diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml deleted file mode 100644 index 65635e0c3..000000000 --- a/.github/workflows/docker-image.yml +++ /dev/null @@ -1,40 +0,0 @@ -name: Docker Image CI - -on: - push: - branches: [ master ] - -jobs: - - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Build the Docker image - run: mvn clean package -Pdev -DskipTests -U -e && /bin/cp -rf powerjob-server/powerjob-server-starter/target/*.jar powerjob-server/docker/powerjob-server.jar && /bin/cp -rf powerjob-worker-agent/target/*.jar powerjob-worker-agent/powerjob-agent.jar && /bin/cp -rf powerjob-worker-samples/target/*.jar powerjob-worker-samples/powerjob-worker-samples.jar - - uses: docker/build-push-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: tjqq/powerjob-server - tag_with_ref: true - tags: latest - path: powerjob-server/docker/ - - uses: docker/build-push-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: tjqq/powerjob-agent - tag_with_ref: true - tags: latest - path: powerjob-worker-agent/ - - uses: docker/build-push-action@v1 - with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKER_PASSWORD }} - repository: tjqq/powerjob-worker-samples - tag_with_ref: true - tags: latest - path: powerjob-worker-samples/ \ No newline at end of file diff --git a/.github/workflows/docker_publish.yml b/.github/workflows/docker_publish.yml new file mode 100644 index 000000000..f9ec57142 --- /dev/null +++ b/.github/workflows/docker_publish.yml @@ -0,0 +1,68 @@ +name: build_docker + +on: + push: + tags: + - 'v*' # Push events to matching v*, i.e. v1.0, v20.15.10 + +jobs: + build_docker: + name: Build docker + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Build Maven Project + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + - name: Publish package + run: mvn clean package -Pdev -DskipTests -U -e && /bin/cp -rf powerjob-server/powerjob-server-starter/target/*.jar powerjob-server/docker/powerjob-server.jar && /bin/cp -rf powerjob-worker-agent/target/*.jar powerjob-worker-agent/powerjob-agent.jar && /bin/cp -rf powerjob-worker-samples/target/*.jar powerjob-worker-samples/powerjob-worker-samples.jar + + # Login + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKER_USERNAME }} + password: ${{ secrets.DOCKER_PASSWORD }} + + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Build And Push [powerjob-server] + uses: docker/build-push-action@v6 + with: + context: powerjob-server/docker/ + push: true + platforms: linux/amd64,linux/arm64 + tags: | + tjqq/powerjob-server:latest + powerjob/powerjob-server:latest + tjqq/powerjob-server:${{ github.ref_name }} + powerjob/powerjob-server:${{ github.ref_name }} + + - name: Build And Push [powerjob-agent] + uses: docker/build-push-action@v6 + with: + context: powerjob-worker-agent/ + push: true + platforms: linux/amd64,linux/arm64 + tags: | + tjqq/powerjob-agent:latest + powerjob/powerjob-agent:latest + tjqq/powerjob-agent:${{ github.ref_name }} + powerjob/powerjob-agent:${{ github.ref_name }} + + - name: Build And Push [powerjob-worker-samples] + uses: docker/build-push-action@v6 + with: + context: powerjob-worker-samples/ + push: true + platforms: linux/amd64,linux/arm64 + tags: | + tjqq/powerjob-worker-samples:latest + powerjob/powerjob-worker-samples:latest + tjqq/powerjob-worker-samples:${{ github.ref_name }} + powerjob/powerjob-worker-samples:${{ github.ref_name }} diff --git a/.github/workflows/maven.yml b/.github/workflows/maven.yml deleted file mode 100644 index c2f999717..000000000 --- a/.github/workflows/maven.yml +++ /dev/null @@ -1,38 +0,0 @@ -# This workflow will build a Java project with Maven -# For more information see: https://help.github.com/actions/language-and-framework-guides/building-and-testing-java-with-maven - -name: Java CI with Maven - -on: - push: - branches: [ master ] - pull_request: - branches: [ master ] - -jobs: - build: - - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v2 - - name: Set up JDK 1.8 - uses: actions/setup-java@v1 - with: - java-version: 1.8 - - name: Build with Maven - run: mvn -B clean package -Pdev -DskipTests --file pom.xml - - name: upload build result - run: mkdir staging && cp powerjob-server/powerjob-server-starter/target/*.jar staging/powerjob-server.jar && cp powerjob-client/target/*.jar staging/powerjob-client.jar && cp powerjob-worker-agent/target/*.jar staging/powerjob-agent.jar - - uses: actions/upload-artifact@v1 - with: - name: powerjob-server.jar - path: staging/powerjob-server.jar - - uses: actions/upload-artifact@v1 - with: - name: powerjob-client.jar - path: staging/powerjob-client.jar - - uses: actions/upload-artifact@v1 - with: - name: powerjob-agent.jar - path: staging/powerjob-agent.jar diff --git a/.github/workflows/maven_build.yml b/.github/workflows/maven_build.yml new file mode 100644 index 000000000..f0042b9a0 --- /dev/null +++ b/.github/workflows/maven_build.yml @@ -0,0 +1,28 @@ +# This workflow will build a Java project with Maven +# For more information see: https://docs.github.com/zh/actions/use-cases-and-examples/building-and-testing/building-and-testing-java-with-maven + +name: Java CI with Maven + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + build: + + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + - run: mvn -B clean package -Pdev -DskipTests --file pom.xml + - run: mkdir staging && cp powerjob-server/powerjob-server-starter/target/*.jar staging/powerjob-server.jar && cp powerjob-client/target/*.jar staging/powerjob-client.jar && cp powerjob-worker-agent/target/*.jar staging/powerjob-agent.jar && cp powerjob-worker-spring-boot-starter/target/*.jar staging/powerjob-worker-spring-boot-starter.jar + - uses: actions/upload-artifact@v4 + with: + name: Package + path: staging + diff --git a/.github/workflows/maven_publish.yml b/.github/workflows/maven_publish.yml new file mode 100644 index 000000000..f374635a7 --- /dev/null +++ b/.github/workflows/maven_publish.yml @@ -0,0 +1,22 @@ +name: Publish package to the Maven Central Repository +on: + release: + types: [created] +jobs: + publish: + runs-on: ubuntu-latest + steps: + - uses: actions/checkout@v4 + - name: Set up Maven Central Repository + uses: actions/setup-java@v4 + with: + java-version: '8' + distribution: 'temurin' + server-id: ossrh + server-username: MAVEN_USERNAME + server-password: MAVEN_PASSWORD + - name: Publish package + run: mvn --batch-mode clean deploy -pl powerjob-worker,powerjob-client,powerjob-worker-spring-boot-starter,powerjob-official-processors,powerjob-worker-agent -DskipTests -Prelease -am + env: + MAVEN_USERNAME: ${{ secrets.OSSRH_USERNAME }} + MAVEN_PASSWORD: ${{ secrets.OSSRH_TOKEN }} diff --git a/.gitignore b/.gitignore index af4044503..b63852e16 100644 --- a/.gitignore +++ b/.gitignore @@ -42,4 +42,8 @@ build/ */.phd */.txt */.trc -powerjob-data/ \ No newline at end of file +powerjob-data/ + +powerjob-server/powerjob-server-starter/src/main/resources/application-dev.properties +.claude/** +CLAUDE.md \ No newline at end of file diff --git a/docker-compose.yml b/docker-compose.yml index b7986a589..95844cf31 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -30,6 +30,7 @@ services: - "7700:7700" - "10086:10086" - "10010:10010" + - "10077:10077" volumes: - ./powerjob-data/powerjob-server:/root/powerjob/server/ diff --git a/others/dev/build_test_env.sh b/others/dev/build_test_env.sh index 7ec7486d9..87c739977 100755 --- a/others/dev/build_test_env.sh +++ b/others/dev/build_test_env.sh @@ -3,6 +3,8 @@ echo "================== 关闭全部服务 ==================" docker-compose down +echo "================== 删除历史数据 ==================" +rm -rf ~/powerjob-data/ echo "================== 构建 jar ==================" cd `dirname $0`/../.. || exit # mvn clean package -Pdev -DskipTests -U -e -pl powerjob-server,powerjob-worker-agent -am @@ -16,4 +18,4 @@ ls -l powerjob-worker-agent/powerjob-agent.jar cd others/dev docker-compose build -docker-compose --compatibility up \ No newline at end of file +docker-compose --compatibility -p powerjob_test_env up \ No newline at end of file diff --git a/others/dev/docker-compose.yml b/others/dev/docker-compose.yml index 3f1b9bdbc..11fb64757 100644 --- a/others/dev/docker-compose.yml +++ b/others/dev/docker-compose.yml @@ -11,7 +11,7 @@ services: deploy: resources: limits: - memory: 768M + memory: 1024M restart: always container_name: powerjob-mysql image: powerjob/powerjob-mysql:test_env @@ -20,43 +20,40 @@ services: volumes: - ~/powerjob-data/powerjob-mysql:/var/lib/mysql command: --lower_case_table_names=1 -# powerjob-mongodb: -# image: mongo:latest -# container_name: powerjob-mongodb -# restart: always -# deploy: -# resources: -# limits: -# memory: 256M -# environment: -# MONGO_INITDB_ROOT_USERNAME: "root" -# MONGO_INITDB_ROOT_PASSWORD: "No1Bug2Please3!" -# MONGO_INITDB_DATABASE: "powerjob_daily" -# ports: -# - "27017:27017" -# volumes: -# - ./testenv/init_mongodb.js:/docker-entrypoint-initdb.d/mongo-init.js:ro -# - ~/powerjob-data/powerjob-mongodb:/data/db + # powerjob-mongodb: + # image: mongo:latest + # container_name: powerjob-mongodb + # restart: always + # deploy: + # resources: + # limits: + # memory: 256M + # environment: + # MONGO_INITDB_ROOT_USERNAME: "root" + # MONGO_INITDB_ROOT_PASSWORD: "No1Bug2Please3!" + # MONGO_INITDB_DATABASE: "powerjob_daily" + # ports: + # - "27017:27017" + # volumes: + # - ./testenv/init_mongodb.js:/docker-entrypoint-initdb.d/mongo-init.js:ro + # - ~/powerjob-data/powerjob-mongodb:/data/db powerjob-server: build: context: ../../powerjob-server/docker - deploy: - resources: - limits: - memory: 896M container_name: powerjob-server image: powerjob/powerjob-server:test_env restart: always depends_on: - powerjob-mysql -# - powerjob-mongodb + # - powerjob-mongodb environment: - PARAMS: "--spring.profiles.active=daily --spring.datasource.core.jdbc-url=jdbc:mysql://powerjob-mysql:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai --oms.storage.dfs.mysql_series.url=jdbc:mysql://powerjob-mysql:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai" - JVMOPTIONS: "-server -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/powerjob/server/gc.log" + PARAMS: "--spring.profiles.active=daily --logging.config=classpath:logback-product.xml --spring.datasource.core.jdbc-url=jdbc:mysql://powerjob-mysql:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai --oms.storage.dfs.mysql_series.url=jdbc:mysql://powerjob-mysql:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai" + JVMOPTIONS: "-server -XX:+UseG1GC -Xms768m -Xmx768m -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/powerjob/server/gc.log -Dpowerjob.sp-env=trial -Dpowerjob.server.test.user.accounts=powerjob" ports: - "7700:7700" - "10086:10086" - "10010:10010" + - "10077:10077" volumes: - ~/powerjob-data/powerjob-server:/root/powerjob/server/ - ~/.m2:/root/.m2 @@ -64,10 +61,6 @@ services: powerjob-worker-agent: build: context: ../../powerjob-worker-agent - deploy: - resources: - limits: - memory: 384M container_name: powerjob-worker-agent image: powerjob/powerjob-worker-agent:test_env restart: always @@ -83,13 +76,9 @@ services: entrypoint: - "sh" - "-c" - - "./wait-for-it.sh powerjob-server:7700 --strict -- java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10000 -Dcom.sun.management.jmxremote.rmi.port=10000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -server -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/gc.log -jar /powerjob-agent.jar --app powerjob-worker-samples --server powerjob-server:7700" + - "./wait-for-it.sh powerjob-server:7700 --strict -- java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10000 -Dcom.sun.management.jmxremote.rmi.port=10000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -server -XX:+UseG1GC -Xms256m -Xmx256m -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/gc.log -jar /powerjob-agent.jar --app powerjob-worker-samples --server powerjob-server:7700" powerjob-worker-agent2: - deploy: - resources: - limits: - memory: 384M container_name: powerjob-worker-agent2 image: powerjob/powerjob-worker-agent:test_env restart: always @@ -105,5 +94,9 @@ services: entrypoint: - "sh" - "-c" - - "./wait-for-it.sh powerjob-server:7700 --strict -- java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10000 -Dcom.sun.management.jmxremote.rmi.port=10000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -server -XX:+UseG1GC -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/gc.log -jar /powerjob-agent.jar --app powerjob-worker-samples --server powerjob-server:7700" + - "./wait-for-it.sh powerjob-server:7700 --strict -- java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10000 -Dcom.sun.management.jmxremote.rmi.port=10000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false -server -XX:+UseG1GC -Xms256m -Xmx256m -XX:+PrintGCDetails -XX:+PrintGCDateStamps -XX:+UseGCLogFileRotation -XX:NumberOfGCLogFiles=7 -XX:GCLogFileSize=100M -Xloggc:/root/gc.log -jar /powerjob-agent.jar --app powerjob-worker-samples --server powerjob-server:7700" +networks: + powerjob_test_env_network: + driver: bridge + name: powerjob_test_env_network \ No newline at end of file diff --git a/others/dev/publish_docker.sh b/others/dev/publish_docker.sh index 7b3da88eb..acf6b78be 100755 --- a/others/dev/publish_docker.sh +++ b/others/dev/publish_docker.sh @@ -90,7 +90,7 @@ if [ "$startup" = "y" ] || [ "$startup" = "Y" ]; then echo "================== 准备启动 powerjob-server ==================" docker run -d \ --name powerjob-server \ - -p 7700:7700 -p 10086:10086 -p 10010:10010 -p 5001:5005 -p 10001:10000 \ + -p 7700:7700 -p 10086:10086 -p 10010:10010 -p 10077:10077 -p 5001:5005 -p 10001:10000 \ -e JVMOPTIONS="-agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=5005 -Dcom.sun.management.jmxremote -Dcom.sun.management.jmxremote.port=10000 -Dcom.sun.management.jmxremote.rmi.port=10000 -Dcom.sun.management.jmxremote.authenticate=false -Dcom.sun.management.jmxremote.ssl=false" \ -e PARAMS="--spring.profiles.active=pre" \ -e TZ="Asia/Shanghai" \ diff --git a/others/dev/publish_docker_apple_silicon.sh b/others/dev/publish_docker_apple_silicon.sh new file mode 100755 index 000000000..5f37bbe31 --- /dev/null +++ b/others/dev/publish_docker_apple_silicon.sh @@ -0,0 +1,71 @@ +#!/bin/bash +echo "A docker image release script for the Apple Silicon device." +# -p:允许后面跟一个字符串作为提示 -r:保证读入的是原始内容,不会发生任何转义 +read -r -p "请输入Dockedr镜像版本:" version +echo "即将构建的 server 镜像:powerjob-server:$version" +echo "即将构建的 agent 镜像:powerjob-agent:$version" +read -r -p "任意键继续:" + +# 一键部署脚本,请勿挪动脚本 +cd `dirname $0`/../.. || exit + +read -r -p "是否进行maven构建(y/n):" needmvn +if [ "$needmvn" = "y" ] || [ "$needmvn" = "Y" ]; then + echo "================== 构建 jar ==================" + # mvn clean package -Pdev -DskipTests -U -e -pl powerjob-server,powerjob-worker-agent -am + # -U:强制检查snapshot库 -pl:指定需要构建的模块,多模块逗号分割 -am:同时构建依赖模块,一般与pl连用 -Pxxx:指定使用的配置文件 + mvn clean package -Pdev -DskipTests -U -e + echo "================== 拷贝 jar ==================" + /bin/cp -rf powerjob-server/powerjob-server-starter/target/*.jar powerjob-server/docker/powerjob-server.jar + /bin/cp -rf powerjob-worker-agent/target/*.jar powerjob-worker-agent/powerjob-agent.jar + ls -l powerjob-server/docker/powerjob-server.jar + ls -l powerjob-worker-agent/powerjob-agent.jar +fi + +echo "================== 关闭老应用 ==================" +docker stop powerjob-server +docker stop powerjob-agent +docker stop powerjob-agent2 +echo "================== 删除老容器 ==================" +docker container rm powerjob-server +docker container rm powerjob-agent +docker container rm powerjob-agent2 +read -r -p "是否构建并发布镜像(y/n):" rebuild +if [ "$rebuild" = "y" ] || [ "$rebuild" = "Y" ]; then + echo "================== 删除旧镜像 ==================" + docker rmi -f tjqq/powerjob-server:$version + docker rmi -f powerjob/powerjob-server:$version + docker rmi -f tjqq/powerjob-agent:$version + docker rmi -f powerjob/powerjob-agent:$version + docker rmi -f powerjob/powerjob-mysql:$version + docker rmi -f powerjob/powerjob-worker-samples:$version + echo "================== 构建 powerjob-server 镜像(tjqq) ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag tjqq/powerjob-server:$version powerjob-server/docker/. --push || exit + echo "================== 构建 powerjob-server 镜像(powerjob) ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag powerjob/powerjob-server:$version powerjob-server/docker/. --push || exit + echo "================== 构建 powerjob-agent 镜像(tjqq) ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag tjqq/powerjob-agent:$version powerjob-worker-agent/. --push|| exit + echo "================== 构建 powerjob-agent 镜像(powerjob) ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag powerjob/powerjob-agent:$version powerjob-worker-agent/. --push|| exit + echo "================== 构建 powerjob-mysql 镜像 ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag powerjob/powerjob-mysql:$version others/. --push|| exit + echo "================== 构建 powerjob-worker-samples 镜像 ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag powerjob/powerjob-worker-samples:$version powerjob-worker-samples/. --push|| exit +fi + +read -r -p "是否推送LATEST(y/n):" push_latest +if [ "$push_latest" = "y" ] || [ "$push_latest" = "Y" ]; then + + echo "================== powerjob-server LATEST (tjqq) ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag tjqq/powerjob-server:latest powerjob-server/docker/. --push || exit + echo "================== powerjob-server LATEST (powerjob) ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag powerjob/powerjob-server:latest powerjob-server/docker/. --push || exit + echo "================== powerjob-agent LATEST (tjqq) ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag tjqq/powerjob-agent:latest powerjob-worker-agent/. --push|| exit + echo "================== powerjob-agent LATEST (powerjob) ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag powerjob/powerjob-agent:latest powerjob-worker-agent/. --push|| exit + echo "================== powerjob-mysql LATEST ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag powerjob/powerjob-mysql:latest others/. --push|| exit + echo "================== powerjob-worker-samples LATEST ==================" + docker buildx build --platform=linux/amd64,linux/arm64 --tag powerjob/powerjob-worker-samples:latest powerjob-worker-samples/. --push|| exit +fi \ No newline at end of file diff --git a/others/powerjob-mysql.sql b/others/powerjob-mysql.sql index fec1d2ff7..bc43a1141 100644 --- a/others/powerjob-mysql.sql +++ b/others/powerjob-mysql.sql @@ -1,3 +1,24 @@ +/* +官方 SQL 仅基于特定版本(MySQL8)导出,不一定兼容其他数据库,也不一定兼容其他版本。此 SQL 仅供参考。 +如果您的数据库无法使用此 SQL,建议使用 SpringDataJPA 自带的建表能力,先在开发环境直连测试库自动建表,然后自行导出相关的 SQL 即可。 + */ + +/* + Navicat Premium Data Transfer + + Source Server : Local@3306 + Source Server Type : MySQL + Source Server Version : 80300 (8.3.0) + Source Host : localhost:3306 + Source Schema : powerjob5g + + Target Server Type : MySQL + Target Server Version : 80300 (8.3.0) + File Encoding : 65001 + + Date: 17/08/2025 21:58:30 +*/ + SET NAMES utf8mb4; SET FOREIGN_KEY_CHECKS = 0; @@ -5,260 +26,307 @@ SET FOREIGN_KEY_CHECKS = 0; -- Table structure for app_info -- ---------------------------- DROP TABLE IF EXISTS `app_info`; -CREATE TABLE `app_info` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '应用ID', - `app_name` varchar(128) not NULL COMMENT '应用名称', - `current_server` varchar(255) default null COMMENT 'Server地址,用于负责调度应用的ActorSystem地址', - `gmt_create` datetime not null COMMENT '创建时间', - `gmt_modified` datetime not null COMMENT '更新时间', - `password` varchar(255) not null COMMENT '应用密码', - PRIMARY KEY (`id`), - UNIQUE KEY `uidx01_app_info` (`app_name`) -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='应用表'; +CREATE TABLE `app_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_name` varchar(255) DEFAULT NULL, + `creator` bigint DEFAULT NULL, + `current_server` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `modifier` bigint DEFAULT NULL, + `namespace_id` bigint DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `tags` varchar(255) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_app_info` (`app_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for container_info -- ---------------------------- - DROP TABLE IF EXISTS `container_info`; -CREATE TABLE `container_info` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '容器ID', - `app_id` bigint not null COMMENT '应用ID', - `container_name` varchar(128) not null COMMENT '容器名称', - `gmt_create` datetime not null COMMENT '创建时间', - `gmt_modified` datetime not null COMMENT '更新时间', - `last_deploy_time` datetime DEFAULT NULL COMMENT '上次部署时间', - `source_info` varchar(255) DEFAULT NULL COMMENT '资源信息,内容取决于source_type\n1、FatJar -> String\n2、Git -> JSON,{"repo”:””仓库,”branch”:”分支”,”username”:”账号,”password”:”密码”}', - `source_type` int not null COMMENT '资源类型,1:FatJar/2:Git', - `status` int not null COMMENT '状态,1:正常ENABLE/2:已禁用DISABLE/99:已删除DELETED', - `version` varchar(255) default null COMMENT '版本', - PRIMARY KEY (`id`), - KEY `idx01_container_info` (`app_id`) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='容器表'; +CREATE TABLE `container_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `container_name` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `last_deploy_time` datetime(6) DEFAULT NULL, + `source_info` varchar(255) DEFAULT NULL, + `source_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `version` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_container_info` (`app_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for instance_info -- ---------------------------- DROP TABLE IF EXISTS `instance_info`; -CREATE TABLE `instance_info` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '任务实例ID', - `app_id` bigint not null COMMENT '应用ID', - `instance_id` bigint not null COMMENT '任务实例ID', - `type` int not NULL COMMENT '任务实例类型,1:普通NORMAL/2:工作流WORKFLOW', - `job_id` bigint not NULL COMMENT '任务ID', - `instance_params` longtext COMMENT '任务动态参数', - `job_params` longtext COMMENT '任务静态参数', - `actual_trigger_time` bigint default NULL COMMENT '实际触发时间', - `expected_trigger_time` bigint DEFAULT NULL COMMENT '计划触发时间', - `finished_time` bigint DEFAULT NULL COMMENT '执行结束时间', - `last_report_time` bigint DEFAULT NULL COMMENT '最后上报时间', - `result` longtext COMMENT '执行结果', - `running_times` bigint DEFAULT NULL COMMENT '总执行次数,用于重试判断', - `status` int not NULL COMMENT '任务状态,1:等待派发WAITING_DISPATCH/2:等待Worker接收WAITING_WORKER_RECEIVE/3:运行中RUNNING/4:失败FAILED/5:成功SUCCEED/9:取消CANCELED/10:手动停止STOPPED', - `task_tracker_address` varchar(255) DEFAULT NULL COMMENT 'TaskTracker地址', - `wf_instance_id` bigint DEFAULT NULL COMMENT '工作流实例ID', - `additional_data` longtext comment '附加信息 (JSON)', - `gmt_create` datetime not NULL COMMENT '创建时间', - `gmt_modified` datetime not NULL COMMENT '更新时间', - PRIMARY KEY (`id`), - KEY `idx01_instance_info` (`job_id`, `status`), - KEY `idx02_instance_info` (`app_id`, `status`), - KEY `idx03_instance_info` (`instance_id`, `status`) -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='任务实例表'; +CREATE TABLE `instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `expected_trigger_time` bigint DEFAULT NULL, + `extend_value` varchar(255) DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_id` bigint DEFAULT NULL, + `instance_params` longtext, + `job_id` bigint DEFAULT NULL, + `job_params` longtext, + `last_report_time` bigint DEFAULT NULL, + `meta` varchar(255) DEFAULT NULL, + `outer_key` varchar(255) DEFAULT NULL, + `result` longtext, + `running_times` bigint DEFAULT NULL, + `status` int DEFAULT NULL, + `task_tracker_address` varchar(255) DEFAULT NULL, + `type` int DEFAULT NULL, + `wf_instance_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_instance_info` (`job_id`,`status`), + KEY `idx02_instance_info` (`app_id`,`status`), + KEY `idx03_instance_info` (`instance_id`,`status`), + KEY `idx04_instance_info_outer_key` (`outer_key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for job_info -- ---------------------------- DROP TABLE IF EXISTS `job_info`; -CREATE TABLE `job_info` -( - `id` bigint NOT NULL AUTO_INCREMENT, - `app_id` bigint DEFAULT NULL COMMENT '应用ID', - `job_name` varchar(128) DEFAULT NULL COMMENT '任务名称', - `job_description` varchar(255) DEFAULT NULL COMMENT '任务描述', - `job_params` text COMMENT '任务默认参数', - `concurrency` int DEFAULT NULL COMMENT '并发度,同时执行某个任务的最大线程数量', - `designated_workers` varchar(255) DEFAULT NULL COMMENT '运行节点,空:不限(多值逗号分割)', - `dispatch_strategy` int DEFAULT NULL COMMENT '投递策略,1:健康优先/2:随机', - `execute_type` int not NULL COMMENT '执行类型,1:单机STANDALONE/2:广播BROADCAST/3:MAP_REDUCE/4:MAP', - `instance_retry_num` int not null DEFAULT 0 COMMENT 'Instance重试次数', - `instance_time_limit` bigint not null DEFAULT 0 COMMENT '任务整体超时时间', - `lifecycle` varchar(255) DEFAULT NULL COMMENT '生命周期', - `max_instance_num` int not null DEFAULT 1 COMMENT '最大同时运行任务数,默认 1', - `max_worker_count` int not null DEFAULT 0 COMMENT '最大运行节点数量', - `min_cpu_cores` double NOT NULL default 0 COMMENT '最低CPU核心数量,0:不限', - `min_disk_space` double NOT NULL default 0 COMMENT '最低磁盘空间(GB),0:不限', - `min_memory_space` double NOT NULL default 0 COMMENT '最低内存空间(GB),0:不限', - `next_trigger_time` bigint DEFAULT NULL COMMENT '下一次调度时间', - `notify_user_ids` varchar(255) DEFAULT NULL COMMENT '报警用户(多值逗号分割)', - `processor_info` varchar(255) DEFAULT NULL COMMENT '执行器信息', - `processor_type` int not NULL COMMENT '执行器类型,1:内建处理器BUILT_IN/2:SHELL/3:PYTHON/4:外部处理器(动态加载)EXTERNAL', - `status` int not NULL COMMENT '状态,1:正常ENABLE/2:已禁用DISABLE/99:已删除DELETED', - `task_retry_num` int not NULL default 0 COMMENT 'Task重试次数', - `time_expression` varchar(255) default NULL COMMENT '时间表达式,内容取决于time_expression_type,1:CRON/2:NULL/3:LONG/4:LONG', - `time_expression_type` int not NULL COMMENT '时间表达式类型,1:CRON/2:API/3:FIX_RATE/4:FIX_DELAY,5:WORKFLOW\n)', - `tag` varchar(255) DEFAULT NULL COMMENT 'TAG', - `log_config` varchar(255) DEFAULT NULL COMMENT '日志配置', - `extra` varchar(255) DEFAULT NULL COMMENT '扩展字段', - `gmt_create` datetime not NULL COMMENT '创建时间', - `gmt_modified` datetime not NULL COMMENT '更新时间', - PRIMARY KEY (`id`), - KEY `idx01_job_info` (`app_id`, `status`, `time_expression_type`, `next_trigger_time`) -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='任务表'; +CREATE TABLE `job_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `advanced_runtime_config` varchar(255) DEFAULT NULL, + `alarm_config` varchar(255) DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `concurrency` int DEFAULT NULL, + `designated_workers` varchar(255) DEFAULT NULL, + `dispatch_strategy` int DEFAULT NULL, + `dispatch_strategy_config` varchar(255) DEFAULT NULL, + `execute_type` int DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_retry_num` int DEFAULT NULL, + `instance_time_limit` bigint DEFAULT NULL, + `job_description` varchar(255) DEFAULT NULL, + `job_name` varchar(255) DEFAULT NULL, + `job_params` longtext, + `lifecycle` varchar(255) DEFAULT NULL, + `log_config` varchar(255) DEFAULT NULL, + `max_instance_num` int DEFAULT NULL, + `max_worker_count` int DEFAULT NULL, + `min_cpu_cores` double NOT NULL, + `min_disk_space` double NOT NULL, + `min_memory_space` double NOT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `processor_info` varchar(255) DEFAULT NULL, + `processor_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `tag` varchar(255) DEFAULT NULL, + `task_retry_num` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_job_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for namespace +-- ---------------------------- +DROP TABLE IF EXISTS `namespace`; +CREATE TABLE `namespace` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `code` varchar(255) DEFAULT NULL, + `creator` bigint DEFAULT NULL, + `dept` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `modifier` bigint DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `status` int DEFAULT NULL, + `tags` varchar(255) DEFAULT NULL, + `token` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_namespace` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for oms_lock -- ---------------------------- DROP TABLE IF EXISTS `oms_lock`; -CREATE TABLE `oms_lock` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '序号ID', - `lock_name` varchar(128) DEFAULT NULL COMMENT '名称', - `max_lock_time` bigint DEFAULT NULL COMMENT '最长持锁时间', - `ownerip` varchar(255) DEFAULT NULL COMMENT '拥有者IP', - `gmt_create` datetime not NULL COMMENT '创建时间', - `gmt_modified` datetime not NULL COMMENT '更新时间', - PRIMARY KEY (`id`), - UNIQUE KEY `uidx01_oms_lock` (`lock_name`) -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='数据库锁'; +CREATE TABLE `oms_lock` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lock_name` varchar(255) DEFAULT NULL, + `max_lock_time` bigint DEFAULT NULL, + `ownerip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_oms_lock` (`lock_name`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for pwjb_user_info +-- ---------------------------- +DROP TABLE IF EXISTS `pwjb_user_info`; +CREATE TABLE `pwjb_user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for server_info -- ---------------------------- DROP TABLE IF EXISTS `server_info`; -CREATE TABLE `server_info` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '服务器ID', - `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', - `gmt_modified` datetime DEFAULT NULL COMMENT '更新时间', - `ip` varchar(128) DEFAULT NULL COMMENT '服务器IP地址', - PRIMARY KEY (`id`), - UNIQUE KEY `uidx01_server_info` (`ip`), - KEY `idx01_server_info` (`gmt_modified`) -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='服务器表'; +CREATE TABLE `server_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `ip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_server_info` (`ip`), + KEY `idx01_server_info` (`gmt_modified`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for sundry +-- ---------------------------- +DROP TABLE IF EXISTS `sundry`; +CREATE TABLE `sundry` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `content` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `pkey` varchar(255) DEFAULT NULL, + `skey` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_sundry` (`pkey`,`skey`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for user_info -- ---------------------------- DROP TABLE IF EXISTS `user_info`; -CREATE TABLE `user_info` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '用户ID', - `username` varchar(128) not NULL COMMENT '用户名', - `password` varchar(255) default NULL COMMENT '密码', - `phone` varchar(255) DEFAULT NULL COMMENT '手机号', - `email` varchar(128) not NULL COMMENT '邮箱', - `extra` varchar(255) DEFAULT NULL COMMENT '扩展字段', - `web_hook` varchar(255) DEFAULT NULL COMMENT 'webhook地址', - `gmt_create` datetime not NULL COMMENT '创建时间', - `gmt_modified` datetime not NULL COMMENT '更新时间', - PRIMARY KEY (`id`), - unique index uidx01_user_info (username), - unique index uidx02_user_info (email) -) ENGINE = InnoDB - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='用户表'; +CREATE TABLE `user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `account_type` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `nick` varchar(255) DEFAULT NULL, + `origin_username` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `phone` varchar(255) DEFAULT NULL, + `status` int DEFAULT NULL, + `token_login_verify_info` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + `web_hook` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_user_name` (`username`), + KEY `uidx02_user_info` (`email`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for user_role +-- ---------------------------- +DROP TABLE IF EXISTS `user_role`; +CREATE TABLE `user_role` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `role` int DEFAULT NULL, + `scope` int DEFAULT NULL, + `target` bigint DEFAULT NULL, + `user_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `uidx01_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for workflow_info -- ---------------------------- DROP TABLE IF EXISTS `workflow_info`; -CREATE TABLE `workflow_info` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '工作流ID', - `app_id` bigint not NULL COMMENT '应用ID', - `wf_name` varchar(128) not NULL COMMENT '工作流名称', - `wf_description` varchar(255) default NULL COMMENT '工作流描述', - `extra` varchar(255) DEFAULT NULL COMMENT '扩展字段', - `lifecycle` varchar(255) DEFAULT NULL COMMENT '生命周期', - `max_wf_instance_num` int not null DEFAULT 1 COMMENT '最大运行工作流数量,默认 1', - `next_trigger_time` bigint DEFAULT NULL COMMENT '下次调度时间', - `notify_user_ids` varchar(255) DEFAULT NULL COMMENT '报警用户(多值逗号分割)', - `pedag` text COMMENT 'DAG信息(JSON)', - `status` int not NULL COMMENT '状态,1:正常ENABLE/2:已禁用DISABLE/99:已删除DELETED', - `time_expression` varchar(255) DEFAULT NULL COMMENT '时间表达式,内容取决于time_expression_type,1:CRON/2:NULL/3:LONG/4:LONG', - `time_expression_type` int not NULL COMMENT '时间表达式类型,1:CRON/2:API/3:FIX_RATE/4:FIX_DELAY,5:WORKFLOW\n)', - `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', - `gmt_modified` datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`), - KEY `idx01_workflow_info` (`app_id`, `status`, `time_expression_type`, next_trigger_time) -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='工作流表'; +CREATE TABLE `workflow_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lifecycle` varchar(255) DEFAULT NULL, + `max_wf_instance_num` int DEFAULT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `pedag` longtext, + `status` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + `wf_description` varchar(255) DEFAULT NULL, + `wf_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for workflow_instance_info -- ---------------------------- DROP TABLE IF EXISTS `workflow_instance_info`; -CREATE TABLE `workflow_instance_info` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '工作流实例ID', - `wf_instance_id` bigint DEFAULT NULL COMMENT '工作流实例ID', - `workflow_id` bigint DEFAULT NULL COMMENT '工作流ID', - `actual_trigger_time` bigint DEFAULT NULL COMMENT '实际触发时间', - `app_id` bigint DEFAULT NULL COMMENT '应用ID', - `dag` text COMMENT 'DAG信息(JSON)', - `expected_trigger_time` bigint DEFAULT NULL COMMENT '计划触发时间', - `finished_time` bigint DEFAULT NULL COMMENT '执行结束时间', - `result` text COMMENT '执行结果', - `status` int DEFAULT NULL COMMENT '工作流实例状态,1:等待调度WAITING/2:运行中RUNNING/3:失败FAILED/4:成功SUCCEED/10:手动停止STOPPED', - `wf_context` text COMMENT '工作流上下文', - `wf_init_params` text COMMENT '工作流启动参数', - `gmt_create` datetime DEFAULT NULL COMMENT '创建时间', - `gmt_modified` datetime DEFAULT NULL COMMENT '更新时间', - PRIMARY KEY (`id`), - unique index uidx01_wf_instance (`wf_instance_id`), - index idx01_wf_instance (`workflow_id`, `status`), - index idx02_wf_instance (`app_id`, `status`, `expected_trigger_time`) -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='工作流实例表'; +CREATE TABLE `workflow_instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `dag` longtext, + `expected_trigger_time` bigint DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `parent_wf_instance_id` bigint DEFAULT NULL, + `result` longtext, + `status` int DEFAULT NULL, + `wf_context` longtext, + `wf_init_params` longtext, + `wf_instance_id` bigint DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_wf_instance` (`wf_instance_id`), + KEY `idx01_wf_instance` (`workflow_id`,`status`,`app_id`,`expected_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; -- ---------------------------- -- Table structure for workflow_node_info -- ---------------------------- DROP TABLE IF EXISTS `workflow_node_info`; -CREATE TABLE `workflow_node_info` -( - `id` bigint NOT NULL AUTO_INCREMENT COMMENT '节点ID', - `app_id` bigint NOT NULL COMMENT '应用ID', - `enable` bit(1) NOT NULL COMMENT '是否启动,0:否/1:是', - `extra` text COMMENT '扩展字段', - `gmt_create` datetime NOT NULL COMMENT '创建时间', - `gmt_modified` datetime NOT NULL COMMENT '更新时间', - `job_id` bigint default NULL COMMENT '任务ID', - `node_name` varchar(255) DEFAULT NULL COMMENT '节点名称', - `node_params` text COMMENT '节点参数', - `skip_when_failed` bit(1) NOT NULL COMMENT '是否允许失败跳过,0:否/1:是', - `type` int DEFAULT NULL COMMENT '节点类型,1:任务JOB', - `workflow_id` bigint DEFAULT NULL COMMENT '工作流ID', - PRIMARY KEY (`id`), - KEY `idx01_workflow_node_info` (`workflow_id`,`gmt_create`) -) ENGINE = InnoDB - AUTO_INCREMENT = 1 - DEFAULT CHARSET = utf8mb4 - COLLATE = utf8mb4_general_ci COMMENT ='工作流节点表'; +CREATE TABLE `workflow_node_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint NOT NULL, + `enable` bit(1) NOT NULL, + `extra` longtext, + `gmt_create` datetime(6) NOT NULL, + `gmt_modified` datetime(6) NOT NULL, + `job_id` bigint DEFAULT NULL, + `node_name` varchar(255) DEFAULT NULL, + `node_params` longtext, + `skip_when_failed` bit(1) NOT NULL, + `type` int DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_node_info` (`workflow_id`,`gmt_create`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; SET FOREIGN_KEY_CHECKS = 1; diff --git a/others/sql/schema/powerjob_mysql_4.3.9.sql b/others/sql/schema/powerjob_mysql_4.3.9.sql new file mode 100644 index 000000000..b6a790c91 --- /dev/null +++ b/others/sql/schema/powerjob_mysql_4.3.9.sql @@ -0,0 +1,243 @@ +/* + Navicat Premium Data Transfer + + Source Server : Local@3306 + Source Server Type : MySQL + Source Server Version : 80300 (8.3.0) + Source Host : localhost:3306 + Source Schema : powerjob4 + + Target Server Type : MySQL + Target Server Version : 80300 (8.3.0) + File Encoding : 65001 + + Date: 02/03/2024 18:51:36 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for app_info +-- ---------------------------- +DROP TABLE IF EXISTS `app_info`; +CREATE TABLE `app_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_name` varchar(255) DEFAULT NULL, + `current_server` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_app_info` (`app_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for container_info +-- ---------------------------- +DROP TABLE IF EXISTS `container_info`; +CREATE TABLE `container_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `container_name` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `last_deploy_time` datetime(6) DEFAULT NULL, + `source_info` varchar(255) DEFAULT NULL, + `source_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `version` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_container_info` (`app_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for instance_info +-- ---------------------------- +DROP TABLE IF EXISTS `instance_info`; +CREATE TABLE `instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `expected_trigger_time` bigint DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_id` bigint DEFAULT NULL, + `instance_params` longtext, + `job_id` bigint DEFAULT NULL, + `job_params` longtext, + `last_report_time` bigint DEFAULT NULL, + `result` longtext, + `running_times` bigint DEFAULT NULL, + `status` int DEFAULT NULL, + `task_tracker_address` varchar(255) DEFAULT NULL, + `type` int DEFAULT NULL, + `wf_instance_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_instance_info` (`job_id`,`status`), + KEY `idx02_instance_info` (`app_id`,`status`), + KEY `idx03_instance_info` (`instance_id`,`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for job_info +-- ---------------------------- +DROP TABLE IF EXISTS `job_info`; +CREATE TABLE `job_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `advanced_runtime_config` varchar(255) DEFAULT NULL, + `alarm_config` varchar(255) DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `concurrency` int DEFAULT NULL, + `designated_workers` varchar(255) DEFAULT NULL, + `dispatch_strategy` int DEFAULT NULL, + `dispatch_strategy_config` varchar(255) DEFAULT NULL, + `execute_type` int DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_retry_num` int DEFAULT NULL, + `instance_time_limit` bigint DEFAULT NULL, + `job_description` varchar(255) DEFAULT NULL, + `job_name` varchar(255) DEFAULT NULL, + `job_params` longtext, + `lifecycle` varchar(255) DEFAULT NULL, + `log_config` varchar(255) DEFAULT NULL, + `max_instance_num` int DEFAULT NULL, + `max_worker_count` int DEFAULT NULL, + `min_cpu_cores` double NOT NULL, + `min_disk_space` double NOT NULL, + `min_memory_space` double NOT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `processor_info` varchar(255) DEFAULT NULL, + `processor_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `tag` varchar(255) DEFAULT NULL, + `task_retry_num` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_job_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for oms_lock +-- ---------------------------- +DROP TABLE IF EXISTS `oms_lock`; +CREATE TABLE `oms_lock` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lock_name` varchar(255) DEFAULT NULL, + `max_lock_time` bigint DEFAULT NULL, + `ownerip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_oms_lock` (`lock_name`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for server_info +-- ---------------------------- +DROP TABLE IF EXISTS `server_info`; +CREATE TABLE `server_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `ip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_server_info` (`ip`), + KEY `idx01_server_info` (`gmt_modified`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for user_info +-- ---------------------------- +DROP TABLE IF EXISTS `user_info`; +CREATE TABLE `user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `email` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `phone` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + `web_hook` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `uidx01_user_info` (`username`), + KEY `uidx02_user_info` (`email`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_info`; +CREATE TABLE `workflow_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lifecycle` varchar(255) DEFAULT NULL, + `max_wf_instance_num` int DEFAULT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `pedag` longtext, + `status` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + `wf_description` varchar(255) DEFAULT NULL, + `wf_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_instance_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_instance_info`; +CREATE TABLE `workflow_instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `dag` longtext, + `expected_trigger_time` bigint DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `parent_wf_instance_id` bigint DEFAULT NULL, + `result` longtext, + `status` int DEFAULT NULL, + `wf_context` longtext, + `wf_init_params` longtext, + `wf_instance_id` bigint DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_wf_instance` (`wf_instance_id`), + KEY `idx01_wf_instance` (`workflow_id`,`status`,`app_id`,`expected_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_node_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_node_info`; +CREATE TABLE `workflow_node_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint NOT NULL, + `enable` bit(1) NOT NULL, + `extra` longtext, + `gmt_create` datetime(6) NOT NULL, + `gmt_modified` datetime(6) NOT NULL, + `job_id` bigint DEFAULT NULL, + `node_name` varchar(255) DEFAULT NULL, + `node_params` longtext, + `skip_when_failed` bit(1) NOT NULL, + `type` int DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_node_info` (`workflow_id`,`gmt_create`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/others/sql/schema/powerjob_mysql_5.0.1.sql b/others/sql/schema/powerjob_mysql_5.0.1.sql new file mode 100644 index 000000000..da04575c8 --- /dev/null +++ b/others/sql/schema/powerjob_mysql_5.0.1.sql @@ -0,0 +1,323 @@ +/* + Navicat Premium Data Transfer + + Source Server : Local@3306 + Source Server Type : MySQL + Source Server Version : 80300 (8.3.0) + Source Host : localhost:3306 + Source Schema : powerjob5 + + Target Server Type : MySQL + Target Server Version : 80300 (8.3.0) + File Encoding : 65001 + + Date: 16/03/2024 22:07:31 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for app_info +-- ---------------------------- +DROP TABLE IF EXISTS `app_info`; +CREATE TABLE `app_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_name` varchar(255) DEFAULT NULL, + `creator` bigint DEFAULT NULL, + `current_server` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `modifier` bigint DEFAULT NULL, + `namespace_id` bigint DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `tags` varchar(255) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_app_info` (`app_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for container_info +-- ---------------------------- +DROP TABLE IF EXISTS `container_info`; +CREATE TABLE `container_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `container_name` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `last_deploy_time` datetime(6) DEFAULT NULL, + `source_info` varchar(255) DEFAULT NULL, + `source_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `version` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_container_info` (`app_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for instance_info +-- ---------------------------- +DROP TABLE IF EXISTS `instance_info`; +CREATE TABLE `instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `expected_trigger_time` bigint DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_id` bigint DEFAULT NULL, + `instance_params` longtext, + `job_id` bigint DEFAULT NULL, + `job_params` longtext, + `last_report_time` bigint DEFAULT NULL, + `result` longtext, + `running_times` bigint DEFAULT NULL, + `status` int DEFAULT NULL, + `task_tracker_address` varchar(255) DEFAULT NULL, + `type` int DEFAULT NULL, + `wf_instance_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_instance_info` (`job_id`,`status`), + KEY `idx02_instance_info` (`app_id`,`status`), + KEY `idx03_instance_info` (`instance_id`,`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for job_info +-- ---------------------------- +DROP TABLE IF EXISTS `job_info`; +CREATE TABLE `job_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `advanced_runtime_config` varchar(255) DEFAULT NULL, + `alarm_config` varchar(255) DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `concurrency` int DEFAULT NULL, + `designated_workers` varchar(255) DEFAULT NULL, + `dispatch_strategy` int DEFAULT NULL, + `dispatch_strategy_config` varchar(255) DEFAULT NULL, + `execute_type` int DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_retry_num` int DEFAULT NULL, + `instance_time_limit` bigint DEFAULT NULL, + `job_description` varchar(255) DEFAULT NULL, + `job_name` varchar(255) DEFAULT NULL, + `job_params` longtext, + `lifecycle` varchar(255) DEFAULT NULL, + `log_config` varchar(255) DEFAULT NULL, + `max_instance_num` int DEFAULT NULL, + `max_worker_count` int DEFAULT NULL, + `min_cpu_cores` double NOT NULL, + `min_disk_space` double NOT NULL, + `min_memory_space` double NOT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `processor_info` varchar(255) DEFAULT NULL, + `processor_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `tag` varchar(255) DEFAULT NULL, + `task_retry_num` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_job_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for namespace +-- ---------------------------- +DROP TABLE IF EXISTS `namespace`; +CREATE TABLE `namespace` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `code` varchar(255) DEFAULT NULL, + `creator` bigint DEFAULT NULL, + `dept` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `modifier` bigint DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `status` int DEFAULT NULL, + `tags` varchar(255) DEFAULT NULL, + `token` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_namespace` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for oms_lock +-- ---------------------------- +DROP TABLE IF EXISTS `oms_lock`; +CREATE TABLE `oms_lock` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lock_name` varchar(255) DEFAULT NULL, + `max_lock_time` bigint DEFAULT NULL, + `ownerip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_oms_lock` (`lock_name`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for pwjb_user_info +-- ---------------------------- +DROP TABLE IF EXISTS `pwjb_user_info`; +CREATE TABLE `pwjb_user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for server_info +-- ---------------------------- +DROP TABLE IF EXISTS `server_info`; +CREATE TABLE `server_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `ip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_server_info` (`ip`), + KEY `idx01_server_info` (`gmt_modified`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for sundry +-- ---------------------------- +DROP TABLE IF EXISTS `sundry`; +CREATE TABLE `sundry` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `content` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `pkey` varchar(255) DEFAULT NULL, + `skey` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_sundry` (`pkey`,`skey`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for user_info +-- ---------------------------- +DROP TABLE IF EXISTS `user_info`; +CREATE TABLE `user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `account_type` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `nick` varchar(255) DEFAULT NULL, + `origin_username` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `phone` varchar(255) DEFAULT NULL, + `status` int DEFAULT NULL, + `token_login_verify_info` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + `web_hook` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_user_name` (`username`), + KEY `uidx02_user_info` (`email`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for user_role +-- ---------------------------- +DROP TABLE IF EXISTS `user_role`; +CREATE TABLE `user_role` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `role` int DEFAULT NULL, + `scope` int DEFAULT NULL, + `target` bigint DEFAULT NULL, + `user_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `uidx01_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_info`; +CREATE TABLE `workflow_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lifecycle` varchar(255) DEFAULT NULL, + `max_wf_instance_num` int DEFAULT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `pedag` longtext, + `status` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + `wf_description` varchar(255) DEFAULT NULL, + `wf_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_instance_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_instance_info`; +CREATE TABLE `workflow_instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `dag` longtext, + `expected_trigger_time` bigint DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `parent_wf_instance_id` bigint DEFAULT NULL, + `result` longtext, + `status` int DEFAULT NULL, + `wf_context` longtext, + `wf_init_params` longtext, + `wf_instance_id` bigint DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_wf_instance` (`wf_instance_id`), + KEY `idx01_wf_instance` (`workflow_id`,`status`,`app_id`,`expected_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_node_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_node_info`; +CREATE TABLE `workflow_node_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint NOT NULL, + `enable` bit(1) NOT NULL, + `extra` longtext, + `gmt_create` datetime(6) NOT NULL, + `gmt_modified` datetime(6) NOT NULL, + `job_id` bigint DEFAULT NULL, + `node_name` varchar(255) DEFAULT NULL, + `node_params` longtext, + `skip_when_failed` bit(1) NOT NULL, + `type` int DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_node_info` (`workflow_id`,`gmt_create`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/others/sql/schema/powerjob_mysql_5.1.0.sql b/others/sql/schema/powerjob_mysql_5.1.0.sql new file mode 100644 index 000000000..0d594a8c2 --- /dev/null +++ b/others/sql/schema/powerjob_mysql_5.1.0.sql @@ -0,0 +1,323 @@ +/* + Navicat Premium Data Transfer + + Source Server : Local@3306 + Source Server Type : MySQL + Source Server Version : 80300 (8.3.0) + Source Host : localhost:3306 + Source Schema : powerjob5 + + Target Server Type : MySQL + Target Server Version : 80300 (8.3.0) + File Encoding : 65001 + + Date: 11/08/2024 23:23:30 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for app_info +-- ---------------------------- +DROP TABLE IF EXISTS `app_info`; +CREATE TABLE `app_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_name` varchar(255) DEFAULT NULL, + `creator` bigint DEFAULT NULL, + `current_server` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `modifier` bigint DEFAULT NULL, + `namespace_id` bigint DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `tags` varchar(255) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_app_info` (`app_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for container_info +-- ---------------------------- +DROP TABLE IF EXISTS `container_info`; +CREATE TABLE `container_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `container_name` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `last_deploy_time` datetime(6) DEFAULT NULL, + `source_info` varchar(255) DEFAULT NULL, + `source_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `version` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_container_info` (`app_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for instance_info +-- ---------------------------- +DROP TABLE IF EXISTS `instance_info`; +CREATE TABLE `instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `expected_trigger_time` bigint DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_id` bigint DEFAULT NULL, + `instance_params` longtext, + `job_id` bigint DEFAULT NULL, + `job_params` longtext, + `last_report_time` bigint DEFAULT NULL, + `result` longtext, + `running_times` bigint DEFAULT NULL, + `status` int DEFAULT NULL, + `task_tracker_address` varchar(255) DEFAULT NULL, + `type` int DEFAULT NULL, + `wf_instance_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_instance_info` (`job_id`,`status`), + KEY `idx02_instance_info` (`app_id`,`status`), + KEY `idx03_instance_info` (`instance_id`,`status`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for job_info +-- ---------------------------- +DROP TABLE IF EXISTS `job_info`; +CREATE TABLE `job_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `advanced_runtime_config` varchar(255) DEFAULT NULL, + `alarm_config` varchar(255) DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `concurrency` int DEFAULT NULL, + `designated_workers` varchar(255) DEFAULT NULL, + `dispatch_strategy` int DEFAULT NULL, + `dispatch_strategy_config` varchar(255) DEFAULT NULL, + `execute_type` int DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_retry_num` int DEFAULT NULL, + `instance_time_limit` bigint DEFAULT NULL, + `job_description` varchar(255) DEFAULT NULL, + `job_name` varchar(255) DEFAULT NULL, + `job_params` longtext, + `lifecycle` varchar(255) DEFAULT NULL, + `log_config` varchar(255) DEFAULT NULL, + `max_instance_num` int DEFAULT NULL, + `max_worker_count` int DEFAULT NULL, + `min_cpu_cores` double NOT NULL, + `min_disk_space` double NOT NULL, + `min_memory_space` double NOT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `processor_info` varchar(255) DEFAULT NULL, + `processor_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `tag` varchar(255) DEFAULT NULL, + `task_retry_num` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_job_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for namespace +-- ---------------------------- +DROP TABLE IF EXISTS `namespace`; +CREATE TABLE `namespace` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `code` varchar(255) DEFAULT NULL, + `creator` bigint DEFAULT NULL, + `dept` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `modifier` bigint DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `status` int DEFAULT NULL, + `tags` varchar(255) DEFAULT NULL, + `token` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_namespace` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for oms_lock +-- ---------------------------- +DROP TABLE IF EXISTS `oms_lock`; +CREATE TABLE `oms_lock` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lock_name` varchar(255) DEFAULT NULL, + `max_lock_time` bigint DEFAULT NULL, + `ownerip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_oms_lock` (`lock_name`) +) ENGINE=InnoDB AUTO_INCREMENT=4 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for pwjb_user_info +-- ---------------------------- +DROP TABLE IF EXISTS `pwjb_user_info`; +CREATE TABLE `pwjb_user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for server_info +-- ---------------------------- +DROP TABLE IF EXISTS `server_info`; +CREATE TABLE `server_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `ip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_server_info` (`ip`), + KEY `idx01_server_info` (`gmt_modified`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for sundry +-- ---------------------------- +DROP TABLE IF EXISTS `sundry`; +CREATE TABLE `sundry` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `content` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `pkey` varchar(255) DEFAULT NULL, + `skey` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_sundry` (`pkey`,`skey`) +) ENGINE=InnoDB AUTO_INCREMENT=3 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for user_info +-- ---------------------------- +DROP TABLE IF EXISTS `user_info`; +CREATE TABLE `user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `account_type` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `nick` varchar(255) DEFAULT NULL, + `origin_username` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `phone` varchar(255) DEFAULT NULL, + `status` int DEFAULT NULL, + `token_login_verify_info` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + `web_hook` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_user_name` (`username`), + KEY `uidx02_user_info` (`email`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for user_role +-- ---------------------------- +DROP TABLE IF EXISTS `user_role`; +CREATE TABLE `user_role` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `role` int DEFAULT NULL, + `scope` int DEFAULT NULL, + `target` bigint DEFAULT NULL, + `user_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `uidx01_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_info`; +CREATE TABLE `workflow_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lifecycle` varchar(255) DEFAULT NULL, + `max_wf_instance_num` int DEFAULT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `pedag` longtext, + `status` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + `wf_description` varchar(255) DEFAULT NULL, + `wf_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_instance_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_instance_info`; +CREATE TABLE `workflow_instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `dag` longtext, + `expected_trigger_time` bigint DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `parent_wf_instance_id` bigint DEFAULT NULL, + `result` longtext, + `status` int DEFAULT NULL, + `wf_context` longtext, + `wf_init_params` longtext, + `wf_instance_id` bigint DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_wf_instance` (`wf_instance_id`), + KEY `idx01_wf_instance` (`workflow_id`,`status`,`app_id`,`expected_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_node_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_node_info`; +CREATE TABLE `workflow_node_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint NOT NULL, + `enable` bit(1) NOT NULL, + `extra` longtext, + `gmt_create` datetime(6) NOT NULL, + `gmt_modified` datetime(6) NOT NULL, + `job_id` bigint DEFAULT NULL, + `node_name` varchar(255) DEFAULT NULL, + `node_params` longtext, + `skip_when_failed` bit(1) NOT NULL, + `type` int DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_node_info` (`workflow_id`,`gmt_create`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/others/sql/schema/powerjob_mysql_5.1.2.sql b/others/sql/schema/powerjob_mysql_5.1.2.sql new file mode 100644 index 000000000..8958680e7 --- /dev/null +++ b/others/sql/schema/powerjob_mysql_5.1.2.sql @@ -0,0 +1,327 @@ +/* + Navicat Premium Data Transfer + + Source Server : Local@3306 + Source Server Type : MySQL + Source Server Version : 80300 (8.3.0) + Source Host : localhost:3306 + Source Schema : powerjob5g + + Target Server Type : MySQL + Target Server Version : 80300 (8.3.0) + File Encoding : 65001 + + Date: 17/08/2025 21:58:30 +*/ + +SET NAMES utf8mb4; +SET FOREIGN_KEY_CHECKS = 0; + +-- ---------------------------- +-- Table structure for app_info +-- ---------------------------- +DROP TABLE IF EXISTS `app_info`; +CREATE TABLE `app_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_name` varchar(255) DEFAULT NULL, + `creator` bigint DEFAULT NULL, + `current_server` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `modifier` bigint DEFAULT NULL, + `namespace_id` bigint DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `tags` varchar(255) DEFAULT NULL, + `title` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_app_info` (`app_name`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for container_info +-- ---------------------------- +DROP TABLE IF EXISTS `container_info`; +CREATE TABLE `container_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `container_name` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `last_deploy_time` datetime(6) DEFAULT NULL, + `source_info` varchar(255) DEFAULT NULL, + `source_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `version` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_container_info` (`app_id`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for instance_info +-- ---------------------------- +DROP TABLE IF EXISTS `instance_info`; +CREATE TABLE `instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `expected_trigger_time` bigint DEFAULT NULL, + `extend_value` varchar(255) DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_id` bigint DEFAULT NULL, + `instance_params` longtext, + `job_id` bigint DEFAULT NULL, + `job_params` longtext, + `last_report_time` bigint DEFAULT NULL, + `meta` varchar(255) DEFAULT NULL, + `outer_key` varchar(255) DEFAULT NULL, + `result` longtext, + `running_times` bigint DEFAULT NULL, + `status` int DEFAULT NULL, + `task_tracker_address` varchar(255) DEFAULT NULL, + `type` int DEFAULT NULL, + `wf_instance_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_instance_info` (`job_id`,`status`), + KEY `idx02_instance_info` (`app_id`,`status`), + KEY `idx03_instance_info` (`instance_id`,`status`), + KEY `idx04_instance_info_outer_key` (`outer_key`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for job_info +-- ---------------------------- +DROP TABLE IF EXISTS `job_info`; +CREATE TABLE `job_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `advanced_runtime_config` varchar(255) DEFAULT NULL, + `alarm_config` varchar(255) DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `concurrency` int DEFAULT NULL, + `designated_workers` varchar(255) DEFAULT NULL, + `dispatch_strategy` int DEFAULT NULL, + `dispatch_strategy_config` varchar(255) DEFAULT NULL, + `execute_type` int DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `instance_retry_num` int DEFAULT NULL, + `instance_time_limit` bigint DEFAULT NULL, + `job_description` varchar(255) DEFAULT NULL, + `job_name` varchar(255) DEFAULT NULL, + `job_params` longtext, + `lifecycle` varchar(255) DEFAULT NULL, + `log_config` varchar(255) DEFAULT NULL, + `max_instance_num` int DEFAULT NULL, + `max_worker_count` int DEFAULT NULL, + `min_cpu_cores` double NOT NULL, + `min_disk_space` double NOT NULL, + `min_memory_space` double NOT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `processor_info` varchar(255) DEFAULT NULL, + `processor_type` int DEFAULT NULL, + `status` int DEFAULT NULL, + `tag` varchar(255) DEFAULT NULL, + `task_retry_num` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_job_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for namespace +-- ---------------------------- +DROP TABLE IF EXISTS `namespace`; +CREATE TABLE `namespace` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `code` varchar(255) DEFAULT NULL, + `creator` bigint DEFAULT NULL, + `dept` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `modifier` bigint DEFAULT NULL, + `name` varchar(255) DEFAULT NULL, + `status` int DEFAULT NULL, + `tags` varchar(255) DEFAULT NULL, + `token` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_namespace` (`code`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for oms_lock +-- ---------------------------- +DROP TABLE IF EXISTS `oms_lock`; +CREATE TABLE `oms_lock` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lock_name` varchar(255) DEFAULT NULL, + `max_lock_time` bigint DEFAULT NULL, + `ownerip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_oms_lock` (`lock_name`) +) ENGINE=InnoDB AUTO_INCREMENT=6 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for pwjb_user_info +-- ---------------------------- +DROP TABLE IF EXISTS `pwjb_user_info`; +CREATE TABLE `pwjb_user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_username` (`username`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for server_info +-- ---------------------------- +DROP TABLE IF EXISTS `server_info`; +CREATE TABLE `server_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `ip` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_server_info` (`ip`), + KEY `idx01_server_info` (`gmt_modified`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for sundry +-- ---------------------------- +DROP TABLE IF EXISTS `sundry`; +CREATE TABLE `sundry` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `content` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `pkey` varchar(255) DEFAULT NULL, + `skey` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_sundry` (`pkey`,`skey`) +) ENGINE=InnoDB AUTO_INCREMENT=5 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for user_info +-- ---------------------------- +DROP TABLE IF EXISTS `user_info`; +CREATE TABLE `user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `account_type` varchar(255) DEFAULT NULL, + `email` varchar(255) DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `nick` varchar(255) DEFAULT NULL, + `origin_username` varchar(255) DEFAULT NULL, + `password` varchar(255) DEFAULT NULL, + `phone` varchar(255) DEFAULT NULL, + `status` int DEFAULT NULL, + `token_login_verify_info` varchar(255) DEFAULT NULL, + `username` varchar(255) DEFAULT NULL, + `web_hook` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_user_name` (`username`), + KEY `uidx02_user_info` (`email`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for user_role +-- ---------------------------- +DROP TABLE IF EXISTS `user_role`; +CREATE TABLE `user_role` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `role` int DEFAULT NULL, + `scope` int DEFAULT NULL, + `target` bigint DEFAULT NULL, + `user_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `uidx01_user_id` (`user_id`) +) ENGINE=InnoDB AUTO_INCREMENT=2 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_info`; +CREATE TABLE `workflow_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint DEFAULT NULL, + `extra` varchar(255) DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `lifecycle` varchar(255) DEFAULT NULL, + `max_wf_instance_num` int DEFAULT NULL, + `next_trigger_time` bigint DEFAULT NULL, + `notify_user_ids` varchar(255) DEFAULT NULL, + `pedag` longtext, + `status` int DEFAULT NULL, + `time_expression` varchar(255) DEFAULT NULL, + `time_expression_type` int DEFAULT NULL, + `wf_description` varchar(255) DEFAULT NULL, + `wf_name` varchar(255) DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_info` (`app_id`,`status`,`time_expression_type`,`next_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_instance_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_instance_info`; +CREATE TABLE `workflow_instance_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `actual_trigger_time` bigint DEFAULT NULL, + `app_id` bigint DEFAULT NULL, + `dag` longtext, + `expected_trigger_time` bigint DEFAULT NULL, + `finished_time` bigint DEFAULT NULL, + `gmt_create` datetime(6) DEFAULT NULL, + `gmt_modified` datetime(6) DEFAULT NULL, + `parent_wf_instance_id` bigint DEFAULT NULL, + `result` longtext, + `status` int DEFAULT NULL, + `wf_context` longtext, + `wf_init_params` longtext, + `wf_instance_id` bigint DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + UNIQUE KEY `uidx01_wf_instance` (`wf_instance_id`), + KEY `idx01_wf_instance` (`workflow_id`,`status`,`app_id`,`expected_trigger_time`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +-- ---------------------------- +-- Table structure for workflow_node_info +-- ---------------------------- +DROP TABLE IF EXISTS `workflow_node_info`; +CREATE TABLE `workflow_node_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `app_id` bigint NOT NULL, + `enable` bit(1) NOT NULL, + `extra` longtext, + `gmt_create` datetime(6) NOT NULL, + `gmt_modified` datetime(6) NOT NULL, + `job_id` bigint DEFAULT NULL, + `node_name` varchar(255) DEFAULT NULL, + `node_params` longtext, + `skip_when_failed` bit(1) NOT NULL, + `type` int DEFAULT NULL, + `workflow_id` bigint DEFAULT NULL, + PRIMARY KEY (`id`), + KEY `idx01_workflow_node_info` (`workflow_id`,`gmt_create`) +) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci; + +SET FOREIGN_KEY_CHECKS = 1; diff --git a/others/sql/upgrade/README.md b/others/sql/upgrade/README.md new file mode 100644 index 000000000..ea5111374 --- /dev/null +++ b/others/sql/upgrade/README.md @@ -0,0 +1,7 @@ +由于存在不同数据库、不同版本的升级,官方能给出的 upgrade SQL 相对有限,大家可参考以下方式自行生成升级 SQL: + +- 【官方脚本】参考官方每个版本的数据库全库建表文件(项目 others - sql - schema),自行进行字段 DIFF + +- 【自己动手版】导出当前您的 powerjob 数据库表结构,同时创建一个测试库,让 5.x 版本的 server 直连该测试库,自动建表。分别拿到两个版本的表结构 SQL 后,借用工具生产 update SQL 即可(navigate 等数据库管理软件均支持结构对比) + +参考文档:https://www.yuque.com/powerjob/guidence/upgrade \ No newline at end of file diff --git a/others/sql/upgrade/v4.3.7-v4.3.8.sql b/others/sql/upgrade/v4.3.7-v4.3.8.sql new file mode 100644 index 000000000..e2ab1e460 --- /dev/null +++ b/others/sql/upgrade/v4.3.7-v4.3.8.sql @@ -0,0 +1,6 @@ +-- Upgrade SQL FROM 4.3.7 to 4.3.8 +-- ---------------------------- +-- Table change for job_info +-- ---------------------------- +alter table job_info add dispatch_strategy_config varchar(255) comment 'dispatch_strategy_config' default null; +alter table job_info add advanced_runtime_config varchar(255) comment 'advanced_runtime_config' default null; diff --git a/others/sql/upgrade/v4.3.x-v5.0.x.sql b/others/sql/upgrade/v4.3.x-v5.0.x.sql new file mode 100644 index 000000000..ee9f2a126 --- /dev/null +++ b/others/sql/upgrade/v4.3.x-v5.0.x.sql @@ -0,0 +1,88 @@ +-- Upgrade SQL FROM 4.1.x to 4.2.x +-- ---------------------------- +-- Table change for app_info +-- ---------------------------- +SET FOREIGN_KEY_CHECKS=0; + +ALTER TABLE `app_info` ADD COLUMN `creator` bigint NULL DEFAULT NULL; +ALTER TABLE `app_info` ADD COLUMN `extra` varchar(255) NULL DEFAULT NULL; +ALTER TABLE `app_info` ADD COLUMN `modifier` bigint NULL DEFAULT NULL; +ALTER TABLE `app_info` ADD COLUMN `namespace_id` bigint NULL DEFAULT NULL; +ALTER TABLE `app_info` ADD COLUMN `tags` varchar(255) NULL DEFAULT NULL; +ALTER TABLE `app_info` ADD COLUMN `title` varchar(255) NULL DEFAULT NULL; + +-- ---------------------------- +-- Table change for user_info +-- ---------------------------- +ALTER TABLE `user_info` ADD COLUMN `account_type` varchar(255) NULL DEFAULT NULL; +ALTER TABLE `user_info` ADD COLUMN `nick` varchar(255) NULL DEFAULT NULL; +ALTER TABLE `user_info` ADD COLUMN `origin_username` varchar(255) NULL DEFAULT NULL; +ALTER TABLE `user_info` ADD COLUMN `token_login_verify_info` varchar(255) NULL DEFAULT NULL; +ALTER TABLE `user_info` ADD UNIQUE INDEX `uidx01_user_name`(`username` ASC) USING BTREE; + +-- ---------------------------- +-- new table 'namespace' +-- ---------------------------- +CREATE TABLE `namespace` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `code` varchar(255) NULL DEFAULT NULL, + `creator` bigint NULL DEFAULT NULL, + `dept` varchar(255) NULL DEFAULT NULL, + `extra` varchar(255) NULL DEFAULT NULL, + `gmt_create` datetime(6) NULL DEFAULT NULL, + `gmt_modified` datetime(6) NULL DEFAULT NULL, + `modifier` bigint NULL DEFAULT NULL, + `name` varchar(255) NULL DEFAULT NULL, + `status` int NULL DEFAULT NULL, + `tags` varchar(255) NULL DEFAULT NULL, + `token` varchar(255) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `uidx01_namespace`(`code` ASC) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + + +-- ---------------------------- +-- new table 'pwjb_user_info' +-- ---------------------------- +CREATE TABLE `pwjb_user_info` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) NULL DEFAULT NULL, + `gmt_create` datetime(6) NULL DEFAULT NULL, + `gmt_modified` datetime(6) NULL DEFAULT NULL, + `password` varchar(255) NULL DEFAULT NULL, + `username` varchar(255) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `uidx01_username`(`username` ASC) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + +-- ---------------------------- +-- new table 'sundry' +-- ---------------------------- +CREATE TABLE `sundry` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `content` varchar(255) NULL DEFAULT NULL, + `extra` varchar(255) NULL DEFAULT NULL, + `gmt_create` datetime(6) NULL DEFAULT NULL, + `gmt_modified` datetime(6) NULL DEFAULT NULL, + `pkey` varchar(255) NULL DEFAULT NULL, + `skey` varchar(255) NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + UNIQUE INDEX `uidx01_sundry`(`pkey` ASC, `skey` ASC) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 3 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; + + +-- ---------------------------- +-- new table 'user_role' +-- ---------------------------- +CREATE TABLE `user_role` ( + `id` bigint NOT NULL AUTO_INCREMENT, + `extra` varchar(255) NULL DEFAULT NULL, + `gmt_create` datetime(6) NULL DEFAULT NULL, + `gmt_modified` datetime(6) NULL DEFAULT NULL, + `role` int NULL DEFAULT NULL, + `scope` int NULL DEFAULT NULL, + `target` bigint NULL DEFAULT NULL, + `user_id` bigint NULL DEFAULT NULL, + PRIMARY KEY (`id`) USING BTREE, + INDEX `uidx01_user_id`(`user_id` ASC) USING BTREE +) ENGINE = InnoDB AUTO_INCREMENT = 2 CHARACTER SET = utf8mb4 COLLATE = utf8mb4_0900_ai_ci ROW_FORMAT = Dynamic; \ No newline at end of file diff --git a/others/sql/upgrade/v5.1.0-v5.1.2.sql b/others/sql/upgrade/v5.1.0-v5.1.2.sql new file mode 100644 index 000000000..3d5967b10 --- /dev/null +++ b/others/sql/upgrade/v5.1.0-v5.1.2.sql @@ -0,0 +1,7 @@ +ALTER TABLE `instance_info` ADD COLUMN `extend_value` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL AFTER `expected_trigger_time`; + +ALTER TABLE `instance_info` ADD COLUMN `meta` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL AFTER `last_report_time`; + +ALTER TABLE `instance_info` ADD COLUMN `outer_key` varchar(255) CHARACTER SET utf8mb4 COLLATE utf8mb4_0900_ai_ci NULL DEFAULT NULL AFTER `meta`; + +ALTER TABLE `instance_info` ADD INDEX `idx04_instance_info_outer_key`(`outer_key` ASC) USING BTREE; \ No newline at end of file diff --git a/pom.xml b/pom.xml index 790d7fc02..e95acaf5a 100644 --- a/pom.xml +++ b/pom.xml @@ -6,7 +6,7 @@ tech.powerjob powerjob - 4.3.6 + 5.1.2 pom powerjob http://www.powerjob.tech @@ -58,7 +58,7 @@ 1.6 UTF-8 UTF-8 - 1.18.12 + 1.18.38 @@ -151,30 +151,18 @@ + - org.sonatype.plugins - nexus-staging-maven-plugin - 1.6.7 + org.sonatype.central + central-publishing-maven-plugin + 0.8.0 true - ossrh - https://s01.oss.sonatype.org/ - true + central - - - - ossrh - https://s01.oss.sonatype.org/content/repositories/snapshots/ - - - ossrh - https://s01.oss.sonatype.org/service/local/staging/deploy/maven2/ - - diff --git a/powerjob-client/pom.xml b/powerjob-client/pom.xml index 10b88c931..c95d8b819 100644 --- a/powerjob-client/pom.xml +++ b/powerjob-client/pom.xml @@ -5,18 +5,20 @@ powerjob tech.powerjob - 4.3.6 + 5.1.2 4.0.0 powerjob-client - 4.3.6 + powerjob-client + 5.1.2 jar 5.9.1 + 1.2.13 1.2.83 - 4.3.6 + 5.1.2 3.2.4 @@ -44,6 +46,13 @@ ${junit.version} test + + + ch.qos.logback + logback-classic + ${logback.version} + test + diff --git a/powerjob-client/src/main/java/tech/powerjob/client/ClientConfig.java b/powerjob-client/src/main/java/tech/powerjob/client/ClientConfig.java new file mode 100644 index 000000000..abe29e87d --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/ClientConfig.java @@ -0,0 +1,71 @@ +package tech.powerjob.client; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; +import tech.powerjob.client.common.Protocol; +import tech.powerjob.client.extension.ClientExtension; + +import java.io.Serializable; +import java.util.List; +import java.util.Map; + +/** + * 客户端配置 + * + * @author 程序帕鲁 + * @since 2024/2/20 + */ +@Getter +@Setter +@ToString +@Accessors(chain = true) +public class ClientConfig implements Serializable { + + /** + * 执行器 AppName + */ + private String appName; + + /** + * 执行器密码 + */ + private String password; + + /** + * 地址列表,支持格式: + * - IP:Port, eg: 192.168.1.1:7700 + * - 域名, eg: powerjob.apple-inc.com + */ + private List addressList; + + /** + * 客户端通讯协议 + */ + private Protocol protocol = Protocol.HTTP; + + /** + * 连接超时时间 + */ + private Integer connectionTimeout; + /** + * 指定了等待服务器响应数据的最长时间。更具体地说,这是从服务器开始返回响应数据(包括HTTP头和数据)后,客户端读取数据的超时时间 + */ + private Integer readTimeout; + /** + * 指定了向服务器发送数据的最长时间。这是从客户端开始发送数据(如POST请求的正文)到数据完全发送出去的时间 + */ + private Integer writeTimeout; + + /** + * 默认携带的请求头 + * 用于流量被基础设施识别 + */ + private Map defaultHeaders; + + /** + * 客户端行为扩展 + */ + private ClientExtension clientExtension; +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/IPowerJobClient.java b/powerjob-client/src/main/java/tech/powerjob/client/IPowerJobClient.java index 0df519b10..84ab80321 100644 --- a/powerjob-client/src/main/java/tech/powerjob/client/IPowerJobClient.java +++ b/powerjob-client/src/main/java/tech/powerjob/client/IPowerJobClient.java @@ -1,8 +1,10 @@ package tech.powerjob.client; +import tech.powerjob.common.request.http.RunJobRequest; import tech.powerjob.common.request.http.SaveJobInfoRequest; import tech.powerjob.common.request.http.SaveWorkflowNodeRequest; import tech.powerjob.common.request.http.SaveWorkflowRequest; +import tech.powerjob.common.request.query.InstancePageQuery; import tech.powerjob.common.request.query.JobInfoQuery; import tech.powerjob.common.response.*; @@ -38,6 +40,8 @@ public interface IPowerJobClient { ResultDTO runJob(Long jobId, String instanceParams, long delayMS); + PowerResultDTO runJob(RunJobRequest runJobRequest); + /* ************* Instance API list ************* */ ResultDTO stopInstance(Long instanceId); @@ -50,6 +54,8 @@ public interface IPowerJobClient { ResultDTO fetchInstanceInfo(Long instanceId); + ResultDTO> queryInstanceInfo(InstancePageQuery instancePageQuery); + /* ************* Workflow API list ************* */ ResultDTO saveWorkflow(SaveWorkflowRequest request); diff --git a/powerjob-client/src/main/java/tech/powerjob/client/PowerJobClient.java b/powerjob-client/src/main/java/tech/powerjob/client/PowerJobClient.java index e0240e5cd..0dba46b65 100644 --- a/powerjob-client/src/main/java/tech/powerjob/client/PowerJobClient.java +++ b/powerjob-client/src/main/java/tech/powerjob/client/PowerJobClient.java @@ -1,28 +1,34 @@ package tech.powerjob.client; import com.alibaba.fastjson.JSON; -import tech.powerjob.common.enums.InstanceStatus; -import tech.powerjob.common.OmsConstant; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import tech.powerjob.client.module.AppAuthRequest; +import tech.powerjob.client.module.AppAuthResult; +import tech.powerjob.client.service.PowerRequestBody; +import tech.powerjob.client.service.RequestService; +import tech.powerjob.client.service.impl.ClusterRequestServiceOkHttp3Impl; import tech.powerjob.common.OpenAPIConstant; +import tech.powerjob.common.enums.EncryptType; +import tech.powerjob.common.enums.InstanceStatus; import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.request.http.RunJobRequest; import tech.powerjob.common.request.http.SaveJobInfoRequest; import tech.powerjob.common.request.http.SaveWorkflowNodeRequest; import tech.powerjob.common.request.http.SaveWorkflowRequest; +import tech.powerjob.common.request.query.InstancePageQuery; import tech.powerjob.common.request.query.JobInfoQuery; import tech.powerjob.common.response.*; -import tech.powerjob.common.utils.CommonUtils; -import tech.powerjob.common.utils.HttpUtils; import tech.powerjob.common.serialize.JsonUtils; -import com.google.common.collect.Lists; -import lombok.extern.slf4j.Slf4j; -import okhttp3.FormBody; -import okhttp3.MediaType; -import okhttp3.RequestBody; -import org.apache.commons.lang3.StringUtils; +import tech.powerjob.common.utils.CommonUtils; +import tech.powerjob.common.utils.DigestUtils; +import java.io.Closeable; import java.io.IOException; import java.util.List; -import java.util.Objects; +import java.util.Map; import static tech.powerjob.client.TypeStore.*; @@ -33,14 +39,44 @@ * @since 2020/4/15 */ @Slf4j -public class PowerJobClient implements IPowerJobClient { +public class PowerJobClient implements IPowerJobClient, Closeable { private Long appId; - private String currentAddress; - private final List allAddress; + + private final RequestService requestService; + + public PowerJobClient(ClientConfig config) { + + List addressList = config.getAddressList(); + String appName = config.getAppName(); + + CommonUtils.requireNonNull(addressList, "addressList can't be null!"); + CommonUtils.requireNonNull(appName, "appName can't be null"); + + this.requestService = new ClusterRequestServiceOkHttp3Impl(config); - private static final String URL_PATTERN = "http://%s%s%s"; + AppAuthRequest appAuthRequest = new AppAuthRequest(); + appAuthRequest.setAppName(appName); + appAuthRequest.setEncryptedPassword(DigestUtils.md5(config.getPassword())); + appAuthRequest.setEncryptType(EncryptType.MD5.getCode()); + String assertResponse = requestService.request(OpenAPIConstant.AUTH_APP, PowerRequestBody.newJsonRequestBody(appAuthRequest)); + + if (StringUtils.isNotEmpty(assertResponse)) { + ResultDTO resultDTO = JSON.parseObject(assertResponse, APP_AUTH_RESULT_TYPE); + if (resultDTO.isSuccess()) { + appId = resultDTO.getData().getAppId(); + } else { + throw new PowerJobException(resultDTO.getMessage()); + } + } + + if (appId == null) { + throw new PowerJobException("appId is null, please check your config"); + } + + log.info("[PowerJobClient] [INIT] {}'s PowerJobClient bootstrap successfully", appName); + } /** * Init PowerJobClient with domain, appName and password. * @@ -49,7 +85,7 @@ public class PowerJobClient implements IPowerJobClient { * @param password password of the application */ public PowerJobClient(String domain, String appName, String password) { - this(Lists.newArrayList(domain), appName, password); + this(new ClientConfig().setAppName(appName).setPassword(password).setAddressList(Lists.newArrayList(domain))); } @@ -61,48 +97,7 @@ public PowerJobClient(String domain, String appName, String password) { * @param password password of the application */ public PowerJobClient(List addressList, String appName, String password) { - - CommonUtils.requireNonNull(addressList, "addressList can't be null!"); - CommonUtils.requireNonNull(appName, "appName can't be null"); - - allAddress = addressList; - for (String addr : addressList) { - String url = getUrl(OpenAPIConstant.ASSERT, addr); - try { - String result = assertApp(appName, password, url); - if (StringUtils.isNotEmpty(result)) { - ResultDTO resultDTO = JSON.parseObject(result, LONG_RESULT_TYPE); - if (resultDTO.isSuccess()) { - appId = resultDTO.getData(); - currentAddress = addr; - break; - } else { - throw new PowerJobException(resultDTO.getMessage()); - } - } - } catch (IOException ignore) { - // - } - } - - if (StringUtils.isEmpty(currentAddress)) { - throw new PowerJobException("no server available for PowerJobClient"); - } - log.info("[PowerJobClient] {}'s PowerJobClient bootstrap successfully, using server: {}", appName, currentAddress); - } - - private static String assertApp(String appName, String password, String url) throws IOException { - FormBody.Builder builder = new FormBody.Builder() - .add("appName", appName); - if (password != null) { - builder.add("password", password); - } - return HttpUtils.post(url, builder.build()); - } - - - private static String getUrl(String path, String address) { - return String.format(URL_PATTERN, address, OpenAPIConstant.WEB_PATH, path); + this(new ClientConfig().setAppName(appName).setPassword(password).setAddressList(addressList)); } /* ************* Job 区 ************* */ @@ -118,9 +113,7 @@ private static String getUrl(String path, String address) { public ResultDTO saveJob(SaveJobInfoRequest request) { request.setAppId(appId); - MediaType jsonType = MediaType.parse(OmsConstant.JSON_MEDIA_TYPE); - String json = JSON.toJSONString(request); - String post = postHA(OpenAPIConstant.SAVE_JOB, RequestBody.create(jsonType, json)); + String post = requestService.request(OpenAPIConstant.SAVE_JOB, PowerRequestBody.newJsonRequestBody(request)); return JSON.parseObject(post, LONG_RESULT_TYPE); } @@ -133,21 +126,20 @@ public ResultDTO saveJob(SaveJobInfoRequest request) { */ @Override public ResultDTO copyJob(Long jobId) { - RequestBody body = new FormBody.Builder() - .add("jobId", jobId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.COPY_JOB, body); + Map param = Maps.newHashMap(); + param.put("jobId", jobId.toString()); + param.put("appId", appId.toString()); + + String post = requestService.request(OpenAPIConstant.COPY_JOB, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, LONG_RESULT_TYPE); } @Override public ResultDTO exportJob(Long jobId) { - RequestBody body = new FormBody.Builder() - .add("jobId", jobId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.EXPORT_JOB, body); + Map param = Maps.newHashMap(); + param.put("jobId", jobId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.EXPORT_JOB, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, SAVE_JOB_INFO_REQUEST_RESULT_TYPE); } @@ -159,11 +151,10 @@ public ResultDTO exportJob(Long jobId) { */ @Override public ResultDTO fetchJob(Long jobId) { - RequestBody body = new FormBody.Builder() - .add("jobId", jobId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.FETCH_JOB, body); + Map param = Maps.newHashMap(); + param.put("jobId", jobId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.FETCH_JOB, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, JOB_RESULT_TYPE); } @@ -174,10 +165,9 @@ public ResultDTO fetchJob(Long jobId) { */ @Override public ResultDTO> fetchAllJob() { - RequestBody body = new FormBody.Builder() - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.FETCH_ALL_JOB, body); + Map param = Maps.newHashMap(); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.FETCH_ALL_JOB, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, LIST_JOB_RESULT_TYPE); } @@ -190,9 +180,7 @@ public ResultDTO> fetchAllJob() { @Override public ResultDTO> queryJob(JobInfoQuery powerQuery) { powerQuery.setAppIdEq(appId); - MediaType jsonType = MediaType.parse(OmsConstant.JSON_MEDIA_TYPE); - String json = JsonUtils.toJSONStringUnsafe(powerQuery); - String post = postHA(OpenAPIConstant.QUERY_JOB, RequestBody.create(jsonType, json)); + String post = requestService.request(OpenAPIConstant.QUERY_JOB, PowerRequestBody.newJsonRequestBody(powerQuery)); return JSON.parseObject(post, LIST_JOB_RESULT_TYPE); } @@ -204,11 +192,10 @@ public ResultDTO> queryJob(JobInfoQuery powerQuery) { */ @Override public ResultDTO disableJob(Long jobId) { - RequestBody body = new FormBody.Builder() - .add("jobId", jobId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.DISABLE_JOB, body); + Map param = Maps.newHashMap(); + param.put("jobId", jobId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.DISABLE_JOB, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -220,11 +207,10 @@ public ResultDTO disableJob(Long jobId) { */ @Override public ResultDTO enableJob(Long jobId) { - RequestBody body = new FormBody.Builder() - .add("jobId", jobId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.ENABLE_JOB, body); + Map param = Maps.newHashMap(); + param.put("jobId", jobId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.ENABLE_JOB, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -236,11 +222,10 @@ public ResultDTO enableJob(Long jobId) { */ @Override public ResultDTO deleteJob(Long jobId) { - RequestBody body = new FormBody.Builder() - .add("jobId", jobId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.DELETE_JOB, body); + Map param = Maps.newHashMap(); + param.put("jobId", jobId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.DELETE_JOB, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -254,22 +239,22 @@ public ResultDTO deleteJob(Long jobId) { */ @Override public ResultDTO runJob(Long jobId, String instanceParams, long delayMS) { - FormBody.Builder builder = new FormBody.Builder() - .add("jobId", jobId.toString()) - .add("appId", appId.toString()) - .add("delay", String.valueOf(delayMS)); - if (StringUtils.isNotEmpty(instanceParams)) { - builder.add("instanceParams", instanceParams); - } - String post = postHA(OpenAPIConstant.RUN_JOB, builder.build()); - return JSON.parseObject(post, LONG_RESULT_TYPE); + RunJobRequest runJobRequest = new RunJobRequest().setJobId(jobId).setInstanceParams(instanceParams).setDelay(delayMS); + return runJob(runJobRequest); } public ResultDTO runJob(Long jobId) { return runJob(jobId, null, 0); } + @Override + public PowerResultDTO runJob(RunJobRequest runJobRequest) { + runJobRequest.setAppId(appId); + String post = requestService.request(OpenAPIConstant.RUN_JOB2, PowerRequestBody.newJsonRequestBody(runJobRequest)); + return JSON.parseObject(post, LONG_POWER_RESULT_TYPE); + } + /* ************* Instance API list ************* */ /** @@ -280,11 +265,12 @@ public ResultDTO runJob(Long jobId) { */ @Override public ResultDTO stopInstance(Long instanceId) { - RequestBody body = new FormBody.Builder() - .add("instanceId", instanceId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.STOP_INSTANCE, body); + + Map param = Maps.newHashMap(); + param.put("instanceId", instanceId.toString()); + param.put("appId", appId.toString()); + + String post = requestService.request(OpenAPIConstant.STOP_INSTANCE, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -297,11 +283,10 @@ public ResultDTO stopInstance(Long instanceId) { */ @Override public ResultDTO cancelInstance(Long instanceId) { - RequestBody body = new FormBody.Builder() - .add("instanceId", instanceId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.CANCEL_INSTANCE, body); + Map param = Maps.newHashMap(); + param.put("instanceId", instanceId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.CANCEL_INSTANCE, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -314,11 +299,10 @@ public ResultDTO cancelInstance(Long instanceId) { */ @Override public ResultDTO retryInstance(Long instanceId) { - RequestBody body = new FormBody.Builder() - .add("instanceId", instanceId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.RETRY_INSTANCE, body); + Map param = Maps.newHashMap(); + param.put("instanceId", instanceId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.RETRY_INSTANCE, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -330,10 +314,10 @@ public ResultDTO retryInstance(Long instanceId) { */ @Override public ResultDTO fetchInstanceStatus(Long instanceId) { - RequestBody body = new FormBody.Builder() - .add("instanceId", instanceId.toString()) - .build(); - String post = postHA(OpenAPIConstant.FETCH_INSTANCE_STATUS, body); + Map param = Maps.newHashMap(); + param.put("instanceId", instanceId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.FETCH_INSTANCE_STATUS, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, INTEGER_RESULT_TYPE); } @@ -345,13 +329,20 @@ public ResultDTO fetchInstanceStatus(Long instanceId) { */ @Override public ResultDTO fetchInstanceInfo(Long instanceId) { - RequestBody body = new FormBody.Builder() - .add("instanceId", instanceId.toString()) - .build(); - String post = postHA(OpenAPIConstant.FETCH_INSTANCE_INFO, body); + Map param = Maps.newHashMap(); + param.put("instanceId", instanceId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.FETCH_INSTANCE_INFO, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, INSTANCE_RESULT_TYPE); } + @Override + public ResultDTO> queryInstanceInfo(InstancePageQuery instancePageQuery) { + instancePageQuery.setAppIdEq(appId); + String post = requestService.request(OpenAPIConstant.QUERY_INSTANCE, PowerRequestBody.newJsonRequestBody(instancePageQuery)); + return JSON.parseObject(post, PAGE_INSTANCE_RESULT_TYPE); + } + /* ************* Workflow API list ************* */ /** @@ -364,10 +355,9 @@ public ResultDTO fetchInstanceInfo(Long instanceId) { @Override public ResultDTO saveWorkflow(SaveWorkflowRequest request) { request.setAppId(appId); - MediaType jsonType = MediaType.parse(OmsConstant.JSON_MEDIA_TYPE); // 中坑记录:用 FastJSON 序列化会导致 Server 接收时 pEWorkflowDAG 为 null,无语.jpg String json = JsonUtils.toJSONStringUnsafe(request); - String post = postHA(OpenAPIConstant.SAVE_WORKFLOW, RequestBody.create(jsonType, json)); + String post = requestService.request(OpenAPIConstant.SAVE_WORKFLOW, PowerRequestBody.newJsonRequestBody(json)); return JSON.parseObject(post, LONG_RESULT_TYPE); } @@ -379,11 +369,12 @@ public ResultDTO saveWorkflow(SaveWorkflowRequest request) { */ @Override public ResultDTO copyWorkflow(Long workflowId) { - RequestBody body = new FormBody.Builder() - .add("workflowId", workflowId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.COPY_WORKFLOW, body); + + Map param = Maps.newHashMap(); + param.put("workflowId", workflowId.toString()); + param.put("appId", appId.toString()); + + String post = requestService.request(OpenAPIConstant.COPY_WORKFLOW, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, LONG_RESULT_TYPE); } @@ -399,9 +390,9 @@ public ResultDTO> saveWorkflowNode(List> saveWorkflowNode(List fetchWorkflow(Long workflowId) { - RequestBody body = new FormBody.Builder() - .add("workflowId", workflowId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.FETCH_WORKFLOW, body); + Map param = Maps.newHashMap(); + param.put("workflowId", workflowId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.FETCH_WORKFLOW, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, WF_RESULT_TYPE); } @@ -431,11 +421,10 @@ public ResultDTO fetchWorkflow(Long workflowId) { */ @Override public ResultDTO disableWorkflow(Long workflowId) { - RequestBody body = new FormBody.Builder() - .add("workflowId", workflowId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.DISABLE_WORKFLOW, body); + Map param = Maps.newHashMap(); + param.put("workflowId", workflowId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.DISABLE_WORKFLOW, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -447,11 +436,10 @@ public ResultDTO disableWorkflow(Long workflowId) { */ @Override public ResultDTO enableWorkflow(Long workflowId) { - RequestBody body = new FormBody.Builder() - .add("workflowId", workflowId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.ENABLE_WORKFLOW, body); + Map param = Maps.newHashMap(); + param.put("workflowId", workflowId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.ENABLE_WORKFLOW, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -463,11 +451,10 @@ public ResultDTO enableWorkflow(Long workflowId) { */ @Override public ResultDTO deleteWorkflow(Long workflowId) { - RequestBody body = new FormBody.Builder() - .add("workflowId", workflowId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.DELETE_WORKFLOW, body); + Map param = Maps.newHashMap(); + param.put("workflowId", workflowId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.DELETE_WORKFLOW, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -481,14 +468,17 @@ public ResultDTO deleteWorkflow(Long workflowId) { */ @Override public ResultDTO runWorkflow(Long workflowId, String initParams, long delayMS) { - FormBody.Builder builder = new FormBody.Builder() - .add("workflowId", workflowId.toString()) - .add("appId", appId.toString()) - .add("delay", String.valueOf(delayMS)); + + Map param = Maps.newHashMap(); + param.put("workflowId", workflowId.toString()); + param.put("appId", appId.toString()); + param.put("delay", String.valueOf(delayMS)); + + if (StringUtils.isNotEmpty(initParams)) { - builder.add("initParams", initParams); + param.put("initParams", initParams); } - String post = postHA(OpenAPIConstant.RUN_WORKFLOW, builder.build()); + String post = requestService.request(OpenAPIConstant.RUN_WORKFLOW, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, LONG_RESULT_TYPE); } @@ -506,11 +496,12 @@ public ResultDTO runWorkflow(Long workflowId) { */ @Override public ResultDTO stopWorkflowInstance(Long wfInstanceId) { - RequestBody body = new FormBody.Builder() - .add("wfInstanceId", wfInstanceId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.STOP_WORKFLOW_INSTANCE, body); + + Map param = Maps.newHashMap(); + param.put("wfInstanceId", wfInstanceId.toString()); + param.put("appId", appId.toString()); + + String post = requestService.request(OpenAPIConstant.STOP_WORKFLOW_INSTANCE, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -522,11 +513,10 @@ public ResultDTO stopWorkflowInstance(Long wfInstanceId) { */ @Override public ResultDTO retryWorkflowInstance(Long wfInstanceId) { - RequestBody body = new FormBody.Builder() - .add("wfInstanceId", wfInstanceId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.RETRY_WORKFLOW_INSTANCE, body); + Map param = Maps.newHashMap(); + param.put("wfInstanceId", wfInstanceId.toString()); + param.put("appId", appId.toString()); + String post = requestService.request(OpenAPIConstant.RETRY_WORKFLOW_INSTANCE, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -539,12 +529,13 @@ public ResultDTO retryWorkflowInstance(Long wfInstanceId) { */ @Override public ResultDTO markWorkflowNodeAsSuccess(Long wfInstanceId, Long nodeId) { - RequestBody body = new FormBody.Builder() - .add("wfInstanceId", wfInstanceId.toString()) - .add("nodeId", nodeId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.MARK_WORKFLOW_NODE_AS_SUCCESS, body); + + Map param = Maps.newHashMap(); + param.put("wfInstanceId", wfInstanceId.toString()); + param.put("appId", appId.toString()); + param.put("nodeId", nodeId.toString()); + + String post = requestService.request(OpenAPIConstant.MARK_WORKFLOW_NODE_AS_SUCCESS, PowerRequestBody.newFormRequestBody(param)); return JSON.parseObject(post, VOID_RESULT_TYPE); } @@ -556,47 +547,17 @@ public ResultDTO markWorkflowNodeAsSuccess(Long wfInstanceId, Long nodeId) */ @Override public ResultDTO fetchWorkflowInstanceInfo(Long wfInstanceId) { - RequestBody body = new FormBody.Builder() - .add("wfInstanceId", wfInstanceId.toString()) - .add("appId", appId.toString()) - .build(); - String post = postHA(OpenAPIConstant.FETCH_WORKFLOW_INSTANCE_INFO, body); - return JSON.parseObject(post, WF_INSTANCE_RESULT_TYPE); - } - - - private String postHA(String path, RequestBody requestBody) { - // 先尝试默认地址 - String url = getUrl(path, currentAddress); - try { - String res = HttpUtils.post(url, requestBody); - if (StringUtils.isNotEmpty(res)) { - return res; - } - } catch (IOException e) { - log.warn("[PowerJobClient] request url:{} failed, reason is {}.", url, e.toString()); - } + Map param = Maps.newHashMap(); + param.put("wfInstanceId", wfInstanceId.toString()); + param.put("appId", appId.toString()); - // 失败,开始重试 - for (String addr : allAddress) { - if (Objects.equals(addr, currentAddress)) { - continue; - } - url = getUrl(path, addr); - try { - String res = HttpUtils.post(url, requestBody); - if (StringUtils.isNotEmpty(res)) { - log.warn("[PowerJobClient] server change: from({}) -> to({}).", currentAddress, addr); - currentAddress = addr; - return res; - } - } catch (IOException e) { - log.warn("[PowerJobClient] request url:{} failed, reason is {}.", url, e.toString()); - } - } + String post = requestService.request(OpenAPIConstant.FETCH_WORKFLOW_INSTANCE_INFO, PowerRequestBody.newFormRequestBody(param)); + return JSON.parseObject(post, WF_INSTANCE_RESULT_TYPE); + } - log.error("[PowerJobClient] do post for path: {} failed because of no server available in {}.", path, allAddress); - throw new PowerJobException("no server available when send post request"); + @Override + public void close() throws IOException { + requestService.close(); } } diff --git a/powerjob-client/src/main/java/tech/powerjob/client/TypeStore.java b/powerjob-client/src/main/java/tech/powerjob/client/TypeStore.java index 15c8e2851..9834607cb 100644 --- a/powerjob-client/src/main/java/tech/powerjob/client/TypeStore.java +++ b/powerjob-client/src/main/java/tech/powerjob/client/TypeStore.java @@ -1,6 +1,7 @@ package tech.powerjob.client; import com.alibaba.fastjson.TypeReference; +import tech.powerjob.client.module.AppAuthResult; import tech.powerjob.common.request.http.SaveJobInfoRequest; import tech.powerjob.common.response.*; @@ -14,11 +15,13 @@ */ public class TypeStore { + public static final TypeReference> APP_AUTH_RESULT_TYPE = new TypeReference>(){}; public static final TypeReference> VOID_RESULT_TYPE = new TypeReference>(){}; public static final TypeReference> INTEGER_RESULT_TYPE = new TypeReference>(){}; public static final TypeReference> LONG_RESULT_TYPE = new TypeReference>(){}; + public static final TypeReference> LONG_POWER_RESULT_TYPE = new TypeReference>(){}; public static final TypeReference> JOB_RESULT_TYPE = new TypeReference>(){}; @@ -30,6 +33,8 @@ public class TypeStore { public static final TypeReference>> LIST_INSTANCE_RESULT_TYPE = new TypeReference>>(){}; + public static final TypeReference>> PAGE_INSTANCE_RESULT_TYPE = new TypeReference>>(){}; + public static final TypeReference> WF_RESULT_TYPE = new TypeReference>() {}; public static final TypeReference> WF_INSTANCE_RESULT_TYPE = new TypeReference>() {}; diff --git a/powerjob-client/src/main/java/tech/powerjob/client/common/Protocol.java b/powerjob-client/src/main/java/tech/powerjob/client/common/Protocol.java new file mode 100644 index 000000000..5168a6424 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/common/Protocol.java @@ -0,0 +1,28 @@ +package tech.powerjob.client.common; + +import lombok.Getter; + +/** + * Protocol + * + * @author tjq + * @since 2024/2/20 + */ +@Getter +public enum Protocol { + + HTTP("http"), + + HTTPS("https"); + + private final String protocol; + + Protocol(String protocol) { + this.protocol = protocol; + } + + @Override + public String toString() { + return protocol; + } +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/extension/ClientExtension.java b/powerjob-client/src/main/java/tech/powerjob/client/extension/ClientExtension.java new file mode 100644 index 000000000..28e98f6ae --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/extension/ClientExtension.java @@ -0,0 +1,19 @@ +package tech.powerjob.client.extension; + +import java.util.List; + +/** + * 扩展服务 + * + * @author tjq + * @since 2024/8/11 + */ +public interface ClientExtension { + + /** + * 动态提供地址,适用于 server 部署在动态集群上的场景 + * @param context 上下文 + * @return 地址,格式要求同 ClientConfig#addressList + */ + List addressProvider(ExtensionContext context); +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/extension/ExtensionContext.java b/powerjob-client/src/main/java/tech/powerjob/client/extension/ExtensionContext.java new file mode 100644 index 000000000..c1d36b971 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/extension/ExtensionContext.java @@ -0,0 +1,10 @@ +package tech.powerjob.client.extension; + +/** + * 扩展上下文 + * + * @author tjq + * @since 2024/8/11 + */ +public class ExtensionContext { +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/module/AppAuthRequest.java b/powerjob-client/src/main/java/tech/powerjob/client/module/AppAuthRequest.java new file mode 100644 index 000000000..0e8c84dc6 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/module/AppAuthRequest.java @@ -0,0 +1,39 @@ +package tech.powerjob.client.module; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.util.Map; + +/** + * App 鉴权请求 + * + * @author tjq + * @since 2024/2/19 + */ +@Getter +@Setter +@ToString +public class AppAuthRequest implements Serializable { + + /** + * 应用名称 + */ + private String appName; + /** + * 加密后密码 + */ + private String encryptedPassword; + + /** + * 加密类型 + */ + private String encryptType; + + /** + * 额外参数,方便开发者传递其他参数 + */ + private Map extra; +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/module/AppAuthResult.java b/powerjob-client/src/main/java/tech/powerjob/client/module/AppAuthResult.java new file mode 100644 index 000000000..1e4029948 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/module/AppAuthResult.java @@ -0,0 +1,30 @@ +package tech.powerjob.client.module; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; +import java.util.Map; + +/** + * App 鉴权响应 + * + * @author tjq + * @since 2024/2/21 + */ +@Getter +@Setter +@ToString +public class AppAuthResult implements Serializable { + + private Long appId; + + private String token; + + /** + * 额外参数 + * 有安全需求的开发者可执行扩展 + */ + private Map extra; +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/service/HttpResponse.java b/powerjob-client/src/main/java/tech/powerjob/client/service/HttpResponse.java new file mode 100644 index 000000000..5b1b68e67 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/service/HttpResponse.java @@ -0,0 +1,26 @@ +package tech.powerjob.client.service; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Map; + +/** + * HTTP 响应 + * + * @author tjq + * @since 2024/8/10 + */ +@Data +@Accessors(chain = true) +public class HttpResponse implements Serializable { + + private boolean success; + + private int code; + + private String response; + + private Map headers; +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/service/PowerRequestBody.java b/powerjob-client/src/main/java/tech/powerjob/client/service/PowerRequestBody.java new file mode 100644 index 000000000..7b0ef1028 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/service/PowerRequestBody.java @@ -0,0 +1,47 @@ +package tech.powerjob.client.service; + +import com.google.common.collect.Maps; +import lombok.Getter; +import tech.powerjob.common.enums.MIME; + +import java.util.Map; + +/** + * 请求体 + * + * @author tjq + * @since 2024/8/10 + */ +@Getter +public class PowerRequestBody { + + private MIME mime; + + private Object payload; + + private final Map headers = Maps.newHashMap(); + + private PowerRequestBody() { + } + + public static PowerRequestBody newJsonRequestBody(Object data) { + PowerRequestBody powerRequestBody = new PowerRequestBody(); + powerRequestBody.mime = MIME.APPLICATION_JSON; + powerRequestBody.payload = data; + return powerRequestBody; + } + + public static PowerRequestBody newFormRequestBody(Map form) { + PowerRequestBody powerRequestBody = new PowerRequestBody(); + powerRequestBody.mime = MIME.APPLICATION_FORM; + powerRequestBody.payload = form; + return powerRequestBody; + } + + public void addHeaders(Map hs) { + if (hs == null || hs.isEmpty()) { + return; + } + this.headers.putAll(hs); + } +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/service/RequestService.java b/powerjob-client/src/main/java/tech/powerjob/client/service/RequestService.java new file mode 100644 index 000000000..14c2c8c69 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/service/RequestService.java @@ -0,0 +1,15 @@ +package tech.powerjob.client.service; + +import java.io.Closeable; + +/** + * 请求服务 + * + * @author tjq + * @since 2024/2/20 + */ +public interface RequestService extends Closeable { + + + String request(String path, PowerRequestBody powerRequestBody); +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/service/impl/AppAuthClusterRequestService.java b/powerjob-client/src/main/java/tech/powerjob/client/service/impl/AppAuthClusterRequestService.java new file mode 100644 index 000000000..de0466e0c --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/service/impl/AppAuthClusterRequestService.java @@ -0,0 +1,113 @@ +package tech.powerjob.client.service.impl; + +import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Maps; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import tech.powerjob.client.ClientConfig; +import tech.powerjob.client.TypeStore; +import tech.powerjob.client.module.AppAuthRequest; +import tech.powerjob.client.module.AppAuthResult; +import tech.powerjob.client.service.HttpResponse; +import tech.powerjob.client.service.PowerRequestBody; +import tech.powerjob.common.OpenAPIConstant; +import tech.powerjob.common.enums.EncryptType; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.common.utils.DigestUtils; +import tech.powerjob.common.utils.MapUtils; + +import java.util.Map; + +/** + * 封装鉴权相关逻辑 + * + * @author tjq + * @since 2024/2/21 + */ +@Slf4j +abstract class AppAuthClusterRequestService extends ClusterRequestService { + + protected AppAuthResult appAuthResult; + + public AppAuthClusterRequestService(ClientConfig config) { + super(config); + } + + + @Override + public String request(String path, PowerRequestBody powerRequestBody) { + // 若不存在 appAuthResult,则首先进行鉴权 + if (appAuthResult == null) { + refreshAppAuthResult(); + } + + HttpResponse httpResponse = doRequest(path, powerRequestBody); + + // 如果 auth 成功,则代表请求有效,直接返回 + String authStatus = MapUtils.getString(httpResponse.getHeaders(), OpenAPIConstant.RESPONSE_HEADER_AUTH_STATUS); + // 继续尝试获取转为小写之后的 auth header (Nginx代理默认会将自定义header转为纯小写, 实现针对该情况的兼容) + if (StringUtils.isEmpty(authStatus)) { + authStatus = MapUtils.getString(httpResponse.getHeaders(), + OpenAPIConstant.RESPONSE_HEADER_AUTH_STATUS.toLowerCase()); + } + if (Boolean.TRUE.toString().equalsIgnoreCase(authStatus)) { + return httpResponse.getResponse(); + } + + // 否则请求无效,刷新鉴权后重新请求 + log.warn("[PowerJobClient] auth failed[authStatus: {}], try to refresh the auth info", authStatus); + refreshAppAuthResult(); + httpResponse = doRequest(path, powerRequestBody); + + // 只要请求不失败,直接返回(如果鉴权失败则返回鉴权错误信息,server 保证 response 永远非空) + return httpResponse.getResponse(); + } + + private HttpResponse doRequest(String path, PowerRequestBody powerRequestBody) { + + // 添加鉴权信息 + Map authHeaders = buildAuthHeader(); + powerRequestBody.addHeaders(authHeaders); + + HttpResponse httpResponse = clusterHaRequest(path, powerRequestBody); + + // 任何请求不成功,都直接报错 + if (!httpResponse.isSuccess()) { + throw new PowerJobException("REMOTE_SERVER_INNER_EXCEPTION"); + } + return httpResponse; + } + + private Map buildAuthHeader() { + Map authHeader = Maps.newHashMap(); + authHeader.put(OpenAPIConstant.REQUEST_HEADER_APP_ID, String.valueOf(appAuthResult.getAppId())); + authHeader.put(OpenAPIConstant.REQUEST_HEADER_ACCESS_TOKEN, appAuthResult.getToken()); + return authHeader; + } + + @SneakyThrows + private void refreshAppAuthResult() { + AppAuthRequest appAuthRequest = buildAppAuthRequest(); + HttpResponse httpResponse = clusterHaRequest(OpenAPIConstant.AUTH_APP, PowerRequestBody.newJsonRequestBody(appAuthRequest)); + if (!httpResponse.isSuccess()) { + throw new PowerJobException("AUTH_APP_EXCEPTION!"); + } + ResultDTO authResultDTO = JSONObject.parseObject(httpResponse.getResponse(), TypeStore.APP_AUTH_RESULT_TYPE); + if (!authResultDTO.isSuccess()) { + throw new PowerJobException("AUTH_FAILED_" + authResultDTO.getMessage()); + } + + log.warn("[PowerJobClient] refresh auth info successfully!"); + this.appAuthResult = authResultDTO.getData(); + } + + protected AppAuthRequest buildAppAuthRequest() { + AppAuthRequest appAuthRequest = new AppAuthRequest(); + appAuthRequest.setAppName(config.getAppName()); + appAuthRequest.setEncryptedPassword(DigestUtils.md5(config.getPassword())); + appAuthRequest.setEncryptType(EncryptType.MD5.getCode()); + return appAuthRequest; + } +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/service/impl/ClusterRequestService.java b/powerjob-client/src/main/java/tech/powerjob/client/service/impl/ClusterRequestService.java new file mode 100644 index 000000000..d842201f8 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/service/impl/ClusterRequestService.java @@ -0,0 +1,140 @@ +package tech.powerjob.client.service.impl; + +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.client.ClientConfig; +import tech.powerjob.client.extension.ClientExtension; +import tech.powerjob.client.extension.ExtensionContext; +import tech.powerjob.client.service.HttpResponse; +import tech.powerjob.client.service.PowerRequestBody; +import tech.powerjob.client.service.RequestService; +import tech.powerjob.common.OpenAPIConstant; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.utils.CollectionUtils; + +import javax.net.ssl.X509TrustManager; +import java.io.IOException; +import java.security.cert.X509Certificate; +import java.util.List; +import java.util.Objects; + +/** + * 集群请求服务 + * 封装网络相关通用逻辑 + * + * @author tjq + * @since 2024/2/21 + */ +@Slf4j +abstract class ClusterRequestService implements RequestService { + + protected final ClientConfig config; + + /** + * 当前地址(上次请求成功的地址) + */ + protected String currentAddress; + + /** + * 地址格式 + * 协议://域名/OpenAPI/子路径 + */ + protected static final String URL_PATTERN = "%s://%s%s%s"; + + /** + * 默认超时时间 + */ + protected static final Integer DEFAULT_TIMEOUT_SECONDS = 2; + + protected static final int HTTP_SUCCESS_CODE = 200; + + public ClusterRequestService(ClientConfig config) { + this.config = config; + this.currentAddress = config.getAddressList().get(0); + } + + /** + * 具体某一次 HTTP 请求的实现 + * @param url 完整请求地址 + * @param body 请求体 + * @return 响应 + * @throws IOException 异常 + */ + protected abstract HttpResponse sendHttpRequest(String url, PowerRequestBody body) throws IOException; + + /** + * 封装集群请求能力 + * @param path 请求 PATH + * @param powerRequestBody 请求体 + * @return 响应 + */ + protected HttpResponse clusterHaRequest(String path, PowerRequestBody powerRequestBody) { + + // 先尝试默认地址 + String url = getUrl(path, currentAddress); + try { + return sendHttpRequest(url, powerRequestBody); + } catch (IOException e) { + log.warn("[ClusterRequestService] request url:{} failed, reason is {}.", url, e.toString()); + } + + List addressList = fetchAddressList(); + + // 失败,开始重试 + for (String addr : addressList) { + if (Objects.equals(addr, currentAddress)) { + continue; + } + url = getUrl(path, addr); + try { + HttpResponse res = sendHttpRequest(url, powerRequestBody); + log.warn("[ClusterRequestService] server change: from({}) -> to({}).", currentAddress, addr); + currentAddress = addr; + return res; + } catch (IOException e) { + log.warn("[ClusterRequestService] request url:{} failed, reason is {}.", url, e.toString()); + } + } + + log.error("[ClusterRequestService] do post for path: {} failed because of no server available in {}.", path, addressList); + throw new PowerJobException("no server available when send post request"); + } + + private List fetchAddressList() { + + ClientExtension clientExtension = config.getClientExtension(); + if (clientExtension != null) { + List addressList = clientExtension.addressProvider(new ExtensionContext()); + if (!CollectionUtils.isEmpty(addressList)) { + return addressList; + } + } + + return config.getAddressList(); + } + + /** + * 不验证证书 + * X.509 是一个国际标准,定义了公钥证书的格式。这个标准是由国际电信联盟(ITU-T)制定的,用于公钥基础设施(PKI)中数字证书的创建和分发。X.509证书主要用于在公开网络上验证实体的身份,如服务器或客户端的身份验证过程中,确保通信双方是可信的。X.509证书广泛应用于多种安全协议中,包括SSL/TLS,它是实现HTTPS的基础。 + */ + protected static class NoVerifyX509TrustManager implements X509TrustManager { + @Override + public void checkClientTrusted(X509Certificate[] arg0, String arg1) { + } + + @Override + public void checkServerTrusted(X509Certificate[] arg0, String arg1) { + // 不验证 + } + + @Override + public X509Certificate[] getAcceptedIssuers() { + return new X509Certificate[0]; + } + } + + + private String getUrl(String path, String address) { + String protocol = config.getProtocol().getProtocol(); + return String.format(URL_PATTERN, protocol, address, OpenAPIConstant.WEB_PATH, path); + } +} diff --git a/powerjob-client/src/main/java/tech/powerjob/client/service/impl/ClusterRequestServiceOkHttp3Impl.java b/powerjob-client/src/main/java/tech/powerjob/client/service/impl/ClusterRequestServiceOkHttp3Impl.java new file mode 100644 index 000000000..ff24f8d92 --- /dev/null +++ b/powerjob-client/src/main/java/tech/powerjob/client/service/impl/ClusterRequestServiceOkHttp3Impl.java @@ -0,0 +1,148 @@ +package tech.powerjob.client.service.impl; + +import com.google.common.collect.Maps; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import okhttp3.*; +import tech.powerjob.client.ClientConfig; +import tech.powerjob.client.common.Protocol; +import tech.powerjob.client.service.HttpResponse; +import tech.powerjob.client.service.PowerRequestBody; +import tech.powerjob.common.OmsConstant; +import tech.powerjob.common.serialize.JsonUtils; + +import javax.net.ssl.*; +import java.io.IOException; +import java.security.SecureRandom; +import java.util.Map; +import java.util.Optional; +import java.util.Set; +import java.util.concurrent.TimeUnit; + +/** + * desc + * + * @author tjq + * @since 2024/2/20 + */ +@Slf4j +public class ClusterRequestServiceOkHttp3Impl extends AppAuthClusterRequestService { + + private final OkHttpClient okHttpClient; + + + public ClusterRequestServiceOkHttp3Impl(ClientConfig config) { + super(config); + + // 初始化 HTTP 客户端 + if (Protocol.HTTPS.equals(config.getProtocol())) { + okHttpClient = initHttpsNoVerifyClient(); + } else { + okHttpClient = initHttpClient(); + } + } + + @Override + protected HttpResponse sendHttpRequest(String url, PowerRequestBody powerRequestBody) throws IOException { + + // 添加公共 header + powerRequestBody.addHeaders(config.getDefaultHeaders()); + + Object obj = powerRequestBody.getPayload(); + + RequestBody requestBody = null; + + switch (powerRequestBody.getMime()) { + case APPLICATION_JSON: + MediaType jsonType = MediaType.parse(OmsConstant.JSON_MEDIA_TYPE); + String body = obj instanceof String ? (String) obj : JsonUtils.toJSONStringUnsafe(obj); + requestBody = RequestBody.create(jsonType, body); + + break; + case APPLICATION_FORM: + FormBody.Builder formBuilder = new FormBody.Builder(); + Map formObj = (Map) obj; + formObj.forEach(formBuilder::add); + requestBody = formBuilder.build(); + } + + Request request = new Request.Builder() + .post(requestBody) + .headers(Headers.of(powerRequestBody.getHeaders())) + .url(url) + .build(); + + try (Response response = okHttpClient.newCall(request).execute()) { + + int code = response.code(); + HttpResponse httpResponse = new HttpResponse() + .setCode(code) + .setSuccess(code == HTTP_SUCCESS_CODE); + + ResponseBody body = response.body(); + if (body != null) { + httpResponse.setResponse(body.string()); + } + + Headers respHeaders = response.headers(); + Set headerNames = respHeaders.names(); + Map respHeaderMap = Maps.newHashMap(); + headerNames.forEach(hdKey -> respHeaderMap.put(hdKey, respHeaders.get(hdKey))); + + httpResponse.setHeaders(respHeaderMap); + + return httpResponse; + } + } + + @SneakyThrows + private OkHttpClient initHttpClient() { + OkHttpClient.Builder okHttpBuilder = commonOkHttpBuilder(); + return okHttpBuilder.build(); + } + + @SneakyThrows + private OkHttpClient initHttpsNoVerifyClient() { + + X509TrustManager trustManager = new NoVerifyX509TrustManager(); + + SSLContext sslContext = SSLContext.getInstance("TLS"); + sslContext.init(null, new TrustManager[]{trustManager}, new SecureRandom()); + SSLSocketFactory sslSocketFactory = sslContext.getSocketFactory(); + + OkHttpClient.Builder okHttpBuilder = commonOkHttpBuilder(); + + // 不需要校验证书 + okHttpBuilder.sslSocketFactory(sslSocketFactory, trustManager); + // 不校验 url中的 hostname + okHttpBuilder.hostnameVerifier((String hostname, SSLSession session) -> true); + + + return okHttpBuilder.build(); + } + + private OkHttpClient.Builder commonOkHttpBuilder() { + return new OkHttpClient.Builder() + // 设置读取超时时间 + .readTimeout(Optional.ofNullable(config.getReadTimeout()).orElse(DEFAULT_TIMEOUT_SECONDS), TimeUnit.SECONDS) + // 设置写的超时时间 + .writeTimeout(Optional.ofNullable(config.getWriteTimeout()).orElse(DEFAULT_TIMEOUT_SECONDS), TimeUnit.SECONDS) + // 设置连接超时时间 + .connectTimeout(Optional.ofNullable(config.getConnectionTimeout()).orElse(DEFAULT_TIMEOUT_SECONDS), TimeUnit.SECONDS) + .callTimeout(Optional.ofNullable(config.getConnectionTimeout()).orElse(DEFAULT_TIMEOUT_SECONDS), TimeUnit.SECONDS); + } + + @Override + public void close() throws IOException { + + // 关闭 Dispatcher + okHttpClient.dispatcher().executorService().shutdown(); + // 清理连接池 + okHttpClient.connectionPool().evictAll(); + // 清理缓存(如果有使用) + Cache cache = okHttpClient.cache(); + if (cache != null) { + cache.close(); + } + } +} diff --git a/powerjob-client/src/test/java/tech/powerjob/client/test/ClientInitializer.java b/powerjob-client/src/test/java/tech/powerjob/client/test/ClientInitializer.java index 8617ac673..4cad73ba2 100644 --- a/powerjob-client/src/test/java/tech/powerjob/client/test/ClientInitializer.java +++ b/powerjob-client/src/test/java/tech/powerjob/client/test/ClientInitializer.java @@ -1,5 +1,6 @@ package tech.powerjob.client.test; +import com.google.common.collect.Lists; import org.junit.jupiter.api.BeforeAll; import tech.powerjob.client.IPowerJobClient; import tech.powerjob.client.PowerJobClient; @@ -16,6 +17,6 @@ public class ClientInitializer { @BeforeAll public static void initClient() throws Exception { - powerJobClient = new PowerJobClient("127.0.0.1:7700", "powerjob-worker-samples", "powerjob123"); + powerJobClient = new PowerJobClient(Lists.newArrayList("127.0.0.1:7700", "127.0.0.1:7701"), "powerjob-worker-samples", "powerjob123"); } } diff --git a/powerjob-client/src/test/java/tech/powerjob/client/test/TestClient.java b/powerjob-client/src/test/java/tech/powerjob/client/test/TestClient.java index ded4b51c2..9c1b30c04 100644 --- a/powerjob-client/src/test/java/tech/powerjob/client/test/TestClient.java +++ b/powerjob-client/src/test/java/tech/powerjob/client/test/TestClient.java @@ -1,19 +1,19 @@ package tech.powerjob.client.test; import com.alibaba.fastjson.JSONObject; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Assertions; +import org.junit.jupiter.api.Test; import tech.powerjob.client.PowerJobClient; import tech.powerjob.common.enums.ExecuteType; import tech.powerjob.common.enums.ProcessorType; import tech.powerjob.common.enums.TimeExpressionType; import tech.powerjob.common.request.http.SaveJobInfoRequest; +import tech.powerjob.common.request.query.InstancePageQuery; import tech.powerjob.common.response.InstanceInfoDTO; import tech.powerjob.common.response.JobInfoDTO; import tech.powerjob.common.response.ResultDTO; -import lombok.SneakyThrows; -import org.junit.jupiter.api.Assertions; -import org.junit.jupiter.api.Test; - -import java.util.concurrent.TimeUnit; /** * Test cases for {@link PowerJobClient} @@ -22,17 +22,18 @@ * @author Echo009 * @since 2020/4/15 */ +@Slf4j class TestClient extends ClientInitializer { - public static final long JOB_ID = 4L; + public static final long JOB_ID = 1L; @Test void testSaveJob() { SaveJobInfoRequest newJobInfo = new SaveJobInfoRequest(); newJobInfo.setId(JOB_ID); - newJobInfo.setJobName("omsOpenAPIJobccccc"); - newJobInfo.setJobDescription("test OpenAPI"); + newJobInfo.setJobName("omsOpenAPIJobccccc" + System.currentTimeMillis()); + newJobInfo.setJobDescription("test OpenAPI" + System.currentTimeMillis()); newJobInfo.setJobParams("{'aa':'bb'}"); newJobInfo.setTimeExpressionType(TimeExpressionType.CRON); newJobInfo.setTimeExpression("0 0 * * * ? "); @@ -45,8 +46,10 @@ void testSaveJob() { newJobInfo.setMinMemorySpace(1.2); newJobInfo.setMinDiskSpace(1.3); + log.info("[TestClient] [testSaveJob] SaveJobInfoRequest: {}", JSONObject.toJSONString(newJobInfo)); + ResultDTO resultDTO = powerJobClient.saveJob(newJobInfo); - System.out.println(JSONObject.toJSONString(resultDTO)); + log.info("[TestClient] [testSaveJob] result: {}", JSONObject.toJSONString(resultDTO)); Assertions.assertNotNull(resultDTO); } @@ -107,21 +110,32 @@ void testRunJobDelay() { @Test void testFetchInstanceInfo() { - ResultDTO res = powerJobClient.fetchInstanceInfo(205436386851946560L); + ResultDTO res = powerJobClient.fetchInstanceInfo(702482902331424832L); System.out.println(res); Assertions.assertNotNull(res); } + @Test + void testQueryInstanceInfo() { + InstancePageQuery instancePageQuery = new InstancePageQuery(); + instancePageQuery.setJobIdEq(11L); + instancePageQuery.setSortBy("actualTriggerTime"); + instancePageQuery.setAsc(true); + instancePageQuery.setPageSize(3); + instancePageQuery.setStatusIn(Lists.newArrayList(1,2,5)); + TestUtils.output(powerJobClient.queryInstanceInfo(instancePageQuery)); + } + @Test void testStopInstance() { - ResultDTO res = powerJobClient.stopInstance(205436995885858880L); + ResultDTO res = powerJobClient.stopInstance(702482902331424832L); System.out.println(res); Assertions.assertNotNull(res); } @Test void testFetchInstanceStatus() { - ResultDTO res = powerJobClient.fetchInstanceStatus(205436995885858880L); + ResultDTO res = powerJobClient.fetchInstanceStatus(702482902331424832L); System.out.println(res); Assertions.assertNotNull(res); } @@ -135,19 +149,19 @@ void testCancelInstanceInTimeWheel() { Assertions.assertTrue(cancelRes.isSuccess()); } - @Test - @SneakyThrows - void testCancelInstanceInDatabase() { - ResultDTO startRes = powerJobClient.runJob(15L, "start by OhMyClient", 2000000); - System.out.println("runJob result: " + JSONObject.toJSONString(startRes)); - - // Restart server manually and clear all the data in time wheeler. - TimeUnit.MINUTES.sleep(1); - - ResultDTO cancelRes = powerJobClient.cancelInstance(startRes.getData()); - System.out.println("cancelJob result: " + JSONObject.toJSONString(cancelRes)); - Assertions.assertTrue(cancelRes.isSuccess()); - } +// @Test +// @SneakyThrows +// void testCancelInstanceInDatabase() { +// ResultDTO startRes = powerJobClient.runJob(15L, "start by OhMyClient", 2000000); +// System.out.println("runJob result: " + JSONObject.toJSONString(startRes)); +// +// // Restart server manually and clear all the data in time wheeler. +// TimeUnit.MINUTES.sleep(1); +// +// ResultDTO cancelRes = powerJobClient.cancelInstance(startRes.getData()); +// System.out.println("cancelJob result: " + JSONObject.toJSONString(cancelRes)); +// Assertions.assertTrue(cancelRes.isSuccess()); +// } @Test void testRetryInstance() { diff --git a/powerjob-client/src/test/java/tech/powerjob/client/test/TestClusterHA.java b/powerjob-client/src/test/java/tech/powerjob/client/test/TestClusterHA.java new file mode 100644 index 000000000..e10cc8d32 --- /dev/null +++ b/powerjob-client/src/test/java/tech/powerjob/client/test/TestClusterHA.java @@ -0,0 +1,35 @@ +package tech.powerjob.client.test; + +import com.alibaba.fastjson.JSONObject; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import tech.powerjob.common.response.JobInfoDTO; +import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.common.utils.CommonUtils; + +/** + * 测试容灾能力 + * + * @author tjq + * @since 2024/8/11 + */ +@Slf4j +public class TestClusterHA extends ClientInitializer { + + @Test + void testHa() { + // 人工让 server 启停 + for (int i = 0; i < 1000000; i++) { + + CommonUtils.easySleep(100); + + ResultDTO jobInfoDTOResultDTO = powerJobClient.fetchJob(1L); + + log.info("[TestClusterHA] response: {}", JSONObject.toJSONString(jobInfoDTOResultDTO)); + + if (!jobInfoDTOResultDTO.isSuccess()) { + throw new RuntimeException("request failed!"); + } + } + } +} diff --git a/powerjob-client/src/test/java/tech/powerjob/client/test/TestInstance.java b/powerjob-client/src/test/java/tech/powerjob/client/test/TestInstance.java new file mode 100644 index 000000000..2f6349f63 --- /dev/null +++ b/powerjob-client/src/test/java/tech/powerjob/client/test/TestInstance.java @@ -0,0 +1,44 @@ +package tech.powerjob.client.test; + +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; +import tech.powerjob.common.request.http.RunJobRequest; +import tech.powerjob.common.request.query.InstancePageQuery; +import tech.powerjob.common.response.InstanceInfoDTO; +import tech.powerjob.common.response.PageResult; +import tech.powerjob.common.response.PowerResultDTO; +import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.common.serialize.JsonUtils; + +/** + * 测试任务实例 + * + * @author tjq + * @since 2025/8/17 + */ +@Slf4j +public class TestInstance extends ClientInitializer { + + private static final Long jobId = 1L; + + @Test + void testOuterKeyAndExtendValue() { + String outerKey = "ok_" + System.currentTimeMillis(); + RunJobRequest runJobRequest = new RunJobRequest() + .setJobId(jobId) + .setOuterKey(outerKey).setExtendValue("TEST_EXT_VALUE") + .setInstanceParams("OpenAPI-Params") + .setDelay(1000L); + + PowerResultDTO runJobResult = powerJobClient.runJob(runJobRequest); + log.info("[TestInstance] runJobResult: {}", runJobResult); + Long instanceId = runJobResult.getData(); + + InstancePageQuery instancePageQuery = new InstancePageQuery(); + instancePageQuery.setOuterKeyEq(outerKey); + ResultDTO> pageResultResultDTO = powerJobClient.queryInstanceInfo(instancePageQuery); + log.info("[TestInstance] queryInstanceInfo: {}", JsonUtils.toJSONString(pageResultResultDTO)); + + assert pageResultResultDTO.getData().getData().get(0).getInstanceId().equals(instanceId); + } +} diff --git a/powerjob-client/src/test/java/tech/powerjob/client/test/TestUtils.java b/powerjob-client/src/test/java/tech/powerjob/client/test/TestUtils.java new file mode 100644 index 000000000..e09f4071b --- /dev/null +++ b/powerjob-client/src/test/java/tech/powerjob/client/test/TestUtils.java @@ -0,0 +1,17 @@ +package tech.powerjob.client.test; + +import com.alibaba.fastjson.JSONObject; + +/** + * TestUtils + * + * @author tjq + * @since 2024/11/21 + */ +public class TestUtils { + + public static void output(Object v) { + String str = JSONObject.toJSONString(v); + System.out.println(str); + } +} diff --git a/powerjob-client/src/test/java/tech/powerjob/client/test/TestWorkflow.java b/powerjob-client/src/test/java/tech/powerjob/client/test/TestWorkflow.java index 1b6206c2d..b12a1562f 100644 --- a/powerjob-client/src/test/java/tech/powerjob/client/test/TestWorkflow.java +++ b/powerjob-client/src/test/java/tech/powerjob/client/test/TestWorkflow.java @@ -29,7 +29,7 @@ */ class TestWorkflow extends ClientInitializer { - private static final long WF_ID = 1; + private static final long WF_ID = 2; @Test void initTestData() { diff --git a/powerjob-common/pom.xml b/powerjob-common/pom.xml index d6640019d..de37509b0 100644 --- a/powerjob-common/pom.xml +++ b/powerjob-common/pom.xml @@ -5,12 +5,13 @@ powerjob tech.powerjob - 4.3.6 + 5.1.2 4.0.0 powerjob-common - 4.3.6 + powerjob-common + 5.1.2 jar @@ -20,7 +21,7 @@ 31.1-jre 3.14.9 5.3.0 - 2.14.0-rc1 + 2.14.3 5.9.0 @@ -77,6 +78,13 @@ jackson-databind ${jackson.version} + + + com.fasterxml.jackson.datatype + jackson-datatype-jsr310 + ${jackson.version} + + diff --git a/powerjob-common/src/main/java/tech/powerjob/common/OmsConstant.java b/powerjob-common/src/main/java/tech/powerjob/common/OmsConstant.java index f589e869a..4d40d3239 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/OmsConstant.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/OmsConstant.java @@ -30,4 +30,6 @@ public class OmsConstant { public static final String HTTP_HEADER_CONTENT_TYPE = "Content-Type"; public static final String JSON_MEDIA_TYPE = "application/json; charset=utf-8"; + + public static final String NULL = "null"; } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/OpenAPIConstant.java b/powerjob-common/src/main/java/tech/powerjob/common/OpenAPIConstant.java index 2b9da25a4..198346f05 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/OpenAPIConstant.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/OpenAPIConstant.java @@ -16,6 +16,8 @@ private OpenAPIConstant(){ public static final String ASSERT = "/assert"; + public static final String AUTH_APP = "/authApp"; + /* ************* JOB 区 ************* */ public static final String SAVE_JOB = "/saveJob"; @@ -29,6 +31,7 @@ private OpenAPIConstant(){ public static final String ENABLE_JOB = "/enableJob"; public static final String DELETE_JOB = "/deleteJob"; public static final String RUN_JOB = "/runJob"; + public static final String RUN_JOB2 = "/runJob2"; /* ************* Instance 区 ************* */ @@ -56,4 +59,12 @@ private OpenAPIConstant(){ public static final String RETRY_WORKFLOW_INSTANCE = "/retryWfInstance"; public static final String FETCH_WORKFLOW_INSTANCE_INFO = "/fetchWfInstanceInfo"; public static final String MARK_WORKFLOW_NODE_AS_SUCCESS = "/markWorkflowNodeAsSuccess"; + + /* ************* 鉴权 ************* */ + + public static final String REQUEST_HEADER_ACCESS_TOKEN = "X-POWERJOB-ACCESS-TOKEN"; + + public static final String REQUEST_HEADER_APP_ID = "X-POWERJOB-APP-ID"; + + public static final String RESPONSE_HEADER_AUTH_STATUS = "X-POWERJOB-AUTH-PASSED"; } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/PowerJobDKey.java b/powerjob-common/src/main/java/tech/powerjob/common/PowerJobDKey.java index 92c3a3530..c06323286 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/PowerJobDKey.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/PowerJobDKey.java @@ -55,4 +55,26 @@ public class PowerJobDKey { */ public static final String FREQUENCY_JOB_MAX_INTERVAL = "powerjob.server.frequency-job.max-interval"; + /* ******************* 系统纬度参数,低频使用 ******************* */ + /** + * 自行指定可用CPU核数 + */ + public static final String SYS_AVAILABLE_PROCESSORS = "powerjob.system.available-processors"; + + /* ******************* 不太可能有人用的参数,主要方便内部测试 ******************* */ + + /** + * 最大活跃任务数量,超出部分 SWAP 到磁盘以提升性能 + */ + public static final String WORKER_RUNTIME_SWAP_MAX_ACTIVE_TASK_NUM = "powerjob.worker.swap.max-active-task-num"; + + public static final String WORKER_RUNTIME_SWAP_TASK_SCHEDULE_INTERVAL_MS = "powerjob.worker.swap.scan-interval"; + + public static final String SERVER_TEST_ACCOUNT_USERNAME = "powerjob.server.test-accounts"; + + /** + * 特殊环境,test 代表测试环境,trial 代表试用环境 + */ + public static final String SP_ENV = "powerjob.sp-env"; + } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enhance/SafeRunnable.java b/powerjob-common/src/main/java/tech/powerjob/common/enhance/SafeRunnable.java new file mode 100644 index 000000000..73075995b --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/enhance/SafeRunnable.java @@ -0,0 +1,26 @@ +package tech.powerjob.common.enhance; + +import lombok.extern.slf4j.Slf4j; + +import java.util.concurrent.ScheduledExecutorService; + +/** + * 安全的 runnable,可防止因抛出异常导致周期性任务终止 + * 使用 {@link ScheduledExecutorService} 执行任务时,推荐继承此类捕获并打印异常,避免因为抛出异常导致周期性任务终止 + * + * @author songyinyin + * @since 2023/9/20 15:52 + */ +@Slf4j +public abstract class SafeRunnable implements Runnable{ + @Override + public void run() { + try { + run0(); + } catch (Exception e) { + log.error("[SafeRunnable] run failed", e); + } + } + + protected abstract void run0(); +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enhance/SafeRunnableWrapper.java b/powerjob-common/src/main/java/tech/powerjob/common/enhance/SafeRunnableWrapper.java new file mode 100644 index 000000000..2c847507d --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/enhance/SafeRunnableWrapper.java @@ -0,0 +1,30 @@ +package tech.powerjob.common.enhance; + +import lombok.extern.slf4j.Slf4j; + +import java.util.concurrent.ScheduledExecutorService; + +/** + * 使用 {@link ScheduledExecutorService} 执行任务时,推荐使用此对象包装一层,避免因为抛出异常导致周期性任务终止 + * + * @author songyinyin + * @since 2023/9/20 16:04 + */ +@Slf4j +public class SafeRunnableWrapper implements Runnable { + + private final Runnable runnable; + + public SafeRunnableWrapper(Runnable runnable) { + this.runnable = runnable; + } + + @Override + public void run() { + try { + runnable.run(); + } catch (Exception e) { + log.error("[SafeRunnableWrapper] run failed", e); + } + } +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enums/DispatchStrategy.java b/powerjob-common/src/main/java/tech/powerjob/common/enums/DispatchStrategy.java index 23157a001..deebc3508 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/enums/DispatchStrategy.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/enums/DispatchStrategy.java @@ -13,8 +13,19 @@ @AllArgsConstructor public enum DispatchStrategy { + /** + * 健康度优先 + */ HEALTH_FIRST(1), - RANDOM(2); + /** + * 随机 + */ + RANDOM(2), + /** + * 指定执行 + */ + SPECIFY(11) + ; private final int v; diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enums/EncryptType.java b/powerjob-common/src/main/java/tech/powerjob/common/enums/EncryptType.java new file mode 100644 index 000000000..3ce0eaa85 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/enums/EncryptType.java @@ -0,0 +1,22 @@ +package tech.powerjob.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 加密类型 + * + * @author tjq + * @since 2024/8/10 + */ +@Getter +@AllArgsConstructor +public enum EncryptType { + + NONE("none"), + + MD5("md5") + ; + + private final String code; +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enums/ErrorCodes.java b/powerjob-common/src/main/java/tech/powerjob/common/enums/ErrorCodes.java new file mode 100644 index 000000000..2542f5fb5 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/enums/ErrorCodes.java @@ -0,0 +1,75 @@ +package tech.powerjob.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 鉴权错误信息 + * + * @author tjq + * @since 2024/2/11 + */ +@Getter +@AllArgsConstructor +public enum ErrorCodes { + + USER_NOT_LOGIN("-100", "UserNotLoggedIn"), + USER_NOT_EXIST("-101", "UserNotExist"), + USER_AUTH_FAILED("-102", "UserAuthFailed"), + /** + * 账户被停用 + */ + USER_DISABLED("-103", "UserDisabled"), + + + NO_PERMISSION("-200", "NoPermission"), + + /** + * 无效请求,一般是参数问题 + */ + INVALID_REQUEST("-300", "INVALID_REQUEST"), + + INCORRECT_PASSWORD("-400", "INCORRECT_PASSWORD"), + + /** + * 非法令牌 + */ + INVALID_TOKEN("-401", "INVALID_TOKEN"), + /** + * 无效 APP(无法找到 app) + */ + INVALID_APP("-402", "INVALID_APP"), + + /** + * 令牌过期 + */ + TOKEN_EXPIRED("-403", "TOKEN_EXPIRED"), + + /** + * 系统内部异常 + */ + SYSTEM_UNKNOWN_ERROR("-500", "SYS_UNKNOWN_ERROR"), + /** + * 非法参数 + */ + ILLEGAL_ARGS_ERROR("-501", "ILLEGAL_ARGS_ERROR"), + /** + * 不允许操作 + */ + OPERATION_NOT_PERMITTED("-502", "OPERATION_NOT_PERMITTED"), + + /** + * OPENAPI 错误码号段 -10XX + */ + OPEN_API_AUTH_FAILED("-1002", "OPEN_API_AUTH_FAILED"), + + /** + * PowerJobClient 错误码号段 + */ + CLIENT_HTTP_REQUEST_FAILED("-2001", "CLIENT_HTTP_REQUEST_FAILED"), + + ; + + private final String code; + private final String msg; +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enums/MIME.java b/powerjob-common/src/main/java/tech/powerjob/common/enums/MIME.java new file mode 100644 index 000000000..b5a15c782 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/enums/MIME.java @@ -0,0 +1,22 @@ +package tech.powerjob.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 消息内容类型 + * + * @author tjq + * @since 2024/8/10 + */ +@Getter +@AllArgsConstructor +public enum MIME { + + APPLICATION_JSON("application/json; charset=utf-8"), + + APPLICATION_FORM("application/x-www-form-urlencoded") + ; + + private final String code; +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enums/Protocol.java b/powerjob-common/src/main/java/tech/powerjob/common/enums/Protocol.java index 363c925d7..ce89dfe51 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/enums/Protocol.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/enums/Protocol.java @@ -13,7 +13,8 @@ public enum Protocol { AKKA, - HTTP; + HTTP, + MU; public static Protocol of(String protocol) { if (StringUtils.isEmpty(protocol)) { diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enums/SpEnv.java b/powerjob-common/src/main/java/tech/powerjob/common/enums/SpEnv.java new file mode 100644 index 000000000..f4efcfeda --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/enums/SpEnv.java @@ -0,0 +1,27 @@ +package tech.powerjob.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 特殊环境 + * + * @author tjq + * @since 2025/8/17 + */ +@Getter +@AllArgsConstructor +public enum SpEnv { + + /** + * 测试环境 + */ + TEST("test"), + /** + * 试用环境 + */ + TRIAL("trial") + ; + + private final String code; +} diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/constants/SwitchableStatus.java b/powerjob-common/src/main/java/tech/powerjob/common/enums/SwitchableStatus.java similarity index 84% rename from powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/constants/SwitchableStatus.java rename to powerjob-common/src/main/java/tech/powerjob/common/enums/SwitchableStatus.java index e143553c4..e01300b62 100644 --- a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/constants/SwitchableStatus.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/enums/SwitchableStatus.java @@ -1,4 +1,4 @@ -package tech.powerjob.server.common.constants; +package tech.powerjob.common.enums; import lombok.AllArgsConstructor; import lombok.Getter; @@ -13,10 +13,16 @@ @AllArgsConstructor public enum SwitchableStatus { /** - * + * 启用 */ ENABLE(1), + /** + * 关闭 + */ DISABLE(2), + /** + * 软删除 + */ DELETED(99); private final int v; diff --git a/powerjob-common/src/main/java/tech/powerjob/common/enums/TaskTrackerBehavior.java b/powerjob-common/src/main/java/tech/powerjob/common/enums/TaskTrackerBehavior.java new file mode 100644 index 000000000..3d081e6c4 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/enums/TaskTrackerBehavior.java @@ -0,0 +1,42 @@ +package tech.powerjob.common.enums; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * TaskTracker 行为枚举 + * + * @author tjq + * @since 2024/2/24 + */ +@Getter +@AllArgsConstructor +public enum TaskTrackerBehavior { + + /** + * 普通:不特殊处理,参与集群计算,会导致 TaskTracker 负载比常规节点高。适用于节点数不那么多,任务不那么繁重的场景 + */ + NORMAL(1), + /** + * 划水:只负责管理节点,不参与计算,稳定性最优。适用于节点数量非常多的大规模计算场景,少一个计算节点来换取稳定性提升 + */ + PADDLING(11) + ; + + + private final Integer v; + + public static TaskTrackerBehavior of(Integer type) { + + if (type == null) { + return NORMAL; + } + + for (TaskTrackerBehavior t : values()) { + if (t.v.equals(type)) { + return t; + } + } + return NORMAL; + } +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/exception/PowerJobException.java b/powerjob-common/src/main/java/tech/powerjob/common/exception/PowerJobException.java index d9ecda6dd..442e5bcdf 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/exception/PowerJobException.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/exception/PowerJobException.java @@ -1,13 +1,21 @@ package tech.powerjob.common.exception; +import lombok.Getter; +import lombok.Setter; +import tech.powerjob.common.enums.ErrorCodes; + /** * PowerJob 运行时异常 * * @author tjq * @since 2020/5/26 */ +@Setter +@Getter public class PowerJobException extends RuntimeException { + protected String code; + public PowerJobException() { } @@ -15,6 +23,11 @@ public PowerJobException(String message) { super(message); } + public PowerJobException(ErrorCodes errorCode, String extraMsg) { + super(extraMsg == null ? errorCode.getMsg() : errorCode.getMsg().concat(":").concat(extraMsg)); + this.code = errorCode.getCode(); + } + public PowerJobException(String message, Throwable cause) { super(message, cause); } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/exception/PowerJobExceptionLauncher.java b/powerjob-common/src/main/java/tech/powerjob/common/exception/PowerJobExceptionLauncher.java new file mode 100644 index 000000000..d86e13af7 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/exception/PowerJobExceptionLauncher.java @@ -0,0 +1,17 @@ +package tech.powerjob.common.exception; + + +import tech.powerjob.common.enums.ErrorCodes; + +/** + * PowerJobExceptionLauncher + * + * @author tjq + * @since 2024/11/22 + */ +public class PowerJobExceptionLauncher { + + public PowerJobExceptionLauncher(ErrorCodes errorCode, String message) { + throw new PowerJobException(errorCode, message); + } +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/model/InstanceDetail.java b/powerjob-common/src/main/java/tech/powerjob/common/model/InstanceDetail.java index f249783d2..0d003f1cc 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/model/InstanceDetail.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/model/InstanceDetail.java @@ -1,8 +1,8 @@ package tech.powerjob.common.model; -import tech.powerjob.common.PowerSerializable; import lombok.Data; import lombok.NoArgsConstructor; +import tech.powerjob.common.PowerSerializable; import java.util.List; @@ -49,10 +49,26 @@ public class InstanceDetail implements PowerSerializable { */ private String instanceParams; + /** + * “外键”,用于 OPENAPI 场景业务场景与 PowerJob 实例的绑定 + */ + private String outerKey; + /** + * 扩展属性,用于 OPENAPI 场景上下文参数的透传 + */ + private String extendValue; + /** * Task detail, used by MapReduce or Broadcast tasks. + * 命名有点问题,实际是 task 统计信息 */ private TaskDetail taskDetail; + + /** + * 查询出来的 Task 详细结果 + */ + private List queriedTaskDetailInfoList; + /** * Sub instance details, used by frequent tasks. */ @@ -92,5 +108,14 @@ public static class TaskDetail implements PowerSerializable { private long totalTaskNum; private long succeedTaskNum; private long failedTaskNum; + + // 等待派发状态(仅存在 TaskTracker 数据库中) + protected Long waitingDispatchTaskNum; + // 已派发,但 ProcessorTracker 未确认,可能由于网络错误请求未送达,也有可能 ProcessorTracker 线程池满,拒绝执行 + protected Long workerUnreceivedTaskNum; + // ProcessorTracker确认接收,存在与线程池队列中,排队执行 + protected Long receivedTaskNum; + // ProcessorTracker正在执行 + protected Long runningTaskNum; } } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/model/InstanceMeta.java b/powerjob-common/src/main/java/tech/powerjob/common/model/InstanceMeta.java new file mode 100644 index 000000000..8463a4a6f --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/model/InstanceMeta.java @@ -0,0 +1,23 @@ +package tech.powerjob.common.model; + +import lombok.Data; +import tech.powerjob.common.PowerSerializable; + +/** + * 调度元信息 + * + * @author tjq + * @since 2025/8/17 + */ +@Data +public class InstanceMeta implements PowerSerializable { + + /** + * expectTriggerTime + * 原始的期望调度时间(无论重试N次都保留最开始的期望调度时间) + */ + private Long ett; + + public InstanceMeta() { + } +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/model/JobAdvancedRuntimeConfig.java b/powerjob-common/src/main/java/tech/powerjob/common/model/JobAdvancedRuntimeConfig.java new file mode 100644 index 000000000..1d3690a2d --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/model/JobAdvancedRuntimeConfig.java @@ -0,0 +1,25 @@ +package tech.powerjob.common.model; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import lombok.experimental.Accessors; + +/** + * 任务运行时高级配置 + * + * @author tjq + * @since 2024/2/24 + */ +@Getter +@Setter +@ToString +@Accessors(chain = true) +public class JobAdvancedRuntimeConfig { + + /** + * MR 任务专享参数,TaskTracker 行为 {@link tech.powerjob.common.enums.TaskTrackerBehavior} + */ + private Integer taskTrackerBehavior; + +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/model/TaskDetailInfo.java b/powerjob-common/src/main/java/tech/powerjob/common/model/TaskDetailInfo.java new file mode 100644 index 000000000..5390e51fd --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/model/TaskDetailInfo.java @@ -0,0 +1,43 @@ +package tech.powerjob.common.model; + +import lombok.Data; +import lombok.experimental.Accessors; +import tech.powerjob.common.PowerSerializable; + +/** + * Task 详细信息 + * + * @author tjq + * @since 2024/2/25 + */ +@Data +@Accessors(chain = true) +public class TaskDetailInfo implements PowerSerializable { + + private String taskId; + private String taskName; + /** + * 任务对象(map 的 subTask) + */ + private String taskContent; + /** + * 处理器地址 + */ + private String processorAddress; + private Integer status; + private String statusStr; + private String result; + private Integer failedCnt; + /** + * 创建时间 + */ + private Long createdTime; + /** + * 最后修改时间 + */ + private Long lastModifiedTime; + /** + * ProcessorTracker 最后上报时间 + */ + private Long lastReportTime; +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/request/ServerQueryInstanceStatusReq.java b/powerjob-common/src/main/java/tech/powerjob/common/request/ServerQueryInstanceStatusReq.java index a37dfbf21..e692c6237 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/request/ServerQueryInstanceStatusReq.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/request/ServerQueryInstanceStatusReq.java @@ -17,4 +17,11 @@ public class ServerQueryInstanceStatusReq implements PowerSerializable { private Long instanceId; + /** + * 自定义查询 + * 针对高阶用户,直接开放底库查询,便于运维和排查问题 + * 此处只传递查询条件,前置拼接 select *,后置拼接 limit + */ + private String customQuery; + } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/request/ServerScheduleJobReq.java b/powerjob-common/src/main/java/tech/powerjob/common/request/ServerScheduleJobReq.java index ac8df5033..735a36ccf 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/request/ServerScheduleJobReq.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/request/ServerScheduleJobReq.java @@ -97,4 +97,14 @@ public class ServerScheduleJobReq implements PowerSerializable { * 日志配置 */ private String logConfig; + + /** + * 高级运行时配置 + */ + private String advancedRuntimeConfig; + + /** + * 调度元信息 + */ + private String meta; } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/request/http/RunJobRequest.java b/powerjob-common/src/main/java/tech/powerjob/common/request/http/RunJobRequest.java new file mode 100644 index 000000000..9c1a68956 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/request/http/RunJobRequest.java @@ -0,0 +1,37 @@ +package tech.powerjob.common.request.http; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 运行任务 + * + * @author tjq + * @since 2025/8/16 + */ +@Data +@Accessors(chain = true) +public class RunJobRequest { + + private Long jobId; + /** + * 运行时参数 + */ + private String instanceParams; + /** + * 延迟执行的时间,单位毫秒 + */ + private Long delay; + + /** + * “外键”,用于 OPENAPI 场景业务场景与 PowerJob 实例的绑定 + */ + private String outerKey; + /** + * 扩展属性,用于 OPENAPI 场景上下文参数的透传 + */ + private String extendValue; + + /* 无需填写,系统自动填充 */ + private Long appId; +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/request/http/SaveJobInfoRequest.java b/powerjob-common/src/main/java/tech/powerjob/common/request/http/SaveJobInfoRequest.java index 65fd892b1..4b7097369 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/request/http/SaveJobInfoRequest.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/request/http/SaveJobInfoRequest.java @@ -5,6 +5,7 @@ import tech.powerjob.common.enums.ProcessorType; import tech.powerjob.common.enums.TimeExpressionType; import tech.powerjob.common.model.AlarmConfig; +import tech.powerjob.common.model.JobAdvancedRuntimeConfig; import tech.powerjob.common.model.LogConfig; import tech.powerjob.common.model.LifeCycle; import tech.powerjob.common.utils.CommonUtils; @@ -134,6 +135,11 @@ public class SaveJobInfoRequest { private DispatchStrategy dispatchStrategy; + /** + * 某种派发策略背后的具体配置,值取决于 dispatchStrategy + */ + private String dispatchStrategyConfig; + private LifeCycle lifeCycle; /** * alarm config @@ -150,6 +156,10 @@ public class SaveJobInfoRequest { */ private LogConfig logConfig; + /** + * 高级运行时配置 + */ + private JobAdvancedRuntimeConfig advancedRuntimeConfig; /** * Check non-null properties. diff --git a/powerjob-common/src/main/java/tech/powerjob/common/request/query/InstancePageQuery.java b/powerjob-common/src/main/java/tech/powerjob/common/request/query/InstancePageQuery.java new file mode 100644 index 000000000..36b7db4e0 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/request/query/InstancePageQuery.java @@ -0,0 +1,38 @@ +package tech.powerjob.common.request.query; + +import lombok.Getter; +import lombok.Setter; + +import java.util.Date; +import java.util.List; + +/** + * 任务实例分页查询 + * + * @author tjq + * @since 2024/11/21 + */ +@Getter +@Setter +public class InstancePageQuery extends PowerPageQuery { + + private Long instanceIdEq; + private Long instanceIdLt; + private Long instanceIdGt; + + /** + * 根据业务外建查询 + */ + private String outerKeyEq; + + private Long jobIdEq; + + private List statusIn; + + + private Date gmtCreateLt; + private Date gmtCreateGt; + + private Date gmtModifiedLt; + private Date gmtModifiedGt; +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/request/query/PowerPageQuery.java b/powerjob-common/src/main/java/tech/powerjob/common/request/query/PowerPageQuery.java new file mode 100644 index 000000000..cd65139bf --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/request/query/PowerPageQuery.java @@ -0,0 +1,41 @@ +package tech.powerjob.common.request.query; + +import lombok.Getter; +import lombok.Setter; +import tech.powerjob.common.PowerQuery; + +import java.io.Serializable; + +/** + * 分页查询 + * + * @author tjq + * @since 2024/11/21 + */ +@Getter +@Setter +public class PowerPageQuery extends PowerQuery implements Serializable { + + + /* ****************** 分页参数 ****************** */ + /** + * 当前页码 + */ + protected Integer index = 0; + /** + * 页大小 + */ + protected Integer pageSize = 10; + + /* ****************** 排序参数 ****************** */ + + /** + * 排序参数,如 gmtCreate、instanceId + */ + protected String sortBy; + + /** + * asc是指定列按升序排列,desc则是指定列按降序排列 + */ + protected boolean asc = false; +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/response/InstanceInfoDTO.java b/powerjob-common/src/main/java/tech/powerjob/common/response/InstanceInfoDTO.java index f75d62bbe..6e3ae2f67 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/response/InstanceInfoDTO.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/response/InstanceInfoDTO.java @@ -72,6 +72,15 @@ public class InstanceInfoDTO { */ private Long runningTimes; + /** + * “外键”,用于 OPENAPI 场景业务场景与 PowerJob 实例的绑定 + */ + private String outerKey; + /** + * 扩展属性,用于 OPENAPI 场景上下文参数的透传 + */ + private String extendValue; + private Date gmtCreate; private Date gmtModified; } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/response/JobInfoDTO.java b/powerjob-common/src/main/java/tech/powerjob/common/response/JobInfoDTO.java index 34b63613c..9b62d2e60 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/response/JobInfoDTO.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/response/JobInfoDTO.java @@ -2,6 +2,7 @@ import lombok.Data; import tech.powerjob.common.model.AlarmConfig; +import tech.powerjob.common.model.JobAdvancedRuntimeConfig; import tech.powerjob.common.model.LogConfig; import java.util.Date; @@ -121,7 +122,14 @@ public class JobInfoDTO { private String extra; + /** + * 派发策略 + */ private Integer dispatchStrategy; + /** + * 某种派发策略背后的具体配置,值取决于 dispatchStrategy + */ + private String dispatchStrategyConfig; private String lifecycle; @@ -137,4 +145,5 @@ public class JobInfoDTO { */ private LogConfig logConfig; + private JobAdvancedRuntimeConfig advancedRuntimeConfig; } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/response/PageResult.java b/powerjob-common/src/main/java/tech/powerjob/common/response/PageResult.java new file mode 100644 index 000000000..a90c5ee59 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/response/PageResult.java @@ -0,0 +1,42 @@ +package tech.powerjob.common.response; + +import lombok.Data; +import lombok.NoArgsConstructor; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.List; + +/** + * 分页对象 + * + * @author tjq + * @since 2020/4/12 + */ +@Data +@NoArgsConstructor +@Accessors(chain = true) +public class PageResult implements Serializable { + + /** + * 当前页数 + */ + private int index; + /** + * 页大小 + */ + private int pageSize; + /** + * 总页数 + */ + private int totalPages; + /** + * 总数据量 + */ + private long totalItems; + /** + * 数据 + */ + private List data; + +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/response/PowerResultDTO.java b/powerjob-common/src/main/java/tech/powerjob/common/response/PowerResultDTO.java new file mode 100644 index 000000000..e582f764c --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/response/PowerResultDTO.java @@ -0,0 +1,47 @@ +package tech.powerjob.common.response; + +import lombok.Getter; +import lombok.Setter; +import org.apache.commons.lang3.exception.ExceptionUtils; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.common.exception.PowerJobException; + +/** + * 新的 Result,带状态码 + * + * @author 程序帕鲁 + * @since 2024/2/19 + */ +@Getter +@Setter +public class PowerResultDTO extends ResultDTO { + + private String code; + + public static PowerResultDTO s(T data) { + PowerResultDTO r = new PowerResultDTO<>(); + r.success = true; + r.data = data; + return r; + } + + public static PowerResultDTO f(String message) { + PowerResultDTO r = new PowerResultDTO<>(); + r.success = false; + r.message = message; + return r; + } + + public static PowerResultDTO f(Throwable t) { + PowerResultDTO f = f(ExceptionUtils.getStackTrace(t)); + f.setCode(ErrorCodes.SYSTEM_UNKNOWN_ERROR.getCode()); + return f; + } + + public static PowerResultDTO f(PowerJobException pje) { + PowerResultDTO f = f(pje.getMessage()); + f.setCode(pje.getCode()); + return f; + } + +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/response/ResultDTO.java b/powerjob-common/src/main/java/tech/powerjob/common/response/ResultDTO.java index 03e1dc6be..5cd905193 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/response/ResultDTO.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/response/ResultDTO.java @@ -8,6 +8,11 @@ /** * The result object returned by the request + *

+ * 低版本由于 Jackson 序列化配置问题,导致无法在此对象上新增任何字段了,否则会报错 com.fasterxml.jackson.databind.exc.UnrecognizedPropertyException: Unrecognized field "code" (class tech.powerjob.common.response.ObjectResultDTO), not marked as ignorable (3 known properties: "data", "success", "message"]) + * at [Source: (String)"{"success":true,"code":null,"data":2,"message":null}"; line: 1, column: 28] (through reference chain: tech.powerjob.common.response.ObjectResultDTO["code"]) + *

+ * 短期内所有的新增字段需求,都通过新对象继承实现 * * @author tjq * @since 2020/3/30 @@ -17,9 +22,9 @@ @ToString public class ResultDTO implements PowerSerializable { - private boolean success; - private T data; - private String message; + protected boolean success; + protected T data; + protected String message; public static ResultDTO success(T data) { ResultDTO r = new ResultDTO<>(); diff --git a/powerjob-common/src/main/java/tech/powerjob/common/serialize/JsonUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/serialize/JsonUtils.java index 0480357a9..7f280bde6 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/serialize/JsonUtils.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/serialize/JsonUtils.java @@ -1,8 +1,9 @@ package tech.powerjob.common.serialize; +import com.fasterxml.jackson.annotation.JsonInclude; import com.fasterxml.jackson.core.JsonParser; -import com.fasterxml.jackson.core.JsonProcessingException; import com.fasterxml.jackson.core.type.TypeReference; +import com.fasterxml.jackson.databind.DeserializationFeature; import com.fasterxml.jackson.databind.MapperFeature; import com.fasterxml.jackson.databind.json.JsonMapper; import lombok.extern.slf4j.Slf4j; @@ -28,8 +29,20 @@ public class JsonUtils { .configure(MapperFeature.PROPAGATE_TRANSIENT_MARKER, true) .configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true) .configure(JsonParser.Feature.IGNORE_UNDEFINED, true) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) .build(); + static { + JSON_MAPPER.setSerializationInclusion(JsonInclude.Include.NON_NULL); + + // 非核心功能可降级,尽可能降低依赖冲突概率 + try { + JSON_MAPPER.registerModule(new com.fasterxml.jackson.datatype.jsr310.JavaTimeModule()); + } catch (Exception e) { + log.warn("[JsonUtils] registerJavaTimeModule failed, PowerJob can't process Java 8 date/time type now!", e); + } + } + private static final TypeReference> MAP_TYPE_REFERENCE = new TypeReference> () {}; private JsonUtils(){ @@ -37,6 +50,9 @@ private JsonUtils(){ } public static String toJSONString(Object obj) { + if (obj == null) { + return null; + } if (obj instanceof String) { return (String) obj; } @@ -55,8 +71,9 @@ public static String toJSONStringUnsafe(Object obj) { try { return JSON_MAPPER.writeValueAsString(obj); }catch (Exception e) { - throw new PowerJobException(e); + ExceptionUtils.rethrow(e); } + throw new ImpossibleException(); } public static byte[] toBytes(Object obj) { @@ -68,7 +85,7 @@ public static byte[] toBytes(Object obj) { return null; } - public static T parseObject(String json, Class clz) throws JsonProcessingException { + public static T parseObject(String json, Class clz) throws Exception { return JSON_MAPPER.readValue(json, clz); } @@ -110,6 +127,9 @@ public static T parseObjectIgnoreException(String json, Class clz) { } public static T parseObjectUnsafe(String json, Class clz) { + if (json == null) { + return null; + } try { return JSON_MAPPER.readValue(json, clz); }catch (Exception e) { @@ -117,4 +137,11 @@ public static T parseObjectUnsafe(String json, Class clz) { } throw new PowerJobException("impossible"); } + + public static T toJavaObject(Object o, Class clz) { + if (o == null) { + return null; + } + return JSON_MAPPER.convertValue(o, clz); + } } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/CommonUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/CommonUtils.java index 498d5b731..d787f3373 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/utils/CommonUtils.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/CommonUtils.java @@ -7,6 +7,8 @@ import org.apache.commons.lang3.time.DateFormatUtils; import java.util.Collection; +import java.util.Date; +import java.util.Map; import java.util.UUID; import java.util.function.Supplier; @@ -128,6 +130,16 @@ public static T requireNonNull(T obj, String msg) { throw new PowerJobException(msg); } } + if (obj instanceof Collection) { + if (CollectionUtils.isEmpty((Collection) obj)) { + throw new PowerJobException(msg); + } + } + if (obj instanceof Map) { + if (MapUtils.isEmpty((Map) obj)) { + throw new PowerJobException(msg); + } + } return obj; } @@ -147,6 +159,13 @@ public static String formatTime(Long ts) { return OmsConstant.NONE; } + public static String formatTime(Date date) { + if (date == null) { + return OmsConstant.NONE; + } + return formatTime(date.getTime()); + } + /** * 格式化字符串,如果是 null 或空则显示 N/A * @param str 字符串 diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/DigestUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/DigestUtils.java new file mode 100644 index 000000000..4feeb90c0 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/DigestUtils.java @@ -0,0 +1,47 @@ +package tech.powerjob.common.utils; + +import lombok.SneakyThrows; +import org.apache.commons.lang3.StringUtils; + +import java.math.BigInteger; +import java.security.MessageDigest; + +/** + * 加密工具 + * + * @author tjq + * @since 2023/3/25 + */ +public class DigestUtils { + + /** + * 32位小写 md5 + * @param input 输入 + * @return md5 + */ + @SneakyThrows + public static String md5(String input) { + + if (StringUtils.isEmpty(input)) { + return null; + } + + MessageDigest md5 = MessageDigest.getInstance("MD5"); + md5.update(input.getBytes()); + byte[] byteArray = md5.digest(); + + BigInteger bigInt = new BigInteger(1, byteArray); + // 参数16表示16进制 + StringBuilder result = new StringBuilder(bigInt.toString(16)); + // 不足32位高位补零 + while(result.length() < 32) { + result.insert(0, "0"); + } + return result.toString(); + } + + public static String rePassword(String password, String salt) { + String f1 = String.format("%s_%s_z", salt, password); + return String.format("%s_%s_b", salt, md5(f1)); + } +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/HttpUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/HttpUtils.java index fa65ff834..ceb2af526 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/utils/HttpUtils.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/HttpUtils.java @@ -21,6 +21,7 @@ public class HttpUtils { client = new OkHttpClient.Builder() .connectTimeout(1, TimeUnit.SECONDS) .readTimeout(5, TimeUnit.SECONDS) + .writeTimeout(10, TimeUnit.SECONDS) .build(); } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/MapUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/MapUtils.java new file mode 100644 index 000000000..dd57bfcd9 --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/MapUtils.java @@ -0,0 +1,86 @@ +package tech.powerjob.common.utils; + +import java.text.NumberFormat; +import java.text.ParseException; +import java.util.Map; + +/** + * MapUtils + * + * @author tjq + * @since 2024/2/24 + */ +public class MapUtils { + + public static String getString(Map map, K key) { + if (map != null) { + Object answer = map.get(key); + if (answer != null) { + return answer.toString(); + } + } + + return null; + } + + public static String getString(Map map, K key, String defaultValue) { + String answer = getString(map, key); + if (answer == null) { + answer = defaultValue; + } + + return answer; + } + + public static Long getLong(Map map, K key, Long defaultValue) { + Long answer = getLong(map, key); + if (answer == null) { + answer = defaultValue; + } + + return answer; + } + + public static long getLongValue(Map map, K key) { + Long longObject = getLong(map, key); + return longObject == null ? 0L : longObject; + } + + public static Long getLong(Map map, K key) { + Number answer = getNumber(map, key); + if (answer == null) { + return null; + } else { + return answer instanceof Long ? (Long)answer : answer.longValue(); + } + } + + public static Number getNumber(Map map, K key) { + if (map != null) { + Object answer = map.get(key); + if (answer != null) { + if (answer instanceof Number) { + return (Number)answer; + } + + if (answer instanceof String) { + try { + String text = (String)answer; + return NumberFormat.getInstance().parse(text); + } catch (ParseException var4) { + } + } + } + } + + return null; + } + + public static boolean isEmpty(Map map) { + return map == null || map.isEmpty(); + } + + public static boolean isNotEmpty(Map map) { + return !isEmpty(map); + } +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/NetUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/NetUtils.java index 56fa7b3b7..5b7ebbff1 100644 --- a/powerjob-common/src/main/java/tech/powerjob/common/utils/NetUtils.java +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/NetUtils.java @@ -77,6 +77,10 @@ public static boolean checkIpPortAvailable(String ip, int port) { * @return 本机 IP 地址 */ public static String getLocalHost() { + return getLocalHostWithNetworkInterfaceChecker(null); + } + + public static String getLocalHostWithNetworkInterfaceChecker(NetworkInterfaceChecker networkInterfaceChecker) { if (HOST_ADDRESS != null) { return HOST_ADDRESS; } @@ -87,31 +91,39 @@ public static String getLocalHost() { return HOST_ADDRESS = addressFromJVM; } - InetAddress address = getLocalAddress(); + InetAddress address = getLocalAddress(networkInterfaceChecker); if (address != null) { return HOST_ADDRESS = address.getHostAddress(); } return LOCALHOST_VALUE; } + /** + * 隔离调用 scope,核心场景才能直接调用 getLocalHost,方便查看使用点 + * @return IP + */ + public static String getLocalHost4Test() { + return getLocalHost(); + } + /** * Find first valid IP from local network card * * @return first valid local IP */ - public static InetAddress getLocalAddress() { + public static InetAddress getLocalAddress(NetworkInterfaceChecker networkInterfaceChecker) { if (LOCAL_ADDRESS != null) { return LOCAL_ADDRESS; } - InetAddress localAddress = getLocalAddress0(); + InetAddress localAddress = getLocalAddress0(networkInterfaceChecker); LOCAL_ADDRESS = localAddress; return localAddress; } - private static InetAddress getLocalAddress0() { + private static InetAddress getLocalAddress0(NetworkInterfaceChecker networkInterfaceChecker) { // @since 2.7.6, choose the {@link NetworkInterface} first try { - InetAddress addressOp = getFirstReachableInetAddress( findNetworkInterface()); + InetAddress addressOp = getFirstReachableInetAddress( findNetworkInterface(networkInterfaceChecker)); if (addressOp != null) { return addressOp; } @@ -161,7 +173,7 @@ private static InetAddress getFirstReachableInetAddress(NetworkInterface network * @return If no {@link NetworkInterface} is available , return null * @since 2.7.6 */ - public static NetworkInterface findNetworkInterface() { + public static NetworkInterface findNetworkInterface(NetworkInterfaceChecker networkInterfaceChecker) { List validNetworkInterfaces = emptyList(); try { @@ -176,7 +188,11 @@ public static NetworkInterface findNetworkInterface() { // Try to find the preferred one for (NetworkInterface networkInterface : validNetworkInterfaces) { if (isPreferredNetworkInterface(networkInterface)) { - log.info("[Net] use preferred network interface: {}", networkInterface.getDisplayName()); + log.info("[Net] use preferred network interface: {}", networkInterface); + return networkInterface; + } + if (isPassedCheckNetworkInterface(networkInterface, networkInterfaceChecker)) { + log.info("[Net] use PassedCheckNetworkInterface: {}", networkInterface); return networkInterface; } } @@ -191,6 +207,26 @@ public static NetworkInterface findNetworkInterface() { return first(validNetworkInterfaces); } + /** + * 通过用户方法判断是否为目标网卡 + * @param networkInterface networkInterface + * @param networkInterfaceChecker 判断方法 + * @return true or false + */ + static boolean isPassedCheckNetworkInterface(NetworkInterface networkInterface, NetworkInterfaceChecker networkInterfaceChecker) { + if (networkInterfaceChecker == null) { + return false; + } + try { + boolean ok = networkInterfaceChecker.ok(networkInterface, getFirstReachableInetAddress(networkInterface)); + log.info("[Net] try to choose NetworkInterface by NetworkInterfaceChecker, current NetworkInterface[{}], ok: {}", networkInterface, ok); + return ok; + } catch (Exception e) { + log.warn("[Net] isPassedCheckerNetworkInterface failed, current networkInterface: {}", networkInterface, e); + } + return false; + } + private static Optional toValidAddress(InetAddress address) { if (address instanceof Inet6Address) { Inet6Address v6Address = (Inet6Address) address; @@ -344,4 +380,9 @@ static boolean ignoreInterfaceByConfig(String interfaceName) { } return false; } + + @FunctionalInterface + public interface NetworkInterfaceChecker { + boolean ok(NetworkInterface networkInterface, InetAddress inetAddress); + } } diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/SysUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/SysUtils.java new file mode 100644 index 000000000..019fe8edc --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/SysUtils.java @@ -0,0 +1,50 @@ +package tech.powerjob.common.utils; + +import org.apache.commons.lang3.StringUtils; +import tech.powerjob.common.PowerJobDKey; +import tech.powerjob.common.enums.SpEnv; + +/** + * 系统工具 + * + * @author tjq + * @since 2025/8/17 + */ +public class SysUtils { + + /** + * 可用处理器核数 + * @return 可用处理器核数 + */ + public static int availableProcessors() { + String property = System.getProperty(PowerJobDKey.SYS_AVAILABLE_PROCESSORS); + if (StringUtils.isEmpty(property)) { + return Runtime.getRuntime().availableProcessors(); + } + return Integer.parseInt(property); + } + + /** + * 判断是否为测试环境 + * @return 测试环境 + */ + public static boolean isTestEnv() { + String property = System.getProperty(PowerJobDKey.SP_ENV); + if (StringUtils.isEmpty(property)) { + return false; + } + return SpEnv.TEST.getCode().equalsIgnoreCase(property); + } + + /** + * 判断是否为试用环境 + * @return 试用环境 + */ + public static boolean isTrialEnv() { + String property = System.getProperty(PowerJobDKey.SP_ENV); + if (StringUtils.isEmpty(property)) { + return false; + } + return SpEnv.TRIAL.getCode().equalsIgnoreCase(property); + } +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongServer.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongServer.java new file mode 100644 index 000000000..53e4f0c3e --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongServer.java @@ -0,0 +1,14 @@ +package tech.powerjob.common.utils.net; + +import java.io.Closeable; + +/** + * socket 服务器,用于进行连通性测试 + * + * @author tjq + * @since 2024/2/8 + */ +public interface PingPongServer extends Closeable { + + void initialize(int port) throws Exception; +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongSocketServer.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongSocketServer.java new file mode 100644 index 000000000..1ec93d74b --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongSocketServer.java @@ -0,0 +1,63 @@ +package tech.powerjob.common.utils.net; + +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.common.utils.CommonUtils; + +import java.io.IOException; +import java.io.OutputStream; +import java.net.ServerSocket; +import java.net.Socket; +import java.nio.charset.StandardCharsets; + +/** + * 简易服务器 + * + * @author tjq + * @since 2024/2/8 + */ +@Slf4j +public class PingPongSocketServer implements PingPongServer { + + private Thread thread; + + private ServerSocket serverSocket; + + private volatile boolean terminated = false; + + @Override + public void initialize(int port) throws Exception{ + serverSocket = new ServerSocket(port); + + thread = new Thread(() -> { + while (true) { + if (terminated) { + return; + } + // 接收连接,如果没有连接,accept() 方法会阻塞 + try (Socket socket = serverSocket.accept();OutputStream outputStream = socket.getOutputStream();) { + + socket.setSoTimeout(2000); + socket.setKeepAlive(false); + + outputStream.write(PingPongUtils.PONG.getBytes(StandardCharsets.UTF_8)); + // BufferedReader.readLine() 会等待直到遇到换行符(\n)或回车符(\r\n),才会返回一行内容。如果服务器发送的数据没有这些换行符,readLine() 会一直阻塞,直到超时 + outputStream.write(System.lineSeparator().getBytes(StandardCharsets.UTF_8)); + outputStream.flush(); + } catch (Exception e) { + if (!terminated) { + log.warn("[PingPongSocketServer] process accepted socket failed!", e); + } + } + } + }, "PingPongSocketServer-Thread"); + + thread.start(); + } + + @Override + public void close() throws IOException { + terminated = true; + CommonUtils.executeIgnoreException(() -> serverSocket.close()); + thread.interrupt(); + } +} diff --git a/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongUtils.java b/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongUtils.java new file mode 100644 index 000000000..821f7352c --- /dev/null +++ b/powerjob-common/src/main/java/tech/powerjob/common/utils/net/PingPongUtils.java @@ -0,0 +1,56 @@ +package tech.powerjob.common.utils.net; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.exception.ExceptionUtils; + +import java.io.*; +import java.net.Socket; +import java.net.UnknownHostException; +import java.nio.charset.StandardCharsets; + +/** + * socket 连通性助手 + * + * @author tjq + * @since 2024/2/8 + */ +@Slf4j +public class PingPongUtils { + + static final String PING = "ping"; + static final String PONG = "pong"; + + /** + * 验证目标 IP 和 端口的连通性 + * @param targetIp 目标 IP + * @param targetPort 目标端口 + * @return true or false + */ + public static boolean checkConnectivity(String targetIp, int targetPort) { + + try (Socket s = new Socket(targetIp, targetPort);InputStream is = s.getInputStream();OutputStream os = s.getOutputStream();BufferedReader br = new BufferedReader(new InputStreamReader(is))) { + + s.setSoTimeout(2000); + s.setKeepAlive(false); + + // 发送 PING 请求 + os.write(PING.getBytes(StandardCharsets.UTF_8)); + os.flush(); + + //读取服务器返回的消息 + String content = br.readLine(); + + if (PONG.equalsIgnoreCase(content)) { + return true; + } + } catch (UnknownHostException e) { + log.warn("[SocketConnectivityUtils] unknown host: {}:{}", targetIp, targetPort); + } catch (IOException e) { + log.warn("[SocketConnectivityUtils] IOException: {}:{}, msg: {}", targetIp, targetPort, ExceptionUtils.getMessage(e)); + } catch (Exception e) { + log.error("[SocketConnectivityUtils] unknown exception for check ip: {}:{}", targetIp, targetPort, e); + } + + return false; + } +} diff --git a/powerjob-common/src/test/java/NetUtilsTest.java b/powerjob-common/src/test/java/NetUtilsTest.java index 7d6c562a4..98bfeda01 100644 --- a/powerjob-common/src/test/java/NetUtilsTest.java +++ b/powerjob-common/src/test/java/NetUtilsTest.java @@ -12,19 +12,19 @@ public class NetUtilsTest { @Test public void testOrigin() { - System.out.println(NetUtils.getLocalHost()); + System.out.println(NetUtils.getLocalHost4Test()); } @Test public void testPreferredNetworkInterface() { System.setProperty(PowerJobDKey.PREFERRED_NETWORK_INTERFACE, "en5"); - System.out.println(NetUtils.getLocalHost()); + System.out.println(NetUtils.getLocalHost4Test()); } @Test public void testIgnoredNetworkInterface() { System.setProperty(PowerJobDKey.IGNORED_NETWORK_INTERFACE_REGEX, "utun.|llw."); - System.out.println(NetUtils.getLocalHost()); + System.out.println(NetUtils.getLocalHost4Test()); } } diff --git a/powerjob-common/src/test/java/tech/powerjob/common/serialize/JsonUtilsTest.java b/powerjob-common/src/test/java/tech/powerjob/common/serialize/JsonUtilsTest.java new file mode 100644 index 000000000..3e8b029e5 --- /dev/null +++ b/powerjob-common/src/test/java/tech/powerjob/common/serialize/JsonUtilsTest.java @@ -0,0 +1,81 @@ +package tech.powerjob.common.serialize; + +import lombok.Data; +import lombok.EqualsAndHashCode; +import lombok.SneakyThrows; +import lombok.experimental.Accessors; +import lombok.extern.slf4j.Slf4j; +import org.junit.jupiter.api.Test; + +import java.io.Serializable; +import java.time.LocalDateTime; +import java.util.Map; + +/** + * test json utils + * + * @author tjq + * @since 2024/3/16 + */ +@Slf4j +class JsonUtilsTest { + + @Test + @SneakyThrows + void simpleTest() { + Person person = new Person().setName("mubao").setAge(18); + String jsonString = JsonUtils.toJSONString(person); + log.info("[JsonUtilsTest] person: {}, jsonString: {}", person, jsonString); + assert jsonString != null; + Person person2 = JsonUtils.parseObject(jsonString, Person.class); + assert person2.equals(person); + } + + @Test + @SneakyThrows + void testAdvanceApi() { + PersonPlus personPlus = new PersonPlus(); + personPlus.setName("gongbao").setAge(3); + personPlus.setBirthDay(LocalDateTime.now()); + + String jsonString = JsonUtils.toJSONString(personPlus); + PersonPlus personPlus2 = JsonUtils.parseObject(jsonString, PersonPlus.class); + assert personPlus2.equals(personPlus); + } + + @Test + @SneakyThrows + void testMoreOrLessFields() { + PersonPlus personPlus = new PersonPlus().setBirthDay(LocalDateTime.now()); + personPlus.setName("gongbao").setAge(3); + + String originJsonStr = JsonUtils.toJSONString(personPlus); + + Map personPlusMapMore = JsonUtils.parseMap(originJsonStr); + personPlusMapMore.put("extraKey", System.currentTimeMillis()); + + PersonPlus personPlusByMoreFieldsJsonStr = JsonUtils.parseObject(JsonUtils.toJSONString(personPlusMapMore), PersonPlus.class); + assert personPlusByMoreFieldsJsonStr.equals(personPlus); + + Map personPlusMapLess = JsonUtils.parseMap(originJsonStr); + personPlusMapLess.remove("birthDay"); + + PersonPlus personPlusByLessFieldsJsonStr = JsonUtils.parseObject(JsonUtils.toJSONString(personPlusMapLess), PersonPlus.class); + assert personPlusByLessFieldsJsonStr.getName().equals(personPlus.getName()); + assert personPlusByLessFieldsJsonStr.getAge().equals(personPlus.getAge()); + } + + @Data + @Accessors(chain = true) + static class Person implements Serializable { + private String name; + private Integer age; + } + + @Data + @Accessors(chain = true) + @EqualsAndHashCode(callSuper = true) + static class PersonPlus extends Person { + private LocalDateTime birthDay; + } +} \ No newline at end of file diff --git a/powerjob-common/src/test/java/tech/powerjob/common/utils/CommonUtilsTest.java b/powerjob-common/src/test/java/tech/powerjob/common/utils/CommonUtilsTest.java new file mode 100644 index 000000000..26453dd4d --- /dev/null +++ b/powerjob-common/src/test/java/tech/powerjob/common/utils/CommonUtilsTest.java @@ -0,0 +1,39 @@ +package tech.powerjob.common.utils; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import org.junit.jupiter.api.Test; +import tech.powerjob.common.exception.PowerJobException; + +import java.util.Collections; +import java.util.Map; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * CommonUtilsTest + * + * @author tjq + * @since 2024/8/11 + */ +class CommonUtilsTest { + + @Test + void testRequireNonNull() { + + assertThrowsExactly(PowerJobException.class, () -> CommonUtils.requireNonNull(null, "NULL_OBJ")); + assertThrowsExactly(PowerJobException.class, () -> CommonUtils.requireNonNull("", "EMPTY_STR")); + assertThrowsExactly(PowerJobException.class, () -> CommonUtils.requireNonNull(Lists.newArrayList(), "EMPTY_COLLECTION")); + assertThrowsExactly(PowerJobException.class, () -> CommonUtils.requireNonNull(Collections.emptyMap(), "EMPTY_MAP")); + + Map map = Maps.newHashMap(); + map.put("1", 1); + + CommonUtils.requireNonNull(1, "NORMAL"); + CommonUtils.requireNonNull("1", "NORMAL"); + CommonUtils.requireNonNull(Lists.newArrayList("1"), "NORMAL"); + CommonUtils.requireNonNull(map, "NORMAL"); + + } + +} \ No newline at end of file diff --git a/powerjob-common/src/test/java/tech/powerjob/common/utils/net/PingPongSocketServerTest.java b/powerjob-common/src/test/java/tech/powerjob/common/utils/net/PingPongSocketServerTest.java new file mode 100644 index 000000000..0d559111e --- /dev/null +++ b/powerjob-common/src/test/java/tech/powerjob/common/utils/net/PingPongSocketServerTest.java @@ -0,0 +1,31 @@ +package tech.powerjob.common.utils.net; + +import org.junit.jupiter.api.Test; +import tech.powerjob.common.utils.NetUtils; + +/** + * desc + * + * @author tjq + * @since 2024/2/8 + */ +class PingPongSocketServerTest { + + @Test + void test() throws Exception { + + int port = 8877; + + PingPongSocketServer pingPongSocketServer = new PingPongSocketServer(); + pingPongSocketServer.initialize(port); + + System.out.println("[PingPongSocketServerTest] finished initialize"); + + assert PingPongUtils.checkConnectivity(NetUtils.getLocalHost(), port); + + assert !PingPongUtils.checkConnectivity(NetUtils.getLocalHost(), port + 1); + + pingPongSocketServer.close(); + System.out.println("[PingPongSocketServerTest] finished close"); + } +} \ No newline at end of file diff --git a/powerjob-official-processors/pom.xml b/powerjob-official-processors/pom.xml index 7a4eb979f..56229b1f5 100644 --- a/powerjob-official-processors/pom.xml +++ b/powerjob-official-processors/pom.xml @@ -5,12 +5,13 @@ powerjob tech.powerjob - 4.3.6 + 5.1.2 4.0.0 powerjob-official-processors - 4.3.6 + powerjob-official-processors + 5.1.2 jar @@ -19,12 +20,11 @@ 5.9.1 - 1.2.9 - 4.3.6 - 5.2.9.RELEASE - 2.2.220 + 1.2.13 + 5.1.2 + 2.2.224 8.0.28 - 5.3.23 + 5.3.31 1.2.83 @@ -87,7 +87,7 @@ org.springframework spring-jdbc - ${spring.jdbc.version} + ${spring.version} test diff --git a/powerjob-official-processors/src/main/java/tech/powerjob/official/processors/impl/VerificationProcessor.java b/powerjob-official-processors/src/main/java/tech/powerjob/official/processors/impl/VerificationProcessor.java index 4588c22e5..e8768be6b 100644 --- a/powerjob-official-processors/src/main/java/tech/powerjob/official/processors/impl/VerificationProcessor.java +++ b/powerjob-official-processors/src/main/java/tech/powerjob/official/processors/impl/VerificationProcessor.java @@ -4,6 +4,7 @@ import com.google.common.collect.Lists; import lombok.*; import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.lang3.StringUtils; import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.utils.NetUtils; import tech.powerjob.official.processors.CommonBasicProcessor; @@ -35,10 +36,12 @@ protected ProcessResult process0(TaskContext taskContext) throws Exception { final OmsLogger omsLogger = taskContext.getOmsLogger(); final String paramsStr = CommonUtils.parseParams(taskContext); - final VerificationParam verificationParam = JSONObject.parseObject(paramsStr, VerificationParam.class); + final VerificationParam verificationParam = StringUtils.isEmpty(paramsStr) ? new VerificationParam() : JSONObject.parseObject(paramsStr, VerificationParam.class); final Mode mode = Mode.of(verificationParam.getMode()); + omsLogger.info("META: {}", taskContext.getInstanceMeta()); + switch (mode) { case ERROR: return new ProcessResult(false, "EXECUTE_FAILED_FOR_TEST"); @@ -123,14 +126,14 @@ public ProcessResult reduce(TaskContext context, List taskResults) { @Override public ProcessResult preProcess(TaskContext context) throws Exception { - context.getOmsLogger().info("start to preProcess, current worker IP is {}.", NetUtils.getLocalHost()); + context.getOmsLogger().info("start to preProcess, current worker IP is {}.", NetUtils.getLocalHost4Test()); return new ProcessResult(true, "preProcess successfully!"); } @Override public ProcessResult postProcess(TaskContext context, List taskResults) throws Exception { OmsLogger omsLogger = context.getOmsLogger(); - omsLogger.info("start to postProcess, current worker IP is {}.", NetUtils.getLocalHost()); + omsLogger.info("start to postProcess, current worker IP is {}.", NetUtils.getLocalHost4Test()); omsLogger.info("====== All Node's Process Result ======"); taskResults.forEach(r -> omsLogger.info("taskId:{},success:{},result:{}", r.getTaskId(), r.isSuccess(), r.getResult())); return new ProcessResult(true, "postProcess successfully!"); diff --git a/powerjob-official-processors/src/main/java/tech/powerjob/official/processors/impl/script/AbstractScriptProcessor.java b/powerjob-official-processors/src/main/java/tech/powerjob/official/processors/impl/script/AbstractScriptProcessor.java index 40d4dde10..a6d3a09e2 100644 --- a/powerjob-official-processors/src/main/java/tech/powerjob/official/processors/impl/script/AbstractScriptProcessor.java +++ b/powerjob-official-processors/src/main/java/tech/powerjob/official/processors/impl/script/AbstractScriptProcessor.java @@ -1,5 +1,6 @@ package tech.powerjob.official.processors.impl.script; +import tech.powerjob.common.utils.SysUtils; import tech.powerjob.worker.common.utils.PowerFileUtils; import tech.powerjob.worker.core.processor.ProcessResult; import tech.powerjob.worker.core.processor.TaskContext; @@ -31,7 +32,7 @@ @Slf4j public abstract class AbstractScriptProcessor extends CommonBasicProcessor { - private static final ForkJoinPool POOL = new ForkJoinPool(4 * Runtime.getRuntime().availableProcessors()); + private static final ForkJoinPool POOL = new ForkJoinPool(4 * SysUtils.availableProcessors()); private static final Set DOWNLOAD_PROTOCOL = Sets.newHashSet("http", "https", "ftp"); protected static final String SH_SHELL = "/bin/sh"; protected static final String CMD_SHELL = "cmd.exe"; diff --git a/powerjob-remote/pom.xml b/powerjob-remote/pom.xml index 511139c0a..dad931517 100644 --- a/powerjob-remote/pom.xml +++ b/powerjob-remote/pom.xml @@ -5,18 +5,19 @@ powerjob tech.powerjob - 4.3.6 + 5.1.2 4.0.0 pom powerjob-remote-framework - powerjob-remote-benchmark powerjob-remote-impl-http powerjob-remote-impl-akka + powerjob-remote-impl-mu powerjob-remote + powerjob-remote 8 @@ -24,7 +25,7 @@ UTF-8 5.9.0 - 1.2.9 + 1.2.13 diff --git a/powerjob-remote/powerjob-remote-benchmark/pom.xml b/powerjob-remote/powerjob-remote-benchmark/pom.xml deleted file mode 100644 index c9b80b946..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/pom.xml +++ /dev/null @@ -1,113 +0,0 @@ - - - - powerjob-remote - tech.powerjob - 4.3.6 - - 4.0.0 - - powerjob-remote-benchmark - - - 8 - 8 - UTF-8 - - 3.10.1 - 3.2.2 - - 1.2.9 - 2.7.14 - 4.3.6 - 4.3.6 - - 3.9.0 - 4.2.9 - - - - - - - io.gatling.highcharts - gatling-charts-highcharts - ${gatling.version} - test - - - - ch.qos.logback - logback-classic - ${logback.version} - - - - org.springframework.boot - spring-boot-starter-web - ${springboot.version} - - - - tech.powerjob - powerjob-remote-impl-http - ${powerjob-remote-impl-http.version} - - - - tech.powerjob - powerjob-remote-impl-akka - ${powerjob-remote-impl-akka.version} - - - - - - - - - - org.springframework.boot - spring-boot-maven-plugin - ${springboot.version} - - tech.powerjob.remote.benchmark.BenchmarkApplication - - - - - repackage - - - - - - - maven-compiler-plugin - ${maven-compiler-plugin.version} - - - maven-jar-plugin - ${maven-jar-plugin.version} - - - io.gatling - gatling-maven-plugin - ${gatling-maven-plugin.version} - - - - - - - org.apache.maven.plugins - maven-deploy-plugin - - true - - - - - \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/BenchmarkApplication.java b/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/BenchmarkApplication.java deleted file mode 100644 index 64dcb25e1..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/BenchmarkApplication.java +++ /dev/null @@ -1,19 +0,0 @@ -package tech.powerjob.remote.benchmark; - -import org.springframework.boot.SpringApplication; -import org.springframework.boot.autoconfigure.SpringBootApplication; - -/** - * 测试工程 - * 用于 remote 协议压测 - * - * @author tjq - * @since 2023/1/7 - */ -@SpringBootApplication -public class BenchmarkApplication { - - public static void main(String[] args) { - SpringApplication.run(BenchmarkApplication.class, args); - } -} diff --git a/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/EngineService.java b/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/EngineService.java deleted file mode 100644 index 41079878d..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/EngineService.java +++ /dev/null @@ -1,68 +0,0 @@ -package tech.powerjob.remote.benchmark; - -import com.google.common.collect.Lists; -import lombok.Getter; -import org.springframework.stereotype.Service; -import tech.powerjob.common.enums.Protocol; -import tech.powerjob.remote.framework.BenchmarkActor; -import tech.powerjob.remote.framework.base.Address; -import tech.powerjob.remote.framework.base.ServerType; -import tech.powerjob.remote.framework.engine.EngineConfig; -import tech.powerjob.remote.framework.engine.impl.PowerJobRemoteEngine; -import tech.powerjob.remote.framework.transporter.Transporter; - -import javax.annotation.PostConstruct; - -/** - * EngineService - * - * @author tjq - * @since 2023/1/7 - */ -@Service -public class EngineService { - - public static final String HOST = "127.0.0.1"; - - public static final int SERVER_AKKA_PORT = 10001; - public static final int SERVER_HTTP_PORT = 10002; - - public static final int CLIENT_AKKA_PORT = 20001; - public static final int CLIENT_HTTP_PORT = 20002; - - @Getter - private Transporter akkaTransporter; - @Getter - private Transporter httpTransporter; - - @PostConstruct - public void init() { - // http server - new PowerJobRemoteEngine().start(new EngineConfig() - .setServerType(ServerType.SERVER) - .setActorList(Lists.newArrayList(new BenchmarkActor())) - .setType(Protocol.HTTP.name()) - .setBindAddress(new Address().setHost(HOST).setPort(SERVER_HTTP_PORT))); - - // akka server - new PowerJobRemoteEngine().start(new EngineConfig() - .setServerType(ServerType.SERVER) - .setActorList(Lists.newArrayList(new BenchmarkActor())) - .setType(Protocol.AKKA.name()) - .setBindAddress(new Address().setHost(HOST).setPort(SERVER_AKKA_PORT))); - - // http client - httpTransporter = new PowerJobRemoteEngine().start(new EngineConfig() - .setServerType(ServerType.WORKER) - .setActorList(Lists.newArrayList(new BenchmarkActor())) - .setType(Protocol.HTTP.name()) - .setBindAddress(new Address().setHost(HOST).setPort(CLIENT_HTTP_PORT))).getTransporter(); - - // akka client - akkaTransporter = new PowerJobRemoteEngine().start(new EngineConfig() - .setServerType(ServerType.WORKER) - .setActorList(Lists.newArrayList(new BenchmarkActor())) - .setType(Protocol.AKKA.name()) - .setBindAddress(new Address().setHost(HOST).setPort(CLIENT_AKKA_PORT))).getTransporter(); - } -} diff --git a/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/PressureTestController.java b/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/PressureTestController.java deleted file mode 100644 index c2f9fcc45..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/src/main/java/tech/powerjob/remote/benchmark/PressureTestController.java +++ /dev/null @@ -1,82 +0,0 @@ -package tech.powerjob.remote.benchmark; - -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.lang3.BooleanUtils; -import org.apache.commons.lang3.exception.ExceptionUtils; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; -import tech.powerjob.common.enums.Protocol; -import tech.powerjob.remote.framework.BenchmarkActor; -import tech.powerjob.remote.framework.base.Address; -import tech.powerjob.remote.framework.base.HandlerLocation; -import tech.powerjob.remote.framework.base.URL; - -import javax.annotation.Resource; - -import java.util.concurrent.CompletionStage; - -import static tech.powerjob.remote.benchmark.EngineService.*; - -/** - * 压测测试入口 - * - * @author tjq - * @since 2023/1/7 - */ -@Slf4j -@RestController -@RequestMapping("/pressure") -public class PressureTestController { - - private static final HandlerLocation HL = new HandlerLocation().setRootPath("benchmark").setMethodPath("standard"); - - @Resource - private EngineService engineService; - - @GetMapping("/tell") - public void httpTell(String protocol, Integer blockMs, Integer responseSize, String content) { - Address address = new Address().setHost(HOST); - URL url = new URL().setLocation(HL).setAddress(address); - final BenchmarkActor.BenchmarkRequest request = new BenchmarkActor.BenchmarkRequest().setContent(content).setBlockingMills(blockMs).setResponseSize(responseSize); - try { - if (Protocol.HTTP.name().equalsIgnoreCase(protocol)) { - address.setPort(SERVER_HTTP_PORT); - engineService.getHttpTransporter().tell(url, request); - } else { - address.setPort(SERVER_AKKA_PORT); - engineService.getAkkaTransporter().tell(url, request); - } - } catch (Exception e) { - log.error("[HttpTell] process failed!", e); - ExceptionUtils.rethrow(e); - } - } - - - @GetMapping("/ask") - public void httpAsk(String protocol, Integer blockMs, Integer responseSize, String content, Boolean debug) { - Address address = new Address().setHost(HOST); - URL url = new URL().setLocation(HL).setAddress(address); - final BenchmarkActor.BenchmarkRequest request = new BenchmarkActor.BenchmarkRequest().setContent(content).setBlockingMills(blockMs).setResponseSize(responseSize); - try { - CompletionStage responseOpt = null; - - if (Protocol.HTTP.name().equalsIgnoreCase(protocol)) { - address.setPort(SERVER_HTTP_PORT); - responseOpt = engineService.getHttpTransporter().ask(url, request, BenchmarkActor.BenchmarkResponse.class); - } else { - address.setPort(SERVER_AKKA_PORT); - responseOpt = engineService.getAkkaTransporter().ask(url, request, BenchmarkActor.BenchmarkResponse.class); - } - final BenchmarkActor.BenchmarkResponse response = responseOpt.toCompletableFuture().get(); - if (BooleanUtils.isTrue(debug)) { - log.info("[httpAsk] response: {}", response); - } - } catch (Exception e) { - log.error("[httpAsk] process failed", e); - ExceptionUtils.rethrow(e); - } - } - -} diff --git a/powerjob-remote/powerjob-remote-benchmark/src/test/java/Engine.java b/powerjob-remote/powerjob-remote-benchmark/src/test/java/Engine.java deleted file mode 100644 index fa70e9eb6..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/src/test/java/Engine.java +++ /dev/null @@ -1,20 +0,0 @@ -import io.gatling.app.Gatling; -import io.gatling.core.config.GatlingPropertiesBuilder; - -/** - * 压测启动入口 - * - * @author tjq - * @since 2023/1/8 - */ -public class Engine { - - public static void main(String[] args) { - GatlingPropertiesBuilder props = new GatlingPropertiesBuilder() - .resourcesDirectory(IDEPathHelper.mavenResourcesDirectory.toString()) - .resultsDirectory(IDEPathHelper.resultsDirectory.toString()) - .binariesDirectory(IDEPathHelper.mavenBinariesDirectory.toString()); - - Gatling.fromMap(props.build()); - } -} diff --git a/powerjob-remote/powerjob-remote-benchmark/src/test/java/IDEPathHelper.java b/powerjob-remote/powerjob-remote-benchmark/src/test/java/IDEPathHelper.java deleted file mode 100644 index 5315cad1b..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/src/test/java/IDEPathHelper.java +++ /dev/null @@ -1,33 +0,0 @@ -import java.net.URISyntaxException; -import java.nio.file.Path; -import java.nio.file.Paths; - -import static java.util.Objects.requireNonNull; - -/** - * @author gatling-maven-plugin-demo-java - */ -public class IDEPathHelper { - - static final Path mavenSourcesDirectory; - static final Path mavenResourcesDirectory; - static final Path mavenBinariesDirectory; - static final Path resultsDirectory; - static final Path recorderConfigFile; - - static { - try { - Path projectRootDir = Paths.get(requireNonNull(IDEPathHelper.class.getResource("gatling.conf"), "Couldn't locate gatling.conf").toURI()).getParent().getParent().getParent(); - Path mavenTargetDirectory = projectRootDir.resolve("target"); - Path mavenSrcTestDirectory = projectRootDir.resolve("src").resolve("test"); - - mavenSourcesDirectory = mavenSrcTestDirectory.resolve("java"); - mavenResourcesDirectory = mavenSrcTestDirectory.resolve("resources"); - mavenBinariesDirectory = mavenTargetDirectory.resolve("test-classes"); - resultsDirectory = mavenTargetDirectory.resolve("gatling"); - recorderConfigFile = mavenResourcesDirectory.resolve("recorder.conf"); - } catch (URISyntaxException e) { - throw new ExceptionInInitializerError(e); - } - } -} diff --git a/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/Constant.java b/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/Constant.java deleted file mode 100644 index 71820edb3..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/Constant.java +++ /dev/null @@ -1,14 +0,0 @@ -package tech.powerjob.remote.benchmark; - -/** - * Constant - * 压测时需要修改的常量 - * - * @author tjq - * @since 2023/1/8 - */ -public class Constant { - - public static final String SERVER_HOST = "127.0.0.1"; - -} diff --git a/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/HttpSimulation.java b/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/HttpSimulation.java deleted file mode 100644 index 00b1a8b48..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/src/test/java/tech/powerjob/remote/benchmark/HttpSimulation.java +++ /dev/null @@ -1,62 +0,0 @@ -package tech.powerjob.remote.benchmark; - -import static io.gatling.javaapi.core.CoreDsl.*; -import static io.gatling.javaapi.http.HttpDsl.*; - -import io.gatling.javaapi.core.*; -import io.gatling.javaapi.http.*; -/** - * 以 HTTP 为入口压测 - * - * @author tjq - * @since 2023/1/8 - */ -public class HttpSimulation extends Simulation { - - String baseUrl = String.format("http://%s:8080", Constant.SERVER_HOST); - HttpProtocolBuilder httpProtocol = http // 4 - .baseUrl(baseUrl) // 5 - .acceptHeader("application/json") // 6 - .doNotTrackHeader("1") - .acceptLanguageHeader("en-US,en;q=0.5") - .acceptEncodingHeader("gzip, deflate") - .userAgentHeader("Mozilla/5.0 (Windows NT 5.1; rv:31.0) Gecko/20100101 Firefox/31.0"); - - ScenarioBuilder warmup = scenario("WarmupSimulation") - .exec(http("PowerJob-Warmup-HTTP") - .get("/pressure/ask?protocol=HTTP&debug=false&responseSize=1024")) - .exec(http("PowerJob-Warmup-AKKA") - .get("/pressure/ask?protocol=AKKA&debug=false&responseSize=1024")) - ; - - ScenarioBuilder httpAsk = scenario("HttpSimulation") // 7 - .exec(http("PowerJob-Remote-Http") // 请求名称,用于压测报表展示 - .get("/pressure/ask?protocol=HTTP&debug=false&responseSize=1024")) // 9 - ; - - ScenarioBuilder akkaAsk = scenario("AkkaSimulation") // 7 - .exec(http("PowerJob-Remote-AKKA") // 请求名称,用于压测报表展示 - .get("/pressure/ask?protocol=AKKA&debug=false&responseSize=1024")) // 9 - ; - - - /* - atOnceUsers(10) 一次模拟的用户数量(10) - nothingFor(4 seconds) 在指定的时间段(4 seconds)内什么都不干 - constantUsersPerSec(10) during(20 seconds) 以固定的速度模拟用户,指定每秒模拟的用户数(10),指定模拟测试时间长度(20 seconds) - rampUsersPerSec(10) to (20) during(20 seconds) 在指定的时间(20 seconds)内,使每秒模拟的用户从数量1(10)逐渐增加到数量2(20),速度匀速 - heavisideUsers(100) over(10 seconds) 在指定的时间(10 seconds)内使用类似单位阶跃函数的方法逐渐增加模拟并发的用户,直到总数达到指定的数量(100).简单说就是每秒并发用户数递增 - */ - - { - setUp( // 11 - warmup.injectOpen(constantUsersPerSec(50).during(10)) - .andThen( - httpAsk.injectOpen(incrementUsersPerSec(100).times(10).eachLevelLasting(10)) - ) - .andThen( - akkaAsk.injectOpen(incrementUsersPerSec(100).times(10).eachLevelLasting(10)) - ) - ).protocols(httpProtocol); // 13 - } -} diff --git a/powerjob-remote/powerjob-remote-benchmark/src/test/resources/gatling.conf b/powerjob-remote/powerjob-remote-benchmark/src/test/resources/gatling.conf deleted file mode 100644 index c6db76269..000000000 --- a/powerjob-remote/powerjob-remote-benchmark/src/test/resources/gatling.conf +++ /dev/null @@ -1,127 +0,0 @@ -######################### -# Gatling Configuration # -######################### - -# This file contains all the settings configurable for Gatling with their default values - -gatling { - core { - #outputDirectoryBaseName = "" # The prefix for each simulation result folder (then suffixed by the report generation timestamp) - #runDescription = "" # The description for this simulation run, displayed in each report - #encoding = "utf-8" # Encoding to use throughout Gatling for file and string manipulation - #simulationClass = "" # The FQCN of the simulation to run (when used in conjunction with noReports, the simulation for which assertions will be validated) - #elFileBodiesCacheMaxCapacity = 200 # Cache size for request body EL templates, set to 0 to disable - #rawFileBodiesCacheMaxCapacity = 200 # Cache size for request body Raw templates, set to 0 to disable - #rawFileBodiesInMemoryMaxSize = 1000 # Below this limit, raw file bodies will be cached in memory - #pebbleFileBodiesCacheMaxCapacity = 200 # Cache size for request body Peeble templates, set to 0 to disable - #feederAdaptiveLoadModeThreshold = 100 # File size threshold (in MB). Below load eagerly in memory, above use batch mode with default buffer size - #shutdownTimeout = 10000 # Milliseconds to wait for the actor system to shutdown - extract { - regex { - #cacheMaxCapacity = 200 # Cache size for the compiled regexes, set to 0 to disable caching - } - xpath { - #cacheMaxCapacity = 200 # Cache size for the compiled XPath queries, set to 0 to disable caching - } - jsonPath { - #cacheMaxCapacity = 200 # Cache size for the compiled jsonPath queries, set to 0 to disable caching - } - css { - #cacheMaxCapacity = 200 # Cache size for the compiled CSS selectors queries, set to 0 to disable caching - } - } - directory { - #simulations = user-files/simulations # Directory where simulation classes are located (for bundle packaging only) - #resources = user-files/resources # Directory where resources, such as feeder files and request bodies are located (for bundle packaging only) - #reportsOnly = "" # If set, name of report folder to look for in order to generate its report - #binaries = "" # If set, name of the folder where compiles classes are located: Defaults to GATLING_HOME/target. - #results = results # Name of the folder where all reports folder are located - } - } - socket { - #connectTimeout = 10000 # Timeout in millis for establishing a TCP socket - #tcpNoDelay = true - #soKeepAlive = false # if TCP keepalive configured at OS level should be used - #soReuseAddress = false - } - netty { - #useNativeTransport = true # if Netty native transport should be used instead of Java NIO - #allocator = "pooled" # switch to unpooled for unpooled ByteBufAllocator - #maxThreadLocalCharBufferSize = 200000 # Netty's default is 16k - } - ssl { - #useOpenSsl = true # if OpenSSL should be used instead of JSSE (only the latter can be debugged with -Djava.net.debug=ssl) - #useOpenSslFinalizers = false # if OpenSSL contexts should be freed with Finalizer or if using RefCounted is fine - #handshakeTimeout = 10000 # TLS handshake timeout in millis - #useInsecureTrustManager = true # Use an insecure TrustManager that trusts all server certificates - #enabledProtocols = [] # Array of enabled protocols for HTTPS, if empty use Netty's defaults - #enabledCipherSuites = [] # Array of enabled cipher suites for HTTPS, if empty enable all available ciphers - #sessionCacheSize = 0 # SSLSession cache size, set to 0 to use JDK's default - #sessionTimeout = 0 # SSLSession timeout in seconds, set to 0 to use JDK's default (24h) - #enableSni = true # When set to true, enable Server Name indication (SNI) - keyStore { - #type = "" # Type of SSLContext's KeyManagers store - #file = "" # Location of SSLContext's KeyManagers store - #password = "" # Password for SSLContext's KeyManagers store - #algorithm = "" # Algorithm used SSLContext's KeyManagers store - } - trustStore { - #type = "" # Type of SSLContext's TrustManagers store - #file = "" # Location of SSLContext's TrustManagers store - #password = "" # Password for SSLContext's TrustManagers store - #algorithm = "" # Algorithm used by SSLContext's TrustManagers store - } - } - charting { - #noReports = false # When set to true, don't generate HTML reports - #maxPlotPerSeries = 1000 # Number of points per graph in Gatling reports - #useGroupDurationMetric = false # Switch group timings from cumulated response time to group duration. - indicators { - #lowerBound = 800 # Lower bound for the requests' response time to track in the reports and the console summary - #higherBound = 1200 # Higher bound for the requests' response time to track in the reports and the console summary - #percentile1 = 50 # Value for the 1st percentile to track in the reports, the console summary and Graphite - #percentile2 = 75 # Value for the 2nd percentile to track in the reports, the console summary and Graphite - #percentile3 = 95 # Value for the 3rd percentile to track in the reports, the console summary and Graphite - #percentile4 = 99 # Value for the 4th percentile to track in the reports, the console summary and Graphite - } - } - http { - #fetchedCssCacheMaxCapacity = 200 # Cache size for CSS parsed content, set to 0 to disable - #fetchedHtmlCacheMaxCapacity = 200 # Cache size for HTML parsed content, set to 0 to disable - #perUserCacheMaxCapacity = 200 # Per virtual user cache size, set to 0 to disable - #warmUpUrl = "https://gatling.io" # The URL to use to warm-up the HTTP stack (blank means disabled) - #enableGA = true # Very light Google Analytics (Gatling and Java version), please support - #pooledConnectionIdleTimeout = 60000 # Timeout in millis for a connection to stay idle in the pool - #requestTimeout = 60000 # Timeout in millis for performing an HTTP request - #enableHostnameVerification = false # When set to true, enable hostname verification: SSLEngine.setHttpsEndpointIdentificationAlgorithm("HTTPS") - dns { - #queryTimeout = 5000 # Timeout in millis of each DNS query in millis - #maxQueriesPerResolve = 6 # Maximum allowed number of DNS queries for a given name resolution - } - } - jms { - #replyTimeoutScanPeriod = 1000 # scan period for timedout reply messages - } - data { - #writers = [console, file] # The list of DataWriters to which Gatling write simulation data (currently supported : console, file, graphite) - console { - #light = false # When set to true, displays a light version without detailed request stats - #writePeriod = 5 # Write interval, in seconds - } - file { - #bufferSize = 8192 # FileDataWriter's internal data buffer size, in bytes - } - leak { - #noActivityTimeout = 30 # Period, in seconds, for which Gatling may have no activity before considering a leak may be happening - } - graphite { - #light = false # only send the all* stats - #host = "localhost" # The host where the Carbon server is located - #port = 2003 # The port to which the Carbon server listens to (2003 is default for plaintext, 2004 is default for pickle) - #protocol = "tcp" # The protocol used to send data to Carbon (currently supported : "tcp", "udp") - #rootPathPrefix = "gatling" # The common prefix of all metrics sent to Graphite - #bufferSize = 8192 # Internal data buffer size, in bytes - #writePeriod = 1 # Write period, in seconds - } - } -} diff --git a/powerjob-remote/powerjob-remote-framework/pom.xml b/powerjob-remote/powerjob-remote-framework/pom.xml index e63f358a0..8d6c7966f 100644 --- a/powerjob-remote/powerjob-remote-framework/pom.xml +++ b/powerjob-remote/powerjob-remote-framework/pom.xml @@ -5,19 +5,20 @@ powerjob-remote tech.powerjob - 4.3.6 + 5.1.2 4.0.0 - 4.3.6 + 5.1.2 powerjob-remote-framework + powerjob-remote-framework 8 8 UTF-8 - 4.3.6 + 5.1.2 0.10.2 diff --git a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/actor/TestActor.java b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/actor/TestActor.java new file mode 100644 index 000000000..c597a5f09 --- /dev/null +++ b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/actor/TestActor.java @@ -0,0 +1,27 @@ +package tech.powerjob.remote.framework.actor; + +import lombok.extern.slf4j.Slf4j; + +/** + * 内置一个用来通用测试的 TestActor + * + * @author tjq + * @since 2022/12/31 + */ +@Slf4j +@Actor(path = "test") +public class TestActor { + + public static void simpleStaticMethod() { + } + + public void simpleMethod() { + } + + @Handler(path = "method1") + public String handlerMethod1() { + log.info("[TestActor] handlerMethod1"); + return "1"; + } + +} diff --git a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/base/RemotingException.java b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/base/RemotingException.java index fd3185db6..bb881eb27 100644 --- a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/base/RemotingException.java +++ b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/base/RemotingException.java @@ -1,7 +1,5 @@ package tech.powerjob.remote.framework.base; -import java.io.IOException; - /** * RemotingException * @@ -13,4 +11,8 @@ public class RemotingException extends RuntimeException { public RemotingException(String message) { super(message); } + + public RemotingException(String message, Throwable throwable) { + super(message, throwable); + } } diff --git a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/cs/CSInitializerConfig.java b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/cs/CSInitializerConfig.java index a64051fd7..0546e2636 100644 --- a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/cs/CSInitializerConfig.java +++ b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/cs/CSInitializerConfig.java @@ -19,7 +19,14 @@ @Accessors(chain = true) public class CSInitializerConfig implements Serializable { + /** + * 需要绑定的地址(本地) + */ private Address bindAddress; + /** + * 外部地址(需要 NAT 等情况存在) + */ + private Address externalAddress; private ServerType serverType; } diff --git a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/EngineConfig.java b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/EngineConfig.java index a9b82961d..d038114c7 100644 --- a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/EngineConfig.java +++ b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/EngineConfig.java @@ -30,6 +30,10 @@ public class EngineConfig implements Serializable { * 绑定的本地地址 */ private Address bindAddress; + /** + * 外部地址(需要 NAT 等情况存在) + */ + private Address externalAddress; /** * actor实例,交由使用侧自己实例化以便自行注入各种 bean */ diff --git a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/impl/CSInitializerFactory.java b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/impl/CSInitializerFactory.java index 8b02f3d43..7590da18a 100644 --- a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/impl/CSInitializerFactory.java +++ b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/impl/CSInitializerFactory.java @@ -4,9 +4,11 @@ import org.apache.commons.lang3.exception.ExceptionUtils; import org.reflections.Reflections; import tech.powerjob.common.OmsConstant; +import tech.powerjob.common.enums.Protocol; import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.remote.framework.cs.CSInitializer; +import java.util.Optional; import java.util.Set; /** @@ -18,8 +20,26 @@ @Slf4j class CSInitializerFactory { + private static final String OFFICIAL_HTTP_CS_INITIALIZER = "tech.powerjob.remote.http.HttpVertxCSInitializer"; + /** + * 未来底层框架摆脱 vertx 时可能会用这个 classname,or 开发者自己实现的 http 协议也可以用这个 classname,总之预留战未来 + */ + private static final String OFFICIAL_HTTP_CS_INITIALIZER2 = "tech.powerjob.remote.http.HttpCSInitializer"; + private static final String OFFICIAL_AKKA_CS_INITIALIZER = "tech.powerjob.remote.akka.AkkaCSInitializer"; + private static final String OFFICIAL_MU_CS_INITIALIZER = "tech.powerjob.remote.mu.MuCSInitializer"; + + private static final String EXTEND_CS_INITIALIZER_PATTERN = "tech.powerjob.remote.%s.CSInitializer"; + static CSInitializer build(String targetType) { + CSInitializer officialCSInitializer = tryLoadCSInitializerByClassName(targetType); + if (officialCSInitializer != null) { + return officialCSInitializer; + } + + log.info("[CSInitializerFactory] try load CSInitializerFactory by name failed, start to use Reflections!"); + + // JAVA SPI 机制太笨了,短期内继续保留 Reflections 官网下高版本兼容性 Reflections reflections = new Reflections(OmsConstant.PACKAGE); Set> cSInitializerClzSet = reflections.getSubTypesOf(CSInitializer.class); @@ -41,4 +61,59 @@ static CSInitializer build(String targetType) { throw new PowerJobException(String.format("can't load CSInitializer[%s], ensure your package name start with 'tech.powerjob' and import the dependencies!", targetType)); } + + /** + * 官方组件直接使用固定类名尝试加载,确保 reflections 不兼容情况下,至少能使用官方通讯协议 + * @param targetType 协议类型 + * @return CSInitializer + */ + private static CSInitializer tryLoadCSInitializerByClassName(String targetType) { + + if (Protocol.HTTP.name().equalsIgnoreCase(targetType)) { + Optional httpCsIOpt = tryLoadCSInitializerByClzName(OFFICIAL_HTTP_CS_INITIALIZER); + if (httpCsIOpt.isPresent()) { + return httpCsIOpt.get(); + } + Optional httpCsIOpt2 = tryLoadCSInitializerByClzName(OFFICIAL_HTTP_CS_INITIALIZER2); + if (httpCsIOpt2.isPresent()) { + return httpCsIOpt2.get(); + } + } + + if (Protocol.AKKA.name().equalsIgnoreCase(targetType)) { + Optional akkaCSIOpt = tryLoadCSInitializerByClzName(OFFICIAL_AKKA_CS_INITIALIZER); + if (akkaCSIOpt.isPresent()) { + return akkaCSIOpt.get(); + } + } + + if (Protocol.MU.name().equalsIgnoreCase(targetType)) { + Optional muCSIOpt = tryLoadCSInitializerByClzName(OFFICIAL_MU_CS_INITIALIZER); + if (muCSIOpt.isPresent()) { + return muCSIOpt.get(); + } + } + + // 尝试加载按规范命名的处理器,比如使用方自定义了 http2 协议,将其类名定为 tech.powerjob.remote.http2.CSInitializer 依然可确保在 Reflections 不可用的情况下完成加载 + String clz = String.format(EXTEND_CS_INITIALIZER_PATTERN, targetType); + Optional extOpt = tryLoadCSInitializerByClzName(clz); + return extOpt.orElse(null); + + } + + + private static Optional tryLoadCSInitializerByClzName(String clzName) { + try { + log.info("[CSInitializerFactory] try to load CSInitializer by classname: {}", clzName); + Class clz = Class.forName(clzName); + CSInitializer o = (CSInitializer) clz.getDeclaredConstructor().newInstance(); + log.info("[CSInitializerFactory] load CSInitializer[{}] successfully, obj: {}", clzName, o); + return Optional.of(o); + } catch (ClassNotFoundException ce) { + log.warn("[CSInitializerFactory] load CSInitializer by classname[{}] failed due to ClassNotFound: {}", clzName, ExceptionUtils.getMessage(ce)); + } catch (Exception e) { + log.warn("[CSInitializerFactory] load CSInitializer by classname[{}] failed.", clzName, e); + } + return Optional.empty(); + } } diff --git a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/impl/PowerJobRemoteEngine.java b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/impl/PowerJobRemoteEngine.java index 2f9cbc6b8..7ace6a4e4 100644 --- a/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/impl/PowerJobRemoteEngine.java +++ b/powerjob-remote/powerjob-remote-framework/src/main/java/tech/powerjob/remote/framework/engine/impl/PowerJobRemoteEngine.java @@ -2,7 +2,9 @@ import com.google.common.base.Stopwatch; import lombok.extern.slf4j.Slf4j; +import tech.powerjob.common.utils.SysUtils; import tech.powerjob.remote.framework.actor.ActorInfo; +import tech.powerjob.remote.framework.actor.TestActor; import tech.powerjob.remote.framework.cs.CSInitializer; import tech.powerjob.remote.framework.cs.CSInitializerConfig; import tech.powerjob.remote.framework.engine.EngineConfig; @@ -27,6 +29,8 @@ public class PowerJobRemoteEngine implements RemoteEngine { @Override public EngineOutput start(EngineConfig engineConfig) { + reConfig(engineConfig); + final String engineType = engineConfig.getType(); EngineOutput engineOutput = new EngineOutput(); log.info("[PowerJobRemoteEngine] [{}] start remote engine with config: {}", engineType, engineConfig); @@ -41,6 +45,7 @@ public EngineOutput start(EngineConfig engineConfig) { csInitializer.init(new CSInitializerConfig() .setBindAddress(engineConfig.getBindAddress()) + .setExternalAddress(engineConfig.getExternalAddress()) .setServerType(engineConfig.getServerType()) ); @@ -63,4 +68,12 @@ public EngineOutput start(EngineConfig engineConfig) { public void close() throws IOException { csInitializer.close(); } + + private static void reConfig(EngineConfig engineConfig) { + boolean testEnv = SysUtils.isTestEnv(); + if (testEnv) { + log.info("[PowerJobRemoteEngine] add 'TestActor' due to current is test env"); + engineConfig.getActorList().add(new TestActor()); + } + } } diff --git a/powerjob-remote/powerjob-remote-framework/src/test/java/tech/powerjob/remote/framework/engine/impl/ActorFactoryTest.java b/powerjob-remote/powerjob-remote-framework/src/test/java/tech/powerjob/remote/framework/engine/impl/ActorFactoryTest.java index 7e80d2aef..7e604b4d8 100644 --- a/powerjob-remote/powerjob-remote-framework/src/test/java/tech/powerjob/remote/framework/engine/impl/ActorFactoryTest.java +++ b/powerjob-remote/powerjob-remote-framework/src/test/java/tech/powerjob/remote/framework/engine/impl/ActorFactoryTest.java @@ -3,12 +3,7 @@ import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.junit.jupiter.api.Test; -import tech.powerjob.remote.framework.actor.ActorInfo; -import tech.powerjob.remote.framework.test.TestActor; - -import java.util.List; -import java.util.Set; -import java.util.stream.Collectors; +import tech.powerjob.remote.framework.actor.TestActor; /** * HandlerFactoryTest diff --git a/powerjob-remote/powerjob-remote-framework/src/test/java/tech/powerjob/remote/framework/test/TestActor.java b/powerjob-remote/powerjob-remote-framework/src/test/java/tech/powerjob/remote/framework/test/TestActor.java deleted file mode 100644 index a1d3351ad..000000000 --- a/powerjob-remote/powerjob-remote-framework/src/test/java/tech/powerjob/remote/framework/test/TestActor.java +++ /dev/null @@ -1,42 +0,0 @@ -package tech.powerjob.remote.framework.test; - -import lombok.extern.slf4j.Slf4j; -import tech.powerjob.remote.framework.actor.Actor; -import tech.powerjob.remote.framework.actor.Handler; - -import java.util.Map; - -/** - * TestActor - * - * @author tjq - * @since 2022/12/31 - */ -@Slf4j -@Actor(path = "/test") -public class TestActor { - - public static void simpleStaticMethod() { - } - - public void simpleMethod() { - } - - @Handler(path = "/method1") - public String handlerMethod1() { - log.info("[TestActor] handlerMethod1"); - return "1"; - } - - @Handler(path = "/method2") - public String handlerMethod2(String name) { - log.info("[TestActor] handlerMethod2 req: {}", name); - return name; - } - - @Handler(path = "/returnEmpty") - public void handlerEmpty(Map req) { - log.info("[TestActor] handlerEmpty req: {}", req); - } - -} diff --git a/powerjob-remote/powerjob-remote-impl-akka/pom.xml b/powerjob-remote/powerjob-remote-impl-akka/pom.xml index 1ee9b4f41..f622342b4 100644 --- a/powerjob-remote/powerjob-remote-impl-akka/pom.xml +++ b/powerjob-remote/powerjob-remote-impl-akka/pom.xml @@ -5,19 +5,20 @@ powerjob-remote tech.powerjob - 4.3.6 + 5.1.2 4.0.0 powerjob-remote-impl-akka - 4.3.6 + powerjob-remote-impl-akka + 5.1.2 8 8 UTF-8 - 4.3.6 + 5.1.2 2.6.13 diff --git a/powerjob-remote/powerjob-remote-impl-akka/src/main/java/tech/powerjob/remote/akka/AkkaCSInitializer.java b/powerjob-remote/powerjob-remote-impl-akka/src/main/java/tech/powerjob/remote/akka/AkkaCSInitializer.java index cad05a8f9..42faeca3c 100644 --- a/powerjob-remote/powerjob-remote-impl-akka/src/main/java/tech/powerjob/remote/akka/AkkaCSInitializer.java +++ b/powerjob-remote/powerjob-remote-impl-akka/src/main/java/tech/powerjob/remote/akka/AkkaCSInitializer.java @@ -9,7 +9,9 @@ import com.typesafe.config.Config; import com.typesafe.config.ConfigFactory; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.common.utils.SysUtils; import tech.powerjob.remote.framework.actor.ActorInfo; import tech.powerjob.remote.framework.base.Address; import tech.powerjob.remote.framework.cs.CSInitializer; @@ -47,8 +49,22 @@ public void init(CSInitializerConfig config) { // 初始化 ActorSystem(macOS上 new ServerSocket 检测端口占用的方法并不生效,可能是AKKA是Scala写的缘故?没办法...只能靠异常重试了) Map overrideConfig = Maps.newHashMap(); - overrideConfig.put("akka.remote.artery.canonical.hostname", bindAddress.getHost()); - overrideConfig.put("akka.remote.artery.canonical.port", bindAddress.getPort()); + + Address externalAddress = config.getExternalAddress(); + + if (externalAddress == null || StringUtils.equalsIgnoreCase(externalAddress.toFullAddress(), bindAddress.toFullAddress())) { + overrideConfig.put("akka.remote.artery.canonical.hostname", bindAddress.getHost()); + overrideConfig.put("akka.remote.artery.canonical.port", bindAddress.getPort()); + log.info("[PowerJob-AKKA] not exist externalIp, overrideConfig: {}", overrideConfig); + } else { + overrideConfig.put("akka.remote.artery.canonical.hostname", externalAddress.getHost()); + overrideConfig.put("akka.remote.artery.canonical.port", externalAddress.getPort()); + + overrideConfig.put("akka.remote.artery.bind.hostname", "0.0.0.0"); + overrideConfig.put("akka.remote.artery.bind.port", bindAddress.getPort()); + + log.info("[PowerJob-AKKA] exist externalAddress[{}], final overrideConfig: {}", externalAddress, overrideConfig); + } Config akkaBasicConfig = ConfigFactory.load(AkkaConstant.AKKA_CONFIG); Config akkaFinalConfig = ConfigFactory.parseMap(overrideConfig).withFallback(akkaBasicConfig); @@ -73,7 +89,7 @@ public Transporter buildTransporter() { @Override public void bindHandlers(List actorInfos) { - int cores = Runtime.getRuntime().availableProcessors(); + int cores = SysUtils.availableProcessors(); actorInfos.forEach(actorInfo -> { String rootPath = actorInfo.getAnno().path(); AkkaMappingService.ActorConfig actorConfig = AkkaMappingService.parseActorName(rootPath); diff --git a/powerjob-remote/powerjob-remote-impl-http/pom.xml b/powerjob-remote/powerjob-remote-impl-http/pom.xml index 84577fadf..d82c52758 100644 --- a/powerjob-remote/powerjob-remote-impl-http/pom.xml +++ b/powerjob-remote/powerjob-remote-impl-http/pom.xml @@ -5,12 +5,13 @@ powerjob-remote tech.powerjob - 4.3.6 + 5.1.2 4.0.0 powerjob-remote-impl-http - 4.3.6 + powerjob-remote-impl-http + 5.1.2 8 @@ -18,7 +19,7 @@ UTF-8 4.3.7 - 4.3.6 + 5.1.2 diff --git a/powerjob-remote/powerjob-remote-impl-http/src/main/java/tech/powerjob/remote/http/HttpVertxCSInitializer.java b/powerjob-remote/powerjob-remote-impl-http/src/main/java/tech/powerjob/remote/http/HttpVertxCSInitializer.java index 9d37a6e8e..14fcfcdac 100644 --- a/powerjob-remote/powerjob-remote-impl-http/src/main/java/tech/powerjob/remote/http/HttpVertxCSInitializer.java +++ b/powerjob-remote/powerjob-remote-impl-http/src/main/java/tech/powerjob/remote/http/HttpVertxCSInitializer.java @@ -1,5 +1,8 @@ package tech.powerjob.remote.http; +import com.fasterxml.jackson.annotation.JsonInclude; +import com.fasterxml.jackson.core.JsonParser; +import com.fasterxml.jackson.databind.DeserializationFeature; import io.netty.handler.codec.http.HttpResponseStatus; import io.vertx.core.Handler; import io.vertx.core.Vertx; @@ -13,6 +16,7 @@ import io.vertx.ext.web.handler.BodyHandler; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.ArrayUtils; import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.remote.framework.actor.ActorInfo; import tech.powerjob.remote.framework.actor.HandlerInfo; @@ -38,6 +42,8 @@ * - vertx 唯一的缺点是其作为相对上层的框架,可能存在较为严重的包冲突问题,尤其是对于那些本身跑在 vertx-framework 上的用户 * - 不过该问题可以通过更换协议解决,预计后续提供一个基于 netty 和自定义协议的实现 * + * 20240316 note:注意类名被强依赖,后续若有改动需要同步更改 + * * @author tjq * @since 2022/12/31 */ @@ -58,6 +64,19 @@ public String type() { @Override public void init(CSInitializerConfig config) { this.config = config; + + // 【Vertx 版本升级时必须注意】临时解决 vertx 自带的 jackson 序列化无法支持字段升级问题(默认特性居然是不支持增删字段的序列化方式,外国框架也是一坨...) + try { + io.vertx.core.json.jackson.DatabindCodec.mapper() + .configure(com.fasterxml.jackson.databind.MapperFeature.PROPAGATE_TRANSIENT_MARKER, true) + .configure(JsonParser.Feature.ALLOW_SINGLE_QUOTES, true) + .configure(JsonParser.Feature.IGNORE_UNDEFINED, true) + .configure(DeserializationFeature.FAIL_ON_UNKNOWN_PROPERTIES, false) + .setSerializationInclusion(JsonInclude.Include.NON_NULL); + } catch (Throwable t) { + log.warn("[HttpVertxCSInitializer] hack jackson failed!", t); + } + vertx = VertxInitializer.buildVertx(); httpServer = VertxInitializer.buildHttpServer(vertx); httpClient = VertxInitializer.buildHttpClient(vertx); @@ -108,8 +127,10 @@ private Handler buildRequestHandler(ActorInfo actorInfo, Handler Optional> powerSerializeClz = RemoteUtils.findPowerSerialize(method.getParameterTypes()); // 内部框架,严格模式,绑定失败直接报错 - if (!powerSerializeClz.isPresent()) { - throw new PowerJobException("can't find any 'PowerSerialize' object in handler args: " + handlerInfo.getLocation()); + if (ArrayUtils.isNotEmpty(method.getParameterTypes())) { + if (!powerSerializeClz.isPresent()) { + throw new PowerJobException("can't find any 'PowerSerialize' object in handler args: " + handlerInfo.getLocation()); + } } return ctx -> { diff --git a/powerjob-remote/powerjob-remote-impl-http/src/main/java/tech/powerjob/remote/http/vertx/VertxInitializer.java b/powerjob-remote/powerjob-remote-impl-http/src/main/java/tech/powerjob/remote/http/vertx/VertxInitializer.java index 8d0eda3dc..1dfb34dc8 100644 --- a/powerjob-remote/powerjob-remote-impl-http/src/main/java/tech/powerjob/remote/http/vertx/VertxInitializer.java +++ b/powerjob-remote/powerjob-remote-impl-http/src/main/java/tech/powerjob/remote/http/vertx/VertxInitializer.java @@ -10,6 +10,7 @@ import org.apache.commons.lang3.StringUtils; import tech.powerjob.common.OmsConstant; import tech.powerjob.common.PowerJobDKey; +import tech.powerjob.common.utils.SysUtils; /** * VertxInitializer @@ -31,7 +32,7 @@ public class VertxInitializer { private static final int SERVER_IDLE_TIMEOUT_S = 300; public static Vertx buildVertx() { - final int cpuCores = Runtime.getRuntime().availableProcessors(); + final int cpuCores = SysUtils.availableProcessors(); VertxOptions options = new VertxOptions() .setWorkerPoolSize(Math.max(16, 2 * cpuCores)) .setInternalBlockingPoolSize(Math.max(32, 4 * cpuCores)); @@ -63,7 +64,7 @@ public static HttpClient buildHttpClient(Vertx vertx) { HttpClientOptions httpClientOptions = new HttpClientOptions() .setMetricsName(OmsConstant.PACKAGE) .setConnectTimeout(CONNECTION_TIMEOUT_MS) - .setMaxPoolSize(Math.max(8, Runtime.getRuntime().availableProcessors()) * 2); + .setMaxPoolSize(Math.max(8, SysUtils.availableProcessors()) * 2); // 长连接 String keepaliveTimeout = System.getProperty(PowerJobDKey.TRANSPORTER_KEEP_ALIVE_TIMEOUT, String.valueOf(DEFAULT_KEEP_ALIVE_TIMEOUT)); diff --git a/powerjob-remote/powerjob-remote-impl-mu/DESIGN.md b/powerjob-remote/powerjob-remote-impl-mu/DESIGN.md new file mode 100644 index 000000000..479c48827 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/DESIGN.md @@ -0,0 +1,563 @@ +# PowerJob Mu 协议技术设计方案 + +## 1. 项目背景 + +### 1.1 业务场景 +PowerJob 是一个分布式任务调度框架,采用 Server-Worker 架构。在实际部署中,经常遇到以下网络环境限制: +- Worker 节点部署在内网环境,只能单向访问公网的 Server +- Server 无法直接访问 Worker 的内网 IP 地址 +- 业务需要支持 Server 向 Worker 的主动通讯(任务下发、状态查询等) + +### 1.2 现有协议局限性 +- **HTTP 协议**:基于请求-响应模式,Server 向 Worker 推送需要 Worker 轮询,实时性差 +- **AKKA 协议**:功能强大但配置复杂,在 NAT 环境下需要复杂的网络配置 + +### 1.3 设计目标 +1. 支持 Worker 仅可出站访问的网络环境 +2. 实现 Server 与 Worker 的双向通讯 +3. 支持完整的节点间通讯矩阵(Worker↔Server, Worker↔Worker, Server↔Server) +4. 保持高性能和低延迟 +5. 简化网络配置和部署复杂度 + +## 2. 总体设计 + +### 2.1 核心设计原则 + +#### 连接复用 (Connection Reuse) +- Worker 主动建立到 Server 的长连接 +- Server 通过注册机制维护 Worker 连接映射 +- Server 复用 Worker 建立的连接进行反向通讯 + +#### 延迟连接 (Lazy Connection) +- 节点启动时不立即建立所有连接 +- 首次通讯时才建立目标连接 +- 避免启动时的网络依赖和连接失败 + +#### 统一架构 (Unified Architecture) +- 所有节点都具备 Server 和 Client 双重能力 +- 统一的消息格式和处理流程 +- 支持任意节点间的直接通讯 + +### 2.2 架构图 + +``` + PowerJob Mu Protocol Architecture + + ┌──────────────────────────────────────────────────────────────────┐ + │ Application Layer │ + ├──────────────────────────────────────────────────────────────────┤ + │ Actor System (Handler Registration & Message Routing) │ + ├──────────────────────────────────────────────────────────────────┤ + │ Transport Layer │ + │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ + │ │MuTransporter│ │ChannelMgr │ │ConnectionMgr│ │ + │ │ │ │ │ │ │ │ + │ │- tell() │ │- Worker Reg │ │- Lazy Conn │ │ + │ │- ask() │ │- Ask/Resp │ │- Conn Pool │ │ + │ └─────────────┘ └─────────────┘ └─────────────┘ │ + ├──────────────────────────────────────────────────────────────────┤ + │ Protocol Layer │ + │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ + │ │ MuMessage │ │MuMessageCodec│ │Message Types│ │ + │ │ │ │ │ │ │ │ + │ │- Type │ │- Encode │ │- TELL │ │ + │ │- RequestId │ │- Decode │ │- ASK │ │ + │ │- Path │ │- Length │ │- RESPONSE │ │ + │ │- Payload │ │- JSON │ │- HEARTBEAT │ │ + │ └─────────────┘ └─────────────┘ └─────────────┘ │ + ├──────────────────────────────────────────────────────────────────┤ + │ Network Layer │ + │ Netty Framework │ + │ ┌─────────────┐ ┌─────────────┐ ┌─────────────┐ │ + │ │EventLoopGroup│ │ Bootstrap │ │ChannelPipe │ │ + │ │ │ │ │ │ │ │ + │ │- Boss │ │- Server │ │- Codec │ │ + │ │- Worker │ │- Client │ │- Handler │ │ + │ └─────────────┘ └─────────────┘ └─────────────┘ │ + └──────────────────────────────────────────────────────────────────┘ +``` + +## 3. 详细设计 + +### 3.1 通讯流程设计 + +#### 3.1.1 Worker 注册流程 +```mermaid +sequenceDiagram + participant W as Worker + participant S as Server + + W->>S: 1. 建立TCP连接 + W->>S: 2. 发送HEARTBEAT消息 (包含Worker地址) + S->>S: 3. 注册Worker连接到ChannelManager + S->>S: 4. 建立 workerAddress -> Channel 映射 + + Note over W,S: 连接建立完成,可以双向通讯 + + W->>S: 5. 定期发送HEARTBEAT (保活) + S->>W: 6. 可以通过已注册连接发送消息 +``` + +#### 3.1.2 延迟连接流程 +```mermaid +sequenceDiagram + participant W1 as Worker1 + participant W2 as Worker2 + + W1->>W1: 1. 需要向Worker2发送消息 + W1->>W1: 2. 检查连接池,无现有连接 + W1->>W2: 3. 建立新的TCP连接 + W1->>W2: 4. 发送消息 + W1->>W1: 5. 连接加入连接池,供后续复用 +``` + +### 3.2 核心组件设计 + +#### 3.2.1 MuCSInitializer +```java +public class MuCSInitializer implements CSInitializer { + + // 根据节点类型初始化不同服务 + public void init(CSInitializerConfig config) { + if (config.getServerType() == ServerType.SERVER) { + initServer(); // 启动Netty服务端 + 连接管理器 + } else { + initWorker(); // 启动Netty服务端 + 连接管理器 + } + } + + private void initServer() { + // 1. 创建ServerHandler + // 2. 启动Netty服务端监听 + // 3. 初始化连接管理器 + } + + private void initWorker() { + // 1. 创建WorkerHandler + // 2. 启动Netty服务端监听 (支持Worker间通讯) + // 3. 初始化连接管理器 + } +} +``` + +#### 3.2.2 MuTransporter +```java +public class MuTransporter implements Transporter { + + public void tell(URL url, PowerSerializable request) { + if (当前节点是Worker) { + // 使用连接管理器建立到目标的连接 + connectionManager.getOrCreateConnection(url.getAddress()) + .thenAccept(channel -> channel.writeAndFlush(message)); + } else { + // Server端需要区分目标类型 + if (目标是Worker) { + // 使用已注册的Worker连接 + Channel channel = channelManager.getWorkerChannel(url.getAddress()); + channel.writeAndFlush(message); + } else { + // 使用连接管理器连接到目标Server + connectionManager.getOrCreateConnection(url.getAddress()) + .thenAccept(channel -> channel.writeAndFlush(message)); + } + } + } + + public CompletionStage ask(URL url, PowerSerializable request, Class clz) { + // 1. 生成唯一的requestId + // 2. 注册Future到ChannelManager + // 3. 按照tell的逻辑发送ASK消息 + // 4. 返回Future等待响应 + } +} +``` + +#### 3.2.3 ChannelManager +```java +public class ChannelManager { + + // Worker地址到连接的映射 (Server端用) + private final ConcurrentMap workerChannels; + + // 请求ID到Future的映射 (Ask模式用) + private final ConcurrentMap> pendingRequests; + + // 请求ID到响应类型的映射 (类型转换用) + private final ConcurrentMap> requestResponseTypes; + + public void registerWorkerChannel(Address workerAddress, Channel channel) { + String key = workerAddress.getHost() + ":" + workerAddress.getPort(); + workerChannels.put(key, channel); + // 监听连接关闭,自动清理映射 + } + + public void completePendingRequest(String requestId, Object response) { + CompletableFuture future = pendingRequests.remove(requestId); + Class responseType = requestResponseTypes.remove(requestId); + + // 类型转换,解决LinkedHashMap问题 + Object convertedResponse = convertResponse(response, responseType); + future.complete(convertedResponse); + } +} +``` + +#### 3.2.4 MuConnectionManager +```java +public class MuConnectionManager { + + // 目标地址到连接的映射 + private final ConcurrentMap connections; + + // 正在建立的连接 + private final ConcurrentMap> pendingConnections; + + public CompletableFuture getOrCreateConnection(Address targetAddress) { + String key = targetAddress.getHost() + ":" + targetAddress.getPort(); + + // 1. 检查现有连接 + Channel existingChannel = connections.get(key); + if (existingChannel != null && existingChannel.isActive()) { + return CompletableFuture.completedFuture(existingChannel); + } + + // 2. 检查正在建立的连接 + CompletableFuture pendingConnection = pendingConnections.get(key); + if (pendingConnection != null) { + return pendingConnection; + } + + // 3. 建立新连接 + return createNewConnection(targetAddress); + } +} +``` + +### 3.3 消息协议设计 + +#### 3.3.1 消息格式 +```java +public class MuMessage implements PowerSerializable { + private MessageType messageType; // 消息类型 + private String requestId; // 请求ID (Ask模式) + private String path; // 处理器路径 + private Address senderAddress; // 发送方地址 (注册用) + private Object payload; // 消息载荷 + private String errorMessage; // 错误信息 +} + +public enum MessageType { + TELL, // 单向消息 + ASK, // 请求消息 + RESPONSE, // 响应消息 + ERROR, // 错误响应 + HEARTBEAT // 心跳消息 +} +``` + +#### 3.3.2 编解码器 +```java +public class MuMessageCodec extends ByteToMessageCodec { + + @Override + protected void encode(ChannelHandlerContext ctx, MuMessage msg, ByteBuf out) { + byte[] data = OBJECT_MAPPER.writeValueAsBytes(msg); + out.writeInt(data.length); // 长度前缀 + out.writeBytes(data); // 消息内容 + } + + @Override + protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) { + if (in.readableBytes() < 4) return; // 长度不足 + + int length = in.readInt(); + if (in.readableBytes() < length) { + in.resetReaderIndex(); // 重置读取位置 + return; + } + + byte[] data = new byte[length]; + in.readBytes(data); + MuMessage message = OBJECT_MAPPER.readValue(data, MuMessage.class); + out.add(message); + } +} +``` + +## 4. 关键技术方案 + +### 4.1 连接复用机制 + +#### 问题描述 +在单向网络环境中,Server 无法主动连接到 Worker,但需要向 Worker 发送消息。 + +#### 解决方案 +1. **Worker 主动注册**:Worker 启动时主动连接到 Server,并发送包含自身地址的心跳消息 +2. **连接映射维护**:Server 维护 Worker 地址到连接通道的映射关系 +3. **反向通讯**:Server 需要向 Worker 发送消息时,从映射中查找对应的连接通道 + +```java +// Worker端:发送心跳注册 +MuMessage heartbeat = new MuMessage( + MessageType.HEARTBEAT, null, null, + workerAddress, // 关键:携带Worker地址 + null, null +); +channel.writeAndFlush(heartbeat); + +// Server端:处理心跳并注册 +public void handleHeartbeat(ChannelHandlerContext ctx, MuMessage msg) { + if (msg.getSenderAddress() != null) { + channelManager.registerWorkerChannel(msg.getSenderAddress(), ctx.channel()); + } +} +``` + +### 4.2 延迟连接机制 + +#### 问题描述 +节点启动时立即建立所有连接会导致: +- 启动时间长 +- 网络故障影响启动 +- 不必要的资源占用 + +#### 解决方案 +1. **按需连接**:只在首次需要通讯时才建立连接 +2. **连接缓存**:建立的连接保存在连接池中供后续复用 +3. **并发控制**:避免同时建立到同一目标的多个连接 + +```java +public CompletableFuture getOrCreateConnection(Address targetAddress) { + // 1. 检查缓存连接 + Channel cached = connectionCache.get(addressKey); + if (cached != null && cached.isActive()) { + return CompletableFuture.completedFuture(cached); + } + + // 2. 检查正在建立的连接,避免重复建立 + CompletableFuture pending = pendingConnections.get(addressKey); + if (pending != null) { + return pending; + } + + // 3. 建立新连接 + return createNewConnection(targetAddress); +} +``` + +### 4.3 消息路由机制 + +#### 问题描述 +不同的通讯场景需要使用不同的连接方式,需要智能路由。 + +#### 解决方案 +基于调用方类型和目标类型的二维路由表: + +```java +public void routeMessage(URL url, MuMessage message) { + if (currentNodeType == ServerType.WORKER) { + // Worker作为发送方:统一使用连接管理器 + connectionManager.getOrCreateConnection(url.getAddress()) + .thenAccept(channel -> channel.writeAndFlush(message)); + } else { + // Server作为发送方:根据目标类型选择策略 + if (url.getServerType() == ServerType.WORKER) { + // 目标是Worker:使用已注册的连接 + Channel workerChannel = channelManager.getWorkerChannel(url.getAddress()); + workerChannel.writeAndFlush(message); + } else { + // 目标是Server:使用连接管理器 + connectionManager.getOrCreateConnection(url.getAddress()) + .thenAccept(channel -> channel.writeAndFlush(message)); + } + } +} +``` + +### 4.4 类型转换机制 + +#### 问题描述 +Jackson 反序列化时可能将对象反序列化为 LinkedHashMap,导致类型转换异常。 + +#### 解决方案 +1. **类型映射**:Ask 请求时记录期望的响应类型 +2. **智能转换**:响应时根据期望类型进行转换 + +```java +// 发送Ask请求时记录类型 +public CompletionStage ask(URL url, PowerSerializable request, Class clz) { + String requestId = UUID.randomUUID().toString(); + channelManager.registerPendingRequest(requestId, future, clz); // 记录期望类型 + // ... 发送消息 +} + +// 接收响应时转换类型 +public void completePendingRequest(String requestId, Object response) { + Class expectedType = requestResponseTypes.remove(requestId); + Object convertedResponse = JsonUtils.toJavaObject(response, expectedType); + future.complete(convertedResponse); +} +``` + +## 5. 性能优化 + +### 5.1 连接池管理 +- **连接复用**:相同目标的多次请求复用连接 +- **连接清理**:自动检测和清理失效连接 +- **连接限制**:控制最大连接数,避免资源耗尽 + +### 5.2 异步处理 +- **非阻塞IO**:基于Netty的异步IO模型 +- **事件驱动**:消息处理采用事件驱动方式 +- **线程池优化**:合理配置EventLoopGroup大小 + +### 5.3 内存管理 +- **零拷贝**:利用Netty的零拷贝特性 +- **对象池**:复用消息对象,减少GC压力 +- **缓冲区管理**:合理设置接收和发送缓冲区大小 + +## 6. 容错设计 + +### 6.1 连接故障处理 +```java +// 连接断开监听 +channel.closeFuture().addListener(future -> { + // 清理连接映射 + connectionCache.remove(addressKey); + workerChannels.remove(workerKey); + + // 失败所有待处理的请求 + failPendingRequests(channel); +}); + +// 自动重连 +public CompletableFuture reconnect(Address address) { + return CompletableFuture + .runAsync(() -> Thread.sleep(retryInterval)) + .thenCompose(v -> createConnection(address)); +} +``` + +### 6.2 消息超时处理 +```java +// Ask请求超时 (JDK8兼容方式) +ScheduledExecutorService scheduler = Executors.newSingleThreadScheduledExecutor(); +scheduler.schedule(() -> { + if (!future.isDone()) { + channelManager.removePendingRequest(requestId); + future.completeExceptionally(new TimeoutException("Request timeout")); + } +}, timeout, TimeUnit.SECONDS); +``` + +### 6.3 异常传播 +- **网络异常**:连接失败、超时等网络层异常 +- **协议异常**:消息格式错误、编解码异常 +- **业务异常**:处理器执行异常 + +## 7. 监控与运维 + +### 7.1 关键指标 +- **连接数统计**:活跃连接数、总连接数 +- **消息统计**:发送/接收消息数、消息大小 +- **性能指标**:响应时间、吞吐量 +- **错误统计**:连接失败、消息失败、超时次数 + +### 7.2 日志记录 +```java +// 连接事件 +log.info("[MuConnectionManager] Connected to {}", targetAddress); +log.warn("[MuConnectionManager] Connection failed to {}", targetAddress); + +// 消息事件 +log.debug("[MuTransporter] Sent {} message to {}", messageType, url); +log.error("[MuHandler] Failed to process message", exception); +``` + +### 7.3 健康检查 +- **连接健康**:定期检查连接状态 +- **心跳监控**:监控Worker心跳状态 +- **性能监控**:监控关键性能指标 + +## 8. 测试方案 + +### 8.1 单元测试 +- **组件测试**:各核心组件的独立测试 +- **协议测试**:消息编解码正确性测试 +- **异常测试**:各种异常场景的处理测试 + +### 8.2 集成测试 +- **通讯测试**:各种通讯场景的端到端测试 +- **故障测试**:网络故障、节点故障的恢复测试 +- **性能测试**:高并发、大数据量的性能测试 + +### 8.3 场景测试 +```java +// Worker到Server通讯测试 +@Test +public void testWorkerToServerCommunication() { + // 1. 启动Server + // 2. 启动Worker并连接到Server + // 3. Worker发送消息到Server + // 4. 验证Server收到消息 +} + +// 网络故障恢复测试 +@Test +public void testNetworkFailureRecovery() { + // 1. 建立正常连接 + // 2. 模拟网络中断 + // 3. 恢复网络连接 + // 4. 验证通讯自动恢复 +} +``` + +## 9. 部署指南 + +### 9.1 网络配置 +```yaml +# Server配置 +server: + host: 0.0.0.0 # 监听所有网卡 + port: 7700 # 监听端口 + external_host: 公网IP # 外部访问地址 + +# Worker配置 +worker: + host: 0.0.0.0 # 本地监听地址 + port: 27777 # 本地监听端口 + server_host: 公网IP # Server地址 + server_port: 7700 # Server端口 +``` + +### 9.2 防火墙配置 +```bash +# Server端:开放监听端口 +iptables -A INPUT -p tcp --dport 7700 -j ACCEPT + +# Worker端:确保可以访问Server端口 +# 通常不需要额外配置,确保出站不受限即可 +``` + +### 9.3 高可用部署 +- **Server集群**:多个Server实例负载均衡 +- **Worker多连接**:Worker配置多个Server地址 +- **故障转移**:自动检测和切换故障节点 + +## 10. 总结 + +PowerJob Mu 协议通过创新的连接复用和延迟连接机制,成功解决了单向网络环境下的双向通讯问题。主要技术特点包括: + +1. **网络适应性**:专为受限网络环境设计,无需复杂的网络配置 +2. **高性能**:基于Netty的异步IO,支持高并发和低延迟 +3. **可靠性**:完善的故障检测和恢复机制 +4. **扩展性**:统一的架构设计,支持多种通讯场景 +5. **易部署**:简化的配置和部署流程 + +该协议特别适合云原生、容器化部署以及混合云环境,为PowerJob在复杂网络环境下提供了可靠的通讯基础。 + +--- + +*PowerJob Mu Protocol Technical Design* +*Version: 1.0* +*Date: January 2025* \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/pom.xml b/powerjob-remote/powerjob-remote-impl-mu/pom.xml new file mode 100644 index 000000000..c35279110 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/pom.xml @@ -0,0 +1,42 @@ + + + + powerjob-remote + tech.powerjob + 5.1.2 + + 4.0.0 + + powerjob-remote-impl-mu + powerjob-remote-impl-mu + 5.1.2 + + + 8 + 8 + UTF-8 + + 4.1.104.Final + 5.1.2 + + + + + + tech.powerjob + powerjob-remote-framework + ${powerjob-remote-framework.version} + + + + + io.netty + netty-all + ${netty.version} + + + + + \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/ChannelManager.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/ChannelManager.java new file mode 100644 index 000000000..2dadd4d08 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/ChannelManager.java @@ -0,0 +1,122 @@ +package tech.powerjob.remote.mu; + +import io.netty.channel.Channel; +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.remote.framework.base.Address; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; + +/** + * Channel manager for maintaining worker address to channel mapping + * Supports both tell and ask modes for reverse communication + * + * @author claude + * @since 2025/1/1 + */ +@Slf4j +public class ChannelManager { + + private final ConcurrentMap workerChannels = new ConcurrentHashMap<>(); + private final ConcurrentMap> pendingRequests = new ConcurrentHashMap<>(); + private final ConcurrentMap> requestResponseTypes = new ConcurrentHashMap<>(); + + /** + * Register a worker channel + * @param workerAddress worker address + * @param channel Netty channel + */ + public void registerWorkerChannel(Address workerAddress, Channel channel) { + String key = workerAddress.getHost() + ":" + workerAddress.getPort(); + workerChannels.put(key, channel); + log.info("[ChannelManager] Registered worker channel: {}", key); + + // Remove channel when it becomes inactive + channel.closeFuture().addListener(future -> { + workerChannels.remove(key); + log.info("[ChannelManager] Removed inactive worker channel: {}", key); + }); + } + + /** + * Get channel for worker + * @param workerAddress worker address + * @return Channel or null if not found + */ + public Channel getWorkerChannel(Address workerAddress) { + String key = workerAddress.getHost() + ":" + workerAddress.getPort(); + return workerChannels.get(key); + } + + /** + * Store pending request for ask mode + * @param requestId request ID + * @param future future to complete when response received + * @param responseType expected response type + */ + public void registerPendingRequest(String requestId, CompletableFuture future, Class responseType) { + pendingRequests.put(requestId, future); + requestResponseTypes.put(requestId, responseType); + } + + /** + * Complete pending request with response + * @param requestId request ID + * @param response response object + */ + public void completePendingRequest(String requestId, Object response) { + CompletableFuture future = pendingRequests.remove(requestId); + Class responseType = requestResponseTypes.remove(requestId); + + if (future != null) { + Object convertedResponse = convertResponse(response, responseType); + future.complete(convertedResponse); + } else { + log.warn("[ChannelManager] No pending request found for ID: {}", requestId); + } + } + + /** + * Complete pending request with exception + * @param requestId request ID + * @param exception exception + */ + public void completePendingRequestExceptionally(String requestId, Throwable exception) { + CompletableFuture future = pendingRequests.remove(requestId); + requestResponseTypes.remove(requestId); // Clean up response type mapping + if (future != null) { + future.completeExceptionally(exception); + } else { + log.warn("[ChannelManager] No pending request found for ID: {}", requestId); + } + } + + /** + * Remove pending request (timeout cleanup) + * @param requestId request ID + */ + public void removePendingRequest(String requestId) { + pendingRequests.remove(requestId); + requestResponseTypes.remove(requestId); + } + + /** + * Convert response to expected type + * @param response raw response object + * @param responseType expected response type + * @return converted response + */ + private Object convertResponse(Object response, Class responseType) { + if (response == null || responseType == null) { + return response; + } + + if (responseType.isInstance(response)) { + return response; + } + + return JsonUtils.toJavaObject(response, responseType); + } +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuCSInitializer.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuCSInitializer.java new file mode 100644 index 000000000..22fff12dd --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuCSInitializer.java @@ -0,0 +1,179 @@ +package tech.powerjob.remote.mu; + +import io.netty.bootstrap.ServerBootstrap; +import io.netty.channel.*; +import io.netty.channel.nio.NioEventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioServerSocketChannel; +import io.netty.handler.timeout.IdleStateHandler; +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.remote.framework.actor.ActorInfo; +import tech.powerjob.remote.framework.base.ServerType; +import tech.powerjob.remote.framework.cs.CSInitializer; +import tech.powerjob.remote.framework.cs.CSInitializerConfig; +import tech.powerjob.remote.framework.transporter.Transporter; + +import java.io.IOException; +import java.util.List; +import java.util.concurrent.TimeUnit; + +/** + * Mu CSInitializer implementation using Netty + * Supports bidirectional communication with worker-only outbound connectivity + * + * @author claude + * @since 2025/1/1 + */ +@Slf4j +public class MuCSInitializer implements CSInitializer { + + private EventLoopGroup bossGroup; + private EventLoopGroup workerGroup; + private Channel serverChannel; + private CSInitializerConfig config; + private final ChannelManager channelManager = new ChannelManager(); + + private MuServerHandler serverHandler; + private MuWorkerHandler workerHandler; + private MuConnectionManager connectionManager; + + @Override + public String type() { + return "MU"; + } + + @Override + public void init(CSInitializerConfig config) { + this.config = config; + + bossGroup = new NioEventLoopGroup(1); + workerGroup = new NioEventLoopGroup(); + + if (config.getServerType() == ServerType.SERVER) { + initServer(); + } else { + initWorker(); + } + } + + private void initServer() { + try { + serverHandler = new MuServerHandler(channelManager); + + ServerBootstrap bootstrap = new ServerBootstrap(); + bootstrap.group(bossGroup, workerGroup) + .channel(NioServerSocketChannel.class) + .option(ChannelOption.SO_BACKLOG, 128) + .childOption(ChannelOption.SO_KEEPALIVE, true) + .childOption(ChannelOption.TCP_NODELAY, true) + .childHandler(new ChannelInitializer() { + @Override + protected void initChannel(SocketChannel ch) { + ch.pipeline() + .addLast(new IdleStateHandler(0, 0, 60, TimeUnit.SECONDS)) + .addLast(new MuMessageCodec()) + .addLast(serverHandler); + } + }); + + ChannelFuture future = bootstrap.bind( + config.getBindAddress().getHost(), + config.getBindAddress().getPort() + ).sync(); + + serverChannel = future.channel(); + log.info("[MuCSInitializer] Server started on {}:{}", + config.getBindAddress().getHost(), + config.getBindAddress().getPort()); + + // 初始化连接管理器,用于Server连接到其他Server + connectionManager = new MuConnectionManager(workerGroup, channelManager, serverHandler, config.getBindAddress()); + log.info("[MuCSInitializer] Server initialized with client capabilities for server-to-server communication"); + } catch (Exception e) { + log.error("[MuCSInitializer] Failed to start server", e); + throw new RuntimeException("Failed to start Mu server", e); + } + } + + private void initWorker() { + try { + // Worker需要同时具备服务端和客户端能力 + // 服务端:接受其他Worker的连接 + // 客户端:连接到Server或其他Worker + + // 初始化handler + workerHandler = new MuWorkerHandler(channelManager); + + // 启动服务端,接受其他Worker的连接 + ServerBootstrap serverBootstrap = new ServerBootstrap(); + serverBootstrap.group(bossGroup, workerGroup) + .channel(NioServerSocketChannel.class) + .option(ChannelOption.SO_BACKLOG, 128) + .childOption(ChannelOption.SO_KEEPALIVE, true) + .childOption(ChannelOption.TCP_NODELAY, true) + .childHandler(new ChannelInitializer() { + @Override + protected void initChannel(SocketChannel ch) { + ch.pipeline() + .addLast(new IdleStateHandler(0, 0, 60, TimeUnit.SECONDS)) + .addLast(new MuMessageCodec()) + .addLast(workerHandler); + } + }); + + ChannelFuture serverFuture = serverBootstrap.bind( + config.getBindAddress().getHost(), + config.getBindAddress().getPort() + ).sync(); + + serverChannel = serverFuture.channel(); + log.info("[MuCSInitializer] Worker server started on {}:{}", + config.getBindAddress().getHost(), + config.getBindAddress().getPort()); + + // 初始化连接管理器,用于连接到其他节点 + connectionManager = new MuConnectionManager(workerGroup, channelManager, workerHandler, config.getBindAddress()); + log.info("[MuCSInitializer] Worker initialized with server and client capabilities"); + } catch (Exception e) { + log.error("[MuCSInitializer] Failed to initialize worker", e); + throw new RuntimeException("Failed to initialize Mu worker", e); + } + } + + @Override + public Transporter buildTransporter() { + return new MuTransporter(channelManager, config.getServerType(), connectionManager); + } + + @Override + public void bindHandlers(List actorInfos) { + if (config.getServerType() == ServerType.SERVER && serverHandler != null) { + serverHandler.bindHandlers(actorInfos); + } else if (config.getServerType() == ServerType.WORKER && workerHandler != null) { + workerHandler.bindHandlers(actorInfos); + } + } + + @Override + public void close() throws IOException { + try { + if (serverChannel != null) { + serverChannel.close().sync(); + } + if (connectionManager != null) { + connectionManager.closeAllConnections(); + } + } catch (InterruptedException e) { + Thread.currentThread().interrupt(); + log.warn("[MuCSInitializer] Interrupted while closing channels", e); + } finally { + if (bossGroup != null) { + bossGroup.shutdownGracefully(); + } + if (workerGroup != null) { + workerGroup.shutdownGracefully(); + } + } + log.info("[MuCSInitializer] Mu CSInitializer closed"); + } +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuConnectionManager.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuConnectionManager.java new file mode 100644 index 000000000..5ff5912e9 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuConnectionManager.java @@ -0,0 +1,136 @@ +package tech.powerjob.remote.mu; + +import io.netty.bootstrap.Bootstrap; +import io.netty.channel.Channel; +import io.netty.channel.ChannelFuture; +import io.netty.channel.ChannelInitializer; +import io.netty.channel.ChannelOption; +import io.netty.channel.EventLoopGroup; +import io.netty.channel.socket.SocketChannel; +import io.netty.channel.socket.nio.NioSocketChannel; +import io.netty.handler.timeout.IdleStateHandler; +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.remote.framework.base.Address; + +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.ConcurrentHashMap; +import java.util.concurrent.ConcurrentMap; +import java.util.concurrent.TimeUnit; + +/** + * Connection manager for worker-side lazy connection to server + * + * @author claude + * @since 2025/1/1 + */ +@Slf4j +public class MuConnectionManager { + + private final EventLoopGroup workerGroup; + private final ChannelManager channelManager; + private final Object messageHandler; // Can be MuWorkerHandler or MuServerHandler + private final Address localAddress; + + private final ConcurrentMap serverConnections = new ConcurrentHashMap<>(); + private final ConcurrentMap> pendingConnections = new ConcurrentHashMap<>(); + + public MuConnectionManager(EventLoopGroup workerGroup, ChannelManager channelManager, + Object messageHandler, Address localAddress) { + this.workerGroup = workerGroup; + this.channelManager = channelManager; + this.messageHandler = messageHandler; + this.localAddress = localAddress; + } + + /** + * Get or create connection to target address + * @param targetAddress target address + * @return CompletableFuture of channel + */ + public CompletableFuture getOrCreateConnection(Address targetAddress) { + String key = targetAddress.getHost() + ":" + targetAddress.getPort(); + + // Check if we already have an active connection + Channel existingChannel = serverConnections.get(key); + if (existingChannel != null && existingChannel.isActive()) { + return CompletableFuture.completedFuture(existingChannel); + } + + // Check if there's already a pending connection + CompletableFuture pendingConnection = pendingConnections.get(key); + if (pendingConnection != null) { + return pendingConnection; + } + + // Create new connection + CompletableFuture connectionFuture = new CompletableFuture<>(); + pendingConnections.put(key, connectionFuture); + + try { + Bootstrap bootstrap = new Bootstrap(); + bootstrap.group(workerGroup) + .channel(NioSocketChannel.class) + .option(ChannelOption.SO_KEEPALIVE, true) + .option(ChannelOption.TCP_NODELAY, true) + .handler(new ChannelInitializer() { + @Override + protected void initChannel(SocketChannel ch) { + ch.pipeline() + .addLast(new IdleStateHandler(0, 30, 0, TimeUnit.SECONDS)) + .addLast(new MuMessageCodec()) + .addLast((io.netty.channel.ChannelHandler) messageHandler); + + // Only add heartbeat handler for Worker connections + if (messageHandler instanceof MuWorkerHandler) { + ch.pipeline().addLast(new MuWorkerHeartbeatHandler(localAddress)); + } + } + }); + + ChannelFuture future = bootstrap.connect(targetAddress.getHost(), targetAddress.getPort()); + future.addListener(f -> { + pendingConnections.remove(key); + if (f.isSuccess()) { + Channel channel = future.channel(); + serverConnections.put(key, channel); + + // Remove connection when it becomes inactive + channel.closeFuture().addListener(closeFuture -> { + serverConnections.remove(key); + log.info("[MuConnectionManager] Removed inactive server connection: {}", key); + }); + + connectionFuture.complete(channel); + log.info("[MuConnectionManager] Connected to server: {}", key); + } else { + connectionFuture.completeExceptionally(f.cause()); + log.error("[MuConnectionManager] Failed to connect to server: {}", key, f.cause()); + } + }); + } catch (Exception e) { + pendingConnections.remove(key); + connectionFuture.completeExceptionally(e); + log.error("[MuConnectionManager] Error creating connection to server: {}", key, e); + } + + return connectionFuture; + } + + /** + * Close all connections + */ + public void closeAllConnections() { + for (Channel channel : serverConnections.values()) { + if (channel.isActive()) { + channel.close(); + } + } + serverConnections.clear(); + + // Complete all pending connections with exception + for (CompletableFuture future : pendingConnections.values()) { + future.completeExceptionally(new RuntimeException("Connection manager is closing")); + } + pendingConnections.clear(); + } +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuMessage.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuMessage.java new file mode 100644 index 000000000..f1c0c0e45 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuMessage.java @@ -0,0 +1,37 @@ +package tech.powerjob.remote.mu; + +import lombok.AllArgsConstructor; +import lombok.Data; +import lombok.NoArgsConstructor; +import tech.powerjob.common.PowerSerializable; +import tech.powerjob.remote.framework.base.Address; + +/** + * Mu protocol message format + * + * @author claude + * @since 2025/1/1 + */ +@Data +@NoArgsConstructor +@AllArgsConstructor +public class MuMessage implements PowerSerializable { + + /** + * Message types + */ + public enum MessageType { + TELL, // Fire-and-forget + ASK, // Request-response + RESPONSE, // Response to ASK + HEARTBEAT, // Worker heartbeat/registration + ERROR // Error response + } + + private MessageType messageType; + private String requestId; // Unique ID for ask/response correlation + private String path; // Handler path + private Address senderAddress; // Sender address for registration + private Object payload; // Actual message payload + private String errorMessage; // Error message for ERROR type +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuMessageCodec.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuMessageCodec.java new file mode 100644 index 000000000..7ff0f7cfd --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuMessageCodec.java @@ -0,0 +1,75 @@ +package tech.powerjob.remote.mu; + +import com.fasterxml.jackson.databind.ObjectMapper; +import io.netty.buffer.ByteBuf; +import io.netty.channel.ChannelHandlerContext; +import io.netty.handler.codec.ByteToMessageCodec; +import lombok.extern.slf4j.Slf4j; + +import java.util.List; + +/** + * Mu message codec for encoding/decoding messages over Netty + * + * @author claude + * @since 2025/1/1 + */ +@Slf4j +public class MuMessageCodec extends ByteToMessageCodec { + + private static final ObjectMapper OBJECT_MAPPER = new ObjectMapper(); + private static final int MAX_MESSAGE_SIZE = 64 * 1024 * 1024; // 64MB + + @Override + protected void encode(ChannelHandlerContext ctx, MuMessage msg, ByteBuf out) throws Exception { + try { + byte[] data = OBJECT_MAPPER.writeValueAsBytes(msg); + if (data.length > MAX_MESSAGE_SIZE) { + throw new IllegalArgumentException("Message too large: " + data.length + " bytes"); + } + + // Write message length followed by message data + out.writeInt(data.length); + out.writeBytes(data); + } catch (Exception e) { + log.error("[MuMessageCodec] Failed to encode message", e); + throw e; + } + } + + @Override + protected void decode(ChannelHandlerContext ctx, ByteBuf in, List out) throws Exception { + try { + // Need at least 4 bytes for length + if (in.readableBytes() < 4) { + return; + } + + // Mark reader index to reset if not enough data + in.markReaderIndex(); + + // Read message length + int length = in.readInt(); + + if (length <= 0 || length > MAX_MESSAGE_SIZE) { + throw new IllegalArgumentException("Invalid message length: " + length); + } + + // Check if we have enough bytes for the full message + if (in.readableBytes() < length) { + in.resetReaderIndex(); + return; + } + + // Read and decode message + byte[] data = new byte[length]; + in.readBytes(data); + + MuMessage message = OBJECT_MAPPER.readValue(data, MuMessage.class); + out.add(message); + } catch (Exception e) { + log.error("[MuMessageCodec] Failed to decode message", e); + throw e; + } + } +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuProtocol.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuProtocol.java new file mode 100644 index 000000000..798814940 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuProtocol.java @@ -0,0 +1,18 @@ +package tech.powerjob.remote.mu; + +import tech.powerjob.remote.framework.transporter.Protocol; + +/** + * Mu Protocol implementation using Netty for bidirectional communication + * with support for worker-only outbound connectivity + * + * @author claude + * @since 2025/1/1 + */ +public class MuProtocol implements Protocol { + + @Override + public String name() { + return tech.powerjob.common.enums.Protocol.MU.name(); + } +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuServerHandler.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuServerHandler.java new file mode 100644 index 000000000..76b9fbee5 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuServerHandler.java @@ -0,0 +1,185 @@ +package tech.powerjob.remote.mu; + +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.remote.framework.actor.ActorInfo; +import tech.powerjob.remote.framework.actor.HandlerInfo; +import tech.powerjob.remote.framework.utils.RemoteUtils; + +import java.lang.reflect.Method; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Server-side message handler for Mu protocol + * Handles incoming messages from workers and manages channel registration + * + * @author claude + * @since 2025/1/1 + */ +@Slf4j +@ChannelHandler.Sharable +public class MuServerHandler extends SimpleChannelInboundHandler { + + private final ChannelManager channelManager; + private final Map handlerMap = new ConcurrentHashMap<>(); + + public MuServerHandler(ChannelManager channelManager) { + this.channelManager = channelManager; + } + + public void bindHandlers(List actorInfos) { + for (ActorInfo actorInfo : actorInfos) { + if (actorInfo.getHandlerInfos() != null) { + for (HandlerInfo handlerInfo : actorInfo.getHandlerInfos()) { + String path = handlerInfo.getLocation().toPath(); + handlerMap.put(path, actorInfo); + log.info("[MuServerHandler] Bound handler: {}", path); + } + } + } + } + + @Override + protected void channelRead0(ChannelHandlerContext ctx, MuMessage msg) throws Exception { + try { + switch (msg.getMessageType()) { + case HEARTBEAT: + handleHeartbeat(ctx, msg); + break; + case TELL: + handleTell(ctx, msg); + break; + case ASK: + handleAsk(ctx, msg); + break; + case RESPONSE: + handleResponse(ctx, msg); + break; + case ERROR: + handleError(ctx, msg); + break; + default: + log.warn("[MuServerHandler] Unknown message type: {}", msg.getMessageType()); + } + } catch (Exception e) { + log.error("[MuServerHandler] Error processing message", e); + if (msg.getMessageType() == MuMessage.MessageType.ASK) { + // Send error response for ASK messages + MuMessage errorResponse = new MuMessage( + MuMessage.MessageType.ERROR, + msg.getRequestId(), + null, + null, + null, + "Internal server error: " + e.getMessage() + ); + ctx.writeAndFlush(errorResponse); + } + } + } + + private void handleHeartbeat(ChannelHandlerContext ctx, MuMessage msg) { + if (msg.getSenderAddress() != null) { + channelManager.registerWorkerChannel(msg.getSenderAddress(), ctx.channel()); + log.debug("[MuServerHandler] Registered worker: {}", msg.getSenderAddress()); + } + } + + private void handleTell(ChannelHandlerContext ctx, MuMessage msg) { + invokeHandler(msg, false, ctx); + } + + private void handleAsk(ChannelHandlerContext ctx, MuMessage msg) { + Object response = invokeHandler(msg, true, ctx); + + MuMessage.MessageType responseType = response != null ? + MuMessage.MessageType.RESPONSE : MuMessage.MessageType.ERROR; + String errorMessage = response == null ? "Handler returned null" : null; + + MuMessage responseMsg = new MuMessage( + responseType, + msg.getRequestId(), + null, + null, + response, + errorMessage + ); + + ctx.writeAndFlush(responseMsg); + } + + private void handleResponse(ChannelHandlerContext ctx, MuMessage msg) { + channelManager.completePendingRequest(msg.getRequestId(), msg.getPayload()); + } + + private void handleError(ChannelHandlerContext ctx, MuMessage msg) { + Exception exception = new RuntimeException(msg.getErrorMessage()); + channelManager.completePendingRequestExceptionally(msg.getRequestId(), exception); + } + + private Object invokeHandler(MuMessage msg, boolean needResponse, ChannelHandlerContext ctx) { + try { + String path = msg.getPath(); + ActorInfo actorInfo = handlerMap.get(path); + + if (actorInfo == null) { + log.warn("[MuServerHandler] No handler found for path: {}", path); + return null; + } + + HandlerInfo handlerInfo = actorInfo.getHandlerInfos().stream() + .filter(h -> h.getLocation().toPath().equals(path)) + .findFirst() + .orElse(null); + + if (handlerInfo == null) { + log.warn("[MuServerHandler] Handler info not found for path: {}", path); + return null; + } + + Method method = handlerInfo.getMethod(); + Optional> powerSerializeClz = RemoteUtils.findPowerSerialize(method.getParameterTypes()); + + if (!powerSerializeClz.isPresent()) { + log.error("[MuServerHandler] No PowerSerializable parameter found for handler: {}", path); + return null; + } + + Object convertedPayload = convertPayload(msg.getPayload(), powerSerializeClz.get()); + Object response = method.invoke(actorInfo.getActor(), convertedPayload); + + if (needResponse) { + return response; + } + + return null; + } catch (Exception e) { + log.error("[MuServerHandler] Failed to invoke handler for path: {}", msg.getPath(), e); + return null; + } + } + + private Object convertPayload(Object payload, Class targetClass) { + if (payload == null) { + return null; + } + + if (targetClass.isInstance(payload)) { + return payload; + } + + return JsonUtils.toJavaObject(payload, targetClass); + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { + log.error("[MuServerHandler] Channel exception", cause); + ctx.close(); + } +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuTransporter.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuTransporter.java new file mode 100644 index 000000000..a2d563073 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuTransporter.java @@ -0,0 +1,195 @@ +package tech.powerjob.remote.mu; + +import io.netty.channel.Channel; +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.common.PowerSerializable; +import tech.powerjob.remote.framework.base.RemotingException; +import tech.powerjob.remote.framework.base.ServerType; +import tech.powerjob.remote.framework.base.URL; +import tech.powerjob.remote.framework.transporter.Protocol; +import tech.powerjob.remote.framework.transporter.Transporter; + +import java.util.UUID; +import java.util.concurrent.CompletableFuture; +import java.util.concurrent.CompletionStage; +import java.util.concurrent.TimeUnit; + +/** + * Mu protocol transporter implementation + * Handles both client-side (worker) and reverse (server-to-worker) communication + * + * @author claude + * @since 2025/1/1 + */ +@Slf4j +public class MuTransporter implements Transporter { + + private static final Protocol PROTOCOL = new MuProtocol(); + private static final long ASK_TIMEOUT_SECONDS = 30; + + private final ChannelManager channelManager; + private final ServerType serverType; + private final MuConnectionManager connectionManager; // For worker-side lazy connection + + public MuTransporter(ChannelManager channelManager, ServerType serverType, MuConnectionManager connectionManager) { + this.channelManager = channelManager; + this.serverType = serverType; + this.connectionManager = connectionManager; + } + + @Override + public Protocol getProtocol() { + return PROTOCOL; + } + + @Override + public void tell(URL url, PowerSerializable request) { + try { + MuMessage message = new MuMessage( + MuMessage.MessageType.TELL, + null, + url.getLocation().toPath(), + null, + request, + null + ); + + if (serverType == ServerType.WORKER) { + // Worker to server/worker: use connection manager for lazy connection + connectionManager.getOrCreateConnection(url.getAddress()) + .thenAccept(channel -> { + if (channel.isActive()) { + channel.writeAndFlush(message); + log.debug("[MuTransporter] Sent TELL message to {}", url); + } else { + log.error("[MuTransporter] Channel is not active for {}", url); + } + }) + .exceptionally(throwable -> { + log.error("[MuTransporter] Failed to get connection for TELL to {}", url, throwable); + return null; + }); + } else { + // Server side: distinguish between worker and server targets + if (url.getServerType() == ServerType.WORKER) { + // Server to worker: use stored channel from worker registration + Channel channel = channelManager.getWorkerChannel(url.getAddress()); + if (channel != null && channel.isActive()) { + channel.writeAndFlush(message); + log.debug("[MuTransporter] Sent TELL message to worker {}", url); + } else { + log.error("[MuTransporter] No active channel available for worker {}", url); + throw new RemotingException("No active channel available for " + url); + } + } else { + // Server to server: use connection manager for direct connection + connectionManager.getOrCreateConnection(url.getAddress()) + .thenAccept(channel -> { + if (channel.isActive()) { + channel.writeAndFlush(message); + log.debug("[MuTransporter] Sent TELL message to server {}", url); + } else { + log.error("[MuTransporter] Channel is not active for server {}", url); + } + }) + .exceptionally(throwable -> { + log.error("[MuTransporter] Failed to get connection for TELL to server {}", url, throwable); + return null; + }); + } + } + } catch (Exception e) { + log.error("[MuTransporter] Failed to send TELL message to {}", url, e); + throw new RemotingException("Failed to send TELL message", e); + } + } + + @Override + public CompletionStage ask(URL url, PowerSerializable request, Class clz) throws RemotingException { + try { + String requestId = UUID.randomUUID().toString(); + CompletableFuture future = new CompletableFuture<>(); + + // Register the future for response handling + channelManager.registerPendingRequest(requestId, (CompletableFuture) future, clz); + + // Set timeout for the request (JDK8 compatible) + future.whenComplete((result, throwable) -> { + if (throwable != null) { + channelManager.removePendingRequest(requestId); + } + }); + + // Schedule timeout manually for JDK8 compatibility + java.util.concurrent.Executors.newSingleThreadScheduledExecutor().schedule(() -> { + if (!future.isDone()) { + channelManager.removePendingRequest(requestId); + future.completeExceptionally(new java.util.concurrent.TimeoutException("Request timeout after " + ASK_TIMEOUT_SECONDS + " seconds")); + } + }, ASK_TIMEOUT_SECONDS, TimeUnit.SECONDS); + + MuMessage message = new MuMessage( + MuMessage.MessageType.ASK, + requestId, + url.getLocation().toPath(), + null, + request, + null + ); + + if (serverType == ServerType.WORKER) { + // Worker to server/worker: use connection manager for lazy connection + connectionManager.getOrCreateConnection(url.getAddress()) + .thenAccept(channel -> { + if (channel.isActive()) { + channel.writeAndFlush(message); + log.debug("[MuTransporter] Sent ASK message to {} with requestId {}", url, requestId); + } else { + channelManager.removePendingRequest(requestId); + future.completeExceptionally(new RemotingException("Channel is not active for " + url)); + } + }) + .exceptionally(throwable -> { + channelManager.removePendingRequest(requestId); + future.completeExceptionally(new RemotingException("Failed to get connection for ASK to " + url, throwable)); + return null; + }); + } else { + // Server side: distinguish between worker and server targets + if (url.getServerType() == ServerType.WORKER) { + // Server to worker: use stored channel from worker registration + Channel channel = channelManager.getWorkerChannel(url.getAddress()); + if (channel != null && channel.isActive()) { + channel.writeAndFlush(message); + log.debug("[MuTransporter] Sent ASK message to worker {} with requestId {}", url, requestId); + } else { + channelManager.removePendingRequest(requestId); + future.completeExceptionally(new RemotingException("No active channel available for " + url)); + } + } else { + // Server to server: use connection manager for direct connection + connectionManager.getOrCreateConnection(url.getAddress()) + .thenAccept(channel -> { + if (channel.isActive()) { + channel.writeAndFlush(message); + log.debug("[MuTransporter] Sent ASK message to server {} with requestId {}", url, requestId); + } else { + channelManager.removePendingRequest(requestId); + future.completeExceptionally(new RemotingException("Channel is not active for server " + url)); + } + }) + .exceptionally(throwable -> { + channelManager.removePendingRequest(requestId); + future.completeExceptionally(new RemotingException("Failed to get connection for ASK to server " + url, throwable)); + return null; + }); + } + } + + return future; + } catch (Exception e) { + log.error("[MuTransporter] Failed to send ASK message to {}", url, e); + throw new RemotingException("Failed to send ASK message", e); + } + } +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuWorkerHandler.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuWorkerHandler.java new file mode 100644 index 000000000..6099665ff --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuWorkerHandler.java @@ -0,0 +1,190 @@ +package tech.powerjob.remote.mu; + +import io.netty.channel.ChannelHandler; +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.SimpleChannelInboundHandler; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.remote.framework.actor.ActorInfo; +import tech.powerjob.remote.framework.actor.HandlerInfo; +import tech.powerjob.remote.framework.utils.RemoteUtils; + +import java.lang.reflect.Method; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.concurrent.ConcurrentHashMap; + +/** + * Worker-side message handler for Mu protocol + * Handles incoming messages from server and processes local handlers + * + * @author claude + * @since 2025/1/1 + */ +@Slf4j +@ChannelHandler.Sharable +public class MuWorkerHandler extends SimpleChannelInboundHandler { + + private final Map handlerMap = new ConcurrentHashMap<>(); + private final ChannelManager channelManager; + + public MuWorkerHandler(ChannelManager channelManager) { + this.channelManager = channelManager; + } + + public void bindHandlers(List actorInfos) { + for (ActorInfo actorInfo : actorInfos) { + if (actorInfo.getHandlerInfos() != null) { + for (HandlerInfo handlerInfo : actorInfo.getHandlerInfos()) { + String path = handlerInfo.getLocation().toPath(); + handlerMap.put(path, actorInfo); + log.info("[MuWorkerHandler] Bound handler: {}", path); + } + } + } + } + + @Override + protected void channelRead0(ChannelHandlerContext ctx, MuMessage msg) throws Exception { + try { + switch (msg.getMessageType()) { + case TELL: + handleTell(ctx, msg); + break; + case ASK: + handleAsk(ctx, msg); + break; + case RESPONSE: + handleResponse(ctx, msg); + break; + case ERROR: + handleError(ctx, msg); + break; + case HEARTBEAT: + handleHeartbeat(ctx, msg); + break; + default: + log.warn("[MuWorkerHandler] Unknown message type: {}", msg.getMessageType()); + } + } catch (Exception e) { + log.error("[MuWorkerHandler] Error processing message", e); + if (msg.getMessageType() == MuMessage.MessageType.ASK) { + // Send error response for ASK messages + MuMessage errorResponse = new MuMessage( + MuMessage.MessageType.ERROR, + msg.getRequestId(), + null, + null, + null, + "Internal worker error: " + e.getMessage() + ); + ctx.writeAndFlush(errorResponse); + } + } + } + + private void handleTell(ChannelHandlerContext ctx, MuMessage msg) { + invokeHandler(msg, false, ctx); + } + + private void handleAsk(ChannelHandlerContext ctx, MuMessage msg) { + Object response = invokeHandler(msg, true, ctx); + + MuMessage.MessageType responseType = response != null ? + MuMessage.MessageType.RESPONSE : MuMessage.MessageType.ERROR; + String errorMessage = response == null ? "Handler returned null" : null; + + MuMessage responseMsg = new MuMessage( + responseType, + msg.getRequestId(), + null, + null, + response, + errorMessage + ); + + ctx.writeAndFlush(responseMsg); + } + + private void handleResponse(ChannelHandlerContext ctx, MuMessage msg) { + channelManager.completePendingRequest(msg.getRequestId(), msg.getPayload()); + } + + private void handleError(ChannelHandlerContext ctx, MuMessage msg) { + Exception exception = new RuntimeException(msg.getErrorMessage()); + channelManager.completePendingRequestExceptionally(msg.getRequestId(), exception); + } + + private void handleHeartbeat(ChannelHandlerContext ctx, MuMessage msg) { + // Worker接收到心跳消息时,通常不需要特殊处理 + // 但记录一下调试信息,表明收到了心跳 + if (msg.getSenderAddress() != null) { + log.debug("[MuWorkerHandler] Received heartbeat from: {}", msg.getSenderAddress()); + } else { + log.debug("[MuWorkerHandler] Received heartbeat"); + } + } + + private Object invokeHandler(MuMessage msg, boolean needResponse, ChannelHandlerContext ctx) { + try { + String path = msg.getPath(); + ActorInfo actorInfo = handlerMap.get(path); + + if (actorInfo == null) { + log.warn("[MuWorkerHandler] No handler found for path: {}", path); + return null; + } + + HandlerInfo handlerInfo = actorInfo.getHandlerInfos().stream() + .filter(h -> h.getLocation().toPath().equals(path)) + .findFirst() + .orElse(null); + + if (handlerInfo == null) { + log.warn("[MuWorkerHandler] Handler info not found for path: {}", path); + return null; + } + + Method method = handlerInfo.getMethod(); + Optional> powerSerializeClz = RemoteUtils.findPowerSerialize(method.getParameterTypes()); + + if (!powerSerializeClz.isPresent()) { + log.error("[MuWorkerHandler] No PowerSerializable parameter found for handler: {}", path); + return null; + } + + Object convertedPayload = convertPayload(msg.getPayload(), powerSerializeClz.get()); + Object response = method.invoke(actorInfo.getActor(), convertedPayload); + + if (needResponse) { + return response; + } + + return null; + } catch (Exception e) { + log.error("[MuWorkerHandler] Failed to invoke handler for path: {}", msg.getPath(), e); + return null; + } + } + + @SneakyThrows + private Object convertPayload(Object payload, Class targetClass) { + if (payload == null) { + return null; + } + + if (targetClass.isInstance(payload)) { + return payload; + } + + return JsonUtils.toJavaObject(payload, targetClass); + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { + log.error("[MuWorkerHandler] Channel exception", cause); + ctx.close(); + } +} \ No newline at end of file diff --git a/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuWorkerHeartbeatHandler.java b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuWorkerHeartbeatHandler.java new file mode 100644 index 000000000..a80e63419 --- /dev/null +++ b/powerjob-remote/powerjob-remote-impl-mu/src/main/java/tech/powerjob/remote/mu/MuWorkerHeartbeatHandler.java @@ -0,0 +1,61 @@ +package tech.powerjob.remote.mu; + +import io.netty.channel.ChannelHandlerContext; +import io.netty.channel.ChannelInboundHandlerAdapter; +import io.netty.handler.timeout.IdleState; +import io.netty.handler.timeout.IdleStateEvent; +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.remote.framework.base.Address; + +/** + * Worker heartbeat handler for maintaining connection and registration + * + * @author claude + * @since 2025/1/1 + */ +@Slf4j +public class MuWorkerHeartbeatHandler extends ChannelInboundHandlerAdapter { + + private final Address workerAddress; + + public MuWorkerHeartbeatHandler(Address workerAddress) { + this.workerAddress = workerAddress; + } + + @Override + public void channelActive(ChannelHandlerContext ctx) throws Exception { + super.channelActive(ctx); + sendHeartbeat(ctx); + log.info("[MuWorkerHeartbeatHandler] Worker connected and sent initial heartbeat"); + } + + @Override + public void userEventTriggered(ChannelHandlerContext ctx, Object evt) throws Exception { + if (evt instanceof IdleStateEvent) { + IdleStateEvent event = (IdleStateEvent) evt; + if (event.state() == IdleState.WRITER_IDLE) { + sendHeartbeat(ctx); + log.debug("[MuWorkerHeartbeatHandler] Sent heartbeat"); + } + } + super.userEventTriggered(ctx, evt); + } + + private void sendHeartbeat(ChannelHandlerContext ctx) { + MuMessage heartbeat = new MuMessage( + MuMessage.MessageType.HEARTBEAT, + null, + null, + workerAddress, + null, + null + ); + ctx.writeAndFlush(heartbeat); + } + + @Override + public void exceptionCaught(ChannelHandlerContext ctx, Throwable cause) { + log.error("[MuWorkerHeartbeatHandler] Exception in heartbeat handler", cause); + ctx.close(); + } +} \ No newline at end of file diff --git a/powerjob-server/docker/Dockerfile b/powerjob-server/docker/Dockerfile index 606dd7113..1565dd4ea 100644 --- a/powerjob-server/docker/Dockerfile +++ b/powerjob-server/docker/Dockerfile @@ -3,8 +3,8 @@ FROM adoptopenjdk:8-jdk-hotspot # 维护者 MAINTAINER tengjiqi@gmail.com # 下载并安装 maven -RUN curl -O https://mirrors.aliyun.com/apache/maven/maven-3/3.9.4/binaries/apache-maven-3.9.4-bin.tar.gz -RUN tar -zxvf apache-maven-3.9.4-bin.tar.gz && mv apache-maven-3.9.4 /opt/powerjob-maven && rm -rf apache-maven-3.9.4-bin.tar.gz +RUN curl -O https://mirrors.aliyun.com/apache/maven/maven-3/3.9.11/binaries/apache-maven-3.9.11-bin.tar.gz +RUN tar -zxvf apache-maven-3.9.11-bin.tar.gz && mv apache-maven-3.9.11 /opt/powerjob-maven && rm -rf apache-maven-3.9.11-bin.tar.gz # 替换 maven 配置文件 RUN rm -rf /opt/powerjob-maven/conf/settings.xml COPY settings.xml /opt/powerjob-maven/conf/settings.xml diff --git a/powerjob-server/pom.xml b/powerjob-server/pom.xml index 81b49f4f4..6dbc3f2db 100644 --- a/powerjob-server/pom.xml +++ b/powerjob-server/pom.xml @@ -5,12 +5,13 @@ powerjob tech.powerjob - 4.3.6 + 5.1.2 4.0.0 powerjob-server - 4.3.6 + powerjob-server + 5.1.2 pom @@ -22,11 +23,12 @@ powerjob-server-migrate powerjob-server-core powerjob-server-monitor + powerjob-server-auth - 2.7.14 + 2.7.18 8.0.33 @@ -34,7 +36,7 @@ 7.4.1.jre8 11.5.0.0 42.6.0 - 2.2.220 + 2.2.224 4.10.2 2.11.2 @@ -50,12 +52,13 @@ 3.0.10 9.2.1 - 4.3.6 - 4.3.6 - 4.3.6 + 5.1.2 + 5.1.2 + 5.1.2 + 5.1.2 1.6.14 3.17.1 - 8.5.2 + 1.12.665 4.4 @@ -96,12 +99,23 @@ powerjob-server-migrate ${project.version} + + tech.powerjob + powerjob-server-auth + ${project.version} + tech.powerjob powerjob-server-starter ${project.version} + + tech.powerjob + powerjob-client + ${project.version} + + org.mongodb @@ -114,11 +128,11 @@ aliyun-sdk-oss ${aliyun-sdk-oss.version} - + - io.minio - minio - ${minio.version} + com.amazonaws + aws-java-sdk-s3 + ${aws-java-sdk-s3.version} @@ -149,6 +163,11 @@ powerjob-remote-impl-akka ${powerjob-remote-impl-akka.version} + + tech.powerjob + powerjob-remote-impl-mu + ${powerjob-remote-impl-mu.version} + diff --git a/powerjob-server/powerjob-server-auth/pom.xml b/powerjob-server/powerjob-server-auth/pom.xml new file mode 100644 index 000000000..e25a0ff41 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/pom.xml @@ -0,0 +1,58 @@ + + + + + tech.powerjob + powerjob-server + 5.1.2 + + + 4.0.0 + + powerjob-server-auth + ${project.parent.version} + + + 8 + 8 + UTF-8 + 0.11.5 + 1.1.86 + + + + + tech.powerjob + powerjob-server-persistence + provided + + + io.jsonwebtoken + jjwt-api + ${jjwt.version} + + + io.jsonwebtoken + jjwt-impl + ${jjwt.version} + runtime + + + io.jsonwebtoken + jjwt-jackson + ${jjwt.version} + runtime + + + + com.aliyun + dingtalk + ${dingtalk.version} + + + + + + \ No newline at end of file diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/LoginUserHolder.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/LoginUserHolder.java new file mode 100644 index 000000000..7cf324a61 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/LoginUserHolder.java @@ -0,0 +1,48 @@ +package tech.powerjob.server.auth; + +/** + * LoginUserHolder + * + * @author tjq + * @since 2023/4/16 + */ +public class LoginUserHolder { + + private static final ThreadLocal TL = new ThreadLocal<>(); + + public static PowerJobUser get() { + return TL.get(); + } + + public static void set(PowerJobUser powerJobUser) { + TL.set(powerJobUser); + } + + public static void clean() { + TL.remove(); + } + + /** + * 获取用户名 + * @return 存在则返回常规用户名,否则返回 unknown + */ + public static String getUserName() { + PowerJobUser powerJobUser = get(); + if (powerJobUser != null) { + return powerJobUser.getUsername(); + } + return "UNKNOWN"; + } + + /** + * 获取用户ID + * @return 存在则返回,否则返回 null + */ + public static Long getUserId() { + PowerJobUser powerJobUser = get(); + if (powerJobUser != null) { + return powerJobUser.getId(); + } + return null; + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/Permission.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/Permission.java new file mode 100644 index 000000000..e6fabb4a5 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/Permission.java @@ -0,0 +1,40 @@ +package tech.powerjob.server.auth; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 权限 + * + * @author tjq + * @since 2023/3/20 + */ +@Getter +@AllArgsConstructor +public enum Permission { + + /** + * 不需要权限 + */ + NONE(1), + /** + * 读权限,查看控制台数据 + */ + READ(10), + /** + * 写权限,新增/修改任务等 + */ + WRITE(20), + /** + * 运维权限,比如任务的执行 + */ + OPS(30), + /** + * 超级权限 + */ + SU(100) + ; + + + private int v; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/PowerJobUser.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/PowerJobUser.java new file mode 100644 index 000000000..c0a750c1a --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/PowerJobUser.java @@ -0,0 +1,44 @@ +package tech.powerjob.server.auth; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.io.Serializable; + +/** + * PowerJob 的 登陆用户 + * + * @author tjq + * @since 2023/3/20 + */ +@Getter +@Setter +@ToString +public class PowerJobUser implements Serializable { + + private Long id; + + private String username; + + /** + * 手机号 + */ + private String phone; + /** + * 邮箱地址 + */ + private String email; + /** + * webHook + */ + private String webHook; + /** + * 扩展字段 + */ + private String extra; + + /* ************** 以上为数据库字段 ************** */ + + private String jwtToken; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/Role.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/Role.java new file mode 100644 index 000000000..9b0280ab7 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/Role.java @@ -0,0 +1,53 @@ +package tech.powerjob.server.auth; + +import com.google.common.collect.Sets; +import lombok.AllArgsConstructor; +import lombok.Getter; + +import java.util.Set; + +import static tech.powerjob.server.auth.Permission.*; + +/** + * 角色 + * PowerJob 采用 RBAC 实现权限,出于实际需求的考虑,不决定采用动态权限模型。因此 RBAC 中的角色和权限均在此处定义。 + * 如果有自定义诉求,可以修改 Role 的定义 + * + * @author tjq + * @since 2023/3/20 + */ +@Getter +@AllArgsConstructor +public enum Role { + + /** + * 观察者,默认只读权限 + */ + OBSERVER(10, Sets.newHashSet(READ)), + /** + * 技术质量,读 + 操作权限 + */ + QA(20, Sets.newHashSet(READ, OPS)), + /** + * 开发者,读 + 编辑 + 操作权限 + */ + DEVELOPER(30, Sets.newHashSet(READ, WRITE, OPS)), + /** + * 管理员 + */ + ADMIN(40, Sets.newHashSet(READ, WRITE, OPS, SU)) + ; + + private final int v; + + private final Set permissions; + + public static Role of(int vv) { + for (Role role : values()) { + if (vv == role.v) { + return role; + } + } + throw new IllegalArgumentException("unknown role: " + vv); + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/RoleScope.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/RoleScope.java new file mode 100644 index 000000000..cec6f559c --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/RoleScope.java @@ -0,0 +1,40 @@ +package tech.powerjob.server.auth; + +import lombok.AllArgsConstructor; +import lombok.Getter; + +/** + * 权限范围 + * + * @author tjq + * @since 2023/9/3 + */ +@Getter +@AllArgsConstructor +public enum RoleScope { + + /** + * NAMESPACE 权限 + */ + NAMESPACE(1), + /** + * APP 级别权限 + */ + APP(10), + /** + * 全局权限 + */ + GLOBAL(666) + ; + + private final int v; + + public static RoleScope of(int vv) { + for (RoleScope rs : values()) { + if (vv == rs.v) { + return rs; + } + } + throw new IllegalArgumentException("unknown RoleScope: " + vv); + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/AuthConstants.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/AuthConstants.java new file mode 100644 index 000000000..7aa055288 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/AuthConstants.java @@ -0,0 +1,53 @@ +package tech.powerjob.server.auth.common; + +/** + * 常量 + * + * @author tjq + * @since 2024/2/11 + */ +public class AuthConstants { + + /* ********** 账号体系唯一标识,推荐开发者接入第三方登录体系时也使用4位编码,便于前端统一做样式 ********** */ + /** + * PowerJob自建账号体系 + */ + public static final String ACCOUNT_TYPE_POWER_JOB = "PWJB"; + /** + * 钉钉 + */ + public static final String ACCOUNT_TYPE_DING = "DING"; + /** + * 企业微信(预留,蹲一个 contributor) + */ + public static final String ACCOUNT_TYPE_WX = "QYWX"; + /** + * 飞书(预留,蹲一个 contributor +1) + */ + public static final String ACCOUNT_LARK = "LARK"; + + public static final String PARAM_KEY_USERNAME = "username"; + public static final String PARAM_KEY_PASSWORD = "password"; + /** + * 前端参数-密码加密类型,官方版本出于成本未进行前后端传输的对称加密,接入方有需求可自行实现,此处定义加密协议字段 + */ + public static final String PARAM_KEY_ENCRYPTION = "encryption"; + + /* ********** 账号体系 ********** */ + + /** + * JWT key + * 前端 header 默认首字母大写,保持一致方便处理 + */ + public static final String OLD_JWT_NAME = "Power_jwt"; + public static final String JWT_NAME = "PowerJwt"; + + /** + * 前端跳转到指定页面指令 + */ + public static final String FE_REDIRECT_KEY = "FE-REDIRECT:"; + + public static final String TIPS_NO_PERMISSION_TO_SEE = "NO_PERMISSION_TO_SEE"; + + public static final Long GLOBAL_ADMIN_TARGET_ID = 1L; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/PowerJobAuthException.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/PowerJobAuthException.java new file mode 100644 index 000000000..2b2862e06 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/PowerJobAuthException.java @@ -0,0 +1,23 @@ +package tech.powerjob.server.auth.common; + +import lombok.Getter; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.common.exception.PowerJobException; + +/** + * 鉴权相关错误 + * + * @author tjq + * @since 2024/2/10 + */ +@Getter +public class PowerJobAuthException extends PowerJobException { + + public PowerJobAuthException(ErrorCodes errorCode) { + this(errorCode, null); + } + + public PowerJobAuthException(ErrorCodes errorCode, String extraMsg) { + super(errorCode, extraMsg); + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/utils/AuthHeaderUtils.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/utils/AuthHeaderUtils.java new file mode 100644 index 000000000..de4b4859f --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/utils/AuthHeaderUtils.java @@ -0,0 +1,27 @@ +package tech.powerjob.server.auth.common.utils; + +import javax.servlet.http.HttpServletRequest; +import java.util.Objects; + +/** + * 获取常用的请求头 + * + * @author tjq + * @since 2025/1/21 + */ +public class AuthHeaderUtils { + + public static String fetchAppId(HttpServletRequest request) { + return HttpServletUtils.fetchFromHeader("AppId", request); + } + public static Long fetchAppIdL(HttpServletRequest request) { + return Long.valueOf(Objects.requireNonNull(HttpServletUtils.fetchFromHeader("AppId", request), "AppId from header is null!")); + } + + public static String fetchNamespaceId(HttpServletRequest request) { + return HttpServletUtils.fetchFromHeader("NamespaceId", request); + } + public static Long fetchNamespaceIdL(HttpServletRequest request) { + return Long.valueOf(Objects.requireNonNull(HttpServletUtils.fetchFromHeader("NamespaceId", request), "NamespaceId from header is null!")); + } +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/utils/HttpServletUtils.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/utils/HttpServletUtils.java new file mode 100644 index 000000000..7c232ca15 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/common/utils/HttpServletUtils.java @@ -0,0 +1,27 @@ +package tech.powerjob.server.auth.common.utils; + +import tech.powerjob.common.OmsConstant; + +import javax.servlet.http.HttpServletRequest; + +/** + * HttpServletUtils + * + * @author tjq + * @since 2024/2/12 + */ +public class HttpServletUtils { + + public static String fetchFromHeader(String key, HttpServletRequest httpServletRequest) { + // header、cookie 都能获取 + String v = httpServletRequest.getHeader(key); + + // 解决 window.localStorage.getItem 为 null 的问题 + if (OmsConstant.NULL.equalsIgnoreCase(v) || "undefined".equalsIgnoreCase(v)) { + return null; + } + + return v; + } + +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/ApiPermission.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/ApiPermission.java new file mode 100644 index 000000000..98bfce2e2 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/ApiPermission.java @@ -0,0 +1,45 @@ +package tech.powerjob.server.auth.interceptor; + +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.RoleScope; + +import java.lang.annotation.ElementType; +import java.lang.annotation.Retention; +import java.lang.annotation.RetentionPolicy; +import java.lang.annotation.Target; + +/** + * API 权限 + * + * @author tjq + * @since 2023/3/20 + */ +@Target(ElementType.METHOD) +@Retention(RetentionPolicy.RUNTIME) +public @interface ApiPermission { + /** + * API 名称 + * @return 空使用服务.方法名代替 + */ + String name() default ""; + + RoleScope roleScope() default RoleScope.APP; + + /** + * 需要的权限 + * @return 权限 + */ + Permission requiredPermission() default Permission.SU; + + /** + * 固定权限不支持的场景,需要使用动态权限 + * @return 动态权限 + */ + Class dynamicPermissionPlugin() default EmptyPlugin.class; + + /** + * 新增场景,需要授权插件执行授权 + * @return 授权插件 + */ + Class grandPermissionPlugin() default EmptyPlugin.class; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/ApiPermissionAspect.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/ApiPermissionAspect.java new file mode 100644 index 000000000..e0179fe2a --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/ApiPermissionAspect.java @@ -0,0 +1,65 @@ +package tech.powerjob.server.auth.interceptor; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.aspectj.lang.JoinPoint; +import org.aspectj.lang.annotation.AfterReturning; +import org.aspectj.lang.annotation.Aspect; +import org.aspectj.lang.annotation.Pointcut; +import org.aspectj.lang.reflect.MethodSignature; +import org.springframework.core.annotation.AnnotationUtils; +import org.springframework.stereotype.Component; + +import java.lang.reflect.Method; + +/** + * ApiPermission 切面 + * 主要用于执行授权插件,完成创建后授权 + * + * @author tjq + * @since 2024/2/11 + */ +@Slf4j +@Aspect +@Component +public class ApiPermissionAspect { + + @Pointcut("@annotation(ApiPermission)") + public void apiPermissionPointcut() { + // 定义切入点 + } + + /** + * 后置返回 + * 如果第一个参数为JoinPoint,则第二个参数为返回值的信息 + * 如果第一个参数不为JoinPoint,则第一个参数为returning中对应的参数 + * returning:限定了只有目标方法返回值与通知方法参数类型匹配时才能执行后置返回通知,否则不执行, + * 参数为Object类型将匹配任何目标返回值 + * After注解标注的方法会在目标方法执行后运行,无论目标方法是正常完成还是抛出异常。它相当于finally块,因为它总是执行,所以适用于释放资源等清理活动。@After注解不能访问目标方法的返回值。 + * AfterReturning注解标注的方法仅在目标方法成功执行后(即正常返回)运行。它可以访问目标方法的返回值。使用@AfterReturning可以在方法正常返回后执行一些逻辑,比如对返回值进行处理或验证。 + */ + @AfterReturning(value = "apiPermissionPointcut()", returning = "result") + public void doAfterReturningAdvice1(JoinPoint joinPoint, Object result) { + + // 入参 + Object[] args = joinPoint.getArgs(); + + // 获取目标方法 + MethodSignature signature = (MethodSignature) joinPoint.getSignature(); + Method method = signature.getMethod(); + + ApiPermission annotationAnno = AnnotationUtils.getAnnotation(method, ApiPermission.class); + + assert annotationAnno != null; + + Class grandPermissionPluginClz = annotationAnno.grandPermissionPlugin(); + + try { + GrantPermissionPlugin grandPermissionPlugin = grandPermissionPluginClz.getDeclaredConstructor().newInstance(); + grandPermissionPlugin.grant(args, result, method, joinPoint.getTarget()); + } catch (Exception e) { + log.error("[ApiPermissionAspect] process ApiPermission grant failed", e); + ExceptionUtils.rethrow(e); + } + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/DynamicPermissionPlugin.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/DynamicPermissionPlugin.java new file mode 100644 index 000000000..504deb6ec --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/DynamicPermissionPlugin.java @@ -0,0 +1,15 @@ +package tech.powerjob.server.auth.interceptor; + +import tech.powerjob.server.auth.Permission; + +import javax.servlet.http.HttpServletRequest; + +/** + * 动态权限 + * + * @author tjq + * @since 2023/9/3 + */ +public interface DynamicPermissionPlugin { + Permission calculate(HttpServletRequest request, Object handler); +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/EmptyPlugin.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/EmptyPlugin.java new file mode 100644 index 000000000..95d00b8f2 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/EmptyPlugin.java @@ -0,0 +1,24 @@ +package tech.powerjob.server.auth.interceptor; + +import tech.powerjob.server.auth.Permission; + +import javax.servlet.http.HttpServletRequest; +import java.lang.reflect.Method; + +/** + * 空 + * + * @author tjq + * @since 2024/2/12 + */ +public class EmptyPlugin implements DynamicPermissionPlugin, GrantPermissionPlugin { + @Override + public Permission calculate(HttpServletRequest request, Object handler) { + return null; + } + + @Override + public void grant(Object[] args, Object result, Method method, Object originBean) { + + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/GrantPermissionPlugin.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/GrantPermissionPlugin.java new file mode 100644 index 000000000..34d085ad7 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/GrantPermissionPlugin.java @@ -0,0 +1,21 @@ +package tech.powerjob.server.auth.interceptor; + +import java.lang.reflect.Method; + +/** + * 授予权限插件 + * + * @author tjq + * @since 2024/2/11 + */ +public interface GrantPermissionPlugin { + + /** + * 授权 + * @param args 入参 + * @param result 响应 + * @param method 被调用方法 + * @param originBean 原始对象 + */ + void grant(Object[] args, Object result, Method method, Object originBean); +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/PowerJobAuthInterceptor.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/PowerJobAuthInterceptor.java new file mode 100644 index 000000000..dbf68bf10 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/interceptor/PowerJobAuthInterceptor.java @@ -0,0 +1,135 @@ +package tech.powerjob.server.auth.interceptor; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.springframework.lang.NonNull; +import org.springframework.stereotype.Component; +import org.springframework.web.method.HandlerMethod; +import org.springframework.web.servlet.HandlerInterceptor; +import tech.powerjob.common.exception.ImpossibleException; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.server.auth.LoginUserHolder; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.PowerJobUser; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.server.auth.common.PowerJobAuthException; +import tech.powerjob.server.auth.common.utils.AuthHeaderUtils; +import tech.powerjob.server.auth.service.login.PowerJobLoginService; +import tech.powerjob.server.auth.service.permission.PowerJobPermissionService; +import tech.powerjob.server.common.Loggers; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; +import java.util.Optional; + +/** + * login auth and permission check + * + * @author tjq + * @since 2023/3/25 + */ +@Slf4j +@Component +public class PowerJobAuthInterceptor implements HandlerInterceptor { + @Resource + private PowerJobLoginService powerJobLoginService; + @Resource + private PowerJobPermissionService powerJobPermissionService; + + @Override + public boolean preHandle(@NonNull HttpServletRequest request,@NonNull HttpServletResponse response,@NonNull Object handler) throws Exception { + if (!(handler instanceof HandlerMethod)) { + return true; + } + HandlerMethod handlerMethod = (HandlerMethod) handler; + final Method method = handlerMethod.getMethod(); + final ApiPermission apiPermissionAnno = method.getAnnotation(ApiPermission.class); + + // 无注解代表不需要权限,无需登陆直接访问 + if (apiPermissionAnno == null) { + return true; + } + + // 尝试直接解析登陆 + final Optional loginUserOpt = powerJobLoginService.ifLogin(request); + + // 未登录直接报错,返回固定状态码,前端拦截后跳转到登录页 + if (!loginUserOpt.isPresent()) { + throw new PowerJobAuthException(ErrorCodes.USER_NOT_LOGIN); + } + + // 登陆用户进行权限校验 + final PowerJobUser powerJobUser = loginUserOpt.get(); + + // 写入上下文 + LoginUserHolder.set(powerJobUser); + + Permission requiredPermission = parsePermission(request, handler, apiPermissionAnno); + RoleScope roleScope = apiPermissionAnno.roleScope(); + Long targetId = null; + + if (RoleScope.NAMESPACE.equals(roleScope)) { + + final String namespaceIdStr = AuthHeaderUtils.fetchNamespaceId(request); + if (StringUtils.isNotEmpty(namespaceIdStr)) { + targetId = Long.valueOf(namespaceIdStr); + } + } + + if (RoleScope.APP.equals(roleScope)) { + final String appIdStr = AuthHeaderUtils.fetchAppId(request); + if (StringUtils.isNotEmpty(appIdStr)) { + targetId = Long.valueOf(appIdStr); + } + } + + + final boolean hasPermission = powerJobPermissionService.hasPermission(powerJobUser.getId(), roleScope, targetId, requiredPermission); + if (hasPermission) { + return true; + } + + final String resourceName = parseResourceName(apiPermissionAnno, handlerMethod); + Loggers.WEB.info("[PowerJobAuthInterceptor] user[{}] has no permission to access: {}", powerJobUser.getUsername(), resourceName); + + throw new PowerJobException("Permission denied!"); + } + + @Override + public void afterCompletion(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler, Exception ex) throws Exception { + LoginUserHolder.clean(); + } + + private static String parseResourceName(ApiPermission apiPermission, HandlerMethod handlerMethod) { + final String name = apiPermission.name(); + if (StringUtils.isNotEmpty(name)) { + return name; + } + try { + final String clzName = handlerMethod.getBean().getClass().getSimpleName(); + final String methodName = handlerMethod.getMethod().getName(); + return String.format("%s_%s", clzName, methodName); + } catch (Exception ignore) { + } + return "UNKNOWN"; + } + + private static Permission parsePermission(HttpServletRequest request, Object handler, ApiPermission apiPermission) { + Class dynamicPermissionPlugin = apiPermission.dynamicPermissionPlugin(); + if (EmptyPlugin.class.equals(dynamicPermissionPlugin)) { + return apiPermission.requiredPermission(); + } + try { + DynamicPermissionPlugin dynamicPermission = dynamicPermissionPlugin.getDeclaredConstructor().newInstance(); + return dynamicPermission.calculate(request, handler); + } catch (Throwable t) { + log.error("[PowerJobAuthService] process dynamicPermissionPlugin failed!", t); + ExceptionUtils.rethrow(t); + } + throw new ImpossibleException(); + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/JwtService.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/JwtService.java new file mode 100644 index 000000000..28564b083 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/JwtService.java @@ -0,0 +1,16 @@ +package tech.powerjob.server.auth.jwt; + +import java.util.Map; + +/** + * JWT 服务 + * + * @author tjq + * @since 2023/3/20 + */ +public interface JwtService { + + String build(Map body, String extraSk); + + ParseResult parse(String jwt, String extraSk); +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/ParseResult.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/ParseResult.java new file mode 100644 index 000000000..04b39768b --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/ParseResult.java @@ -0,0 +1,35 @@ +package tech.powerjob.server.auth.jwt; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; +import java.util.Map; + +/** + * 解析结果 + * + * @author tjq + * @since 2024/8/11 + */ +@Data +@Accessors(chain = true) +public class ParseResult implements Serializable { + + /** + * 解析状态 + */ + private Status status; + /** + * 解析结果 + */ + private Map result; + + private String msg; + + public enum Status { + SUCCESS, + EXPIRED, + FAILED + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/SecretProvider.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/SecretProvider.java new file mode 100644 index 000000000..349f393e6 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/SecretProvider.java @@ -0,0 +1,13 @@ +package tech.powerjob.server.auth.jwt; + +/** + * JWT 安全性的核心 + * 对安全性有要求的接入方,可以自行重新该方法,自定义自己的安全 token 生成策略 + * + * @author tjq + * @since 2023/3/20 + */ +public interface SecretProvider { + + String fetchSecretKey(); +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/impl/DefaultSecretProvider.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/impl/DefaultSecretProvider.java new file mode 100644 index 000000000..6444f3091 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/impl/DefaultSecretProvider.java @@ -0,0 +1,47 @@ +package tech.powerjob.server.auth.jwt.impl; + +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.core.env.Environment; +import org.springframework.stereotype.Component; +import tech.powerjob.server.auth.jwt.SecretProvider; +import tech.powerjob.common.utils.DigestUtils; + +import javax.annotation.Resource; + +/** + * PowerJob 默认实现 + * + * @author tjq + * @since 2023/3/20 + */ +@Slf4j +@Component +public class DefaultSecretProvider implements SecretProvider { + + @Resource + private Environment environment; + + private static final String PROPERTY_KEY = "spring.datasource.core.jdbc-url"; + + @Override + public String fetchSecretKey() { + + // 考虑到大部分用户都是开箱即用,此处还是提供一个相对安全的默认实现。JDBC URL 部署时必会改,skey 不固定,更安全 + try { + String propertyValue = environment.getProperty(PROPERTY_KEY); + if (StringUtils.isNotEmpty(propertyValue)) { + String md5 = DigestUtils.md5(propertyValue); + + log.debug("[DefaultSecretProvider] propertyValue: {} ==> md5: {}", propertyValue, md5); + + if (StringUtils.isNotEmpty(md5)) { + return md5; + } + } + } catch (Exception ignore) { + } + + return "ZQQZJ"; + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/impl/JwtServiceImpl.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/impl/JwtServiceImpl.java new file mode 100644 index 000000000..871ea2361 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/jwt/impl/JwtServiceImpl.java @@ -0,0 +1,104 @@ +package tech.powerjob.server.auth.jwt.impl; + +import com.google.common.collect.Maps; +import io.jsonwebtoken.*; +import io.jsonwebtoken.io.Decoders; +import io.jsonwebtoken.security.Keys; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import tech.powerjob.server.auth.jwt.JwtService; +import tech.powerjob.server.auth.jwt.ParseResult; +import tech.powerjob.server.auth.jwt.SecretProvider; + +import javax.annotation.Resource; +import java.security.Key; +import java.util.Date; +import java.util.Map; +import java.util.UUID; + +/** + * JWT 默认实现 + * + * @author tjq + * @since 2023/3/20 + */ +@Slf4j +@Service +public class JwtServiceImpl implements JwtService { + + @Resource + private SecretProvider secretProvider; + + /** + * JWT 客户端过期时间 + */ + @Value("${oms.auth.security.jwt.expire-seconds:604800}") + private int jwtExpireTime; + + /** + * GoodSong + */ + private static final String BASE_SECURITY = + "CengMengXiangZhangJianZouTianYa" + + "KanYiKanShiJieDeFanHua" + + "NianShaoDeXinZongYouXieQingKuang" + + "RuJinWoSiHaiWeiJia" + ; + + @Override + public String build(Map body, String extraSk) { + + final String secret = fetchSk(extraSk); + return innerBuild(secret, jwtExpireTime, body); + } + + static String innerBuild(String secret, int expireSeconds, Map body) { + JwtBuilder jwtBuilder = Jwts.builder() + .setHeaderParam("typ", "JWT") + .addClaims(body) + .setSubject("PowerJob") + .setExpiration(new Date(System.currentTimeMillis() + 1000L * expireSeconds)) + .setId(UUID.randomUUID().toString()) + .signWith(genSecretKey(secret), SignatureAlgorithm.HS256); + return jwtBuilder.compact(); + } + + @Override + public ParseResult parse(String jwt, String extraSk) { + try { + Map parseResult = innerParse(fetchSk(extraSk), jwt); + return new ParseResult().setStatus(ParseResult.Status.SUCCESS).setResult(parseResult); + } catch (ExpiredJwtException expiredJwtException) { + return new ParseResult().setStatus(ParseResult.Status.EXPIRED).setMsg(expiredJwtException.getMessage()); + } catch (Exception e) { + log.warn("[JwtService] parse jwt[{}] with extraSk[{}] failed", jwt, extraSk, e); + return new ParseResult().setStatus(ParseResult.Status.FAILED).setMsg(ExceptionUtils.getMessage(e)); + } + } + + private String fetchSk(String extraSk) { + if (StringUtils.isEmpty(extraSk)) { + return secretProvider.fetchSecretKey(); + } + return secretProvider.fetchSecretKey().concat(extraSk); + } + + static Map innerParse(String secret, String jwtStr) { + final Jws claimsJws = Jwts.parserBuilder() + .setSigningKey(genSecretKey(secret)) + .build() + .parseClaimsJws(jwtStr); + Map ret = Maps.newHashMap(); + ret.putAll(claimsJws.getBody()); + return ret; + } + + private static Key genSecretKey(String secret) { + byte[] keyBytes = Decoders.BASE64.decode(BASE_SECURITY.concat(secret)); + return Keys.hmacShaKeyFor(keyBytes); + } + +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/LoginTypeInfo.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/LoginTypeInfo.java new file mode 100644 index 000000000..0ecf38a1f --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/LoginTypeInfo.java @@ -0,0 +1,30 @@ +package tech.powerjob.server.auth.login; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.io.Serializable; + +/** + * 登录类型描述 + * + * @author tjq + * @since 2024/2/10 + */ +@Data +@Accessors(chain = true) +public class LoginTypeInfo implements Serializable { + + /** + * 登录类型,唯一标识 + */ + private String type; + /** + * 描述名称,前端展示用 + */ + private String name; + /** + * 展示用的 ICON + */ + private String iconUrl; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyLoginRequest.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyLoginRequest.java new file mode 100644 index 000000000..52f74efc9 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyLoginRequest.java @@ -0,0 +1,24 @@ +package tech.powerjob.server.auth.login; + +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.servlet.http.HttpServletRequest; + +/** + * 第三方登录请求 + * + * @author tjq + * @since 2024/2/10 + */ +@Data +@Accessors(chain = true) +public class ThirdPartyLoginRequest { + + /** + * 原始参数,给第三方登录方式一个服务端和前端交互的数据通道。PowerJob 本身不感知其中的内容 + */ + private String originParams; + + private transient HttpServletRequest httpServletRequest; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyLoginService.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyLoginService.java new file mode 100644 index 000000000..16dd819b2 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyLoginService.java @@ -0,0 +1,42 @@ +package tech.powerjob.server.auth.login; + +import javax.servlet.http.HttpServletRequest; + +/** + * 第三方登录服务 + * + * @author tjq + * @since 2024/2/10 + */ +public interface ThirdPartyLoginService { + + /** + * 登陆服务的类型 + * @return 登陆服务类型,比如 PowerJob / DingTalk + */ + LoginTypeInfo loginType(); + + /** + * 生成登陆的重定向 URL + * @param httpServletRequest http请求 + * @return 重定向地址 + */ + String generateLoginUrl(HttpServletRequest httpServletRequest); + + /** + * 执行第三方登录 + * @param loginRequest 上下文 + * @return 登录地址 + */ + ThirdPartyUser login(ThirdPartyLoginRequest loginRequest); + + /** + * JWT 登录的回调校验 + * @param username 用户名称 + * @param tokenLoginVerifyInfo 二次校验信息 + * @return 是否通过 + */ + default boolean tokenLoginVerify(String username, TokenLoginVerifyInfo tokenLoginVerifyInfo) { + return true; + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyUser.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyUser.java new file mode 100644 index 000000000..f34604a1e --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/ThirdPartyUser.java @@ -0,0 +1,47 @@ +package tech.powerjob.server.auth.login; + +import lombok.Data; +import lombok.experimental.Accessors; + +/** + * 第三方用户 + * + * @author tjq + * @since 2024/2/10 + */ +@Data +@Accessors(chain = true) +public class ThirdPartyUser { + + /** + * 用户的唯一标识,用于关联到 PowerJob 的 username + */ + private String username; + /** + * JWT 登录的二次校验配置 + * 可空,空则代表放弃二次校验(会出现第三方登录改了密码当 PowerJob JWT 登录依然可用的情况) + */ + private TokenLoginVerifyInfo tokenLoginVerifyInfo; + + /* ******** 以下全部选填即可,只是方便数据同步,后续都可以去 PowerJob 控制台更改 ******** */ + /** + * 用户昵称 + */ + private String nick; + /** + * 手机号 + */ + private String phone; + /** + * 邮箱地址 + */ + private String email; + /** + * web 回调地址 + */ + private String webHook; + /** + * 扩展字段 + */ + private String extra; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/TokenLoginVerifyInfo.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/TokenLoginVerifyInfo.java new file mode 100644 index 000000000..e60f0077e --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/TokenLoginVerifyInfo.java @@ -0,0 +1,31 @@ +package tech.powerjob.server.auth.login; + +import lombok.Data; + +import java.io.Serializable; + +/** + * JWT 登录时的校验信息 + * + * @author tjq + * @since 2024/2/16 + */ +@Data +public class TokenLoginVerifyInfo implements Serializable { + + /** + * 加密 token 部分,比如密码的 md5,会直接写入 JWT 下发给前端 + * 如果需要使用 JWT 二次校验,则该参数必须存在 + */ + private String encryptedToken; + + /** + * 补充信息,用于二次校验 + */ + private String additionalInfo; + + /** + * 依然是预留字段,第三方实现自用即可 + */ + private String extra; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/impl/DingTalkLoginService.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/impl/DingTalkLoginService.java new file mode 100644 index 000000000..c9a646c36 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/impl/DingTalkLoginService.java @@ -0,0 +1,142 @@ +package tech.powerjob.server.auth.login.impl; + +import com.aliyun.dingtalkcontact_1_0.models.GetUserHeaders; +import com.aliyun.dingtalkcontact_1_0.models.GetUserResponseBody; +import com.aliyun.dingtalkoauth2_1_0.models.GetUserTokenRequest; +import com.aliyun.dingtalkoauth2_1_0.models.GetUserTokenResponse; +import com.aliyun.teaopenapi.models.Config; +import com.aliyun.teautil.models.RuntimeOptions; +import lombok.SneakyThrows; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.server.auth.common.AuthConstants; +import tech.powerjob.server.auth.login.*; +import tech.powerjob.server.common.Loggers; + +import javax.servlet.http.HttpServletRequest; +import java.net.URLEncoder; +import java.nio.charset.StandardCharsets; + +/** + * 钉钉账号体系登录第三方网站 + * PowerJob 官方支持钉钉账号体系登录原因: + * 1. 钉钉作为当下用户体量最大的企业级办公软件,覆盖率足够高,提供钉钉支持能让更多开发者开箱即用 + * 2. 钉钉的 API 设计和 PowerJob 设想一致,算是个最佳实践,其他企业内部的账号体系可参考这套流程进行接入 + * - PowerJob 重定向到第三方账号体系登陆页 -> 第三方完成登陆 -> 跳转回调 PowerJob auth 接口 -> PowerJob 解析回调登陆信息,完整用户关联 + * + * @author tjq + * @since 2023/3/26 + */ +@Service +public class DingTalkLoginService implements ThirdPartyLoginService { + + /* + 配置示例 + oms.auth.dingtalk.appkey=dinggzqqzqqzqqzqq + oms.auth.dingtalk.appSecret=iY-FS8mzqqzqq_xEizqqzqqzqqzqqzqqzqqYEbkZOal + oms.auth.dingtalk.callbackUrl=http://localhost:7700 + */ + + /** + * 钉钉应用 AppKey + */ + @Value("${oms.auth.dingtalk.appkey:#{null}}") + private String dingTalkAppKey; + /** + * 钉钉应用 AppSecret + */ + @Value("${oms.auth.dingtalk.appSecret:#{null}}") + private String dingTalkAppSecret; + /** + * 回调地址,powerjob 前端控制台地址,即 powerjob-console 地址 + * 比如本地调试时为 LocalDemoCallbackUrl + * 部署后则为 demoCallBackUrl + */ + @Value("${oms.auth.dingtalk.callbackUrl:#{null}}") + private String dingTalkCallbackUrl; + + @Override + public LoginTypeInfo loginType() { + return new LoginTypeInfo() + .setType(AuthConstants.ACCOUNT_TYPE_DING) + .setName("DingTalk") + ; + } + + @Override + @SneakyThrows + public String generateLoginUrl(HttpServletRequest httpServletRequest) { + if (StringUtils.isAnyEmpty(dingTalkAppKey, dingTalkAppSecret, dingTalkCallbackUrl)) { + throw new IllegalArgumentException("please config 'oms.auth.dingtalk.appkey', 'oms.auth.dingtalk.appSecret' and 'oms.auth.dingtalk.callbackUrl' in properties!"); + } + + String urlString = URLEncoder.encode(dingTalkCallbackUrl, StandardCharsets.UTF_8.name()); + String url = "https://login.dingtalk.com/oauth2/auth?" + + "redirect_uri=" + urlString + + "&response_type=code" + + "&client_id=" + dingTalkAppKey + + "&scope=openid" + + "&state=" + AuthConstants.ACCOUNT_TYPE_DING + + "&prompt=consent"; + Loggers.WEB.info("[DingTalkBizLoginService] login url: {}", url); + return url; + } + + @Override + @SneakyThrows + public ThirdPartyUser login(ThirdPartyLoginRequest loginRequest) { + try { + com.aliyun.dingtalkoauth2_1_0.Client client = authClient(); + GetUserTokenRequest getUserTokenRequest = new GetUserTokenRequest() + //应用基础信息-应用信息的AppKey,请务必替换为开发的应用AppKey + .setClientId(dingTalkAppKey) + //应用基础信息-应用信息的AppSecret,,请务必替换为开发的应用AppSecret + .setClientSecret(dingTalkAppSecret) + .setCode(loginRequest.getHttpServletRequest().getParameter("authCode")) + .setGrantType("authorization_code"); + GetUserTokenResponse getUserTokenResponse = client.getUserToken(getUserTokenRequest); + //获取用户个人 token + String accessToken = getUserTokenResponse.getBody().getAccessToken(); + // 查询钉钉用户 + final GetUserResponseBody dingUser = getUserinfo(accessToken); + // 将钉钉用户的唯一ID 和 PowerJob 账户体系的唯一键 username 关联 + if (dingUser != null) { + ThirdPartyUser bizUser = new ThirdPartyUser(); + bizUser.setUsername(dingUser.getUnionId()); + bizUser.setNick(dingUser.getNick()); + bizUser.setPhone(dingUser.getMobile()); + bizUser.setEmail(dingUser.getEmail()); + return bizUser; + } + } catch (Exception e) { + Loggers.WEB.error("[DingTalkBizLoginService] login by dingTalk failed!", e); + throw e; + } + throw new PowerJobException("login from dingTalk failed!"); + } + + /* 以下代码均拷自钉钉官网示例 */ + + private static com.aliyun.dingtalkoauth2_1_0.Client authClient() throws Exception { + Config config = new Config(); + config.protocol = "https"; + config.regionId = "central"; + return new com.aliyun.dingtalkoauth2_1_0.Client(config); + } + private static com.aliyun.dingtalkcontact_1_0.Client contactClient() throws Exception { + Config config = new Config(); + config.protocol = "https"; + config.regionId = "central"; + return new com.aliyun.dingtalkcontact_1_0.Client(config); + } + + private GetUserResponseBody getUserinfo(String accessToken) throws Exception { + com.aliyun.dingtalkcontact_1_0.Client client = contactClient(); + GetUserHeaders getUserHeaders = new GetUserHeaders(); + getUserHeaders.xAcsDingtalkAccessToken = accessToken; + //获取用户个人信息,如需获取当前授权人的信息,unionId参数必须传me + return client.getUserWithOptions("me", getUserHeaders, new RuntimeOptions()).getBody(); + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/impl/PwjbAccountLoginService.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/impl/PwjbAccountLoginService.java new file mode 100644 index 000000000..366233903 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/login/impl/PwjbAccountLoginService.java @@ -0,0 +1,121 @@ +package tech.powerjob.server.auth.login.impl; + +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.server.auth.common.AuthConstants; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.server.auth.common.PowerJobAuthException; +import tech.powerjob.server.auth.login.*; +import tech.powerjob.server.common.Loggers; +import tech.powerjob.common.utils.DigestUtils; +import tech.powerjob.server.persistence.remote.model.PwjbUserInfoDO; +import tech.powerjob.server.persistence.remote.repository.PwjbUserInfoRepository; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Map; +import java.util.Optional; + +/** + * PowerJob 自带的登陆服务 + * 和应用主框架无关,依然属于第三方登录体系 + * + * @author tjq + * @since 2023/3/20 + */ +@Service +public class PwjbAccountLoginService implements ThirdPartyLoginService { + + @Resource + private PwjbUserInfoRepository pwjbUserInfoRepository; + + + @Override + public LoginTypeInfo loginType() { + return new LoginTypeInfo() + .setType(AuthConstants.ACCOUNT_TYPE_POWER_JOB) + .setName("PowerJob Account") + ; + } + + @Override + public String generateLoginUrl(HttpServletRequest httpServletRequest) { + // 前端实现跳转,服务端返回特殊指令 + return AuthConstants.FE_REDIRECT_KEY.concat("powerjobLogin"); + } + + @Override + public ThirdPartyUser login(ThirdPartyLoginRequest loginRequest) { + final String loginInfo = loginRequest.getOriginParams(); + if (StringUtils.isEmpty(loginInfo)) { + throw new IllegalArgumentException("can't find login Info"); + } + + Map loginInfoMap = JsonUtils.parseMap(loginInfo); + + final String username = MapUtils.getString(loginInfoMap, AuthConstants.PARAM_KEY_USERNAME); + final String password = MapUtils.getString(loginInfoMap, AuthConstants.PARAM_KEY_PASSWORD); + final String encryption = MapUtils.getString(loginInfoMap, AuthConstants.PARAM_KEY_ENCRYPTION); + + Loggers.WEB.debug("[PowerJobLoginService] encryption: {}", encryption); + + if (StringUtils.isAnyEmpty(username, password)) { + Loggers.WEB.debug("[PowerJobLoginService] username or password is empty, login failed!"); + throw new PowerJobAuthException(ErrorCodes.INVALID_REQUEST); + } + + final Optional userInfoOpt = pwjbUserInfoRepository.findByUsername(username); + if (!userInfoOpt.isPresent()) { + Loggers.WEB.debug("[PowerJobLoginService] can't find user by username: {}", username); + throw new PowerJobAuthException(ErrorCodes.USER_NOT_EXIST); + } + + final PwjbUserInfoDO dbUser = userInfoOpt.get(); + + if (DigestUtils.rePassword(password, username).equals(dbUser.getPassword())) { + ThirdPartyUser bizUser = new ThirdPartyUser(); + bizUser.setUsername(username); + + // 回填第一次创建的信息 + String extra = dbUser.getExtra(); + if (StringUtils.isNotEmpty(extra)) { + ThirdPartyUser material = JsonUtils.parseObjectIgnoreException(extra, ThirdPartyUser.class); + if (material != null) { + bizUser.setEmail(material.getEmail()); + bizUser.setNick(material.getNick()); + bizUser.setPhone(material.getPhone()); + bizUser.setWebHook(material.getWebHook()); + } + } + + // 下发加密的密码作为 JWT 的一部分,方便处理改密码后失效的场景 + TokenLoginVerifyInfo tokenLoginVerifyInfo = new TokenLoginVerifyInfo(); + tokenLoginVerifyInfo.setEncryptedToken(dbUser.getPassword()); + bizUser.setTokenLoginVerifyInfo(tokenLoginVerifyInfo); + + return bizUser; + } + + Loggers.WEB.debug("[PowerJobLoginService] user[{}]'s password is incorrect, login failed!", username); + throw new PowerJobException("password is incorrect"); + } + + @Override + public boolean tokenLoginVerify(String username, TokenLoginVerifyInfo tokenLoginVerifyInfo) { + + if (tokenLoginVerifyInfo == null) { + return false; + } + + final Optional userInfoOpt = pwjbUserInfoRepository.findByUsername(username); + if (userInfoOpt.isPresent()) { + String dbPassword = userInfoOpt.get().getPassword(); + return StringUtils.equals(dbPassword, tokenLoginVerifyInfo.getEncryptedToken()); + } + + return false; + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/LoginRequest.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/LoginRequest.java new file mode 100644 index 000000000..a72bd06c4 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/LoginRequest.java @@ -0,0 +1,32 @@ +package tech.powerjob.server.auth.service.login; + +import lombok.Data; +import lombok.experimental.Accessors; + +import javax.servlet.http.HttpServletRequest; + +/** + * 执行登录的请求 + * + * @author tjq + * @since 2024/2/10 + */ +@Data +@Accessors(chain = true) +public class LoginRequest { + + /** + * 登录类型 + */ + private String loginType; + + /** + * 原始参数,给第三方登录方式一个服务端和前端交互的数据通道。PowerJob 本身不感知其中的内容 + */ + private String originParams; + + /** + * http原始请求,第三方回调参数传递类型无法枚举,直接传递 HttpServletRequest 满足扩展性要求 + */ + private transient HttpServletRequest httpServletRequest; +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/PowerJobLoginService.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/PowerJobLoginService.java new file mode 100644 index 000000000..f932b5bef --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/PowerJobLoginService.java @@ -0,0 +1,48 @@ +package tech.powerjob.server.auth.service.login; + +import tech.powerjob.server.auth.PowerJobUser; +import tech.powerjob.server.auth.common.PowerJobAuthException; +import tech.powerjob.server.auth.login.LoginTypeInfo; + +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.Optional; + +/** + * PowerJob 登录服务 + * + * @author tjq + * @since 2024/2/10 + */ +public interface PowerJobLoginService { + + /** + * 获取全部可登录的类型 + * @return 全部可登录类型 + */ + List fetchSupportLoginTypes(); + + + /** + * 获取第三方登录链接 + * @param loginType 登录类型 + * @param httpServletRequest http请求 + * @return 重定向地址 + */ + String fetchThirdPartyLoginUrl(String loginType, HttpServletRequest httpServletRequest); + + /** + * 执行真正的登录请求,底层调用第三方登录服务完成登录 + * @param loginRequest 登录请求 + * @return 登录完成的 PowerJobUser + * @throws PowerJobAuthException 鉴权失败抛出异常 + */ + PowerJobUser doLogin(LoginRequest loginRequest) throws PowerJobAuthException; + + /** + * 从 JWT 信息中解析用户登录信息 + * @param httpServletRequest httpServletRequest + * @return PowerJob 用户 + */ + Optional ifLogin(HttpServletRequest httpServletRequest); +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/impl/PowerJobLoginServiceImpl.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/impl/PowerJobLoginServiceImpl.java new file mode 100644 index 000000000..80aa018eb --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/login/impl/PowerJobLoginServiceImpl.java @@ -0,0 +1,255 @@ +package tech.powerjob.server.auth.service.login.impl; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.Data; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.server.auth.LoginUserHolder; +import tech.powerjob.server.auth.PowerJobUser; +import tech.powerjob.server.auth.common.AuthConstants; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.server.auth.common.PowerJobAuthException; +import tech.powerjob.server.auth.common.utils.HttpServletUtils; +import tech.powerjob.server.auth.jwt.JwtService; +import tech.powerjob.server.auth.login.*; +import tech.powerjob.server.auth.service.login.LoginRequest; +import tech.powerjob.server.auth.service.login.PowerJobLoginService; +import tech.powerjob.server.common.Loggers; +import tech.powerjob.common.enums.SwitchableStatus; +import tech.powerjob.server.persistence.remote.model.UserInfoDO; +import tech.powerjob.server.persistence.remote.repository.UserInfoRepository; + +import javax.servlet.http.HttpServletRequest; +import java.io.Serializable; +import java.util.Date; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * PowerJob 登录服务 + * + * @author tjq + * @since 2024/2/10 + */ +@Slf4j +@Service +public class PowerJobLoginServiceImpl implements PowerJobLoginService { + + private final JwtService jwtService; + private final UserInfoRepository userInfoRepository; + private final Map code2ThirdPartyLoginService; + + @Autowired + public PowerJobLoginServiceImpl(JwtService jwtService, UserInfoRepository userInfoRepository, List thirdPartyLoginServices) { + + this.jwtService = jwtService; + this.userInfoRepository = userInfoRepository; + + code2ThirdPartyLoginService = Maps.newHashMap(); + thirdPartyLoginServices.forEach(s -> { + code2ThirdPartyLoginService.put(s.loginType().getType(), s); + log.info("[PowerJobLoginService] register ThirdPartyLoginService: {}", s.loginType()); + }); + } + + @Override + public List fetchSupportLoginTypes() { + return Lists.newArrayList(code2ThirdPartyLoginService.values()).stream().map(ThirdPartyLoginService::loginType).collect(Collectors.toList()); + } + + @Override + public String fetchThirdPartyLoginUrl(String type, HttpServletRequest httpServletRequest) { + final ThirdPartyLoginService thirdPartyLoginService = fetchBizLoginService(type); + return thirdPartyLoginService.generateLoginUrl(httpServletRequest); + } + + @Override + public PowerJobUser doLogin(LoginRequest loginRequest) throws PowerJobAuthException { + final String loginType = loginRequest.getLoginType(); + final ThirdPartyLoginService thirdPartyLoginService = fetchBizLoginService(loginType); + + ThirdPartyLoginRequest thirdPartyLoginRequest = new ThirdPartyLoginRequest() + .setOriginParams(loginRequest.getOriginParams()) + .setHttpServletRequest(loginRequest.getHttpServletRequest()); + + final ThirdPartyUser bizUser = thirdPartyLoginService.login(thirdPartyLoginRequest); + + String dbUserName = String.format("%s_%s", loginType, bizUser.getUsername()); + Optional powerJobUserOpt = userInfoRepository.findByUsername(dbUserName); + + // 如果不存在用户,先同步创建用户 + if (!powerJobUserOpt.isPresent()) { + UserInfoDO newUser = new UserInfoDO(); + newUser.setUsername(dbUserName); + // 写入账号体系类型 + newUser.setAccountType(loginType); + newUser.setOriginUsername(bizUser.getUsername()); + + newUser.setTokenLoginVerifyInfo(JsonUtils.toJSONString(bizUser.getTokenLoginVerifyInfo())); + + // 同步素材 + newUser.setEmail(bizUser.getEmail()); + newUser.setPhone(bizUser.getPhone()); + newUser.setNick(bizUser.getNick()); + newUser.setWebHook(bizUser.getWebHook()); + newUser.setExtra(bizUser.getExtra()); + + Loggers.WEB.info("[PowerJobLoginService] sync user to PowerJobUserSystem: {}", dbUserName); + userInfoRepository.saveAndFlush(newUser); + + powerJobUserOpt = userInfoRepository.findByUsername(dbUserName); + } else { + + UserInfoDO dbUserInfoDO = powerJobUserOpt.get(); + + checkUserStatus(dbUserInfoDO); + + // 更新二次校验的 TOKEN 信息 + dbUserInfoDO.setTokenLoginVerifyInfo(JsonUtils.toJSONString(bizUser.getTokenLoginVerifyInfo())); + dbUserInfoDO.setGmtModified(new Date()); + + userInfoRepository.saveAndFlush(dbUserInfoDO); + } + + PowerJobUser ret = new PowerJobUser(); + + // 理论上 100% 存在 + if (powerJobUserOpt.isPresent()) { + final UserInfoDO dbUser = powerJobUserOpt.get(); + BeanUtils.copyProperties(dbUser, ret); + ret.setUsername(dbUserName); + } + + fillJwt(ret, Optional.ofNullable(bizUser.getTokenLoginVerifyInfo()).map(TokenLoginVerifyInfo::getEncryptedToken).orElse(null)); + + return ret; + } + + @Override + public Optional ifLogin(HttpServletRequest httpServletRequest) { + final Optional jwtBodyOpt = parseJwt(httpServletRequest); + if (!jwtBodyOpt.isPresent()) { + return Optional.empty(); + } + + JwtBody jwtBody = jwtBodyOpt.get(); + + Optional dbUserInfoOpt = userInfoRepository.findByUsername(jwtBody.getUsername()); + if (!dbUserInfoOpt.isPresent()) { + throw new PowerJobAuthException(ErrorCodes.USER_NOT_EXIST); + } + + UserInfoDO dbUser = dbUserInfoOpt.get(); + + checkUserStatus(dbUser); + + PowerJobUser powerJobUser = new PowerJobUser(); + + String tokenLoginVerifyInfoStr = dbUser.getTokenLoginVerifyInfo(); + TokenLoginVerifyInfo tokenLoginVerifyInfo = Optional.ofNullable(tokenLoginVerifyInfoStr).map(x -> JsonUtils.parseObjectIgnoreException(x, TokenLoginVerifyInfo.class)).orElse(new TokenLoginVerifyInfo()); + + // DB 中的 encryptedToken 存在,代表需要二次校验 + if (StringUtils.isNotEmpty(tokenLoginVerifyInfo.getEncryptedToken())) { + if (!StringUtils.equals(jwtBody.getEncryptedToken(), tokenLoginVerifyInfo.getEncryptedToken())) { + throw new PowerJobAuthException(ErrorCodes.INVALID_TOKEN); + } + + ThirdPartyLoginService thirdPartyLoginService = code2ThirdPartyLoginService.get(dbUser.getAccountType()); + boolean tokenLoginVerifyOk = thirdPartyLoginService.tokenLoginVerify(dbUser.getOriginUsername(), tokenLoginVerifyInfo); + + if (!tokenLoginVerifyOk) { + throw new PowerJobAuthException(ErrorCodes.USER_AUTH_FAILED); + } + } + + BeanUtils.copyProperties(dbUser, powerJobUser); + + // 兼容某些直接通过 ifLogin 判断登录的场景 + LoginUserHolder.set(powerJobUser); + + return Optional.of(powerJobUser); + } + + /** + * 检查 user 状态 + * @param dbUser user + */ + private void checkUserStatus(UserInfoDO dbUser) { + int accountStatus = Optional.ofNullable(dbUser.getStatus()).orElse(SwitchableStatus.ENABLE.getV()); + if (accountStatus == SwitchableStatus.DISABLE.getV()) { + throw new PowerJobAuthException(ErrorCodes.USER_DISABLED); + } + } + + private ThirdPartyLoginService fetchBizLoginService(String loginType) { + final ThirdPartyLoginService loginService = code2ThirdPartyLoginService.get(loginType); + if (loginService == null) { + throw new PowerJobAuthException(ErrorCodes.INVALID_REQUEST, "can't find ThirdPartyLoginService by type: " + loginType); + } + return loginService; + } + + private void fillJwt(PowerJobUser powerJobUser, String encryptedToken) { + + // 不能下发 userId,容易被轮询爆破 + JwtBody jwtBody = new JwtBody(); + jwtBody.setUsername(powerJobUser.getUsername()); + if (StringUtils.isNotEmpty(encryptedToken)) { + jwtBody.setEncryptedToken(encryptedToken); + } + + Map jwtMap = JsonUtils.parseMap(JsonUtils.toJSONString(jwtBody)); + + powerJobUser.setJwtToken(jwtService.build(jwtMap, null)); + } + + @SneakyThrows + private Optional parseJwt(HttpServletRequest httpServletRequest) { + // header、cookie 都能获取 + String jwtStr = HttpServletUtils.fetchFromHeader(AuthConstants.JWT_NAME, httpServletRequest); + if (StringUtils.isEmpty(jwtStr)) { + jwtStr = HttpServletUtils.fetchFromHeader(AuthConstants.OLD_JWT_NAME, httpServletRequest); + } + + /* + + 开发阶段跨域无法简单传输 cookies,暂时采取 header 方案传输 JWT + + if (StringUtils.isEmpty(jwtStr)) { + for (Cookie cookie : Optional.ofNullable(httpServletRequest.getCookies()).orElse(new Cookie[]{})) { + if (cookie.getName().equals(AuthConstants.JWT_NAME)) { + jwtStr = cookie.getValue(); + } + } + } + */ + + if (StringUtils.isEmpty(jwtStr)) { + return Optional.empty(); + } + final Map jwtBodyMap = jwtService.parse(jwtStr, null).getResult(); + + if (MapUtils.isEmpty(jwtBodyMap)) { + return Optional.empty(); + } + + return Optional.ofNullable(JsonUtils.parseObject(JsonUtils.toJSONString(jwtBodyMap), JwtBody.class)); + } + + @Data + static class JwtBody implements Serializable { + + private String username; + + private String encryptedToken; + } +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/permission/PowerJobPermissionService.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/permission/PowerJobPermissionService.java new file mode 100644 index 000000000..64dd7c311 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/permission/PowerJobPermissionService.java @@ -0,0 +1,64 @@ +package tech.powerjob.server.auth.service.permission; + +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.Role; +import tech.powerjob.server.auth.RoleScope; + +import java.util.List; +import java.util.Map; +import java.util.Set; + +/** + * PowerJob 鉴权服务 + * + * @author tjq + * @since 2024/2/11 + */ +public interface PowerJobPermissionService { + + + /** + * 判断用户是否有访问权限 + * @param userId userId + * @param roleScope 权限范围 + * @param target 权限目标ID + * @param permission 要求的权限 + * @return 是否有权限 + */ + boolean hasPermission(Long userId, RoleScope roleScope, Long target, Permission permission); + + /** + * 授予用户角色 + * @param roleScope 权限范围 + * @param target 权限目标 + * @param userId 用户ID + * @param role 角色 + * @param extra 其他 + */ + void grantRole(RoleScope roleScope, Long target, Long userId, Role role, String extra); + + /** + * 回收用户角色 + * @param roleScope 权限范围 + * @param target 权限目标 + * @param userId 用户ID + * @param role 角色 + */ + void retrieveRole(RoleScope roleScope, Long target, Long userId, Role role); + + /** + * 获取有相关权限的用户 + * @param roleScope 角色范围 + * @param target 目标 + * @return 角色对应的用户列表,user 可能重复,需要用 SET 去重(save APP/namespace 等场景,创建人自动被授权成为 ADMIN,如果用户在面板将自己添加到管理员,就会存在2套授权机制2次授权出现重复) + */ + Map> fetchUserWithPermissions(RoleScope roleScope, Long target); + + /** + * 获取用户有权限的目标 + * @param roleScope 角色范围 + * @param userId 用户ID + * @return result + */ + Map> fetchUserHadPermissionTargets(RoleScope roleScope, Long userId); +} diff --git a/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/permission/PowerJobPermissionServiceImpl.java b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/permission/PowerJobPermissionServiceImpl.java new file mode 100644 index 000000000..9b1d49705 --- /dev/null +++ b/powerjob-server/powerjob-server-auth/src/main/java/tech/powerjob/server/auth/service/permission/PowerJobPermissionServiceImpl.java @@ -0,0 +1,175 @@ +package tech.powerjob.server.auth.service.permission; + +import com.google.common.collect.*; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.Role; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import tech.powerjob.server.persistence.remote.model.UserRoleDO; +import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; +import tech.powerjob.server.persistence.remote.repository.UserRoleRepository; + +import javax.annotation.Resource; +import java.util.*; + +/** + * PowerJobPermissionService + * + * @author tjq + * @since 2024/2/11 + */ +@Slf4j +@Service +public class PowerJobPermissionServiceImpl implements PowerJobPermissionService { + + @Resource + private AppInfoRepository appInfoRepository; + @Resource + private UserRoleRepository userRoleRepository; + + @Override + public boolean hasPermission(Long userId, RoleScope roleScope, Long target, Permission requiredPermission) { + final List userRoleList = Optional.ofNullable(userRoleRepository.findAllByUserId(userId)).orElse(Collections.emptyList()); + + Multimap appId2Role = ArrayListMultimap.create(); + Multimap namespaceId2Role = ArrayListMultimap.create(); + + List globalRoles = Lists.newArrayList(); + + for (UserRoleDO userRole : userRoleList) { + final Role role = Role.of(userRole.getRole()); + + // 处理全局权限 + if (RoleScope.GLOBAL.getV() == userRole.getScope()) { + if (Role.ADMIN.equals(role)) { + return true; + } + globalRoles.add(role); + } + + if (RoleScope.NAMESPACE.getV() == userRole.getScope()) { + namespaceId2Role.put(userRole.getTarget(), role); + } + if (RoleScope.APP.getV() == userRole.getScope()) { + appId2Role.put(userRole.getTarget(), role); + } + } + + // 前置判断需要的权限(新增场景还没有 appId or namespaceId) + if (requiredPermission == Permission.NONE) { + return true; + } + + // 检验全局穿透权限 + for (Role role : globalRoles) { + if (role.getPermissions().contains(requiredPermission)) { + return true; + } + } + + // 无超级管理员权限,校验普通权限 + if (RoleScope.APP.equals(roleScope)) { + return checkAppPermission(target, requiredPermission, appId2Role, namespaceId2Role); + } + + if (RoleScope.NAMESPACE.equals(roleScope)) { + return checkNamespacePermission(target, requiredPermission, namespaceId2Role); + } + + return false; + } + + @Override + public void grantRole(RoleScope roleScope, Long target, Long userId, Role role, String extra) { + + UserRoleDO userRoleDO = new UserRoleDO(); + userRoleDO.setGmtCreate(new Date()); + userRoleDO.setGmtModified(new Date()); + userRoleDO.setExtra(extra); + + userRoleDO.setScope(roleScope.getV()); + userRoleDO.setTarget(target); + userRoleDO.setUserId(userId); + userRoleDO.setRole(role.getV()); + + userRoleRepository.saveAndFlush(userRoleDO); + log.info("[PowerJobPermissionService] [grantPermission] saveAndFlush userRole successfully: {}", userRoleDO); + } + + @Override + public void retrieveRole(RoleScope roleScope, Long target, Long userId, Role role) { + List originUserRole = userRoleRepository.findAllByScopeAndTargetAndRoleAndUserId(roleScope.getV(), target, role.getV(), userId); + log.info("[PowerJobPermissionService] [retrievePermission] origin rule: {}", originUserRole); + Optional.ofNullable(originUserRole).orElse(Collections.emptyList()).forEach(r -> { + userRoleRepository.deleteById(r.getId()); + log.info("[PowerJobPermissionService] [retrievePermission] delete UserRole: {}", r); + }); + } + + @Override + public Map> fetchUserWithPermissions(RoleScope roleScope, Long target) { + List permissionUserList = userRoleRepository.findAllByScopeAndTarget(roleScope.getV(), target); + Map> ret = Maps.newHashMap(); + Optional.ofNullable(permissionUserList).orElse(Collections.emptyList()).forEach(userRoleDO -> { + Role role = Role.of(userRoleDO.getRole()); + Set userIds = ret.computeIfAbsent(role, ignore -> Sets.newHashSet()); + userIds.add(userRoleDO.getUserId()); + }); + + return ret; + } + + @Override + public Map> fetchUserHadPermissionTargets(RoleScope roleScope, Long userId) { + + Map> ret = Maps.newHashMap(); + List userRoleDOList = userRoleRepository.findAllByUserIdAndScope(userId, roleScope.getV()); + + Optional.ofNullable(userRoleDOList).orElse(Collections.emptyList()).forEach(r -> { + Role role = Role.of(r.getRole()); + List targetIds = ret.computeIfAbsent(role, ignore -> Lists.newArrayList()); + targetIds.add(r.getTarget()); + }); + + return ret; + } + + private boolean checkAppPermission(Long targetId, Permission requiredPermission, Multimap appId2Role, Multimap namespaceId2Role) { + + final Collection appRoles = appId2Role.get(targetId); + for (Role role : appRoles) { + if (role.getPermissions().contains(requiredPermission)) { + return true; + } + } + + // 校验 namespace 穿透权限 + Optional appInfoOpt = appInfoRepository.findById(targetId); + if (!appInfoOpt.isPresent()) { + throw new IllegalArgumentException("can't find appInfo by appId in permission check: " + targetId); + } + Long namespaceId = Optional.ofNullable(appInfoOpt.get().getNamespaceId()).orElse(-1L); + Collection namespaceRoles = namespaceId2Role.get(namespaceId); + for (Role role : namespaceRoles) { + if (role.getPermissions().contains(requiredPermission)) { + return true; + } + } + + return false; + } + + private boolean checkNamespacePermission(Long targetId, Permission requiredPermission, Multimap namespaceId2Role) { + Collection namespaceRoles = namespaceId2Role.get(targetId); + for (Role role : namespaceRoles) { + if (role.getPermissions().contains(requiredPermission)) { + return true; + } + } + + return false; + } + +} diff --git a/powerjob-server/powerjob-server-common/pom.xml b/powerjob-server/powerjob-server-common/pom.xml index 34a5284d6..48b70d24e 100644 --- a/powerjob-server/powerjob-server-common/pom.xml +++ b/powerjob-server/powerjob-server-common/pom.xml @@ -5,7 +5,7 @@ powerjob-server tech.powerjob - 4.3.6 + 5.1.2 ../pom.xml 4.0.0 diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/Loggers.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/Loggers.java new file mode 100644 index 000000000..20b0e58cd --- /dev/null +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/Loggers.java @@ -0,0 +1,18 @@ +package tech.powerjob.server.common; + +import org.slf4j.Logger; +import org.slf4j.LoggerFactory; + +/** + * 统一定义日志 + * + * @author tjq + * @since 2023/3/25 + */ +public class Loggers { + + /** + * Web 层统一日志 + */ + public static final Logger WEB = LoggerFactory.getLogger("P_SERVER_LOGGER_WEB"); +} diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/PowerJobServerConfigKey.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/PowerJobServerConfigKey.java index 75ca26354..e14927e81 100644 --- a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/PowerJobServerConfigKey.java +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/PowerJobServerConfigKey.java @@ -16,6 +16,10 @@ public class PowerJobServerConfigKey { * http 协议端口号 */ public static final String HTTP_PORT = "oms.http.port"; + /** + * MU 协议端口号 + */ + public static final String MU_PORT = "oms.mu.port"; /** * 自定义数据库表前缀 */ diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/SJ.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/SJ.java index 89a89730e..eb2051a84 100644 --- a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/SJ.java +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/SJ.java @@ -3,6 +3,8 @@ import com.google.common.base.Joiner; import com.google.common.base.Splitter; +import java.util.Map; + /** * Splitter & Joiner * @@ -16,4 +18,9 @@ public class SJ { public static final Joiner MONITOR_JOINER = Joiner.on("|").useForNull("-"); + private static final Splitter.MapSplitter MAP_SPLITTER = Splitter.onPattern(";").withKeyValueSeparator(":"); + + public static Map splitKvString(String kvString) { + return MAP_SPLITTER.split(kvString); + } } diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/constants/ExtensionKey.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/constants/ExtensionKey.java new file mode 100644 index 000000000..296aaa088 --- /dev/null +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/constants/ExtensionKey.java @@ -0,0 +1,18 @@ +package tech.powerjob.server.common.constants; + +/** + * 扩展 key + * + * @author tjq + * @since 2024/12/8 + */ +public interface ExtensionKey { + + interface App { + String allowedBecomeAdminByPassword = "allowedBecomeAdminByPassword"; + } + + interface PwjbUser { + String allowedChangePwd = "allowedChangePwd"; + } +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/module/WorkerInfo.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/module/WorkerInfo.java index c16d2384a..95f6b1b02 100644 --- a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/module/WorkerInfo.java +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/module/WorkerInfo.java @@ -20,7 +20,14 @@ public class WorkerInfo { private String address; + /** + * 上一次worker在线时间(取 server 端时间) + */ private long lastActiveTime; + /** + * 上一次worker在线时间(取 worker 端时间) + */ + private long lastActiveWorkerTime; private String protocol; @@ -44,7 +51,8 @@ public class WorkerInfo { public void refresh(WorkerHeartbeat workerHeartbeat) { address = workerHeartbeat.getWorkerAddress(); - lastActiveTime = workerHeartbeat.getHeartbeatTime(); + lastActiveTime = System.currentTimeMillis(); + lastActiveWorkerTime = workerHeartbeat.getHeartbeatTime(); protocol = workerHeartbeat.getProtocol(); client = workerHeartbeat.getClient(); tag = workerHeartbeat.getTag(); @@ -56,7 +64,7 @@ public void refresh(WorkerHeartbeat workerHeartbeat) { if (workerHeartbeat.isOverload()) { overloading = true; - lastOverloadTime = workerHeartbeat.getHeartbeatTime(); + lastOverloadTime = System.currentTimeMillis(); log.warn("[WorkerInfo] worker {} is overload!", getAddress()); } else { overloading = false; diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/timewheel/HashedWheelTimer.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/timewheel/HashedWheelTimer.java index 840d2d844..0a1c75d9c 100644 --- a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/timewheel/HashedWheelTimer.java +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/timewheel/HashedWheelTimer.java @@ -1,6 +1,7 @@ package tech.powerjob.server.common.timewheel; import tech.powerjob.common.utils.CommonUtils; +import tech.powerjob.common.utils.SysUtils; import tech.powerjob.server.common.RejectedExecutionHandlerFactory; import com.google.common.collect.Queues; import com.google.common.collect.Sets; @@ -67,7 +68,7 @@ public HashedWheelTimer(long tickDuration, int ticksPerWheel, int processThreadN ThreadFactory threadFactory = new ThreadFactoryBuilder().setNameFormat("HashedWheelTimer-Executor-%d").build(); // 这里需要调整一下队列大小 BlockingQueue queue = Queues.newLinkedBlockingQueue(8192); - int core = Math.max(Runtime.getRuntime().availableProcessors(), processThreadNum); + int core = Math.max(SysUtils.availableProcessors(), processThreadNum); // 基本都是 io 密集型任务 taskProcessPool = new ThreadPoolExecutor(core, 2 * core, 60, TimeUnit.SECONDS, diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/timewheel/holder/InstanceTimeWheelService.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/timewheel/holder/InstanceTimeWheelService.java index d38d53d8a..cbcee65aa 100644 --- a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/timewheel/holder/InstanceTimeWheelService.java +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/timewheel/holder/InstanceTimeWheelService.java @@ -1,5 +1,6 @@ package tech.powerjob.server.common.timewheel.holder; +import tech.powerjob.common.utils.SysUtils; import tech.powerjob.server.common.timewheel.HashedWheelTimer; import tech.powerjob.server.common.timewheel.Timer; import tech.powerjob.server.common.timewheel.TimerFuture; @@ -22,7 +23,7 @@ public class InstanceTimeWheelService { /** * 精确调度时间轮,每 1MS 走一格 */ - private static final Timer TIMER = new HashedWheelTimer(1, 4096, Runtime.getRuntime().availableProcessors() * 4); + private static final Timer TIMER = new HashedWheelTimer(1, 4096, SysUtils.availableProcessors() * 4); /** * 非精确调度时间轮,用于处理高延迟任务,每 10S 走一格 */ diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/utils/AESUtil.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/utils/AESUtil.java new file mode 100644 index 000000000..fba942e05 --- /dev/null +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/utils/AESUtil.java @@ -0,0 +1,92 @@ +package tech.powerjob.server.common.utils; + +import lombok.SneakyThrows; +import tech.powerjob.common.utils.DigestUtils; + +import javax.crypto.Cipher; +import javax.crypto.spec.GCMParameterSpec; +import javax.crypto.spec.SecretKeySpec; +import java.nio.charset.StandardCharsets; +import java.security.SecureRandom; +import java.util.Base64; + +public class AESUtil { + + + private static final String ALGORITHM = "AES"; + private static final String TRANSFORMATION = "AES/GCM/NoPadding"; + private static final int KEY_SIZE = 256; // AES 256-bit + private static final int GCM_NONCE_LENGTH = 12; // GCM nonce length (12 bytes) + private static final int GCM_TAG_LENGTH = 16; // GCM authentication tag length (16 bytes) + + // SecureRandom 实例,用于生成 nonce + private static final SecureRandom secureRandom = new SecureRandom(); + + /** + * 生成密钥 + * + * @param key 传入的密钥字符串,必须是 32 字节(256 位)长度 + * @return SecretKeySpec 实例 + */ + private static SecretKeySpec getKey(String key) { + byte[] keyBytes = key.getBytes(StandardCharsets.UTF_8); + // 不足 32 字节,则使用 MD5 转为 32 位 + if (keyBytes.length != KEY_SIZE / 8) { + keyBytes = DigestUtils.md5(key).getBytes(StandardCharsets.UTF_8); + } + return new SecretKeySpec(keyBytes, ALGORITHM); + } + + /** + * 加密 + * + * @param data 要加密的数据 + * @param key 加密密钥 + * @return 加密后的数据(Base64 编码),包含 nonce + */ + @SneakyThrows + public static String encrypt(String data, String key) { + byte[] nonce = new byte[GCM_NONCE_LENGTH]; + secureRandom.nextBytes(nonce); // 生成随机的 nonce + + Cipher cipher = Cipher.getInstance(TRANSFORMATION); + GCMParameterSpec gcmParameterSpec = new GCMParameterSpec(GCM_TAG_LENGTH * 8, nonce); + cipher.init(Cipher.ENCRYPT_MODE, getKey(key), gcmParameterSpec); + + byte[] encryptedData = cipher.doFinal(data.getBytes(StandardCharsets.UTF_8)); + + // 将 nonce 和密文连接在一起,然后进行 Base64 编码 + byte[] combinedData = new byte[nonce.length + encryptedData.length]; + System.arraycopy(nonce, 0, combinedData, 0, nonce.length); + System.arraycopy(encryptedData, 0, combinedData, nonce.length, encryptedData.length); + + return Base64.getEncoder().encodeToString(combinedData); + } + + /** + * 解密 + * + * @param encryptedData 要解密的数据(Base64 编码),包含 nonce + * @param key 解密密钥 + * @return 解密后的数据 + */ + @SneakyThrows + public static String decrypt(String encryptedData, String key) { + byte[] combinedData = Base64.getDecoder().decode(encryptedData); + + // 提取 nonce + byte[] nonce = new byte[GCM_NONCE_LENGTH]; + System.arraycopy(combinedData, 0, nonce, 0, nonce.length); + + // 提取实际的加密数据 + byte[] encryptedText = new byte[combinedData.length - nonce.length]; + System.arraycopy(combinedData, nonce.length, encryptedText, 0, encryptedText.length); + + Cipher cipher = Cipher.getInstance(TRANSFORMATION); + GCMParameterSpec gcmParameterSpec = new GCMParameterSpec(GCM_TAG_LENGTH * 8, nonce); + cipher.init(Cipher.DECRYPT_MODE, getKey(key), gcmParameterSpec); + + byte[] decryptedData = cipher.doFinal(encryptedText); + return new String(decryptedData, StandardCharsets.UTF_8); + } +} diff --git a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/utils/OmsFileUtils.java b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/utils/OmsFileUtils.java index 8a78edcff..3ae1ebe51 100644 --- a/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/utils/OmsFileUtils.java +++ b/powerjob-server/powerjob-server-common/src/main/java/tech/powerjob/server/common/utils/OmsFileUtils.java @@ -90,8 +90,10 @@ public static void file2HttpResponse(File file, HttpServletResponse response) th try (BufferedOutputStream bos = new BufferedOutputStream(response.getOutputStream()); BufferedInputStream bis = new BufferedInputStream(new FileInputStream(file))) { - while (bis.read(buffer) != -1) { - bos.write(buffer); + // https://github.com/PowerJob/PowerJob/pull/939/files + int cnt; + while ((cnt = bis.read(buffer)) != -1) { + bos.write(buffer, 0, cnt); } } } diff --git a/powerjob-server/powerjob-server-common/src/test/java/tech/powerjob/server/common/utils/AESUtilTest.java b/powerjob-server/powerjob-server-common/src/test/java/tech/powerjob/server/common/utils/AESUtilTest.java new file mode 100644 index 000000000..84c924cf9 --- /dev/null +++ b/powerjob-server/powerjob-server-common/src/test/java/tech/powerjob/server/common/utils/AESUtilTest.java @@ -0,0 +1,28 @@ +package tech.powerjob.server.common.utils; + +import org.junit.jupiter.api.Test; + +/** + * AESUtilTest + * + * @author tjq + * @since 2024/8/10 + */ +class AESUtilTest { + + @Test + void testAes() throws Exception { + + String sk = "ChinaNo.1_ChinaNo.1_ChinaNo.1"; + + String txt = "kyksjdfh"; + + String encrypt = AESUtil.encrypt(txt, sk); + System.out.println(encrypt); + String decrypt = AESUtil.decrypt(encrypt, sk); + System.out.println(decrypt); + + assert txt.equals(decrypt); + } + +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-core/pom.xml b/powerjob-server/powerjob-server-core/pom.xml index 33808bc4b..6860b8101 100644 --- a/powerjob-server/powerjob-server-core/pom.xml +++ b/powerjob-server/powerjob-server-core/pom.xml @@ -5,7 +5,7 @@ powerjob-server tech.powerjob - 4.3.6 + 5.1.2 ../pom.xml 4.0.0 diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/DispatchService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/DispatchService.java index b0821b627..4db0d0ec4 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/DispatchService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/DispatchService.java @@ -26,6 +26,7 @@ import tech.powerjob.server.remote.transporter.TransportService; import tech.powerjob.server.remote.transporter.impl.ServerURLFactory; import tech.powerjob.server.remote.worker.WorkerClusterQueryService; +import tech.powerjob.server.remote.worker.selector.TaskTrackerSelectorService; import java.util.ArrayList; import java.util.Date; @@ -58,6 +59,8 @@ public class DispatchService { private final InstanceInfoRepository instanceInfoRepository; + private final TaskTrackerSelectorService taskTrackerSelectorService; + /** * 异步重新派发 * @@ -145,7 +148,7 @@ public void dispatch(JobInfoDO jobInfo, Long instanceId, Optional suitableWorkers = workerClusterQueryService.getSuitableWorkers(jobInfo); + List suitableWorkers = workerClusterQueryService.geAvailableWorkers(jobInfo); if (CollectionUtils.isEmpty(suitableWorkers)) { log.warn("[Dispatcher-{}|{}] cancel dispatch job due to no worker available", jobId, instanceId); @@ -167,7 +170,7 @@ public void dispatch(JobInfoDO jobInfo, Long instanceId, Optional BEANS = Lists.newLinkedList(); public AlarmCenter(List alarmables) { - int cores = Runtime.getRuntime().availableProcessors(); + int cores = SysUtils.availableProcessors(); ThreadFactory factory = new ThreadFactoryBuilder().setNameFormat("AlarmPool-%d").build(); POOL = new ThreadPoolExecutor(cores, cores, 5, TimeUnit.MINUTES, Queues.newLinkedBlockingQueue(), factory); diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/alarm/impl/MailAlarmService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/alarm/impl/MailAlarmService.java index dbbf1a0d7..838d32917 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/alarm/impl/MailAlarmService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/alarm/impl/MailAlarmService.java @@ -44,7 +44,7 @@ public void onFailed(Alarm alarm, List targetUserList) { SimpleMailMessage sm = new SimpleMailMessage(); try { sm.setFrom(from); - sm.setTo(targetUserList.stream().map(AlarmTarget::getEmail).filter(Objects::nonNull).toArray(String[]::new)); + sm.setTo(targetUserList.stream().map(AlarmTarget::getEmail).filter(Objects::nonNull).filter(email -> !email.isEmpty()).toArray(String[]::new)); sm.setSubject(alarm.fetchTitle()); sm.setText(alarm.fetchContent()); diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/container/ContainerService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/container/ContainerService.java index acb2fd0ba..9468ea99e 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/container/ContainerService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/container/ContainerService.java @@ -37,7 +37,7 @@ import tech.powerjob.common.utils.SegmentLock; import tech.powerjob.remote.framework.base.URL; import tech.powerjob.server.common.constants.ContainerSourceType; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.module.WorkerInfo; import tech.powerjob.server.common.utils.OmsFileUtils; import tech.powerjob.server.extension.LockService; @@ -317,40 +317,38 @@ public String fetchDeployedInfo(Long appId, Long containerId) { .collect(Collectors.toSet()); Set deployedList = Sets.newLinkedHashSet(); - List unDeployedList = Lists.newLinkedList(); - Multimap version2Address = ArrayListMultimap.create(); + Multimap version2DeployedContainerInfoList = ArrayListMultimap.create(); infoList.forEach(info -> { String targetWorkerAddress = info.getWorkerAddress(); if (aliveWorkers.contains(targetWorkerAddress)) { deployedList.add(targetWorkerAddress); - version2Address.put(info.getVersion(), targetWorkerAddress); - }else { - unDeployedList.add(targetWorkerAddress); + version2DeployedContainerInfoList.put(info.getVersion(), info); } }); + Set unDeployedList = Sets.newHashSet(aliveWorkers); + unDeployedList.removeAll(deployedList); + StringBuilder sb = new StringBuilder("========== DeployedInfo ==========").append(System.lineSeparator()); + // 集群分裂,各worker版本不统一,问题很大 - if (version2Address.keySet().size() > 1) { + if (version2DeployedContainerInfoList.keySet().size() > 1) { sb.append("WARN: there exists multi version container now, please redeploy to fix this problem").append(System.lineSeparator()); - sb.append("divisive version ==> ").append(System.lineSeparator()); - version2Address.forEach((v, addressList) -> { - sb.append("version: ").append(v).append(System.lineSeparator()); - sb.append(addressList); - }); - sb.append(System.lineSeparator()); } + + version2DeployedContainerInfoList.asMap().forEach((version, deployedContainerInfos) -> { + sb.append("[version] ").append(version).append(System.lineSeparator()); + deployedContainerInfos.forEach(deployedContainerInfo -> sb.append(String.format("Address: %s, DeployedTime: %s", deployedContainerInfo.getWorkerAddress(), CommonUtils.formatTime(deployedContainerInfo.getDeployedTime()))).append(System.lineSeparator())); + }); + // 当前在线未部署机器 if (!CollectionUtils.isEmpty(unDeployedList)) { - sb.append("WARN: there exists unDeployed worker(OhMyScheduler will auto fix when some job need to process)").append(System.lineSeparator()); - sb.append("unDeployed worker list ==> ").append(System.lineSeparator()); + sb.append("WARN: there exists unDeployed worker(PowerJob will auto fix when some job need to process)").append(System.lineSeparator()); + sb.append("unDeployed worker list ==> ").append(unDeployedList).append(System.lineSeparator()); } - // 当前部署机器 - sb.append("deployed worker list ==> ").append(System.lineSeparator()); + if (CollectionUtils.isEmpty(deployedList)) { - sb.append("no worker deployed now~"); - }else { - sb.append(deployedList); + sb.append("no worker deployed this container now~"); } return sb.toString(); diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/handler/AbWorkerRequestHandler.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/handler/AbWorkerRequestHandler.java index 90c0e59e2..595f135d2 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/handler/AbWorkerRequestHandler.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/handler/AbWorkerRequestHandler.java @@ -12,7 +12,7 @@ import tech.powerjob.common.utils.NetUtils; import tech.powerjob.remote.framework.actor.Handler; import tech.powerjob.remote.framework.actor.ProcessType; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.module.WorkerInfo; import tech.powerjob.server.common.utils.SpringUtils; import tech.powerjob.server.monitor.MonitorService; @@ -134,7 +134,7 @@ public AskResponse processWorkerQueryExecutorCluster(WorkerQueryExecutorClusterR if (!jobInfo.getAppId().equals(appId)) { askResponse = AskResponse.failed("Permission Denied!"); }else { - List sortedAvailableWorker = workerClusterQueryService.getSuitableWorkers(jobInfo) + List sortedAvailableWorker = workerClusterQueryService.geAvailableWorkers(jobInfo) .stream().map(WorkerInfo::getAddress).collect(Collectors.toList()); askResponse = AskResponse.succeed(sortedAvailableWorker); } diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/instance/InstanceLogService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/instance/InstanceLogService.java index 42c67d0c5..5f1979584 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/instance/InstanceLogService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/instance/InstanceLogService.java @@ -5,6 +5,7 @@ import com.google.common.collect.Maps; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import org.apache.commons.lang3.time.FastDateFormat; import org.springframework.beans.BeanUtils; @@ -78,6 +79,11 @@ public class InstanceLogService { @Resource(name = PJThreadPool.BACKGROUND_POOL) private AsyncTaskExecutor powerJobBackgroundPool; + @Value("${server.servlet.context-path:#{null}}") + private String servletContextPath; + + private static final String DOWNLOAD_URL_PATTERN = "http://%s:%d%s/instance/downloadLog?instanceId=%d"; + /** * 分段锁 */ @@ -173,7 +179,8 @@ public StringPage fetchInstanceLog(Long appId, Long instanceId, Long index) { */ @DesignateServer public String fetchDownloadUrl(Long appId, Long instanceId) { - String url = "http://" + NetUtils.getLocalHost() + ":" + port + "/instance/downloadLog?instanceId=" + instanceId; + String path = Optional.ofNullable(servletContextPath).orElse(StringUtils.EMPTY); + String url = String.format(DOWNLOAD_URL_PATTERN, NetUtils.getLocalHost(), port, path, instanceId); log.info("[InstanceLog-{}] downloadURL for appId[{}]: {}", instanceId, appId, url); return url; } @@ -392,4 +399,42 @@ private static String genMongoFileName(long instanceId) { return String.format("oms-%d.log", instanceId); } + /** + * description 在重跑之前移除老的文件,避免重跑后还看到的是之前的示例日志。 + * 因为当重跑完读取稳定日志的时候 目前逻辑会先判断本地文件是否存在 若存在则直接返回了 故需要先移除掉 + * 参考:tech.powerjob.server.core.instance.InstanceLogService#genStableLogFile(long) + * @author jian chen jiang + * date 2024/2/5 17:01 + * @param instanceId + * @return void + */ + public void removeOldFile(Long instanceId) { + // 库中的数据不删,删了就会丢失全部的历史日志 + try { + //删除本地缓存 + String s = genLogFilePath(instanceId, true); + File file = new File(s); + if(!file.exists()){ + return; + } + boolean delete = file.delete(); + if(!delete){ + log.warn("[InstanceLogService] delete old logs{} for instance: {} failed.", s,instanceId); + } + //删除临时文件 + String tempFilePath = genLogFilePath(instanceId, false); + File tempFile = new File(tempFilePath); + if(!tempFile.exists()){ + return; + } + delete = tempFile.delete(); + if(!delete){ + log.warn("[InstanceLogService] delete old temp logs{} for instance: {} failed.", s,instanceId); + } + } catch (Throwable t) { + log.error("[InstanceLogService] delete old logs for instance[{}] failed.", instanceId, t); + } + + } + } diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/instance/InstanceService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/instance/InstanceService.java index 53071a6db..b852a9e70 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/instance/InstanceService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/instance/InstanceService.java @@ -3,17 +3,23 @@ import lombok.RequiredArgsConstructor; import lombok.extern.slf4j.Slf4j; import org.springframework.beans.BeanUtils; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; import org.springframework.stereotype.Service; -import tech.powerjob.common.PowerQuery; import tech.powerjob.common.RemoteConstant; import tech.powerjob.common.SystemInstanceResult; import tech.powerjob.common.enums.InstanceStatus; import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.model.InstanceDetail; +import tech.powerjob.common.model.InstanceMeta; import tech.powerjob.common.request.ServerQueryInstanceStatusReq; import tech.powerjob.common.request.ServerStopInstanceReq; +import tech.powerjob.common.request.query.InstancePageQuery; import tech.powerjob.common.response.AskResponse; import tech.powerjob.common.response.InstanceInfoDTO; +import tech.powerjob.common.response.PageResult; +import tech.powerjob.common.serialize.JsonUtils; import tech.powerjob.remote.framework.base.URL; import tech.powerjob.server.common.constants.InstanceType; import tech.powerjob.server.common.module.WorkerInfo; @@ -27,8 +33,8 @@ import tech.powerjob.server.persistence.remote.repository.InstanceInfoRepository; import tech.powerjob.server.persistence.remote.repository.JobInfoRepository; import tech.powerjob.server.remote.server.redirector.DesignateServer; -import tech.powerjob.server.remote.transporter.impl.ServerURLFactory; import tech.powerjob.server.remote.transporter.TransportService; +import tech.powerjob.server.remote.transporter.impl.ServerURLFactory; import tech.powerjob.server.remote.worker.WorkerClusterQueryService; import java.util.Date; @@ -65,6 +71,8 @@ public class InstanceService { private final WorkerClusterQueryService workerClusterQueryService; + private final InstanceLogService instanceLogService; + /** * 创建任务实例(注意,该方法并不调用 saveAndFlush,如果有需要立即同步到DB的需求,请在方法结束后手动调用 flush) * ******************************************** @@ -80,7 +88,7 @@ public class InstanceService { * @param expectTriggerTime 预期执行时间 * @return 任务实例ID */ - public InstanceInfoDO create(Long jobId, Long appId, String jobParams, String instanceParams, Long wfInstanceId, Long expectTriggerTime) { + public InstanceInfoDO create(Long jobId, Long appId, String jobParams, String instanceParams, Long wfInstanceId, Long expectTriggerTime, String outerKey, String extendValue) { Long instanceId = idGenerateService.allocate(); Date now = new Date(); @@ -98,9 +106,16 @@ public InstanceInfoDO create(Long jobId, Long appId, String jobParams, String in newInstanceInfo.setRunningTimes(0L); newInstanceInfo.setExpectedTriggerTime(expectTriggerTime); newInstanceInfo.setLastReportTime(-1L); + newInstanceInfo.setOuterKey(outerKey); + newInstanceInfo.setExtendValue(extendValue); newInstanceInfo.setGmtCreate(now); newInstanceInfo.setGmtModified(now); + // 写入调度元信息 + InstanceMeta instanceMeta = new InstanceMeta(); + instanceMeta.setEtt(expectTriggerTime); + newInstanceInfo.setMeta(JsonUtils.toJSONString(instanceMeta)); + instanceInfoRepository.save(newInstanceInfo); return newInstanceInfo; } @@ -183,6 +198,9 @@ public void retryInstance(Long appId, Long instanceId) { // 派发任务 Long jobId = instanceInfo.getJobId(); JobInfoDO jobInfo = jobInfoRepository.findById(jobId).orElseThrow(() -> new PowerJobException("can't find job info by jobId: " + jobId)); + //删除掉之前的日志文件 + instanceLogService.removeOldFile(instanceId); + dispatchService.dispatch(jobInfo, instanceId,Optional.of(instanceInfo),Optional.empty()); } @@ -228,12 +246,21 @@ public void cancelInstance(Long appId, Long instanceId) { } } - public List queryInstanceInfo(PowerQuery powerQuery) { - return instanceInfoRepository - .findAll(QueryConvertUtils.toSpecification(powerQuery)) - .stream() - .map(InstanceService::directConvert) - .collect(Collectors.toList()); + public PageResult queryInstanceInfo(InstancePageQuery instancePageQuery) { + Specification specification = QueryConvertUtils.toSpecification(instancePageQuery); + Pageable pageable = QueryConvertUtils.toPageable(instancePageQuery); + Page instanceInfoDOPage = instanceInfoRepository.findAll(specification, pageable); + + PageResult ret = new PageResult<>(); + List instanceInfoDTOList = instanceInfoDOPage.get().map(InstanceService::directConvert).collect(Collectors.toList()); + + ret.setData(instanceInfoDTOList) + .setIndex(instanceInfoDOPage.getNumber()) + .setPageSize(instanceInfoDOPage.getSize()) + .setTotalPages(instanceInfoDOPage.getTotalPages()) + .setTotalItems(instanceInfoDOPage.getTotalElements()); + + return ret; } /** @@ -260,10 +287,12 @@ public InstanceStatus getInstanceStatus(Long instanceId) { /** * 获取任务实例的详细运行详细 * + * @param appId 用于远程 server 路由,勿删! * @param instanceId 任务实例ID * @return 详细运行状态 */ - public InstanceDetail getInstanceDetail(Long instanceId) { + @DesignateServer + public InstanceDetail getInstanceDetail(Long appId, Long instanceId, String customQuery) { InstanceInfoDO instanceInfoDO = fetchInstanceInfo(instanceId); @@ -281,7 +310,7 @@ public InstanceDetail getInstanceDetail(Long instanceId) { Optional workerInfoOpt = workerClusterQueryService.getWorkerInfoByAddress(instanceInfoDO.getAppId(), instanceInfoDO.getTaskTrackerAddress()); if (workerInfoOpt.isPresent()) { WorkerInfo workerInfo = workerInfoOpt.get(); - ServerQueryInstanceStatusReq req = new ServerQueryInstanceStatusReq(instanceId); + ServerQueryInstanceStatusReq req = new ServerQueryInstanceStatusReq(instanceId, customQuery); try { final URL url = ServerURLFactory.queryInstance2Worker(workerInfo.getAddress()); AskResponse askResponse = transportService.ask(workerInfo.getProtocol(), url, req, AskResponse.class) diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/CoreScheduleTaskManager.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/CoreScheduleTaskManager.java index 4a46e497d..a814e4109 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/CoreScheduleTaskManager.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/CoreScheduleTaskManager.java @@ -67,8 +67,11 @@ public void run() { log.info("start task : {}.", taskName); while (true) { try { - innerRunnable.run(); + + // 倒置顺序为 先 sleep 再执行,解决异常情况 while true 打日志的问题 https://github.com/PowerJob/PowerJob/issues/769 Thread.sleep(runningInterval); + + innerRunnable.run(); } catch (InterruptedException e) { log.warn("[{}] task has been interrupted!", taskName, e); break; diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/InstanceStatusCheckService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/InstanceStatusCheckService.java index 4652904f1..951d37ed2 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/InstanceStatusCheckService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/InstanceStatusCheckService.java @@ -12,7 +12,7 @@ import tech.powerjob.common.enums.TimeExpressionType; import tech.powerjob.common.enums.WorkflowInstanceStatus; import tech.powerjob.server.common.Holder; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.core.DispatchService; import tech.powerjob.server.core.instance.InstanceManager; import tech.powerjob.server.core.workflow.WorkflowInstanceManager; @@ -145,7 +145,11 @@ public void checkRunningInstance() { log.info("[InstanceStatusChecker] RunningInstance status check using {}.", stopwatch.stop()); } - private void handleWaitingDispatchInstance(List partAppIds) { + private void handleWaitingDispatchInstance(List appIds) { + + // 存在移除操作,需要重新创建集合,否则会导致外层抛出 NoSuchElementException: null + List partAppIds = Lists.newArrayList(appIds); + // 1. 检查等待 WAITING_DISPATCH 状态的任务 long threshold = System.currentTimeMillis() - DISPATCH_TIMEOUT_MS; List waitingDispatchInstances = instanceInfoRepository.findAllByAppIdInAndStatusAndExpectedTriggerTimeLessThan(partAppIds, InstanceStatus.WAITING_DISPATCH.getV(), threshold, PageRequest.of(0, MAX_BATCH_NUM_INSTANCE)); diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/PowerScheduleService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/PowerScheduleService.java index 1b4fd5e8b..e94f4a7e4 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/PowerScheduleService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/scheduler/PowerScheduleService.java @@ -11,7 +11,8 @@ import tech.powerjob.common.enums.InstanceStatus; import tech.powerjob.common.enums.TimeExpressionType; import tech.powerjob.common.model.LifeCycle; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; +import tech.powerjob.common.request.http.RunJobRequest; import tech.powerjob.server.common.timewheel.holder.InstanceTimeWheelService; import tech.powerjob.server.core.DispatchService; import tech.powerjob.server.core.instance.InstanceService; @@ -167,7 +168,7 @@ private void scheduleNormalJob0(TimeExpressionType timeExpressionType, List { - Long instanceId = instanceService.create(jobInfo.getId(), jobInfo.getAppId(), jobInfo.getJobParams(), null, null, jobInfo.getNextTriggerTime()).getInstanceId(); + Long instanceId = instanceService.create(jobInfo.getId(), jobInfo.getAppId(), jobInfo.getJobParams(), null, null, jobInfo.getNextTriggerTime(), null, null).getInstanceId(); jobId2InstanceId.put(jobInfo.getId(), instanceId); }); instanceInfoRepository.flush(); @@ -276,7 +277,9 @@ private void scheduleFrequentJobCore(List appIds) { log.info("[FrequentScheduler] disable frequent job,id:{}.", jobInfoDO.getId()); } else if (lifeCycle.getStart() == null || lifeCycle.getStart() < System.currentTimeMillis() + SCHEDULE_RATE * 2) { log.info("[FrequentScheduler] schedule frequent job,id:{}.", jobInfoDO.getId()); - jobService.runJob(jobInfoDO.getAppId(), jobId, null, Optional.ofNullable(lifeCycle.getStart()).orElse(0L) - System.currentTimeMillis()); + RunJobRequest runJobRequest = new RunJobRequest() + .setAppId(jobInfoDO.getAppId()).setJobId(jobId).setDelay(Optional.ofNullable(lifeCycle.getStart()).orElse(0L) - System.currentTimeMillis()); + jobService.runJob(runJobRequest.getAppId(), runJobRequest); } }); }); diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/AppInfoService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/AppInfoService.java index 4e81b0482..098216678 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/AppInfoService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/AppInfoService.java @@ -1,5 +1,9 @@ package tech.powerjob.server.core.service; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; + +import java.util.Optional; + /** * AppInfoService * @@ -7,5 +11,36 @@ * @since 2023/3/4 */ public interface AppInfoService { - Long assertApp(String appName, String password); + + Optional findByAppName(String appName); + + /** + * 获取 AppInfo(带缓存) + * @param appId appId + * @param useCache cache + * @return App 信息 + */ + Optional findById(Long appId, boolean useCache); + + void deleteById(Long appId); + + /** + * 保存 App + * @param appInfo app 信息 + * @return 保存后结果 + */ + AppInfoDO save(AppInfoDO appInfo); + + /** + * + * @param appName 验证 APP 账号密码 + * @param password 密码 + * @param encryptType 密码类型 + * @return appId + */ + Long assertApp(String appName, String password, String encryptType); + + Long assertApp(AppInfoDO appInfo, String password, String encryptType); + + String fetchOriginAppPassword(AppInfoDO appInfo); } diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/JobService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/JobService.java index 1ad88b8d3..fffc3f949 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/JobService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/JobService.java @@ -1,6 +1,7 @@ package tech.powerjob.server.core.service; import tech.powerjob.common.PowerQuery; +import tech.powerjob.common.request.http.RunJobRequest; import tech.powerjob.common.request.http.SaveJobInfoRequest; import tech.powerjob.common.response.JobInfoDTO; import tech.powerjob.server.persistence.remote.model.JobInfoDO; @@ -25,7 +26,7 @@ public interface JobService { List queryJob(PowerQuery powerQuery); - long runJob(Long appId, Long jobId, String instanceParams, Long delay); + long runJob(Long appId, RunJobRequest runJobRequest); void deleteJob(Long jobId); diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/UserService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/UserService.java index 6acea5bd2..4087438c5 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/UserService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/UserService.java @@ -1,14 +1,13 @@ package tech.powerjob.server.core.service; -import tech.powerjob.server.persistence.remote.model.UserInfoDO; -import tech.powerjob.server.persistence.remote.repository.UserInfoRepository; import com.google.common.base.Splitter; import com.google.common.collect.Lists; -import org.springframework.stereotype.Service; import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import tech.powerjob.server.persistence.remote.model.UserInfoDO; +import tech.powerjob.server.persistence.remote.repository.UserInfoRepository; import javax.annotation.Resource; -import java.util.Date; import java.util.List; import java.util.Set; import java.util.stream.Collectors; @@ -25,16 +24,6 @@ public class UserService { @Resource private UserInfoRepository userInfoRepository; - /** - * 保存/修改 用户 - * @param userInfoDO user - */ - public void save(UserInfoDO userInfoDO) { - userInfoDO.setGmtCreate(new Date()); - userInfoDO.setGmtModified(userInfoDO.getGmtCreate()); - userInfoRepository.saveAndFlush(userInfoDO); - } - /** * 根据用户ID字符串获取用户信息详细列表 * @param userIds 逗号分割的用户ID信息 diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/AppInfoServiceImpl.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/AppInfoServiceImpl.java index b5e96ed04..fc7dacfe4 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/AppInfoServiceImpl.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/AppInfoServiceImpl.java @@ -1,13 +1,22 @@ package tech.powerjob.server.core.service.impl; +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.stereotype.Service; +import tech.powerjob.common.enums.EncryptType; +import tech.powerjob.common.enums.ErrorCodes; import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.utils.DigestUtils; +import tech.powerjob.server.common.utils.AESUtil; import tech.powerjob.server.core.service.AppInfoService; import tech.powerjob.server.persistence.remote.model.AppInfoDO; import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; -import java.util.Objects; +import java.util.Optional; +import java.util.concurrent.TimeUnit; /** * AppInfoServiceImpl @@ -15,25 +24,105 @@ * @author tjq * @since 2023/3/4 */ +@Slf4j @Service @RequiredArgsConstructor public class AppInfoServiceImpl implements AppInfoService { + private final Cache appId2AppInfoDO = CacheBuilder.newBuilder() + .softValues() + .expireAfterWrite(3, TimeUnit.MINUTES) + .maximumSize(1024) + .build(); + private final AppInfoRepository appInfoRepository; - /** - * 验证应用访问权限 - * @param appName 应用名称 - * @param password 密码 - * @return 应用ID - */ + private static final String ENCRYPT_KEY = "ChinaNo.1_ChinaNo.1_ChinaNo.1AAA"; + + private static final String ENCRYPT_PWD_PREFIX = "sys_encrypt_aes:"; + @Override - public Long assertApp(String appName, String password) { + public Optional findByAppName(String appName) { + return appInfoRepository.findByAppName(appName); + } - AppInfoDO appInfo = appInfoRepository.findByAppName(appName).orElseThrow(() -> new PowerJobException("can't find appInfo by appName: " + appName)); - if (Objects.equals(appInfo.getPassword(), password)) { - return appInfo.getId(); + @Override + public Optional findById(Long appId, boolean useCache) { + if (!useCache) { + Optional appInfoOpt = appInfoRepository.findById(appId); + appInfoOpt.ifPresent(appInfo -> appId2AppInfoDO.put(appId, appInfo)); + return appInfoOpt; } - throw new PowerJobException("password error!"); + try { + AppInfoDO appInfoDO = appId2AppInfoDO.get(appId, () -> { + Optional appInfoOpt = appInfoRepository.findById(appId); + if (appInfoOpt.isPresent()) { + return appInfoOpt.get(); + } + throw new IllegalArgumentException("can't find appInfo by appId:" + appId); + }); + return Optional.of(appInfoDO); + } catch (Exception e) { + log.warn("[AppInfoService] findByIdWithCache failed,appId={}", appId, e); + } + return Optional.empty(); + } + + @Override + public void deleteById(Long appId) { + appInfoRepository.deleteById(appId); + } + + @Override + public AppInfoDO save(AppInfoDO appInfo) { + + String originPassword = appInfo.getPassword(); + String encryptPassword = AESUtil.encrypt(originPassword, ENCRYPT_KEY); + String finalPassword = ENCRYPT_PWD_PREFIX.concat(encryptPassword); + appInfo.setPassword(finalPassword); + + return appInfoRepository.saveAndFlush(appInfo); + } + + @Override + public Long assertApp(String appName, String password, String encryptType) { + AppInfoDO appInfo = appInfoRepository.findByAppName(appName).orElseThrow(() -> new PowerJobException(ErrorCodes.INVALID_APP, appName)); + return assertApp(appInfo, password, encryptType); } + + @Override + public Long assertApp(AppInfoDO appInfo, String password, String encryptType) { + boolean checkPass = checkPassword(appInfo, password, encryptType); + if (!checkPass) { + throw new PowerJobException(ErrorCodes.INCORRECT_PASSWORD, null); + } + return appInfo.getId(); + } + + private boolean checkPassword(AppInfoDO appInfo, String password, String encryptType) { + String originPwd = fetchOriginAppPassword(appInfo); + if (StringUtils.isEmpty(encryptType) || EncryptType.NONE.getCode().equalsIgnoreCase(encryptType)) { + return password.equals(originPwd); + } + if (EncryptType.MD5.getCode().equalsIgnoreCase(encryptType)) { + return password.equalsIgnoreCase(DigestUtils.md5(originPwd)); + } + throw new PowerJobException(ErrorCodes.INVALID_REQUEST, "unknown_encryptType:" + encryptType); + } + + @Override + public String fetchOriginAppPassword(AppInfoDO appInfo) { + String dbPwd = appInfo.getPassword(); + if (StringUtils.isEmpty(dbPwd)) { + return dbPwd; + } + + if (dbPwd.startsWith(ENCRYPT_PWD_PREFIX)) { + String encryptPassword = dbPwd.replaceFirst(ENCRYPT_PWD_PREFIX, StringUtils.EMPTY); + return AESUtil.decrypt(encryptPassword, ENCRYPT_KEY); + } + + return dbPwd; + } + } diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/job/JobConverter.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/job/JobConverter.java index 7c45f4f2a..b1ec2ae16 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/job/JobConverter.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/job/JobConverter.java @@ -9,6 +9,7 @@ import tech.powerjob.common.enums.ProcessorType; import tech.powerjob.common.enums.TimeExpressionType; import tech.powerjob.common.model.AlarmConfig; +import tech.powerjob.common.model.JobAdvancedRuntimeConfig; import tech.powerjob.common.model.LifeCycle; import tech.powerjob.common.model.LogConfig; import tech.powerjob.common.request.http.SaveJobInfoRequest; @@ -40,6 +41,7 @@ public static SaveJobInfoRequest convertJobInfoDO2SaveJobInfoRequest(JobInfoDO j saveJobInfoRequest.setLifeCycle(LifeCycle.parse(jobInfoDO.getLifecycle())); saveJobInfoRequest.setAlarmConfig(JsonUtils.parseObjectIgnoreException(jobInfoDO.getAlarmConfig(), AlarmConfig.class)); saveJobInfoRequest.setLogConfig(JsonUtils.parseObjectIgnoreException(jobInfoDO.getLogConfig(), LogConfig.class)); + saveJobInfoRequest.setAdvancedRuntimeConfig(JsonUtils.parseObjectIgnoreException(jobInfoDO.getAdvancedRuntimeConfig(), JobAdvancedRuntimeConfig.class)); return saveJobInfoRequest; } @@ -49,6 +51,14 @@ public static JobInfoDTO convertJobInfoDO2JobInfoDTO(JobInfoDO jobInfoDO) { if (jobInfoDO.getAlarmConfig() != null) { jobInfoDTO.setAlarmConfig(JSON.parseObject(jobInfoDO.getAlarmConfig(), AlarmConfig.class)); } + + if (StringUtils.isNotEmpty(jobInfoDO.getLogConfig())) { + jobInfoDTO.setLogConfig(JSON.parseObject(jobInfoDO.getLogConfig(), LogConfig.class)); + } + + if (StringUtils.isNotEmpty(jobInfoDO.getAdvancedRuntimeConfig())) { + jobInfoDTO.setAdvancedRuntimeConfig(JSON.parseObject(jobInfoDO.getAdvancedRuntimeConfig(), JobAdvancedRuntimeConfig.class)); + } return jobInfoDTO; } diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/job/JobServiceImpl.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/job/JobServiceImpl.java index e76345b3e..c4278a40d 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/job/JobServiceImpl.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/service/impl/job/JobServiceImpl.java @@ -14,11 +14,12 @@ import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.model.AlarmConfig; import tech.powerjob.common.model.LifeCycle; +import tech.powerjob.common.request.http.RunJobRequest; import tech.powerjob.common.request.http.SaveJobInfoRequest; import tech.powerjob.common.response.JobInfoDTO; import tech.powerjob.common.serialize.JsonUtils; import tech.powerjob.server.common.SJ; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.timewheel.holder.InstanceTimeWheelService; import tech.powerjob.server.core.DispatchService; import tech.powerjob.server.core.instance.InstanceService; @@ -116,6 +117,10 @@ public Long saveJob(SaveJobInfoRequest request) { if (request.getLogConfig() != null) { jobInfoDO.setLogConfig(JSONObject.toJSONString(request.getLogConfig())); } + // 日志配置 + if (request.getAdvancedRuntimeConfig() != null) { + jobInfoDO.setAdvancedRuntimeConfig(JSONObject.toJSONString(request.getAdvancedRuntimeConfig())); + } JobInfoDO res = jobInfoRepository.saveAndFlush(jobInfoDO); return res.getId(); } @@ -165,23 +170,23 @@ public List queryJob(PowerQuery powerQuery) { return jobInfoRepository.findAll(specification).stream().map(JobConverter::convertJobInfoDO2JobInfoDTO).collect(Collectors.toList()); } - /** - * 手动立即运行某个任务 - * - * @param jobId 任务ID - * @param instanceParams 任务实例参数(仅 OpenAPI 存在) - * @param delay 延迟时间,单位 毫秒 - * @return 任务实例ID - */ + @Override @DesignateServer - public long runJob(Long appId, Long jobId, String instanceParams, Long delay) { + public long runJob(Long appId, RunJobRequest runJobRequest) { + Long jobId = runJobRequest.getJobId(); + String instanceParams = runJobRequest.getInstanceParams(); + String outerKey = runJobRequest.getOuterKey(); + long delay = runJobRequest.getDelay() == null ? 0 : runJobRequest.getDelay(); - delay = delay == null ? 0 : delay; JobInfoDO jobInfo = jobInfoRepository.findById(jobId).orElseThrow(() -> new IllegalArgumentException("can't find job by id:" + jobId)); - log.info("[Job-{}] try to run job in app[{}], instanceParams={},delay={} ms.", jobInfo.getId(), appId, instanceParams, delay); - final InstanceInfoDO instanceInfo = instanceService.create(jobInfo.getId(), jobInfo.getAppId(), jobInfo.getJobParams(), instanceParams, null, System.currentTimeMillis() + Math.max(delay, 0)); + log.info("[Job-{}] try to run job in app[{}], instanceParams={},delay={} ms,outerKey={}", jobInfo.getId(), appId, instanceParams, delay, outerKey); + + final InstanceInfoDO instanceInfo = instanceService.create(jobInfo.getId(), jobInfo.getAppId(), jobInfo.getJobParams(), + instanceParams, null, System.currentTimeMillis() + Math.max(delay, 0), + outerKey, runJobRequest.getExtendValue() + ); instanceInfoRepository.flush(); if (delay <= 0) { dispatchService.dispatch(jobInfo, instanceInfo.getInstanceId(), Optional.of(instanceInfo),Optional.empty()); @@ -192,7 +197,6 @@ public long runJob(Long appId, Long jobId, String instanceParams, Long delay) { return instanceInfo.getInstanceId(); } - /** * 删除某个任务 * diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/uid/IdGenerateService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/uid/IdGenerateService.java index d583f69b9..75568e76a 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/uid/IdGenerateService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/uid/IdGenerateService.java @@ -1,7 +1,6 @@ package tech.powerjob.server.core.uid; import lombok.extern.slf4j.Slf4j; -import org.springframework.beans.factory.annotation.Autowired; import org.springframework.stereotype.Service; import tech.powerjob.server.remote.server.self.ServerInfoService; @@ -22,7 +21,7 @@ public class IdGenerateService { private static final int DATA_CENTER_ID = 0; public IdGenerateService(ServerInfoService serverInfoService) { - long id = serverInfoService.fetchServiceInfo().getId(); + long id = serverInfoService.fetchCurrentServerInfo().getId(); snowFlakeIdGenerator = new SnowFlakeIdGenerator(DATA_CENTER_ID, id); log.info("[IdGenerateService] initialize IdGenerateService successfully, ID:{}", id); } diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/validator/JobNodeValidator.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/validator/JobNodeValidator.java index 7765aec88..aedf5c33b 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/validator/JobNodeValidator.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/validator/JobNodeValidator.java @@ -5,14 +5,12 @@ import org.springframework.stereotype.Component; import tech.powerjob.common.enums.WorkflowNodeType; import tech.powerjob.common.exception.PowerJobException; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.core.workflow.algorithm.WorkflowDAG; import tech.powerjob.server.persistence.remote.model.JobInfoDO; import tech.powerjob.server.persistence.remote.model.WorkflowNodeInfoDO; import tech.powerjob.server.persistence.remote.repository.JobInfoRepository; -import javax.annotation.Resource; - /** * @author Echo009 * @since 2021/12/14 diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/validator/NestedWorkflowNodeValidator.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/validator/NestedWorkflowNodeValidator.java index 0c22fa1b9..b257c80c3 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/validator/NestedWorkflowNodeValidator.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/validator/NestedWorkflowNodeValidator.java @@ -7,7 +7,7 @@ import tech.powerjob.common.enums.WorkflowNodeType; import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.model.PEWorkflowDAG; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.core.workflow.algorithm.WorkflowDAG; import tech.powerjob.server.persistence.remote.model.WorkflowInfoDO; import tech.powerjob.server.persistence.remote.model.WorkflowNodeInfoDO; diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowInstanceManager.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowInstanceManager.java index 2c6cdd783..1dde853fe 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowInstanceManager.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowInstanceManager.java @@ -18,7 +18,7 @@ import tech.powerjob.common.model.PEWorkflowDAG; import tech.powerjob.common.serialize.JsonUtils; import tech.powerjob.common.utils.CommonUtils; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.utils.SpringUtils; import tech.powerjob.server.core.alarm.AlarmUtils; import tech.powerjob.server.core.helper.StatusMappingHelper; diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowInstanceService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowInstanceService.java index 047a706d6..93c1d7c0d 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowInstanceService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowInstanceService.java @@ -12,7 +12,7 @@ import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.model.PEWorkflowDAG; import tech.powerjob.common.response.WorkflowInstanceInfoDTO; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.utils.SpringUtils; import tech.powerjob.server.core.instance.InstanceService; import tech.powerjob.server.core.lock.UseCacheLock; diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowService.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowService.java index 3a86cfb5f..f6e2c701b 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowService.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/WorkflowService.java @@ -15,7 +15,7 @@ import tech.powerjob.common.request.http.SaveWorkflowNodeRequest; import tech.powerjob.common.request.http.SaveWorkflowRequest; import tech.powerjob.server.common.SJ; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.timewheel.holder.InstanceTimeWheelService; import tech.powerjob.server.core.scheduler.TimingStrategyService; import tech.powerjob.server.core.service.NodeValidateService; diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/hanlder/impl/JobNodeHandler.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/hanlder/impl/JobNodeHandler.java index a3fc30ed0..0d32e7909 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/hanlder/impl/JobNodeHandler.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/hanlder/impl/JobNodeHandler.java @@ -31,7 +31,7 @@ public class JobNodeHandler implements TaskNodeHandler { @Override public void createTaskInstance(PEWorkflowDAG.Node node, PEWorkflowDAG dag, WorkflowInstanceInfoDO wfInstanceInfo) { // instanceParam 传递的是工作流实例的 wfContext - Long instanceId = SpringUtils.getBean(InstanceService.class).create(node.getJobId(), wfInstanceInfo.getAppId(), node.getNodeParams(), wfInstanceInfo.getWfContext(), wfInstanceInfo.getWfInstanceId(), System.currentTimeMillis()).getInstanceId(); + Long instanceId = SpringUtils.getBean(InstanceService.class).create(node.getJobId(), wfInstanceInfo.getAppId(), node.getNodeParams(), wfInstanceInfo.getWfContext(), wfInstanceInfo.getWfInstanceId(), System.currentTimeMillis(), null, null).getInstanceId(); node.setInstanceId(instanceId); node.setStatus(InstanceStatus.RUNNING.getV()); log.info("[Workflow-{}|{}] create readyNode(JOB) instance(nodeId={},jobId={},instanceId={}) successfully~", wfInstanceInfo.getWorkflowId(), wfInstanceInfo.getWfInstanceId(), node.getNodeId(), node.getJobId(), instanceId); diff --git a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/hanlder/impl/NestedWorkflowNodeHandler.java b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/hanlder/impl/NestedWorkflowNodeHandler.java index b08413a64..12b1e5d43 100644 --- a/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/hanlder/impl/NestedWorkflowNodeHandler.java +++ b/powerjob-server/powerjob-server-core/src/main/java/tech/powerjob/server/core/workflow/hanlder/impl/NestedWorkflowNodeHandler.java @@ -11,7 +11,7 @@ import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.model.PEWorkflowDAG; import tech.powerjob.common.utils.CommonUtils; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.utils.SpringUtils; import tech.powerjob.server.core.workflow.WorkflowInstanceManager; import tech.powerjob.server.core.workflow.algorithm.WorkflowDAGUtils; diff --git a/powerjob-server/powerjob-server-extension/pom.xml b/powerjob-server/powerjob-server-extension/pom.xml index 7998e6bd2..9f72ecee2 100644 --- a/powerjob-server/powerjob-server-extension/pom.xml +++ b/powerjob-server/powerjob-server-extension/pom.xml @@ -5,7 +5,7 @@ powerjob-server tech.powerjob - 4.3.6 + 5.1.2 ../pom.xml 4.0.0 diff --git a/powerjob-server/powerjob-server-extension/src/main/java/tech/powerjob/server/extension/dfs/DFsService.java b/powerjob-server/powerjob-server-extension/src/main/java/tech/powerjob/server/extension/dfs/DFsService.java index fdb77b6b6..7fe61f7c4 100644 --- a/powerjob-server/powerjob-server-extension/src/main/java/tech/powerjob/server/extension/dfs/DFsService.java +++ b/powerjob-server/powerjob-server-extension/src/main/java/tech/powerjob/server/extension/dfs/DFsService.java @@ -16,14 +16,14 @@ public interface DFsService { * @param storeRequest 存储请求 * @throws IOException 异常 */ - void store(StoreRequest storeRequest) throws IOException; + void store(StoreRequest storeRequest) throws Exception; /** * 下载文件 * @param downloadRequest 文件下载请求 * @throws IOException 异常 */ - void download(DownloadRequest downloadRequest) throws IOException; + void download(DownloadRequest downloadRequest) throws Exception; /** * 获取文件元信息 @@ -31,7 +31,7 @@ public interface DFsService { * @return 存在则返回文件元信息 * @throws IOException 异常 */ - Optional fetchFileMeta(FileLocation fileLocation) throws IOException; + Optional fetchFileMeta(FileLocation fileLocation) throws Exception; /** * 清理 powerjob 认为“过期”的文件 diff --git a/powerjob-server/powerjob-server-migrate/pom.xml b/powerjob-server/powerjob-server-migrate/pom.xml index 669eda191..0cb9a3cce 100644 --- a/powerjob-server/powerjob-server-migrate/pom.xml +++ b/powerjob-server/powerjob-server-migrate/pom.xml @@ -5,7 +5,7 @@ powerjob-server tech.powerjob - 4.3.6 + 5.1.2 ../pom.xml 4.0.0 diff --git a/powerjob-server/powerjob-server-monitor/pom.xml b/powerjob-server/powerjob-server-monitor/pom.xml index 587a604a7..77f968f38 100644 --- a/powerjob-server/powerjob-server-monitor/pom.xml +++ b/powerjob-server/powerjob-server-monitor/pom.xml @@ -5,7 +5,7 @@ powerjob-server tech.powerjob - 4.3.6 + 5.1.2 ../pom.xml 4.0.0 diff --git a/powerjob-server/powerjob-server-persistence/pom.xml b/powerjob-server/powerjob-server-persistence/pom.xml index 59c5f63e5..72b5b2993 100644 --- a/powerjob-server/powerjob-server-persistence/pom.xml +++ b/powerjob-server/powerjob-server-persistence/pom.xml @@ -5,7 +5,7 @@ powerjob-server tech.powerjob - 4.3.6 + 5.1.2 ../pom.xml 4.0.0 @@ -41,8 +41,8 @@ aliyun-sdk-oss - io.minio - minio + com.amazonaws + aws-java-sdk-s3 diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/QueryConvertUtils.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/QueryConvertUtils.java index 31d0bbbf9..2455eb2ed 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/QueryConvertUtils.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/QueryConvertUtils.java @@ -1,14 +1,18 @@ package tech.powerjob.server.persistence; import com.alibaba.fastjson.JSONArray; -import tech.powerjob.common.exception.PowerJobException; -import tech.powerjob.common.PowerQuery; import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.domain.Sort; import org.springframework.data.jpa.domain.Specification; +import tech.powerjob.common.PowerQuery; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.request.query.PowerPageQuery; -import javax.persistence.criteria.*; +import javax.persistence.criteria.Predicate; import java.lang.reflect.Field; import java.util.List; @@ -86,7 +90,27 @@ public static Specification toSpecification(PowerQuery powerQuery) { }; } - private static String convertLikeParams(Object o) { + public static Pageable toPageable(PowerPageQuery powerPageQuery) { + + Sort sorter = null; + String sortBy = powerPageQuery.getSortBy(); + if (StringUtils.isNoneEmpty(sortBy)) { + sorter = Sort.by(sortBy); + if (powerPageQuery.isAsc()) { + sorter = sorter.ascending(); + } else { + sorter = sorter.descending(); + } + } + + if (sorter == null) { + return PageRequest.of(powerPageQuery.getIndex(), powerPageQuery.getPageSize()); + } + + return PageRequest.of(powerPageQuery.getIndex(), powerPageQuery.getPageSize(), sorter); + } + + public static String convertLikeParams(Object o) { String s = (String) o; if (!s.startsWith("%")) { s = "%" + s; diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/config/dialect/AdpPostgreSQLDialect.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/config/dialect/AdpPostgreSQLDialect.java new file mode 100644 index 000000000..8552c674f --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/config/dialect/AdpPostgreSQLDialect.java @@ -0,0 +1,37 @@ +package tech.powerjob.server.persistence.config.dialect; + +import org.hibernate.dialect.PostgreSQL10Dialect; +import org.hibernate.type.descriptor.sql.LongVarbinaryTypeDescriptor; +import org.hibernate.type.descriptor.sql.LongVarcharTypeDescriptor; +import org.hibernate.type.descriptor.sql.SqlTypeDescriptor; + +import java.sql.Types; + +/** + * PG数据库方言 + * 使用方自行通过配置文件激活:spring.datasource.remote.hibernate.properties.hibernate.dialect=tech.powerjob.server.persistence.config.dialect.AdpPostgreSQLDialect + * + * @author litong0531 + * @since 2024/8/11 + */ +public class AdpPostgreSQLDialect extends PostgreSQL10Dialect { + + public AdpPostgreSQLDialect() { + super(); + registerColumnType(Types.BLOB, "bytea"); + registerColumnType(Types.CLOB, "text"); + } + + @Override + public SqlTypeDescriptor remapSqlTypeDescriptor(SqlTypeDescriptor sqlTypeDescriptor) { + switch (sqlTypeDescriptor.getSqlType()) { + case Types.CLOB: + return LongVarcharTypeDescriptor.INSTANCE; + case Types.BLOB: + return LongVarbinaryTypeDescriptor.INSTANCE; + case Types.NCLOB: + return LongVarbinaryTypeDescriptor.INSTANCE; + } + return super.remapSqlTypeDescriptor(sqlTypeDescriptor); + } +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/AppInfoDO.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/AppInfoDO.java index 7395af382..fe073946c 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/AppInfoDO.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/AppInfoDO.java @@ -22,7 +22,14 @@ public class AppInfoDO { @GenericGenerator(name = "native", strategy = "native") private Long id; + private String appName; + + /** + * 描述 + */ + private String title; + /** * 应用分组密码 */ @@ -35,7 +42,24 @@ public class AppInfoDO { */ private String currentServer; + /** + * 命名空间ID,外键关联 + */ + private Long namespaceId; + /** + * 管理标签 + */ + private String tags; + /** + * 扩展字段 + */ + private String extra; + private Date gmtCreate; private Date gmtModified; + + private Long creator; + + private Long modifier; } diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/InstanceInfoDO.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/InstanceInfoDO.java index c74e6546c..ac1e1e93e 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/InstanceInfoDO.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/InstanceInfoDO.java @@ -22,7 +22,8 @@ @Table(indexes = { @Index(name = "idx01_instance_info", columnList = "jobId,status"), @Index(name = "idx02_instance_info", columnList = "appId,status"), - @Index(name = "idx03_instance_info", columnList = "instanceId,status") + @Index(name = "idx03_instance_info", columnList = "instanceId,status"), + @Index(name = "idx04_instance_info_outer_key", columnList = "outerKey") }) public class InstanceInfoDO { @@ -99,6 +100,19 @@ public class InstanceInfoDO { */ private Long runningTimes; + /** + * “外键”,用于 OPENAPI 场景业务场景与 PowerJob 实例的绑定 + */ + private String outerKey; + /** + * 扩展属性,用于 OPENAPI 场景上下文参数的透传 + */ + private String extendValue; + + /** + * 调度元信息 + */ + private String meta; private Date gmtCreate; diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/JobInfoDO.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/JobInfoDO.java index a3b4bfbfb..957023548 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/JobInfoDO.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/JobInfoDO.java @@ -139,7 +139,14 @@ public class JobInfoDO { */ private String extra; + /** + * 派发策略 + */ private Integer dispatchStrategy; + /** + * 某种派发策略背后的具体配置,值取决于 dispatchStrategy + */ + private String dispatchStrategyConfig; private String lifecycle; /** @@ -156,4 +163,10 @@ public class JobInfoDO { * 日志配置,包括日志级别、日志方式等配置信息 */ private String logConfig; + + /** + * 高级运行时配置 + * 不需要用于索引的高级运行参数,后续统一存储到这里,便于版本升级(尽可能保证数据库表结构稳定) + */ + private String advancedRuntimeConfig; } diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/NamespaceDO.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/NamespaceDO.java new file mode 100644 index 000000000..35d01bf8e --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/NamespaceDO.java @@ -0,0 +1,65 @@ +package tech.powerjob.server.persistence.remote.model; + +import lombok.Data; +import org.hibernate.annotations.GenericGenerator; + +import javax.persistence.*; +import java.util.Date; + +/** + * 命名空间,用于组织管理 App + * + * @author tjq + * @since 2023/9/3 + */ +@Data +@Entity +@Table(uniqueConstraints = {@UniqueConstraint(name = "uidx01_namespace", columnNames = {"code"})}) +public class NamespaceDO { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "native") + @GenericGenerator(name = "native", strategy = "native") + private Long id; + + /** + * 空间唯一标识 + */ + private String code; + + /** + * 空间名称,比如中文描述(XX部门XX空间) + */ + private String name; + + /** + * 鉴权 token,后续 OpenAPI 调用需要 + */ + private String token; + + private Integer status; + + /** + * 部门,组织架构相关属性。 + * 预留数据库字段方便基于组织架构二次开发 + */ + private String dept; + + /** + * 标签,扩展性之王,多值逗号分割 + */ + private String tags; + + /** + * 扩展字段 + */ + private String extra; + + private Date gmtCreate; + + private Date gmtModified; + + private Long creator; + + private Long modifier; +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/PwjbUserInfoDO.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/PwjbUserInfoDO.java new file mode 100644 index 000000000..814182716 --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/PwjbUserInfoDO.java @@ -0,0 +1,36 @@ +package tech.powerjob.server.persistence.remote.model; + +import lombok.Data; +import org.hibernate.annotations.GenericGenerator; + +import javax.persistence.*; +import java.util.Date; + +/** + * PowerJob 自建登录体系的用户表,只存储使用 PowerJob 自带登录方式登录的用户信息 + * + * @author tjq + * @since 2024/2/13 + */ +@Data +@Entity +@Table(uniqueConstraints = { + @UniqueConstraint(name = "uidx01_username", columnNames = {"username"}) +}) +public class PwjbUserInfoDO { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "native") + @GenericGenerator(name = "native", strategy = "native") + private Long id; + + private String username; + + private String password; + + private String extra; + + private Date gmtCreate; + + private Date gmtModified; +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/SundryDO.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/SundryDO.java new file mode 100644 index 000000000..b72cd64f3 --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/SundryDO.java @@ -0,0 +1,49 @@ +package tech.powerjob.server.persistence.remote.model; + +import lombok.Data; +import lombok.NoArgsConstructor; +import org.hibernate.annotations.GenericGenerator; + +import javax.persistence.*; +import java.util.Date; + +/** + * 杂项 + * KKV 表存一些配置数据 + * + * @author tjq + * @since 2024/2/15 + */ +@Data +@Entity +@NoArgsConstructor +@Table(uniqueConstraints = {@UniqueConstraint(name = "uidx01_sundry", columnNames = {"pkey", "skey"})}) +public class SundryDO { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "native") + @GenericGenerator(name = "native", strategy = "native") + private Long id; + + /** + * PKEY + */ + private String pkey; + /** + * SKEY + */ + private String skey; + /** + * 内容 + */ + private String content; + + /** + * 其他参数 + */ + private String extra; + + private Date gmtCreate; + + private Date gmtModified; +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/UserInfoDO.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/UserInfoDO.java index e19bef8c9..2c3ef4d6e 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/UserInfoDO.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/UserInfoDO.java @@ -8,16 +8,20 @@ /** * 用户信息表 + * PowerJob 自身维护的全部用户体系数据 + * 5.0.0 可能不兼容改动:为了支持第三方登录,需要通过 username 与第三方登录系统做匹配,该列需要声明为唯一索引,确保全局唯一 * * @author tjq * @since 2020/4/12 */ @Data @Entity -@Table(indexes = { - @Index(name = "uidx01_user_info", columnList = "username"), - @Index(name = "uidx02_user_info", columnList = "email") -}) +@Table(uniqueConstraints = { + @UniqueConstraint(name = "uidx01_user_name", columnNames = {"username"}) +}, + indexes = { + @Index(name = "uidx02_user_info", columnList = "email") + }) public class UserInfoDO { @Id @@ -25,7 +29,17 @@ public class UserInfoDO { @GenericGenerator(name = "native", strategy = "native") private Long id; + /** + * 账号类型 + */ + private String accountType; + private String username; + /** + * since 5.0.0 + * 昵称(第三方登陆的 username 很难识别,方便后续展示引入 nick) + */ + private String nick; private String password; /** @@ -40,11 +54,28 @@ public class UserInfoDO { * webHook */ private String webHook; + /** - * 扩展字段 + * JWT 登录的二次校验信息 + */ + private String tokenLoginVerifyInfo; + + /** + * 扩展字段 for 第三方 + * PowerJob 内部不允许使用该字段 */ private String extra; + /** + * 原始账号 username + */ + private String originUsername; + + /** + * 账号当前状态 + */ + private Integer status; + private Date gmtCreate; private Date gmtModified; diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/UserRoleDO.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/UserRoleDO.java new file mode 100644 index 000000000..22d7b629b --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/model/UserRoleDO.java @@ -0,0 +1,53 @@ +package tech.powerjob.server.persistence.remote.model; + +import lombok.Data; +import org.hibernate.annotations.GenericGenerator; + +import javax.persistence.*; +import java.util.Date; + +/** + * 用户角色表 + * + * @author tjq + * @since 2023/3/20 + */ +@Data +@Entity +@Table(indexes = { + @Index(name = "uidx01_user_id", columnList = "userId") +}) +public class UserRoleDO { + + @Id + @GeneratedValue(strategy = GenerationType.AUTO, generator = "native") + @GenericGenerator(name = "native", strategy = "native") + private Long id; + + /** + * 授予角色的用户ID + */ + private Long userId; + + /** + * 权限范围,namespace 还是 app + */ + private Integer scope; + /** + * 和 scope 一起组成授权目标,比如某个 app 或 某个 namespace + */ + private Long target; + + /** + * 角色,比如 Observer + */ + private Integer role; + /** + * 扩展字段 + */ + private String extra; + + private Date gmtCreate; + + private Date gmtModified; +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/AppInfoRepository.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/AppInfoRepository.java index a7e6d09db..ec98e8e99 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/AppInfoRepository.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/AppInfoRepository.java @@ -1,12 +1,14 @@ package tech.powerjob.server.persistence.remote.repository; -import org.springframework.data.jpa.repository.Query; -import org.springframework.data.repository.query.Param; -import tech.powerjob.server.persistence.remote.model.AppInfoDO; import org.springframework.data.domain.Page; import org.springframework.data.domain.Pageable; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import org.springframework.data.jpa.repository.Query; +import org.springframework.data.repository.query.Param; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import java.util.Collection; import java.util.List; import java.util.Optional; @@ -16,7 +18,7 @@ * @author tjq * @since 2020/4/1 */ -public interface AppInfoRepository extends JpaRepository { +public interface AppInfoRepository extends JpaRepository, JpaSpecificationExecutor { Optional findByAppName(String appName); @@ -31,4 +33,8 @@ public interface AppInfoRepository extends JpaRepository { @Query(value = "select id from AppInfoDO where currentServer = :currentServer") List listAppIdByCurrentServer(@Param("currentServer")String currentServer); + List findAllByNamespaceId(Long namespaceId); + + + List findAllByIdIn(Collection ids); } diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/NamespaceRepository.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/NamespaceRepository.java new file mode 100644 index 000000000..ff776903e --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/NamespaceRepository.java @@ -0,0 +1,22 @@ +package tech.powerjob.server.persistence.remote.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import tech.powerjob.server.persistence.remote.model.NamespaceDO; + +import java.util.Collection; +import java.util.List; +import java.util.Optional; + +/** + * 命名空间 + * + * @author tjq + * @since 2023/9/3 + */ +public interface NamespaceRepository extends JpaRepository, JpaSpecificationExecutor { + + Optional findByCode(String code); + + List findAllByIdIn(Collection ids); +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/PwjbUserInfoRepository.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/PwjbUserInfoRepository.java new file mode 100644 index 000000000..68c02bb0d --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/PwjbUserInfoRepository.java @@ -0,0 +1,17 @@ +package tech.powerjob.server.persistence.remote.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import tech.powerjob.server.persistence.remote.model.PwjbUserInfoDO; + +import java.util.Optional; + +/** + * PwjbUserInfoRepository + * + * @author tjq + * @since 2024/2/13 + */ +public interface PwjbUserInfoRepository extends JpaRepository { + + Optional findByUsername(String username); +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/SundryRepository.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/SundryRepository.java new file mode 100644 index 000000000..62e47a5ac --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/SundryRepository.java @@ -0,0 +1,20 @@ +package tech.powerjob.server.persistence.remote.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import tech.powerjob.server.persistence.remote.model.SundryDO; + +import java.util.List; +import java.util.Optional; + +/** + * SundryRepository + * + * @author tjq + * @since 2024/2/15 + */ +public interface SundryRepository extends JpaRepository { + + List findAllByPkey(String pkey); + + Optional findByPkeyAndSkey(String pkey, String skey); +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/UserInfoRepository.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/UserInfoRepository.java index 2a11d2071..60a2ae1b7 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/UserInfoRepository.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/UserInfoRepository.java @@ -1,9 +1,11 @@ package tech.powerjob.server.persistence.remote.repository; -import tech.powerjob.server.persistence.remote.model.UserInfoDO; import org.springframework.data.jpa.repository.JpaRepository; +import org.springframework.data.jpa.repository.JpaSpecificationExecutor; +import tech.powerjob.server.persistence.remote.model.UserInfoDO; import java.util.List; +import java.util.Optional; /** * 用户信息表数据库访问层 @@ -11,7 +13,9 @@ * @author tjq * @since 2020/4/12 */ -public interface UserInfoRepository extends JpaRepository { +public interface UserInfoRepository extends JpaRepository, JpaSpecificationExecutor { + + Optional findByUsername(String username); List findByUsernameLike(String username); diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/UserRoleRepository.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/UserRoleRepository.java new file mode 100644 index 000000000..fb4c69cf4 --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/remote/repository/UserRoleRepository.java @@ -0,0 +1,23 @@ +package tech.powerjob.server.persistence.remote.repository; + +import org.springframework.data.jpa.repository.JpaRepository; +import tech.powerjob.server.persistence.remote.model.UserRoleDO; + +import java.util.List; + +/** + * UserRoleRepository + * + * @author tjq + * @since 2023/3/20 + */ +public interface UserRoleRepository extends JpaRepository { + + List findAllByUserId(Long userId); + + List findAllByScopeAndTarget(Integer scope, Long target); + + List findAllByScopeAndTargetAndRoleAndUserId(Integer scope, Long target, Integer role, Long userId); + + List findAllByUserIdAndScope(Long userId, Integer scope); +} diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/AbstractDFsService.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/AbstractDFsService.java index edb52a8ca..abe0f4778 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/AbstractDFsService.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/AbstractDFsService.java @@ -6,6 +6,8 @@ import org.springframework.context.ApplicationContext; import org.springframework.context.ApplicationContextAware; import org.springframework.core.env.Environment; +import tech.powerjob.server.common.aware.ServerInfoAware; +import tech.powerjob.server.common.module.ServerInfo; import tech.powerjob.server.extension.dfs.DFsService; /** @@ -15,8 +17,9 @@ * @since 2023/7/28 */ @Slf4j -public abstract class AbstractDFsService implements DFsService, ApplicationContextAware, DisposableBean { +public abstract class AbstractDFsService implements DFsService, ApplicationContextAware, ServerInfoAware, DisposableBean { + protected ServerInfo serverInfo; protected ApplicationContext applicationContext; public AbstractDFsService() { @@ -38,4 +41,9 @@ public void setApplicationContext(ApplicationContext applicationContext) throws log.info("[DFsService] invoke [{}]'s setApplicationContext", this.getClass().getName()); init(applicationContext); } + + @Override + public void setServerInfo(ServerInfo serverInfo) { + this.serverInfo = serverInfo; + } } diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/StorageConfiguration.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/StorageConfiguration.java index 890fbebae..245cdb734 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/StorageConfiguration.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/StorageConfiguration.java @@ -27,6 +27,12 @@ public DFsService initDbFs() { return new MySqlSeriesDfsService(); } + @Bean + @Conditional(PostgresqlSeriesDfsService.PostgresqlSeriesCondition.class) + public DFsService initPGDbFs() { + return new PostgresqlSeriesDfsService(); + } + @Bean @Conditional(AliOssService.AliOssCondition.class) public DFsService initAliOssFs() { diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/MinioOssService.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/MinioOssService.java index 5ee30ec23..cc14de9cf 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/MinioOssService.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/MinioOssService.java @@ -1,8 +1,13 @@ package tech.powerjob.server.persistence.storage.impl; +import com.amazonaws.auth.AWSStaticCredentialsProvider; +import com.amazonaws.auth.BasicAWSCredentials; +import com.amazonaws.client.builder.AwsClientBuilder; +import com.amazonaws.services.s3.AmazonS3; +import com.amazonaws.services.s3.AmazonS3ClientBuilder; +import com.amazonaws.services.s3.model.*; import com.google.common.collect.Lists; import com.google.common.collect.Maps; -import io.minio.*; import lombok.SneakyThrows; import lombok.extern.slf4j.Slf4j; import org.apache.commons.io.FileUtils; @@ -16,8 +21,6 @@ import tech.powerjob.server.persistence.storage.AbstractDFsService; import javax.annotation.Priority; -import java.nio.file.Files; -import java.util.Date; import java.util.List; import java.util.Map; import java.util.Optional; @@ -44,19 +47,19 @@ public class MinioOssService extends AbstractDFsService { private static final String KEY_BUCKET_NAME = "bucketName"; private static final String ACCESS_KEY = "accessKey"; private static final String SECRET_KEY = "secretKey"; - private MinioClient minioClient; + private AmazonS3 amazonS3; private String bucket; - private static final String NO_SUCH_KEY = "NoSuchKey"; + private static final String NOT_FOUNT = "404 Not Found"; @Override public void store(StoreRequest storeRequest) { try { - minioClient.uploadObject(UploadObjectArgs.builder() - .bucket(this.bucket) - .object(parseFileName(storeRequest.getFileLocation())) - .filename(storeRequest.getLocalFile().getPath()) - .contentType(Files.probeContentType(storeRequest.getLocalFile().toPath())) - .build()); + + String fileName = parseFileName(storeRequest.getFileLocation()); + // 创建 PutObjectRequest 对象 + PutObjectRequest request = new PutObjectRequest(this.bucket, fileName, storeRequest.getLocalFile()); + + amazonS3.putObject(request); } catch (Throwable t) { ExceptionUtils.rethrow(t); } @@ -66,13 +69,11 @@ public void store(StoreRequest storeRequest) { public void download(DownloadRequest downloadRequest) { try { FileUtils.forceMkdirParent(downloadRequest.getTarget()); - // 下载文件 - minioClient.downloadObject( - DownloadObjectArgs.builder() - .bucket(this.bucket) - .object(parseFileName(downloadRequest.getFileLocation())) - .filename(downloadRequest.getTarget().getAbsolutePath()) - .build()); + + String fileName = parseFileName(downloadRequest.getFileLocation()); + GetObjectRequest getObjectRequest = new GetObjectRequest(this.bucket, fileName); + amazonS3.getObject(getObjectRequest, downloadRequest.getTarget()); + } catch (Throwable t) { ExceptionUtils.rethrow(t); } @@ -86,26 +87,28 @@ public void download(DownloadRequest downloadRequest) { @Override public Optional fetchFileMeta(FileLocation fileLocation) { try { - StatObjectResponse stat = minioClient.statObject(StatObjectArgs.builder() - .bucket(this.bucket) - .object(parseFileName(fileLocation)) - .build()); - return Optional.ofNullable(stat).map(minioStat -> { + + String fileName = parseFileName(fileLocation); + ObjectMetadata objectMetadata = amazonS3.getObjectMetadata(this.bucket, fileName); + + return Optional.ofNullable(objectMetadata).map(minioStat -> { Map metaInfo = Maps.newHashMap(); - if (stat.userMetadata() != null) { - metaInfo.putAll(stat.userMetadata()); + + if (objectMetadata.getRawMetadata() != null) { + metaInfo.putAll(objectMetadata.getRawMetadata()); } return new FileMeta() - .setLastModifiedTime(Date.from(stat.lastModified().toInstant())) - .setLength(stat.size()) + .setLastModifiedTime(objectMetadata.getLastModified()) + .setLength(objectMetadata.getContentLength()) .setMetaInfo(metaInfo); }); - } catch (Exception oe) { - String errorCode = oe.getMessage(); - if (NO_SUCH_KEY.equalsIgnoreCase(errorCode)) { + } catch (AmazonS3Exception s3Exception) { + String errorCode = s3Exception.getErrorCode(); + if (NOT_FOUNT.equalsIgnoreCase(errorCode)) { return Optional.empty(); } + } catch (Exception oe) { ExceptionUtils.rethrow(oe); } return Optional.empty(); @@ -170,8 +173,18 @@ public void initOssClient(String endpoint, String bucketName, String accessKey, if (StringUtils.isEmpty(bucketName)) { throw new IllegalArgumentException("'oms.storage.dfs.minio.bucketName' can't be empty, please creat a bucket in minio oss console then config it to powerjob"); } + + // 创建凭证对象 + BasicAWSCredentials awsCreds = new BasicAWSCredentials(accessKey, secretKey); + + // 创建AmazonS3客户端并指定终端节点和凭证 + this.amazonS3 = AmazonS3ClientBuilder.standard() + // 当使用 AWS Java SDK 连接到非AWS服务(如MinIO)时,指定区域(Region)是必需的,即使这个区域对于你的MinIO实例并不真正适用。原因在于AWS SDK的客户端构建器需要一个区域来配置其服务端点,即使在连接到本地或第三方S3兼容服务时也是如此。使用 "us-east-1" 作为占位符是很常见的做法,因为它是AWS最常用的区域之一。这不会影响到实际的连接或数据传输,因为真正的服务地址是由你提供的终端节点URL决定的。如果你的代码主要是与MinIO交互,并且不涉及AWS服务,那么这个区域设置只是形式上的要求。 + .withEndpointConfiguration(new AwsClientBuilder.EndpointConfiguration(endpoint, "us-east-1")) + .withCredentials(new AWSStaticCredentialsProvider(awsCreds)) + .withPathStyleAccessEnabled(true) // 重要:启用路径样式访问 + .build(); this.bucket = bucketName; - minioClient = MinioClient.builder().endpoint(endpoint).credentials(accessKey, secretKey).build(); createBucket(bucketName); log.info("[Minio] initialize OSS successfully!"); } @@ -183,10 +196,15 @@ public void initOssClient(String endpoint, String bucketName, String accessKey, */ @SneakyThrows(Exception.class) public void createBucket(String bucketName) { - if (!bucketExists(bucketName)) { - minioClient.makeBucket(MakeBucketArgs.builder() - .bucket(bucketName).build()); + + // 建议自行创建 bucket,设置好相关的策略 + if (bucketExists(bucketName)) { + return; } + + Bucket createBucketResult = amazonS3.createBucket(bucketName); + log.info("[Minio] createBucket successfully, bucketName: {}, createResult: {}", bucketName, createBucketResult); + String policy = "{\n" + " \"Version\": \"2012-10-17\",\n" + " \"Statement\": [\n" + @@ -206,7 +224,11 @@ public void createBucket(String bucketName) { " }\n" + " ]\n" + "}"; - minioClient.setBucketPolicy(SetBucketPolicyArgs.builder().bucket(bucketName).config(policy).build()); + try { + amazonS3.setBucketPolicy(bucketName, policy); + } catch (Exception e) { + log.warn("[Minio] setBucketPolicy failed, maybe you need to setBucketPolicy by yourself!", e); + } } /** @@ -217,7 +239,8 @@ public void createBucket(String bucketName) { */ @SneakyThrows(Exception.class) public boolean bucketExists(String bucketName) { - return minioClient.bucketExists(BucketExistsArgs.builder().bucket(bucketName).build()); + + return amazonS3.doesBucketExistV2(bucketName); } public static class MinioOssCondition extends PropertyAndOneBeanCondition { diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/MySqlSeriesDfsService.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/MySqlSeriesDfsService.java index 9493f62cf..fe138ebb3 100644 --- a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/MySqlSeriesDfsService.java +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/MySqlSeriesDfsService.java @@ -17,8 +17,7 @@ import org.springframework.core.env.Environment; import tech.powerjob.common.serialize.JsonUtils; import tech.powerjob.common.utils.CommonUtils; -import tech.powerjob.common.utils.NetUtils; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.spring.condition.PropertyAndOneBeanCondition; import tech.powerjob.server.extension.dfs.*; import tech.powerjob.server.persistence.storage.AbstractDFsService; @@ -139,8 +138,9 @@ public void store(StoreRequest storeRequest) throws IOException { deleteByLocation(fileLocation); Map meta = Maps.newHashMap(); - meta.put("_server_", NetUtils.getLocalHost()); + meta.put("_server_", serverInfo.getIp()); meta.put("_local_file_path_", storeRequest.getLocalFile().getAbsolutePath()); + BufferedInputStream bufferedInputStream = new BufferedInputStream(Files.newInputStream(storeRequest.getLocalFile().toPath())); Date date = new Date(System.currentTimeMillis()); @@ -153,7 +153,7 @@ public void store(StoreRequest storeRequest) throws IOException { pst.setString(4, JsonUtils.toJSONString(meta)); pst.setLong(5, storeRequest.getLocalFile().length()); pst.setInt(6, SwitchableStatus.ENABLE.getV()); - pst.setBlob(7, new BufferedInputStream(Files.newInputStream(storeRequest.getLocalFile().toPath()))); + pst.setBlob(7, bufferedInputStream); pst.setString(8, null); pst.setDate(9, date); pst.setDate(10, date); @@ -165,6 +165,8 @@ public void store(StoreRequest storeRequest) throws IOException { } catch (Exception e) { log.error("[MySqlSeriesDfsService] store [{}] failed!", fileLocation); ExceptionUtils.rethrow(e); + }finally { + bufferedInputStream.close(); } } diff --git a/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/PostgresqlSeriesDfsService.java b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/PostgresqlSeriesDfsService.java new file mode 100644 index 000000000..d8435679c --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/main/java/tech/powerjob/server/persistence/storage/impl/PostgresqlSeriesDfsService.java @@ -0,0 +1,406 @@ +package tech.powerjob.server.persistence.storage.impl; + +import com.google.common.base.Stopwatch; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.zaxxer.hikari.HikariConfig; +import com.zaxxer.hikari.HikariDataSource; +import lombok.Data; +import lombok.experimental.Accessors; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; +import org.apache.commons.lang3.exception.ExceptionUtils; +import org.apache.commons.lang3.time.DateUtils; +import org.springframework.context.ApplicationContext; +import org.springframework.context.annotation.Conditional; +import org.springframework.core.env.Environment; +import tech.powerjob.common.enums.SwitchableStatus; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.common.utils.CommonUtils; +import tech.powerjob.server.common.spring.condition.PropertyAndOneBeanCondition; +import tech.powerjob.server.extension.dfs.*; +import tech.powerjob.server.persistence.storage.AbstractDFsService; + +import javax.annotation.Priority; +import javax.sql.DataSource; +import java.io.BufferedInputStream; +import java.io.ByteArrayOutputStream; +import java.io.FileOutputStream; +import java.io.IOException; +import java.nio.file.Files; +import java.sql.*; +import java.util.List; +import java.util.Map; +import java.util.Optional; + +/** + * postgresql 数据库存储,使用的版本是14 + * ********************* 配置项 ********************* + * oms.storage.dfs.postgresql_series.driver + * oms.storage.dfs.postgresql_series.url + * oms.storage.dfs.postgresql_series.username + * oms.storage.dfs.postgresql_series.password + * oms.storage.dfs.postgresql_series.auto_create_table + * oms.storage.dfs.postgresql_series.table_name + * + * @author jetol + * @since 2024-1-8 + */ +@Slf4j +@Priority(value = Integer.MAX_VALUE - 4) +@Conditional(PostgresqlSeriesDfsService.PostgresqlSeriesCondition.class) +public class PostgresqlSeriesDfsService extends AbstractDFsService { + + private DataSource dataSource; + + private static final String TYPE_POSTGRESQL = "postgresql_series"; + + /** + * 数据库驱动,Postgresql 为 org.postgresql.Driver + */ + private static final String KEY_DRIVER_NAME = "driver"; + /** + * 数据库地址,比如 jdbc:postgresql://localhost:3306/powerjob-daily + */ + private static final String KEY_URL = "url"; + /** + * 数据库账号,比如 root + */ + private static final String KEY_USERNAME = "username"; + /** + * 数据库密码 + */ + private static final String KEY_PASSWORD = "password"; + /** + * 是否自动建表 + */ + private static final String KEY_AUTO_CREATE_TABLE = "auto_create_table"; + /** + * 表名 + */ + private static final String KEY_TABLE_NAME = "table_name"; + + /* ********************* SQL region ********************* */ + + private static final String DEFAULT_TABLE_NAME = "powerjob_files"; + + private static final String POWERJOB_FILES_ID_SEQ = "CREATE SEQUENCE if not exists powerjob_files_id_seq\n" + + " START WITH 1\n" + + " INCREMENT BY 1\n" + + " NO MINVALUE\n" + + " NO MAXVALUE\n" + + " CACHE 1;" ; + private static final String CREATE_TABLE_SQL = "CREATE TABLE if not exists powerjob_files (\n" + + " id bigint NOT NULL DEFAULT nextval('powerjob_files_id_seq') PRIMARY KEY,\n" + + " bucket varchar(255) NOT NULL,\n" + + " name varchar(255) NOT NULL,\n" + + " version varchar(255) NOT NULL,\n" + + " meta varchar(255) NULL DEFAULT NULL,\n" + + " length bigint NOT NULL,\n" + + " status int NOT NULL,\n" + + " data bytea NOT NULL,\n" + + " extra varchar(255) NULL DEFAULT NULL,\n" + + " gmt_create timestamp without time zone NOT NULL,\n" + + " gmt_modified timestamp without time zone NULL DEFAULT NULL\n" + + ");"; + + private static final String INSERT_SQL = "insert into %s(bucket, name, version, meta, length, status, data, extra, gmt_create, gmt_modified) values (?,?,?,?,?,?,?,?,?,?);"; + + private static final String DELETE_SQL = "DELETE FROM %s "; + + private static final String QUERY_FULL_SQL = "select * from %s"; + + private static final String QUERY_META_SQL = "select bucket, name, version, meta, length, status, extra, gmt_create, gmt_modified from %s"; + + + private void deleteByLocation(FileLocation fileLocation) { + String dSQLPrefix = fullSQL(DELETE_SQL); + String dSQL = dSQLPrefix.concat(whereSQL(fileLocation)); + executeDelete(dSQL); + } + + private void executeDelete(String sql) { + try (Connection con = dataSource.getConnection()) { + con.createStatement().executeUpdate(sql); + } catch (Exception e) { + log.error("[PostgresqlSeriesDfsService] executeDelete failed, sql: {}", sql); + } + } + + @Override + public void store(StoreRequest storeRequest) throws IOException, SQLException { + + Stopwatch sw = Stopwatch.createStarted(); + String insertSQL = fullSQL(INSERT_SQL); + + FileLocation fileLocation = storeRequest.getFileLocation(); + + // 覆盖写,写之前先删除 + deleteByLocation(fileLocation); + + Map meta = Maps.newHashMap(); + meta.put("_server_", serverInfo.getIp()); + meta.put("_local_file_path_", storeRequest.getLocalFile().getAbsolutePath()); + BufferedInputStream bufferedInputStream = new BufferedInputStream(Files.newInputStream(storeRequest.getLocalFile().toPath())); + + Date date = new Date(System.currentTimeMillis()); + + Connection con =null; + PreparedStatement pst =null; + try { + con = dataSource.getConnection(); + //pg库提示报错:org.postgresql.util.PSQLException: Large Objects may not be used in auto-commit mode. + con.setAutoCommit(false); + + pst = con.prepareStatement(insertSQL); + + pst.setString(1, fileLocation.getBucket()); + pst.setString(2, fileLocation.getName()); + pst.setString(3, "mu"); + pst.setString(4, JsonUtils.toJSONString(meta)); + pst.setLong(5, storeRequest.getLocalFile().length()); + pst.setInt(6, SwitchableStatus.ENABLE.getV()); + //PreparedStatement类并没有提供setBlob方法来直接设置BYTEA类型字段,因为PostgreSQL不支持JDBC中的java.sql.Blob接口 +// pst.setBlob(7, bufferedInputStream);org.postgresql.util.PSQLException: ERROR: column "data" is of type bytea but expression is of type bigint + pst.setBytes(7, bufferedInputStreamToByteArray(bufferedInputStream)); + pst.setString(8, null); + pst.setDate(9, date); + pst.setDate(10, date); + + pst.execute(); + con.commit(); + log.info("[PostgresqlSeriesDfsService] store [{}] successfully, cost: {}", fileLocation, sw); + + } catch (Exception e) { + if(con != null){ + con.rollback(); + } + log.error("[PostgresqlSeriesDfsService] store [{}] failed!", fileLocation, e); + ExceptionUtils.rethrow(e); + }finally { + if(con != null){ + //设置回来,恢复自动提交模式 + con.setAutoCommit(true); + con.close(); + } + if(null != pst){ + pst.close(); + } + bufferedInputStream.close(); + } + } + + /** + * 上面已经有异常处理,这里直接往上抛 + * @param bis + * @return + * @throws IOException + */ + public static byte[] bufferedInputStreamToByteArray(BufferedInputStream bis) throws IOException { + ByteArrayOutputStream baos = new ByteArrayOutputStream(); + if(null == bis ){ + return null; + } + // 创建缓冲区 + byte[] buffer = new byte[1024]; + int read; + // 读取流中的数据并写入到ByteArrayOutputStream + while ((read = bis.read(buffer)) != -1) { + baos.write(buffer, 0, read); + } + // 关闭输入流 + bis.close(); + // 转换为字节数组并返回 + return baos.toByteArray(); + } + + @Override + public void download(DownloadRequest downloadRequest) throws IOException { + + Stopwatch sw = Stopwatch.createStarted(); + String querySQL = fullSQL(QUERY_FULL_SQL); + + FileLocation fileLocation = downloadRequest.getFileLocation(); + + FileUtils.forceMkdirParent(downloadRequest.getTarget()); + + try (Connection con = dataSource.getConnection()) { + + ResultSet resultSet = con.createStatement().executeQuery(querySQL.concat(whereSQL(fileLocation))); + + boolean exist = resultSet.next(); + + if (!exist) { + log.warn("[PostgresqlSeriesDfsService] download file[{}] failed due to not exits!", fileLocation); + return; + } + + // 在 PostgreSQL 中,bytea 类型的数据并不直接映射为 JDBC 的 Blob 类型。相反,bytea 数据应当被处理为字节数组 (byte[]) 而不是 Blob 对象 + try { + byte[] dataBytes = resultSet.getBytes("data"); + try (FileOutputStream fos = new FileOutputStream(downloadRequest.getTarget())) { + fos.write(dataBytes); + } + } catch (Exception ignore) { + // 测试发现会报错 报错“不良的类型值 long”;但并未有用户反馈问题,暂时保留老写法,可能是不同DB获取方式不同? + Blob dataBlob = resultSet.getBlob("data"); + FileUtils.copyInputStreamToFile(new BufferedInputStream(dataBlob.getBinaryStream()), downloadRequest.getTarget()); + } + + log.info("[PostgresqlSeriesDfsService] download [{}] successfully, cost: {}", fileLocation, sw); + + } catch (Exception e) { + log.error("[PostgresqlSeriesDfsService] download file [{}] failed!", fileLocation, e); + ExceptionUtils.rethrow(e); + } + + } + + @Override + public Optional fetchFileMeta(FileLocation fileLocation) { + + String querySQL = fullSQL(QUERY_META_SQL); + + try (Connection con = dataSource.getConnection()) { + + ResultSet resultSet = con.createStatement().executeQuery(querySQL.concat(whereSQL(fileLocation))); + + boolean exist = resultSet.next(); + + if (!exist) { + return Optional.empty(); + } + + FileMeta fileMeta = new FileMeta() + .setLength(resultSet.getLong("length")) + .setLastModifiedTime(resultSet.getDate("gmt_modified")) + .setMetaInfo(JsonUtils.parseMap(resultSet.getString("meta"))); + return Optional.of(fileMeta); + + } catch (Exception e) { + log.error("[PostgresqlSeriesDfsService] fetchFileMeta [{}] failed!", fileLocation); + ExceptionUtils.rethrow(e); + } + + return Optional.empty(); + } + + @Override + public void cleanExpiredFiles(String bucket, int days) { + + // 虽然官方提供了服务端删除的能力,依然强烈建议用户直接在数据库层面配置清理事件!!! + + String dSQLPrefix = fullSQL(DELETE_SQL); + final long targetTs = DateUtils.addDays(new Date(System.currentTimeMillis()), -days).getTime(); + final String targetDeleteTime = CommonUtils.formatTime(targetTs); + log.info("[PostgresqlSeriesDfsService] start to cleanExpiredFiles, targetDeleteTime: {}", targetDeleteTime); + String fSQL = dSQLPrefix.concat(String.format(" where gmt_modified < '%s'", targetDeleteTime)); + log.info("[PostgresqlSeriesDfsService] cleanExpiredFiles SQL: {}", fSQL); + executeDelete(fSQL); + } + + @Override + protected void init(ApplicationContext applicationContext) { + + Environment env = applicationContext.getEnvironment(); + + PostgresqlProperty postgresqlProperty = new PostgresqlProperty() + .setDriver(fetchProperty(env, TYPE_POSTGRESQL, KEY_DRIVER_NAME)) + .setUrl(fetchProperty(env, TYPE_POSTGRESQL, KEY_URL)) + .setUsername(fetchProperty(env, TYPE_POSTGRESQL, KEY_USERNAME)) + .setPassword(fetchProperty(env, TYPE_POSTGRESQL, KEY_PASSWORD)) + .setAutoCreateTable(Boolean.TRUE.toString().equalsIgnoreCase(fetchProperty(env, TYPE_POSTGRESQL, KEY_AUTO_CREATE_TABLE))) + ; + + try { + initDatabase(postgresqlProperty); + initTable(postgresqlProperty); + } catch (Exception e) { + log.error("[PostgresqlSeriesDfsService] init datasource failed!", e); + ExceptionUtils.rethrow(e); + } + + log.info("[PostgresqlSeriesDfsService] initialize successfully, THIS_WILL_BE_THE_STORAGE_LAYER."); + } + + void initDatabase(PostgresqlProperty property) { + + log.info("[PostgresqlSeriesDfsService] init datasource by config: {}", property); + + HikariConfig config = new HikariConfig(); + + config.setDriverClassName(StringUtils.isEmpty(property.driver) ? "org.postgresql.Driver" : property.driver); + config.setJdbcUrl(property.url); + config.setUsername(property.username); + config.setPassword(property.password); + + config.setAutoCommit(true); + // 池中最小空闲连接数量 + config.setMinimumIdle(2); + // 池中最大连接数量 + config.setMaximumPoolSize(32); + + dataSource = new HikariDataSource(config); + } + + void initTable(PostgresqlProperty property) throws Exception { + + if (property.autoCreateTable) { + + String powerjobFilesIdSeq = fullSQL(POWERJOB_FILES_ID_SEQ); + String createTableSQL = fullSQL(CREATE_TABLE_SQL); + + log.info("[PostgresqlSeriesDfsService] use create table SQL: {}", createTableSQL); + try (Connection connection = dataSource.getConnection()) { + connection.createStatement().execute(powerjobFilesIdSeq); + connection.createStatement().execute(createTableSQL); + log.info("[PostgresqlSeriesDfsService] auto create table successfully!"); + } + } + } + + private String fullSQL(String sql) { + return String.format(sql, parseTableName()); + } + + private String parseTableName() { + // 误删,兼容本地 unit test + if (applicationContext == null) { + return DEFAULT_TABLE_NAME; + } + String tableName = fetchProperty(applicationContext.getEnvironment(), TYPE_POSTGRESQL, KEY_TABLE_NAME); + return StringUtils.isEmpty(tableName) ? DEFAULT_TABLE_NAME : tableName; + } + + private static String whereSQL(FileLocation fileLocation) { + return String.format(" where bucket='%s' AND name='%s' ", fileLocation.getBucket(), fileLocation.getName()); + } + + @Override + public void destroy() throws Exception { + } + + @Data + @Accessors(chain = true) + static class PostgresqlProperty { + private String driver; + private String url; + private String username; + private String password; + + private boolean autoCreateTable; + } + + public static class PostgresqlSeriesCondition extends PropertyAndOneBeanCondition { + @Override + protected List anyConfigKey() { + return Lists.newArrayList("oms.storage.dfs.postgresql_series.url"); + } + + @Override + protected Class beanType() { + return DFsService.class; + } + } +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-persistence/src/test/java/tech/powerjob/server/persistence/storage/impl/AliOssServiceTest.java b/powerjob-server/powerjob-server-persistence/src/test/java/tech/powerjob/server/persistence/storage/impl/AliOssServiceTest.java index 941677313..86ae4cd51 100644 --- a/powerjob-server/powerjob-server-persistence/src/test/java/tech/powerjob/server/persistence/storage/impl/AliOssServiceTest.java +++ b/powerjob-server/powerjob-server-persistence/src/test/java/tech/powerjob/server/persistence/storage/impl/AliOssServiceTest.java @@ -1,8 +1,8 @@ package tech.powerjob.server.persistence.storage.impl; import com.aliyun.oss.common.utils.AuthUtils; -import com.aliyun.oss.common.utils.StringUtils; import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.exception.ExceptionUtils; import tech.powerjob.server.extension.dfs.DFsService; @@ -33,7 +33,7 @@ protected Optional fetchService() { log.info("[AliOssServiceTest] ak: {}, sk: {}", accessKeyId, secretAccessKey); - if (org.apache.commons.lang3.StringUtils.isAnyEmpty(accessKeyId, secretAccessKey)) { + if (StringUtils.isAnyEmpty(accessKeyId, secretAccessKey)) { return Optional.empty(); } diff --git a/powerjob-server/powerjob-server-persistence/src/test/java/tech/powerjob/server/persistence/storage/impl/MinioOssServiceTest.java b/powerjob-server/powerjob-server-persistence/src/test/java/tech/powerjob/server/persistence/storage/impl/MinioOssServiceTest.java new file mode 100644 index 000000000..0ed5bf4b9 --- /dev/null +++ b/powerjob-server/powerjob-server-persistence/src/test/java/tech/powerjob/server/persistence/storage/impl/MinioOssServiceTest.java @@ -0,0 +1,30 @@ +package tech.powerjob.server.persistence.storage.impl; + +import lombok.extern.slf4j.Slf4j; +import tech.powerjob.server.extension.dfs.DFsService; + +import java.util.Optional; + +/** + * MinioOssServiceTest + * 测试需要先本地部署 minio,因此捕获异常,失败也不阻断测试 + * + * @author tjq + * @since 2024/2/26 + */ +@Slf4j +class MinioOssServiceTest extends AbstractDfsServiceTest { + + @Override + protected Optional fetchService() { + try { + MinioOssService aliOssService = new MinioOssService(); + aliOssService.initOssClient("http://192.168.124.23:9000", "pj2","testAk", "testSktestSktestSk"); + return Optional.of(aliOssService); + } catch (Exception e) { + // 仅异常提醒 + log.error("[MinioOssServiceTest] test exception!", e); + } + return Optional.empty(); + } +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-remote/pom.xml b/powerjob-server/powerjob-server-remote/pom.xml index fd9c141e9..c1d7b6e33 100644 --- a/powerjob-server/powerjob-server-remote/pom.xml +++ b/powerjob-server/powerjob-server-remote/pom.xml @@ -5,7 +5,7 @@ powerjob-server tech.powerjob - 4.3.6 + 5.1.2 ../pom.xml 4.0.0 diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/election/ServerElectionService.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/election/ServerElectionService.java index e6febdfe0..d7ece94df 100644 --- a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/election/ServerElectionService.java +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/election/ServerElectionService.java @@ -6,7 +6,6 @@ import org.apache.commons.lang3.StringUtils; import org.springframework.beans.factory.annotation.Value; import org.springframework.stereotype.Service; -import tech.powerjob.common.enums.Protocol; import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.request.ServerDiscoveryRequest; import tech.powerjob.common.response.AskResponse; @@ -16,8 +15,8 @@ import tech.powerjob.server.persistence.remote.model.AppInfoDO; import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; import tech.powerjob.server.remote.transporter.ProtocolInfo; -import tech.powerjob.server.remote.transporter.impl.ServerURLFactory; import tech.powerjob.server.remote.transporter.TransportService; +import tech.powerjob.server.remote.transporter.impl.ServerURLFactory; import java.util.Date; import java.util.Optional; @@ -150,7 +149,7 @@ private String activeAddress(String serverAddress, Set downServerCache, URL targetUrl = ServerURLFactory.ping2Friend(serverAddress); try { - AskResponse response = transportService.ask(Protocol.HTTP.name(), targetUrl, ping, AskResponse.class) + AskResponse response = transportService.ask(transportService.defaultProtocol().getProtocol(), targetUrl, ping, AskResponse.class) .toCompletableFuture() .get(PING_TIMEOUT_MS, TimeUnit.MILLISECONDS); if (response.isSuccess()) { diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/redirector/DesignateServerAspect.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/redirector/DesignateServerAspect.java index ad906487d..b25635198 100644 --- a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/redirector/DesignateServerAspect.java +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/redirector/DesignateServerAspect.java @@ -14,14 +14,13 @@ import org.springframework.core.annotation.Order; import org.springframework.stereotype.Component; import tech.powerjob.common.RemoteConstant; -import tech.powerjob.common.enums.Protocol; import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.response.AskResponse; import tech.powerjob.remote.framework.base.URL; import tech.powerjob.server.persistence.remote.model.AppInfoDO; import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; -import tech.powerjob.server.remote.transporter.impl.ServerURLFactory; import tech.powerjob.server.remote.transporter.TransportService; +import tech.powerjob.server.remote.transporter.impl.ServerURLFactory; import java.lang.reflect.Method; import java.lang.reflect.ParameterizedType; @@ -100,7 +99,7 @@ public Object execute(ProceedingJoinPoint point, DesignateServer designateServer final URL friendUrl = ServerURLFactory.process2Friend(targetServer); - CompletionStage askCS = transportService.ask(Protocol.HTTP.name(), friendUrl, remoteProcessReq, AskResponse.class); + CompletionStage askCS = transportService.ask(transportService.defaultProtocol().getProtocol(), friendUrl, remoteProcessReq, AskResponse.class); AskResponse askResponse = askCS.toCompletableFuture().get(RemoteConstant.DEFAULT_TIMEOUT_MS, TimeUnit.MILLISECONDS); if (!askResponse.isSuccess()) { diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/self/ServerInfoService.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/self/ServerInfoService.java index 5c799a7a2..1e119ec6c 100644 --- a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/self/ServerInfoService.java +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/self/ServerInfoService.java @@ -14,6 +14,13 @@ public interface ServerInfoService { * fetch current server info * @return ServerInfo */ - ServerInfo fetchServiceInfo(); + ServerInfo fetchCurrentServerInfo(); + + /** + * fetch schedule server info + * @param appId appId + * @return ServerInfo + */ + ServerInfo fetchAppServerInfo(Long appId); } diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/self/ServerInfoServiceImpl.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/self/ServerInfoServiceImpl.java index 8a205e499..21af89c8c 100644 --- a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/self/ServerInfoServiceImpl.java +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/server/self/ServerInfoServiceImpl.java @@ -15,6 +15,7 @@ import tech.powerjob.server.extension.LockService; import tech.powerjob.server.persistence.remote.model.ServerInfoDO; import tech.powerjob.server.persistence.remote.repository.ServerInfoRepository; +import tech.powerjob.server.remote.server.redirector.DesignateServer; import java.util.Date; import java.util.List; @@ -138,7 +139,13 @@ public void setBuildProperties(BuildProperties buildProperties) { } @Override - public ServerInfo fetchServiceInfo() { + public ServerInfo fetchCurrentServerInfo() { + return serverInfo; + } + + @Override + @DesignateServer + public ServerInfo fetchAppServerInfo(Long appId) { return serverInfo; } } diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/transporter/impl/PowerTransportService.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/transporter/impl/PowerTransportService.java index 331a83ad8..537488621 100644 --- a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/transporter/impl/PowerTransportService.java +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/transporter/impl/PowerTransportService.java @@ -104,23 +104,35 @@ private void initRemoteFrameWork(String protocol, int port) { // 从构造器注入改为从 applicationContext 获取来避免循环依赖 final Map beansWithAnnotation = applicationContext.getBeansWithAnnotation(Actor.class); - log.info("[PowerTransportService] find Actor num={},names={}", beansWithAnnotation.size(), beansWithAnnotation.keySet()); + log.info("[PowerTransportService] [{}] find Actor num={},names={}", protocol, beansWithAnnotation.size(), beansWithAnnotation.keySet()); Address address = new Address() .setHost(NetUtils.getLocalHost()) .setPort(port); + + ProtocolInfo protocolInfo = new ProtocolInfo(protocol, address.getHost(), address.getPort(), null); + EngineConfig engineConfig = new EngineConfig() .setServerType(ServerType.SERVER) .setType(protocol.toUpperCase()) .setBindAddress(address) .setActorList(Lists.newArrayList(beansWithAnnotation.values())); - log.info("[PowerTransportService] start to initialize RemoteEngine[type={},address={}]", protocol, address); + + if (!StringUtils.equalsIgnoreCase(protocolInfo.getExternalAddress(), protocolInfo.getAddress())) { + Address externalAddress = Address.fromIpv4(protocolInfo.getExternalAddress()); + engineConfig.setExternalAddress(externalAddress); + log.info("[PowerTransportService] [{}] exist externalAddress: {}", protocol, externalAddress); + } + + log.info("[PowerTransportService] [{}] start to initialize RemoteEngine[address={}]", protocol, address); RemoteEngine re = new PowerJobRemoteEngine(); final EngineOutput engineOutput = re.start(engineConfig); - log.info("[PowerTransportService] start RemoteEngine[type={},address={}] successfully", protocol, address); + log.info("[PowerTransportService] [{}] start RemoteEngine[address={}] successfully", protocol, address); this.engines.add(re); - this.protocolName2Info.put(protocol, new ProtocolInfo(protocol, address.getHost(), address.getPort(), engineOutput.getTransporter())); + + protocolInfo.setTransporter(engineOutput.getTransporter()); + this.protocolName2Info.put(protocol, protocolInfo); } @Override diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/ClusterStatusHolder.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/ClusterStatusHolder.java index 98b9293d2..ba136f70d 100644 --- a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/ClusterStatusHolder.java +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/ClusterStatusHolder.java @@ -55,8 +55,8 @@ public void updateStatus(WorkerHeartbeat heartbeat) { wf.refresh(heartbeat); return wf; }); - long oldTime = workerInfo.getLastActiveTime(); - if (heartbeatTime < oldTime) { + long oldHeartbeatTime = workerInfo.getLastActiveWorkerTime(); + if (heartbeatTime < oldHeartbeatTime) { log.warn("[ClusterStatusHolder-{}] receive the expired heartbeat from {}, serverTime: {}, heartTime: {}", appName, heartbeat.getWorkerAddress(), System.currentTimeMillis(), heartbeat.getHeartbeatTime()); return; } diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/WorkerClusterQueryService.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/WorkerClusterQueryService.java index 3b44c4cf9..9364a5a11 100644 --- a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/WorkerClusterQueryService.java +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/WorkerClusterQueryService.java @@ -3,12 +3,11 @@ import com.google.common.collect.Lists; import lombok.extern.slf4j.Slf4j; import org.springframework.stereotype.Service; -import tech.powerjob.common.enums.DispatchStrategy; import tech.powerjob.common.model.DeployedContainerInfo; import tech.powerjob.server.common.module.WorkerInfo; -import tech.powerjob.server.remote.worker.filter.WorkerFilter; import tech.powerjob.server.persistence.remote.model.JobInfoDO; import tech.powerjob.server.remote.server.redirector.DesignateServer; +import tech.powerjob.server.remote.worker.filter.WorkerFilter; import java.util.Collections; import java.util.List; @@ -37,24 +36,13 @@ public WorkerClusterQueryService(List workerFilters) { * @param jobInfo job * @return worker cluster info, sorted by metrics desc */ - public List getSuitableWorkers(JobInfoDO jobInfo) { + public List geAvailableWorkers(JobInfoDO jobInfo) { List workers = Lists.newLinkedList(getWorkerInfosByAppId(jobInfo.getAppId()).values()); + // 过滤不符合要求的机器 workers.removeIf(workerInfo -> filterWorker(workerInfo, jobInfo)); - DispatchStrategy dispatchStrategy = DispatchStrategy.of(jobInfo.getDispatchStrategy()); - switch (dispatchStrategy) { - case RANDOM: - Collections.shuffle(workers); - break; - case HEALTH_FIRST: - workers.sort((o1, o2) -> o2.getSystemMetrics().calculateScore() - o1.getSystemMetrics().calculateScore()); - break; - default: - // do nothing - } - // 限定集群大小(0代表不限制) if (!workers.isEmpty() && jobInfo.getMaxWorkerCount() > 0 && workers.size() > jobInfo.getMaxWorkerCount()) { workers = workers.subList(0, jobInfo.getMaxWorkerCount()); diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/filter/DisconnectedWorkerFilter.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/filter/DisconnectedWorkerFilter.java index 5cdfb9a85..5c056c254 100644 --- a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/filter/DisconnectedWorkerFilter.java +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/filter/DisconnectedWorkerFilter.java @@ -19,7 +19,7 @@ public class DisconnectedWorkerFilter implements WorkerFilter { public boolean filter(WorkerInfo workerInfo, JobInfoDO jobInfo) { boolean timeout = workerInfo.timeout(); if (timeout) { - log.info("[Job-{}] filter worker[{}] due to timeout(lastActiveTime={})", jobInfo.getId(), workerInfo.getAddress(), workerInfo.getLastActiveTime()); + log.info("[Job-{}] filter worker[{}] due to timeout(lastActiveTime={},lastActiveTimeWorkerTime={})", jobInfo.getId(), workerInfo.getAddress(), workerInfo.getLastActiveTime(), workerInfo.getLastActiveWorkerTime()); } return timeout; } diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/TaskTrackerSelector.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/TaskTrackerSelector.java new file mode 100644 index 000000000..b32612347 --- /dev/null +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/TaskTrackerSelector.java @@ -0,0 +1,32 @@ +package tech.powerjob.server.remote.worker.selector; + +import tech.powerjob.common.enums.DispatchStrategy; +import tech.powerjob.server.common.module.WorkerInfo; +import tech.powerjob.server.persistence.remote.model.InstanceInfoDO; +import tech.powerjob.server.persistence.remote.model.JobInfoDO; + +import java.util.List; + +/** + * 主节点选择方式 + * + * @author tjq + * @since 2024/2/24 + */ +public interface TaskTrackerSelector { + + /** + * 支持的策略 + * @return 派发策略 + */ + DispatchStrategy strategy(); + + /** + * 选择主节点 + * @param jobInfoDO 任务信息 + * @param instanceInfoDO 任务实例 + * @param availableWorkers 可用 workers + * @return 主节点 worker + */ + WorkerInfo select(JobInfoDO jobInfoDO, InstanceInfoDO instanceInfoDO, List availableWorkers); +} diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/TaskTrackerSelectorService.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/TaskTrackerSelectorService.java new file mode 100644 index 000000000..85951a277 --- /dev/null +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/TaskTrackerSelectorService.java @@ -0,0 +1,33 @@ +package tech.powerjob.server.remote.worker.selector; + +import com.google.common.collect.Maps; +import org.springframework.beans.factory.annotation.Autowired; +import org.springframework.stereotype.Service; +import tech.powerjob.server.common.module.WorkerInfo; +import tech.powerjob.server.persistence.remote.model.InstanceInfoDO; +import tech.powerjob.server.persistence.remote.model.JobInfoDO; + +import java.util.List; +import java.util.Map; + +/** + * TaskTrackerSelectorService + * + * @author tjq + * @since 2024/2/24 + */ +@Service +public class TaskTrackerSelectorService { + + private final Map taskTrackerSelectorMap = Maps.newHashMap(); + + @Autowired + public TaskTrackerSelectorService(List taskTrackerSelectors) { + taskTrackerSelectors.forEach(ts -> taskTrackerSelectorMap.put(ts.strategy().getV(), ts)); + } + + public WorkerInfo select(JobInfoDO jobInfoDO, InstanceInfoDO instanceInfoDO, List availableWorkers) { + TaskTrackerSelector taskTrackerSelector = taskTrackerSelectorMap.get(jobInfoDO.getDispatchStrategy()); + return taskTrackerSelector.select(jobInfoDO, instanceInfoDO, availableWorkers); + } +} diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/HealthFirstTaskTrackerSelector.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/HealthFirstTaskTrackerSelector.java new file mode 100644 index 000000000..b562e40a0 --- /dev/null +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/HealthFirstTaskTrackerSelector.java @@ -0,0 +1,33 @@ +package tech.powerjob.server.remote.worker.selector.impl; + +import com.google.common.collect.Lists; +import org.springframework.stereotype.Component; +import tech.powerjob.common.enums.DispatchStrategy; +import tech.powerjob.server.common.module.WorkerInfo; +import tech.powerjob.server.persistence.remote.model.InstanceInfoDO; +import tech.powerjob.server.persistence.remote.model.JobInfoDO; +import tech.powerjob.server.remote.worker.selector.TaskTrackerSelector; + +import java.util.List; + +/** + * HealthFirst + * + * @author (疑似)新冠帕鲁 + * @since 2024/2/24 + */ +@Component +public class HealthFirstTaskTrackerSelector implements TaskTrackerSelector { + + @Override + public DispatchStrategy strategy() { + return DispatchStrategy.HEALTH_FIRST; + } + + @Override + public WorkerInfo select(JobInfoDO jobInfoDO, InstanceInfoDO instanceInfoDO, List availableWorkers) { + List workers = Lists.newArrayList(availableWorkers); + workers.sort((o1, o2) -> o2.getSystemMetrics().calculateScore() - o1.getSystemMetrics().calculateScore()); + return workers.get(0); + } +} diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/RandomTaskTrackerSelector.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/RandomTaskTrackerSelector.java new file mode 100644 index 000000000..97de378d7 --- /dev/null +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/RandomTaskTrackerSelector.java @@ -0,0 +1,32 @@ +package tech.powerjob.server.remote.worker.selector.impl; + +import org.springframework.stereotype.Component; +import tech.powerjob.common.enums.DispatchStrategy; +import tech.powerjob.server.common.module.WorkerInfo; +import tech.powerjob.server.persistence.remote.model.InstanceInfoDO; +import tech.powerjob.server.persistence.remote.model.JobInfoDO; +import tech.powerjob.server.remote.worker.selector.TaskTrackerSelector; + +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; + +/** + * RANDOM + * + * @author (疑似)新冠帕鲁 + * @since 2024/2/24 + */ +@Component +public class RandomTaskTrackerSelector implements TaskTrackerSelector { + + @Override + public DispatchStrategy strategy() { + return DispatchStrategy.RANDOM; + } + + @Override + public WorkerInfo select(JobInfoDO jobInfoDO, InstanceInfoDO instanceInfoDO, List availableWorkers) { + int randomIdx = ThreadLocalRandom.current().nextInt(availableWorkers.size()); + return availableWorkers.get(randomIdx); + } +} diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/SpecifyTaskTrackerSelector.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/SpecifyTaskTrackerSelector.java new file mode 100644 index 000000000..cbad5331b --- /dev/null +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/selector/impl/SpecifyTaskTrackerSelector.java @@ -0,0 +1,59 @@ +package tech.powerjob.server.remote.worker.selector.impl; + +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Component; +import tech.powerjob.common.enums.DispatchStrategy; +import tech.powerjob.common.utils.CollectionUtils; +import tech.powerjob.server.common.module.WorkerInfo; +import tech.powerjob.server.persistence.remote.model.InstanceInfoDO; +import tech.powerjob.server.persistence.remote.model.JobInfoDO; +import tech.powerjob.server.remote.worker.selector.TaskTrackerSelector; +import tech.powerjob.server.remote.worker.utils.SpecifyUtils; + +import java.util.List; +import java.util.concurrent.ThreadLocalRandom; + +/** + * 指定工作的主节点,大规模运算需要隔离主节点,以防止 worker 部署打断整体的任务执行 + * + * @author tjq + * @since 2024/2/24 + */ +@Slf4j +@Component +public class SpecifyTaskTrackerSelector implements TaskTrackerSelector { + @Override + public DispatchStrategy strategy() { + return DispatchStrategy.SPECIFY; + } + + @Override + public WorkerInfo select(JobInfoDO jobInfoDO, InstanceInfoDO instanceInfoDO, List availableWorkers) { + + String dispatchStrategyConfig = jobInfoDO.getDispatchStrategyConfig(); + + // 降级到随机 + if (StringUtils.isEmpty(dispatchStrategyConfig)) { + log.warn("[SpecifyTaskTrackerSelector] job[id={}]'s dispatchStrategyConfig is empty, use random as bottom DispatchStrategy!", jobInfoDO.getId()); + return availableWorkers.get(ThreadLocalRandom.current().nextInt(availableWorkers.size())); + } + + List targetWorkers = Lists.newArrayList(); + availableWorkers.forEach(aw -> { + boolean match = SpecifyUtils.match(aw, dispatchStrategyConfig); + if (match) { + targetWorkers.add(aw); + } + }); + + if (CollectionUtils.isEmpty(targetWorkers)) { + log.warn("[SpecifyTaskTrackerSelector] Unable to find available nodes based on conditions for job(id={},dispatchStrategyConfig={}), use random as bottom DispatchStrategy!", jobInfoDO.getId(), dispatchStrategyConfig); + return availableWorkers.get(ThreadLocalRandom.current().nextInt(availableWorkers.size())); + } + + // 如果有多个 worker 符合条件,最终还是随机选择出一个 + return targetWorkers.get(ThreadLocalRandom.current().nextInt(targetWorkers.size())); + } +} diff --git a/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/utils/SpecifyUtils.java b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/utils/SpecifyUtils.java new file mode 100644 index 000000000..ac85b903f --- /dev/null +++ b/powerjob-server/powerjob-server-remote/src/main/java/tech/powerjob/server/remote/worker/utils/SpecifyUtils.java @@ -0,0 +1,51 @@ +package tech.powerjob.server.remote.worker.utils; + +import com.google.common.collect.Sets; +import org.apache.commons.lang3.StringUtils; +import tech.powerjob.server.common.SJ; +import tech.powerjob.server.common.module.WorkerInfo; + +import java.util.Optional; +import java.util.Set; + +/** + * 指定工具 + * + * @author tjq + * @since 2024/2/24 + */ +public class SpecifyUtils { + + private static final String TAG_EQUALS = "tagEquals:"; + + private static final String TAG_IN = "tagIn:"; + + public static boolean match(WorkerInfo workerInfo, String specifyInfo) { + + String workerTag = workerInfo.getTag(); + + // tagIn 语法,worker 可上报多个tag,如 WorkerInfo#tag=tag1,tag2,tag3,配置中指定 tagIn=tag1 即可命中 + if (specifyInfo.startsWith(TAG_IN)) { + String targetTag = specifyInfo.replace(TAG_IN, StringUtils.EMPTY); + return Optional.ofNullable(workerTag).orElse(StringUtils.EMPTY).contains(targetTag); + } + + // tagEquals 语法,字符串完全匹配,worker 只可上报一个 tag,如 WorkerInfo#tag=tag1,配置中指定 tagEquals=tag1 即可命中 + if (specifyInfo.startsWith(TAG_EQUALS)) { + String targetTag = specifyInfo.replace(TAG_EQUALS, StringUtils.EMPTY); + return Optional.ofNullable(workerTag).orElse(StringUtils.EMPTY).equals(targetTag); + } + + // 默认情况,IP 和 tag 逗号分割后任意完全匹配即视为命中(兼容 4.3.8 版本前序逻辑) + Set designatedWorkersSet = Sets.newHashSet(SJ.COMMA_SPLITTER.splitToList(specifyInfo)); + + for (String tagOrAddress : designatedWorkersSet) { + if (tagOrAddress.equals(workerInfo.getTag()) || tagOrAddress.equals(workerInfo.getAddress())) { + return true; + } + } + + return false; + } + +} diff --git a/powerjob-server/powerjob-server-remote/src/test/java/tech/powerjob/server/remote/worker/utils/SpecifyUtilsTest.java b/powerjob-server/powerjob-server-remote/src/test/java/tech/powerjob/server/remote/worker/utils/SpecifyUtilsTest.java new file mode 100644 index 000000000..740ad6b56 --- /dev/null +++ b/powerjob-server/powerjob-server-remote/src/test/java/tech/powerjob/server/remote/worker/utils/SpecifyUtilsTest.java @@ -0,0 +1,45 @@ +package tech.powerjob.server.remote.worker.utils; + +import org.junit.jupiter.api.Test; +import tech.powerjob.server.common.module.WorkerInfo; + +import static org.junit.jupiter.api.Assertions.*; + +/** + * SpecifyUtilsTest + * + * @author tjq + * @since 2024/2/24 + */ +class SpecifyUtilsTest { + + @Test + void match() { + + WorkerInfo workerInfo = new WorkerInfo(); + workerInfo.setAddress("192.168.1.1"); + workerInfo.setTag("tag1"); + + assert SpecifyUtils.match(workerInfo, "192.168.1.1"); + assert SpecifyUtils.match(workerInfo, "192.168.1.1,192.168.1.2,192.168.1.3,192.168.1.4"); + + assert !SpecifyUtils.match(workerInfo, "172.168.1.1"); + assert !SpecifyUtils.match(workerInfo, "172.168.1.1,172.168.1.2,172.168.1.3"); + + assert SpecifyUtils.match(workerInfo, "tag1"); + assert SpecifyUtils.match(workerInfo, "tag1,tag2"); + assert !SpecifyUtils.match(workerInfo, "t1"); + assert !SpecifyUtils.match(workerInfo, "t1,t2"); + + assert SpecifyUtils.match(workerInfo, "tagIn:tag1"); + assert !SpecifyUtils.match(workerInfo, "tagIn:tag2"); + + assert SpecifyUtils.match(workerInfo, "tagEquals:tag1"); + assert !SpecifyUtils.match(workerInfo, "tagEquals:tag2"); + + workerInfo.setTag("tag1,tag2,tag3"); + assert SpecifyUtils.match(workerInfo, "tagIn:tag1"); + assert SpecifyUtils.match(workerInfo, "tagIn:tag3"); + assert !SpecifyUtils.match(workerInfo, "tagIn:tag99"); + } +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-starter/pom.xml b/powerjob-server/powerjob-server-starter/pom.xml index df747a3de..4a5ae65a6 100644 --- a/powerjob-server/powerjob-server-starter/pom.xml +++ b/powerjob-server/powerjob-server-starter/pom.xml @@ -5,7 +5,7 @@ powerjob-server tech.powerjob - 4.3.6 + 5.1.2 ../pom.xml 4.0.0 @@ -43,10 +43,19 @@ tech.powerjob powerjob-server-core + + tech.powerjob + powerjob-server-auth + tech.powerjob powerjob-server-migrate + + + tech.powerjob + powerjob-client + diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/ModifyOrCreateDynamicPermission.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/ModifyOrCreateDynamicPermission.java new file mode 100644 index 000000000..44962eaa9 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/ModifyOrCreateDynamicPermission.java @@ -0,0 +1,46 @@ +package tech.powerjob.server.auth.plugin; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.util.StreamUtils; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.interceptor.DynamicPermissionPlugin; + +import javax.servlet.http.HttpServletRequest; +import java.util.Map; + +/** + * 针对 namespace 和 app 两大鉴权纬度,创建不需要任何权限,但任何修改操作都需要 WRITE 权限 + * 创建不需要权限,修改需要校验权限 + * + * @author tjq + * @since 2023/9/3 + */ +@Slf4j +public class ModifyOrCreateDynamicPermission implements DynamicPermissionPlugin { + @Override + public Permission calculate(HttpServletRequest request, Object handler) { + + try { + //获取请求body + byte[] bodyBytes = StreamUtils.copyToByteArray(request.getInputStream()); + String body = new String(bodyBytes, request.getCharacterEncoding()); + + Map inputParams = JsonUtils.parseMap(body); + + Object id = inputParams.get("id"); + + // 创建,不需要权限 + if (id == null) { + return Permission.NONE; + } + + return Permission.WRITE; + } catch (Exception e) { + log.error("[ModifyOrCreateDynamicPermission] check permission failed, please fix the bug!!!", e); + } + + // 异常情况先放行,不影响功能使用,后续修复 BUG + return Permission.NONE; + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveAppGrantPermissionPlugin.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveAppGrantPermissionPlugin.java new file mode 100644 index 000000000..4bffe6fde --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveAppGrantPermissionPlugin.java @@ -0,0 +1,16 @@ +package tech.powerjob.server.auth.plugin; + +import tech.powerjob.server.auth.RoleScope; + +/** + * desc + * + * @author tjq + * @since 2024/2/11 + */ +public class SaveAppGrantPermissionPlugin extends SaveGrantPermissionPlugin { + @Override + protected RoleScope fetchRuleScope() { + return RoleScope.APP; + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveGrantPermissionPlugin.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveGrantPermissionPlugin.java new file mode 100644 index 000000000..aa0e45d1c --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveGrantPermissionPlugin.java @@ -0,0 +1,99 @@ +package tech.powerjob.server.auth.plugin; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.server.auth.LoginUserHolder; +import tech.powerjob.server.auth.PowerJobUser; +import tech.powerjob.server.auth.Role; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.interceptor.GrantPermissionPlugin; +import tech.powerjob.server.auth.service.permission.PowerJobPermissionService; +import tech.powerjob.server.common.utils.SpringUtils; + +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.lang.reflect.Method; +import java.util.Collections; +import java.util.List; +import java.util.Map; + +/** + * WEB 类保存&修改一体型请求-授权插件 + * + * @author tjq + * @since 2024/2/11 + */ +@Slf4j +public abstract class SaveGrantPermissionPlugin implements GrantPermissionPlugin { + + private static final String KEY_ID = "id"; + + @Override + public void grant(Object[] args, Object result, Method method, Object originBean) { + + List bizArgs = filterInputArgs(args); + if (bizArgs.size() != 1) { + throw new IllegalArgumentException("[GrantPermission] args not match(!=1), maybe there has some bug!size=" + bizArgs.size()); + } + + // 理论上不可能,前置已完成判断 + PowerJobUser powerJobUser = LoginUserHolder.get(); + if (powerJobUser == null) { + throw new IllegalArgumentException("[GrantPermission] user not login, can't grant permission"); + } + + // 解析ID,非空代表更新,不授权 + Map saveRequest = JsonUtils.parseMap(JsonUtils.toJSONString(args[0])); + Long id = MapUtils.getLong(saveRequest, KEY_ID); + if (id != null) { + return; + } + + if (!(result instanceof ResultDTO)) { + throw new IllegalArgumentException("[GrantPermission] result not instanceof ResultDTO, maybe there has some bug"); + } + + ResultDTO resultDTO = (ResultDTO) result; + + if (!resultDTO.isSuccess()) { + log.warn("[GrantPermission] result not success, skip grant permission!"); + return; + } + + Map saveResult = JsonUtils.parseMap(JsonUtils.toJSONString(resultDTO.getData())); + Long savedId = MapUtils.getLong(saveResult, KEY_ID); + if (savedId == null) { + throw new IllegalArgumentException("[GrantPermission] result success but id not exits, maybe there has some bug, please fix it!!!"); + } + + PowerJobPermissionService powerJobPermissionService = SpringUtils.getBean(PowerJobPermissionService.class); + + Map extra = Maps.newHashMap(); + extra.put("source", "SaveGrantPermissionPlugin"); + + powerJobPermissionService.grantRole(fetchRuleScope(), savedId, powerJobUser.getId(), Role.ADMIN, JsonUtils.toJSONString(extra)); + } + + protected abstract RoleScope fetchRuleScope(); + + private static List filterInputArgs(Object[] args) { + if (args == null) { + return Collections.emptyList(); + } + List ret = Lists.newArrayList(); + for (Object arg : args) { + if (arg instanceof HttpServletRequest) { + continue; + } + if (arg instanceof HttpServletResponse) { + continue; + } + ret.add(arg); + } + return ret; + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveNamespaceGrantPermissionPlugin.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveNamespaceGrantPermissionPlugin.java new file mode 100644 index 000000000..955ded5a3 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/plugin/SaveNamespaceGrantPermissionPlugin.java @@ -0,0 +1,16 @@ +package tech.powerjob.server.auth.plugin; + +import tech.powerjob.server.auth.RoleScope; + +/** + * namespace 授权插件 + * + * @author tjq + * @since 2024/2/11 + */ +public class SaveNamespaceGrantPermissionPlugin extends SaveGrantPermissionPlugin { + @Override + protected RoleScope fetchRuleScope() { + return RoleScope.NAMESPACE; + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/service/WebAuthService.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/service/WebAuthService.java new file mode 100644 index 000000000..c0a1bb08c --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/service/WebAuthService.java @@ -0,0 +1,62 @@ +package tech.powerjob.server.auth.service; + +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.Role; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.web.request.ComponentUserRoleInfo; + +import java.util.List; +import java.util.Map; + +/** + * Web Auth 服务 + * 写在 starter 包下,抽取 controller 的公共逻辑 + * (powerjob 的 service/core 包核心处理调度核心逻辑,admin 部分代码收口在 stater 包) + * + * @author tjq + * @since 2024/2/12 + */ +public interface WebAuthService { + + /** + * 对当前登录用户授予角色 + * @param roleScope 角色范围 + * @param target 目标 + * @param role 角色 + * @param extra 其他信息 + */ + void grantRole2LoginUser(RoleScope roleScope, Long target, Role role, String extra); + + /** + * 处理授权 + * @param roleScope 权限范围 + * @param target 权限目标 + * @param componentUserRoleInfo 人员角色信息 + */ + void processPermissionOnSave(RoleScope roleScope, Long target, ComponentUserRoleInfo componentUserRoleInfo); + + /** + * 获取目标相关权限人员列表 + * @param roleScope 权限范围 + * @param target 权限目标 + * @return ComponentUserRoleInfo + */ + ComponentUserRoleInfo fetchComponentUserRoleInfo(RoleScope roleScope, Long target); + + /** + * 判断当前用户是否有权限 + * @param roleScope 权限范围 + * @param target 权限目标 + * @param permission 要求的权限 + * @return 是否有权限 + */ + boolean hasPermission(RoleScope roleScope, Long target, Permission permission); + + /** + * 是否为全局管理员 + * @return true or false + */ + boolean isGlobalAdmin(); + + Map> fetchMyPermissionTargets(RoleScope roleScope); +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/service/impl/WebAuthServiceImpl.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/service/impl/WebAuthServiceImpl.java new file mode 100644 index 000000000..42f6def90 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/auth/service/impl/WebAuthServiceImpl.java @@ -0,0 +1,121 @@ +package tech.powerjob.server.auth.service.impl; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import lombok.extern.slf4j.Slf4j; +import org.springframework.stereotype.Service; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.server.auth.*; +import tech.powerjob.server.auth.common.AuthConstants; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.server.auth.common.PowerJobAuthException; +import tech.powerjob.server.auth.service.WebAuthService; +import tech.powerjob.server.auth.service.permission.PowerJobPermissionService; +import tech.powerjob.server.web.request.ComponentUserRoleInfo; + +import javax.annotation.Resource; +import java.util.*; + +/** + * WebAuthService + * + * @author tjq + * @since 2024/2/12 + */ +@Slf4j +@Service +public class WebAuthServiceImpl implements WebAuthService { + + @Resource + private PowerJobPermissionService powerJobPermissionService; + + + @Override + public void grantRole2LoginUser(RoleScope roleScope, Long target, Role role, String extra) { + Long userId = LoginUserHolder.getUserId(); + if (userId == null) { + throw new PowerJobAuthException(ErrorCodes.USER_NOT_LOGIN); + } + powerJobPermissionService.grantRole(roleScope, target, userId, role, extra); + } + + @Override + public void processPermissionOnSave(RoleScope roleScope, Long target, ComponentUserRoleInfo o) { + ComponentUserRoleInfo componentUserRoleInfo = Optional.ofNullable(o).orElse(new ComponentUserRoleInfo()); + + Map> role2Uids = powerJobPermissionService.fetchUserWithPermissions(roleScope, target); + diffGrant(roleScope, target, Role.OBSERVER, componentUserRoleInfo.getObserver(), role2Uids); + diffGrant(roleScope, target, Role.QA, componentUserRoleInfo.getQa(), role2Uids); + diffGrant(roleScope, target, Role.DEVELOPER, componentUserRoleInfo.getDeveloper(), role2Uids); + diffGrant(roleScope, target, Role.ADMIN, componentUserRoleInfo.getAdmin(), role2Uids); + } + + @Override + public ComponentUserRoleInfo fetchComponentUserRoleInfo(RoleScope roleScope, Long target) { + Map> role2Uids = powerJobPermissionService.fetchUserWithPermissions(roleScope, target); + return new ComponentUserRoleInfo() + .setObserver(Lists.newArrayList(role2Uids.getOrDefault(Role.OBSERVER, Collections.emptySet()))) + .setQa(Lists.newArrayList(role2Uids.getOrDefault(Role.QA, Collections.emptySet()))) + .setDeveloper(Lists.newArrayList(role2Uids.getOrDefault(Role.DEVELOPER, Collections.emptySet()))) + .setAdmin(Lists.newArrayList(role2Uids.getOrDefault(Role.ADMIN, Collections.emptySet()))); + } + + @Override + public boolean hasPermission(RoleScope roleScope, Long target, Permission permission) { + + PowerJobUser powerJobUser = LoginUserHolder.get(); + if (powerJobUser == null) { + return false; + } + + return powerJobPermissionService.hasPermission(powerJobUser.getId(), roleScope, target, permission); + } + + @Override + public boolean isGlobalAdmin() { + return hasPermission(RoleScope.GLOBAL, AuthConstants.GLOBAL_ADMIN_TARGET_ID, Permission.SU); + } + + @Override + public Map> fetchMyPermissionTargets(RoleScope roleScope) { + + PowerJobUser powerJobUser = LoginUserHolder.get(); + if (powerJobUser == null) { + throw new PowerJobAuthException(ErrorCodes.USER_NOT_LOGIN); + } + + // 展示不考虑穿透权限的问题(即拥有 namespace 权限也可以看到全部的 apps) + return powerJobPermissionService.fetchUserHadPermissionTargets(roleScope, powerJobUser.getId()); + } + + private void diffGrant(RoleScope roleScope, Long target, Role role, List uids, Map> originRole2Uids) { + + Set originUids = Sets.newHashSet(Optional.ofNullable(originRole2Uids.get(role)).orElse(Collections.emptySet())); + Set currentUids = Sets.newHashSet(Optional.ofNullable(uids).orElse(Collections.emptyList())); + + Map extraInfo = Maps.newHashMap(); + extraInfo.put("grantor", LoginUserHolder.getUserName()); + extraInfo.put("source", "diffGrant"); + String extra = JsonUtils.toJSONString(extraInfo); + + Set allIds = Sets.newHashSet(originUids); + allIds.addAll(currentUids); + + Set allIds2 = Sets.newHashSet(allIds); + + // 在 originUids 不在 currentUids,需要取消授权 + allIds.removeAll(currentUids); + allIds.forEach(cancelPermissionUid -> { + powerJobPermissionService.retrieveRole(roleScope, target, cancelPermissionUid, role); + log.info("[WebAuthService] [diffGrant] cancelPermission: roleScope={},target={},uid={},role={}", roleScope, target, cancelPermissionUid, role); + }); + + // 在 currentUids 当不在 orignUids,需要增加授权 + allIds2.removeAll(originUids); + allIds2.forEach(addPermissionUid -> { + powerJobPermissionService.grantRole(roleScope, target, addPermissionUid, role, extra); + log.info("[WebAuthService] [diffGrant] grantPermission: roleScope={},target={},uid={},role={},extra={}", roleScope, target, addPermissionUid, role, extra); + }); + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/CachingRequestBodyFilter.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/CachingRequestBodyFilter.java new file mode 100644 index 000000000..ec471f7a9 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/CachingRequestBodyFilter.java @@ -0,0 +1,119 @@ +package tech.powerjob.server.config; + +import com.google.common.collect.Sets; +import org.springframework.stereotype.Component; + +import javax.servlet.*; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletRequestWrapper; +import java.io.*; +import java.util.Set; + +/** + * 解决 HttpServletRequest 只能被读取一次的问题,方便全局日志 & 鉴权,切面提前读取数据 + * 在请求进入Servlet容器之前,先经过Filter的过滤器链。在请求进入Controller之前,先经过 HandlerInterceptor 的拦截器链。Filter 一定先于 HandlerInterceptor 执行 + * 解决HttpServletRequest 流数据不可重复读 + * + * @author tjq + * @since 2024/2/11 + */ +@Component +public class CachingRequestBodyFilter implements Filter { + + + /** + * 忽略部分不需要处理的类型: + * GET 请求的数据一般是 Query String,直接在 url 的后面,不需要特殊处理 + * multipart/form-data:doDispatch() 阶段就会进行处理,此处已经空值了,强行处理会导致结果空 + * application/x-www-form-urlencoded:估计也类似,有特殊逻辑,导致 OpenAPI 部分请求参数无法传递,同样忽略 + */ + private static final Set IGNORE_CONTENT_TYPES = Sets.newHashSet("application/x-www-form-urlencoded", "multipart/form-data"); + + private static final Set IGNORE_URIS = Sets.newHashSet("/container/jarUpload"); + + @Override + public void doFilter(ServletRequest request, ServletResponse response, FilterChain chain) + throws IOException, ServletException { + if (request instanceof HttpServletRequest) { + String uri = ((HttpServletRequest) request).getRequestURI(); + // 忽略 jar 上传等处理路径 + if (IGNORE_URIS.contains(uri)) { + chain.doFilter(request, response); + return; + } + String contentType = request.getContentType(); + if (contentType != null && !IGNORE_CONTENT_TYPES.contains(contentType)) { + CustomHttpServletRequestWrapper wrappedRequest = new CustomHttpServletRequestWrapper((HttpServletRequest) request); + chain.doFilter(wrappedRequest, response); + return; + } + } + chain.doFilter(request, response); + } + + // Implement other required methods like init() and destroy() if necessary + + + public static class CustomHttpServletRequestWrapper extends HttpServletRequestWrapper { + + private final String body; + + public CustomHttpServletRequestWrapper(HttpServletRequest request) throws IOException { + super(request); + StringBuilder stringBuilder = new StringBuilder(); + BufferedReader bufferedReader = null; + try { + InputStream inputStream = request.getInputStream(); + if (inputStream != null) { + bufferedReader = new BufferedReader(new InputStreamReader(inputStream)); + char[] charBuffer = new char[128]; + int bytesRead = -1; + while ((bytesRead = bufferedReader.read(charBuffer)) > 0) { + stringBuilder.append(charBuffer, 0, bytesRead); + } + } + } finally { + if (bufferedReader != null) { + bufferedReader.close(); + } + } + body = stringBuilder.toString(); + } + + @Override + public ServletInputStream getInputStream() throws IOException { + final ByteArrayInputStream byteArrayInputStream = new ByteArrayInputStream(body.getBytes()); + + return new ServletInputStream() { + public int read() throws IOException { + return byteArrayInputStream.read(); + } + + @Override + public boolean isFinished() { + return byteArrayInputStream.available() == 0; + } + + @Override + public boolean isReady() { + return true; + } + + @Override + public void setReadListener(ReadListener readListener) { + throw new UnsupportedOperationException("Not implemented"); + } + }; + } + + @Override + public BufferedReader getReader() throws IOException { + return new BufferedReader(new InputStreamReader(this.getInputStream())); + } + + public String getBody() { + return this.body; + } + } + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/SwaggerConfig.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/SwaggerConfig.java index 5f4467e10..44c117269 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/SwaggerConfig.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/SwaggerConfig.java @@ -41,7 +41,7 @@ public OpenAPI springShopOpenAPI() { return new OpenAPI() .info(new Info().title("PowerJob") .description("Distributed scheduling and computing framework.") - .version(serverInfoService.fetchServiceInfo().getVersion()) + .version(serverInfoService.fetchCurrentServerInfo().getVersion()) .contact(contact) .license(new License().name("Apache License 2.0").url("https://github.com/PowerJob/PowerJob/blob/master/LICENSE"))); } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/ThreadPoolConfig.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/ThreadPoolConfig.java index bd77d50c0..32e629461 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/ThreadPoolConfig.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/ThreadPoolConfig.java @@ -9,6 +9,7 @@ import org.springframework.scheduling.annotation.EnableAsync; import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor; import org.springframework.scheduling.concurrent.ThreadPoolTaskScheduler; +import tech.powerjob.common.utils.SysUtils; import tech.powerjob.server.common.RejectedExecutionHandlerFactory; import tech.powerjob.server.common.constants.PJThreadPool; import tech.powerjob.server.common.thread.NewThreadRunRejectedExecutionHandler; @@ -27,8 +28,8 @@ public class ThreadPoolConfig { @Bean(PJThreadPool.TIMING_POOL) public TaskExecutor getTimingPool() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(Runtime.getRuntime().availableProcessors()); - executor.setMaxPoolSize(Runtime.getRuntime().availableProcessors() * 4); + executor.setCorePoolSize(SysUtils.availableProcessors()); + executor.setMaxPoolSize(SysUtils.availableProcessors() * 4); // use SynchronousQueue executor.setQueueCapacity(0); executor.setKeepAliveSeconds(60); @@ -40,8 +41,8 @@ public TaskExecutor getTimingPool() { @Bean(PJThreadPool.BACKGROUND_POOL) public AsyncTaskExecutor initBackgroundPool() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - executor.setCorePoolSize(Runtime.getRuntime().availableProcessors() * 8); - executor.setMaxPoolSize(Runtime.getRuntime().availableProcessors() * 16); + executor.setCorePoolSize(SysUtils.availableProcessors() * 8); + executor.setMaxPoolSize(SysUtils.availableProcessors() * 16); executor.setQueueCapacity(8192); executor.setKeepAliveSeconds(60); executor.setThreadNamePrefix("PJ-BG-"); @@ -52,7 +53,7 @@ public AsyncTaskExecutor initBackgroundPool() { @Bean(PJThreadPool.LOCAL_DB_POOL) public TaskExecutor initOmsLocalDbPool() { ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor(); - int tSize = Math.max(1, Runtime.getRuntime().availableProcessors() / 2); + int tSize = Math.max(1, SysUtils.availableProcessors() / 2); executor.setCorePoolSize(tSize); executor.setMaxPoolSize(tSize); executor.setQueueCapacity(2048); @@ -67,7 +68,7 @@ public TaskExecutor initOmsLocalDbPool() { @Bean public TaskScheduler taskScheduler() { ThreadPoolTaskScheduler scheduler = new ThreadPoolTaskScheduler(); - scheduler.setPoolSize(Math.max(Runtime.getRuntime().availableProcessors() * 8, 32)); + scheduler.setPoolSize(Math.max(SysUtils.availableProcessors() * 8, 32)); scheduler.setThreadNamePrefix("PJ-DEFAULT-"); scheduler.setDaemon(true); return scheduler; diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/WebConfig.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/WebConfig.java index c1e819ad8..b16f20173 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/WebConfig.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/config/WebConfig.java @@ -3,9 +3,15 @@ import org.springframework.context.annotation.Bean; import org.springframework.context.annotation.Configuration; import org.springframework.web.servlet.config.annotation.CorsRegistry; +import org.springframework.web.servlet.config.annotation.InterceptorRegistry; import org.springframework.web.servlet.config.annotation.WebMvcConfigurer; import org.springframework.web.socket.config.annotation.EnableWebSocket; import org.springframework.web.socket.server.standard.ServerEndpointExporter; +import tech.powerjob.common.OpenAPIConstant; +import tech.powerjob.server.auth.interceptor.PowerJobAuthInterceptor; +import tech.powerjob.server.openapi.OpenApiInterceptor; + +import javax.annotation.Resource; /** * CORS @@ -16,6 +22,12 @@ @Configuration @EnableWebSocket public class WebConfig implements WebMvcConfigurer { + + @Resource + private OpenApiInterceptor openApiInterceptor; + @Resource + private PowerJobAuthInterceptor powerJobAuthInterceptor; + @Override public void addCorsMappings(CorsRegistry registry) { registry.addMapping("/**") @@ -26,4 +38,23 @@ public void addCorsMappings(CorsRegistry registry) { public ServerEndpointExporter serverEndpointExporter() { return new ServerEndpointExporter(); } + + @Override + public void addInterceptors(InterceptorRegistry registry) { + /* + 可以添加多个拦截器 + addPathPatterns("/**") 表示对所有请求都拦截 + .excludePathPatterns("/base/index") 表示排除对/base/index请求的拦截 + 多个拦截器可以设置order顺序,值越小,preHandle越先执行,postHandle和afterCompletion越后执行 + order默认的值是0,如果只添加一个拦截器,可以不显示设置order的值 + */ + registry.addInterceptor(powerJobAuthInterceptor) + .addPathPatterns("/**") + .excludePathPatterns("/css/**", "/js/**", "/images/**", "/img/**", "/fonts/**", "/favicon.ico") + .order(0); + + registry.addInterceptor(openApiInterceptor) + .addPathPatterns(OpenAPIConstant.WEB_PATH.concat("/**")) + .order(1); + } } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/NewSystemInitializer.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/NewSystemInitializer.java new file mode 100644 index 000000000..d30827b8a --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/NewSystemInitializer.java @@ -0,0 +1,97 @@ +package tech.powerjob.server.initializer; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.boot.CommandLineRunner; +import org.springframework.stereotype.Component; +import tech.powerjob.common.utils.CommonUtils; +import tech.powerjob.server.extension.LockService; +import tech.powerjob.server.persistence.remote.model.SundryDO; +import tech.powerjob.server.persistence.remote.repository.SundryRepository; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.Optional; +import java.util.function.Consumer; + +/** + * 新系统初始化器 + * + * @author tjq + * @since 2023/9/5 + */ +@Slf4j +@Component +public class NewSystemInitializer implements CommandLineRunner { + + + private static final String LOCK_PREFIX = "sys_init_lock_"; + + private static final int MAX_LOCK_TIME = 5000; + + + @Resource + private LockService lockService; + @Resource + private SundryRepository sundryRepository; + @Resource + private SystemInitializeService systemInitializeService; + + private static final String SUNDRY_PKEY = "sys_initialize"; + + @Override + public void run(String... args) throws Exception { + clusterInit(SystemInitializeService.GOAL_INIT_LOCK, V -> { + clusterInit(SystemInitializeService.GOAL_INIT_ADMIN, Void -> systemInitializeService.initAdmin()); + clusterInit(SystemInitializeService.GOAL_INIT_NAMESPACE, Void -> systemInitializeService.initNamespace()); + clusterInit(SystemInitializeService.GOAL_INIT_TEST_ENV, Void -> systemInitializeService.initTrialEnv()); + }); + } + + private void clusterInit(String name, Consumer initFunc) { + + Optional sundryOpt = sundryRepository.findByPkeyAndSkey(SUNDRY_PKEY, name); + if (sundryOpt.isPresent()) { + log.info("[NewSystemInitializer] already initialized, skip: {}", name); + return; + } + + String lockName = LOCK_PREFIX.concat(name); + + while (true) { + try { + + boolean lockStatus = lockService.tryLock(lockName, MAX_LOCK_TIME); + + // 无论是否拿到锁,都重现检测一次,如果已完成初始化,则直接 return + Optional sundryOpt2 = sundryRepository.findByPkeyAndSkey(SUNDRY_PKEY, name); + if (sundryOpt2.isPresent()) { + log.info("[NewSystemInitializer] other server finished initialize, skip process: {}", name); + break; + } + + if (!lockStatus) { + CommonUtils.easySleep(277); + continue; + } + + log.info("[NewSystemInitializer] try to initialize: {}", name); + initFunc.accept(null); + log.info("[NewSystemInitializer] initialize [{}] successfully!", name); + + // 写入初始化成功标记 + SundryDO sundryDO = new SundryDO(); + sundryDO.setPkey(SUNDRY_PKEY); + sundryDO.setSkey(name); + sundryDO.setContent("A"); + sundryDO.setGmtCreate(new Date()); + sundryRepository.saveAndFlush(sundryDO); + log.info("[NewSystemInitializer] write initialized tag successfully: {}", sundryDO); + + break; + } finally { + lockService.unlock(lockName); + } + } + + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/SystemInitializeService.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/SystemInitializeService.java new file mode 100644 index 000000000..bd86fd43d --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/SystemInitializeService.java @@ -0,0 +1,30 @@ +package tech.powerjob.server.initializer; + +/** + * 系统初始化服务 + * + * @author tjq + * @since 2024/2/15 + */ +public interface SystemInitializeService { + + String GOAL_INIT_LOCK = "goal_init_system"; + String GOAL_INIT_ADMIN = "goal_init_admin"; + String GOAL_INIT_NAMESPACE = "goal_init_namespace"; + String GOAL_INIT_TEST_ENV = "goal_init_test_env"; + + /** + * 初始化超级管理员 + */ + void initAdmin(); + + /** + * 初始化 namespace + */ + void initNamespace(); + + /** + * 初始化试用环境 + */ + void initTrialEnv(); +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/SystemInitializeServiceImpl.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/SystemInitializeServiceImpl.java new file mode 100644 index 000000000..ce53497e3 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/initializer/SystemInitializeServiceImpl.java @@ -0,0 +1,202 @@ +package tech.powerjob.server.initializer; + +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.RandomStringUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.stereotype.Service; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.common.utils.SysUtils; +import tech.powerjob.server.auth.PowerJobUser; +import tech.powerjob.server.auth.Role; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.AuthConstants; +import tech.powerjob.server.auth.service.login.LoginRequest; +import tech.powerjob.server.auth.service.login.PowerJobLoginService; +import tech.powerjob.server.auth.service.permission.PowerJobPermissionService; +import tech.powerjob.server.common.constants.ExtensionKey; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import tech.powerjob.server.persistence.remote.model.NamespaceDO; +import tech.powerjob.server.persistence.remote.model.PwjbUserInfoDO; +import tech.powerjob.server.web.AppWebService; +import tech.powerjob.server.web.request.ComponentUserRoleInfo; +import tech.powerjob.server.web.request.ModifyAppInfoRequest; +import tech.powerjob.server.web.request.ModifyNamespaceRequest; +import tech.powerjob.server.web.request.ModifyUserInfoRequest; +import tech.powerjob.server.web.service.NamespaceWebService; +import tech.powerjob.server.web.service.PwjbUserWebService; + +import javax.annotation.Resource; +import javax.transaction.Transactional; +import java.util.List; +import java.util.Map; +import java.util.Optional; +import java.util.stream.Collectors; + +/** + * 初始化 PowerJob 首次部署相关的内容 + * 为了可维护性足够高,统一使用 WEB 请求进行初始化,不直接操作底层,防止后续内部逻辑变更后出现问题 + * + * @author tjq + * @since 2024/2/15 + */ +@Slf4j +@Service +public class SystemInitializeServiceImpl implements SystemInitializeService { + + @Value("${oms.auth.initiliaze.admin.password:#{null}}") + private String defaultAdminPassword; + @Resource + private AppWebService appWebService; + @Resource + private PwjbUserWebService pwjbUserWebService; + @Resource + private NamespaceWebService namespaceWebService; + @Resource + private PowerJobLoginService powerJobLoginService; + @Resource + private PowerJobPermissionService powerJobPermissionService; + + private static final String SYSTEM_ADMIN_NAME = "ADMIN"; + + private static final String SYSTEM_DEFAULT_NAMESPACE = "default_namespace"; + + private static final String TRIAL_ENV_ACCOUNT_AND_PWD = "powerjob"; + + private static final String TEST_APP_NAME = "powerjob-worker-samples"; + private static final String TEST_APP_PWD = "powerjob123"; + + @Override + @Transactional(rollbackOn = Exception.class) + public void initAdmin() { + + String username = SYSTEM_ADMIN_NAME; + String password = StringUtils.isEmpty(defaultAdminPassword) ? RandomStringUtils.randomAlphabetic(8) : defaultAdminPassword; + + // 创建用户 + PowerJobUser powerJobUser = createUser(username, password, true); + + // STEP3: 授予全局管理员权限 + powerJobPermissionService.grantRole(RoleScope.GLOBAL, AuthConstants.GLOBAL_ADMIN_TARGET_ID, powerJobUser.getId(), Role.ADMIN, null); + log.info("[SystemInitializeService] GRANT ADMIN to user[{}] successfully!", powerJobUser); + + // 循环10遍,强提醒用户,第一次使用必须更改 admin 密码 + for (int i = 0; i < 10; i++) { + log.warn("[SystemInitializeService] The system has automatically created a super administrator account[username={},password={}], please log in and change the password immediately!", username, password); + } + } + + @Override + @Transactional(rollbackOn = Exception.class) + public void initNamespace() { + Optional namespaceDOOptional = namespaceWebService.findByCode(SYSTEM_DEFAULT_NAMESPACE); + if (namespaceDOOptional.isPresent()) { + log.info("[SystemInitializeService] namespace[{}] already exist", SYSTEM_DEFAULT_NAMESPACE); + return; + } + + ModifyNamespaceRequest saveNamespaceReq = new ModifyNamespaceRequest(); + saveNamespaceReq.setName(SYSTEM_DEFAULT_NAMESPACE); + saveNamespaceReq.setCode(SYSTEM_DEFAULT_NAMESPACE); + + log.info("[SystemInitializeService] create default namespace by request: {}", saveNamespaceReq); + NamespaceDO savedNamespaceDO = namespaceWebService.save(saveNamespaceReq); + log.info("[SystemInitializeService] create default namespace successfully: {}", savedNamespaceDO); + } + + @Override + @Transactional(rollbackOn = Exception.class) + public void initTrialEnv() { + boolean trialEnv = SysUtils.isTrialEnv(); + if (!trialEnv) { + return; + } + log.warn("[SystemInitializeService] [trialEnv] Detect trialEnv and start initializing the trial environment"); + + // 初始化测试账号 + List testAccounts = Lists.newArrayList(TRIAL_ENV_ACCOUNT_AND_PWD); + + List testUsers = testAccounts.stream().map(un -> createUser(un, TRIAL_ENV_ACCOUNT_AND_PWD, false)).collect(Collectors.toList()); + List testUserIds = testUsers.stream().map(PowerJobUser::getId).collect(Collectors.toList()); + + log.info("[SystemInitializeService] [TestEnv] test user: {}", testUsers); + + AppInfoDO testApp = createApp(TEST_APP_NAME, TEST_APP_PWD, SYSTEM_DEFAULT_NAMESPACE, testUserIds); + log.info("[SystemInitializeService] [TestEnv] test app: {}", testApp); + } + private PowerJobUser createUser(String username, String password, boolean allowedChangePwd) { + // STEP1: 创建 PWJB 用户 + + Optional pwjbUserOpt = pwjbUserWebService.findByUsername(username); + PwjbUserInfoDO savedPwjbUser = pwjbUserOpt.orElseGet(() -> { + ModifyUserInfoRequest createUser = new ModifyUserInfoRequest(); + createUser.setUsername(username); + createUser.setNick(username); + createUser.setPassword(password); + + if (!allowedChangePwd) { + Map extra = Maps.newHashMap(); + extra.put(ExtensionKey.PwjbUser.allowedChangePwd, false); + createUser.setExtra(JsonUtils.toJSONString(extra)); + } + + log.info("[SystemInitializeService] [username:{}] create PWJB user by request: {}", username, createUser); + PwjbUserInfoDO nPwjbUser = pwjbUserWebService.save(createUser); + log.info("[SystemInitializeService] [username:{}] create PWJB user successfully: {}", username, nPwjbUser); + return nPwjbUser; + }); + log.info("[SystemInitializeService] [username:{}] => PwjbUser: {}", username, savedPwjbUser); + + // STEP2: 创建 USER 对象 + Map params = Maps.newHashMap(); + params.put(AuthConstants.PARAM_KEY_USERNAME, username); + params.put(AuthConstants.PARAM_KEY_PASSWORD, password); + + LoginRequest loginRequest = new LoginRequest() + .setLoginType(AuthConstants.ACCOUNT_TYPE_POWER_JOB) + .setOriginParams(JsonUtils.toJSONString(params)); + log.info("[SystemInitializeService] [username:{}] create PowerJobUser by request: {}", username, loginRequest); + PowerJobUser powerJobUser = powerJobLoginService.doLogin(loginRequest); + log.info("[SystemInitializeService] [username:{}] create PowerJobUser successfully: {}", username, powerJobUser); + return powerJobUser; + } + + private AppInfoDO createApp(String appName, String password, String namespaceCode, List developers) { + + ModifyAppInfoRequest modifyAppInfoRequest = new ModifyAppInfoRequest(); + + // 应用已存在则转为更新模式 + Optional oldAppOpt = appWebService.findByAppName(appName); + oldAppOpt.ifPresent(appInfoDO -> { + BeanUtils.copyProperties(appInfoDO, modifyAppInfoRequest); + modifyAppInfoRequest.setId(appInfoDO.getId()); + }); + + modifyAppInfoRequest.setAppName(appName); + modifyAppInfoRequest.setTitle(appName); + + modifyAppInfoRequest.setPassword(password); + modifyAppInfoRequest.setNamespaceCode(namespaceCode); + + modifyAppInfoRequest.setTags("test_app"); + + // 禁用靠密码成为管理员 + Map extra = Maps.newHashMap(); + extra.put(ExtensionKey.App.allowedBecomeAdminByPassword, false); + modifyAppInfoRequest.setExtra(JsonUtils.toJSONString(extra)); + + ComponentUserRoleInfo componentUserRoleInfo = new ComponentUserRoleInfo(); + modifyAppInfoRequest.setComponentUserRoleInfo(componentUserRoleInfo); + + componentUserRoleInfo.setDeveloper(developers); + + log.info("[SystemInitializeService] [app:{}] create App by request: {}", appName, modifyAppInfoRequest); + AppInfoDO appInfoDO = appWebService.save(modifyAppInfoRequest); + log.info("[SystemInitializeService] [app:{}] create App successfully: {}", appName, appInfoDO); + + return appInfoDO; + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/OpenAPIController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/OpenAPIController.java similarity index 82% rename from powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/OpenAPIController.java rename to powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/OpenAPIController.java index 33e76f7c7..e0938df53 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/OpenAPIController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/OpenAPIController.java @@ -1,24 +1,29 @@ -package tech.powerjob.server.web.controller; +package tech.powerjob.server.openapi; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.exception.ExceptionUtils; import org.springframework.web.bind.annotation.*; +import tech.powerjob.client.module.AppAuthRequest; +import tech.powerjob.client.module.AppAuthResult; import tech.powerjob.common.OpenAPIConstant; -import tech.powerjob.common.PowerQuery; +import tech.powerjob.common.enums.ErrorCodes; import tech.powerjob.common.enums.InstanceStatus; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.request.http.RunJobRequest; import tech.powerjob.common.request.http.SaveJobInfoRequest; import tech.powerjob.common.request.http.SaveWorkflowNodeRequest; import tech.powerjob.common.request.http.SaveWorkflowRequest; +import tech.powerjob.common.request.query.InstancePageQuery; import tech.powerjob.common.request.query.JobInfoQuery; -import tech.powerjob.common.response.InstanceInfoDTO; -import tech.powerjob.common.response.JobInfoDTO; -import tech.powerjob.common.response.ResultDTO; -import tech.powerjob.common.response.WorkflowInstanceInfoDTO; +import tech.powerjob.common.response.*; import tech.powerjob.server.core.instance.InstanceService; import tech.powerjob.server.core.service.AppInfoService; import tech.powerjob.server.core.service.CacheService; import tech.powerjob.server.core.service.JobService; import tech.powerjob.server.core.workflow.WorkflowInstanceService; import tech.powerjob.server.core.workflow.WorkflowService; +import tech.powerjob.server.openapi.security.OpenApiSecurityService; import tech.powerjob.server.persistence.remote.model.WorkflowInfoDO; import tech.powerjob.server.persistence.remote.model.WorkflowNodeInfoDO; import tech.powerjob.server.web.response.WorkflowInfoVO; @@ -31,6 +36,7 @@ * @author tjq * @since 2020/4/15 */ +@Slf4j @RestController @RequestMapping(OpenAPIConstant.WEB_PATH) @RequiredArgsConstructor @@ -46,12 +52,37 @@ public class OpenAPIController { private final WorkflowInstanceService workflowInstanceService; + private final OpenApiSecurityService openApiSecurityService; + private final CacheService cacheService; @PostMapping(OpenAPIConstant.ASSERT) public ResultDTO assertAppName(String appName, @RequestParam(required = false) String password) { - return ResultDTO.success(appInfoService.assertApp(appName, password)); + return ResultDTO.success(appInfoService.assertApp(appName, password, null)); + } + + /** + * APP 鉴权 + * @param appAuthRequest 鉴权请求 + * @return 鉴权响应 + */ + @PostMapping(OpenAPIConstant.AUTH_APP) + public PowerResultDTO auth(@RequestBody AppAuthRequest appAuthRequest) { + try { + return PowerResultDTO.s(openApiSecurityService.authAppByParam(appAuthRequest)); + } catch (PowerJobException pje) { + PowerResultDTO f = PowerResultDTO.f(pje.getMessage()); + f.setCode(pje.getCode()); + return f; + } catch (Throwable t) { + + log.error("[OpenAPIController] auth failed for request: {}", appAuthRequest, t); + + PowerResultDTO f = PowerResultDTO.f(ExceptionUtils.getMessage(t)); + f.setCode(ErrorCodes.SYSTEM_UNKNOWN_ERROR.getCode()); + return f; + } } /* ************* Job 区 ************* */ @@ -114,8 +145,14 @@ public ResultDTO enableJob(Long jobId, Long appId) { @PostMapping(OpenAPIConstant.RUN_JOB) public ResultDTO runJob(Long appId, Long jobId, @RequestParam(required = false) String instanceParams, @RequestParam(required = false) Long delay) { - checkJobIdValid(jobId, appId); - return ResultDTO.success(jobService.runJob(appId, jobId, instanceParams, delay)); + RunJobRequest request = new RunJobRequest().setAppId(appId).setJobId(jobId).setInstanceParams(instanceParams).setDelay(delay); + return runJob2(request); + } + + @PostMapping(OpenAPIConstant.RUN_JOB2) + public PowerResultDTO runJob2(@RequestBody RunJobRequest runJobRequest) { + checkJobIdValid(runJobRequest.getJobId(), runJobRequest.getAppId()); + return PowerResultDTO.s(jobService.runJob(runJobRequest.getAppId(), runJobRequest)); } /* ************* Instance 区 ************* */ @@ -153,7 +190,7 @@ public ResultDTO fetchInstanceInfo(Long instanceId) { } @PostMapping(OpenAPIConstant.QUERY_INSTANCE) - public ResultDTO> queryInstance(@RequestBody PowerQuery powerQuery) { + public ResultDTO> queryInstance(@RequestBody InstancePageQuery powerQuery) { return ResultDTO.success(instanceService.queryInstanceInfo(powerQuery)); } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/OpenApiInterceptor.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/OpenApiInterceptor.java new file mode 100644 index 000000000..23d37d8a6 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/OpenApiInterceptor.java @@ -0,0 +1,92 @@ +package tech.powerjob.server.openapi; + +import com.google.common.collect.Sets; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.factory.annotation.Value; +import org.springframework.lang.NonNull; +import org.springframework.stereotype.Component; +import org.springframework.web.servlet.HandlerInterceptor; +import tech.powerjob.common.OmsConstant; +import tech.powerjob.common.OpenAPIConstant; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.response.PowerResultDTO; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.server.openapi.security.OpenApiSecurityService; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.io.PrintWriter; +import java.util.Set; + +/** + * OpenAPI 拦截器 + * + * @author 程序帕鲁 + * @since 2024/2/19 + */ +@Slf4j +@Component +public class OpenApiInterceptor implements HandlerInterceptor { + + @Resource + private OpenApiSecurityService openApiSecurityService; + + /** + * 4.x 及前序版本的 OpenAPI 均为携带 auth 的必要参数,直接开启鉴权功能会导致之前的服务全部报错 + * 因此提供功能开关给到使用者,若无安全影响,可展示关闭鉴权功能,等 client 升级完毕后再打开鉴权 + */ + @Value("${oms.auth.openapi.enable:false}") + private boolean enableOpenApiAuth; + + private static final Set IGNORE_OPEN_API_PATH = Sets.newHashSet(OpenAPIConstant.ASSERT, OpenAPIConstant.AUTH_APP); + + @Override + public boolean preHandle(@NonNull HttpServletRequest request, @NonNull HttpServletResponse response, @NonNull Object handler) throws Exception { + + if (!enableOpenApiAuth) { + response.addHeader(OpenAPIConstant.RESPONSE_HEADER_AUTH_STATUS, Boolean.TRUE.toString()); + return true; + } + + // 鉴权类请求跳过拦截 + String requestURI = request.getRequestURI(); + for (String endPath : IGNORE_OPEN_API_PATH) { + if (requestURI.endsWith(endPath)) { + return true; + } + } + + try { + openApiSecurityService.authAppByToken(request); + response.addHeader(OpenAPIConstant.RESPONSE_HEADER_AUTH_STATUS, Boolean.TRUE.toString()); + } catch (PowerJobException pje) { + response.addHeader(OpenAPIConstant.RESPONSE_HEADER_AUTH_STATUS, Boolean.FALSE.toString()); + writeResponse(PowerResultDTO.f(pje), response); + return false; + } catch (Exception e) { + response.setStatus(HttpServletResponse.SC_INTERNAL_SERVER_ERROR); + writeResponse(PowerResultDTO.f(e), response); + + log.error("[OpenApiInterceptor] unknown exception when auth app by token", e); + + return false; + } + + return true; + } + + @SneakyThrows + private void writeResponse( PowerResultDTO powerResult, HttpServletResponse response) { + + // 设置响应的 Content-Type + response.setContentType(OmsConstant.JSON_MEDIA_TYPE); + + // 将 JSON 写入响应 + PrintWriter writer = response.getWriter(); + writer.write(JsonUtils.toJSONString(powerResult)); + writer.flush(); + } + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/security/OpenApiSecurityService.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/security/OpenApiSecurityService.java new file mode 100644 index 000000000..ab9ee65f5 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/security/OpenApiSecurityService.java @@ -0,0 +1,28 @@ +package tech.powerjob.server.openapi.security; + +import tech.powerjob.client.module.AppAuthRequest; +import tech.powerjob.client.module.AppAuthResult; + +import javax.servlet.http.HttpServletRequest; + +/** + * OPENAPI 安全服务 + * + * @author tjq + * @since 2024/2/19 + */ +public interface OpenApiSecurityService { + + /** + * APP 纬度请求的鉴权 & 验证 + * @param appAuthRequest 请求参数 + * @return token + */ + AppAuthResult authAppByParam(AppAuthRequest appAuthRequest); + + /** + * APP 纬度请求的鉴权 & 验证 + * @param httpServletRequest http 原始请求 + */ + void authAppByToken(HttpServletRequest httpServletRequest); +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/security/OpenApiSecurityServiceImpl.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/security/OpenApiSecurityServiceImpl.java new file mode 100644 index 000000000..00c4a762d --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/openapi/security/OpenApiSecurityServiceImpl.java @@ -0,0 +1,106 @@ +package tech.powerjob.server.openapi.security; + +import com.google.common.collect.Maps; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import tech.powerjob.client.module.AppAuthRequest; +import tech.powerjob.client.module.AppAuthResult; +import tech.powerjob.common.OpenAPIConstant; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.server.auth.common.utils.HttpServletUtils; +import tech.powerjob.server.auth.jwt.JwtService; +import tech.powerjob.server.auth.jwt.ParseResult; +import tech.powerjob.server.core.service.AppInfoService; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.Map; +import java.util.Optional; + +/** + * OpenApiSecurityService + * + * @author tjq + * @since 2024/2/19 + */ +@Slf4j +@Service +public class OpenApiSecurityServiceImpl implements OpenApiSecurityService { + + @Resource + private JwtService jwtService; + @Resource + private AppInfoService appInfoService; + + private static final String JWT_KEY_APP_ID = "appId"; + private static final String JWT_KEY_APP_PASSWORD = "password"; + private static final String JWT_KEY_ENCRYPT_TYPE = "encryptType"; + + @Override + public void authAppByToken(HttpServletRequest httpServletRequest) { + + String token = HttpServletUtils.fetchFromHeader(OpenAPIConstant.REQUEST_HEADER_ACCESS_TOKEN, httpServletRequest); + String appIdFromHeader = HttpServletUtils.fetchFromHeader(OpenAPIConstant.REQUEST_HEADER_APP_ID, httpServletRequest); + + if (StringUtils.isEmpty(appIdFromHeader)) { + throw new PowerJobException(ErrorCodes.INVALID_REQUEST, "lack_of_appId_in_header"); + } + + if (StringUtils.isEmpty(token)) { + throw new PowerJobException(ErrorCodes.OPEN_API_AUTH_FAILED, "token_is_empty"); + } + + ParseResult parseResult = jwtService.parse(token, null); + switch (parseResult.getStatus()) { + case EXPIRED: + throw new PowerJobException(ErrorCodes.TOKEN_EXPIRED, parseResult.getMsg()); + case FAILED: + throw new PowerJobException(ErrorCodes.INVALID_TOKEN, parseResult.getMsg()); + } + + Map jwtResult = parseResult.getResult(); + + Long appIdFromJwt = MapUtils.getLong(jwtResult, JWT_KEY_APP_ID); + String passwordFromJwt = MapUtils.getString(jwtResult, JWT_KEY_APP_PASSWORD); + String encryptType = MapUtils.getString(jwtResult, JWT_KEY_ENCRYPT_TYPE); + + // 校验 appId 一致性 + if (!StringUtils.equals(appIdFromHeader, String.valueOf(appIdFromJwt))) { + throw new PowerJobException(ErrorCodes.INVALID_REQUEST, "Inconsistent_appId_from_token_and_header"); + } + + // 此处不考虑改密码后的缓存时间,毕竟只要改了密码,一定会报错。换言之 OpenAPI 模式下,密码不可更改 + Optional appInfoOpt = appInfoService.findById(appIdFromJwt, true); + if (!appInfoOpt.isPresent()) { + throw new PowerJobException(ErrorCodes.INVALID_APP, "can_not_find_app"); + } + + appInfoService.assertApp(appInfoOpt.get(), passwordFromJwt, encryptType); + } + + + @Override + public AppAuthResult authAppByParam(AppAuthRequest appAuthRequest) { + + String appName = appAuthRequest.getAppName(); + String encryptedPassword = appAuthRequest.getEncryptedPassword(); + + Long appId = appInfoService.assertApp(appName, encryptedPassword, appAuthRequest.getEncryptType()); + + Map jwtBody = Maps.newHashMap(); + jwtBody.put(JWT_KEY_APP_ID, appId); + jwtBody.put(JWT_KEY_APP_PASSWORD, encryptedPassword); + jwtBody.put(JWT_KEY_ENCRYPT_TYPE, appAuthRequest.getEncryptType()); + + AppAuthResult appAuthResult = new AppAuthResult(); + + appAuthResult.setAppId(appId); + appAuthResult.setToken(jwtService.build(jwtBody, null)); + + return appAuthResult; + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/support/ServerInfoAwareProcessor.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/support/ServerInfoAwareProcessor.java index 6a4aa54a4..cd335752a 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/support/ServerInfoAwareProcessor.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/support/ServerInfoAwareProcessor.java @@ -19,7 +19,7 @@ public class ServerInfoAwareProcessor { public ServerInfoAwareProcessor(ServerInfoService serverInfoService, List awareList) { - final ServerInfo serverInfo = serverInfoService.fetchServiceInfo(); + final ServerInfo serverInfo = serverInfoService.fetchCurrentServerInfo(); log.info("[ServerInfoAwareProcessor] current server info: {}", serverInfo); awareList.forEach(aware -> { aware.setServerInfo(serverInfo); diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/AppWebService.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/AppWebService.java new file mode 100644 index 000000000..428e33fd1 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/AppWebService.java @@ -0,0 +1,25 @@ +package tech.powerjob.server.web; + +import org.springframework.data.domain.Page; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import tech.powerjob.server.web.request.ModifyAppInfoRequest; +import tech.powerjob.server.web.request.QueryAppInfoRequest; + +import java.util.Optional; + +/** + * AppWebService + * + * @author tjq + * @since 2024/12/8 + */ +public interface AppWebService { + + AppInfoDO save(ModifyAppInfoRequest request); + + void delete(Long id); + + Optional findByAppName(String appName); + + Page list(QueryAppInfoRequest queryAppInfoRequest); +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/ControllerExceptionHandler.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/ControllerExceptionHandler.java index 0730312ff..45fc77bc9 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/ControllerExceptionHandler.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/ControllerExceptionHandler.java @@ -1,7 +1,5 @@ package tech.powerjob.server.web; -import tech.powerjob.common.exception.PowerJobException; -import tech.powerjob.common.response.ResultDTO; import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.exception.ExceptionUtils; import org.springframework.http.converter.HttpMessageNotReadableException; @@ -10,6 +8,8 @@ import org.springframework.web.bind.annotation.ControllerAdvice; import org.springframework.web.bind.annotation.ExceptionHandler; import org.springframework.web.bind.annotation.ResponseBody; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.response.PowerResultDTO; /** * 统一处理 web 层异常信息 @@ -23,11 +23,16 @@ public class ControllerExceptionHandler { @ResponseBody @ExceptionHandler(Exception.class) - public ResultDTO exceptionHandler(Exception e) { + public PowerResultDTO exceptionHandler(Exception e) { + + PowerResultDTO ret = PowerResultDTO.f(ExceptionUtils.getMessage(e)); // 不是所有异常都需要打印完整堆栈,后续可以定义内部的Exception,便于判断 - if (e instanceof IllegalArgumentException || e instanceof PowerJobException) { - log.warn("[ControllerException] http request failed, message is {}.", e.getMessage()); + if (e instanceof PowerJobException) { + ret.setCode(((PowerJobException) e).getCode()); + log.warn("[ControllerException] PowerJobException, message is {}.", e.getMessage()); + } else if (e instanceof IllegalArgumentException) { + log.warn("[ControllerException] http request failed due to IllegalArgument, message is {}.", e.getMessage()); } else if (e instanceof HttpMessageNotReadableException || e instanceof MethodArgumentTypeMismatchException) { log.warn("[ControllerException] invalid http request params, exception is {}.", e.getMessage()); } else if (e instanceof HttpRequestMethodNotSupportedException) { @@ -35,6 +40,7 @@ public ResultDTO exceptionHandler(Exception e) { } else { log.error("[ControllerException] http request failed.", e); } - return ResultDTO.failed(ExceptionUtils.getMessage(e)); + + return ret; } } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/AppInfoController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/AppInfoController.java index f50e9a901..349797540 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/AppInfoController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/AppInfoController.java @@ -1,26 +1,53 @@ package tech.powerjob.server.web.controller; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; import lombok.RequiredArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.data.domain.Page; +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import tech.powerjob.common.enums.ErrorCodes; import tech.powerjob.common.exception.PowerJobException; import tech.powerjob.common.response.ResultDTO; -import tech.powerjob.server.persistence.remote.model.AppInfoDO; -import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.common.utils.CommonUtils; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.Role; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.AuthConstants; +import tech.powerjob.server.auth.common.utils.AuthHeaderUtils; +import tech.powerjob.server.auth.interceptor.ApiPermission; +import tech.powerjob.server.auth.plugin.ModifyOrCreateDynamicPermission; +import tech.powerjob.server.auth.plugin.SaveAppGrantPermissionPlugin; +import tech.powerjob.server.auth.service.WebAuthService; +import tech.powerjob.server.common.constants.ExtensionKey; import tech.powerjob.server.core.service.AppInfoService; +import tech.powerjob.server.persistence.PageResult; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import tech.powerjob.server.persistence.remote.model.NamespaceDO; +import tech.powerjob.server.web.AppWebService; +import tech.powerjob.server.web.converter.NamespaceConverter; import tech.powerjob.server.web.request.AppAssertRequest; +import tech.powerjob.server.web.request.ComponentUserRoleInfo; import tech.powerjob.server.web.request.ModifyAppInfoRequest; -import com.google.common.collect.Lists; -import lombok.Data; -import org.apache.commons.lang3.StringUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Pageable; -import org.springframework.util.CollectionUtils; -import org.springframework.web.bind.annotation.*; - -import javax.annotation.Resource; -import java.util.Date; +import tech.powerjob.server.web.request.QueryAppInfoRequest; +import tech.powerjob.server.web.response.AppInfoVO; +import tech.powerjob.server.web.response.NamespaceBaseVO; +import tech.powerjob.server.web.response.UserBaseVO; +import tech.powerjob.server.web.service.NamespaceWebService; +import tech.powerjob.server.web.service.UserWebService; + +import javax.servlet.http.HttpServletRequest; import java.util.List; -import java.util.Objects; +import java.util.Map; +import java.util.Optional; import java.util.stream.Collectors; /** @@ -30,80 +57,129 @@ * @author tjq * @since 2020/4/1 */ +@Slf4j @RestController @RequestMapping("/appInfo") @RequiredArgsConstructor public class AppInfoController { - private final AppInfoService appInfoService; + private final AppWebService appWebService; - private final AppInfoRepository appInfoRepository; + private final WebAuthService webAuthService; - private static final int MAX_APP_NUM = 200; + private final UserWebService userWebService; - @PostMapping("/save") - public ResultDTO saveAppInfo(@RequestBody ModifyAppInfoRequest req) { + private final AppInfoService appInfoService; - req.valid(); - AppInfoDO appInfoDO; + private final NamespaceWebService namespaceWebService; - Long id = req.getId(); - if (id == null) { - appInfoDO = new AppInfoDO(); - appInfoDO.setGmtCreate(new Date()); - }else { - appInfoDO = appInfoRepository.findById(id).orElseThrow(() -> new IllegalArgumentException("can't find appInfo by id:" + id)); + @PostMapping("/save") + @ApiPermission(name = "App-Save", roleScope = RoleScope.APP, dynamicPermissionPlugin = ModifyOrCreateDynamicPermission.class, grandPermissionPlugin = SaveAppGrantPermissionPlugin.class) + public ResultDTO saveAppInfo(@RequestBody ModifyAppInfoRequest req, HttpServletRequest hsr) { - // 对比密码 - if (!Objects.equals(req.getOldPassword(), appInfoDO.getPassword())) { - throw new PowerJobException("The password is incorrect."); - } + // 安全注入攻击的场景,不信任传参 + if (req.getId() != null) { + req.setId(Long.valueOf(AuthHeaderUtils.fetchAppId(hsr))); } - BeanUtils.copyProperties(req, appInfoDO); - appInfoDO.setGmtModified(new Date()); - appInfoRepository.saveAndFlush(appInfoDO); - return ResultDTO.success(null); - } + AppInfoDO savedAppInfo = appWebService.save(req); - @PostMapping("/assert") - public ResultDTO assertApp(@RequestBody AppAssertRequest request) { - return ResultDTO.success(appInfoService.assertApp(request.getAppName(), request.getPassword())); + return ResultDTO.success(convert(Lists.newArrayList(savedAppInfo), false).get(0)); } - @GetMapping("/delete") - public ResultDTO deleteAppInfo(Long appId) { - appInfoRepository.deleteById(appId); + @PostMapping("/delete") + @ApiPermission(name = "App-Delete", roleScope = RoleScope.APP, requiredPermission = Permission.SU) + public ResultDTO deleteApp(HttpServletRequest hsr) { + + Long appId = Long.valueOf(AuthHeaderUtils.fetchAppId(hsr)); + log.warn("[AppInfoController] try to delete app: {}", appId); + + appWebService.delete(appId); + log.warn("[AppInfoController] delete app[id={}] successfully!", appId); return ResultDTO.success(null); } - @GetMapping("/list") - public ResultDTO> listAppInfo(@RequestParam(required = false) String condition) { - List result; - Pageable limit = PageRequest.of(0, MAX_APP_NUM); - if (StringUtils.isEmpty(condition)) { - result = appInfoRepository.findAll(limit).getContent(); - }else { - result = appInfoRepository.findByAppNameLike("%" + condition + "%", limit).getContent(); + @PostMapping("/list") + @ApiPermission(name = "App-List", roleScope = RoleScope.APP, requiredPermission = Permission.NONE) + public ResultDTO> listAppInfoByQuery(@RequestBody QueryAppInfoRequest queryAppInfoRequest) { + + Page pageAppInfoResult = appWebService.list(queryAppInfoRequest); + PageResult pageRet = new PageResult<>(pageAppInfoResult); + + List appInfoDos = pageAppInfoResult.get().collect(Collectors.toList()); + pageRet.setData(convert(appInfoDos, true)); + + return ResultDTO.success(pageRet); + } + + @PostMapping("/becomeAdmin") + @ApiPermission(name = "App-BecomeAdmin", roleScope = RoleScope.GLOBAL, requiredPermission = Permission.NONE) + public ResultDTO becomeAdminByAppNameAndPassword(@RequestBody AppAssertRequest appAssertRequest) { + String appName = appAssertRequest.getAppName(); + + Optional appOpt = appWebService.findByAppName(appName); + if (!appOpt.isPresent()) { + throw new PowerJobException(ErrorCodes.ILLEGAL_ARGS_ERROR, "can't find appInfo by appName: " + appName); + } + + String appExtra = appOpt.get().getExtra(); + if (StringUtils.isNotBlank(appExtra)) { + Map appExtraMap = JsonUtils.parseMap(appExtra); + Boolean allowedBecomeAdminByPassword = MapUtils.getBoolean(appExtraMap, ExtensionKey.App.allowedBecomeAdminByPassword, true); + if (!allowedBecomeAdminByPassword) { + throw new PowerJobException(ErrorCodes.OPERATION_NOT_PERMITTED, "allowedBecomeAdminByPassword=false"); + } } - return ResultDTO.success(convert(result)); + + Long appId = appInfoService.assertApp(appName, appAssertRequest.getPassword(), appAssertRequest.getEncryptType()); + + Map extra = Maps.newHashMap(); + extra.put("source", "becomeAdminByAppNameAndPassword"); + + webAuthService.grantRole2LoginUser(RoleScope.APP, appId, Role.ADMIN, JsonUtils.toJSONString(extra)); + + return ResultDTO.success(null); } - private static List convert(List data) { + private List convert(List data, boolean fillDetail) { if (CollectionUtils.isEmpty(data)) { return Lists.newLinkedList(); } + + // app 界面使用频率不高,数据库操作 rt 也不会太长,展示不考虑性能问题,简单期间串行补全 return data.stream().map(appInfoDO -> { AppInfoVO appInfoVO = new AppInfoVO(); BeanUtils.copyProperties(appInfoDO, appInfoVO); + + appInfoVO.setGmtCreateStr(CommonUtils.formatTime(appInfoDO.getGmtCreate())); + appInfoVO.setGmtModifiedStr(CommonUtils.formatTime(appInfoDO.getGmtModified())); + + if (fillDetail) { + // 人员面板 + ComponentUserRoleInfo componentUserRoleInfo = webAuthService.fetchComponentUserRoleInfo(RoleScope.APP, appInfoDO.getId()); + appInfoVO.setComponentUserRoleInfo(componentUserRoleInfo); + + // 密码 + boolean hasPermission = webAuthService.hasPermission(RoleScope.APP, appInfoDO.getId(), Permission.READ); + String originPassword = appInfoService.fetchOriginAppPassword(appInfoDO); + appInfoVO.setPassword(hasPermission ? originPassword : AuthConstants.TIPS_NO_PERMISSION_TO_SEE); + + // namespace + Optional namespaceOpt = namespaceWebService.findById(appInfoDO.getNamespaceId()); + if (namespaceOpt.isPresent()) { + NamespaceBaseVO baseNamespace = NamespaceConverter.do2BaseVo(namespaceOpt.get()); + appInfoVO.setNamespace(baseNamespace); + appInfoVO.setNamespaceName(baseNamespace.getName()); + } + + // user 信息 + appInfoVO.setCreatorShowName(userWebService.fetchBaseUserInfo(appInfoDO.getCreator()).map(UserBaseVO::getShowName).orElse(null)); + appInfoVO.setModifierShowName(userWebService.fetchBaseUserInfo(appInfoDO.getModifier()).map(UserBaseVO::getShowName).orElse(null)); + + } + return appInfoVO; }).collect(Collectors.toList()); } - @Data - private static class AppInfoVO { - private Long id; - private String appName; - } - } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/AuthController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/AuthController.java new file mode 100644 index 000000000..b9198764f --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/AuthController.java @@ -0,0 +1,123 @@ +package tech.powerjob.server.web.controller; + +import org.springframework.web.bind.annotation.*; +import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.common.utils.CollectionUtils; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.PowerJobUser; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.AuthConstants; +import tech.powerjob.server.auth.interceptor.ApiPermission; +import tech.powerjob.server.auth.login.LoginTypeInfo; +import tech.powerjob.server.auth.service.WebAuthService; +import tech.powerjob.server.auth.service.login.LoginRequest; +import tech.powerjob.server.auth.service.login.PowerJobLoginService; +import tech.powerjob.server.web.request.ComponentUserRoleInfo; + +import javax.annotation.Resource; +import javax.servlet.http.Cookie; +import javax.servlet.http.HttpServletRequest; +import javax.servlet.http.HttpServletResponse; +import java.util.List; +import java.util.Optional; + +/** + * 登录 & 权限相关 + * + * @author tjq + * @since 2023/4/16 + */ +@RestController +@RequestMapping("/auth") +public class AuthController { + + @Resource + private WebAuthService webAuthService; + @Resource + private PowerJobLoginService powerJobLoginService; + + @GetMapping("/supportLoginTypes") + public ResultDTO> listSupportLoginTypes() { + return ResultDTO.success(powerJobLoginService.fetchSupportLoginTypes()); + } + + @GetMapping("/thirdPartyLoginUrl") + public ResultDTO getThirdPartyLoginUrl(String type, HttpServletRequest request) { + String url = powerJobLoginService.fetchThirdPartyLoginUrl(type, request); + return ResultDTO.success(url); + } + + /** + * 第三方账号体系回调登录接口,eg, 接受钉钉登录回调 + * @param httpServletRequest 请求 + * @param httpServletResponse 响应 + * @return 登录结果 + */ + @RequestMapping(value = "/thirdPartyLoginCallback", method = {RequestMethod.GET, RequestMethod.POST}) + public ResultDTO loginCallback(HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { + + LoginRequest loginContext = new LoginRequest().setHttpServletRequest(httpServletRequest); + + // 常见登录组件的标准规范(钉钉、企业微信、飞书),第三方原样透传。开发者在对接第三方登录体系时,可能需要修改此处,将 type 回填 + final String state = httpServletRequest.getParameter("state"); + loginContext.setLoginType(state); + + final PowerJobUser powerJobUser = powerJobLoginService.doLogin(loginContext); + fillJwt4LoginUser(powerJobUser, httpServletResponse); + + return ResultDTO.success(powerJobUser); + } + + /** + * 第三方账号体系直接登录接口,eg, 接受 PowerJob 自带账号密码体系的登录请求 + * @param loginRequest 登录请求 + * @param httpServletResponse 响应 + * @return 登录结果 + */ + @PostMapping("/thirdPartyLoginDirect") + public ResultDTO selfLogin(@RequestBody LoginRequest loginRequest, HttpServletRequest httpServletRequest, HttpServletResponse httpServletResponse) { + loginRequest.setHttpServletRequest(httpServletRequest); + try { + final PowerJobUser powerJobUser = powerJobLoginService.doLogin(loginRequest); + if (powerJobUser == null) { + return ResultDTO.failed("USER_NOT_FOUND"); + } + fillJwt4LoginUser(powerJobUser, httpServletResponse); + return ResultDTO.success(powerJobUser); + } catch (Exception e) { + return ResultDTO.failed(e.getMessage()); + } + } + + @GetMapping(value = "/ifLogin") + public ResultDTO ifLogin(HttpServletRequest httpServletRequest) { + final Optional powerJobUser = powerJobLoginService.ifLogin(httpServletRequest); + return powerJobUser.map(ResultDTO::success).orElseGet(() -> ResultDTO.success(null)); + } + + /* ****************** 授权相关 ****************** */ + + @GetMapping("/listGlobalAdmin") + public ResultDTO> listGlobalAdmin() { + // 全局只设置超级管理员权限 + ComponentUserRoleInfo componentUserRoleInfo = webAuthService.fetchComponentUserRoleInfo(RoleScope.GLOBAL, AuthConstants.GLOBAL_ADMIN_TARGET_ID); + return ResultDTO.success(componentUserRoleInfo.getAdmin()); + } + + @PostMapping("/saveGlobalAdmin") + @ApiPermission(name = "Auth-SaveGlobalAdmin", roleScope = RoleScope.GLOBAL, requiredPermission = Permission.SU) + public ResultDTO saveGlobalAdmin(@RequestBody ComponentUserRoleInfo componentUserRoleInfo) { + + if (CollectionUtils.isEmpty(componentUserRoleInfo.getAdmin())) { + throw new IllegalArgumentException("At least one super administrator is required!"); + } + + webAuthService.processPermissionOnSave(RoleScope.GLOBAL, AuthConstants.GLOBAL_ADMIN_TARGET_ID, componentUserRoleInfo); + + return ResultDTO.success(null); + } + + private void fillJwt4LoginUser(PowerJobUser powerJobUser, HttpServletResponse httpServletResponse) { + httpServletResponse.addCookie(new Cookie(AuthConstants.JWT_NAME, powerJobUser.getJwtToken())); + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/ContainerController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/ContainerController.java index 02acd5d0b..9e31f8936 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/ContainerController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/ContainerController.java @@ -4,13 +4,16 @@ import org.apache.commons.lang3.StringUtils; import org.apache.commons.lang3.time.DateFormatUtils; import org.springframework.beans.BeanUtils; -import org.springframework.beans.factory.annotation.Value; import org.springframework.web.bind.annotation.*; import org.springframework.web.multipart.MultipartFile; import tech.powerjob.common.OmsConstant; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.utils.AuthHeaderUtils; +import tech.powerjob.server.auth.interceptor.ApiPermission; import tech.powerjob.server.common.constants.ContainerSourceType; -import tech.powerjob.server.common.constants.SwitchableStatus; import tech.powerjob.server.common.utils.OmsFileUtils; import tech.powerjob.server.core.container.ContainerService; import tech.powerjob.server.core.container.ContainerTemplateGenerator; @@ -22,6 +25,7 @@ import tech.powerjob.server.web.request.SaveContainerInfoRequest; import tech.powerjob.server.web.response.ContainerInfoVO; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.io.IOException; @@ -39,22 +43,25 @@ @RequestMapping("/container") public class ContainerController { - - private final int port; - private final ContainerService containerService; private final AppInfoRepository appInfoRepository; private final ContainerInfoRepository containerInfoRepository; - public ContainerController(@Value("${server.port}") int port, ContainerService containerService, AppInfoRepository appInfoRepository, ContainerInfoRepository containerInfoRepository) { - this.port = port; + public ContainerController(ContainerService containerService, AppInfoRepository appInfoRepository, ContainerInfoRepository containerInfoRepository) { this.containerService = containerService; this.appInfoRepository = appInfoRepository; this.containerInfoRepository = containerInfoRepository; } + /** + * 暴露给 worker 的下载端口,制品本身 version 不可枚举,不单独鉴权 + * 如果对此有安全性需求,可自行实现加密鉴权逻辑,或者干脆走自己的下载通道下载制品 + * @param version 容器版本 + * @param response 响应 + * @throws IOException 异常 + */ @GetMapping("/downloadJar") public void downloadJar(String version, HttpServletResponse response) throws IOException { File file = containerService.fetchContainerJarFile(version); @@ -72,6 +79,7 @@ public void downloadContainerTemplate(@RequestBody GenerateContainerTemplateRequ } @PostMapping("/jarUpload") + @ApiPermission(name = "Container-JarUpload", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) public ResultDTO fileUpload(@RequestParam("file") MultipartFile file) throws Exception { if (file == null || file.isEmpty()) { return ResultDTO.failed("empty file"); @@ -80,7 +88,11 @@ public ResultDTO fileUpload(@RequestParam("file") MultipartFile file) th } @PostMapping("/save") - public ResultDTO saveContainer(@RequestBody SaveContainerInfoRequest request) { + @ApiPermission(name = "Container-Save", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO saveContainer(@RequestBody SaveContainerInfoRequest request, HttpServletRequest hsr) { + + request.setAppId(Long.valueOf(AuthHeaderUtils.fetchAppId(hsr))); + request.valid(); ContainerInfoDO container = new ContainerInfoDO(); @@ -93,20 +105,25 @@ public ResultDTO saveContainer(@RequestBody SaveContainerInfoRequest reque } @GetMapping("/delete") - public ResultDTO deleteContainer(Long appId, Long containerId) { - containerService.delete(appId, containerId); + @ApiPermission(name = "Container-Delete", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO deleteContainer(Long containerId, HttpServletRequest hsr) { + containerService.delete(Long.valueOf(AuthHeaderUtils.fetchAppId(hsr)), containerId); return ResultDTO.success(null); } @GetMapping("/list") - public ResultDTO> listContainers(Long appId) { + @ApiPermission(name = "Container-List", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO> listContainers(HttpServletRequest hsr) { + Long appId = Long.valueOf(AuthHeaderUtils.fetchAppId(hsr)); List res = containerInfoRepository.findByAppIdAndStatusNot(appId, SwitchableStatus.DELETED.getV()) .stream().map(ContainerController::convert).collect(Collectors.toList()); return ResultDTO.success(res); } @GetMapping("/listDeployedWorker") - public ResultDTO listDeployedWorker(Long appId, Long containerId, HttpServletResponse response) { + @ApiPermission(name = "Container-ListDeployedWorker", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO listDeployedWorker(Long containerId, HttpServletResponse response, HttpServletRequest hsr) { + Long appId = Long.valueOf(AuthHeaderUtils.fetchAppId(hsr)); AppInfoDO appInfoDO = appInfoRepository.findById(appId).orElseThrow(() -> new IllegalArgumentException("can't find app by id:" + appId)); String targetServer = appInfoDO.getCurrentServer(); diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/InstanceController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/InstanceController.java index d2f729c24..79c5b4719 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/InstanceController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/InstanceController.java @@ -1,35 +1,42 @@ package tech.powerjob.server.web.controller; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.io.FileUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.data.domain.Example; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.web.bind.annotation.*; +import tech.powerjob.common.OmsConstant; import tech.powerjob.common.enums.InstanceStatus; import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.utils.AuthHeaderUtils; +import tech.powerjob.server.auth.interceptor.ApiPermission; import tech.powerjob.server.common.utils.OmsFileUtils; +import tech.powerjob.server.core.instance.InstanceLogService; +import tech.powerjob.server.core.instance.InstanceService; +import tech.powerjob.server.core.service.CacheService; import tech.powerjob.server.persistence.PageResult; import tech.powerjob.server.persistence.StringPage; import tech.powerjob.server.persistence.remote.model.InstanceInfoDO; -import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; import tech.powerjob.server.persistence.remote.repository.InstanceInfoRepository; -import tech.powerjob.server.core.service.CacheService; -import tech.powerjob.server.core.instance.InstanceLogService; -import tech.powerjob.server.core.instance.InstanceService; +import tech.powerjob.server.web.request.QueryInstanceDetailRequest; import tech.powerjob.server.web.request.QueryInstanceRequest; import tech.powerjob.server.web.response.InstanceDetailVO; import tech.powerjob.server.web.response.InstanceInfoVO; -import lombok.SneakyThrows; -import lombok.extern.slf4j.Slf4j; -import org.apache.commons.io.FileUtils; -import org.springframework.beans.BeanUtils; -import org.springframework.data.domain.Example; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import javax.servlet.http.HttpServletResponse; import java.io.File; import java.net.URL; import java.util.List; +import java.util.Optional; import java.util.stream.Collectors; @@ -44,8 +51,6 @@ @RequestMapping("/instance") public class InstanceController { - - @Resource private InstanceService instanceService; @Resource @@ -57,42 +62,70 @@ public class InstanceController { private InstanceInfoRepository instanceInfoRepository; @GetMapping("/stop") - public ResultDTO stopInstance(Long appId,Long instanceId) { - instanceService.stopInstance(appId,instanceId); + @ApiPermission(name = "Instance-Stop", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO stopInstance(Long instanceId, HttpServletRequest hsr) { + instanceService.stopInstance(AuthHeaderUtils.fetchAppIdL(hsr), instanceId); return ResultDTO.success(null); } @GetMapping("/retry") - public ResultDTO retryInstance(String appId, Long instanceId) { - instanceService.retryInstance(Long.valueOf(appId), instanceId); + @ApiPermission(name = "Instance-Retry", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO retryInstance(Long instanceId, HttpServletRequest hsr) { + instanceService.retryInstance(AuthHeaderUtils.fetchAppIdL(hsr), instanceId); return ResultDTO.success(null); } @GetMapping("/detail") - public ResultDTO getInstanceDetail(Long instanceId) { - return ResultDTO.success(InstanceDetailVO.from(instanceService.getInstanceDetail(instanceId))); + @ApiPermission(name = "Instance-Detail", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO getInstanceDetail(Long instanceId, HttpServletRequest hsr) { + QueryInstanceDetailRequest queryInstanceDetailRequest = new QueryInstanceDetailRequest(); + queryInstanceDetailRequest.setAppId(AuthHeaderUtils.fetchAppIdL(hsr)); + queryInstanceDetailRequest.setInstanceId(instanceId); + return getInstanceDetailPlus(queryInstanceDetailRequest, hsr); + } + + @PostMapping("/detailPlus") + public ResultDTO getInstanceDetailPlus(@RequestBody QueryInstanceDetailRequest req, HttpServletRequest hsr) { + + req.setAppId(AuthHeaderUtils.fetchAppIdL(hsr)); + + // 非法请求参数校验 + String customQuery = req.getCustomQuery(); + String nonNullCustomQuery = Optional.ofNullable(customQuery).orElse(OmsConstant.NONE); + if (StringUtils.containsAnyIgnoreCase(nonNullCustomQuery, "delete", "update", "insert", "drop", "CREATE", "ALTER", "TRUNCATE", "RENAME", "LOCK", "GRANT", "REVOKE", "PREPARE", "EXECUTE", "COMMIT", "BEGIN")) { + throw new IllegalArgumentException("Don't get any ideas about the database, illegally query: " + customQuery); + } + + // 兼容老版本前端不存在 appId 的场景 + if (req.getAppId() == null) { + req.setAppId(instanceService.getInstanceInfo(req.getInstanceId()).getAppId()); + } + + return ResultDTO.success(InstanceDetailVO.from(instanceService.getInstanceDetail(req.getAppId(), req.getInstanceId(), customQuery))); } @GetMapping("/log") - public ResultDTO getInstanceLog(Long appId, Long instanceId, Long index) { - return ResultDTO.success(instanceLogService.fetchInstanceLog(appId, instanceId, index)); + @ApiPermission(name = "Instance-Log", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO getInstanceLog(Long instanceId, Long index, HttpServletRequest hsr) { + return ResultDTO.success(instanceLogService.fetchInstanceLog(AuthHeaderUtils.fetchAppIdL(hsr), instanceId, index)); } @GetMapping("/downloadLogUrl") - public ResultDTO getDownloadUrl(Long appId, Long instanceId) { - return ResultDTO.success(instanceLogService.fetchDownloadUrl(appId, instanceId)); + @ApiPermission(name = "Instance-FetchDownloadLogUrl", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO getDownloadUrl(Long instanceId, HttpServletRequest hsr) { + return ResultDTO.success(instanceLogService.fetchDownloadUrl(AuthHeaderUtils.fetchAppIdL(hsr), instanceId)); } @GetMapping("/downloadLog") public void downloadLogFile(Long instanceId , HttpServletResponse response) throws Exception { - File file = instanceLogService.downloadInstanceLog(instanceId); OmsFileUtils.file2HttpResponse(file, response); } @GetMapping("/downloadLog4Console") @SneakyThrows - public void downloadLog4Console(Long appId, Long instanceId , HttpServletResponse response) { + public void downloadLog4Console(Long instanceId , HttpServletResponse response, HttpServletRequest hsr) { + Long appId = AuthHeaderUtils.fetchAppIdL(hsr); // 获取内部下载链接 String downloadUrl = instanceLogService.fetchDownloadUrl(appId, instanceId); // 先下载到本机 @@ -110,7 +143,10 @@ public void downloadLog4Console(Long appId, Long instanceId , HttpServletRespons } @PostMapping("/list") - public ResultDTO> list(@RequestBody QueryInstanceRequest request) { + @ApiPermission(name = "Instance-List", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO> list(@RequestBody QueryInstanceRequest request, HttpServletRequest hsr) { + + request.setAppId(AuthHeaderUtils.fetchAppIdL(hsr)); Sort sort = Sort.by(Sort.Direction.DESC, "gmtModified"); PageRequest pageable = PageRequest.of(request.getIndex(), request.getPageSize(), sort); diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/JobController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/JobController.java index aaa3a9f1c..d12a40f4d 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/JobController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/JobController.java @@ -1,23 +1,31 @@ package tech.powerjob.server.web.controller; +import com.google.common.collect.Lists; +import lombok.extern.slf4j.Slf4j; import org.apache.commons.lang3.StringUtils; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.web.bind.annotation.*; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.common.enums.SwitchableStatus; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.request.http.RunJobRequest; import tech.powerjob.common.request.http.SaveJobInfoRequest; import tech.powerjob.common.response.ResultDTO; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.utils.AuthHeaderUtils; +import tech.powerjob.server.auth.interceptor.ApiPermission; +import tech.powerjob.server.core.service.JobService; import tech.powerjob.server.persistence.PageResult; import tech.powerjob.server.persistence.remote.model.JobInfoDO; import tech.powerjob.server.persistence.remote.repository.JobInfoRepository; -import tech.powerjob.server.core.service.JobService; import tech.powerjob.server.web.request.QueryJobInfoRequest; import tech.powerjob.server.web.response.JobInfoVO; -import com.google.common.collect.Lists; -import lombok.extern.slf4j.Slf4j; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.List; import java.util.Optional; import java.util.stream.Collectors; @@ -39,40 +47,56 @@ public class JobController { private JobInfoRepository jobInfoRepository; @PostMapping("/save") - public ResultDTO saveJobInfo(@RequestBody SaveJobInfoRequest request) { + @ApiPermission(name = "Job-Save", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO saveJobInfo(@RequestBody SaveJobInfoRequest request, HttpServletRequest hsr) { + request.setAppId(Long.valueOf(AuthHeaderUtils.fetchAppId(hsr))); jobService.saveJob(request); return ResultDTO.success(null); } @PostMapping("/copy") - public ResultDTO copyJob(String jobId) { + @ApiPermission(name = "Job-Copy", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO copyJob(String jobId, HttpServletRequest hsr) { + preCheck(jobId, hsr); return ResultDTO.success(JobInfoVO.from(jobService.copyJob(Long.valueOf(jobId)))); } @GetMapping("/export") - public ResultDTO exportJob(String jobId) { + @ApiPermission(name = "Job-Export", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO exportJob(String jobId, HttpServletRequest hsr) { + preCheck(jobId, hsr); return ResultDTO.success(jobService.exportJob(Long.valueOf(jobId))); } @GetMapping("/disable") - public ResultDTO disableJob(String jobId) { + @ApiPermission(name = "Job-Disable", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO disableJob(String jobId, HttpServletRequest hsr) { + preCheck(jobId, hsr); jobService.disableJob(Long.valueOf(jobId)); return ResultDTO.success(null); } @GetMapping("/delete") - public ResultDTO deleteJob(String jobId) { + @ApiPermission(name = "Job-Delete", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO deleteJob(String jobId, HttpServletRequest hsr) { + preCheck(jobId, hsr); jobService.deleteJob(Long.valueOf(jobId)); return ResultDTO.success(null); } @GetMapping("/run") - public ResultDTO runImmediately(String appId, String jobId, @RequestParam(required = false) String instanceParams) { - return ResultDTO.success(jobService.runJob(Long.valueOf(appId), Long.valueOf(jobId), instanceParams, 0L)); + @ApiPermission(name = "Job-Run", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO runImmediately(String jobId, @RequestParam(required = false) String instanceParams, HttpServletRequest hsr) { + preCheck(jobId, hsr); + RunJobRequest request = new RunJobRequest().setAppId(AuthHeaderUtils.fetchAppIdL(hsr)).setJobId(Long.valueOf(jobId)).setInstanceParams(instanceParams); + return ResultDTO.success(jobService.runJob(request.getAppId(), request)); } @PostMapping("/list") - public ResultDTO> listJobs(@RequestBody QueryJobInfoRequest request) { + @ApiPermission(name = "Job-List", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO> listJobs(@RequestBody QueryJobInfoRequest request, HttpServletRequest hsr) { + + request.setAppId(Long.valueOf(AuthHeaderUtils.fetchAppId(hsr))); Sort sort = Sort.by(Sort.Direction.ASC, "id"); PageRequest pageRequest = PageRequest.of(request.getIndex(), request.getPageSize(), sort); @@ -127,4 +151,18 @@ private static PageResult convertPage(Page jobInfoPage) { return pageResult; } + private void preCheck(String jobId, HttpServletRequest hsr) { + Long appId = Long.valueOf(AuthHeaderUtils.fetchAppId(hsr)); + Optional jobInfoOpt = jobInfoRepository.findById(Long.valueOf(jobId)); + if (!jobInfoOpt.isPresent()) { + throw new PowerJobException(ErrorCodes.ILLEGAL_ARGS_ERROR, "JobNotExist"); + } + + JobInfoDO jobInfoDO = jobInfoOpt.get(); + + if (!jobInfoDO.getAppId().equals(appId)) { + throw new PowerJobException(ErrorCodes.INVALID_REQUEST, String.format("AppIdNotMatch(%d!=%d)", jobInfoDO.getAppId(), appId)); + } + } + } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/NamespaceController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/NamespaceController.java new file mode 100644 index 000000000..4d626f8a9 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/NamespaceController.java @@ -0,0 +1,122 @@ +package tech.powerjob.server.web.controller; + +import lombok.extern.slf4j.Slf4j; +import org.springframework.beans.BeanUtils; +import org.springframework.data.domain.Page; +import org.springframework.web.bind.annotation.*; +import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.AuthConstants; +import tech.powerjob.server.auth.common.utils.AuthHeaderUtils; +import tech.powerjob.server.auth.interceptor.ApiPermission; +import tech.powerjob.server.auth.plugin.ModifyOrCreateDynamicPermission; +import tech.powerjob.server.auth.plugin.SaveNamespaceGrantPermissionPlugin; +import tech.powerjob.server.auth.service.WebAuthService; +import tech.powerjob.server.persistence.PageResult; +import tech.powerjob.server.persistence.remote.model.NamespaceDO; +import tech.powerjob.server.web.converter.NamespaceConverter; +import tech.powerjob.server.web.request.ComponentUserRoleInfo; +import tech.powerjob.server.web.request.ModifyNamespaceRequest; +import tech.powerjob.server.web.request.QueryNamespaceRequest; +import tech.powerjob.server.web.response.NamespaceBaseVO; +import tech.powerjob.server.web.response.NamespaceVO; +import tech.powerjob.server.web.response.UserBaseVO; +import tech.powerjob.server.web.service.NamespaceWebService; +import tech.powerjob.server.web.service.UserWebService; + +import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; +import java.util.List; +import java.util.stream.Collectors; + +/** + * 命名空间 Controller + * + * @author tjq + * @since 2023/9/3 + */ +@Slf4j +@RestController +@RequestMapping("/namespace") +public class NamespaceController { + + @Resource + private WebAuthService webAuthService; + @Resource + private UserWebService userWebService; + @Resource + private NamespaceWebService namespaceWebService; + + @ResponseBody + @PostMapping("/save") + @ApiPermission(name = "Namespace-Save", roleScope = RoleScope.NAMESPACE, dynamicPermissionPlugin = ModifyOrCreateDynamicPermission.class, grandPermissionPlugin = SaveNamespaceGrantPermissionPlugin.class) + public ResultDTO save(@RequestBody ModifyNamespaceRequest req, HttpServletRequest hsr) { + + if (req.getId() != null) { + req.setId(AuthHeaderUtils.fetchNamespaceIdL(hsr)); + } + NamespaceDO savedNamespace = namespaceWebService.save(req); + return ResultDTO.success(NamespaceConverter.do2BaseVo(savedNamespace)); + } + + @DeleteMapping("/delete") + @ApiPermission(name = "Namespace-Delete", roleScope = RoleScope.NAMESPACE, requiredPermission = Permission.SU) + public ResultDTO deleteNamespace(HttpServletRequest hsr) { + namespaceWebService.delete(AuthHeaderUtils.fetchNamespaceIdL(hsr)); + return ResultDTO.success(null); + } + + @PostMapping("/list") + @ApiPermission(name = "Namespace-List", roleScope = RoleScope.NAMESPACE, requiredPermission = Permission.NONE) + public ResultDTO> listNamespace(@RequestBody QueryNamespaceRequest queryNamespaceRequest) { + + Page namespacePageResult = namespaceWebService.list(queryNamespaceRequest); + + PageResult ret = new PageResult<>(namespacePageResult); + ret.setData(namespacePageResult.get().map(x -> { + NamespaceVO detailVo = new NamespaceVO(); + NamespaceBaseVO baseVO = NamespaceConverter.do2BaseVo(x); + BeanUtils.copyProperties(baseVO, detailVo); + + fillDetail(x, detailVo); + return detailVo; + }).collect(Collectors.toList())); + + return ResultDTO.success(ret); + } + + @PostMapping("/listAll") + @ApiPermission(name = "Namespace-ListAll", roleScope = RoleScope.NAMESPACE, requiredPermission = Permission.NONE) + public ResultDTO> listAll() { + // 数量应该不是很多,先简单处理,不查询精简对象 + List namespaceRepositoryAll = namespaceWebService.listAll(); + List namespaceBaseVOList = namespaceRepositoryAll.stream().map(nd -> { + NamespaceBaseVO nv = new NamespaceBaseVO(); + nv.setId(nd.getId()); + nv.setCode(nd.getCode()); + nv.setName(nd.getName()); + nv.genShowName(); + return nv; + }).collect(Collectors.toList()); + return ResultDTO.success(namespaceBaseVOList); + } + + private void fillDetail(NamespaceDO namespaceDO, NamespaceVO namespaceVO) { + + Long namespaceId = namespaceVO.getId(); + + // 权限用户关系 + ComponentUserRoleInfo componentUserRoleInfo = webAuthService.fetchComponentUserRoleInfo(RoleScope.NAMESPACE, namespaceId); + namespaceVO.setComponentUserRoleInfo(componentUserRoleInfo); + + // 有权限用户填充 token + boolean hasPermission = webAuthService.hasPermission(RoleScope.NAMESPACE, namespaceId, Permission.READ); + namespaceVO.setToken(hasPermission ? namespaceDO.getToken() : AuthConstants.TIPS_NO_PERMISSION_TO_SEE); + + // 用户信息 + namespaceVO.setCreatorShowName(userWebService.fetchBaseUserInfo(namespaceDO.getCreator()).map(UserBaseVO::getShowName).orElse(null)); + namespaceVO.setModifierShowName(userWebService.fetchBaseUserInfo(namespaceDO.getModifier()).map(UserBaseVO::getShowName).orElse(null)); + } + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/PwjbUserInfoController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/PwjbUserInfoController.java new file mode 100644 index 000000000..af397b9e9 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/PwjbUserInfoController.java @@ -0,0 +1,45 @@ +package tech.powerjob.server.web.controller; + +import org.springframework.web.bind.annotation.PostMapping; +import org.springframework.web.bind.annotation.RequestBody; +import org.springframework.web.bind.annotation.RequestMapping; +import org.springframework.web.bind.annotation.RestController; +import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.server.web.request.ChangePasswordRequest; +import tech.powerjob.server.web.request.ModifyUserInfoRequest; +import tech.powerjob.server.web.service.PwjbUserWebService; + +import javax.annotation.Resource; + +/** + * PowerJob 自带的登录体系 + * (同样视为第三方服务,与主框架没有任何关系) + * + * @author tjq + * @since 2024/2/13 + */ +@RestController +@RequestMapping("/pwjbUser") +public class PwjbUserInfoController { + + @Resource + private PwjbUserWebService pwjbUserWebService; + + /** + * 创建第三方登录体系(PowerJob) 的账户,不允许修改 + * @param request 请求(此处复用了主框架请求,便于用户一次性把所有参数都填入) + * @return 创建结果 + */ + @PostMapping("/create") + public ResultDTO save(@RequestBody ModifyUserInfoRequest request) { + pwjbUserWebService.save(request); + return ResultDTO.success(null); + } + + @PostMapping("/changePassword") + public ResultDTO changePassword(@RequestBody ChangePasswordRequest changePasswordRequest) { + + pwjbUserWebService.changePassword(changePasswordRequest); + return ResultDTO.success(null); + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/ServerController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/ServerController.java index c3343941a..c476e1626 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/ServerController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/ServerController.java @@ -11,7 +11,7 @@ import tech.powerjob.common.request.ServerDiscoveryRequest; import tech.powerjob.common.response.ResultDTO; import tech.powerjob.common.utils.CommonUtils; -import tech.powerjob.common.utils.NetUtils; +import tech.powerjob.common.utils.net.PingPongUtils; import tech.powerjob.server.common.aware.ServerInfoAware; import tech.powerjob.server.common.module.ServerInfo; import tech.powerjob.server.persistence.remote.model.AppInfoDO; @@ -66,10 +66,21 @@ public ResultDTO acquireServer(ServerDiscoveryRequest request) { return ResultDTO.success(serverElectionService.elect(request)); } + @GetMapping("/checkConnectivity") + public ResultDTO checkConnectivity(String targetIp, Integer targetPort) { + try { + boolean ret = PingPongUtils.checkConnectivity(targetIp, targetPort); + return ResultDTO.success(ret); + } catch (Throwable t) { + return ResultDTO.failed(t); + } + } + + @GetMapping("/hello") public ResultDTO ping(@RequestParam(required = false) boolean debug) { JSONObject res = new JSONObject(); - res.put("localHost", NetUtils.getLocalHost()); + res.put("localHost", serverInfo.getIp()); res.put("serverInfo", serverInfo); res.put("serverTime", CommonUtils.formatTime(System.currentTimeMillis())); res.put("serverTimeTs", System.currentTimeMillis()); diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/SystemInfoController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/SystemInfoController.java index 5864feccd..fc1801879 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/SystemInfoController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/SystemInfoController.java @@ -10,8 +10,13 @@ import tech.powerjob.common.OmsConstant; import tech.powerjob.common.enums.InstanceStatus; import tech.powerjob.common.response.ResultDTO; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.interceptor.ApiPermission; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.common.module.WorkerInfo; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; import tech.powerjob.server.persistence.remote.repository.InstanceInfoRepository; import tech.powerjob.server.persistence.remote.repository.JobInfoRepository; import tech.powerjob.server.remote.server.self.ServerInfoService; @@ -21,6 +26,7 @@ import java.util.Date; import java.util.List; +import java.util.Optional; import java.util.TimeZone; import java.util.stream.Collectors; @@ -36,6 +42,8 @@ @RequiredArgsConstructor public class SystemInfoController { + private final AppInfoRepository appInfoRepository; + private final JobInfoRepository jobInfoRepository; private final InstanceInfoRepository instanceInfoRepository; @@ -45,6 +53,7 @@ public class SystemInfoController { private final WorkerClusterQueryService workerClusterQueryService; @GetMapping("/listWorker") + @ApiPermission(name = "System-ListWorker", roleScope = RoleScope.APP, requiredPermission = Permission.READ) public ResultDTO> listWorker(Long appId) { List workerInfos = workerClusterQueryService.getAllWorkers(appId); @@ -52,10 +61,19 @@ public ResultDTO> listWorker(Long appId) { } @GetMapping("/overview") + @ApiPermission(name = "System-Overview", roleScope = RoleScope.APP, requiredPermission = Permission.READ) public ResultDTO getSystemOverview(Long appId) { SystemOverviewVO overview = new SystemOverviewVO(); + Optional appInfoOpt = appInfoRepository.findById(appId); + if (appInfoOpt.isPresent()) { + AppInfoDO appInfo = appInfoOpt.get(); + + overview.setAppId(appId); + overview.setAppName(appInfo.getAppName()); + } + // 总任务数量 overview.setJobCount(jobInfoRepository.countByAppIdAndStatusNot(appId, SwitchableStatus.DELETED.getV())); // 运行任务数 @@ -69,7 +87,8 @@ public ResultDTO getSystemOverview(Long appId) { // 服务器时间 overview.setServerTime(DateFormatUtils.format(new Date(), OmsConstant.TIME_PATTERN)); - overview.setServerInfo(serverInfoService.fetchServiceInfo()); + overview.setWebServerInfo(serverInfoService.fetchCurrentServerInfo()); + overview.setScheduleServerInfo(serverInfoService.fetchAppServerInfo(appId)); return ResultDTO.success(overview); } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/TestController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/TestController.java index c7fea8be2..2f7c1c866 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/TestController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/TestController.java @@ -4,16 +4,17 @@ import lombok.extern.slf4j.Slf4j; import org.apache.commons.collections4.MapUtils; import org.springframework.beans.factory.annotation.Value; -import org.springframework.web.bind.annotation.GetMapping; -import org.springframework.web.bind.annotation.RequestBody; -import org.springframework.web.bind.annotation.RequestMapping; -import org.springframework.web.bind.annotation.RestController; +import org.springframework.web.bind.annotation.*; +import tech.powerjob.common.PowerSerializable; +import tech.powerjob.common.response.AskResponse; import tech.powerjob.common.serialize.JsonUtils; import tech.powerjob.common.utils.CollectionUtils; +import tech.powerjob.remote.framework.base.URL; import tech.powerjob.server.common.utils.TestUtils; import tech.powerjob.server.core.alarm.AlarmCenter; import tech.powerjob.server.core.alarm.module.JobInstanceAlarm; import tech.powerjob.server.extension.alarm.AlarmTarget; +import tech.powerjob.server.remote.transporter.TransportService; import javax.annotation.Resource; import java.util.Map; @@ -35,6 +36,8 @@ public class TestController { @Resource private AlarmCenter alarmCenter; + @Resource + private TransportService transportService; @RequestMapping("/io") public Map io(@RequestBody Map input) { @@ -55,6 +58,24 @@ public void check() { testAlarmCenter(); } + @PostMapping("/transport") + public Object testTransportService(@RequestBody Map params) throws ClassNotFoundException { + String method = MapUtils.getString(params, "method"); + + String protocol = MapUtils.getString(params, "protocol"); + Object url = MapUtils.getObject(params, "url"); + Object request = MapUtils.getObject(params, "request"); + String requestClassName = MapUtils.getString(params, "requestClassName"); + Class requestClz = (Class) Class.forName(requestClassName); + + if ("ask".equalsIgnoreCase(method)) { + return transportService.ask(protocol, JsonUtils.toJavaObject(url, URL.class), JsonUtils.toJavaObject(request, requestClz) , AskResponse.class); + } + + transportService.tell(protocol, JsonUtils.toJavaObject(url, URL.class), (PowerSerializable) request); + return "TELL_SUCCESS"; + } + void testAlarmCenter() { JobInstanceAlarm jobInstanceAlarm = new JobInstanceAlarm().setAppId(277).setJobId(1).setInstanceId(2) .setJobName("test-alarm").setJobParams("jobParams").setInstanceParams("instanceParams") diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/UserInfoController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/UserInfoController.java index 029c653fb..8dcb66876 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/UserInfoController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/UserInfoController.java @@ -1,21 +1,45 @@ package tech.powerjob.server.web.controller; -import tech.powerjob.common.response.ResultDTO; +import com.google.common.collect.Lists; +import com.google.common.collect.Maps; +import com.google.common.collect.Sets; +import lombok.SneakyThrows; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.lang3.StringUtils; import org.springframework.beans.BeanUtils; +import org.springframework.util.CollectionUtils; +import org.springframework.web.bind.annotation.*; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.PowerJobUser; +import tech.powerjob.server.auth.Role; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.server.auth.common.PowerJobAuthException; +import tech.powerjob.server.auth.interceptor.ApiPermission; +import tech.powerjob.server.auth.service.WebAuthService; +import tech.powerjob.server.auth.service.login.PowerJobLoginService; +import tech.powerjob.common.enums.SwitchableStatus; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import tech.powerjob.server.persistence.remote.model.NamespaceDO; import tech.powerjob.server.persistence.remote.model.UserInfoDO; +import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; +import tech.powerjob.server.persistence.remote.repository.NamespaceRepository; import tech.powerjob.server.persistence.remote.repository.UserInfoRepository; -import tech.powerjob.server.core.service.UserService; +import tech.powerjob.server.web.converter.NamespaceConverter; +import tech.powerjob.server.web.converter.UserConverter; import tech.powerjob.server.web.request.ModifyUserInfoRequest; -import com.google.common.collect.Lists; -import lombok.AllArgsConstructor; -import lombok.Getter; -import lombok.NoArgsConstructor; -import org.springframework.util.CollectionUtils; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.*; +import tech.powerjob.server.web.request.QueryUserRequest; +import tech.powerjob.server.web.response.AppBaseVO; +import tech.powerjob.server.web.response.NamespaceBaseVO; +import tech.powerjob.server.web.response.UserBaseVO; +import tech.powerjob.server.web.response.UserDetailVO; +import tech.powerjob.server.web.service.UserWebService; import javax.annotation.Resource; -import java.util.List; +import javax.servlet.http.HttpServletRequest; +import java.util.*; import java.util.stream.Collectors; /** @@ -24,25 +48,64 @@ * @author tjq * @since 2020/4/12 */ + +@Slf4j @RestController @RequestMapping("/user") public class UserInfoController { @Resource - private UserService userService; + private UserWebService userWebService; @Resource private UserInfoRepository userInfoRepository; + @Resource + private PowerJobLoginService powerJobLoginService; + @Resource + private WebAuthService webAuthService; + @Resource + private NamespaceRepository namespaceRepository; + @Resource + private AppInfoRepository appInfoRepository; + + @SneakyThrows + @PostMapping("/modify") + public ResultDTO modifyUser(@RequestBody ModifyUserInfoRequest modifyUserInfoRequest, HttpServletRequest httpServletRequest) { + + Long userId = modifyUserInfoRequest.getId(); + checkModifyUserPermission(userId, httpServletRequest); + + Optional userOpt = userInfoRepository.findById(userId); + if (!userOpt.isPresent()) { + throw new IllegalArgumentException("can't find user by userId:" + userId); + } + + UserInfoDO dbUser = userOpt.get(); + + // 拷入允许修改的内容 + if (StringUtils.isNotEmpty(modifyUserInfoRequest.getNick())) { + dbUser.setNick(modifyUserInfoRequest.getNick()); + } + if (StringUtils.isNotEmpty(modifyUserInfoRequest.getPhone())) { + dbUser.setPhone(modifyUserInfoRequest.getPhone()); + } + if (StringUtils.isNotEmpty(modifyUserInfoRequest.getEmail())) { + dbUser.setEmail(modifyUserInfoRequest.getEmail()); + } + if (StringUtils.isNotEmpty(modifyUserInfoRequest.getWebHook())) { + dbUser.setWebHook(modifyUserInfoRequest.getWebHook()); + } + if (StringUtils.isNotEmpty(modifyUserInfoRequest.getExtra())) { + dbUser.setExtra(modifyUserInfoRequest.getExtra()); + } + + dbUser.setGmtModified(new Date()); + userInfoRepository.saveAndFlush(dbUser); - @PostMapping("save") - public ResultDTO save(@RequestBody ModifyUserInfoRequest request) { - UserInfoDO userInfoDO = new UserInfoDO(); - BeanUtils.copyProperties(request, userInfoDO); - userService.save(userInfoDO); return ResultDTO.success(null); } - @GetMapping("list") - public ResultDTO> list(@RequestParam(required = false) String name) { + @GetMapping("/list") + public ResultDTO> list(@RequestParam(required = false) String name) { List result; if (StringUtils.isEmpty(name)) { @@ -53,18 +116,140 @@ public ResultDTO> list(@RequestParam(required = false) String n return ResultDTO.success(convert(result)); } - private static List convert(List data) { + /** + * 查询用户信息(用于管理员操作,会返回敏感信息) + * @param queryUserRequest 查询请求 + * @return 响应 + */ + @PostMapping("/query") + @ApiPermission(name = "User-Query", roleScope = RoleScope.GLOBAL, requiredPermission = Permission.SU) + public ResultDTO> query(@RequestBody QueryUserRequest queryUserRequest) { + List userInfoDos = userWebService.list(queryUserRequest); + List userBaseVOS = userInfoDos.stream().map(x -> UserConverter.do2BaseVo(x, true)).collect(Collectors.toList()); + return ResultDTO.success(userBaseVOS); + } + + @GetMapping("/detail") + public ResultDTO getUserDetail(HttpServletRequest httpServletRequest) { + Optional powerJobUserOpt = powerJobLoginService.ifLogin(httpServletRequest); + if (!powerJobUserOpt.isPresent()) { + throw new PowerJobAuthException(ErrorCodes.USER_NOT_LOGIN); + } + Optional userinfoDoOpt = userInfoRepository.findById(powerJobUserOpt.get().getId()); + if (!userinfoDoOpt.isPresent()) { + throw new IllegalArgumentException("can't find user by id: " + powerJobUserOpt.get().getId()); + } + UserDetailVO userDetailVO = new UserDetailVO(); + BeanUtils.copyProperties(userinfoDoOpt.get(), userDetailVO); + userDetailVO.genShowName(); + + // 权限信息 + Map> globalPermissions = webAuthService.fetchMyPermissionTargets(RoleScope.GLOBAL); + userDetailVO.setGlobalRoles(globalPermissions.keySet().stream().map(Enum::name).collect(Collectors.toList())); + + Map> namespacePermissions = webAuthService.fetchMyPermissionTargets(RoleScope.NAMESPACE); + List nsList = namespaceRepository.findAllByIdIn(mergeIds(namespacePermissions)); + Map id2NamespaceDo = Maps.newHashMap(); + nsList.forEach(x -> id2NamespaceDo.put(x.getId(), x)); + Map> role2NamespaceBaseVo = Maps.newHashMap(); + namespacePermissions.forEach((k, v) -> { + List namespaceBaseVOS = Lists.newArrayList(); + role2NamespaceBaseVo.put(k.name(), namespaceBaseVOS); + v.forEach(nId -> { + NamespaceDO namespaceDO = id2NamespaceDo.get(nId); + if (namespaceDO == null) { + return; + } + NamespaceBaseVO namespaceBaseVO = NamespaceConverter.do2BaseVo(namespaceDO); + namespaceBaseVOS.add(namespaceBaseVO); + }); + }); + userDetailVO.setRole2NamespaceList(role2NamespaceBaseVo); + + Map> appPermissions = webAuthService.fetchMyPermissionTargets(RoleScope.APP); + List appList = appInfoRepository.findAllByIdIn(mergeIds(appPermissions)); + Map id2AppInfo = Maps.newHashMap(); + appList.forEach(x -> id2AppInfo.put(x.getId(), x)); + Map> role2AppBaseVo = Maps.newHashMap(); + appPermissions.forEach((k, v) -> { + List appBaseVOS = Lists.newArrayList(); + role2AppBaseVo.put(k.name(), appBaseVOS); + v.forEach(nId -> { + AppInfoDO appInfoDO = id2AppInfo.get(nId); + if (appInfoDO == null) { + return; + } + AppBaseVO appBaseVO = new AppBaseVO(); + BeanUtils.copyProperties(appInfoDO, appBaseVO); + appBaseVOS.add(appBaseVO); + }); + }); + userDetailVO.setRole2AppList(role2AppBaseVo); + + return ResultDTO.success(userDetailVO); + } + + @PostMapping("/disable") + public ResultDTO disableUser(Long uid, HttpServletRequest httpServletRequest) { + changeAccountStatus(uid, SwitchableStatus.DISABLE, httpServletRequest); + return ResultDTO.success(null); + } + + @PostMapping("/enable") + public ResultDTO enableUser(Long uid, HttpServletRequest httpServletRequest) { + changeAccountStatus(uid, SwitchableStatus.ENABLE, httpServletRequest); + return ResultDTO.success(null); + } + + private void changeAccountStatus(Long uid, SwitchableStatus targetStatus, HttpServletRequest httpServletRequest) { + checkModifyUserPermission(uid, httpServletRequest); + + Optional userOpt = userInfoRepository.findById(uid); + if (!userOpt.isPresent()) { + throw new IllegalArgumentException("can't find user by userId:" + uid); + } + + UserInfoDO dbUser = userOpt.get(); + + dbUser.setStatus(targetStatus.getV()); + dbUser.setGmtModified(new Date()); + + userInfoRepository.saveAndFlush(dbUser); + log.info("[UserInfoController] changeAccountStatus, userId={},targetStatus={}", uid, targetStatus); + } + + /** + * 检查针对 user 处理的权限 + * @param uid 目标 userId + * @param httpServletRequest http 上下文请求 + */ + private void checkModifyUserPermission(Long uid, HttpServletRequest httpServletRequest) { + Optional powerJobUserOpt = powerJobLoginService.ifLogin(httpServletRequest); + if (!powerJobUserOpt.isPresent()) { + throw new PowerJobAuthException(ErrorCodes.USER_NOT_LOGIN); + } + PowerJobUser currentLoginUser = powerJobUserOpt.get(); + + boolean myself = uid.equals(currentLoginUser.getId()); + boolean globalAdmin = webAuthService.isGlobalAdmin(); + + if (myself || globalAdmin) { + return; + } + + throw new PowerJobException("Only the administrator and account owner can modify the account"); + } + + private static List convert(List data) { if (CollectionUtils.isEmpty(data)) { return Lists.newLinkedList(); } - return data.stream().map(x -> new UserItemVO(x.getId(), x.getUsername())).collect(Collectors.toList()); + return data.stream().map(x -> UserConverter.do2BaseVo(x, false)).collect(Collectors.toList()); } - @Getter - @NoArgsConstructor - @AllArgsConstructor - public static final class UserItemVO { - private Long id; - private String username; + private static Set mergeIds(Map> map) { + Set ids = Sets.newHashSet(); + map.values().forEach(ids::addAll); + return ids; } } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/WorkflowController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/WorkflowController.java index c78c6965b..309c4fef5 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/WorkflowController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/WorkflowController.java @@ -1,26 +1,30 @@ package tech.powerjob.server.web.controller; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.web.bind.annotation.*; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.common.request.http.SaveWorkflowNodeRequest; import tech.powerjob.common.request.http.SaveWorkflowRequest; import tech.powerjob.common.response.ResultDTO; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.utils.AuthHeaderUtils; +import tech.powerjob.server.auth.interceptor.ApiPermission; +import tech.powerjob.server.core.workflow.WorkflowService; import tech.powerjob.server.persistence.PageResult; import tech.powerjob.server.persistence.remote.model.WorkflowInfoDO; import tech.powerjob.server.persistence.remote.model.WorkflowNodeInfoDO; import tech.powerjob.server.persistence.remote.repository.WorkflowInfoRepository; -import tech.powerjob.server.core.workflow.WorkflowService; import tech.powerjob.server.web.request.QueryWorkflowInfoRequest; import tech.powerjob.server.web.response.WorkflowInfoVO; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.text.ParseException; import java.util.List; -import java.util.function.LongToDoubleFunction; import java.util.stream.Collectors; /** @@ -40,35 +44,44 @@ public class WorkflowController { private WorkflowInfoRepository workflowInfoRepository; @PostMapping("/save") - public ResultDTO save(@RequestBody SaveWorkflowRequest req) throws ParseException { + @ApiPermission(name = "Workflow-Save", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO save(@RequestBody SaveWorkflowRequest req, HttpServletRequest hsr) throws ParseException { + req.setAppId(AuthHeaderUtils.fetchAppIdL(hsr)); return ResultDTO.success(workflowService.saveWorkflow(req)); } @PostMapping("/copy") - public ResultDTO copy(Long workflowId, Long appId) { - return ResultDTO.success(workflowService.copyWorkflow(workflowId,appId)); + @ApiPermission(name = "Workflow-Copy", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO copy(Long workflowId, HttpServletRequest hsr) { + return ResultDTO.success(workflowService.copyWorkflow(workflowId, AuthHeaderUtils.fetchAppIdL(hsr))); } @GetMapping("/disable") - public ResultDTO disableWorkflow(Long workflowId, Long appId) { - workflowService.disableWorkflow(workflowId, appId); + @ApiPermission(name = "Workflow-Disable", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO disableWorkflow(Long workflowId, HttpServletRequest hsr) { + workflowService.disableWorkflow(workflowId, AuthHeaderUtils.fetchAppIdL(hsr)); return ResultDTO.success(null); } @GetMapping("/enable") - public ResultDTO enableWorkflow(Long workflowId, Long appId) { - workflowService.enableWorkflow(workflowId, appId); + @ApiPermission(name = "Workflow-Enable", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO enableWorkflow(Long workflowId, HttpServletRequest hsr) { + workflowService.enableWorkflow(workflowId, AuthHeaderUtils.fetchAppIdL(hsr)); return ResultDTO.success(null); } @GetMapping("/delete") - public ResultDTO deleteWorkflow(Long workflowId, Long appId) { - workflowService.deleteWorkflow(workflowId, appId); + @ApiPermission(name = "Workflow-Delete", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO deleteWorkflow(Long workflowId, HttpServletRequest hsr) { + workflowService.deleteWorkflow(workflowId, AuthHeaderUtils.fetchAppIdL(hsr)); return ResultDTO.success(null); } @PostMapping("/list") - public ResultDTO> list(@RequestBody QueryWorkflowInfoRequest req) { + @ApiPermission(name = "Workflow-List", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO> list(@RequestBody QueryWorkflowInfoRequest req, HttpServletRequest hsr) { + + req.setAppId(AuthHeaderUtils.fetchAppIdL(hsr)); Sort sort = Sort.by(Sort.Direction.DESC, "gmtCreate"); PageRequest pageRequest = PageRequest.of(req.getIndex(), req.getPageSize(), sort); @@ -89,21 +102,26 @@ public ResultDTO> list(@RequestBody QueryWorkflowInfo } @GetMapping("/run") - public ResultDTO runWorkflow(Long workflowId, Long appId, + @ApiPermission(name = "Workflow-Run", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO runWorkflow(Long workflowId, HttpServletRequest hsr, @RequestParam(required = false,defaultValue = "0") Long delay, @RequestParam(required = false) String initParams ) { - return ResultDTO.success(workflowService.runWorkflow(workflowId, appId, initParams, delay)); + return ResultDTO.success(workflowService.runWorkflow(workflowId, AuthHeaderUtils.fetchAppIdL(hsr), initParams, delay)); } @GetMapping("/fetch") - public ResultDTO fetchWorkflow(Long workflowId, Long appId) { - WorkflowInfoDO workflowInfoDO = workflowService.fetchWorkflow(workflowId, appId); + @ApiPermission(name = "Workflow-Fetch", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO fetchWorkflow(Long workflowId, HttpServletRequest hsr) { + WorkflowInfoDO workflowInfoDO = workflowService.fetchWorkflow(workflowId, AuthHeaderUtils.fetchAppIdL(hsr)); return ResultDTO.success(WorkflowInfoVO.from(workflowInfoDO)); } @PostMapping("/saveNode") - public ResultDTO> addWorkflowNode(@RequestBody List request) { + @ApiPermission(name = "Workflow-SaveNode", roleScope = RoleScope.APP, requiredPermission = Permission.WRITE) + public ResultDTO> addWorkflowNode(@RequestBody List request, HttpServletRequest hsr) { + Long appId = AuthHeaderUtils.fetchAppIdL(hsr); + request.forEach(r -> r.setAppId(appId)); return ResultDTO.success(workflowService.saveWorkflowNode(request)); } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/WorkflowInstanceController.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/WorkflowInstanceController.java index 944737dd3..ff603a6d4 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/WorkflowInstanceController.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/controller/WorkflowInstanceController.java @@ -1,23 +1,28 @@ package tech.powerjob.server.web.controller; +import org.apache.commons.lang3.StringUtils; +import org.springframework.beans.BeanUtils; +import org.springframework.data.domain.Example; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Sort; +import org.springframework.web.bind.annotation.*; import tech.powerjob.common.enums.WorkflowInstanceStatus; import tech.powerjob.common.response.ResultDTO; +import tech.powerjob.server.auth.Permission; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.common.utils.AuthHeaderUtils; +import tech.powerjob.server.auth.interceptor.ApiPermission; +import tech.powerjob.server.core.service.CacheService; +import tech.powerjob.server.core.workflow.WorkflowInstanceService; import tech.powerjob.server.persistence.PageResult; import tech.powerjob.server.persistence.remote.model.WorkflowInstanceInfoDO; import tech.powerjob.server.persistence.remote.repository.WorkflowInstanceInfoRepository; -import tech.powerjob.server.core.service.CacheService; -import tech.powerjob.server.core.workflow.WorkflowInstanceService; import tech.powerjob.server.web.request.QueryWorkflowInstanceRequest; import tech.powerjob.server.web.response.WorkflowInstanceInfoVO; -import org.springframework.beans.BeanUtils; -import org.springframework.data.domain.Example; -import org.springframework.data.domain.Page; -import org.springframework.data.domain.PageRequest; -import org.springframework.data.domain.Sort; -import org.apache.commons.lang3.StringUtils; -import org.springframework.web.bind.annotation.*; import javax.annotation.Resource; +import javax.servlet.http.HttpServletRequest; import java.util.stream.Collectors; /** @@ -38,32 +43,40 @@ public class WorkflowInstanceController { private WorkflowInstanceInfoRepository workflowInstanceInfoRepository; @GetMapping("/stop") - public ResultDTO stopWfInstance(Long wfInstanceId, Long appId) { - workflowInstanceService.stopWorkflowInstanceEntrance(wfInstanceId, appId); + @ApiPermission(name = "WorkflowInstance-Stop", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO stopWfInstance(Long wfInstanceId, HttpServletRequest hsr) { + workflowInstanceService.stopWorkflowInstanceEntrance(wfInstanceId, AuthHeaderUtils.fetchAppIdL(hsr)); return ResultDTO.success(null); } @RequestMapping("/retry") - public ResultDTO retryWfInstance(Long wfInstanceId, Long appId) { - workflowInstanceService.retryWorkflowInstance(wfInstanceId, appId); + @ApiPermission(name = "WorkflowInstance-Retry", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO retryWfInstance(Long wfInstanceId, HttpServletRequest hsr) { + workflowInstanceService.retryWorkflowInstance(wfInstanceId, AuthHeaderUtils.fetchAppIdL(hsr)); return ResultDTO.success(null); } @RequestMapping("/markNodeAsSuccess") - public ResultDTO markNodeAsSuccess(Long wfInstanceId, Long appId, Long nodeId) { - workflowInstanceService.markNodeAsSuccess(appId, wfInstanceId, nodeId); + @ApiPermission(name = "WorkflowInstance-MarkNodeAsSuccess", roleScope = RoleScope.APP, requiredPermission = Permission.OPS) + public ResultDTO markNodeAsSuccess(Long wfInstanceId, Long nodeId, HttpServletRequest hsr) { + workflowInstanceService.markNodeAsSuccess(AuthHeaderUtils.fetchAppIdL(hsr), wfInstanceId, nodeId); return ResultDTO.success(null); } @GetMapping("/info") - public ResultDTO getInfo(Long wfInstanceId, Long appId) { - WorkflowInstanceInfoDO wfInstanceDO = workflowInstanceService.fetchWfInstance(wfInstanceId, appId); + @ApiPermission(name = "WorkflowInstance-Info", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO getInfo(Long wfInstanceId, HttpServletRequest hsr) { + WorkflowInstanceInfoDO wfInstanceDO = workflowInstanceService.fetchWfInstance(wfInstanceId, AuthHeaderUtils.fetchAppIdL(hsr)); return ResultDTO.success(WorkflowInstanceInfoVO.from(wfInstanceDO, cacheService.getWorkflowName(wfInstanceDO.getWorkflowId()))); } @PostMapping("/list") - public ResultDTO> listWfInstance(@RequestBody QueryWorkflowInstanceRequest req) { + @ApiPermission(name = "WorkflowInstance-List", roleScope = RoleScope.APP, requiredPermission = Permission.READ) + public ResultDTO> listWfInstance(@RequestBody QueryWorkflowInstanceRequest req, HttpServletRequest hsr) { + + req.setAppId(AuthHeaderUtils.fetchAppIdL(hsr)); + Sort sort = Sort.by(Sort.Direction.DESC, "gmtModified"); PageRequest pageable = PageRequest.of(req.getIndex(), req.getPageSize(), sort); diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/converter/NamespaceConverter.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/converter/NamespaceConverter.java new file mode 100644 index 000000000..ed2852c37 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/converter/NamespaceConverter.java @@ -0,0 +1,30 @@ +package tech.powerjob.server.web.converter; + +import org.springframework.beans.BeanUtils; +import tech.powerjob.common.utils.CommonUtils; +import tech.powerjob.common.enums.SwitchableStatus; +import tech.powerjob.server.persistence.remote.model.NamespaceDO; +import tech.powerjob.server.web.response.NamespaceBaseVO; + +/** + * NamespaceConverter + * + * @author tjq + * @since 2023/9/4 + */ +public class NamespaceConverter { + + public static NamespaceBaseVO do2BaseVo(NamespaceDO d) { + NamespaceBaseVO v = new NamespaceBaseVO(); + + BeanUtils.copyProperties(d, v); + + v.setGmtCreateStr(CommonUtils.formatTime(d.getGmtCreate())); + v.setGmtModifiedStr(CommonUtils.formatTime(d.getGmtModified())); + v.setStatusStr(SwitchableStatus.of(d.getStatus()).name()); + + v.genShowName(); + return v; + } + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/converter/UserConverter.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/converter/UserConverter.java new file mode 100644 index 000000000..283ba46f7 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/converter/UserConverter.java @@ -0,0 +1,37 @@ +package tech.powerjob.server.web.converter; + +import tech.powerjob.common.enums.SwitchableStatus; +import tech.powerjob.server.persistence.remote.model.UserInfoDO; +import tech.powerjob.server.web.response.UserBaseVO; + +import java.util.Optional; + +/** + * UserConverter + * + * @author tjq + * @since 2023/9/4 + */ +public class UserConverter { + + public static UserBaseVO do2BaseVo(UserInfoDO x, boolean includeSensitiveInfo) { + + UserBaseVO userBaseVO = new UserBaseVO(); + + userBaseVO.setId(x.getId()); + userBaseVO.setAccountType(x.getAccountType()); + userBaseVO.setUsername(x.getUsername()); + userBaseVO.setNick(x.getNick()); + userBaseVO.setStatus(Optional.ofNullable(x.getStatus()).orElse(SwitchableStatus.ENABLE.getV())); + userBaseVO.setEnable(userBaseVO.getStatus() == SwitchableStatus.ENABLE.getV()); + + if (includeSensitiveInfo) { + userBaseVO.setPhone(x.getPhone()); + userBaseVO.setEmail(x.getEmail()); + } + + userBaseVO.genShowName(); + return userBaseVO; + } + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/AppAssertRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/AppAssertRequest.java index 826d99ad8..bb41c4731 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/AppAssertRequest.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/AppAssertRequest.java @@ -12,4 +12,6 @@ public class AppAssertRequest { private String appName; private String password; + + private String encryptType; } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ChangePasswordRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ChangePasswordRequest.java new file mode 100644 index 000000000..60b5ddb77 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ChangePasswordRequest.java @@ -0,0 +1,23 @@ +package tech.powerjob.server.web.request; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 修改密码 + * + * @author tjq + * @since 2024/2/13 + */ +@Data +public class ChangePasswordRequest implements Serializable { + + private String username; + + private String oldPassword; + + private String newPassword; + + private String newPassword2; +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ComponentUserRoleInfo.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ComponentUserRoleInfo.java new file mode 100644 index 000000000..0b2fd9252 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ComponentUserRoleInfo.java @@ -0,0 +1,34 @@ +package tech.powerjob.server.web.request; + +import lombok.Data; +import lombok.experimental.Accessors; + +import java.util.List; + +/** + * 组件上的用户角色信息 + * + * @author tjq + * @since 2024/2/12 + */ +@Data +@Accessors(chain = true) +public class ComponentUserRoleInfo { + /** + * 观察者 + */ + private List observer; + /** + * 测试 + */ + private List qa; + /** + * 开发者 + */ + private List developer; + /** + * 管理员 + */ + private List admin; + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/GrantPermissionRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/GrantPermissionRequest.java new file mode 100644 index 000000000..cc2b71d60 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/GrantPermissionRequest.java @@ -0,0 +1,31 @@ +package tech.powerjob.server.web.request; + +import lombok.Data; + +import java.io.Serializable; +import java.util.List; + +/** + * 授权请求 + * + * @author tjq + * @since 2024/2/12 + */ +@Data +public class GrantPermissionRequest implements Serializable { + + /** + * 目标ID + */ + private Long targetId; + + /** + * 授予的角色 + */ + private Integer role; + + /** + * 授予的用户IDS + */ + private List userIds; +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyAppInfoRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyAppInfoRequest.java index 2b5aca6fc..7d86fbd07 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyAppInfoRequest.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyAppInfoRequest.java @@ -15,14 +15,41 @@ public class ModifyAppInfoRequest { private Long id; - private String oldPassword; private String appName; + + /** + * namespace 唯一标识,任选其一传递即可 + */ + private Long namespaceId; + private String namespaceCode; + + private String oldPassword; private String password; + /** + * 描述 + */ + private String title; + + /** + * 管理标签 + */ + private String tags; + /** + * 扩展字段 + */ + private String extra; + + private ComponentUserRoleInfo componentUserRoleInfo; + public void valid() { CommonUtils.requireNonNull(appName, "appName can't be empty"); if (StringUtils.containsWhitespace(appName)) { throw new PowerJobException("appName can't contains white space!"); } + CommonUtils.requireNonNull(password, "password can't be empty"); + + // 后续版本强制要求设置 namespace,方便统一管理 + CommonUtils.requireNonNull(namespaceId, "namespace can't be empty"); } } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyNamespaceRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyNamespaceRequest.java new file mode 100644 index 000000000..1edb7eb3f --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyNamespaceRequest.java @@ -0,0 +1,53 @@ +package tech.powerjob.server.web.request; + +import lombok.Data; +import org.apache.commons.lang3.StringUtils; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.utils.CommonUtils; + +/** + * ModifyNamespaceRequest + * + * @author tjq + * @since 2023/9/3 + */ +@Data +public class ModifyNamespaceRequest { + + private Long id; + + /** + * 空间唯一标识 + */ + private String code; + + /** + * 空间名称,比如中文描述(XX部门XX空间) + */ + private String name; + + private String dept; + + /** + * 标签,扩展性之王,多值逗号分割 + */ + private String tags; + + private Integer status; + + /** + * 扩展字段 + */ + private String extra; + /** + * 权限表单 + */ + private ComponentUserRoleInfo componentUserRoleInfo; + + public void valid() { + CommonUtils.requireNonNull(code, "namespace code can't be empty"); + if (StringUtils.containsWhitespace(code)) { + throw new PowerJobException("namespace code can't contains white space!"); + } + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyUserInfoRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyUserInfoRequest.java index db43e3466..428f5c848 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyUserInfoRequest.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/ModifyUserInfoRequest.java @@ -14,6 +14,7 @@ public class ModifyUserInfoRequest { private Long id; private String username; + private String nick; private String password; private String webHook; @@ -25,4 +26,6 @@ public class ModifyUserInfoRequest { * 邮箱地址 */ private String email; + + private String extra; } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryAppInfoRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryAppInfoRequest.java new file mode 100644 index 000000000..44f2886aa --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryAppInfoRequest.java @@ -0,0 +1,44 @@ +package tech.powerjob.server.web.request; + +import lombok.Data; + +/** + * 查询应用信息 + * + * @author tjq + * @since 2024/2/11 + */ +@Data +public class QueryAppInfoRequest { + + /** + * appId 精确查旋 + */ + private Long appId; + /** + * namespaceId + */ + private Long namespaceId; + /** + * 任务名称 + */ + private String appNameLike; + + private String tagLike; + + /** + * 查询与我相关的任务(我有直接权限的) + */ + private Boolean showMyRelated; + + /* ****************** 分页参数 ****************** */ + /** + * 当前页码 + */ + private Integer index; + /** + * 页大小 + */ + private Integer pageSize; + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryInstanceDetailRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryInstanceDetailRequest.java new file mode 100644 index 000000000..085a728ed --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryInstanceDetailRequest.java @@ -0,0 +1,24 @@ +package tech.powerjob.server.web.request; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 查询任务详情的请求 + * + * @author tjq + * @since 2024/2/25 + */ +@Data +public class QueryInstanceDetailRequest implements Serializable { + + private Long appId; + + private Long instanceId; + + /** + * 自定义查询条件(SQL) + */ + private String customQuery; +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryNamespaceRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryNamespaceRequest.java new file mode 100644 index 000000000..57f4d8f35 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryNamespaceRequest.java @@ -0,0 +1,35 @@ +package tech.powerjob.server.web.request; + +import lombok.Data; + +/** + * 查询 namespace 请求 + * + * @author tjq + * @since 2024/2/11 + */ +@Data +public class QueryNamespaceRequest { + + /** + * code 模糊查询 + */ + private String codeLike; + + /** + * 名称模糊查询 + */ + private String nameLike; + + private String tagLike; + + /* ****************** 分页参数 ****************** */ + /** + * 当前页码 + */ + private Integer index = 0; + /** + * 页大小 + */ + private Integer pageSize = 10; +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryUserRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryUserRequest.java new file mode 100644 index 000000000..cbb90ab53 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/QueryUserRequest.java @@ -0,0 +1,32 @@ +package tech.powerjob.server.web.request; + +import lombok.Data; + +import java.io.Serializable; + +/** + * 用户查询请求 + * + * @author tjq + * @since 2024/3/16 + */ +@Data +public class QueryUserRequest implements Serializable { + + /** + * 通过 userId 精确查询 + */ + private Long userIdEq; + + private String accountTypeEq; + + /** + * nick 模糊查询 + */ + private String nickLike; + + /** + * 手机号模糊查询 + */ + private String phoneLike; +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/SaveContainerInfoRequest.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/SaveContainerInfoRequest.java index aa734c140..ae812cc25 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/SaveContainerInfoRequest.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/request/SaveContainerInfoRequest.java @@ -2,7 +2,7 @@ import tech.powerjob.common.utils.CommonUtils; import tech.powerjob.server.common.constants.ContainerSourceType; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import lombok.Data; /** diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/AppBaseVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/AppBaseVO.java new file mode 100644 index 000000000..2c0f778f0 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/AppBaseVO.java @@ -0,0 +1,27 @@ +package tech.powerjob.server.web.response; + +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; + +/** + * AppBaseVO + * + * @author tjq + * @since 2024/2/13 + */ +@Getter +@Setter +public class AppBaseVO implements Serializable { + + protected Long id; + + protected String appName; + + protected Long namespaceId; + /** + * 描述 + */ + protected String title; +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/AppInfoVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/AppInfoVO.java new file mode 100644 index 000000000..9e08f1f29 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/AppInfoVO.java @@ -0,0 +1,47 @@ +package tech.powerjob.server.web.response; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import tech.powerjob.server.web.request.ComponentUserRoleInfo; + +import java.util.Date; + +/** + * AppInfoVO + * + * @author tjq + * @since 2024/2/12 + */ +@Getter +@Setter +@ToString +public class AppInfoVO extends AppBaseVO { + + private String password; + + private String tags; + + private String extra; + + private ComponentUserRoleInfo componentUserRoleInfo; + + private Date gmtCreate; + + private String gmtCreateStr; + + private Date gmtModified; + + private String gmtModifiedStr; + + private String creatorShowName; + + private String modifierShowName; + + /** + * Namespace Info + */ + private NamespaceBaseVO namespace; + + private String namespaceName; +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/InstanceDetailVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/InstanceDetailVO.java index 704bc9609..b85fe010f 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/InstanceDetailVO.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/InstanceDetailVO.java @@ -1,15 +1,18 @@ package tech.powerjob.server.web.response; -import tech.powerjob.common.PowerSerializable; -import tech.powerjob.common.model.InstanceDetail; -import tech.powerjob.common.utils.CommonUtils; import com.google.common.collect.Lists; import lombok.Data; import lombok.NoArgsConstructor; import org.springframework.beans.BeanUtils; import org.springframework.util.CollectionUtils; +import tech.powerjob.common.PowerSerializable; +import tech.powerjob.common.model.InstanceDetail; +import tech.powerjob.common.utils.CommonUtils; +import java.util.Collections; import java.util.List; +import java.util.Optional; +import java.util.stream.Collectors; /** * 任务实例的运行详细信息(对外展示对象) @@ -55,10 +58,24 @@ public class InstanceDetailVO { */ private String instanceParams; + /** + * “外键”,用于 OPENAPI 场景业务场景与 PowerJob 实例的绑定 + */ + private String outerKey; + /** + * 扩展属性,用于 OPENAPI 场景上下文参数的透传 + */ + private String extendValue; + /** * MR或BD任务专用 + * 事实上为 instance 的 task 统计信息,命名为 instanceTaskStats 更合理,不过出于兼容性暂时不改名称了 */ - private InstanceDetailVO.TaskDetail taskDetail; + private InstanceDetailVO.InstanceTaskStats taskDetail; + /** + * 查询出来的 Task 详细结果 + */ + private List queriedTaskDetailInfoList; /** * 秒级任务专用 */ @@ -87,10 +104,19 @@ public static class SubInstanceDetail implements PowerSerializable { */ @Data @NoArgsConstructor - public static class TaskDetail implements PowerSerializable { + public static class InstanceTaskStats implements PowerSerializable { private long totalTaskNum; private long succeedTaskNum; private long failedTaskNum; + + // 等待派发状态(仅存在 TaskTracker 数据库中) + protected Long waitingDispatchTaskNum; + // 已派发,但 ProcessorTracker 未确认,可能由于网络错误请求未送达,也有可能 ProcessorTracker 线程池满,拒绝执行 + protected Long workerUnreceivedTaskNum; + // ProcessorTracker确认接收,存在与线程池队列中,排队执行 + protected Long receivedTaskNum; + // ProcessorTracker正在执行 + protected Long runningTaskNum; } public static InstanceDetailVO from(InstanceDetail origin) { @@ -104,7 +130,7 @@ public static InstanceDetailVO from(InstanceDetail origin) { // 拷贝 TaskDetail if (origin.getTaskDetail() != null) { - TaskDetail voDetail = new TaskDetail(); + InstanceTaskStats voDetail = new InstanceTaskStats(); BeanUtils.copyProperties(origin.getTaskDetail(), voDetail); vo.setTaskDetail(voDetail); } @@ -126,6 +152,10 @@ public static InstanceDetailVO from(InstanceDetail origin) { }); } + // 拷贝 MR Task 结果 + List taskDetailInfoVOList = Optional.ofNullable(origin.getQueriedTaskDetailInfoList()).orElse(Collections.emptyList()).stream().map(TaskDetailInfoVO::from).collect(Collectors.toList()); + vo.setQueriedTaskDetailInfoList(taskDetailInfoVOList); + return vo; } } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/JobInfoVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/JobInfoVO.java index f100474c7..1a2ec6569 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/JobInfoVO.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/JobInfoVO.java @@ -7,12 +7,13 @@ import tech.powerjob.common.enums.ProcessorType; import tech.powerjob.common.enums.TimeExpressionType; import tech.powerjob.common.model.AlarmConfig; +import tech.powerjob.common.model.JobAdvancedRuntimeConfig; import tech.powerjob.common.model.LogConfig; import tech.powerjob.common.model.LifeCycle; import tech.powerjob.common.utils.CommonUtils; import tech.powerjob.server.common.SJ; import tech.powerjob.common.enums.DispatchStrategy; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.persistence.remote.model.JobInfoDO; import com.google.common.collect.Lists; import lombok.Data; @@ -142,6 +143,11 @@ public class JobInfoVO { private String dispatchStrategy; + /** + * 某种派发策略背后的具体配置,值取决于 dispatchStrategy + */ + private String dispatchStrategyConfig; + private LifeCycle lifeCycle; private AlarmConfig alarmConfig; @@ -156,6 +162,8 @@ public class JobInfoVO { */ private LogConfig logConfig; + private JobAdvancedRuntimeConfig advancedRuntimeConfig; + public static JobInfoVO from(JobInfoDO jobInfoDO) { JobInfoVO jobInfoVO = new JobInfoVO(); BeanUtils.copyProperties(jobInfoDO, jobInfoVO); @@ -194,6 +202,12 @@ public static JobInfoVO from(JobInfoDO jobInfoDO) { jobInfoVO.setLogConfig(new LogConfig()); } + if (StringUtils.isEmpty(jobInfoDO.getAdvancedRuntimeConfig())) { + jobInfoVO.setAdvancedRuntimeConfig(new JobAdvancedRuntimeConfig()); + } else { + jobInfoVO.setAdvancedRuntimeConfig(JSONObject.parseObject(jobInfoDO.getAdvancedRuntimeConfig(), JobAdvancedRuntimeConfig.class)); + } + return jobInfoVO; } } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/NamespaceBaseVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/NamespaceBaseVO.java new file mode 100644 index 000000000..b7f872c54 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/NamespaceBaseVO.java @@ -0,0 +1,58 @@ +package tech.powerjob.server.web.response; + +import lombok.Getter; +import lombok.Setter; + +import java.io.Serializable; +import java.util.Date; + +/** + * namespace 基本 VO 对象,用于列表渲染 + * + * @author tjq + * @since 2024/2/12 + */ +@Getter +@Setter +public class NamespaceBaseVO implements Serializable { + + protected Long id; + + /** + * 空间唯一标识 + */ + protected String code; + + /** + * 空间名称,比如中文描述(XX部门XX空间) + */ + protected String name; + + private String dept; + private String tags; + + /** + * 扩展字段 + */ + private String extra; + + private Integer status; + private String statusStr; + + private Date gmtCreate; + + private String gmtCreateStr; + + private Date gmtModified; + + private String gmtModifiedStr; + + /** + * 前端名称(拼接 code + name,更容易辨认) + */ + protected String showName; + + public void genShowName() { + showName = String.format("%s(%s)", name, code); + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/NamespaceVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/NamespaceVO.java new file mode 100644 index 000000000..fcd7287b2 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/NamespaceVO.java @@ -0,0 +1,31 @@ +package tech.powerjob.server.web.response; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; +import tech.powerjob.server.web.request.ComponentUserRoleInfo; + +/** + * 基础版本的命名空间 + * + * @author tjq + * @since 2023/9/3 + */ +@Getter +@Setter +@ToString +public class NamespaceVO extends NamespaceBaseVO { + + /** + * 访问 token + * 仅拥有当前 namespace 权限的访问者可见 + */ + private String token; + + private ComponentUserRoleInfo componentUserRoleInfo; + + private String creatorShowName; + + private String modifierShowName; + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/SystemOverviewVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/SystemOverviewVO.java index 0f4f95267..178550d26 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/SystemOverviewVO.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/SystemOverviewVO.java @@ -1,8 +1,6 @@ package tech.powerjob.server.web.response; -import lombok.AllArgsConstructor; import lombok.Data; -import lombok.Getter; import tech.powerjob.server.common.module.ServerInfo; /** @@ -14,6 +12,10 @@ @Data public class SystemOverviewVO { + private Long appId; + + private String appName; + private long jobCount; private long runningInstanceCount; private long failedInstanceCount; @@ -26,5 +28,12 @@ public class SystemOverviewVO { */ private String serverTime; - private ServerInfo serverInfo; + /** + * 处理当前 WEB 服务的 server 信息 + */ + private ServerInfo webServerInfo; + /** + * 调度服务器信息 + */ + private ServerInfo scheduleServerInfo; } diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/TaskDetailInfoVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/TaskDetailInfoVO.java new file mode 100644 index 000000000..b24a814b2 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/TaskDetailInfoVO.java @@ -0,0 +1,62 @@ +package tech.powerjob.server.web.response; + +import lombok.Data; +import lombok.experimental.Accessors; +import org.springframework.beans.BeanUtils; +import tech.powerjob.common.model.TaskDetailInfo; +import tech.powerjob.common.utils.CommonUtils; + +import java.io.Serializable; + +/** + * 任务详情 + * + * @author tjq + * @since 2024/2/25 + */ +@Data +@Accessors(chain = true) +public class TaskDetailInfoVO implements Serializable { + + private String taskId; + private String taskName; + /** + * 任务对象(map 的 subTask) + */ + private String taskContent; + /** + * 处理器地址 + */ + private String processorAddress; + private Integer status; + private String statusStr; + + private String result; + private Integer failedCnt; + /** + * 创建时间 + */ + private Long createdTime; + private String createdTimeStr; + /** + * 最后修改时间 + */ + private Long lastModifiedTime; + private String lastModifiedTimeStr; + /** + * ProcessorTracker 最后上报时间 + */ + private Long lastReportTime; + private String lastReportTimeStr; + + public static TaskDetailInfoVO from(TaskDetailInfo taskDetailInfo) { + TaskDetailInfoVO vo = new TaskDetailInfoVO(); + BeanUtils.copyProperties(taskDetailInfo, vo); + + vo.setCreatedTimeStr(CommonUtils.formatTime(vo.getCreatedTime())); + vo.setLastModifiedTimeStr(CommonUtils.formatTime(vo.getLastModifiedTime())); + vo.setLastReportTimeStr(CommonUtils.formatTime(vo.getLastReportTime())); + + return vo; + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/UserBaseVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/UserBaseVO.java new file mode 100644 index 000000000..83b81648a --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/UserBaseVO.java @@ -0,0 +1,58 @@ +package tech.powerjob.server.web.response; + +import lombok.Getter; +import lombok.NoArgsConstructor; +import lombok.Setter; +import org.apache.commons.lang3.StringUtils; + +/** + * 用户基础信息 + * + * @author tjq + * @since 2023/9/3 + */ +@Getter +@Setter +@NoArgsConstructor +public class UserBaseVO { + + protected Long id; + protected String username; + protected String nick; + + /** + * 账户类型 + */ + private String accountType; + + /** + * 手机号 + */ + private String phone; + /** + * 邮箱地址 + */ + private String email; + + /** + * 账号当前状态 + */ + private Integer status; + + private boolean enable; + + /** + * 前端展示名称,更容易辨认 + */ + protected String showName; + + public void genShowName() { + + if (StringUtils.isEmpty(nick)) { + showName = username; + } else { + showName = String.format("%s (%s)", nick, username); + } + } + +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/UserDetailVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/UserDetailVO.java new file mode 100644 index 000000000..8cca9ff8f --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/UserDetailVO.java @@ -0,0 +1,51 @@ +package tech.powerjob.server.web.response; + +import lombok.Getter; +import lombok.Setter; +import lombok.ToString; + +import java.util.List; +import java.util.Map; + +/** + * 用户详细信息 + * + * @author tjq + * @since 2024/2/13 + */ +@Getter +@Setter +@ToString +public class UserDetailVO extends UserBaseVO { + + + /** + * 密码 + */ + private String password; + + /** + * webHook + */ + private String webHook; + + private String originUsername; + /** + * 扩展字段 + */ + private String extra; + + /** + * 拥有的全局权限 + */ + private List globalRoles; + /** + * 拥有的 namespace 权限 + */ + private Map> role2NamespaceList; + /** + * 拥有的 app 权限 + */ + private Map> role2AppList; + +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/WorkerStatusVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/WorkerStatusVO.java index a8a6b1017..66eb2a183 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/WorkerStatusVO.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/WorkerStatusVO.java @@ -6,7 +6,7 @@ import tech.powerjob.common.utils.CommonUtils; import tech.powerjob.server.common.module.WorkerInfo; -import java.text.DecimalFormat; +import java.text.NumberFormat; /** * Worker机器状态 @@ -26,6 +26,10 @@ public class WorkerStatusVO { private String protocol; private String tag; private String lastActiveTime; + /** + * 上一次worker在线时间(取 worker 端时间) + */ + private String lastActiveWorkerTime; private Integer lightTaskTrackerNum; @@ -48,32 +52,40 @@ public class WorkerStatusVO { * 27.7%(2.9/8.0 GB) */ private static final String OTHER_FORMAT = "%s%%(%s / %s GB)"; - private static final DecimalFormat df = new DecimalFormat("#.#"); private static final double THRESHOLD = 0.8; + // 静态 NumberFormat 实例,线程安全 + private static final NumberFormat NUMBER_FORMAT; + // 静态初始化块,配置 NumberFormat 的格式 + static { + NUMBER_FORMAT = NumberFormat.getInstance(); + // 设置最小小数位数为 0 + NUMBER_FORMAT.setMinimumFractionDigits(0); + // 设置最大小数位数为 1 + NUMBER_FORMAT.setMaximumFractionDigits(1); + } public WorkerStatusVO(WorkerInfo workerInfo) { - SystemMetrics systemMetrics = workerInfo.getSystemMetrics(); this.status = 1; this.address = workerInfo.getAddress(); - this.cpuLoad = String.format(CPU_FORMAT, df.format(systemMetrics.getCpuLoad()), systemMetrics.getCpuProcessors()); + this.cpuLoad = String.format(CPU_FORMAT, NUMBER_FORMAT.format(systemMetrics.getCpuLoad()), systemMetrics.getCpuProcessors()); if (systemMetrics.getCpuLoad() > systemMetrics.getCpuProcessors() * THRESHOLD) { this.status ++; } - String menL = df.format(systemMetrics.getJvmMemoryUsage() * 100); - String menUsed = df.format(systemMetrics.getJvmUsedMemory()); - String menMax = df.format(systemMetrics.getJvmMaxMemory()); + String menL = NUMBER_FORMAT.format(systemMetrics.getJvmMemoryUsage() * 100); + String menUsed = NUMBER_FORMAT.format(systemMetrics.getJvmUsedMemory()); + String menMax = NUMBER_FORMAT.format(systemMetrics.getJvmMaxMemory()); this.memoryLoad = String.format(OTHER_FORMAT, menL, menUsed, menMax); if (systemMetrics.getJvmMemoryUsage() > THRESHOLD) { this.status ++; } - String diskL = df.format(systemMetrics.getDiskUsage() * 100); - String diskUsed = df.format(systemMetrics.getDiskUsed()); - String diskMax = df.format(systemMetrics.getDiskTotal()); + String diskL = NUMBER_FORMAT.format(systemMetrics.getDiskUsage() * 100); + String diskUsed = NUMBER_FORMAT.format(systemMetrics.getDiskUsed()); + String diskMax = NUMBER_FORMAT.format(systemMetrics.getDiskTotal()); this.diskLoad = String.format(OTHER_FORMAT, diskL, diskUsed, diskMax); if (systemMetrics.getDiskUsage() > THRESHOLD) { this.status ++; @@ -91,6 +103,7 @@ public WorkerStatusVO(WorkerInfo workerInfo) { this.protocol = workerInfo.getProtocol(); this.tag = CommonUtils.formatString(workerInfo.getTag()); this.lastActiveTime = CommonUtils.formatTime(workerInfo.getLastActiveTime()); + this.lastActiveWorkerTime = CommonUtils.formatTime(workerInfo.getLastActiveWorkerTime()); this.lightTaskTrackerNum = workerInfo.getLightTaskTrackerNum(); this.heavyTaskTrackerNum = workerInfo.getHeavyTaskTrackerNum(); this.lastOverloadTime = workerInfo.getLastOverloadTime(); diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/WorkflowInfoVO.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/WorkflowInfoVO.java index bfdcd92ca..09c74033c 100644 --- a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/WorkflowInfoVO.java +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/response/WorkflowInfoVO.java @@ -6,7 +6,7 @@ import tech.powerjob.common.model.LifeCycle; import tech.powerjob.common.model.PEWorkflowDAG; import tech.powerjob.server.common.SJ; -import tech.powerjob.server.common.constants.SwitchableStatus; +import tech.powerjob.common.enums.SwitchableStatus; import tech.powerjob.server.persistence.remote.model.WorkflowInfoDO; import lombok.Data; import org.springframework.beans.BeanUtils; diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/NamespaceWebService.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/NamespaceWebService.java new file mode 100644 index 000000000..8ff706aa4 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/NamespaceWebService.java @@ -0,0 +1,30 @@ +package tech.powerjob.server.web.service; + +import org.springframework.data.domain.Page; +import tech.powerjob.server.persistence.remote.model.NamespaceDO; +import tech.powerjob.server.web.request.ModifyNamespaceRequest; +import tech.powerjob.server.web.request.QueryNamespaceRequest; + +import java.util.List; +import java.util.Optional; + +/** + * namespace web 服务 + * + * @author tjq + * @since 2024/2/15 + */ +public interface NamespaceWebService { + + NamespaceDO save(ModifyNamespaceRequest req); + + void delete(Long id); + + Optional findById(Long id); + + Optional findByCode(String code); + + Page list(QueryNamespaceRequest queryNamespaceRequest); + + List listAll(); +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/PwjbUserWebService.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/PwjbUserWebService.java new file mode 100644 index 000000000..8b2b149d0 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/PwjbUserWebService.java @@ -0,0 +1,22 @@ +package tech.powerjob.server.web.service; + +import tech.powerjob.server.persistence.remote.model.PwjbUserInfoDO; +import tech.powerjob.server.web.request.ChangePasswordRequest; +import tech.powerjob.server.web.request.ModifyUserInfoRequest; + +import java.util.Optional; + +/** + * PwjbUserWebService + * + * @author tjq + * @since 2024/2/15 + */ +public interface PwjbUserWebService { + + PwjbUserInfoDO save(ModifyUserInfoRequest request); + + void changePassword(ChangePasswordRequest changePasswordRequest); + + Optional findByUsername(String username); +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/UserWebService.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/UserWebService.java new file mode 100644 index 000000000..4db425503 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/UserWebService.java @@ -0,0 +1,21 @@ +package tech.powerjob.server.web.service; + +import tech.powerjob.server.persistence.remote.model.UserInfoDO; +import tech.powerjob.server.web.request.QueryUserRequest; +import tech.powerjob.server.web.response.UserBaseVO; + +import java.util.List; +import java.util.Optional; + +/** + * 用户 WEB 服务 + * + * @author tjq + * @since 2024/2/17 + */ +public interface UserWebService { + + Optional fetchBaseUserInfo(Long userId); + + List list(QueryUserRequest queryUserRequest); +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/AppWebServiceImpl.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/AppWebServiceImpl.java new file mode 100644 index 000000000..cff02d470 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/AppWebServiceImpl.java @@ -0,0 +1,170 @@ +package tech.powerjob.server.web.service.impl; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import lombok.AllArgsConstructor; +import lombok.extern.slf4j.Slf4j; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.BooleanUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.exception.PowerJobExceptionLauncher; +import tech.powerjob.server.auth.LoginUserHolder; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.service.WebAuthService; +import tech.powerjob.server.common.module.WorkerInfo; +import tech.powerjob.server.core.service.AppInfoService; +import tech.powerjob.server.persistence.QueryConvertUtils; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; +import tech.powerjob.server.remote.worker.WorkerClusterQueryService; +import tech.powerjob.server.web.AppWebService; +import tech.powerjob.server.web.request.ModifyAppInfoRequest; +import tech.powerjob.server.web.request.QueryAppInfoRequest; +import tech.powerjob.server.web.service.NamespaceWebService; + +import javax.persistence.criteria.Predicate; +import java.util.*; + +/** + * AppWebService + * + * @author tjq + * @since 2024/12/8 + */ +@Slf4j +@Service +@AllArgsConstructor +public class AppWebServiceImpl implements AppWebService { + + private final WebAuthService webAuthService; + + private final AppInfoService appInfoService; + private final AppInfoRepository appInfoRepository; + + private final NamespaceWebService namespaceWebService; + + private final WorkerClusterQueryService workerClusterQueryService; + + @Override + public AppInfoDO save(ModifyAppInfoRequest req) { + // 根据 ns code 填充 namespaceId(自动化创建过程中,固定的 namespace-code 对用户更友好) + if (StringUtils.isNotEmpty(req.getNamespaceCode())) { + namespaceWebService.findByCode(req.getNamespaceCode()).ifPresent(x -> req.setNamespaceId(x.getId())); + } + + req.valid(); + AppInfoDO appInfoDO; + + Long id = req.getId(); + if (id == null) { + + // 前置校验,防止部分没加唯一索引的 DB 重复创建记录导致异常 + appInfoRepository.findByAppName(req.getAppName()).ifPresent(x -> new PowerJobExceptionLauncher(ErrorCodes.ILLEGAL_ARGS_ERROR, String.format("App[%s] already exists", req.getAppName()))); + + appInfoDO = new AppInfoDO(); + appInfoDO.setGmtCreate(new Date()); + appInfoDO.setCreator(LoginUserHolder.getUserId()); + + } else { + appInfoDO = appInfoService.findById(id, false).orElseThrow(() -> new IllegalArgumentException("can't find appInfo by id:" + id)); + + // 不允许修改 appName + if (!appInfoDO.getAppName().equalsIgnoreCase(req.getAppName())) { + throw new IllegalArgumentException("NOT_ALLOW_CHANGE_THE_APP_NAME"); + } + } + + appInfoDO.setAppName(req.getAppName()); + appInfoDO.setTitle(req.getTitle()); + appInfoDO.setPassword(req.getPassword()); + appInfoDO.setNamespaceId(req.getNamespaceId()); + appInfoDO.setTags(req.getTags()); + appInfoDO.setExtra(req.getExtra()); + + appInfoDO.setGmtModified(new Date()); + appInfoDO.setModifier(LoginUserHolder.getUserId()); + + AppInfoDO savedAppInfo = appInfoService.save(appInfoDO); + + // 重新授权 + webAuthService.processPermissionOnSave(RoleScope.APP, savedAppInfo.getId(), req.getComponentUserRoleInfo()); + return savedAppInfo; + } + + @Override + public void delete(Long appId) { + log.warn("[AppInfoController] try to delete app: {}", appId); + + List allAliveWorkers = workerClusterQueryService.getAllAliveWorkers(appId); + if (CollectionUtils.isNotEmpty(allAliveWorkers)) { + throw new PowerJobException(ErrorCodes.OPERATION_NOT_PERMITTED, "Unable to delete apps with live workers, Please remove the worker dependency first!"); + } + + appInfoService.deleteById(appId); + log.warn("[AppInfoController] delete app[id={}] successfully!", appId); + } + + @Override + public Optional findByAppName(String appName) { + return appInfoRepository.findByAppName(appName); + } + + @Override + public Page list(QueryAppInfoRequest queryAppInfoRequest) { + Pageable pageable = PageRequest.of(queryAppInfoRequest.getIndex(), queryAppInfoRequest.getPageSize()); + + // 相关权限(先查处关联 ids) + Set queryAppIds; + Boolean showMyRelated = queryAppInfoRequest.getShowMyRelated(); + if (BooleanUtils.isTrue(showMyRelated)) { + Set targetIds = Sets.newHashSet(); + webAuthService.fetchMyPermissionTargets(RoleScope.APP).values().forEach(targetIds::addAll); + queryAppIds = targetIds; + + if (CollectionUtils.isEmpty(queryAppIds)) { + return Page.empty(); + } + + } else { + queryAppIds = Collections.emptySet(); + } + + Specification specification = (root, query, criteriaBuilder) -> { + List predicates = Lists.newArrayList(); + + Long appId = queryAppInfoRequest.getAppId(); + Long namespaceId = queryAppInfoRequest.getNamespaceId(); + + if (appId != null) { + predicates.add(criteriaBuilder.equal(root.get("id"), appId)); + } + + if (namespaceId != null) { + predicates.add(criteriaBuilder.equal(root.get("namespaceId"), namespaceId)); + } + + if (StringUtils.isNotEmpty(queryAppInfoRequest.getAppNameLike())) { + predicates.add(criteriaBuilder.like(root.get("appName"), QueryConvertUtils.convertLikeParams(queryAppInfoRequest.getAppNameLike()))); + } + + if (StringUtils.isNotEmpty(queryAppInfoRequest.getTagLike())) { + predicates.add(criteriaBuilder.like(root.get("tags"), QueryConvertUtils.convertLikeParams(queryAppInfoRequest.getTagLike()))); + } + + if (!queryAppIds.isEmpty()) { + predicates.add(criteriaBuilder.in(root.get("id")).value(queryAppIds)); + } + + return query.where(predicates.toArray(new Predicate[0])).getRestriction(); + }; + + return appInfoRepository.findAll(specification, pageable); + } +} \ No newline at end of file diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/NamespaceWebServiceImpl.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/NamespaceWebServiceImpl.java new file mode 100644 index 000000000..e376adf2a --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/NamespaceWebServiceImpl.java @@ -0,0 +1,168 @@ +package tech.powerjob.server.web.service.impl; + +import com.google.common.collect.Lists; +import org.apache.commons.collections4.CollectionUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.domain.Page; +import org.springframework.data.domain.PageRequest; +import org.springframework.data.domain.Pageable; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.common.enums.SwitchableStatus; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.exception.PowerJobExceptionLauncher; +import tech.powerjob.server.auth.LoginUserHolder; +import tech.powerjob.server.auth.RoleScope; +import tech.powerjob.server.auth.service.WebAuthService; +import tech.powerjob.server.common.SJ; +import tech.powerjob.server.persistence.QueryConvertUtils; +import tech.powerjob.server.persistence.remote.model.AppInfoDO; +import tech.powerjob.server.persistence.remote.model.NamespaceDO; +import tech.powerjob.server.persistence.remote.repository.AppInfoRepository; +import tech.powerjob.server.persistence.remote.repository.NamespaceRepository; +import tech.powerjob.server.web.request.ModifyNamespaceRequest; +import tech.powerjob.server.web.request.QueryNamespaceRequest; +import tech.powerjob.server.web.service.NamespaceWebService; + +import javax.annotation.Resource; +import javax.persistence.criteria.Predicate; +import java.util.Date; +import java.util.List; +import java.util.Optional; +import java.util.UUID; +import java.util.stream.Collectors; + +/** + * NamespaceWebService + * + * @author tjq + * @since 2024/2/15 + */ +@Service +public class NamespaceWebServiceImpl implements NamespaceWebService { + + @Resource + private WebAuthService webAuthService; + @Resource + private AppInfoRepository appInfoRepository; + @Resource + private NamespaceRepository namespaceRepository; + + @Override + public NamespaceDO save(ModifyNamespaceRequest req) { + req.valid(); + + Long id = req.getId(); + NamespaceDO namespaceDO; + + boolean isCreate = id == null; + + if (isCreate) { + + namespaceRepository.findByCode(req.getCode()).ifPresent(x -> new PowerJobExceptionLauncher(ErrorCodes.ILLEGAL_ARGS_ERROR, String.format("namespace[%s] already exists", req.getCode()))); + + namespaceDO = new NamespaceDO(); + namespaceDO.setGmtCreate(new Date()); + + // code 单独拷贝 + namespaceDO.setCode(req.getCode()); + // 创建时生成 token + namespaceDO.setToken(UUID.randomUUID().toString()); + namespaceDO.setCreator(LoginUserHolder.getUserId()); + + } else { + namespaceDO = fetchById(id); + namespaceDO.setModifier(LoginUserHolder.getUserId()); + + if (!namespaceDO.getCode().equalsIgnoreCase(req.getCode())) { + throw new IllegalArgumentException("NOT_ALLOW_CHANGE_THE_NAMESPACE_CODE"); + } + } + + // 拷贝通用变更属性(code 不允许更改) + namespaceDO.setTags(req.getTags()); + namespaceDO.setName(req.getName()); + namespaceDO.setExtra(req.getExtra()); + namespaceDO.setStatus(Optional.ofNullable(req.getStatus()).orElse(SwitchableStatus.ENABLE.getV())); + + namespaceDO.setGmtModified(new Date()); + NamespaceDO savedNamespace = namespaceRepository.save(namespaceDO); + + // 授权 + webAuthService.processPermissionOnSave(RoleScope.NAMESPACE, savedNamespace.getId(), req.getComponentUserRoleInfo()); + + return savedNamespace; + } + + @Override + public void delete(Long id) { + List appInfosInNamespace = appInfoRepository.findAllByNamespaceId(id); + if (CollectionUtils.isNotEmpty(appInfosInNamespace)) { + List relatedApps = appInfosInNamespace.stream().map(AppInfoDO::getAppName).collect(Collectors.toList()); + throw new PowerJobException("Unable to delete due to associated apps: " + SJ.COMMA_JOINER.join(relatedApps)); + } + + namespaceRepository.deleteById(id); + } + + @Override + public Optional findById(Long id) { + if (id == null) { + return Optional.empty(); + } + return namespaceRepository.findById(id); + } + + @Override + public Optional findByCode(String code) { + if (StringUtils.isEmpty(code)) { + return Optional.empty(); + } + return namespaceRepository.findByCode(code); + } + + @Override + public Page list(QueryNamespaceRequest queryNamespaceRequest) { + String codeLike = queryNamespaceRequest.getCodeLike(); + String nameLike = queryNamespaceRequest.getNameLike(); + String tagLike = queryNamespaceRequest.getTagLike(); + + Pageable pageable = PageRequest.of(queryNamespaceRequest.getIndex(), queryNamespaceRequest.getPageSize()); + Specification specification = (root, query, cb) -> { + + List predicates = Lists.newArrayList(); + + if (StringUtils.isNotEmpty(codeLike)) { + predicates.add(cb.like(root.get("code"), QueryConvertUtils.convertLikeParams(codeLike))); + } + + if (StringUtils.isNotEmpty(nameLike)) { + predicates.add(cb.like(root.get("name"), QueryConvertUtils.convertLikeParams(nameLike))); + } + if (StringUtils.isNotEmpty(tagLike)) { + predicates.add(cb.like(root.get("tags"), QueryConvertUtils.convertLikeParams(tagLike))); + } + + if (predicates.isEmpty()) { + return null; + } + return query.where(predicates.toArray(new Predicate[0])).getRestriction(); + }; + + return namespaceRepository.findAll(specification, pageable); + } + + @Override + public List listAll() { + return namespaceRepository.findAll(); + } + + private NamespaceDO fetchById(Long id) { + Optional namespaceDoOpt = namespaceRepository.findById(id); + if (!namespaceDoOpt.isPresent()) { + throw new IllegalArgumentException("can't find namespace by id: " + id); + } + return namespaceDoOpt.get(); + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/PwjbUserWebServiceImplImpl.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/PwjbUserWebServiceImplImpl.java new file mode 100644 index 000000000..cf40df0cf --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/PwjbUserWebServiceImplImpl.java @@ -0,0 +1,129 @@ +package tech.powerjob.server.web.service.impl; + +import com.google.common.collect.Lists; +import com.google.common.collect.Sets; +import lombok.SneakyThrows; +import org.apache.commons.collections4.MapUtils; +import org.apache.commons.lang3.StringUtils; +import org.springframework.stereotype.Service; +import tech.powerjob.common.PowerJobDKey; +import tech.powerjob.common.enums.ErrorCodes; +import tech.powerjob.common.exception.PowerJobException; +import tech.powerjob.common.serialize.JsonUtils; +import tech.powerjob.common.utils.CommonUtils; +import tech.powerjob.common.utils.DigestUtils; +import tech.powerjob.server.auth.common.PowerJobAuthException; +import tech.powerjob.server.common.SJ; +import tech.powerjob.server.common.constants.ExtensionKey; +import tech.powerjob.server.persistence.remote.model.PwjbUserInfoDO; +import tech.powerjob.server.persistence.remote.repository.PwjbUserInfoRepository; +import tech.powerjob.server.web.request.ChangePasswordRequest; +import tech.powerjob.server.web.request.ModifyUserInfoRequest; +import tech.powerjob.server.web.service.PwjbUserWebService; + +import javax.annotation.Resource; +import java.util.Date; +import java.util.Map; +import java.util.Optional; +import java.util.Set; + +/** + * PwjbUserWebService + * + * @author tjq + * @since 2024/2/15 + */ +@Service +public class PwjbUserWebServiceImplImpl implements PwjbUserWebService { + + @Resource + private PwjbUserInfoRepository pwjbUserInfoRepository; + + private static final Set NOT_ALLOWED_CHANGE_PASSWORD_ACCOUNTS = Sets.newHashSet("powerjob_trial_account"); + + @Override + @SneakyThrows + public PwjbUserInfoDO save(ModifyUserInfoRequest request) { + String username = request.getUsername(); + CommonUtils.requireNonNull(username, "userName can't be null or empty!"); + CommonUtils.requireNonNull(request.getPassword(), "password can't be null or empty!"); + + Optional oldUserOpt = pwjbUserInfoRepository.findByUsername(username); + if (oldUserOpt.isPresent()) { + throw new IllegalArgumentException("username already exist, please change one!"); + } + + PwjbUserInfoDO pwjbUserInfoDO = new PwjbUserInfoDO(); + + pwjbUserInfoDO.setUsername(username); + pwjbUserInfoDO.setGmtCreate(new Date()); + pwjbUserInfoDO.setGmtModified(new Date()); + + // 二次加密密码 + final String password = request.getPassword(); + if (StringUtils.isNotEmpty(password)) { + pwjbUserInfoDO.setPassword(DigestUtils.rePassword(password, pwjbUserInfoDO.getUsername())); + } + + // 其他参数存入 extra,在回调创建真正的内部 USER 时回填 + ModifyUserInfoRequest cpRequest = JsonUtils.parseObject(JsonUtils.toJSONString(request), ModifyUserInfoRequest.class); + cpRequest.setPassword(null); + cpRequest.setUsername(null); + cpRequest.setNick(null); + pwjbUserInfoDO.setExtra(JsonUtils.toJSONString(cpRequest)); + + return pwjbUserInfoRepository.save(pwjbUserInfoDO); + } + + @Override + public void changePassword(ChangePasswordRequest changePasswordRequest) { + if (!StringUtils.equals(changePasswordRequest.getNewPassword(), changePasswordRequest.getNewPassword2())) { + throw new IllegalArgumentException("Inconsistent passwords"); + } + + String username = changePasswordRequest.getUsername(); + Optional userOpt = pwjbUserInfoRepository.findByUsername(username); + if (!userOpt.isPresent()) { + throw new IllegalArgumentException("can't find user by username: " + username); + } + + PwjbUserInfoDO dbUser = userOpt.get(); + String oldPasswordInDb = dbUser.getPassword(); + String oldPasswordInReq = DigestUtils.rePassword(changePasswordRequest.getOldPassword(), dbUser.getUsername()); + if (!StringUtils.equals(oldPasswordInDb, oldPasswordInReq)) { + throw new PowerJobAuthException(ErrorCodes.INCORRECT_PASSWORD); + } + + // 不允许修改密码判定 + String extra = dbUser.getExtra(); + if (StringUtils.isNotEmpty(extra)) { + ModifyUserInfoRequest originRequest = JsonUtils.parseObjectUnsafe(extra, ModifyUserInfoRequest.class); + if (StringUtils.isNotEmpty(originRequest.getExtra())) { + Map extraMap = JsonUtils.parseMap(originRequest.getExtra()); + boolean allowedChangePwd = MapUtils.getBoolean(extraMap, ExtensionKey.PwjbUser.allowedChangePwd, true); + if (!allowedChangePwd) { + throw new PowerJobException(ErrorCodes.OPERATION_NOT_PERMITTED, "notAllowedChangePassword"); + } + } + } + + // 测试账号特殊处理 + Set testAccounts = Sets.newHashSet(NOT_ALLOWED_CHANGE_PASSWORD_ACCOUNTS); + String testAccountsStr = System.getProperty(PowerJobDKey.SERVER_TEST_ACCOUNT_USERNAME); + if (StringUtils.isNotEmpty(testAccountsStr)) { + testAccounts.addAll(Lists.newArrayList(SJ.COMMA_SPLITTER.split(testAccountsStr))); + } + if (testAccounts.contains(username)) { + throw new IllegalArgumentException("this account not allowed change the password"); + } + + dbUser.setPassword(DigestUtils.rePassword(changePasswordRequest.getNewPassword(), dbUser.getUsername())); + dbUser.setGmtModified(new Date()); + pwjbUserInfoRepository.saveAndFlush(dbUser); + } + + @Override + public Optional findByUsername(String username) { + return pwjbUserInfoRepository.findByUsername(username); + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/UserWebServiceImpl.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/UserWebServiceImpl.java new file mode 100644 index 000000000..04cc38128 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/impl/UserWebServiceImpl.java @@ -0,0 +1,103 @@ +package tech.powerjob.server.web.service.impl; + +import com.google.common.cache.Cache; +import com.google.common.cache.CacheBuilder; +import com.google.common.collect.Lists; +import org.apache.commons.lang3.StringUtils; +import org.springframework.data.jpa.domain.Specification; +import org.springframework.stereotype.Service; +import tech.powerjob.server.persistence.QueryConvertUtils; +import tech.powerjob.server.persistence.remote.model.UserInfoDO; +import tech.powerjob.server.persistence.remote.repository.UserInfoRepository; +import tech.powerjob.server.web.converter.UserConverter; +import tech.powerjob.server.web.request.QueryUserRequest; +import tech.powerjob.server.web.response.UserBaseVO; +import tech.powerjob.server.web.service.UserWebService; + +import javax.annotation.Resource; +import javax.persistence.criteria.Predicate; +import java.util.List; +import java.util.Optional; +import java.util.concurrent.TimeUnit; + +/** + * UserWebService + * + * @author tjq + * @since 2024/2/17 + */ +@Service +public class UserWebServiceImpl implements UserWebService { + + /** + * 展示用的 user 查询缓存,对延迟不敏感 + */ + private final Cache userCache4Show = CacheBuilder.newBuilder() + .softValues() + .maximumSize(256) + .expireAfterWrite(3, TimeUnit.MINUTES) + .build(); + + @Resource + private UserInfoRepository userInfoRepository; + + @Override + public Optional fetchBaseUserInfo(Long userId) { + + if (userId == null) { + return Optional.empty(); + } + + try { + UserInfoDO userInfoDO = userCache4Show.get(userId, () -> { + Optional userInfoOpt = userInfoRepository.findById(userId); + if (userInfoOpt.isPresent()) { + return userInfoOpt.get(); + } + throw new IllegalArgumentException("can't find user by userId: " + userId); + }); + + return Optional.of(UserConverter.do2BaseVo(userInfoDO, false)); + } catch (Exception e) { + return Optional.empty(); + } + } + + @Override + public List list(QueryUserRequest q) { + + Long userIdEq = q.getUserIdEq(); + String accountTypeEq = q.getAccountTypeEq(); + String nickLike = q.getNickLike(); + String phoneLike = q.getPhoneLike(); + + + Specification specification = (root, query, cb) -> { + + List predicates = Lists.newArrayList(); + + if (userIdEq != null) { + predicates.add(cb.equal(root.get("id"), userIdEq)); + } + + if (StringUtils.isNotEmpty(accountTypeEq)) { + predicates.add(cb.equal(root.get("accountType"), accountTypeEq)); + } + + if (StringUtils.isNotEmpty(nickLike)) { + predicates.add(cb.like(root.get("nick"), QueryConvertUtils.convertLikeParams(nickLike))); + } + + if (StringUtils.isNotEmpty(phoneLike)) { + predicates.add(cb.like(root.get("phone"), QueryConvertUtils.convertLikeParams(phoneLike))); + } + + if (predicates.isEmpty()) { + return null; + } + return query.where(predicates.toArray(new Predicate[0])).getRestriction(); + }; + + return userInfoRepository.findAll(specification); + } +} diff --git a/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/z-package-info.java b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/z-package-info.java new file mode 100644 index 000000000..e1f263ce5 --- /dev/null +++ b/powerjob-server/powerjob-server-starter/src/main/java/tech/powerjob/server/web/service/z-package-info.java @@ -0,0 +1,9 @@ +/** + * 处理 WEB 服务的 service 层 + * 如果有共用逻辑可以单独抽成 service,否则直接写在 controller 即可。PowerJob 的 WEB 领域模型不复杂,没必要过度封装。 + * LESS IS MORE + * + * @author tjq + * @since 2024/2/15 + */ +package tech.powerjob.server.web.service; \ No newline at end of file diff --git a/powerjob-server/powerjob-server-starter/src/main/resources/application-daily.properties b/powerjob-server/powerjob-server-starter/src/main/resources/application-daily.properties index a2285ddd4..6722e8b71 100644 --- a/powerjob-server/powerjob-server-starter/src/main/resources/application-daily.properties +++ b/powerjob-server/powerjob-server-starter/src/main/resources/application-daily.properties @@ -12,7 +12,7 @@ spring.datasource.core.minimum-idle=5 ####### Storage properties(Delete if not needed) ####### #oms.storage.dfs.mongodb.uri=mongodb+srv://zqq:No1Bug2Please3!@cluster0.wie54.gcp.mongodb.net/powerjob_daily?retryWrites=true&w=majority oms.storage.dfs.mysql_series.driver=com.mysql.cj.jdbc.Driver -oms.storage.dfs.mysql_series.url=jdbc:mysql://localhost:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai +oms.storage.dfs.mysql_series.url=jdbc:mysql://powerjob-mysql:3306/powerjob-daily?useUnicode=true&characterEncoding=UTF-8&serverTimezone=Asia/Shanghai oms.storage.dfs.mysql_series.username=root oms.storage.dfs.mysql_series.password=No1Bug2Please3! oms.storage.dfs.mysql_series.auto_create_table=true diff --git a/powerjob-server/powerjob-server-starter/src/main/resources/application-product.properties b/powerjob-server/powerjob-server-starter/src/main/resources/application-product.properties index efd5a6379..9557f5d8b 100644 --- a/powerjob-server/powerjob-server-starter/src/main/resources/application-product.properties +++ b/powerjob-server/powerjob-server-starter/src/main/resources/application-product.properties @@ -10,7 +10,7 @@ spring.datasource.core.maximum-pool-size=20 spring.datasource.core.minimum-idle=5 ####### Storage properties(Delete if not needed) ####### -oms.storage.dfs.mongodb.uri=mongodb://localhost:27017/powerjob-product +#oms.storage.dfs.mongodb.uri=mongodb://localhost:27017/powerjob-product ####### Email properties(Non-core configuration properties) ####### ####### Delete the following code to disable the mail ####### diff --git a/powerjob-server/powerjob-server-starter/src/main/resources/application.properties b/powerjob-server/powerjob-server-starter/src/main/resources/application.properties index 1b74735bd..5e5c34895 100644 --- a/powerjob-server/powerjob-server-starter/src/main/resources/application.properties +++ b/powerjob-server/powerjob-server-starter/src/main/resources/application.properties @@ -14,9 +14,14 @@ spring.servlet.multipart.max-file-size=209715200 spring.servlet.multipart.max-request-size=209715200 ###### PowerJob transporter configuration ###### -oms.transporter.active.protocols=AKKA,HTTP +oms.transporter.active.protocols=AKKA,HTTP,MU oms.transporter.main.protocol=HTTP oms.akka.port=10086 oms.http.port=10010 +oms.mu.port=10077 # Prefix for all tables. Default empty string. Config if you have needs, i.e. pj_ -oms.table-prefix= \ No newline at end of file +oms.table-prefix= + +###### PowerJob User and Permission Configuration Configuration ###### +oms.auth.initiliaze.admin.password=powerjob_admin +oms.auth.openapi.enable=false \ No newline at end of file diff --git a/powerjob-server/powerjob-server-starter/src/main/resources/static/img/banner.f4c75b86.jpg b/powerjob-server/powerjob-server-starter/src/main/resources/static/img/banner.f4c75b86.jpg deleted file mode 100644 index 5ea2145a0..000000000 Binary files a/powerjob-server/powerjob-server-starter/src/main/resources/static/img/banner.f4c75b86.jpg and /dev/null differ diff --git a/powerjob-server/powerjob-server-starter/src/main/resources/static/index.html b/powerjob-server/powerjob-server-starter/src/main/resources/static/index.html index 8d9337868..89a0076b3 100644 --- a/powerjob-server/powerjob-server-starter/src/main/resources/static/index.html +++ b/powerjob-server/powerjob-server-starter/src/main/resources/static/index.html @@ -4,14 +4,14 @@ - + PowerJob - +
- + diff --git a/powerjob-server/powerjob-server-starter/src/main/resources/static/js/0.js b/powerjob-server/powerjob-server-starter/src/main/resources/static/js/0.js index 34fa4418b..0bfde9e9c 100644 --- a/powerjob-server/powerjob-server-starter/src/main/resources/static/js/0.js +++ b/powerjob-server/powerjob-server-starter/src/main/resources/static/js/0.js @@ -8,7 +8,7 @@ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blue\", function() { return blue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cyan\", function() { return cyan; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geekblue\", function() { return geekblue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generate\", function() { return generate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gold\", function() { return gold; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"green\", function() { return green; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"grey\", function() { return grey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lime\", function() { return lime; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"magenta\", function() { return magenta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orange\", function() { return orange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"presetDarkPalettes\", function() { return presetDarkPalettes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"presetPalettes\", function() { return presetPalettes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"presetPrimaryColors\", function() { return presetPrimaryColors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"purple\", function() { return purple; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"red\", function() { return red; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"volcano\", function() { return volcano; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"yellow\", function() { return yellow; });\n/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tinycolor2 */ \"./node_modules/tinycolor2/tinycolor.js\");\n/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar hueStep = 2; // 色相阶梯\n\nvar saturationStep = 0.16; // 饱和度阶梯,浅色部分\n\nvar saturationStep2 = 0.05; // 饱和度阶梯,深色部分\n\nvar brightnessStep1 = 0.05; // 亮度阶梯,浅色部分\n\nvar brightnessStep2 = 0.15; // 亮度阶梯,深色部分\n\nvar lightColorCount = 5; // 浅色数量,主色上\n\nvar darkColorCount = 4; // 深色数量,主色下\n// 暗色主题颜色映射关系表\n\nvar darkColorMap = [{\n index: 7,\n opacity: 0.15\n}, {\n index: 6,\n opacity: 0.25\n}, {\n index: 5,\n opacity: 0.3\n}, {\n index: 5,\n opacity: 0.45\n}, {\n index: 5,\n opacity: 0.65\n}, {\n index: 5,\n opacity: 0.85\n}, {\n index: 4,\n opacity: 0.9\n}, {\n index: 3,\n opacity: 0.95\n}, {\n index: 2,\n opacity: 0.97\n}, {\n index: 1,\n opacity: 0.98\n}];\n\nfunction getHue(hsv, i, light) {\n var hue; // 根据色相不同,色相转向不同\n\n if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {\n hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;\n } else {\n hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;\n }\n\n if (hue < 0) {\n hue += 360;\n } else if (hue >= 360) {\n hue -= 360;\n }\n\n return hue;\n}\n\nfunction getSaturation(hsv, i, light) {\n // grey color don't change saturation\n if (hsv.h === 0 && hsv.s === 0) {\n return hsv.s;\n }\n\n var saturation;\n\n if (light) {\n saturation = hsv.s - saturationStep * i;\n } else if (i === darkColorCount) {\n saturation = hsv.s + saturationStep;\n } else {\n saturation = hsv.s + saturationStep2 * i;\n } // 边界值修正\n\n\n if (saturation > 1) {\n saturation = 1;\n } // 第一格的 s 限制在 0.06-0.1 之间\n\n\n if (light && i === lightColorCount && saturation > 0.1) {\n saturation = 0.1;\n }\n\n if (saturation < 0.06) {\n saturation = 0.06;\n }\n\n return Number(saturation.toFixed(2));\n}\n\nfunction getValue(hsv, i, light) {\n var value;\n\n if (light) {\n value = hsv.v + brightnessStep1 * i;\n } else {\n value = hsv.v - brightnessStep2 * i;\n }\n\n if (value > 1) {\n value = 1;\n }\n\n return Number(value.toFixed(2));\n}\n\nfunction generate(color) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var patterns = [];\n var pColor = tinycolor2__WEBPACK_IMPORTED_MODULE_0___default()(color);\n\n for (var i = lightColorCount; i > 0; i -= 1) {\n var hsv = pColor.toHsv();\n var colorString = tinycolor2__WEBPACK_IMPORTED_MODULE_0___default()({\n h: getHue(hsv, i, true),\n s: getSaturation(hsv, i, true),\n v: getValue(hsv, i, true)\n }).toHexString();\n patterns.push(colorString);\n }\n\n patterns.push(pColor.toHexString());\n\n for (var _i = 1; _i <= darkColorCount; _i += 1) {\n var _hsv = pColor.toHsv();\n\n var _colorString = tinycolor2__WEBPACK_IMPORTED_MODULE_0___default()({\n h: getHue(_hsv, _i),\n s: getSaturation(_hsv, _i),\n v: getValue(_hsv, _i)\n }).toHexString();\n\n patterns.push(_colorString);\n } // dark theme patterns\n\n\n if (opts.theme === 'dark') {\n return darkColorMap.map(function (_ref) {\n var index = _ref.index,\n opacity = _ref.opacity;\n var darkColorString = tinycolor2__WEBPACK_IMPORTED_MODULE_0___default.a.mix(opts.backgroundColor || '#141414', patterns[index], opacity * 100).toHexString();\n return darkColorString;\n });\n }\n\n return patterns;\n}\n\nvar presetPrimaryColors = {\n red: '#F5222D',\n volcano: '#FA541C',\n orange: '#FA8C16',\n gold: '#FAAD14',\n yellow: '#FADB14',\n lime: '#A0D911',\n green: '#52C41A',\n cyan: '#13C2C2',\n blue: '#1890FF',\n geekblue: '#2F54EB',\n purple: '#722ED1',\n magenta: '#EB2F96',\n grey: '#666666'\n};\nvar presetPalettes = {};\nvar presetDarkPalettes = {};\nObject.keys(presetPrimaryColors).forEach(function (key) {\n presetPalettes[key] = generate(presetPrimaryColors[key]);\n presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes\n\n presetDarkPalettes[key] = generate(presetPrimaryColors[key], {\n theme: 'dark',\n backgroundColor: '#141414'\n });\n presetDarkPalettes[key].primary = presetDarkPalettes[key][5];\n});\nvar red = presetPalettes.red;\nvar volcano = presetPalettes.volcano;\nvar gold = presetPalettes.gold;\nvar orange = presetPalettes.orange;\nvar yellow = presetPalettes.yellow;\nvar lime = presetPalettes.lime;\nvar green = presetPalettes.green;\nvar cyan = presetPalettes.cyan;\nvar blue = presetPalettes.blue;\nvar geekblue = presetPalettes.geekblue;\nvar purple = presetPalettes.purple;\nvar magenta = presetPalettes.magenta;\nvar grey = presetPalettes.grey;\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@ant-design/colors/dist/index.esm.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blue\", function() { return blue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cyan\", function() { return cyan; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"geekblue\", function() { return geekblue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generate\", function() { return generate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gold\", function() { return gold; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"green\", function() { return green; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"grey\", function() { return grey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lime\", function() { return lime; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"magenta\", function() { return magenta; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orange\", function() { return orange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"presetDarkPalettes\", function() { return presetDarkPalettes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"presetPalettes\", function() { return presetPalettes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"presetPrimaryColors\", function() { return presetPrimaryColors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"purple\", function() { return purple; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"red\", function() { return red; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"volcano\", function() { return volcano; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"yellow\", function() { return yellow; });\n/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tinycolor2 */ \"./node_modules/tinycolor2/cjs/tinycolor.js\");\n/* harmony import */ var tinycolor2__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(tinycolor2__WEBPACK_IMPORTED_MODULE_0__);\n\n\nvar hueStep = 2; // 色相阶梯\n\nvar saturationStep = 0.16; // 饱和度阶梯,浅色部分\n\nvar saturationStep2 = 0.05; // 饱和度阶梯,深色部分\n\nvar brightnessStep1 = 0.05; // 亮度阶梯,浅色部分\n\nvar brightnessStep2 = 0.15; // 亮度阶梯,深色部分\n\nvar lightColorCount = 5; // 浅色数量,主色上\n\nvar darkColorCount = 4; // 深色数量,主色下\n// 暗色主题颜色映射关系表\n\nvar darkColorMap = [{\n index: 7,\n opacity: 0.15\n}, {\n index: 6,\n opacity: 0.25\n}, {\n index: 5,\n opacity: 0.3\n}, {\n index: 5,\n opacity: 0.45\n}, {\n index: 5,\n opacity: 0.65\n}, {\n index: 5,\n opacity: 0.85\n}, {\n index: 4,\n opacity: 0.9\n}, {\n index: 3,\n opacity: 0.95\n}, {\n index: 2,\n opacity: 0.97\n}, {\n index: 1,\n opacity: 0.98\n}];\n\nfunction getHue(hsv, i, light) {\n var hue; // 根据色相不同,色相转向不同\n\n if (Math.round(hsv.h) >= 60 && Math.round(hsv.h) <= 240) {\n hue = light ? Math.round(hsv.h) - hueStep * i : Math.round(hsv.h) + hueStep * i;\n } else {\n hue = light ? Math.round(hsv.h) + hueStep * i : Math.round(hsv.h) - hueStep * i;\n }\n\n if (hue < 0) {\n hue += 360;\n } else if (hue >= 360) {\n hue -= 360;\n }\n\n return hue;\n}\n\nfunction getSaturation(hsv, i, light) {\n // grey color don't change saturation\n if (hsv.h === 0 && hsv.s === 0) {\n return hsv.s;\n }\n\n var saturation;\n\n if (light) {\n saturation = hsv.s - saturationStep * i;\n } else if (i === darkColorCount) {\n saturation = hsv.s + saturationStep;\n } else {\n saturation = hsv.s + saturationStep2 * i;\n } // 边界值修正\n\n\n if (saturation > 1) {\n saturation = 1;\n } // 第一格的 s 限制在 0.06-0.1 之间\n\n\n if (light && i === lightColorCount && saturation > 0.1) {\n saturation = 0.1;\n }\n\n if (saturation < 0.06) {\n saturation = 0.06;\n }\n\n return Number(saturation.toFixed(2));\n}\n\nfunction getValue(hsv, i, light) {\n var value;\n\n if (light) {\n value = hsv.v + brightnessStep1 * i;\n } else {\n value = hsv.v - brightnessStep2 * i;\n }\n\n if (value > 1) {\n value = 1;\n }\n\n return Number(value.toFixed(2));\n}\n\nfunction generate(color) {\n var opts = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n var patterns = [];\n var pColor = tinycolor2__WEBPACK_IMPORTED_MODULE_0___default()(color);\n\n for (var i = lightColorCount; i > 0; i -= 1) {\n var hsv = pColor.toHsv();\n var colorString = tinycolor2__WEBPACK_IMPORTED_MODULE_0___default()({\n h: getHue(hsv, i, true),\n s: getSaturation(hsv, i, true),\n v: getValue(hsv, i, true)\n }).toHexString();\n patterns.push(colorString);\n }\n\n patterns.push(pColor.toHexString());\n\n for (var _i = 1; _i <= darkColorCount; _i += 1) {\n var _hsv = pColor.toHsv();\n\n var _colorString = tinycolor2__WEBPACK_IMPORTED_MODULE_0___default()({\n h: getHue(_hsv, _i),\n s: getSaturation(_hsv, _i),\n v: getValue(_hsv, _i)\n }).toHexString();\n\n patterns.push(_colorString);\n } // dark theme patterns\n\n\n if (opts.theme === 'dark') {\n return darkColorMap.map(function (_ref) {\n var index = _ref.index,\n opacity = _ref.opacity;\n var darkColorString = tinycolor2__WEBPACK_IMPORTED_MODULE_0___default.a.mix(opts.backgroundColor || '#141414', patterns[index], opacity * 100).toHexString();\n return darkColorString;\n });\n }\n\n return patterns;\n}\n\nvar presetPrimaryColors = {\n red: '#F5222D',\n volcano: '#FA541C',\n orange: '#FA8C16',\n gold: '#FAAD14',\n yellow: '#FADB14',\n lime: '#A0D911',\n green: '#52C41A',\n cyan: '#13C2C2',\n blue: '#1890FF',\n geekblue: '#2F54EB',\n purple: '#722ED1',\n magenta: '#EB2F96',\n grey: '#666666'\n};\nvar presetPalettes = {};\nvar presetDarkPalettes = {};\nObject.keys(presetPrimaryColors).forEach(function (key) {\n presetPalettes[key] = generate(presetPrimaryColors[key]);\n presetPalettes[key].primary = presetPalettes[key][5]; // dark presetPalettes\n\n presetDarkPalettes[key] = generate(presetPrimaryColors[key], {\n theme: 'dark',\n backgroundColor: '#141414'\n });\n presetDarkPalettes[key].primary = presetDarkPalettes[key][5];\n});\nvar red = presetPalettes.red;\nvar volcano = presetPalettes.volcano;\nvar gold = presetPalettes.gold;\nvar orange = presetPalettes.orange;\nvar yellow = presetPalettes.yellow;\nvar lime = presetPalettes.lime;\nvar green = presetPalettes.green;\nvar cyan = presetPalettes.cyan;\nvar blue = presetPalettes.blue;\nvar geekblue = presetPalettes.geekblue;\nvar purple = presetPalettes.purple;\nvar magenta = presetPalettes.magenta;\nvar grey = presetPalettes.grey;\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@ant-design/colors/dist/index.esm.js?"); /***/ }), @@ -20,7 +20,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar adjMatrix = function adjMatrix(graphData, directed) {\n var nodes = graphData.nodes,\n edges = graphData.edges;\n var matrix = []; // map node with index in data.nodes\n\n var nodeMap = {};\n\n if (!nodes) {\n throw new Error(\"invalid nodes data!\");\n }\n\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n\n if (edges) {\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n if (!sIndex && sIndex !== 0 || !tIndex && tIndex !== 0) return;\n matrix[sIndex][tIndex] = 1;\n\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n\n return matrix;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (adjMatrix);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/adjacent-matrix.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar adjMatrix = function adjMatrix(graphData, directed) {\n var nodes = graphData.nodes,\n edges = graphData.edges;\n var matrix = [];\n // map node with index in data.nodes\n var nodeMap = {};\n if (!nodes) {\n throw new Error(\"invalid nodes data!\");\n }\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n if (edges) {\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n if (!sIndex && sIndex !== 0 || !tIndex && tIndex !== 0) return;\n matrix[sIndex][tIndex] = 1;\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n return matrix;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (adjMatrix);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/adjacent-matrix.js?"); /***/ }), @@ -32,7 +32,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nvar adjMatrix = function adjM /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _structs_queue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./structs/queue */ \"./node_modules/@antv/algorithm/es/structs/queue.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n/**\n *\n * @param callbacks\n * allowTraversal: 确定 BFS 是否从顶点沿着边遍历到其邻居,默认情况下,同一个节点只能遍历一次\n * enterNode: 当 BFS 访问某个节点时调用\n * leaveNode: 当 BFS 访问访问结束某个节点时调用\n */\n\nfunction initCallbacks(callbacks) {\n if (callbacks === void 0) {\n callbacks = {};\n }\n\n var initiatedCallback = callbacks;\n\n var stubCallback = function stubCallback() {};\n\n var allowTraversalCallback = function () {\n var seen = {};\n return function (_a) {\n var next = _a.next;\n var id = next;\n\n if (!seen[id]) {\n seen[id] = true;\n return true;\n }\n\n return false;\n };\n }();\n\n initiatedCallback.allowTraversal = callbacks.allowTraversal || allowTraversalCallback;\n initiatedCallback.enter = callbacks.enter || stubCallback;\n initiatedCallback.leave = callbacks.leave || stubCallback;\n return initiatedCallback;\n}\n/**\n * 广度优先遍历图\n * @param graph Graph 图实例\n * @param startNode 开始遍历的节点\n * @param originalCallbacks 回调\n */\n\n\nvar breadthFirstSearch = function breadthFirstSearch(graphData, startNodeId, originalCallbacks, directed) {\n if (directed === void 0) {\n directed = true;\n }\n\n var callbacks = initCallbacks(originalCallbacks);\n var nodeQueue = new _structs_queue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n var _a = graphData.edges,\n edges = _a === void 0 ? [] : _a; // 初始化队列元素\n\n nodeQueue.enqueue(startNodeId);\n var previousNode = '';\n\n var _loop_1 = function _loop_1() {\n var currentNode = nodeQueue.dequeue();\n callbacks.enter({\n current: currentNode,\n previous: previousNode\n }); // 将所有邻居添加到队列中以便遍历\n\n Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(currentNode, edges, directed ? 'target' : undefined).forEach(function (nextNode) {\n if (callbacks.allowTraversal({\n previous: previousNode,\n current: currentNode,\n next: nextNode\n })) {\n nodeQueue.enqueue(nextNode);\n }\n });\n callbacks.leave({\n current: currentNode,\n previous: previousNode\n }); // 下一次循环之前存储当前顶点\n\n previousNode = currentNode;\n }; // 遍历队列中的所有顶点\n\n\n while (!nodeQueue.isEmpty()) {\n _loop_1();\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (breadthFirstSearch);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/bfs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _structs_queue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./structs/queue */ \"./node_modules/@antv/algorithm/es/structs/queue.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n/**\n *\n * @param callbacks\n * allowTraversal: 确定 BFS 是否从顶点沿着边遍历到其邻居,默认情况下,同一个节点只能遍历一次\n * enterNode: 当 BFS 访问某个节点时调用\n * leaveNode: 当 BFS 访问访问结束某个节点时调用\n */\nfunction initCallbacks(callbacks) {\n if (callbacks === void 0) {\n callbacks = {};\n }\n var initiatedCallback = callbacks;\n var stubCallback = function stubCallback() {};\n var allowTraversalCallback = function () {\n var seen = {};\n return function (_a) {\n var next = _a.next;\n var id = next;\n if (!seen[id]) {\n seen[id] = true;\n return true;\n }\n return false;\n };\n }();\n initiatedCallback.allowTraversal = callbacks.allowTraversal || allowTraversalCallback;\n initiatedCallback.enter = callbacks.enter || stubCallback;\n initiatedCallback.leave = callbacks.leave || stubCallback;\n return initiatedCallback;\n}\n/**\n * 广度优先遍历图\n * @param graph Graph 图实例\n * @param startNode 开始遍历的节点\n * @param originalCallbacks 回调\n */\nvar breadthFirstSearch = function breadthFirstSearch(graphData, startNodeId, originalCallbacks, directed) {\n if (directed === void 0) {\n directed = true;\n }\n var callbacks = initCallbacks(originalCallbacks);\n var nodeQueue = new _structs_queue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n var _a = graphData.edges,\n edges = _a === void 0 ? [] : _a;\n // 初始化队列元素\n nodeQueue.enqueue(startNodeId);\n var previousNode = '';\n var _loop_1 = function _loop_1() {\n var currentNode = nodeQueue.dequeue();\n callbacks.enter({\n current: currentNode,\n previous: previousNode\n });\n // 将所有邻居添加到队列中以便遍历\n Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(currentNode, edges, directed ? 'target' : undefined).forEach(function (nextNode) {\n if (callbacks.allowTraversal({\n previous: previousNode,\n current: currentNode,\n next: nextNode\n })) {\n nodeQueue.enqueue(nextNode);\n }\n });\n callbacks.leave({\n current: currentNode,\n previous: previousNode\n });\n // 下一次循环之前存储当前顶点\n previousNode = currentNode;\n };\n // 遍历队列中的所有顶点\n while (!nodeQueue.isEmpty()) {\n _loop_1();\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (breadthFirstSearch);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/bfs.js?"); /***/ }), @@ -44,7 +44,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _str /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectConnectedComponents\", function() { return detectConnectedComponents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectStrongConnectComponents\", function() { return detectStrongConnectComponents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getConnectedComponents; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n/**\n * Generate all connected components for an undirected graph\n * @param graph\n */\n\nvar detectConnectedComponents = function detectConnectedComponents(graphData) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var allComponents = [];\n var visited = {};\n var nodeStack = [];\n\n var getComponent = function getComponent(node) {\n nodeStack.push(node);\n visited[node.id] = true;\n var neighbors = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"getNeighbors\"])(node.id, edges);\n\n var _loop_1 = function _loop_1(i) {\n var neighbor = neighbors[i];\n\n if (!visited[neighbor]) {\n var targetNode = nodes.filter(function (node) {\n return node.id === neighbor;\n });\n\n if (targetNode.length > 0) {\n getComponent(targetNode[0]);\n }\n }\n };\n\n for (var i = 0; i < neighbors.length; ++i) {\n _loop_1(i);\n }\n };\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n\n if (!visited[node.id]) {\n // 对于无向图进行dfs遍历,每一次调用后都得到一个连通分量\n getComponent(node);\n var component = [];\n\n while (nodeStack.length > 0) {\n component.push(nodeStack.pop());\n }\n\n allComponents.push(component);\n }\n }\n\n return allComponents;\n};\n/**\n * Tarjan's Algorithm 复杂度 O(|V|+|E|)\n * For directed graph only\n * a directed graph is said to be strongly connected if \"every vertex is reachable from every other vertex\".\n * refer: http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm\n * @param graph\n * @return a list of strongly connected components\n */\n\nvar detectStrongConnectComponents = function detectStrongConnectComponents(graphData) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodeStack = [];\n var inStack = {}; // 辅助判断是否已经在stack中,减少查找开销\n\n var indices = {};\n var lowLink = {};\n var allComponents = [];\n var index = 0;\n\n var getComponent = function getComponent(node) {\n // Set the depth index for v to the smallest unused index\n indices[node.id] = index;\n lowLink[node.id] = index;\n index += 1;\n nodeStack.push(node);\n inStack[node.id] = true; // 考虑每个邻接点\n\n var neighbors = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"getNeighbors\"])(node.id, edges, 'target').filter(function (n) {\n return nodes.map(function (node) {\n return node.id;\n }).indexOf(n) > -1;\n });\n\n var _loop_2 = function _loop_2(i) {\n var targetNodeID = neighbors[i];\n\n if (!indices[targetNodeID] && indices[targetNodeID] !== 0) {\n var targetNode = nodes.filter(function (node) {\n return node.id === targetNodeID;\n });\n\n if (targetNode.length > 0) {\n getComponent(targetNode[0]);\n } // tree edge\n\n\n lowLink[node.id] = Math.min(lowLink[node.id], lowLink[targetNodeID]);\n } else if (inStack[targetNodeID]) {\n // back edge, target node is in the current SCC\n lowLink[node.id] = Math.min(lowLink[node.id], indices[targetNodeID]);\n }\n };\n\n for (var i = 0; i < neighbors.length; i++) {\n _loop_2(i);\n } // If node is a root node, generate an SCC\n\n\n if (lowLink[node.id] === indices[node.id]) {\n var component = [];\n\n while (nodeStack.length > 0) {\n var tmpNode = nodeStack.pop();\n inStack[tmpNode.id] = false;\n component.push(tmpNode);\n if (tmpNode === node) break;\n }\n\n if (component.length > 0) {\n allComponents.push(component);\n }\n }\n };\n\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n var node = nodes_1[_i];\n\n if (!indices[node.id] && indices[node.id] !== 0) {\n getComponent(node);\n }\n }\n\n return allComponents;\n};\nfunction getConnectedComponents(graphData, directed) {\n if (directed) return detectStrongConnectComponents(graphData);\n return detectConnectedComponents(graphData);\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/connected-component.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectConnectedComponents\", function() { return detectConnectedComponents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectStrongConnectComponents\", function() { return detectStrongConnectComponents; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getConnectedComponents; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n/**\n * Generate all connected components for an undirected graph\n * @param graph\n */\nvar detectConnectedComponents = function detectConnectedComponents(graphData) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var allComponents = [];\n var visited = {};\n var nodeStack = [];\n var getComponent = function getComponent(node) {\n nodeStack.push(node);\n visited[node.id] = true;\n var neighbors = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"getNeighbors\"])(node.id, edges);\n var _loop_1 = function _loop_1(i) {\n var neighbor = neighbors[i];\n if (!visited[neighbor]) {\n var targetNode = nodes.filter(function (node) {\n return node.id === neighbor;\n });\n if (targetNode.length > 0) {\n getComponent(targetNode[0]);\n }\n }\n };\n for (var i = 0; i < neighbors.length; ++i) {\n _loop_1(i);\n }\n };\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if (!visited[node.id]) {\n // 对于无向图进行dfs遍历,每一次调用后都得到一个连通分量\n getComponent(node);\n var component = [];\n while (nodeStack.length > 0) {\n component.push(nodeStack.pop());\n }\n allComponents.push(component);\n }\n }\n return allComponents;\n};\n/**\n * Tarjan's Algorithm 复杂度 O(|V|+|E|)\n * For directed graph only\n * a directed graph is said to be strongly connected if \"every vertex is reachable from every other vertex\".\n * refer: http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm\n * @param graph\n * @return a list of strongly connected components\n */\nvar detectStrongConnectComponents = function detectStrongConnectComponents(graphData) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodeStack = [];\n var inStack = {}; // 辅助判断是否已经在stack中,减少查找开销\n var indices = {};\n var lowLink = {};\n var allComponents = [];\n var index = 0;\n var getComponent = function getComponent(node) {\n // Set the depth index for v to the smallest unused index\n indices[node.id] = index;\n lowLink[node.id] = index;\n index += 1;\n nodeStack.push(node);\n inStack[node.id] = true;\n // 考虑每个邻接点\n var neighbors = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"getNeighbors\"])(node.id, edges, 'target').filter(function (n) {\n return nodes.map(function (node) {\n return node.id;\n }).indexOf(n) > -1;\n });\n var _loop_2 = function _loop_2(i) {\n var targetNodeID = neighbors[i];\n if (!indices[targetNodeID] && indices[targetNodeID] !== 0) {\n var targetNode = nodes.filter(function (node) {\n return node.id === targetNodeID;\n });\n if (targetNode.length > 0) {\n getComponent(targetNode[0]);\n }\n // tree edge\n lowLink[node.id] = Math.min(lowLink[node.id], lowLink[targetNodeID]);\n } else if (inStack[targetNodeID]) {\n // back edge, target node is in the current SCC\n lowLink[node.id] = Math.min(lowLink[node.id], indices[targetNodeID]);\n }\n };\n for (var i = 0; i < neighbors.length; i++) {\n _loop_2(i);\n }\n // If node is a root node, generate an SCC\n if (lowLink[node.id] === indices[node.id]) {\n var component = [];\n while (nodeStack.length > 0) {\n var tmpNode = nodeStack.pop();\n inStack[tmpNode.id] = false;\n component.push(tmpNode);\n if (tmpNode === node) break;\n }\n if (component.length > 0) {\n allComponents.push(component);\n }\n }\n };\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n var node = nodes_1[_i];\n if (!indices[node.id] && indices[node.id] !== 0) {\n getComponent(node);\n }\n }\n return allComponents;\n};\nfunction getConnectedComponents(graphData, directed) {\n if (directed) return detectStrongConnectComponents(graphData);\n return detectConnectedComponents(graphData);\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/connected-component.js?"); /***/ }), @@ -68,7 +68,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils_vector__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/vector */ \"./node_modules/@antv/algorithm/es/utils/vector.js\");\n\n/**\n * cosine-similarity算法 计算余弦相似度\n * @param item 元素\n * @param targetItem 目标元素\n */\n\nvar cosineSimilarity = function cosineSimilarity(item, targetItem) {\n // 目标元素向量\n var targetItemVector = new _utils_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"](targetItem); // 目标元素向量的模长\n\n var targetNodeNorm2 = targetItemVector.norm2(); // 元素向量\n\n var itemVector = new _utils_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"](item); // 元素向量的模长\n\n var itemNorm2 = itemVector.norm2(); // 计算元素向量和目标元素向量的点积\n\n var dot = targetItemVector.dot(itemVector);\n var norm2Product = targetNodeNorm2 * itemNorm2; // 计算元素向量和目标元素向量的余弦相似度\n\n var cosineSimilarity = norm2Product ? dot / norm2Product : 0;\n return cosineSimilarity;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (cosineSimilarity);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/cosine-similarity.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _utils_vector__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./utils/vector */ \"./node_modules/@antv/algorithm/es/utils/vector.js\");\n\n/**\n * cosine-similarity算法 计算余弦相似度\n * @param item 元素\n * @param targetItem 目标元素\n */\nvar cosineSimilarity = function cosineSimilarity(item, targetItem) {\n // 目标元素向量\n var targetItemVector = new _utils_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"](targetItem);\n // 目标元素向量的模长\n var targetNodeNorm2 = targetItemVector.norm2();\n // 元素向量\n var itemVector = new _utils_vector__WEBPACK_IMPORTED_MODULE_0__[\"default\"](item);\n // 元素向量的模长\n var itemNorm2 = itemVector.norm2();\n // 计算元素向量和目标元素向量的点积\n var dot = targetItemVector.dot(itemVector);\n var norm2Product = targetNodeNorm2 * itemNorm2;\n // 计算元素向量和目标元素向量的余弦相似度\n var cosineSimilarity = norm2Product ? dot / norm2Product : 0;\n return cosineSimilarity;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (cosineSimilarity);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/cosine-similarity.js?"); /***/ }), @@ -80,7 +80,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uti /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getInDegree\", function() { return getInDegree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getOutDegree\", function() { return getOutDegree; });\nvar degree = function degree(graphData) {\n var degrees = {};\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n nodes.forEach(function (node) {\n degrees[node.id] = {\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n });\n edges.forEach(function (edge) {\n degrees[edge.source].degree++;\n degrees[edge.source].outDegree++;\n degrees[edge.target].degree++;\n degrees[edge.target].inDegree++;\n });\n return degrees;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (degree);\n/**\n * 获取指定节点的入度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\n\nvar getInDegree = function getInDegree(graphData, nodeId) {\n var nodeDegree = degree(graphData);\n\n if (nodeDegree[nodeId]) {\n return degree(graphData)[nodeId].inDegree;\n }\n\n return 0;\n};\n/**\n * 获取指定节点的出度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\n\nvar getOutDegree = function getOutDegree(graphData, nodeId) {\n var nodeDegree = degree(graphData);\n\n if (nodeDegree[nodeId]) {\n return degree(graphData)[nodeId].outDegree;\n }\n\n return 0;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/degree.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getInDegree\", function() { return getInDegree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getOutDegree\", function() { return getOutDegree; });\nvar degree = function degree(graphData) {\n var degrees = {};\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n nodes.forEach(function (node) {\n degrees[node.id] = {\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n });\n edges.forEach(function (edge) {\n degrees[edge.source].degree++;\n degrees[edge.source].outDegree++;\n degrees[edge.target].degree++;\n degrees[edge.target].inDegree++;\n });\n return degrees;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (degree);\n/**\n * 获取指定节点的入度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\nvar getInDegree = function getInDegree(graphData, nodeId) {\n var nodeDegree = degree(graphData);\n if (nodeDegree[nodeId]) {\n return degree(graphData)[nodeId].inDegree;\n }\n return 0;\n};\n/**\n * 获取指定节点的出度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\nvar getOutDegree = function getOutDegree(graphData, nodeId) {\n var nodeDegree = degree(graphData);\n if (nodeDegree[nodeId]) {\n return degree(graphData)[nodeId].outDegree;\n }\n return 0;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/degree.js?"); /***/ }), @@ -92,7 +92,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectAllUndirectedCycle\", function() { return detectAllUndirectedCycle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectAllDirectedCycle\", function() { return detectAllDirectedCycle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectAllCycles\", function() { return detectAllCycles; });\n/* harmony import */ var _dfs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs */ \"./node_modules/@antv/algorithm/es/dfs.js\");\n/* harmony import */ var _connected_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./connected-component */ \"./node_modules/@antv/algorithm/es/connected-component.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n\n\nvar detectDirectedCycle = function detectDirectedCycle(graphData) {\n var cycle = null;\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a;\n var dfsParentMap = {}; // 所有没有被访问的节点集合\n\n var unvisitedSet = {}; // 正在被访问的节点集合\n\n var visitingSet = {}; // 所有已经被访问过的节点集合\n\n var visitedSet = {}; // 初始化 unvisitedSet\n\n nodes.forEach(function (node) {\n unvisitedSet[node.id] = node;\n });\n var callbacks = {\n enter: function enter(_a) {\n var currentNode = _a.current,\n previousNode = _a.previous;\n\n if (visitingSet[currentNode]) {\n // 如果当前节点正在访问中,则说明检测到环路了\n cycle = {};\n var currentCycleNode = currentNode;\n var previousCycleNode = previousNode;\n\n while (previousCycleNode !== currentNode) {\n cycle[currentCycleNode] = previousCycleNode;\n currentCycleNode = previousCycleNode;\n previousCycleNode = dfsParentMap[previousCycleNode];\n }\n\n cycle[currentCycleNode] = previousCycleNode;\n } else {\n // 如果不存在正在访问集合中,则将其放入正在访问集合,并从未访问集合中删除\n visitingSet[currentNode] = currentNode;\n delete unvisitedSet[currentNode]; // 更新 DSF parents 列表\n\n dfsParentMap[currentNode] = previousNode;\n }\n },\n leave: function leave(_a) {\n var currentNode = _a.current; // 如果所有的节点的子节点都已经访问过了,则从正在访问集合中删除掉,并将其移入到已访问集合中,\n // 同时也意味着当前节点的所有邻居节点都被访问过了\n\n visitedSet[currentNode] = currentNode;\n delete visitingSet[currentNode];\n },\n allowTraversal: function allowTraversal(_a) {\n var nextNode = _a.next; // 如果检测到环路则需要终止所有进一步的遍历,否则会导致无限循环遍历\n\n if (cycle) {\n return false;\n } // 仅允许遍历没有访问的节点,visitedSet 中的都已经访问过了\n\n\n return !visitedSet[nextNode];\n }\n }; // 开始遍历节点\n\n while (Object.keys(unvisitedSet).length) {\n // 从第一个节点开始进行 DFS 遍历\n var firsetUnVisitedKey = Object.keys(unvisitedSet)[0];\n Object(_dfs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, firsetUnVisitedKey, callbacks);\n }\n\n return cycle;\n};\n/**\n * 检测无向图中的所有Base cycles\n * refer: https://www.codeproject.com/Articles/1158232/Enumerating-All-Cycles-in-an-Undirected-Graph\n * @param graph\n * @param nodeIds 节点 ID 的数组\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: INode}] 返回一组base cycles\n */\n\n\nvar detectAllUndirectedCycle = function detectAllUndirectedCycle(graphData, nodeIds, include) {\n var _a, _b;\n\n if (include === void 0) {\n include = true;\n }\n\n var allCycles = [];\n var components = Object(_connected_component__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(graphData, false); // loop through all connected components\n\n for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {\n var component = components_1[_i];\n if (!component.length) continue;\n var root = component[0];\n var rootId = root.id;\n var stack = [root];\n var parent_1 = (_a = {}, _a[rootId] = root, _a);\n var used = (_b = {}, _b[rootId] = new Set(), _b); // walk a spanning tree to find cycles\n\n while (stack.length > 0) {\n var curNode = stack.pop();\n var curNodeId = curNode.id;\n var neighbors = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getNeighbors\"])(curNodeId, graphData.edges);\n\n var _loop_1 = function _loop_1(i) {\n var _c;\n\n var neighborId = neighbors[i];\n var neighbor = graphData.nodes.find(function (node) {\n return node.id === neighborId;\n }); // const neighborId = neighbor.get('id');\n\n if (neighborId === curNodeId) {\n // 自环\n allCycles.push((_c = {}, _c[neighborId] = curNode, _c));\n } else if (!(neighborId in used)) {\n // visit a new node\n parent_1[neighborId] = curNode;\n stack.push(neighbor);\n used[neighborId] = new Set([curNode]);\n } else if (!used[curNodeId].has(neighbor)) {\n // a cycle found\n var cycleValid = true;\n var cyclePath = [neighbor, curNode];\n var p = parent_1[curNodeId];\n\n while (used[neighborId].size && !used[neighborId].has(p)) {\n cyclePath.push(p);\n if (p === parent_1[p.id]) break;else p = parent_1[p.id];\n }\n\n cyclePath.push(p);\n\n if (nodeIds && include) {\n // 如果有指定包含的节点\n cycleValid = false;\n\n if (cyclePath.findIndex(function (node) {\n return nodeIds.indexOf(node.id) > -1;\n }) > -1) {\n cycleValid = true;\n }\n } else if (nodeIds && !include) {\n // 如果有指定不包含的节点\n if (cyclePath.findIndex(function (node) {\n return nodeIds.indexOf(node.id) > -1;\n }) > -1) {\n cycleValid = false;\n }\n } // 把 node list 形式转换为 cycle 的格式\n\n\n if (cycleValid) {\n var cycle = {};\n\n for (var index = 1; index < cyclePath.length; index += 1) {\n cycle[cyclePath[index - 1].id] = cyclePath[index];\n }\n\n if (cyclePath.length) {\n cycle[cyclePath[cyclePath.length - 1].id] = cyclePath[0];\n }\n\n allCycles.push(cycle);\n }\n\n used[neighborId].add(curNode);\n }\n };\n\n for (var i = 0; i < neighbors.length; i += 1) {\n _loop_1(i);\n }\n }\n }\n\n return allCycles;\n};\n/**\n * Johnson's algorithm, 时间复杂度 O((V + E)(C + 1))$ and space bounded by O(V + E)\n * refer: https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF\n * refer: https://networkx.github.io/documentation/stable/_modules/networkx/algorithms/cycles.html#simple_cycles\n * @param graph\n * @param nodeIds 节点 ID 的数组\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: INode}] 返回所有的 simple cycles\n */\n\nvar detectAllDirectedCycle = function detectAllDirectedCycle(graphData, nodeIds, include) {\n if (include === void 0) {\n include = true;\n }\n\n var path = []; // stack of nodes in current path\n\n var blocked = new Set();\n var B = []; // remember portions of the graph that yield no elementary circuit\n\n var allCycles = [];\n var idx2Node = {};\n var node2Idx = {}; // 辅助函数: unblock all blocked nodes\n\n var unblock = function unblock(thisNode) {\n var stack = [thisNode];\n\n while (stack.length > 0) {\n var node = stack.pop();\n\n if (blocked.has(node)) {\n blocked.delete(node);\n B[node.id].forEach(function (n) {\n stack.push(n);\n });\n B[node.id].clear();\n }\n }\n };\n\n var circuit = function circuit(node, start, adjList) {\n var closed = false; // whether a path is closed\n\n if (nodeIds && include === false && nodeIds.indexOf(node.id) > -1) return closed;\n path.push(node);\n blocked.add(node);\n var neighbors = adjList[node.id];\n\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = idx2Node[neighbors[i]];\n\n if (neighbor === start) {\n var cycle = {};\n\n for (var index = 1; index < path.length; index += 1) {\n cycle[path[index - 1].id] = path[index];\n }\n\n if (path.length) {\n cycle[path[path.length - 1].id] = path[0];\n }\n\n allCycles.push(cycle);\n closed = true;\n } else if (!blocked.has(neighbor)) {\n if (circuit(neighbor, start, adjList)) {\n closed = true;\n }\n }\n }\n\n if (closed) {\n unblock(node);\n } else {\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = idx2Node[neighbors[i]];\n\n if (!B[neighbor.id].has(node)) {\n B[neighbor.id].add(node);\n }\n }\n }\n\n path.pop();\n return closed;\n };\n\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a; // Johnson's algorithm 要求给节点赋顺序,先按节点在数组中的顺序\n\n for (var i = 0; i < nodes.length; i += 1) {\n var node = nodes[i];\n var nodeId = node.id;\n node2Idx[nodeId] = i;\n idx2Node[i] = node;\n } // 如果有指定包含的节点,则把指定节点排序在前,以便提早结束搜索\n\n\n if (nodeIds && include) {\n var _loop_2 = function _loop_2(i) {\n var nodeId = nodeIds[i];\n node2Idx[nodes[i].id] = node2Idx[nodeId];\n node2Idx[nodeId] = 0;\n idx2Node[0] = nodes.find(function (node) {\n return node.id === nodeId;\n });\n idx2Node[node2Idx[nodes[i].id]] = nodes[i];\n };\n\n for (var i = 0; i < nodeIds.length; i++) {\n _loop_2(i);\n }\n } // 返回 节点顺序 >= nodeOrder 的强连通分量的adjList\n\n\n var getMinComponentAdj = function getMinComponentAdj(components) {\n var _a;\n\n var minCompIdx;\n var minIdx = Infinity; // Find least component and the lowest node\n\n for (var i = 0; i < components.length; i += 1) {\n var comp = components[i];\n\n for (var j = 0; j < comp.length; j++) {\n var nodeIdx_1 = node2Idx[comp[j].id];\n\n if (nodeIdx_1 < minIdx) {\n minIdx = nodeIdx_1;\n minCompIdx = i;\n }\n }\n }\n\n var component = components[minCompIdx];\n var adjList = [];\n\n for (var i = 0; i < component.length; i += 1) {\n var node = component[i];\n adjList[node.id] = [];\n\n for (var _i = 0, _b = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getNeighbors\"])(node.id, graphData.edges, 'target').filter(function (n) {\n return component.map(function (c) {\n return c.id;\n }).indexOf(n) > -1;\n }); _i < _b.length; _i++) {\n var neighbor = _b[_i]; // 对自环情况 (点连向自身) 特殊处理:记录自环,但不加入adjList\n\n if (neighbor === node.id && !(include === false && nodeIds.indexOf(node.id) > -1)) {\n allCycles.push((_a = {}, _a[node.id] = node, _a));\n } else {\n adjList[node.id].push(node2Idx[neighbor]);\n }\n }\n }\n\n return {\n component: component,\n adjList: adjList,\n minIdx: minIdx\n };\n };\n\n var nodeIdx = 0;\n\n while (nodeIdx < nodes.length) {\n var subgraphNodes = nodes.filter(function (n) {\n return node2Idx[n.id] >= nodeIdx;\n });\n var sccs = Object(_connected_component__WEBPACK_IMPORTED_MODULE_1__[\"detectStrongConnectComponents\"])({\n nodes: subgraphNodes,\n edges: graphData.edges\n }).filter(function (component) {\n return component.length > 1;\n });\n if (sccs.length === 0) break;\n var scc = getMinComponentAdj(sccs);\n var minIdx = scc.minIdx,\n adjList = scc.adjList,\n component = scc.component;\n\n if (component.length > 1) {\n component.forEach(function (node) {\n B[node.id] = new Set();\n });\n var startNode = idx2Node[minIdx]; // startNode 不在指定要包含的节点中,提前结束搜索\n\n if (nodeIds && include && nodeIds.indexOf(startNode.id) === -1) return allCycles;\n circuit(startNode, startNode, adjList);\n nodeIdx = minIdx + 1;\n } else {\n break;\n }\n }\n\n return allCycles;\n};\n/**\n * 查找图中所有满足要求的圈\n * @param graph\n * @param directed 是否为有向图\n * @param nodeIds 节点 ID 的数组,若不指定,则返回图中所有的圈\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: Node}] 包含所有环的数组,每个环用一个Object表示,其中key为节点id,value为该节点在环中指向的下一个节点\n */\n\nvar detectAllCycles = function detectAllCycles(graphData, directed, nodeIds, include) {\n if (include === void 0) {\n include = true;\n }\n\n if (directed) return detectAllDirectedCycle(graphData, nodeIds, include);\n return detectAllUndirectedCycle(graphData, nodeIds, include);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (detectDirectedCycle);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/detect-cycle.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectAllUndirectedCycle\", function() { return detectAllUndirectedCycle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectAllDirectedCycle\", function() { return detectAllDirectedCycle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectAllCycles\", function() { return detectAllCycles; });\n/* harmony import */ var _dfs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs */ \"./node_modules/@antv/algorithm/es/dfs.js\");\n/* harmony import */ var _connected_component__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./connected-component */ \"./node_modules/@antv/algorithm/es/connected-component.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n\nvar detectDirectedCycle = function detectDirectedCycle(graphData) {\n var cycle = null;\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a;\n var dfsParentMap = {};\n // 所有没有被访问的节点集合\n var unvisitedSet = {};\n // 正在被访问的节点集合\n var visitingSet = {};\n // 所有已经被访问过的节点集合\n var visitedSet = {};\n // 初始化 unvisitedSet\n nodes.forEach(function (node) {\n unvisitedSet[node.id] = node;\n });\n var callbacks = {\n enter: function enter(_a) {\n var currentNode = _a.current,\n previousNode = _a.previous;\n if (visitingSet[currentNode]) {\n // 如果当前节点正在访问中,则说明检测到环路了\n cycle = {};\n var currentCycleNode = currentNode;\n var previousCycleNode = previousNode;\n while (previousCycleNode !== currentNode) {\n cycle[currentCycleNode] = previousCycleNode;\n currentCycleNode = previousCycleNode;\n previousCycleNode = dfsParentMap[previousCycleNode];\n }\n cycle[currentCycleNode] = previousCycleNode;\n } else {\n // 如果不存在正在访问集合中,则将其放入正在访问集合,并从未访问集合中删除\n visitingSet[currentNode] = currentNode;\n delete unvisitedSet[currentNode];\n // 更新 DSF parents 列表\n dfsParentMap[currentNode] = previousNode;\n }\n },\n leave: function leave(_a) {\n var currentNode = _a.current;\n // 如果所有的节点的子节点都已经访问过了,则从正在访问集合中删除掉,并将其移入到已访问集合中,\n // 同时也意味着当前节点的所有邻居节点都被访问过了\n visitedSet[currentNode] = currentNode;\n delete visitingSet[currentNode];\n },\n allowTraversal: function allowTraversal(_a) {\n var nextNode = _a.next;\n // 如果检测到环路则需要终止所有进一步的遍历,否则会导致无限循环遍历\n if (cycle) {\n return false;\n }\n // 仅允许遍历没有访问的节点,visitedSet 中的都已经访问过了\n return !visitedSet[nextNode];\n }\n };\n // 开始遍历节点\n while (Object.keys(unvisitedSet).length) {\n // 从第一个节点开始进行 DFS 遍历\n var firsetUnVisitedKey = Object.keys(unvisitedSet)[0];\n Object(_dfs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, firsetUnVisitedKey, callbacks);\n }\n return cycle;\n};\n/**\n * 检测无向图中的所有Base cycles\n * refer: https://www.codeproject.com/Articles/1158232/Enumerating-All-Cycles-in-an-Undirected-Graph\n * @param graph\n * @param nodeIds 节点 ID 的数组\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: INode}] 返回一组base cycles\n */\nvar detectAllUndirectedCycle = function detectAllUndirectedCycle(graphData, nodeIds, include) {\n var _a, _b;\n if (include === void 0) {\n include = true;\n }\n var allCycles = [];\n var components = Object(_connected_component__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(graphData, false);\n // loop through all connected components\n for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {\n var component = components_1[_i];\n if (!component.length) continue;\n var root = component[0];\n var rootId = root.id;\n var stack = [root];\n var parent_1 = (_a = {}, _a[rootId] = root, _a);\n var used = (_b = {}, _b[rootId] = new Set(), _b);\n // walk a spanning tree to find cycles\n while (stack.length > 0) {\n var curNode = stack.pop();\n var curNodeId = curNode.id;\n var neighbors = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getNeighbors\"])(curNodeId, graphData.edges);\n var _loop_1 = function _loop_1(i) {\n var _c;\n var neighborId = neighbors[i];\n var neighbor = graphData.nodes.find(function (node) {\n return node.id === neighborId;\n });\n // const neighborId = neighbor.get('id');\n if (neighborId === curNodeId) {\n // 自环\n allCycles.push((_c = {}, _c[neighborId] = curNode, _c));\n } else if (!(neighborId in used)) {\n // visit a new node\n parent_1[neighborId] = curNode;\n stack.push(neighbor);\n used[neighborId] = new Set([curNode]);\n } else if (!used[curNodeId].has(neighbor)) {\n // a cycle found\n var cycleValid = true;\n var cyclePath = [neighbor, curNode];\n var p = parent_1[curNodeId];\n while (used[neighborId].size && !used[neighborId].has(p)) {\n cyclePath.push(p);\n if (p === parent_1[p.id]) break;else p = parent_1[p.id];\n }\n cyclePath.push(p);\n if (nodeIds && include) {\n // 如果有指定包含的节点\n cycleValid = false;\n if (cyclePath.findIndex(function (node) {\n return nodeIds.indexOf(node.id) > -1;\n }) > -1) {\n cycleValid = true;\n }\n } else if (nodeIds && !include) {\n // 如果有指定不包含的节点\n if (cyclePath.findIndex(function (node) {\n return nodeIds.indexOf(node.id) > -1;\n }) > -1) {\n cycleValid = false;\n }\n }\n // 把 node list 形式转换为 cycle 的格式\n if (cycleValid) {\n var cycle = {};\n for (var index = 1; index < cyclePath.length; index += 1) {\n cycle[cyclePath[index - 1].id] = cyclePath[index];\n }\n if (cyclePath.length) {\n cycle[cyclePath[cyclePath.length - 1].id] = cyclePath[0];\n }\n allCycles.push(cycle);\n }\n used[neighborId].add(curNode);\n }\n };\n for (var i = 0; i < neighbors.length; i += 1) {\n _loop_1(i);\n }\n }\n }\n return allCycles;\n};\n/**\n * Johnson's algorithm, 时间复杂度 O((V + E)(C + 1))$ and space bounded by O(V + E)\n * refer: https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF\n * refer: https://networkx.github.io/documentation/stable/_modules/networkx/algorithms/cycles.html#simple_cycles\n * @param graph\n * @param nodeIds 节点 ID 的数组\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: INode}] 返回所有的 simple cycles\n */\nvar detectAllDirectedCycle = function detectAllDirectedCycle(graphData, nodeIds, include) {\n if (include === void 0) {\n include = true;\n }\n var path = []; // stack of nodes in current path\n var blocked = new Set();\n var B = []; // remember portions of the graph that yield no elementary circuit\n var allCycles = [];\n var idx2Node = {};\n var node2Idx = {};\n // 辅助函数: unblock all blocked nodes\n var unblock = function unblock(thisNode) {\n var stack = [thisNode];\n while (stack.length > 0) {\n var node = stack.pop();\n if (blocked.has(node)) {\n blocked.delete(node);\n B[node.id].forEach(function (n) {\n stack.push(n);\n });\n B[node.id].clear();\n }\n }\n };\n var circuit = function circuit(node, start, adjList) {\n var closed = false; // whether a path is closed\n if (nodeIds && include === false && nodeIds.indexOf(node.id) > -1) return closed;\n path.push(node);\n blocked.add(node);\n var neighbors = adjList[node.id];\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = idx2Node[neighbors[i]];\n if (neighbor === start) {\n var cycle = {};\n for (var index = 1; index < path.length; index += 1) {\n cycle[path[index - 1].id] = path[index];\n }\n if (path.length) {\n cycle[path[path.length - 1].id] = path[0];\n }\n allCycles.push(cycle);\n closed = true;\n } else if (!blocked.has(neighbor)) {\n if (circuit(neighbor, start, adjList)) {\n closed = true;\n }\n }\n }\n if (closed) {\n unblock(node);\n } else {\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = idx2Node[neighbors[i]];\n if (!B[neighbor.id].has(node)) {\n B[neighbor.id].add(node);\n }\n }\n }\n path.pop();\n return closed;\n };\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a;\n // Johnson's algorithm 要求给节点赋顺序,先按节点在数组中的顺序\n for (var i = 0; i < nodes.length; i += 1) {\n var node = nodes[i];\n var nodeId = node.id;\n node2Idx[nodeId] = i;\n idx2Node[i] = node;\n }\n // 如果有指定包含的节点,则把指定节点排序在前,以便提早结束搜索\n if (nodeIds && include) {\n var _loop_2 = function _loop_2(i) {\n var nodeId = nodeIds[i];\n node2Idx[nodes[i].id] = node2Idx[nodeId];\n node2Idx[nodeId] = 0;\n idx2Node[0] = nodes.find(function (node) {\n return node.id === nodeId;\n });\n idx2Node[node2Idx[nodes[i].id]] = nodes[i];\n };\n for (var i = 0; i < nodeIds.length; i++) {\n _loop_2(i);\n }\n }\n // 返回 节点顺序 >= nodeOrder 的强连通分量的adjList\n var getMinComponentAdj = function getMinComponentAdj(components) {\n var _a;\n var minCompIdx;\n var minIdx = Infinity;\n // Find least component and the lowest node\n for (var i = 0; i < components.length; i += 1) {\n var comp = components[i];\n for (var j = 0; j < comp.length; j++) {\n var nodeIdx_1 = node2Idx[comp[j].id];\n if (nodeIdx_1 < minIdx) {\n minIdx = nodeIdx_1;\n minCompIdx = i;\n }\n }\n }\n var component = components[minCompIdx];\n var adjList = [];\n for (var i = 0; i < component.length; i += 1) {\n var node = component[i];\n adjList[node.id] = [];\n for (var _i = 0, _b = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getNeighbors\"])(node.id, graphData.edges, 'target').filter(function (n) {\n return component.map(function (c) {\n return c.id;\n }).indexOf(n) > -1;\n }); _i < _b.length; _i++) {\n var neighbor = _b[_i];\n // 对自环情况 (点连向自身) 特殊处理:记录自环,但不加入adjList\n if (neighbor === node.id && !(include === false && nodeIds.indexOf(node.id) > -1)) {\n allCycles.push((_a = {}, _a[node.id] = node, _a));\n } else {\n adjList[node.id].push(node2Idx[neighbor]);\n }\n }\n }\n return {\n component: component,\n adjList: adjList,\n minIdx: minIdx\n };\n };\n var nodeIdx = 0;\n while (nodeIdx < nodes.length) {\n var subgraphNodes = nodes.filter(function (n) {\n return node2Idx[n.id] >= nodeIdx;\n });\n var sccs = Object(_connected_component__WEBPACK_IMPORTED_MODULE_1__[\"detectStrongConnectComponents\"])({\n nodes: subgraphNodes,\n edges: graphData.edges\n }).filter(function (component) {\n return component.length > 1;\n });\n if (sccs.length === 0) break;\n var scc = getMinComponentAdj(sccs);\n var minIdx = scc.minIdx,\n adjList = scc.adjList,\n component = scc.component;\n if (component.length > 1) {\n component.forEach(function (node) {\n B[node.id] = new Set();\n });\n var startNode = idx2Node[minIdx];\n // startNode 不在指定要包含的节点中,提前结束搜索\n if (nodeIds && include && nodeIds.indexOf(startNode.id) === -1) return allCycles;\n circuit(startNode, startNode, adjList);\n nodeIdx = minIdx + 1;\n } else {\n break;\n }\n }\n return allCycles;\n};\n/**\n * 查找图中所有满足要求的圈\n * @param graph\n * @param directed 是否为有向图\n * @param nodeIds 节点 ID 的数组,若不指定,则返回图中所有的圈\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: Node}] 包含所有环的数组,每个环用一个Object表示,其中key为节点id,value为该节点在环中指向的下一个节点\n */\nvar detectAllCycles = function detectAllCycles(graphData, directed, nodeIds, include) {\n if (include === void 0) {\n include = true;\n }\n if (directed) return detectAllDirectedCycle(graphData, nodeIds, include);\n return detectAllUndirectedCycle(graphData, nodeIds, include);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (detectDirectedCycle);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/detect-cycle.js?"); /***/ }), @@ -104,7 +104,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return depthFirstSearch; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\nfunction initCallbacks(callbacks) {\n if (callbacks === void 0) {\n callbacks = {};\n }\n\n var initiatedCallback = callbacks;\n\n var stubCallback = function stubCallback() {};\n\n var allowTraversalCallback = function () {\n var seen = {};\n return function (_a) {\n var next = _a.next;\n\n if (!seen[next]) {\n seen[next] = true;\n return true;\n }\n\n return false;\n };\n }();\n\n initiatedCallback.allowTraversal = callbacks.allowTraversal || allowTraversalCallback;\n initiatedCallback.enter = callbacks.enter || stubCallback;\n initiatedCallback.leave = callbacks.leave || stubCallback;\n return initiatedCallback;\n}\n/**\n * @param {Graph} graph\n * @param {GraphNode} currentNode\n * @param {GraphNode} previousNode\n * @param {Callbacks} callbacks\n */\n\n\nfunction depthFirstSearchRecursive(graphData, currentNode, previousNode, callbacks) {\n callbacks.enter({\n current: currentNode,\n previous: previousNode\n });\n var _a = graphData.edges,\n edges = _a === void 0 ? [] : _a;\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"getNeighbors\"])(currentNode, edges, 'target').forEach(function (nextNode) {\n if (callbacks.allowTraversal({\n previous: previousNode,\n current: currentNode,\n next: nextNode\n })) {\n depthFirstSearchRecursive(graphData, nextNode, currentNode, callbacks);\n }\n });\n callbacks.leave({\n current: currentNode,\n previous: previousNode\n });\n}\n/**\n * 深度优先遍历图\n * @param data GraphData 图数据\n * @param startNodeId 开始遍历的节点的 ID\n * @param originalCallbacks 回调\n */\n\n\nfunction depthFirstSearch(graphData, startNodeId, callbacks) {\n depthFirstSearchRecursive(graphData, startNodeId, '', initCallbacks(callbacks));\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/dfs.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return depthFirstSearch; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\nfunction initCallbacks(callbacks) {\n if (callbacks === void 0) {\n callbacks = {};\n }\n var initiatedCallback = callbacks;\n var stubCallback = function stubCallback() {};\n var allowTraversalCallback = function () {\n var seen = {};\n return function (_a) {\n var next = _a.next;\n if (!seen[next]) {\n seen[next] = true;\n return true;\n }\n return false;\n };\n }();\n initiatedCallback.allowTraversal = callbacks.allowTraversal || allowTraversalCallback;\n initiatedCallback.enter = callbacks.enter || stubCallback;\n initiatedCallback.leave = callbacks.leave || stubCallback;\n return initiatedCallback;\n}\n/**\n * @param {Graph} graph\n * @param {GraphNode} currentNode\n * @param {GraphNode} previousNode\n * @param {Callbacks} callbacks\n */\nfunction depthFirstSearchRecursive(graphData, currentNode, previousNode, callbacks, directed) {\n if (directed === void 0) {\n directed = true;\n }\n callbacks.enter({\n current: currentNode,\n previous: previousNode\n });\n var _a = graphData.edges,\n edges = _a === void 0 ? [] : _a;\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"getNeighbors\"])(currentNode, edges, directed ? 'target' : undefined).forEach(function (nextNode) {\n if (callbacks.allowTraversal({\n previous: previousNode,\n current: currentNode,\n next: nextNode\n })) {\n depthFirstSearchRecursive(graphData, nextNode, currentNode, callbacks, directed);\n }\n });\n callbacks.leave({\n current: currentNode,\n previous: previousNode\n });\n}\n/**\n * 深度优先遍历图\n * @param data GraphData 图数据\n * @param startNodeId 开始遍历的节点的 ID\n * @param originalCallbacks 回调\n */\nfunction depthFirstSearch(graphData, startNodeId, callbacks, directed) {\n if (directed === void 0) {\n directed = true;\n }\n depthFirstSearchRecursive(graphData, startNodeId, '', initCallbacks(callbacks), directed);\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/dfs.js?"); /***/ }), @@ -116,7 +116,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n\n\nvar minVertex = function minVertex(D, nodes, marks) {\n // 找出最小的点\n var minDis = Infinity;\n var minNode;\n\n for (var i = 0; i < nodes.length; i++) {\n var nodeId = nodes[i].id;\n\n if (!marks[nodeId] && D[nodeId] <= minDis) {\n minDis = D[nodeId];\n minNode = nodes[i];\n }\n }\n\n return minNode;\n};\n\nvar dijkstra = function dijkstra(graphData, source, directed, weightPropertyName) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodeIds = [];\n var marks = {};\n var D = {};\n var prevs = {}; // key: 顶点, value: 顶点的前驱点数组(可能有多条等长的最短路径)\n\n nodes.forEach(function (node, i) {\n var id = node.id;\n nodeIds.push(id);\n D[id] = Infinity;\n if (id === source) D[id] = 0;\n });\n var nodeNum = nodes.length;\n\n var _loop_1 = function _loop_1(i) {\n // Process the vertices\n var minNode = minVertex(D, nodes, marks);\n var minNodeId = minNode.id;\n marks[minNodeId] = true;\n if (D[minNodeId] === Infinity) return \"continue\"; // Unreachable vertices cannot be the intermediate point\n\n var relatedEdges = [];\n if (directed) relatedEdges = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getOutEdgesNodeId\"])(minNodeId, edges);else relatedEdges = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getEdgesByNodeId\"])(minNodeId, edges);\n relatedEdges.forEach(function (edge) {\n var edgeTarget = edge.target;\n var edgeSource = edge.source;\n var w = edgeTarget === minNodeId ? edgeSource : edgeTarget;\n var weight = weightPropertyName && edge[weightPropertyName] ? edge[weightPropertyName] : 1;\n\n if (D[w] > D[minNode.id] + weight) {\n D[w] = D[minNode.id] + weight;\n prevs[w] = [minNode.id];\n } else if (D[w] === D[minNode.id] + weight) {\n prevs[w].push(minNode.id);\n }\n });\n };\n\n for (var i = 0; i < nodeNum; i++) {\n _loop_1(i);\n }\n\n prevs[source] = [source]; // 每个节点存可能存在多条最短路径\n\n var paths = {};\n\n for (var target in D) {\n if (D[target] !== Infinity) {\n findAllPaths(source, target, prevs, paths);\n }\n } // 兼容之前单路径\n\n\n var path = {};\n\n for (var target in paths) {\n path[target] = paths[target][0];\n }\n\n return {\n length: D,\n path: path,\n allPath: paths\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dijkstra);\n\nfunction findAllPaths(source, target, prevs, foundPaths) {\n if (source === target) {\n return [source];\n }\n\n if (foundPaths[target]) {\n return foundPaths[target];\n }\n\n var paths = [];\n\n for (var _i = 0, _a = prevs[target]; _i < _a.length; _i++) {\n var prev = _a[_i];\n var prevPaths = findAllPaths(source, prev, prevs, foundPaths);\n if (!prevPaths) return;\n\n for (var _b = 0, prevPaths_1 = prevPaths; _b < prevPaths_1.length; _b++) {\n var prePath = prevPaths_1[_b];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(prePath)) paths.push(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], prePath, true), [target], false));else paths.push([prePath, target]);\n }\n }\n\n foundPaths[target] = paths;\n return foundPaths[target];\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/dijkstra.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n\nvar minVertex = function minVertex(D, nodes, marks) {\n // 找出最小的点\n var minDis = Infinity;\n var minNode;\n for (var i = 0; i < nodes.length; i++) {\n var nodeId = nodes[i].id;\n if (!marks[nodeId] && D[nodeId] <= minDis) {\n minDis = D[nodeId];\n minNode = nodes[i];\n }\n }\n return minNode;\n};\nvar dijkstra = function dijkstra(graphData, source, directed, weightPropertyName) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodeIds = [];\n var marks = {};\n var D = {};\n var prevs = {}; // key: 顶点, value: 顶点的前驱点数组(可能有多条等长的最短路径)\n nodes.forEach(function (node, i) {\n var id = node.id;\n nodeIds.push(id);\n D[id] = Infinity;\n if (id === source) D[id] = 0;\n });\n var nodeNum = nodes.length;\n var _loop_1 = function _loop_1(i) {\n // Process the vertices\n var minNode = minVertex(D, nodes, marks);\n var minNodeId = minNode.id;\n marks[minNodeId] = true;\n if (D[minNodeId] === Infinity) return \"continue\"; // Unreachable vertices cannot be the intermediate point\n var relatedEdges = [];\n if (directed) relatedEdges = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getOutEdgesNodeId\"])(minNodeId, edges);else relatedEdges = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getEdgesByNodeId\"])(minNodeId, edges);\n relatedEdges.forEach(function (edge) {\n var edgeTarget = edge.target;\n var edgeSource = edge.source;\n var w = edgeTarget === minNodeId ? edgeSource : edgeTarget;\n var weight = weightPropertyName && edge[weightPropertyName] ? edge[weightPropertyName] : 1;\n if (D[w] > D[minNode.id] + weight) {\n D[w] = D[minNode.id] + weight;\n prevs[w] = [minNode.id];\n } else if (D[w] === D[minNode.id] + weight) {\n prevs[w].push(minNode.id);\n }\n });\n };\n for (var i = 0; i < nodeNum; i++) {\n _loop_1(i);\n }\n prevs[source] = [source];\n // 每个节点存可能存在多条最短路径\n var paths = {};\n for (var target in D) {\n if (D[target] !== Infinity) {\n findAllPaths(source, target, prevs, paths);\n }\n }\n // 兼容之前单路径\n var path = {};\n for (var target in paths) {\n path[target] = paths[target][0];\n }\n return {\n length: D,\n path: path,\n allPath: paths\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (dijkstra);\nfunction findAllPaths(source, target, prevs, foundPaths) {\n if (source === target) {\n return [source];\n }\n if (foundPaths[target]) {\n return foundPaths[target];\n }\n var paths = [];\n for (var _i = 0, _a = prevs[target]; _i < _a.length; _i++) {\n var prev = _a[_i];\n var prevPaths = findAllPaths(source, prev, prevs, foundPaths);\n if (!prevPaths) return;\n for (var _b = 0, prevPaths_1 = prevPaths; _b < prevPaths_1.length; _b++) {\n var prePath = prevPaths_1[_b];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(prePath)) paths.push(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], prePath, true), [target], false));else paths.push([prePath, target]);\n }\n }\n foundPaths[target] = paths;\n return foundPaths[target];\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/dijkstra.js?"); /***/ }), @@ -128,7 +128,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tsli /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findShortestPath\", function() { return findShortestPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findAllPath\", function() { return findAllPath; });\n/* harmony import */ var _dijkstra__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/algorithm/es/dijkstra.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\nvar findShortestPath = function findShortestPath(graphData, start, end, directed, weightPropertyName) {\n var _a = Object(_dijkstra__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, start, directed, weightPropertyName),\n length = _a.length,\n path = _a.path,\n allPath = _a.allPath;\n\n return {\n length: length[end],\n path: path[end],\n allPath: allPath[end]\n };\n};\nvar findAllPath = function findAllPath(graphData, start, end, directed) {\n var _a;\n\n if (start === end) return [[start]];\n var _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var visited = [start];\n var isVisited = (_a = {}, _a[start] = true, _a);\n var stack = []; // 辅助栈,用于存储访问过的节点的邻居节点\n\n var allPath = [];\n var neighbors = directed ? Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(start, edges, 'target') : Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(start, edges);\n stack.push(neighbors);\n\n while (visited.length > 0 && stack.length > 0) {\n var children = stack[stack.length - 1];\n\n if (children.length) {\n var child = children.shift();\n\n if (child) {\n visited.push(child);\n isVisited[child] = true;\n neighbors = directed ? Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(child, edges, 'target') : Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(child, edges);\n stack.push(neighbors.filter(function (neighbor) {\n return !isVisited[neighbor];\n }));\n }\n } else {\n var node = visited.pop();\n isVisited[node] = false;\n stack.pop();\n continue;\n }\n\n if (visited[visited.length - 1] === end) {\n var path = visited.map(function (node) {\n return node;\n });\n allPath.push(path);\n var node = visited.pop();\n isVisited[node] = false;\n stack.pop();\n }\n }\n\n return allPath;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/find-path.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findShortestPath\", function() { return findShortestPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"findAllPath\", function() { return findAllPath; });\n/* harmony import */ var _dijkstra__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/algorithm/es/dijkstra.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\nvar findShortestPath = function findShortestPath(graphData, start, end, directed, weightPropertyName) {\n var _a = Object(_dijkstra__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, start, directed, weightPropertyName),\n length = _a.length,\n path = _a.path,\n allPath = _a.allPath;\n return {\n length: length[end],\n path: path[end],\n allPath: allPath[end]\n };\n};\nvar findAllPath = function findAllPath(graphData, start, end, directed) {\n var _a;\n if (start === end) return [[start]];\n var _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var visited = [start];\n var isVisited = (_a = {}, _a[start] = true, _a);\n var stack = []; // 辅助栈,用于存储访问过的节点的邻居节点\n var allPath = [];\n var neighbors = directed ? Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(start, edges, 'target') : Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(start, edges);\n stack.push(neighbors);\n while (visited.length > 0 && stack.length > 0) {\n var children = stack[stack.length - 1];\n if (children.length) {\n var child = children.shift();\n if (child) {\n visited.push(child);\n isVisited[child] = true;\n neighbors = directed ? Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(child, edges, 'target') : Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(child, edges);\n stack.push(neighbors.filter(function (neighbor) {\n return !isVisited[neighbor];\n }));\n }\n } else {\n var node = visited.pop();\n isVisited[node] = false;\n stack.pop();\n continue;\n }\n if (visited[visited.length - 1] === end) {\n var path = visited.map(function (node) {\n return node;\n });\n allPath.push(path);\n var node = visited.pop();\n isVisited[node] = false;\n stack.pop();\n }\n }\n return allPath;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/find-path.js?"); /***/ }), @@ -140,7 +140,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adjacent_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/es/adjacent-matrix.js\");\n\n\nvar floydWarshall = function floydWarshall(graphData, directed) {\n var adjacentMatrix = Object(_adjacent_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, directed);\n var dist = [];\n var size = adjacentMatrix.length;\n\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n } else if (adjacentMatrix[i][j] === 0 || !adjacentMatrix[i][j]) {\n dist[i][j] = Infinity;\n } else {\n dist[i][j] = adjacentMatrix[i][j];\n }\n }\n } // floyd\n\n\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n\n return dist;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (floydWarshall);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/floydWarshall.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adjacent_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/es/adjacent-matrix.js\");\n\nvar floydWarshall = function floydWarshall(graphData, directed) {\n var adjacentMatrix = Object(_adjacent_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, directed);\n var dist = [];\n var size = adjacentMatrix.length;\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n } else if (adjacentMatrix[i][j] === 0 || !adjacentMatrix[i][j]) {\n dist[i][j] = Infinity;\n } else {\n dist[i][j] = adjacentMatrix[i][j];\n }\n }\n }\n // floyd\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n return dist;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (floydWarshall);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/floydWarshall.js?"); /***/ }), @@ -152,7 +152,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adj /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _struct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./struct */ \"./node_modules/@antv/algorithm/es/gSpan/struct.js\");\n\n\n\nvar DFSedge =\n/** @class */\nfunction () {\n function DFSedge(fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel) {\n this.fromNode = fromNode;\n this.toNode = toNode;\n this.nodeEdgeNodeLabel = {\n nodeLabel1: fromNodeLabel || _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"],\n edgeLabel: edgeLabel || _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_EDGE_LABEL\"],\n nodeLabel2: toNodeLabel || _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"]\n };\n }\n\n DFSedge.prototype.equalTo = function (other) {\n return this.fromNode === other.formNode && this.toNode === other.toNode && this.nodeEdgeNodeLabel === other.nodeEdgeNodeLabel;\n };\n\n DFSedge.prototype.notEqualTo = function (other) {\n return !this.equalTo(other);\n };\n\n return DFSedge;\n}(); // DFScode 是 DESedge 的数组\n\n\nvar DFScode =\n/** @class */\nfunction () {\n function DFScode() {\n this.rmpath = [];\n this.dfsEdgeList = [];\n }\n\n DFScode.prototype.equalTo = function (other) {\n var aLength = this.dfsEdgeList.length;\n var bLength = other.length;\n if (aLength !== bLength) return false;\n\n for (var i = 0; i < aLength; i++) {\n if (this.dfsEdgeList[i] !== other[i]) return false;\n }\n\n return true;\n };\n\n DFScode.prototype.notEqualTo = function (other) {\n return !this.equalTo(other);\n };\n /** 增加一条 edge 到 DFScode */\n\n\n DFScode.prototype.pushBack = function (fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel) {\n this.dfsEdgeList.push(new DFSedge(fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel));\n return this.dfsEdgeList;\n };\n /** 根据 dfs 构建图 */\n\n\n DFScode.prototype.toGraph = function (graphId, directed) {\n if (graphId === void 0) {\n graphId = _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_GRAPH_ID\"];\n }\n\n if (directed === void 0) {\n directed = false;\n }\n\n var graph = new _struct__WEBPACK_IMPORTED_MODULE_1__[\"Graph\"](graphId, true, directed);\n this.dfsEdgeList.forEach(function (dfsEdge) {\n var fromNodeId = dfsEdge.fromNode;\n var toNodeId = dfsEdge.toNode;\n var _a = dfsEdge.nodeEdgeNodeLabel,\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n if (nodeLabel1 !== _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"]) graph.addNode(fromNodeId, nodeLabel1);\n if (nodeLabel2 !== _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"]) graph.addNode(toNodeId, nodeLabel2);\n if (nodeLabel1 !== _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"] && nodeLabel2 !== nodeLabel1) graph.addEdge(undefined, fromNodeId, toNodeId, edgeLabel);\n });\n return graph;\n }; // 建立 rightmost path\n\n\n DFScode.prototype.buildRmpath = function () {\n this.rmpath = [];\n var oldFrom = undefined;\n var selfLength = this.dfsEdgeList.length;\n\n for (var i = selfLength - 1; i >= 0; i--) {\n var dfsEdge = this.dfsEdgeList[i];\n var fromNodeIdx = dfsEdge.fromNode;\n var toNodeIdx = dfsEdge.toNode;\n\n if (fromNodeIdx < toNodeIdx && (oldFrom === undefined || toNodeIdx === oldFrom)) {\n this.rmpath.push(i);\n oldFrom = fromNodeIdx;\n }\n }\n\n return this.rmpath;\n };\n\n DFScode.prototype.getNodeNum = function () {\n var nodeMap = {};\n this.dfsEdgeList.forEach(function (dfsEdge) {\n if (!nodeMap[dfsEdge.fromNode]) nodeMap[dfsEdge.fromNode] = true;\n if (!nodeMap[dfsEdge.toNode]) nodeMap[dfsEdge.toNode] = true;\n });\n return Object.keys(nodeMap).length;\n };\n\n return DFScode;\n}();\n\nvar History =\n/** @class */\nfunction () {\n function History(pdfs) {\n this.his = {};\n this.nodesUsed = {};\n this.edgesUsed = {};\n this.edges = [];\n if (!pdfs) return;\n\n while (pdfs) {\n var e = pdfs.edge;\n this.edges.push(e);\n this.nodesUsed[e.from] = 1;\n this.nodesUsed[e.to] = 1;\n this.edgesUsed[e.id] = 1;\n pdfs = pdfs.preNode;\n } // 倒序\n\n\n this.edges = this.edges.reverse();\n }\n\n History.prototype.hasNode = function (node) {\n return this.nodesUsed[node.id] === 1;\n };\n\n History.prototype.hasEdge = function (edge) {\n return this.edgesUsed[edge.id] === 1;\n };\n\n return History;\n}();\n\nvar GSpan =\n/** @class */\nfunction () {\n function GSpan(_a) {\n var graphs = _a.graphs,\n _b = _a.minSupport,\n minSupport = _b === void 0 ? 2 : _b,\n _c = _a.minNodeNum,\n minNodeNum = _c === void 0 ? 1 : _c,\n _d = _a.maxNodeNum,\n maxNodeNum = _d === void 0 ? 4 : _d,\n _e = _a.top,\n top = _e === void 0 ? 10 : _e,\n _f = _a.directed,\n directed = _f === void 0 ? false : _f,\n _g = _a.verbose,\n verbose = _g === void 0 ? false : _g; // -------- 第零步,初始化-------\n\n this.graphs = graphs;\n this.dfsCode = new DFScode();\n this.support = 0;\n this.frequentSize1Subgraphs = [];\n this.frequentSubgraphs = [];\n this.minSupport = minSupport;\n this.top = top;\n this.directed = directed;\n this.counter = 0; // TODO? timestamp = {}\n\n this.maxNodeNum = maxNodeNum;\n this.minNodeNum = minNodeNum;\n this.verbose = verbose;\n if (this.maxNodeNum < this.minNodeNum) this.maxNodeNum = this.minNodeNum;\n this.reportDF = []; // matrix\n } // Line 352\n\n\n GSpan.prototype.findForwardRootEdges = function (graph, fromNode) {\n var _this = this;\n\n var result = [];\n var nodeMap = graph.nodeMap;\n fromNode.edges.forEach(function (edge) {\n if (_this.directed || fromNode.label <= nodeMap[edge.to].label) result.push(edge);\n });\n return result;\n };\n\n GSpan.prototype.findBackwardEdge = function (graph, edge1, edge2, history) {\n if (!this.directed && edge1 === edge2) return null;\n var nodeMap = graph.nodeMap;\n var edge2To = nodeMap[edge2.to];\n var edge2ToEdges = edge2To.edges;\n var edgeLength = edge2ToEdges.length;\n\n for (var i = 0; i < edgeLength; i++) {\n var edge = edge2ToEdges[i];\n if (history.hasEdge(edge) || edge.to !== edge1.from) continue;\n\n if (!this.directed) {\n if (edge1.label < edge.label || edge1.label === edge.label && nodeMap[edge1.to].label <= nodeMap[edge2.to].label) {\n return edge;\n }\n } else {\n if (nodeMap[edge1.from].label < nodeMap[edge2.to].label || nodeMap[edge1.from].label === nodeMap[edge2.to].label && edge1.label <= edge.label) {\n return edge;\n }\n }\n }\n\n return null;\n };\n\n GSpan.prototype.findForwardPureEdges = function (graph, rightmostEdge, minNodeLabel, history) {\n var result = [];\n var rightmostEdgeToId = rightmostEdge.to;\n var edges = graph.nodeMap[rightmostEdgeToId].edges;\n var edgeLength = edges.length;\n\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var toNode = graph.nodeMap[edge.to];\n\n if (minNodeLabel <= toNode.label && !history.hasNode(toNode)) {\n result.push(edge);\n }\n }\n\n return result;\n };\n\n GSpan.prototype.findForwardRmpathEdges = function (graph, rightmostEdge, minNodeLabel, history) {\n var result = [];\n var nodeMap = graph.nodeMap;\n var toNodeLabel = nodeMap[rightmostEdge.to].label;\n var fromNode = nodeMap[rightmostEdge.from];\n var edges = fromNode.edges;\n var edgeLength = edges.length;\n\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var newToNodeLabel = nodeMap[edge.to].label;\n\n if (rightmostEdge.to === edge.to || minNodeLabel > newToNodeLabel || history.hasNode(nodeMap[edge.to])) {\n continue;\n }\n\n if (rightmostEdge.label < edge.label || rightmostEdge.label === edge.label && toNodeLabel <= newToNodeLabel) {\n result.push(edge);\n }\n }\n\n return result;\n };\n\n GSpan.prototype.getSupport = function (projected) {\n var graphMap = {};\n projected.forEach(function (pro) {\n if (!graphMap[pro.graphId]) graphMap[pro.graphId] = true;\n });\n return Object.keys(graphMap).length;\n };\n\n GSpan.prototype.findMinLabel = function (obj) {\n var minLabel = undefined;\n Object.keys(obj).forEach(function (nodeEdgeNodeLabel) {\n var _a = obj[nodeEdgeNodeLabel],\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n\n if (!minLabel) {\n minLabel = {\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n return;\n }\n\n if (nodeLabel1 < minLabel.nodeLabel1 || nodeLabel1 === minLabel.nodeLabel1 && edgeLabel < minLabel.edgeLabel || nodeLabel1 === minLabel.nodeLabel1 && edgeLabel === minLabel.edgeLabel && nodeLabel2 < minLabel.nodeLabel2) {\n minLabel = {\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n }\n });\n return minLabel;\n };\n\n GSpan.prototype.isMin = function () {\n var _this = this;\n\n var dfsCode = this.dfsCode;\n if (this.verbose) console.log(\"isMin checking\", dfsCode);\n if (dfsCode.dfsEdgeList.length === 1) return true;\n var directed = this.directed;\n var graph = dfsCode.toGraph(_struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_GRAPH_ID\"], directed);\n var nodeMap = graph.nodeMap;\n var dfsCodeMin = new DFScode();\n var root = {};\n graph.nodes.forEach(function (node) {\n var forwardEdges = _this.findForwardRootEdges(graph, node);\n\n forwardEdges.forEach(function (edge) {\n var otherNode = nodeMap[edge.to];\n var nodeEdgeNodeLabel = \"\".concat(node.label, \"-\").concat(edge.label, \"-\").concat(otherNode.label);\n if (!root[nodeEdgeNodeLabel]) root[nodeEdgeNodeLabel] = {\n projected: [],\n nodeLabel1: node.label,\n edgeLabel: edge.label,\n nodeLabel2: otherNode.label\n };\n var pdfs = {\n graphId: graph.id,\n edge: edge,\n preNode: null\n };\n root[nodeEdgeNodeLabel].projected.push(pdfs);\n });\n }); // 比较 root 中每一项的 nodeEdgeNodeLabel 大小,按照 nodeLabel1、edgeLabe、nodeLabel2 的顺序比较\n\n var minLabel = this.findMinLabel(root); // line 419\n\n if (!minLabel) return;\n dfsCodeMin.dfsEdgeList.push(new DFSedge(0, 1, minLabel.nodeLabel1, minLabel.edgeLabel, minLabel.nodeLabel2)); // line 423\n\n var projectIsMin = function projectIsMin(projected) {\n // right most path\n var rmpath = dfsCodeMin.buildRmpath();\n var minNodeLabel = dfsCodeMin.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1;\n var maxToC = dfsCodeMin.dfsEdgeList[rmpath[0]].toNode; // node id\n\n var backwardRoot = {};\n var flag = false,\n newTo = 0;\n var end = directed ? -1 : 0; // 遍历到 1 还是到 0\n\n var _loop_1 = function _loop_1(i) {\n if (flag) return \"break\"; // line 435\n\n projected.forEach(function (p) {\n var history = new History(p);\n\n var backwardEdge = _this.findBackwardEdge(graph, history.edges[rmpath[i]], history.edges[rmpath[0]], history);\n\n if (backwardEdge) {\n // Line 441\n if (!backwardRoot[backwardEdge.label]) {\n backwardRoot[backwardEdge.label] = {\n projected: [],\n edgeLabel: backwardEdge.label\n };\n }\n\n backwardRoot[backwardEdge.label].projected.push({\n graphId: graph.id,\n edge: backwardRoot,\n preNode: p\n });\n newTo = dfsCodeMin.dfsEdgeList[rmpath[i]].fromNode;\n flag = true;\n }\n });\n };\n\n for (var i = rmpath.length - 1; i > end; i--) {\n var state_1 = _loop_1(i);\n\n if (state_1 === \"break\") break;\n }\n\n if (flag) {\n var minBackwardEdgeLabel = _this.findMinLabel(backwardRoot);\n\n dfsCodeMin.dfsEdgeList.push(new DFSedge(maxToC, newTo, _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"], minBackwardEdgeLabel.edgeLabel, _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"]));\n var idx_1 = dfsCodeMin.dfsEdgeList.length - 1;\n if (_this.dfsCode.dfsEdgeList[idx_1] !== dfsCodeMin.dfsEdgeList[idx_1]) return false;\n return projectIsMin(backwardRoot[minBackwardEdgeLabel.edgeLabel].projected);\n }\n\n var forwardRoot = {};\n flag = false;\n var newFrom = 0;\n projected.forEach(function (p) {\n var history = new History(p);\n\n var forwardPureEdges = _this.findForwardPureEdges(graph, history.edges[rmpath[0]], minNodeLabel, history);\n\n if (forwardPureEdges.length > 0) {\n flag = true;\n newFrom = maxToC;\n forwardPureEdges.forEach(function (edge) {\n var key = \"\".concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: graph.id,\n edge: edge,\n preNode: p\n });\n });\n }\n });\n var pathLength = rmpath.length;\n\n var _loop_2 = function _loop_2(i) {\n if (flag) return \"break\";\n var value = rmpath[i];\n projected.forEach(function (p) {\n var history = new History(p);\n\n var forwardRmpathEdges = _this.findForwardRmpathEdges(graph, history.edges[value], minNodeLabel, history);\n\n if (forwardRmpathEdges.length > 0) {\n flag = true;\n newFrom = dfsCodeMin.dfsEdgeList[value].fromNode;\n forwardRmpathEdges.forEach(function (edge) {\n var key = \"\".concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: graph.id,\n edge: edge,\n preNode: p\n });\n });\n }\n });\n };\n\n for (var i = 0; i < pathLength; i++) {\n var state_2 = _loop_2(i);\n\n if (state_2 === \"break\") break;\n }\n\n if (!flag) return true;\n\n var forwardMinEdgeNodeLabel = _this.findMinLabel(forwardRoot);\n\n dfsCodeMin.dfsEdgeList.push(new DFSedge(newFrom, maxToC + 1, _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"], forwardMinEdgeNodeLabel.edgeLabel, forwardMinEdgeNodeLabel.nodeLabel2));\n var idx = dfsCodeMin.dfsEdgeList.length - 1;\n if (dfsCode.dfsEdgeList[idx] !== dfsCodeMin.dfsEdgeList[idx]) return false;\n return projectIsMin(forwardRoot[\"\".concat(forwardMinEdgeNodeLabel.edgeLabel, \"-\").concat(forwardMinEdgeNodeLabel.nodeLabel2)].projected);\n };\n\n var key = \"\".concat(minLabel.nodeLabel1, \"-\").concat(minLabel.edgeLabel, \"-\").concat(minLabel.nodeLabel2);\n return projectIsMin(root[key].projected);\n };\n\n GSpan.prototype.report = function () {\n if (this.dfsCode.getNodeNum() < this.minNodeNum) return;\n this.counter++;\n var graph = this.dfsCode.toGraph(this.counter, this.directed);\n this.frequentSubgraphs.push(Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(graph));\n };\n\n GSpan.prototype.subGraphMining = function (projected) {\n var _this = this;\n\n var support = this.getSupport(projected);\n if (support < this.minSupport) return;\n if (!this.isMin()) return;\n this.report();\n var nodeNum = this.dfsCode.getNodeNum();\n var rmpath = this.dfsCode.buildRmpath();\n var maxToC = this.dfsCode.dfsEdgeList[rmpath[0]].toNode;\n var minNodeLabel = this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1;\n var forwardRoot = {};\n var backwardRoot = {};\n projected.forEach(function (p) {\n var graph = _this.graphs[p.graphId];\n var nodeMap = graph.nodeMap;\n var history = new History(p); // backward Line 526\n\n for (var i = rmpath.length - 1; i >= 0; i--) {\n var backwardEdge = _this.findBackwardEdge(graph, history.edges[rmpath[i]], history.edges[rmpath[0]], history);\n\n if (backwardEdge) {\n var key = \"\".concat(_this.dfsCode.dfsEdgeList[rmpath[i]].fromNode, \"-\").concat(backwardEdge.label);\n if (!backwardRoot[key]) backwardRoot[key] = {\n projected: [],\n toNodeId: _this.dfsCode.dfsEdgeList[rmpath[i]].fromNode,\n edgeLabel: backwardEdge.label\n };\n backwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: backwardEdge,\n preNode: p\n });\n }\n } // pure forward\n\n\n if (nodeNum >= _this.maxNodeNum) return;\n\n var forwardPureEdges = _this.findForwardPureEdges(graph, history.edges[rmpath[0]], minNodeLabel, history);\n\n forwardPureEdges.forEach(function (edge) {\n var key = \"\".concat(maxToC, \"-\").concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n fromNodeId: maxToC,\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: edge,\n preNode: p\n });\n });\n\n var _loop_3 = function _loop_3(i) {\n var forwardRmpathEdges = _this.findForwardRmpathEdges(graph, history.edges[rmpath[i]], minNodeLabel, history);\n\n forwardRmpathEdges.forEach(function (edge) {\n var key = \"\".concat(_this.dfsCode.dfsEdgeList[rmpath[i]].fromNode, \"-\").concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n fromNodeId: _this.dfsCode.dfsEdgeList[rmpath[i]].fromNode,\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: edge,\n preNode: p\n });\n });\n }; // rmpath forward\n\n\n for (var i = 0; i < rmpath.length; i++) {\n _loop_3(i);\n }\n }); // backward\n\n Object.keys(backwardRoot).forEach(function (key) {\n var _a = backwardRoot[key],\n toNodeId = _a.toNodeId,\n edgeLabel = _a.edgeLabel;\n\n _this.dfsCode.dfsEdgeList.push(new DFSedge(maxToC, toNodeId, \"-1\", edgeLabel, \"-1\"));\n\n _this.subGraphMining(backwardRoot[key].projected);\n\n _this.dfsCode.dfsEdgeList.pop();\n }); // forward\n\n Object.keys(forwardRoot).forEach(function (key) {\n var _a = forwardRoot[key],\n fromNodeId = _a.fromNodeId,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n\n _this.dfsCode.dfsEdgeList.push(new DFSedge(fromNodeId, maxToC + 1, _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"], edgeLabel, nodeLabel2));\n\n _this.subGraphMining(forwardRoot[key].projected);\n\n _this.dfsCode.dfsEdgeList.pop();\n });\n };\n\n GSpan.prototype.generate1EdgeFrequentSubGraphs = function () {\n var graphs = this.graphs;\n var directed = this.directed;\n var minSupport = this.minSupport;\n var frequentSize1Subgraphs = this.frequentSize1Subgraphs;\n var nodeLabelCounter = {},\n nodeEdgeNodeCounter = {}; // 保存各个图和各自节点的关系 map,key 格式为 graphKey-node类型\n\n var nodeLableCounted = {}; // 保存各个图和各自边的关系 map,key 格式为 graphKey-fromNode类型-edge类型-toNode类型\n\n var nodeEdgeNodeLabelCounted = {};\n Object.keys(graphs).forEach(function (key) {\n // Line 271\n var graph = graphs[key];\n var nodeMap = graph.nodeMap; // 遍历节点,记录对应图 与 每个节点的 label 到 nodeLableCounted\n\n graph.nodes.forEach(function (node, i) {\n // Line 272\n var nodeLabel = node.label;\n var graphNodeKey = \"\".concat(key, \"-\").concat(nodeLabel);\n\n if (!nodeLableCounted[graphNodeKey]) {\n var counter = nodeLabelCounter[nodeLabel] || 0;\n counter++;\n nodeLabelCounter[nodeLabel] = counter;\n }\n\n nodeLableCounted[graphNodeKey] = {\n graphKey: key,\n label: nodeLabel\n }; // 遍历该节点的所有边,记录各个图和各自边的关系到 nodeEdgeNodeLabelCounted. Line 276\n\n node.edges.forEach(function (edge) {\n var nodeLabel1 = nodeLabel;\n var nodeLabel2 = nodeMap[edge.to].label;\n\n if (!directed && nodeLabel1 > nodeLabel2) {\n var tmp = nodeLabel2;\n nodeLabel2 = nodeLabel1;\n nodeLabel1 = tmp;\n }\n\n var edgeLabel = edge.label;\n var graphNodeEdgeNodeKey = \"\".concat(key, \"-\").concat(nodeLabel1, \"-\").concat(edgeLabel, \"-\").concat(nodeLabel2);\n var nodeEdgeNodeKey = \"\".concat(nodeLabel1, \"-\").concat(edgeLabel, \"-\").concat(nodeLabel2);\n\n if (!nodeEdgeNodeCounter[nodeEdgeNodeKey]) {\n var counter = nodeEdgeNodeCounter[nodeEdgeNodeKey] || 0;\n counter++;\n nodeEdgeNodeCounter[nodeEdgeNodeKey] = counter; // Line281\n }\n\n nodeEdgeNodeLabelCounted[graphNodeEdgeNodeKey] = {\n graphId: key,\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n });\n });\n }); // 计算频繁的节点\n\n Object.keys(nodeLabelCounter).forEach(function (label) {\n var count = nodeLabelCounter[label];\n if (count < minSupport) return;\n var g = {\n nodes: [],\n edges: []\n };\n g.nodes.push({\n id: \"0\",\n label: label\n });\n frequentSize1Subgraphs.push(g); // if (minNodeNum <= 1) reportSize1 TODO\n });\n return frequentSize1Subgraphs;\n };\n\n GSpan.prototype.run = function () {\n var _this = this; // -------- 第一步, _generate_1edge_frequent_subgraphs:频繁的单个节点-------\n\n\n this.frequentSize1Subgraphs = this.generate1EdgeFrequentSubGraphs();\n if (this.maxNodeNum < 2) return;\n var graphs = this.graphs;\n var directed = this.directed; // PDFS 数组的 map Line 304\n\n var root = {};\n Object.keys(graphs).forEach(function (graphId) {\n var graph = graphs[graphId];\n var nodeMap = graph.nodeMap; // Line 306\n\n graph.nodes.forEach(function (node) {\n var forwardRootEdges = _this.findForwardRootEdges(graph, node); // Line 308\n\n\n forwardRootEdges.forEach(function (edge) {\n var toNode = nodeMap[edge.to];\n var nodeEdgeNodeLabel = \"\".concat(node.label, \"-\").concat(edge.label, \"-\").concat(toNode.label);\n if (!root[nodeEdgeNodeLabel]) root[nodeEdgeNodeLabel] = {\n projected: [],\n nodeLabel1: node.label,\n edgeLabel: edge.label,\n nodeLabel2: toNode.label\n };\n var pdfs = {\n graphId: graphId,\n edge: edge,\n preNode: null\n };\n root[nodeEdgeNodeLabel].projected.push(pdfs);\n });\n });\n }); // Line 313\n\n Object.keys(root).forEach(function (nodeEdgeNodeLabel) {\n var _a = root[nodeEdgeNodeLabel],\n projected = _a.projected,\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n\n _this.dfsCode.dfsEdgeList.push(new DFSedge(0, 1, nodeLabel1, edgeLabel, nodeLabel2));\n\n _this.subGraphMining(projected);\n\n _this.dfsCode.dfsEdgeList.pop();\n });\n };\n\n return GSpan;\n}();\n\nvar formatGraphs = function formatGraphs(graphs, directed, nodeLabelProp, edgeLabelProp) {\n var result = {};\n Object.keys(graphs).forEach(function (key, i) {\n var graph = graphs[key];\n var fGraph = new _struct__WEBPACK_IMPORTED_MODULE_1__[\"Graph\"](i, true, directed);\n var nodeIdxMap = {};\n graph.nodes.forEach(function (node, j) {\n fGraph.addNode(j, node[nodeLabelProp]);\n nodeIdxMap[node.id] = j;\n });\n graph.edges.forEach(function (edge, k) {\n var sourceIdx = nodeIdxMap[edge.source];\n var targetIdx = nodeIdxMap[edge.target];\n fGraph.addEdge(-1, sourceIdx, targetIdx, edge[edgeLabelProp]);\n });\n if (fGraph && fGraph.getNodeNum()) result[fGraph.id] = fGraph;\n });\n return result;\n};\n\nvar toGraphDatas = function toGraphDatas(graphs, nodeLabelProp, edgeLabelProp) {\n var result = [];\n graphs.forEach(function (graph) {\n var graphData = {\n nodes: [],\n edges: []\n };\n graph.nodes.forEach(function (node) {\n var _a;\n\n graphData.nodes.push((_a = {\n id: \"\".concat(node.id)\n }, _a[nodeLabelProp] = node.label, _a));\n });\n graph.edges.forEach(function (edge) {\n var _a;\n\n graphData.edges.push((_a = {\n source: \"\".concat(edge.from),\n target: \"\".concat(edge.to)\n }, _a[edgeLabelProp] = edge.label, _a));\n });\n result.push(graphData);\n });\n return result;\n};\n\nvar DEFAULT_LABEL_NAME = \"cluster\";\n/**\n * gSpan 频繁子图计算算法(frequent graph mining)\n * @param params 参数\n */\n\nvar gSpan = function gSpan(params) {\n // ------- 将图数据 GraphData 的 map 转换为格式 -------\n var graphs = params.graphs,\n _a = params.directed,\n directed = _a === void 0 ? false : _a,\n _b = params.nodeLabelProp,\n nodeLabelProp = _b === void 0 ? DEFAULT_LABEL_NAME : _b,\n _c = params.edgeLabelProp,\n edgeLabelProp = _c === void 0 ? DEFAULT_LABEL_NAME : _c;\n var formattedGraphs = formatGraphs(graphs, directed, nodeLabelProp, edgeLabelProp);\n var minSupport = params.minSupport,\n maxNodeNum = params.maxNodeNum,\n minNodeNum = params.minNodeNum,\n verbose = params.verbose,\n top = params.top; // ------- 初始化与执行算法 -------\n\n var algoParams = {\n graphs: formattedGraphs,\n minSupport: minSupport,\n maxNodeNum: maxNodeNum,\n minNodeNum: minNodeNum,\n top: top,\n verbose: verbose,\n directed: directed\n };\n var calculator = new GSpan(algoParams);\n calculator.run();\n var result = toGraphDatas(calculator.frequentSubgraphs, nodeLabelProp, edgeLabelProp);\n return result;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (gSpan);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/gSpan/gSpan.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _struct__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./struct */ \"./node_modules/@antv/algorithm/es/gSpan/struct.js\");\n\n\nvar DFSedge = /** @class */function () {\n function DFSedge(fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel) {\n this.fromNode = fromNode;\n this.toNode = toNode;\n this.nodeEdgeNodeLabel = {\n nodeLabel1: fromNodeLabel || _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"],\n edgeLabel: edgeLabel || _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_EDGE_LABEL\"],\n nodeLabel2: toNodeLabel || _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"]\n };\n }\n DFSedge.prototype.equalTo = function (other) {\n return this.fromNode === other.formNode && this.toNode === other.toNode && this.nodeEdgeNodeLabel === other.nodeEdgeNodeLabel;\n };\n DFSedge.prototype.notEqualTo = function (other) {\n return !this.equalTo(other);\n };\n return DFSedge;\n}();\n// DFScode 是 DESedge 的数组\nvar DFScode = /** @class */function () {\n function DFScode() {\n this.rmpath = [];\n this.dfsEdgeList = [];\n }\n DFScode.prototype.equalTo = function (other) {\n var aLength = this.dfsEdgeList.length;\n var bLength = other.length;\n if (aLength !== bLength) return false;\n for (var i = 0; i < aLength; i++) {\n if (this.dfsEdgeList[i] !== other[i]) return false;\n }\n return true;\n };\n DFScode.prototype.notEqualTo = function (other) {\n return !this.equalTo(other);\n };\n /** 增加一条 edge 到 DFScode */\n DFScode.prototype.pushBack = function (fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel) {\n this.dfsEdgeList.push(new DFSedge(fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel));\n return this.dfsEdgeList;\n };\n /** 根据 dfs 构建图 */\n DFScode.prototype.toGraph = function (graphId, directed) {\n if (graphId === void 0) {\n graphId = _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_GRAPH_ID\"];\n }\n if (directed === void 0) {\n directed = false;\n }\n var graph = new _struct__WEBPACK_IMPORTED_MODULE_1__[\"Graph\"](graphId, true, directed);\n this.dfsEdgeList.forEach(function (dfsEdge) {\n var fromNodeId = dfsEdge.fromNode;\n var toNodeId = dfsEdge.toNode;\n var _a = dfsEdge.nodeEdgeNodeLabel,\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n if (nodeLabel1 !== _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"]) graph.addNode(fromNodeId, nodeLabel1);\n if (nodeLabel2 !== _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"]) graph.addNode(toNodeId, nodeLabel2);\n if (nodeLabel1 !== _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"] && nodeLabel2 !== nodeLabel1) graph.addEdge(undefined, fromNodeId, toNodeId, edgeLabel);\n });\n return graph;\n };\n // 建立 rightmost path\n DFScode.prototype.buildRmpath = function () {\n this.rmpath = [];\n var oldFrom = undefined;\n var selfLength = this.dfsEdgeList.length;\n for (var i = selfLength - 1; i >= 0; i--) {\n var dfsEdge = this.dfsEdgeList[i];\n var fromNodeIdx = dfsEdge.fromNode;\n var toNodeIdx = dfsEdge.toNode;\n if (fromNodeIdx < toNodeIdx && (oldFrom === undefined || toNodeIdx === oldFrom)) {\n this.rmpath.push(i);\n oldFrom = fromNodeIdx;\n }\n }\n return this.rmpath;\n };\n DFScode.prototype.getNodeNum = function () {\n var nodeMap = {};\n this.dfsEdgeList.forEach(function (dfsEdge) {\n if (!nodeMap[dfsEdge.fromNode]) nodeMap[dfsEdge.fromNode] = true;\n if (!nodeMap[dfsEdge.toNode]) nodeMap[dfsEdge.toNode] = true;\n });\n return Object.keys(nodeMap).length;\n };\n return DFScode;\n}();\nvar History = /** @class */function () {\n function History(pdfs) {\n this.his = {};\n this.nodesUsed = {};\n this.edgesUsed = {};\n this.edges = [];\n if (!pdfs) return;\n while (pdfs) {\n var e = pdfs.edge;\n this.edges.push(e);\n this.nodesUsed[e.from] = 1;\n this.nodesUsed[e.to] = 1;\n this.edgesUsed[e.id] = 1;\n pdfs = pdfs.preNode;\n }\n // 倒序\n this.edges = this.edges.reverse();\n }\n History.prototype.hasNode = function (node) {\n return this.nodesUsed[node.id] === 1;\n };\n History.prototype.hasEdge = function (edge) {\n return this.edgesUsed[edge.id] === 1;\n };\n return History;\n}();\nvar GSpan = /** @class */function () {\n function GSpan(_a) {\n var graphs = _a.graphs,\n _b = _a.minSupport,\n minSupport = _b === void 0 ? 2 : _b,\n _c = _a.minNodeNum,\n minNodeNum = _c === void 0 ? 1 : _c,\n _d = _a.maxNodeNum,\n maxNodeNum = _d === void 0 ? 4 : _d,\n _e = _a.top,\n top = _e === void 0 ? 10 : _e,\n _f = _a.directed,\n directed = _f === void 0 ? false : _f,\n _g = _a.verbose,\n verbose = _g === void 0 ? false : _g;\n // -------- 第零步,初始化-------\n this.graphs = graphs;\n this.dfsCode = new DFScode();\n this.support = 0;\n this.frequentSize1Subgraphs = [];\n this.frequentSubgraphs = [];\n this.minSupport = minSupport;\n this.top = top;\n this.directed = directed;\n this.counter = 0;\n // TODO? timestamp = {}\n this.maxNodeNum = maxNodeNum;\n this.minNodeNum = minNodeNum;\n this.verbose = verbose;\n if (this.maxNodeNum < this.minNodeNum) this.maxNodeNum = this.minNodeNum;\n this.reportDF = []; // matrix\n }\n // Line 352\n GSpan.prototype.findForwardRootEdges = function (graph, fromNode) {\n var _this = this;\n var result = [];\n var nodeMap = graph.nodeMap;\n fromNode.edges.forEach(function (edge) {\n if (_this.directed || fromNode.label <= nodeMap[edge.to].label) result.push(edge);\n });\n return result;\n };\n GSpan.prototype.findBackwardEdge = function (graph, edge1, edge2, history) {\n if (!this.directed && edge1 === edge2) return null;\n var nodeMap = graph.nodeMap;\n var edge2To = nodeMap[edge2.to];\n var edge2ToEdges = edge2To.edges;\n var edgeLength = edge2ToEdges.length;\n for (var i = 0; i < edgeLength; i++) {\n var edge = edge2ToEdges[i];\n if (history.hasEdge(edge) || edge.to !== edge1.from) continue;\n if (!this.directed) {\n if (edge1.label < edge.label || edge1.label === edge.label && nodeMap[edge1.to].label <= nodeMap[edge2.to].label) {\n return edge;\n }\n } else {\n if (nodeMap[edge1.from].label < nodeMap[edge2.to].label || nodeMap[edge1.from].label === nodeMap[edge2.to].label && edge1.label <= edge.label) {\n return edge;\n }\n }\n }\n return null;\n };\n GSpan.prototype.findForwardPureEdges = function (graph, rightmostEdge, minNodeLabel, history) {\n var result = [];\n var rightmostEdgeToId = rightmostEdge.to;\n var edges = graph.nodeMap[rightmostEdgeToId].edges;\n var edgeLength = edges.length;\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var toNode = graph.nodeMap[edge.to];\n if (minNodeLabel <= toNode.label && !history.hasNode(toNode)) {\n result.push(edge);\n }\n }\n return result;\n };\n GSpan.prototype.findForwardRmpathEdges = function (graph, rightmostEdge, minNodeLabel, history) {\n var result = [];\n var nodeMap = graph.nodeMap;\n var toNodeLabel = nodeMap[rightmostEdge.to].label;\n var fromNode = nodeMap[rightmostEdge.from];\n var edges = fromNode.edges;\n var edgeLength = edges.length;\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var newToNodeLabel = nodeMap[edge.to].label;\n if (rightmostEdge.to === edge.to || minNodeLabel > newToNodeLabel || history.hasNode(nodeMap[edge.to])) {\n continue;\n }\n if (rightmostEdge.label < edge.label || rightmostEdge.label === edge.label && toNodeLabel <= newToNodeLabel) {\n result.push(edge);\n }\n }\n return result;\n };\n GSpan.prototype.getSupport = function (projected) {\n var graphMap = {};\n projected.forEach(function (pro) {\n if (!graphMap[pro.graphId]) graphMap[pro.graphId] = true;\n });\n return Object.keys(graphMap).length;\n };\n GSpan.prototype.findMinLabel = function (obj) {\n var minLabel = undefined;\n Object.keys(obj).forEach(function (nodeEdgeNodeLabel) {\n var _a = obj[nodeEdgeNodeLabel],\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n if (!minLabel) {\n minLabel = {\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n return;\n }\n if (nodeLabel1 < minLabel.nodeLabel1 || nodeLabel1 === minLabel.nodeLabel1 && edgeLabel < minLabel.edgeLabel || nodeLabel1 === minLabel.nodeLabel1 && edgeLabel === minLabel.edgeLabel && nodeLabel2 < minLabel.nodeLabel2) {\n minLabel = {\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n }\n });\n return minLabel;\n };\n GSpan.prototype.isMin = function () {\n var _this = this;\n var dfsCode = this.dfsCode;\n if (this.verbose) console.log(\"isMin checking\", dfsCode);\n if (dfsCode.dfsEdgeList.length === 1) return true;\n var directed = this.directed;\n var graph = dfsCode.toGraph(_struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_GRAPH_ID\"], directed);\n var nodeMap = graph.nodeMap;\n var dfsCodeMin = new DFScode();\n var root = {};\n graph.nodes.forEach(function (node) {\n var forwardEdges = _this.findForwardRootEdges(graph, node);\n forwardEdges.forEach(function (edge) {\n var otherNode = nodeMap[edge.to];\n var nodeEdgeNodeLabel = \"\".concat(node.label, \"-\").concat(edge.label, \"-\").concat(otherNode.label);\n if (!root[nodeEdgeNodeLabel]) root[nodeEdgeNodeLabel] = {\n projected: [],\n nodeLabel1: node.label,\n edgeLabel: edge.label,\n nodeLabel2: otherNode.label\n };\n var pdfs = {\n graphId: graph.id,\n edge: edge,\n preNode: null\n };\n root[nodeEdgeNodeLabel].projected.push(pdfs);\n });\n });\n // 比较 root 中每一项的 nodeEdgeNodeLabel 大小,按照 nodeLabel1、edgeLabe、nodeLabel2 的顺序比较\n var minLabel = this.findMinLabel(root); // line 419\n if (!minLabel) return;\n dfsCodeMin.dfsEdgeList.push(new DFSedge(0, 1, minLabel.nodeLabel1, minLabel.edgeLabel, minLabel.nodeLabel2));\n // line 423\n var projectIsMin = function projectIsMin(projected) {\n // right most path\n var rmpath = dfsCodeMin.buildRmpath();\n var minNodeLabel = dfsCodeMin.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1;\n var maxToC = dfsCodeMin.dfsEdgeList[rmpath[0]].toNode; // node id\n var backwardRoot = {};\n var flag = false,\n newTo = 0;\n var end = directed ? -1 : 0; // 遍历到 1 还是到 0\n var _loop_1 = function _loop_1(i) {\n if (flag) return \"break\";\n // line 435\n projected.forEach(function (p) {\n var history = new History(p);\n var backwardEdge = _this.findBackwardEdge(graph, history.edges[rmpath[i]], history.edges[rmpath[0]], history);\n if (backwardEdge) {\n // Line 441\n if (!backwardRoot[backwardEdge.label]) {\n backwardRoot[backwardEdge.label] = {\n projected: [],\n edgeLabel: backwardEdge.label\n };\n }\n backwardRoot[backwardEdge.label].projected.push({\n graphId: graph.id,\n edge: backwardRoot,\n preNode: p\n });\n newTo = dfsCodeMin.dfsEdgeList[rmpath[i]].fromNode;\n flag = true;\n }\n });\n };\n for (var i = rmpath.length - 1; i > end; i--) {\n var state_1 = _loop_1(i);\n if (state_1 === \"break\") break;\n }\n if (flag) {\n var minBackwardEdgeLabel = _this.findMinLabel(backwardRoot);\n dfsCodeMin.dfsEdgeList.push(new DFSedge(maxToC, newTo, _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"], minBackwardEdgeLabel.edgeLabel, _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"]));\n var idx_1 = dfsCodeMin.dfsEdgeList.length - 1;\n if (_this.dfsCode.dfsEdgeList[idx_1] !== dfsCodeMin.dfsEdgeList[idx_1]) return false;\n return projectIsMin(backwardRoot[minBackwardEdgeLabel.edgeLabel].projected);\n }\n var forwardRoot = {};\n flag = false;\n var newFrom = 0;\n projected.forEach(function (p) {\n var history = new History(p);\n var forwardPureEdges = _this.findForwardPureEdges(graph, history.edges[rmpath[0]], minNodeLabel, history);\n if (forwardPureEdges.length > 0) {\n flag = true;\n newFrom = maxToC;\n forwardPureEdges.forEach(function (edge) {\n var key = \"\".concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: graph.id,\n edge: edge,\n preNode: p\n });\n });\n }\n });\n var pathLength = rmpath.length;\n var _loop_2 = function _loop_2(i) {\n if (flag) return \"break\";\n var value = rmpath[i];\n projected.forEach(function (p) {\n var history = new History(p);\n var forwardRmpathEdges = _this.findForwardRmpathEdges(graph, history.edges[value], minNodeLabel, history);\n if (forwardRmpathEdges.length > 0) {\n flag = true;\n newFrom = dfsCodeMin.dfsEdgeList[value].fromNode;\n forwardRmpathEdges.forEach(function (edge) {\n var key = \"\".concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: graph.id,\n edge: edge,\n preNode: p\n });\n });\n }\n });\n };\n for (var i = 0; i < pathLength; i++) {\n var state_2 = _loop_2(i);\n if (state_2 === \"break\") break;\n }\n if (!flag) return true;\n var forwardMinEdgeNodeLabel = _this.findMinLabel(forwardRoot);\n dfsCodeMin.dfsEdgeList.push(new DFSedge(newFrom, maxToC + 1, _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"], forwardMinEdgeNodeLabel.edgeLabel, forwardMinEdgeNodeLabel.nodeLabel2));\n var idx = dfsCodeMin.dfsEdgeList.length - 1;\n if (dfsCode.dfsEdgeList[idx] !== dfsCodeMin.dfsEdgeList[idx]) return false;\n return projectIsMin(forwardRoot[\"\".concat(forwardMinEdgeNodeLabel.edgeLabel, \"-\").concat(forwardMinEdgeNodeLabel.nodeLabel2)].projected);\n };\n var key = \"\".concat(minLabel.nodeLabel1, \"-\").concat(minLabel.edgeLabel, \"-\").concat(minLabel.nodeLabel2);\n return projectIsMin(root[key].projected);\n };\n GSpan.prototype.report = function () {\n if (this.dfsCode.getNodeNum() < this.minNodeNum) return;\n this.counter++;\n var graph = this.dfsCode.toGraph(this.counter, this.directed);\n this.frequentSubgraphs.push(Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(graph));\n };\n GSpan.prototype.subGraphMining = function (projected) {\n var _this = this;\n var support = this.getSupport(projected);\n if (support < this.minSupport) return;\n if (!this.isMin()) return;\n this.report();\n var nodeNum = this.dfsCode.getNodeNum();\n var rmpath = this.dfsCode.buildRmpath();\n var maxToC = this.dfsCode.dfsEdgeList[rmpath[0]].toNode;\n var minNodeLabel = this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1;\n var forwardRoot = {};\n var backwardRoot = {};\n projected.forEach(function (p) {\n var graph = _this.graphs[p.graphId];\n var nodeMap = graph.nodeMap;\n var history = new History(p);\n // backward Line 526\n for (var i = rmpath.length - 1; i >= 0; i--) {\n var backwardEdge = _this.findBackwardEdge(graph, history.edges[rmpath[i]], history.edges[rmpath[0]], history);\n if (backwardEdge) {\n var key = \"\".concat(_this.dfsCode.dfsEdgeList[rmpath[i]].fromNode, \"-\").concat(backwardEdge.label);\n if (!backwardRoot[key]) backwardRoot[key] = {\n projected: [],\n toNodeId: _this.dfsCode.dfsEdgeList[rmpath[i]].fromNode,\n edgeLabel: backwardEdge.label\n };\n backwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: backwardEdge,\n preNode: p\n });\n }\n }\n // pure forward\n if (nodeNum >= _this.maxNodeNum) return;\n var forwardPureEdges = _this.findForwardPureEdges(graph, history.edges[rmpath[0]], minNodeLabel, history);\n forwardPureEdges.forEach(function (edge) {\n var key = \"\".concat(maxToC, \"-\").concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n fromNodeId: maxToC,\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: edge,\n preNode: p\n });\n });\n var _loop_3 = function _loop_3(i) {\n var forwardRmpathEdges = _this.findForwardRmpathEdges(graph, history.edges[rmpath[i]], minNodeLabel, history);\n forwardRmpathEdges.forEach(function (edge) {\n var key = \"\".concat(_this.dfsCode.dfsEdgeList[rmpath[i]].fromNode, \"-\").concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n fromNodeId: _this.dfsCode.dfsEdgeList[rmpath[i]].fromNode,\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: edge,\n preNode: p\n });\n });\n };\n // rmpath forward\n for (var i = 0; i < rmpath.length; i++) {\n _loop_3(i);\n }\n });\n // backward\n Object.keys(backwardRoot).forEach(function (key) {\n var _a = backwardRoot[key],\n toNodeId = _a.toNodeId,\n edgeLabel = _a.edgeLabel;\n _this.dfsCode.dfsEdgeList.push(new DFSedge(maxToC, toNodeId, \"-1\", edgeLabel, \"-1\"));\n _this.subGraphMining(backwardRoot[key].projected);\n _this.dfsCode.dfsEdgeList.pop();\n });\n // forward\n Object.keys(forwardRoot).forEach(function (key) {\n var _a = forwardRoot[key],\n fromNodeId = _a.fromNodeId,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n _this.dfsCode.dfsEdgeList.push(new DFSedge(fromNodeId, maxToC + 1, _struct__WEBPACK_IMPORTED_MODULE_1__[\"VACANT_NODE_LABEL\"], edgeLabel, nodeLabel2));\n _this.subGraphMining(forwardRoot[key].projected);\n _this.dfsCode.dfsEdgeList.pop();\n });\n };\n GSpan.prototype.generate1EdgeFrequentSubGraphs = function () {\n var graphs = this.graphs;\n var directed = this.directed;\n var minSupport = this.minSupport;\n var frequentSize1Subgraphs = this.frequentSize1Subgraphs;\n var nodeLabelCounter = {},\n nodeEdgeNodeCounter = {};\n // 保存各个图和各自节点的关系 map,key 格式为 graphKey-node类型\n var nodeLableCounted = {};\n // 保存各个图和各自边的关系 map,key 格式为 graphKey-fromNode类型-edge类型-toNode类型\n var nodeEdgeNodeLabelCounted = {};\n Object.keys(graphs).forEach(function (key) {\n // Line 271\n var graph = graphs[key];\n var nodeMap = graph.nodeMap;\n // 遍历节点,记录对应图 与 每个节点的 label 到 nodeLableCounted\n graph.nodes.forEach(function (node, i) {\n // Line 272\n var nodeLabel = node.label;\n var graphNodeKey = \"\".concat(key, \"-\").concat(nodeLabel);\n if (!nodeLableCounted[graphNodeKey]) {\n var counter = nodeLabelCounter[nodeLabel] || 0;\n counter++;\n nodeLabelCounter[nodeLabel] = counter;\n }\n nodeLableCounted[graphNodeKey] = {\n graphKey: key,\n label: nodeLabel\n };\n // 遍历该节点的所有边,记录各个图和各自边的关系到 nodeEdgeNodeLabelCounted. Line 276\n node.edges.forEach(function (edge) {\n var nodeLabel1 = nodeLabel;\n var nodeLabel2 = nodeMap[edge.to].label;\n if (!directed && nodeLabel1 > nodeLabel2) {\n var tmp = nodeLabel2;\n nodeLabel2 = nodeLabel1;\n nodeLabel1 = tmp;\n }\n var edgeLabel = edge.label;\n var graphNodeEdgeNodeKey = \"\".concat(key, \"-\").concat(nodeLabel1, \"-\").concat(edgeLabel, \"-\").concat(nodeLabel2);\n var nodeEdgeNodeKey = \"\".concat(nodeLabel1, \"-\").concat(edgeLabel, \"-\").concat(nodeLabel2);\n if (!nodeEdgeNodeCounter[nodeEdgeNodeKey]) {\n var counter = nodeEdgeNodeCounter[nodeEdgeNodeKey] || 0;\n counter++;\n nodeEdgeNodeCounter[nodeEdgeNodeKey] = counter; // Line281\n }\n\n nodeEdgeNodeLabelCounted[graphNodeEdgeNodeKey] = {\n graphId: key,\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n });\n });\n });\n // 计算频繁的节点\n Object.keys(nodeLabelCounter).forEach(function (label) {\n var count = nodeLabelCounter[label];\n if (count < minSupport) return;\n var g = {\n nodes: [],\n edges: []\n };\n g.nodes.push({\n id: \"0\",\n label: label\n });\n frequentSize1Subgraphs.push(g);\n // if (minNodeNum <= 1) reportSize1 TODO\n });\n\n return frequentSize1Subgraphs;\n };\n GSpan.prototype.run = function () {\n var _this = this;\n // -------- 第一步, _generate_1edge_frequent_subgraphs:频繁的单个节点-------\n this.frequentSize1Subgraphs = this.generate1EdgeFrequentSubGraphs();\n if (this.maxNodeNum < 2) return;\n var graphs = this.graphs;\n var directed = this.directed;\n // PDFS 数组的 map Line 304\n var root = {};\n Object.keys(graphs).forEach(function (graphId) {\n var graph = graphs[graphId];\n var nodeMap = graph.nodeMap;\n // Line 306\n graph.nodes.forEach(function (node) {\n var forwardRootEdges = _this.findForwardRootEdges(graph, node);\n // Line 308\n forwardRootEdges.forEach(function (edge) {\n var toNode = nodeMap[edge.to];\n var nodeEdgeNodeLabel = \"\".concat(node.label, \"-\").concat(edge.label, \"-\").concat(toNode.label);\n if (!root[nodeEdgeNodeLabel]) root[nodeEdgeNodeLabel] = {\n projected: [],\n nodeLabel1: node.label,\n edgeLabel: edge.label,\n nodeLabel2: toNode.label\n };\n var pdfs = {\n graphId: graphId,\n edge: edge,\n preNode: null\n };\n root[nodeEdgeNodeLabel].projected.push(pdfs);\n });\n });\n });\n // Line 313\n Object.keys(root).forEach(function (nodeEdgeNodeLabel) {\n var _a = root[nodeEdgeNodeLabel],\n projected = _a.projected,\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n _this.dfsCode.dfsEdgeList.push(new DFSedge(0, 1, nodeLabel1, edgeLabel, nodeLabel2));\n _this.subGraphMining(projected);\n _this.dfsCode.dfsEdgeList.pop();\n });\n };\n return GSpan;\n}();\nvar formatGraphs = function formatGraphs(graphs, directed, nodeLabelProp, edgeLabelProp) {\n var result = {};\n Object.keys(graphs).forEach(function (key, i) {\n var graph = graphs[key];\n var fGraph = new _struct__WEBPACK_IMPORTED_MODULE_1__[\"Graph\"](i, true, directed);\n var nodeIdxMap = {};\n graph.nodes.forEach(function (node, j) {\n fGraph.addNode(j, node[nodeLabelProp]);\n nodeIdxMap[node.id] = j;\n });\n graph.edges.forEach(function (edge, k) {\n var sourceIdx = nodeIdxMap[edge.source];\n var targetIdx = nodeIdxMap[edge.target];\n fGraph.addEdge(-1, sourceIdx, targetIdx, edge[edgeLabelProp]);\n });\n if (fGraph && fGraph.getNodeNum()) result[fGraph.id] = fGraph;\n });\n return result;\n};\nvar toGraphDatas = function toGraphDatas(graphs, nodeLabelProp, edgeLabelProp) {\n var result = [];\n graphs.forEach(function (graph) {\n var graphData = {\n nodes: [],\n edges: []\n };\n graph.nodes.forEach(function (node) {\n var _a;\n graphData.nodes.push((_a = {\n id: \"\".concat(node.id)\n }, _a[nodeLabelProp] = node.label, _a));\n });\n graph.edges.forEach(function (edge) {\n var _a;\n graphData.edges.push((_a = {\n source: \"\".concat(edge.from),\n target: \"\".concat(edge.to)\n }, _a[edgeLabelProp] = edge.label, _a));\n });\n result.push(graphData);\n });\n return result;\n};\nvar DEFAULT_LABEL_NAME = \"cluster\";\n/**\n * gSpan 频繁子图计算算法(frequent graph mining)\n * @param params 参数\n */\nvar gSpan = function gSpan(params) {\n // ------- 将图数据 GraphData 的 map 转换为格式 -------\n var graphs = params.graphs,\n _a = params.directed,\n directed = _a === void 0 ? false : _a,\n _b = params.nodeLabelProp,\n nodeLabelProp = _b === void 0 ? DEFAULT_LABEL_NAME : _b,\n _c = params.edgeLabelProp,\n edgeLabelProp = _c === void 0 ? DEFAULT_LABEL_NAME : _c;\n var formattedGraphs = formatGraphs(graphs, directed, nodeLabelProp, edgeLabelProp);\n var minSupport = params.minSupport,\n maxNodeNum = params.maxNodeNum,\n minNodeNum = params.minNodeNum,\n verbose = params.verbose,\n top = params.top;\n // ------- 初始化与执行算法 -------\n var algoParams = {\n graphs: formattedGraphs,\n minSupport: minSupport,\n maxNodeNum: maxNodeNum,\n minNodeNum: minNodeNum,\n top: top,\n verbose: verbose,\n directed: directed\n };\n var calculator = new GSpan(algoParams);\n calculator.run();\n var result = toGraphDatas(calculator.frequentSubgraphs, nodeLabelProp, edgeLabelProp);\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (gSpan);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/gSpan/gSpan.js?"); /***/ }), @@ -164,7 +164,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ant /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_EDGE_ID\", function() { return VACANT_EDGE_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_NODE_ID\", function() { return VACANT_NODE_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_EDGE_LABEL\", function() { return VACANT_EDGE_LABEL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_NODE_LABEL\", function() { return VACANT_NODE_LABEL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_GRAPH_ID\", function() { return VACANT_GRAPH_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AUTO_EDGE_ID\", function() { return AUTO_EDGE_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Edge\", function() { return Edge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return Node; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Graph\", function() { return Graph; });\nvar VACANT_EDGE_ID = -1;\nvar VACANT_NODE_ID = -1;\nvar VACANT_EDGE_LABEL = \"-1\";\nvar VACANT_NODE_LABEL = \"-1\";\nvar VACANT_GRAPH_ID = -1;\nvar AUTO_EDGE_ID = \"-1\";\n\nvar Edge =\n/** @class */\nfunction () {\n function Edge(id, from, to, label) {\n if (id === void 0) {\n id = VACANT_EDGE_ID;\n }\n\n if (from === void 0) {\n from = VACANT_NODE_ID;\n }\n\n if (to === void 0) {\n to = VACANT_NODE_ID;\n }\n\n if (label === void 0) {\n label = VACANT_EDGE_LABEL;\n }\n\n this.id = id;\n this.from = from;\n this.to = to;\n this.label = label;\n }\n\n return Edge;\n}();\n\n\n\nvar Node =\n/** @class */\nfunction () {\n function Node(id, label) {\n if (id === void 0) {\n id = VACANT_NODE_ID;\n }\n\n if (label === void 0) {\n label = VACANT_NODE_LABEL;\n }\n\n this.id = id;\n this.label = label;\n this.edges = [];\n this.edgeMap = {};\n }\n\n Node.prototype.addEdge = function (edge) {\n this.edges.push(edge);\n this.edgeMap[edge.id] = edge;\n };\n\n return Node;\n}();\n\n\n\nvar Graph =\n/** @class */\nfunction () {\n function Graph(id, edgeIdAutoIncrease, directed) {\n if (id === void 0) {\n id = VACANT_NODE_ID;\n }\n\n if (edgeIdAutoIncrease === void 0) {\n edgeIdAutoIncrease = true;\n }\n\n if (directed === void 0) {\n directed = false;\n }\n\n this.id = id;\n this.edgeIdAutoIncrease = edgeIdAutoIncrease;\n this.edges = [];\n this.nodes = [];\n this.nodeMap = {};\n this.edgeMap = {};\n this.nodeLabelMap = {};\n this.edgeLabelMap = {};\n this.counter = 0;\n this.directed = directed;\n }\n\n Graph.prototype.getNodeNum = function () {\n return this.nodes.length;\n };\n\n Graph.prototype.addNode = function (id, label) {\n if (this.nodeMap[id]) return;\n var node = new Node(id, label);\n this.nodes.push(node);\n this.nodeMap[id] = node;\n if (!this.nodeLabelMap[label]) this.nodeLabelMap[label] = [];\n this.nodeLabelMap[label].push(id);\n };\n\n Graph.prototype.addEdge = function (id, from, to, label) {\n if (this.edgeIdAutoIncrease || id === undefined) id = this.counter++;\n if (this.nodeMap[from] && this.nodeMap[to] && this.nodeMap[to].edgeMap[id]) return;\n var edge = new Edge(id, from, to, label);\n this.edges.push(edge);\n this.edgeMap[id] = edge;\n this.nodeMap[from].addEdge(edge);\n if (!this.edgeLabelMap[label]) this.edgeLabelMap[label] = [];\n this.edgeLabelMap[label].push(edge);\n\n if (!this.directed) {\n var rEdge = new Edge(id, to, from, label);\n this.nodeMap[to].addEdge(rEdge);\n this.edgeLabelMap[label].push(rEdge);\n }\n };\n\n return Graph;\n}();\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/gSpan/struct.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_EDGE_ID\", function() { return VACANT_EDGE_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_NODE_ID\", function() { return VACANT_NODE_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_EDGE_LABEL\", function() { return VACANT_EDGE_LABEL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_NODE_LABEL\", function() { return VACANT_NODE_LABEL; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VACANT_GRAPH_ID\", function() { return VACANT_GRAPH_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AUTO_EDGE_ID\", function() { return AUTO_EDGE_ID; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Edge\", function() { return Edge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return Node; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Graph\", function() { return Graph; });\nvar VACANT_EDGE_ID = -1;\nvar VACANT_NODE_ID = -1;\nvar VACANT_EDGE_LABEL = \"-1\";\nvar VACANT_NODE_LABEL = \"-1\";\nvar VACANT_GRAPH_ID = -1;\nvar AUTO_EDGE_ID = \"-1\";\nvar Edge = /** @class */function () {\n function Edge(id, from, to, label) {\n if (id === void 0) {\n id = VACANT_EDGE_ID;\n }\n if (from === void 0) {\n from = VACANT_NODE_ID;\n }\n if (to === void 0) {\n to = VACANT_NODE_ID;\n }\n if (label === void 0) {\n label = VACANT_EDGE_LABEL;\n }\n this.id = id;\n this.from = from;\n this.to = to;\n this.label = label;\n }\n return Edge;\n}();\n\nvar Node = /** @class */function () {\n function Node(id, label) {\n if (id === void 0) {\n id = VACANT_NODE_ID;\n }\n if (label === void 0) {\n label = VACANT_NODE_LABEL;\n }\n this.id = id;\n this.label = label;\n this.edges = [];\n this.edgeMap = {};\n }\n Node.prototype.addEdge = function (edge) {\n this.edges.push(edge);\n this.edgeMap[edge.id] = edge;\n };\n return Node;\n}();\n\nvar Graph = /** @class */function () {\n function Graph(id, edgeIdAutoIncrease, directed) {\n if (id === void 0) {\n id = VACANT_NODE_ID;\n }\n if (edgeIdAutoIncrease === void 0) {\n edgeIdAutoIncrease = true;\n }\n if (directed === void 0) {\n directed = false;\n }\n this.id = id;\n this.edgeIdAutoIncrease = edgeIdAutoIncrease;\n this.edges = [];\n this.nodes = [];\n this.nodeMap = {};\n this.edgeMap = {};\n this.nodeLabelMap = {};\n this.edgeLabelMap = {};\n this.counter = 0;\n this.directed = directed;\n }\n Graph.prototype.getNodeNum = function () {\n return this.nodes.length;\n };\n Graph.prototype.addNode = function (id, label) {\n if (this.nodeMap[id]) return;\n var node = new Node(id, label);\n this.nodes.push(node);\n this.nodeMap[id] = node;\n if (!this.nodeLabelMap[label]) this.nodeLabelMap[label] = [];\n this.nodeLabelMap[label].push(id);\n };\n Graph.prototype.addEdge = function (id, from, to, label) {\n if (this.edgeIdAutoIncrease || id === undefined) id = this.counter++;\n if (this.nodeMap[from] && this.nodeMap[to] && this.nodeMap[to].edgeMap[id]) return;\n var edge = new Edge(id, from, to, label);\n this.edges.push(edge);\n this.edgeMap[id] = edge;\n this.nodeMap[from].addEdge(edge);\n if (!this.edgeLabelMap[label]) this.edgeLabelMap[label] = [];\n this.edgeLabelMap[label].push(edge);\n if (!this.directed) {\n var rEdge = new Edge(id, to, from, label);\n this.nodeMap[to].addEdge(rEdge);\n this.edgeLabelMap[label].push(rEdge);\n }\n };\n return Graph;\n}();\n\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/gSpan/struct.js?"); /***/ }), @@ -176,7 +176,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _floydWarshall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./floydWarshall */ \"./node_modules/@antv/algorithm/es/floydWarshall.js\");\n/* harmony import */ var _gSpan_gSpan__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gSpan/gSpan */ \"./node_modules/@antv/algorithm/es/gSpan/gSpan.js\");\n/* harmony import */ var _dijkstra__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/algorithm/es/dijkstra.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n\n\n\n/**\n * 为 graphData 中每个节点生成邻居单元数组\n * @param graphData\n * @param spm\n * @param nodeLabelProp\n * @param k k-近邻\n */\n\nvar findKNeighborUnits = function findKNeighborUnits(graphData, spm, nodeLabelProp, k) {\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n\n if (k === void 0) {\n k = 2;\n }\n\n var units = [];\n var nodes = graphData.nodes;\n spm.forEach(function (row, i) {\n units.push(findKNeighborUnit(nodes, row, i, nodeLabelProp, k));\n });\n return units;\n};\n\nvar findKNeighborUnit = function findKNeighborUnit(nodes, row, i, nodeLabelProp, k) {\n var unitNodeIdxs = [i];\n var neighbors = [];\n var labelCountMap = {};\n row.forEach(function (v, j) {\n if (v <= k && i !== j) {\n unitNodeIdxs.push(j);\n neighbors.push(nodes[j]);\n var label = nodes[j][nodeLabelProp];\n if (!labelCountMap[label]) labelCountMap[label] = {\n count: 1,\n dists: [v]\n };else {\n labelCountMap[label].count++;\n labelCountMap[label].dists.push(v);\n }\n }\n }); // 将 labelCountMap 中的 dists 按照从小到大排序,方便后面使用\n\n Object.keys(labelCountMap).forEach(function (label) {\n labelCountMap[label].dists = labelCountMap[label].dists.sort(function (a, b) {\n return a - b;\n });\n });\n return {\n nodeIdx: i,\n nodeId: nodes[i].id,\n nodeIdxs: unitNodeIdxs,\n neighbors: neighbors,\n neighborNum: unitNodeIdxs.length - 1,\n nodeLabelCountMap: labelCountMap\n };\n};\n/**\n * 随机寻找点对,满足距离小于 k\n * @param k 参数 k,表示 k-近邻\n * @param nodeNum 参数 length\n * @param maxNodePairNum 寻找点对的数量不超过 maxNodePairNum\n * @param spm 最短路径矩阵\n */\n\n\nvar findNodePairsRandomly = function findNodePairsRandomly(k, nodeNum, maxNodePairNum, kNeighborUnits, spm) {\n // 每个节点需要随机找出的点对数\n var nodePairNumEachNode = Math.ceil(maxNodePairNum / nodeNum);\n var nodePairMap = {};\n var foundNodePairCount = 0; // 遍历节点,为每个节点随机找出 nodePairNumEachNode 个点对,满足距离小于 k。找到的点对数量超过 maxNodePairNum 或所有节点遍历结束时终止\n\n kNeighborUnits.forEach(function (unit, i) {\n // 若未达到 nodePairNumEachNode,或循环次数小于最大循环次数(2 * nodeNum),继续循环\n var nodePairForICount = 0;\n var outerLoopCount = 0;\n var neighbors = unit.nodeIdxs; // the first one is the center node\n\n var neighborNum = unit.neighborNum - 1;\n\n while (nodePairForICount < nodePairNumEachNode) {\n // 另一端节点在节点数组中的的 index\n var oidx = neighbors[1 + Math.floor(Math.random() * neighborNum)];\n var innerLoopCount = 0; // 若随机得到的另一端 idx 不符合条件,则继续 random。条件是不是同一个节点、这个点对没有被记录过、距离小于 k\n\n while (nodePairMap[\"\".concat(i, \"-\").concat(oidx)] || nodePairMap[\"\".concat(oidx, \"-\").concat(i)]) {\n oidx = Math.floor(Math.random() * nodeNum);\n innerLoopCount++;\n if (innerLoopCount > 2 * nodeNum) break; // 循环次数大于最大循环次数(2 * nodeNum)跳出循环,避免死循环\n }\n\n if (innerLoopCount < 2 * nodeNum) {\n // 未达到最大循环次数,说明找到了合适的另一端\n nodePairMap[\"\".concat(i, \"-\").concat(oidx)] = {\n start: i,\n end: oidx,\n distance: spm[i][oidx]\n };\n nodePairForICount++;\n foundNodePairCount++; // 如果当前找到的点对数量达到了上限,返回结果\n\n if (foundNodePairCount >= maxNodePairNum) return nodePairMap;\n }\n\n outerLoopCount++;\n if (outerLoopCount > 2 * nodeNum) break; // 循环次数大于最大循环次数(2 * nodeNum)跳出循环,避免死循环\n } // 这个节点没有找到足够 nodePairNumEachNode 的点对。更新 nodePairNumEachNode,让后续节点找更多的点对\n\n\n if (nodePairForICount < nodePairNumEachNode) {\n var gap = nodePairNumEachNode - nodePairForICount;\n nodePairNumEachNode = (nodePairNumEachNode + gap) / (nodeNum - i - 1);\n }\n });\n return nodePairMap;\n};\n/**\n * 计算所有 nodePairMap 中节点对的相交邻居诱导子图\n * @param nodePairMap 节点对 map,key 为 node1.id-node2.id,value 为 { startNodeIdx, endNodeIdx, distance }\n * @param neighborUnits 每个节点的邻居元数组\n * @param graphData 原图数据\n * @param edgeMap 边的 map,方便检索\n * @param cachedInducedGraphMap 缓存的结果,下次进入该函数将继续更新该缓存,若 key 在缓存中存在则不需要重复计算\n */\n\n\nvar getIntersectNeighborInducedGraph = function getIntersectNeighborInducedGraph(nodePairMap, neighborUnits, graphData, cachedInducedGraphMap) {\n var nodes = graphData.nodes;\n if (!cachedInducedGraphMap) cachedInducedGraphMap = {};\n Object.keys(nodePairMap).forEach(function (key) {\n var _a, _b;\n\n if (cachedInducedGraphMap && cachedInducedGraphMap[key]) return;\n cachedInducedGraphMap[key] = {\n nodes: [],\n edges: []\n };\n var pair = nodePairMap[key];\n var startUnitNodeIds = (_a = neighborUnits[pair.start]) === null || _a === void 0 ? void 0 : _a.nodeIdxs;\n var endUnitNodeIds = (_b = neighborUnits[pair.end]) === null || _b === void 0 ? void 0 : _b.nodeIdxs;\n if (!startUnitNodeIds || !endUnitNodeIds) return; // 不存在邻元,返回空图\n\n var endSet = new Set(endUnitNodeIds);\n var intersect = startUnitNodeIds.filter(function (x) {\n return endSet.has(x);\n }); // 可能会爆栈(在 1580 + 6 nodes full-connected 时出现)\n\n if (!intersect || !intersect.length) return; // 没有交集,返回空图\n\n var intersectIdMap = {};\n var intersectLength = intersect.length;\n\n for (var i = 0; i < intersectLength; i++) {\n var node = nodes[intersect[i]];\n cachedInducedGraphMap[key].nodes.push(node); // 将交集中的点加入诱导子图\n\n intersectIdMap[node.id] = true;\n } // 遍历所有边数据,如果边的两端都在交集中,将该边加入诱导子图\n\n\n graphData.edges.forEach(function (edge) {\n if (intersectIdMap[edge.source] && intersectIdMap[edge.target]) cachedInducedGraphMap[key].edges.push(edge);\n });\n });\n return cachedInducedGraphMap;\n};\n/**\n * 计算 strcutre 在 graph 上的匹配数量\n * @param graph 图数据\n * @param structure 目前支持只有两个节点一条边的最简单结构\n * @param nodeLabelProp 节点类型字段名\n * @param edgeLabelProp 边类型字段名\n */\n\n\nvar getMatchedCount = function getMatchedCount(graph, structure, nodeLabelProp, edgeLabelProp) {\n var _a, _b;\n\n var nodeMap = {};\n graph.nodes.forEach(function (node) {\n nodeMap[node.id] = node;\n });\n var count = 0;\n if (!((_a = structure === null || structure === void 0 ? void 0 : structure.edges) === null || _a === void 0 ? void 0 : _a.length) || ((_b = structure === null || structure === void 0 ? void 0 : structure.nodes) === null || _b === void 0 ? void 0 : _b.length) < 2) return 0;\n graph.edges.forEach(function (e) {\n var sourceLabel = nodeMap[e.source][nodeLabelProp];\n var targetLabel = nodeMap[e.target][nodeLabelProp];\n var strNodeLabel1 = structure === null || structure === void 0 ? void 0 : structure.nodes[0][nodeLabelProp];\n var strNodeLabel2 = structure === null || structure === void 0 ? void 0 : structure.nodes[1][nodeLabelProp];\n var strEdgeLabel = structure === null || structure === void 0 ? void 0 : structure.edges[0][edgeLabelProp];\n if (e[edgeLabelProp] !== strEdgeLabel) return;\n\n if (sourceLabel === strNodeLabel1 && targetLabel === strNodeLabel2 || sourceLabel === strNodeLabel2 && targetLabel === strNodeLabel1) {\n count++;\n }\n });\n return count;\n};\n/**\n * structures 中寻找最具有代表性的一个。这个结构是使得 matchedCountMap 的分组方式类内间距最小,类间间距最大\n * @param matchedCountMap 每个 structure 分类后的各图匹配数量,格式 { [strcture.idx]: { [interInducedGraphKey]: count } }\n * @param structureNum strcuture 个数,与 matchedCountMap.length 对应\n * @param structures\n */\n\n\nvar findRepresentStructure = function findRepresentStructure(matchedCountMap, structureNum, structures) {\n var maxOffset = Infinity,\n representClusterType = 0;\n\n var _loop_1 = function _loop_1(i) {\n // 一种分组的 map,key 是 intGraph 的 key,value 是 structures[i] 的匹配个数\n var countMapI = matchedCountMap[i]; // 按照 value 为该组排序,生成 keys 的数组:\n\n var sortedGraphKeys = Object.keys(countMapI).sort(function (a, b) {\n return countMapI[a] - countMapI[b];\n }); // 共 100 个 graphKeys,将 graphKeys 按顺序分为 groupNum 组\n\n var groupNum = 10;\n var clusters = []; // 总共有 groupNum 个项\n\n sortedGraphKeys.forEach(function (key, j) {\n if (!clusters[j % groupNum]) clusters[j % groupNum] = {\n graphs: [],\n totalCount: 0,\n aveCount: 0\n };\n clusters[j % groupNum].graphs.push(key);\n clusters[j % groupNum].totalCount += countMapI[key];\n }); // 计算 cluster 与 cluster 之间的距离 innerDist,每个 cluster 内部的距离 intraDist\n\n var aveIntraDist = 0; // 该类的类内平均值\n\n var aveCounts = []; // 类内平均匹配数量,将用于计算类间距离\n\n clusters.forEach(function (graphsInCluster) {\n // 类内均值\n var aveCount = graphsInCluster.totalCount / graphsInCluster.graphs.length;\n graphsInCluster.aveCount = aveCount;\n aveCounts.push(aveCount); // 对于每类,计算类内间距平均值\n\n var aveIntraPerCluster = 0;\n var graphsNum = graphsInCluster.length;\n graphsInCluster.graphs.forEach(function (graphKey1, j) {\n var graph1Count = countMapI[graphKey1];\n graphsInCluster.graphs.forEach(function (graphKey2, k) {\n if (j === k) return;\n aveIntraPerCluster += Math.abs(graph1Count - countMapI[graphKey2]);\n });\n });\n aveIntraPerCluster /= graphsNum * (graphsNum - 1) / 2;\n aveIntraDist += aveIntraPerCluster;\n });\n aveIntraDist /= clusters.length; // 用类内均值计算类间距\n\n var aveInterDist = 0; // 类间间距平均值\n\n aveCounts.forEach(function (aveCount1, j) {\n aveCounts.forEach(function (aveCount2, k) {\n if (j === k) return;\n aveInterDist += Math.abs(aveCount1 - aveCount2);\n });\n aveInterDist /= aveCounts.length * (aveCounts.length - 1) / 2;\n }); // 寻找 (类间间距均值-类内间距均值) 最大的一种分组方式(对应的 structure 就是最终要找的唯一 DS(G))\n\n var offset = aveInterDist - aveIntraDist;\n\n if (maxOffset < offset) {\n maxOffset = offset;\n representClusterType = i;\n }\n };\n\n for (var i = 0; i < structureNum; i++) {\n _loop_1(i);\n }\n\n return {\n structure: structures[representClusterType],\n structureCountMap: matchedCountMap[representClusterType]\n };\n};\n\nvar getNodeMaps = function getNodeMaps(nodes, nodeLabelProp) {\n var nodeMap = {},\n nodeLabelMap = {};\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = {\n idx: i,\n node: node,\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n var label = node[nodeLabelProp];\n if (!nodeLabelMap[label]) nodeLabelMap[label] = [];\n nodeLabelMap[label].push(node);\n });\n return {\n nodeMap: nodeMap,\n nodeLabelMap: nodeLabelMap\n };\n};\n\nvar getEdgeMaps = function getEdgeMaps(edges, edgeLabelProp, nodeMap) {\n var edgeMap = {},\n edgeLabelMap = {};\n edges.forEach(function (edge, i) {\n edgeMap[\"\".concat(_util__WEBPACK_IMPORTED_MODULE_4__[\"uniqueId\"])] = {\n idx: i,\n edge: edge\n };\n var label = edge[edgeLabelProp];\n if (!edgeLabelMap[label]) edgeLabelMap[label] = [];\n edgeLabelMap[label].push(edge);\n var sourceNode = nodeMap[edge.source];\n\n if (sourceNode) {\n sourceNode.degree++;\n sourceNode.outDegree++;\n }\n\n var targetNode = nodeMap[edge.target];\n\n if (targetNode) {\n targetNode.degree++;\n targetNode.inDegree++;\n }\n });\n return {\n edgeMap: edgeMap,\n edgeLabelMap: edgeLabelMap\n };\n};\n/**\n * 输出最短路径的 map,key 为 sourceNode.id-targetNode.id,value 为这两个节点的最短路径长度\n * @param nodes\n * @param spm\n * @param directed\n */\n\n\nvar getSpmMap = function getSpmMap(nodes, spm, directed) {\n var length = spm.length;\n var map = {};\n spm.forEach(function (row, i) {\n var start = directed ? 0 : i + 1;\n var iId = nodes[i].id;\n\n for (var j = start; j < length; j++) {\n if (i === j) continue;\n var jId = nodes[j].id;\n var dist = row[j];\n map[\"\".concat(iId, \"-\").concat(jId)] = dist;\n if (!directed) map[\"\".concat(jId, \"-\").concat(iId)] = dist;\n }\n });\n return map;\n};\n/**\n * 计算一对节点(node1,node2)的 NDS 距离\n * @param graph 原图数据\n * @param node1\n * @param node2\n */\n\n\nvar getNDSDist = function getNDSDist(graph, node1, node2, nodeMap, spDist, kNeighborUnits, structure, nodeLabelProp, edgeLabelProp, cachedNDSMap, cachedInterInducedGraph) {\n var _a;\n\n var key = \"\".concat(node1.id, \"-\").concat(node2.id);\n if (cachedNDSMap && cachedNDSMap[key]) return cachedNDSMap[key];\n var interInducedGraph = cachedInterInducedGraph ? cachedInterInducedGraph[key] : undefined; // 若没有缓存相交邻居诱导子图,计算\n\n if (!interInducedGraph) {\n var pairMap = (_a = {}, _a[key] = {\n start: nodeMap[node1.id].idx,\n end: nodeMap[node2.id].idx,\n distance: spDist\n }, _a);\n cachedInterInducedGraph = getIntersectNeighborInducedGraph(pairMap, kNeighborUnits, graph, cachedInterInducedGraph);\n interInducedGraph = cachedInterInducedGraph[key];\n }\n\n return getMatchedCount(interInducedGraph, structure, nodeLabelProp, edgeLabelProp);\n};\n/**\n * 计算 pattern 上绩点的度数并存储到 minPatternNodeLabelDegreeMap\n */\n\n\nvar stashPatternNodeLabelDegreeMap = function stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, neighborLabel, patternNodeMap, patternNodeLabelMap) {\n var _a, _b, _c;\n\n var minPatternNodeLabelDegree = (_a = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _a === void 0 ? void 0 : _a.degree;\n var minPatternNodeLabelInDegree = (_b = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _b === void 0 ? void 0 : _b.inDegree;\n var minPatternNodeLabelOutDegree = (_c = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _c === void 0 ? void 0 : _c.outDegree;\n\n if (minPatternNodeLabelDegreeMap[neighborLabel] === undefined) {\n minPatternNodeLabelDegree = Infinity;\n minPatternNodeLabelInDegree = Infinity;\n minPatternNodeLabelOutDegree = Infinity;\n patternNodeLabelMap[neighborLabel].forEach(function (patternNodeWithLabel) {\n var patternNodeDegree = patternNodeMap[patternNodeWithLabel.id].degree;\n if (minPatternNodeLabelDegree > patternNodeDegree) minPatternNodeLabelDegree = patternNodeDegree;\n var patternNodeInDegree = patternNodeMap[patternNodeWithLabel.id].inDegree;\n if (minPatternNodeLabelInDegree > patternNodeInDegree) minPatternNodeLabelInDegree = patternNodeInDegree;\n var patternNodeOutDegree = patternNodeMap[patternNodeWithLabel.id].outDegree;\n if (minPatternNodeLabelOutDegree > patternNodeOutDegree) minPatternNodeLabelOutDegree = patternNodeOutDegree;\n });\n minPatternNodeLabelDegreeMap[neighborLabel] = {\n degree: minPatternNodeLabelDegree,\n inDegree: minPatternNodeLabelInDegree,\n outDegree: minPatternNodeLabelOutDegree\n };\n }\n\n return {\n minPatternNodeLabelDegree: minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree: minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree: minPatternNodeLabelOutDegree\n };\n};\n/**\n * GADDI 模式匹配\n * @param graphData 原图数据\n * @param pattern 搜索图(需要在原图上搜索的模式)数据\n * @param directed 是否计算有向图,默认 false\n * @param k 参数 k,表示 k-近邻\n * @param length 参数 length\n * @param nodeLabelProp 节点数据中代表节点标签(分类信息)的属性名。默认为 cluster\n * @param edgeLabelProp 边数据中代表边标签(分类信息)的属性名。默认为 cluster\n */\n\n\nvar GADDI = function GADDI(graphData, pattern, directed, k, length, nodeLabelProp, edgeLabelProp) {\n var _a;\n\n if (directed === void 0) {\n directed = false;\n }\n\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n\n if (edgeLabelProp === void 0) {\n edgeLabelProp = 'cluster';\n }\n\n if (!graphData || !graphData.nodes) return; // 分为三步:\n // 0. 预计算:节点/边数,邻接矩阵、最短路径矩阵\n // 1. 处理原图 graphData。再分为 1~5 小步\n // 2. 匹配\n // console.log(\"----- stage-pre: preprocessing -------\");\n // -------- 第零步,预计算:节点/边数,邻接矩阵、最短路径矩阵-------\n\n var nodeNum = graphData.nodes.length;\n if (!nodeNum) return; // console.log(\"----- stage-pre.1: calc shortest path matrix for graph -------\");\n\n var spm = Object(_floydWarshall__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(graphData, directed); // console.log(\n // \"----- stage-pre.2: calc shortest path matrix for pattern -------\"\n // );\n\n var patternSpm = Object(_floydWarshall__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(pattern, directed); // console.log(\n // \"----- stage-pre.3: calc shortest path matrix map for graph -------\"\n // );\n\n var spmMap = getSpmMap(graphData.nodes, spm, directed); // console.log(\n // \"----- stage-pre.4: calc shortest path matrix map for pattern -------\"\n // );\n\n var patternSpmMap = getSpmMap(pattern.nodes, patternSpm, directed); // console.log(\"----- stage-pre.5: establish maps -------\");\n // 节点的 map,以 id 为 id 映射,方便后续快速检索\n\n var _b = getNodeMaps(graphData.nodes, nodeLabelProp),\n nodeMap = _b.nodeMap,\n nodeLabelMap = _b.nodeLabelMap;\n\n var _c = getNodeMaps(pattern.nodes, nodeLabelProp),\n patternNodeMap = _c.nodeMap,\n patternNodeLabelMap = _c.nodeLabelMap; // 计算节点度数\n\n\n getEdgeMaps(graphData.edges, edgeLabelProp, nodeMap);\n var patternEdgeLabelMap = getEdgeMaps(pattern.edges, edgeLabelProp, patternNodeMap).edgeLabelMap; // 若未指定 length,自动计算 pattern 半径(最短路径最大值)\n\n var patternSpmSpread = [];\n patternSpm === null || patternSpm === void 0 ? void 0 : patternSpm.forEach(function (row) {\n patternSpmSpread = patternSpmSpread.concat(row);\n });\n if (!length) length = Math.max.apply(Math, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], patternSpmSpread, false), [2], false));\n if (!k) k = length; // console.log(\"params\", directed, length, k);\n // console.log(\"----- stage-pre.6: calc k neighbor units -------\");\n // 计算每个节点的 k 邻元集合\n\n var kNeighborUnits = findKNeighborUnits(graphData, spm, nodeLabelProp, k);\n var patternKNeighborUnits = findKNeighborUnits(pattern, patternSpm, nodeLabelProp, k); // console.log(\n // \"----- stage0: going to processing graph and find intersect neighbor induced graphs -------\"\n // );\n // console.log(\"----- stage0.1: going to select random node pairs -------\");\n // -------- 第一步,处理原图 graphData-------\n // 1.1. 随机选择最多 100 个点对,满足距离小于 Length 和 k\n // 当 graphData 少于 20 个节点,则不能找出 100 个点对,只找出不多于 n(n-1)/2 个点对\n\n var maxNodePairNum = Math.min(100, nodeNum * (nodeNum - 1) / 2);\n var nodePairsMap = findNodePairsRandomly(k, nodeNum, maxNodePairNum, kNeighborUnits, spm); // console.log(\n // \"----- stage0.2: going to calculate intersect neighbor induced graphs -------\"\n // );\n // 1.2. 生成上面节点对的相应相交邻居诱导子图。格式为 {'beginNodeIdx-endNodeIdx': {nodes: [], edges: []}}\n\n var intGMap = getIntersectNeighborInducedGraph(nodePairsMap, kNeighborUnits, graphData); // 1.3. 使用 gSpan 算法(frequent graph mining)计算 ISIntG 的前 10 个频率最高的子结构(3-4条边)\n\n var top = 10,\n minSupport = 1,\n minNodeNum = 1,\n maxNodeNum = 4;\n var params = {\n graphs: intGMap,\n nodeLabelProp: nodeLabelProp,\n edgeLabelProp: edgeLabelProp,\n minSupport: minSupport,\n minNodeNum: minNodeNum,\n maxNodeNum: maxNodeNum,\n directed: directed\n }; // console.log(\n // \"----- stage1: (gSpan) going to find frequent structure dsG -------\"\n // );\n // console.log(\"----- stage1.1: going to run gSpan -------\");\n // 暂时假设生成的 sub structure 都只有一条边\n\n var freStructures = Object(_gSpan_gSpan__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(params).slice(0, top); // structureNum 可能小于 top\n\n var structureNum = freStructures.length; // 1.4. 计算上述 10 个子结构在 intGMap 中每个诱导子图的匹配个数\n\n var matchedCountMap = [];\n freStructures.forEach(function (structure, i) {\n matchedCountMap[i] = {};\n Object.keys(intGMap).forEach(function (key) {\n var graph = intGMap[key];\n var subStructureCount = getMatchedCount(graph, structure, nodeLabelProp, edgeLabelProp);\n matchedCountMap[i][key] = subStructureCount;\n });\n }); // console.log(\n // \"----- stage1.1: going to find the most represent strucutre -------\"\n // );\n // 1.5. 对于每个子结构,根据匹配个数为 intGMap 中的诱导子图分组,生成 structureNum 种分组\n // 计算每种分组的类间距和类内间距,找到类间距最大、类内间距最小的一种分组,这种分组对应的子结构被选为唯一代表性子结构 DS(G)\n\n var _d = findRepresentStructure(matchedCountMap, structureNum, freStructures),\n dsG = _d.structure,\n ndsDist = _d.structureCountMap; // -------- 第二步,匹配-------\n // 2.1 找到从 Q 中的一个节点作为起始节点,寻找 G 中的匹配。这个其实节点的标签可以在 G 中找到最多的节点\n\n\n var beginPNode = pattern.nodes[0],\n candidates = [],\n label = (_a = pattern.nodes[0]) === null || _a === void 0 ? void 0 : _a[nodeLabelProp],\n maxNodeNumWithSameLabel = -Infinity;\n pattern.nodes.forEach(function (node) {\n var pLabel = node[nodeLabelProp];\n var nodesWithSameLabel = nodeLabelMap[pLabel];\n\n if ((nodesWithSameLabel === null || nodesWithSameLabel === void 0 ? void 0 : nodesWithSameLabel.length) > maxNodeNumWithSameLabel) {\n maxNodeNumWithSameLabel = nodesWithSameLabel.length;\n candidates = nodesWithSameLabel;\n label = pLabel;\n beginPNode = node;\n }\n }); // console.log(\"----- stage2: going to find candidates -------\");\n // 全局缓存,避免重复计算\n\n var minPatternNodeLabelDegreeMap = {}; // key 是 label,value 是该 label 节点的最小度数\n\n var patternIntGraphMap = {},\n patternNDSDist = {},\n // key 为 node.id-node.id\n patternNDSDistMap = {}; // key 为 node.id-label2,value nds距离值数组(按从大到小排序,无需关心具体对应哪个 node2)\n // 2.2.2 对于 Q 中的另一个标签的 k 个节点,计算它们到 node 的最短路径以及 NDS 距离\n\n var patternSpDist = {};\n var patternSpDistBack = {};\n Object.keys(patternNodeLabelMap).forEach(function (label2, j) {\n patternSpDist[label2] = [];\n\n if (directed) {\n patternSpDistBack[label2] = [];\n }\n\n var maxDist = -Infinity;\n var patternNodesWithLabel2 = patternNodeLabelMap[label2];\n var patternNodePairMap = {};\n patternNodesWithLabel2.forEach(function (nodeWithLabel2) {\n var dist = patternSpmMap[\"\".concat(beginPNode.id, \"-\").concat(nodeWithLabel2.id)];\n dist && patternSpDist[label2].push(dist);\n if (maxDist < dist) maxDist = dist;\n patternNodePairMap[\"\".concat(beginPNode.id, \"-\").concat(nodeWithLabel2.id)] = {\n start: 0,\n end: patternNodeMap[nodeWithLabel2.id].idx,\n distance: dist\n };\n\n if (directed) {\n var distBack = patternSpmMap[\"\".concat(nodeWithLabel2.id, \"-\").concat(beginPNode.id)];\n distBack && patternSpDistBack[label2].push(distBack);\n }\n }); // spDist[label2] 按照从小到大排序\n\n patternSpDist[label2] = patternSpDist[label2].sort(function (a, b) {\n return a - b;\n });\n if (directed) patternSpDistBack[label2] = patternSpDistBack[label2].sort(function (a, b) {\n return a - b;\n }); // 计算 Q 中所有 label2 节点到 beginPNode 的 NDS 距离\n // 所有 label2 节点到 beginPNode 的邻居相交诱导子图:\n // key: node1.id-node2.id\n\n patternIntGraphMap = getIntersectNeighborInducedGraph(patternNodePairMap, patternKNeighborUnits, pattern, patternIntGraphMap); // pattern 中 beginNode 到当前 label2 节点 的 NDS 距离(数组,无需关心具体对应到哪个节点)\n\n var currentPatternNDSDistArray = [];\n Object.keys(patternNodePairMap).forEach(function (key) {\n if (patternNDSDist[key]) {\n currentPatternNDSDistArray.push(patternNDSDist[key]);\n return; // 缓存过则不需要再次计算\n }\n\n var patternIntGraph = patternIntGraphMap[key];\n patternNDSDist[key] = getMatchedCount(patternIntGraph, dsG, nodeLabelProp, edgeLabelProp);\n currentPatternNDSDistArray.push(patternNDSDist[key]);\n }); // 根据值为 currentPatternNDSDist 从大到小排序\n\n currentPatternNDSDistArray = currentPatternNDSDistArray.sort(function (a, b) {\n return b - a;\n });\n patternNDSDistMap[\"\".concat(beginPNode.id, \"-\").concat(label2)] = currentPatternNDSDistArray;\n if (label2 === label) return;\n var candidatesNum = (candidates === null || candidates === void 0 ? void 0 : candidates.length) || 0;\n\n var _loop_4 = function _loop_4(m) {\n var cNode = candidates[m]; // prune1:若 candidates 中节点 cNode 的 kNeighborUnits 中标签为 label2 的节点个数少于 pattern 中 label2 个数,删去它\n\n var graphNeighborUnit = kNeighborUnits[nodeMap[cNode.id].idx];\n var graphNeighborUnitCountMap = graphNeighborUnit.nodeLabelCountMap[label2];\n var patternLabel2Num = patternNodeLabelMap[label2].length;\n\n if (!graphNeighborUnitCountMap || graphNeighborUnitCountMap.count < patternLabel2Num) {\n candidates.splice(m, 1);\n return \"continue\";\n } // prune2:若 candidates 中节点 cNode 到 kNeighborUnits 中标签为 label2 的节点最短路径大于 patternSpDist[label2],删去它\n // (prune2 规则即:candidate 相关的最短路径的最大 spDist[label2].length 个,按照大小顺序依次和 patternSpDist[label2] 中的值比较,只要遇到一个是 G > Q 的,就删去这个 candidate)\n\n\n var prune2Invalid = false;\n\n for (var n = 0; n < patternLabel2Num; n++) {\n if (graphNeighborUnitCountMap.dists[n] > patternSpDist[label2][n]) {\n prune2Invalid = true;\n break;\n }\n }\n\n if (prune2Invalid) {\n candidates.splice(m, 1);\n return \"continue\";\n } // prune3:若 candidates 中节点 cNode 到 kNeighborUnits 中标签为 label2 的节点 NDS 距离小于 patternNDSDist[beginNode.id-label2],删去它\n // TODO:prune3,currentPatternNDSDistArray 与 currentNDSDist 的比较\n // 计算 G 中所有 label2 节点到 cNode 的 NDS 距离\n // 所有 label2 节点到 cNode 的邻居相交诱导子图:\n\n\n var cNodePairMap = {};\n graphNeighborUnit.neighbors.forEach(function (neighborNode) {\n var dist = spmMap[\"\".concat(cNode.id, \"-\").concat(neighborNode.id)];\n cNodePairMap[\"\".concat(cNode.id, \"-\").concat(neighborNode.id)] = {\n start: nodeMap[cNode.id].idx,\n end: nodeMap[neighborNode.id].idx,\n distance: dist\n };\n }); // 更新 intGMap\n\n intGMap = getIntersectNeighborInducedGraph(cNodePairMap, kNeighborUnits, graphData, intGMap); // candidate 到它周围 label2 节点的 NDS 距离, key 是 node.id-node.id\n\n var currentNDSDistArray = [];\n Object.keys(cNodePairMap).forEach(function (key) {\n if (ndsDist[key]) {\n currentNDSDistArray.push(ndsDist[key]);\n return; // 缓存过则不需要再次计算\n }\n\n var intGraph = intGMap[key];\n ndsDist[key] = getMatchedCount(intGraph, dsG, nodeLabelProp, edgeLabelProp);\n currentNDSDistArray.push(ndsDist[key]);\n }); // 根据值为 currentNDSDistArray 从大到小排序\n\n currentNDSDistArray = currentNDSDistArray.sort(function (a, b) {\n return b - a;\n });\n var prune3Invalid = false;\n\n for (var n = 0; n < patternLabel2Num; n++) {\n if (currentNDSDistArray[n] < currentPatternNDSDistArray[n]) {\n prune3Invalid = true;\n break;\n }\n }\n\n if (prune3Invalid) {\n candidates.splice(m, 1);\n return \"continue\";\n }\n };\n\n for (var m = candidatesNum - 1; m >= 0; m--) {\n _loop_4(m);\n }\n });\n var candidateGraphs = []; // console.log(\n // \"----- stage3: going to splice neighbors for each candidate graph -------\"\n // );\n // candidates 经过筛选后,以每个 candidate 为中心,生成 Length-neighbor 的邻居诱导子图\n // 并在诱导子图中去除不可能在 Q 上找到匹配的点:在 Q 上不存在的 label,其他 label 到 candidate 的最大最短距离符合 Q、NDS 距离符合 Q\n\n candidates === null || candidates === void 0 ? void 0 : candidates.forEach(function (candidate) {\n var nodeIdx = nodeMap[candidate.id].idx;\n var lengthNeighborUnit = findKNeighborUnit(graphData.nodes, spm[nodeIdx], nodeIdx, nodeLabelProp, length);\n var neighborNodes = lengthNeighborUnit.neighbors; // 删除不可能找到匹配的邻居点\n\n var neighborNum = neighborNodes.length;\n var unmatched = false;\n\n for (var i = neighborNum - 1; i >= 0; i--) {\n // 如果通过裁剪,符合条件的节点数量已过少,说明不能匹配这个 candidate 相关的图\n if (neighborNodes.length + 1 < pattern.nodes.length) {\n unmatched = true;\n return;\n }\n\n var neighborNode = neighborNodes[i];\n var neighborLabel = neighborNode[nodeLabelProp]; // prune1: 若该邻居点的 label 不存在于 pattern 中,移除这个点\n\n if (!patternNodeLabelMap[neighborLabel] || !patternNodeLabelMap[neighborLabel].length) {\n neighborNodes.splice(i, 1);\n continue;\n } // prune2: 若该邻居点到 candidate 的最短路径比和它有相同 label 的节点到 beginPNode 的最大最短路径长度长,移除这个点\n // prune2.1: 如果没有这个标签到 beginPNode 的距离记录,说明 pattern 上(可能 beginPNode 是这个 label)没有其他这个 label 的节点\n\n\n if (!patternSpDist[neighborLabel] || !patternSpDist[neighborLabel].length) {\n neighborNodes.splice(i, 1);\n continue;\n }\n\n var key = \"\".concat(candidate.id, \"-\").concat(neighborNode.id); // prune2.2\n\n var distToCandidate = spmMap[key];\n var idx = patternSpDist[neighborLabel].length - 1;\n var maxDistWithLabelInPattern = patternSpDist[neighborLabel][idx]; // patternSpDist[neighborLabel] 已经按照从小到大排序\n\n if (distToCandidate > maxDistWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n\n if (directed) {\n var keyBack = \"\".concat(neighborNode.id, \"-\").concat(candidate.id);\n var distFromCandidate = spmMap[keyBack];\n idx = patternSpDistBack[neighborLabel].length - 1;\n var maxBackDistWithLabelInPattern = patternSpDistBack[neighborLabel][idx];\n\n if (distFromCandidate > maxBackDistWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n } // prune3: 若该邻居点到 candidate 的 NDS 距离比和它有相同 label 的节点到 beginPNode 的最小 NDS 距离小,移除这个点\n\n\n var ndsToCandidate = ndsDist[key] ? ndsDist[key] : getNDSDist(graphData, candidate, neighborNode, nodeMap, distToCandidate, kNeighborUnits, dsG, nodeLabelProp, edgeLabelProp, ndsDist, intGMap);\n var patternKey = \"\".concat(beginPNode.id, \"-\").concat(neighborLabel);\n var minNdsWithLabelInPattern = patternNDSDistMap[patternKey][patternNDSDistMap[patternKey].length - 1]; // patternNDSDist[key] 一定存在\n\n if (ndsToCandidate < minNdsWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n } // prune4: 若该邻居点的度数小于 pattern 同 label 节点最小度数,删去该点\n\n\n var _a = stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, neighborLabel, patternNodeMap, patternNodeLabelMap),\n minPatternNodeLabelDegree = _a.minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree = _a.minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree = _a.minPatternNodeLabelOutDegree;\n\n if (nodeMap[neighborNode.id].degree < minPatternNodeLabelDegree) {\n neighborNodes.splice(i, 1);\n continue;\n }\n } // 节点在个数上符合匹配(不少于 pattern 的节点个数),现在筛选相关边\n\n\n if (!unmatched) {\n candidateGraphs.push({\n nodes: [candidate].concat(neighborNodes)\n });\n }\n }); // console.log(\n // \"----- stage4: going to splice edges and neighbors for each candidate graph -------\"\n // );\n\n var undirectedLengthsToBeginPNode = Object(_dijkstra__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(pattern, beginPNode.id, false).length;\n var undirectedLengthsToBeginPNodeLabelMap = {};\n\n if (directed) {\n Object.keys(undirectedLengthsToBeginPNode).forEach(function (nodeId) {\n var nodeLabel = patternNodeMap[nodeId].node[nodeLabelProp];\n if (!undirectedLengthsToBeginPNodeLabelMap[nodeLabel]) undirectedLengthsToBeginPNodeLabelMap[nodeLabel] = [undirectedLengthsToBeginPNode[nodeId]];else undirectedLengthsToBeginPNodeLabelMap[nodeLabel].push(undirectedLengthsToBeginPNode[nodeId]);\n });\n Object.keys(undirectedLengthsToBeginPNodeLabelMap).forEach(function (pLabel) {\n undirectedLengthsToBeginPNodeLabelMap[pLabel].sort(function (a, b) {\n return a - b;\n });\n });\n } else {\n undirectedLengthsToBeginPNodeLabelMap = patternSpDist;\n } // 现在 candidateGraphs 里面只有节点,进行边的筛选\n\n\n var candidateGraphNum = candidateGraphs.length;\n\n var _loop_2 = function _loop_2(i) {\n var candidateGraph = candidateGraphs[i];\n var candidate = candidateGraph.nodes[0];\n var candidateNodeLabelCountMap = {};\n var candidateNodeMap = {};\n candidateGraph.nodes.forEach(function (node, q) {\n candidateNodeMap[node.id] = {\n idx: q,\n node: node,\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n var cNodeLabel = node[nodeLabelProp];\n if (!candidateNodeLabelCountMap[cNodeLabel]) candidateNodeLabelCountMap[cNodeLabel] = 1;else candidateNodeLabelCountMap[cNodeLabel]++;\n }); // 根据 candidate 和 neighborNodes 中的节点生成 G 的诱导子图\n // 即,将 graphData 上两端都在 candidateGraph.nodes 中的边放入 candidateEdges\n\n var candidateEdges = [];\n var edgeLabelCountMap = {};\n graphData.edges.forEach(function (edge) {\n if (candidateNodeMap[edge.source] && candidateNodeMap[edge.target]) {\n candidateEdges.push(edge);\n if (!edgeLabelCountMap[edge[edgeLabelProp]]) edgeLabelCountMap[edge[edgeLabelProp]] = 1;else edgeLabelCountMap[edge[edgeLabelProp]]++;\n candidateNodeMap[edge.source].degree++;\n candidateNodeMap[edge.target].degree++;\n candidateNodeMap[edge.source].outDegree++;\n candidateNodeMap[edge.target].inDegree++;\n }\n }); // prune:若有一个 edgeLabel 在 candidateGraph 上的个数少于 pattern,去除该图\n\n var pattenrEdgeLabelNum = Object.keys(patternEdgeLabelMap).length;\n var prunedByEdgeLabel = false;\n\n for (var e = 0; e < pattenrEdgeLabelNum; e++) {\n var label_1 = Object.keys(patternEdgeLabelMap)[e];\n\n if (!edgeLabelCountMap[label_1] || edgeLabelCountMap[label_1] < patternEdgeLabelMap[label_1].length) {\n prunedByEdgeLabel = true;\n break;\n }\n }\n\n if (prunedByEdgeLabel) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n } // 遍历 candidateEdges,进行边的筛选\n\n\n var candidateEdgeNum = candidateEdges.length; // prune:若边数过少,去除该图\n\n if (candidateEdgeNum < pattern.edges.length) {\n candidateGraphs.splice(i, 1);\n return \"break\";\n }\n\n var candidateGraphInvalid = false;\n\n var _loop_5 = function _loop_5(e) {\n var edge = candidateEdges[e];\n var edgeLabel = edge[edgeLabelProp];\n var patternEdgesWithLabel = patternEdgeLabelMap[edgeLabel]; // prune 1: 若边的 label 不存在于 pattern 边 label 中,去除该边\n\n if (!patternEdgesWithLabel || !patternEdgesWithLabel.length) {\n edgeLabelCountMap[edgeLabel]--; // 若这个 label 的 count 减少之后,该 label 的边数不足,去除该图\n\n if (patternEdgesWithLabel && edgeLabelCountMap[edgeLabel] < patternEdgesWithLabel.length) {\n candidateGraphInvalid = true;\n return \"break\";\n }\n\n candidateEdges.splice(e, 1);\n candidateNodeMap[edge.source].degree--;\n candidateNodeMap[edge.target].degree--;\n candidateNodeMap[edge.source].outDegree--;\n candidateNodeMap[edge.target].inDegree--;\n return \"continue\";\n } // prune 2: 若边的 label +两端 label 的三元组关系不能在 pattern 中找到,去除该边\n\n\n var sourceLabel = candidateNodeMap[edge.source].node[nodeLabelProp];\n var targetLabel = candidateNodeMap[edge.target].node[nodeLabelProp];\n var edgeMatched = false;\n patternEdgesWithLabel.forEach(function (patternEdge) {\n var patternSource = patternNodeMap[patternEdge.source].node;\n var patternTarget = patternNodeMap[patternEdge.target].node;\n if (patternSource[nodeLabelProp] === sourceLabel && patternTarget[nodeLabelProp] === targetLabel) edgeMatched = true;\n if (!directed && patternSource[nodeLabelProp] === targetLabel && patternTarget[nodeLabelProp] === sourceLabel) edgeMatched = true;\n });\n\n if (!edgeMatched) {\n edgeLabelCountMap[edgeLabel]--; // 若这个 label 的 count 减少之后,该 label 的边数不足,去除该图\n\n if (patternEdgesWithLabel && edgeLabelCountMap[edgeLabel] < patternEdgesWithLabel.length) {\n candidateGraphInvalid = true;\n return \"break\";\n }\n\n candidateEdges.splice(e, 1);\n candidateNodeMap[edge.source].degree--;\n candidateNodeMap[edge.target].degree--;\n candidateNodeMap[edge.source].outDegree--;\n candidateNodeMap[edge.target].inDegree--;\n return \"continue\";\n }\n };\n\n for (var e = candidateEdgeNum - 1; e >= 0; e--) {\n var state_2 = _loop_5(e);\n\n if (state_2 === \"break\") break;\n } // prune2: 删除边的过程中,发现边数过少/边 label 数过少时,去除该图\n\n\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n\n candidateGraph.edges = candidateEdges;\n var lengthsToCandidate = Object(_dijkstra__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(candidateGraph, candidateGraph.nodes[0].id, false).length;\n Object.keys(lengthsToCandidate).reverse().forEach(function (targetId) {\n if (targetId === candidateGraph.nodes[0].id || candidateGraphInvalid) return; // prune4: 通过上述裁剪,可能导致该邻居子图变为不连通。裁剪掉目前在这个邻居子图中和 candidate(第一个节点)不连通的节点\n\n if (lengthsToCandidate[targetId] === Infinity) {\n var targetNodeLabel = candidateNodeMap[targetId].node[nodeLabelProp];\n candidateNodeLabelCountMap[targetNodeLabel]--;\n\n if (candidateNodeLabelCountMap[targetNodeLabel] < patternNodeLabelMap[targetNodeLabel].length) {\n candidateGraphInvalid = true;\n return;\n }\n\n var idx = candidateGraph.nodes.indexOf(candidateNodeMap[targetId].node);\n candidateGraph.nodes.splice(idx, 1);\n candidateNodeMap[targetId] = undefined;\n return;\n } // prune5: 经过边裁剪后,可能又出现了最短路径过长的节点 (比 pattern 中同 label 的节点到 beginNode 最大最短距离远),删去这些节点\n\n\n var nLabel = nodeMap[targetId].node[nodeLabelProp];\n\n if (!undirectedLengthsToBeginPNodeLabelMap[nLabel] || !undirectedLengthsToBeginPNodeLabelMap[nLabel].length || lengthsToCandidate[targetId] > undirectedLengthsToBeginPNodeLabelMap[nLabel][undirectedLengthsToBeginPNodeLabelMap[nLabel].length - 1]) {\n var targetNodeLabel = candidateNodeMap[targetId].node[nodeLabelProp];\n candidateNodeLabelCountMap[targetNodeLabel]--;\n\n if (candidateNodeLabelCountMap[targetNodeLabel] < patternNodeLabelMap[targetNodeLabel].length) {\n candidateGraphInvalid = true;\n return;\n }\n\n var idx = candidateGraph.nodes.indexOf(candidateNodeMap[targetId].node);\n candidateGraph.nodes.splice(idx, 1);\n candidateNodeMap[targetId] = undefined;\n }\n });\n\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n\n var degreeChanged = true;\n var loopCount = 0;\n\n while (degreeChanged && !candidateGraphInvalid) {\n degreeChanged = false; // candidate 度数不足,删去该图\n\n var condition = directed ? candidateNodeMap[candidate.id].degree < patternNodeMap[beginPNode.id].degree || candidateNodeMap[candidate.id].inDegree < patternNodeMap[beginPNode.id].inDegree || candidateNodeMap[candidate.id].outDegree < patternNodeMap[beginPNode.id].outDegree : candidateNodeMap[candidate.id].degree < patternNodeMap[beginPNode.id].degree;\n\n if (condition) {\n candidateGraphInvalid = true;\n break;\n } // candidate label 个数不足,删去该图\n\n\n if (candidateNodeLabelCountMap[candidate[nodeLabelProp]] < patternNodeLabelMap[candidate[nodeLabelProp]].length) {\n candidateGraphInvalid = true;\n break;\n } // prune6:去除度数过小的节点\n\n\n var currentCandidateNodeNum = candidateGraph.nodes.length;\n\n for (var o = currentCandidateNodeNum - 1; o >= 0; o--) {\n var cgNode = candidateGraph.nodes[o];\n var nodeDegree = candidateNodeMap[cgNode.id].degree;\n var nodeInDegree = candidateNodeMap[cgNode.id].inDegree;\n var nodeOutDegree = candidateNodeMap[cgNode.id].outDegree;\n var cNodeLabel = cgNode[nodeLabelProp];\n\n var _e = stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, cNodeLabel, patternNodeMap, patternNodeLabelMap),\n minPatternNodeLabelDegree = _e.minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree = _e.minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree = _e.minPatternNodeLabelOutDegree;\n\n var deleteCondition = directed ? nodeDegree < minPatternNodeLabelDegree || nodeInDegree < minPatternNodeLabelInDegree || nodeOutDegree < minPatternNodeLabelOutDegree : nodeDegree < minPatternNodeLabelDegree;\n\n if (deleteCondition) {\n candidateNodeLabelCountMap[cgNode[nodeLabelProp]]--; // 节点 label 个数不足\n\n if (candidateNodeLabelCountMap[cgNode[nodeLabelProp]] < patternNodeLabelMap[cgNode[nodeLabelProp]].length) {\n candidateGraphInvalid = true;\n break;\n }\n\n candidateGraph.nodes.splice(o, 1);\n candidateNodeMap[cgNode.id] = undefined;\n degreeChanged = true;\n }\n }\n\n if (candidateGraphInvalid || !degreeChanged && loopCount !== 0) break; // 经过 prune5 节点裁剪,删去端点已经不在 candidateGraph 中的边\n\n candidateEdgeNum = candidateEdges.length;\n\n for (var y = candidateEdgeNum - 1; y >= 0; y--) {\n var cedge = candidateEdges[y];\n\n if (!candidateNodeMap[cedge.source] || !candidateNodeMap[cedge.target]) {\n candidateEdges.splice(y, 1);\n var edgeLabel = cedge[edgeLabelProp];\n edgeLabelCountMap[edgeLabel]--;\n\n if (candidateNodeMap[cedge.source]) {\n candidateNodeMap[cedge.source].degree--;\n candidateNodeMap[cedge.source].outDegree--;\n }\n\n if (candidateNodeMap[cedge.target]) {\n candidateNodeMap[cedge.target].degree--;\n candidateNodeMap[cedge.target].inDegree--;\n } // 边 label 数量不足\n\n\n if (patternEdgeLabelMap[edgeLabel] && edgeLabelCountMap[edgeLabel] < patternEdgeLabelMap[edgeLabel].length) {\n candidateGraphInvalid = true;\n break;\n }\n\n degreeChanged = true;\n }\n }\n\n loopCount++;\n }\n\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n } // prune: 若节点/边数过少,节点/边 label 过少,去掉这个图\n\n\n if (candidateGraphInvalid || candidateGraph.nodes.length < pattern.nodes.length || candidateEdges.length < pattern.edges.length) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n };\n\n for (var i = candidateGraphNum - 1; i >= 0; i--) {\n var state_1 = _loop_2(i);\n\n if (state_1 === \"break\") break;\n } // 此时已经生成的多个 candidateGraphs,可能有重复\n // console.log(\n // \"----- stage5: going to splice dulplicated candidate graphs -------\"\n // );\n // 删去 candidateGraphs 中一模一样的子图,通过边的 node-node-edgeLabel 作为 key,这类边个数作为 value,进行匹配\n\n\n var currentLength = candidateGraphs.length;\n\n var _loop_3 = function _loop_3(i) {\n var cg1 = candidateGraphs[i];\n var cg1EdgeMap = {}; // [node1.id-node2.id-edge.label]: count\n\n cg1.edges.forEach(function (edge) {\n var key = \"\".concat(edge.source, \"-\").concat(edge.target, \"-\").concat(edge.label);\n if (!cg1EdgeMap[key]) cg1EdgeMap[key] = 1;else cg1EdgeMap[key]++;\n });\n\n var _loop_6 = function _loop_6(j) {\n var cg2 = candidateGraphs[j];\n var cg2EdgeMap = {}; // [node1.id-node2.id-edge.label]: count\n\n cg2.edges.forEach(function (edge) {\n var key = \"\".concat(edge.source, \"-\").concat(edge.target, \"-\").concat(edge.label);\n if (!cg2EdgeMap[key]) cg2EdgeMap[key] = 1;else cg2EdgeMap[key]++;\n });\n var same = true;\n\n if (Object.keys(cg2EdgeMap).length !== Object.keys(cg1EdgeMap).length) {\n same = false;\n } else {\n Object.keys(cg1EdgeMap).forEach(function (key) {\n if (cg2EdgeMap[key] !== cg1EdgeMap[key]) same = false;\n });\n }\n\n if (same) {\n candidateGraphs.splice(j, 1);\n }\n };\n\n for (var j = currentLength - 1; j > i; j--) {\n _loop_6(j);\n }\n\n currentLength = candidateGraphs.length;\n };\n\n for (var i = 0; i <= currentLength - 1; i++) {\n _loop_3(i);\n }\n\n return candidateGraphs;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (GADDI);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/gaddi.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _floydWarshall__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./floydWarshall */ \"./node_modules/@antv/algorithm/es/floydWarshall.js\");\n/* harmony import */ var _gSpan_gSpan__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./gSpan/gSpan */ \"./node_modules/@antv/algorithm/es/gSpan/gSpan.js\");\n/* harmony import */ var _dijkstra__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/algorithm/es/dijkstra.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n\n\n\n/**\n * 为 graphData 中每个节点生成邻居单元数组\n * @param graphData\n * @param spm\n * @param nodeLabelProp\n * @param k k-近邻\n */\nvar findKNeighborUnits = function findKNeighborUnits(graphData, spm, nodeLabelProp, k) {\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n if (k === void 0) {\n k = 2;\n }\n var units = [];\n var nodes = graphData.nodes;\n spm.forEach(function (row, i) {\n units.push(findKNeighborUnit(nodes, row, i, nodeLabelProp, k));\n });\n return units;\n};\nvar findKNeighborUnit = function findKNeighborUnit(nodes, row, i, nodeLabelProp, k) {\n var unitNodeIdxs = [i];\n var neighbors = [];\n var labelCountMap = {};\n row.forEach(function (v, j) {\n if (v <= k && i !== j) {\n unitNodeIdxs.push(j);\n neighbors.push(nodes[j]);\n var label = nodes[j][nodeLabelProp];\n if (!labelCountMap[label]) labelCountMap[label] = {\n count: 1,\n dists: [v]\n };else {\n labelCountMap[label].count++;\n labelCountMap[label].dists.push(v);\n }\n }\n });\n // 将 labelCountMap 中的 dists 按照从小到大排序,方便后面使用\n Object.keys(labelCountMap).forEach(function (label) {\n labelCountMap[label].dists = labelCountMap[label].dists.sort(function (a, b) {\n return a - b;\n });\n });\n return {\n nodeIdx: i,\n nodeId: nodes[i].id,\n nodeIdxs: unitNodeIdxs,\n neighbors: neighbors,\n neighborNum: unitNodeIdxs.length - 1,\n nodeLabelCountMap: labelCountMap\n };\n};\n/**\n * 随机寻找点对,满足距离小于 k\n * @param k 参数 k,表示 k-近邻\n * @param nodeNum 参数 length\n * @param maxNodePairNum 寻找点对的数量不超过 maxNodePairNum\n * @param spm 最短路径矩阵\n */\nvar findNodePairsRandomly = function findNodePairsRandomly(k, nodeNum, maxNodePairNum, kNeighborUnits, spm) {\n // 每个节点需要随机找出的点对数\n var nodePairNumEachNode = Math.ceil(maxNodePairNum / nodeNum);\n var nodePairMap = {};\n var foundNodePairCount = 0;\n // 遍历节点,为每个节点随机找出 nodePairNumEachNode 个点对,满足距离小于 k。找到的点对数量超过 maxNodePairNum 或所有节点遍历结束时终止\n kNeighborUnits.forEach(function (unit, i) {\n // 若未达到 nodePairNumEachNode,或循环次数小于最大循环次数(2 * nodeNum),继续循环\n var nodePairForICount = 0;\n var outerLoopCount = 0;\n var neighbors = unit.nodeIdxs; // the first one is the center node\n var neighborNum = unit.neighborNum - 1;\n while (nodePairForICount < nodePairNumEachNode) {\n // 另一端节点在节点数组中的的 index\n var oidx = neighbors[1 + Math.floor(Math.random() * neighborNum)];\n var innerLoopCount = 0;\n // 若随机得到的另一端 idx 不符合条件,则继续 random。条件是不是同一个节点、这个点对没有被记录过、距离小于 k\n while (nodePairMap[\"\".concat(i, \"-\").concat(oidx)] || nodePairMap[\"\".concat(oidx, \"-\").concat(i)]) {\n oidx = Math.floor(Math.random() * nodeNum);\n innerLoopCount++;\n if (innerLoopCount > 2 * nodeNum) break; // 循环次数大于最大循环次数(2 * nodeNum)跳出循环,避免死循环\n }\n\n if (innerLoopCount < 2 * nodeNum) {\n // 未达到最大循环次数,说明找到了合适的另一端\n nodePairMap[\"\".concat(i, \"-\").concat(oidx)] = {\n start: i,\n end: oidx,\n distance: spm[i][oidx]\n };\n nodePairForICount++;\n foundNodePairCount++;\n // 如果当前找到的点对数量达到了上限,返回结果\n if (foundNodePairCount >= maxNodePairNum) return nodePairMap;\n }\n outerLoopCount++;\n if (outerLoopCount > 2 * nodeNum) break; // 循环次数大于最大循环次数(2 * nodeNum)跳出循环,避免死循环\n }\n // 这个节点没有找到足够 nodePairNumEachNode 的点对。更新 nodePairNumEachNode,让后续节点找更多的点对\n if (nodePairForICount < nodePairNumEachNode) {\n var gap = nodePairNumEachNode - nodePairForICount;\n nodePairNumEachNode = (nodePairNumEachNode + gap) / (nodeNum - i - 1);\n }\n });\n return nodePairMap;\n};\n/**\n * 计算所有 nodePairMap 中节点对的相交邻居诱导子图\n * @param nodePairMap 节点对 map,key 为 node1.id-node2.id,value 为 { startNodeIdx, endNodeIdx, distance }\n * @param neighborUnits 每个节点的邻居元数组\n * @param graphData 原图数据\n * @param edgeMap 边的 map,方便检索\n * @param cachedInducedGraphMap 缓存的结果,下次进入该函数将继续更新该缓存,若 key 在缓存中存在则不需要重复计算\n */\nvar getIntersectNeighborInducedGraph = function getIntersectNeighborInducedGraph(nodePairMap, neighborUnits, graphData, cachedInducedGraphMap) {\n var nodes = graphData.nodes;\n if (!cachedInducedGraphMap) cachedInducedGraphMap = {};\n Object.keys(nodePairMap).forEach(function (key) {\n var _a, _b;\n if (cachedInducedGraphMap && cachedInducedGraphMap[key]) return;\n cachedInducedGraphMap[key] = {\n nodes: [],\n edges: []\n };\n var pair = nodePairMap[key];\n var startUnitNodeIds = (_a = neighborUnits[pair.start]) === null || _a === void 0 ? void 0 : _a.nodeIdxs;\n var endUnitNodeIds = (_b = neighborUnits[pair.end]) === null || _b === void 0 ? void 0 : _b.nodeIdxs;\n if (!startUnitNodeIds || !endUnitNodeIds) return; // 不存在邻元,返回空图\n var endSet = new Set(endUnitNodeIds);\n var intersect = startUnitNodeIds.filter(function (x) {\n return endSet.has(x);\n }); // 可能会爆栈(在 1580 + 6 nodes full-connected 时出现)\n if (!intersect || !intersect.length) return; // 没有交集,返回空图\n var intersectIdMap = {};\n var intersectLength = intersect.length;\n for (var i = 0; i < intersectLength; i++) {\n var node = nodes[intersect[i]];\n cachedInducedGraphMap[key].nodes.push(node); // 将交集中的点加入诱导子图\n intersectIdMap[node.id] = true;\n }\n // 遍历所有边数据,如果边的两端都在交集中,将该边加入诱导子图\n graphData.edges.forEach(function (edge) {\n if (intersectIdMap[edge.source] && intersectIdMap[edge.target]) cachedInducedGraphMap[key].edges.push(edge);\n });\n });\n return cachedInducedGraphMap;\n};\n/**\n * 计算 strcutre 在 graph 上的匹配数量\n * @param graph 图数据\n * @param structure 目前支持只有两个节点一条边的最简单结构\n * @param nodeLabelProp 节点类型字段名\n * @param edgeLabelProp 边类型字段名\n */\nvar getMatchedCount = function getMatchedCount(graph, structure, nodeLabelProp, edgeLabelProp) {\n var _a, _b;\n var nodeMap = {};\n graph.nodes.forEach(function (node) {\n nodeMap[node.id] = node;\n });\n var count = 0;\n if (!((_a = structure === null || structure === void 0 ? void 0 : structure.edges) === null || _a === void 0 ? void 0 : _a.length) || ((_b = structure === null || structure === void 0 ? void 0 : structure.nodes) === null || _b === void 0 ? void 0 : _b.length) < 2) return 0;\n graph.edges.forEach(function (e) {\n var sourceLabel = nodeMap[e.source][nodeLabelProp];\n var targetLabel = nodeMap[e.target][nodeLabelProp];\n var strNodeLabel1 = structure === null || structure === void 0 ? void 0 : structure.nodes[0][nodeLabelProp];\n var strNodeLabel2 = structure === null || structure === void 0 ? void 0 : structure.nodes[1][nodeLabelProp];\n var strEdgeLabel = structure === null || structure === void 0 ? void 0 : structure.edges[0][edgeLabelProp];\n if (e[edgeLabelProp] !== strEdgeLabel) return;\n if (sourceLabel === strNodeLabel1 && targetLabel === strNodeLabel2 || sourceLabel === strNodeLabel2 && targetLabel === strNodeLabel1) {\n count++;\n }\n });\n return count;\n};\n/**\n * structures 中寻找最具有代表性的一个。这个结构是使得 matchedCountMap 的分组方式类内间距最小,类间间距最大\n * @param matchedCountMap 每个 structure 分类后的各图匹配数量,格式 { [strcture.idx]: { [interInducedGraphKey]: count } }\n * @param structureNum strcuture 个数,与 matchedCountMap.length 对应\n * @param structures\n */\nvar findRepresentStructure = function findRepresentStructure(matchedCountMap, structureNum, structures) {\n var maxOffset = Infinity,\n representClusterType = 0;\n var _loop_1 = function _loop_1(i) {\n // 一种分组的 map,key 是 intGraph 的 key,value 是 structures[i] 的匹配个数\n var countMapI = matchedCountMap[i];\n // 按照 value 为该组排序,生成 keys 的数组:\n var sortedGraphKeys = Object.keys(countMapI).sort(function (a, b) {\n return countMapI[a] - countMapI[b];\n });\n // 共 100 个 graphKeys,将 graphKeys 按顺序分为 groupNum 组\n var groupNum = 10;\n var clusters = []; // 总共有 groupNum 个项\n sortedGraphKeys.forEach(function (key, j) {\n if (!clusters[j % groupNum]) clusters[j % groupNum] = {\n graphs: [],\n totalCount: 0,\n aveCount: 0\n };\n clusters[j % groupNum].graphs.push(key);\n clusters[j % groupNum].totalCount += countMapI[key];\n });\n // 计算 cluster 与 cluster 之间的距离 innerDist,每个 cluster 内部的距离 intraDist\n var aveIntraDist = 0; // 该类的类内平均值\n var aveCounts = []; // 类内平均匹配数量,将用于计算类间距离\n clusters.forEach(function (graphsInCluster) {\n // 类内均值\n var aveCount = graphsInCluster.totalCount / graphsInCluster.graphs.length;\n graphsInCluster.aveCount = aveCount;\n aveCounts.push(aveCount);\n // 对于每类,计算类内间距平均值\n var aveIntraPerCluster = 0;\n var graphsNum = graphsInCluster.length;\n graphsInCluster.graphs.forEach(function (graphKey1, j) {\n var graph1Count = countMapI[graphKey1];\n graphsInCluster.graphs.forEach(function (graphKey2, k) {\n if (j === k) return;\n aveIntraPerCluster += Math.abs(graph1Count - countMapI[graphKey2]);\n });\n });\n aveIntraPerCluster /= graphsNum * (graphsNum - 1) / 2;\n aveIntraDist += aveIntraPerCluster;\n });\n aveIntraDist /= clusters.length;\n // 用类内均值计算类间距\n var aveInterDist = 0; // 类间间距平均值\n aveCounts.forEach(function (aveCount1, j) {\n aveCounts.forEach(function (aveCount2, k) {\n if (j === k) return;\n aveInterDist += Math.abs(aveCount1 - aveCount2);\n });\n aveInterDist /= aveCounts.length * (aveCounts.length - 1) / 2;\n });\n // 寻找 (类间间距均值-类内间距均值) 最大的一种分组方式(对应的 structure 就是最终要找的唯一 DS(G))\n var offset = aveInterDist - aveIntraDist;\n if (maxOffset < offset) {\n maxOffset = offset;\n representClusterType = i;\n }\n };\n for (var i = 0; i < structureNum; i++) {\n _loop_1(i);\n }\n return {\n structure: structures[representClusterType],\n structureCountMap: matchedCountMap[representClusterType]\n };\n};\nvar getNodeMaps = function getNodeMaps(nodes, nodeLabelProp) {\n var nodeMap = {},\n nodeLabelMap = {};\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = {\n idx: i,\n node: node,\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n var label = node[nodeLabelProp];\n if (!nodeLabelMap[label]) nodeLabelMap[label] = [];\n nodeLabelMap[label].push(node);\n });\n return {\n nodeMap: nodeMap,\n nodeLabelMap: nodeLabelMap\n };\n};\nvar getEdgeMaps = function getEdgeMaps(edges, edgeLabelProp, nodeMap) {\n var edgeMap = {},\n edgeLabelMap = {};\n edges.forEach(function (edge, i) {\n edgeMap[\"\".concat(_util__WEBPACK_IMPORTED_MODULE_4__[\"uniqueId\"])] = {\n idx: i,\n edge: edge\n };\n var label = edge[edgeLabelProp];\n if (!edgeLabelMap[label]) edgeLabelMap[label] = [];\n edgeLabelMap[label].push(edge);\n var sourceNode = nodeMap[edge.source];\n if (sourceNode) {\n sourceNode.degree++;\n sourceNode.outDegree++;\n }\n var targetNode = nodeMap[edge.target];\n if (targetNode) {\n targetNode.degree++;\n targetNode.inDegree++;\n }\n });\n return {\n edgeMap: edgeMap,\n edgeLabelMap: edgeLabelMap\n };\n};\n/**\n * 输出最短路径的 map,key 为 sourceNode.id-targetNode.id,value 为这两个节点的最短路径长度\n * @param nodes\n * @param spm\n * @param directed\n */\nvar getSpmMap = function getSpmMap(nodes, spm, directed) {\n var length = spm.length;\n var map = {};\n spm.forEach(function (row, i) {\n var start = directed ? 0 : i + 1;\n var iId = nodes[i].id;\n for (var j = start; j < length; j++) {\n if (i === j) continue;\n var jId = nodes[j].id;\n var dist = row[j];\n map[\"\".concat(iId, \"-\").concat(jId)] = dist;\n if (!directed) map[\"\".concat(jId, \"-\").concat(iId)] = dist;\n }\n });\n return map;\n};\n/**\n * 计算一对节点(node1,node2)的 NDS 距离\n * @param graph 原图数据\n * @param node1\n * @param node2\n */\nvar getNDSDist = function getNDSDist(graph, node1, node2, nodeMap, spDist, kNeighborUnits, structure, nodeLabelProp, edgeLabelProp, cachedNDSMap, cachedInterInducedGraph) {\n var _a;\n var key = \"\".concat(node1.id, \"-\").concat(node2.id);\n if (cachedNDSMap && cachedNDSMap[key]) return cachedNDSMap[key];\n var interInducedGraph = cachedInterInducedGraph ? cachedInterInducedGraph[key] : undefined;\n // 若没有缓存相交邻居诱导子图,计算\n if (!interInducedGraph) {\n var pairMap = (_a = {}, _a[key] = {\n start: nodeMap[node1.id].idx,\n end: nodeMap[node2.id].idx,\n distance: spDist\n }, _a);\n cachedInterInducedGraph = getIntersectNeighborInducedGraph(pairMap, kNeighborUnits, graph, cachedInterInducedGraph);\n interInducedGraph = cachedInterInducedGraph[key];\n }\n return getMatchedCount(interInducedGraph, structure, nodeLabelProp, edgeLabelProp);\n};\n/**\n * 计算 pattern 上绩点的度数并存储到 minPatternNodeLabelDegreeMap\n */\nvar stashPatternNodeLabelDegreeMap = function stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, neighborLabel, patternNodeMap, patternNodeLabelMap) {\n var _a, _b, _c;\n var minPatternNodeLabelDegree = (_a = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _a === void 0 ? void 0 : _a.degree;\n var minPatternNodeLabelInDegree = (_b = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _b === void 0 ? void 0 : _b.inDegree;\n var minPatternNodeLabelOutDegree = (_c = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _c === void 0 ? void 0 : _c.outDegree;\n if (minPatternNodeLabelDegreeMap[neighborLabel] === undefined) {\n minPatternNodeLabelDegree = Infinity;\n minPatternNodeLabelInDegree = Infinity;\n minPatternNodeLabelOutDegree = Infinity;\n patternNodeLabelMap[neighborLabel].forEach(function (patternNodeWithLabel) {\n var patternNodeDegree = patternNodeMap[patternNodeWithLabel.id].degree;\n if (minPatternNodeLabelDegree > patternNodeDegree) minPatternNodeLabelDegree = patternNodeDegree;\n var patternNodeInDegree = patternNodeMap[patternNodeWithLabel.id].inDegree;\n if (minPatternNodeLabelInDegree > patternNodeInDegree) minPatternNodeLabelInDegree = patternNodeInDegree;\n var patternNodeOutDegree = patternNodeMap[patternNodeWithLabel.id].outDegree;\n if (minPatternNodeLabelOutDegree > patternNodeOutDegree) minPatternNodeLabelOutDegree = patternNodeOutDegree;\n });\n minPatternNodeLabelDegreeMap[neighborLabel] = {\n degree: minPatternNodeLabelDegree,\n inDegree: minPatternNodeLabelInDegree,\n outDegree: minPatternNodeLabelOutDegree\n };\n }\n return {\n minPatternNodeLabelDegree: minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree: minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree: minPatternNodeLabelOutDegree\n };\n};\n/**\n * GADDI 模式匹配\n * @param graphData 原图数据\n * @param pattern 搜索图(需要在原图上搜索的模式)数据\n * @param directed 是否计算有向图,默认 false\n * @param k 参数 k,表示 k-近邻\n * @param length 参数 length\n * @param nodeLabelProp 节点数据中代表节点标签(分类信息)的属性名。默认为 cluster\n * @param edgeLabelProp 边数据中代表边标签(分类信息)的属性名。默认为 cluster\n */\nvar GADDI = function GADDI(graphData, pattern, directed, k, length, nodeLabelProp, edgeLabelProp) {\n var _a;\n if (directed === void 0) {\n directed = false;\n }\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n if (edgeLabelProp === void 0) {\n edgeLabelProp = 'cluster';\n }\n if (!graphData || !graphData.nodes) return;\n // 分为三步:\n // 0. 预计算:节点/边数,邻接矩阵、最短路径矩阵\n // 1. 处理原图 graphData。再分为 1~5 小步\n // 2. 匹配\n // console.log(\"----- stage-pre: preprocessing -------\");\n // -------- 第零步,预计算:节点/边数,邻接矩阵、最短路径矩阵-------\n var nodeNum = graphData.nodes.length;\n if (!nodeNum) return;\n // console.log(\"----- stage-pre.1: calc shortest path matrix for graph -------\");\n var spm = Object(_floydWarshall__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(graphData, directed);\n // console.log(\n // \"----- stage-pre.2: calc shortest path matrix for pattern -------\"\n // );\n var patternSpm = Object(_floydWarshall__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(pattern, directed);\n // console.log(\n // \"----- stage-pre.3: calc shortest path matrix map for graph -------\"\n // );\n var spmMap = getSpmMap(graphData.nodes, spm, directed);\n // console.log(\n // \"----- stage-pre.4: calc shortest path matrix map for pattern -------\"\n // );\n var patternSpmMap = getSpmMap(pattern.nodes, patternSpm, directed);\n // console.log(\"----- stage-pre.5: establish maps -------\");\n // 节点的 map,以 id 为 id 映射,方便后续快速检索\n var _b = getNodeMaps(graphData.nodes, nodeLabelProp),\n nodeMap = _b.nodeMap,\n nodeLabelMap = _b.nodeLabelMap;\n var _c = getNodeMaps(pattern.nodes, nodeLabelProp),\n patternNodeMap = _c.nodeMap,\n patternNodeLabelMap = _c.nodeLabelMap;\n // 计算节点度数\n getEdgeMaps(graphData.edges, edgeLabelProp, nodeMap);\n var patternEdgeLabelMap = getEdgeMaps(pattern.edges, edgeLabelProp, patternNodeMap).edgeLabelMap;\n // 若未指定 length,自动计算 pattern 半径(最短路径最大值)\n var patternSpmSpread = [];\n patternSpm === null || patternSpm === void 0 ? void 0 : patternSpm.forEach(function (row) {\n patternSpmSpread = patternSpmSpread.concat(row);\n });\n if (!length) length = Math.max.apply(Math, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], patternSpmSpread, false), [2], false));\n if (!k) k = length;\n // console.log(\"params\", directed, length, k);\n // console.log(\"----- stage-pre.6: calc k neighbor units -------\");\n // 计算每个节点的 k 邻元集合\n var kNeighborUnits = findKNeighborUnits(graphData, spm, nodeLabelProp, k);\n var patternKNeighborUnits = findKNeighborUnits(pattern, patternSpm, nodeLabelProp, k);\n // console.log(\n // \"----- stage0: going to processing graph and find intersect neighbor induced graphs -------\"\n // );\n // console.log(\"----- stage0.1: going to select random node pairs -------\");\n // -------- 第一步,处理原图 graphData-------\n // 1.1. 随机选择最多 100 个点对,满足距离小于 Length 和 k\n // 当 graphData 少于 20 个节点,则不能找出 100 个点对,只找出不多于 n(n-1)/2 个点对\n var maxNodePairNum = Math.min(100, nodeNum * (nodeNum - 1) / 2);\n var nodePairsMap = findNodePairsRandomly(k, nodeNum, maxNodePairNum, kNeighborUnits, spm);\n // console.log(\n // \"----- stage0.2: going to calculate intersect neighbor induced graphs -------\"\n // );\n // 1.2. 生成上面节点对的相应相交邻居诱导子图。格式为 {'beginNodeIdx-endNodeIdx': {nodes: [], edges: []}}\n var intGMap = getIntersectNeighborInducedGraph(nodePairsMap, kNeighborUnits, graphData);\n // 1.3. 使用 gSpan 算法(frequent graph mining)计算 ISIntG 的前 10 个频率最高的子结构(3-4条边)\n var top = 10,\n minSupport = 1,\n minNodeNum = 1,\n maxNodeNum = 4;\n var params = {\n graphs: intGMap,\n nodeLabelProp: nodeLabelProp,\n edgeLabelProp: edgeLabelProp,\n minSupport: minSupport,\n minNodeNum: minNodeNum,\n maxNodeNum: maxNodeNum,\n directed: directed\n };\n // console.log(\n // \"----- stage1: (gSpan) going to find frequent structure dsG -------\"\n // );\n // console.log(\"----- stage1.1: going to run gSpan -------\");\n // 暂时假设生成的 sub structure 都只有一条边\n var freStructures = Object(_gSpan_gSpan__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(params).slice(0, top);\n // structureNum 可能小于 top\n var structureNum = freStructures.length;\n // 1.4. 计算上述 10 个子结构在 intGMap 中每个诱导子图的匹配个数\n var matchedCountMap = [];\n freStructures.forEach(function (structure, i) {\n matchedCountMap[i] = {};\n Object.keys(intGMap).forEach(function (key) {\n var graph = intGMap[key];\n var subStructureCount = getMatchedCount(graph, structure, nodeLabelProp, edgeLabelProp);\n matchedCountMap[i][key] = subStructureCount;\n });\n });\n // console.log(\n // \"----- stage1.1: going to find the most represent strucutre -------\"\n // );\n // 1.5. 对于每个子结构,根据匹配个数为 intGMap 中的诱导子图分组,生成 structureNum 种分组\n // 计算每种分组的类间距和类内间距,找到类间距最大、类内间距最小的一种分组,这种分组对应的子结构被选为唯一代表性子结构 DS(G)\n var _d = findRepresentStructure(matchedCountMap, structureNum, freStructures),\n dsG = _d.structure,\n ndsDist = _d.structureCountMap;\n // -------- 第二步,匹配-------\n // 2.1 找到从 Q 中的一个节点作为起始节点,寻找 G 中的匹配。这个其实节点的标签可以在 G 中找到最多的节点\n var beginPNode = pattern.nodes[0],\n candidates = [],\n label = (_a = pattern.nodes[0]) === null || _a === void 0 ? void 0 : _a[nodeLabelProp],\n maxNodeNumWithSameLabel = -Infinity;\n pattern.nodes.forEach(function (node) {\n var pLabel = node[nodeLabelProp];\n var nodesWithSameLabel = nodeLabelMap[pLabel];\n if ((nodesWithSameLabel === null || nodesWithSameLabel === void 0 ? void 0 : nodesWithSameLabel.length) > maxNodeNumWithSameLabel) {\n maxNodeNumWithSameLabel = nodesWithSameLabel.length;\n candidates = nodesWithSameLabel;\n label = pLabel;\n beginPNode = node;\n }\n });\n // console.log(\"----- stage2: going to find candidates -------\");\n // 全局缓存,避免重复计算\n var minPatternNodeLabelDegreeMap = {}; // key 是 label,value 是该 label 节点的最小度数\n var patternIntGraphMap = {},\n patternNDSDist = {},\n // key 为 node.id-node.id\n patternNDSDistMap = {}; // key 为 node.id-label2,value nds距离值数组(按从大到小排序,无需关心具体对应哪个 node2)\n // 2.2.2 对于 Q 中的另一个标签的 k 个节点,计算它们到 node 的最短路径以及 NDS 距离\n var patternSpDist = {};\n var patternSpDistBack = {};\n Object.keys(patternNodeLabelMap).forEach(function (label2, j) {\n patternSpDist[label2] = [];\n if (directed) {\n patternSpDistBack[label2] = [];\n }\n var maxDist = -Infinity;\n var patternNodesWithLabel2 = patternNodeLabelMap[label2];\n var patternNodePairMap = {};\n patternNodesWithLabel2.forEach(function (nodeWithLabel2) {\n var dist = patternSpmMap[\"\".concat(beginPNode.id, \"-\").concat(nodeWithLabel2.id)];\n dist && patternSpDist[label2].push(dist);\n if (maxDist < dist) maxDist = dist;\n patternNodePairMap[\"\".concat(beginPNode.id, \"-\").concat(nodeWithLabel2.id)] = {\n start: 0,\n end: patternNodeMap[nodeWithLabel2.id].idx,\n distance: dist\n };\n if (directed) {\n var distBack = patternSpmMap[\"\".concat(nodeWithLabel2.id, \"-\").concat(beginPNode.id)];\n distBack && patternSpDistBack[label2].push(distBack);\n }\n });\n // spDist[label2] 按照从小到大排序\n patternSpDist[label2] = patternSpDist[label2].sort(function (a, b) {\n return a - b;\n });\n if (directed) patternSpDistBack[label2] = patternSpDistBack[label2].sort(function (a, b) {\n return a - b;\n });\n // 计算 Q 中所有 label2 节点到 beginPNode 的 NDS 距离\n // 所有 label2 节点到 beginPNode 的邻居相交诱导子图:\n // key: node1.id-node2.id\n patternIntGraphMap = getIntersectNeighborInducedGraph(patternNodePairMap, patternKNeighborUnits, pattern, patternIntGraphMap);\n // pattern 中 beginNode 到当前 label2 节点 的 NDS 距离(数组,无需关心具体对应到哪个节点)\n var currentPatternNDSDistArray = [];\n Object.keys(patternNodePairMap).forEach(function (key) {\n if (patternNDSDist[key]) {\n currentPatternNDSDistArray.push(patternNDSDist[key]);\n return; // 缓存过则不需要再次计算\n }\n\n var patternIntGraph = patternIntGraphMap[key];\n patternNDSDist[key] = getMatchedCount(patternIntGraph, dsG, nodeLabelProp, edgeLabelProp);\n currentPatternNDSDistArray.push(patternNDSDist[key]);\n });\n // 根据值为 currentPatternNDSDist 从大到小排序\n currentPatternNDSDistArray = currentPatternNDSDistArray.sort(function (a, b) {\n return b - a;\n });\n patternNDSDistMap[\"\".concat(beginPNode.id, \"-\").concat(label2)] = currentPatternNDSDistArray;\n if (label2 === label) return;\n var candidatesNum = (candidates === null || candidates === void 0 ? void 0 : candidates.length) || 0;\n var _loop_4 = function _loop_4(m) {\n var cNode = candidates[m];\n // prune1:若 candidates 中节点 cNode 的 kNeighborUnits 中标签为 label2 的节点个数少于 pattern 中 label2 个数,删去它\n var graphNeighborUnit = kNeighborUnits[nodeMap[cNode.id].idx];\n var graphNeighborUnitCountMap = graphNeighborUnit.nodeLabelCountMap[label2];\n var patternLabel2Num = patternNodeLabelMap[label2].length;\n if (!graphNeighborUnitCountMap || graphNeighborUnitCountMap.count < patternLabel2Num) {\n candidates.splice(m, 1);\n return \"continue\";\n }\n // prune2:若 candidates 中节点 cNode 到 kNeighborUnits 中标签为 label2 的节点最短路径大于 patternSpDist[label2],删去它\n // (prune2 规则即:candidate 相关的最短路径的最大 spDist[label2].length 个,按照大小顺序依次和 patternSpDist[label2] 中的值比较,只要遇到一个是 G > Q 的,就删去这个 candidate)\n var prune2Invalid = false;\n for (var n = 0; n < patternLabel2Num; n++) {\n if (graphNeighborUnitCountMap.dists[n] > patternSpDist[label2][n]) {\n prune2Invalid = true;\n break;\n }\n }\n if (prune2Invalid) {\n candidates.splice(m, 1);\n return \"continue\";\n }\n // prune3:若 candidates 中节点 cNode 到 kNeighborUnits 中标签为 label2 的节点 NDS 距离小于 patternNDSDist[beginNode.id-label2],删去它\n // TODO:prune3,currentPatternNDSDistArray 与 currentNDSDist 的比较\n // 计算 G 中所有 label2 节点到 cNode 的 NDS 距离\n // 所有 label2 节点到 cNode 的邻居相交诱导子图:\n var cNodePairMap = {};\n graphNeighborUnit.neighbors.forEach(function (neighborNode) {\n var dist = spmMap[\"\".concat(cNode.id, \"-\").concat(neighborNode.id)];\n cNodePairMap[\"\".concat(cNode.id, \"-\").concat(neighborNode.id)] = {\n start: nodeMap[cNode.id].idx,\n end: nodeMap[neighborNode.id].idx,\n distance: dist\n };\n });\n // 更新 intGMap\n intGMap = getIntersectNeighborInducedGraph(cNodePairMap, kNeighborUnits, graphData, intGMap);\n // candidate 到它周围 label2 节点的 NDS 距离, key 是 node.id-node.id\n var currentNDSDistArray = [];\n Object.keys(cNodePairMap).forEach(function (key) {\n if (ndsDist[key]) {\n currentNDSDistArray.push(ndsDist[key]);\n return; // 缓存过则不需要再次计算\n }\n\n var intGraph = intGMap[key];\n ndsDist[key] = getMatchedCount(intGraph, dsG, nodeLabelProp, edgeLabelProp);\n currentNDSDistArray.push(ndsDist[key]);\n });\n // 根据值为 currentNDSDistArray 从大到小排序\n currentNDSDistArray = currentNDSDistArray.sort(function (a, b) {\n return b - a;\n });\n var prune3Invalid = false;\n for (var n = 0; n < patternLabel2Num; n++) {\n if (currentNDSDistArray[n] < currentPatternNDSDistArray[n]) {\n prune3Invalid = true;\n break;\n }\n }\n if (prune3Invalid) {\n candidates.splice(m, 1);\n return \"continue\";\n }\n };\n for (var m = candidatesNum - 1; m >= 0; m--) {\n _loop_4(m);\n }\n });\n var candidateGraphs = [];\n // console.log(\n // \"----- stage3: going to splice neighbors for each candidate graph -------\"\n // );\n // candidates 经过筛选后,以每个 candidate 为中心,生成 Length-neighbor 的邻居诱导子图\n // 并在诱导子图中去除不可能在 Q 上找到匹配的点:在 Q 上不存在的 label,其他 label 到 candidate 的最大最短距离符合 Q、NDS 距离符合 Q\n candidates === null || candidates === void 0 ? void 0 : candidates.forEach(function (candidate) {\n var nodeIdx = nodeMap[candidate.id].idx;\n var lengthNeighborUnit = findKNeighborUnit(graphData.nodes, spm[nodeIdx], nodeIdx, nodeLabelProp, length);\n var neighborNodes = lengthNeighborUnit.neighbors;\n // 删除不可能找到匹配的邻居点\n var neighborNum = neighborNodes.length;\n var unmatched = false;\n for (var i = neighborNum - 1; i >= 0; i--) {\n // 如果通过裁剪,符合条件的节点数量已过少,说明不能匹配这个 candidate 相关的图\n if (neighborNodes.length + 1 < pattern.nodes.length) {\n unmatched = true;\n return;\n }\n var neighborNode = neighborNodes[i];\n var neighborLabel = neighborNode[nodeLabelProp];\n // prune1: 若该邻居点的 label 不存在于 pattern 中,移除这个点\n if (!patternNodeLabelMap[neighborLabel] || !patternNodeLabelMap[neighborLabel].length) {\n neighborNodes.splice(i, 1);\n continue;\n }\n // prune2: 若该邻居点到 candidate 的最短路径比和它有相同 label 的节点到 beginPNode 的最大最短路径长度长,移除这个点\n // prune2.1: 如果没有这个标签到 beginPNode 的距离记录,说明 pattern 上(可能 beginPNode 是这个 label)没有其他这个 label 的节点\n if (!patternSpDist[neighborLabel] || !patternSpDist[neighborLabel].length) {\n neighborNodes.splice(i, 1);\n continue;\n }\n var key = \"\".concat(candidate.id, \"-\").concat(neighborNode.id);\n // prune2.2\n var distToCandidate = spmMap[key];\n var idx = patternSpDist[neighborLabel].length - 1;\n var maxDistWithLabelInPattern = patternSpDist[neighborLabel][idx]; // patternSpDist[neighborLabel] 已经按照从小到大排序\n if (distToCandidate > maxDistWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n if (directed) {\n var keyBack = \"\".concat(neighborNode.id, \"-\").concat(candidate.id);\n var distFromCandidate = spmMap[keyBack];\n idx = patternSpDistBack[neighborLabel].length - 1;\n var maxBackDistWithLabelInPattern = patternSpDistBack[neighborLabel][idx];\n if (distFromCandidate > maxBackDistWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n }\n // prune3: 若该邻居点到 candidate 的 NDS 距离比和它有相同 label 的节点到 beginPNode 的最小 NDS 距离小,移除这个点\n var ndsToCandidate = ndsDist[key] ? ndsDist[key] : getNDSDist(graphData, candidate, neighborNode, nodeMap, distToCandidate, kNeighborUnits, dsG, nodeLabelProp, edgeLabelProp, ndsDist, intGMap);\n var patternKey = \"\".concat(beginPNode.id, \"-\").concat(neighborLabel);\n var minNdsWithLabelInPattern = patternNDSDistMap[patternKey][patternNDSDistMap[patternKey].length - 1]; // patternNDSDist[key] 一定存在\n if (ndsToCandidate < minNdsWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n // prune4: 若该邻居点的度数小于 pattern 同 label 节点最小度数,删去该点\n var _a = stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, neighborLabel, patternNodeMap, patternNodeLabelMap),\n minPatternNodeLabelDegree = _a.minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree = _a.minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree = _a.minPatternNodeLabelOutDegree;\n if (nodeMap[neighborNode.id].degree < minPatternNodeLabelDegree) {\n neighborNodes.splice(i, 1);\n continue;\n }\n }\n // 节点在个数上符合匹配(不少于 pattern 的节点个数),现在筛选相关边\n if (!unmatched) {\n candidateGraphs.push({\n nodes: [candidate].concat(neighborNodes)\n });\n }\n });\n // console.log(\n // \"----- stage4: going to splice edges and neighbors for each candidate graph -------\"\n // );\n var undirectedLengthsToBeginPNode = Object(_dijkstra__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(pattern, beginPNode.id, false).length;\n var undirectedLengthsToBeginPNodeLabelMap = {};\n if (directed) {\n Object.keys(undirectedLengthsToBeginPNode).forEach(function (nodeId) {\n var nodeLabel = patternNodeMap[nodeId].node[nodeLabelProp];\n if (!undirectedLengthsToBeginPNodeLabelMap[nodeLabel]) undirectedLengthsToBeginPNodeLabelMap[nodeLabel] = [undirectedLengthsToBeginPNode[nodeId]];else undirectedLengthsToBeginPNodeLabelMap[nodeLabel].push(undirectedLengthsToBeginPNode[nodeId]);\n });\n Object.keys(undirectedLengthsToBeginPNodeLabelMap).forEach(function (pLabel) {\n undirectedLengthsToBeginPNodeLabelMap[pLabel].sort(function (a, b) {\n return a - b;\n });\n });\n } else {\n undirectedLengthsToBeginPNodeLabelMap = patternSpDist;\n }\n // 现在 candidateGraphs 里面只有节点,进行边的筛选\n var candidateGraphNum = candidateGraphs.length;\n var _loop_2 = function _loop_2(i) {\n var candidateGraph = candidateGraphs[i];\n var candidate = candidateGraph.nodes[0];\n var candidateNodeLabelCountMap = {};\n var candidateNodeMap = {};\n candidateGraph.nodes.forEach(function (node, q) {\n candidateNodeMap[node.id] = {\n idx: q,\n node: node,\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n var cNodeLabel = node[nodeLabelProp];\n if (!candidateNodeLabelCountMap[cNodeLabel]) candidateNodeLabelCountMap[cNodeLabel] = 1;else candidateNodeLabelCountMap[cNodeLabel]++;\n });\n // 根据 candidate 和 neighborNodes 中的节点生成 G 的诱导子图\n // 即,将 graphData 上两端都在 candidateGraph.nodes 中的边放入 candidateEdges\n var candidateEdges = [];\n var edgeLabelCountMap = {};\n graphData.edges.forEach(function (edge) {\n if (candidateNodeMap[edge.source] && candidateNodeMap[edge.target]) {\n candidateEdges.push(edge);\n if (!edgeLabelCountMap[edge[edgeLabelProp]]) edgeLabelCountMap[edge[edgeLabelProp]] = 1;else edgeLabelCountMap[edge[edgeLabelProp]]++;\n candidateNodeMap[edge.source].degree++;\n candidateNodeMap[edge.target].degree++;\n candidateNodeMap[edge.source].outDegree++;\n candidateNodeMap[edge.target].inDegree++;\n }\n });\n // prune:若有一个 edgeLabel 在 candidateGraph 上的个数少于 pattern,去除该图\n var pattenrEdgeLabelNum = Object.keys(patternEdgeLabelMap).length;\n var prunedByEdgeLabel = false;\n for (var e = 0; e < pattenrEdgeLabelNum; e++) {\n var label_1 = Object.keys(patternEdgeLabelMap)[e];\n if (!edgeLabelCountMap[label_1] || edgeLabelCountMap[label_1] < patternEdgeLabelMap[label_1].length) {\n prunedByEdgeLabel = true;\n break;\n }\n }\n if (prunedByEdgeLabel) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n // 遍历 candidateEdges,进行边的筛选\n var candidateEdgeNum = candidateEdges.length;\n // prune:若边数过少,去除该图\n if (candidateEdgeNum < pattern.edges.length) {\n candidateGraphs.splice(i, 1);\n return \"break\";\n }\n var candidateGraphInvalid = false;\n var _loop_5 = function _loop_5(e) {\n var edge = candidateEdges[e];\n var edgeLabel = edge[edgeLabelProp];\n var patternEdgesWithLabel = patternEdgeLabelMap[edgeLabel];\n // prune 1: 若边的 label 不存在于 pattern 边 label 中,去除该边\n if (!patternEdgesWithLabel || !patternEdgesWithLabel.length) {\n edgeLabelCountMap[edgeLabel]--;\n // 若这个 label 的 count 减少之后,该 label 的边数不足,去除该图\n if (patternEdgesWithLabel && edgeLabelCountMap[edgeLabel] < patternEdgesWithLabel.length) {\n candidateGraphInvalid = true;\n return \"break\";\n }\n candidateEdges.splice(e, 1);\n candidateNodeMap[edge.source].degree--;\n candidateNodeMap[edge.target].degree--;\n candidateNodeMap[edge.source].outDegree--;\n candidateNodeMap[edge.target].inDegree--;\n return \"continue\";\n }\n // prune 2: 若边的 label +两端 label 的三元组关系不能在 pattern 中找到,去除该边\n var sourceLabel = candidateNodeMap[edge.source].node[nodeLabelProp];\n var targetLabel = candidateNodeMap[edge.target].node[nodeLabelProp];\n var edgeMatched = false;\n patternEdgesWithLabel.forEach(function (patternEdge) {\n var patternSource = patternNodeMap[patternEdge.source].node;\n var patternTarget = patternNodeMap[patternEdge.target].node;\n if (patternSource[nodeLabelProp] === sourceLabel && patternTarget[nodeLabelProp] === targetLabel) edgeMatched = true;\n if (!directed && patternSource[nodeLabelProp] === targetLabel && patternTarget[nodeLabelProp] === sourceLabel) edgeMatched = true;\n });\n if (!edgeMatched) {\n edgeLabelCountMap[edgeLabel]--;\n // 若这个 label 的 count 减少之后,该 label 的边数不足,去除该图\n if (patternEdgesWithLabel && edgeLabelCountMap[edgeLabel] < patternEdgesWithLabel.length) {\n candidateGraphInvalid = true;\n return \"break\";\n }\n candidateEdges.splice(e, 1);\n candidateNodeMap[edge.source].degree--;\n candidateNodeMap[edge.target].degree--;\n candidateNodeMap[edge.source].outDegree--;\n candidateNodeMap[edge.target].inDegree--;\n return \"continue\";\n }\n };\n for (var e = candidateEdgeNum - 1; e >= 0; e--) {\n var state_2 = _loop_5(e);\n if (state_2 === \"break\") break;\n }\n // prune2: 删除边的过程中,发现边数过少/边 label 数过少时,去除该图\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n candidateGraph.edges = candidateEdges;\n var lengthsToCandidate = Object(_dijkstra__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(candidateGraph, candidateGraph.nodes[0].id, false).length;\n Object.keys(lengthsToCandidate).reverse().forEach(function (targetId) {\n if (targetId === candidateGraph.nodes[0].id || candidateGraphInvalid) return;\n // prune4: 通过上述裁剪,可能导致该邻居子图变为不连通。裁剪掉目前在这个邻居子图中和 candidate(第一个节点)不连通的节点\n if (lengthsToCandidate[targetId] === Infinity) {\n var targetNodeLabel = candidateNodeMap[targetId].node[nodeLabelProp];\n candidateNodeLabelCountMap[targetNodeLabel]--;\n if (candidateNodeLabelCountMap[targetNodeLabel] < patternNodeLabelMap[targetNodeLabel].length) {\n candidateGraphInvalid = true;\n return;\n }\n var idx = candidateGraph.nodes.indexOf(candidateNodeMap[targetId].node);\n candidateGraph.nodes.splice(idx, 1);\n candidateNodeMap[targetId] = undefined;\n return;\n }\n // prune5: 经过边裁剪后,可能又出现了最短路径过长的节点 (比 pattern 中同 label 的节点到 beginNode 最大最短距离远),删去这些节点\n var nLabel = nodeMap[targetId].node[nodeLabelProp];\n if (!undirectedLengthsToBeginPNodeLabelMap[nLabel] || !undirectedLengthsToBeginPNodeLabelMap[nLabel].length || lengthsToCandidate[targetId] > undirectedLengthsToBeginPNodeLabelMap[nLabel][undirectedLengthsToBeginPNodeLabelMap[nLabel].length - 1]) {\n var targetNodeLabel = candidateNodeMap[targetId].node[nodeLabelProp];\n candidateNodeLabelCountMap[targetNodeLabel]--;\n if (candidateNodeLabelCountMap[targetNodeLabel] < patternNodeLabelMap[targetNodeLabel].length) {\n candidateGraphInvalid = true;\n return;\n }\n var idx = candidateGraph.nodes.indexOf(candidateNodeMap[targetId].node);\n candidateGraph.nodes.splice(idx, 1);\n candidateNodeMap[targetId] = undefined;\n }\n });\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n var degreeChanged = true;\n var loopCount = 0;\n while (degreeChanged && !candidateGraphInvalid) {\n degreeChanged = false;\n // candidate 度数不足,删去该图\n var condition = directed ? candidateNodeMap[candidate.id].degree < patternNodeMap[beginPNode.id].degree || candidateNodeMap[candidate.id].inDegree < patternNodeMap[beginPNode.id].inDegree || candidateNodeMap[candidate.id].outDegree < patternNodeMap[beginPNode.id].outDegree : candidateNodeMap[candidate.id].degree < patternNodeMap[beginPNode.id].degree;\n if (condition) {\n candidateGraphInvalid = true;\n break;\n }\n // candidate label 个数不足,删去该图\n if (candidateNodeLabelCountMap[candidate[nodeLabelProp]] < patternNodeLabelMap[candidate[nodeLabelProp]].length) {\n candidateGraphInvalid = true;\n break;\n }\n // prune6:去除度数过小的节点\n var currentCandidateNodeNum = candidateGraph.nodes.length;\n for (var o = currentCandidateNodeNum - 1; o >= 0; o--) {\n var cgNode = candidateGraph.nodes[o];\n var nodeDegree = candidateNodeMap[cgNode.id].degree;\n var nodeInDegree = candidateNodeMap[cgNode.id].inDegree;\n var nodeOutDegree = candidateNodeMap[cgNode.id].outDegree;\n var cNodeLabel = cgNode[nodeLabelProp];\n var _e = stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, cNodeLabel, patternNodeMap, patternNodeLabelMap),\n minPatternNodeLabelDegree = _e.minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree = _e.minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree = _e.minPatternNodeLabelOutDegree;\n var deleteCondition = directed ? nodeDegree < minPatternNodeLabelDegree || nodeInDegree < minPatternNodeLabelInDegree || nodeOutDegree < minPatternNodeLabelOutDegree : nodeDegree < minPatternNodeLabelDegree;\n if (deleteCondition) {\n candidateNodeLabelCountMap[cgNode[nodeLabelProp]]--;\n // 节点 label 个数不足\n if (candidateNodeLabelCountMap[cgNode[nodeLabelProp]] < patternNodeLabelMap[cgNode[nodeLabelProp]].length) {\n candidateGraphInvalid = true;\n break;\n }\n candidateGraph.nodes.splice(o, 1);\n candidateNodeMap[cgNode.id] = undefined;\n degreeChanged = true;\n }\n }\n if (candidateGraphInvalid || !degreeChanged && loopCount !== 0) break;\n // 经过 prune5 节点裁剪,删去端点已经不在 candidateGraph 中的边\n candidateEdgeNum = candidateEdges.length;\n for (var y = candidateEdgeNum - 1; y >= 0; y--) {\n var cedge = candidateEdges[y];\n if (!candidateNodeMap[cedge.source] || !candidateNodeMap[cedge.target]) {\n candidateEdges.splice(y, 1);\n var edgeLabel = cedge[edgeLabelProp];\n edgeLabelCountMap[edgeLabel]--;\n if (candidateNodeMap[cedge.source]) {\n candidateNodeMap[cedge.source].degree--;\n candidateNodeMap[cedge.source].outDegree--;\n }\n if (candidateNodeMap[cedge.target]) {\n candidateNodeMap[cedge.target].degree--;\n candidateNodeMap[cedge.target].inDegree--;\n }\n // 边 label 数量不足\n if (patternEdgeLabelMap[edgeLabel] && edgeLabelCountMap[edgeLabel] < patternEdgeLabelMap[edgeLabel].length) {\n candidateGraphInvalid = true;\n break;\n }\n degreeChanged = true;\n }\n }\n loopCount++;\n }\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n // prune: 若节点/边数过少,节点/边 label 过少,去掉这个图\n if (candidateGraphInvalid || candidateGraph.nodes.length < pattern.nodes.length || candidateEdges.length < pattern.edges.length) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n };\n for (var i = candidateGraphNum - 1; i >= 0; i--) {\n var state_1 = _loop_2(i);\n if (state_1 === \"break\") break;\n }\n // 此时已经生成的多个 candidateGraphs,可能有重复\n // console.log(\n // \"----- stage5: going to splice dulplicated candidate graphs -------\"\n // );\n // 删去 candidateGraphs 中一模一样的子图,通过边的 node-node-edgeLabel 作为 key,这类边个数作为 value,进行匹配\n var currentLength = candidateGraphs.length;\n var _loop_3 = function _loop_3(i) {\n var cg1 = candidateGraphs[i];\n var cg1EdgeMap = {}; // [node1.id-node2.id-edge.label]: count\n cg1.edges.forEach(function (edge) {\n var key = \"\".concat(edge.source, \"-\").concat(edge.target, \"-\").concat(edge.label);\n if (!cg1EdgeMap[key]) cg1EdgeMap[key] = 1;else cg1EdgeMap[key]++;\n });\n var _loop_6 = function _loop_6(j) {\n var cg2 = candidateGraphs[j];\n var cg2EdgeMap = {}; // [node1.id-node2.id-edge.label]: count\n cg2.edges.forEach(function (edge) {\n var key = \"\".concat(edge.source, \"-\").concat(edge.target, \"-\").concat(edge.label);\n if (!cg2EdgeMap[key]) cg2EdgeMap[key] = 1;else cg2EdgeMap[key]++;\n });\n var same = true;\n if (Object.keys(cg2EdgeMap).length !== Object.keys(cg1EdgeMap).length) {\n same = false;\n } else {\n Object.keys(cg1EdgeMap).forEach(function (key) {\n if (cg2EdgeMap[key] !== cg1EdgeMap[key]) same = false;\n });\n }\n if (same) {\n candidateGraphs.splice(j, 1);\n }\n };\n for (var j = currentLength - 1; j > i; j--) {\n _loop_6(j);\n }\n currentLength = candidateGraphs.length;\n };\n for (var i = 0; i <= currentLength - 1; i++) {\n _loop_3(i);\n }\n return candidateGraphs;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (GADDI);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/gaddi.js?"); /***/ }), @@ -188,7 +188,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tsli /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _louvain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./louvain */ \"./node_modules/@antv/algorithm/es/louvain.js\");\n\n/**\n * 社区发现 i-louvain 算法:模块度 + 惯性模块度(即节点属性相似性)\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param threshold 差值阈值\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n * @param inertialWeight 惯性模块度权重\n */\n\nvar iLouvain = function iLouvain(graphData, directed, weightPropertyName, threshold, propertyKey, involvedKeys, uninvolvedKeys, inertialWeight) {\n if (directed === void 0) {\n directed = false;\n }\n\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n\n if (threshold === void 0) {\n threshold = 0.0001;\n }\n\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = ['id'];\n }\n\n if (inertialWeight === void 0) {\n inertialWeight = 1;\n }\n\n return Object(_louvain__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, directed, weightPropertyName, threshold, true, propertyKey, involvedKeys, uninvolvedKeys, inertialWeight);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (iLouvain);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/i-louvain.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _louvain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./louvain */ \"./node_modules/@antv/algorithm/es/louvain.js\");\n\n/**\n * 社区发现 i-louvain 算法:模块度 + 惯性模块度(即节点属性相似性)\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param threshold 差值阈值\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n * @param inertialWeight 惯性模块度权重\n */\nvar iLouvain = function iLouvain(graphData, directed, weightPropertyName, threshold, propertyKey, involvedKeys, uninvolvedKeys, inertialWeight) {\n if (directed === void 0) {\n directed = false;\n }\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n if (threshold === void 0) {\n threshold = 0.0001;\n }\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = ['id'];\n }\n if (inertialWeight === void 0) {\n inertialWeight = 1;\n }\n return Object(_louvain__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, directed, weightPropertyName, threshold, true, propertyKey, involvedKeys, uninvolvedKeys, inertialWeight);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (iLouvain);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/i-louvain.js?"); /***/ }), @@ -212,7 +212,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _degree__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./degree */ \"./node_modules/@antv/algorithm/es/degree.js\");\n\n\n/**\n * k-core算法 找出符合指定核心度的紧密关联的子图结构\n * @param graphData 图数据\n * @param k 核心度数\n */\n\nvar kCore = function kCore(graphData, k) {\n var _a;\n\n if (k === void 0) {\n k = 1;\n }\n\n var data = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(graphData);\n var _b = data.nodes,\n nodes = _b === void 0 ? [] : _b;\n var _c = data.edges,\n edges = _c === void 0 ? [] : _c;\n\n var _loop_1 = function _loop_1() {\n // 获取图中节点的度数\n var degrees = Object(_degree__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n nodes: nodes,\n edges: edges\n });\n var nodeIds = Object.keys(degrees); // 按照度数进行排序\n\n nodeIds.sort(function (a, b) {\n var _a, _b;\n\n return ((_a = degrees[a]) === null || _a === void 0 ? void 0 : _a.degree) - ((_b = degrees[b]) === null || _b === void 0 ? void 0 : _b.degree);\n });\n var minIndexId = nodeIds[0];\n\n if (!nodes.length || ((_a = degrees[minIndexId]) === null || _a === void 0 ? void 0 : _a.degree) >= k) {\n return \"break\";\n }\n\n var originIndex = nodes.findIndex(function (node) {\n return node.id === minIndexId;\n }); // 移除度数小于k的节点\n\n nodes.splice(originIndex, 1); // 移除度数小于k的节点相关的边\n\n edges = edges.filter(function (edge) {\n return !(edge.source === minIndexId || edge.target === minIndexId);\n });\n };\n\n while (true) {\n var state_1 = _loop_1();\n\n if (state_1 === \"break\") break;\n }\n\n return {\n nodes: nodes,\n edges: edges\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (kCore);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/k-core.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _degree__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./degree */ \"./node_modules/@antv/algorithm/es/degree.js\");\n\n\n/**\n * k-core算法 找出符合指定核心度的紧密关联的子图结构\n * @param graphData 图数据\n * @param k 核心度数\n */\nvar kCore = function kCore(graphData, k) {\n var _a;\n if (k === void 0) {\n k = 1;\n }\n var data = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(graphData);\n var _b = data.nodes,\n nodes = _b === void 0 ? [] : _b;\n var _c = data.edges,\n edges = _c === void 0 ? [] : _c;\n var _loop_1 = function _loop_1() {\n // 获取图中节点的度数\n var degrees = Object(_degree__WEBPACK_IMPORTED_MODULE_1__[\"default\"])({\n nodes: nodes,\n edges: edges\n });\n var nodeIds = Object.keys(degrees);\n // 按照度数进行排序\n nodeIds.sort(function (a, b) {\n var _a, _b;\n return ((_a = degrees[a]) === null || _a === void 0 ? void 0 : _a.degree) - ((_b = degrees[b]) === null || _b === void 0 ? void 0 : _b.degree);\n });\n var minIndexId = nodeIds[0];\n if (!nodes.length || ((_a = degrees[minIndexId]) === null || _a === void 0 ? void 0 : _a.degree) >= k) {\n return \"break\";\n }\n var originIndex = nodes.findIndex(function (node) {\n return node.id === minIndexId;\n });\n // 移除度数小于k的节点\n nodes.splice(originIndex, 1);\n // 移除度数小于k的节点相关的边\n edges = edges.filter(function (edge) {\n return !(edge.source === minIndexId || edge.target === minIndexId);\n });\n };\n while (true) {\n var state_1 = _loop_1();\n if (state_1 === \"break\") break;\n }\n return {\n nodes: nodes,\n edges: edges\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (kCore);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/k-core.js?"); /***/ }), @@ -224,7 +224,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ant /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _utils_node_properties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/node-properties */ \"./node_modules/@antv/algorithm/es/utils/node-properties.js\");\n/* harmony import */ var _utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/data-preprocessing */ \"./node_modules/@antv/algorithm/es/utils/data-preprocessing.js\");\n/* harmony import */ var _utils_vector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/vector */ \"./node_modules/@antv/algorithm/es/utils/vector.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/algorithm/es/types.js\");\n\n\n\n\n // 获取质心\n\nvar getCentroid = function getCentroid(distanceType, allPropertiesWeight, index) {\n var centroid = [];\n\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance:\n centroid = allPropertiesWeight[index];\n break;\n\n default:\n centroid = [];\n break;\n }\n\n return centroid;\n};\n/**\n * k-means算法 根据节点之间的距离将节点聚类为K个簇\n * @param data 图数据\n * @param k 质心(聚类中心)个数\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n * @param distanceType 距离类型 默认节点属性的欧式距离\n */\n\n\nvar kMeans = function kMeans(data, k, propertyKey, involvedKeys, uninvolvedKeys, distanceType) {\n if (k === void 0) {\n k = 3;\n }\n\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = ['id'];\n }\n\n if (distanceType === void 0) {\n distanceType = _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance;\n }\n\n var _a = data.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = data.edges,\n edges = _b === void 0 ? [] : _b;\n var defaultClusterInfo = {\n clusters: [{\n id: \"0\",\n nodes: nodes\n }],\n clusterEdges: []\n }; // 距离类型为欧式距离且没有属性时,直接return\n\n if (distanceType === _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance && !nodes.every(function (node) {\n return node.hasOwnProperty(propertyKey);\n })) {\n return defaultClusterInfo;\n } // 所有节点属性集合\n\n\n var properties = []; // 所有节点属性one-hot特征向量集合\n\n var allPropertiesWeight = [];\n\n if (distanceType === _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance) {\n properties = Object(_utils_node_properties__WEBPACK_IMPORTED_MODULE_1__[\"getAllProperties\"])(nodes, propertyKey);\n allPropertiesWeight = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__[\"oneHot\"])(properties, involvedKeys, uninvolvedKeys);\n }\n\n if (!allPropertiesWeight.length) {\n return defaultClusterInfo;\n }\n\n var allPropertiesWeightUniq = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"uniq\"])(allPropertiesWeight.map(function (item) {\n return item.join('');\n })); // 当输入节点数量或者属性集合的长度小于k时,k调整为其中最小的值\n\n var finalK = Math.min(k, nodes.length, allPropertiesWeightUniq.length); // 记录节点的原始index,与allPropertiesWeight对应\n\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].originIndex = i;\n } // 初始化质心(聚类中心)\n\n\n var centroids = [];\n var centroidIndexList = [];\n var clusters = [];\n\n for (var i = 0; i < finalK; i++) {\n if (i === 0) {\n // 随机选取质心(聚类中心)\n var randomIndex = Math.floor(Math.random() * nodes.length);\n\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance:\n centroids[i] = allPropertiesWeight[randomIndex];\n break;\n\n default:\n centroids[i] = [];\n break;\n }\n\n centroidIndexList.push(randomIndex);\n clusters[i] = [nodes[randomIndex]];\n nodes[randomIndex].clusterId = String(i);\n } else {\n var maxDistance = -Infinity;\n var maxDistanceNodeIndex = 0;\n\n var _loop_1 = function _loop_1(m) {\n if (!centroidIndexList.includes(m)) {\n var totalDistance = 0;\n\n for (var j = 0; j < centroids.length; j++) {\n // 求节点到质心的距离(默认节点属性的欧式距离)\n var distance = 0;\n\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance:\n distance = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__[\"getDistance\"])(allPropertiesWeight[nodes[m].originIndex], centroids[j], distanceType);\n break;\n\n default:\n break;\n }\n\n totalDistance += distance;\n } // 节点到各质心的平均距离(默认欧式距离)\n\n\n var avgDistance = totalDistance / centroids.length; // 记录到已有质心最远的的距离和节点索引\n\n if (avgDistance > maxDistance && !centroids.find(function (centroid) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isEqual\"])(centroid, getCentroid(distanceType, allPropertiesWeight, nodes[m].originIndex));\n })) {\n maxDistance = avgDistance;\n maxDistanceNodeIndex = m;\n }\n }\n }; // 选取与已有质心平均距离最远的点做为新的质心\n\n\n for (var m = 0; m < nodes.length; m++) {\n _loop_1(m);\n }\n\n centroids[i] = getCentroid(distanceType, allPropertiesWeight, maxDistanceNodeIndex);\n centroidIndexList.push(maxDistanceNodeIndex);\n clusters[i] = [nodes[maxDistanceNodeIndex]];\n nodes[maxDistanceNodeIndex].clusterId = String(i);\n }\n }\n\n var iterations = 0;\n\n while (true) {\n for (var i = 0; i < nodes.length; i++) {\n var minDistanceIndex = 0;\n var minDistance = Infinity;\n\n if (!(iterations === 0 && centroidIndexList.includes(i))) {\n for (var j = 0; j < centroids.length; j++) {\n // 求节点到质心的距离(默认节点属性的欧式距离)\n var distance = 0;\n\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance:\n distance = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__[\"getDistance\"])(allPropertiesWeight[i], centroids[j], distanceType);\n break;\n\n default:\n break;\n } // 记录节点最近的质心的索引\n\n\n if (distance < minDistance) {\n minDistance = distance;\n minDistanceIndex = j;\n }\n } // 从原来的类别删除节点\n\n\n if (nodes[i].clusterId !== undefined) {\n for (var n = clusters[Number(nodes[i].clusterId)].length - 1; n >= 0; n--) {\n if (clusters[Number(nodes[i].clusterId)][n].id === nodes[i].id) {\n clusters[Number(nodes[i].clusterId)].splice(n, 1);\n }\n }\n } // 将节点划分到距离最小的质心(聚类中心)所对应的类中\n\n\n nodes[i].clusterId = String(minDistanceIndex);\n clusters[minDistanceIndex].push(nodes[i]);\n }\n } // 是否存在质心(聚类中心)移动\n\n\n var centroidsEqualAvg = false;\n\n for (var i = 0; i < clusters.length; i++) {\n var clusterNodes = clusters[i];\n var totalVector = new _utils_vector__WEBPACK_IMPORTED_MODULE_3__[\"default\"]([]);\n\n for (var j = 0; j < clusterNodes.length; j++) {\n totalVector = totalVector.add(new _utils_vector__WEBPACK_IMPORTED_MODULE_3__[\"default\"](allPropertiesWeight[clusterNodes[j].originIndex]));\n } // 计算每个类别的均值向量\n\n\n var avgVector = totalVector.avg(clusterNodes.length); // 如果均值向量不等于质心向量\n\n if (!avgVector.equal(new _utils_vector__WEBPACK_IMPORTED_MODULE_3__[\"default\"](centroids[i]))) {\n centroidsEqualAvg = true; // 移动/更新每个类别的质心(聚类中心)到该均值向量\n\n centroids[i] = avgVector.getArr();\n }\n }\n\n iterations++; // 如果每个节点都归属了类别,且不存在质心(聚类中心)移动或者迭代次数超过1000,则停止\n\n if (nodes.every(function (node) {\n return node.clusterId !== undefined;\n }) && centroidsEqualAvg || iterations >= 1000) {\n break;\n }\n } // get the cluster edges\n\n\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var _a, _b;\n\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = (_a = nodes.find(function (node) {\n return node.id === source;\n })) === null || _a === void 0 ? void 0 : _a.clusterId;\n var targetClusterId = (_b = nodes.find(function (node) {\n return node.id === target;\n })) === null || _b === void 0 ? void 0 : _b.clusterId;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n return {\n clusters: clusters,\n clusterEdges: clusterEdges\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (kMeans);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/k-means.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _utils_node_properties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/node-properties */ \"./node_modules/@antv/algorithm/es/utils/node-properties.js\");\n/* harmony import */ var _utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/data-preprocessing */ \"./node_modules/@antv/algorithm/es/utils/data-preprocessing.js\");\n/* harmony import */ var _utils_vector__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/vector */ \"./node_modules/@antv/algorithm/es/utils/vector.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/algorithm/es/types.js\");\n\n\n\n\n\n// 获取质心\nvar getCentroid = function getCentroid(distanceType, allPropertiesWeight, index) {\n var centroid = [];\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance:\n centroid = allPropertiesWeight[index];\n break;\n default:\n centroid = [];\n break;\n }\n return centroid;\n};\n/**\n * k-means算法 根据节点之间的距离将节点聚类为K个簇\n * @param data 图数据\n * @param k 质心(聚类中心)个数\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n * @param distanceType 距离类型 默认节点属性的欧式距离\n */\nvar kMeans = function kMeans(data, k, propertyKey, involvedKeys, uninvolvedKeys, distanceType) {\n if (k === void 0) {\n k = 3;\n }\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = ['id'];\n }\n if (distanceType === void 0) {\n distanceType = _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance;\n }\n var _a = data.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = data.edges,\n edges = _b === void 0 ? [] : _b;\n var defaultClusterInfo = {\n clusters: [{\n id: \"0\",\n nodes: nodes\n }],\n clusterEdges: []\n };\n // 距离类型为欧式距离且没有属性时,直接return\n if (distanceType === _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance && !nodes.every(function (node) {\n return node.hasOwnProperty(propertyKey);\n })) {\n return defaultClusterInfo;\n }\n // 所有节点属性集合\n var properties = [];\n // 所有节点属性one-hot特征向量集合\n var allPropertiesWeight = [];\n if (distanceType === _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance) {\n properties = Object(_utils_node_properties__WEBPACK_IMPORTED_MODULE_1__[\"getAllProperties\"])(nodes, propertyKey);\n allPropertiesWeight = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__[\"oneHot\"])(properties, involvedKeys, uninvolvedKeys);\n }\n if (!allPropertiesWeight.length) {\n return defaultClusterInfo;\n }\n var allPropertiesWeightUniq = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"uniq\"])(allPropertiesWeight.map(function (item) {\n return item.join('');\n }));\n // 当输入节点数量或者属性集合的长度小于k时,k调整为其中最小的值\n var finalK = Math.min(k, nodes.length, allPropertiesWeightUniq.length);\n // 记录节点的原始index,与allPropertiesWeight对应\n for (var i = 0; i < nodes.length; i++) {\n nodes[i].originIndex = i;\n }\n // 初始化质心(聚类中心)\n var centroids = [];\n var centroidIndexList = [];\n var clusters = [];\n for (var i = 0; i < finalK; i++) {\n if (i === 0) {\n // 随机选取质心(聚类中心)\n var randomIndex = Math.floor(Math.random() * nodes.length);\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance:\n centroids[i] = allPropertiesWeight[randomIndex];\n break;\n default:\n centroids[i] = [];\n break;\n }\n centroidIndexList.push(randomIndex);\n clusters[i] = [nodes[randomIndex]];\n nodes[randomIndex].clusterId = String(i);\n } else {\n var maxDistance = -Infinity;\n var maxDistanceNodeIndex = 0;\n var _loop_1 = function _loop_1(m) {\n if (!centroidIndexList.includes(m)) {\n var totalDistance = 0;\n for (var j = 0; j < centroids.length; j++) {\n // 求节点到质心的距离(默认节点属性的欧式距离)\n var distance = 0;\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance:\n distance = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__[\"getDistance\"])(allPropertiesWeight[nodes[m].originIndex], centroids[j], distanceType);\n break;\n default:\n break;\n }\n totalDistance += distance;\n }\n // 节点到各质心的平均距离(默认欧式距离)\n var avgDistance = totalDistance / centroids.length;\n // 记录到已有质心最远的的距离和节点索引\n if (avgDistance > maxDistance && !centroids.find(function (centroid) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isEqual\"])(centroid, getCentroid(distanceType, allPropertiesWeight, nodes[m].originIndex));\n })) {\n maxDistance = avgDistance;\n maxDistanceNodeIndex = m;\n }\n }\n };\n // 选取与已有质心平均距离最远的点做为新的质心\n for (var m = 0; m < nodes.length; m++) {\n _loop_1(m);\n }\n centroids[i] = getCentroid(distanceType, allPropertiesWeight, maxDistanceNodeIndex);\n centroidIndexList.push(maxDistanceNodeIndex);\n clusters[i] = [nodes[maxDistanceNodeIndex]];\n nodes[maxDistanceNodeIndex].clusterId = String(i);\n }\n }\n var iterations = 0;\n while (true) {\n for (var i = 0; i < nodes.length; i++) {\n var minDistanceIndex = 0;\n var minDistance = Infinity;\n if (!(iterations === 0 && centroidIndexList.includes(i))) {\n for (var j = 0; j < centroids.length; j++) {\n // 求节点到质心的距离(默认节点属性的欧式距离)\n var distance = 0;\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_4__[\"DistanceType\"].EuclideanDistance:\n distance = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__[\"getDistance\"])(allPropertiesWeight[i], centroids[j], distanceType);\n break;\n default:\n break;\n }\n // 记录节点最近的质心的索引\n if (distance < minDistance) {\n minDistance = distance;\n minDistanceIndex = j;\n }\n }\n // 从原来的类别删除节点\n if (nodes[i].clusterId !== undefined) {\n for (var n = clusters[Number(nodes[i].clusterId)].length - 1; n >= 0; n--) {\n if (clusters[Number(nodes[i].clusterId)][n].id === nodes[i].id) {\n clusters[Number(nodes[i].clusterId)].splice(n, 1);\n }\n }\n }\n // 将节点划分到距离最小的质心(聚类中心)所对应的类中\n nodes[i].clusterId = String(minDistanceIndex);\n clusters[minDistanceIndex].push(nodes[i]);\n }\n }\n // 是否存在质心(聚类中心)移动\n var centroidsEqualAvg = false;\n for (var i = 0; i < clusters.length; i++) {\n var clusterNodes = clusters[i];\n var totalVector = new _utils_vector__WEBPACK_IMPORTED_MODULE_3__[\"default\"]([]);\n for (var j = 0; j < clusterNodes.length; j++) {\n totalVector = totalVector.add(new _utils_vector__WEBPACK_IMPORTED_MODULE_3__[\"default\"](allPropertiesWeight[clusterNodes[j].originIndex]));\n }\n // 计算每个类别的均值向量\n var avgVector = totalVector.avg(clusterNodes.length);\n // 如果均值向量不等于质心向量\n if (!avgVector.equal(new _utils_vector__WEBPACK_IMPORTED_MODULE_3__[\"default\"](centroids[i]))) {\n centroidsEqualAvg = true;\n // 移动/更新每个类别的质心(聚类中心)到该均值向量\n centroids[i] = avgVector.getArr();\n }\n }\n iterations++;\n // 如果每个节点都归属了类别,且不存在质心(聚类中心)移动或者迭代次数超过1000,则停止\n if (nodes.every(function (node) {\n return node.clusterId !== undefined;\n }) && centroidsEqualAvg || iterations >= 1000) {\n break;\n }\n }\n // get the cluster edges\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var _a, _b;\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = (_a = nodes.find(function (node) {\n return node.id === source;\n })) === null || _a === void 0 ? void 0 : _a.clusterId;\n var targetClusterId = (_b = nodes.find(function (node) {\n return node.id === target;\n })) === null || _b === void 0 ? void 0 : _b.clusterId;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n return {\n clusters: clusters,\n clusterEdges: clusterEdges\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (kMeans);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/k-means.js?"); /***/ }), @@ -236,7 +236,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ant /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adjacent_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/es/adjacent-matrix.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n/**\n * 标签传播算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param maxIteration 最大迭代次数\n */\n\nvar labelPropagation = function labelPropagation(graphData, directed, weightPropertyName, maxIteration) {\n if (directed === void 0) {\n directed = false;\n }\n\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n\n if (maxIteration === void 0) {\n maxIteration = 1000;\n } // the origin data\n\n\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var clusters = {};\n var nodeMap = {}; // init the clusters and nodeMap\n\n nodes.forEach(function (node, i) {\n var cid = Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"uniqueId\"])();\n node.clusterId = cid;\n clusters[cid] = {\n id: cid,\n nodes: [node]\n };\n nodeMap[node.id] = {\n node: node,\n idx: i\n };\n }); // the adjacent matrix of calNodes inside clusters\n\n var adjMatrix = Object(_adjacent_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, directed); // the sum of each row in adjacent matrix\n\n var ks = [];\n /**\n * neighbor nodes (id for key and weight for value) for each node\n * neighbors = {\n * id(node_id): { id(neighbor_1_id): weight(weight of the edge), id(neighbor_2_id): weight(weight of the edge), ... },\n * ...\n * }\n */\n\n var neighbors = {};\n adjMatrix.forEach(function (row, i) {\n var k = 0;\n var iid = nodes[i].id;\n neighbors[iid] = {};\n row.forEach(function (entry, j) {\n if (!entry) return;\n k += entry;\n var jid = nodes[j].id;\n neighbors[iid][jid] = entry;\n });\n ks.push(k);\n });\n var iter = 0;\n\n var _loop_1 = function _loop_1() {\n var changed = false;\n nodes.forEach(function (node) {\n var neighborClusters = {};\n Object.keys(neighbors[node.id]).forEach(function (neighborId) {\n var neighborWeight = neighbors[node.id][neighborId];\n var neighborNode = nodeMap[neighborId].node;\n var neighborClusterId = neighborNode.clusterId;\n if (!neighborClusters[neighborClusterId]) neighborClusters[neighborClusterId] = 0;\n neighborClusters[neighborClusterId] += neighborWeight;\n }); // find the cluster with max weight\n\n var maxWeight = -Infinity;\n var bestClusterIds = [];\n Object.keys(neighborClusters).forEach(function (clusterId) {\n if (maxWeight < neighborClusters[clusterId]) {\n maxWeight = neighborClusters[clusterId];\n bestClusterIds = [clusterId];\n } else if (maxWeight === neighborClusters[clusterId]) {\n bestClusterIds.push(clusterId);\n }\n });\n if (bestClusterIds.length === 1 && bestClusterIds[0] === node.clusterId) return;\n var selfClusterIdx = bestClusterIds.indexOf(node.clusterId);\n if (selfClusterIdx >= 0) bestClusterIds.splice(selfClusterIdx, 1);\n\n if (bestClusterIds && bestClusterIds.length) {\n changed = true; // remove from origin cluster\n\n var selfCluster = clusters[node.clusterId];\n var nodeInSelfClusterIdx = selfCluster.nodes.indexOf(node);\n selfCluster.nodes.splice(nodeInSelfClusterIdx, 1); // move the node to the best cluster\n\n var randomIdx = Math.floor(Math.random() * bestClusterIds.length);\n var bestCluster = clusters[bestClusterIds[randomIdx]];\n bestCluster.nodes.push(node);\n node.clusterId = bestCluster.id;\n }\n });\n if (!changed) return \"break\";\n iter++;\n };\n\n while (iter < maxIteration) {\n var state_1 = _loop_1();\n\n if (state_1 === \"break\") break;\n } // delete the empty clusters\n\n\n Object.keys(clusters).forEach(function (clusterId) {\n var cluster = clusters[clusterId];\n\n if (!cluster.nodes || !cluster.nodes.length) {\n delete clusters[clusterId];\n }\n }); // get the cluster edges\n\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var weight = edge[weightPropertyName] || 1;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].weight += weight;\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n weight: weight,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n var clustersArray = [];\n Object.keys(clusters).forEach(function (clusterId) {\n clustersArray.push(clusters[clusterId]);\n });\n return {\n clusters: clustersArray,\n clusterEdges: clusterEdges\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (labelPropagation);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/label-propagation.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adjacent_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/es/adjacent-matrix.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n/**\n * 标签传播算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param maxIteration 最大迭代次数\n */\nvar labelPropagation = function labelPropagation(graphData, directed, weightPropertyName, maxIteration) {\n if (directed === void 0) {\n directed = false;\n }\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n if (maxIteration === void 0) {\n maxIteration = 1000;\n }\n // the origin data\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var clusters = {};\n var nodeMap = {};\n // init the clusters and nodeMap\n nodes.forEach(function (node, i) {\n var cid = Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"uniqueId\"])();\n node.clusterId = cid;\n clusters[cid] = {\n id: cid,\n nodes: [node]\n };\n nodeMap[node.id] = {\n node: node,\n idx: i\n };\n });\n // the adjacent matrix of calNodes inside clusters\n var adjMatrix = Object(_adjacent_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData, directed);\n // the sum of each row in adjacent matrix\n var ks = [];\n /**\n * neighbor nodes (id for key and weight for value) for each node\n * neighbors = {\n * id(node_id): { id(neighbor_1_id): weight(weight of the edge), id(neighbor_2_id): weight(weight of the edge), ... },\n * ...\n * }\n */\n var neighbors = {};\n adjMatrix.forEach(function (row, i) {\n var k = 0;\n var iid = nodes[i].id;\n neighbors[iid] = {};\n row.forEach(function (entry, j) {\n if (!entry) return;\n k += entry;\n var jid = nodes[j].id;\n neighbors[iid][jid] = entry;\n });\n ks.push(k);\n });\n var iter = 0;\n var _loop_1 = function _loop_1() {\n var changed = false;\n nodes.forEach(function (node) {\n var neighborClusters = {};\n Object.keys(neighbors[node.id]).forEach(function (neighborId) {\n var neighborWeight = neighbors[node.id][neighborId];\n var neighborNode = nodeMap[neighborId].node;\n var neighborClusterId = neighborNode.clusterId;\n if (!neighborClusters[neighborClusterId]) neighborClusters[neighborClusterId] = 0;\n neighborClusters[neighborClusterId] += neighborWeight;\n });\n // find the cluster with max weight\n var maxWeight = -Infinity;\n var bestClusterIds = [];\n Object.keys(neighborClusters).forEach(function (clusterId) {\n if (maxWeight < neighborClusters[clusterId]) {\n maxWeight = neighborClusters[clusterId];\n bestClusterIds = [clusterId];\n } else if (maxWeight === neighborClusters[clusterId]) {\n bestClusterIds.push(clusterId);\n }\n });\n if (bestClusterIds.length === 1 && bestClusterIds[0] === node.clusterId) return;\n var selfClusterIdx = bestClusterIds.indexOf(node.clusterId);\n if (selfClusterIdx >= 0) bestClusterIds.splice(selfClusterIdx, 1);\n if (bestClusterIds && bestClusterIds.length) {\n changed = true;\n // remove from origin cluster\n var selfCluster = clusters[node.clusterId];\n var nodeInSelfClusterIdx = selfCluster.nodes.indexOf(node);\n selfCluster.nodes.splice(nodeInSelfClusterIdx, 1);\n // move the node to the best cluster\n var randomIdx = Math.floor(Math.random() * bestClusterIds.length);\n var bestCluster = clusters[bestClusterIds[randomIdx]];\n bestCluster.nodes.push(node);\n node.clusterId = bestCluster.id;\n }\n });\n if (!changed) return \"break\";\n iter++;\n };\n while (iter < maxIteration) {\n var state_1 = _loop_1();\n if (state_1 === \"break\") break;\n }\n // delete the empty clusters\n Object.keys(clusters).forEach(function (clusterId) {\n var cluster = clusters[clusterId];\n if (!cluster.nodes || !cluster.nodes.length) {\n delete clusters[clusterId];\n }\n });\n // get the cluster edges\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var weight = edge[weightPropertyName] || 1;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].weight += weight;\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n weight: weight,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n var clustersArray = [];\n Object.keys(clusters).forEach(function (clusterId) {\n clustersArray.push(clusters[clusterId]);\n });\n return {\n clusters: clustersArray,\n clusterEdges: clusterEdges\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (labelPropagation);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/label-propagation.js?"); /***/ }), @@ -248,7 +248,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _adj /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _adjacent_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/es/adjacent-matrix.js\");\n/* harmony import */ var _utils_vector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/vector */ \"./node_modules/@antv/algorithm/es/utils/vector.js\");\n/* harmony import */ var _utils_node_properties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/node-properties */ \"./node_modules/@antv/algorithm/es/utils/node-properties.js\");\n/* harmony import */ var _utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/data-preprocessing */ \"./node_modules/@antv/algorithm/es/utils/data-preprocessing.js\");\n\n\n\n\n\n\nvar getModularity = function getModularity(nodes, adjMatrix, ks, m) {\n var length = adjMatrix.length;\n var param = 2 * m;\n var modularity = 0;\n\n for (var i = 0; i < length; i++) {\n var clusteri = nodes[i].clusterId;\n\n for (var j = 0; j < length; j++) {\n var clusterj = nodes[j].clusterId;\n if (clusteri !== clusterj) continue;\n var entry = adjMatrix[i][j] || 0;\n var ki = ks[i] || 0;\n var kj = ks[j] || 0;\n modularity += entry - ki * kj / param;\n }\n }\n\n modularity *= 1 / param;\n return modularity;\n}; // 模块惯性度,衡量属性相似度\n\n\nvar getInertialModularity = function getInertialModularity(nodes, allPropertiesWeight) {\n if (nodes === void 0) {\n nodes = [];\n }\n\n var length = nodes.length;\n var totalProperties = new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"]([]);\n\n for (var i = 0; i < length; i++) {\n totalProperties = totalProperties.add(new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](allPropertiesWeight[i]));\n } // 均值向量\n\n\n var avgProperties = totalProperties.avg(length);\n avgProperties.normalize(); // 节点集合的方差: 节点v与均值向量的平方欧式距离之和\n\n var variance = 0;\n\n for (var i = 0; i < length; i++) {\n var propertiesi = new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](allPropertiesWeight[i]);\n var squareEuclideanDistance = propertiesi.squareEuclideanDistance(avgProperties);\n variance += squareEuclideanDistance;\n } // 任意两点间的欧式平方距离\n\n\n var squareEuclideanDistanceInfo = [];\n nodes.forEach(function () {\n squareEuclideanDistanceInfo.push([]);\n });\n\n for (var i = 0; i < length; i++) {\n var propertiesi = new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](allPropertiesWeight[i]);\n nodes[i]['clusterInertial'] = 0;\n\n for (var j = 0; j < length; j++) {\n if (i === j) {\n squareEuclideanDistanceInfo[i][j] = 0;\n continue;\n }\n\n var propertiesj = new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](allPropertiesWeight[j]);\n squareEuclideanDistanceInfo[i][j] = propertiesi.squareEuclideanDistance(propertiesj);\n nodes[i]['clusterInertial'] += squareEuclideanDistanceInfo[i][j];\n }\n } // 计算模块惯性度\n\n\n var inertialModularity = 0;\n var param = 2 * length * variance;\n\n for (var i = 0; i < length; i++) {\n var clusteri = nodes[i].clusterId;\n\n for (var j = 0; j < length; j++) {\n var clusterj = nodes[j].clusterId;\n if (i === j || clusteri !== clusterj) continue;\n var inertial = nodes[i].clusterInertial * nodes[j].clusterInertial / Math.pow(param, 2) - squareEuclideanDistanceInfo[i][j] / param;\n inertialModularity += inertial;\n }\n }\n\n return Number(inertialModularity.toFixed(4));\n};\n/**\n * 社区发现 louvain 算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param threshold 差值阈值\n * @param inertialModularity 是否使用惯性模块度(即节点属性相似性)\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n * @param inertialWeight 惯性模块度权重\n */\n\n\nvar louvain = function louvain(graphData, directed, weightPropertyName, threshold, inertialModularity, propertyKey, involvedKeys, uninvolvedKeys, inertialWeight) {\n if (directed === void 0) {\n directed = false;\n }\n\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n\n if (threshold === void 0) {\n threshold = 0.0001;\n }\n\n if (inertialModularity === void 0) {\n inertialModularity = false;\n }\n\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = ['id'];\n }\n\n if (inertialWeight === void 0) {\n inertialWeight = 1;\n } // the origin data\n\n\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var allPropertiesWeight = [];\n\n if (inertialModularity) {\n nodes.forEach(function (node, index) {\n node.properties = node.properties || {};\n node.originIndex = index;\n });\n var nodeTypeInfo_1 = [];\n\n if (nodes.every(function (node) {\n return node.hasOwnProperty('nodeType');\n })) {\n nodeTypeInfo_1 = Array.from(new Set(nodes.map(function (node) {\n return node.nodeType;\n })));\n nodes.forEach(function (node) {\n node.properties.nodeType = nodeTypeInfo_1.findIndex(function (nodeType) {\n return nodeType === node.nodeType;\n });\n });\n } // 所有节点属性集合\n\n\n var properties = Object(_utils_node_properties__WEBPACK_IMPORTED_MODULE_3__[\"getAllProperties\"])(nodes, propertyKey); // 所有节点属性one-hot特征向量集合\n\n allPropertiesWeight = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_4__[\"oneHot\"])(properties, involvedKeys, uninvolvedKeys);\n }\n\n var uniqueId = 1;\n var clusters = {};\n var nodeMap = {}; // init the clusters and nodeMap\n\n nodes.forEach(function (node, i) {\n var cid = String(uniqueId++);\n node.clusterId = cid;\n clusters[cid] = {\n id: cid,\n nodes: [node]\n };\n nodeMap[node.id] = {\n node: node,\n idx: i\n };\n }); // the adjacent matrix of calNodes inside clusters\n\n var adjMatrix = Object(_adjacent_matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(graphData, directed); // the sum of each row in adjacent matrix\n\n var ks = [];\n /**\n * neighbor nodes (id for key and weight for value) for each node\n * neighbors = {\n * id(node_id): { id(neighbor_1_id): weight(weight of the edge), id(neighbor_2_id): weight(weight of the edge), ... },\n * ...\n * }\n */\n\n var neighbors = {}; // the sum of the weights of all edges in the graph\n\n var m = 0;\n adjMatrix.forEach(function (row, i) {\n var k = 0;\n var iid = nodes[i].id;\n neighbors[iid] = {};\n row.forEach(function (entry, j) {\n if (!entry) return;\n k += entry;\n var jid = nodes[j].id;\n neighbors[iid][jid] = entry;\n m += entry;\n });\n ks.push(k);\n });\n m /= 2;\n var totalModularity = Infinity;\n var previousModularity = Infinity;\n var iter = 0;\n var finalNodes = [];\n var finalClusters = {};\n\n while (true) {\n if (inertialModularity && nodes.every(function (node) {\n return node.hasOwnProperty('properties');\n })) {\n totalModularity = getModularity(nodes, adjMatrix, ks, m) + getInertialModularity(nodes, allPropertiesWeight) * inertialWeight;\n } else {\n totalModularity = getModularity(nodes, adjMatrix, ks, m);\n } // 第一次迭代previousModularity直接赋值\n\n\n if (iter === 0) {\n previousModularity = totalModularity;\n finalNodes = nodes;\n finalClusters = clusters;\n }\n\n var increaseWithinThreshold = totalModularity > 0 && totalModularity > previousModularity && totalModularity - previousModularity < threshold; // 总模块度增加才更新最优解\n\n if (totalModularity > previousModularity) {\n finalNodes = nodes.map(function (node) {\n return {\n node: node,\n clusterId: node.clusterId\n };\n });\n finalClusters = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(clusters);\n previousModularity = totalModularity;\n } // whether to terminate the iterations\n\n\n if (increaseWithinThreshold || iter > 100) {\n break;\n }\n\n ;\n iter++; // pre compute some values for current clusters\n\n Object.keys(clusters).forEach(function (clusterId) {\n // sum of weights of edges to nodes in cluster\n var sumTot = 0;\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n\n if (sourceClusterId === clusterId && targetClusterId !== clusterId || targetClusterId === clusterId && sourceClusterId !== clusterId) {\n sumTot = sumTot + (edge[weightPropertyName] || 1);\n }\n });\n clusters[clusterId].sumTot = sumTot;\n }); // move the nodes to increase the delta modularity\n\n nodes.forEach(function (node, i) {\n var selfCluster = clusters[node.clusterId];\n var bestIncrease = 0;\n var bestCluster;\n var commonParam = ks[i] / (2 * m); // sum of weights of edges from node to nodes in cluster\n\n var kiin = 0;\n var selfClusterNodes = selfCluster.nodes;\n selfClusterNodes.forEach(function (scNode) {\n var scNodeIdx = nodeMap[scNode.id].idx;\n kiin += adjMatrix[i][scNodeIdx] || 0;\n }); // the modurarity for **removing** the node i from the origin cluster of node i\n\n var removeModurarity = kiin - selfCluster.sumTot * commonParam; // nodes for **removing** node i into this neighbor cluster\n\n var selfClusterNodesAfterRemove = selfClusterNodes.filter(function (scNode) {\n return scNode.id !== node.id;\n });\n var propertiesWeightRemove = [];\n selfClusterNodesAfterRemove.forEach(function (nodeRemove, index) {\n propertiesWeightRemove[index] = allPropertiesWeight[nodeRemove.originIndex];\n }); // the inertialModularity for **removing** the node i from the origin cluster of node i\n\n var removeInertialModularity = getInertialModularity(selfClusterNodesAfterRemove, allPropertiesWeight) * inertialWeight; // the neightbors of the node\n\n var nodeNeighborIds = neighbors[node.id];\n Object.keys(nodeNeighborIds).forEach(function (neighborNodeId) {\n var neighborNode = nodeMap[neighborNodeId].node;\n var neighborClusterId = neighborNode.clusterId; // if the node and the neighbor of node are in the same cluster, reutrn\n\n if (neighborClusterId === node.clusterId) return;\n var neighborCluster = clusters[neighborClusterId];\n var clusterNodes = neighborCluster.nodes; // if the cluster is empty, remove the cluster and return\n\n if (!clusterNodes || !clusterNodes.length) return; // sum of weights of edges from node to nodes in cluster\n\n var neighborClusterKiin = 0;\n clusterNodes.forEach(function (cNode) {\n var cNodeIdx = nodeMap[cNode.id].idx;\n neighborClusterKiin += adjMatrix[i][cNodeIdx] || 0;\n }); // the modurarity for **adding** node i into this neighbor cluster\n\n var addModurarity = neighborClusterKiin - neighborCluster.sumTot * commonParam; // nodes for **adding** node i into this neighbor cluster\n\n var clusterNodesAfterAdd = clusterNodes.concat([node]);\n var propertiesWeightAdd = [];\n clusterNodesAfterAdd.forEach(function (nodeAdd, index) {\n propertiesWeightAdd[index] = allPropertiesWeight[nodeAdd.originIndex];\n }); // the inertialModularity for **adding** node i into this neighbor cluster\n\n var addInertialModularity = getInertialModularity(clusterNodesAfterAdd, allPropertiesWeight) * inertialWeight; // the increase modurarity is the difference between addModurarity and removeModurarity\n\n var increase = addModurarity - removeModurarity;\n\n if (inertialModularity) {\n increase = addModurarity + addInertialModularity - (removeModurarity + removeInertialModularity);\n } // find the best cluster to move node i into\n\n\n if (increase > bestIncrease) {\n bestIncrease = increase;\n bestCluster = neighborCluster;\n }\n }); // if found a best cluster to move into\n\n if (bestIncrease > 0) {\n bestCluster.nodes.push(node);\n var previousClusterId_1 = node.clusterId;\n node.clusterId = bestCluster.id; // move the node to the best cluster\n\n var nodeInSelfClusterIdx = selfCluster.nodes.indexOf(node); // remove from origin cluster\n\n selfCluster.nodes.splice(nodeInSelfClusterIdx, 1); // update sumTot for clusters\n // sum of weights of edges to nodes in cluster\n\n var neighborClusterSumTot_1 = 0;\n var selfClusterSumTot_1 = 0;\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n\n if (sourceClusterId === bestCluster.id && targetClusterId !== bestCluster.id || targetClusterId === bestCluster.id && sourceClusterId !== bestCluster.id) {\n neighborClusterSumTot_1 = neighborClusterSumTot_1 + (edge[weightPropertyName] || 1);\n }\n\n if (sourceClusterId === previousClusterId_1 && targetClusterId !== previousClusterId_1 || targetClusterId === previousClusterId_1 && sourceClusterId !== previousClusterId_1) {\n selfClusterSumTot_1 = selfClusterSumTot_1 + (edge[weightPropertyName] || 1);\n }\n }); // the nodes of the clusters to move into and remove are changed, update their sumTot\n\n bestCluster.sumTot = neighborClusterSumTot_1;\n selfCluster.sumTot = selfClusterSumTot_1;\n }\n });\n } // delete the empty clusters, assign increasing clusterId\n\n\n var newClusterIdMap = {};\n var clusterIdx = 0;\n Object.keys(finalClusters).forEach(function (clusterId) {\n var cluster = finalClusters[clusterId];\n\n if (!cluster.nodes || !cluster.nodes.length) {\n delete finalClusters[clusterId];\n return;\n }\n\n var newId = String(clusterIdx + 1);\n\n if (newId === clusterId) {\n return;\n }\n\n cluster.id = newId;\n cluster.nodes = cluster.nodes.map(function (item) {\n return {\n id: item.id,\n clusterId: newId\n };\n });\n finalClusters[newId] = cluster;\n newClusterIdMap[clusterId] = newId;\n delete finalClusters[clusterId];\n clusterIdx++;\n }); // restore node clusterId\n\n finalNodes.forEach(function (nodeInfo) {\n var node = nodeInfo.node,\n clusterId = nodeInfo.clusterId;\n if (!node) return;\n node.clusterId = clusterId;\n if (node.clusterId && newClusterIdMap[node.clusterId]) node.clusterId = newClusterIdMap[node.clusterId];\n }); // get the cluster edges\n\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var weight = edge[weightPropertyName] || 1;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n if (!sourceClusterId || !targetClusterId) return;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].weight += weight;\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n weight: weight,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n var clustersArray = [];\n Object.keys(finalClusters).forEach(function (clusterId) {\n clustersArray.push(finalClusters[clusterId]);\n });\n return {\n clusters: clustersArray,\n clusterEdges: clusterEdges\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (louvain);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/louvain.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _adjacent_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/es/adjacent-matrix.js\");\n/* harmony import */ var _utils_vector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/vector */ \"./node_modules/@antv/algorithm/es/utils/vector.js\");\n/* harmony import */ var _utils_node_properties__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./utils/node-properties */ \"./node_modules/@antv/algorithm/es/utils/node-properties.js\");\n/* harmony import */ var _utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/data-preprocessing */ \"./node_modules/@antv/algorithm/es/utils/data-preprocessing.js\");\n\n\n\n\n\nvar getModularity = function getModularity(nodes, adjMatrix, ks, m) {\n var length = adjMatrix.length;\n var param = 2 * m;\n var modularity = 0;\n for (var i = 0; i < length; i++) {\n var clusteri = nodes[i].clusterId;\n for (var j = 0; j < length; j++) {\n var clusterj = nodes[j].clusterId;\n if (clusteri !== clusterj) continue;\n var entry = adjMatrix[i][j] || 0;\n var ki = ks[i] || 0;\n var kj = ks[j] || 0;\n modularity += entry - ki * kj / param;\n }\n }\n modularity *= 1 / param;\n return modularity;\n};\n// 模块惯性度,衡量属性相似度\nvar getInertialModularity = function getInertialModularity(nodes, allPropertiesWeight) {\n if (nodes === void 0) {\n nodes = [];\n }\n var length = nodes.length;\n var totalProperties = new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"]([]);\n for (var i = 0; i < length; i++) {\n totalProperties = totalProperties.add(new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](allPropertiesWeight[i]));\n }\n // 均值向量\n var avgProperties = totalProperties.avg(length);\n avgProperties.normalize();\n // 节点集合的方差: 节点v与均值向量的平方欧式距离之和\n var variance = 0;\n for (var i = 0; i < length; i++) {\n var propertiesi = new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](allPropertiesWeight[i]);\n var squareEuclideanDistance = propertiesi.squareEuclideanDistance(avgProperties);\n variance += squareEuclideanDistance;\n }\n // 任意两点间的欧式平方距离\n var squareEuclideanDistanceInfo = [];\n nodes.forEach(function () {\n squareEuclideanDistanceInfo.push([]);\n });\n for (var i = 0; i < length; i++) {\n var propertiesi = new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](allPropertiesWeight[i]);\n nodes[i]['clusterInertial'] = 0;\n for (var j = 0; j < length; j++) {\n if (i === j) {\n squareEuclideanDistanceInfo[i][j] = 0;\n continue;\n }\n var propertiesj = new _utils_vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](allPropertiesWeight[j]);\n squareEuclideanDistanceInfo[i][j] = propertiesi.squareEuclideanDistance(propertiesj);\n nodes[i]['clusterInertial'] += squareEuclideanDistanceInfo[i][j];\n }\n }\n // 计算模块惯性度\n var inertialModularity = 0;\n var param = 2 * length * variance;\n for (var i = 0; i < length; i++) {\n var clusteri = nodes[i].clusterId;\n for (var j = 0; j < length; j++) {\n var clusterj = nodes[j].clusterId;\n if (i === j || clusteri !== clusterj) continue;\n var inertial = nodes[i].clusterInertial * nodes[j].clusterInertial / Math.pow(param, 2) - squareEuclideanDistanceInfo[i][j] / param;\n inertialModularity += inertial;\n }\n }\n return Number(inertialModularity.toFixed(4));\n};\n/**\n * 社区发现 louvain 算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param threshold 差值阈值\n * @param inertialModularity 是否使用惯性模块度(即节点属性相似性)\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n * @param inertialWeight 惯性模块度权重\n */\nvar louvain = function louvain(graphData, directed, weightPropertyName, threshold, inertialModularity, propertyKey, involvedKeys, uninvolvedKeys, inertialWeight) {\n if (directed === void 0) {\n directed = false;\n }\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n if (threshold === void 0) {\n threshold = 0.0001;\n }\n if (inertialModularity === void 0) {\n inertialModularity = false;\n }\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = ['id'];\n }\n if (inertialWeight === void 0) {\n inertialWeight = 1;\n }\n // the origin data\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var allPropertiesWeight = [];\n if (inertialModularity) {\n nodes.forEach(function (node, index) {\n node.properties = node.properties || {};\n node.originIndex = index;\n });\n var nodeTypeInfo_1 = [];\n if (nodes.every(function (node) {\n return node.hasOwnProperty('nodeType');\n })) {\n nodeTypeInfo_1 = Array.from(new Set(nodes.map(function (node) {\n return node.nodeType;\n })));\n nodes.forEach(function (node) {\n node.properties.nodeType = nodeTypeInfo_1.findIndex(function (nodeType) {\n return nodeType === node.nodeType;\n });\n });\n }\n // 所有节点属性集合\n var properties = Object(_utils_node_properties__WEBPACK_IMPORTED_MODULE_3__[\"getAllProperties\"])(nodes, propertyKey);\n // 所有节点属性one-hot特征向量集合\n allPropertiesWeight = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_4__[\"oneHot\"])(properties, involvedKeys, uninvolvedKeys);\n }\n var uniqueId = 1;\n var clusters = {};\n var nodeMap = {};\n // init the clusters and nodeMap\n nodes.forEach(function (node, i) {\n var cid = String(uniqueId++);\n node.clusterId = cid;\n clusters[cid] = {\n id: cid,\n nodes: [node]\n };\n nodeMap[node.id] = {\n node: node,\n idx: i\n };\n });\n // the adjacent matrix of calNodes inside clusters\n var adjMatrix = Object(_adjacent_matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(graphData, directed);\n // the sum of each row in adjacent matrix\n var ks = [];\n /**\n * neighbor nodes (id for key and weight for value) for each node\n * neighbors = {\n * id(node_id): { id(neighbor_1_id): weight(weight of the edge), id(neighbor_2_id): weight(weight of the edge), ... },\n * ...\n * }\n */\n var neighbors = {};\n // the sum of the weights of all edges in the graph\n var m = 0;\n adjMatrix.forEach(function (row, i) {\n var k = 0;\n var iid = nodes[i].id;\n neighbors[iid] = {};\n row.forEach(function (entry, j) {\n if (!entry) return;\n k += entry;\n var jid = nodes[j].id;\n neighbors[iid][jid] = entry;\n m += entry;\n });\n ks.push(k);\n });\n m /= 2;\n var totalModularity = Infinity;\n var previousModularity = Infinity;\n var iter = 0;\n var finalNodes = [];\n var finalClusters = {};\n while (true) {\n if (inertialModularity && nodes.every(function (node) {\n return node.hasOwnProperty('properties');\n })) {\n totalModularity = getModularity(nodes, adjMatrix, ks, m) + getInertialModularity(nodes, allPropertiesWeight) * inertialWeight;\n } else {\n totalModularity = getModularity(nodes, adjMatrix, ks, m);\n }\n // 第一次迭代previousModularity直接赋值\n if (iter === 0) {\n previousModularity = totalModularity;\n finalNodes = nodes;\n finalClusters = clusters;\n }\n var increaseWithinThreshold = totalModularity > 0 && totalModularity > previousModularity && totalModularity - previousModularity < threshold;\n // 总模块度增加才更新最优解\n if (totalModularity > previousModularity) {\n finalNodes = nodes.map(function (node) {\n return {\n node: node,\n clusterId: node.clusterId\n };\n });\n finalClusters = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(clusters);\n previousModularity = totalModularity;\n }\n // whether to terminate the iterations\n if (increaseWithinThreshold || iter > 100) {\n break;\n }\n ;\n iter++;\n // pre compute some values for current clusters\n Object.keys(clusters).forEach(function (clusterId) {\n // sum of weights of edges to nodes in cluster\n var sumTot = 0;\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n if (sourceClusterId === clusterId && targetClusterId !== clusterId || targetClusterId === clusterId && sourceClusterId !== clusterId) {\n sumTot = sumTot + (edge[weightPropertyName] || 1);\n }\n });\n clusters[clusterId].sumTot = sumTot;\n });\n // move the nodes to increase the delta modularity\n nodes.forEach(function (node, i) {\n var selfCluster = clusters[node.clusterId];\n var bestIncrease = 0;\n var bestCluster;\n var commonParam = ks[i] / (2 * m);\n // sum of weights of edges from node to nodes in cluster\n var kiin = 0;\n var selfClusterNodes = selfCluster.nodes;\n selfClusterNodes.forEach(function (scNode) {\n var scNodeIdx = nodeMap[scNode.id].idx;\n kiin += adjMatrix[i][scNodeIdx] || 0;\n });\n // the modurarity for **removing** the node i from the origin cluster of node i\n var removeModurarity = kiin - selfCluster.sumTot * commonParam;\n // nodes for **removing** node i into this neighbor cluster\n var selfClusterNodesAfterRemove = selfClusterNodes.filter(function (scNode) {\n return scNode.id !== node.id;\n });\n var propertiesWeightRemove = [];\n selfClusterNodesAfterRemove.forEach(function (nodeRemove, index) {\n propertiesWeightRemove[index] = allPropertiesWeight[nodeRemove.originIndex];\n });\n // the inertialModularity for **removing** the node i from the origin cluster of node i\n var removeInertialModularity = getInertialModularity(selfClusterNodesAfterRemove, allPropertiesWeight) * inertialWeight;\n // the neightbors of the node\n var nodeNeighborIds = neighbors[node.id];\n Object.keys(nodeNeighborIds).forEach(function (neighborNodeId) {\n var neighborNode = nodeMap[neighborNodeId].node;\n var neighborClusterId = neighborNode.clusterId;\n // if the node and the neighbor of node are in the same cluster, reutrn\n if (neighborClusterId === node.clusterId) return;\n var neighborCluster = clusters[neighborClusterId];\n var clusterNodes = neighborCluster.nodes;\n // if the cluster is empty, remove the cluster and return\n if (!clusterNodes || !clusterNodes.length) return;\n // sum of weights of edges from node to nodes in cluster\n var neighborClusterKiin = 0;\n clusterNodes.forEach(function (cNode) {\n var cNodeIdx = nodeMap[cNode.id].idx;\n neighborClusterKiin += adjMatrix[i][cNodeIdx] || 0;\n });\n // the modurarity for **adding** node i into this neighbor cluster\n var addModurarity = neighborClusterKiin - neighborCluster.sumTot * commonParam;\n // nodes for **adding** node i into this neighbor cluster\n var clusterNodesAfterAdd = clusterNodes.concat([node]);\n var propertiesWeightAdd = [];\n clusterNodesAfterAdd.forEach(function (nodeAdd, index) {\n propertiesWeightAdd[index] = allPropertiesWeight[nodeAdd.originIndex];\n });\n // the inertialModularity for **adding** node i into this neighbor cluster\n var addInertialModularity = getInertialModularity(clusterNodesAfterAdd, allPropertiesWeight) * inertialWeight;\n // the increase modurarity is the difference between addModurarity and removeModurarity\n var increase = addModurarity - removeModurarity;\n if (inertialModularity) {\n increase = addModurarity + addInertialModularity - (removeModurarity + removeInertialModularity);\n }\n // find the best cluster to move node i into\n if (increase > bestIncrease) {\n bestIncrease = increase;\n bestCluster = neighborCluster;\n }\n });\n // if found a best cluster to move into\n if (bestIncrease > 0) {\n bestCluster.nodes.push(node);\n var previousClusterId_1 = node.clusterId;\n node.clusterId = bestCluster.id;\n // move the node to the best cluster\n var nodeInSelfClusterIdx = selfCluster.nodes.indexOf(node);\n // remove from origin cluster\n selfCluster.nodes.splice(nodeInSelfClusterIdx, 1);\n // update sumTot for clusters\n // sum of weights of edges to nodes in cluster\n var neighborClusterSumTot_1 = 0;\n var selfClusterSumTot_1 = 0;\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n if (sourceClusterId === bestCluster.id && targetClusterId !== bestCluster.id || targetClusterId === bestCluster.id && sourceClusterId !== bestCluster.id) {\n neighborClusterSumTot_1 = neighborClusterSumTot_1 + (edge[weightPropertyName] || 1);\n }\n if (sourceClusterId === previousClusterId_1 && targetClusterId !== previousClusterId_1 || targetClusterId === previousClusterId_1 && sourceClusterId !== previousClusterId_1) {\n selfClusterSumTot_1 = selfClusterSumTot_1 + (edge[weightPropertyName] || 1);\n }\n });\n // the nodes of the clusters to move into and remove are changed, update their sumTot\n bestCluster.sumTot = neighborClusterSumTot_1;\n selfCluster.sumTot = selfClusterSumTot_1;\n }\n });\n }\n // delete the empty clusters, assign increasing clusterId\n var newClusterIdMap = {};\n var clusterIdx = 0;\n Object.keys(finalClusters).forEach(function (clusterId) {\n var cluster = finalClusters[clusterId];\n if (!cluster.nodes || !cluster.nodes.length) {\n delete finalClusters[clusterId];\n return;\n }\n var newId = String(clusterIdx + 1);\n if (newId === clusterId) {\n return;\n }\n cluster.id = newId;\n cluster.nodes = cluster.nodes.map(function (item) {\n return {\n id: item.id,\n clusterId: newId\n };\n });\n finalClusters[newId] = cluster;\n newClusterIdMap[clusterId] = newId;\n delete finalClusters[clusterId];\n clusterIdx++;\n });\n // restore node clusterId\n finalNodes.forEach(function (nodeInfo) {\n var node = nodeInfo.node,\n clusterId = nodeInfo.clusterId;\n if (!node) return;\n node.clusterId = clusterId;\n if (node.clusterId && newClusterIdMap[node.clusterId]) node.clusterId = newClusterIdMap[node.clusterId];\n });\n // get the cluster edges\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var weight = edge[weightPropertyName] || 1;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n if (!sourceClusterId || !targetClusterId) return;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].weight += weight;\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n weight: weight,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n var clustersArray = [];\n Object.keys(finalClusters).forEach(function (clusterId) {\n clustersArray.push(finalClusters[clusterId]);\n });\n return {\n clusters: clustersArray,\n clusterEdges: clusterEdges\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (louvain);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/louvain.js?"); /***/ }), @@ -260,7 +260,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ant /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _structs_union_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./structs/union-find */ \"./node_modules/@antv/algorithm/es/structs/union-find.js\");\n/* harmony import */ var _structs_binary_heap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./structs/binary-heap */ \"./node_modules/@antv/algorithm/es/structs/binary-heap.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n\n/**\n * Prim algorithm,use priority queue,复杂度 O(E+V*logV), V: 节点数量,E: 边的数量\n * refer: https://en.wikipedia.org/wiki/Prim%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n */\n\nvar primMST = function primMST(graphData, weight) {\n var selectedEdges = [];\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n\n if (nodes.length === 0) {\n return selectedEdges;\n } // 从nodes[0]开始\n\n\n var currNode = nodes[0];\n var visited = new Set();\n visited.add(currNode); // 用二叉堆维护距已加入节点的其他节点的边的权值\n\n var compareWeight = function compareWeight(a, b) {\n if (weight) {\n return a.weight - b.weight;\n }\n\n return 0;\n };\n\n var edgeQueue = new _structs_binary_heap__WEBPACK_IMPORTED_MODULE_1__[\"default\"](compareWeight);\n Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getEdgesByNodeId\"])(currNode.id, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n\n while (!edgeQueue.isEmpty()) {\n // 选取与已加入的结点之间边权最小的结点\n var currEdge = edgeQueue.delMin();\n var source = currEdge.source;\n var target = currEdge.target;\n if (visited.has(source) && visited.has(target)) continue;\n selectedEdges.push(currEdge);\n\n if (!visited.has(source)) {\n visited.add(source);\n Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getEdgesByNodeId\"])(source, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n }\n\n if (!visited.has(target)) {\n visited.add(target);\n Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getEdgesByNodeId\"])(target, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n }\n }\n\n return selectedEdges;\n};\n/**\n * Kruskal algorithm,复杂度 O(E*logE), E: 边的数量\n * refer: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @return IEdge[] 返回构成MST的边的数组\n */\n\n\nvar kruskalMST = function kruskalMST(graphData, weight) {\n var selectedEdges = [];\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n\n if (nodes.length === 0) {\n return selectedEdges;\n } // 若指定weight,则将所有的边按权值从小到大排序\n\n\n var weightEdges = edges.map(function (edge) {\n return edge;\n });\n\n if (weight) {\n weightEdges.sort(function (a, b) {\n return a.weight - b.weight;\n });\n }\n\n var disjointSet = new _structs_union_find__WEBPACK_IMPORTED_MODULE_0__[\"default\"](nodes.map(function (n) {\n return n.id;\n })); // 从权值最小的边开始,如果这条边连接的两个节点于图G中不在同一个连通分量中,则添加这条边\n // 直到遍历完所有点或边\n\n while (weightEdges.length > 0) {\n var curEdge = weightEdges.shift();\n var source = curEdge.source;\n var target = curEdge.target;\n\n if (!disjointSet.connected(source, target)) {\n selectedEdges.push(curEdge);\n disjointSet.union(source, target);\n }\n }\n\n return selectedEdges;\n};\n/**\n * 最小生成树\n * refer: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @param algo 'prim' | 'kruskal' 算法类型\n * @return EdgeConfig[] 返回构成MST的边的数组\n */\n\n\nvar minimumSpanningTree = function minimumSpanningTree(graphData, weight, algo) {\n var algos = {\n prim: primMST,\n kruskal: kruskalMST\n };\n if (!algo) return kruskalMST(graphData, weight);\n return algos[algo](graphData, weight);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (minimumSpanningTree);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/mts.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _structs_union_find__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./structs/union-find */ \"./node_modules/@antv/algorithm/es/structs/union-find.js\");\n/* harmony import */ var _structs_binary_heap__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./structs/binary-heap */ \"./node_modules/@antv/algorithm/es/structs/binary-heap.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n\n/**\n * Prim algorithm,use priority queue,复杂度 O(E+V*logV), V: 节点数量,E: 边的数量\n * refer: https://en.wikipedia.org/wiki/Prim%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n */\nvar primMST = function primMST(graphData, weight) {\n var selectedEdges = [];\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n if (nodes.length === 0) {\n return selectedEdges;\n }\n // 从nodes[0]开始\n var currNode = nodes[0];\n var visited = new Set();\n visited.add(currNode);\n // 用二叉堆维护距已加入节点的其他节点的边的权值\n var compareWeight = function compareWeight(a, b) {\n if (weight) {\n return a.weight - b.weight;\n }\n return 0;\n };\n var edgeQueue = new _structs_binary_heap__WEBPACK_IMPORTED_MODULE_1__[\"default\"](compareWeight);\n Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getEdgesByNodeId\"])(currNode.id, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n while (!edgeQueue.isEmpty()) {\n // 选取与已加入的结点之间边权最小的结点\n var currEdge = edgeQueue.delMin();\n var source = currEdge.source;\n var target = currEdge.target;\n if (visited.has(source) && visited.has(target)) continue;\n selectedEdges.push(currEdge);\n if (!visited.has(source)) {\n visited.add(source);\n Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getEdgesByNodeId\"])(source, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n }\n if (!visited.has(target)) {\n visited.add(target);\n Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"getEdgesByNodeId\"])(target, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n }\n }\n return selectedEdges;\n};\n/**\n * Kruskal algorithm,复杂度 O(E*logE), E: 边的数量\n * refer: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @return IEdge[] 返回构成MST的边的数组\n */\nvar kruskalMST = function kruskalMST(graphData, weight) {\n var selectedEdges = [];\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n if (nodes.length === 0) {\n return selectedEdges;\n }\n // 若指定weight,则将所有的边按权值从小到大排序\n var weightEdges = edges.map(function (edge) {\n return edge;\n });\n if (weight) {\n weightEdges.sort(function (a, b) {\n return a.weight - b.weight;\n });\n }\n var disjointSet = new _structs_union_find__WEBPACK_IMPORTED_MODULE_0__[\"default\"](nodes.map(function (n) {\n return n.id;\n }));\n // 从权值最小的边开始,如果这条边连接的两个节点于图G中不在同一个连通分量中,则添加这条边\n // 直到遍历完所有点或边\n while (weightEdges.length > 0) {\n var curEdge = weightEdges.shift();\n var source = curEdge.source;\n var target = curEdge.target;\n if (!disjointSet.connected(source, target)) {\n selectedEdges.push(curEdge);\n disjointSet.union(source, target);\n }\n }\n return selectedEdges;\n};\n/**\n * 最小生成树\n * refer: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @param algo 'prim' | 'kruskal' 算法类型\n * @return EdgeConfig[] 返回构成MST的边的数组\n */\nvar minimumSpanningTree = function minimumSpanningTree(graphData, weight, algo) {\n var algos = {\n prim: primMST,\n kruskal: kruskalMST\n };\n if (!algo) return kruskalMST(graphData, weight);\n return algos[algo](graphData, weight);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (minimumSpanningTree);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/mts.js?"); /***/ }), @@ -272,7 +272,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _str /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _utils_node_properties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/node-properties */ \"./node_modules/@antv/algorithm/es/utils/node-properties.js\");\n/* harmony import */ var _utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/data-preprocessing */ \"./node_modules/@antv/algorithm/es/utils/data-preprocessing.js\");\n/* harmony import */ var _cosine_similarity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cosine-similarity */ \"./node_modules/@antv/algorithm/es/cosine-similarity.js\");\n\n\n\n\n/**\n * nodes-cosine-similarity算法 基于节点属性计算余弦相似度(基于种子节点寻找相似节点)\n * @param nodes 图节点数据\n * @param seedNode 种子节点\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\n\nvar nodesCosineSimilarity = function nodesCosineSimilarity(nodes, seedNode, propertyKey, involvedKeys, uninvolvedKeys) {\n if (nodes === void 0) {\n nodes = [];\n }\n\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = [];\n }\n\n var similarNodes = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(nodes.filter(function (node) {\n return node.id !== seedNode.id;\n }));\n var seedNodeIndex = nodes.findIndex(function (node) {\n return node.id === seedNode.id;\n }); // 所有节点属性集合\n\n var properties = Object(_utils_node_properties__WEBPACK_IMPORTED_MODULE_1__[\"getAllProperties\"])(nodes, propertyKey); // 所有节点属性one-hot特征向量集合\n\n var allPropertiesWeight = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__[\"oneHot\"])(properties, involvedKeys, uninvolvedKeys); // 种子节点属性\n\n var seedNodeProperties = allPropertiesWeight[seedNodeIndex];\n var allCosineSimilarity = [];\n similarNodes.forEach(function (node, index) {\n if (node.id !== seedNode.id) {\n // 节点属性\n var nodeProperties = allPropertiesWeight[index]; // 计算节点向量和种子节点向量的余弦相似度\n\n var cosineSimilarityValue = Object(_cosine_similarity__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(nodeProperties, seedNodeProperties);\n allCosineSimilarity.push(cosineSimilarityValue);\n node.cosineSimilarity = cosineSimilarityValue;\n }\n }); // 将返回的节点按照余弦相似度大小排序\n\n similarNodes.sort(function (a, b) {\n return b.cosineSimilarity - a.cosineSimilarity;\n });\n return {\n allCosineSimilarity: allCosineSimilarity,\n similarNodes: similarNodes\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (nodesCosineSimilarity);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/nodes-cosine-similarity.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _utils_node_properties__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./utils/node-properties */ \"./node_modules/@antv/algorithm/es/utils/node-properties.js\");\n/* harmony import */ var _utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./utils/data-preprocessing */ \"./node_modules/@antv/algorithm/es/utils/data-preprocessing.js\");\n/* harmony import */ var _cosine_similarity__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./cosine-similarity */ \"./node_modules/@antv/algorithm/es/cosine-similarity.js\");\n\n\n\n\n/**\n * nodes-cosine-similarity算法 基于节点属性计算余弦相似度(基于种子节点寻找相似节点)\n * @param nodes 图节点数据\n * @param seedNode 种子节点\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\nvar nodesCosineSimilarity = function nodesCosineSimilarity(nodes, seedNode, propertyKey, involvedKeys, uninvolvedKeys) {\n if (nodes === void 0) {\n nodes = [];\n }\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = [];\n }\n var similarNodes = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(nodes.filter(function (node) {\n return node.id !== seedNode.id;\n }));\n var seedNodeIndex = nodes.findIndex(function (node) {\n return node.id === seedNode.id;\n });\n // 所有节点属性集合\n var properties = Object(_utils_node_properties__WEBPACK_IMPORTED_MODULE_1__[\"getAllProperties\"])(nodes, propertyKey);\n // 所有节点属性one-hot特征向量集合\n var allPropertiesWeight = Object(_utils_data_preprocessing__WEBPACK_IMPORTED_MODULE_2__[\"oneHot\"])(properties, involvedKeys, uninvolvedKeys);\n // 种子节点属性\n var seedNodeProperties = allPropertiesWeight[seedNodeIndex];\n var allCosineSimilarity = [];\n similarNodes.forEach(function (node, index) {\n if (node.id !== seedNode.id) {\n // 节点属性\n var nodeProperties = allPropertiesWeight[index];\n // 计算节点向量和种子节点向量的余弦相似度\n var cosineSimilarityValue = Object(_cosine_similarity__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(nodeProperties, seedNodeProperties);\n allCosineSimilarity.push(cosineSimilarityValue);\n node.cosineSimilarity = cosineSimilarityValue;\n }\n });\n // 将返回的节点按照余弦相似度大小排序\n similarNodes.sort(function (a, b) {\n return b.cosineSimilarity - a.cosineSimilarity;\n });\n return {\n allCosineSimilarity: allCosineSimilarity,\n similarNodes: similarNodes\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (nodesCosineSimilarity);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/nodes-cosine-similarity.js?"); /***/ }), @@ -284,7 +284,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ant /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _degree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./degree */ \"./node_modules/@antv/algorithm/es/degree.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n/**\n * PageRank https://en.wikipedia.org/wiki/PageRank\n * refer: https://github.com/anvaka/ngraph.pagerank\n * @param graph\n * @param epsilon 判断是否收敛的精度值,默认 0.000001\n * @param linkProb 阻尼系数(dumping factor),指任意时刻,用户访问到某节点后继续访问该节点链接的下一个节点的概率,经验值 0.85\n */\n\nvar pageRank = function pageRank(graphData, epsilon, linkProb) {\n if (typeof epsilon !== 'number') epsilon = 0.000001;\n if (typeof linkProb !== 'number') linkProb = 0.85;\n var distance = 1;\n var leakedRank = 0;\n var maxIterations = 1000;\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodesCount = nodes.length;\n var currentRank;\n var curRanks = {};\n var prevRanks = {}; // Initialize pageranks 初始化\n\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n curRanks[nodeId] = 1 / nodesCount;\n prevRanks[nodeId] = 1 / nodesCount;\n }\n\n var nodeDegree = Object(_degree__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData);\n\n while (maxIterations > 0 && distance > epsilon) {\n leakedRank = 0;\n\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n currentRank = 0;\n\n if (nodeDegree[node.id].inDegree === 0) {\n curRanks[nodeId] = 0;\n } else {\n var neighbors = Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(nodeId, edges, 'source');\n\n for (var i = 0; i < neighbors.length; ++i) {\n var neighbor = neighbors[i];\n var outDegree = nodeDegree[neighbor].outDegree;\n if (outDegree > 0) currentRank += prevRanks[neighbor] / outDegree;\n }\n\n curRanks[nodeId] = linkProb * currentRank;\n leakedRank += curRanks[nodeId];\n }\n }\n\n leakedRank = (1 - leakedRank) / nodesCount;\n distance = 0;\n\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n currentRank = curRanks[nodeId] + leakedRank;\n distance += Math.abs(currentRank - prevRanks[nodeId]);\n prevRanks[nodeId] = currentRank;\n }\n\n maxIterations -= 1;\n }\n\n return prevRanks;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (pageRank);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/pageRank.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _degree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./degree */ \"./node_modules/@antv/algorithm/es/degree.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/es/util.js\");\n\n\n/**\n * PageRank https://en.wikipedia.org/wiki/PageRank\n * refer: https://github.com/anvaka/ngraph.pagerank\n * @param graph\n * @param epsilon 判断是否收敛的精度值,默认 0.000001\n * @param linkProb 阻尼系数(dumping factor),指任意时刻,用户访问到某节点后继续访问该节点链接的下一个节点的概率,经验值 0.85\n */\nvar pageRank = function pageRank(graphData, epsilon, linkProb) {\n if (typeof epsilon !== 'number') epsilon = 0.000001;\n if (typeof linkProb !== 'number') linkProb = 0.85;\n var distance = 1;\n var leakedRank = 0;\n var maxIterations = 1000;\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodesCount = nodes.length;\n var currentRank;\n var curRanks = {};\n var prevRanks = {};\n // Initialize pageranks 初始化\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n curRanks[nodeId] = 1 / nodesCount;\n prevRanks[nodeId] = 1 / nodesCount;\n }\n var nodeDegree = Object(_degree__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graphData);\n while (maxIterations > 0 && distance > epsilon) {\n leakedRank = 0;\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n currentRank = 0;\n if (nodeDegree[node.id].inDegree === 0) {\n curRanks[nodeId] = 0;\n } else {\n var neighbors = Object(_util__WEBPACK_IMPORTED_MODULE_1__[\"getNeighbors\"])(nodeId, edges, 'source');\n for (var i = 0; i < neighbors.length; ++i) {\n var neighbor = neighbors[i];\n var outDegree = nodeDegree[neighbor].outDegree;\n if (outDegree > 0) currentRank += prevRanks[neighbor] / outDegree;\n }\n curRanks[nodeId] = linkProb * currentRank;\n leakedRank += curRanks[nodeId];\n }\n }\n leakedRank = (1 - leakedRank) / nodesCount;\n distance = 0;\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n currentRank = curRanks[nodeId] + leakedRank;\n distance += Math.abs(currentRank - prevRanks[nodeId]);\n prevRanks[nodeId] = currentRank;\n }\n maxIterations -= 1;\n }\n return prevRanks;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (pageRank);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/pageRank.js?"); /***/ }), @@ -296,7 +296,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _deg /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar defaultCompare = function defaultCompare(a, b) {\n return a - b;\n};\n\nvar MinBinaryHeap =\n/** @class */\nfunction () {\n function MinBinaryHeap(compareFn) {\n if (compareFn === void 0) {\n compareFn = defaultCompare;\n }\n\n this.compareFn = compareFn;\n this.list = [];\n }\n\n MinBinaryHeap.prototype.getLeft = function (index) {\n return 2 * index + 1;\n };\n\n MinBinaryHeap.prototype.getRight = function (index) {\n return 2 * index + 2;\n };\n\n MinBinaryHeap.prototype.getParent = function (index) {\n if (index === 0) {\n return null;\n }\n\n return Math.floor((index - 1) / 2);\n };\n\n MinBinaryHeap.prototype.isEmpty = function () {\n return this.list.length <= 0;\n };\n\n MinBinaryHeap.prototype.top = function () {\n return this.isEmpty() ? undefined : this.list[0];\n };\n\n MinBinaryHeap.prototype.delMin = function () {\n var top = this.top();\n var bottom = this.list.pop();\n\n if (this.list.length > 0) {\n this.list[0] = bottom;\n this.moveDown(0);\n }\n\n return top;\n };\n\n MinBinaryHeap.prototype.insert = function (value) {\n if (value !== null) {\n this.list.push(value);\n var index = this.list.length - 1;\n this.moveUp(index);\n return true;\n }\n\n return false;\n };\n\n MinBinaryHeap.prototype.moveUp = function (index) {\n var parent = this.getParent(index);\n\n while (index && index > 0 && this.compareFn(this.list[parent], this.list[index]) > 0) {\n // swap\n var tmp = this.list[parent];\n this.list[parent] = this.list[index];\n this.list[index] = tmp; // [this.list[index], this.list[parent]] = [this.list[parent], this.list[index]]\n\n index = parent;\n parent = this.getParent(index);\n }\n };\n\n MinBinaryHeap.prototype.moveDown = function (index) {\n var _a;\n\n var element = index;\n var left = this.getLeft(index);\n var right = this.getRight(index);\n var size = this.list.length;\n\n if (left !== null && left < size && this.compareFn(this.list[element], this.list[left]) > 0) {\n element = left;\n } else if (right !== null && right < size && this.compareFn(this.list[element], this.list[right]) > 0) {\n element = right;\n }\n\n if (index !== element) {\n _a = [this.list[element], this.list[index]], this.list[index] = _a[0], this.list[element] = _a[1];\n this.moveDown(element);\n }\n };\n\n return MinBinaryHeap;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (MinBinaryHeap);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/binary-heap.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar defaultCompare = function defaultCompare(a, b) {\n return a - b;\n};\nvar MinBinaryHeap = /** @class */function () {\n function MinBinaryHeap(compareFn) {\n if (compareFn === void 0) {\n compareFn = defaultCompare;\n }\n this.compareFn = compareFn;\n this.list = [];\n }\n MinBinaryHeap.prototype.getLeft = function (index) {\n return 2 * index + 1;\n };\n MinBinaryHeap.prototype.getRight = function (index) {\n return 2 * index + 2;\n };\n MinBinaryHeap.prototype.getParent = function (index) {\n if (index === 0) {\n return null;\n }\n return Math.floor((index - 1) / 2);\n };\n MinBinaryHeap.prototype.isEmpty = function () {\n return this.list.length <= 0;\n };\n MinBinaryHeap.prototype.top = function () {\n return this.isEmpty() ? undefined : this.list[0];\n };\n MinBinaryHeap.prototype.delMin = function () {\n var top = this.top();\n var bottom = this.list.pop();\n if (this.list.length > 0) {\n this.list[0] = bottom;\n this.moveDown(0);\n }\n return top;\n };\n MinBinaryHeap.prototype.insert = function (value) {\n if (value !== null) {\n this.list.push(value);\n var index = this.list.length - 1;\n this.moveUp(index);\n return true;\n }\n return false;\n };\n MinBinaryHeap.prototype.moveUp = function (index) {\n var parent = this.getParent(index);\n while (index && index > 0 && this.compareFn(this.list[parent], this.list[index]) > 0) {\n // swap\n var tmp = this.list[parent];\n this.list[parent] = this.list[index];\n this.list[index] = tmp;\n // [this.list[index], this.list[parent]] = [this.list[parent], this.list[index]]\n index = parent;\n parent = this.getParent(index);\n }\n };\n MinBinaryHeap.prototype.moveDown = function (index) {\n var _a;\n var element = index;\n var left = this.getLeft(index);\n var right = this.getRight(index);\n var size = this.list.length;\n if (left !== null && left < size && this.compareFn(this.list[element], this.list[left]) > 0) {\n element = left;\n } else if (right !== null && right < size && this.compareFn(this.list[element], this.list[right]) > 0) {\n element = right;\n }\n if (index !== element) {\n _a = [this.list[element], this.list[index]], this.list[index] = _a[0], this.list[element] = _a[1];\n this.moveDown(element);\n }\n };\n return MinBinaryHeap;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (MinBinaryHeap);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/binary-heap.js?"); /***/ }), @@ -308,7 +308,7 @@ eval("__webpack_require__.r(__webpack_exports__);\nvar defaultCompare = function /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinkedListNode\", function() { return LinkedListNode; });\nvar defaultComparator = function defaultComparator(a, b) {\n if (a === b) {\n return true;\n }\n\n return false;\n};\n/**\n * 链表中单个元素节点\n */\n\n\nvar LinkedListNode =\n/** @class */\nfunction () {\n function LinkedListNode(value, next) {\n if (next === void 0) {\n next = null;\n }\n\n this.value = value;\n this.next = next;\n }\n\n LinkedListNode.prototype.toString = function (callback) {\n return callback ? callback(this.value) : \"\".concat(this.value);\n };\n\n return LinkedListNode;\n}();\n\n\n\nvar LinkedList =\n/** @class */\nfunction () {\n function LinkedList(comparator) {\n if (comparator === void 0) {\n comparator = defaultComparator;\n }\n\n this.head = null;\n this.tail = null;\n this.compare = comparator;\n }\n /**\n * 将指定元素添加到链表头部\n * @param value\n */\n\n\n LinkedList.prototype.prepend = function (value) {\n // 在头部添加一个节点\n var newNode = new LinkedListNode(value, this.head);\n this.head = newNode;\n\n if (!this.tail) {\n this.tail = newNode;\n }\n\n return this;\n };\n /**\n * 将指定元素添加到链表中\n * @param value\n */\n\n\n LinkedList.prototype.append = function (value) {\n var newNode = new LinkedListNode(value); // 如果不存在头节点,则将创建的新节点作为头节点\n\n if (!this.head) {\n this.head = newNode;\n this.tail = newNode;\n return this;\n } // 将新节点附加到链表末尾\n\n\n this.tail.next = newNode;\n this.tail = newNode;\n return this;\n };\n /**\n * 删除指定元素\n * @param value 要删除的元素\n */\n\n\n LinkedList.prototype.delete = function (value) {\n if (!this.head) {\n return null;\n }\n\n var deleteNode = null; // 如果删除的是头部元素,则将next作为头元素\n\n while (this.head && this.compare(this.head.value, value)) {\n deleteNode = this.head;\n this.head = this.head.next;\n }\n\n var currentNode = this.head;\n\n if (currentNode !== null) {\n // 如果删除了节点以后,将next节点前移\n while (currentNode.next) {\n if (this.compare(currentNode.next.value, value)) {\n deleteNode = currentNode.next;\n currentNode.next = currentNode.next.next;\n } else {\n currentNode = currentNode.next;\n }\n }\n } // 检查尾部节点是否被删除\n\n\n if (this.compare(this.tail.value, value)) {\n this.tail = currentNode;\n }\n\n return deleteNode;\n };\n /**\n * 查找指定的元素\n * @param param0\n */\n\n\n LinkedList.prototype.find = function (_a) {\n var _b = _a.value,\n value = _b === void 0 ? undefined : _b,\n _c = _a.callback,\n callback = _c === void 0 ? undefined : _c;\n\n if (!this.head) {\n return null;\n }\n\n var currentNode = this.head;\n\n while (currentNode) {\n // 如果指定了 callback,则按指定的 callback 查找\n if (callback && callback(currentNode.value)) {\n return currentNode;\n } // 如果指定了 value,则按 value 查找\n\n\n if (value !== undefined && this.compare(currentNode.value, value)) {\n return currentNode;\n }\n\n currentNode = currentNode.next;\n }\n\n return null;\n };\n /**\n * 删除尾部节点\n */\n\n\n LinkedList.prototype.deleteTail = function () {\n var deletedTail = this.tail;\n\n if (this.head === this.tail) {\n // 链表中只有一个元素\n this.head = null;\n this.tail = null;\n return deletedTail;\n }\n\n var currentNode = this.head;\n\n while (currentNode.next) {\n if (!currentNode.next.next) {\n currentNode.next = null;\n } else {\n currentNode = currentNode.next;\n }\n }\n\n this.tail = currentNode;\n return deletedTail;\n };\n /**\n * 删除头部节点\n */\n\n\n LinkedList.prototype.deleteHead = function () {\n if (!this.head) {\n return null;\n }\n\n var deletedHead = this.head;\n\n if (this.head.next) {\n this.head = this.head.next;\n } else {\n this.head = null;\n this.tail = null;\n }\n\n return deletedHead;\n };\n /**\n * 将一组元素转成链表中的节点\n * @param values 链表中的元素\n */\n\n\n LinkedList.prototype.fromArray = function (values) {\n var _this = this;\n\n values.forEach(function (value) {\n return _this.append(value);\n });\n return this;\n };\n /**\n * 将链表中的节点转成数组元素\n */\n\n\n LinkedList.prototype.toArray = function () {\n var nodes = [];\n var currentNode = this.head;\n\n while (currentNode) {\n nodes.push(currentNode);\n currentNode = currentNode.next;\n }\n\n return nodes;\n };\n /**\n * 反转链表中的元素节点\n */\n\n\n LinkedList.prototype.reverse = function () {\n var currentNode = this.head;\n var prevNode = null;\n var nextNode = null;\n\n while (currentNode) {\n // 存储下一个元素节点\n nextNode = currentNode.next; // 更改当前节点的下一个节点,以便将它连接到上一个节点上\n\n currentNode.next = prevNode; // 将 prevNode 和 currentNode 向前移动一步\n\n prevNode = currentNode;\n currentNode = nextNode;\n }\n\n this.tail = this.head;\n this.head = prevNode;\n };\n\n LinkedList.prototype.toString = function (callback) {\n if (callback === void 0) {\n callback = undefined;\n }\n\n return this.toArray().map(function (node) {\n return node.toString(callback);\n }).toString();\n };\n\n return LinkedList;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LinkedList);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/linked-list.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LinkedListNode\", function() { return LinkedListNode; });\nvar defaultComparator = function defaultComparator(a, b) {\n if (a === b) {\n return true;\n }\n return false;\n};\n/**\n * 链表中单个元素节点\n */\nvar LinkedListNode = /** @class */function () {\n function LinkedListNode(value, next) {\n if (next === void 0) {\n next = null;\n }\n this.value = value;\n this.next = next;\n }\n LinkedListNode.prototype.toString = function (callback) {\n return callback ? callback(this.value) : \"\".concat(this.value);\n };\n return LinkedListNode;\n}();\n\nvar LinkedList = /** @class */function () {\n function LinkedList(comparator) {\n if (comparator === void 0) {\n comparator = defaultComparator;\n }\n this.head = null;\n this.tail = null;\n this.compare = comparator;\n }\n /**\n * 将指定元素添加到链表头部\n * @param value\n */\n LinkedList.prototype.prepend = function (value) {\n // 在头部添加一个节点\n var newNode = new LinkedListNode(value, this.head);\n this.head = newNode;\n if (!this.tail) {\n this.tail = newNode;\n }\n return this;\n };\n /**\n * 将指定元素添加到链表中\n * @param value\n */\n LinkedList.prototype.append = function (value) {\n var newNode = new LinkedListNode(value);\n // 如果不存在头节点,则将创建的新节点作为头节点\n if (!this.head) {\n this.head = newNode;\n this.tail = newNode;\n return this;\n }\n // 将新节点附加到链表末尾\n this.tail.next = newNode;\n this.tail = newNode;\n return this;\n };\n /**\n * 删除指定元素\n * @param value 要删除的元素\n */\n LinkedList.prototype.delete = function (value) {\n if (!this.head) {\n return null;\n }\n var deleteNode = null;\n // 如果删除的是头部元素,则将next作为头元素\n while (this.head && this.compare(this.head.value, value)) {\n deleteNode = this.head;\n this.head = this.head.next;\n }\n var currentNode = this.head;\n if (currentNode !== null) {\n // 如果删除了节点以后,将next节点前移\n while (currentNode.next) {\n if (this.compare(currentNode.next.value, value)) {\n deleteNode = currentNode.next;\n currentNode.next = currentNode.next.next;\n } else {\n currentNode = currentNode.next;\n }\n }\n }\n // 检查尾部节点是否被删除\n if (this.compare(this.tail.value, value)) {\n this.tail = currentNode;\n }\n return deleteNode;\n };\n /**\n * 查找指定的元素\n * @param param0\n */\n LinkedList.prototype.find = function (_a) {\n var _b = _a.value,\n value = _b === void 0 ? undefined : _b,\n _c = _a.callback,\n callback = _c === void 0 ? undefined : _c;\n if (!this.head) {\n return null;\n }\n var currentNode = this.head;\n while (currentNode) {\n // 如果指定了 callback,则按指定的 callback 查找\n if (callback && callback(currentNode.value)) {\n return currentNode;\n }\n // 如果指定了 value,则按 value 查找\n if (value !== undefined && this.compare(currentNode.value, value)) {\n return currentNode;\n }\n currentNode = currentNode.next;\n }\n return null;\n };\n /**\n * 删除尾部节点\n */\n LinkedList.prototype.deleteTail = function () {\n var deletedTail = this.tail;\n if (this.head === this.tail) {\n // 链表中只有一个元素\n this.head = null;\n this.tail = null;\n return deletedTail;\n }\n var currentNode = this.head;\n while (currentNode.next) {\n if (!currentNode.next.next) {\n currentNode.next = null;\n } else {\n currentNode = currentNode.next;\n }\n }\n this.tail = currentNode;\n return deletedTail;\n };\n /**\n * 删除头部节点\n */\n LinkedList.prototype.deleteHead = function () {\n if (!this.head) {\n return null;\n }\n var deletedHead = this.head;\n if (this.head.next) {\n this.head = this.head.next;\n } else {\n this.head = null;\n this.tail = null;\n }\n return deletedHead;\n };\n /**\n * 将一组元素转成链表中的节点\n * @param values 链表中的元素\n */\n LinkedList.prototype.fromArray = function (values) {\n var _this = this;\n values.forEach(function (value) {\n return _this.append(value);\n });\n return this;\n };\n /**\n * 将链表中的节点转成数组元素\n */\n LinkedList.prototype.toArray = function () {\n var nodes = [];\n var currentNode = this.head;\n while (currentNode) {\n nodes.push(currentNode);\n currentNode = currentNode.next;\n }\n return nodes;\n };\n /**\n * 反转链表中的元素节点\n */\n LinkedList.prototype.reverse = function () {\n var currentNode = this.head;\n var prevNode = null;\n var nextNode = null;\n while (currentNode) {\n // 存储下一个元素节点\n nextNode = currentNode.next;\n // 更改当前节点的下一个节点,以便将它连接到上一个节点上\n currentNode.next = prevNode;\n // 将 prevNode 和 currentNode 向前移动一步\n prevNode = currentNode;\n currentNode = nextNode;\n }\n this.tail = this.head;\n this.head = prevNode;\n };\n LinkedList.prototype.toString = function (callback) {\n if (callback === void 0) {\n callback = undefined;\n }\n return this.toArray().map(function (node) {\n return node.toString(callback);\n }).toString();\n };\n return LinkedList;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (LinkedList);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/linked-list.js?"); /***/ }), @@ -320,7 +320,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _linked_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linked-list */ \"./node_modules/@antv/algorithm/es/structs/linked-list.js\");\n\n\nvar Queue =\n/** @class */\nfunction () {\n function Queue() {\n this.linkedList = new _linked_list__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n }\n /**\n * 队列是否为空\n */\n\n\n Queue.prototype.isEmpty = function () {\n return !this.linkedList.head;\n };\n /**\n * 读取队列头部的元素, 不删除队列中的元素\n */\n\n\n Queue.prototype.peek = function () {\n if (!this.linkedList.head) {\n return null;\n }\n\n return this.linkedList.head.value;\n };\n /**\n * 在队列的尾部新增一个元素\n * @param value\n */\n\n\n Queue.prototype.enqueue = function (value) {\n this.linkedList.append(value);\n };\n /**\n * 删除队列中的头部元素,如果队列为空,则返回 null\n */\n\n\n Queue.prototype.dequeue = function () {\n var removeHead = this.linkedList.deleteHead();\n return removeHead ? removeHead.value : null;\n };\n\n Queue.prototype.toString = function (callback) {\n return this.linkedList.toString(callback);\n };\n\n return Queue;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Queue);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/queue.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _linked_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linked-list */ \"./node_modules/@antv/algorithm/es/structs/linked-list.js\");\n\nvar Queue = /** @class */function () {\n function Queue() {\n this.linkedList = new _linked_list__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n }\n /**\n * 队列是否为空\n */\n Queue.prototype.isEmpty = function () {\n return !this.linkedList.head;\n };\n /**\n * 读取队列头部的元素, 不删除队列中的元素\n */\n Queue.prototype.peek = function () {\n if (!this.linkedList.head) {\n return null;\n }\n return this.linkedList.head.value;\n };\n /**\n * 在队列的尾部新增一个元素\n * @param value\n */\n Queue.prototype.enqueue = function (value) {\n this.linkedList.append(value);\n };\n /**\n * 删除队列中的头部元素,如果队列为空,则返回 null\n */\n Queue.prototype.dequeue = function () {\n var removeHead = this.linkedList.deleteHead();\n return removeHead ? removeHead.value : null;\n };\n Queue.prototype.toString = function (callback) {\n return this.linkedList.toString(callback);\n };\n return Queue;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Queue);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/queue.js?"); /***/ }), @@ -332,7 +332,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lin /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _linked_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linked-list */ \"./node_modules/@antv/algorithm/es/structs/linked-list.js\");\n\n\nvar Stack =\n/** @class */\nfunction () {\n function Stack(maxStep) {\n if (maxStep === void 0) {\n maxStep = 10;\n }\n\n this.linkedList = new _linked_list__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this.maxStep = maxStep;\n }\n\n Object.defineProperty(Stack.prototype, \"length\", {\n get: function get() {\n return this.linkedList.toArray().length;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * 判断栈是否为空,如果链表中没有头部元素,则栈为空\n */\n\n Stack.prototype.isEmpty = function () {\n return !this.linkedList.head;\n };\n /**\n * 是否到定义的栈的最大长度,如果达到最大长度后,不再允许入栈\n */\n\n\n Stack.prototype.isMaxStack = function () {\n return this.toArray().length >= this.maxStep;\n };\n /**\n * 访问顶端元素\n */\n\n\n Stack.prototype.peek = function () {\n if (this.isEmpty()) {\n return null;\n } // 返回头部元素,不删除元素\n\n\n return this.linkedList.head.value;\n };\n\n Stack.prototype.push = function (value) {\n this.linkedList.prepend(value);\n\n if (this.length > this.maxStep) {\n this.linkedList.deleteTail();\n }\n };\n\n Stack.prototype.pop = function () {\n var removeHead = this.linkedList.deleteHead();\n return removeHead ? removeHead.value : null;\n };\n\n Stack.prototype.toArray = function () {\n return this.linkedList.toArray().map(function (node) {\n return node.value;\n });\n };\n\n Stack.prototype.clear = function () {\n while (!this.isEmpty()) {\n this.pop();\n }\n };\n\n return Stack;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Stack);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/stack.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _linked_list__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linked-list */ \"./node_modules/@antv/algorithm/es/structs/linked-list.js\");\n\nvar Stack = /** @class */function () {\n function Stack(maxStep) {\n if (maxStep === void 0) {\n maxStep = 10;\n }\n this.linkedList = new _linked_list__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n this.maxStep = maxStep;\n }\n Object.defineProperty(Stack.prototype, \"length\", {\n get: function get() {\n return this.linkedList.toArray().length;\n },\n enumerable: false,\n configurable: true\n });\n /**\n * 判断栈是否为空,如果链表中没有头部元素,则栈为空\n */\n Stack.prototype.isEmpty = function () {\n return !this.linkedList.head;\n };\n /**\n * 是否到定义的栈的最大长度,如果达到最大长度后,不再允许入栈\n */\n Stack.prototype.isMaxStack = function () {\n return this.toArray().length >= this.maxStep;\n };\n /**\n * 访问顶端元素\n */\n Stack.prototype.peek = function () {\n if (this.isEmpty()) {\n return null;\n }\n // 返回头部元素,不删除元素\n return this.linkedList.head.value;\n };\n Stack.prototype.push = function (value) {\n this.linkedList.prepend(value);\n if (this.length > this.maxStep) {\n this.linkedList.deleteTail();\n }\n };\n Stack.prototype.pop = function () {\n var removeHead = this.linkedList.deleteHead();\n return removeHead ? removeHead.value : null;\n };\n Stack.prototype.toArray = function () {\n return this.linkedList.toArray().map(function (node) {\n return node.value;\n });\n };\n Stack.prototype.clear = function () {\n while (!this.isEmpty()) {\n this.pop();\n }\n };\n return Stack;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Stack);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/stack.js?"); /***/ }), @@ -344,7 +344,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _lin /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 并查集 Disjoint set to support quick union\n */\nvar UnionFind =\n/** @class */\nfunction () {\n function UnionFind(items) {\n this.count = items.length;\n this.parent = {};\n\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var i = items_1[_i];\n this.parent[i] = i;\n }\n } // find the root of the item\n\n\n UnionFind.prototype.find = function (item) {\n while (this.parent[item] !== item) {\n item = this.parent[item];\n }\n\n return item;\n };\n\n UnionFind.prototype.union = function (a, b) {\n var rootA = this.find(a);\n var rootB = this.find(b);\n if (rootA === rootB) return; // make the element with smaller root the parent\n\n if (rootA < rootB) {\n if (this.parent[b] !== b) this.union(this.parent[b], a);\n this.parent[b] = this.parent[a];\n } else {\n if (this.parent[a] !== a) this.union(this.parent[a], b);\n this.parent[a] = this.parent[b];\n }\n }; // whether a and b are connected, i.e. a and b have the same root\n\n\n UnionFind.prototype.connected = function (a, b) {\n return this.find(a) === this.find(b);\n };\n\n return UnionFind;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (UnionFind);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/union-find.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 并查集 Disjoint set to support quick union\n */\nvar UnionFind = /** @class */function () {\n function UnionFind(items) {\n this.count = items.length;\n this.parent = {};\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var i = items_1[_i];\n this.parent[i] = i;\n }\n }\n // find the root of the item\n UnionFind.prototype.find = function (item) {\n while (this.parent[item] !== item) {\n item = this.parent[item];\n }\n return item;\n };\n UnionFind.prototype.union = function (a, b) {\n var rootA = this.find(a);\n var rootB = this.find(b);\n if (rootA === rootB) return;\n // make the element with smaller root the parent\n if (rootA < rootB) {\n if (this.parent[b] !== b) this.union(this.parent[b], a);\n this.parent[b] = this.parent[a];\n } else {\n if (this.parent[a] !== a) this.union(this.parent[a], b);\n this.parent[a] = this.parent[b];\n }\n };\n // whether a and b are connected, i.e. a and b have the same root\n UnionFind.prototype.connected = function (a, b) {\n return this.find(a) === this.find(b);\n };\n return UnionFind;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (UnionFind);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/structs/union-find.js?"); /***/ }), @@ -356,7 +356,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 并查集 Disjoint se /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DistanceType\", function() { return DistanceType; });\nvar DistanceType;\n\n(function (DistanceType) {\n DistanceType[\"EuclideanDistance\"] = \"euclideanDistance\";\n})(DistanceType || (DistanceType = {}));\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/types.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DistanceType\", function() { return DistanceType; });\nvar DistanceType;\n(function (DistanceType) {\n DistanceType[\"EuclideanDistance\"] = \"euclideanDistance\";\n})(DistanceType || (DistanceType = {}));\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/types.js?"); /***/ }), @@ -368,7 +368,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNeighbors\", function() { return getNeighbors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getOutEdgesNodeId\", function() { return getOutEdgesNodeId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getEdgesByNodeId\", function() { return getEdgesByNodeId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return uniqueId; });\n/**\n * 获取指定节点的所有邻居\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n * @param type 邻居类型\n */\nvar getNeighbors = function getNeighbors(nodeId, edges, type) {\n if (edges === void 0) {\n edges = [];\n }\n\n var currentEdges = edges.filter(function (edge) {\n return edge.source === nodeId || edge.target === nodeId;\n });\n\n if (type === 'target') {\n // 当前节点为 source,它所指向的目标节点\n var neighhborsConverter_1 = function neighhborsConverter_1(edge) {\n return edge.source === nodeId;\n };\n\n return currentEdges.filter(neighhborsConverter_1).map(function (edge) {\n return edge.target;\n });\n }\n\n if (type === 'source') {\n // 当前节点为 target,它所指向的源节点\n var neighhborsConverter_2 = function neighhborsConverter_2(edge) {\n return edge.target === nodeId;\n };\n\n return currentEdges.filter(neighhborsConverter_2).map(function (edge) {\n return edge.source;\n });\n } // 若未指定 type ,则返回所有邻居\n\n\n var neighhborsConverter = function neighhborsConverter(edge) {\n return edge.source === nodeId ? edge.target : edge.source;\n };\n\n return currentEdges.map(neighhborsConverter);\n};\n/**\n * 获取指定节点的出边\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n */\n\nvar getOutEdgesNodeId = function getOutEdgesNodeId(nodeId, edges) {\n return edges.filter(function (edge) {\n return edge.source === nodeId;\n });\n};\n/**\n * 获取指定节点的边,包括出边和入边\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n */\n\nvar getEdgesByNodeId = function getEdgesByNodeId(nodeId, edges) {\n return edges.filter(function (edge) {\n return edge.source === nodeId || edge.target === nodeId;\n });\n};\n/**\n * 生成唯一的 ID,规则是序号 + 时间戳\n * @param index 序号\n */\n\nvar uniqueId = function uniqueId(index) {\n if (index === void 0) {\n index = 0;\n }\n\n var random1 = \"\".concat(Math.random()).split('.')[1].substr(0, 5);\n var random2 = \"\".concat(Math.random()).split('.')[1].substr(0, 5);\n return \"\".concat(index, \"-\").concat(random1).concat(random2);\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/util.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNeighbors\", function() { return getNeighbors; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getOutEdgesNodeId\", function() { return getOutEdgesNodeId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getEdgesByNodeId\", function() { return getEdgesByNodeId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return uniqueId; });\n/**\n * 获取指定节点的所有邻居\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n * @param type 邻居类型\n */\nvar getNeighbors = function getNeighbors(nodeId, edges, type) {\n if (edges === void 0) {\n edges = [];\n }\n var currentEdges = edges.filter(function (edge) {\n return edge.source === nodeId || edge.target === nodeId;\n });\n if (type === 'target') {\n // 当前节点为 source,它所指向的目标节点\n var neighhborsConverter_1 = function neighhborsConverter_1(edge) {\n return edge.source === nodeId;\n };\n return currentEdges.filter(neighhborsConverter_1).map(function (edge) {\n return edge.target;\n });\n }\n if (type === 'source') {\n // 当前节点为 target,它所指向的源节点\n var neighhborsConverter_2 = function neighhborsConverter_2(edge) {\n return edge.target === nodeId;\n };\n return currentEdges.filter(neighhborsConverter_2).map(function (edge) {\n return edge.source;\n });\n }\n // 若未指定 type ,则返回所有邻居\n var neighhborsConverter = function neighhborsConverter(edge) {\n return edge.source === nodeId ? edge.target : edge.source;\n };\n return currentEdges.map(neighhborsConverter);\n};\n/**\n * 获取指定节点的出边\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n */\nvar getOutEdgesNodeId = function getOutEdgesNodeId(nodeId, edges) {\n return edges.filter(function (edge) {\n return edge.source === nodeId;\n });\n};\n/**\n * 获取指定节点的边,包括出边和入边\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n */\nvar getEdgesByNodeId = function getEdgesByNodeId(nodeId, edges) {\n return edges.filter(function (edge) {\n return edge.source === nodeId || edge.target === nodeId;\n });\n};\n/**\n * 生成唯一的 ID,规则是序号 + 时间戳\n * @param index 序号\n */\nvar uniqueId = function uniqueId(index) {\n if (index === void 0) {\n index = 0;\n }\n var random1 = \"\".concat(Math.random()).split('.')[1].substr(0, 5);\n var random2 = \"\".concat(Math.random()).split('.')[1].substr(0, 5);\n return \"\".concat(index, \"-\").concat(random1).concat(random2);\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/util.js?"); /***/ }), @@ -380,7 +380,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAllKeyValueMap\", function() { return getAllKeyValueMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"oneHot\", function() { return oneHot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDistance\", function() { return getDistance; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types */ \"./node_modules/@antv/algorithm/es/types.js\");\n/* harmony import */ var _vector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vector */ \"./node_modules/@antv/algorithm/es/utils/vector.js\");\n\n\n\n/**\n * 获取数据中所有的属性及其对应的值\n * @param dataList 数据集\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\n\nvar getAllKeyValueMap = function getAllKeyValueMap(dataList, involvedKeys, uninvolvedKeys) {\n var keys = []; // 指定了参与计算的keys时,使用指定的keys\n\n if (involvedKeys === null || involvedKeys === void 0 ? void 0 : involvedKeys.length) {\n keys = involvedKeys;\n } else {\n // 未指定抽取的keys时,提取数据中所有的key\n dataList.forEach(function (data) {\n keys = keys.concat(Object.keys(data));\n });\n keys = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"uniq\"])(keys);\n } // 获取所有值非空的key的value数组\n\n\n var allKeyValueMap = {};\n keys.forEach(function (key) {\n var value = [];\n dataList.forEach(function (data) {\n if (data[key] !== undefined && data[key] !== '') {\n value.push(data[key]);\n }\n });\n\n if (value.length && !(uninvolvedKeys === null || uninvolvedKeys === void 0 ? void 0 : uninvolvedKeys.includes(key))) {\n allKeyValueMap[key] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"uniq\"])(value);\n }\n });\n return allKeyValueMap;\n};\n/**\n * one-hot编码:数据特征提取\n * @param dataList 数据集\n * @param involvedKeys 参与计算的的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\n\nvar oneHot = function oneHot(dataList, involvedKeys, uninvolvedKeys) {\n // 获取数据中所有的属性/特征及其对应的值\n var allKeyValueMap = getAllKeyValueMap(dataList, involvedKeys, uninvolvedKeys);\n var oneHotCode = [];\n\n if (!Object.keys(allKeyValueMap).length) {\n return oneHotCode;\n } // 获取所有的属性/特征值\n\n\n var allValue = Object.values(allKeyValueMap); // 是否所有属性/特征的值都是数值型\n\n var isAllNumber = allValue.every(function (value) {\n return value.every(function (item) {\n return typeof item === 'number';\n });\n }); // 对数据进行one-hot编码\n\n dataList.forEach(function (data, index) {\n var code = [];\n Object.keys(allKeyValueMap).forEach(function (key) {\n var keyValue = data[key];\n var allKeyValue = allKeyValueMap[key];\n var valueIndex = allKeyValue.findIndex(function (value) {\n return keyValue === value;\n });\n var subCode = []; // 如果属性/特征所有的值都能转成数值型,不满足分箱,则直接用值(todo: 为了收敛更快,需做归一化处理)\n\n if (isAllNumber) {\n subCode.push(keyValue);\n } else {\n // 进行one-hot编码\n for (var i = 0; i < allKeyValue.length; i++) {\n if (i === valueIndex) {\n subCode.push(1);\n } else {\n subCode.push(0);\n }\n }\n }\n\n code = code.concat(subCode);\n });\n oneHotCode[index] = code;\n });\n return oneHotCode;\n};\n/**\n * getDistance:获取两个元素之间的距离\n * @param item\n * @param otherItem\n * @param distanceType 距离类型\n * @param graphData 图数据\n */\n\nvar getDistance = function getDistance(item, otherItem, distanceType, graphData) {\n if (distanceType === void 0) {\n distanceType = _types__WEBPACK_IMPORTED_MODULE_1__[\"DistanceType\"].EuclideanDistance;\n }\n\n var distance = 0;\n\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_1__[\"DistanceType\"].EuclideanDistance:\n distance = new _vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](item).euclideanDistance(new _vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](otherItem));\n break;\n\n default:\n break;\n }\n\n return distance;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getAllKeyValueMap: getAllKeyValueMap,\n oneHot: oneHot,\n getDistance: getDistance\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/utils/data-preprocessing.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAllKeyValueMap\", function() { return getAllKeyValueMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"oneHot\", function() { return oneHot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDistance\", function() { return getDistance; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../types */ \"./node_modules/@antv/algorithm/es/types.js\");\n/* harmony import */ var _vector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vector */ \"./node_modules/@antv/algorithm/es/utils/vector.js\");\n\n\n\n/**\n * 获取数据中所有的属性及其对应的值\n * @param dataList 数据集\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\nvar getAllKeyValueMap = function getAllKeyValueMap(dataList, involvedKeys, uninvolvedKeys) {\n var keys = [];\n // 指定了参与计算的keys时,使用指定的keys\n if (involvedKeys === null || involvedKeys === void 0 ? void 0 : involvedKeys.length) {\n keys = involvedKeys;\n } else {\n // 未指定抽取的keys时,提取数据中所有的key\n dataList.forEach(function (data) {\n keys = keys.concat(Object.keys(data));\n });\n keys = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"uniq\"])(keys);\n }\n // 获取所有值非空的key的value数组\n var allKeyValueMap = {};\n keys.forEach(function (key) {\n var value = [];\n dataList.forEach(function (data) {\n if (data[key] !== undefined && data[key] !== '') {\n value.push(data[key]);\n }\n });\n if (value.length && !(uninvolvedKeys === null || uninvolvedKeys === void 0 ? void 0 : uninvolvedKeys.includes(key))) {\n allKeyValueMap[key] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"uniq\"])(value);\n }\n });\n return allKeyValueMap;\n};\n/**\n * one-hot编码:数据特征提取\n * @param dataList 数据集\n * @param involvedKeys 参与计算的的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\nvar oneHot = function oneHot(dataList, involvedKeys, uninvolvedKeys) {\n // 获取数据中所有的属性/特征及其对应的值\n var allKeyValueMap = getAllKeyValueMap(dataList, involvedKeys, uninvolvedKeys);\n var oneHotCode = [];\n if (!Object.keys(allKeyValueMap).length) {\n return oneHotCode;\n }\n // 获取所有的属性/特征值\n var allValue = Object.values(allKeyValueMap);\n // 是否所有属性/特征的值都是数值型\n var isAllNumber = allValue.every(function (value) {\n return value.every(function (item) {\n return typeof item === 'number';\n });\n });\n // 对数据进行one-hot编码\n dataList.forEach(function (data, index) {\n var code = [];\n Object.keys(allKeyValueMap).forEach(function (key) {\n var keyValue = data[key];\n var allKeyValue = allKeyValueMap[key];\n var valueIndex = allKeyValue.findIndex(function (value) {\n return keyValue === value;\n });\n var subCode = [];\n // 如果属性/特征所有的值都能转成数值型,不满足分箱,则直接用值(todo: 为了收敛更快,需做归一化处理)\n if (isAllNumber) {\n subCode.push(keyValue);\n } else {\n // 进行one-hot编码\n for (var i = 0; i < allKeyValue.length; i++) {\n if (i === valueIndex) {\n subCode.push(1);\n } else {\n subCode.push(0);\n }\n }\n }\n code = code.concat(subCode);\n });\n oneHotCode[index] = code;\n });\n return oneHotCode;\n};\n/**\n * getDistance:获取两个元素之间的距离\n * @param item\n * @param otherItem\n * @param distanceType 距离类型\n * @param graphData 图数据\n */\nvar getDistance = function getDistance(item, otherItem, distanceType, graphData) {\n if (distanceType === void 0) {\n distanceType = _types__WEBPACK_IMPORTED_MODULE_1__[\"DistanceType\"].EuclideanDistance;\n }\n var distance = 0;\n switch (distanceType) {\n case _types__WEBPACK_IMPORTED_MODULE_1__[\"DistanceType\"].EuclideanDistance:\n distance = new _vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](item).euclideanDistance(new _vector__WEBPACK_IMPORTED_MODULE_2__[\"default\"](otherItem));\n break;\n default:\n break;\n }\n return distance;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getAllKeyValueMap: getAllKeyValueMap,\n oneHot: oneHot,\n getDistance: getDistance\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/utils/data-preprocessing.js?"); /***/ }), @@ -392,7 +392,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAllSortProperties\", function() { return getAllSortProperties; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPropertyWeight\", function() { return getPropertyWeight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAllProperties\", function() { return getAllProperties; });\n/* harmony import */ var _constants_time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/time */ \"./node_modules/@antv/algorithm/es/constants/time.js\");\n // 获取所有属性并排序\n\nvar getAllSortProperties = function getAllSortProperties(nodes, n) {\n if (nodes === void 0) {\n nodes = [];\n }\n\n if (n === void 0) {\n n = 100;\n }\n\n var propertyKeyInfo = {};\n nodes.forEach(function (node) {\n if (!node.properties) {\n return;\n }\n\n Object.keys(node.properties).forEach(function (propertyKey) {\n // 目前过滤只保留可以转成数值型的或日期型的, todo: 统一转成one-hot特征向量或者embedding\n if (propertyKey === 'id' || !\"\".concat(node.properties[propertyKey]).match(_constants_time__WEBPACK_IMPORTED_MODULE_0__[\"secondReg\"]) && !\"\".concat(node.properties[propertyKey]).match(_constants_time__WEBPACK_IMPORTED_MODULE_0__[\"dateReg\"]) && isNaN(Number(node.properties[propertyKey]))) {\n if (propertyKeyInfo.hasOwnProperty(propertyKey)) {\n delete propertyKeyInfo[propertyKey];\n }\n\n return;\n }\n\n if (propertyKeyInfo.hasOwnProperty(propertyKey)) {\n propertyKeyInfo[propertyKey] += 1;\n } else {\n propertyKeyInfo[propertyKey] = 1;\n }\n });\n }); // 取top50的属性\n\n var sortKeys = Object.keys(propertyKeyInfo).sort(function (a, b) {\n return propertyKeyInfo[b] - propertyKeyInfo[a];\n });\n return sortKeys.length < n ? sortKeys : sortKeys.slice(0, n);\n};\n\nvar processProperty = function processProperty(properties, propertyKeys) {\n return propertyKeys.map(function (key) {\n if (properties.hasOwnProperty(key)) {\n // // 可以转成数值的直接转成数值\n // if (!isNaN(Number(properties[key]))) {\n // return Number(properties[key]);\n // }\n // // 时间型的转成时间戳\n // if (properties[key].match(secondReg) || properties[key].match(dateReg)) {\n // // @ts-ignore\n // return Number(Date.parse(new Date(properties[key]))) / 1000;\n // }\n return properties[key];\n }\n\n return 0;\n });\n}; // 获取属性特征权重\n\n\nvar getPropertyWeight = function getPropertyWeight(nodes) {\n var propertyKeys = getAllSortProperties(nodes);\n var allPropertiesWeight = [];\n\n for (var i = 0; i < nodes.length; i++) {\n allPropertiesWeight[i] = processProperty(nodes[i].properties, propertyKeys);\n }\n\n return allPropertiesWeight;\n}; // 获取所有节点的属性集合\n\nvar getAllProperties = function getAllProperties(nodes, key) {\n if (key === void 0) {\n key = undefined;\n }\n\n var allProperties = [];\n nodes.forEach(function (node) {\n if (key === undefined) {\n allProperties.push(node);\n }\n\n if (node[key] !== undefined) {\n allProperties.push(node[key]);\n }\n });\n return allProperties;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getAllSortProperties: getAllSortProperties,\n getPropertyWeight: getPropertyWeight,\n getAllProperties: getAllProperties\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/utils/node-properties.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAllSortProperties\", function() { return getAllSortProperties; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPropertyWeight\", function() { return getPropertyWeight; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAllProperties\", function() { return getAllProperties; });\n/* harmony import */ var _constants_time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../constants/time */ \"./node_modules/@antv/algorithm/es/constants/time.js\");\n\n// 获取所有属性并排序\nvar getAllSortProperties = function getAllSortProperties(nodes, n) {\n if (nodes === void 0) {\n nodes = [];\n }\n if (n === void 0) {\n n = 100;\n }\n var propertyKeyInfo = {};\n nodes.forEach(function (node) {\n if (!node.properties) {\n return;\n }\n Object.keys(node.properties).forEach(function (propertyKey) {\n // 目前过滤只保留可以转成数值型的或日期型的, todo: 统一转成one-hot特征向量或者embedding\n if (propertyKey === 'id' || !\"\".concat(node.properties[propertyKey]).match(_constants_time__WEBPACK_IMPORTED_MODULE_0__[\"secondReg\"]) && !\"\".concat(node.properties[propertyKey]).match(_constants_time__WEBPACK_IMPORTED_MODULE_0__[\"dateReg\"]) && isNaN(Number(node.properties[propertyKey]))) {\n if (propertyKeyInfo.hasOwnProperty(propertyKey)) {\n delete propertyKeyInfo[propertyKey];\n }\n return;\n }\n if (propertyKeyInfo.hasOwnProperty(propertyKey)) {\n propertyKeyInfo[propertyKey] += 1;\n } else {\n propertyKeyInfo[propertyKey] = 1;\n }\n });\n });\n // 取top50的属性\n var sortKeys = Object.keys(propertyKeyInfo).sort(function (a, b) {\n return propertyKeyInfo[b] - propertyKeyInfo[a];\n });\n return sortKeys.length < n ? sortKeys : sortKeys.slice(0, n);\n};\nvar processProperty = function processProperty(properties, propertyKeys) {\n return propertyKeys.map(function (key) {\n if (properties.hasOwnProperty(key)) {\n // // 可以转成数值的直接转成数值\n // if (!isNaN(Number(properties[key]))) {\n // return Number(properties[key]);\n // }\n // // 时间型的转成时间戳\n // if (properties[key].match(secondReg) || properties[key].match(dateReg)) {\n // // @ts-ignore\n // return Number(Date.parse(new Date(properties[key]))) / 1000;\n // }\n return properties[key];\n }\n return 0;\n });\n};\n// 获取属性特征权重\nvar getPropertyWeight = function getPropertyWeight(nodes) {\n var propertyKeys = getAllSortProperties(nodes);\n var allPropertiesWeight = [];\n for (var i = 0; i < nodes.length; i++) {\n allPropertiesWeight[i] = processProperty(nodes[i].properties, propertyKeys);\n }\n return allPropertiesWeight;\n};\n// 获取所有节点的属性集合\nvar getAllProperties = function getAllProperties(nodes, key) {\n if (key === void 0) {\n key = undefined;\n }\n var allProperties = [];\n nodes.forEach(function (node) {\n if (key === undefined) {\n allProperties.push(node);\n }\n if (node[key] !== undefined) {\n allProperties.push(node[key]);\n }\n });\n return allProperties;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getAllSortProperties: getAllSortProperties,\n getPropertyWeight: getPropertyWeight,\n getAllProperties: getAllProperties\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/utils/node-properties.js?"); /***/ }), @@ -404,7 +404,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/**\n * 向量运算\n */\n\n\nvar Vector =\n/** @class */\nfunction () {\n function Vector(arr) {\n this.arr = arr;\n }\n\n Vector.prototype.getArr = function () {\n return this.arr || [];\n };\n\n Vector.prototype.add = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return new Vector(otherArr);\n }\n\n if (!(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return new Vector(this.arr);\n }\n\n if (this.arr.length === otherArr.length) {\n var res = [];\n\n for (var index in this.arr) {\n res[index] = this.arr[index] + otherArr[index];\n }\n\n return new Vector(res);\n }\n };\n\n Vector.prototype.subtract = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return new Vector(otherArr);\n }\n\n if (!(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return new Vector(this.arr);\n }\n\n if (this.arr.length === otherArr.length) {\n var res = [];\n\n for (var index in this.arr) {\n res[index] = this.arr[index] - otherArr[index];\n }\n\n return new Vector(res);\n }\n };\n\n Vector.prototype.avg = function (length) {\n var res = [];\n\n if (length !== 0) {\n for (var index in this.arr) {\n res[index] = this.arr[index] / length;\n }\n }\n\n return new Vector(res);\n };\n\n Vector.prototype.negate = function () {\n var res = [];\n\n for (var index in this.arr) {\n res[index] = -this.arr[index];\n }\n\n return new Vector(res);\n }; // 平方欧式距离\n\n\n Vector.prototype.squareEuclideanDistance = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n\n if (this.arr.length === otherArr.length) {\n var res = 0;\n\n for (var index in this.arr) {\n res += Math.pow(this.arr[index] - otherVector.arr[index], 2);\n }\n\n return res;\n }\n }; // 欧式距离\n\n\n Vector.prototype.euclideanDistance = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n\n if (this.arr.length === otherArr.length) {\n var res = 0;\n\n for (var index in this.arr) {\n res += Math.pow(this.arr[index] - otherVector.arr[index], 2);\n }\n\n return Math.sqrt(res);\n } else {\n console.error('The two vectors are unequal in length.');\n }\n }; // 归一化处理\n\n\n Vector.prototype.normalize = function () {\n var res = [];\n var cloneArr = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(this.arr);\n cloneArr.sort(function (a, b) {\n return a - b;\n });\n var max = cloneArr[cloneArr.length - 1];\n var min = cloneArr[0];\n\n for (var index in this.arr) {\n res[index] = (this.arr[index] - min) / (max - min);\n }\n\n return new Vector(res);\n }; // 2范数 or 模长\n\n\n Vector.prototype.norm2 = function () {\n var _a;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return 0;\n }\n\n var res = 0;\n\n for (var index in this.arr) {\n res += Math.pow(this.arr[index], 2);\n }\n\n return Math.sqrt(res);\n }; // 两个向量的点积\n\n\n Vector.prototype.dot = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n\n if (this.arr.length === otherArr.length) {\n var res = 0;\n\n for (var index in this.arr) {\n res += this.arr[index] * otherVector.arr[index];\n }\n\n return res;\n } else {\n console.error('The two vectors are unequal in length.');\n }\n }; // 两个向量比较\n\n\n Vector.prototype.equal = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) !== (otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return false;\n }\n\n for (var index in this.arr) {\n if (this.arr[index] !== otherArr[index]) {\n return false;\n }\n }\n\n return true;\n };\n\n return Vector;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Vector);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/utils/vector.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/**\n * 向量运算\n */\n\nvar Vector = /** @class */function () {\n function Vector(arr) {\n this.arr = arr;\n }\n Vector.prototype.getArr = function () {\n return this.arr || [];\n };\n Vector.prototype.add = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return new Vector(otherArr);\n }\n if (!(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return new Vector(this.arr);\n }\n if (this.arr.length === otherArr.length) {\n var res = [];\n for (var index in this.arr) {\n res[index] = this.arr[index] + otherArr[index];\n }\n return new Vector(res);\n }\n };\n Vector.prototype.subtract = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return new Vector(otherArr);\n }\n if (!(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return new Vector(this.arr);\n }\n if (this.arr.length === otherArr.length) {\n var res = [];\n for (var index in this.arr) {\n res[index] = this.arr[index] - otherArr[index];\n }\n return new Vector(res);\n }\n };\n Vector.prototype.avg = function (length) {\n var res = [];\n if (length !== 0) {\n for (var index in this.arr) {\n res[index] = this.arr[index] / length;\n }\n }\n return new Vector(res);\n };\n Vector.prototype.negate = function () {\n var res = [];\n for (var index in this.arr) {\n res[index] = -this.arr[index];\n }\n return new Vector(res);\n };\n // 平方欧式距离\n Vector.prototype.squareEuclideanDistance = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n if (this.arr.length === otherArr.length) {\n var res = 0;\n for (var index in this.arr) {\n res += Math.pow(this.arr[index] - otherVector.arr[index], 2);\n }\n return res;\n }\n };\n // 欧式距离\n Vector.prototype.euclideanDistance = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n if (this.arr.length === otherArr.length) {\n var res = 0;\n for (var index in this.arr) {\n res += Math.pow(this.arr[index] - otherVector.arr[index], 2);\n }\n return Math.sqrt(res);\n } else {\n console.error('The two vectors are unequal in length.');\n }\n };\n // 归一化处理\n Vector.prototype.normalize = function () {\n var res = [];\n var cloneArr = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(this.arr);\n cloneArr.sort(function (a, b) {\n return a - b;\n });\n var max = cloneArr[cloneArr.length - 1];\n var min = cloneArr[0];\n for (var index in this.arr) {\n res[index] = (this.arr[index] - min) / (max - min);\n }\n return new Vector(res);\n };\n // 2范数 or 模长\n Vector.prototype.norm2 = function () {\n var _a;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return 0;\n }\n var res = 0;\n for (var index in this.arr) {\n res += Math.pow(this.arr[index], 2);\n }\n return Math.sqrt(res);\n };\n // 两个向量的点积\n Vector.prototype.dot = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n if (this.arr.length === otherArr.length) {\n var res = 0;\n for (var index in this.arr) {\n res += this.arr[index] * otherVector.arr[index];\n }\n return res;\n } else {\n console.error('The two vectors are unequal in length.');\n }\n };\n // 两个向量比较\n Vector.prototype.equal = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) !== (otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return false;\n }\n for (var index in this.arr) {\n if (this.arr[index] !== otherArr[index]) {\n return false;\n }\n }\n return true;\n };\n return Vector;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Vector);\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/es/utils/vector.js?"); /***/ }), @@ -416,7 +416,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ant /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar adjMatrix = function adjMatrix(graphData, directed) {\n var nodes = graphData.nodes,\n edges = graphData.edges;\n var matrix = []; // map node with index in data.nodes\n\n var nodeMap = {};\n\n if (!nodes) {\n throw new Error(\"invalid nodes data!\");\n }\n\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n\n if (edges) {\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n if (!sIndex && sIndex !== 0 || !tIndex && tIndex !== 0) return;\n matrix[sIndex][tIndex] = 1;\n\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n\n return matrix;\n};\n\nvar _default = adjMatrix;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/adjacent-matrix.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar adjMatrix = function adjMatrix(graphData, directed) {\n var nodes = graphData.nodes,\n edges = graphData.edges;\n var matrix = [];\n // map node with index in data.nodes\n var nodeMap = {};\n if (!nodes) {\n throw new Error(\"invalid nodes data!\");\n }\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n if (edges) {\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n if (!sIndex && sIndex !== 0 || !tIndex && tIndex !== 0) return;\n matrix[sIndex][tIndex] = 1;\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n return matrix;\n};\nvar _default = adjMatrix;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/adjacent-matrix.js?"); /***/ }), @@ -428,7 +428,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"GADDIAsync\", {\n enumerable: true,\n get: function get() {\n return _index.GADDIAsync;\n }\n});\nObject.defineProperty(exports, \"connectedComponentAsync\", {\n enumerable: true,\n get: function get() {\n return _index.connectedComponentAsync;\n }\n});\nexports.default = void 0;\nObject.defineProperty(exports, \"detectAllCyclesAsync\", {\n enumerable: true,\n get: function get() {\n return _index.detectAllCyclesAsync;\n }\n});\nObject.defineProperty(exports, \"detectAllDirectedCycleAsync\", {\n enumerable: true,\n get: function get() {\n return _index.detectAllDirectedCycleAsync;\n }\n});\nObject.defineProperty(exports, \"detectAllUndirectedCycleAsync\", {\n enumerable: true,\n get: function get() {\n return _index.detectAllUndirectedCycleAsync;\n }\n});\nObject.defineProperty(exports, \"detectCycleAsync\", {\n enumerable: true,\n get: function get() {\n return _index.detectCycleAsync;\n }\n});\nexports.detectDirectedCycleAsync = void 0;\nObject.defineProperty(exports, \"dijkstraAsync\", {\n enumerable: true,\n get: function get() {\n return _index.dijkstraAsync;\n }\n});\nObject.defineProperty(exports, \"findAllPathAsync\", {\n enumerable: true,\n get: function get() {\n return _index.findAllPathAsync;\n }\n});\nObject.defineProperty(exports, \"findShortestPathAsync\", {\n enumerable: true,\n get: function get() {\n return _index.findShortestPathAsync;\n }\n});\nObject.defineProperty(exports, \"floydWarshallAsync\", {\n enumerable: true,\n get: function get() {\n return _index.floydWarshallAsync;\n }\n});\nObject.defineProperty(exports, \"getAdjMatrixAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getAdjMatrixAsync;\n }\n});\nObject.defineProperty(exports, \"getDegreeAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getDegreeAsync;\n }\n});\nObject.defineProperty(exports, \"getInDegreeAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getInDegreeAsync;\n }\n});\nObject.defineProperty(exports, \"getNeighborsAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getNeighborsAsync;\n }\n});\nObject.defineProperty(exports, \"getOutDegreeAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getOutDegreeAsync;\n }\n});\nObject.defineProperty(exports, \"labelPropagationAsync\", {\n enumerable: true,\n get: function get() {\n return _index.labelPropagationAsync;\n }\n});\nObject.defineProperty(exports, \"louvainAsync\", {\n enumerable: true,\n get: function get() {\n return _index.louvainAsync;\n }\n});\nObject.defineProperty(exports, \"minimumSpanningTreeAsync\", {\n enumerable: true,\n get: function get() {\n return _index.minimumSpanningTreeAsync;\n }\n});\nObject.defineProperty(exports, \"pageRankAsync\", {\n enumerable: true,\n get: function get() {\n return _index.pageRankAsync;\n }\n});\n\nvar _index = __webpack_require__(/*! ./workers/index */ \"./node_modules/@antv/algorithm/lib/workers/index.js\");\n\nvar detectDirectedCycleAsync = _index.detectCycleAsync;\nexports.detectDirectedCycleAsync = detectDirectedCycleAsync;\nvar _default = {\n getAdjMatrixAsync: _index.getAdjMatrixAsync,\n connectedComponentAsync: _index.connectedComponentAsync,\n getDegreeAsync: _index.getDegreeAsync,\n getInDegreeAsync: _index.getInDegreeAsync,\n getOutDegreeAsync: _index.getOutDegreeAsync,\n detectCycleAsync: _index.detectCycleAsync,\n detectDirectedCycleAsync: detectDirectedCycleAsync,\n detectAllCyclesAsync: _index.detectAllCyclesAsync,\n detectAllDirectedCycleAsync: _index.detectAllDirectedCycleAsync,\n detectAllUndirectedCycleAsync: _index.detectAllUndirectedCycleAsync,\n dijkstraAsync: _index.dijkstraAsync,\n findAllPathAsync: _index.findAllPathAsync,\n findShortestPathAsync: _index.findShortestPathAsync,\n floydWarshallAsync: _index.floydWarshallAsync,\n labelPropagationAsync: _index.labelPropagationAsync,\n louvainAsync: _index.louvainAsync,\n minimumSpanningTreeAsync: _index.minimumSpanningTreeAsync,\n pageRankAsync: _index.pageRankAsync,\n getNeighborsAsync: _index.getNeighborsAsync,\n GADDIAsync: _index.GADDIAsync\n};\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/asyncIndex.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"GADDIAsync\", {\n enumerable: true,\n get: function get() {\n return _index.GADDIAsync;\n }\n});\nObject.defineProperty(exports, \"connectedComponentAsync\", {\n enumerable: true,\n get: function get() {\n return _index.connectedComponentAsync;\n }\n});\nexports.default = void 0;\nObject.defineProperty(exports, \"detectAllCyclesAsync\", {\n enumerable: true,\n get: function get() {\n return _index.detectAllCyclesAsync;\n }\n});\nObject.defineProperty(exports, \"detectAllDirectedCycleAsync\", {\n enumerable: true,\n get: function get() {\n return _index.detectAllDirectedCycleAsync;\n }\n});\nObject.defineProperty(exports, \"detectAllUndirectedCycleAsync\", {\n enumerable: true,\n get: function get() {\n return _index.detectAllUndirectedCycleAsync;\n }\n});\nObject.defineProperty(exports, \"detectCycleAsync\", {\n enumerable: true,\n get: function get() {\n return _index.detectCycleAsync;\n }\n});\nexports.detectDirectedCycleAsync = void 0;\nObject.defineProperty(exports, \"dijkstraAsync\", {\n enumerable: true,\n get: function get() {\n return _index.dijkstraAsync;\n }\n});\nObject.defineProperty(exports, \"findAllPathAsync\", {\n enumerable: true,\n get: function get() {\n return _index.findAllPathAsync;\n }\n});\nObject.defineProperty(exports, \"findShortestPathAsync\", {\n enumerable: true,\n get: function get() {\n return _index.findShortestPathAsync;\n }\n});\nObject.defineProperty(exports, \"floydWarshallAsync\", {\n enumerable: true,\n get: function get() {\n return _index.floydWarshallAsync;\n }\n});\nObject.defineProperty(exports, \"getAdjMatrixAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getAdjMatrixAsync;\n }\n});\nObject.defineProperty(exports, \"getDegreeAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getDegreeAsync;\n }\n});\nObject.defineProperty(exports, \"getInDegreeAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getInDegreeAsync;\n }\n});\nObject.defineProperty(exports, \"getNeighborsAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getNeighborsAsync;\n }\n});\nObject.defineProperty(exports, \"getOutDegreeAsync\", {\n enumerable: true,\n get: function get() {\n return _index.getOutDegreeAsync;\n }\n});\nObject.defineProperty(exports, \"labelPropagationAsync\", {\n enumerable: true,\n get: function get() {\n return _index.labelPropagationAsync;\n }\n});\nObject.defineProperty(exports, \"louvainAsync\", {\n enumerable: true,\n get: function get() {\n return _index.louvainAsync;\n }\n});\nObject.defineProperty(exports, \"minimumSpanningTreeAsync\", {\n enumerable: true,\n get: function get() {\n return _index.minimumSpanningTreeAsync;\n }\n});\nObject.defineProperty(exports, \"pageRankAsync\", {\n enumerable: true,\n get: function get() {\n return _index.pageRankAsync;\n }\n});\nvar _index = __webpack_require__(/*! ./workers/index */ \"./node_modules/@antv/algorithm/lib/workers/index.js\");\nvar detectDirectedCycleAsync = _index.detectCycleAsync;\nexports.detectDirectedCycleAsync = detectDirectedCycleAsync;\nvar _default = {\n getAdjMatrixAsync: _index.getAdjMatrixAsync,\n connectedComponentAsync: _index.connectedComponentAsync,\n getDegreeAsync: _index.getDegreeAsync,\n getInDegreeAsync: _index.getInDegreeAsync,\n getOutDegreeAsync: _index.getOutDegreeAsync,\n detectCycleAsync: _index.detectCycleAsync,\n detectDirectedCycleAsync: detectDirectedCycleAsync,\n detectAllCyclesAsync: _index.detectAllCyclesAsync,\n detectAllDirectedCycleAsync: _index.detectAllDirectedCycleAsync,\n detectAllUndirectedCycleAsync: _index.detectAllUndirectedCycleAsync,\n dijkstraAsync: _index.dijkstraAsync,\n findAllPathAsync: _index.findAllPathAsync,\n findShortestPathAsync: _index.findShortestPathAsync,\n floydWarshallAsync: _index.floydWarshallAsync,\n labelPropagationAsync: _index.labelPropagationAsync,\n louvainAsync: _index.louvainAsync,\n minimumSpanningTreeAsync: _index.minimumSpanningTreeAsync,\n pageRankAsync: _index.pageRankAsync,\n getNeighborsAsync: _index.getNeighborsAsync,\n GADDIAsync: _index.GADDIAsync\n};\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/asyncIndex.js?"); /***/ }), @@ -440,7 +440,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _queue = _interopRequireDefault(__webpack_require__(/*! ./structs/queue */ \"./node_modules/@antv/algorithm/lib/structs/queue.js\"));\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n *\n * @param callbacks\n * allowTraversal: 确定 BFS 是否从顶点沿着边遍历到其邻居,默认情况下,同一个节点只能遍历一次\n * enterNode: 当 BFS 访问某个节点时调用\n * leaveNode: 当 BFS 访问访问结束某个节点时调用\n */\nfunction initCallbacks(callbacks) {\n if (callbacks === void 0) {\n callbacks = {};\n }\n\n var initiatedCallback = callbacks;\n\n var stubCallback = function stubCallback() {};\n\n var allowTraversalCallback = function () {\n var seen = {};\n return function (_a) {\n var next = _a.next;\n var id = next;\n\n if (!seen[id]) {\n seen[id] = true;\n return true;\n }\n\n return false;\n };\n }();\n\n initiatedCallback.allowTraversal = callbacks.allowTraversal || allowTraversalCallback;\n initiatedCallback.enter = callbacks.enter || stubCallback;\n initiatedCallback.leave = callbacks.leave || stubCallback;\n return initiatedCallback;\n}\n/**\n * 广度优先遍历图\n * @param graph Graph 图实例\n * @param startNode 开始遍历的节点\n * @param originalCallbacks 回调\n */\n\n\nvar breadthFirstSearch = function breadthFirstSearch(graphData, startNodeId, originalCallbacks, directed) {\n if (directed === void 0) {\n directed = true;\n }\n\n var callbacks = initCallbacks(originalCallbacks);\n var nodeQueue = new _queue.default();\n var _a = graphData.edges,\n edges = _a === void 0 ? [] : _a; // 初始化队列元素\n\n nodeQueue.enqueue(startNodeId);\n var previousNode = '';\n\n var _loop_1 = function _loop_1() {\n var currentNode = nodeQueue.dequeue();\n callbacks.enter({\n current: currentNode,\n previous: previousNode\n }); // 将所有邻居添加到队列中以便遍历\n\n (0, _util.getNeighbors)(currentNode, edges, directed ? 'target' : undefined).forEach(function (nextNode) {\n if (callbacks.allowTraversal({\n previous: previousNode,\n current: currentNode,\n next: nextNode\n })) {\n nodeQueue.enqueue(nextNode);\n }\n });\n callbacks.leave({\n current: currentNode,\n previous: previousNode\n }); // 下一次循环之前存储当前顶点\n\n previousNode = currentNode;\n }; // 遍历队列中的所有顶点\n\n\n while (!nodeQueue.isEmpty()) {\n _loop_1();\n }\n};\n\nvar _default = breadthFirstSearch;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/bfs.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _queue = _interopRequireDefault(__webpack_require__(/*! ./structs/queue */ \"./node_modules/@antv/algorithm/lib/structs/queue.js\"));\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n *\n * @param callbacks\n * allowTraversal: 确定 BFS 是否从顶点沿着边遍历到其邻居,默认情况下,同一个节点只能遍历一次\n * enterNode: 当 BFS 访问某个节点时调用\n * leaveNode: 当 BFS 访问访问结束某个节点时调用\n */\nfunction initCallbacks(callbacks) {\n if (callbacks === void 0) {\n callbacks = {};\n }\n var initiatedCallback = callbacks;\n var stubCallback = function stubCallback() {};\n var allowTraversalCallback = function () {\n var seen = {};\n return function (_a) {\n var next = _a.next;\n var id = next;\n if (!seen[id]) {\n seen[id] = true;\n return true;\n }\n return false;\n };\n }();\n initiatedCallback.allowTraversal = callbacks.allowTraversal || allowTraversalCallback;\n initiatedCallback.enter = callbacks.enter || stubCallback;\n initiatedCallback.leave = callbacks.leave || stubCallback;\n return initiatedCallback;\n}\n/**\n * 广度优先遍历图\n * @param graph Graph 图实例\n * @param startNode 开始遍历的节点\n * @param originalCallbacks 回调\n */\nvar breadthFirstSearch = function breadthFirstSearch(graphData, startNodeId, originalCallbacks, directed) {\n if (directed === void 0) {\n directed = true;\n }\n var callbacks = initCallbacks(originalCallbacks);\n var nodeQueue = new _queue.default();\n var _a = graphData.edges,\n edges = _a === void 0 ? [] : _a;\n // 初始化队列元素\n nodeQueue.enqueue(startNodeId);\n var previousNode = '';\n var _loop_1 = function _loop_1() {\n var currentNode = nodeQueue.dequeue();\n callbacks.enter({\n current: currentNode,\n previous: previousNode\n });\n // 将所有邻居添加到队列中以便遍历\n (0, _util.getNeighbors)(currentNode, edges, directed ? 'target' : undefined).forEach(function (nextNode) {\n if (callbacks.allowTraversal({\n previous: previousNode,\n current: currentNode,\n next: nextNode\n })) {\n nodeQueue.enqueue(nextNode);\n }\n });\n callbacks.leave({\n current: currentNode,\n previous: previousNode\n });\n // 下一次循环之前存储当前顶点\n previousNode = currentNode;\n };\n // 遍历队列中的所有顶点\n while (!nodeQueue.isEmpty()) {\n _loop_1();\n }\n};\nvar _default = breadthFirstSearch;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/bfs.js?"); /***/ }), @@ -452,7 +452,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getConnectedComponents;\nexports.detectStrongConnectComponents = exports.detectConnectedComponents = void 0;\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\n/**\n * Generate all connected components for an undirected graph\n * @param graph\n */\nvar detectConnectedComponents = function detectConnectedComponents(graphData) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var allComponents = [];\n var visited = {};\n var nodeStack = [];\n\n var getComponent = function getComponent(node) {\n nodeStack.push(node);\n visited[node.id] = true;\n var neighbors = (0, _util.getNeighbors)(node.id, edges);\n\n var _loop_1 = function _loop_1(i) {\n var neighbor = neighbors[i];\n\n if (!visited[neighbor]) {\n var targetNode = nodes.filter(function (node) {\n return node.id === neighbor;\n });\n\n if (targetNode.length > 0) {\n getComponent(targetNode[0]);\n }\n }\n };\n\n for (var i = 0; i < neighbors.length; ++i) {\n _loop_1(i);\n }\n };\n\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n\n if (!visited[node.id]) {\n // 对于无向图进行dfs遍历,每一次调用后都得到一个连通分量\n getComponent(node);\n var component = [];\n\n while (nodeStack.length > 0) {\n component.push(nodeStack.pop());\n }\n\n allComponents.push(component);\n }\n }\n\n return allComponents;\n};\n/**\n * Tarjan's Algorithm 复杂度 O(|V|+|E|)\n * For directed graph only\n * a directed graph is said to be strongly connected if \"every vertex is reachable from every other vertex\".\n * refer: http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm\n * @param graph\n * @return a list of strongly connected components\n */\n\n\nexports.detectConnectedComponents = detectConnectedComponents;\n\nvar detectStrongConnectComponents = function detectStrongConnectComponents(graphData) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodeStack = [];\n var inStack = {}; // 辅助判断是否已经在stack中,减少查找开销\n\n var indices = {};\n var lowLink = {};\n var allComponents = [];\n var index = 0;\n\n var getComponent = function getComponent(node) {\n // Set the depth index for v to the smallest unused index\n indices[node.id] = index;\n lowLink[node.id] = index;\n index += 1;\n nodeStack.push(node);\n inStack[node.id] = true; // 考虑每个邻接点\n\n var neighbors = (0, _util.getNeighbors)(node.id, edges, 'target').filter(function (n) {\n return nodes.map(function (node) {\n return node.id;\n }).indexOf(n) > -1;\n });\n\n var _loop_2 = function _loop_2(i) {\n var targetNodeID = neighbors[i];\n\n if (!indices[targetNodeID] && indices[targetNodeID] !== 0) {\n var targetNode = nodes.filter(function (node) {\n return node.id === targetNodeID;\n });\n\n if (targetNode.length > 0) {\n getComponent(targetNode[0]);\n } // tree edge\n\n\n lowLink[node.id] = Math.min(lowLink[node.id], lowLink[targetNodeID]);\n } else if (inStack[targetNodeID]) {\n // back edge, target node is in the current SCC\n lowLink[node.id] = Math.min(lowLink[node.id], indices[targetNodeID]);\n }\n };\n\n for (var i = 0; i < neighbors.length; i++) {\n _loop_2(i);\n } // If node is a root node, generate an SCC\n\n\n if (lowLink[node.id] === indices[node.id]) {\n var component = [];\n\n while (nodeStack.length > 0) {\n var tmpNode = nodeStack.pop();\n inStack[tmpNode.id] = false;\n component.push(tmpNode);\n if (tmpNode === node) break;\n }\n\n if (component.length > 0) {\n allComponents.push(component);\n }\n }\n };\n\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n var node = nodes_1[_i];\n\n if (!indices[node.id] && indices[node.id] !== 0) {\n getComponent(node);\n }\n }\n\n return allComponents;\n};\n\nexports.detectStrongConnectComponents = detectStrongConnectComponents;\n\nfunction getConnectedComponents(graphData, directed) {\n if (directed) return detectStrongConnectComponents(graphData);\n return detectConnectedComponents(graphData);\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/connected-component.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = getConnectedComponents;\nexports.detectStrongConnectComponents = exports.detectConnectedComponents = void 0;\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n/**\n * Generate all connected components for an undirected graph\n * @param graph\n */\nvar detectConnectedComponents = function detectConnectedComponents(graphData) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var allComponents = [];\n var visited = {};\n var nodeStack = [];\n var getComponent = function getComponent(node) {\n nodeStack.push(node);\n visited[node.id] = true;\n var neighbors = (0, _util.getNeighbors)(node.id, edges);\n var _loop_1 = function _loop_1(i) {\n var neighbor = neighbors[i];\n if (!visited[neighbor]) {\n var targetNode = nodes.filter(function (node) {\n return node.id === neighbor;\n });\n if (targetNode.length > 0) {\n getComponent(targetNode[0]);\n }\n }\n };\n for (var i = 0; i < neighbors.length; ++i) {\n _loop_1(i);\n }\n };\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if (!visited[node.id]) {\n // 对于无向图进行dfs遍历,每一次调用后都得到一个连通分量\n getComponent(node);\n var component = [];\n while (nodeStack.length > 0) {\n component.push(nodeStack.pop());\n }\n allComponents.push(component);\n }\n }\n return allComponents;\n};\n/**\n * Tarjan's Algorithm 复杂度 O(|V|+|E|)\n * For directed graph only\n * a directed graph is said to be strongly connected if \"every vertex is reachable from every other vertex\".\n * refer: http://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm\n * @param graph\n * @return a list of strongly connected components\n */\nexports.detectConnectedComponents = detectConnectedComponents;\nvar detectStrongConnectComponents = function detectStrongConnectComponents(graphData) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodeStack = [];\n var inStack = {}; // 辅助判断是否已经在stack中,减少查找开销\n var indices = {};\n var lowLink = {};\n var allComponents = [];\n var index = 0;\n var getComponent = function getComponent(node) {\n // Set the depth index for v to the smallest unused index\n indices[node.id] = index;\n lowLink[node.id] = index;\n index += 1;\n nodeStack.push(node);\n inStack[node.id] = true;\n // 考虑每个邻接点\n var neighbors = (0, _util.getNeighbors)(node.id, edges, 'target').filter(function (n) {\n return nodes.map(function (node) {\n return node.id;\n }).indexOf(n) > -1;\n });\n var _loop_2 = function _loop_2(i) {\n var targetNodeID = neighbors[i];\n if (!indices[targetNodeID] && indices[targetNodeID] !== 0) {\n var targetNode = nodes.filter(function (node) {\n return node.id === targetNodeID;\n });\n if (targetNode.length > 0) {\n getComponent(targetNode[0]);\n }\n // tree edge\n lowLink[node.id] = Math.min(lowLink[node.id], lowLink[targetNodeID]);\n } else if (inStack[targetNodeID]) {\n // back edge, target node is in the current SCC\n lowLink[node.id] = Math.min(lowLink[node.id], indices[targetNodeID]);\n }\n };\n for (var i = 0; i < neighbors.length; i++) {\n _loop_2(i);\n }\n // If node is a root node, generate an SCC\n if (lowLink[node.id] === indices[node.id]) {\n var component = [];\n while (nodeStack.length > 0) {\n var tmpNode = nodeStack.pop();\n inStack[tmpNode.id] = false;\n component.push(tmpNode);\n if (tmpNode === node) break;\n }\n if (component.length > 0) {\n allComponents.push(component);\n }\n }\n };\n for (var _i = 0, nodes_1 = nodes; _i < nodes_1.length; _i++) {\n var node = nodes_1[_i];\n if (!indices[node.id] && indices[node.id] !== 0) {\n getComponent(node);\n }\n }\n return allComponents;\n};\nexports.detectStrongConnectComponents = detectStrongConnectComponents;\nfunction getConnectedComponents(graphData, directed) {\n if (directed) return detectStrongConnectComponents(graphData);\n return detectConnectedComponents(graphData);\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/connected-component.js?"); /***/ }), @@ -476,7 +476,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getOutDegree = exports.getInDegree = exports.default = void 0;\n\nvar degree = function degree(graphData) {\n var degrees = {};\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n nodes.forEach(function (node) {\n degrees[node.id] = {\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n });\n edges.forEach(function (edge) {\n degrees[edge.source].degree++;\n degrees[edge.source].outDegree++;\n degrees[edge.target].degree++;\n degrees[edge.target].inDegree++;\n });\n return degrees;\n};\n\nvar _default = degree;\n/**\n * 获取指定节点的入度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\n\nexports.default = _default;\n\nvar getInDegree = function getInDegree(graphData, nodeId) {\n var nodeDegree = degree(graphData);\n\n if (nodeDegree[nodeId]) {\n return degree(graphData)[nodeId].inDegree;\n }\n\n return 0;\n};\n/**\n * 获取指定节点的出度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\n\n\nexports.getInDegree = getInDegree;\n\nvar getOutDegree = function getOutDegree(graphData, nodeId) {\n var nodeDegree = degree(graphData);\n\n if (nodeDegree[nodeId]) {\n return degree(graphData)[nodeId].outDegree;\n }\n\n return 0;\n};\n\nexports.getOutDegree = getOutDegree;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/degree.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getOutDegree = exports.getInDegree = exports.default = void 0;\nvar degree = function degree(graphData) {\n var degrees = {};\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n nodes.forEach(function (node) {\n degrees[node.id] = {\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n });\n edges.forEach(function (edge) {\n degrees[edge.source].degree++;\n degrees[edge.source].outDegree++;\n degrees[edge.target].degree++;\n degrees[edge.target].inDegree++;\n });\n return degrees;\n};\nvar _default = degree;\n/**\n * 获取指定节点的入度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\nexports.default = _default;\nvar getInDegree = function getInDegree(graphData, nodeId) {\n var nodeDegree = degree(graphData);\n if (nodeDegree[nodeId]) {\n return degree(graphData)[nodeId].inDegree;\n }\n return 0;\n};\n/**\n * 获取指定节点的出度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\nexports.getInDegree = getInDegree;\nvar getOutDegree = function getOutDegree(graphData, nodeId) {\n var nodeDegree = degree(graphData);\n if (nodeDegree[nodeId]) {\n return degree(graphData)[nodeId].outDegree;\n }\n return 0;\n};\nexports.getOutDegree = getOutDegree;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/degree.js?"); /***/ }), @@ -488,7 +488,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.detectAllUndirectedCycle = exports.detectAllDirectedCycle = exports.detectAllCycles = exports.default = void 0;\n\nvar _dfs = _interopRequireDefault(__webpack_require__(/*! ./dfs */ \"./node_modules/@antv/algorithm/lib/dfs.js\"));\n\nvar _connectedComponent = _interopRequireWildcard(__webpack_require__(/*! ./connected-component */ \"./node_modules/@antv/algorithm/lib/connected-component.js\"));\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar detectDirectedCycle = function detectDirectedCycle(graphData) {\n var cycle = null;\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a;\n var dfsParentMap = {}; // 所有没有被访问的节点集合\n\n var unvisitedSet = {}; // 正在被访问的节点集合\n\n var visitingSet = {}; // 所有已经被访问过的节点集合\n\n var visitedSet = {}; // 初始化 unvisitedSet\n\n nodes.forEach(function (node) {\n unvisitedSet[node.id] = node;\n });\n var callbacks = {\n enter: function enter(_a) {\n var currentNode = _a.current,\n previousNode = _a.previous;\n\n if (visitingSet[currentNode]) {\n // 如果当前节点正在访问中,则说明检测到环路了\n cycle = {};\n var currentCycleNode = currentNode;\n var previousCycleNode = previousNode;\n\n while (previousCycleNode !== currentNode) {\n cycle[currentCycleNode] = previousCycleNode;\n currentCycleNode = previousCycleNode;\n previousCycleNode = dfsParentMap[previousCycleNode];\n }\n\n cycle[currentCycleNode] = previousCycleNode;\n } else {\n // 如果不存在正在访问集合中,则将其放入正在访问集合,并从未访问集合中删除\n visitingSet[currentNode] = currentNode;\n delete unvisitedSet[currentNode]; // 更新 DSF parents 列表\n\n dfsParentMap[currentNode] = previousNode;\n }\n },\n leave: function leave(_a) {\n var currentNode = _a.current; // 如果所有的节点的子节点都已经访问过了,则从正在访问集合中删除掉,并将其移入到已访问集合中,\n // 同时也意味着当前节点的所有邻居节点都被访问过了\n\n visitedSet[currentNode] = currentNode;\n delete visitingSet[currentNode];\n },\n allowTraversal: function allowTraversal(_a) {\n var nextNode = _a.next; // 如果检测到环路则需要终止所有进一步的遍历,否则会导致无限循环遍历\n\n if (cycle) {\n return false;\n } // 仅允许遍历没有访问的节点,visitedSet 中的都已经访问过了\n\n\n return !visitedSet[nextNode];\n }\n }; // 开始遍历节点\n\n while (Object.keys(unvisitedSet).length) {\n // 从第一个节点开始进行 DFS 遍历\n var firsetUnVisitedKey = Object.keys(unvisitedSet)[0];\n (0, _dfs.default)(graphData, firsetUnVisitedKey, callbacks);\n }\n\n return cycle;\n};\n/**\n * 检测无向图中的所有Base cycles\n * refer: https://www.codeproject.com/Articles/1158232/Enumerating-All-Cycles-in-an-Undirected-Graph\n * @param graph\n * @param nodeIds 节点 ID 的数组\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: INode}] 返回一组base cycles\n */\n\n\nvar detectAllUndirectedCycle = function detectAllUndirectedCycle(graphData, nodeIds, include) {\n var _a, _b;\n\n if (include === void 0) {\n include = true;\n }\n\n var allCycles = [];\n var components = (0, _connectedComponent.default)(graphData, false); // loop through all connected components\n\n for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {\n var component = components_1[_i];\n if (!component.length) continue;\n var root = component[0];\n var rootId = root.id;\n var stack = [root];\n var parent_1 = (_a = {}, _a[rootId] = root, _a);\n var used = (_b = {}, _b[rootId] = new Set(), _b); // walk a spanning tree to find cycles\n\n while (stack.length > 0) {\n var curNode = stack.pop();\n var curNodeId = curNode.id;\n var neighbors = (0, _util.getNeighbors)(curNodeId, graphData.edges);\n\n var _loop_1 = function _loop_1(i) {\n var _c;\n\n var neighborId = neighbors[i];\n var neighbor = graphData.nodes.find(function (node) {\n return node.id === neighborId;\n }); // const neighborId = neighbor.get('id');\n\n if (neighborId === curNodeId) {\n // 自环\n allCycles.push((_c = {}, _c[neighborId] = curNode, _c));\n } else if (!(neighborId in used)) {\n // visit a new node\n parent_1[neighborId] = curNode;\n stack.push(neighbor);\n used[neighborId] = new Set([curNode]);\n } else if (!used[curNodeId].has(neighbor)) {\n // a cycle found\n var cycleValid = true;\n var cyclePath = [neighbor, curNode];\n var p = parent_1[curNodeId];\n\n while (used[neighborId].size && !used[neighborId].has(p)) {\n cyclePath.push(p);\n if (p === parent_1[p.id]) break;else p = parent_1[p.id];\n }\n\n cyclePath.push(p);\n\n if (nodeIds && include) {\n // 如果有指定包含的节点\n cycleValid = false;\n\n if (cyclePath.findIndex(function (node) {\n return nodeIds.indexOf(node.id) > -1;\n }) > -1) {\n cycleValid = true;\n }\n } else if (nodeIds && !include) {\n // 如果有指定不包含的节点\n if (cyclePath.findIndex(function (node) {\n return nodeIds.indexOf(node.id) > -1;\n }) > -1) {\n cycleValid = false;\n }\n } // 把 node list 形式转换为 cycle 的格式\n\n\n if (cycleValid) {\n var cycle = {};\n\n for (var index = 1; index < cyclePath.length; index += 1) {\n cycle[cyclePath[index - 1].id] = cyclePath[index];\n }\n\n if (cyclePath.length) {\n cycle[cyclePath[cyclePath.length - 1].id] = cyclePath[0];\n }\n\n allCycles.push(cycle);\n }\n\n used[neighborId].add(curNode);\n }\n };\n\n for (var i = 0; i < neighbors.length; i += 1) {\n _loop_1(i);\n }\n }\n }\n\n return allCycles;\n};\n/**\n * Johnson's algorithm, 时间复杂度 O((V + E)(C + 1))$ and space bounded by O(V + E)\n * refer: https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF\n * refer: https://networkx.github.io/documentation/stable/_modules/networkx/algorithms/cycles.html#simple_cycles\n * @param graph\n * @param nodeIds 节点 ID 的数组\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: INode}] 返回所有的 simple cycles\n */\n\n\nexports.detectAllUndirectedCycle = detectAllUndirectedCycle;\n\nvar detectAllDirectedCycle = function detectAllDirectedCycle(graphData, nodeIds, include) {\n if (include === void 0) {\n include = true;\n }\n\n var path = []; // stack of nodes in current path\n\n var blocked = new Set();\n var B = []; // remember portions of the graph that yield no elementary circuit\n\n var allCycles = [];\n var idx2Node = {};\n var node2Idx = {}; // 辅助函数: unblock all blocked nodes\n\n var unblock = function unblock(thisNode) {\n var stack = [thisNode];\n\n while (stack.length > 0) {\n var node = stack.pop();\n\n if (blocked.has(node)) {\n blocked.delete(node);\n B[node.id].forEach(function (n) {\n stack.push(n);\n });\n B[node.id].clear();\n }\n }\n };\n\n var circuit = function circuit(node, start, adjList) {\n var closed = false; // whether a path is closed\n\n if (nodeIds && include === false && nodeIds.indexOf(node.id) > -1) return closed;\n path.push(node);\n blocked.add(node);\n var neighbors = adjList[node.id];\n\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = idx2Node[neighbors[i]];\n\n if (neighbor === start) {\n var cycle = {};\n\n for (var index = 1; index < path.length; index += 1) {\n cycle[path[index - 1].id] = path[index];\n }\n\n if (path.length) {\n cycle[path[path.length - 1].id] = path[0];\n }\n\n allCycles.push(cycle);\n closed = true;\n } else if (!blocked.has(neighbor)) {\n if (circuit(neighbor, start, adjList)) {\n closed = true;\n }\n }\n }\n\n if (closed) {\n unblock(node);\n } else {\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = idx2Node[neighbors[i]];\n\n if (!B[neighbor.id].has(node)) {\n B[neighbor.id].add(node);\n }\n }\n }\n\n path.pop();\n return closed;\n };\n\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a; // Johnson's algorithm 要求给节点赋顺序,先按节点在数组中的顺序\n\n for (var i = 0; i < nodes.length; i += 1) {\n var node = nodes[i];\n var nodeId = node.id;\n node2Idx[nodeId] = i;\n idx2Node[i] = node;\n } // 如果有指定包含的节点,则把指定节点排序在前,以便提早结束搜索\n\n\n if (nodeIds && include) {\n var _loop_2 = function _loop_2(i) {\n var nodeId = nodeIds[i];\n node2Idx[nodes[i].id] = node2Idx[nodeId];\n node2Idx[nodeId] = 0;\n idx2Node[0] = nodes.find(function (node) {\n return node.id === nodeId;\n });\n idx2Node[node2Idx[nodes[i].id]] = nodes[i];\n };\n\n for (var i = 0; i < nodeIds.length; i++) {\n _loop_2(i);\n }\n } // 返回 节点顺序 >= nodeOrder 的强连通分量的adjList\n\n\n var getMinComponentAdj = function getMinComponentAdj(components) {\n var _a;\n\n var minCompIdx;\n var minIdx = Infinity; // Find least component and the lowest node\n\n for (var i = 0; i < components.length; i += 1) {\n var comp = components[i];\n\n for (var j = 0; j < comp.length; j++) {\n var nodeIdx_1 = node2Idx[comp[j].id];\n\n if (nodeIdx_1 < minIdx) {\n minIdx = nodeIdx_1;\n minCompIdx = i;\n }\n }\n }\n\n var component = components[minCompIdx];\n var adjList = [];\n\n for (var i = 0; i < component.length; i += 1) {\n var node = component[i];\n adjList[node.id] = [];\n\n for (var _i = 0, _b = (0, _util.getNeighbors)(node.id, graphData.edges, 'target').filter(function (n) {\n return component.map(function (c) {\n return c.id;\n }).indexOf(n) > -1;\n }); _i < _b.length; _i++) {\n var neighbor = _b[_i]; // 对自环情况 (点连向自身) 特殊处理:记录自环,但不加入adjList\n\n if (neighbor === node.id && !(include === false && nodeIds.indexOf(node.id) > -1)) {\n allCycles.push((_a = {}, _a[node.id] = node, _a));\n } else {\n adjList[node.id].push(node2Idx[neighbor]);\n }\n }\n }\n\n return {\n component: component,\n adjList: adjList,\n minIdx: minIdx\n };\n };\n\n var nodeIdx = 0;\n\n while (nodeIdx < nodes.length) {\n var subgraphNodes = nodes.filter(function (n) {\n return node2Idx[n.id] >= nodeIdx;\n });\n var sccs = (0, _connectedComponent.detectStrongConnectComponents)({\n nodes: subgraphNodes,\n edges: graphData.edges\n }).filter(function (component) {\n return component.length > 1;\n });\n if (sccs.length === 0) break;\n var scc = getMinComponentAdj(sccs);\n var minIdx = scc.minIdx,\n adjList = scc.adjList,\n component = scc.component;\n\n if (component.length > 1) {\n component.forEach(function (node) {\n B[node.id] = new Set();\n });\n var startNode = idx2Node[minIdx]; // startNode 不在指定要包含的节点中,提前结束搜索\n\n if (nodeIds && include && nodeIds.indexOf(startNode.id) === -1) return allCycles;\n circuit(startNode, startNode, adjList);\n nodeIdx = minIdx + 1;\n } else {\n break;\n }\n }\n\n return allCycles;\n};\n/**\n * 查找图中所有满足要求的圈\n * @param graph\n * @param directed 是否为有向图\n * @param nodeIds 节点 ID 的数组,若不指定,则返回图中所有的圈\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: Node}] 包含所有环的数组,每个环用一个Object表示,其中key为节点id,value为该节点在环中指向的下一个节点\n */\n\n\nexports.detectAllDirectedCycle = detectAllDirectedCycle;\n\nvar detectAllCycles = function detectAllCycles(graphData, directed, nodeIds, include) {\n if (include === void 0) {\n include = true;\n }\n\n if (directed) return detectAllDirectedCycle(graphData, nodeIds, include);\n return detectAllUndirectedCycle(graphData, nodeIds, include);\n};\n\nexports.detectAllCycles = detectAllCycles;\nvar _default = detectDirectedCycle;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/detect-cycle.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.detectAllUndirectedCycle = exports.detectAllDirectedCycle = exports.detectAllCycles = exports.default = void 0;\nvar _dfs = _interopRequireDefault(__webpack_require__(/*! ./dfs */ \"./node_modules/@antv/algorithm/lib/dfs.js\"));\nvar _connectedComponent = _interopRequireWildcard(__webpack_require__(/*! ./connected-component */ \"./node_modules/@antv/algorithm/lib/connected-component.js\"));\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar detectDirectedCycle = function detectDirectedCycle(graphData) {\n var cycle = null;\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a;\n var dfsParentMap = {};\n // 所有没有被访问的节点集合\n var unvisitedSet = {};\n // 正在被访问的节点集合\n var visitingSet = {};\n // 所有已经被访问过的节点集合\n var visitedSet = {};\n // 初始化 unvisitedSet\n nodes.forEach(function (node) {\n unvisitedSet[node.id] = node;\n });\n var callbacks = {\n enter: function enter(_a) {\n var currentNode = _a.current,\n previousNode = _a.previous;\n if (visitingSet[currentNode]) {\n // 如果当前节点正在访问中,则说明检测到环路了\n cycle = {};\n var currentCycleNode = currentNode;\n var previousCycleNode = previousNode;\n while (previousCycleNode !== currentNode) {\n cycle[currentCycleNode] = previousCycleNode;\n currentCycleNode = previousCycleNode;\n previousCycleNode = dfsParentMap[previousCycleNode];\n }\n cycle[currentCycleNode] = previousCycleNode;\n } else {\n // 如果不存在正在访问集合中,则将其放入正在访问集合,并从未访问集合中删除\n visitingSet[currentNode] = currentNode;\n delete unvisitedSet[currentNode];\n // 更新 DSF parents 列表\n dfsParentMap[currentNode] = previousNode;\n }\n },\n leave: function leave(_a) {\n var currentNode = _a.current;\n // 如果所有的节点的子节点都已经访问过了,则从正在访问集合中删除掉,并将其移入到已访问集合中,\n // 同时也意味着当前节点的所有邻居节点都被访问过了\n visitedSet[currentNode] = currentNode;\n delete visitingSet[currentNode];\n },\n allowTraversal: function allowTraversal(_a) {\n var nextNode = _a.next;\n // 如果检测到环路则需要终止所有进一步的遍历,否则会导致无限循环遍历\n if (cycle) {\n return false;\n }\n // 仅允许遍历没有访问的节点,visitedSet 中的都已经访问过了\n return !visitedSet[nextNode];\n }\n };\n // 开始遍历节点\n while (Object.keys(unvisitedSet).length) {\n // 从第一个节点开始进行 DFS 遍历\n var firsetUnVisitedKey = Object.keys(unvisitedSet)[0];\n (0, _dfs.default)(graphData, firsetUnVisitedKey, callbacks);\n }\n return cycle;\n};\n/**\n * 检测无向图中的所有Base cycles\n * refer: https://www.codeproject.com/Articles/1158232/Enumerating-All-Cycles-in-an-Undirected-Graph\n * @param graph\n * @param nodeIds 节点 ID 的数组\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: INode}] 返回一组base cycles\n */\nvar detectAllUndirectedCycle = function detectAllUndirectedCycle(graphData, nodeIds, include) {\n var _a, _b;\n if (include === void 0) {\n include = true;\n }\n var allCycles = [];\n var components = (0, _connectedComponent.default)(graphData, false);\n // loop through all connected components\n for (var _i = 0, components_1 = components; _i < components_1.length; _i++) {\n var component = components_1[_i];\n if (!component.length) continue;\n var root = component[0];\n var rootId = root.id;\n var stack = [root];\n var parent_1 = (_a = {}, _a[rootId] = root, _a);\n var used = (_b = {}, _b[rootId] = new Set(), _b);\n // walk a spanning tree to find cycles\n while (stack.length > 0) {\n var curNode = stack.pop();\n var curNodeId = curNode.id;\n var neighbors = (0, _util.getNeighbors)(curNodeId, graphData.edges);\n var _loop_1 = function _loop_1(i) {\n var _c;\n var neighborId = neighbors[i];\n var neighbor = graphData.nodes.find(function (node) {\n return node.id === neighborId;\n });\n // const neighborId = neighbor.get('id');\n if (neighborId === curNodeId) {\n // 自环\n allCycles.push((_c = {}, _c[neighborId] = curNode, _c));\n } else if (!(neighborId in used)) {\n // visit a new node\n parent_1[neighborId] = curNode;\n stack.push(neighbor);\n used[neighborId] = new Set([curNode]);\n } else if (!used[curNodeId].has(neighbor)) {\n // a cycle found\n var cycleValid = true;\n var cyclePath = [neighbor, curNode];\n var p = parent_1[curNodeId];\n while (used[neighborId].size && !used[neighborId].has(p)) {\n cyclePath.push(p);\n if (p === parent_1[p.id]) break;else p = parent_1[p.id];\n }\n cyclePath.push(p);\n if (nodeIds && include) {\n // 如果有指定包含的节点\n cycleValid = false;\n if (cyclePath.findIndex(function (node) {\n return nodeIds.indexOf(node.id) > -1;\n }) > -1) {\n cycleValid = true;\n }\n } else if (nodeIds && !include) {\n // 如果有指定不包含的节点\n if (cyclePath.findIndex(function (node) {\n return nodeIds.indexOf(node.id) > -1;\n }) > -1) {\n cycleValid = false;\n }\n }\n // 把 node list 形式转换为 cycle 的格式\n if (cycleValid) {\n var cycle = {};\n for (var index = 1; index < cyclePath.length; index += 1) {\n cycle[cyclePath[index - 1].id] = cyclePath[index];\n }\n if (cyclePath.length) {\n cycle[cyclePath[cyclePath.length - 1].id] = cyclePath[0];\n }\n allCycles.push(cycle);\n }\n used[neighborId].add(curNode);\n }\n };\n for (var i = 0; i < neighbors.length; i += 1) {\n _loop_1(i);\n }\n }\n }\n return allCycles;\n};\n/**\n * Johnson's algorithm, 时间复杂度 O((V + E)(C + 1))$ and space bounded by O(V + E)\n * refer: https://www.cs.tufts.edu/comp/150GA/homeworks/hw1/Johnson%2075.PDF\n * refer: https://networkx.github.io/documentation/stable/_modules/networkx/algorithms/cycles.html#simple_cycles\n * @param graph\n * @param nodeIds 节点 ID 的数组\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: INode}] 返回所有的 simple cycles\n */\nexports.detectAllUndirectedCycle = detectAllUndirectedCycle;\nvar detectAllDirectedCycle = function detectAllDirectedCycle(graphData, nodeIds, include) {\n if (include === void 0) {\n include = true;\n }\n var path = []; // stack of nodes in current path\n var blocked = new Set();\n var B = []; // remember portions of the graph that yield no elementary circuit\n var allCycles = [];\n var idx2Node = {};\n var node2Idx = {};\n // 辅助函数: unblock all blocked nodes\n var unblock = function unblock(thisNode) {\n var stack = [thisNode];\n while (stack.length > 0) {\n var node = stack.pop();\n if (blocked.has(node)) {\n blocked.delete(node);\n B[node.id].forEach(function (n) {\n stack.push(n);\n });\n B[node.id].clear();\n }\n }\n };\n var circuit = function circuit(node, start, adjList) {\n var closed = false; // whether a path is closed\n if (nodeIds && include === false && nodeIds.indexOf(node.id) > -1) return closed;\n path.push(node);\n blocked.add(node);\n var neighbors = adjList[node.id];\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = idx2Node[neighbors[i]];\n if (neighbor === start) {\n var cycle = {};\n for (var index = 1; index < path.length; index += 1) {\n cycle[path[index - 1].id] = path[index];\n }\n if (path.length) {\n cycle[path[path.length - 1].id] = path[0];\n }\n allCycles.push(cycle);\n closed = true;\n } else if (!blocked.has(neighbor)) {\n if (circuit(neighbor, start, adjList)) {\n closed = true;\n }\n }\n }\n if (closed) {\n unblock(node);\n } else {\n for (var i = 0; i < neighbors.length; i += 1) {\n var neighbor = idx2Node[neighbors[i]];\n if (!B[neighbor.id].has(node)) {\n B[neighbor.id].add(node);\n }\n }\n }\n path.pop();\n return closed;\n };\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a;\n // Johnson's algorithm 要求给节点赋顺序,先按节点在数组中的顺序\n for (var i = 0; i < nodes.length; i += 1) {\n var node = nodes[i];\n var nodeId = node.id;\n node2Idx[nodeId] = i;\n idx2Node[i] = node;\n }\n // 如果有指定包含的节点,则把指定节点排序在前,以便提早结束搜索\n if (nodeIds && include) {\n var _loop_2 = function _loop_2(i) {\n var nodeId = nodeIds[i];\n node2Idx[nodes[i].id] = node2Idx[nodeId];\n node2Idx[nodeId] = 0;\n idx2Node[0] = nodes.find(function (node) {\n return node.id === nodeId;\n });\n idx2Node[node2Idx[nodes[i].id]] = nodes[i];\n };\n for (var i = 0; i < nodeIds.length; i++) {\n _loop_2(i);\n }\n }\n // 返回 节点顺序 >= nodeOrder 的强连通分量的adjList\n var getMinComponentAdj = function getMinComponentAdj(components) {\n var _a;\n var minCompIdx;\n var minIdx = Infinity;\n // Find least component and the lowest node\n for (var i = 0; i < components.length; i += 1) {\n var comp = components[i];\n for (var j = 0; j < comp.length; j++) {\n var nodeIdx_1 = node2Idx[comp[j].id];\n if (nodeIdx_1 < minIdx) {\n minIdx = nodeIdx_1;\n minCompIdx = i;\n }\n }\n }\n var component = components[minCompIdx];\n var adjList = [];\n for (var i = 0; i < component.length; i += 1) {\n var node = component[i];\n adjList[node.id] = [];\n for (var _i = 0, _b = (0, _util.getNeighbors)(node.id, graphData.edges, 'target').filter(function (n) {\n return component.map(function (c) {\n return c.id;\n }).indexOf(n) > -1;\n }); _i < _b.length; _i++) {\n var neighbor = _b[_i];\n // 对自环情况 (点连向自身) 特殊处理:记录自环,但不加入adjList\n if (neighbor === node.id && !(include === false && nodeIds.indexOf(node.id) > -1)) {\n allCycles.push((_a = {}, _a[node.id] = node, _a));\n } else {\n adjList[node.id].push(node2Idx[neighbor]);\n }\n }\n }\n return {\n component: component,\n adjList: adjList,\n minIdx: minIdx\n };\n };\n var nodeIdx = 0;\n while (nodeIdx < nodes.length) {\n var subgraphNodes = nodes.filter(function (n) {\n return node2Idx[n.id] >= nodeIdx;\n });\n var sccs = (0, _connectedComponent.detectStrongConnectComponents)({\n nodes: subgraphNodes,\n edges: graphData.edges\n }).filter(function (component) {\n return component.length > 1;\n });\n if (sccs.length === 0) break;\n var scc = getMinComponentAdj(sccs);\n var minIdx = scc.minIdx,\n adjList = scc.adjList,\n component = scc.component;\n if (component.length > 1) {\n component.forEach(function (node) {\n B[node.id] = new Set();\n });\n var startNode = idx2Node[minIdx];\n // startNode 不在指定要包含的节点中,提前结束搜索\n if (nodeIds && include && nodeIds.indexOf(startNode.id) === -1) return allCycles;\n circuit(startNode, startNode, adjList);\n nodeIdx = minIdx + 1;\n } else {\n break;\n }\n }\n return allCycles;\n};\n/**\n * 查找图中所有满足要求的圈\n * @param graph\n * @param directed 是否为有向图\n * @param nodeIds 节点 ID 的数组,若不指定,则返回图中所有的圈\n * @param include 包含或排除指定的节点\n * @return [{[key: string]: Node}] 包含所有环的数组,每个环用一个Object表示,其中key为节点id,value为该节点在环中指向的下一个节点\n */\nexports.detectAllDirectedCycle = detectAllDirectedCycle;\nvar detectAllCycles = function detectAllCycles(graphData, directed, nodeIds, include) {\n if (include === void 0) {\n include = true;\n }\n if (directed) return detectAllDirectedCycle(graphData, nodeIds, include);\n return detectAllUndirectedCycle(graphData, nodeIds, include);\n};\nexports.detectAllCycles = detectAllCycles;\nvar _default = detectDirectedCycle;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/detect-cycle.js?"); /***/ }), @@ -500,7 +500,7 @@ eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = depthFirstSearch;\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction initCallbacks(callbacks) {\n if (callbacks === void 0) {\n callbacks = {};\n }\n\n var initiatedCallback = callbacks;\n\n var stubCallback = function stubCallback() {};\n\n var allowTraversalCallback = function () {\n var seen = {};\n return function (_a) {\n var next = _a.next;\n\n if (!seen[next]) {\n seen[next] = true;\n return true;\n }\n\n return false;\n };\n }();\n\n initiatedCallback.allowTraversal = callbacks.allowTraversal || allowTraversalCallback;\n initiatedCallback.enter = callbacks.enter || stubCallback;\n initiatedCallback.leave = callbacks.leave || stubCallback;\n return initiatedCallback;\n}\n/**\n * @param {Graph} graph\n * @param {GraphNode} currentNode\n * @param {GraphNode} previousNode\n * @param {Callbacks} callbacks\n */\n\n\nfunction depthFirstSearchRecursive(graphData, currentNode, previousNode, callbacks) {\n callbacks.enter({\n current: currentNode,\n previous: previousNode\n });\n var _a = graphData.edges,\n edges = _a === void 0 ? [] : _a;\n (0, _util.getNeighbors)(currentNode, edges, 'target').forEach(function (nextNode) {\n if (callbacks.allowTraversal({\n previous: previousNode,\n current: currentNode,\n next: nextNode\n })) {\n depthFirstSearchRecursive(graphData, nextNode, currentNode, callbacks);\n }\n });\n callbacks.leave({\n current: currentNode,\n previous: previousNode\n });\n}\n/**\n * 深度优先遍历图\n * @param data GraphData 图数据\n * @param startNodeId 开始遍历的节点的 ID\n * @param originalCallbacks 回调\n */\n\n\nfunction depthFirstSearch(graphData, startNodeId, callbacks) {\n depthFirstSearchRecursive(graphData, startNodeId, '', initCallbacks(callbacks));\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/dfs.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = depthFirstSearch;\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction initCallbacks(callbacks) {\n if (callbacks === void 0) {\n callbacks = {};\n }\n var initiatedCallback = callbacks;\n var stubCallback = function stubCallback() {};\n var allowTraversalCallback = function () {\n var seen = {};\n return function (_a) {\n var next = _a.next;\n if (!seen[next]) {\n seen[next] = true;\n return true;\n }\n return false;\n };\n }();\n initiatedCallback.allowTraversal = callbacks.allowTraversal || allowTraversalCallback;\n initiatedCallback.enter = callbacks.enter || stubCallback;\n initiatedCallback.leave = callbacks.leave || stubCallback;\n return initiatedCallback;\n}\n/**\n * @param {Graph} graph\n * @param {GraphNode} currentNode\n * @param {GraphNode} previousNode\n * @param {Callbacks} callbacks\n */\nfunction depthFirstSearchRecursive(graphData, currentNode, previousNode, callbacks, directed) {\n if (directed === void 0) {\n directed = true;\n }\n callbacks.enter({\n current: currentNode,\n previous: previousNode\n });\n var _a = graphData.edges,\n edges = _a === void 0 ? [] : _a;\n (0, _util.getNeighbors)(currentNode, edges, directed ? 'target' : undefined).forEach(function (nextNode) {\n if (callbacks.allowTraversal({\n previous: previousNode,\n current: currentNode,\n next: nextNode\n })) {\n depthFirstSearchRecursive(graphData, nextNode, currentNode, callbacks, directed);\n }\n });\n callbacks.leave({\n current: currentNode,\n previous: previousNode\n });\n}\n/**\n * 深度优先遍历图\n * @param data GraphData 图数据\n * @param startNodeId 开始遍历的节点的 ID\n * @param originalCallbacks 回调\n */\nfunction depthFirstSearch(graphData, startNodeId, callbacks, directed) {\n if (directed === void 0) {\n directed = true;\n }\n depthFirstSearchRecursive(graphData, startNodeId, '', initCallbacks(callbacks), directed);\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/dfs.js?"); /***/ }), @@ -512,7 +512,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _util2 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nvar minVertex = function minVertex(D, nodes, marks) {\n // 找出最小的点\n var minDis = Infinity;\n var minNode;\n\n for (var i = 0; i < nodes.length; i++) {\n var nodeId = nodes[i].id;\n\n if (!marks[nodeId] && D[nodeId] <= minDis) {\n minDis = D[nodeId];\n minNode = nodes[i];\n }\n }\n\n return minNode;\n};\n\nvar dijkstra = function dijkstra(graphData, source, directed, weightPropertyName) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodeIds = [];\n var marks = {};\n var D = {};\n var prevs = {}; // key: 顶点, value: 顶点的前驱点数组(可能有多条等长的最短路径)\n\n nodes.forEach(function (node, i) {\n var id = node.id;\n nodeIds.push(id);\n D[id] = Infinity;\n if (id === source) D[id] = 0;\n });\n var nodeNum = nodes.length;\n\n var _loop_1 = function _loop_1(i) {\n // Process the vertices\n var minNode = minVertex(D, nodes, marks);\n var minNodeId = minNode.id;\n marks[minNodeId] = true;\n if (D[minNodeId] === Infinity) return \"continue\"; // Unreachable vertices cannot be the intermediate point\n\n var relatedEdges = [];\n if (directed) relatedEdges = (0, _util2.getOutEdgesNodeId)(minNodeId, edges);else relatedEdges = (0, _util2.getEdgesByNodeId)(minNodeId, edges);\n relatedEdges.forEach(function (edge) {\n var edgeTarget = edge.target;\n var edgeSource = edge.source;\n var w = edgeTarget === minNodeId ? edgeSource : edgeTarget;\n var weight = weightPropertyName && edge[weightPropertyName] ? edge[weightPropertyName] : 1;\n\n if (D[w] > D[minNode.id] + weight) {\n D[w] = D[minNode.id] + weight;\n prevs[w] = [minNode.id];\n } else if (D[w] === D[minNode.id] + weight) {\n prevs[w].push(minNode.id);\n }\n });\n };\n\n for (var i = 0; i < nodeNum; i++) {\n _loop_1(i);\n }\n\n prevs[source] = [source]; // 每个节点存可能存在多条最短路径\n\n var paths = {};\n\n for (var target in D) {\n if (D[target] !== Infinity) {\n findAllPaths(source, target, prevs, paths);\n }\n } // 兼容之前单路径\n\n\n var path = {};\n\n for (var target in paths) {\n path[target] = paths[target][0];\n }\n\n return {\n length: D,\n path: path,\n allPath: paths\n };\n};\n\nvar _default = dijkstra;\nexports.default = _default;\n\nfunction findAllPaths(source, target, prevs, foundPaths) {\n if (source === target) {\n return [source];\n }\n\n if (foundPaths[target]) {\n return foundPaths[target];\n }\n\n var paths = [];\n\n for (var _i = 0, _a = prevs[target]; _i < _a.length; _i++) {\n var prev = _a[_i];\n var prevPaths = findAllPaths(source, prev, prevs, foundPaths);\n if (!prevPaths) return;\n\n for (var _b = 0, prevPaths_1 = prevPaths; _b < prevPaths_1.length; _b++) {\n var prePath = prevPaths_1[_b];\n if ((0, _util.isArray)(prePath)) paths.push((0, _tslib.__spreadArray)((0, _tslib.__spreadArray)([], prePath, true), [target], false));else paths.push([prePath, target]);\n }\n }\n\n foundPaths[target] = paths;\n return foundPaths[target];\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/dijkstra.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _util2 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nvar minVertex = function minVertex(D, nodes, marks) {\n // 找出最小的点\n var minDis = Infinity;\n var minNode;\n for (var i = 0; i < nodes.length; i++) {\n var nodeId = nodes[i].id;\n if (!marks[nodeId] && D[nodeId] <= minDis) {\n minDis = D[nodeId];\n minNode = nodes[i];\n }\n }\n return minNode;\n};\nvar dijkstra = function dijkstra(graphData, source, directed, weightPropertyName) {\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodeIds = [];\n var marks = {};\n var D = {};\n var prevs = {}; // key: 顶点, value: 顶点的前驱点数组(可能有多条等长的最短路径)\n nodes.forEach(function (node, i) {\n var id = node.id;\n nodeIds.push(id);\n D[id] = Infinity;\n if (id === source) D[id] = 0;\n });\n var nodeNum = nodes.length;\n var _loop_1 = function _loop_1(i) {\n // Process the vertices\n var minNode = minVertex(D, nodes, marks);\n var minNodeId = minNode.id;\n marks[minNodeId] = true;\n if (D[minNodeId] === Infinity) return \"continue\"; // Unreachable vertices cannot be the intermediate point\n var relatedEdges = [];\n if (directed) relatedEdges = (0, _util2.getOutEdgesNodeId)(minNodeId, edges);else relatedEdges = (0, _util2.getEdgesByNodeId)(minNodeId, edges);\n relatedEdges.forEach(function (edge) {\n var edgeTarget = edge.target;\n var edgeSource = edge.source;\n var w = edgeTarget === minNodeId ? edgeSource : edgeTarget;\n var weight = weightPropertyName && edge[weightPropertyName] ? edge[weightPropertyName] : 1;\n if (D[w] > D[minNode.id] + weight) {\n D[w] = D[minNode.id] + weight;\n prevs[w] = [minNode.id];\n } else if (D[w] === D[minNode.id] + weight) {\n prevs[w].push(minNode.id);\n }\n });\n };\n for (var i = 0; i < nodeNum; i++) {\n _loop_1(i);\n }\n prevs[source] = [source];\n // 每个节点存可能存在多条最短路径\n var paths = {};\n for (var target in D) {\n if (D[target] !== Infinity) {\n findAllPaths(source, target, prevs, paths);\n }\n }\n // 兼容之前单路径\n var path = {};\n for (var target in paths) {\n path[target] = paths[target][0];\n }\n return {\n length: D,\n path: path,\n allPath: paths\n };\n};\nvar _default = dijkstra;\nexports.default = _default;\nfunction findAllPaths(source, target, prevs, foundPaths) {\n if (source === target) {\n return [source];\n }\n if (foundPaths[target]) {\n return foundPaths[target];\n }\n var paths = [];\n for (var _i = 0, _a = prevs[target]; _i < _a.length; _i++) {\n var prev = _a[_i];\n var prevPaths = findAllPaths(source, prev, prevs, foundPaths);\n if (!prevPaths) return;\n for (var _b = 0, prevPaths_1 = prevPaths; _b < prevPaths_1.length; _b++) {\n var prePath = prevPaths_1[_b];\n if ((0, _util.isArray)(prePath)) paths.push((0, _tslib.__spreadArray)((0, _tslib.__spreadArray)([], prePath, true), [target], false));else paths.push([prePath, target]);\n }\n }\n foundPaths[target] = paths;\n return foundPaths[target];\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/dijkstra.js?"); /***/ }), @@ -524,7 +524,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findShortestPath = exports.findAllPath = void 0;\n\nvar _dijkstra = _interopRequireDefault(__webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/algorithm/lib/dijkstra.js\"));\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar findShortestPath = function findShortestPath(graphData, start, end, directed, weightPropertyName) {\n var _a = (0, _dijkstra.default)(graphData, start, directed, weightPropertyName),\n length = _a.length,\n path = _a.path,\n allPath = _a.allPath;\n\n return {\n length: length[end],\n path: path[end],\n allPath: allPath[end]\n };\n};\n\nexports.findShortestPath = findShortestPath;\n\nvar findAllPath = function findAllPath(graphData, start, end, directed) {\n var _a;\n\n if (start === end) return [[start]];\n var _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var visited = [start];\n var isVisited = (_a = {}, _a[start] = true, _a);\n var stack = []; // 辅助栈,用于存储访问过的节点的邻居节点\n\n var allPath = [];\n var neighbors = directed ? (0, _util.getNeighbors)(start, edges, 'target') : (0, _util.getNeighbors)(start, edges);\n stack.push(neighbors);\n\n while (visited.length > 0 && stack.length > 0) {\n var children = stack[stack.length - 1];\n\n if (children.length) {\n var child = children.shift();\n\n if (child) {\n visited.push(child);\n isVisited[child] = true;\n neighbors = directed ? (0, _util.getNeighbors)(child, edges, 'target') : (0, _util.getNeighbors)(child, edges);\n stack.push(neighbors.filter(function (neighbor) {\n return !isVisited[neighbor];\n }));\n }\n } else {\n var node = visited.pop();\n isVisited[node] = false;\n stack.pop();\n continue;\n }\n\n if (visited[visited.length - 1] === end) {\n var path = visited.map(function (node) {\n return node;\n });\n allPath.push(path);\n var node = visited.pop();\n isVisited[node] = false;\n stack.pop();\n }\n }\n\n return allPath;\n};\n\nexports.findAllPath = findAllPath;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/find-path.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.findShortestPath = exports.findAllPath = void 0;\nvar _dijkstra = _interopRequireDefault(__webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/algorithm/lib/dijkstra.js\"));\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar findShortestPath = function findShortestPath(graphData, start, end, directed, weightPropertyName) {\n var _a = (0, _dijkstra.default)(graphData, start, directed, weightPropertyName),\n length = _a.length,\n path = _a.path,\n allPath = _a.allPath;\n return {\n length: length[end],\n path: path[end],\n allPath: allPath[end]\n };\n};\nexports.findShortestPath = findShortestPath;\nvar findAllPath = function findAllPath(graphData, start, end, directed) {\n var _a;\n if (start === end) return [[start]];\n var _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var visited = [start];\n var isVisited = (_a = {}, _a[start] = true, _a);\n var stack = []; // 辅助栈,用于存储访问过的节点的邻居节点\n var allPath = [];\n var neighbors = directed ? (0, _util.getNeighbors)(start, edges, 'target') : (0, _util.getNeighbors)(start, edges);\n stack.push(neighbors);\n while (visited.length > 0 && stack.length > 0) {\n var children = stack[stack.length - 1];\n if (children.length) {\n var child = children.shift();\n if (child) {\n visited.push(child);\n isVisited[child] = true;\n neighbors = directed ? (0, _util.getNeighbors)(child, edges, 'target') : (0, _util.getNeighbors)(child, edges);\n stack.push(neighbors.filter(function (neighbor) {\n return !isVisited[neighbor];\n }));\n }\n } else {\n var node = visited.pop();\n isVisited[node] = false;\n stack.pop();\n continue;\n }\n if (visited[visited.length - 1] === end) {\n var path = visited.map(function (node) {\n return node;\n });\n allPath.push(path);\n var node = visited.pop();\n isVisited[node] = false;\n stack.pop();\n }\n }\n return allPath;\n};\nexports.findAllPath = findAllPath;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/find-path.js?"); /***/ }), @@ -536,7 +536,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _adjacentMatrix = _interopRequireDefault(__webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/lib/adjacent-matrix.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar floydWarshall = function floydWarshall(graphData, directed) {\n var adjacentMatrix = (0, _adjacentMatrix.default)(graphData, directed);\n var dist = [];\n var size = adjacentMatrix.length;\n\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n } else if (adjacentMatrix[i][j] === 0 || !adjacentMatrix[i][j]) {\n dist[i][j] = Infinity;\n } else {\n dist[i][j] = adjacentMatrix[i][j];\n }\n }\n } // floyd\n\n\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n\n return dist;\n};\n\nvar _default = floydWarshall;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/floydWarshall.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _adjacentMatrix = _interopRequireDefault(__webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/lib/adjacent-matrix.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar floydWarshall = function floydWarshall(graphData, directed) {\n var adjacentMatrix = (0, _adjacentMatrix.default)(graphData, directed);\n var dist = [];\n var size = adjacentMatrix.length;\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n } else if (adjacentMatrix[i][j] === 0 || !adjacentMatrix[i][j]) {\n dist[i][j] = Infinity;\n } else {\n dist[i][j] = adjacentMatrix[i][j];\n }\n }\n }\n // floyd\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n return dist;\n};\nvar _default = floydWarshall;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/floydWarshall.js?"); /***/ }), @@ -548,7 +548,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _struct = __webpack_require__(/*! ./struct */ \"./node_modules/@antv/algorithm/lib/gSpan/struct.js\");\n\nvar DFSedge =\n/** @class */\nfunction () {\n function DFSedge(fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel) {\n this.fromNode = fromNode;\n this.toNode = toNode;\n this.nodeEdgeNodeLabel = {\n nodeLabel1: fromNodeLabel || _struct.VACANT_NODE_LABEL,\n edgeLabel: edgeLabel || _struct.VACANT_EDGE_LABEL,\n nodeLabel2: toNodeLabel || _struct.VACANT_NODE_LABEL\n };\n }\n\n DFSedge.prototype.equalTo = function (other) {\n return this.fromNode === other.formNode && this.toNode === other.toNode && this.nodeEdgeNodeLabel === other.nodeEdgeNodeLabel;\n };\n\n DFSedge.prototype.notEqualTo = function (other) {\n return !this.equalTo(other);\n };\n\n return DFSedge;\n}(); // DFScode 是 DESedge 的数组\n\n\nvar DFScode =\n/** @class */\nfunction () {\n function DFScode() {\n this.rmpath = [];\n this.dfsEdgeList = [];\n }\n\n DFScode.prototype.equalTo = function (other) {\n var aLength = this.dfsEdgeList.length;\n var bLength = other.length;\n if (aLength !== bLength) return false;\n\n for (var i = 0; i < aLength; i++) {\n if (this.dfsEdgeList[i] !== other[i]) return false;\n }\n\n return true;\n };\n\n DFScode.prototype.notEqualTo = function (other) {\n return !this.equalTo(other);\n };\n /** 增加一条 edge 到 DFScode */\n\n\n DFScode.prototype.pushBack = function (fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel) {\n this.dfsEdgeList.push(new DFSedge(fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel));\n return this.dfsEdgeList;\n };\n /** 根据 dfs 构建图 */\n\n\n DFScode.prototype.toGraph = function (graphId, directed) {\n if (graphId === void 0) {\n graphId = _struct.VACANT_GRAPH_ID;\n }\n\n if (directed === void 0) {\n directed = false;\n }\n\n var graph = new _struct.Graph(graphId, true, directed);\n this.dfsEdgeList.forEach(function (dfsEdge) {\n var fromNodeId = dfsEdge.fromNode;\n var toNodeId = dfsEdge.toNode;\n var _a = dfsEdge.nodeEdgeNodeLabel,\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n if (nodeLabel1 !== _struct.VACANT_NODE_LABEL) graph.addNode(fromNodeId, nodeLabel1);\n if (nodeLabel2 !== _struct.VACANT_NODE_LABEL) graph.addNode(toNodeId, nodeLabel2);\n if (nodeLabel1 !== _struct.VACANT_NODE_LABEL && nodeLabel2 !== nodeLabel1) graph.addEdge(undefined, fromNodeId, toNodeId, edgeLabel);\n });\n return graph;\n }; // 建立 rightmost path\n\n\n DFScode.prototype.buildRmpath = function () {\n this.rmpath = [];\n var oldFrom = undefined;\n var selfLength = this.dfsEdgeList.length;\n\n for (var i = selfLength - 1; i >= 0; i--) {\n var dfsEdge = this.dfsEdgeList[i];\n var fromNodeIdx = dfsEdge.fromNode;\n var toNodeIdx = dfsEdge.toNode;\n\n if (fromNodeIdx < toNodeIdx && (oldFrom === undefined || toNodeIdx === oldFrom)) {\n this.rmpath.push(i);\n oldFrom = fromNodeIdx;\n }\n }\n\n return this.rmpath;\n };\n\n DFScode.prototype.getNodeNum = function () {\n var nodeMap = {};\n this.dfsEdgeList.forEach(function (dfsEdge) {\n if (!nodeMap[dfsEdge.fromNode]) nodeMap[dfsEdge.fromNode] = true;\n if (!nodeMap[dfsEdge.toNode]) nodeMap[dfsEdge.toNode] = true;\n });\n return Object.keys(nodeMap).length;\n };\n\n return DFScode;\n}();\n\nvar History =\n/** @class */\nfunction () {\n function History(pdfs) {\n this.his = {};\n this.nodesUsed = {};\n this.edgesUsed = {};\n this.edges = [];\n if (!pdfs) return;\n\n while (pdfs) {\n var e = pdfs.edge;\n this.edges.push(e);\n this.nodesUsed[e.from] = 1;\n this.nodesUsed[e.to] = 1;\n this.edgesUsed[e.id] = 1;\n pdfs = pdfs.preNode;\n } // 倒序\n\n\n this.edges = this.edges.reverse();\n }\n\n History.prototype.hasNode = function (node) {\n return this.nodesUsed[node.id] === 1;\n };\n\n History.prototype.hasEdge = function (edge) {\n return this.edgesUsed[edge.id] === 1;\n };\n\n return History;\n}();\n\nvar GSpan =\n/** @class */\nfunction () {\n function GSpan(_a) {\n var graphs = _a.graphs,\n _b = _a.minSupport,\n minSupport = _b === void 0 ? 2 : _b,\n _c = _a.minNodeNum,\n minNodeNum = _c === void 0 ? 1 : _c,\n _d = _a.maxNodeNum,\n maxNodeNum = _d === void 0 ? 4 : _d,\n _e = _a.top,\n top = _e === void 0 ? 10 : _e,\n _f = _a.directed,\n directed = _f === void 0 ? false : _f,\n _g = _a.verbose,\n verbose = _g === void 0 ? false : _g; // -------- 第零步,初始化-------\n\n this.graphs = graphs;\n this.dfsCode = new DFScode();\n this.support = 0;\n this.frequentSize1Subgraphs = [];\n this.frequentSubgraphs = [];\n this.minSupport = minSupport;\n this.top = top;\n this.directed = directed;\n this.counter = 0; // TODO? timestamp = {}\n\n this.maxNodeNum = maxNodeNum;\n this.minNodeNum = minNodeNum;\n this.verbose = verbose;\n if (this.maxNodeNum < this.minNodeNum) this.maxNodeNum = this.minNodeNum;\n this.reportDF = []; // matrix\n } // Line 352\n\n\n GSpan.prototype.findForwardRootEdges = function (graph, fromNode) {\n var _this = this;\n\n var result = [];\n var nodeMap = graph.nodeMap;\n fromNode.edges.forEach(function (edge) {\n if (_this.directed || fromNode.label <= nodeMap[edge.to].label) result.push(edge);\n });\n return result;\n };\n\n GSpan.prototype.findBackwardEdge = function (graph, edge1, edge2, history) {\n if (!this.directed && edge1 === edge2) return null;\n var nodeMap = graph.nodeMap;\n var edge2To = nodeMap[edge2.to];\n var edge2ToEdges = edge2To.edges;\n var edgeLength = edge2ToEdges.length;\n\n for (var i = 0; i < edgeLength; i++) {\n var edge = edge2ToEdges[i];\n if (history.hasEdge(edge) || edge.to !== edge1.from) continue;\n\n if (!this.directed) {\n if (edge1.label < edge.label || edge1.label === edge.label && nodeMap[edge1.to].label <= nodeMap[edge2.to].label) {\n return edge;\n }\n } else {\n if (nodeMap[edge1.from].label < nodeMap[edge2.to].label || nodeMap[edge1.from].label === nodeMap[edge2.to].label && edge1.label <= edge.label) {\n return edge;\n }\n }\n }\n\n return null;\n };\n\n GSpan.prototype.findForwardPureEdges = function (graph, rightmostEdge, minNodeLabel, history) {\n var result = [];\n var rightmostEdgeToId = rightmostEdge.to;\n var edges = graph.nodeMap[rightmostEdgeToId].edges;\n var edgeLength = edges.length;\n\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var toNode = graph.nodeMap[edge.to];\n\n if (minNodeLabel <= toNode.label && !history.hasNode(toNode)) {\n result.push(edge);\n }\n }\n\n return result;\n };\n\n GSpan.prototype.findForwardRmpathEdges = function (graph, rightmostEdge, minNodeLabel, history) {\n var result = [];\n var nodeMap = graph.nodeMap;\n var toNodeLabel = nodeMap[rightmostEdge.to].label;\n var fromNode = nodeMap[rightmostEdge.from];\n var edges = fromNode.edges;\n var edgeLength = edges.length;\n\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var newToNodeLabel = nodeMap[edge.to].label;\n\n if (rightmostEdge.to === edge.to || minNodeLabel > newToNodeLabel || history.hasNode(nodeMap[edge.to])) {\n continue;\n }\n\n if (rightmostEdge.label < edge.label || rightmostEdge.label === edge.label && toNodeLabel <= newToNodeLabel) {\n result.push(edge);\n }\n }\n\n return result;\n };\n\n GSpan.prototype.getSupport = function (projected) {\n var graphMap = {};\n projected.forEach(function (pro) {\n if (!graphMap[pro.graphId]) graphMap[pro.graphId] = true;\n });\n return Object.keys(graphMap).length;\n };\n\n GSpan.prototype.findMinLabel = function (obj) {\n var minLabel = undefined;\n Object.keys(obj).forEach(function (nodeEdgeNodeLabel) {\n var _a = obj[nodeEdgeNodeLabel],\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n\n if (!minLabel) {\n minLabel = {\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n return;\n }\n\n if (nodeLabel1 < minLabel.nodeLabel1 || nodeLabel1 === minLabel.nodeLabel1 && edgeLabel < minLabel.edgeLabel || nodeLabel1 === minLabel.nodeLabel1 && edgeLabel === minLabel.edgeLabel && nodeLabel2 < minLabel.nodeLabel2) {\n minLabel = {\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n }\n });\n return minLabel;\n };\n\n GSpan.prototype.isMin = function () {\n var _this = this;\n\n var dfsCode = this.dfsCode;\n if (this.verbose) console.log(\"isMin checking\", dfsCode);\n if (dfsCode.dfsEdgeList.length === 1) return true;\n var directed = this.directed;\n var graph = dfsCode.toGraph(_struct.VACANT_GRAPH_ID, directed);\n var nodeMap = graph.nodeMap;\n var dfsCodeMin = new DFScode();\n var root = {};\n graph.nodes.forEach(function (node) {\n var forwardEdges = _this.findForwardRootEdges(graph, node);\n\n forwardEdges.forEach(function (edge) {\n var otherNode = nodeMap[edge.to];\n var nodeEdgeNodeLabel = \"\".concat(node.label, \"-\").concat(edge.label, \"-\").concat(otherNode.label);\n if (!root[nodeEdgeNodeLabel]) root[nodeEdgeNodeLabel] = {\n projected: [],\n nodeLabel1: node.label,\n edgeLabel: edge.label,\n nodeLabel2: otherNode.label\n };\n var pdfs = {\n graphId: graph.id,\n edge: edge,\n preNode: null\n };\n root[nodeEdgeNodeLabel].projected.push(pdfs);\n });\n }); // 比较 root 中每一项的 nodeEdgeNodeLabel 大小,按照 nodeLabel1、edgeLabe、nodeLabel2 的顺序比较\n\n var minLabel = this.findMinLabel(root); // line 419\n\n if (!minLabel) return;\n dfsCodeMin.dfsEdgeList.push(new DFSedge(0, 1, minLabel.nodeLabel1, minLabel.edgeLabel, minLabel.nodeLabel2)); // line 423\n\n var projectIsMin = function projectIsMin(projected) {\n // right most path\n var rmpath = dfsCodeMin.buildRmpath();\n var minNodeLabel = dfsCodeMin.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1;\n var maxToC = dfsCodeMin.dfsEdgeList[rmpath[0]].toNode; // node id\n\n var backwardRoot = {};\n var flag = false,\n newTo = 0;\n var end = directed ? -1 : 0; // 遍历到 1 还是到 0\n\n var _loop_1 = function _loop_1(i) {\n if (flag) return \"break\"; // line 435\n\n projected.forEach(function (p) {\n var history = new History(p);\n\n var backwardEdge = _this.findBackwardEdge(graph, history.edges[rmpath[i]], history.edges[rmpath[0]], history);\n\n if (backwardEdge) {\n // Line 441\n if (!backwardRoot[backwardEdge.label]) {\n backwardRoot[backwardEdge.label] = {\n projected: [],\n edgeLabel: backwardEdge.label\n };\n }\n\n backwardRoot[backwardEdge.label].projected.push({\n graphId: graph.id,\n edge: backwardRoot,\n preNode: p\n });\n newTo = dfsCodeMin.dfsEdgeList[rmpath[i]].fromNode;\n flag = true;\n }\n });\n };\n\n for (var i = rmpath.length - 1; i > end; i--) {\n var state_1 = _loop_1(i);\n\n if (state_1 === \"break\") break;\n }\n\n if (flag) {\n var minBackwardEdgeLabel = _this.findMinLabel(backwardRoot);\n\n dfsCodeMin.dfsEdgeList.push(new DFSedge(maxToC, newTo, _struct.VACANT_NODE_LABEL, minBackwardEdgeLabel.edgeLabel, _struct.VACANT_NODE_LABEL));\n var idx_1 = dfsCodeMin.dfsEdgeList.length - 1;\n if (_this.dfsCode.dfsEdgeList[idx_1] !== dfsCodeMin.dfsEdgeList[idx_1]) return false;\n return projectIsMin(backwardRoot[minBackwardEdgeLabel.edgeLabel].projected);\n }\n\n var forwardRoot = {};\n flag = false;\n var newFrom = 0;\n projected.forEach(function (p) {\n var history = new History(p);\n\n var forwardPureEdges = _this.findForwardPureEdges(graph, history.edges[rmpath[0]], minNodeLabel, history);\n\n if (forwardPureEdges.length > 0) {\n flag = true;\n newFrom = maxToC;\n forwardPureEdges.forEach(function (edge) {\n var key = \"\".concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: graph.id,\n edge: edge,\n preNode: p\n });\n });\n }\n });\n var pathLength = rmpath.length;\n\n var _loop_2 = function _loop_2(i) {\n if (flag) return \"break\";\n var value = rmpath[i];\n projected.forEach(function (p) {\n var history = new History(p);\n\n var forwardRmpathEdges = _this.findForwardRmpathEdges(graph, history.edges[value], minNodeLabel, history);\n\n if (forwardRmpathEdges.length > 0) {\n flag = true;\n newFrom = dfsCodeMin.dfsEdgeList[value].fromNode;\n forwardRmpathEdges.forEach(function (edge) {\n var key = \"\".concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: graph.id,\n edge: edge,\n preNode: p\n });\n });\n }\n });\n };\n\n for (var i = 0; i < pathLength; i++) {\n var state_2 = _loop_2(i);\n\n if (state_2 === \"break\") break;\n }\n\n if (!flag) return true;\n\n var forwardMinEdgeNodeLabel = _this.findMinLabel(forwardRoot);\n\n dfsCodeMin.dfsEdgeList.push(new DFSedge(newFrom, maxToC + 1, _struct.VACANT_NODE_LABEL, forwardMinEdgeNodeLabel.edgeLabel, forwardMinEdgeNodeLabel.nodeLabel2));\n var idx = dfsCodeMin.dfsEdgeList.length - 1;\n if (dfsCode.dfsEdgeList[idx] !== dfsCodeMin.dfsEdgeList[idx]) return false;\n return projectIsMin(forwardRoot[\"\".concat(forwardMinEdgeNodeLabel.edgeLabel, \"-\").concat(forwardMinEdgeNodeLabel.nodeLabel2)].projected);\n };\n\n var key = \"\".concat(minLabel.nodeLabel1, \"-\").concat(minLabel.edgeLabel, \"-\").concat(minLabel.nodeLabel2);\n return projectIsMin(root[key].projected);\n };\n\n GSpan.prototype.report = function () {\n if (this.dfsCode.getNodeNum() < this.minNodeNum) return;\n this.counter++;\n var graph = this.dfsCode.toGraph(this.counter, this.directed);\n this.frequentSubgraphs.push((0, _util.clone)(graph));\n };\n\n GSpan.prototype.subGraphMining = function (projected) {\n var _this = this;\n\n var support = this.getSupport(projected);\n if (support < this.minSupport) return;\n if (!this.isMin()) return;\n this.report();\n var nodeNum = this.dfsCode.getNodeNum();\n var rmpath = this.dfsCode.buildRmpath();\n var maxToC = this.dfsCode.dfsEdgeList[rmpath[0]].toNode;\n var minNodeLabel = this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1;\n var forwardRoot = {};\n var backwardRoot = {};\n projected.forEach(function (p) {\n var graph = _this.graphs[p.graphId];\n var nodeMap = graph.nodeMap;\n var history = new History(p); // backward Line 526\n\n for (var i = rmpath.length - 1; i >= 0; i--) {\n var backwardEdge = _this.findBackwardEdge(graph, history.edges[rmpath[i]], history.edges[rmpath[0]], history);\n\n if (backwardEdge) {\n var key = \"\".concat(_this.dfsCode.dfsEdgeList[rmpath[i]].fromNode, \"-\").concat(backwardEdge.label);\n if (!backwardRoot[key]) backwardRoot[key] = {\n projected: [],\n toNodeId: _this.dfsCode.dfsEdgeList[rmpath[i]].fromNode,\n edgeLabel: backwardEdge.label\n };\n backwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: backwardEdge,\n preNode: p\n });\n }\n } // pure forward\n\n\n if (nodeNum >= _this.maxNodeNum) return;\n\n var forwardPureEdges = _this.findForwardPureEdges(graph, history.edges[rmpath[0]], minNodeLabel, history);\n\n forwardPureEdges.forEach(function (edge) {\n var key = \"\".concat(maxToC, \"-\").concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n fromNodeId: maxToC,\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: edge,\n preNode: p\n });\n });\n\n var _loop_3 = function _loop_3(i) {\n var forwardRmpathEdges = _this.findForwardRmpathEdges(graph, history.edges[rmpath[i]], minNodeLabel, history);\n\n forwardRmpathEdges.forEach(function (edge) {\n var key = \"\".concat(_this.dfsCode.dfsEdgeList[rmpath[i]].fromNode, \"-\").concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n fromNodeId: _this.dfsCode.dfsEdgeList[rmpath[i]].fromNode,\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: edge,\n preNode: p\n });\n });\n }; // rmpath forward\n\n\n for (var i = 0; i < rmpath.length; i++) {\n _loop_3(i);\n }\n }); // backward\n\n Object.keys(backwardRoot).forEach(function (key) {\n var _a = backwardRoot[key],\n toNodeId = _a.toNodeId,\n edgeLabel = _a.edgeLabel;\n\n _this.dfsCode.dfsEdgeList.push(new DFSedge(maxToC, toNodeId, \"-1\", edgeLabel, \"-1\"));\n\n _this.subGraphMining(backwardRoot[key].projected);\n\n _this.dfsCode.dfsEdgeList.pop();\n }); // forward\n\n Object.keys(forwardRoot).forEach(function (key) {\n var _a = forwardRoot[key],\n fromNodeId = _a.fromNodeId,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n\n _this.dfsCode.dfsEdgeList.push(new DFSedge(fromNodeId, maxToC + 1, _struct.VACANT_NODE_LABEL, edgeLabel, nodeLabel2));\n\n _this.subGraphMining(forwardRoot[key].projected);\n\n _this.dfsCode.dfsEdgeList.pop();\n });\n };\n\n GSpan.prototype.generate1EdgeFrequentSubGraphs = function () {\n var graphs = this.graphs;\n var directed = this.directed;\n var minSupport = this.minSupport;\n var frequentSize1Subgraphs = this.frequentSize1Subgraphs;\n var nodeLabelCounter = {},\n nodeEdgeNodeCounter = {}; // 保存各个图和各自节点的关系 map,key 格式为 graphKey-node类型\n\n var nodeLableCounted = {}; // 保存各个图和各自边的关系 map,key 格式为 graphKey-fromNode类型-edge类型-toNode类型\n\n var nodeEdgeNodeLabelCounted = {};\n Object.keys(graphs).forEach(function (key) {\n // Line 271\n var graph = graphs[key];\n var nodeMap = graph.nodeMap; // 遍历节点,记录对应图 与 每个节点的 label 到 nodeLableCounted\n\n graph.nodes.forEach(function (node, i) {\n // Line 272\n var nodeLabel = node.label;\n var graphNodeKey = \"\".concat(key, \"-\").concat(nodeLabel);\n\n if (!nodeLableCounted[graphNodeKey]) {\n var counter = nodeLabelCounter[nodeLabel] || 0;\n counter++;\n nodeLabelCounter[nodeLabel] = counter;\n }\n\n nodeLableCounted[graphNodeKey] = {\n graphKey: key,\n label: nodeLabel\n }; // 遍历该节点的所有边,记录各个图和各自边的关系到 nodeEdgeNodeLabelCounted. Line 276\n\n node.edges.forEach(function (edge) {\n var nodeLabel1 = nodeLabel;\n var nodeLabel2 = nodeMap[edge.to].label;\n\n if (!directed && nodeLabel1 > nodeLabel2) {\n var tmp = nodeLabel2;\n nodeLabel2 = nodeLabel1;\n nodeLabel1 = tmp;\n }\n\n var edgeLabel = edge.label;\n var graphNodeEdgeNodeKey = \"\".concat(key, \"-\").concat(nodeLabel1, \"-\").concat(edgeLabel, \"-\").concat(nodeLabel2);\n var nodeEdgeNodeKey = \"\".concat(nodeLabel1, \"-\").concat(edgeLabel, \"-\").concat(nodeLabel2);\n\n if (!nodeEdgeNodeCounter[nodeEdgeNodeKey]) {\n var counter = nodeEdgeNodeCounter[nodeEdgeNodeKey] || 0;\n counter++;\n nodeEdgeNodeCounter[nodeEdgeNodeKey] = counter; // Line281\n }\n\n nodeEdgeNodeLabelCounted[graphNodeEdgeNodeKey] = {\n graphId: key,\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n });\n });\n }); // 计算频繁的节点\n\n Object.keys(nodeLabelCounter).forEach(function (label) {\n var count = nodeLabelCounter[label];\n if (count < minSupport) return;\n var g = {\n nodes: [],\n edges: []\n };\n g.nodes.push({\n id: \"0\",\n label: label\n });\n frequentSize1Subgraphs.push(g); // if (minNodeNum <= 1) reportSize1 TODO\n });\n return frequentSize1Subgraphs;\n };\n\n GSpan.prototype.run = function () {\n var _this = this; // -------- 第一步, _generate_1edge_frequent_subgraphs:频繁的单个节点-------\n\n\n this.frequentSize1Subgraphs = this.generate1EdgeFrequentSubGraphs();\n if (this.maxNodeNum < 2) return;\n var graphs = this.graphs;\n var directed = this.directed; // PDFS 数组的 map Line 304\n\n var root = {};\n Object.keys(graphs).forEach(function (graphId) {\n var graph = graphs[graphId];\n var nodeMap = graph.nodeMap; // Line 306\n\n graph.nodes.forEach(function (node) {\n var forwardRootEdges = _this.findForwardRootEdges(graph, node); // Line 308\n\n\n forwardRootEdges.forEach(function (edge) {\n var toNode = nodeMap[edge.to];\n var nodeEdgeNodeLabel = \"\".concat(node.label, \"-\").concat(edge.label, \"-\").concat(toNode.label);\n if (!root[nodeEdgeNodeLabel]) root[nodeEdgeNodeLabel] = {\n projected: [],\n nodeLabel1: node.label,\n edgeLabel: edge.label,\n nodeLabel2: toNode.label\n };\n var pdfs = {\n graphId: graphId,\n edge: edge,\n preNode: null\n };\n root[nodeEdgeNodeLabel].projected.push(pdfs);\n });\n });\n }); // Line 313\n\n Object.keys(root).forEach(function (nodeEdgeNodeLabel) {\n var _a = root[nodeEdgeNodeLabel],\n projected = _a.projected,\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n\n _this.dfsCode.dfsEdgeList.push(new DFSedge(0, 1, nodeLabel1, edgeLabel, nodeLabel2));\n\n _this.subGraphMining(projected);\n\n _this.dfsCode.dfsEdgeList.pop();\n });\n };\n\n return GSpan;\n}();\n\nvar formatGraphs = function formatGraphs(graphs, directed, nodeLabelProp, edgeLabelProp) {\n var result = {};\n Object.keys(graphs).forEach(function (key, i) {\n var graph = graphs[key];\n var fGraph = new _struct.Graph(i, true, directed);\n var nodeIdxMap = {};\n graph.nodes.forEach(function (node, j) {\n fGraph.addNode(j, node[nodeLabelProp]);\n nodeIdxMap[node.id] = j;\n });\n graph.edges.forEach(function (edge, k) {\n var sourceIdx = nodeIdxMap[edge.source];\n var targetIdx = nodeIdxMap[edge.target];\n fGraph.addEdge(-1, sourceIdx, targetIdx, edge[edgeLabelProp]);\n });\n if (fGraph && fGraph.getNodeNum()) result[fGraph.id] = fGraph;\n });\n return result;\n};\n\nvar toGraphDatas = function toGraphDatas(graphs, nodeLabelProp, edgeLabelProp) {\n var result = [];\n graphs.forEach(function (graph) {\n var graphData = {\n nodes: [],\n edges: []\n };\n graph.nodes.forEach(function (node) {\n var _a;\n\n graphData.nodes.push((_a = {\n id: \"\".concat(node.id)\n }, _a[nodeLabelProp] = node.label, _a));\n });\n graph.edges.forEach(function (edge) {\n var _a;\n\n graphData.edges.push((_a = {\n source: \"\".concat(edge.from),\n target: \"\".concat(edge.to)\n }, _a[edgeLabelProp] = edge.label, _a));\n });\n result.push(graphData);\n });\n return result;\n};\n\nvar DEFAULT_LABEL_NAME = \"cluster\";\n/**\n * gSpan 频繁子图计算算法(frequent graph mining)\n * @param params 参数\n */\n\nvar gSpan = function gSpan(params) {\n // ------- 将图数据 GraphData 的 map 转换为格式 -------\n var graphs = params.graphs,\n _a = params.directed,\n directed = _a === void 0 ? false : _a,\n _b = params.nodeLabelProp,\n nodeLabelProp = _b === void 0 ? DEFAULT_LABEL_NAME : _b,\n _c = params.edgeLabelProp,\n edgeLabelProp = _c === void 0 ? DEFAULT_LABEL_NAME : _c;\n var formattedGraphs = formatGraphs(graphs, directed, nodeLabelProp, edgeLabelProp);\n var minSupport = params.minSupport,\n maxNodeNum = params.maxNodeNum,\n minNodeNum = params.minNodeNum,\n verbose = params.verbose,\n top = params.top; // ------- 初始化与执行算法 -------\n\n var algoParams = {\n graphs: formattedGraphs,\n minSupport: minSupport,\n maxNodeNum: maxNodeNum,\n minNodeNum: minNodeNum,\n top: top,\n verbose: verbose,\n directed: directed\n };\n var calculator = new GSpan(algoParams);\n calculator.run();\n var result = toGraphDatas(calculator.frequentSubgraphs, nodeLabelProp, edgeLabelProp);\n return result;\n};\n\nvar _default = gSpan;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/gSpan/gSpan.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _struct = __webpack_require__(/*! ./struct */ \"./node_modules/@antv/algorithm/lib/gSpan/struct.js\");\nvar DFSedge = /** @class */function () {\n function DFSedge(fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel) {\n this.fromNode = fromNode;\n this.toNode = toNode;\n this.nodeEdgeNodeLabel = {\n nodeLabel1: fromNodeLabel || _struct.VACANT_NODE_LABEL,\n edgeLabel: edgeLabel || _struct.VACANT_EDGE_LABEL,\n nodeLabel2: toNodeLabel || _struct.VACANT_NODE_LABEL\n };\n }\n DFSedge.prototype.equalTo = function (other) {\n return this.fromNode === other.formNode && this.toNode === other.toNode && this.nodeEdgeNodeLabel === other.nodeEdgeNodeLabel;\n };\n DFSedge.prototype.notEqualTo = function (other) {\n return !this.equalTo(other);\n };\n return DFSedge;\n}();\n// DFScode 是 DESedge 的数组\nvar DFScode = /** @class */function () {\n function DFScode() {\n this.rmpath = [];\n this.dfsEdgeList = [];\n }\n DFScode.prototype.equalTo = function (other) {\n var aLength = this.dfsEdgeList.length;\n var bLength = other.length;\n if (aLength !== bLength) return false;\n for (var i = 0; i < aLength; i++) {\n if (this.dfsEdgeList[i] !== other[i]) return false;\n }\n return true;\n };\n DFScode.prototype.notEqualTo = function (other) {\n return !this.equalTo(other);\n };\n /** 增加一条 edge 到 DFScode */\n DFScode.prototype.pushBack = function (fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel) {\n this.dfsEdgeList.push(new DFSedge(fromNode, toNode, fromNodeLabel, edgeLabel, toNodeLabel));\n return this.dfsEdgeList;\n };\n /** 根据 dfs 构建图 */\n DFScode.prototype.toGraph = function (graphId, directed) {\n if (graphId === void 0) {\n graphId = _struct.VACANT_GRAPH_ID;\n }\n if (directed === void 0) {\n directed = false;\n }\n var graph = new _struct.Graph(graphId, true, directed);\n this.dfsEdgeList.forEach(function (dfsEdge) {\n var fromNodeId = dfsEdge.fromNode;\n var toNodeId = dfsEdge.toNode;\n var _a = dfsEdge.nodeEdgeNodeLabel,\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n if (nodeLabel1 !== _struct.VACANT_NODE_LABEL) graph.addNode(fromNodeId, nodeLabel1);\n if (nodeLabel2 !== _struct.VACANT_NODE_LABEL) graph.addNode(toNodeId, nodeLabel2);\n if (nodeLabel1 !== _struct.VACANT_NODE_LABEL && nodeLabel2 !== nodeLabel1) graph.addEdge(undefined, fromNodeId, toNodeId, edgeLabel);\n });\n return graph;\n };\n // 建立 rightmost path\n DFScode.prototype.buildRmpath = function () {\n this.rmpath = [];\n var oldFrom = undefined;\n var selfLength = this.dfsEdgeList.length;\n for (var i = selfLength - 1; i >= 0; i--) {\n var dfsEdge = this.dfsEdgeList[i];\n var fromNodeIdx = dfsEdge.fromNode;\n var toNodeIdx = dfsEdge.toNode;\n if (fromNodeIdx < toNodeIdx && (oldFrom === undefined || toNodeIdx === oldFrom)) {\n this.rmpath.push(i);\n oldFrom = fromNodeIdx;\n }\n }\n return this.rmpath;\n };\n DFScode.prototype.getNodeNum = function () {\n var nodeMap = {};\n this.dfsEdgeList.forEach(function (dfsEdge) {\n if (!nodeMap[dfsEdge.fromNode]) nodeMap[dfsEdge.fromNode] = true;\n if (!nodeMap[dfsEdge.toNode]) nodeMap[dfsEdge.toNode] = true;\n });\n return Object.keys(nodeMap).length;\n };\n return DFScode;\n}();\nvar History = /** @class */function () {\n function History(pdfs) {\n this.his = {};\n this.nodesUsed = {};\n this.edgesUsed = {};\n this.edges = [];\n if (!pdfs) return;\n while (pdfs) {\n var e = pdfs.edge;\n this.edges.push(e);\n this.nodesUsed[e.from] = 1;\n this.nodesUsed[e.to] = 1;\n this.edgesUsed[e.id] = 1;\n pdfs = pdfs.preNode;\n }\n // 倒序\n this.edges = this.edges.reverse();\n }\n History.prototype.hasNode = function (node) {\n return this.nodesUsed[node.id] === 1;\n };\n History.prototype.hasEdge = function (edge) {\n return this.edgesUsed[edge.id] === 1;\n };\n return History;\n}();\nvar GSpan = /** @class */function () {\n function GSpan(_a) {\n var graphs = _a.graphs,\n _b = _a.minSupport,\n minSupport = _b === void 0 ? 2 : _b,\n _c = _a.minNodeNum,\n minNodeNum = _c === void 0 ? 1 : _c,\n _d = _a.maxNodeNum,\n maxNodeNum = _d === void 0 ? 4 : _d,\n _e = _a.top,\n top = _e === void 0 ? 10 : _e,\n _f = _a.directed,\n directed = _f === void 0 ? false : _f,\n _g = _a.verbose,\n verbose = _g === void 0 ? false : _g;\n // -------- 第零步,初始化-------\n this.graphs = graphs;\n this.dfsCode = new DFScode();\n this.support = 0;\n this.frequentSize1Subgraphs = [];\n this.frequentSubgraphs = [];\n this.minSupport = minSupport;\n this.top = top;\n this.directed = directed;\n this.counter = 0;\n // TODO? timestamp = {}\n this.maxNodeNum = maxNodeNum;\n this.minNodeNum = minNodeNum;\n this.verbose = verbose;\n if (this.maxNodeNum < this.minNodeNum) this.maxNodeNum = this.minNodeNum;\n this.reportDF = []; // matrix\n }\n // Line 352\n GSpan.prototype.findForwardRootEdges = function (graph, fromNode) {\n var _this = this;\n var result = [];\n var nodeMap = graph.nodeMap;\n fromNode.edges.forEach(function (edge) {\n if (_this.directed || fromNode.label <= nodeMap[edge.to].label) result.push(edge);\n });\n return result;\n };\n GSpan.prototype.findBackwardEdge = function (graph, edge1, edge2, history) {\n if (!this.directed && edge1 === edge2) return null;\n var nodeMap = graph.nodeMap;\n var edge2To = nodeMap[edge2.to];\n var edge2ToEdges = edge2To.edges;\n var edgeLength = edge2ToEdges.length;\n for (var i = 0; i < edgeLength; i++) {\n var edge = edge2ToEdges[i];\n if (history.hasEdge(edge) || edge.to !== edge1.from) continue;\n if (!this.directed) {\n if (edge1.label < edge.label || edge1.label === edge.label && nodeMap[edge1.to].label <= nodeMap[edge2.to].label) {\n return edge;\n }\n } else {\n if (nodeMap[edge1.from].label < nodeMap[edge2.to].label || nodeMap[edge1.from].label === nodeMap[edge2.to].label && edge1.label <= edge.label) {\n return edge;\n }\n }\n }\n return null;\n };\n GSpan.prototype.findForwardPureEdges = function (graph, rightmostEdge, minNodeLabel, history) {\n var result = [];\n var rightmostEdgeToId = rightmostEdge.to;\n var edges = graph.nodeMap[rightmostEdgeToId].edges;\n var edgeLength = edges.length;\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var toNode = graph.nodeMap[edge.to];\n if (minNodeLabel <= toNode.label && !history.hasNode(toNode)) {\n result.push(edge);\n }\n }\n return result;\n };\n GSpan.prototype.findForwardRmpathEdges = function (graph, rightmostEdge, minNodeLabel, history) {\n var result = [];\n var nodeMap = graph.nodeMap;\n var toNodeLabel = nodeMap[rightmostEdge.to].label;\n var fromNode = nodeMap[rightmostEdge.from];\n var edges = fromNode.edges;\n var edgeLength = edges.length;\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var newToNodeLabel = nodeMap[edge.to].label;\n if (rightmostEdge.to === edge.to || minNodeLabel > newToNodeLabel || history.hasNode(nodeMap[edge.to])) {\n continue;\n }\n if (rightmostEdge.label < edge.label || rightmostEdge.label === edge.label && toNodeLabel <= newToNodeLabel) {\n result.push(edge);\n }\n }\n return result;\n };\n GSpan.prototype.getSupport = function (projected) {\n var graphMap = {};\n projected.forEach(function (pro) {\n if (!graphMap[pro.graphId]) graphMap[pro.graphId] = true;\n });\n return Object.keys(graphMap).length;\n };\n GSpan.prototype.findMinLabel = function (obj) {\n var minLabel = undefined;\n Object.keys(obj).forEach(function (nodeEdgeNodeLabel) {\n var _a = obj[nodeEdgeNodeLabel],\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n if (!minLabel) {\n minLabel = {\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n return;\n }\n if (nodeLabel1 < minLabel.nodeLabel1 || nodeLabel1 === minLabel.nodeLabel1 && edgeLabel < minLabel.edgeLabel || nodeLabel1 === minLabel.nodeLabel1 && edgeLabel === minLabel.edgeLabel && nodeLabel2 < minLabel.nodeLabel2) {\n minLabel = {\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n }\n });\n return minLabel;\n };\n GSpan.prototype.isMin = function () {\n var _this = this;\n var dfsCode = this.dfsCode;\n if (this.verbose) console.log(\"isMin checking\", dfsCode);\n if (dfsCode.dfsEdgeList.length === 1) return true;\n var directed = this.directed;\n var graph = dfsCode.toGraph(_struct.VACANT_GRAPH_ID, directed);\n var nodeMap = graph.nodeMap;\n var dfsCodeMin = new DFScode();\n var root = {};\n graph.nodes.forEach(function (node) {\n var forwardEdges = _this.findForwardRootEdges(graph, node);\n forwardEdges.forEach(function (edge) {\n var otherNode = nodeMap[edge.to];\n var nodeEdgeNodeLabel = \"\".concat(node.label, \"-\").concat(edge.label, \"-\").concat(otherNode.label);\n if (!root[nodeEdgeNodeLabel]) root[nodeEdgeNodeLabel] = {\n projected: [],\n nodeLabel1: node.label,\n edgeLabel: edge.label,\n nodeLabel2: otherNode.label\n };\n var pdfs = {\n graphId: graph.id,\n edge: edge,\n preNode: null\n };\n root[nodeEdgeNodeLabel].projected.push(pdfs);\n });\n });\n // 比较 root 中每一项的 nodeEdgeNodeLabel 大小,按照 nodeLabel1、edgeLabe、nodeLabel2 的顺序比较\n var minLabel = this.findMinLabel(root); // line 419\n if (!minLabel) return;\n dfsCodeMin.dfsEdgeList.push(new DFSedge(0, 1, minLabel.nodeLabel1, minLabel.edgeLabel, minLabel.nodeLabel2));\n // line 423\n var projectIsMin = function projectIsMin(projected) {\n // right most path\n var rmpath = dfsCodeMin.buildRmpath();\n var minNodeLabel = dfsCodeMin.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1;\n var maxToC = dfsCodeMin.dfsEdgeList[rmpath[0]].toNode; // node id\n var backwardRoot = {};\n var flag = false,\n newTo = 0;\n var end = directed ? -1 : 0; // 遍历到 1 还是到 0\n var _loop_1 = function _loop_1(i) {\n if (flag) return \"break\";\n // line 435\n projected.forEach(function (p) {\n var history = new History(p);\n var backwardEdge = _this.findBackwardEdge(graph, history.edges[rmpath[i]], history.edges[rmpath[0]], history);\n if (backwardEdge) {\n // Line 441\n if (!backwardRoot[backwardEdge.label]) {\n backwardRoot[backwardEdge.label] = {\n projected: [],\n edgeLabel: backwardEdge.label\n };\n }\n backwardRoot[backwardEdge.label].projected.push({\n graphId: graph.id,\n edge: backwardRoot,\n preNode: p\n });\n newTo = dfsCodeMin.dfsEdgeList[rmpath[i]].fromNode;\n flag = true;\n }\n });\n };\n for (var i = rmpath.length - 1; i > end; i--) {\n var state_1 = _loop_1(i);\n if (state_1 === \"break\") break;\n }\n if (flag) {\n var minBackwardEdgeLabel = _this.findMinLabel(backwardRoot);\n dfsCodeMin.dfsEdgeList.push(new DFSedge(maxToC, newTo, _struct.VACANT_NODE_LABEL, minBackwardEdgeLabel.edgeLabel, _struct.VACANT_NODE_LABEL));\n var idx_1 = dfsCodeMin.dfsEdgeList.length - 1;\n if (_this.dfsCode.dfsEdgeList[idx_1] !== dfsCodeMin.dfsEdgeList[idx_1]) return false;\n return projectIsMin(backwardRoot[minBackwardEdgeLabel.edgeLabel].projected);\n }\n var forwardRoot = {};\n flag = false;\n var newFrom = 0;\n projected.forEach(function (p) {\n var history = new History(p);\n var forwardPureEdges = _this.findForwardPureEdges(graph, history.edges[rmpath[0]], minNodeLabel, history);\n if (forwardPureEdges.length > 0) {\n flag = true;\n newFrom = maxToC;\n forwardPureEdges.forEach(function (edge) {\n var key = \"\".concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: graph.id,\n edge: edge,\n preNode: p\n });\n });\n }\n });\n var pathLength = rmpath.length;\n var _loop_2 = function _loop_2(i) {\n if (flag) return \"break\";\n var value = rmpath[i];\n projected.forEach(function (p) {\n var history = new History(p);\n var forwardRmpathEdges = _this.findForwardRmpathEdges(graph, history.edges[value], minNodeLabel, history);\n if (forwardRmpathEdges.length > 0) {\n flag = true;\n newFrom = dfsCodeMin.dfsEdgeList[value].fromNode;\n forwardRmpathEdges.forEach(function (edge) {\n var key = \"\".concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: graph.id,\n edge: edge,\n preNode: p\n });\n });\n }\n });\n };\n for (var i = 0; i < pathLength; i++) {\n var state_2 = _loop_2(i);\n if (state_2 === \"break\") break;\n }\n if (!flag) return true;\n var forwardMinEdgeNodeLabel = _this.findMinLabel(forwardRoot);\n dfsCodeMin.dfsEdgeList.push(new DFSedge(newFrom, maxToC + 1, _struct.VACANT_NODE_LABEL, forwardMinEdgeNodeLabel.edgeLabel, forwardMinEdgeNodeLabel.nodeLabel2));\n var idx = dfsCodeMin.dfsEdgeList.length - 1;\n if (dfsCode.dfsEdgeList[idx] !== dfsCodeMin.dfsEdgeList[idx]) return false;\n return projectIsMin(forwardRoot[\"\".concat(forwardMinEdgeNodeLabel.edgeLabel, \"-\").concat(forwardMinEdgeNodeLabel.nodeLabel2)].projected);\n };\n var key = \"\".concat(minLabel.nodeLabel1, \"-\").concat(minLabel.edgeLabel, \"-\").concat(minLabel.nodeLabel2);\n return projectIsMin(root[key].projected);\n };\n GSpan.prototype.report = function () {\n if (this.dfsCode.getNodeNum() < this.minNodeNum) return;\n this.counter++;\n var graph = this.dfsCode.toGraph(this.counter, this.directed);\n this.frequentSubgraphs.push((0, _util.clone)(graph));\n };\n GSpan.prototype.subGraphMining = function (projected) {\n var _this = this;\n var support = this.getSupport(projected);\n if (support < this.minSupport) return;\n if (!this.isMin()) return;\n this.report();\n var nodeNum = this.dfsCode.getNodeNum();\n var rmpath = this.dfsCode.buildRmpath();\n var maxToC = this.dfsCode.dfsEdgeList[rmpath[0]].toNode;\n var minNodeLabel = this.dfsCode.dfsEdgeList[0].nodeEdgeNodeLabel.nodeLabel1;\n var forwardRoot = {};\n var backwardRoot = {};\n projected.forEach(function (p) {\n var graph = _this.graphs[p.graphId];\n var nodeMap = graph.nodeMap;\n var history = new History(p);\n // backward Line 526\n for (var i = rmpath.length - 1; i >= 0; i--) {\n var backwardEdge = _this.findBackwardEdge(graph, history.edges[rmpath[i]], history.edges[rmpath[0]], history);\n if (backwardEdge) {\n var key = \"\".concat(_this.dfsCode.dfsEdgeList[rmpath[i]].fromNode, \"-\").concat(backwardEdge.label);\n if (!backwardRoot[key]) backwardRoot[key] = {\n projected: [],\n toNodeId: _this.dfsCode.dfsEdgeList[rmpath[i]].fromNode,\n edgeLabel: backwardEdge.label\n };\n backwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: backwardEdge,\n preNode: p\n });\n }\n }\n // pure forward\n if (nodeNum >= _this.maxNodeNum) return;\n var forwardPureEdges = _this.findForwardPureEdges(graph, history.edges[rmpath[0]], minNodeLabel, history);\n forwardPureEdges.forEach(function (edge) {\n var key = \"\".concat(maxToC, \"-\").concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n fromNodeId: maxToC,\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: edge,\n preNode: p\n });\n });\n var _loop_3 = function _loop_3(i) {\n var forwardRmpathEdges = _this.findForwardRmpathEdges(graph, history.edges[rmpath[i]], minNodeLabel, history);\n forwardRmpathEdges.forEach(function (edge) {\n var key = \"\".concat(_this.dfsCode.dfsEdgeList[rmpath[i]].fromNode, \"-\").concat(edge.label, \"-\").concat(nodeMap[edge.to].label);\n if (!forwardRoot[key]) forwardRoot[key] = {\n projected: [],\n fromNodeId: _this.dfsCode.dfsEdgeList[rmpath[i]].fromNode,\n edgeLabel: edge.label,\n nodeLabel2: nodeMap[edge.to].label\n };\n forwardRoot[key].projected.push({\n graphId: p.graphId,\n edge: edge,\n preNode: p\n });\n });\n };\n // rmpath forward\n for (var i = 0; i < rmpath.length; i++) {\n _loop_3(i);\n }\n });\n // backward\n Object.keys(backwardRoot).forEach(function (key) {\n var _a = backwardRoot[key],\n toNodeId = _a.toNodeId,\n edgeLabel = _a.edgeLabel;\n _this.dfsCode.dfsEdgeList.push(new DFSedge(maxToC, toNodeId, \"-1\", edgeLabel, \"-1\"));\n _this.subGraphMining(backwardRoot[key].projected);\n _this.dfsCode.dfsEdgeList.pop();\n });\n // forward\n Object.keys(forwardRoot).forEach(function (key) {\n var _a = forwardRoot[key],\n fromNodeId = _a.fromNodeId,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n _this.dfsCode.dfsEdgeList.push(new DFSedge(fromNodeId, maxToC + 1, _struct.VACANT_NODE_LABEL, edgeLabel, nodeLabel2));\n _this.subGraphMining(forwardRoot[key].projected);\n _this.dfsCode.dfsEdgeList.pop();\n });\n };\n GSpan.prototype.generate1EdgeFrequentSubGraphs = function () {\n var graphs = this.graphs;\n var directed = this.directed;\n var minSupport = this.minSupport;\n var frequentSize1Subgraphs = this.frequentSize1Subgraphs;\n var nodeLabelCounter = {},\n nodeEdgeNodeCounter = {};\n // 保存各个图和各自节点的关系 map,key 格式为 graphKey-node类型\n var nodeLableCounted = {};\n // 保存各个图和各自边的关系 map,key 格式为 graphKey-fromNode类型-edge类型-toNode类型\n var nodeEdgeNodeLabelCounted = {};\n Object.keys(graphs).forEach(function (key) {\n // Line 271\n var graph = graphs[key];\n var nodeMap = graph.nodeMap;\n // 遍历节点,记录对应图 与 每个节点的 label 到 nodeLableCounted\n graph.nodes.forEach(function (node, i) {\n // Line 272\n var nodeLabel = node.label;\n var graphNodeKey = \"\".concat(key, \"-\").concat(nodeLabel);\n if (!nodeLableCounted[graphNodeKey]) {\n var counter = nodeLabelCounter[nodeLabel] || 0;\n counter++;\n nodeLabelCounter[nodeLabel] = counter;\n }\n nodeLableCounted[graphNodeKey] = {\n graphKey: key,\n label: nodeLabel\n };\n // 遍历该节点的所有边,记录各个图和各自边的关系到 nodeEdgeNodeLabelCounted. Line 276\n node.edges.forEach(function (edge) {\n var nodeLabel1 = nodeLabel;\n var nodeLabel2 = nodeMap[edge.to].label;\n if (!directed && nodeLabel1 > nodeLabel2) {\n var tmp = nodeLabel2;\n nodeLabel2 = nodeLabel1;\n nodeLabel1 = tmp;\n }\n var edgeLabel = edge.label;\n var graphNodeEdgeNodeKey = \"\".concat(key, \"-\").concat(nodeLabel1, \"-\").concat(edgeLabel, \"-\").concat(nodeLabel2);\n var nodeEdgeNodeKey = \"\".concat(nodeLabel1, \"-\").concat(edgeLabel, \"-\").concat(nodeLabel2);\n if (!nodeEdgeNodeCounter[nodeEdgeNodeKey]) {\n var counter = nodeEdgeNodeCounter[nodeEdgeNodeKey] || 0;\n counter++;\n nodeEdgeNodeCounter[nodeEdgeNodeKey] = counter; // Line281\n }\n\n nodeEdgeNodeLabelCounted[graphNodeEdgeNodeKey] = {\n graphId: key,\n nodeLabel1: nodeLabel1,\n edgeLabel: edgeLabel,\n nodeLabel2: nodeLabel2\n };\n });\n });\n });\n // 计算频繁的节点\n Object.keys(nodeLabelCounter).forEach(function (label) {\n var count = nodeLabelCounter[label];\n if (count < minSupport) return;\n var g = {\n nodes: [],\n edges: []\n };\n g.nodes.push({\n id: \"0\",\n label: label\n });\n frequentSize1Subgraphs.push(g);\n // if (minNodeNum <= 1) reportSize1 TODO\n });\n\n return frequentSize1Subgraphs;\n };\n GSpan.prototype.run = function () {\n var _this = this;\n // -------- 第一步, _generate_1edge_frequent_subgraphs:频繁的单个节点-------\n this.frequentSize1Subgraphs = this.generate1EdgeFrequentSubGraphs();\n if (this.maxNodeNum < 2) return;\n var graphs = this.graphs;\n var directed = this.directed;\n // PDFS 数组的 map Line 304\n var root = {};\n Object.keys(graphs).forEach(function (graphId) {\n var graph = graphs[graphId];\n var nodeMap = graph.nodeMap;\n // Line 306\n graph.nodes.forEach(function (node) {\n var forwardRootEdges = _this.findForwardRootEdges(graph, node);\n // Line 308\n forwardRootEdges.forEach(function (edge) {\n var toNode = nodeMap[edge.to];\n var nodeEdgeNodeLabel = \"\".concat(node.label, \"-\").concat(edge.label, \"-\").concat(toNode.label);\n if (!root[nodeEdgeNodeLabel]) root[nodeEdgeNodeLabel] = {\n projected: [],\n nodeLabel1: node.label,\n edgeLabel: edge.label,\n nodeLabel2: toNode.label\n };\n var pdfs = {\n graphId: graphId,\n edge: edge,\n preNode: null\n };\n root[nodeEdgeNodeLabel].projected.push(pdfs);\n });\n });\n });\n // Line 313\n Object.keys(root).forEach(function (nodeEdgeNodeLabel) {\n var _a = root[nodeEdgeNodeLabel],\n projected = _a.projected,\n nodeLabel1 = _a.nodeLabel1,\n edgeLabel = _a.edgeLabel,\n nodeLabel2 = _a.nodeLabel2;\n _this.dfsCode.dfsEdgeList.push(new DFSedge(0, 1, nodeLabel1, edgeLabel, nodeLabel2));\n _this.subGraphMining(projected);\n _this.dfsCode.dfsEdgeList.pop();\n });\n };\n return GSpan;\n}();\nvar formatGraphs = function formatGraphs(graphs, directed, nodeLabelProp, edgeLabelProp) {\n var result = {};\n Object.keys(graphs).forEach(function (key, i) {\n var graph = graphs[key];\n var fGraph = new _struct.Graph(i, true, directed);\n var nodeIdxMap = {};\n graph.nodes.forEach(function (node, j) {\n fGraph.addNode(j, node[nodeLabelProp]);\n nodeIdxMap[node.id] = j;\n });\n graph.edges.forEach(function (edge, k) {\n var sourceIdx = nodeIdxMap[edge.source];\n var targetIdx = nodeIdxMap[edge.target];\n fGraph.addEdge(-1, sourceIdx, targetIdx, edge[edgeLabelProp]);\n });\n if (fGraph && fGraph.getNodeNum()) result[fGraph.id] = fGraph;\n });\n return result;\n};\nvar toGraphDatas = function toGraphDatas(graphs, nodeLabelProp, edgeLabelProp) {\n var result = [];\n graphs.forEach(function (graph) {\n var graphData = {\n nodes: [],\n edges: []\n };\n graph.nodes.forEach(function (node) {\n var _a;\n graphData.nodes.push((_a = {\n id: \"\".concat(node.id)\n }, _a[nodeLabelProp] = node.label, _a));\n });\n graph.edges.forEach(function (edge) {\n var _a;\n graphData.edges.push((_a = {\n source: \"\".concat(edge.from),\n target: \"\".concat(edge.to)\n }, _a[edgeLabelProp] = edge.label, _a));\n });\n result.push(graphData);\n });\n return result;\n};\nvar DEFAULT_LABEL_NAME = \"cluster\";\n/**\n * gSpan 频繁子图计算算法(frequent graph mining)\n * @param params 参数\n */\nvar gSpan = function gSpan(params) {\n // ------- 将图数据 GraphData 的 map 转换为格式 -------\n var graphs = params.graphs,\n _a = params.directed,\n directed = _a === void 0 ? false : _a,\n _b = params.nodeLabelProp,\n nodeLabelProp = _b === void 0 ? DEFAULT_LABEL_NAME : _b,\n _c = params.edgeLabelProp,\n edgeLabelProp = _c === void 0 ? DEFAULT_LABEL_NAME : _c;\n var formattedGraphs = formatGraphs(graphs, directed, nodeLabelProp, edgeLabelProp);\n var minSupport = params.minSupport,\n maxNodeNum = params.maxNodeNum,\n minNodeNum = params.minNodeNum,\n verbose = params.verbose,\n top = params.top;\n // ------- 初始化与执行算法 -------\n var algoParams = {\n graphs: formattedGraphs,\n minSupport: minSupport,\n maxNodeNum: maxNodeNum,\n minNodeNum: minNodeNum,\n top: top,\n verbose: verbose,\n directed: directed\n };\n var calculator = new GSpan(algoParams);\n calculator.run();\n var result = toGraphDatas(calculator.frequentSubgraphs, nodeLabelProp, edgeLabelProp);\n return result;\n};\nvar _default = gSpan;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/gSpan/gSpan.js?"); /***/ }), @@ -560,7 +560,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VACANT_NODE_LABEL = exports.VACANT_NODE_ID = exports.VACANT_GRAPH_ID = exports.VACANT_EDGE_LABEL = exports.VACANT_EDGE_ID = exports.Node = exports.Graph = exports.Edge = exports.AUTO_EDGE_ID = void 0;\nvar VACANT_EDGE_ID = -1;\nexports.VACANT_EDGE_ID = VACANT_EDGE_ID;\nvar VACANT_NODE_ID = -1;\nexports.VACANT_NODE_ID = VACANT_NODE_ID;\nvar VACANT_EDGE_LABEL = \"-1\";\nexports.VACANT_EDGE_LABEL = VACANT_EDGE_LABEL;\nvar VACANT_NODE_LABEL = \"-1\";\nexports.VACANT_NODE_LABEL = VACANT_NODE_LABEL;\nvar VACANT_GRAPH_ID = -1;\nexports.VACANT_GRAPH_ID = VACANT_GRAPH_ID;\nvar AUTO_EDGE_ID = \"-1\";\nexports.AUTO_EDGE_ID = AUTO_EDGE_ID;\n\nvar Edge =\n/** @class */\nfunction () {\n function Edge(id, from, to, label) {\n if (id === void 0) {\n id = VACANT_EDGE_ID;\n }\n\n if (from === void 0) {\n from = VACANT_NODE_ID;\n }\n\n if (to === void 0) {\n to = VACANT_NODE_ID;\n }\n\n if (label === void 0) {\n label = VACANT_EDGE_LABEL;\n }\n\n this.id = id;\n this.from = from;\n this.to = to;\n this.label = label;\n }\n\n return Edge;\n}();\n\nexports.Edge = Edge;\n\nvar Node =\n/** @class */\nfunction () {\n function Node(id, label) {\n if (id === void 0) {\n id = VACANT_NODE_ID;\n }\n\n if (label === void 0) {\n label = VACANT_NODE_LABEL;\n }\n\n this.id = id;\n this.label = label;\n this.edges = [];\n this.edgeMap = {};\n }\n\n Node.prototype.addEdge = function (edge) {\n this.edges.push(edge);\n this.edgeMap[edge.id] = edge;\n };\n\n return Node;\n}();\n\nexports.Node = Node;\n\nvar Graph =\n/** @class */\nfunction () {\n function Graph(id, edgeIdAutoIncrease, directed) {\n if (id === void 0) {\n id = VACANT_NODE_ID;\n }\n\n if (edgeIdAutoIncrease === void 0) {\n edgeIdAutoIncrease = true;\n }\n\n if (directed === void 0) {\n directed = false;\n }\n\n this.id = id;\n this.edgeIdAutoIncrease = edgeIdAutoIncrease;\n this.edges = [];\n this.nodes = [];\n this.nodeMap = {};\n this.edgeMap = {};\n this.nodeLabelMap = {};\n this.edgeLabelMap = {};\n this.counter = 0;\n this.directed = directed;\n }\n\n Graph.prototype.getNodeNum = function () {\n return this.nodes.length;\n };\n\n Graph.prototype.addNode = function (id, label) {\n if (this.nodeMap[id]) return;\n var node = new Node(id, label);\n this.nodes.push(node);\n this.nodeMap[id] = node;\n if (!this.nodeLabelMap[label]) this.nodeLabelMap[label] = [];\n this.nodeLabelMap[label].push(id);\n };\n\n Graph.prototype.addEdge = function (id, from, to, label) {\n if (this.edgeIdAutoIncrease || id === undefined) id = this.counter++;\n if (this.nodeMap[from] && this.nodeMap[to] && this.nodeMap[to].edgeMap[id]) return;\n var edge = new Edge(id, from, to, label);\n this.edges.push(edge);\n this.edgeMap[id] = edge;\n this.nodeMap[from].addEdge(edge);\n if (!this.edgeLabelMap[label]) this.edgeLabelMap[label] = [];\n this.edgeLabelMap[label].push(edge);\n\n if (!this.directed) {\n var rEdge = new Edge(id, to, from, label);\n this.nodeMap[to].addEdge(rEdge);\n this.edgeLabelMap[label].push(rEdge);\n }\n };\n\n return Graph;\n}();\n\nexports.Graph = Graph;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/gSpan/struct.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.VACANT_NODE_LABEL = exports.VACANT_NODE_ID = exports.VACANT_GRAPH_ID = exports.VACANT_EDGE_LABEL = exports.VACANT_EDGE_ID = exports.Node = exports.Graph = exports.Edge = exports.AUTO_EDGE_ID = void 0;\nvar VACANT_EDGE_ID = -1;\nexports.VACANT_EDGE_ID = VACANT_EDGE_ID;\nvar VACANT_NODE_ID = -1;\nexports.VACANT_NODE_ID = VACANT_NODE_ID;\nvar VACANT_EDGE_LABEL = \"-1\";\nexports.VACANT_EDGE_LABEL = VACANT_EDGE_LABEL;\nvar VACANT_NODE_LABEL = \"-1\";\nexports.VACANT_NODE_LABEL = VACANT_NODE_LABEL;\nvar VACANT_GRAPH_ID = -1;\nexports.VACANT_GRAPH_ID = VACANT_GRAPH_ID;\nvar AUTO_EDGE_ID = \"-1\";\nexports.AUTO_EDGE_ID = AUTO_EDGE_ID;\nvar Edge = /** @class */function () {\n function Edge(id, from, to, label) {\n if (id === void 0) {\n id = VACANT_EDGE_ID;\n }\n if (from === void 0) {\n from = VACANT_NODE_ID;\n }\n if (to === void 0) {\n to = VACANT_NODE_ID;\n }\n if (label === void 0) {\n label = VACANT_EDGE_LABEL;\n }\n this.id = id;\n this.from = from;\n this.to = to;\n this.label = label;\n }\n return Edge;\n}();\nexports.Edge = Edge;\nvar Node = /** @class */function () {\n function Node(id, label) {\n if (id === void 0) {\n id = VACANT_NODE_ID;\n }\n if (label === void 0) {\n label = VACANT_NODE_LABEL;\n }\n this.id = id;\n this.label = label;\n this.edges = [];\n this.edgeMap = {};\n }\n Node.prototype.addEdge = function (edge) {\n this.edges.push(edge);\n this.edgeMap[edge.id] = edge;\n };\n return Node;\n}();\nexports.Node = Node;\nvar Graph = /** @class */function () {\n function Graph(id, edgeIdAutoIncrease, directed) {\n if (id === void 0) {\n id = VACANT_NODE_ID;\n }\n if (edgeIdAutoIncrease === void 0) {\n edgeIdAutoIncrease = true;\n }\n if (directed === void 0) {\n directed = false;\n }\n this.id = id;\n this.edgeIdAutoIncrease = edgeIdAutoIncrease;\n this.edges = [];\n this.nodes = [];\n this.nodeMap = {};\n this.edgeMap = {};\n this.nodeLabelMap = {};\n this.edgeLabelMap = {};\n this.counter = 0;\n this.directed = directed;\n }\n Graph.prototype.getNodeNum = function () {\n return this.nodes.length;\n };\n Graph.prototype.addNode = function (id, label) {\n if (this.nodeMap[id]) return;\n var node = new Node(id, label);\n this.nodes.push(node);\n this.nodeMap[id] = node;\n if (!this.nodeLabelMap[label]) this.nodeLabelMap[label] = [];\n this.nodeLabelMap[label].push(id);\n };\n Graph.prototype.addEdge = function (id, from, to, label) {\n if (this.edgeIdAutoIncrease || id === undefined) id = this.counter++;\n if (this.nodeMap[from] && this.nodeMap[to] && this.nodeMap[to].edgeMap[id]) return;\n var edge = new Edge(id, from, to, label);\n this.edges.push(edge);\n this.edgeMap[id] = edge;\n this.nodeMap[from].addEdge(edge);\n if (!this.edgeLabelMap[label]) this.edgeLabelMap[label] = [];\n this.edgeLabelMap[label].push(edge);\n if (!this.directed) {\n var rEdge = new Edge(id, to, from, label);\n this.nodeMap[to].addEdge(rEdge);\n this.edgeLabelMap[label].push(rEdge);\n }\n };\n return Graph;\n}();\nexports.Graph = Graph;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/gSpan/struct.js?"); /***/ }), @@ -572,7 +572,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n\nvar _floydWarshall = _interopRequireDefault(__webpack_require__(/*! ./floydWarshall */ \"./node_modules/@antv/algorithm/lib/floydWarshall.js\"));\n\nvar _gSpan = _interopRequireDefault(__webpack_require__(/*! ./gSpan/gSpan */ \"./node_modules/@antv/algorithm/lib/gSpan/gSpan.js\"));\n\nvar _dijkstra = _interopRequireDefault(__webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/algorithm/lib/dijkstra.js\"));\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * 为 graphData 中每个节点生成邻居单元数组\n * @param graphData\n * @param spm\n * @param nodeLabelProp\n * @param k k-近邻\n */\nvar findKNeighborUnits = function findKNeighborUnits(graphData, spm, nodeLabelProp, k) {\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n\n if (k === void 0) {\n k = 2;\n }\n\n var units = [];\n var nodes = graphData.nodes;\n spm.forEach(function (row, i) {\n units.push(findKNeighborUnit(nodes, row, i, nodeLabelProp, k));\n });\n return units;\n};\n\nvar findKNeighborUnit = function findKNeighborUnit(nodes, row, i, nodeLabelProp, k) {\n var unitNodeIdxs = [i];\n var neighbors = [];\n var labelCountMap = {};\n row.forEach(function (v, j) {\n if (v <= k && i !== j) {\n unitNodeIdxs.push(j);\n neighbors.push(nodes[j]);\n var label = nodes[j][nodeLabelProp];\n if (!labelCountMap[label]) labelCountMap[label] = {\n count: 1,\n dists: [v]\n };else {\n labelCountMap[label].count++;\n labelCountMap[label].dists.push(v);\n }\n }\n }); // 将 labelCountMap 中的 dists 按照从小到大排序,方便后面使用\n\n Object.keys(labelCountMap).forEach(function (label) {\n labelCountMap[label].dists = labelCountMap[label].dists.sort(function (a, b) {\n return a - b;\n });\n });\n return {\n nodeIdx: i,\n nodeId: nodes[i].id,\n nodeIdxs: unitNodeIdxs,\n neighbors: neighbors,\n neighborNum: unitNodeIdxs.length - 1,\n nodeLabelCountMap: labelCountMap\n };\n};\n/**\n * 随机寻找点对,满足距离小于 k\n * @param k 参数 k,表示 k-近邻\n * @param nodeNum 参数 length\n * @param maxNodePairNum 寻找点对的数量不超过 maxNodePairNum\n * @param spm 最短路径矩阵\n */\n\n\nvar findNodePairsRandomly = function findNodePairsRandomly(k, nodeNum, maxNodePairNum, kNeighborUnits, spm) {\n // 每个节点需要随机找出的点对数\n var nodePairNumEachNode = Math.ceil(maxNodePairNum / nodeNum);\n var nodePairMap = {};\n var foundNodePairCount = 0; // 遍历节点,为每个节点随机找出 nodePairNumEachNode 个点对,满足距离小于 k。找到的点对数量超过 maxNodePairNum 或所有节点遍历结束时终止\n\n kNeighborUnits.forEach(function (unit, i) {\n // 若未达到 nodePairNumEachNode,或循环次数小于最大循环次数(2 * nodeNum),继续循环\n var nodePairForICount = 0;\n var outerLoopCount = 0;\n var neighbors = unit.nodeIdxs; // the first one is the center node\n\n var neighborNum = unit.neighborNum - 1;\n\n while (nodePairForICount < nodePairNumEachNode) {\n // 另一端节点在节点数组中的的 index\n var oidx = neighbors[1 + Math.floor(Math.random() * neighborNum)];\n var innerLoopCount = 0; // 若随机得到的另一端 idx 不符合条件,则继续 random。条件是不是同一个节点、这个点对没有被记录过、距离小于 k\n\n while (nodePairMap[\"\".concat(i, \"-\").concat(oidx)] || nodePairMap[\"\".concat(oidx, \"-\").concat(i)]) {\n oidx = Math.floor(Math.random() * nodeNum);\n innerLoopCount++;\n if (innerLoopCount > 2 * nodeNum) break; // 循环次数大于最大循环次数(2 * nodeNum)跳出循环,避免死循环\n }\n\n if (innerLoopCount < 2 * nodeNum) {\n // 未达到最大循环次数,说明找到了合适的另一端\n nodePairMap[\"\".concat(i, \"-\").concat(oidx)] = {\n start: i,\n end: oidx,\n distance: spm[i][oidx]\n };\n nodePairForICount++;\n foundNodePairCount++; // 如果当前找到的点对数量达到了上限,返回结果\n\n if (foundNodePairCount >= maxNodePairNum) return nodePairMap;\n }\n\n outerLoopCount++;\n if (outerLoopCount > 2 * nodeNum) break; // 循环次数大于最大循环次数(2 * nodeNum)跳出循环,避免死循环\n } // 这个节点没有找到足够 nodePairNumEachNode 的点对。更新 nodePairNumEachNode,让后续节点找更多的点对\n\n\n if (nodePairForICount < nodePairNumEachNode) {\n var gap = nodePairNumEachNode - nodePairForICount;\n nodePairNumEachNode = (nodePairNumEachNode + gap) / (nodeNum - i - 1);\n }\n });\n return nodePairMap;\n};\n/**\n * 计算所有 nodePairMap 中节点对的相交邻居诱导子图\n * @param nodePairMap 节点对 map,key 为 node1.id-node2.id,value 为 { startNodeIdx, endNodeIdx, distance }\n * @param neighborUnits 每个节点的邻居元数组\n * @param graphData 原图数据\n * @param edgeMap 边的 map,方便检索\n * @param cachedInducedGraphMap 缓存的结果,下次进入该函数将继续更新该缓存,若 key 在缓存中存在则不需要重复计算\n */\n\n\nvar getIntersectNeighborInducedGraph = function getIntersectNeighborInducedGraph(nodePairMap, neighborUnits, graphData, cachedInducedGraphMap) {\n var nodes = graphData.nodes;\n if (!cachedInducedGraphMap) cachedInducedGraphMap = {};\n Object.keys(nodePairMap).forEach(function (key) {\n var _a, _b;\n\n if (cachedInducedGraphMap && cachedInducedGraphMap[key]) return;\n cachedInducedGraphMap[key] = {\n nodes: [],\n edges: []\n };\n var pair = nodePairMap[key];\n var startUnitNodeIds = (_a = neighborUnits[pair.start]) === null || _a === void 0 ? void 0 : _a.nodeIdxs;\n var endUnitNodeIds = (_b = neighborUnits[pair.end]) === null || _b === void 0 ? void 0 : _b.nodeIdxs;\n if (!startUnitNodeIds || !endUnitNodeIds) return; // 不存在邻元,返回空图\n\n var endSet = new Set(endUnitNodeIds);\n var intersect = startUnitNodeIds.filter(function (x) {\n return endSet.has(x);\n }); // 可能会爆栈(在 1580 + 6 nodes full-connected 时出现)\n\n if (!intersect || !intersect.length) return; // 没有交集,返回空图\n\n var intersectIdMap = {};\n var intersectLength = intersect.length;\n\n for (var i = 0; i < intersectLength; i++) {\n var node = nodes[intersect[i]];\n cachedInducedGraphMap[key].nodes.push(node); // 将交集中的点加入诱导子图\n\n intersectIdMap[node.id] = true;\n } // 遍历所有边数据,如果边的两端都在交集中,将该边加入诱导子图\n\n\n graphData.edges.forEach(function (edge) {\n if (intersectIdMap[edge.source] && intersectIdMap[edge.target]) cachedInducedGraphMap[key].edges.push(edge);\n });\n });\n return cachedInducedGraphMap;\n};\n/**\n * 计算 strcutre 在 graph 上的匹配数量\n * @param graph 图数据\n * @param structure 目前支持只有两个节点一条边的最简单结构\n * @param nodeLabelProp 节点类型字段名\n * @param edgeLabelProp 边类型字段名\n */\n\n\nvar getMatchedCount = function getMatchedCount(graph, structure, nodeLabelProp, edgeLabelProp) {\n var _a, _b;\n\n var nodeMap = {};\n graph.nodes.forEach(function (node) {\n nodeMap[node.id] = node;\n });\n var count = 0;\n if (!((_a = structure === null || structure === void 0 ? void 0 : structure.edges) === null || _a === void 0 ? void 0 : _a.length) || ((_b = structure === null || structure === void 0 ? void 0 : structure.nodes) === null || _b === void 0 ? void 0 : _b.length) < 2) return 0;\n graph.edges.forEach(function (e) {\n var sourceLabel = nodeMap[e.source][nodeLabelProp];\n var targetLabel = nodeMap[e.target][nodeLabelProp];\n var strNodeLabel1 = structure === null || structure === void 0 ? void 0 : structure.nodes[0][nodeLabelProp];\n var strNodeLabel2 = structure === null || structure === void 0 ? void 0 : structure.nodes[1][nodeLabelProp];\n var strEdgeLabel = structure === null || structure === void 0 ? void 0 : structure.edges[0][edgeLabelProp];\n if (e[edgeLabelProp] !== strEdgeLabel) return;\n\n if (sourceLabel === strNodeLabel1 && targetLabel === strNodeLabel2 || sourceLabel === strNodeLabel2 && targetLabel === strNodeLabel1) {\n count++;\n }\n });\n return count;\n};\n/**\n * structures 中寻找最具有代表性的一个。这个结构是使得 matchedCountMap 的分组方式类内间距最小,类间间距最大\n * @param matchedCountMap 每个 structure 分类后的各图匹配数量,格式 { [strcture.idx]: { [interInducedGraphKey]: count } }\n * @param structureNum strcuture 个数,与 matchedCountMap.length 对应\n * @param structures\n */\n\n\nvar findRepresentStructure = function findRepresentStructure(matchedCountMap, structureNum, structures) {\n var maxOffset = Infinity,\n representClusterType = 0;\n\n var _loop_1 = function _loop_1(i) {\n // 一种分组的 map,key 是 intGraph 的 key,value 是 structures[i] 的匹配个数\n var countMapI = matchedCountMap[i]; // 按照 value 为该组排序,生成 keys 的数组:\n\n var sortedGraphKeys = Object.keys(countMapI).sort(function (a, b) {\n return countMapI[a] - countMapI[b];\n }); // 共 100 个 graphKeys,将 graphKeys 按顺序分为 groupNum 组\n\n var groupNum = 10;\n var clusters = []; // 总共有 groupNum 个项\n\n sortedGraphKeys.forEach(function (key, j) {\n if (!clusters[j % groupNum]) clusters[j % groupNum] = {\n graphs: [],\n totalCount: 0,\n aveCount: 0\n };\n clusters[j % groupNum].graphs.push(key);\n clusters[j % groupNum].totalCount += countMapI[key];\n }); // 计算 cluster 与 cluster 之间的距离 innerDist,每个 cluster 内部的距离 intraDist\n\n var aveIntraDist = 0; // 该类的类内平均值\n\n var aveCounts = []; // 类内平均匹配数量,将用于计算类间距离\n\n clusters.forEach(function (graphsInCluster) {\n // 类内均值\n var aveCount = graphsInCluster.totalCount / graphsInCluster.graphs.length;\n graphsInCluster.aveCount = aveCount;\n aveCounts.push(aveCount); // 对于每类,计算类内间距平均值\n\n var aveIntraPerCluster = 0;\n var graphsNum = graphsInCluster.length;\n graphsInCluster.graphs.forEach(function (graphKey1, j) {\n var graph1Count = countMapI[graphKey1];\n graphsInCluster.graphs.forEach(function (graphKey2, k) {\n if (j === k) return;\n aveIntraPerCluster += Math.abs(graph1Count - countMapI[graphKey2]);\n });\n });\n aveIntraPerCluster /= graphsNum * (graphsNum - 1) / 2;\n aveIntraDist += aveIntraPerCluster;\n });\n aveIntraDist /= clusters.length; // 用类内均值计算类间距\n\n var aveInterDist = 0; // 类间间距平均值\n\n aveCounts.forEach(function (aveCount1, j) {\n aveCounts.forEach(function (aveCount2, k) {\n if (j === k) return;\n aveInterDist += Math.abs(aveCount1 - aveCount2);\n });\n aveInterDist /= aveCounts.length * (aveCounts.length - 1) / 2;\n }); // 寻找 (类间间距均值-类内间距均值) 最大的一种分组方式(对应的 structure 就是最终要找的唯一 DS(G))\n\n var offset = aveInterDist - aveIntraDist;\n\n if (maxOffset < offset) {\n maxOffset = offset;\n representClusterType = i;\n }\n };\n\n for (var i = 0; i < structureNum; i++) {\n _loop_1(i);\n }\n\n return {\n structure: structures[representClusterType],\n structureCountMap: matchedCountMap[representClusterType]\n };\n};\n\nvar getNodeMaps = function getNodeMaps(nodes, nodeLabelProp) {\n var nodeMap = {},\n nodeLabelMap = {};\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = {\n idx: i,\n node: node,\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n var label = node[nodeLabelProp];\n if (!nodeLabelMap[label]) nodeLabelMap[label] = [];\n nodeLabelMap[label].push(node);\n });\n return {\n nodeMap: nodeMap,\n nodeLabelMap: nodeLabelMap\n };\n};\n\nvar getEdgeMaps = function getEdgeMaps(edges, edgeLabelProp, nodeMap) {\n var edgeMap = {},\n edgeLabelMap = {};\n edges.forEach(function (edge, i) {\n edgeMap[\"\".concat(_util.uniqueId)] = {\n idx: i,\n edge: edge\n };\n var label = edge[edgeLabelProp];\n if (!edgeLabelMap[label]) edgeLabelMap[label] = [];\n edgeLabelMap[label].push(edge);\n var sourceNode = nodeMap[edge.source];\n\n if (sourceNode) {\n sourceNode.degree++;\n sourceNode.outDegree++;\n }\n\n var targetNode = nodeMap[edge.target];\n\n if (targetNode) {\n targetNode.degree++;\n targetNode.inDegree++;\n }\n });\n return {\n edgeMap: edgeMap,\n edgeLabelMap: edgeLabelMap\n };\n};\n/**\n * 输出最短路径的 map,key 为 sourceNode.id-targetNode.id,value 为这两个节点的最短路径长度\n * @param nodes\n * @param spm\n * @param directed\n */\n\n\nvar getSpmMap = function getSpmMap(nodes, spm, directed) {\n var length = spm.length;\n var map = {};\n spm.forEach(function (row, i) {\n var start = directed ? 0 : i + 1;\n var iId = nodes[i].id;\n\n for (var j = start; j < length; j++) {\n if (i === j) continue;\n var jId = nodes[j].id;\n var dist = row[j];\n map[\"\".concat(iId, \"-\").concat(jId)] = dist;\n if (!directed) map[\"\".concat(jId, \"-\").concat(iId)] = dist;\n }\n });\n return map;\n};\n/**\n * 计算一对节点(node1,node2)的 NDS 距离\n * @param graph 原图数据\n * @param node1\n * @param node2\n */\n\n\nvar getNDSDist = function getNDSDist(graph, node1, node2, nodeMap, spDist, kNeighborUnits, structure, nodeLabelProp, edgeLabelProp, cachedNDSMap, cachedInterInducedGraph) {\n var _a;\n\n var key = \"\".concat(node1.id, \"-\").concat(node2.id);\n if (cachedNDSMap && cachedNDSMap[key]) return cachedNDSMap[key];\n var interInducedGraph = cachedInterInducedGraph ? cachedInterInducedGraph[key] : undefined; // 若没有缓存相交邻居诱导子图,计算\n\n if (!interInducedGraph) {\n var pairMap = (_a = {}, _a[key] = {\n start: nodeMap[node1.id].idx,\n end: nodeMap[node2.id].idx,\n distance: spDist\n }, _a);\n cachedInterInducedGraph = getIntersectNeighborInducedGraph(pairMap, kNeighborUnits, graph, cachedInterInducedGraph);\n interInducedGraph = cachedInterInducedGraph[key];\n }\n\n return getMatchedCount(interInducedGraph, structure, nodeLabelProp, edgeLabelProp);\n};\n/**\n * 计算 pattern 上绩点的度数并存储到 minPatternNodeLabelDegreeMap\n */\n\n\nvar stashPatternNodeLabelDegreeMap = function stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, neighborLabel, patternNodeMap, patternNodeLabelMap) {\n var _a, _b, _c;\n\n var minPatternNodeLabelDegree = (_a = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _a === void 0 ? void 0 : _a.degree;\n var minPatternNodeLabelInDegree = (_b = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _b === void 0 ? void 0 : _b.inDegree;\n var minPatternNodeLabelOutDegree = (_c = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _c === void 0 ? void 0 : _c.outDegree;\n\n if (minPatternNodeLabelDegreeMap[neighborLabel] === undefined) {\n minPatternNodeLabelDegree = Infinity;\n minPatternNodeLabelInDegree = Infinity;\n minPatternNodeLabelOutDegree = Infinity;\n patternNodeLabelMap[neighborLabel].forEach(function (patternNodeWithLabel) {\n var patternNodeDegree = patternNodeMap[patternNodeWithLabel.id].degree;\n if (minPatternNodeLabelDegree > patternNodeDegree) minPatternNodeLabelDegree = patternNodeDegree;\n var patternNodeInDegree = patternNodeMap[patternNodeWithLabel.id].inDegree;\n if (minPatternNodeLabelInDegree > patternNodeInDegree) minPatternNodeLabelInDegree = patternNodeInDegree;\n var patternNodeOutDegree = patternNodeMap[patternNodeWithLabel.id].outDegree;\n if (minPatternNodeLabelOutDegree > patternNodeOutDegree) minPatternNodeLabelOutDegree = patternNodeOutDegree;\n });\n minPatternNodeLabelDegreeMap[neighborLabel] = {\n degree: minPatternNodeLabelDegree,\n inDegree: minPatternNodeLabelInDegree,\n outDegree: minPatternNodeLabelOutDegree\n };\n }\n\n return {\n minPatternNodeLabelDegree: minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree: minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree: minPatternNodeLabelOutDegree\n };\n};\n/**\n * GADDI 模式匹配\n * @param graphData 原图数据\n * @param pattern 搜索图(需要在原图上搜索的模式)数据\n * @param directed 是否计算有向图,默认 false\n * @param k 参数 k,表示 k-近邻\n * @param length 参数 length\n * @param nodeLabelProp 节点数据中代表节点标签(分类信息)的属性名。默认为 cluster\n * @param edgeLabelProp 边数据中代表边标签(分类信息)的属性名。默认为 cluster\n */\n\n\nvar GADDI = function GADDI(graphData, pattern, directed, k, length, nodeLabelProp, edgeLabelProp) {\n var _a;\n\n if (directed === void 0) {\n directed = false;\n }\n\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n\n if (edgeLabelProp === void 0) {\n edgeLabelProp = 'cluster';\n }\n\n if (!graphData || !graphData.nodes) return; // 分为三步:\n // 0. 预计算:节点/边数,邻接矩阵、最短路径矩阵\n // 1. 处理原图 graphData。再分为 1~5 小步\n // 2. 匹配\n // console.log(\"----- stage-pre: preprocessing -------\");\n // -------- 第零步,预计算:节点/边数,邻接矩阵、最短路径矩阵-------\n\n var nodeNum = graphData.nodes.length;\n if (!nodeNum) return; // console.log(\"----- stage-pre.1: calc shortest path matrix for graph -------\");\n\n var spm = (0, _floydWarshall.default)(graphData, directed); // console.log(\n // \"----- stage-pre.2: calc shortest path matrix for pattern -------\"\n // );\n\n var patternSpm = (0, _floydWarshall.default)(pattern, directed); // console.log(\n // \"----- stage-pre.3: calc shortest path matrix map for graph -------\"\n // );\n\n var spmMap = getSpmMap(graphData.nodes, spm, directed); // console.log(\n // \"----- stage-pre.4: calc shortest path matrix map for pattern -------\"\n // );\n\n var patternSpmMap = getSpmMap(pattern.nodes, patternSpm, directed); // console.log(\"----- stage-pre.5: establish maps -------\");\n // 节点的 map,以 id 为 id 映射,方便后续快速检索\n\n var _b = getNodeMaps(graphData.nodes, nodeLabelProp),\n nodeMap = _b.nodeMap,\n nodeLabelMap = _b.nodeLabelMap;\n\n var _c = getNodeMaps(pattern.nodes, nodeLabelProp),\n patternNodeMap = _c.nodeMap,\n patternNodeLabelMap = _c.nodeLabelMap; // 计算节点度数\n\n\n getEdgeMaps(graphData.edges, edgeLabelProp, nodeMap);\n var patternEdgeLabelMap = getEdgeMaps(pattern.edges, edgeLabelProp, patternNodeMap).edgeLabelMap; // 若未指定 length,自动计算 pattern 半径(最短路径最大值)\n\n var patternSpmSpread = [];\n patternSpm === null || patternSpm === void 0 ? void 0 : patternSpm.forEach(function (row) {\n patternSpmSpread = patternSpmSpread.concat(row);\n });\n if (!length) length = Math.max.apply(Math, (0, _tslib.__spreadArray)((0, _tslib.__spreadArray)([], patternSpmSpread, false), [2], false));\n if (!k) k = length; // console.log(\"params\", directed, length, k);\n // console.log(\"----- stage-pre.6: calc k neighbor units -------\");\n // 计算每个节点的 k 邻元集合\n\n var kNeighborUnits = findKNeighborUnits(graphData, spm, nodeLabelProp, k);\n var patternKNeighborUnits = findKNeighborUnits(pattern, patternSpm, nodeLabelProp, k); // console.log(\n // \"----- stage0: going to processing graph and find intersect neighbor induced graphs -------\"\n // );\n // console.log(\"----- stage0.1: going to select random node pairs -------\");\n // -------- 第一步,处理原图 graphData-------\n // 1.1. 随机选择最多 100 个点对,满足距离小于 Length 和 k\n // 当 graphData 少于 20 个节点,则不能找出 100 个点对,只找出不多于 n(n-1)/2 个点对\n\n var maxNodePairNum = Math.min(100, nodeNum * (nodeNum - 1) / 2);\n var nodePairsMap = findNodePairsRandomly(k, nodeNum, maxNodePairNum, kNeighborUnits, spm); // console.log(\n // \"----- stage0.2: going to calculate intersect neighbor induced graphs -------\"\n // );\n // 1.2. 生成上面节点对的相应相交邻居诱导子图。格式为 {'beginNodeIdx-endNodeIdx': {nodes: [], edges: []}}\n\n var intGMap = getIntersectNeighborInducedGraph(nodePairsMap, kNeighborUnits, graphData); // 1.3. 使用 gSpan 算法(frequent graph mining)计算 ISIntG 的前 10 个频率最高的子结构(3-4条边)\n\n var top = 10,\n minSupport = 1,\n minNodeNum = 1,\n maxNodeNum = 4;\n var params = {\n graphs: intGMap,\n nodeLabelProp: nodeLabelProp,\n edgeLabelProp: edgeLabelProp,\n minSupport: minSupport,\n minNodeNum: minNodeNum,\n maxNodeNum: maxNodeNum,\n directed: directed\n }; // console.log(\n // \"----- stage1: (gSpan) going to find frequent structure dsG -------\"\n // );\n // console.log(\"----- stage1.1: going to run gSpan -------\");\n // 暂时假设生成的 sub structure 都只有一条边\n\n var freStructures = (0, _gSpan.default)(params).slice(0, top); // structureNum 可能小于 top\n\n var structureNum = freStructures.length; // 1.4. 计算上述 10 个子结构在 intGMap 中每个诱导子图的匹配个数\n\n var matchedCountMap = [];\n freStructures.forEach(function (structure, i) {\n matchedCountMap[i] = {};\n Object.keys(intGMap).forEach(function (key) {\n var graph = intGMap[key];\n var subStructureCount = getMatchedCount(graph, structure, nodeLabelProp, edgeLabelProp);\n matchedCountMap[i][key] = subStructureCount;\n });\n }); // console.log(\n // \"----- stage1.1: going to find the most represent strucutre -------\"\n // );\n // 1.5. 对于每个子结构,根据匹配个数为 intGMap 中的诱导子图分组,生成 structureNum 种分组\n // 计算每种分组的类间距和类内间距,找到类间距最大、类内间距最小的一种分组,这种分组对应的子结构被选为唯一代表性子结构 DS(G)\n\n var _d = findRepresentStructure(matchedCountMap, structureNum, freStructures),\n dsG = _d.structure,\n ndsDist = _d.structureCountMap; // -------- 第二步,匹配-------\n // 2.1 找到从 Q 中的一个节点作为起始节点,寻找 G 中的匹配。这个其实节点的标签可以在 G 中找到最多的节点\n\n\n var beginPNode = pattern.nodes[0],\n candidates = [],\n label = (_a = pattern.nodes[0]) === null || _a === void 0 ? void 0 : _a[nodeLabelProp],\n maxNodeNumWithSameLabel = -Infinity;\n pattern.nodes.forEach(function (node) {\n var pLabel = node[nodeLabelProp];\n var nodesWithSameLabel = nodeLabelMap[pLabel];\n\n if ((nodesWithSameLabel === null || nodesWithSameLabel === void 0 ? void 0 : nodesWithSameLabel.length) > maxNodeNumWithSameLabel) {\n maxNodeNumWithSameLabel = nodesWithSameLabel.length;\n candidates = nodesWithSameLabel;\n label = pLabel;\n beginPNode = node;\n }\n }); // console.log(\"----- stage2: going to find candidates -------\");\n // 全局缓存,避免重复计算\n\n var minPatternNodeLabelDegreeMap = {}; // key 是 label,value 是该 label 节点的最小度数\n\n var patternIntGraphMap = {},\n patternNDSDist = {},\n // key 为 node.id-node.id\n patternNDSDistMap = {}; // key 为 node.id-label2,value nds距离值数组(按从大到小排序,无需关心具体对应哪个 node2)\n // 2.2.2 对于 Q 中的另一个标签的 k 个节点,计算它们到 node 的最短路径以及 NDS 距离\n\n var patternSpDist = {};\n var patternSpDistBack = {};\n Object.keys(patternNodeLabelMap).forEach(function (label2, j) {\n patternSpDist[label2] = [];\n\n if (directed) {\n patternSpDistBack[label2] = [];\n }\n\n var maxDist = -Infinity;\n var patternNodesWithLabel2 = patternNodeLabelMap[label2];\n var patternNodePairMap = {};\n patternNodesWithLabel2.forEach(function (nodeWithLabel2) {\n var dist = patternSpmMap[\"\".concat(beginPNode.id, \"-\").concat(nodeWithLabel2.id)];\n dist && patternSpDist[label2].push(dist);\n if (maxDist < dist) maxDist = dist;\n patternNodePairMap[\"\".concat(beginPNode.id, \"-\").concat(nodeWithLabel2.id)] = {\n start: 0,\n end: patternNodeMap[nodeWithLabel2.id].idx,\n distance: dist\n };\n\n if (directed) {\n var distBack = patternSpmMap[\"\".concat(nodeWithLabel2.id, \"-\").concat(beginPNode.id)];\n distBack && patternSpDistBack[label2].push(distBack);\n }\n }); // spDist[label2] 按照从小到大排序\n\n patternSpDist[label2] = patternSpDist[label2].sort(function (a, b) {\n return a - b;\n });\n if (directed) patternSpDistBack[label2] = patternSpDistBack[label2].sort(function (a, b) {\n return a - b;\n }); // 计算 Q 中所有 label2 节点到 beginPNode 的 NDS 距离\n // 所有 label2 节点到 beginPNode 的邻居相交诱导子图:\n // key: node1.id-node2.id\n\n patternIntGraphMap = getIntersectNeighborInducedGraph(patternNodePairMap, patternKNeighborUnits, pattern, patternIntGraphMap); // pattern 中 beginNode 到当前 label2 节点 的 NDS 距离(数组,无需关心具体对应到哪个节点)\n\n var currentPatternNDSDistArray = [];\n Object.keys(patternNodePairMap).forEach(function (key) {\n if (patternNDSDist[key]) {\n currentPatternNDSDistArray.push(patternNDSDist[key]);\n return; // 缓存过则不需要再次计算\n }\n\n var patternIntGraph = patternIntGraphMap[key];\n patternNDSDist[key] = getMatchedCount(patternIntGraph, dsG, nodeLabelProp, edgeLabelProp);\n currentPatternNDSDistArray.push(patternNDSDist[key]);\n }); // 根据值为 currentPatternNDSDist 从大到小排序\n\n currentPatternNDSDistArray = currentPatternNDSDistArray.sort(function (a, b) {\n return b - a;\n });\n patternNDSDistMap[\"\".concat(beginPNode.id, \"-\").concat(label2)] = currentPatternNDSDistArray;\n if (label2 === label) return;\n var candidatesNum = (candidates === null || candidates === void 0 ? void 0 : candidates.length) || 0;\n\n var _loop_4 = function _loop_4(m) {\n var cNode = candidates[m]; // prune1:若 candidates 中节点 cNode 的 kNeighborUnits 中标签为 label2 的节点个数少于 pattern 中 label2 个数,删去它\n\n var graphNeighborUnit = kNeighborUnits[nodeMap[cNode.id].idx];\n var graphNeighborUnitCountMap = graphNeighborUnit.nodeLabelCountMap[label2];\n var patternLabel2Num = patternNodeLabelMap[label2].length;\n\n if (!graphNeighborUnitCountMap || graphNeighborUnitCountMap.count < patternLabel2Num) {\n candidates.splice(m, 1);\n return \"continue\";\n } // prune2:若 candidates 中节点 cNode 到 kNeighborUnits 中标签为 label2 的节点最短路径大于 patternSpDist[label2],删去它\n // (prune2 规则即:candidate 相关的最短路径的最大 spDist[label2].length 个,按照大小顺序依次和 patternSpDist[label2] 中的值比较,只要遇到一个是 G > Q 的,就删去这个 candidate)\n\n\n var prune2Invalid = false;\n\n for (var n = 0; n < patternLabel2Num; n++) {\n if (graphNeighborUnitCountMap.dists[n] > patternSpDist[label2][n]) {\n prune2Invalid = true;\n break;\n }\n }\n\n if (prune2Invalid) {\n candidates.splice(m, 1);\n return \"continue\";\n } // prune3:若 candidates 中节点 cNode 到 kNeighborUnits 中标签为 label2 的节点 NDS 距离小于 patternNDSDist[beginNode.id-label2],删去它\n // TODO:prune3,currentPatternNDSDistArray 与 currentNDSDist 的比较\n // 计算 G 中所有 label2 节点到 cNode 的 NDS 距离\n // 所有 label2 节点到 cNode 的邻居相交诱导子图:\n\n\n var cNodePairMap = {};\n graphNeighborUnit.neighbors.forEach(function (neighborNode) {\n var dist = spmMap[\"\".concat(cNode.id, \"-\").concat(neighborNode.id)];\n cNodePairMap[\"\".concat(cNode.id, \"-\").concat(neighborNode.id)] = {\n start: nodeMap[cNode.id].idx,\n end: nodeMap[neighborNode.id].idx,\n distance: dist\n };\n }); // 更新 intGMap\n\n intGMap = getIntersectNeighborInducedGraph(cNodePairMap, kNeighborUnits, graphData, intGMap); // candidate 到它周围 label2 节点的 NDS 距离, key 是 node.id-node.id\n\n var currentNDSDistArray = [];\n Object.keys(cNodePairMap).forEach(function (key) {\n if (ndsDist[key]) {\n currentNDSDistArray.push(ndsDist[key]);\n return; // 缓存过则不需要再次计算\n }\n\n var intGraph = intGMap[key];\n ndsDist[key] = getMatchedCount(intGraph, dsG, nodeLabelProp, edgeLabelProp);\n currentNDSDistArray.push(ndsDist[key]);\n }); // 根据值为 currentNDSDistArray 从大到小排序\n\n currentNDSDistArray = currentNDSDistArray.sort(function (a, b) {\n return b - a;\n });\n var prune3Invalid = false;\n\n for (var n = 0; n < patternLabel2Num; n++) {\n if (currentNDSDistArray[n] < currentPatternNDSDistArray[n]) {\n prune3Invalid = true;\n break;\n }\n }\n\n if (prune3Invalid) {\n candidates.splice(m, 1);\n return \"continue\";\n }\n };\n\n for (var m = candidatesNum - 1; m >= 0; m--) {\n _loop_4(m);\n }\n });\n var candidateGraphs = []; // console.log(\n // \"----- stage3: going to splice neighbors for each candidate graph -------\"\n // );\n // candidates 经过筛选后,以每个 candidate 为中心,生成 Length-neighbor 的邻居诱导子图\n // 并在诱导子图中去除不可能在 Q 上找到匹配的点:在 Q 上不存在的 label,其他 label 到 candidate 的最大最短距离符合 Q、NDS 距离符合 Q\n\n candidates === null || candidates === void 0 ? void 0 : candidates.forEach(function (candidate) {\n var nodeIdx = nodeMap[candidate.id].idx;\n var lengthNeighborUnit = findKNeighborUnit(graphData.nodes, spm[nodeIdx], nodeIdx, nodeLabelProp, length);\n var neighborNodes = lengthNeighborUnit.neighbors; // 删除不可能找到匹配的邻居点\n\n var neighborNum = neighborNodes.length;\n var unmatched = false;\n\n for (var i = neighborNum - 1; i >= 0; i--) {\n // 如果通过裁剪,符合条件的节点数量已过少,说明不能匹配这个 candidate 相关的图\n if (neighborNodes.length + 1 < pattern.nodes.length) {\n unmatched = true;\n return;\n }\n\n var neighborNode = neighborNodes[i];\n var neighborLabel = neighborNode[nodeLabelProp]; // prune1: 若该邻居点的 label 不存在于 pattern 中,移除这个点\n\n if (!patternNodeLabelMap[neighborLabel] || !patternNodeLabelMap[neighborLabel].length) {\n neighborNodes.splice(i, 1);\n continue;\n } // prune2: 若该邻居点到 candidate 的最短路径比和它有相同 label 的节点到 beginPNode 的最大最短路径长度长,移除这个点\n // prune2.1: 如果没有这个标签到 beginPNode 的距离记录,说明 pattern 上(可能 beginPNode 是这个 label)没有其他这个 label 的节点\n\n\n if (!patternSpDist[neighborLabel] || !patternSpDist[neighborLabel].length) {\n neighborNodes.splice(i, 1);\n continue;\n }\n\n var key = \"\".concat(candidate.id, \"-\").concat(neighborNode.id); // prune2.2\n\n var distToCandidate = spmMap[key];\n var idx = patternSpDist[neighborLabel].length - 1;\n var maxDistWithLabelInPattern = patternSpDist[neighborLabel][idx]; // patternSpDist[neighborLabel] 已经按照从小到大排序\n\n if (distToCandidate > maxDistWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n\n if (directed) {\n var keyBack = \"\".concat(neighborNode.id, \"-\").concat(candidate.id);\n var distFromCandidate = spmMap[keyBack];\n idx = patternSpDistBack[neighborLabel].length - 1;\n var maxBackDistWithLabelInPattern = patternSpDistBack[neighborLabel][idx];\n\n if (distFromCandidate > maxBackDistWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n } // prune3: 若该邻居点到 candidate 的 NDS 距离比和它有相同 label 的节点到 beginPNode 的最小 NDS 距离小,移除这个点\n\n\n var ndsToCandidate = ndsDist[key] ? ndsDist[key] : getNDSDist(graphData, candidate, neighborNode, nodeMap, distToCandidate, kNeighborUnits, dsG, nodeLabelProp, edgeLabelProp, ndsDist, intGMap);\n var patternKey = \"\".concat(beginPNode.id, \"-\").concat(neighborLabel);\n var minNdsWithLabelInPattern = patternNDSDistMap[patternKey][patternNDSDistMap[patternKey].length - 1]; // patternNDSDist[key] 一定存在\n\n if (ndsToCandidate < minNdsWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n } // prune4: 若该邻居点的度数小于 pattern 同 label 节点最小度数,删去该点\n\n\n var _a = stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, neighborLabel, patternNodeMap, patternNodeLabelMap),\n minPatternNodeLabelDegree = _a.minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree = _a.minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree = _a.minPatternNodeLabelOutDegree;\n\n if (nodeMap[neighborNode.id].degree < minPatternNodeLabelDegree) {\n neighborNodes.splice(i, 1);\n continue;\n }\n } // 节点在个数上符合匹配(不少于 pattern 的节点个数),现在筛选相关边\n\n\n if (!unmatched) {\n candidateGraphs.push({\n nodes: [candidate].concat(neighborNodes)\n });\n }\n }); // console.log(\n // \"----- stage4: going to splice edges and neighbors for each candidate graph -------\"\n // );\n\n var undirectedLengthsToBeginPNode = (0, _dijkstra.default)(pattern, beginPNode.id, false).length;\n var undirectedLengthsToBeginPNodeLabelMap = {};\n\n if (directed) {\n Object.keys(undirectedLengthsToBeginPNode).forEach(function (nodeId) {\n var nodeLabel = patternNodeMap[nodeId].node[nodeLabelProp];\n if (!undirectedLengthsToBeginPNodeLabelMap[nodeLabel]) undirectedLengthsToBeginPNodeLabelMap[nodeLabel] = [undirectedLengthsToBeginPNode[nodeId]];else undirectedLengthsToBeginPNodeLabelMap[nodeLabel].push(undirectedLengthsToBeginPNode[nodeId]);\n });\n Object.keys(undirectedLengthsToBeginPNodeLabelMap).forEach(function (pLabel) {\n undirectedLengthsToBeginPNodeLabelMap[pLabel].sort(function (a, b) {\n return a - b;\n });\n });\n } else {\n undirectedLengthsToBeginPNodeLabelMap = patternSpDist;\n } // 现在 candidateGraphs 里面只有节点,进行边的筛选\n\n\n var candidateGraphNum = candidateGraphs.length;\n\n var _loop_2 = function _loop_2(i) {\n var candidateGraph = candidateGraphs[i];\n var candidate = candidateGraph.nodes[0];\n var candidateNodeLabelCountMap = {};\n var candidateNodeMap = {};\n candidateGraph.nodes.forEach(function (node, q) {\n candidateNodeMap[node.id] = {\n idx: q,\n node: node,\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n var cNodeLabel = node[nodeLabelProp];\n if (!candidateNodeLabelCountMap[cNodeLabel]) candidateNodeLabelCountMap[cNodeLabel] = 1;else candidateNodeLabelCountMap[cNodeLabel]++;\n }); // 根据 candidate 和 neighborNodes 中的节点生成 G 的诱导子图\n // 即,将 graphData 上两端都在 candidateGraph.nodes 中的边放入 candidateEdges\n\n var candidateEdges = [];\n var edgeLabelCountMap = {};\n graphData.edges.forEach(function (edge) {\n if (candidateNodeMap[edge.source] && candidateNodeMap[edge.target]) {\n candidateEdges.push(edge);\n if (!edgeLabelCountMap[edge[edgeLabelProp]]) edgeLabelCountMap[edge[edgeLabelProp]] = 1;else edgeLabelCountMap[edge[edgeLabelProp]]++;\n candidateNodeMap[edge.source].degree++;\n candidateNodeMap[edge.target].degree++;\n candidateNodeMap[edge.source].outDegree++;\n candidateNodeMap[edge.target].inDegree++;\n }\n }); // prune:若有一个 edgeLabel 在 candidateGraph 上的个数少于 pattern,去除该图\n\n var pattenrEdgeLabelNum = Object.keys(patternEdgeLabelMap).length;\n var prunedByEdgeLabel = false;\n\n for (var e = 0; e < pattenrEdgeLabelNum; e++) {\n var label_1 = Object.keys(patternEdgeLabelMap)[e];\n\n if (!edgeLabelCountMap[label_1] || edgeLabelCountMap[label_1] < patternEdgeLabelMap[label_1].length) {\n prunedByEdgeLabel = true;\n break;\n }\n }\n\n if (prunedByEdgeLabel) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n } // 遍历 candidateEdges,进行边的筛选\n\n\n var candidateEdgeNum = candidateEdges.length; // prune:若边数过少,去除该图\n\n if (candidateEdgeNum < pattern.edges.length) {\n candidateGraphs.splice(i, 1);\n return \"break\";\n }\n\n var candidateGraphInvalid = false;\n\n var _loop_5 = function _loop_5(e) {\n var edge = candidateEdges[e];\n var edgeLabel = edge[edgeLabelProp];\n var patternEdgesWithLabel = patternEdgeLabelMap[edgeLabel]; // prune 1: 若边的 label 不存在于 pattern 边 label 中,去除该边\n\n if (!patternEdgesWithLabel || !patternEdgesWithLabel.length) {\n edgeLabelCountMap[edgeLabel]--; // 若这个 label 的 count 减少之后,该 label 的边数不足,去除该图\n\n if (patternEdgesWithLabel && edgeLabelCountMap[edgeLabel] < patternEdgesWithLabel.length) {\n candidateGraphInvalid = true;\n return \"break\";\n }\n\n candidateEdges.splice(e, 1);\n candidateNodeMap[edge.source].degree--;\n candidateNodeMap[edge.target].degree--;\n candidateNodeMap[edge.source].outDegree--;\n candidateNodeMap[edge.target].inDegree--;\n return \"continue\";\n } // prune 2: 若边的 label +两端 label 的三元组关系不能在 pattern 中找到,去除该边\n\n\n var sourceLabel = candidateNodeMap[edge.source].node[nodeLabelProp];\n var targetLabel = candidateNodeMap[edge.target].node[nodeLabelProp];\n var edgeMatched = false;\n patternEdgesWithLabel.forEach(function (patternEdge) {\n var patternSource = patternNodeMap[patternEdge.source].node;\n var patternTarget = patternNodeMap[patternEdge.target].node;\n if (patternSource[nodeLabelProp] === sourceLabel && patternTarget[nodeLabelProp] === targetLabel) edgeMatched = true;\n if (!directed && patternSource[nodeLabelProp] === targetLabel && patternTarget[nodeLabelProp] === sourceLabel) edgeMatched = true;\n });\n\n if (!edgeMatched) {\n edgeLabelCountMap[edgeLabel]--; // 若这个 label 的 count 减少之后,该 label 的边数不足,去除该图\n\n if (patternEdgesWithLabel && edgeLabelCountMap[edgeLabel] < patternEdgesWithLabel.length) {\n candidateGraphInvalid = true;\n return \"break\";\n }\n\n candidateEdges.splice(e, 1);\n candidateNodeMap[edge.source].degree--;\n candidateNodeMap[edge.target].degree--;\n candidateNodeMap[edge.source].outDegree--;\n candidateNodeMap[edge.target].inDegree--;\n return \"continue\";\n }\n };\n\n for (var e = candidateEdgeNum - 1; e >= 0; e--) {\n var state_2 = _loop_5(e);\n\n if (state_2 === \"break\") break;\n } // prune2: 删除边的过程中,发现边数过少/边 label 数过少时,去除该图\n\n\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n\n candidateGraph.edges = candidateEdges;\n var lengthsToCandidate = (0, _dijkstra.default)(candidateGraph, candidateGraph.nodes[0].id, false).length;\n Object.keys(lengthsToCandidate).reverse().forEach(function (targetId) {\n if (targetId === candidateGraph.nodes[0].id || candidateGraphInvalid) return; // prune4: 通过上述裁剪,可能导致该邻居子图变为不连通。裁剪掉目前在这个邻居子图中和 candidate(第一个节点)不连通的节点\n\n if (lengthsToCandidate[targetId] === Infinity) {\n var targetNodeLabel = candidateNodeMap[targetId].node[nodeLabelProp];\n candidateNodeLabelCountMap[targetNodeLabel]--;\n\n if (candidateNodeLabelCountMap[targetNodeLabel] < patternNodeLabelMap[targetNodeLabel].length) {\n candidateGraphInvalid = true;\n return;\n }\n\n var idx = candidateGraph.nodes.indexOf(candidateNodeMap[targetId].node);\n candidateGraph.nodes.splice(idx, 1);\n candidateNodeMap[targetId] = undefined;\n return;\n } // prune5: 经过边裁剪后,可能又出现了最短路径过长的节点 (比 pattern 中同 label 的节点到 beginNode 最大最短距离远),删去这些节点\n\n\n var nLabel = nodeMap[targetId].node[nodeLabelProp];\n\n if (!undirectedLengthsToBeginPNodeLabelMap[nLabel] || !undirectedLengthsToBeginPNodeLabelMap[nLabel].length || lengthsToCandidate[targetId] > undirectedLengthsToBeginPNodeLabelMap[nLabel][undirectedLengthsToBeginPNodeLabelMap[nLabel].length - 1]) {\n var targetNodeLabel = candidateNodeMap[targetId].node[nodeLabelProp];\n candidateNodeLabelCountMap[targetNodeLabel]--;\n\n if (candidateNodeLabelCountMap[targetNodeLabel] < patternNodeLabelMap[targetNodeLabel].length) {\n candidateGraphInvalid = true;\n return;\n }\n\n var idx = candidateGraph.nodes.indexOf(candidateNodeMap[targetId].node);\n candidateGraph.nodes.splice(idx, 1);\n candidateNodeMap[targetId] = undefined;\n }\n });\n\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n\n var degreeChanged = true;\n var loopCount = 0;\n\n while (degreeChanged && !candidateGraphInvalid) {\n degreeChanged = false; // candidate 度数不足,删去该图\n\n var condition = directed ? candidateNodeMap[candidate.id].degree < patternNodeMap[beginPNode.id].degree || candidateNodeMap[candidate.id].inDegree < patternNodeMap[beginPNode.id].inDegree || candidateNodeMap[candidate.id].outDegree < patternNodeMap[beginPNode.id].outDegree : candidateNodeMap[candidate.id].degree < patternNodeMap[beginPNode.id].degree;\n\n if (condition) {\n candidateGraphInvalid = true;\n break;\n } // candidate label 个数不足,删去该图\n\n\n if (candidateNodeLabelCountMap[candidate[nodeLabelProp]] < patternNodeLabelMap[candidate[nodeLabelProp]].length) {\n candidateGraphInvalid = true;\n break;\n } // prune6:去除度数过小的节点\n\n\n var currentCandidateNodeNum = candidateGraph.nodes.length;\n\n for (var o = currentCandidateNodeNum - 1; o >= 0; o--) {\n var cgNode = candidateGraph.nodes[o];\n var nodeDegree = candidateNodeMap[cgNode.id].degree;\n var nodeInDegree = candidateNodeMap[cgNode.id].inDegree;\n var nodeOutDegree = candidateNodeMap[cgNode.id].outDegree;\n var cNodeLabel = cgNode[nodeLabelProp];\n\n var _e = stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, cNodeLabel, patternNodeMap, patternNodeLabelMap),\n minPatternNodeLabelDegree = _e.minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree = _e.minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree = _e.minPatternNodeLabelOutDegree;\n\n var deleteCondition = directed ? nodeDegree < minPatternNodeLabelDegree || nodeInDegree < minPatternNodeLabelInDegree || nodeOutDegree < minPatternNodeLabelOutDegree : nodeDegree < minPatternNodeLabelDegree;\n\n if (deleteCondition) {\n candidateNodeLabelCountMap[cgNode[nodeLabelProp]]--; // 节点 label 个数不足\n\n if (candidateNodeLabelCountMap[cgNode[nodeLabelProp]] < patternNodeLabelMap[cgNode[nodeLabelProp]].length) {\n candidateGraphInvalid = true;\n break;\n }\n\n candidateGraph.nodes.splice(o, 1);\n candidateNodeMap[cgNode.id] = undefined;\n degreeChanged = true;\n }\n }\n\n if (candidateGraphInvalid || !degreeChanged && loopCount !== 0) break; // 经过 prune5 节点裁剪,删去端点已经不在 candidateGraph 中的边\n\n candidateEdgeNum = candidateEdges.length;\n\n for (var y = candidateEdgeNum - 1; y >= 0; y--) {\n var cedge = candidateEdges[y];\n\n if (!candidateNodeMap[cedge.source] || !candidateNodeMap[cedge.target]) {\n candidateEdges.splice(y, 1);\n var edgeLabel = cedge[edgeLabelProp];\n edgeLabelCountMap[edgeLabel]--;\n\n if (candidateNodeMap[cedge.source]) {\n candidateNodeMap[cedge.source].degree--;\n candidateNodeMap[cedge.source].outDegree--;\n }\n\n if (candidateNodeMap[cedge.target]) {\n candidateNodeMap[cedge.target].degree--;\n candidateNodeMap[cedge.target].inDegree--;\n } // 边 label 数量不足\n\n\n if (patternEdgeLabelMap[edgeLabel] && edgeLabelCountMap[edgeLabel] < patternEdgeLabelMap[edgeLabel].length) {\n candidateGraphInvalid = true;\n break;\n }\n\n degreeChanged = true;\n }\n }\n\n loopCount++;\n }\n\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n } // prune: 若节点/边数过少,节点/边 label 过少,去掉这个图\n\n\n if (candidateGraphInvalid || candidateGraph.nodes.length < pattern.nodes.length || candidateEdges.length < pattern.edges.length) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n };\n\n for (var i = candidateGraphNum - 1; i >= 0; i--) {\n var state_1 = _loop_2(i);\n\n if (state_1 === \"break\") break;\n } // 此时已经生成的多个 candidateGraphs,可能有重复\n // console.log(\n // \"----- stage5: going to splice dulplicated candidate graphs -------\"\n // );\n // 删去 candidateGraphs 中一模一样的子图,通过边的 node-node-edgeLabel 作为 key,这类边个数作为 value,进行匹配\n\n\n var currentLength = candidateGraphs.length;\n\n var _loop_3 = function _loop_3(i) {\n var cg1 = candidateGraphs[i];\n var cg1EdgeMap = {}; // [node1.id-node2.id-edge.label]: count\n\n cg1.edges.forEach(function (edge) {\n var key = \"\".concat(edge.source, \"-\").concat(edge.target, \"-\").concat(edge.label);\n if (!cg1EdgeMap[key]) cg1EdgeMap[key] = 1;else cg1EdgeMap[key]++;\n });\n\n var _loop_6 = function _loop_6(j) {\n var cg2 = candidateGraphs[j];\n var cg2EdgeMap = {}; // [node1.id-node2.id-edge.label]: count\n\n cg2.edges.forEach(function (edge) {\n var key = \"\".concat(edge.source, \"-\").concat(edge.target, \"-\").concat(edge.label);\n if (!cg2EdgeMap[key]) cg2EdgeMap[key] = 1;else cg2EdgeMap[key]++;\n });\n var same = true;\n\n if (Object.keys(cg2EdgeMap).length !== Object.keys(cg1EdgeMap).length) {\n same = false;\n } else {\n Object.keys(cg1EdgeMap).forEach(function (key) {\n if (cg2EdgeMap[key] !== cg1EdgeMap[key]) same = false;\n });\n }\n\n if (same) {\n candidateGraphs.splice(j, 1);\n }\n };\n\n for (var j = currentLength - 1; j > i; j--) {\n _loop_6(j);\n }\n\n currentLength = candidateGraphs.length;\n };\n\n for (var i = 0; i <= currentLength - 1; i++) {\n _loop_3(i);\n }\n\n return candidateGraphs;\n};\n\nvar _default = GADDI;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/gaddi.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar _floydWarshall = _interopRequireDefault(__webpack_require__(/*! ./floydWarshall */ \"./node_modules/@antv/algorithm/lib/floydWarshall.js\"));\nvar _gSpan = _interopRequireDefault(__webpack_require__(/*! ./gSpan/gSpan */ \"./node_modules/@antv/algorithm/lib/gSpan/gSpan.js\"));\nvar _dijkstra = _interopRequireDefault(__webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/algorithm/lib/dijkstra.js\"));\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * 为 graphData 中每个节点生成邻居单元数组\n * @param graphData\n * @param spm\n * @param nodeLabelProp\n * @param k k-近邻\n */\nvar findKNeighborUnits = function findKNeighborUnits(graphData, spm, nodeLabelProp, k) {\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n if (k === void 0) {\n k = 2;\n }\n var units = [];\n var nodes = graphData.nodes;\n spm.forEach(function (row, i) {\n units.push(findKNeighborUnit(nodes, row, i, nodeLabelProp, k));\n });\n return units;\n};\nvar findKNeighborUnit = function findKNeighborUnit(nodes, row, i, nodeLabelProp, k) {\n var unitNodeIdxs = [i];\n var neighbors = [];\n var labelCountMap = {};\n row.forEach(function (v, j) {\n if (v <= k && i !== j) {\n unitNodeIdxs.push(j);\n neighbors.push(nodes[j]);\n var label = nodes[j][nodeLabelProp];\n if (!labelCountMap[label]) labelCountMap[label] = {\n count: 1,\n dists: [v]\n };else {\n labelCountMap[label].count++;\n labelCountMap[label].dists.push(v);\n }\n }\n });\n // 将 labelCountMap 中的 dists 按照从小到大排序,方便后面使用\n Object.keys(labelCountMap).forEach(function (label) {\n labelCountMap[label].dists = labelCountMap[label].dists.sort(function (a, b) {\n return a - b;\n });\n });\n return {\n nodeIdx: i,\n nodeId: nodes[i].id,\n nodeIdxs: unitNodeIdxs,\n neighbors: neighbors,\n neighborNum: unitNodeIdxs.length - 1,\n nodeLabelCountMap: labelCountMap\n };\n};\n/**\n * 随机寻找点对,满足距离小于 k\n * @param k 参数 k,表示 k-近邻\n * @param nodeNum 参数 length\n * @param maxNodePairNum 寻找点对的数量不超过 maxNodePairNum\n * @param spm 最短路径矩阵\n */\nvar findNodePairsRandomly = function findNodePairsRandomly(k, nodeNum, maxNodePairNum, kNeighborUnits, spm) {\n // 每个节点需要随机找出的点对数\n var nodePairNumEachNode = Math.ceil(maxNodePairNum / nodeNum);\n var nodePairMap = {};\n var foundNodePairCount = 0;\n // 遍历节点,为每个节点随机找出 nodePairNumEachNode 个点对,满足距离小于 k。找到的点对数量超过 maxNodePairNum 或所有节点遍历结束时终止\n kNeighborUnits.forEach(function (unit, i) {\n // 若未达到 nodePairNumEachNode,或循环次数小于最大循环次数(2 * nodeNum),继续循环\n var nodePairForICount = 0;\n var outerLoopCount = 0;\n var neighbors = unit.nodeIdxs; // the first one is the center node\n var neighborNum = unit.neighborNum - 1;\n while (nodePairForICount < nodePairNumEachNode) {\n // 另一端节点在节点数组中的的 index\n var oidx = neighbors[1 + Math.floor(Math.random() * neighborNum)];\n var innerLoopCount = 0;\n // 若随机得到的另一端 idx 不符合条件,则继续 random。条件是不是同一个节点、这个点对没有被记录过、距离小于 k\n while (nodePairMap[\"\".concat(i, \"-\").concat(oidx)] || nodePairMap[\"\".concat(oidx, \"-\").concat(i)]) {\n oidx = Math.floor(Math.random() * nodeNum);\n innerLoopCount++;\n if (innerLoopCount > 2 * nodeNum) break; // 循环次数大于最大循环次数(2 * nodeNum)跳出循环,避免死循环\n }\n\n if (innerLoopCount < 2 * nodeNum) {\n // 未达到最大循环次数,说明找到了合适的另一端\n nodePairMap[\"\".concat(i, \"-\").concat(oidx)] = {\n start: i,\n end: oidx,\n distance: spm[i][oidx]\n };\n nodePairForICount++;\n foundNodePairCount++;\n // 如果当前找到的点对数量达到了上限,返回结果\n if (foundNodePairCount >= maxNodePairNum) return nodePairMap;\n }\n outerLoopCount++;\n if (outerLoopCount > 2 * nodeNum) break; // 循环次数大于最大循环次数(2 * nodeNum)跳出循环,避免死循环\n }\n // 这个节点没有找到足够 nodePairNumEachNode 的点对。更新 nodePairNumEachNode,让后续节点找更多的点对\n if (nodePairForICount < nodePairNumEachNode) {\n var gap = nodePairNumEachNode - nodePairForICount;\n nodePairNumEachNode = (nodePairNumEachNode + gap) / (nodeNum - i - 1);\n }\n });\n return nodePairMap;\n};\n/**\n * 计算所有 nodePairMap 中节点对的相交邻居诱导子图\n * @param nodePairMap 节点对 map,key 为 node1.id-node2.id,value 为 { startNodeIdx, endNodeIdx, distance }\n * @param neighborUnits 每个节点的邻居元数组\n * @param graphData 原图数据\n * @param edgeMap 边的 map,方便检索\n * @param cachedInducedGraphMap 缓存的结果,下次进入该函数将继续更新该缓存,若 key 在缓存中存在则不需要重复计算\n */\nvar getIntersectNeighborInducedGraph = function getIntersectNeighborInducedGraph(nodePairMap, neighborUnits, graphData, cachedInducedGraphMap) {\n var nodes = graphData.nodes;\n if (!cachedInducedGraphMap) cachedInducedGraphMap = {};\n Object.keys(nodePairMap).forEach(function (key) {\n var _a, _b;\n if (cachedInducedGraphMap && cachedInducedGraphMap[key]) return;\n cachedInducedGraphMap[key] = {\n nodes: [],\n edges: []\n };\n var pair = nodePairMap[key];\n var startUnitNodeIds = (_a = neighborUnits[pair.start]) === null || _a === void 0 ? void 0 : _a.nodeIdxs;\n var endUnitNodeIds = (_b = neighborUnits[pair.end]) === null || _b === void 0 ? void 0 : _b.nodeIdxs;\n if (!startUnitNodeIds || !endUnitNodeIds) return; // 不存在邻元,返回空图\n var endSet = new Set(endUnitNodeIds);\n var intersect = startUnitNodeIds.filter(function (x) {\n return endSet.has(x);\n }); // 可能会爆栈(在 1580 + 6 nodes full-connected 时出现)\n if (!intersect || !intersect.length) return; // 没有交集,返回空图\n var intersectIdMap = {};\n var intersectLength = intersect.length;\n for (var i = 0; i < intersectLength; i++) {\n var node = nodes[intersect[i]];\n cachedInducedGraphMap[key].nodes.push(node); // 将交集中的点加入诱导子图\n intersectIdMap[node.id] = true;\n }\n // 遍历所有边数据,如果边的两端都在交集中,将该边加入诱导子图\n graphData.edges.forEach(function (edge) {\n if (intersectIdMap[edge.source] && intersectIdMap[edge.target]) cachedInducedGraphMap[key].edges.push(edge);\n });\n });\n return cachedInducedGraphMap;\n};\n/**\n * 计算 strcutre 在 graph 上的匹配数量\n * @param graph 图数据\n * @param structure 目前支持只有两个节点一条边的最简单结构\n * @param nodeLabelProp 节点类型字段名\n * @param edgeLabelProp 边类型字段名\n */\nvar getMatchedCount = function getMatchedCount(graph, structure, nodeLabelProp, edgeLabelProp) {\n var _a, _b;\n var nodeMap = {};\n graph.nodes.forEach(function (node) {\n nodeMap[node.id] = node;\n });\n var count = 0;\n if (!((_a = structure === null || structure === void 0 ? void 0 : structure.edges) === null || _a === void 0 ? void 0 : _a.length) || ((_b = structure === null || structure === void 0 ? void 0 : structure.nodes) === null || _b === void 0 ? void 0 : _b.length) < 2) return 0;\n graph.edges.forEach(function (e) {\n var sourceLabel = nodeMap[e.source][nodeLabelProp];\n var targetLabel = nodeMap[e.target][nodeLabelProp];\n var strNodeLabel1 = structure === null || structure === void 0 ? void 0 : structure.nodes[0][nodeLabelProp];\n var strNodeLabel2 = structure === null || structure === void 0 ? void 0 : structure.nodes[1][nodeLabelProp];\n var strEdgeLabel = structure === null || structure === void 0 ? void 0 : structure.edges[0][edgeLabelProp];\n if (e[edgeLabelProp] !== strEdgeLabel) return;\n if (sourceLabel === strNodeLabel1 && targetLabel === strNodeLabel2 || sourceLabel === strNodeLabel2 && targetLabel === strNodeLabel1) {\n count++;\n }\n });\n return count;\n};\n/**\n * structures 中寻找最具有代表性的一个。这个结构是使得 matchedCountMap 的分组方式类内间距最小,类间间距最大\n * @param matchedCountMap 每个 structure 分类后的各图匹配数量,格式 { [strcture.idx]: { [interInducedGraphKey]: count } }\n * @param structureNum strcuture 个数,与 matchedCountMap.length 对应\n * @param structures\n */\nvar findRepresentStructure = function findRepresentStructure(matchedCountMap, structureNum, structures) {\n var maxOffset = Infinity,\n representClusterType = 0;\n var _loop_1 = function _loop_1(i) {\n // 一种分组的 map,key 是 intGraph 的 key,value 是 structures[i] 的匹配个数\n var countMapI = matchedCountMap[i];\n // 按照 value 为该组排序,生成 keys 的数组:\n var sortedGraphKeys = Object.keys(countMapI).sort(function (a, b) {\n return countMapI[a] - countMapI[b];\n });\n // 共 100 个 graphKeys,将 graphKeys 按顺序分为 groupNum 组\n var groupNum = 10;\n var clusters = []; // 总共有 groupNum 个项\n sortedGraphKeys.forEach(function (key, j) {\n if (!clusters[j % groupNum]) clusters[j % groupNum] = {\n graphs: [],\n totalCount: 0,\n aveCount: 0\n };\n clusters[j % groupNum].graphs.push(key);\n clusters[j % groupNum].totalCount += countMapI[key];\n });\n // 计算 cluster 与 cluster 之间的距离 innerDist,每个 cluster 内部的距离 intraDist\n var aveIntraDist = 0; // 该类的类内平均值\n var aveCounts = []; // 类内平均匹配数量,将用于计算类间距离\n clusters.forEach(function (graphsInCluster) {\n // 类内均值\n var aveCount = graphsInCluster.totalCount / graphsInCluster.graphs.length;\n graphsInCluster.aveCount = aveCount;\n aveCounts.push(aveCount);\n // 对于每类,计算类内间距平均值\n var aveIntraPerCluster = 0;\n var graphsNum = graphsInCluster.length;\n graphsInCluster.graphs.forEach(function (graphKey1, j) {\n var graph1Count = countMapI[graphKey1];\n graphsInCluster.graphs.forEach(function (graphKey2, k) {\n if (j === k) return;\n aveIntraPerCluster += Math.abs(graph1Count - countMapI[graphKey2]);\n });\n });\n aveIntraPerCluster /= graphsNum * (graphsNum - 1) / 2;\n aveIntraDist += aveIntraPerCluster;\n });\n aveIntraDist /= clusters.length;\n // 用类内均值计算类间距\n var aveInterDist = 0; // 类间间距平均值\n aveCounts.forEach(function (aveCount1, j) {\n aveCounts.forEach(function (aveCount2, k) {\n if (j === k) return;\n aveInterDist += Math.abs(aveCount1 - aveCount2);\n });\n aveInterDist /= aveCounts.length * (aveCounts.length - 1) / 2;\n });\n // 寻找 (类间间距均值-类内间距均值) 最大的一种分组方式(对应的 structure 就是最终要找的唯一 DS(G))\n var offset = aveInterDist - aveIntraDist;\n if (maxOffset < offset) {\n maxOffset = offset;\n representClusterType = i;\n }\n };\n for (var i = 0; i < structureNum; i++) {\n _loop_1(i);\n }\n return {\n structure: structures[representClusterType],\n structureCountMap: matchedCountMap[representClusterType]\n };\n};\nvar getNodeMaps = function getNodeMaps(nodes, nodeLabelProp) {\n var nodeMap = {},\n nodeLabelMap = {};\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = {\n idx: i,\n node: node,\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n var label = node[nodeLabelProp];\n if (!nodeLabelMap[label]) nodeLabelMap[label] = [];\n nodeLabelMap[label].push(node);\n });\n return {\n nodeMap: nodeMap,\n nodeLabelMap: nodeLabelMap\n };\n};\nvar getEdgeMaps = function getEdgeMaps(edges, edgeLabelProp, nodeMap) {\n var edgeMap = {},\n edgeLabelMap = {};\n edges.forEach(function (edge, i) {\n edgeMap[\"\".concat(_util.uniqueId)] = {\n idx: i,\n edge: edge\n };\n var label = edge[edgeLabelProp];\n if (!edgeLabelMap[label]) edgeLabelMap[label] = [];\n edgeLabelMap[label].push(edge);\n var sourceNode = nodeMap[edge.source];\n if (sourceNode) {\n sourceNode.degree++;\n sourceNode.outDegree++;\n }\n var targetNode = nodeMap[edge.target];\n if (targetNode) {\n targetNode.degree++;\n targetNode.inDegree++;\n }\n });\n return {\n edgeMap: edgeMap,\n edgeLabelMap: edgeLabelMap\n };\n};\n/**\n * 输出最短路径的 map,key 为 sourceNode.id-targetNode.id,value 为这两个节点的最短路径长度\n * @param nodes\n * @param spm\n * @param directed\n */\nvar getSpmMap = function getSpmMap(nodes, spm, directed) {\n var length = spm.length;\n var map = {};\n spm.forEach(function (row, i) {\n var start = directed ? 0 : i + 1;\n var iId = nodes[i].id;\n for (var j = start; j < length; j++) {\n if (i === j) continue;\n var jId = nodes[j].id;\n var dist = row[j];\n map[\"\".concat(iId, \"-\").concat(jId)] = dist;\n if (!directed) map[\"\".concat(jId, \"-\").concat(iId)] = dist;\n }\n });\n return map;\n};\n/**\n * 计算一对节点(node1,node2)的 NDS 距离\n * @param graph 原图数据\n * @param node1\n * @param node2\n */\nvar getNDSDist = function getNDSDist(graph, node1, node2, nodeMap, spDist, kNeighborUnits, structure, nodeLabelProp, edgeLabelProp, cachedNDSMap, cachedInterInducedGraph) {\n var _a;\n var key = \"\".concat(node1.id, \"-\").concat(node2.id);\n if (cachedNDSMap && cachedNDSMap[key]) return cachedNDSMap[key];\n var interInducedGraph = cachedInterInducedGraph ? cachedInterInducedGraph[key] : undefined;\n // 若没有缓存相交邻居诱导子图,计算\n if (!interInducedGraph) {\n var pairMap = (_a = {}, _a[key] = {\n start: nodeMap[node1.id].idx,\n end: nodeMap[node2.id].idx,\n distance: spDist\n }, _a);\n cachedInterInducedGraph = getIntersectNeighborInducedGraph(pairMap, kNeighborUnits, graph, cachedInterInducedGraph);\n interInducedGraph = cachedInterInducedGraph[key];\n }\n return getMatchedCount(interInducedGraph, structure, nodeLabelProp, edgeLabelProp);\n};\n/**\n * 计算 pattern 上绩点的度数并存储到 minPatternNodeLabelDegreeMap\n */\nvar stashPatternNodeLabelDegreeMap = function stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, neighborLabel, patternNodeMap, patternNodeLabelMap) {\n var _a, _b, _c;\n var minPatternNodeLabelDegree = (_a = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _a === void 0 ? void 0 : _a.degree;\n var minPatternNodeLabelInDegree = (_b = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _b === void 0 ? void 0 : _b.inDegree;\n var minPatternNodeLabelOutDegree = (_c = minPatternNodeLabelDegreeMap[neighborLabel]) === null || _c === void 0 ? void 0 : _c.outDegree;\n if (minPatternNodeLabelDegreeMap[neighborLabel] === undefined) {\n minPatternNodeLabelDegree = Infinity;\n minPatternNodeLabelInDegree = Infinity;\n minPatternNodeLabelOutDegree = Infinity;\n patternNodeLabelMap[neighborLabel].forEach(function (patternNodeWithLabel) {\n var patternNodeDegree = patternNodeMap[patternNodeWithLabel.id].degree;\n if (minPatternNodeLabelDegree > patternNodeDegree) minPatternNodeLabelDegree = patternNodeDegree;\n var patternNodeInDegree = patternNodeMap[patternNodeWithLabel.id].inDegree;\n if (minPatternNodeLabelInDegree > patternNodeInDegree) minPatternNodeLabelInDegree = patternNodeInDegree;\n var patternNodeOutDegree = patternNodeMap[patternNodeWithLabel.id].outDegree;\n if (minPatternNodeLabelOutDegree > patternNodeOutDegree) minPatternNodeLabelOutDegree = patternNodeOutDegree;\n });\n minPatternNodeLabelDegreeMap[neighborLabel] = {\n degree: minPatternNodeLabelDegree,\n inDegree: minPatternNodeLabelInDegree,\n outDegree: minPatternNodeLabelOutDegree\n };\n }\n return {\n minPatternNodeLabelDegree: minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree: minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree: minPatternNodeLabelOutDegree\n };\n};\n/**\n * GADDI 模式匹配\n * @param graphData 原图数据\n * @param pattern 搜索图(需要在原图上搜索的模式)数据\n * @param directed 是否计算有向图,默认 false\n * @param k 参数 k,表示 k-近邻\n * @param length 参数 length\n * @param nodeLabelProp 节点数据中代表节点标签(分类信息)的属性名。默认为 cluster\n * @param edgeLabelProp 边数据中代表边标签(分类信息)的属性名。默认为 cluster\n */\nvar GADDI = function GADDI(graphData, pattern, directed, k, length, nodeLabelProp, edgeLabelProp) {\n var _a;\n if (directed === void 0) {\n directed = false;\n }\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n if (edgeLabelProp === void 0) {\n edgeLabelProp = 'cluster';\n }\n if (!graphData || !graphData.nodes) return;\n // 分为三步:\n // 0. 预计算:节点/边数,邻接矩阵、最短路径矩阵\n // 1. 处理原图 graphData。再分为 1~5 小步\n // 2. 匹配\n // console.log(\"----- stage-pre: preprocessing -------\");\n // -------- 第零步,预计算:节点/边数,邻接矩阵、最短路径矩阵-------\n var nodeNum = graphData.nodes.length;\n if (!nodeNum) return;\n // console.log(\"----- stage-pre.1: calc shortest path matrix for graph -------\");\n var spm = (0, _floydWarshall.default)(graphData, directed);\n // console.log(\n // \"----- stage-pre.2: calc shortest path matrix for pattern -------\"\n // );\n var patternSpm = (0, _floydWarshall.default)(pattern, directed);\n // console.log(\n // \"----- stage-pre.3: calc shortest path matrix map for graph -------\"\n // );\n var spmMap = getSpmMap(graphData.nodes, spm, directed);\n // console.log(\n // \"----- stage-pre.4: calc shortest path matrix map for pattern -------\"\n // );\n var patternSpmMap = getSpmMap(pattern.nodes, patternSpm, directed);\n // console.log(\"----- stage-pre.5: establish maps -------\");\n // 节点的 map,以 id 为 id 映射,方便后续快速检索\n var _b = getNodeMaps(graphData.nodes, nodeLabelProp),\n nodeMap = _b.nodeMap,\n nodeLabelMap = _b.nodeLabelMap;\n var _c = getNodeMaps(pattern.nodes, nodeLabelProp),\n patternNodeMap = _c.nodeMap,\n patternNodeLabelMap = _c.nodeLabelMap;\n // 计算节点度数\n getEdgeMaps(graphData.edges, edgeLabelProp, nodeMap);\n var patternEdgeLabelMap = getEdgeMaps(pattern.edges, edgeLabelProp, patternNodeMap).edgeLabelMap;\n // 若未指定 length,自动计算 pattern 半径(最短路径最大值)\n var patternSpmSpread = [];\n patternSpm === null || patternSpm === void 0 ? void 0 : patternSpm.forEach(function (row) {\n patternSpmSpread = patternSpmSpread.concat(row);\n });\n if (!length) length = Math.max.apply(Math, (0, _tslib.__spreadArray)((0, _tslib.__spreadArray)([], patternSpmSpread, false), [2], false));\n if (!k) k = length;\n // console.log(\"params\", directed, length, k);\n // console.log(\"----- stage-pre.6: calc k neighbor units -------\");\n // 计算每个节点的 k 邻元集合\n var kNeighborUnits = findKNeighborUnits(graphData, spm, nodeLabelProp, k);\n var patternKNeighborUnits = findKNeighborUnits(pattern, patternSpm, nodeLabelProp, k);\n // console.log(\n // \"----- stage0: going to processing graph and find intersect neighbor induced graphs -------\"\n // );\n // console.log(\"----- stage0.1: going to select random node pairs -------\");\n // -------- 第一步,处理原图 graphData-------\n // 1.1. 随机选择最多 100 个点对,满足距离小于 Length 和 k\n // 当 graphData 少于 20 个节点,则不能找出 100 个点对,只找出不多于 n(n-1)/2 个点对\n var maxNodePairNum = Math.min(100, nodeNum * (nodeNum - 1) / 2);\n var nodePairsMap = findNodePairsRandomly(k, nodeNum, maxNodePairNum, kNeighborUnits, spm);\n // console.log(\n // \"----- stage0.2: going to calculate intersect neighbor induced graphs -------\"\n // );\n // 1.2. 生成上面节点对的相应相交邻居诱导子图。格式为 {'beginNodeIdx-endNodeIdx': {nodes: [], edges: []}}\n var intGMap = getIntersectNeighborInducedGraph(nodePairsMap, kNeighborUnits, graphData);\n // 1.3. 使用 gSpan 算法(frequent graph mining)计算 ISIntG 的前 10 个频率最高的子结构(3-4条边)\n var top = 10,\n minSupport = 1,\n minNodeNum = 1,\n maxNodeNum = 4;\n var params = {\n graphs: intGMap,\n nodeLabelProp: nodeLabelProp,\n edgeLabelProp: edgeLabelProp,\n minSupport: minSupport,\n minNodeNum: minNodeNum,\n maxNodeNum: maxNodeNum,\n directed: directed\n };\n // console.log(\n // \"----- stage1: (gSpan) going to find frequent structure dsG -------\"\n // );\n // console.log(\"----- stage1.1: going to run gSpan -------\");\n // 暂时假设生成的 sub structure 都只有一条边\n var freStructures = (0, _gSpan.default)(params).slice(0, top);\n // structureNum 可能小于 top\n var structureNum = freStructures.length;\n // 1.4. 计算上述 10 个子结构在 intGMap 中每个诱导子图的匹配个数\n var matchedCountMap = [];\n freStructures.forEach(function (structure, i) {\n matchedCountMap[i] = {};\n Object.keys(intGMap).forEach(function (key) {\n var graph = intGMap[key];\n var subStructureCount = getMatchedCount(graph, structure, nodeLabelProp, edgeLabelProp);\n matchedCountMap[i][key] = subStructureCount;\n });\n });\n // console.log(\n // \"----- stage1.1: going to find the most represent strucutre -------\"\n // );\n // 1.5. 对于每个子结构,根据匹配个数为 intGMap 中的诱导子图分组,生成 structureNum 种分组\n // 计算每种分组的类间距和类内间距,找到类间距最大、类内间距最小的一种分组,这种分组对应的子结构被选为唯一代表性子结构 DS(G)\n var _d = findRepresentStructure(matchedCountMap, structureNum, freStructures),\n dsG = _d.structure,\n ndsDist = _d.structureCountMap;\n // -------- 第二步,匹配-------\n // 2.1 找到从 Q 中的一个节点作为起始节点,寻找 G 中的匹配。这个其实节点的标签可以在 G 中找到最多的节点\n var beginPNode = pattern.nodes[0],\n candidates = [],\n label = (_a = pattern.nodes[0]) === null || _a === void 0 ? void 0 : _a[nodeLabelProp],\n maxNodeNumWithSameLabel = -Infinity;\n pattern.nodes.forEach(function (node) {\n var pLabel = node[nodeLabelProp];\n var nodesWithSameLabel = nodeLabelMap[pLabel];\n if ((nodesWithSameLabel === null || nodesWithSameLabel === void 0 ? void 0 : nodesWithSameLabel.length) > maxNodeNumWithSameLabel) {\n maxNodeNumWithSameLabel = nodesWithSameLabel.length;\n candidates = nodesWithSameLabel;\n label = pLabel;\n beginPNode = node;\n }\n });\n // console.log(\"----- stage2: going to find candidates -------\");\n // 全局缓存,避免重复计算\n var minPatternNodeLabelDegreeMap = {}; // key 是 label,value 是该 label 节点的最小度数\n var patternIntGraphMap = {},\n patternNDSDist = {},\n // key 为 node.id-node.id\n patternNDSDistMap = {}; // key 为 node.id-label2,value nds距离值数组(按从大到小排序,无需关心具体对应哪个 node2)\n // 2.2.2 对于 Q 中的另一个标签的 k 个节点,计算它们到 node 的最短路径以及 NDS 距离\n var patternSpDist = {};\n var patternSpDistBack = {};\n Object.keys(patternNodeLabelMap).forEach(function (label2, j) {\n patternSpDist[label2] = [];\n if (directed) {\n patternSpDistBack[label2] = [];\n }\n var maxDist = -Infinity;\n var patternNodesWithLabel2 = patternNodeLabelMap[label2];\n var patternNodePairMap = {};\n patternNodesWithLabel2.forEach(function (nodeWithLabel2) {\n var dist = patternSpmMap[\"\".concat(beginPNode.id, \"-\").concat(nodeWithLabel2.id)];\n dist && patternSpDist[label2].push(dist);\n if (maxDist < dist) maxDist = dist;\n patternNodePairMap[\"\".concat(beginPNode.id, \"-\").concat(nodeWithLabel2.id)] = {\n start: 0,\n end: patternNodeMap[nodeWithLabel2.id].idx,\n distance: dist\n };\n if (directed) {\n var distBack = patternSpmMap[\"\".concat(nodeWithLabel2.id, \"-\").concat(beginPNode.id)];\n distBack && patternSpDistBack[label2].push(distBack);\n }\n });\n // spDist[label2] 按照从小到大排序\n patternSpDist[label2] = patternSpDist[label2].sort(function (a, b) {\n return a - b;\n });\n if (directed) patternSpDistBack[label2] = patternSpDistBack[label2].sort(function (a, b) {\n return a - b;\n });\n // 计算 Q 中所有 label2 节点到 beginPNode 的 NDS 距离\n // 所有 label2 节点到 beginPNode 的邻居相交诱导子图:\n // key: node1.id-node2.id\n patternIntGraphMap = getIntersectNeighborInducedGraph(patternNodePairMap, patternKNeighborUnits, pattern, patternIntGraphMap);\n // pattern 中 beginNode 到当前 label2 节点 的 NDS 距离(数组,无需关心具体对应到哪个节点)\n var currentPatternNDSDistArray = [];\n Object.keys(patternNodePairMap).forEach(function (key) {\n if (patternNDSDist[key]) {\n currentPatternNDSDistArray.push(patternNDSDist[key]);\n return; // 缓存过则不需要再次计算\n }\n\n var patternIntGraph = patternIntGraphMap[key];\n patternNDSDist[key] = getMatchedCount(patternIntGraph, dsG, nodeLabelProp, edgeLabelProp);\n currentPatternNDSDistArray.push(patternNDSDist[key]);\n });\n // 根据值为 currentPatternNDSDist 从大到小排序\n currentPatternNDSDistArray = currentPatternNDSDistArray.sort(function (a, b) {\n return b - a;\n });\n patternNDSDistMap[\"\".concat(beginPNode.id, \"-\").concat(label2)] = currentPatternNDSDistArray;\n if (label2 === label) return;\n var candidatesNum = (candidates === null || candidates === void 0 ? void 0 : candidates.length) || 0;\n var _loop_4 = function _loop_4(m) {\n var cNode = candidates[m];\n // prune1:若 candidates 中节点 cNode 的 kNeighborUnits 中标签为 label2 的节点个数少于 pattern 中 label2 个数,删去它\n var graphNeighborUnit = kNeighborUnits[nodeMap[cNode.id].idx];\n var graphNeighborUnitCountMap = graphNeighborUnit.nodeLabelCountMap[label2];\n var patternLabel2Num = patternNodeLabelMap[label2].length;\n if (!graphNeighborUnitCountMap || graphNeighborUnitCountMap.count < patternLabel2Num) {\n candidates.splice(m, 1);\n return \"continue\";\n }\n // prune2:若 candidates 中节点 cNode 到 kNeighborUnits 中标签为 label2 的节点最短路径大于 patternSpDist[label2],删去它\n // (prune2 规则即:candidate 相关的最短路径的最大 spDist[label2].length 个,按照大小顺序依次和 patternSpDist[label2] 中的值比较,只要遇到一个是 G > Q 的,就删去这个 candidate)\n var prune2Invalid = false;\n for (var n = 0; n < patternLabel2Num; n++) {\n if (graphNeighborUnitCountMap.dists[n] > patternSpDist[label2][n]) {\n prune2Invalid = true;\n break;\n }\n }\n if (prune2Invalid) {\n candidates.splice(m, 1);\n return \"continue\";\n }\n // prune3:若 candidates 中节点 cNode 到 kNeighborUnits 中标签为 label2 的节点 NDS 距离小于 patternNDSDist[beginNode.id-label2],删去它\n // TODO:prune3,currentPatternNDSDistArray 与 currentNDSDist 的比较\n // 计算 G 中所有 label2 节点到 cNode 的 NDS 距离\n // 所有 label2 节点到 cNode 的邻居相交诱导子图:\n var cNodePairMap = {};\n graphNeighborUnit.neighbors.forEach(function (neighborNode) {\n var dist = spmMap[\"\".concat(cNode.id, \"-\").concat(neighborNode.id)];\n cNodePairMap[\"\".concat(cNode.id, \"-\").concat(neighborNode.id)] = {\n start: nodeMap[cNode.id].idx,\n end: nodeMap[neighborNode.id].idx,\n distance: dist\n };\n });\n // 更新 intGMap\n intGMap = getIntersectNeighborInducedGraph(cNodePairMap, kNeighborUnits, graphData, intGMap);\n // candidate 到它周围 label2 节点的 NDS 距离, key 是 node.id-node.id\n var currentNDSDistArray = [];\n Object.keys(cNodePairMap).forEach(function (key) {\n if (ndsDist[key]) {\n currentNDSDistArray.push(ndsDist[key]);\n return; // 缓存过则不需要再次计算\n }\n\n var intGraph = intGMap[key];\n ndsDist[key] = getMatchedCount(intGraph, dsG, nodeLabelProp, edgeLabelProp);\n currentNDSDistArray.push(ndsDist[key]);\n });\n // 根据值为 currentNDSDistArray 从大到小排序\n currentNDSDistArray = currentNDSDistArray.sort(function (a, b) {\n return b - a;\n });\n var prune3Invalid = false;\n for (var n = 0; n < patternLabel2Num; n++) {\n if (currentNDSDistArray[n] < currentPatternNDSDistArray[n]) {\n prune3Invalid = true;\n break;\n }\n }\n if (prune3Invalid) {\n candidates.splice(m, 1);\n return \"continue\";\n }\n };\n for (var m = candidatesNum - 1; m >= 0; m--) {\n _loop_4(m);\n }\n });\n var candidateGraphs = [];\n // console.log(\n // \"----- stage3: going to splice neighbors for each candidate graph -------\"\n // );\n // candidates 经过筛选后,以每个 candidate 为中心,生成 Length-neighbor 的邻居诱导子图\n // 并在诱导子图中去除不可能在 Q 上找到匹配的点:在 Q 上不存在的 label,其他 label 到 candidate 的最大最短距离符合 Q、NDS 距离符合 Q\n candidates === null || candidates === void 0 ? void 0 : candidates.forEach(function (candidate) {\n var nodeIdx = nodeMap[candidate.id].idx;\n var lengthNeighborUnit = findKNeighborUnit(graphData.nodes, spm[nodeIdx], nodeIdx, nodeLabelProp, length);\n var neighborNodes = lengthNeighborUnit.neighbors;\n // 删除不可能找到匹配的邻居点\n var neighborNum = neighborNodes.length;\n var unmatched = false;\n for (var i = neighborNum - 1; i >= 0; i--) {\n // 如果通过裁剪,符合条件的节点数量已过少,说明不能匹配这个 candidate 相关的图\n if (neighborNodes.length + 1 < pattern.nodes.length) {\n unmatched = true;\n return;\n }\n var neighborNode = neighborNodes[i];\n var neighborLabel = neighborNode[nodeLabelProp];\n // prune1: 若该邻居点的 label 不存在于 pattern 中,移除这个点\n if (!patternNodeLabelMap[neighborLabel] || !patternNodeLabelMap[neighborLabel].length) {\n neighborNodes.splice(i, 1);\n continue;\n }\n // prune2: 若该邻居点到 candidate 的最短路径比和它有相同 label 的节点到 beginPNode 的最大最短路径长度长,移除这个点\n // prune2.1: 如果没有这个标签到 beginPNode 的距离记录,说明 pattern 上(可能 beginPNode 是这个 label)没有其他这个 label 的节点\n if (!patternSpDist[neighborLabel] || !patternSpDist[neighborLabel].length) {\n neighborNodes.splice(i, 1);\n continue;\n }\n var key = \"\".concat(candidate.id, \"-\").concat(neighborNode.id);\n // prune2.2\n var distToCandidate = spmMap[key];\n var idx = patternSpDist[neighborLabel].length - 1;\n var maxDistWithLabelInPattern = patternSpDist[neighborLabel][idx]; // patternSpDist[neighborLabel] 已经按照从小到大排序\n if (distToCandidate > maxDistWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n if (directed) {\n var keyBack = \"\".concat(neighborNode.id, \"-\").concat(candidate.id);\n var distFromCandidate = spmMap[keyBack];\n idx = patternSpDistBack[neighborLabel].length - 1;\n var maxBackDistWithLabelInPattern = patternSpDistBack[neighborLabel][idx];\n if (distFromCandidate > maxBackDistWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n }\n // prune3: 若该邻居点到 candidate 的 NDS 距离比和它有相同 label 的节点到 beginPNode 的最小 NDS 距离小,移除这个点\n var ndsToCandidate = ndsDist[key] ? ndsDist[key] : getNDSDist(graphData, candidate, neighborNode, nodeMap, distToCandidate, kNeighborUnits, dsG, nodeLabelProp, edgeLabelProp, ndsDist, intGMap);\n var patternKey = \"\".concat(beginPNode.id, \"-\").concat(neighborLabel);\n var minNdsWithLabelInPattern = patternNDSDistMap[patternKey][patternNDSDistMap[patternKey].length - 1]; // patternNDSDist[key] 一定存在\n if (ndsToCandidate < minNdsWithLabelInPattern) {\n neighborNodes.splice(i, 1);\n continue;\n }\n // prune4: 若该邻居点的度数小于 pattern 同 label 节点最小度数,删去该点\n var _a = stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, neighborLabel, patternNodeMap, patternNodeLabelMap),\n minPatternNodeLabelDegree = _a.minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree = _a.minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree = _a.minPatternNodeLabelOutDegree;\n if (nodeMap[neighborNode.id].degree < minPatternNodeLabelDegree) {\n neighborNodes.splice(i, 1);\n continue;\n }\n }\n // 节点在个数上符合匹配(不少于 pattern 的节点个数),现在筛选相关边\n if (!unmatched) {\n candidateGraphs.push({\n nodes: [candidate].concat(neighborNodes)\n });\n }\n });\n // console.log(\n // \"----- stage4: going to splice edges and neighbors for each candidate graph -------\"\n // );\n var undirectedLengthsToBeginPNode = (0, _dijkstra.default)(pattern, beginPNode.id, false).length;\n var undirectedLengthsToBeginPNodeLabelMap = {};\n if (directed) {\n Object.keys(undirectedLengthsToBeginPNode).forEach(function (nodeId) {\n var nodeLabel = patternNodeMap[nodeId].node[nodeLabelProp];\n if (!undirectedLengthsToBeginPNodeLabelMap[nodeLabel]) undirectedLengthsToBeginPNodeLabelMap[nodeLabel] = [undirectedLengthsToBeginPNode[nodeId]];else undirectedLengthsToBeginPNodeLabelMap[nodeLabel].push(undirectedLengthsToBeginPNode[nodeId]);\n });\n Object.keys(undirectedLengthsToBeginPNodeLabelMap).forEach(function (pLabel) {\n undirectedLengthsToBeginPNodeLabelMap[pLabel].sort(function (a, b) {\n return a - b;\n });\n });\n } else {\n undirectedLengthsToBeginPNodeLabelMap = patternSpDist;\n }\n // 现在 candidateGraphs 里面只有节点,进行边的筛选\n var candidateGraphNum = candidateGraphs.length;\n var _loop_2 = function _loop_2(i) {\n var candidateGraph = candidateGraphs[i];\n var candidate = candidateGraph.nodes[0];\n var candidateNodeLabelCountMap = {};\n var candidateNodeMap = {};\n candidateGraph.nodes.forEach(function (node, q) {\n candidateNodeMap[node.id] = {\n idx: q,\n node: node,\n degree: 0,\n inDegree: 0,\n outDegree: 0\n };\n var cNodeLabel = node[nodeLabelProp];\n if (!candidateNodeLabelCountMap[cNodeLabel]) candidateNodeLabelCountMap[cNodeLabel] = 1;else candidateNodeLabelCountMap[cNodeLabel]++;\n });\n // 根据 candidate 和 neighborNodes 中的节点生成 G 的诱导子图\n // 即,将 graphData 上两端都在 candidateGraph.nodes 中的边放入 candidateEdges\n var candidateEdges = [];\n var edgeLabelCountMap = {};\n graphData.edges.forEach(function (edge) {\n if (candidateNodeMap[edge.source] && candidateNodeMap[edge.target]) {\n candidateEdges.push(edge);\n if (!edgeLabelCountMap[edge[edgeLabelProp]]) edgeLabelCountMap[edge[edgeLabelProp]] = 1;else edgeLabelCountMap[edge[edgeLabelProp]]++;\n candidateNodeMap[edge.source].degree++;\n candidateNodeMap[edge.target].degree++;\n candidateNodeMap[edge.source].outDegree++;\n candidateNodeMap[edge.target].inDegree++;\n }\n });\n // prune:若有一个 edgeLabel 在 candidateGraph 上的个数少于 pattern,去除该图\n var pattenrEdgeLabelNum = Object.keys(patternEdgeLabelMap).length;\n var prunedByEdgeLabel = false;\n for (var e = 0; e < pattenrEdgeLabelNum; e++) {\n var label_1 = Object.keys(patternEdgeLabelMap)[e];\n if (!edgeLabelCountMap[label_1] || edgeLabelCountMap[label_1] < patternEdgeLabelMap[label_1].length) {\n prunedByEdgeLabel = true;\n break;\n }\n }\n if (prunedByEdgeLabel) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n // 遍历 candidateEdges,进行边的筛选\n var candidateEdgeNum = candidateEdges.length;\n // prune:若边数过少,去除该图\n if (candidateEdgeNum < pattern.edges.length) {\n candidateGraphs.splice(i, 1);\n return \"break\";\n }\n var candidateGraphInvalid = false;\n var _loop_5 = function _loop_5(e) {\n var edge = candidateEdges[e];\n var edgeLabel = edge[edgeLabelProp];\n var patternEdgesWithLabel = patternEdgeLabelMap[edgeLabel];\n // prune 1: 若边的 label 不存在于 pattern 边 label 中,去除该边\n if (!patternEdgesWithLabel || !patternEdgesWithLabel.length) {\n edgeLabelCountMap[edgeLabel]--;\n // 若这个 label 的 count 减少之后,该 label 的边数不足,去除该图\n if (patternEdgesWithLabel && edgeLabelCountMap[edgeLabel] < patternEdgesWithLabel.length) {\n candidateGraphInvalid = true;\n return \"break\";\n }\n candidateEdges.splice(e, 1);\n candidateNodeMap[edge.source].degree--;\n candidateNodeMap[edge.target].degree--;\n candidateNodeMap[edge.source].outDegree--;\n candidateNodeMap[edge.target].inDegree--;\n return \"continue\";\n }\n // prune 2: 若边的 label +两端 label 的三元组关系不能在 pattern 中找到,去除该边\n var sourceLabel = candidateNodeMap[edge.source].node[nodeLabelProp];\n var targetLabel = candidateNodeMap[edge.target].node[nodeLabelProp];\n var edgeMatched = false;\n patternEdgesWithLabel.forEach(function (patternEdge) {\n var patternSource = patternNodeMap[patternEdge.source].node;\n var patternTarget = patternNodeMap[patternEdge.target].node;\n if (patternSource[nodeLabelProp] === sourceLabel && patternTarget[nodeLabelProp] === targetLabel) edgeMatched = true;\n if (!directed && patternSource[nodeLabelProp] === targetLabel && patternTarget[nodeLabelProp] === sourceLabel) edgeMatched = true;\n });\n if (!edgeMatched) {\n edgeLabelCountMap[edgeLabel]--;\n // 若这个 label 的 count 减少之后,该 label 的边数不足,去除该图\n if (patternEdgesWithLabel && edgeLabelCountMap[edgeLabel] < patternEdgesWithLabel.length) {\n candidateGraphInvalid = true;\n return \"break\";\n }\n candidateEdges.splice(e, 1);\n candidateNodeMap[edge.source].degree--;\n candidateNodeMap[edge.target].degree--;\n candidateNodeMap[edge.source].outDegree--;\n candidateNodeMap[edge.target].inDegree--;\n return \"continue\";\n }\n };\n for (var e = candidateEdgeNum - 1; e >= 0; e--) {\n var state_2 = _loop_5(e);\n if (state_2 === \"break\") break;\n }\n // prune2: 删除边的过程中,发现边数过少/边 label 数过少时,去除该图\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n candidateGraph.edges = candidateEdges;\n var lengthsToCandidate = (0, _dijkstra.default)(candidateGraph, candidateGraph.nodes[0].id, false).length;\n Object.keys(lengthsToCandidate).reverse().forEach(function (targetId) {\n if (targetId === candidateGraph.nodes[0].id || candidateGraphInvalid) return;\n // prune4: 通过上述裁剪,可能导致该邻居子图变为不连通。裁剪掉目前在这个邻居子图中和 candidate(第一个节点)不连通的节点\n if (lengthsToCandidate[targetId] === Infinity) {\n var targetNodeLabel = candidateNodeMap[targetId].node[nodeLabelProp];\n candidateNodeLabelCountMap[targetNodeLabel]--;\n if (candidateNodeLabelCountMap[targetNodeLabel] < patternNodeLabelMap[targetNodeLabel].length) {\n candidateGraphInvalid = true;\n return;\n }\n var idx = candidateGraph.nodes.indexOf(candidateNodeMap[targetId].node);\n candidateGraph.nodes.splice(idx, 1);\n candidateNodeMap[targetId] = undefined;\n return;\n }\n // prune5: 经过边裁剪后,可能又出现了最短路径过长的节点 (比 pattern 中同 label 的节点到 beginNode 最大最短距离远),删去这些节点\n var nLabel = nodeMap[targetId].node[nodeLabelProp];\n if (!undirectedLengthsToBeginPNodeLabelMap[nLabel] || !undirectedLengthsToBeginPNodeLabelMap[nLabel].length || lengthsToCandidate[targetId] > undirectedLengthsToBeginPNodeLabelMap[nLabel][undirectedLengthsToBeginPNodeLabelMap[nLabel].length - 1]) {\n var targetNodeLabel = candidateNodeMap[targetId].node[nodeLabelProp];\n candidateNodeLabelCountMap[targetNodeLabel]--;\n if (candidateNodeLabelCountMap[targetNodeLabel] < patternNodeLabelMap[targetNodeLabel].length) {\n candidateGraphInvalid = true;\n return;\n }\n var idx = candidateGraph.nodes.indexOf(candidateNodeMap[targetId].node);\n candidateGraph.nodes.splice(idx, 1);\n candidateNodeMap[targetId] = undefined;\n }\n });\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n var degreeChanged = true;\n var loopCount = 0;\n while (degreeChanged && !candidateGraphInvalid) {\n degreeChanged = false;\n // candidate 度数不足,删去该图\n var condition = directed ? candidateNodeMap[candidate.id].degree < patternNodeMap[beginPNode.id].degree || candidateNodeMap[candidate.id].inDegree < patternNodeMap[beginPNode.id].inDegree || candidateNodeMap[candidate.id].outDegree < patternNodeMap[beginPNode.id].outDegree : candidateNodeMap[candidate.id].degree < patternNodeMap[beginPNode.id].degree;\n if (condition) {\n candidateGraphInvalid = true;\n break;\n }\n // candidate label 个数不足,删去该图\n if (candidateNodeLabelCountMap[candidate[nodeLabelProp]] < patternNodeLabelMap[candidate[nodeLabelProp]].length) {\n candidateGraphInvalid = true;\n break;\n }\n // prune6:去除度数过小的节点\n var currentCandidateNodeNum = candidateGraph.nodes.length;\n for (var o = currentCandidateNodeNum - 1; o >= 0; o--) {\n var cgNode = candidateGraph.nodes[o];\n var nodeDegree = candidateNodeMap[cgNode.id].degree;\n var nodeInDegree = candidateNodeMap[cgNode.id].inDegree;\n var nodeOutDegree = candidateNodeMap[cgNode.id].outDegree;\n var cNodeLabel = cgNode[nodeLabelProp];\n var _e = stashPatternNodeLabelDegreeMap(minPatternNodeLabelDegreeMap, cNodeLabel, patternNodeMap, patternNodeLabelMap),\n minPatternNodeLabelDegree = _e.minPatternNodeLabelDegree,\n minPatternNodeLabelInDegree = _e.minPatternNodeLabelInDegree,\n minPatternNodeLabelOutDegree = _e.minPatternNodeLabelOutDegree;\n var deleteCondition = directed ? nodeDegree < minPatternNodeLabelDegree || nodeInDegree < minPatternNodeLabelInDegree || nodeOutDegree < minPatternNodeLabelOutDegree : nodeDegree < minPatternNodeLabelDegree;\n if (deleteCondition) {\n candidateNodeLabelCountMap[cgNode[nodeLabelProp]]--;\n // 节点 label 个数不足\n if (candidateNodeLabelCountMap[cgNode[nodeLabelProp]] < patternNodeLabelMap[cgNode[nodeLabelProp]].length) {\n candidateGraphInvalid = true;\n break;\n }\n candidateGraph.nodes.splice(o, 1);\n candidateNodeMap[cgNode.id] = undefined;\n degreeChanged = true;\n }\n }\n if (candidateGraphInvalid || !degreeChanged && loopCount !== 0) break;\n // 经过 prune5 节点裁剪,删去端点已经不在 candidateGraph 中的边\n candidateEdgeNum = candidateEdges.length;\n for (var y = candidateEdgeNum - 1; y >= 0; y--) {\n var cedge = candidateEdges[y];\n if (!candidateNodeMap[cedge.source] || !candidateNodeMap[cedge.target]) {\n candidateEdges.splice(y, 1);\n var edgeLabel = cedge[edgeLabelProp];\n edgeLabelCountMap[edgeLabel]--;\n if (candidateNodeMap[cedge.source]) {\n candidateNodeMap[cedge.source].degree--;\n candidateNodeMap[cedge.source].outDegree--;\n }\n if (candidateNodeMap[cedge.target]) {\n candidateNodeMap[cedge.target].degree--;\n candidateNodeMap[cedge.target].inDegree--;\n }\n // 边 label 数量不足\n if (patternEdgeLabelMap[edgeLabel] && edgeLabelCountMap[edgeLabel] < patternEdgeLabelMap[edgeLabel].length) {\n candidateGraphInvalid = true;\n break;\n }\n degreeChanged = true;\n }\n }\n loopCount++;\n }\n if (candidateGraphInvalid) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n // prune: 若节点/边数过少,节点/边 label 过少,去掉这个图\n if (candidateGraphInvalid || candidateGraph.nodes.length < pattern.nodes.length || candidateEdges.length < pattern.edges.length) {\n candidateGraphs.splice(i, 1);\n return \"continue\";\n }\n };\n for (var i = candidateGraphNum - 1; i >= 0; i--) {\n var state_1 = _loop_2(i);\n if (state_1 === \"break\") break;\n }\n // 此时已经生成的多个 candidateGraphs,可能有重复\n // console.log(\n // \"----- stage5: going to splice dulplicated candidate graphs -------\"\n // );\n // 删去 candidateGraphs 中一模一样的子图,通过边的 node-node-edgeLabel 作为 key,这类边个数作为 value,进行匹配\n var currentLength = candidateGraphs.length;\n var _loop_3 = function _loop_3(i) {\n var cg1 = candidateGraphs[i];\n var cg1EdgeMap = {}; // [node1.id-node2.id-edge.label]: count\n cg1.edges.forEach(function (edge) {\n var key = \"\".concat(edge.source, \"-\").concat(edge.target, \"-\").concat(edge.label);\n if (!cg1EdgeMap[key]) cg1EdgeMap[key] = 1;else cg1EdgeMap[key]++;\n });\n var _loop_6 = function _loop_6(j) {\n var cg2 = candidateGraphs[j];\n var cg2EdgeMap = {}; // [node1.id-node2.id-edge.label]: count\n cg2.edges.forEach(function (edge) {\n var key = \"\".concat(edge.source, \"-\").concat(edge.target, \"-\").concat(edge.label);\n if (!cg2EdgeMap[key]) cg2EdgeMap[key] = 1;else cg2EdgeMap[key]++;\n });\n var same = true;\n if (Object.keys(cg2EdgeMap).length !== Object.keys(cg1EdgeMap).length) {\n same = false;\n } else {\n Object.keys(cg1EdgeMap).forEach(function (key) {\n if (cg2EdgeMap[key] !== cg1EdgeMap[key]) same = false;\n });\n }\n if (same) {\n candidateGraphs.splice(j, 1);\n }\n };\n for (var j = currentLength - 1; j > i; j--) {\n _loop_6(j);\n }\n currentLength = candidateGraphs.length;\n };\n for (var i = 0; i <= currentLength - 1; i++) {\n _loop_3(i);\n }\n return candidateGraphs;\n};\nvar _default = GADDI;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/gaddi.js?"); /***/ }), @@ -584,7 +584,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _adjacentMatrix = _interopRequireDefault(__webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/lib/adjacent-matrix.js\"));\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * 标签传播算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param maxIteration 最大迭代次数\n */\nvar labelPropagation = function labelPropagation(graphData, directed, weightPropertyName, maxIteration) {\n if (directed === void 0) {\n directed = false;\n }\n\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n\n if (maxIteration === void 0) {\n maxIteration = 1000;\n } // the origin data\n\n\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var clusters = {};\n var nodeMap = {}; // init the clusters and nodeMap\n\n nodes.forEach(function (node, i) {\n var cid = (0, _util.uniqueId)();\n node.clusterId = cid;\n clusters[cid] = {\n id: cid,\n nodes: [node]\n };\n nodeMap[node.id] = {\n node: node,\n idx: i\n };\n }); // the adjacent matrix of calNodes inside clusters\n\n var adjMatrix = (0, _adjacentMatrix.default)(graphData, directed); // the sum of each row in adjacent matrix\n\n var ks = [];\n /**\n * neighbor nodes (id for key and weight for value) for each node\n * neighbors = {\n * id(node_id): { id(neighbor_1_id): weight(weight of the edge), id(neighbor_2_id): weight(weight of the edge), ... },\n * ...\n * }\n */\n\n var neighbors = {};\n adjMatrix.forEach(function (row, i) {\n var k = 0;\n var iid = nodes[i].id;\n neighbors[iid] = {};\n row.forEach(function (entry, j) {\n if (!entry) return;\n k += entry;\n var jid = nodes[j].id;\n neighbors[iid][jid] = entry;\n });\n ks.push(k);\n });\n var iter = 0;\n\n var _loop_1 = function _loop_1() {\n var changed = false;\n nodes.forEach(function (node) {\n var neighborClusters = {};\n Object.keys(neighbors[node.id]).forEach(function (neighborId) {\n var neighborWeight = neighbors[node.id][neighborId];\n var neighborNode = nodeMap[neighborId].node;\n var neighborClusterId = neighborNode.clusterId;\n if (!neighborClusters[neighborClusterId]) neighborClusters[neighborClusterId] = 0;\n neighborClusters[neighborClusterId] += neighborWeight;\n }); // find the cluster with max weight\n\n var maxWeight = -Infinity;\n var bestClusterIds = [];\n Object.keys(neighborClusters).forEach(function (clusterId) {\n if (maxWeight < neighborClusters[clusterId]) {\n maxWeight = neighborClusters[clusterId];\n bestClusterIds = [clusterId];\n } else if (maxWeight === neighborClusters[clusterId]) {\n bestClusterIds.push(clusterId);\n }\n });\n if (bestClusterIds.length === 1 && bestClusterIds[0] === node.clusterId) return;\n var selfClusterIdx = bestClusterIds.indexOf(node.clusterId);\n if (selfClusterIdx >= 0) bestClusterIds.splice(selfClusterIdx, 1);\n\n if (bestClusterIds && bestClusterIds.length) {\n changed = true; // remove from origin cluster\n\n var selfCluster = clusters[node.clusterId];\n var nodeInSelfClusterIdx = selfCluster.nodes.indexOf(node);\n selfCluster.nodes.splice(nodeInSelfClusterIdx, 1); // move the node to the best cluster\n\n var randomIdx = Math.floor(Math.random() * bestClusterIds.length);\n var bestCluster = clusters[bestClusterIds[randomIdx]];\n bestCluster.nodes.push(node);\n node.clusterId = bestCluster.id;\n }\n });\n if (!changed) return \"break\";\n iter++;\n };\n\n while (iter < maxIteration) {\n var state_1 = _loop_1();\n\n if (state_1 === \"break\") break;\n } // delete the empty clusters\n\n\n Object.keys(clusters).forEach(function (clusterId) {\n var cluster = clusters[clusterId];\n\n if (!cluster.nodes || !cluster.nodes.length) {\n delete clusters[clusterId];\n }\n }); // get the cluster edges\n\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var weight = edge[weightPropertyName] || 1;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].weight += weight;\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n weight: weight,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n var clustersArray = [];\n Object.keys(clusters).forEach(function (clusterId) {\n clustersArray.push(clusters[clusterId]);\n });\n return {\n clusters: clustersArray,\n clusterEdges: clusterEdges\n };\n};\n\nvar _default = labelPropagation;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/label-propagation.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _adjacentMatrix = _interopRequireDefault(__webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/lib/adjacent-matrix.js\"));\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * 标签传播算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param maxIteration 最大迭代次数\n */\nvar labelPropagation = function labelPropagation(graphData, directed, weightPropertyName, maxIteration) {\n if (directed === void 0) {\n directed = false;\n }\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n if (maxIteration === void 0) {\n maxIteration = 1000;\n }\n // the origin data\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var clusters = {};\n var nodeMap = {};\n // init the clusters and nodeMap\n nodes.forEach(function (node, i) {\n var cid = (0, _util.uniqueId)();\n node.clusterId = cid;\n clusters[cid] = {\n id: cid,\n nodes: [node]\n };\n nodeMap[node.id] = {\n node: node,\n idx: i\n };\n });\n // the adjacent matrix of calNodes inside clusters\n var adjMatrix = (0, _adjacentMatrix.default)(graphData, directed);\n // the sum of each row in adjacent matrix\n var ks = [];\n /**\n * neighbor nodes (id for key and weight for value) for each node\n * neighbors = {\n * id(node_id): { id(neighbor_1_id): weight(weight of the edge), id(neighbor_2_id): weight(weight of the edge), ... },\n * ...\n * }\n */\n var neighbors = {};\n adjMatrix.forEach(function (row, i) {\n var k = 0;\n var iid = nodes[i].id;\n neighbors[iid] = {};\n row.forEach(function (entry, j) {\n if (!entry) return;\n k += entry;\n var jid = nodes[j].id;\n neighbors[iid][jid] = entry;\n });\n ks.push(k);\n });\n var iter = 0;\n var _loop_1 = function _loop_1() {\n var changed = false;\n nodes.forEach(function (node) {\n var neighborClusters = {};\n Object.keys(neighbors[node.id]).forEach(function (neighborId) {\n var neighborWeight = neighbors[node.id][neighborId];\n var neighborNode = nodeMap[neighborId].node;\n var neighborClusterId = neighborNode.clusterId;\n if (!neighborClusters[neighborClusterId]) neighborClusters[neighborClusterId] = 0;\n neighborClusters[neighborClusterId] += neighborWeight;\n });\n // find the cluster with max weight\n var maxWeight = -Infinity;\n var bestClusterIds = [];\n Object.keys(neighborClusters).forEach(function (clusterId) {\n if (maxWeight < neighborClusters[clusterId]) {\n maxWeight = neighborClusters[clusterId];\n bestClusterIds = [clusterId];\n } else if (maxWeight === neighborClusters[clusterId]) {\n bestClusterIds.push(clusterId);\n }\n });\n if (bestClusterIds.length === 1 && bestClusterIds[0] === node.clusterId) return;\n var selfClusterIdx = bestClusterIds.indexOf(node.clusterId);\n if (selfClusterIdx >= 0) bestClusterIds.splice(selfClusterIdx, 1);\n if (bestClusterIds && bestClusterIds.length) {\n changed = true;\n // remove from origin cluster\n var selfCluster = clusters[node.clusterId];\n var nodeInSelfClusterIdx = selfCluster.nodes.indexOf(node);\n selfCluster.nodes.splice(nodeInSelfClusterIdx, 1);\n // move the node to the best cluster\n var randomIdx = Math.floor(Math.random() * bestClusterIds.length);\n var bestCluster = clusters[bestClusterIds[randomIdx]];\n bestCluster.nodes.push(node);\n node.clusterId = bestCluster.id;\n }\n });\n if (!changed) return \"break\";\n iter++;\n };\n while (iter < maxIteration) {\n var state_1 = _loop_1();\n if (state_1 === \"break\") break;\n }\n // delete the empty clusters\n Object.keys(clusters).forEach(function (clusterId) {\n var cluster = clusters[clusterId];\n if (!cluster.nodes || !cluster.nodes.length) {\n delete clusters[clusterId];\n }\n });\n // get the cluster edges\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var weight = edge[weightPropertyName] || 1;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].weight += weight;\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n weight: weight,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n var clustersArray = [];\n Object.keys(clusters).forEach(function (clusterId) {\n clustersArray.push(clusters[clusterId]);\n });\n return {\n clusters: clustersArray,\n clusterEdges: clusterEdges\n };\n};\nvar _default = labelPropagation;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/label-propagation.js?"); /***/ }), @@ -596,7 +596,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _adjacentMatrix = _interopRequireDefault(__webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/lib/adjacent-matrix.js\"));\n\nvar _vector = _interopRequireDefault(__webpack_require__(/*! ./utils/vector */ \"./node_modules/@antv/algorithm/lib/utils/vector.js\"));\n\nvar _nodeProperties = __webpack_require__(/*! ./utils/node-properties */ \"./node_modules/@antv/algorithm/lib/utils/node-properties.js\");\n\nvar _dataPreprocessing = __webpack_require__(/*! ./utils/data-preprocessing */ \"./node_modules/@antv/algorithm/lib/utils/data-preprocessing.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar getModularity = function getModularity(nodes, adjMatrix, ks, m) {\n var length = adjMatrix.length;\n var param = 2 * m;\n var modularity = 0;\n\n for (var i = 0; i < length; i++) {\n var clusteri = nodes[i].clusterId;\n\n for (var j = 0; j < length; j++) {\n var clusterj = nodes[j].clusterId;\n if (clusteri !== clusterj) continue;\n var entry = adjMatrix[i][j] || 0;\n var ki = ks[i] || 0;\n var kj = ks[j] || 0;\n modularity += entry - ki * kj / param;\n }\n }\n\n modularity *= 1 / param;\n return modularity;\n}; // 模块惯性度,衡量属性相似度\n\n\nvar getInertialModularity = function getInertialModularity(nodes, allPropertiesWeight) {\n if (nodes === void 0) {\n nodes = [];\n }\n\n var length = nodes.length;\n var totalProperties = new _vector.default([]);\n\n for (var i = 0; i < length; i++) {\n totalProperties = totalProperties.add(new _vector.default(allPropertiesWeight[i]));\n } // 均值向量\n\n\n var avgProperties = totalProperties.avg(length);\n avgProperties.normalize(); // 节点集合的方差: 节点v与均值向量的平方欧式距离之和\n\n var variance = 0;\n\n for (var i = 0; i < length; i++) {\n var propertiesi = new _vector.default(allPropertiesWeight[i]);\n var squareEuclideanDistance = propertiesi.squareEuclideanDistance(avgProperties);\n variance += squareEuclideanDistance;\n } // 任意两点间的欧式平方距离\n\n\n var squareEuclideanDistanceInfo = [];\n nodes.forEach(function () {\n squareEuclideanDistanceInfo.push([]);\n });\n\n for (var i = 0; i < length; i++) {\n var propertiesi = new _vector.default(allPropertiesWeight[i]);\n nodes[i]['clusterInertial'] = 0;\n\n for (var j = 0; j < length; j++) {\n if (i === j) {\n squareEuclideanDistanceInfo[i][j] = 0;\n continue;\n }\n\n var propertiesj = new _vector.default(allPropertiesWeight[j]);\n squareEuclideanDistanceInfo[i][j] = propertiesi.squareEuclideanDistance(propertiesj);\n nodes[i]['clusterInertial'] += squareEuclideanDistanceInfo[i][j];\n }\n } // 计算模块惯性度\n\n\n var inertialModularity = 0;\n var param = 2 * length * variance;\n\n for (var i = 0; i < length; i++) {\n var clusteri = nodes[i].clusterId;\n\n for (var j = 0; j < length; j++) {\n var clusterj = nodes[j].clusterId;\n if (i === j || clusteri !== clusterj) continue;\n var inertial = nodes[i].clusterInertial * nodes[j].clusterInertial / Math.pow(param, 2) - squareEuclideanDistanceInfo[i][j] / param;\n inertialModularity += inertial;\n }\n }\n\n return Number(inertialModularity.toFixed(4));\n};\n/**\n * 社区发现 louvain 算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param threshold 差值阈值\n * @param inertialModularity 是否使用惯性模块度(即节点属性相似性)\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n * @param inertialWeight 惯性模块度权重\n */\n\n\nvar louvain = function louvain(graphData, directed, weightPropertyName, threshold, inertialModularity, propertyKey, involvedKeys, uninvolvedKeys, inertialWeight) {\n if (directed === void 0) {\n directed = false;\n }\n\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n\n if (threshold === void 0) {\n threshold = 0.0001;\n }\n\n if (inertialModularity === void 0) {\n inertialModularity = false;\n }\n\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = ['id'];\n }\n\n if (inertialWeight === void 0) {\n inertialWeight = 1;\n } // the origin data\n\n\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var allPropertiesWeight = [];\n\n if (inertialModularity) {\n nodes.forEach(function (node, index) {\n node.properties = node.properties || {};\n node.originIndex = index;\n });\n var nodeTypeInfo_1 = [];\n\n if (nodes.every(function (node) {\n return node.hasOwnProperty('nodeType');\n })) {\n nodeTypeInfo_1 = Array.from(new Set(nodes.map(function (node) {\n return node.nodeType;\n })));\n nodes.forEach(function (node) {\n node.properties.nodeType = nodeTypeInfo_1.findIndex(function (nodeType) {\n return nodeType === node.nodeType;\n });\n });\n } // 所有节点属性集合\n\n\n var properties = (0, _nodeProperties.getAllProperties)(nodes, propertyKey); // 所有节点属性one-hot特征向量集合\n\n allPropertiesWeight = (0, _dataPreprocessing.oneHot)(properties, involvedKeys, uninvolvedKeys);\n }\n\n var uniqueId = 1;\n var clusters = {};\n var nodeMap = {}; // init the clusters and nodeMap\n\n nodes.forEach(function (node, i) {\n var cid = String(uniqueId++);\n node.clusterId = cid;\n clusters[cid] = {\n id: cid,\n nodes: [node]\n };\n nodeMap[node.id] = {\n node: node,\n idx: i\n };\n }); // the adjacent matrix of calNodes inside clusters\n\n var adjMatrix = (0, _adjacentMatrix.default)(graphData, directed); // the sum of each row in adjacent matrix\n\n var ks = [];\n /**\n * neighbor nodes (id for key and weight for value) for each node\n * neighbors = {\n * id(node_id): { id(neighbor_1_id): weight(weight of the edge), id(neighbor_2_id): weight(weight of the edge), ... },\n * ...\n * }\n */\n\n var neighbors = {}; // the sum of the weights of all edges in the graph\n\n var m = 0;\n adjMatrix.forEach(function (row, i) {\n var k = 0;\n var iid = nodes[i].id;\n neighbors[iid] = {};\n row.forEach(function (entry, j) {\n if (!entry) return;\n k += entry;\n var jid = nodes[j].id;\n neighbors[iid][jid] = entry;\n m += entry;\n });\n ks.push(k);\n });\n m /= 2;\n var totalModularity = Infinity;\n var previousModularity = Infinity;\n var iter = 0;\n var finalNodes = [];\n var finalClusters = {};\n\n while (true) {\n if (inertialModularity && nodes.every(function (node) {\n return node.hasOwnProperty('properties');\n })) {\n totalModularity = getModularity(nodes, adjMatrix, ks, m) + getInertialModularity(nodes, allPropertiesWeight) * inertialWeight;\n } else {\n totalModularity = getModularity(nodes, adjMatrix, ks, m);\n } // 第一次迭代previousModularity直接赋值\n\n\n if (iter === 0) {\n previousModularity = totalModularity;\n finalNodes = nodes;\n finalClusters = clusters;\n }\n\n var increaseWithinThreshold = totalModularity > 0 && totalModularity > previousModularity && totalModularity - previousModularity < threshold; // 总模块度增加才更新最优解\n\n if (totalModularity > previousModularity) {\n finalNodes = nodes.map(function (node) {\n return {\n node: node,\n clusterId: node.clusterId\n };\n });\n finalClusters = (0, _util.clone)(clusters);\n previousModularity = totalModularity;\n } // whether to terminate the iterations\n\n\n if (increaseWithinThreshold || iter > 100) {\n break;\n }\n\n ;\n iter++; // pre compute some values for current clusters\n\n Object.keys(clusters).forEach(function (clusterId) {\n // sum of weights of edges to nodes in cluster\n var sumTot = 0;\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n\n if (sourceClusterId === clusterId && targetClusterId !== clusterId || targetClusterId === clusterId && sourceClusterId !== clusterId) {\n sumTot = sumTot + (edge[weightPropertyName] || 1);\n }\n });\n clusters[clusterId].sumTot = sumTot;\n }); // move the nodes to increase the delta modularity\n\n nodes.forEach(function (node, i) {\n var selfCluster = clusters[node.clusterId];\n var bestIncrease = 0;\n var bestCluster;\n var commonParam = ks[i] / (2 * m); // sum of weights of edges from node to nodes in cluster\n\n var kiin = 0;\n var selfClusterNodes = selfCluster.nodes;\n selfClusterNodes.forEach(function (scNode) {\n var scNodeIdx = nodeMap[scNode.id].idx;\n kiin += adjMatrix[i][scNodeIdx] || 0;\n }); // the modurarity for **removing** the node i from the origin cluster of node i\n\n var removeModurarity = kiin - selfCluster.sumTot * commonParam; // nodes for **removing** node i into this neighbor cluster\n\n var selfClusterNodesAfterRemove = selfClusterNodes.filter(function (scNode) {\n return scNode.id !== node.id;\n });\n var propertiesWeightRemove = [];\n selfClusterNodesAfterRemove.forEach(function (nodeRemove, index) {\n propertiesWeightRemove[index] = allPropertiesWeight[nodeRemove.originIndex];\n }); // the inertialModularity for **removing** the node i from the origin cluster of node i\n\n var removeInertialModularity = getInertialModularity(selfClusterNodesAfterRemove, allPropertiesWeight) * inertialWeight; // the neightbors of the node\n\n var nodeNeighborIds = neighbors[node.id];\n Object.keys(nodeNeighborIds).forEach(function (neighborNodeId) {\n var neighborNode = nodeMap[neighborNodeId].node;\n var neighborClusterId = neighborNode.clusterId; // if the node and the neighbor of node are in the same cluster, reutrn\n\n if (neighborClusterId === node.clusterId) return;\n var neighborCluster = clusters[neighborClusterId];\n var clusterNodes = neighborCluster.nodes; // if the cluster is empty, remove the cluster and return\n\n if (!clusterNodes || !clusterNodes.length) return; // sum of weights of edges from node to nodes in cluster\n\n var neighborClusterKiin = 0;\n clusterNodes.forEach(function (cNode) {\n var cNodeIdx = nodeMap[cNode.id].idx;\n neighborClusterKiin += adjMatrix[i][cNodeIdx] || 0;\n }); // the modurarity for **adding** node i into this neighbor cluster\n\n var addModurarity = neighborClusterKiin - neighborCluster.sumTot * commonParam; // nodes for **adding** node i into this neighbor cluster\n\n var clusterNodesAfterAdd = clusterNodes.concat([node]);\n var propertiesWeightAdd = [];\n clusterNodesAfterAdd.forEach(function (nodeAdd, index) {\n propertiesWeightAdd[index] = allPropertiesWeight[nodeAdd.originIndex];\n }); // the inertialModularity for **adding** node i into this neighbor cluster\n\n var addInertialModularity = getInertialModularity(clusterNodesAfterAdd, allPropertiesWeight) * inertialWeight; // the increase modurarity is the difference between addModurarity and removeModurarity\n\n var increase = addModurarity - removeModurarity;\n\n if (inertialModularity) {\n increase = addModurarity + addInertialModularity - (removeModurarity + removeInertialModularity);\n } // find the best cluster to move node i into\n\n\n if (increase > bestIncrease) {\n bestIncrease = increase;\n bestCluster = neighborCluster;\n }\n }); // if found a best cluster to move into\n\n if (bestIncrease > 0) {\n bestCluster.nodes.push(node);\n var previousClusterId_1 = node.clusterId;\n node.clusterId = bestCluster.id; // move the node to the best cluster\n\n var nodeInSelfClusterIdx = selfCluster.nodes.indexOf(node); // remove from origin cluster\n\n selfCluster.nodes.splice(nodeInSelfClusterIdx, 1); // update sumTot for clusters\n // sum of weights of edges to nodes in cluster\n\n var neighborClusterSumTot_1 = 0;\n var selfClusterSumTot_1 = 0;\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n\n if (sourceClusterId === bestCluster.id && targetClusterId !== bestCluster.id || targetClusterId === bestCluster.id && sourceClusterId !== bestCluster.id) {\n neighborClusterSumTot_1 = neighborClusterSumTot_1 + (edge[weightPropertyName] || 1);\n }\n\n if (sourceClusterId === previousClusterId_1 && targetClusterId !== previousClusterId_1 || targetClusterId === previousClusterId_1 && sourceClusterId !== previousClusterId_1) {\n selfClusterSumTot_1 = selfClusterSumTot_1 + (edge[weightPropertyName] || 1);\n }\n }); // the nodes of the clusters to move into and remove are changed, update their sumTot\n\n bestCluster.sumTot = neighborClusterSumTot_1;\n selfCluster.sumTot = selfClusterSumTot_1;\n }\n });\n } // delete the empty clusters, assign increasing clusterId\n\n\n var newClusterIdMap = {};\n var clusterIdx = 0;\n Object.keys(finalClusters).forEach(function (clusterId) {\n var cluster = finalClusters[clusterId];\n\n if (!cluster.nodes || !cluster.nodes.length) {\n delete finalClusters[clusterId];\n return;\n }\n\n var newId = String(clusterIdx + 1);\n\n if (newId === clusterId) {\n return;\n }\n\n cluster.id = newId;\n cluster.nodes = cluster.nodes.map(function (item) {\n return {\n id: item.id,\n clusterId: newId\n };\n });\n finalClusters[newId] = cluster;\n newClusterIdMap[clusterId] = newId;\n delete finalClusters[clusterId];\n clusterIdx++;\n }); // restore node clusterId\n\n finalNodes.forEach(function (nodeInfo) {\n var node = nodeInfo.node,\n clusterId = nodeInfo.clusterId;\n if (!node) return;\n node.clusterId = clusterId;\n if (node.clusterId && newClusterIdMap[node.clusterId]) node.clusterId = newClusterIdMap[node.clusterId];\n }); // get the cluster edges\n\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var weight = edge[weightPropertyName] || 1;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n if (!sourceClusterId || !targetClusterId) return;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].weight += weight;\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n weight: weight,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n var clustersArray = [];\n Object.keys(finalClusters).forEach(function (clusterId) {\n clustersArray.push(finalClusters[clusterId]);\n });\n return {\n clusters: clustersArray,\n clusterEdges: clusterEdges\n };\n};\n\nvar _default = louvain;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/louvain.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _adjacentMatrix = _interopRequireDefault(__webpack_require__(/*! ./adjacent-matrix */ \"./node_modules/@antv/algorithm/lib/adjacent-matrix.js\"));\nvar _vector = _interopRequireDefault(__webpack_require__(/*! ./utils/vector */ \"./node_modules/@antv/algorithm/lib/utils/vector.js\"));\nvar _nodeProperties = __webpack_require__(/*! ./utils/node-properties */ \"./node_modules/@antv/algorithm/lib/utils/node-properties.js\");\nvar _dataPreprocessing = __webpack_require__(/*! ./utils/data-preprocessing */ \"./node_modules/@antv/algorithm/lib/utils/data-preprocessing.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar getModularity = function getModularity(nodes, adjMatrix, ks, m) {\n var length = adjMatrix.length;\n var param = 2 * m;\n var modularity = 0;\n for (var i = 0; i < length; i++) {\n var clusteri = nodes[i].clusterId;\n for (var j = 0; j < length; j++) {\n var clusterj = nodes[j].clusterId;\n if (clusteri !== clusterj) continue;\n var entry = adjMatrix[i][j] || 0;\n var ki = ks[i] || 0;\n var kj = ks[j] || 0;\n modularity += entry - ki * kj / param;\n }\n }\n modularity *= 1 / param;\n return modularity;\n};\n// 模块惯性度,衡量属性相似度\nvar getInertialModularity = function getInertialModularity(nodes, allPropertiesWeight) {\n if (nodes === void 0) {\n nodes = [];\n }\n var length = nodes.length;\n var totalProperties = new _vector.default([]);\n for (var i = 0; i < length; i++) {\n totalProperties = totalProperties.add(new _vector.default(allPropertiesWeight[i]));\n }\n // 均值向量\n var avgProperties = totalProperties.avg(length);\n avgProperties.normalize();\n // 节点集合的方差: 节点v与均值向量的平方欧式距离之和\n var variance = 0;\n for (var i = 0; i < length; i++) {\n var propertiesi = new _vector.default(allPropertiesWeight[i]);\n var squareEuclideanDistance = propertiesi.squareEuclideanDistance(avgProperties);\n variance += squareEuclideanDistance;\n }\n // 任意两点间的欧式平方距离\n var squareEuclideanDistanceInfo = [];\n nodes.forEach(function () {\n squareEuclideanDistanceInfo.push([]);\n });\n for (var i = 0; i < length; i++) {\n var propertiesi = new _vector.default(allPropertiesWeight[i]);\n nodes[i]['clusterInertial'] = 0;\n for (var j = 0; j < length; j++) {\n if (i === j) {\n squareEuclideanDistanceInfo[i][j] = 0;\n continue;\n }\n var propertiesj = new _vector.default(allPropertiesWeight[j]);\n squareEuclideanDistanceInfo[i][j] = propertiesi.squareEuclideanDistance(propertiesj);\n nodes[i]['clusterInertial'] += squareEuclideanDistanceInfo[i][j];\n }\n }\n // 计算模块惯性度\n var inertialModularity = 0;\n var param = 2 * length * variance;\n for (var i = 0; i < length; i++) {\n var clusteri = nodes[i].clusterId;\n for (var j = 0; j < length; j++) {\n var clusterj = nodes[j].clusterId;\n if (i === j || clusteri !== clusterj) continue;\n var inertial = nodes[i].clusterInertial * nodes[j].clusterInertial / Math.pow(param, 2) - squareEuclideanDistanceInfo[i][j] / param;\n inertialModularity += inertial;\n }\n }\n return Number(inertialModularity.toFixed(4));\n};\n/**\n * 社区发现 louvain 算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param threshold 差值阈值\n * @param inertialModularity 是否使用惯性模块度(即节点属性相似性)\n * @param propertyKey 属性的字段名\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n * @param inertialWeight 惯性模块度权重\n */\nvar louvain = function louvain(graphData, directed, weightPropertyName, threshold, inertialModularity, propertyKey, involvedKeys, uninvolvedKeys, inertialWeight) {\n if (directed === void 0) {\n directed = false;\n }\n if (weightPropertyName === void 0) {\n weightPropertyName = 'weight';\n }\n if (threshold === void 0) {\n threshold = 0.0001;\n }\n if (inertialModularity === void 0) {\n inertialModularity = false;\n }\n if (propertyKey === void 0) {\n propertyKey = undefined;\n }\n if (involvedKeys === void 0) {\n involvedKeys = [];\n }\n if (uninvolvedKeys === void 0) {\n uninvolvedKeys = ['id'];\n }\n if (inertialWeight === void 0) {\n inertialWeight = 1;\n }\n // the origin data\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var allPropertiesWeight = [];\n if (inertialModularity) {\n nodes.forEach(function (node, index) {\n node.properties = node.properties || {};\n node.originIndex = index;\n });\n var nodeTypeInfo_1 = [];\n if (nodes.every(function (node) {\n return node.hasOwnProperty('nodeType');\n })) {\n nodeTypeInfo_1 = Array.from(new Set(nodes.map(function (node) {\n return node.nodeType;\n })));\n nodes.forEach(function (node) {\n node.properties.nodeType = nodeTypeInfo_1.findIndex(function (nodeType) {\n return nodeType === node.nodeType;\n });\n });\n }\n // 所有节点属性集合\n var properties = (0, _nodeProperties.getAllProperties)(nodes, propertyKey);\n // 所有节点属性one-hot特征向量集合\n allPropertiesWeight = (0, _dataPreprocessing.oneHot)(properties, involvedKeys, uninvolvedKeys);\n }\n var uniqueId = 1;\n var clusters = {};\n var nodeMap = {};\n // init the clusters and nodeMap\n nodes.forEach(function (node, i) {\n var cid = String(uniqueId++);\n node.clusterId = cid;\n clusters[cid] = {\n id: cid,\n nodes: [node]\n };\n nodeMap[node.id] = {\n node: node,\n idx: i\n };\n });\n // the adjacent matrix of calNodes inside clusters\n var adjMatrix = (0, _adjacentMatrix.default)(graphData, directed);\n // the sum of each row in adjacent matrix\n var ks = [];\n /**\n * neighbor nodes (id for key and weight for value) for each node\n * neighbors = {\n * id(node_id): { id(neighbor_1_id): weight(weight of the edge), id(neighbor_2_id): weight(weight of the edge), ... },\n * ...\n * }\n */\n var neighbors = {};\n // the sum of the weights of all edges in the graph\n var m = 0;\n adjMatrix.forEach(function (row, i) {\n var k = 0;\n var iid = nodes[i].id;\n neighbors[iid] = {};\n row.forEach(function (entry, j) {\n if (!entry) return;\n k += entry;\n var jid = nodes[j].id;\n neighbors[iid][jid] = entry;\n m += entry;\n });\n ks.push(k);\n });\n m /= 2;\n var totalModularity = Infinity;\n var previousModularity = Infinity;\n var iter = 0;\n var finalNodes = [];\n var finalClusters = {};\n while (true) {\n if (inertialModularity && nodes.every(function (node) {\n return node.hasOwnProperty('properties');\n })) {\n totalModularity = getModularity(nodes, adjMatrix, ks, m) + getInertialModularity(nodes, allPropertiesWeight) * inertialWeight;\n } else {\n totalModularity = getModularity(nodes, adjMatrix, ks, m);\n }\n // 第一次迭代previousModularity直接赋值\n if (iter === 0) {\n previousModularity = totalModularity;\n finalNodes = nodes;\n finalClusters = clusters;\n }\n var increaseWithinThreshold = totalModularity > 0 && totalModularity > previousModularity && totalModularity - previousModularity < threshold;\n // 总模块度增加才更新最优解\n if (totalModularity > previousModularity) {\n finalNodes = nodes.map(function (node) {\n return {\n node: node,\n clusterId: node.clusterId\n };\n });\n finalClusters = (0, _util.clone)(clusters);\n previousModularity = totalModularity;\n }\n // whether to terminate the iterations\n if (increaseWithinThreshold || iter > 100) {\n break;\n }\n ;\n iter++;\n // pre compute some values for current clusters\n Object.keys(clusters).forEach(function (clusterId) {\n // sum of weights of edges to nodes in cluster\n var sumTot = 0;\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n if (sourceClusterId === clusterId && targetClusterId !== clusterId || targetClusterId === clusterId && sourceClusterId !== clusterId) {\n sumTot = sumTot + (edge[weightPropertyName] || 1);\n }\n });\n clusters[clusterId].sumTot = sumTot;\n });\n // move the nodes to increase the delta modularity\n nodes.forEach(function (node, i) {\n var selfCluster = clusters[node.clusterId];\n var bestIncrease = 0;\n var bestCluster;\n var commonParam = ks[i] / (2 * m);\n // sum of weights of edges from node to nodes in cluster\n var kiin = 0;\n var selfClusterNodes = selfCluster.nodes;\n selfClusterNodes.forEach(function (scNode) {\n var scNodeIdx = nodeMap[scNode.id].idx;\n kiin += adjMatrix[i][scNodeIdx] || 0;\n });\n // the modurarity for **removing** the node i from the origin cluster of node i\n var removeModurarity = kiin - selfCluster.sumTot * commonParam;\n // nodes for **removing** node i into this neighbor cluster\n var selfClusterNodesAfterRemove = selfClusterNodes.filter(function (scNode) {\n return scNode.id !== node.id;\n });\n var propertiesWeightRemove = [];\n selfClusterNodesAfterRemove.forEach(function (nodeRemove, index) {\n propertiesWeightRemove[index] = allPropertiesWeight[nodeRemove.originIndex];\n });\n // the inertialModularity for **removing** the node i from the origin cluster of node i\n var removeInertialModularity = getInertialModularity(selfClusterNodesAfterRemove, allPropertiesWeight) * inertialWeight;\n // the neightbors of the node\n var nodeNeighborIds = neighbors[node.id];\n Object.keys(nodeNeighborIds).forEach(function (neighborNodeId) {\n var neighborNode = nodeMap[neighborNodeId].node;\n var neighborClusterId = neighborNode.clusterId;\n // if the node and the neighbor of node are in the same cluster, reutrn\n if (neighborClusterId === node.clusterId) return;\n var neighborCluster = clusters[neighborClusterId];\n var clusterNodes = neighborCluster.nodes;\n // if the cluster is empty, remove the cluster and return\n if (!clusterNodes || !clusterNodes.length) return;\n // sum of weights of edges from node to nodes in cluster\n var neighborClusterKiin = 0;\n clusterNodes.forEach(function (cNode) {\n var cNodeIdx = nodeMap[cNode.id].idx;\n neighborClusterKiin += adjMatrix[i][cNodeIdx] || 0;\n });\n // the modurarity for **adding** node i into this neighbor cluster\n var addModurarity = neighborClusterKiin - neighborCluster.sumTot * commonParam;\n // nodes for **adding** node i into this neighbor cluster\n var clusterNodesAfterAdd = clusterNodes.concat([node]);\n var propertiesWeightAdd = [];\n clusterNodesAfterAdd.forEach(function (nodeAdd, index) {\n propertiesWeightAdd[index] = allPropertiesWeight[nodeAdd.originIndex];\n });\n // the inertialModularity for **adding** node i into this neighbor cluster\n var addInertialModularity = getInertialModularity(clusterNodesAfterAdd, allPropertiesWeight) * inertialWeight;\n // the increase modurarity is the difference between addModurarity and removeModurarity\n var increase = addModurarity - removeModurarity;\n if (inertialModularity) {\n increase = addModurarity + addInertialModularity - (removeModurarity + removeInertialModularity);\n }\n // find the best cluster to move node i into\n if (increase > bestIncrease) {\n bestIncrease = increase;\n bestCluster = neighborCluster;\n }\n });\n // if found a best cluster to move into\n if (bestIncrease > 0) {\n bestCluster.nodes.push(node);\n var previousClusterId_1 = node.clusterId;\n node.clusterId = bestCluster.id;\n // move the node to the best cluster\n var nodeInSelfClusterIdx = selfCluster.nodes.indexOf(node);\n // remove from origin cluster\n selfCluster.nodes.splice(nodeInSelfClusterIdx, 1);\n // update sumTot for clusters\n // sum of weights of edges to nodes in cluster\n var neighborClusterSumTot_1 = 0;\n var selfClusterSumTot_1 = 0;\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n if (sourceClusterId === bestCluster.id && targetClusterId !== bestCluster.id || targetClusterId === bestCluster.id && sourceClusterId !== bestCluster.id) {\n neighborClusterSumTot_1 = neighborClusterSumTot_1 + (edge[weightPropertyName] || 1);\n }\n if (sourceClusterId === previousClusterId_1 && targetClusterId !== previousClusterId_1 || targetClusterId === previousClusterId_1 && sourceClusterId !== previousClusterId_1) {\n selfClusterSumTot_1 = selfClusterSumTot_1 + (edge[weightPropertyName] || 1);\n }\n });\n // the nodes of the clusters to move into and remove are changed, update their sumTot\n bestCluster.sumTot = neighborClusterSumTot_1;\n selfCluster.sumTot = selfClusterSumTot_1;\n }\n });\n }\n // delete the empty clusters, assign increasing clusterId\n var newClusterIdMap = {};\n var clusterIdx = 0;\n Object.keys(finalClusters).forEach(function (clusterId) {\n var cluster = finalClusters[clusterId];\n if (!cluster.nodes || !cluster.nodes.length) {\n delete finalClusters[clusterId];\n return;\n }\n var newId = String(clusterIdx + 1);\n if (newId === clusterId) {\n return;\n }\n cluster.id = newId;\n cluster.nodes = cluster.nodes.map(function (item) {\n return {\n id: item.id,\n clusterId: newId\n };\n });\n finalClusters[newId] = cluster;\n newClusterIdMap[clusterId] = newId;\n delete finalClusters[clusterId];\n clusterIdx++;\n });\n // restore node clusterId\n finalNodes.forEach(function (nodeInfo) {\n var node = nodeInfo.node,\n clusterId = nodeInfo.clusterId;\n if (!node) return;\n node.clusterId = clusterId;\n if (node.clusterId && newClusterIdMap[node.clusterId]) node.clusterId = newClusterIdMap[node.clusterId];\n });\n // get the cluster edges\n var clusterEdges = [];\n var clusterEdgeMap = {};\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var weight = edge[weightPropertyName] || 1;\n var sourceClusterId = nodeMap[source].node.clusterId;\n var targetClusterId = nodeMap[target].node.clusterId;\n if (!sourceClusterId || !targetClusterId) return;\n var newEdgeId = \"\".concat(sourceClusterId, \"---\").concat(targetClusterId);\n if (clusterEdgeMap[newEdgeId]) {\n clusterEdgeMap[newEdgeId].weight += weight;\n clusterEdgeMap[newEdgeId].count++;\n } else {\n var newEdge = {\n source: sourceClusterId,\n target: targetClusterId,\n weight: weight,\n count: 1\n };\n clusterEdgeMap[newEdgeId] = newEdge;\n clusterEdges.push(newEdge);\n }\n });\n var clustersArray = [];\n Object.keys(finalClusters).forEach(function (clusterId) {\n clustersArray.push(finalClusters[clusterId]);\n });\n return {\n clusters: clustersArray,\n clusterEdges: clusterEdges\n };\n};\nvar _default = louvain;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/louvain.js?"); /***/ }), @@ -608,7 +608,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _unionFind = _interopRequireDefault(__webpack_require__(/*! ./structs/union-find */ \"./node_modules/@antv/algorithm/lib/structs/union-find.js\"));\n\nvar _binaryHeap = _interopRequireDefault(__webpack_require__(/*! ./structs/binary-heap */ \"./node_modules/@antv/algorithm/lib/structs/binary-heap.js\"));\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * Prim algorithm,use priority queue,复杂度 O(E+V*logV), V: 节点数量,E: 边的数量\n * refer: https://en.wikipedia.org/wiki/Prim%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n */\nvar primMST = function primMST(graphData, weight) {\n var selectedEdges = [];\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n\n if (nodes.length === 0) {\n return selectedEdges;\n } // 从nodes[0]开始\n\n\n var currNode = nodes[0];\n var visited = new Set();\n visited.add(currNode); // 用二叉堆维护距已加入节点的其他节点的边的权值\n\n var compareWeight = function compareWeight(a, b) {\n if (weight) {\n return a.weight - b.weight;\n }\n\n return 0;\n };\n\n var edgeQueue = new _binaryHeap.default(compareWeight);\n (0, _util.getEdgesByNodeId)(currNode.id, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n\n while (!edgeQueue.isEmpty()) {\n // 选取与已加入的结点之间边权最小的结点\n var currEdge = edgeQueue.delMin();\n var source = currEdge.source;\n var target = currEdge.target;\n if (visited.has(source) && visited.has(target)) continue;\n selectedEdges.push(currEdge);\n\n if (!visited.has(source)) {\n visited.add(source);\n (0, _util.getEdgesByNodeId)(source, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n }\n\n if (!visited.has(target)) {\n visited.add(target);\n (0, _util.getEdgesByNodeId)(target, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n }\n }\n\n return selectedEdges;\n};\n/**\n * Kruskal algorithm,复杂度 O(E*logE), E: 边的数量\n * refer: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @return IEdge[] 返回构成MST的边的数组\n */\n\n\nvar kruskalMST = function kruskalMST(graphData, weight) {\n var selectedEdges = [];\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n\n if (nodes.length === 0) {\n return selectedEdges;\n } // 若指定weight,则将所有的边按权值从小到大排序\n\n\n var weightEdges = edges.map(function (edge) {\n return edge;\n });\n\n if (weight) {\n weightEdges.sort(function (a, b) {\n return a.weight - b.weight;\n });\n }\n\n var disjointSet = new _unionFind.default(nodes.map(function (n) {\n return n.id;\n })); // 从权值最小的边开始,如果这条边连接的两个节点于图G中不在同一个连通分量中,则添加这条边\n // 直到遍历完所有点或边\n\n while (weightEdges.length > 0) {\n var curEdge = weightEdges.shift();\n var source = curEdge.source;\n var target = curEdge.target;\n\n if (!disjointSet.connected(source, target)) {\n selectedEdges.push(curEdge);\n disjointSet.union(source, target);\n }\n }\n\n return selectedEdges;\n};\n/**\n * 最小生成树\n * refer: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @param algo 'prim' | 'kruskal' 算法类型\n * @return EdgeConfig[] 返回构成MST的边的数组\n */\n\n\nvar minimumSpanningTree = function minimumSpanningTree(graphData, weight, algo) {\n var algos = {\n prim: primMST,\n kruskal: kruskalMST\n };\n if (!algo) return kruskalMST(graphData, weight);\n return algos[algo](graphData, weight);\n};\n\nvar _default = minimumSpanningTree;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/mts.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _unionFind = _interopRequireDefault(__webpack_require__(/*! ./structs/union-find */ \"./node_modules/@antv/algorithm/lib/structs/union-find.js\"));\nvar _binaryHeap = _interopRequireDefault(__webpack_require__(/*! ./structs/binary-heap */ \"./node_modules/@antv/algorithm/lib/structs/binary-heap.js\"));\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * Prim algorithm,use priority queue,复杂度 O(E+V*logV), V: 节点数量,E: 边的数量\n * refer: https://en.wikipedia.org/wiki/Prim%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n */\nvar primMST = function primMST(graphData, weight) {\n var selectedEdges = [];\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n if (nodes.length === 0) {\n return selectedEdges;\n }\n // 从nodes[0]开始\n var currNode = nodes[0];\n var visited = new Set();\n visited.add(currNode);\n // 用二叉堆维护距已加入节点的其他节点的边的权值\n var compareWeight = function compareWeight(a, b) {\n if (weight) {\n return a.weight - b.weight;\n }\n return 0;\n };\n var edgeQueue = new _binaryHeap.default(compareWeight);\n (0, _util.getEdgesByNodeId)(currNode.id, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n while (!edgeQueue.isEmpty()) {\n // 选取与已加入的结点之间边权最小的结点\n var currEdge = edgeQueue.delMin();\n var source = currEdge.source;\n var target = currEdge.target;\n if (visited.has(source) && visited.has(target)) continue;\n selectedEdges.push(currEdge);\n if (!visited.has(source)) {\n visited.add(source);\n (0, _util.getEdgesByNodeId)(source, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n }\n if (!visited.has(target)) {\n visited.add(target);\n (0, _util.getEdgesByNodeId)(target, edges).forEach(function (edge) {\n edgeQueue.insert(edge);\n });\n }\n }\n return selectedEdges;\n};\n/**\n * Kruskal algorithm,复杂度 O(E*logE), E: 边的数量\n * refer: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @return IEdge[] 返回构成MST的边的数组\n */\nvar kruskalMST = function kruskalMST(graphData, weight) {\n var selectedEdges = [];\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n if (nodes.length === 0) {\n return selectedEdges;\n }\n // 若指定weight,则将所有的边按权值从小到大排序\n var weightEdges = edges.map(function (edge) {\n return edge;\n });\n if (weight) {\n weightEdges.sort(function (a, b) {\n return a.weight - b.weight;\n });\n }\n var disjointSet = new _unionFind.default(nodes.map(function (n) {\n return n.id;\n }));\n // 从权值最小的边开始,如果这条边连接的两个节点于图G中不在同一个连通分量中,则添加这条边\n // 直到遍历完所有点或边\n while (weightEdges.length > 0) {\n var curEdge = weightEdges.shift();\n var source = curEdge.source;\n var target = curEdge.target;\n if (!disjointSet.connected(source, target)) {\n selectedEdges.push(curEdge);\n disjointSet.union(source, target);\n }\n }\n return selectedEdges;\n};\n/**\n * 最小生成树\n * refer: https://en.wikipedia.org/wiki/Kruskal%27s_algorithm\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @param algo 'prim' | 'kruskal' 算法类型\n * @return EdgeConfig[] 返回构成MST的边的数组\n */\nvar minimumSpanningTree = function minimumSpanningTree(graphData, weight, algo) {\n var algos = {\n prim: primMST,\n kruskal: kruskalMST\n };\n if (!algo) return kruskalMST(graphData, weight);\n return algos[algo](graphData, weight);\n};\nvar _default = minimumSpanningTree;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/mts.js?"); /***/ }), @@ -620,7 +620,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _degree = _interopRequireDefault(__webpack_require__(/*! ./degree */ \"./node_modules/@antv/algorithm/lib/degree.js\"));\n\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * PageRank https://en.wikipedia.org/wiki/PageRank\n * refer: https://github.com/anvaka/ngraph.pagerank\n * @param graph\n * @param epsilon 判断是否收敛的精度值,默认 0.000001\n * @param linkProb 阻尼系数(dumping factor),指任意时刻,用户访问到某节点后继续访问该节点链接的下一个节点的概率,经验值 0.85\n */\nvar pageRank = function pageRank(graphData, epsilon, linkProb) {\n if (typeof epsilon !== 'number') epsilon = 0.000001;\n if (typeof linkProb !== 'number') linkProb = 0.85;\n var distance = 1;\n var leakedRank = 0;\n var maxIterations = 1000;\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodesCount = nodes.length;\n var currentRank;\n var curRanks = {};\n var prevRanks = {}; // Initialize pageranks 初始化\n\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n curRanks[nodeId] = 1 / nodesCount;\n prevRanks[nodeId] = 1 / nodesCount;\n }\n\n var nodeDegree = (0, _degree.default)(graphData);\n\n while (maxIterations > 0 && distance > epsilon) {\n leakedRank = 0;\n\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n currentRank = 0;\n\n if (nodeDegree[node.id].inDegree === 0) {\n curRanks[nodeId] = 0;\n } else {\n var neighbors = (0, _util.getNeighbors)(nodeId, edges, 'source');\n\n for (var i = 0; i < neighbors.length; ++i) {\n var neighbor = neighbors[i];\n var outDegree = nodeDegree[neighbor].outDegree;\n if (outDegree > 0) currentRank += prevRanks[neighbor] / outDegree;\n }\n\n curRanks[nodeId] = linkProb * currentRank;\n leakedRank += curRanks[nodeId];\n }\n }\n\n leakedRank = (1 - leakedRank) / nodesCount;\n distance = 0;\n\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n currentRank = curRanks[nodeId] + leakedRank;\n distance += Math.abs(currentRank - prevRanks[nodeId]);\n prevRanks[nodeId] = currentRank;\n }\n\n maxIterations -= 1;\n }\n\n return prevRanks;\n};\n\nvar _default = pageRank;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/pageRank.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _degree = _interopRequireDefault(__webpack_require__(/*! ./degree */ \"./node_modules/@antv/algorithm/lib/degree.js\"));\nvar _util = __webpack_require__(/*! ./util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * PageRank https://en.wikipedia.org/wiki/PageRank\n * refer: https://github.com/anvaka/ngraph.pagerank\n * @param graph\n * @param epsilon 判断是否收敛的精度值,默认 0.000001\n * @param linkProb 阻尼系数(dumping factor),指任意时刻,用户访问到某节点后继续访问该节点链接的下一个节点的概率,经验值 0.85\n */\nvar pageRank = function pageRank(graphData, epsilon, linkProb) {\n if (typeof epsilon !== 'number') epsilon = 0.000001;\n if (typeof linkProb !== 'number') linkProb = 0.85;\n var distance = 1;\n var leakedRank = 0;\n var maxIterations = 1000;\n var _a = graphData.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = graphData.edges,\n edges = _b === void 0 ? [] : _b;\n var nodesCount = nodes.length;\n var currentRank;\n var curRanks = {};\n var prevRanks = {};\n // Initialize pageranks 初始化\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n curRanks[nodeId] = 1 / nodesCount;\n prevRanks[nodeId] = 1 / nodesCount;\n }\n var nodeDegree = (0, _degree.default)(graphData);\n while (maxIterations > 0 && distance > epsilon) {\n leakedRank = 0;\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n currentRank = 0;\n if (nodeDegree[node.id].inDegree === 0) {\n curRanks[nodeId] = 0;\n } else {\n var neighbors = (0, _util.getNeighbors)(nodeId, edges, 'source');\n for (var i = 0; i < neighbors.length; ++i) {\n var neighbor = neighbors[i];\n var outDegree = nodeDegree[neighbor].outDegree;\n if (outDegree > 0) currentRank += prevRanks[neighbor] / outDegree;\n }\n curRanks[nodeId] = linkProb * currentRank;\n leakedRank += curRanks[nodeId];\n }\n }\n leakedRank = (1 - leakedRank) / nodesCount;\n distance = 0;\n for (var j = 0; j < nodesCount; ++j) {\n var node = nodes[j];\n var nodeId = node.id;\n currentRank = curRanks[nodeId] + leakedRank;\n distance += Math.abs(currentRank - prevRanks[nodeId]);\n prevRanks[nodeId] = currentRank;\n }\n maxIterations -= 1;\n }\n return prevRanks;\n};\nvar _default = pageRank;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/pageRank.js?"); /***/ }), @@ -632,7 +632,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar defaultCompare = function defaultCompare(a, b) {\n return a - b;\n};\n\nvar MinBinaryHeap =\n/** @class */\nfunction () {\n function MinBinaryHeap(compareFn) {\n if (compareFn === void 0) {\n compareFn = defaultCompare;\n }\n\n this.compareFn = compareFn;\n this.list = [];\n }\n\n MinBinaryHeap.prototype.getLeft = function (index) {\n return 2 * index + 1;\n };\n\n MinBinaryHeap.prototype.getRight = function (index) {\n return 2 * index + 2;\n };\n\n MinBinaryHeap.prototype.getParent = function (index) {\n if (index === 0) {\n return null;\n }\n\n return Math.floor((index - 1) / 2);\n };\n\n MinBinaryHeap.prototype.isEmpty = function () {\n return this.list.length <= 0;\n };\n\n MinBinaryHeap.prototype.top = function () {\n return this.isEmpty() ? undefined : this.list[0];\n };\n\n MinBinaryHeap.prototype.delMin = function () {\n var top = this.top();\n var bottom = this.list.pop();\n\n if (this.list.length > 0) {\n this.list[0] = bottom;\n this.moveDown(0);\n }\n\n return top;\n };\n\n MinBinaryHeap.prototype.insert = function (value) {\n if (value !== null) {\n this.list.push(value);\n var index = this.list.length - 1;\n this.moveUp(index);\n return true;\n }\n\n return false;\n };\n\n MinBinaryHeap.prototype.moveUp = function (index) {\n var parent = this.getParent(index);\n\n while (index && index > 0 && this.compareFn(this.list[parent], this.list[index]) > 0) {\n // swap\n var tmp = this.list[parent];\n this.list[parent] = this.list[index];\n this.list[index] = tmp; // [this.list[index], this.list[parent]] = [this.list[parent], this.list[index]]\n\n index = parent;\n parent = this.getParent(index);\n }\n };\n\n MinBinaryHeap.prototype.moveDown = function (index) {\n var _a;\n\n var element = index;\n var left = this.getLeft(index);\n var right = this.getRight(index);\n var size = this.list.length;\n\n if (left !== null && left < size && this.compareFn(this.list[element], this.list[left]) > 0) {\n element = left;\n } else if (right !== null && right < size && this.compareFn(this.list[element], this.list[right]) > 0) {\n element = right;\n }\n\n if (index !== element) {\n _a = [this.list[element], this.list[index]], this.list[index] = _a[0], this.list[element] = _a[1];\n this.moveDown(element);\n }\n };\n\n return MinBinaryHeap;\n}();\n\nvar _default = MinBinaryHeap;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/structs/binary-heap.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar defaultCompare = function defaultCompare(a, b) {\n return a - b;\n};\nvar MinBinaryHeap = /** @class */function () {\n function MinBinaryHeap(compareFn) {\n if (compareFn === void 0) {\n compareFn = defaultCompare;\n }\n this.compareFn = compareFn;\n this.list = [];\n }\n MinBinaryHeap.prototype.getLeft = function (index) {\n return 2 * index + 1;\n };\n MinBinaryHeap.prototype.getRight = function (index) {\n return 2 * index + 2;\n };\n MinBinaryHeap.prototype.getParent = function (index) {\n if (index === 0) {\n return null;\n }\n return Math.floor((index - 1) / 2);\n };\n MinBinaryHeap.prototype.isEmpty = function () {\n return this.list.length <= 0;\n };\n MinBinaryHeap.prototype.top = function () {\n return this.isEmpty() ? undefined : this.list[0];\n };\n MinBinaryHeap.prototype.delMin = function () {\n var top = this.top();\n var bottom = this.list.pop();\n if (this.list.length > 0) {\n this.list[0] = bottom;\n this.moveDown(0);\n }\n return top;\n };\n MinBinaryHeap.prototype.insert = function (value) {\n if (value !== null) {\n this.list.push(value);\n var index = this.list.length - 1;\n this.moveUp(index);\n return true;\n }\n return false;\n };\n MinBinaryHeap.prototype.moveUp = function (index) {\n var parent = this.getParent(index);\n while (index && index > 0 && this.compareFn(this.list[parent], this.list[index]) > 0) {\n // swap\n var tmp = this.list[parent];\n this.list[parent] = this.list[index];\n this.list[index] = tmp;\n // [this.list[index], this.list[parent]] = [this.list[parent], this.list[index]]\n index = parent;\n parent = this.getParent(index);\n }\n };\n MinBinaryHeap.prototype.moveDown = function (index) {\n var _a;\n var element = index;\n var left = this.getLeft(index);\n var right = this.getRight(index);\n var size = this.list.length;\n if (left !== null && left < size && this.compareFn(this.list[element], this.list[left]) > 0) {\n element = left;\n } else if (right !== null && right < size && this.compareFn(this.list[element], this.list[right]) > 0) {\n element = right;\n }\n if (index !== element) {\n _a = [this.list[element], this.list[index]], this.list[index] = _a[0], this.list[element] = _a[1];\n this.moveDown(element);\n }\n };\n return MinBinaryHeap;\n}();\nvar _default = MinBinaryHeap;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/structs/binary-heap.js?"); /***/ }), @@ -644,7 +644,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.LinkedListNode = void 0;\n\nvar defaultComparator = function defaultComparator(a, b) {\n if (a === b) {\n return true;\n }\n\n return false;\n};\n/**\n * 链表中单个元素节点\n */\n\n\nvar LinkedListNode =\n/** @class */\nfunction () {\n function LinkedListNode(value, next) {\n if (next === void 0) {\n next = null;\n }\n\n this.value = value;\n this.next = next;\n }\n\n LinkedListNode.prototype.toString = function (callback) {\n return callback ? callback(this.value) : \"\".concat(this.value);\n };\n\n return LinkedListNode;\n}();\n\nexports.LinkedListNode = LinkedListNode;\n\nvar LinkedList =\n/** @class */\nfunction () {\n function LinkedList(comparator) {\n if (comparator === void 0) {\n comparator = defaultComparator;\n }\n\n this.head = null;\n this.tail = null;\n this.compare = comparator;\n }\n /**\n * 将指定元素添加到链表头部\n * @param value\n */\n\n\n LinkedList.prototype.prepend = function (value) {\n // 在头部添加一个节点\n var newNode = new LinkedListNode(value, this.head);\n this.head = newNode;\n\n if (!this.tail) {\n this.tail = newNode;\n }\n\n return this;\n };\n /**\n * 将指定元素添加到链表中\n * @param value\n */\n\n\n LinkedList.prototype.append = function (value) {\n var newNode = new LinkedListNode(value); // 如果不存在头节点,则将创建的新节点作为头节点\n\n if (!this.head) {\n this.head = newNode;\n this.tail = newNode;\n return this;\n } // 将新节点附加到链表末尾\n\n\n this.tail.next = newNode;\n this.tail = newNode;\n return this;\n };\n /**\n * 删除指定元素\n * @param value 要删除的元素\n */\n\n\n LinkedList.prototype.delete = function (value) {\n if (!this.head) {\n return null;\n }\n\n var deleteNode = null; // 如果删除的是头部元素,则将next作为头元素\n\n while (this.head && this.compare(this.head.value, value)) {\n deleteNode = this.head;\n this.head = this.head.next;\n }\n\n var currentNode = this.head;\n\n if (currentNode !== null) {\n // 如果删除了节点以后,将next节点前移\n while (currentNode.next) {\n if (this.compare(currentNode.next.value, value)) {\n deleteNode = currentNode.next;\n currentNode.next = currentNode.next.next;\n } else {\n currentNode = currentNode.next;\n }\n }\n } // 检查尾部节点是否被删除\n\n\n if (this.compare(this.tail.value, value)) {\n this.tail = currentNode;\n }\n\n return deleteNode;\n };\n /**\n * 查找指定的元素\n * @param param0\n */\n\n\n LinkedList.prototype.find = function (_a) {\n var _b = _a.value,\n value = _b === void 0 ? undefined : _b,\n _c = _a.callback,\n callback = _c === void 0 ? undefined : _c;\n\n if (!this.head) {\n return null;\n }\n\n var currentNode = this.head;\n\n while (currentNode) {\n // 如果指定了 callback,则按指定的 callback 查找\n if (callback && callback(currentNode.value)) {\n return currentNode;\n } // 如果指定了 value,则按 value 查找\n\n\n if (value !== undefined && this.compare(currentNode.value, value)) {\n return currentNode;\n }\n\n currentNode = currentNode.next;\n }\n\n return null;\n };\n /**\n * 删除尾部节点\n */\n\n\n LinkedList.prototype.deleteTail = function () {\n var deletedTail = this.tail;\n\n if (this.head === this.tail) {\n // 链表中只有一个元素\n this.head = null;\n this.tail = null;\n return deletedTail;\n }\n\n var currentNode = this.head;\n\n while (currentNode.next) {\n if (!currentNode.next.next) {\n currentNode.next = null;\n } else {\n currentNode = currentNode.next;\n }\n }\n\n this.tail = currentNode;\n return deletedTail;\n };\n /**\n * 删除头部节点\n */\n\n\n LinkedList.prototype.deleteHead = function () {\n if (!this.head) {\n return null;\n }\n\n var deletedHead = this.head;\n\n if (this.head.next) {\n this.head = this.head.next;\n } else {\n this.head = null;\n this.tail = null;\n }\n\n return deletedHead;\n };\n /**\n * 将一组元素转成链表中的节点\n * @param values 链表中的元素\n */\n\n\n LinkedList.prototype.fromArray = function (values) {\n var _this = this;\n\n values.forEach(function (value) {\n return _this.append(value);\n });\n return this;\n };\n /**\n * 将链表中的节点转成数组元素\n */\n\n\n LinkedList.prototype.toArray = function () {\n var nodes = [];\n var currentNode = this.head;\n\n while (currentNode) {\n nodes.push(currentNode);\n currentNode = currentNode.next;\n }\n\n return nodes;\n };\n /**\n * 反转链表中的元素节点\n */\n\n\n LinkedList.prototype.reverse = function () {\n var currentNode = this.head;\n var prevNode = null;\n var nextNode = null;\n\n while (currentNode) {\n // 存储下一个元素节点\n nextNode = currentNode.next; // 更改当前节点的下一个节点,以便将它连接到上一个节点上\n\n currentNode.next = prevNode; // 将 prevNode 和 currentNode 向前移动一步\n\n prevNode = currentNode;\n currentNode = nextNode;\n }\n\n this.tail = this.head;\n this.head = prevNode;\n };\n\n LinkedList.prototype.toString = function (callback) {\n if (callback === void 0) {\n callback = undefined;\n }\n\n return this.toArray().map(function (node) {\n return node.toString(callback);\n }).toString();\n };\n\n return LinkedList;\n}();\n\nvar _default = LinkedList;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/structs/linked-list.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.LinkedListNode = void 0;\nvar defaultComparator = function defaultComparator(a, b) {\n if (a === b) {\n return true;\n }\n return false;\n};\n/**\n * 链表中单个元素节点\n */\nvar LinkedListNode = /** @class */function () {\n function LinkedListNode(value, next) {\n if (next === void 0) {\n next = null;\n }\n this.value = value;\n this.next = next;\n }\n LinkedListNode.prototype.toString = function (callback) {\n return callback ? callback(this.value) : \"\".concat(this.value);\n };\n return LinkedListNode;\n}();\nexports.LinkedListNode = LinkedListNode;\nvar LinkedList = /** @class */function () {\n function LinkedList(comparator) {\n if (comparator === void 0) {\n comparator = defaultComparator;\n }\n this.head = null;\n this.tail = null;\n this.compare = comparator;\n }\n /**\n * 将指定元素添加到链表头部\n * @param value\n */\n LinkedList.prototype.prepend = function (value) {\n // 在头部添加一个节点\n var newNode = new LinkedListNode(value, this.head);\n this.head = newNode;\n if (!this.tail) {\n this.tail = newNode;\n }\n return this;\n };\n /**\n * 将指定元素添加到链表中\n * @param value\n */\n LinkedList.prototype.append = function (value) {\n var newNode = new LinkedListNode(value);\n // 如果不存在头节点,则将创建的新节点作为头节点\n if (!this.head) {\n this.head = newNode;\n this.tail = newNode;\n return this;\n }\n // 将新节点附加到链表末尾\n this.tail.next = newNode;\n this.tail = newNode;\n return this;\n };\n /**\n * 删除指定元素\n * @param value 要删除的元素\n */\n LinkedList.prototype.delete = function (value) {\n if (!this.head) {\n return null;\n }\n var deleteNode = null;\n // 如果删除的是头部元素,则将next作为头元素\n while (this.head && this.compare(this.head.value, value)) {\n deleteNode = this.head;\n this.head = this.head.next;\n }\n var currentNode = this.head;\n if (currentNode !== null) {\n // 如果删除了节点以后,将next节点前移\n while (currentNode.next) {\n if (this.compare(currentNode.next.value, value)) {\n deleteNode = currentNode.next;\n currentNode.next = currentNode.next.next;\n } else {\n currentNode = currentNode.next;\n }\n }\n }\n // 检查尾部节点是否被删除\n if (this.compare(this.tail.value, value)) {\n this.tail = currentNode;\n }\n return deleteNode;\n };\n /**\n * 查找指定的元素\n * @param param0\n */\n LinkedList.prototype.find = function (_a) {\n var _b = _a.value,\n value = _b === void 0 ? undefined : _b,\n _c = _a.callback,\n callback = _c === void 0 ? undefined : _c;\n if (!this.head) {\n return null;\n }\n var currentNode = this.head;\n while (currentNode) {\n // 如果指定了 callback,则按指定的 callback 查找\n if (callback && callback(currentNode.value)) {\n return currentNode;\n }\n // 如果指定了 value,则按 value 查找\n if (value !== undefined && this.compare(currentNode.value, value)) {\n return currentNode;\n }\n currentNode = currentNode.next;\n }\n return null;\n };\n /**\n * 删除尾部节点\n */\n LinkedList.prototype.deleteTail = function () {\n var deletedTail = this.tail;\n if (this.head === this.tail) {\n // 链表中只有一个元素\n this.head = null;\n this.tail = null;\n return deletedTail;\n }\n var currentNode = this.head;\n while (currentNode.next) {\n if (!currentNode.next.next) {\n currentNode.next = null;\n } else {\n currentNode = currentNode.next;\n }\n }\n this.tail = currentNode;\n return deletedTail;\n };\n /**\n * 删除头部节点\n */\n LinkedList.prototype.deleteHead = function () {\n if (!this.head) {\n return null;\n }\n var deletedHead = this.head;\n if (this.head.next) {\n this.head = this.head.next;\n } else {\n this.head = null;\n this.tail = null;\n }\n return deletedHead;\n };\n /**\n * 将一组元素转成链表中的节点\n * @param values 链表中的元素\n */\n LinkedList.prototype.fromArray = function (values) {\n var _this = this;\n values.forEach(function (value) {\n return _this.append(value);\n });\n return this;\n };\n /**\n * 将链表中的节点转成数组元素\n */\n LinkedList.prototype.toArray = function () {\n var nodes = [];\n var currentNode = this.head;\n while (currentNode) {\n nodes.push(currentNode);\n currentNode = currentNode.next;\n }\n return nodes;\n };\n /**\n * 反转链表中的元素节点\n */\n LinkedList.prototype.reverse = function () {\n var currentNode = this.head;\n var prevNode = null;\n var nextNode = null;\n while (currentNode) {\n // 存储下一个元素节点\n nextNode = currentNode.next;\n // 更改当前节点的下一个节点,以便将它连接到上一个节点上\n currentNode.next = prevNode;\n // 将 prevNode 和 currentNode 向前移动一步\n prevNode = currentNode;\n currentNode = nextNode;\n }\n this.tail = this.head;\n this.head = prevNode;\n };\n LinkedList.prototype.toString = function (callback) {\n if (callback === void 0) {\n callback = undefined;\n }\n return this.toArray().map(function (node) {\n return node.toString(callback);\n }).toString();\n };\n return LinkedList;\n}();\nvar _default = LinkedList;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/structs/linked-list.js?"); /***/ }), @@ -656,7 +656,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _linkedList = _interopRequireDefault(__webpack_require__(/*! ./linked-list */ \"./node_modules/@antv/algorithm/lib/structs/linked-list.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar Queue =\n/** @class */\nfunction () {\n function Queue() {\n this.linkedList = new _linkedList.default();\n }\n /**\n * 队列是否为空\n */\n\n\n Queue.prototype.isEmpty = function () {\n return !this.linkedList.head;\n };\n /**\n * 读取队列头部的元素, 不删除队列中的元素\n */\n\n\n Queue.prototype.peek = function () {\n if (!this.linkedList.head) {\n return null;\n }\n\n return this.linkedList.head.value;\n };\n /**\n * 在队列的尾部新增一个元素\n * @param value\n */\n\n\n Queue.prototype.enqueue = function (value) {\n this.linkedList.append(value);\n };\n /**\n * 删除队列中的头部元素,如果队列为空,则返回 null\n */\n\n\n Queue.prototype.dequeue = function () {\n var removeHead = this.linkedList.deleteHead();\n return removeHead ? removeHead.value : null;\n };\n\n Queue.prototype.toString = function (callback) {\n return this.linkedList.toString(callback);\n };\n\n return Queue;\n}();\n\nvar _default = Queue;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/structs/queue.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _linkedList = _interopRequireDefault(__webpack_require__(/*! ./linked-list */ \"./node_modules/@antv/algorithm/lib/structs/linked-list.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar Queue = /** @class */function () {\n function Queue() {\n this.linkedList = new _linkedList.default();\n }\n /**\n * 队列是否为空\n */\n Queue.prototype.isEmpty = function () {\n return !this.linkedList.head;\n };\n /**\n * 读取队列头部的元素, 不删除队列中的元素\n */\n Queue.prototype.peek = function () {\n if (!this.linkedList.head) {\n return null;\n }\n return this.linkedList.head.value;\n };\n /**\n * 在队列的尾部新增一个元素\n * @param value\n */\n Queue.prototype.enqueue = function (value) {\n this.linkedList.append(value);\n };\n /**\n * 删除队列中的头部元素,如果队列为空,则返回 null\n */\n Queue.prototype.dequeue = function () {\n var removeHead = this.linkedList.deleteHead();\n return removeHead ? removeHead.value : null;\n };\n Queue.prototype.toString = function (callback) {\n return this.linkedList.toString(callback);\n };\n return Queue;\n}();\nvar _default = Queue;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/structs/queue.js?"); /***/ }), @@ -668,7 +668,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\n/**\n * 并查集 Disjoint set to support quick union\n */\nvar UnionFind =\n/** @class */\nfunction () {\n function UnionFind(items) {\n this.count = items.length;\n this.parent = {};\n\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var i = items_1[_i];\n this.parent[i] = i;\n }\n } // find the root of the item\n\n\n UnionFind.prototype.find = function (item) {\n while (this.parent[item] !== item) {\n item = this.parent[item];\n }\n\n return item;\n };\n\n UnionFind.prototype.union = function (a, b) {\n var rootA = this.find(a);\n var rootB = this.find(b);\n if (rootA === rootB) return; // make the element with smaller root the parent\n\n if (rootA < rootB) {\n if (this.parent[b] !== b) this.union(this.parent[b], a);\n this.parent[b] = this.parent[a];\n } else {\n if (this.parent[a] !== a) this.union(this.parent[a], b);\n this.parent[a] = this.parent[b];\n }\n }; // whether a and b are connected, i.e. a and b have the same root\n\n\n UnionFind.prototype.connected = function (a, b) {\n return this.find(a) === this.find(b);\n };\n\n return UnionFind;\n}();\n\nvar _default = UnionFind;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/structs/union-find.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n/**\n * 并查集 Disjoint set to support quick union\n */\nvar UnionFind = /** @class */function () {\n function UnionFind(items) {\n this.count = items.length;\n this.parent = {};\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var i = items_1[_i];\n this.parent[i] = i;\n }\n }\n // find the root of the item\n UnionFind.prototype.find = function (item) {\n while (this.parent[item] !== item) {\n item = this.parent[item];\n }\n return item;\n };\n UnionFind.prototype.union = function (a, b) {\n var rootA = this.find(a);\n var rootB = this.find(b);\n if (rootA === rootB) return;\n // make the element with smaller root the parent\n if (rootA < rootB) {\n if (this.parent[b] !== b) this.union(this.parent[b], a);\n this.parent[b] = this.parent[a];\n } else {\n if (this.parent[a] !== a) this.union(this.parent[a], b);\n this.parent[a] = this.parent[b];\n }\n };\n // whether a and b are connected, i.e. a and b have the same root\n UnionFind.prototype.connected = function (a, b) {\n return this.find(a) === this.find(b);\n };\n return UnionFind;\n}();\nvar _default = UnionFind;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/structs/union-find.js?"); /***/ }), @@ -680,7 +680,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DistanceType = void 0;\nvar DistanceType;\nexports.DistanceType = DistanceType;\n\n(function (DistanceType) {\n DistanceType[\"EuclideanDistance\"] = \"euclideanDistance\";\n})(DistanceType || (exports.DistanceType = DistanceType = {}));\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/types.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.DistanceType = void 0;\nvar DistanceType;\nexports.DistanceType = DistanceType;\n(function (DistanceType) {\n DistanceType[\"EuclideanDistance\"] = \"euclideanDistance\";\n})(DistanceType || (exports.DistanceType = DistanceType = {}));\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/types.js?"); /***/ }), @@ -692,7 +692,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.uniqueId = exports.getOutEdgesNodeId = exports.getNeighbors = exports.getEdgesByNodeId = void 0;\n\n/**\n * 获取指定节点的所有邻居\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n * @param type 邻居类型\n */\nvar getNeighbors = function getNeighbors(nodeId, edges, type) {\n if (edges === void 0) {\n edges = [];\n }\n\n var currentEdges = edges.filter(function (edge) {\n return edge.source === nodeId || edge.target === nodeId;\n });\n\n if (type === 'target') {\n // 当前节点为 source,它所指向的目标节点\n var neighhborsConverter_1 = function neighhborsConverter_1(edge) {\n return edge.source === nodeId;\n };\n\n return currentEdges.filter(neighhborsConverter_1).map(function (edge) {\n return edge.target;\n });\n }\n\n if (type === 'source') {\n // 当前节点为 target,它所指向的源节点\n var neighhborsConverter_2 = function neighhborsConverter_2(edge) {\n return edge.target === nodeId;\n };\n\n return currentEdges.filter(neighhborsConverter_2).map(function (edge) {\n return edge.source;\n });\n } // 若未指定 type ,则返回所有邻居\n\n\n var neighhborsConverter = function neighhborsConverter(edge) {\n return edge.source === nodeId ? edge.target : edge.source;\n };\n\n return currentEdges.map(neighhborsConverter);\n};\n/**\n * 获取指定节点的出边\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n */\n\n\nexports.getNeighbors = getNeighbors;\n\nvar getOutEdgesNodeId = function getOutEdgesNodeId(nodeId, edges) {\n return edges.filter(function (edge) {\n return edge.source === nodeId;\n });\n};\n/**\n * 获取指定节点的边,包括出边和入边\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n */\n\n\nexports.getOutEdgesNodeId = getOutEdgesNodeId;\n\nvar getEdgesByNodeId = function getEdgesByNodeId(nodeId, edges) {\n return edges.filter(function (edge) {\n return edge.source === nodeId || edge.target === nodeId;\n });\n};\n/**\n * 生成唯一的 ID,规则是序号 + 时间戳\n * @param index 序号\n */\n\n\nexports.getEdgesByNodeId = getEdgesByNodeId;\n\nvar uniqueId = function uniqueId(index) {\n if (index === void 0) {\n index = 0;\n }\n\n var random1 = \"\".concat(Math.random()).split('.')[1].substr(0, 5);\n var random2 = \"\".concat(Math.random()).split('.')[1].substr(0, 5);\n return \"\".concat(index, \"-\").concat(random1).concat(random2);\n};\n\nexports.uniqueId = uniqueId;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/util.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.uniqueId = exports.getOutEdgesNodeId = exports.getNeighbors = exports.getEdgesByNodeId = void 0;\n/**\n * 获取指定节点的所有邻居\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n * @param type 邻居类型\n */\nvar getNeighbors = function getNeighbors(nodeId, edges, type) {\n if (edges === void 0) {\n edges = [];\n }\n var currentEdges = edges.filter(function (edge) {\n return edge.source === nodeId || edge.target === nodeId;\n });\n if (type === 'target') {\n // 当前节点为 source,它所指向的目标节点\n var neighhborsConverter_1 = function neighhborsConverter_1(edge) {\n return edge.source === nodeId;\n };\n return currentEdges.filter(neighhborsConverter_1).map(function (edge) {\n return edge.target;\n });\n }\n if (type === 'source') {\n // 当前节点为 target,它所指向的源节点\n var neighhborsConverter_2 = function neighhborsConverter_2(edge) {\n return edge.target === nodeId;\n };\n return currentEdges.filter(neighhborsConverter_2).map(function (edge) {\n return edge.source;\n });\n }\n // 若未指定 type ,则返回所有邻居\n var neighhborsConverter = function neighhborsConverter(edge) {\n return edge.source === nodeId ? edge.target : edge.source;\n };\n return currentEdges.map(neighhborsConverter);\n};\n/**\n * 获取指定节点的出边\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n */\nexports.getNeighbors = getNeighbors;\nvar getOutEdgesNodeId = function getOutEdgesNodeId(nodeId, edges) {\n return edges.filter(function (edge) {\n return edge.source === nodeId;\n });\n};\n/**\n * 获取指定节点的边,包括出边和入边\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n */\nexports.getOutEdgesNodeId = getOutEdgesNodeId;\nvar getEdgesByNodeId = function getEdgesByNodeId(nodeId, edges) {\n return edges.filter(function (edge) {\n return edge.source === nodeId || edge.target === nodeId;\n });\n};\n/**\n * 生成唯一的 ID,规则是序号 + 时间戳\n * @param index 序号\n */\nexports.getEdgesByNodeId = getEdgesByNodeId;\nvar uniqueId = function uniqueId(index) {\n if (index === void 0) {\n index = 0;\n }\n var random1 = \"\".concat(Math.random()).split('.')[1].substr(0, 5);\n var random2 = \"\".concat(Math.random()).split('.')[1].substr(0, 5);\n return \"\".concat(index, \"-\").concat(random1).concat(random2);\n};\nexports.uniqueId = uniqueId;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/util.js?"); /***/ }), @@ -704,7 +704,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.oneHot = exports.getDistance = exports.getAllKeyValueMap = exports.default = void 0;\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _types = __webpack_require__(/*! ../types */ \"./node_modules/@antv/algorithm/lib/types.js\");\n\nvar _vector = _interopRequireDefault(__webpack_require__(/*! ./vector */ \"./node_modules/@antv/algorithm/lib/utils/vector.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * 获取数据中所有的属性及其对应的值\n * @param dataList 数据集\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\nvar getAllKeyValueMap = function getAllKeyValueMap(dataList, involvedKeys, uninvolvedKeys) {\n var keys = []; // 指定了参与计算的keys时,使用指定的keys\n\n if (involvedKeys === null || involvedKeys === void 0 ? void 0 : involvedKeys.length) {\n keys = involvedKeys;\n } else {\n // 未指定抽取的keys时,提取数据中所有的key\n dataList.forEach(function (data) {\n keys = keys.concat(Object.keys(data));\n });\n keys = (0, _util.uniq)(keys);\n } // 获取所有值非空的key的value数组\n\n\n var allKeyValueMap = {};\n keys.forEach(function (key) {\n var value = [];\n dataList.forEach(function (data) {\n if (data[key] !== undefined && data[key] !== '') {\n value.push(data[key]);\n }\n });\n\n if (value.length && !(uninvolvedKeys === null || uninvolvedKeys === void 0 ? void 0 : uninvolvedKeys.includes(key))) {\n allKeyValueMap[key] = (0, _util.uniq)(value);\n }\n });\n return allKeyValueMap;\n};\n/**\n * one-hot编码:数据特征提取\n * @param dataList 数据集\n * @param involvedKeys 参与计算的的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\n\n\nexports.getAllKeyValueMap = getAllKeyValueMap;\n\nvar oneHot = function oneHot(dataList, involvedKeys, uninvolvedKeys) {\n // 获取数据中所有的属性/特征及其对应的值\n var allKeyValueMap = getAllKeyValueMap(dataList, involvedKeys, uninvolvedKeys);\n var oneHotCode = [];\n\n if (!Object.keys(allKeyValueMap).length) {\n return oneHotCode;\n } // 获取所有的属性/特征值\n\n\n var allValue = Object.values(allKeyValueMap); // 是否所有属性/特征的值都是数值型\n\n var isAllNumber = allValue.every(function (value) {\n return value.every(function (item) {\n return typeof item === 'number';\n });\n }); // 对数据进行one-hot编码\n\n dataList.forEach(function (data, index) {\n var code = [];\n Object.keys(allKeyValueMap).forEach(function (key) {\n var keyValue = data[key];\n var allKeyValue = allKeyValueMap[key];\n var valueIndex = allKeyValue.findIndex(function (value) {\n return keyValue === value;\n });\n var subCode = []; // 如果属性/特征所有的值都能转成数值型,不满足分箱,则直接用值(todo: 为了收敛更快,需做归一化处理)\n\n if (isAllNumber) {\n subCode.push(keyValue);\n } else {\n // 进行one-hot编码\n for (var i = 0; i < allKeyValue.length; i++) {\n if (i === valueIndex) {\n subCode.push(1);\n } else {\n subCode.push(0);\n }\n }\n }\n\n code = code.concat(subCode);\n });\n oneHotCode[index] = code;\n });\n return oneHotCode;\n};\n/**\n * getDistance:获取两个元素之间的距离\n * @param item\n * @param otherItem\n * @param distanceType 距离类型\n * @param graphData 图数据\n */\n\n\nexports.oneHot = oneHot;\n\nvar getDistance = function getDistance(item, otherItem, distanceType, graphData) {\n if (distanceType === void 0) {\n distanceType = _types.DistanceType.EuclideanDistance;\n }\n\n var distance = 0;\n\n switch (distanceType) {\n case _types.DistanceType.EuclideanDistance:\n distance = new _vector.default(item).euclideanDistance(new _vector.default(otherItem));\n break;\n\n default:\n break;\n }\n\n return distance;\n};\n\nexports.getDistance = getDistance;\nvar _default = {\n getAllKeyValueMap: getAllKeyValueMap,\n oneHot: oneHot,\n getDistance: getDistance\n};\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/utils/data-preprocessing.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.oneHot = exports.getDistance = exports.getAllKeyValueMap = exports.default = void 0;\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _types = __webpack_require__(/*! ../types */ \"./node_modules/@antv/algorithm/lib/types.js\");\nvar _vector = _interopRequireDefault(__webpack_require__(/*! ./vector */ \"./node_modules/@antv/algorithm/lib/utils/vector.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * 获取数据中所有的属性及其对应的值\n * @param dataList 数据集\n * @param involvedKeys 参与计算的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\nvar getAllKeyValueMap = function getAllKeyValueMap(dataList, involvedKeys, uninvolvedKeys) {\n var keys = [];\n // 指定了参与计算的keys时,使用指定的keys\n if (involvedKeys === null || involvedKeys === void 0 ? void 0 : involvedKeys.length) {\n keys = involvedKeys;\n } else {\n // 未指定抽取的keys时,提取数据中所有的key\n dataList.forEach(function (data) {\n keys = keys.concat(Object.keys(data));\n });\n keys = (0, _util.uniq)(keys);\n }\n // 获取所有值非空的key的value数组\n var allKeyValueMap = {};\n keys.forEach(function (key) {\n var value = [];\n dataList.forEach(function (data) {\n if (data[key] !== undefined && data[key] !== '') {\n value.push(data[key]);\n }\n });\n if (value.length && !(uninvolvedKeys === null || uninvolvedKeys === void 0 ? void 0 : uninvolvedKeys.includes(key))) {\n allKeyValueMap[key] = (0, _util.uniq)(value);\n }\n });\n return allKeyValueMap;\n};\n/**\n * one-hot编码:数据特征提取\n * @param dataList 数据集\n * @param involvedKeys 参与计算的的key集合\n * @param uninvolvedKeys 不参与计算的key集合\n */\nexports.getAllKeyValueMap = getAllKeyValueMap;\nvar oneHot = function oneHot(dataList, involvedKeys, uninvolvedKeys) {\n // 获取数据中所有的属性/特征及其对应的值\n var allKeyValueMap = getAllKeyValueMap(dataList, involvedKeys, uninvolvedKeys);\n var oneHotCode = [];\n if (!Object.keys(allKeyValueMap).length) {\n return oneHotCode;\n }\n // 获取所有的属性/特征值\n var allValue = Object.values(allKeyValueMap);\n // 是否所有属性/特征的值都是数值型\n var isAllNumber = allValue.every(function (value) {\n return value.every(function (item) {\n return typeof item === 'number';\n });\n });\n // 对数据进行one-hot编码\n dataList.forEach(function (data, index) {\n var code = [];\n Object.keys(allKeyValueMap).forEach(function (key) {\n var keyValue = data[key];\n var allKeyValue = allKeyValueMap[key];\n var valueIndex = allKeyValue.findIndex(function (value) {\n return keyValue === value;\n });\n var subCode = [];\n // 如果属性/特征所有的值都能转成数值型,不满足分箱,则直接用值(todo: 为了收敛更快,需做归一化处理)\n if (isAllNumber) {\n subCode.push(keyValue);\n } else {\n // 进行one-hot编码\n for (var i = 0; i < allKeyValue.length; i++) {\n if (i === valueIndex) {\n subCode.push(1);\n } else {\n subCode.push(0);\n }\n }\n }\n code = code.concat(subCode);\n });\n oneHotCode[index] = code;\n });\n return oneHotCode;\n};\n/**\n * getDistance:获取两个元素之间的距离\n * @param item\n * @param otherItem\n * @param distanceType 距离类型\n * @param graphData 图数据\n */\nexports.oneHot = oneHot;\nvar getDistance = function getDistance(item, otherItem, distanceType, graphData) {\n if (distanceType === void 0) {\n distanceType = _types.DistanceType.EuclideanDistance;\n }\n var distance = 0;\n switch (distanceType) {\n case _types.DistanceType.EuclideanDistance:\n distance = new _vector.default(item).euclideanDistance(new _vector.default(otherItem));\n break;\n default:\n break;\n }\n return distance;\n};\nexports.getDistance = getDistance;\nvar _default = {\n getAllKeyValueMap: getAllKeyValueMap,\n oneHot: oneHot,\n getDistance: getDistance\n};\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/utils/data-preprocessing.js?"); /***/ }), @@ -716,7 +716,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getPropertyWeight = exports.getAllSortProperties = exports.getAllProperties = exports.default = void 0;\n\nvar _time = __webpack_require__(/*! ../constants/time */ \"./node_modules/@antv/algorithm/lib/constants/time.js\");\n\n// 获取所有属性并排序\nvar getAllSortProperties = function getAllSortProperties(nodes, n) {\n if (nodes === void 0) {\n nodes = [];\n }\n\n if (n === void 0) {\n n = 100;\n }\n\n var propertyKeyInfo = {};\n nodes.forEach(function (node) {\n if (!node.properties) {\n return;\n }\n\n Object.keys(node.properties).forEach(function (propertyKey) {\n // 目前过滤只保留可以转成数值型的或日期型的, todo: 统一转成one-hot特征向量或者embedding\n if (propertyKey === 'id' || !\"\".concat(node.properties[propertyKey]).match(_time.secondReg) && !\"\".concat(node.properties[propertyKey]).match(_time.dateReg) && isNaN(Number(node.properties[propertyKey]))) {\n if (propertyKeyInfo.hasOwnProperty(propertyKey)) {\n delete propertyKeyInfo[propertyKey];\n }\n\n return;\n }\n\n if (propertyKeyInfo.hasOwnProperty(propertyKey)) {\n propertyKeyInfo[propertyKey] += 1;\n } else {\n propertyKeyInfo[propertyKey] = 1;\n }\n });\n }); // 取top50的属性\n\n var sortKeys = Object.keys(propertyKeyInfo).sort(function (a, b) {\n return propertyKeyInfo[b] - propertyKeyInfo[a];\n });\n return sortKeys.length < n ? sortKeys : sortKeys.slice(0, n);\n};\n\nexports.getAllSortProperties = getAllSortProperties;\n\nvar processProperty = function processProperty(properties, propertyKeys) {\n return propertyKeys.map(function (key) {\n if (properties.hasOwnProperty(key)) {\n // // 可以转成数值的直接转成数值\n // if (!isNaN(Number(properties[key]))) {\n // return Number(properties[key]);\n // }\n // // 时间型的转成时间戳\n // if (properties[key].match(secondReg) || properties[key].match(dateReg)) {\n // // @ts-ignore\n // return Number(Date.parse(new Date(properties[key]))) / 1000;\n // }\n return properties[key];\n }\n\n return 0;\n });\n}; // 获取属性特征权重\n\n\nvar getPropertyWeight = function getPropertyWeight(nodes) {\n var propertyKeys = getAllSortProperties(nodes);\n var allPropertiesWeight = [];\n\n for (var i = 0; i < nodes.length; i++) {\n allPropertiesWeight[i] = processProperty(nodes[i].properties, propertyKeys);\n }\n\n return allPropertiesWeight;\n}; // 获取所有节点的属性集合\n\n\nexports.getPropertyWeight = getPropertyWeight;\n\nvar getAllProperties = function getAllProperties(nodes, key) {\n if (key === void 0) {\n key = undefined;\n }\n\n var allProperties = [];\n nodes.forEach(function (node) {\n if (key === undefined) {\n allProperties.push(node);\n }\n\n if (node[key] !== undefined) {\n allProperties.push(node[key]);\n }\n });\n return allProperties;\n};\n\nexports.getAllProperties = getAllProperties;\nvar _default = {\n getAllSortProperties: getAllSortProperties,\n getPropertyWeight: getPropertyWeight,\n getAllProperties: getAllProperties\n};\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/utils/node-properties.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.getPropertyWeight = exports.getAllSortProperties = exports.getAllProperties = exports.default = void 0;\nvar _time = __webpack_require__(/*! ../constants/time */ \"./node_modules/@antv/algorithm/lib/constants/time.js\");\n// 获取所有属性并排序\nvar getAllSortProperties = function getAllSortProperties(nodes, n) {\n if (nodes === void 0) {\n nodes = [];\n }\n if (n === void 0) {\n n = 100;\n }\n var propertyKeyInfo = {};\n nodes.forEach(function (node) {\n if (!node.properties) {\n return;\n }\n Object.keys(node.properties).forEach(function (propertyKey) {\n // 目前过滤只保留可以转成数值型的或日期型的, todo: 统一转成one-hot特征向量或者embedding\n if (propertyKey === 'id' || !\"\".concat(node.properties[propertyKey]).match(_time.secondReg) && !\"\".concat(node.properties[propertyKey]).match(_time.dateReg) && isNaN(Number(node.properties[propertyKey]))) {\n if (propertyKeyInfo.hasOwnProperty(propertyKey)) {\n delete propertyKeyInfo[propertyKey];\n }\n return;\n }\n if (propertyKeyInfo.hasOwnProperty(propertyKey)) {\n propertyKeyInfo[propertyKey] += 1;\n } else {\n propertyKeyInfo[propertyKey] = 1;\n }\n });\n });\n // 取top50的属性\n var sortKeys = Object.keys(propertyKeyInfo).sort(function (a, b) {\n return propertyKeyInfo[b] - propertyKeyInfo[a];\n });\n return sortKeys.length < n ? sortKeys : sortKeys.slice(0, n);\n};\nexports.getAllSortProperties = getAllSortProperties;\nvar processProperty = function processProperty(properties, propertyKeys) {\n return propertyKeys.map(function (key) {\n if (properties.hasOwnProperty(key)) {\n // // 可以转成数值的直接转成数值\n // if (!isNaN(Number(properties[key]))) {\n // return Number(properties[key]);\n // }\n // // 时间型的转成时间戳\n // if (properties[key].match(secondReg) || properties[key].match(dateReg)) {\n // // @ts-ignore\n // return Number(Date.parse(new Date(properties[key]))) / 1000;\n // }\n return properties[key];\n }\n return 0;\n });\n};\n// 获取属性特征权重\nvar getPropertyWeight = function getPropertyWeight(nodes) {\n var propertyKeys = getAllSortProperties(nodes);\n var allPropertiesWeight = [];\n for (var i = 0; i < nodes.length; i++) {\n allPropertiesWeight[i] = processProperty(nodes[i].properties, propertyKeys);\n }\n return allPropertiesWeight;\n};\n// 获取所有节点的属性集合\nexports.getPropertyWeight = getPropertyWeight;\nvar getAllProperties = function getAllProperties(nodes, key) {\n if (key === void 0) {\n key = undefined;\n }\n var allProperties = [];\n nodes.forEach(function (node) {\n if (key === undefined) {\n allProperties.push(node);\n }\n if (node[key] !== undefined) {\n allProperties.push(node[key]);\n }\n });\n return allProperties;\n};\nexports.getAllProperties = getAllProperties;\nvar _default = {\n getAllSortProperties: getAllSortProperties,\n getPropertyWeight: getPropertyWeight,\n getAllProperties: getAllProperties\n};\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/utils/node-properties.js?"); /***/ }), @@ -728,7 +728,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n/**\n * 向量运算\n */\nvar Vector =\n/** @class */\nfunction () {\n function Vector(arr) {\n this.arr = arr;\n }\n\n Vector.prototype.getArr = function () {\n return this.arr || [];\n };\n\n Vector.prototype.add = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return new Vector(otherArr);\n }\n\n if (!(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return new Vector(this.arr);\n }\n\n if (this.arr.length === otherArr.length) {\n var res = [];\n\n for (var index in this.arr) {\n res[index] = this.arr[index] + otherArr[index];\n }\n\n return new Vector(res);\n }\n };\n\n Vector.prototype.subtract = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return new Vector(otherArr);\n }\n\n if (!(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return new Vector(this.arr);\n }\n\n if (this.arr.length === otherArr.length) {\n var res = [];\n\n for (var index in this.arr) {\n res[index] = this.arr[index] - otherArr[index];\n }\n\n return new Vector(res);\n }\n };\n\n Vector.prototype.avg = function (length) {\n var res = [];\n\n if (length !== 0) {\n for (var index in this.arr) {\n res[index] = this.arr[index] / length;\n }\n }\n\n return new Vector(res);\n };\n\n Vector.prototype.negate = function () {\n var res = [];\n\n for (var index in this.arr) {\n res[index] = -this.arr[index];\n }\n\n return new Vector(res);\n }; // 平方欧式距离\n\n\n Vector.prototype.squareEuclideanDistance = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n\n if (this.arr.length === otherArr.length) {\n var res = 0;\n\n for (var index in this.arr) {\n res += Math.pow(this.arr[index] - otherVector.arr[index], 2);\n }\n\n return res;\n }\n }; // 欧式距离\n\n\n Vector.prototype.euclideanDistance = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n\n if (this.arr.length === otherArr.length) {\n var res = 0;\n\n for (var index in this.arr) {\n res += Math.pow(this.arr[index] - otherVector.arr[index], 2);\n }\n\n return Math.sqrt(res);\n } else {\n console.error('The two vectors are unequal in length.');\n }\n }; // 归一化处理\n\n\n Vector.prototype.normalize = function () {\n var res = [];\n var cloneArr = (0, _util.clone)(this.arr);\n cloneArr.sort(function (a, b) {\n return a - b;\n });\n var max = cloneArr[cloneArr.length - 1];\n var min = cloneArr[0];\n\n for (var index in this.arr) {\n res[index] = (this.arr[index] - min) / (max - min);\n }\n\n return new Vector(res);\n }; // 2范数 or 模长\n\n\n Vector.prototype.norm2 = function () {\n var _a;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return 0;\n }\n\n var res = 0;\n\n for (var index in this.arr) {\n res += Math.pow(this.arr[index], 2);\n }\n\n return Math.sqrt(res);\n }; // 两个向量的点积\n\n\n Vector.prototype.dot = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n\n if (this.arr.length === otherArr.length) {\n var res = 0;\n\n for (var index in this.arr) {\n res += this.arr[index] * otherVector.arr[index];\n }\n\n return res;\n } else {\n console.error('The two vectors are unequal in length.');\n }\n }; // 两个向量比较\n\n\n Vector.prototype.equal = function (otherVector) {\n var _a;\n\n var otherArr = otherVector.arr;\n\n if (((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) !== (otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return false;\n }\n\n for (var index in this.arr) {\n if (this.arr[index] !== otherArr[index]) {\n return false;\n }\n }\n\n return true;\n };\n\n return Vector;\n}();\n\nvar _default = Vector;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/utils/vector.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/**\n * 向量运算\n */\n\nvar Vector = /** @class */function () {\n function Vector(arr) {\n this.arr = arr;\n }\n Vector.prototype.getArr = function () {\n return this.arr || [];\n };\n Vector.prototype.add = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return new Vector(otherArr);\n }\n if (!(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return new Vector(this.arr);\n }\n if (this.arr.length === otherArr.length) {\n var res = [];\n for (var index in this.arr) {\n res[index] = this.arr[index] + otherArr[index];\n }\n return new Vector(res);\n }\n };\n Vector.prototype.subtract = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return new Vector(otherArr);\n }\n if (!(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return new Vector(this.arr);\n }\n if (this.arr.length === otherArr.length) {\n var res = [];\n for (var index in this.arr) {\n res[index] = this.arr[index] - otherArr[index];\n }\n return new Vector(res);\n }\n };\n Vector.prototype.avg = function (length) {\n var res = [];\n if (length !== 0) {\n for (var index in this.arr) {\n res[index] = this.arr[index] / length;\n }\n }\n return new Vector(res);\n };\n Vector.prototype.negate = function () {\n var res = [];\n for (var index in this.arr) {\n res[index] = -this.arr[index];\n }\n return new Vector(res);\n };\n // 平方欧式距离\n Vector.prototype.squareEuclideanDistance = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n if (this.arr.length === otherArr.length) {\n var res = 0;\n for (var index in this.arr) {\n res += Math.pow(this.arr[index] - otherVector.arr[index], 2);\n }\n return res;\n }\n };\n // 欧式距离\n Vector.prototype.euclideanDistance = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n if (this.arr.length === otherArr.length) {\n var res = 0;\n for (var index in this.arr) {\n res += Math.pow(this.arr[index] - otherVector.arr[index], 2);\n }\n return Math.sqrt(res);\n } else {\n console.error('The two vectors are unequal in length.');\n }\n };\n // 归一化处理\n Vector.prototype.normalize = function () {\n var res = [];\n var cloneArr = (0, _util.clone)(this.arr);\n cloneArr.sort(function (a, b) {\n return a - b;\n });\n var max = cloneArr[cloneArr.length - 1];\n var min = cloneArr[0];\n for (var index in this.arr) {\n res[index] = (this.arr[index] - min) / (max - min);\n }\n return new Vector(res);\n };\n // 2范数 or 模长\n Vector.prototype.norm2 = function () {\n var _a;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length)) {\n return 0;\n }\n var res = 0;\n for (var index in this.arr) {\n res += Math.pow(this.arr[index], 2);\n }\n return Math.sqrt(res);\n };\n // 两个向量的点积\n Vector.prototype.dot = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (!((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) || !(otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return 0;\n }\n if (this.arr.length === otherArr.length) {\n var res = 0;\n for (var index in this.arr) {\n res += this.arr[index] * otherVector.arr[index];\n }\n return res;\n } else {\n console.error('The two vectors are unequal in length.');\n }\n };\n // 两个向量比较\n Vector.prototype.equal = function (otherVector) {\n var _a;\n var otherArr = otherVector.arr;\n if (((_a = this.arr) === null || _a === void 0 ? void 0 : _a.length) !== (otherArr === null || otherArr === void 0 ? void 0 : otherArr.length)) {\n return false;\n }\n for (var index in this.arr) {\n if (this.arr[index] !== otherArr[index]) {\n return false;\n }\n }\n return true;\n };\n return Vector;\n}();\nvar _default = Vector;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/utils/vector.js?"); /***/ }), @@ -740,7 +740,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"GADDI\", {\n enumerable: true,\n get: function get() {\n return _gaddi.default;\n }\n});\nObject.defineProperty(exports, \"breadthFirstSearch\", {\n enumerable: true,\n get: function get() {\n return _bfs.default;\n }\n});\nObject.defineProperty(exports, \"connectedComponent\", {\n enumerable: true,\n get: function get() {\n return _connectedComponent.default;\n }\n});\nObject.defineProperty(exports, \"depthFirstSearch\", {\n enumerable: true,\n get: function get() {\n return _dfs.default;\n }\n});\nObject.defineProperty(exports, \"detectCycle\", {\n enumerable: true,\n get: function get() {\n return _detectCycle.default;\n }\n});\nObject.defineProperty(exports, \"dijkstra\", {\n enumerable: true,\n get: function get() {\n return _dijkstra.default;\n }\n});\nObject.defineProperty(exports, \"findAllPath\", {\n enumerable: true,\n get: function get() {\n return _findPath.findAllPath;\n }\n});\nObject.defineProperty(exports, \"findShortestPath\", {\n enumerable: true,\n get: function get() {\n return _findPath.findShortestPath;\n }\n});\nObject.defineProperty(exports, \"floydWarshall\", {\n enumerable: true,\n get: function get() {\n return _floydWarshall.default;\n }\n});\nObject.defineProperty(exports, \"getAdjMatrix\", {\n enumerable: true,\n get: function get() {\n return _adjacentMatrix.default;\n }\n});\nObject.defineProperty(exports, \"getDegree\", {\n enumerable: true,\n get: function get() {\n return _degree.default;\n }\n});\nObject.defineProperty(exports, \"getInDegree\", {\n enumerable: true,\n get: function get() {\n return _degree.getInDegree;\n }\n});\nObject.defineProperty(exports, \"getNeighbors\", {\n enumerable: true,\n get: function get() {\n return _util.getNeighbors;\n }\n});\nObject.defineProperty(exports, \"getOutDegree\", {\n enumerable: true,\n get: function get() {\n return _degree.getOutDegree;\n }\n});\nObject.defineProperty(exports, \"labelPropagation\", {\n enumerable: true,\n get: function get() {\n return _labelPropagation.default;\n }\n});\nObject.defineProperty(exports, \"louvain\", {\n enumerable: true,\n get: function get() {\n return _louvain.default;\n }\n});\nObject.defineProperty(exports, \"minimumSpanningTree\", {\n enumerable: true,\n get: function get() {\n return _mts.default;\n }\n});\nObject.defineProperty(exports, \"pageRank\", {\n enumerable: true,\n get: function get() {\n return _pageRank.default;\n }\n});\n\nvar _adjacentMatrix = _interopRequireDefault(__webpack_require__(/*! ../adjacent-matrix */ \"./node_modules/@antv/algorithm/lib/adjacent-matrix.js\"));\n\nvar _bfs = _interopRequireDefault(__webpack_require__(/*! ../bfs */ \"./node_modules/@antv/algorithm/lib/bfs.js\"));\n\nvar _connectedComponent = _interopRequireDefault(__webpack_require__(/*! ../connected-component */ \"./node_modules/@antv/algorithm/lib/connected-component.js\"));\n\nvar _degree = _interopRequireWildcard(__webpack_require__(/*! ../degree */ \"./node_modules/@antv/algorithm/lib/degree.js\"));\n\nvar _detectCycle = _interopRequireDefault(__webpack_require__(/*! ../detect-cycle */ \"./node_modules/@antv/algorithm/lib/detect-cycle.js\"));\n\nvar _dfs = _interopRequireDefault(__webpack_require__(/*! ../dfs */ \"./node_modules/@antv/algorithm/lib/dfs.js\"));\n\nvar _dijkstra = _interopRequireDefault(__webpack_require__(/*! ../dijkstra */ \"./node_modules/@antv/algorithm/lib/dijkstra.js\"));\n\nvar _findPath = __webpack_require__(/*! ../find-path */ \"./node_modules/@antv/algorithm/lib/find-path.js\");\n\nvar _floydWarshall = _interopRequireDefault(__webpack_require__(/*! ../floydWarshall */ \"./node_modules/@antv/algorithm/lib/floydWarshall.js\"));\n\nvar _labelPropagation = _interopRequireDefault(__webpack_require__(/*! ../label-propagation */ \"./node_modules/@antv/algorithm/lib/label-propagation.js\"));\n\nvar _louvain = _interopRequireDefault(__webpack_require__(/*! ../louvain */ \"./node_modules/@antv/algorithm/lib/louvain.js\"));\n\nvar _mts = _interopRequireDefault(__webpack_require__(/*! ../mts */ \"./node_modules/@antv/algorithm/lib/mts.js\"));\n\nvar _pageRank = _interopRequireDefault(__webpack_require__(/*! ../pageRank */ \"./node_modules/@antv/algorithm/lib/pageRank.js\"));\n\nvar _gaddi = _interopRequireDefault(__webpack_require__(/*! ../gaddi */ \"./node_modules/@antv/algorithm/lib/gaddi.js\"));\n\nvar _util = __webpack_require__(/*! ../util */ \"./node_modules/@antv/algorithm/lib/util.js\");\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/workers/algorithm.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nObject.defineProperty(exports, \"GADDI\", {\n enumerable: true,\n get: function get() {\n return _gaddi.default;\n }\n});\nObject.defineProperty(exports, \"breadthFirstSearch\", {\n enumerable: true,\n get: function get() {\n return _bfs.default;\n }\n});\nObject.defineProperty(exports, \"connectedComponent\", {\n enumerable: true,\n get: function get() {\n return _connectedComponent.default;\n }\n});\nObject.defineProperty(exports, \"depthFirstSearch\", {\n enumerable: true,\n get: function get() {\n return _dfs.default;\n }\n});\nObject.defineProperty(exports, \"detectCycle\", {\n enumerable: true,\n get: function get() {\n return _detectCycle.default;\n }\n});\nObject.defineProperty(exports, \"dijkstra\", {\n enumerable: true,\n get: function get() {\n return _dijkstra.default;\n }\n});\nObject.defineProperty(exports, \"findAllPath\", {\n enumerable: true,\n get: function get() {\n return _findPath.findAllPath;\n }\n});\nObject.defineProperty(exports, \"findShortestPath\", {\n enumerable: true,\n get: function get() {\n return _findPath.findShortestPath;\n }\n});\nObject.defineProperty(exports, \"floydWarshall\", {\n enumerable: true,\n get: function get() {\n return _floydWarshall.default;\n }\n});\nObject.defineProperty(exports, \"getAdjMatrix\", {\n enumerable: true,\n get: function get() {\n return _adjacentMatrix.default;\n }\n});\nObject.defineProperty(exports, \"getDegree\", {\n enumerable: true,\n get: function get() {\n return _degree.default;\n }\n});\nObject.defineProperty(exports, \"getInDegree\", {\n enumerable: true,\n get: function get() {\n return _degree.getInDegree;\n }\n});\nObject.defineProperty(exports, \"getNeighbors\", {\n enumerable: true,\n get: function get() {\n return _util.getNeighbors;\n }\n});\nObject.defineProperty(exports, \"getOutDegree\", {\n enumerable: true,\n get: function get() {\n return _degree.getOutDegree;\n }\n});\nObject.defineProperty(exports, \"labelPropagation\", {\n enumerable: true,\n get: function get() {\n return _labelPropagation.default;\n }\n});\nObject.defineProperty(exports, \"louvain\", {\n enumerable: true,\n get: function get() {\n return _louvain.default;\n }\n});\nObject.defineProperty(exports, \"minimumSpanningTree\", {\n enumerable: true,\n get: function get() {\n return _mts.default;\n }\n});\nObject.defineProperty(exports, \"pageRank\", {\n enumerable: true,\n get: function get() {\n return _pageRank.default;\n }\n});\nvar _adjacentMatrix = _interopRequireDefault(__webpack_require__(/*! ../adjacent-matrix */ \"./node_modules/@antv/algorithm/lib/adjacent-matrix.js\"));\nvar _bfs = _interopRequireDefault(__webpack_require__(/*! ../bfs */ \"./node_modules/@antv/algorithm/lib/bfs.js\"));\nvar _connectedComponent = _interopRequireDefault(__webpack_require__(/*! ../connected-component */ \"./node_modules/@antv/algorithm/lib/connected-component.js\"));\nvar _degree = _interopRequireWildcard(__webpack_require__(/*! ../degree */ \"./node_modules/@antv/algorithm/lib/degree.js\"));\nvar _detectCycle = _interopRequireDefault(__webpack_require__(/*! ../detect-cycle */ \"./node_modules/@antv/algorithm/lib/detect-cycle.js\"));\nvar _dfs = _interopRequireDefault(__webpack_require__(/*! ../dfs */ \"./node_modules/@antv/algorithm/lib/dfs.js\"));\nvar _dijkstra = _interopRequireDefault(__webpack_require__(/*! ../dijkstra */ \"./node_modules/@antv/algorithm/lib/dijkstra.js\"));\nvar _findPath = __webpack_require__(/*! ../find-path */ \"./node_modules/@antv/algorithm/lib/find-path.js\");\nvar _floydWarshall = _interopRequireDefault(__webpack_require__(/*! ../floydWarshall */ \"./node_modules/@antv/algorithm/lib/floydWarshall.js\"));\nvar _labelPropagation = _interopRequireDefault(__webpack_require__(/*! ../label-propagation */ \"./node_modules/@antv/algorithm/lib/label-propagation.js\"));\nvar _louvain = _interopRequireDefault(__webpack_require__(/*! ../louvain */ \"./node_modules/@antv/algorithm/lib/louvain.js\"));\nvar _mts = _interopRequireDefault(__webpack_require__(/*! ../mts */ \"./node_modules/@antv/algorithm/lib/mts.js\"));\nvar _pageRank = _interopRequireDefault(__webpack_require__(/*! ../pageRank */ \"./node_modules/@antv/algorithm/lib/pageRank.js\"));\nvar _gaddi = _interopRequireDefault(__webpack_require__(/*! ../gaddi */ \"./node_modules/@antv/algorithm/lib/gaddi.js\"));\nvar _util = __webpack_require__(/*! ../util */ \"./node_modules/@antv/algorithm/lib/util.js\");\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/workers/algorithm.js?"); /***/ }), @@ -764,7 +764,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/algorithm/lib/workers/constant.js\");\n\nvar _index = _interopRequireDefault(__webpack_require__(/*! ./index.worker */ \"./node_modules/@antv/algorithm/lib/workers/index.worker.js\"));\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * 创建一个在worker中运行的算法\n * @param type 算法类型\n */\nvar createWorker = function createWorker(type) {\n return function () {\n var data = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n data[_i] = arguments[_i];\n }\n\n return new Promise(function (resolve, reject) {\n var worker = new _index.default();\n worker.postMessage({\n _algorithmType: type,\n data: data\n });\n\n worker.onmessage = function (event) {\n var _a = event.data,\n data = _a.data,\n _algorithmType = _a._algorithmType;\n\n if (_constant.MESSAGE.SUCCESS === _algorithmType) {\n resolve(data);\n } else {\n reject();\n }\n\n worker.terminate();\n };\n });\n };\n};\n\nvar _default = createWorker;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/workers/createWorker.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/algorithm/lib/workers/constant.js\");\nvar _index = _interopRequireDefault(__webpack_require__(/*! ./index.worker */ \"./node_modules/@antv/algorithm/lib/workers/index.worker.js\"));\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * 创建一个在worker中运行的算法\n * @param type 算法类型\n */\nvar createWorker = function createWorker(type) {\n return function () {\n var data = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n data[_i] = arguments[_i];\n }\n return new Promise(function (resolve, reject) {\n var worker = new _index.default();\n worker.postMessage({\n _algorithmType: type,\n data: data\n });\n worker.onmessage = function (event) {\n var _a = event.data,\n data = _a.data,\n _algorithmType = _a._algorithmType;\n if (_constant.MESSAGE.SUCCESS === _algorithmType) {\n resolve(data);\n } else {\n reject();\n }\n worker.terminate();\n };\n });\n };\n};\nvar _default = createWorker;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/workers/createWorker.js?"); /***/ }), @@ -776,7 +776,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.pageRankAsync = exports.minimumSpanningTreeAsync = exports.louvainAsync = exports.labelPropagationAsync = exports.getOutDegreeAsync = exports.getNeighborsAsync = exports.getInDegreeAsync = exports.getDegreeAsync = exports.getAdjMatrixAsync = exports.floydWarshallAsync = exports.findShortestPathAsync = exports.findAllPathAsync = exports.dijkstraAsync = exports.detectCycleAsync = exports.detectAllUndirectedCycleAsync = exports.detectAllDirectedCycleAsync = exports.detectAllCyclesAsync = exports.connectedComponentAsync = exports.GADDIAsync = void 0;\n\nvar _createWorker = _interopRequireDefault(__webpack_require__(/*! ./createWorker */ \"./node_modules/@antv/algorithm/lib/workers/createWorker.js\"));\n\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/algorithm/lib/workers/constant.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\n/**\n * @param graphData 图数据\n * @param directed 是否为有向图\n */\nvar getAdjMatrixAsync = function getAdjMatrixAsync(graphData, directed) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getAdjMatrix).apply(void 0, [graphData, directed]);\n};\n/**\n * 图的连通分量\n * @param graphData 图数据\n * @param directed 是否为有向图\n */\n\n\nexports.getAdjMatrixAsync = getAdjMatrixAsync;\n\nvar connectedComponentAsync = function connectedComponentAsync(graphData, directed) {\n return (0, _createWorker.default)(_constant.ALGORITHM.connectedComponent).apply(void 0, [graphData, directed]);\n};\n/**\n * 获取节点的度\n * @param graphData 图数据\n */\n\n\nexports.connectedComponentAsync = connectedComponentAsync;\n\nvar getDegreeAsync = function getDegreeAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getDegree)(graphData);\n};\n/**\n * 获取节点的入度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\n\n\nexports.getDegreeAsync = getDegreeAsync;\n\nvar getInDegreeAsync = function getInDegreeAsync(graphData, nodeId) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getInDegree)(graphData, nodeId);\n};\n/**\n * 获取节点的出度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\n\n\nexports.getInDegreeAsync = getInDegreeAsync;\n\nvar getOutDegreeAsync = function getOutDegreeAsync(graphData, nodeId) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getOutDegree)(graphData, nodeId);\n};\n/**\n * 检测图中的(有向) Cycle\n * @param graphData 图数据\n */\n\n\nexports.getOutDegreeAsync = getOutDegreeAsync;\n\nvar detectCycleAsync = function detectCycleAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.detectCycle)(graphData);\n};\n/**\n * 检测图中的(无向) Cycle\n * @param graphData 图数据\n */\n\n\nexports.detectCycleAsync = detectCycleAsync;\n\nvar detectAllCyclesAsync = function detectAllCyclesAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.detectAllCycles)(graphData);\n};\n/**\n * 检测图中的所有(有向) Cycle\n * @param graphData 图数据\n */\n\n\nexports.detectAllCyclesAsync = detectAllCyclesAsync;\n\nvar detectAllDirectedCycleAsync = function detectAllDirectedCycleAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.detectAllDirectedCycle)(graphData);\n};\n/**\n * 检测图中的所有(无向) Cycle\n * @param graphData 图数据\n */\n\n\nexports.detectAllDirectedCycleAsync = detectAllDirectedCycleAsync;\n\nvar detectAllUndirectedCycleAsync = function detectAllUndirectedCycleAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.detectAllUndirectedCycle)(graphData);\n};\n/**\n * Dijkstra's algorithm, See {@link https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm}\n * @param graphData 图数据\n */\n\n\nexports.detectAllUndirectedCycleAsync = detectAllUndirectedCycleAsync;\n\nvar dijkstraAsync = function dijkstraAsync(graphData, source, directed, weightPropertyName) {\n return (0, _createWorker.default)(_constant.ALGORITHM.dijkstra).apply(void 0, [graphData, source, directed, weightPropertyName]);\n};\n/**\n * 查找两点之间的所有路径\n * @param graphData 图数据\n * @param start 路径起始点ID\n * @param end 路径终点ID\n * @param directed 是否为有向图\n */\n\n\nexports.dijkstraAsync = dijkstraAsync;\n\nvar findAllPathAsync = function findAllPathAsync(graphData, start, end, directed) {\n return (0, _createWorker.default)(_constant.ALGORITHM.findAllPath).apply(void 0, [graphData, start, end, directed]);\n};\n/**\n * 查找两点之间的所有路径\n * @param graphData 图数据\n * @param start 路径起始点ID\n * @param end 路径终点ID\n * @param directed 是否为有向图\n * @param weightPropertyName 边权重的属名称,若数据中没有权重,则默认每条边权重为 1\n */\n\n\nexports.findAllPathAsync = findAllPathAsync;\n\nvar findShortestPathAsync = function findShortestPathAsync(graphData, start, end, directed, weightPropertyName) {\n return (0, _createWorker.default)(_constant.ALGORITHM.findShortestPath).apply(void 0, [graphData, start, end, directed, weightPropertyName]);\n};\n/**\n * Floyd–Warshall algorithm, See {@link https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm}\n * @param graphData 图数据\n * @param directed 是否为有向图\n */\n\n\nexports.findShortestPathAsync = findShortestPathAsync;\n\nvar floydWarshallAsync = function floydWarshallAsync(graphData, directed) {\n return (0, _createWorker.default)(_constant.ALGORITHM.floydWarshall).apply(void 0, [graphData, directed]);\n};\n/**\n * 标签传播算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param maxIteration 最大迭代次数\n */\n\n\nexports.floydWarshallAsync = floydWarshallAsync;\n\nvar labelPropagationAsync = function labelPropagationAsync(graphData, directed, weightPropertyName, maxIteration) {\n if (maxIteration === void 0) {\n maxIteration = 1000;\n }\n\n return (0, _createWorker.default)(_constant.ALGORITHM.labelPropagation)(graphData, directed, weightPropertyName, maxIteration);\n};\n/**\n * 社区发现 louvain 算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param threshold\n */\n\n\nexports.labelPropagationAsync = labelPropagationAsync;\n\nvar louvainAsync = function louvainAsync(graphData, directed, weightPropertyName, threshold) {\n return (0, _createWorker.default)(_constant.ALGORITHM.louvain)(graphData, directed, weightPropertyName, threshold);\n};\n/**\n * 最小生成树,See {@link https://en.wikipedia.org/wiki/Kruskal%27s_algorithm}\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @param algo 'prim' | 'kruskal' 算法类型\n * @return EdgeConfig[] 返回构成MST的边的数组\n */\n\n\nexports.louvainAsync = louvainAsync;\n\nvar minimumSpanningTreeAsync = function minimumSpanningTreeAsync(graphData, weight, algo) {\n return (0, _createWorker.default)(_constant.ALGORITHM.minimumSpanningTree).apply(void 0, [graphData, weight, algo]);\n};\n/**\n * PageRank https://en.wikipedia.org/wiki/PageRank\n * refer: https://github.com/anvaka/ngraph.pagerank\n * @param graph\n * @param epsilon 判断是否收敛的精度值,默认 0.000001\n * @param linkProb 阻尼系数(dumping factor),指任意时刻,用户访问到某节点后继续访问该节点链接的下一个节点的概率,经验值 0.85\n */\n\n\nexports.minimumSpanningTreeAsync = minimumSpanningTreeAsync;\n\nvar pageRankAsync = function pageRankAsync(graphData, epsilon, linkProb) {\n return (0, _createWorker.default)(_constant.ALGORITHM.pageRank).apply(void 0, [graphData, epsilon, linkProb]);\n};\n/**\n * 获取指定节点的所有邻居\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n * @param type 邻居类型\n */\n\n\nexports.pageRankAsync = pageRankAsync;\n\nvar getNeighborsAsync = function getNeighborsAsync(nodeId, edges, type) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getNeighbors).apply(void 0, [nodeId, edges, type]);\n};\n/**\n * GADDI 图模式匹配\n * @param graphData 原图数据\n * @param pattern 搜索图(需要在原图上搜索的模式)数据\n * @param directed 是否计算有向图,默认 false\n * @param k 参数 k,表示 k-近邻\n * @param length 参数 length\n * @param nodeLabelProp 节点数据中代表节点标签(分类信息)的属性名。默认为 cluster\n * @param edgeLabelProp 边数据中代表边标签(分类信息)的属性名。默认为 cluster\n */\n\n\nexports.getNeighborsAsync = getNeighborsAsync;\n\nvar GADDIAsync = function GADDIAsync(graphData, pattern, directed, k, length, nodeLabelProp, edgeLabelProp) {\n if (directed === void 0) {\n directed = false;\n }\n\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n\n if (edgeLabelProp === void 0) {\n edgeLabelProp = 'cluster';\n }\n\n return (0, _createWorker.default)(_constant.ALGORITHM.GADDI).apply(void 0, [graphData, pattern, directed, k, length, nodeLabelProp, edgeLabelProp]);\n};\n\nexports.GADDIAsync = GADDIAsync;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/workers/index.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.pageRankAsync = exports.minimumSpanningTreeAsync = exports.louvainAsync = exports.labelPropagationAsync = exports.getOutDegreeAsync = exports.getNeighborsAsync = exports.getInDegreeAsync = exports.getDegreeAsync = exports.getAdjMatrixAsync = exports.floydWarshallAsync = exports.findShortestPathAsync = exports.findAllPathAsync = exports.dijkstraAsync = exports.detectCycleAsync = exports.detectAllUndirectedCycleAsync = exports.detectAllDirectedCycleAsync = exports.detectAllCyclesAsync = exports.connectedComponentAsync = exports.GADDIAsync = void 0;\nvar _createWorker = _interopRequireDefault(__webpack_require__(/*! ./createWorker */ \"./node_modules/@antv/algorithm/lib/workers/createWorker.js\"));\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/algorithm/lib/workers/constant.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n/**\n * @param graphData 图数据\n * @param directed 是否为有向图\n */\nvar getAdjMatrixAsync = function getAdjMatrixAsync(graphData, directed) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getAdjMatrix).apply(void 0, [graphData, directed]);\n};\n/**\n * 图的连通分量\n * @param graphData 图数据\n * @param directed 是否为有向图\n */\nexports.getAdjMatrixAsync = getAdjMatrixAsync;\nvar connectedComponentAsync = function connectedComponentAsync(graphData, directed) {\n return (0, _createWorker.default)(_constant.ALGORITHM.connectedComponent).apply(void 0, [graphData, directed]);\n};\n/**\n * 获取节点的度\n * @param graphData 图数据\n */\nexports.connectedComponentAsync = connectedComponentAsync;\nvar getDegreeAsync = function getDegreeAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getDegree)(graphData);\n};\n/**\n * 获取节点的入度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\nexports.getDegreeAsync = getDegreeAsync;\nvar getInDegreeAsync = function getInDegreeAsync(graphData, nodeId) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getInDegree)(graphData, nodeId);\n};\n/**\n * 获取节点的出度\n * @param graphData 图数据\n * @param nodeId 节点ID\n */\nexports.getInDegreeAsync = getInDegreeAsync;\nvar getOutDegreeAsync = function getOutDegreeAsync(graphData, nodeId) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getOutDegree)(graphData, nodeId);\n};\n/**\n * 检测图中的(有向) Cycle\n * @param graphData 图数据\n */\nexports.getOutDegreeAsync = getOutDegreeAsync;\nvar detectCycleAsync = function detectCycleAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.detectCycle)(graphData);\n};\n/**\n * 检测图中的(无向) Cycle\n * @param graphData 图数据\n */\nexports.detectCycleAsync = detectCycleAsync;\nvar detectAllCyclesAsync = function detectAllCyclesAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.detectAllCycles)(graphData);\n};\n/**\n * 检测图中的所有(有向) Cycle\n * @param graphData 图数据\n */\nexports.detectAllCyclesAsync = detectAllCyclesAsync;\nvar detectAllDirectedCycleAsync = function detectAllDirectedCycleAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.detectAllDirectedCycle)(graphData);\n};\n/**\n * 检测图中的所有(无向) Cycle\n * @param graphData 图数据\n */\nexports.detectAllDirectedCycleAsync = detectAllDirectedCycleAsync;\nvar detectAllUndirectedCycleAsync = function detectAllUndirectedCycleAsync(graphData) {\n return (0, _createWorker.default)(_constant.ALGORITHM.detectAllUndirectedCycle)(graphData);\n};\n/**\n * Dijkstra's algorithm, See {@link https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm}\n * @param graphData 图数据\n */\nexports.detectAllUndirectedCycleAsync = detectAllUndirectedCycleAsync;\nvar dijkstraAsync = function dijkstraAsync(graphData, source, directed, weightPropertyName) {\n return (0, _createWorker.default)(_constant.ALGORITHM.dijkstra).apply(void 0, [graphData, source, directed, weightPropertyName]);\n};\n/**\n * 查找两点之间的所有路径\n * @param graphData 图数据\n * @param start 路径起始点ID\n * @param end 路径终点ID\n * @param directed 是否为有向图\n */\nexports.dijkstraAsync = dijkstraAsync;\nvar findAllPathAsync = function findAllPathAsync(graphData, start, end, directed) {\n return (0, _createWorker.default)(_constant.ALGORITHM.findAllPath).apply(void 0, [graphData, start, end, directed]);\n};\n/**\n * 查找两点之间的所有路径\n * @param graphData 图数据\n * @param start 路径起始点ID\n * @param end 路径终点ID\n * @param directed 是否为有向图\n * @param weightPropertyName 边权重的属名称,若数据中没有权重,则默认每条边权重为 1\n */\nexports.findAllPathAsync = findAllPathAsync;\nvar findShortestPathAsync = function findShortestPathAsync(graphData, start, end, directed, weightPropertyName) {\n return (0, _createWorker.default)(_constant.ALGORITHM.findShortestPath).apply(void 0, [graphData, start, end, directed, weightPropertyName]);\n};\n/**\n * Floyd–Warshall algorithm, See {@link https://en.wikipedia.org/wiki/Floyd%E2%80%93Warshall_algorithm}\n * @param graphData 图数据\n * @param directed 是否为有向图\n */\nexports.findShortestPathAsync = findShortestPathAsync;\nvar floydWarshallAsync = function floydWarshallAsync(graphData, directed) {\n return (0, _createWorker.default)(_constant.ALGORITHM.floydWarshall).apply(void 0, [graphData, directed]);\n};\n/**\n * 标签传播算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param maxIteration 最大迭代次数\n */\nexports.floydWarshallAsync = floydWarshallAsync;\nvar labelPropagationAsync = function labelPropagationAsync(graphData, directed, weightPropertyName, maxIteration) {\n if (maxIteration === void 0) {\n maxIteration = 1000;\n }\n return (0, _createWorker.default)(_constant.ALGORITHM.labelPropagation)(graphData, directed, weightPropertyName, maxIteration);\n};\n/**\n * 社区发现 louvain 算法\n * @param graphData 图数据\n * @param directed 是否有向图,默认为 false\n * @param weightPropertyName 权重的属性字段\n * @param threshold\n */\nexports.labelPropagationAsync = labelPropagationAsync;\nvar louvainAsync = function louvainAsync(graphData, directed, weightPropertyName, threshold) {\n return (0, _createWorker.default)(_constant.ALGORITHM.louvain)(graphData, directed, weightPropertyName, threshold);\n};\n/**\n * 最小生成树,See {@link https://en.wikipedia.org/wiki/Kruskal%27s_algorithm}\n * @param graph\n * @param weight 指定用于作为边权重的属性,若不指定,则认为所有边权重一致\n * @param algo 'prim' | 'kruskal' 算法类型\n * @return EdgeConfig[] 返回构成MST的边的数组\n */\nexports.louvainAsync = louvainAsync;\nvar minimumSpanningTreeAsync = function minimumSpanningTreeAsync(graphData, weight, algo) {\n return (0, _createWorker.default)(_constant.ALGORITHM.minimumSpanningTree).apply(void 0, [graphData, weight, algo]);\n};\n/**\n * PageRank https://en.wikipedia.org/wiki/PageRank\n * refer: https://github.com/anvaka/ngraph.pagerank\n * @param graph\n * @param epsilon 判断是否收敛的精度值,默认 0.000001\n * @param linkProb 阻尼系数(dumping factor),指任意时刻,用户访问到某节点后继续访问该节点链接的下一个节点的概率,经验值 0.85\n */\nexports.minimumSpanningTreeAsync = minimumSpanningTreeAsync;\nvar pageRankAsync = function pageRankAsync(graphData, epsilon, linkProb) {\n return (0, _createWorker.default)(_constant.ALGORITHM.pageRank).apply(void 0, [graphData, epsilon, linkProb]);\n};\n/**\n * 获取指定节点的所有邻居\n * @param nodeId 节点 ID\n * @param edges 图中的所有边数据\n * @param type 邻居类型\n */\nexports.pageRankAsync = pageRankAsync;\nvar getNeighborsAsync = function getNeighborsAsync(nodeId, edges, type) {\n return (0, _createWorker.default)(_constant.ALGORITHM.getNeighbors).apply(void 0, [nodeId, edges, type]);\n};\n/**\n * GADDI 图模式匹配\n * @param graphData 原图数据\n * @param pattern 搜索图(需要在原图上搜索的模式)数据\n * @param directed 是否计算有向图,默认 false\n * @param k 参数 k,表示 k-近邻\n * @param length 参数 length\n * @param nodeLabelProp 节点数据中代表节点标签(分类信息)的属性名。默认为 cluster\n * @param edgeLabelProp 边数据中代表边标签(分类信息)的属性名。默认为 cluster\n */\nexports.getNeighborsAsync = getNeighborsAsync;\nvar GADDIAsync = function GADDIAsync(graphData, pattern, directed, k, length, nodeLabelProp, edgeLabelProp) {\n if (directed === void 0) {\n directed = false;\n }\n if (nodeLabelProp === void 0) {\n nodeLabelProp = 'cluster';\n }\n if (edgeLabelProp === void 0) {\n edgeLabelProp = 'cluster';\n }\n return (0, _createWorker.default)(_constant.ALGORITHM.GADDI).apply(void 0, [graphData, pattern, directed, k, length, nodeLabelProp, edgeLabelProp]);\n};\nexports.GADDIAsync = GADDIAsync;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/workers/index.js?"); /***/ }), @@ -788,7 +788,7 @@ eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar algorithm = _interopRequireWildcard(__webpack_require__(/*! ./algorithm */ \"./node_modules/@antv/algorithm/lib/workers/algorithm.js\"));\n\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/algorithm/lib/workers/constant.js\");\n\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\n\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\n\nvar ctx = typeof self !== 'undefined' ? self : {};\n\nctx.onmessage = function (event) {\n var _a = event.data,\n _algorithmType = _a._algorithmType,\n data = _a.data; // 如果发送内容没有私有类型。说明不是自己发的。不管\n // fix: https://github.com/antvis/algorithm/issues/25\n\n if (!_algorithmType) {\n return;\n }\n\n if (typeof algorithm[_algorithmType] === 'function') {\n var result = algorithm[_algorithmType].apply(algorithm, data);\n\n ctx.postMessage({\n _algorithmType: _constant.MESSAGE.SUCCESS,\n data: result\n });\n return;\n }\n\n ctx.postMessage({\n _algorithmType: _constant.MESSAGE.FAILURE\n });\n}; // https://stackoverflow.com/questions/50210416/webpack-worker-loader-fails-to-compile-typescript-worker\n\n\nvar _default = null;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/workers/index.worker.js?"); +eval("\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar algorithm = _interopRequireWildcard(__webpack_require__(/*! ./algorithm */ \"./node_modules/@antv/algorithm/lib/workers/algorithm.js\"));\nvar _constant = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/algorithm/lib/workers/constant.js\");\nfunction _getRequireWildcardCache(nodeInterop) { if (typeof WeakMap !== \"function\") return null; var cacheBabelInterop = new WeakMap(); var cacheNodeInterop = new WeakMap(); return (_getRequireWildcardCache = function _getRequireWildcardCache(nodeInterop) { return nodeInterop ? cacheNodeInterop : cacheBabelInterop; })(nodeInterop); }\nfunction _interopRequireWildcard(obj, nodeInterop) { if (!nodeInterop && obj && obj.__esModule) { return obj; } if (obj === null || _typeof(obj) !== \"object\" && typeof obj !== \"function\") { return { default: obj }; } var cache = _getRequireWildcardCache(nodeInterop); if (cache && cache.has(obj)) { return cache.get(obj); } var newObj = {}; var hasPropertyDescriptor = Object.defineProperty && Object.getOwnPropertyDescriptor; for (var key in obj) { if (key !== \"default\" && Object.prototype.hasOwnProperty.call(obj, key)) { var desc = hasPropertyDescriptor ? Object.getOwnPropertyDescriptor(obj, key) : null; if (desc && (desc.get || desc.set)) { Object.defineProperty(newObj, key, desc); } else { newObj[key] = obj[key]; } } } newObj.default = obj; if (cache) { cache.set(obj, newObj); } return newObj; }\nvar ctx = typeof self !== 'undefined' ? self : {};\nctx.onmessage = function (event) {\n var _a = event.data,\n _algorithmType = _a._algorithmType,\n data = _a.data;\n // 如果发送内容没有私有类型。说明不是自己发的。不管\n // fix: https://github.com/antvis/algorithm/issues/25\n if (!_algorithmType) {\n return;\n }\n if (typeof algorithm[_algorithmType] === 'function') {\n var result = algorithm[_algorithmType].apply(algorithm, data);\n ctx.postMessage({\n _algorithmType: _constant.MESSAGE.SUCCESS,\n data: result\n });\n return;\n }\n ctx.postMessage({\n _algorithmType: _constant.MESSAGE.FAILURE\n });\n};\n// https://stackoverflow.com/questions/50210416/webpack-worker-loader-fails-to-compile-typescript-worker\nvar _default = null;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/algorithm/lib/workers/index.worker.js?"); /***/ }), @@ -956,7 +956,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tsli /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ \"./node_modules/@antv/g-base/esm/abstract/element.js\");\n/* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/util */ \"./node_modules/@antv/g-base/esm/util/util.js\");\n\n\n\n\nvar SHAPE_MAP = {};\nvar INDEX = '_INDEX';\n/**\n * 设置 canvas\n * @param {IElement} element 元素\n * @param {ICanvas} canvas 画布\n */\nfunction setCanvas(element, canvas) {\n element.set('canvas', canvas);\n if (element.isGroup()) {\n var children = element.get('children');\n if (children.length) {\n children.forEach(function (child) {\n setCanvas(child, canvas);\n });\n }\n }\n}\n/**\n * 设置 timeline\n * @param {IElement} element 元素\n * @param {Timeline} timeline 时间轴\n */\nfunction setTimeline(element, timeline) {\n element.set('timeline', timeline);\n if (element.isGroup()) {\n var children = element.get('children');\n if (children.length) {\n children.forEach(function (child) {\n setTimeline(child, timeline);\n });\n }\n }\n}\nfunction contains(container, element) {\n var children = container.getChildren();\n return children.indexOf(element) >= 0;\n}\nfunction removeChild(container, element, destroy) {\n if (destroy === void 0) { destroy = true; }\n // 不再调用 element.remove() 方法,会出现循环调用\n if (destroy) {\n element.destroy();\n }\n else {\n element.set('parent', null);\n element.set('canvas', null);\n }\n Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"removeFromArray\"])(container.getChildren(), element);\n}\nfunction getComparer(compare) {\n return function (left, right) {\n var result = compare(left, right);\n return result === 0 ? left[INDEX] - right[INDEX] : result;\n };\n}\nvar Container = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Container, _super);\n function Container() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Container.prototype.isCanvas = function () {\n return false;\n };\n // 根据子节点确定 BBox\n Container.prototype.getBBox = function () {\n // 所有的值可能在画布的可视区外\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n var xArr = [];\n var yArr = [];\n // 将可见元素、图形以及不为空的图形分组筛选出来,用于包围盒合并\n var children = this.getChildren().filter(function (child) {\n return child.get('visible') && (!child.isGroup() || (child.isGroup() && child.getChildren().length > 0));\n });\n if (children.length > 0) {\n Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(children, function (child) {\n var box = child.getBBox();\n xArr.push(box.minX, box.maxX);\n yArr.push(box.minY, box.maxY);\n });\n minX = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"min\"])(xArr);\n maxX = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"max\"])(xArr);\n minY = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"min\"])(yArr);\n maxY = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"max\"])(yArr);\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var box = {\n x: minX,\n y: minY,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n width: maxX - minX,\n height: maxY - minY,\n };\n return box;\n };\n // 获取画布的包围盒\n Container.prototype.getCanvasBBox = function () {\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n var xArr = [];\n var yArr = [];\n // 将可见元素、图形以及不为空的图形分组筛选出来,用于包围盒合并\n var children = this.getChildren().filter(function (child) {\n return child.get('visible') && (!child.isGroup() || (child.isGroup() && child.getChildren().length > 0));\n });\n if (children.length > 0) {\n Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(children, function (child) {\n var box = child.getCanvasBBox();\n xArr.push(box.minX, box.maxX);\n yArr.push(box.minY, box.maxY);\n });\n minX = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"min\"])(xArr);\n maxX = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"max\"])(xArr);\n minY = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"min\"])(yArr);\n maxY = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"max\"])(yArr);\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var box = {\n x: minX,\n y: minY,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n width: maxX - minX,\n height: maxY - minY,\n };\n return box;\n };\n Container.prototype.getDefaultCfg = function () {\n var cfg = _super.prototype.getDefaultCfg.call(this);\n cfg['children'] = [];\n return cfg;\n };\n Container.prototype.onAttrChange = function (name, value, originValue) {\n _super.prototype.onAttrChange.call(this, name, value, originValue);\n if (name === 'matrix') {\n var totalMatrix = this.getTotalMatrix();\n this._applyChildrenMarix(totalMatrix);\n }\n };\n // 不但应用到自己身上还要应用于子元素\n Container.prototype.applyMatrix = function (matrix) {\n var preTotalMatrix = this.getTotalMatrix();\n _super.prototype.applyMatrix.call(this, matrix);\n var totalMatrix = this.getTotalMatrix();\n // totalMatrix 没有发生变化时,这里仅考虑两者都为 null 时\n // 不继续向下传递矩阵\n if (totalMatrix === preTotalMatrix) {\n return;\n }\n this._applyChildrenMarix(totalMatrix);\n };\n // 在子元素上设置矩阵\n Container.prototype._applyChildrenMarix = function (totalMatrix) {\n var children = this.getChildren();\n Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(children, function (child) {\n child.applyMatrix(totalMatrix);\n });\n };\n // 兼容老版本的接口\n Container.prototype.addShape = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var type = args[0];\n var cfg = args[1];\n if (Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"isObject\"])(type)) {\n cfg = type;\n }\n else {\n cfg['type'] = type;\n }\n var shapeType = SHAPE_MAP[cfg.type];\n if (!shapeType) {\n shapeType = Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"upperFirst\"])(cfg.type);\n SHAPE_MAP[cfg.type] = shapeType;\n }\n var ShapeBase = this.getShapeBase();\n var shape = new ShapeBase[shapeType](cfg);\n this.add(shape);\n return shape;\n };\n Container.prototype.addGroup = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var groupClass = args[0], cfg = args[1];\n var group;\n if (Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"isFunction\"])(groupClass)) {\n if (cfg) {\n group = new groupClass(cfg);\n }\n else {\n group = new groupClass({\n // canvas,\n parent: this,\n });\n }\n }\n else {\n var tmpCfg = groupClass || {};\n var TmpGroupClass = this.getGroupBase();\n group = new TmpGroupClass(tmpCfg);\n }\n this.add(group);\n return group;\n };\n Container.prototype.getCanvas = function () {\n var canvas;\n if (this.isCanvas()) {\n canvas = this;\n }\n else {\n canvas = this.get('canvas');\n }\n return canvas;\n };\n Container.prototype.getShape = function (x, y, ev) {\n // 如果不支持拾取,则直接返回\n if (!Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"isAllowCapture\"])(this)) {\n return null;\n }\n var children = this.getChildren();\n var shape;\n // 如果容器是 group\n if (!this.isCanvas()) {\n var v = [x, y, 1];\n // 将 x, y 转换成对应于 group 的局部坐标\n v = this.invertFromMatrix(v);\n if (!this.isClipped(v[0], v[1])) {\n shape = this._findShape(children, v[0], v[1], ev);\n }\n }\n else {\n shape = this._findShape(children, x, y, ev);\n }\n return shape;\n };\n Container.prototype._findShape = function (children, x, y, ev) {\n var shape = null;\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n if (Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"isAllowCapture\"])(child)) {\n if (child.isGroup()) {\n shape = child.getShape(x, y, ev);\n }\n else if (child.isHit(x, y)) {\n shape = child;\n }\n }\n if (shape) {\n break;\n }\n }\n return shape;\n };\n Container.prototype.add = function (element) {\n var canvas = this.getCanvas();\n var children = this.getChildren();\n var timeline = this.get('timeline');\n var preParent = element.getParent();\n if (preParent) {\n removeChild(preParent, element, false);\n }\n element.set('parent', this);\n if (canvas) {\n setCanvas(element, canvas);\n }\n if (timeline) {\n setTimeline(element, timeline);\n }\n children.push(element);\n element.onCanvasChange('add');\n this._applyElementMatrix(element);\n };\n // 将当前容器的矩阵应用到子元素\n Container.prototype._applyElementMatrix = function (element) {\n var totalMatrix = this.getTotalMatrix();\n // 添加图形或者分组时,需要把当前图元的矩阵设置进去\n if (totalMatrix) {\n element.applyMatrix(totalMatrix);\n }\n };\n Container.prototype.getChildren = function () {\n return this.get('children');\n };\n Container.prototype.sort = function () {\n var children = this.getChildren();\n // 稳定排序\n Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(children, function (child, index) {\n child[INDEX] = index;\n return child;\n });\n children.sort(getComparer(function (obj1, obj2) {\n return obj1.get('zIndex') - obj2.get('zIndex');\n }));\n this.onCanvasChange('sort');\n };\n Container.prototype.clear = function () {\n this.set('clearing', true);\n if (this.destroyed) {\n return;\n }\n var children = this.getChildren();\n for (var i = children.length - 1; i >= 0; i--) {\n children[i].destroy(); // 销毁子元素\n }\n this.set('children', []);\n this.onCanvasChange('clear');\n this.set('clearing', false);\n };\n Container.prototype.destroy = function () {\n if (this.get('destroyed')) {\n return;\n }\n this.clear();\n _super.prototype.destroy.call(this);\n };\n /**\n * 获取第一个子元素\n * @return {IElement} 第一个元素\n */\n Container.prototype.getFirst = function () {\n return this.getChildByIndex(0);\n };\n /**\n * 获取最后一个子元素\n * @return {IElement} 元素\n */\n Container.prototype.getLast = function () {\n var children = this.getChildren();\n return this.getChildByIndex(children.length - 1);\n };\n /**\n * 根据索引获取子元素\n * @return {IElement} 第一个元素\n */\n Container.prototype.getChildByIndex = function (index) {\n var children = this.getChildren();\n return children[index];\n };\n /**\n * 子元素的数量\n * @return {number} 子元素数量\n */\n Container.prototype.getCount = function () {\n var children = this.getChildren();\n return children.length;\n };\n /**\n * 是否包含对应元素\n * @param {IElement} element 元素\n * @return {boolean}\n */\n Container.prototype.contain = function (element) {\n var children = this.getChildren();\n return children.indexOf(element) > -1;\n };\n /**\n * 移除对应子元素\n * @param {IElement} element 子元素\n * @param {boolean} destroy 是否销毁子元素,默认为 true\n */\n Container.prototype.removeChild = function (element, destroy) {\n if (destroy === void 0) { destroy = true; }\n if (this.contain(element)) {\n element.remove(destroy);\n }\n };\n /**\n * 查找所有匹配的元素\n * @param {ElementFilterFn} fn 匹配函数\n * @return {IElement[]} 元素数组\n */\n Container.prototype.findAll = function (fn) {\n var rst = [];\n var children = this.getChildren();\n Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(children, function (element) {\n if (fn(element)) {\n rst.push(element);\n }\n if (element.isGroup()) {\n rst = rst.concat(element.findAll(fn));\n }\n });\n return rst;\n };\n /**\n * 查找元素,找到第一个返回\n * @param {ElementFilterFn} fn 匹配函数\n * @return {IElement|null} 元素,可以为空\n */\n Container.prototype.find = function (fn) {\n var rst = null;\n var children = this.getChildren();\n Object(_util_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(children, function (element) {\n if (fn(element)) {\n rst = element;\n }\n else if (element.isGroup()) {\n rst = element.find(fn);\n }\n if (rst) {\n return false;\n }\n });\n return rst;\n };\n /**\n * 根据 ID 查找元素\n * @param {string} id 元素 id\n * @return {IElement|null} 元素\n */\n Container.prototype.findById = function (id) {\n return this.find(function (element) {\n return element.get('id') === id;\n });\n };\n /**\n * 该方法即将废弃,不建议使用\n * 根据 className 查找元素\n * TODO: 该方式定义暂时只给 G6 3.3 以后的版本使用,待 G6 中的 findByClassName 方法移除后,G 也需要同步移除\n * @param {string} className 元素 className\n * @return {IElement | null} 元素\n */\n Container.prototype.findByClassName = function (className) {\n return this.find(function (element) {\n return element.get('className') === className;\n });\n };\n /**\n * 根据 name 查找元素列表\n * @param {string} name 元素名称\n * @return {IElement[]} 元素\n */\n Container.prototype.findAllByName = function (name) {\n return this.findAll(function (element) {\n return element.get('name') === name;\n });\n };\n return Container;\n}(_element__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Container);\n//# sourceMappingURL=container.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/abstract/container.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./element */ \"./node_modules/@antv/g-base/esm/abstract/element.js\");\n/* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/util */ \"./node_modules/@antv/g-base/esm/util/util.js\");\n\n\n\nvar SHAPE_MAP = {};\nvar INDEX = '_INDEX';\n/**\n * 设置 canvas\n * @param {IElement} element 元素\n * @param {ICanvas} canvas 画布\n */\nfunction setCanvas(element, canvas) {\n element.set('canvas', canvas);\n if (element.isGroup()) {\n var children = element.get('children');\n if (children.length) {\n children.forEach(function (child) {\n setCanvas(child, canvas);\n });\n }\n }\n}\n/**\n * 设置 timeline\n * @param {IElement} element 元素\n * @param {Timeline} timeline 时间轴\n */\nfunction setTimeline(element, timeline) {\n element.set('timeline', timeline);\n if (element.isGroup()) {\n var children = element.get('children');\n if (children.length) {\n children.forEach(function (child) {\n setTimeline(child, timeline);\n });\n }\n }\n}\nfunction contains(container, element) {\n var children = container.getChildren();\n return children.indexOf(element) >= 0;\n}\nfunction removeChild(container, element, destroy) {\n if (destroy === void 0) { destroy = true; }\n // 不再调用 element.remove() 方法,会出现循环调用\n if (destroy) {\n element.destroy();\n }\n else {\n element.set('parent', null);\n element.set('canvas', null);\n }\n Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"removeFromArray\"])(container.getChildren(), element);\n}\nfunction getComparer(compare) {\n return function (left, right) {\n var result = compare(left, right);\n return result === 0 ? left[INDEX] - right[INDEX] : result;\n };\n}\nvar Container = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Container, _super);\n function Container() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Container.prototype.isCanvas = function () {\n return false;\n };\n // 根据子节点确定 BBox\n Container.prototype.getBBox = function () {\n // 所有的值可能在画布的可视区外\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n // 将可见元素、图形以及不为空的图形分组筛选出来,用于包围盒合并\n var children = this.getChildren().filter(function (child) {\n return child.get('visible') && (!child.isGroup() || (child.isGroup() && child.getChildren().length > 0));\n });\n if (children.length > 0) {\n Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(children, function (child) {\n var _a = child.getBBox(), childMinX = _a.minX, childMaxX = _a.maxX, childMinY = _a.minY, childMaxY = _a.maxY;\n if (childMinX < minX) {\n minX = childMinX;\n }\n if (childMaxX > maxX) {\n maxX = childMaxX;\n }\n if (childMinY < minY) {\n minY = childMinY;\n }\n if (childMaxY > maxY) {\n maxY = childMaxY;\n }\n });\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var box = {\n x: minX,\n y: minY,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n width: maxX - minX,\n height: maxY - minY,\n };\n return box;\n };\n // 获取画布的包围盒\n Container.prototype.getCanvasBBox = function () {\n var minX = Infinity;\n var maxX = -Infinity;\n var minY = Infinity;\n var maxY = -Infinity;\n // 将可见元素、图形以及不为空的图形分组筛选出来,用于包围盒合并\n var children = this.getChildren().filter(function (child) {\n return child.get('visible') && (!child.isGroup() || (child.isGroup() && child.getChildren().length > 0));\n });\n if (children.length > 0) {\n Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(children, function (child) {\n var _a = child.getCanvasBBox(), childMinX = _a.minX, childMaxX = _a.maxX, childMinY = _a.minY, childMaxY = _a.maxY;\n if (childMinX < minX) {\n minX = childMinX;\n }\n if (childMaxX > maxX) {\n maxX = childMaxX;\n }\n if (childMinY < minY) {\n minY = childMinY;\n }\n if (childMaxY > maxY) {\n maxY = childMaxY;\n }\n });\n }\n else {\n minX = 0;\n maxX = 0;\n minY = 0;\n maxY = 0;\n }\n var box = {\n x: minX,\n y: minY,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n width: maxX - minX,\n height: maxY - minY,\n };\n return box;\n };\n Container.prototype.getDefaultCfg = function () {\n var cfg = _super.prototype.getDefaultCfg.call(this);\n cfg['children'] = [];\n return cfg;\n };\n Container.prototype.onAttrChange = function (name, value, originValue) {\n _super.prototype.onAttrChange.call(this, name, value, originValue);\n if (name === 'matrix') {\n var totalMatrix = this.getTotalMatrix();\n this._applyChildrenMarix(totalMatrix);\n }\n };\n // 不但应用到自己身上还要应用于子元素\n Container.prototype.applyMatrix = function (matrix) {\n var preTotalMatrix = this.getTotalMatrix();\n _super.prototype.applyMatrix.call(this, matrix);\n var totalMatrix = this.getTotalMatrix();\n // totalMatrix 没有发生变化时,这里仅考虑两者都为 null 时\n // 不继续向下传递矩阵\n if (totalMatrix === preTotalMatrix) {\n return;\n }\n this._applyChildrenMarix(totalMatrix);\n };\n // 在子元素上设置矩阵\n Container.prototype._applyChildrenMarix = function (totalMatrix) {\n var children = this.getChildren();\n Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(children, function (child) {\n child.applyMatrix(totalMatrix);\n });\n };\n // 兼容老版本的接口\n Container.prototype.addShape = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var type = args[0];\n var cfg = args[1];\n if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"isObject\"])(type)) {\n cfg = type;\n }\n else {\n cfg['type'] = type;\n }\n var shapeType = SHAPE_MAP[cfg.type];\n if (!shapeType) {\n shapeType = Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"upperFirst\"])(cfg.type);\n SHAPE_MAP[cfg.type] = shapeType;\n }\n var ShapeBase = this.getShapeBase();\n var shape = new ShapeBase[shapeType](cfg);\n this.add(shape);\n return shape;\n };\n Container.prototype.addGroup = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var groupClass = args[0], cfg = args[1];\n var group;\n if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"isFunction\"])(groupClass)) {\n if (cfg) {\n group = new groupClass(cfg);\n }\n else {\n group = new groupClass({\n // canvas,\n parent: this,\n });\n }\n }\n else {\n var tmpCfg = groupClass || {};\n var TmpGroupClass = this.getGroupBase();\n group = new TmpGroupClass(tmpCfg);\n }\n this.add(group);\n return group;\n };\n Container.prototype.getCanvas = function () {\n var canvas;\n if (this.isCanvas()) {\n canvas = this;\n }\n else {\n canvas = this.get('canvas');\n }\n return canvas;\n };\n Container.prototype.getShape = function (x, y, ev) {\n // 如果不支持拾取,则直接返回\n if (!Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"isAllowCapture\"])(this)) {\n return null;\n }\n var children = this.getChildren();\n var shape;\n // 如果容器是 group\n if (!this.isCanvas()) {\n var v = [x, y, 1];\n // 将 x, y 转换成对应于 group 的局部坐标\n v = this.invertFromMatrix(v);\n if (!this.isClipped(v[0], v[1])) {\n shape = this._findShape(children, v[0], v[1], ev);\n }\n }\n else {\n shape = this._findShape(children, x, y, ev);\n }\n return shape;\n };\n Container.prototype._findShape = function (children, x, y, ev) {\n var shape = null;\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i];\n if (Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"isAllowCapture\"])(child)) {\n if (child.isGroup()) {\n shape = child.getShape(x, y, ev);\n }\n else if (child.isHit(x, y)) {\n shape = child;\n }\n }\n if (shape) {\n break;\n }\n }\n return shape;\n };\n Container.prototype.add = function (element) {\n var canvas = this.getCanvas();\n var children = this.getChildren();\n var timeline = this.get('timeline');\n var preParent = element.getParent();\n if (preParent) {\n removeChild(preParent, element, false);\n }\n element.set('parent', this);\n if (canvas) {\n setCanvas(element, canvas);\n }\n if (timeline) {\n setTimeline(element, timeline);\n }\n children.push(element);\n element.onCanvasChange('add');\n this._applyElementMatrix(element);\n };\n // 将当前容器的矩阵应用到子元素\n Container.prototype._applyElementMatrix = function (element) {\n var totalMatrix = this.getTotalMatrix();\n // 添加图形或者分组时,需要把当前图元的矩阵设置进去\n if (totalMatrix) {\n element.applyMatrix(totalMatrix);\n }\n };\n Container.prototype.getChildren = function () {\n return this.get('children');\n };\n Container.prototype.sort = function () {\n var children = this.getChildren();\n // 稳定排序\n Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(children, function (child, index) {\n child[INDEX] = index;\n return child;\n });\n children.sort(getComparer(function (obj1, obj2) {\n return obj1.get('zIndex') - obj2.get('zIndex');\n }));\n this.onCanvasChange('sort');\n };\n Container.prototype.clear = function () {\n this.set('clearing', true);\n if (this.destroyed) {\n return;\n }\n var children = this.getChildren();\n for (var i = children.length - 1; i >= 0; i--) {\n children[i].destroy(); // 销毁子元素\n }\n this.set('children', []);\n this.onCanvasChange('clear');\n this.set('clearing', false);\n };\n Container.prototype.destroy = function () {\n if (this.get('destroyed')) {\n return;\n }\n this.clear();\n _super.prototype.destroy.call(this);\n };\n /**\n * 获取第一个子元素\n * @return {IElement} 第一个元素\n */\n Container.prototype.getFirst = function () {\n return this.getChildByIndex(0);\n };\n /**\n * 获取最后一个子元素\n * @return {IElement} 元素\n */\n Container.prototype.getLast = function () {\n var children = this.getChildren();\n return this.getChildByIndex(children.length - 1);\n };\n /**\n * 根据索引获取子元素\n * @return {IElement} 第一个元素\n */\n Container.prototype.getChildByIndex = function (index) {\n var children = this.getChildren();\n return children[index];\n };\n /**\n * 子元素的数量\n * @return {number} 子元素数量\n */\n Container.prototype.getCount = function () {\n var children = this.getChildren();\n return children.length;\n };\n /**\n * 是否包含对应元素\n * @param {IElement} element 元素\n * @return {boolean}\n */\n Container.prototype.contain = function (element) {\n var children = this.getChildren();\n return children.indexOf(element) > -1;\n };\n /**\n * 移除对应子元素\n * @param {IElement} element 子元素\n * @param {boolean} destroy 是否销毁子元素,默认为 true\n */\n Container.prototype.removeChild = function (element, destroy) {\n if (destroy === void 0) { destroy = true; }\n if (this.contain(element)) {\n element.remove(destroy);\n }\n };\n /**\n * 查找所有匹配的元素\n * @param {ElementFilterFn} fn 匹配函数\n * @return {IElement[]} 元素数组\n */\n Container.prototype.findAll = function (fn) {\n var rst = [];\n var children = this.getChildren();\n Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(children, function (element) {\n if (fn(element)) {\n rst.push(element);\n }\n if (element.isGroup()) {\n rst = rst.concat(element.findAll(fn));\n }\n });\n return rst;\n };\n /**\n * 查找元素,找到第一个返回\n * @param {ElementFilterFn} fn 匹配函数\n * @return {IElement|null} 元素,可以为空\n */\n Container.prototype.find = function (fn) {\n var rst = null;\n var children = this.getChildren();\n Object(_util_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(children, function (element) {\n if (fn(element)) {\n rst = element;\n }\n else if (element.isGroup()) {\n rst = element.find(fn);\n }\n if (rst) {\n return false;\n }\n });\n return rst;\n };\n /**\n * 根据 ID 查找元素\n * @param {string} id 元素 id\n * @return {IElement|null} 元素\n */\n Container.prototype.findById = function (id) {\n return this.find(function (element) {\n return element.get('id') === id;\n });\n };\n /**\n * 该方法即将废弃,不建议使用\n * 根据 className 查找元素\n * TODO: 该方式定义暂时只给 G6 3.3 以后的版本使用,待 G6 中的 findByClassName 方法移除后,G 也需要同步移除\n * @param {string} className 元素 className\n * @return {IElement | null} 元素\n */\n Container.prototype.findByClassName = function (className) {\n return this.find(function (element) {\n return element.get('className') === className;\n });\n };\n /**\n * 根据 name 查找元素列表\n * @param {string} name 元素名称\n * @return {IElement[]} 元素\n */\n Container.prototype.findAllByName = function (name) {\n return this.findAll(function (element) {\n return element.get('name') === name;\n });\n };\n return Container;\n}(_element__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Container);\n//# sourceMappingURL=container.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/abstract/container.js?"); /***/ }), @@ -1016,7 +1016,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-timer */ \"./node_modules/d3-timer/src/index.js\");\n/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-interpolate */ \"./node_modules/d3-interpolate/src/index.js\");\n/* harmony import */ var _register__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./register */ \"./node_modules/@antv/g-base/esm/animate/register.js\");\n/* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/path */ \"./node_modules/@antv/g-base/esm/util/path.js\");\n/* harmony import */ var _util_color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/color */ \"./node_modules/@antv/g-base/esm/util/color.js\");\n\n\n // 目前整体动画只需要数值和数组的差值计算\n\n\n\nvar IDENTITY_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n/**\n * 使用 ratio 进行插值计算来更新属性\n * @param {IElement} shape 元素\n * @param {Animation} animation 动画\n * @param {number} ratio 比例\n * @return {boolean} 动画是否执行完成\n */\nfunction _update(shape, animation, ratio) {\n var cProps = {}; // 此刻属性\n var fromAttrs = animation.fromAttrs, toAttrs = animation.toAttrs;\n if (shape.destroyed) {\n return;\n }\n var interf; // 差值函数\n for (var k in toAttrs) {\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isEqual\"])(fromAttrs[k], toAttrs[k])) {\n if (k === 'path') {\n var toPath = toAttrs[k];\n var fromPath = fromAttrs[k];\n if (toPath.length > fromPath.length) {\n toPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"parsePathString\"](toAttrs[k]); // 终点状态\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"parsePathString\"](fromAttrs[k]); // 起始状态\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"fillPathByDiff\"](fromPath, toPath);\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"formatPath\"](fromPath, toPath);\n animation.fromAttrs.path = fromPath;\n animation.toAttrs.path = toPath;\n }\n else if (!animation.pathFormatted) {\n toPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"parsePathString\"](toAttrs[k]);\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"parsePathString\"](fromAttrs[k]);\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"formatPath\"](fromPath, toPath);\n animation.fromAttrs.path = fromPath;\n animation.toAttrs.path = toPath;\n animation.pathFormatted = true;\n }\n cProps[k] = [];\n for (var i = 0; i < toPath.length; i++) {\n var toPathPoint = toPath[i];\n var fromPathPoint = fromPath[i];\n var cPathPoint = [];\n for (var j = 0; j < toPathPoint.length; j++) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(toPathPoint[j]) && fromPathPoint && Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(fromPathPoint[j])) {\n interf = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_2__[\"interpolate\"])(fromPathPoint[j], toPathPoint[j]);\n cPathPoint.push(interf(ratio));\n }\n else {\n cPathPoint.push(toPathPoint[j]);\n }\n }\n cProps[k].push(cPathPoint);\n }\n }\n else if (k === 'matrix') {\n /*\n 对矩阵进行插值时,需要保证矩阵不为空,为空则使用单位矩阵\n TODO: 二维和三维场景下单位矩阵不同,之后 WebGL 版需要做进一步处理\n */\n var matrixFn = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_2__[\"interpolateArray\"])(fromAttrs[k] || IDENTITY_MATRIX, toAttrs[k] || IDENTITY_MATRIX);\n var currentMatrix = matrixFn(ratio);\n cProps[k] = currentMatrix;\n }\n else if (Object(_util_color__WEBPACK_IMPORTED_MODULE_5__[\"isColorProp\"])(k) && Object(_util_color__WEBPACK_IMPORTED_MODULE_5__[\"isGradientColor\"])(toAttrs[k])) {\n cProps[k] = toAttrs[k];\n }\n else if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(toAttrs[k])) {\n // 非函数类型的值才能做插值\n interf = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_2__[\"interpolate\"])(fromAttrs[k], toAttrs[k]);\n cProps[k] = interf(ratio);\n }\n }\n }\n shape.attr(cProps);\n}\n/**\n * 根据自定义帧动画函数 onFrame 来更新属性\n * @param {IElement} shape 元素\n * @param {Animation} animation 动画\n * @param {number} elapsed 动画执行时间(毫秒)\n * @return {boolean} 动画是否执行完成\n */\nfunction update(shape, animation, elapsed) {\n var startTime = animation.startTime, delay = animation.delay;\n // 如果还没有开始执行或暂停,先不更新\n if (elapsed < startTime + delay || animation._paused) {\n return false;\n }\n var ratio;\n var duration = animation.duration;\n var easing = animation.easing;\n var easeFn = Object(_register__WEBPACK_IMPORTED_MODULE_3__[\"getEasing\"])(easing);\n // 已执行时间\n elapsed = elapsed - startTime - animation.delay;\n if (animation.repeat) {\n // 如果动画重复执行,则 elapsed > duration,计算 ratio 时需取模\n ratio = (elapsed % duration) / duration;\n ratio = easeFn(ratio);\n }\n else {\n ratio = elapsed / duration;\n if (ratio < 1) {\n // 动画未执行完\n ratio = easeFn(ratio);\n }\n else {\n // 动画已执行完\n if (animation.onFrame) {\n shape.attr(animation.onFrame(1));\n }\n else {\n shape.attr(animation.toAttrs);\n }\n return true;\n }\n }\n if (animation.onFrame) {\n var attrs = animation.onFrame(ratio);\n shape.attr(attrs);\n }\n else {\n _update(shape, animation, ratio);\n }\n return false;\n}\nvar Timeline = /** @class */ (function () {\n /**\n * 时间轴构造函数,依赖于画布\n * @param {}\n */\n function Timeline(canvas) {\n /**\n * 执行动画的元素列表\n * @type {IElement[]}\n */\n this.animators = [];\n /**\n * 当前时间\n * @type {number}\n */\n this.current = 0;\n /**\n * 定时器\n * @type {d3Timer.Timer}\n */\n this.timer = null;\n this.canvas = canvas;\n }\n /**\n * 初始化定时器\n */\n Timeline.prototype.initTimer = function () {\n var _this = this;\n var isFinished = false;\n var shape;\n var animations;\n var animation;\n this.timer = d3_timer__WEBPACK_IMPORTED_MODULE_1__[\"timer\"](function (elapsed) {\n _this.current = elapsed;\n if (_this.animators.length > 0) {\n for (var i = _this.animators.length - 1; i >= 0; i--) {\n shape = _this.animators[i];\n if (shape.destroyed) {\n // 如果已经被销毁,直接移出队列\n _this.removeAnimator(i);\n continue;\n }\n if (!shape.isAnimatePaused()) {\n animations = shape.get('animations');\n for (var j = animations.length - 1; j >= 0; j--) {\n animation = animations[j];\n isFinished = update(shape, animation, elapsed);\n if (isFinished) {\n animations.splice(j, 1);\n isFinished = false;\n if (animation.callback) {\n animation.callback();\n }\n }\n }\n }\n if (animations.length === 0) {\n _this.removeAnimator(i);\n }\n }\n var autoDraw = _this.canvas.get('autoDraw');\n // 非自动渲染模式下,手动调用 canvas.draw() 重新渲染\n if (!autoDraw) {\n _this.canvas.draw();\n }\n }\n });\n };\n /**\n * 增加动画元素\n */\n Timeline.prototype.addAnimator = function (shape) {\n this.animators.push(shape);\n };\n /**\n * 移除动画元素\n */\n Timeline.prototype.removeAnimator = function (index) {\n this.animators.splice(index, 1);\n };\n /**\n * 是否有动画在执行\n */\n Timeline.prototype.isAnimating = function () {\n return !!this.animators.length;\n };\n /**\n * 停止定时器\n */\n Timeline.prototype.stop = function () {\n if (this.timer) {\n this.timer.stop();\n }\n };\n /**\n * 停止时间轴上所有元素的动画,并置空动画元素列表\n * @param {boolean} toEnd 是否到动画的最终状态,用来透传给动画元素的 stopAnimate 方法\n */\n Timeline.prototype.stopAllAnimations = function (toEnd) {\n if (toEnd === void 0) { toEnd = true; }\n this.animators.forEach(function (animator) {\n animator.stopAnimate(toEnd);\n });\n this.animators = [];\n this.canvas.draw();\n };\n /**\n * 获取当前时间\n */\n Timeline.prototype.getTime = function () {\n return this.current;\n };\n return Timeline;\n}());\n/* harmony default export */ __webpack_exports__[\"default\"] = (Timeline);\n//# sourceMappingURL=timeline.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/animate/timeline.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-timer */ \"./node_modules/d3-timer/src/index.js\");\n/* harmony import */ var d3_interpolate__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! d3-interpolate */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/index.js\");\n/* harmony import */ var _register__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./register */ \"./node_modules/@antv/g-base/esm/animate/register.js\");\n/* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/path */ \"./node_modules/@antv/g-base/esm/util/path.js\");\n/* harmony import */ var _util_color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/color */ \"./node_modules/@antv/g-base/esm/util/color.js\");\n\n\n // 目前整体动画只需要数值和数组的差值计算\n\n\n\nvar IDENTITY_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n/**\n * 使用 ratio 进行插值计算来更新属性\n * @param {IElement} shape 元素\n * @param {Animation} animation 动画\n * @param {number} ratio 比例\n * @return {boolean} 动画是否执行完成\n */\nfunction _update(shape, animation, ratio) {\n var cProps = {}; // 此刻属性\n var fromAttrs = animation.fromAttrs, toAttrs = animation.toAttrs;\n if (shape.destroyed) {\n return;\n }\n var interf; // 差值函数\n for (var k in toAttrs) {\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isEqual\"])(fromAttrs[k], toAttrs[k])) {\n if (k === 'path') {\n var toPath = toAttrs[k];\n var fromPath = fromAttrs[k];\n if (toPath.length > fromPath.length) {\n toPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"parsePathString\"](toAttrs[k]); // 终点状态\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"parsePathString\"](fromAttrs[k]); // 起始状态\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"fillPathByDiff\"](fromPath, toPath);\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"formatPath\"](fromPath, toPath);\n animation.fromAttrs.path = fromPath;\n animation.toAttrs.path = toPath;\n }\n else if (!animation.pathFormatted) {\n toPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"parsePathString\"](toAttrs[k]);\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"parsePathString\"](fromAttrs[k]);\n fromPath = _util_path__WEBPACK_IMPORTED_MODULE_4__[\"formatPath\"](fromPath, toPath);\n animation.fromAttrs.path = fromPath;\n animation.toAttrs.path = toPath;\n animation.pathFormatted = true;\n }\n cProps[k] = [];\n for (var i = 0; i < toPath.length; i++) {\n var toPathPoint = toPath[i];\n var fromPathPoint = fromPath[i];\n var cPathPoint = [];\n for (var j = 0; j < toPathPoint.length; j++) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(toPathPoint[j]) && fromPathPoint && Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(fromPathPoint[j])) {\n interf = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_2__[\"interpolate\"])(fromPathPoint[j], toPathPoint[j]);\n cPathPoint.push(interf(ratio));\n }\n else {\n cPathPoint.push(toPathPoint[j]);\n }\n }\n cProps[k].push(cPathPoint);\n }\n }\n else if (k === 'matrix') {\n /*\n 对矩阵进行插值时,需要保证矩阵不为空,为空则使用单位矩阵\n TODO: 二维和三维场景下单位矩阵不同,之后 WebGL 版需要做进一步处理\n */\n var matrixFn = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_2__[\"interpolateArray\"])(fromAttrs[k] || IDENTITY_MATRIX, toAttrs[k] || IDENTITY_MATRIX);\n var currentMatrix = matrixFn(ratio);\n cProps[k] = currentMatrix;\n }\n else if (Object(_util_color__WEBPACK_IMPORTED_MODULE_5__[\"isColorProp\"])(k) && Object(_util_color__WEBPACK_IMPORTED_MODULE_5__[\"isGradientColor\"])(toAttrs[k])) {\n cProps[k] = toAttrs[k];\n }\n else if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(toAttrs[k])) {\n // 非函数类型的值才能做插值\n interf = Object(d3_interpolate__WEBPACK_IMPORTED_MODULE_2__[\"interpolate\"])(fromAttrs[k], toAttrs[k]);\n cProps[k] = interf(ratio);\n }\n }\n }\n shape.attr(cProps);\n}\n/**\n * 根据自定义帧动画函数 onFrame 来更新属性\n * @param {IElement} shape 元素\n * @param {Animation} animation 动画\n * @param {number} elapsed 动画执行时间(毫秒)\n * @return {boolean} 动画是否执行完成\n */\nfunction update(shape, animation, elapsed) {\n var startTime = animation.startTime, delay = animation.delay;\n // 如果还没有开始执行或暂停,先不更新\n if (elapsed < startTime + delay || animation._paused) {\n return false;\n }\n var ratio;\n var duration = animation.duration;\n var easing = animation.easing;\n var easeFn = Object(_register__WEBPACK_IMPORTED_MODULE_3__[\"getEasing\"])(easing);\n // 已执行时间\n elapsed = elapsed - startTime - animation.delay;\n if (animation.repeat) {\n // 如果动画重复执行,则 elapsed > duration,计算 ratio 时需取模\n ratio = (elapsed % duration) / duration;\n ratio = easeFn(ratio);\n }\n else {\n ratio = elapsed / duration;\n if (ratio < 1) {\n // 动画未执行完\n ratio = easeFn(ratio);\n }\n else {\n // 动画已执行完\n if (animation.onFrame) {\n shape.attr(animation.onFrame(1));\n }\n else {\n shape.attr(animation.toAttrs);\n }\n return true;\n }\n }\n if (animation.onFrame) {\n var attrs = animation.onFrame(ratio);\n shape.attr(attrs);\n }\n else {\n _update(shape, animation, ratio);\n }\n return false;\n}\nvar Timeline = /** @class */ (function () {\n /**\n * 时间轴构造函数,依赖于画布\n * @param {}\n */\n function Timeline(canvas) {\n /**\n * 执行动画的元素列表\n * @type {IElement[]}\n */\n this.animators = [];\n /**\n * 当前时间\n * @type {number}\n */\n this.current = 0;\n /**\n * 定时器\n * @type {d3Timer.Timer}\n */\n this.timer = null;\n this.canvas = canvas;\n }\n /**\n * 初始化定时器\n */\n Timeline.prototype.initTimer = function () {\n var _this = this;\n var isFinished = false;\n var shape;\n var animations;\n var animation;\n this.timer = d3_timer__WEBPACK_IMPORTED_MODULE_1__[\"timer\"](function (elapsed) {\n _this.current = elapsed;\n if (_this.animators.length > 0) {\n for (var i = _this.animators.length - 1; i >= 0; i--) {\n shape = _this.animators[i];\n if (shape.destroyed) {\n // 如果已经被销毁,直接移出队列\n _this.removeAnimator(i);\n continue;\n }\n if (!shape.isAnimatePaused()) {\n animations = shape.get('animations');\n for (var j = animations.length - 1; j >= 0; j--) {\n animation = animations[j];\n isFinished = update(shape, animation, elapsed);\n if (isFinished) {\n animations.splice(j, 1);\n isFinished = false;\n if (animation.callback) {\n animation.callback();\n }\n }\n }\n }\n if (animations.length === 0) {\n _this.removeAnimator(i);\n }\n }\n var autoDraw = _this.canvas.get('autoDraw');\n // 非自动渲染模式下,手动调用 canvas.draw() 重新渲染\n if (!autoDraw) {\n _this.canvas.draw();\n }\n }\n });\n };\n /**\n * 增加动画元素\n */\n Timeline.prototype.addAnimator = function (shape) {\n this.animators.push(shape);\n };\n /**\n * 移除动画元素\n */\n Timeline.prototype.removeAnimator = function (index) {\n this.animators.splice(index, 1);\n };\n /**\n * 是否有动画在执行\n */\n Timeline.prototype.isAnimating = function () {\n return !!this.animators.length;\n };\n /**\n * 停止定时器\n */\n Timeline.prototype.stop = function () {\n if (this.timer) {\n this.timer.stop();\n }\n };\n /**\n * 停止时间轴上所有元素的动画,并置空动画元素列表\n * @param {boolean} toEnd 是否到动画的最终状态,用来透传给动画元素的 stopAnimate 方法\n */\n Timeline.prototype.stopAllAnimations = function (toEnd) {\n if (toEnd === void 0) { toEnd = true; }\n this.animators.forEach(function (animator) {\n animator.stopAnimate(toEnd);\n });\n this.animators = [];\n this.canvas.draw();\n };\n /**\n * 获取当前时间\n */\n Timeline.prototype.getTime = function () {\n return this.current;\n };\n return Timeline;\n}());\n/* harmony default export */ __webpack_exports__[\"default\"] = (Timeline);\n//# sourceMappingURL=timeline.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/animate/timeline.js?"); /***/ }), @@ -1180,11 +1180,11 @@ eval("__webpack_require__.r(__webpack_exports__);\nvar GraphEvent = /** @class * /*!************************************************!*\ !*** ./node_modules/@antv/g-base/esm/index.js ***! \************************************************/ -/*! exports provided: Event, Base, AbstractCanvas, AbstractGroup, AbstractShape, PathUtil, getBBoxMethod, registerBBox, getTextHeight, assembleFont, isAllowCapture, multiplyVec2, invert, getOffScreenContext, registerEasing, version */ +/*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/path */ \"./node_modules/@antv/g-base/esm/util/path.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"PathUtil\", function() { return _util_path__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/g-base/esm/types.js\");\n/* empty/unused harmony star reexport *//* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interfaces */ \"./node_modules/@antv/g-base/esm/interfaces.js\");\n/* empty/unused harmony star reexport *//* harmony import */ var _event_graph_event__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./event/graph-event */ \"./node_modules/@antv/g-base/esm/event/graph-event.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Event\", function() { return _event_graph_event__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _abstract_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./abstract/base */ \"./node_modules/@antv/g-base/esm/abstract/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Base\", function() { return _abstract_base__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _abstract_canvas__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./abstract/canvas */ \"./node_modules/@antv/g-base/esm/abstract/canvas.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractCanvas\", function() { return _abstract_canvas__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _abstract_group__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./abstract/group */ \"./node_modules/@antv/g-base/esm/abstract/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGroup\", function() { return _abstract_group__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _abstract_shape__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./abstract/shape */ \"./node_modules/@antv/g-base/esm/abstract/shape.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractShape\", function() { return _abstract_shape__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _bbox__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./bbox */ \"./node_modules/@antv/g-base/esm/bbox/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getBBoxMethod\", function() { return _bbox__WEBPACK_IMPORTED_MODULE_8__[\"getBBoxMethod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerBBox\", function() { return _bbox__WEBPACK_IMPORTED_MODULE_8__[\"registerBBox\"]; });\n\n/* harmony import */ var _util_text__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util/text */ \"./node_modules/@antv/g-base/esm/util/text.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTextHeight\", function() { return _util_text__WEBPACK_IMPORTED_MODULE_9__[\"getTextHeight\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"assembleFont\", function() { return _util_text__WEBPACK_IMPORTED_MODULE_9__[\"assembleFont\"]; });\n\n/* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util/util */ \"./node_modules/@antv/g-base/esm/util/util.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isAllowCapture\", function() { return _util_util__WEBPACK_IMPORTED_MODULE_10__[\"isAllowCapture\"]; });\n\n/* harmony import */ var _util_matrix__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./util/matrix */ \"./node_modules/@antv/g-base/esm/util/matrix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"multiplyVec2\", function() { return _util_matrix__WEBPACK_IMPORTED_MODULE_11__[\"multiplyVec2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return _util_matrix__WEBPACK_IMPORTED_MODULE_11__[\"invert\"]; });\n\n/* harmony import */ var _util_offscreen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./util/offscreen */ \"./node_modules/@antv/g-base/esm/util/offscreen.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getOffScreenContext\", function() { return _util_offscreen__WEBPACK_IMPORTED_MODULE_12__[\"getOffScreenContext\"]; });\n\n/* harmony import */ var _animate_register__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./animate/register */ \"./node_modules/@antv/g-base/esm/animate/register.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerEasing\", function() { return _animate_register__WEBPACK_IMPORTED_MODULE_13__[\"registerEasing\"]; });\n\n/**\n * @fileoverview G 的基础接口定义和所有的抽象类\n * @author dxq613@gmail.com\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar version = '0.5.11';\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/path */ \"./node_modules/@antv/g-base/esm/util/path.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"PathUtil\", function() { return _util_path__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/g-base/esm/types.js\");\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_types__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _types__WEBPACK_IMPORTED_MODULE_1__) if([\"default\",\"Event\",\"Base\",\"AbstractCanvas\",\"AbstractGroup\",\"AbstractShape\",\"PathUtil\",\"getBBoxMethod\",\"registerBBox\",\"getTextHeight\",\"assembleFont\",\"isAllowCapture\",\"multiplyVec2\",\"invert\",\"getOffScreenContext\",\"registerEasing\",\"version\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _types__WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interfaces */ \"./node_modules/@antv/g-base/esm/interfaces.js\");\n/* harmony import */ var _interfaces__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_interfaces__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _interfaces__WEBPACK_IMPORTED_MODULE_2__) if([\"default\",\"Event\",\"Base\",\"AbstractCanvas\",\"AbstractGroup\",\"AbstractShape\",\"PathUtil\",\"getBBoxMethod\",\"registerBBox\",\"getTextHeight\",\"assembleFont\",\"isAllowCapture\",\"multiplyVec2\",\"invert\",\"getOffScreenContext\",\"registerEasing\",\"version\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _interfaces__WEBPACK_IMPORTED_MODULE_2__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _event_graph_event__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./event/graph-event */ \"./node_modules/@antv/g-base/esm/event/graph-event.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Event\", function() { return _event_graph_event__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _abstract_base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./abstract/base */ \"./node_modules/@antv/g-base/esm/abstract/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Base\", function() { return _abstract_base__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _abstract_canvas__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./abstract/canvas */ \"./node_modules/@antv/g-base/esm/abstract/canvas.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractCanvas\", function() { return _abstract_canvas__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _abstract_group__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./abstract/group */ \"./node_modules/@antv/g-base/esm/abstract/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGroup\", function() { return _abstract_group__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _abstract_shape__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./abstract/shape */ \"./node_modules/@antv/g-base/esm/abstract/shape.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractShape\", function() { return _abstract_shape__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _bbox__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./bbox */ \"./node_modules/@antv/g-base/esm/bbox/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getBBoxMethod\", function() { return _bbox__WEBPACK_IMPORTED_MODULE_8__[\"getBBoxMethod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerBBox\", function() { return _bbox__WEBPACK_IMPORTED_MODULE_8__[\"registerBBox\"]; });\n\n/* harmony import */ var _util_text__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util/text */ \"./node_modules/@antv/g-base/esm/util/text.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTextHeight\", function() { return _util_text__WEBPACK_IMPORTED_MODULE_9__[\"getTextHeight\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"assembleFont\", function() { return _util_text__WEBPACK_IMPORTED_MODULE_9__[\"assembleFont\"]; });\n\n/* harmony import */ var _util_util__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util/util */ \"./node_modules/@antv/g-base/esm/util/util.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isAllowCapture\", function() { return _util_util__WEBPACK_IMPORTED_MODULE_10__[\"isAllowCapture\"]; });\n\n/* harmony import */ var _util_matrix__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./util/matrix */ \"./node_modules/@antv/g-base/esm/util/matrix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"multiplyVec2\", function() { return _util_matrix__WEBPACK_IMPORTED_MODULE_11__[\"multiplyVec2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return _util_matrix__WEBPACK_IMPORTED_MODULE_11__[\"invert\"]; });\n\n/* harmony import */ var _util_offscreen__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./util/offscreen */ \"./node_modules/@antv/g-base/esm/util/offscreen.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getOffScreenContext\", function() { return _util_offscreen__WEBPACK_IMPORTED_MODULE_12__[\"getOffScreenContext\"]; });\n\n/* harmony import */ var _animate_register__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./animate/register */ \"./node_modules/@antv/g-base/esm/animate/register.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerEasing\", function() { return _animate_register__WEBPACK_IMPORTED_MODULE_13__[\"registerEasing\"]; });\n\n/**\n * @fileoverview G 的基础接口定义和所有的抽象类\n * @author dxq613@gmail.com\n */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar version = '0.5.11';\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/index.js?"); /***/ }), @@ -1192,11 +1192,10 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /*!*****************************************************!*\ !*** ./node_modules/@antv/g-base/esm/interfaces.js ***! \*****************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n\n//# sourceMappingURL=interfaces.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/interfaces.js?"); +eval("//# sourceMappingURL=interfaces.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/interfaces.js?"); /***/ }), @@ -1204,11 +1203,10 @@ eval("__webpack_require__.r(__webpack_exports__);\n\n//# sourceMappingURL=interf /*!************************************************!*\ !*** ./node_modules/@antv/g-base/esm/types.js ***! \************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n\n//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/types.js?"); +eval("//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/esm/types.js?"); /***/ }), @@ -1284,6 +1282,318 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ }), +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/array.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/array.js ***! + \****************************************************************************/ +/*! exports provided: default, genericArray */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"genericArray\", function() { return genericArray; });\n/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/value.js\");\n/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./numberArray.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/numberArray.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n return (Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_1__[\"isNumberArray\"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : genericArray)(a, b);\n});\n\nfunction genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/array.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basis.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basis.js ***! + \****************************************************************************/ +/*! exports provided: basis, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"basis\", function() { return basis; });\nfunction basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basis.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basisClosed.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basisClosed.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basis.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basis.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return Object(_basis_js__WEBPACK_IMPORTED_MODULE_0__[\"basis\"])((t - i / n) * n, v0, v1, v2, v3);\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basisClosed.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js ***! + \****************************************************************************/ +/*! exports provided: hue, gamma, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hue\", function() { return hue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gamma\", function() { return gamma; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return nogamma; });\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/constant.js\");\n\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nfunction hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(isNaN(a) ? b : a);\n}\n\nfunction gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(isNaN(a) ? b : a);\n };\n}\n\nfunction nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(isNaN(a) ? b : a);\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/constant.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/constant.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (x => () => x);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/constant.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/cubehelix.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/cubehelix.js ***! + \********************************************************************************/ +/*! exports provided: default, cubehelixLong */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cubehelixLong\", function() { return cubehelixLong; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js\");\n\n\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"cubehelix\"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"cubehelix\"])(end)).h),\n s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.s, end.s),\n l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.l, end.l),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"hue\"]));\nvar cubehelixLong = cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/cubehelix.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/date.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/date.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/date.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/discrete.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/discrete.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/discrete.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hcl.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hcl.js ***! + \**************************************************************************/ +/*! exports provided: default, hclLong */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hclLong\", function() { return hclLong; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js\");\n\n\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"hcl\"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"hcl\"])(end)).h),\n c = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.c, end.c),\n l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.l, end.l),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"hue\"]));\nvar hclLong = hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hcl.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hsl.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hsl.js ***! + \**************************************************************************/ +/*! exports provided: default, hslLong */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hslLong\", function() { return hslLong; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js\");\n\n\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"hsl\"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"hsl\"])(end)).h),\n s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.s, end.s),\n l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.l, end.l),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"hue\"]));\nvar hslLong = hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hsl.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hue.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hue.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var i = Object(_color_js__WEBPACK_IMPORTED_MODULE_0__[\"hue\"])(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hue.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/index.js ***! + \****************************************************************************/ +/*! exports provided: interpolate, interpolateArray, interpolateBasis, interpolateBasisClosed, interpolateDate, interpolateDiscrete, interpolateHue, interpolateNumber, interpolateNumberArray, interpolateObject, interpolateRound, interpolateString, interpolateTransformCss, interpolateTransformSvg, interpolateZoom, interpolateRgb, interpolateRgbBasis, interpolateRgbBasisClosed, interpolateHsl, interpolateHslLong, interpolateLab, interpolateHcl, interpolateHclLong, interpolateCubehelix, interpolateCubehelixLong, piecewise, quantize */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/value.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolate\", function() { return _value_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateArray\", function() { return _array_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basis.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basis.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateBasis\", function() { return _basis_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./basisClosed.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basisClosed.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateBasisClosed\", function() { return _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./date.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/date.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateDate\", function() { return _date_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _discrete_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./discrete.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/discrete.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateDiscrete\", function() { return _discrete_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _hue_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hue.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hue.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHue\", function() { return _hue_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./number.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/number.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateNumber\", function() { return _number_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/numberArray.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateNumberArray\", function() { return _numberArray_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./object.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/object.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateObject\", function() { return _object_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./round.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/round.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateRound\", function() { return _round_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./string.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateString\", function() { return _string_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _transform_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./transform/index.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateTransformCss\", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__[\"interpolateTransformCss\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateTransformSvg\", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__[\"interpolateTransformSvg\"]; });\n\n/* harmony import */ var _zoom_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./zoom.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/zoom.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateZoom\", function() { return _zoom_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rgb.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/rgb.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateRgb\", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateRgbBasis\", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__[\"rgbBasis\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateRgbBasisClosed\", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__[\"rgbBasisClosed\"]; });\n\n/* harmony import */ var _hsl_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./hsl.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hsl.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHsl\", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHslLong\", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__[\"hslLong\"]; });\n\n/* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lab.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/lab.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateLab\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n/* harmony import */ var _hcl_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./hcl.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/hcl.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHcl\", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHclLong\", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__[\"hclLong\"]; });\n\n/* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./cubehelix.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/cubehelix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateCubehelix\", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateCubehelixLong\", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__[\"cubehelixLong\"]; });\n\n/* harmony import */ var _piecewise_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./piecewise.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/piecewise.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"piecewise\", function() { return _piecewise_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"]; });\n\n/* harmony import */ var _quantize_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./quantize.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/quantize.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"quantize\", function() { return _quantize_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/index.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/lab.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/lab.js ***! + \**************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return lab; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js\");\n\n\n\nfunction lab(start, end) {\n var l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"lab\"])(start)).l, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"lab\"])(end)).l),\n a = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.a, end.a),\n b = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.b, end.b),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/lab.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/number.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/number.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/number.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/numberArray.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/numberArray.js ***! + \**********************************************************************************/ +/*! exports provided: default, isNumberArray */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumberArray\", function() { return isNumberArray; });\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n});\n\nfunction isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/numberArray.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/object.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/object.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/value.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/object.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/piecewise.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/piecewise.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return piecewise; });\n/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/value.js\");\n\n\nfunction piecewise(interpolate, values) {\n if (values === undefined) values = interpolate, interpolate = _value_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/piecewise.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/quantize.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/quantize.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/quantize.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/rgb.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/rgb.js ***! + \**************************************************************************/ +/*! exports provided: default, rgbBasis, rgbBasisClosed */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgbBasis\", function() { return rgbBasis; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgbBasisClosed\", function() { return rgbBasisClosed; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./basis.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basis.js\");\n/* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basisClosed.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/basisClosed.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./color.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/color.js\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ((function rgbGamma(y) {\n var color = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__[\"gamma\"])(y);\n\n function rgb(start, end) {\n var r = color((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"rgb\"])(start)).r, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"rgb\"])(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1));\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"rgb\"])(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nvar rgbBasis = rgbSpline(_basis_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\nvar rgbBasisClosed = rgbSpline(_basisClosed_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/rgb.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/round.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/round.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/round.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/string.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/string.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/number.js\");\n\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/string.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/decompose.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/decompose.js ***! + \******************************************************************************************/ +/*! exports provided: identity, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\nvar degrees = 180 / Math.PI;\n\nvar identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/decompose.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/index.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/index.js ***! + \**************************************************************************************/ +/*! exports provided: interpolateTransformCss, interpolateTransformSvg */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"interpolateTransformCss\", function() { return interpolateTransformCss; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"interpolateTransformSvg\", function() { return interpolateTransformSvg; });\n/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../number.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/number.js\");\n/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/parse.js\");\n\n\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(xa, xb)}, {i: i - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(xa, xb)}, {i: i - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nvar interpolateTransformCss = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__[\"parseCss\"], \"px, \", \"px)\", \"deg)\");\nvar interpolateTransformSvg = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__[\"parseSvg\"], \", \", \")\", \")\");\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/index.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/parse.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/parse.js ***! + \**************************************************************************************/ +/*! exports provided: parseCss, parseSvg */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseCss\", function() { return parseCss; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseSvg\", function() { return parseSvg; });\n/* harmony import */ var _decompose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decompose.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/decompose.js\");\n\n\nvar svgNode;\n\n/* eslint-disable no-undef */\nfunction parseCss(value) {\n const m = new (typeof DOMMatrix === \"function\" ? DOMMatrix : WebKitCSSMatrix)(value + \"\");\n return m.isIdentity ? _decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"identity\"] : Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(m.a, m.b, m.c, m.d, m.e, m.f);\n}\n\nfunction parseSvg(value) {\n if (value == null) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"identity\"];\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"identity\"];\n value = value.matrix;\n return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/transform/parse.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/value.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/value.js ***! + \****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rgb.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/rgb.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/array.js\");\n/* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/date.js\");\n/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./number.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/number.js\");\n/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./object.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/object.js\");\n/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./string.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/string.js\");\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/constant.js\");\n/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ \"./node_modules/@antv/g-base/node_modules/d3-interpolate/src/numberArray.js\");\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? Object(_constant_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(b)\n : (t === \"number\" ? _number_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n : t === \"string\" ? ((c = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"color\"])(b)) ? (b = c, _rgb_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) : _string_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])\n : b instanceof d3_color__WEBPACK_IMPORTED_MODULE_0__[\"color\"] ? _rgb_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n : b instanceof Date ? _date_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n : Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_8__[\"isNumberArray\"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]\n : Array.isArray(b) ? _array_js__WEBPACK_IMPORTED_MODULE_2__[\"genericArray\"]\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? _object_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n : _number_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(a, b);\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/value.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g-base/node_modules/d3-interpolate/src/zoom.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@antv/g-base/node_modules/d3-interpolate/src/zoom.js ***! + \***************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ((function zoomRho(rho, rho2, rho4) {\n\n // p0 = [ux0, uy0, w0]\n // p1 = [ux1, uy1, w1]\n function zoom(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000 * rho / Math.SQRT2;\n\n return i;\n }\n\n zoom.rho = function(_) {\n var _1 = Math.max(1e-3, +_), _2 = _1 * _1, _4 = _2 * _2;\n return zoomRho(_1, _2, _4);\n };\n\n return zoom;\n})(Math.SQRT2, 2, 4));\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g-base/node_modules/d3-interpolate/src/zoom.js?"); + +/***/ }), + /***/ "./node_modules/@antv/g-canvas/esm/canvas.js": /*!***************************************************!*\ !*** ./node_modules/@antv/g-canvas/esm/canvas.js ***! @@ -1312,11 +1622,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tsli /*!**************************************************!*\ !*** ./node_modules/@antv/g-canvas/esm/index.js ***! \**************************************************/ -/*! exports provided: Event, Base, AbstractCanvas, AbstractGroup, AbstractShape, PathUtil, getBBoxMethod, registerBBox, getTextHeight, assembleFont, isAllowCapture, multiplyVec2, invert, getOffScreenContext, registerEasing, Canvas, Group, Shape, getArcParams, version */ +/*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g-canvas/esm/shape/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _shape__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _antv_g_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Event\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"Event\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Base\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"Base\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractCanvas\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"AbstractCanvas\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGroup\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"AbstractGroup\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractShape\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"AbstractShape\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PathUtil\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"PathUtil\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getBBoxMethod\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"getBBoxMethod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerBBox\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"registerBBox\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTextHeight\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"getTextHeight\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"assembleFont\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"assembleFont\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isAllowCapture\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"isAllowCapture\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"multiplyVec2\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"multiplyVec2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"invert\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getOffScreenContext\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"getOffScreenContext\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerEasing\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"registerEasing\"]; });\n\n/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./canvas */ \"./node_modules/@antv/g-canvas/esm/canvas.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Canvas\", function() { return _canvas__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./group */ \"./node_modules/@antv/g-canvas/esm/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Group\", function() { return _group__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _util_arc_params__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/arc-params */ \"./node_modules/@antv/g-canvas/esm/util/arc-params.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getArcParams\", function() { return _util_arc_params__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n\n\n\n\n\n\nvar version = '0.5.12';\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-canvas/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g-canvas/esm/shape/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _shape__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _antv_g_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _antv_g_base__WEBPACK_IMPORTED_MODULE_1__) if([\"default\",\"Canvas\",\"Group\",\"Shape\",\"getArcParams\",\"version\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./canvas */ \"./node_modules/@antv/g-canvas/esm/canvas.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Canvas\", function() { return _canvas__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./group */ \"./node_modules/@antv/g-canvas/esm/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Group\", function() { return _group__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _util_arc_params__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util/arc-params */ \"./node_modules/@antv/g-canvas/esm/util/arc-params.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getArcParams\", function() { return _util_arc_params__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n\n\n\n\n\n\nvar version = '0.5.12';\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-canvas/esm/index.js?"); /***/ }), @@ -1496,7 +1806,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyAttrsToContext\", function() { return applyAttrsToContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"drawChildren\", function() { return drawChildren; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRefresh\", function() { return checkRefresh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkChildrenRefresh\", function() { return checkChildrenRefresh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clearChanged\", function() { return clearChanged; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"drawPath\", function() { return drawPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"refreshElement\", function() { return refreshElement; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRefreshRegion\", function() { return getRefreshRegion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMergedRegion\", function() { return getMergedRegion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeView\", function() { return mergeView; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse */ \"./node_modules/@antv/g-canvas/esm/util/parse.js\");\n/* harmony import */ var _arc_params__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./arc-params */ \"./node_modules/@antv/g-canvas/esm/util/arc-params.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/g-canvas/esm/util/util.js\");\n/* harmony import */ var _util_arrow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/arrow */ \"./node_modules/@antv/g-canvas/esm/util/arrow.js\");\n\n\n\n\n\nvar SHAPE_ATTRS_MAP = {\n fill: 'fillStyle',\n stroke: 'strokeStyle',\n opacity: 'globalAlpha',\n};\nfunction applyAttrsToContext(context, element) {\n var attrs = element.attr();\n for (var k in attrs) {\n var v = attrs[k];\n // 转换一下不与 canvas 兼容的属性名\n var name_1 = SHAPE_ATTRS_MAP[k] ? SHAPE_ATTRS_MAP[k] : k;\n if (name_1 === 'matrix' && v) {\n // 设置矩阵\n context.transform(v[0], v[1], v[3], v[4], v[6], v[7]);\n }\n else if (name_1 === 'lineDash' && context.setLineDash) {\n // 设置虚线,只支持数组形式,非数组形式不做任何操作\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(v) && context.setLineDash(v);\n }\n else {\n if (name_1 === 'strokeStyle' || name_1 === 'fillStyle') {\n // 如果存在渐变、pattern 这个开销有些大\n // 可以考虑缓存机制,通过 hasUpdate 来避免一些运算\n v = Object(_parse__WEBPACK_IMPORTED_MODULE_1__[\"parseStyle\"])(context, element, v);\n }\n else if (name_1 === 'globalAlpha') {\n // opacity 效果可以叠加,子元素的 opacity 需要与父元素 opacity 相乘\n v = v * context.globalAlpha;\n }\n context[name_1] = v;\n }\n }\n}\nfunction drawChildren(context, children, region) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.cfg.visible) {\n child.draw(context, region);\n }\n else {\n child.skipDraw();\n }\n }\n}\n// 这个地方的逻辑比较复杂,简单画了一张图:https://www.yuque.com/antv/ou292n/pcgt5g#OW1QE\nfunction checkRefresh(canvas, children, region) {\n var refreshElements = canvas.get('refreshElements');\n // 先遍历需要刷新的元素,将这些元素的父元素也设置 refresh\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(refreshElements, function (el) {\n if (el !== canvas) {\n var parent_1 = el.cfg.parent;\n while (parent_1 && parent_1 !== canvas && !parent_1.cfg.refresh) {\n parent_1.cfg.refresh = true;\n parent_1 = parent_1.cfg.parent;\n }\n }\n });\n if (refreshElements[0] === canvas) {\n setChildrenRefresh(children, region);\n }\n else {\n // 检查所有子元素是否可以刷新\n checkChildrenRefresh(children, region);\n }\n}\n// 检查所有的子元素是否应该更新\nfunction checkChildrenRefresh(children, region) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.cfg.visible) {\n // 先判断 hasChanged,因为它的优先级判断应该高于 refresh\n if (child.cfg.hasChanged) {\n // 如果节点发生了 change,则需要级联设置子元素的 refresh\n child.cfg.refresh = true;\n if (child.isGroup()) {\n setChildrenRefresh(child.cfg.children, region);\n }\n }\n else if (child.cfg.refresh) {\n // 如果当前图形/分组 refresh = true,说明其子节点存在 changed\n if (child.isGroup()) {\n checkChildrenRefresh(child.cfg.children, region);\n }\n }\n else {\n // 这个分支说明此次局部刷新,所有的节点和父元素没有发生变化,仅需要检查包围盒(缓存)是否相交即可\n var refresh = checkElementRefresh(child, region);\n child.cfg.refresh = refresh;\n if (refresh && child.isGroup()) {\n // 如果需要刷新,说明子元素也需要刷新,继续进行判定\n checkChildrenRefresh(child.cfg.children, region);\n }\n }\n }\n }\n}\n// 由于对改变的图形放入 refreshElements 时做了优化,判定父元素 changed 时不加入\n// 那么有可能会出现 elements 都为空,所以最终 group\nfunction clearChanged(elements) {\n for (var i = 0; i < elements.length; i++) {\n var el = elements[i];\n el.cfg.hasChanged = false;\n // 级联清理\n if (el.isGroup() && !el.destroyed) {\n clearChanged(el.cfg.children);\n }\n }\n}\n// 当某个父元素发生改变时,调用这个方法级联设置 refresh\nfunction setChildrenRefresh(children, region) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n // let refresh = true;\n // 获取缓存的 bbox,如果这个 bbox 还存在则说明父元素不是矩阵发生了改变\n // const bbox = child.cfg.canvasBBox;\n // if (bbox) {\n // // 如果这时候\n // refresh = intersectRect(bbox, region);\n // }\n child.cfg.refresh = true;\n // 如果需要刷新当前节点,所有的子元素设置 refresh\n if (child.isGroup()) {\n setChildrenRefresh(child.get('children'), region);\n }\n }\n}\nfunction checkElementRefresh(shape, region) {\n var bbox = shape.cfg.cacheCanvasBBox;\n var isAllow = shape.cfg.isInView && bbox && Object(_util__WEBPACK_IMPORTED_MODULE_3__[\"intersectRect\"])(bbox, region);\n return isAllow;\n}\n// 绘制 path\nfunction drawPath(shape, context, attrs, arcParamsCache) {\n var path = attrs.path, startArrow = attrs.startArrow, endArrow = attrs.endArrow;\n if (!path) {\n return;\n }\n var currentPoint = [0, 0]; // 当前图形\n var startMovePoint = [0, 0]; // 开始 M 的点,可能会有多个\n var distance = {\n dx: 0,\n dy: 0,\n };\n context.beginPath();\n for (var i = 0; i < path.length; i++) {\n var params = path[i];\n var command = params[0];\n if (i === 0 && startArrow && startArrow.d) {\n var tangent = shape.getStartTangent();\n distance = _util_arrow__WEBPACK_IMPORTED_MODULE_4__[\"getShortenOffset\"](tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], startArrow.d);\n }\n else if (i === path.length - 2 && path[i + 1][0] === 'Z' && endArrow && endArrow.d) {\n // 为了防止结尾为 Z 的 segment 缩短不起效,需要取最后两个 segment 特殊处理\n var lastPath = path[i + 1];\n if (lastPath[0] === 'Z') {\n var tangent = shape.getEndTangent();\n distance = _util_arrow__WEBPACK_IMPORTED_MODULE_4__[\"getShortenOffset\"](tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], endArrow.d);\n }\n }\n else if (i === path.length - 1 && endArrow && endArrow.d) {\n if (path[0] !== 'Z') {\n var tangent = shape.getEndTangent();\n distance = _util_arrow__WEBPACK_IMPORTED_MODULE_4__[\"getShortenOffset\"](tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], endArrow.d);\n }\n }\n var dx = distance.dx, dy = distance.dy;\n // V,H,S,T 都在前面被转换成标准形式\n switch (command) {\n case 'M':\n context.moveTo(params[1] - dx, params[2] - dy);\n startMovePoint = [params[1], params[2]];\n break;\n case 'L':\n context.lineTo(params[1] - dx, params[2] - dy);\n break;\n case 'Q':\n context.quadraticCurveTo(params[1], params[2], params[3] - dx, params[4] - dy);\n break;\n case 'C':\n context.bezierCurveTo(params[1], params[2], params[3], params[4], params[5] - dx, params[6] - dy);\n break;\n case 'A': {\n var arcParams = void 0;\n // 为了加速绘制,可以提供参数的缓存,各个图形自己缓存\n if (arcParamsCache) {\n arcParams = arcParamsCache[i];\n if (!arcParams) {\n arcParams = Object(_arc_params__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(currentPoint, params);\n arcParamsCache[i] = arcParams;\n }\n }\n else {\n arcParams = Object(_arc_params__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(currentPoint, params);\n }\n var cx = arcParams.cx, cy = arcParams.cy, rx = arcParams.rx, ry = arcParams.ry, startAngle = arcParams.startAngle, endAngle = arcParams.endAngle, xRotation = arcParams.xRotation, sweepFlag = arcParams.sweepFlag;\n // 直接使用椭圆的 api\n if (context.ellipse) {\n context.ellipse(cx, cy, rx, ry, xRotation, startAngle, endAngle, 1 - sweepFlag);\n }\n else {\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n context.translate(cx, cy);\n context.rotate(xRotation);\n context.scale(scaleX, scaleY);\n context.arc(0, 0, r, startAngle, endAngle, 1 - sweepFlag);\n context.scale(1 / scaleX, 1 / scaleY);\n context.rotate(-xRotation);\n context.translate(-cx, -cy);\n }\n break;\n }\n case 'Z':\n context.closePath();\n break;\n default:\n break;\n }\n // 有了 Z 后,当前节点从开始 M 的点开始\n if (command === 'Z') {\n currentPoint = startMovePoint;\n }\n else {\n var len = params.length;\n currentPoint = [params[len - 2], params[len - 1]];\n }\n }\n}\n// 刷新图形元素(Shape 或者 Group)\nfunction refreshElement(element, changeType) {\n var canvas = element.get('canvas');\n // 只有存在于 canvas 上时生效\n if (canvas) {\n if (changeType === 'remove') {\n // 一旦 remove,则无法在 element 上拿到包围盒\n // destroy 后所有属性都拿不到,所以需要暂存一下\n // 这是一段 hack 的代码\n element._cacheCanvasBBox = element.get('cacheCanvasBBox');\n }\n // 防止反复刷新\n if (!element.get('hasChanged')) {\n // 但是始终要标记为 hasChanged,便于后面进行局部渲染\n element.set('hasChanged', true);\n // 本来只有局部渲染模式下,才需要记录更新的元素队列\n // if (canvas.get('localRefresh')) {\n // canvas.refreshElement(element, changeType, canvas);\n // }\n // 但对于 https://github.com/antvis/g/issues/422 的场景,全局渲染的模式下也需要记录更新的元素队列\n // 如果当前元素的父元素发生了改变,可以不放入队列,这句话大概能够提升 15% 的初次渲染性能\n if (!(element.cfg.parent && element.cfg.parent.get('hasChanged'))) {\n canvas.refreshElement(element, changeType, canvas);\n if (canvas.get('autoDraw')) {\n canvas.draw();\n }\n }\n }\n }\n}\nfunction getRefreshRegion(element) {\n var region;\n if (!element.destroyed) {\n var cacheBox = element.get('cacheCanvasBBox');\n var validCache = cacheBox && !!(cacheBox.width && cacheBox.height);\n var bbox = element.getCanvasBBox();\n var validBBox = bbox && !!(bbox.width && bbox.height);\n // 是否是有效 bbox 判定,一些 NaN 或者 宽高为 0 的情况过滤掉\n if (validCache && validBBox) {\n region = Object(_util__WEBPACK_IMPORTED_MODULE_3__[\"mergeRegion\"])(cacheBox, bbox);\n }\n else if (validCache) {\n region = cacheBox;\n }\n else if (validBBox) {\n region = bbox;\n }\n }\n else {\n // 因为元素已经销毁所以无法获取到缓存的包围盒\n region = element['_cacheCanvasBBox'];\n }\n return region;\n}\nfunction getMergedRegion(elements) {\n if (!elements.length) {\n return null;\n }\n var minXArr = [];\n var minYArr = [];\n var maxXArr = [];\n var maxYArr = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(elements, function (el) {\n var region = getRefreshRegion(el);\n if (region) {\n minXArr.push(region.minX);\n minYArr.push(region.minY);\n maxXArr.push(region.maxX);\n maxYArr.push(region.maxY);\n }\n });\n return {\n minX: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"min\"])(minXArr),\n minY: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"min\"])(minYArr),\n maxX: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"max\"])(maxXArr),\n maxY: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"max\"])(maxYArr),\n };\n}\nfunction mergeView(region, viewRegion) {\n if (!region || !viewRegion) {\n return null;\n }\n // 不相交,则直接返回 null\n if (!Object(_util__WEBPACK_IMPORTED_MODULE_3__[\"intersectRect\"])(region, viewRegion)) {\n return null;\n }\n return {\n minX: Math.max(region.minX, viewRegion.minX),\n minY: Math.max(region.minY, viewRegion.minY),\n maxX: Math.min(region.maxX, viewRegion.maxX),\n maxY: Math.min(region.maxY, viewRegion.maxY),\n };\n}\n//# sourceMappingURL=draw.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-canvas/esm/util/draw.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyAttrsToContext\", function() { return applyAttrsToContext; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"drawChildren\", function() { return drawChildren; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRefresh\", function() { return checkRefresh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkChildrenRefresh\", function() { return checkChildrenRefresh; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clearChanged\", function() { return clearChanged; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"drawPath\", function() { return drawPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"refreshElement\", function() { return refreshElement; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRefreshRegion\", function() { return getRefreshRegion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getMergedRegion\", function() { return getMergedRegion; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeView\", function() { return mergeView; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _parse__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse */ \"./node_modules/@antv/g-canvas/esm/util/parse.js\");\n/* harmony import */ var _arc_params__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./arc-params */ \"./node_modules/@antv/g-canvas/esm/util/arc-params.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/g-canvas/esm/util/util.js\");\n/* harmony import */ var _util_arrow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/arrow */ \"./node_modules/@antv/g-canvas/esm/util/arrow.js\");\n\n\n\n\n\nvar SHAPE_ATTRS_MAP = {\n fill: 'fillStyle',\n stroke: 'strokeStyle',\n opacity: 'globalAlpha',\n};\nfunction applyAttrsToContext(context, element) {\n var attrs = element.attr();\n for (var k in attrs) {\n var v = attrs[k];\n // 转换一下不与 canvas 兼容的属性名\n var name_1 = SHAPE_ATTRS_MAP[k] ? SHAPE_ATTRS_MAP[k] : k;\n if (name_1 === 'matrix' && v) {\n // 设置矩阵\n context.transform(v[0], v[1], v[3], v[4], v[6], v[7]);\n }\n else if (name_1 === 'lineDash' && context.setLineDash) {\n // 设置虚线,只支持数组形式,非数组形式不做任何操作\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(v) && context.setLineDash(v);\n }\n else {\n if (name_1 === 'strokeStyle' || name_1 === 'fillStyle') {\n // 如果存在渐变、pattern 这个开销有些大\n // 可以考虑缓存机制,通过 hasUpdate 来避免一些运算\n v = Object(_parse__WEBPACK_IMPORTED_MODULE_1__[\"parseStyle\"])(context, element, v);\n }\n else if (name_1 === 'globalAlpha') {\n // opacity 效果可以叠加,子元素的 opacity 需要与父元素 opacity 相乘\n v = v * context.globalAlpha;\n }\n context[name_1] = v;\n }\n }\n}\nfunction drawChildren(context, children, region) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.cfg.visible) {\n child.draw(context, region);\n }\n else {\n child.skipDraw();\n }\n }\n}\n// 这个地方的逻辑比较复杂,简单画了一张图:https://www.yuque.com/antv/ou292n/pcgt5g#OW1QE\nfunction checkRefresh(canvas, children, region) {\n var refreshElements = canvas.get('refreshElements');\n // 先遍历需要刷新的元素,将这些元素的父元素也设置 refresh\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(refreshElements, function (el) {\n if (el !== canvas) {\n var parent_1 = el.cfg.parent;\n while (parent_1 && parent_1 !== canvas && !parent_1.cfg.refresh) {\n parent_1.cfg.refresh = true;\n parent_1 = parent_1.cfg.parent;\n }\n }\n });\n if (refreshElements[0] === canvas) {\n setChildrenRefresh(children, region);\n }\n else {\n // 检查所有子元素是否可以刷新\n checkChildrenRefresh(children, region);\n }\n}\n// 检查所有的子元素是否应该更新\nfunction checkChildrenRefresh(children, region) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (child.cfg.visible) {\n // 先判断 hasChanged,因为它的优先级判断应该高于 refresh\n if (child.cfg.hasChanged) {\n // 如果节点发生了 change,则需要级联设置子元素的 refresh\n child.cfg.refresh = true;\n if (child.isGroup()) {\n setChildrenRefresh(child.cfg.children, region);\n }\n }\n else if (child.cfg.refresh) {\n // 如果当前图形/分组 refresh = true,说明其子节点存在 changed\n if (child.isGroup()) {\n checkChildrenRefresh(child.cfg.children, region);\n }\n }\n else {\n // 这个分支说明此次局部刷新,所有的节点和父元素没有发生变化,仅需要检查包围盒(缓存)是否相交即可\n var refresh = checkElementRefresh(child, region);\n child.cfg.refresh = refresh;\n if (refresh && child.isGroup()) {\n // 如果需要刷新,说明子元素也需要刷新,继续进行判定\n checkChildrenRefresh(child.cfg.children, region);\n }\n }\n }\n }\n}\n// 由于对改变的图形放入 refreshElements 时做了优化,判定父元素 changed 时不加入\n// 那么有可能会出现 elements 都为空,所以最终 group\nfunction clearChanged(elements) {\n for (var i = 0; i < elements.length; i++) {\n var el = elements[i];\n el.cfg.hasChanged = false;\n // 级联清理\n if (el.isGroup() && !el.destroyed) {\n clearChanged(el.cfg.children);\n }\n }\n}\n// 当某个父元素发生改变时,调用这个方法级联设置 refresh\nfunction setChildrenRefresh(children, region) {\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n if (!child.cfg.visible) {\n continue;\n }\n // let refresh = true;\n // 获取缓存的 bbox,如果这个 bbox 还存在则说明父元素不是矩阵发生了改变\n // const bbox = child.cfg.canvasBBox;\n // if (bbox) {\n // // 如果这时候\n // refresh = intersectRect(bbox, region);\n // }\n child.cfg.refresh = true;\n // 如果需要刷新当前节点,所有的子元素设置 refresh\n if (child.isGroup()) {\n setChildrenRefresh(child.get('children'), region);\n }\n }\n}\nfunction checkElementRefresh(shape, region) {\n var bbox = shape.cfg.cacheCanvasBBox;\n var isAllow = shape.cfg.isInView && bbox && Object(_util__WEBPACK_IMPORTED_MODULE_3__[\"intersectRect\"])(bbox, region);\n return isAllow;\n}\n// 绘制 path\nfunction drawPath(shape, context, attrs, arcParamsCache) {\n var path = attrs.path, startArrow = attrs.startArrow, endArrow = attrs.endArrow;\n if (!path) {\n return;\n }\n var currentPoint = [0, 0]; // 当前图形\n var startMovePoint = [0, 0]; // 开始 M 的点,可能会有多个\n var distance = {\n dx: 0,\n dy: 0,\n };\n context.beginPath();\n for (var i = 0; i < path.length; i++) {\n var params = path[i];\n var command = params[0];\n if (i === 0 && startArrow && startArrow.d) {\n var tangent = shape.getStartTangent();\n distance = _util_arrow__WEBPACK_IMPORTED_MODULE_4__[\"getShortenOffset\"](tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], startArrow.d);\n }\n else if (i === path.length - 2 && path[i + 1][0] === 'Z' && endArrow && endArrow.d) {\n // 为了防止结尾为 Z 的 segment 缩短不起效,需要取最后两个 segment 特殊处理\n var lastPath = path[i + 1];\n if (lastPath[0] === 'Z') {\n var tangent = shape.getEndTangent();\n distance = _util_arrow__WEBPACK_IMPORTED_MODULE_4__[\"getShortenOffset\"](tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], endArrow.d);\n }\n }\n else if (i === path.length - 1 && endArrow && endArrow.d) {\n if (path[0] !== 'Z') {\n var tangent = shape.getEndTangent();\n distance = _util_arrow__WEBPACK_IMPORTED_MODULE_4__[\"getShortenOffset\"](tangent[0][0], tangent[0][1], tangent[1][0], tangent[1][1], endArrow.d);\n }\n }\n var dx = distance.dx, dy = distance.dy;\n // V,H,S,T 都在前面被转换成标准形式\n switch (command) {\n case 'M':\n context.moveTo(params[1] - dx, params[2] - dy);\n startMovePoint = [params[1], params[2]];\n break;\n case 'L':\n context.lineTo(params[1] - dx, params[2] - dy);\n break;\n case 'Q':\n context.quadraticCurveTo(params[1], params[2], params[3] - dx, params[4] - dy);\n break;\n case 'C':\n context.bezierCurveTo(params[1], params[2], params[3], params[4], params[5] - dx, params[6] - dy);\n break;\n case 'A': {\n var arcParams = void 0;\n // 为了加速绘制,可以提供参数的缓存,各个图形自己缓存\n if (arcParamsCache) {\n arcParams = arcParamsCache[i];\n if (!arcParams) {\n arcParams = Object(_arc_params__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(currentPoint, params);\n arcParamsCache[i] = arcParams;\n }\n }\n else {\n arcParams = Object(_arc_params__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(currentPoint, params);\n }\n var cx = arcParams.cx, cy = arcParams.cy, rx = arcParams.rx, ry = arcParams.ry, startAngle = arcParams.startAngle, endAngle = arcParams.endAngle, xRotation = arcParams.xRotation, sweepFlag = arcParams.sweepFlag;\n // 直接使用椭圆的 api\n if (context.ellipse) {\n context.ellipse(cx, cy, rx, ry, xRotation, startAngle, endAngle, 1 - sweepFlag);\n }\n else {\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n context.translate(cx, cy);\n context.rotate(xRotation);\n context.scale(scaleX, scaleY);\n context.arc(0, 0, r, startAngle, endAngle, 1 - sweepFlag);\n context.scale(1 / scaleX, 1 / scaleY);\n context.rotate(-xRotation);\n context.translate(-cx, -cy);\n }\n break;\n }\n case 'Z':\n context.closePath();\n break;\n default:\n break;\n }\n // 有了 Z 后,当前节点从开始 M 的点开始\n if (command === 'Z') {\n currentPoint = startMovePoint;\n }\n else {\n var len = params.length;\n currentPoint = [params[len - 2], params[len - 1]];\n }\n }\n}\n// 刷新图形元素(Shape 或者 Group)\nfunction refreshElement(element, changeType) {\n var canvas = element.get('canvas');\n // 只有存在于 canvas 上时生效\n if (canvas) {\n if (changeType === 'remove') {\n // 一旦 remove,则无法在 element 上拿到包围盒\n // destroy 后所有属性都拿不到,所以需要暂存一下\n // 这是一段 hack 的代码\n element._cacheCanvasBBox = element.get('cacheCanvasBBox');\n }\n // 防止反复刷新\n if (!element.get('hasChanged')) {\n // 但是始终要标记为 hasChanged,便于后面进行局部渲染\n element.set('hasChanged', true);\n // 本来只有局部渲染模式下,才需要记录更新的元素队列\n // if (canvas.get('localRefresh')) {\n // canvas.refreshElement(element, changeType, canvas);\n // }\n // 但对于 https://github.com/antvis/g/issues/422 的场景,全局渲染的模式下也需要记录更新的元素队列\n // 如果当前元素的父元素发生了改变,可以不放入队列,这句话大概能够提升 15% 的初次渲染性能\n if (!(element.cfg.parent && element.cfg.parent.get('hasChanged'))) {\n canvas.refreshElement(element, changeType, canvas);\n if (canvas.get('autoDraw')) {\n canvas.draw();\n }\n }\n }\n }\n}\nfunction getRefreshRegion(element) {\n var region;\n if (!element.destroyed) {\n var cacheBox = element.get('cacheCanvasBBox');\n var validCache = cacheBox && !!(cacheBox.width && cacheBox.height);\n var bbox = element.getCanvasBBox();\n var validBBox = bbox && !!(bbox.width && bbox.height);\n // 是否是有效 bbox 判定,一些 NaN 或者 宽高为 0 的情况过滤掉\n if (validCache && validBBox) {\n region = Object(_util__WEBPACK_IMPORTED_MODULE_3__[\"mergeRegion\"])(cacheBox, bbox);\n }\n else if (validCache) {\n region = cacheBox;\n }\n else if (validBBox) {\n region = bbox;\n }\n }\n else {\n // 因为元素已经销毁所以无法获取到缓存的包围盒\n region = element['_cacheCanvasBBox'];\n }\n return region;\n}\nfunction getMergedRegion(elements) {\n if (!elements.length) {\n return null;\n }\n var minXArr = [];\n var minYArr = [];\n var maxXArr = [];\n var maxYArr = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(elements, function (el) {\n var region = getRefreshRegion(el);\n if (region) {\n minXArr.push(region.minX);\n minYArr.push(region.minY);\n maxXArr.push(region.maxX);\n maxYArr.push(region.maxY);\n }\n });\n return {\n minX: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"min\"])(minXArr),\n minY: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"min\"])(minYArr),\n maxX: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"max\"])(maxXArr),\n maxY: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"max\"])(maxYArr),\n };\n}\nfunction mergeView(region, viewRegion) {\n if (!region || !viewRegion) {\n return null;\n }\n // 不相交,则直接返回 null\n if (!Object(_util__WEBPACK_IMPORTED_MODULE_3__[\"intersectRect\"])(region, viewRegion)) {\n return null;\n }\n return {\n minX: Math.max(region.minX, viewRegion.minX),\n minY: Math.max(region.minY, viewRegion.minY),\n maxX: Math.min(region.maxX, viewRegion.maxX),\n maxY: Math.min(region.maxY, viewRegion.maxY),\n };\n}\n//# sourceMappingURL=draw.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-canvas/esm/util/draw.js?"); /***/ }), @@ -1616,7 +1926,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n/* harmony import */ var _antv_g_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-math */ \"./node_modules/@antv/g-math/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix/vec3 */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/g-canvas/esm/util/util.js\");\n/* harmony import */ var _in_stroke_line__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./in-stroke/line */ \"./node_modules/@antv/g-canvas/esm/util/in-stroke/line.js\");\n/* harmony import */ var _in_stroke_arc__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./in-stroke/arc */ \"./node_modules/@antv/g-canvas/esm/util/in-stroke/arc.js\");\n\n/**\n * @fileoverview path 的一些工具\n * @author dxq613@gmail.com\n */\n\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_3__[\"ext\"].transform;\nfunction hasArc(path) {\n var hasArc = false;\n var count = path.length;\n for (var i = 0; i < count; i++) {\n var params = path[i];\n var cmd = params[0];\n if (cmd === 'C' || cmd === 'A' || cmd === 'Q') {\n hasArc = true;\n break;\n }\n }\n return hasArc;\n}\nfunction isPointInStroke(segments, lineWidth, x, y, length) {\n var isHit = false;\n var halfWidth = lineWidth / 2;\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n var currentPoint = segment.currentPoint, params = segment.params, prePoint = segment.prePoint, box = segment.box;\n // 如果在前面已经生成过包围盒,直接按照包围盒计算\n if (box && !Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"inBox\"])(box.x - halfWidth, box.y - halfWidth, box.width + lineWidth, box.height + lineWidth, x, y)) {\n continue;\n }\n switch (segment.command) {\n // L 和 Z 都是直线, M 不进行拾取\n case 'L':\n case 'Z':\n isHit = Object(_in_stroke_line__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(prePoint[0], prePoint[1], currentPoint[0], currentPoint[1], lineWidth, x, y);\n break;\n case 'Q':\n var qDistance = _antv_g_math__WEBPACK_IMPORTED_MODULE_2__[\"Quad\"].pointDistance(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], x, y);\n isHit = qDistance <= lineWidth / 2;\n break;\n case 'C':\n var cDistance = _antv_g_math__WEBPACK_IMPORTED_MODULE_2__[\"Cubic\"].pointDistance(prePoint[0], // 上一段结束位置, 即 C 的起始点\n prePoint[1], params[1], // 'C' 的参数,1、2 为第一个控制点,3、4 为第二个控制点,5、6 为结束点\n params[2], params[3], params[4], params[5], params[6], x, y, length);\n isHit = cDistance <= lineWidth / 2;\n break;\n case 'A':\n // 计算点到椭圆圆弧的距离,暂时使用近似算法,后面可以改成切割法求最近距离\n var arcParams = segment.arcParams;\n var cx = arcParams.cx, cy = arcParams.cy, rx = arcParams.rx, ry = arcParams.ry, startAngle = arcParams.startAngle, endAngle = arcParams.endAngle, xRotation = arcParams.xRotation;\n var p = [x, y, 1];\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n var m = transform(null, [\n ['t', -cx, -cy],\n ['r', -xRotation],\n ['s', 1 / scaleX, 1 / scaleY],\n ]);\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_4__[\"transformMat3\"](p, p, m);\n isHit = Object(_in_stroke_arc__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(0, 0, r, startAngle, endAngle, lineWidth, p[0], p[1]);\n break;\n default:\n break;\n }\n if (isHit) {\n break;\n }\n }\n return isHit;\n}\n/**\n * 提取出内部的闭合多边形和非闭合的多边形,假设 path 不存在圆弧\n * @param {Array} path 路径\n * @returns {Array} 点的集合\n */\nfunction extractPolygons(path) {\n var count = path.length;\n var polygons = [];\n var polylines = [];\n var points = []; // 防止第一个命令不是 'M'\n for (var i = 0; i < count; i++) {\n var params = path[i];\n var cmd = params[0];\n if (cmd === 'M') {\n // 遇到 'M' 判定是否是新数组,新数组中没有点\n if (points.length) {\n // 如果存在点,则说明没有遇到 'Z',开始了一个新的多边形\n polylines.push(points);\n points = []; // 创建新的点\n }\n points.push([params[1], params[2]]);\n }\n else if (cmd === 'Z') {\n if (points.length) {\n // 存在点\n polygons.push(points);\n points = []; // 开始新的点集合\n }\n // 如果不存在点,同时 'Z',则说明是错误,不处理\n }\n else {\n points.push([params[1], params[2]]);\n }\n }\n // 说明 points 未放入 polygons 或者 polyline\n // 仅当只有一个 M,没有 Z 时会发生这种情况\n if (points.length > 0) {\n polylines.push(points);\n }\n return {\n polygons: polygons,\n polylines: polylines,\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({ hasArc: hasArc, extractPolygons: extractPolygons, isPointInStroke: isPointInStroke }, _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"PathUtil\"]));\n//# sourceMappingURL=path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-canvas/esm/util/path.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n/* harmony import */ var _antv_g_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-math */ \"./node_modules/@antv/g-math/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! gl-matrix/vec3 */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/g-canvas/esm/util/util.js\");\n/* harmony import */ var _in_stroke_line__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./in-stroke/line */ \"./node_modules/@antv/g-canvas/esm/util/in-stroke/line.js\");\n/* harmony import */ var _in_stroke_arc__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./in-stroke/arc */ \"./node_modules/@antv/g-canvas/esm/util/in-stroke/arc.js\");\n\n/**\n * @fileoverview path 的一些工具\n * @author dxq613@gmail.com\n */\n\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_3__[\"ext\"].transform;\nfunction hasArc(path) {\n var hasArc = false;\n var count = path.length;\n for (var i = 0; i < count; i++) {\n var params = path[i];\n var cmd = params[0];\n if (cmd === 'C' || cmd === 'A' || cmd === 'Q') {\n hasArc = true;\n break;\n }\n }\n return hasArc;\n}\nfunction isPointInStroke(segments, lineWidth, x, y, length) {\n var isHit = false;\n var halfWidth = lineWidth / 2;\n for (var i = 0; i < segments.length; i++) {\n var segment = segments[i];\n var currentPoint = segment.currentPoint, params = segment.params, prePoint = segment.prePoint, box = segment.box;\n // 如果在前面已经生成过包围盒,直接按照包围盒计算\n if (box && !Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"inBox\"])(box.x - halfWidth, box.y - halfWidth, box.width + lineWidth, box.height + lineWidth, x, y)) {\n continue;\n }\n switch (segment.command) {\n // L 和 Z 都是直线, M 不进行拾取\n case 'L':\n case 'Z':\n isHit = Object(_in_stroke_line__WEBPACK_IMPORTED_MODULE_6__[\"default\"])(prePoint[0], prePoint[1], currentPoint[0], currentPoint[1], lineWidth, x, y);\n break;\n case 'Q':\n var qDistance = _antv_g_math__WEBPACK_IMPORTED_MODULE_2__[\"Quad\"].pointDistance(prePoint[0], prePoint[1], params[1], params[2], params[3], params[4], x, y);\n isHit = qDistance <= lineWidth / 2;\n break;\n case 'C':\n var cDistance = _antv_g_math__WEBPACK_IMPORTED_MODULE_2__[\"Cubic\"].pointDistance(prePoint[0], // 上一段结束位置, 即 C 的起始点\n prePoint[1], params[1], // 'C' 的参数,1、2 为第一个控制点,3、4 为第二个控制点,5、6 为结束点\n params[2], params[3], params[4], params[5], params[6], x, y, length);\n isHit = cDistance <= lineWidth / 2;\n break;\n case 'A':\n // 计算点到椭圆圆弧的距离,暂时使用近似算法,后面可以改成切割法求最近距离\n var arcParams = segment.arcParams;\n var cx = arcParams.cx, cy = arcParams.cy, rx = arcParams.rx, ry = arcParams.ry, startAngle = arcParams.startAngle, endAngle = arcParams.endAngle, xRotation = arcParams.xRotation;\n var p = [x, y, 1];\n var r = rx > ry ? rx : ry;\n var scaleX = rx > ry ? 1 : rx / ry;\n var scaleY = rx > ry ? ry / rx : 1;\n var m = transform(null, [\n ['t', -cx, -cy],\n ['r', -xRotation],\n ['s', 1 / scaleX, 1 / scaleY],\n ]);\n gl_matrix_vec3__WEBPACK_IMPORTED_MODULE_4__[\"transformMat3\"](p, p, m);\n isHit = Object(_in_stroke_arc__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(0, 0, r, startAngle, endAngle, lineWidth, p[0], p[1]);\n break;\n default:\n break;\n }\n if (isHit) {\n break;\n }\n }\n return isHit;\n}\n/**\n * 提取出内部的闭合多边形和非闭合的多边形,假设 path 不存在圆弧\n * @param {Array} path 路径\n * @returns {Array} 点的集合\n */\nfunction extractPolygons(path) {\n var count = path.length;\n var polygons = [];\n var polylines = [];\n var points = []; // 防止第一个命令不是 'M'\n for (var i = 0; i < count; i++) {\n var params = path[i];\n var cmd = params[0];\n if (cmd === 'M') {\n // 遇到 'M' 判定是否是新数组,新数组中没有点\n if (points.length) {\n // 如果存在点,则说明没有遇到 'Z',开始了一个新的多边形\n polylines.push(points);\n points = []; // 创建新的点\n }\n points.push([params[1], params[2]]);\n }\n else if (cmd === 'Z') {\n if (points.length) {\n // 存在点\n polygons.push(points);\n points = []; // 开始新的点集合\n }\n // 如果不存在点,同时 'Z',则说明是错误,不处理\n }\n else {\n points.push([params[1], params[2]]);\n }\n }\n // 说明 points 未放入 polygons 或者 polyline\n // 仅当只有一个 M,没有 Z 时会发生这种情况\n if (points.length > 0) {\n polylines.push(points);\n }\n return {\n polygons: polygons,\n polylines: polylines,\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({ hasArc: hasArc,\n extractPolygons: extractPolygons,\n isPointInStroke: isPointInStroke }, _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"PathUtil\"]));\n//# sourceMappingURL=path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-canvas/esm/util/path.js?"); /***/ }), @@ -1760,7 +2070,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumberEqual\", function() { return isNumberEqual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxByArray\", function() { return getBBoxByArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxRange\", function() { return getBBoxRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"piMod\", function() { return piMod; });\nfunction minNum(array) {\n return Math.min.apply(null, array);\n}\nfunction maxNum(array) {\n return Math.max.apply(null, array);\n}\n/**\n * 两点之间的距离\n * @param {number} x1 起始点 x\n * @param {number} y1 起始点 y\n * @param {number} x2 结束点 x\n * @param {number} y2 结束点 y\n * @return {number} 距离\n */\nfunction distance(x1, y1, x2, y2) {\n var dx = x1 - x2;\n var dy = y1 - y2;\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction isNumberEqual(v1, v2) {\n return Math.abs(v1 - v2) < 0.001;\n}\nfunction getBBoxByArray(xArr, yArr) {\n var minX = minNum(xArr);\n var minY = minNum(yArr);\n var maxX = maxNum(xArr);\n var maxY = maxNum(yArr);\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n}\nfunction getBBoxRange(x1, y1, x2, y2) {\n return {\n minX: minNum([x1, x2]),\n maxX: maxNum([x1, x2]),\n minY: minNum([y1, y2]),\n maxY: maxNum([y1, y2]),\n };\n}\nfunction piMod(angle) {\n return (angle + Math.PI * 2) % (Math.PI * 2);\n}\n//# sourceMappingURL=util.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-math/esm/util.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumberEqual\", function() { return isNumberEqual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxByArray\", function() { return getBBoxByArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxRange\", function() { return getBBoxRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"piMod\", function() { return piMod; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n/**\n * 两点之间的距离\n * @param {number} x1 起始点 x\n * @param {number} y1 起始点 y\n * @param {number} x2 结束点 x\n * @param {number} y2 结束点 y\n * @return {number} 距离\n */\nfunction distance(x1, y1, x2, y2) {\n var dx = x1 - x2;\n var dy = y1 - y2;\n return Math.sqrt(dx * dx + dy * dy);\n}\nfunction isNumberEqual(v1, v2) {\n return Math.abs(v1 - v2) < 0.001;\n}\nfunction getBBoxByArray(xArr, yArr) {\n var minX = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"min\"])(xArr);\n var minY = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"min\"])(yArr);\n var maxX = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"max\"])(xArr);\n var maxY = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"max\"])(yArr);\n return {\n x: minX,\n y: minY,\n width: maxX - minX,\n height: maxY - minY,\n };\n}\nfunction getBBoxRange(x1, y1, x2, y2) {\n return {\n minX: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"min\"])([x1, x2]),\n maxX: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"max\"])([x1, x2]),\n minY: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"min\"])([y1, y2]),\n maxY: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"max\"])([y1, y2]),\n };\n}\nfunction piMod(angle) {\n return (angle + Math.PI * 2) % (Math.PI * 2);\n}\n//# sourceMappingURL=util.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-math/esm/util.js?"); /***/ }), @@ -1876,11 +2186,11 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tsli /*!***********************************************!*\ !*** ./node_modules/@antv/g-svg/esm/index.js ***! \***********************************************/ -/*! exports provided: Event, Base, AbstractCanvas, AbstractGroup, AbstractShape, PathUtil, getBBoxMethod, registerBBox, getTextHeight, assembleFont, isAllowCapture, multiplyVec2, invert, getOffScreenContext, registerEasing, Canvas, Group, Shape, version */ +/*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g-svg/esm/shape/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _shape__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _antv_g_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Event\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"Event\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Base\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"Base\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractCanvas\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"AbstractCanvas\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGroup\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"AbstractGroup\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractShape\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"AbstractShape\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PathUtil\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"PathUtil\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getBBoxMethod\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"getBBoxMethod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerBBox\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"registerBBox\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTextHeight\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"getTextHeight\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"assembleFont\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"assembleFont\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isAllowCapture\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"isAllowCapture\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"multiplyVec2\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"multiplyVec2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"invert\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getOffScreenContext\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"getOffScreenContext\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerEasing\", function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"registerEasing\"]; });\n\n/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./canvas */ \"./node_modules/@antv/g-svg/esm/canvas.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Canvas\", function() { return _canvas__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./group */ \"./node_modules/@antv/g-svg/esm/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Group\", function() { return _group__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n\n\n\n\n\nvar version = '0.5.6';\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-svg/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g-svg/esm/shape/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _shape__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _antv_g_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _antv_g_base__WEBPACK_IMPORTED_MODULE_1__) if([\"default\",\"Canvas\",\"Group\",\"Shape\",\"version\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _antv_g_base__WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _canvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./canvas */ \"./node_modules/@antv/g-svg/esm/canvas.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Canvas\", function() { return _canvas__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./group */ \"./node_modules/@antv/g-svg/esm/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Group\", function() { return _group__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n\n\n\n\n\nvar version = '0.5.6';\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-svg/esm/index.js?"); /***/ }), @@ -2108,7 +2418,7 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Component\", function() { return Component; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ComponentManager\", function() { return ComponentManager; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _Entity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Entity */ \"./node_modules/@antv/g-webgpu-core/es/Entity.js\");\n\n\n\n\n\nvar Component = function Component(data) {//\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, Component);\n};\n/**\n * 管理某一类 Component,尽可能做到 AoS 而非 SoA\n * @see https://wickedengine.net/2019/09/29/entity-component-system/\n * @see https://github.com/turanszkij/WickedEngine/blob/master/WickedEngine/wiECS.h\n */\n// tslint:disable-next-line:max-classes-per-file\n\nvar ComponentManager = /*#__PURE__*/function () {\n /**\n * 不在 Entity 中维护拥有的 Component 列表,反之亦然\n */\n function ComponentManager(clazz) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, ComponentManager);\n\n this.clazz = void 0;\n this.components = [];\n this.entities = [];\n this.lookup = {};\n this.clazz = clazz;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(ComponentManager, [{\n key: \"clear\",\n value: function clear() {\n this.components = [];\n this.entities = [];\n this.lookup = {};\n }\n }, {\n key: \"contains\",\n value: function contains(entity) {\n return this.lookup[entity] > -1;\n }\n }, {\n key: \"create\",\n value: function create(entity, data) {\n this.lookup[entity] = this.components.length;\n var component = new this.clazz(data || {});\n this.components.push(component);\n this.entities.push(entity);\n return component;\n }\n }, {\n key: \"remove\",\n value: function remove(entity) {\n var componentIndex = this.lookup[entity];\n\n if (componentIndex > -1) {\n if (componentIndex < this.components.length - 1) {\n // 将待删除元素和最后一个元素交换\n // C++ 中有 std::move 这样的操作,避免数据的拷贝\n // @see https://github.com/turanszkij/WickedEngine/blob/master/WickedEngine/wiECS.h#L169\n this.components[componentIndex] = this.components[this.components.length - 1];\n this.entities[componentIndex] = this.entities[this.entities.length - 1];\n this.lookup[this.entities[componentIndex]] = componentIndex;\n }\n } // 待删除元素已经移动到了最后一个\n\n\n this.components.pop();\n this.entities.pop();\n delete this.lookup[entity];\n }\n }, {\n key: \"removeKeepSorted\",\n value: function removeKeepSorted(entity) {\n var componentIndex = this.lookup[entity];\n\n if (componentIndex > -1) {\n var entity2 = this.entities[componentIndex];\n\n if (componentIndex < this.components.length - 1) {\n // Move every component left by one that is after this element:\n for (var _i = componentIndex + 1; _i < this.components.length; ++_i) {\n this.components[_i - 1] = this.components[_i];\n } // Move every entity left by one that is after this element and update lut:\n\n\n for (var _i2 = componentIndex + 1; _i2 < this.entities.length; ++_i2) {\n this.entities[_i2 - 1] = this.entities[_i2];\n this.lookup[this.entities[_i2 - 1]] = _i2 - 1;\n }\n }\n\n this.components.pop();\n this.entities.pop();\n delete this.lookup[entity2];\n }\n }\n }, {\n key: \"moveItem\",\n value: function moveItem(srcIndex, destIndex) {\n if (srcIndex === destIndex) {\n return;\n } // Save the moved component and entity:\n\n\n var srcComponent = this.components[srcIndex];\n var srcEntity = this.entities[srcIndex]; // Every other entity-component that's in the way gets moved by one and lut is kept updated:\n\n var direction = srcIndex < destIndex ? 1 : -1;\n\n for (var _i3 = srcIndex; _i3 !== destIndex; _i3 += direction) {\n var next = _i3 + direction;\n this.components[_i3] = this.components[next];\n this.entities[_i3] = this.entities[next];\n this.lookup[this.entities[_i3]] = _i3;\n } // Saved entity-component moved to the required position:\n\n\n this.components[destIndex] = srcComponent;\n this.entities[destIndex] = srcEntity;\n this.lookup[srcEntity] = destIndex;\n }\n }, {\n key: \"getEntity\",\n value: function getEntity(index) {\n return this.entities[index];\n }\n /**\n * 由于缺少类似 C++ 的重载操作符,没法通过 [下标] 直接访问。因此只能增加该方法用于遍历。\n */\n\n }, {\n key: \"getComponent\",\n value: function getComponent(index) {\n return this.components[index];\n }\n }, {\n key: \"getComponentByEntity\",\n value: function getComponentByEntity(entity) {\n var componentIndex = this.lookup[entity];\n\n if (componentIndex > -1) {\n return this.components[componentIndex];\n }\n\n return null;\n }\n }, {\n key: \"getCount\",\n value: function getCount() {\n return this.components.length;\n }\n }, {\n key: \"getEntityByComponentIndex\",\n value: function getEntityByComponentIndex(componentIdx) {\n for (var _i4 = 0, _Object$keys = Object.keys(this.lookup); _i4 < _Object$keys.length; _i4++) {\n var _entity = _Object$keys[_i4];\n var entityInNum = Number(_entity);\n\n if (this.lookup[entityInNum] === componentIdx) {\n return entityInNum;\n }\n }\n\n return _Entity__WEBPACK_IMPORTED_MODULE_4__[\"EMPTY\"];\n }\n }, {\n key: \"find\",\n value: function find(callback) {\n for (var _i5 = 0; _i5 < this.getCount(); _i5++) {\n var _component = this.getComponent(_i5);\n\n if (callback(_component, _i5)) {\n return _component;\n }\n }\n\n return null;\n }\n }, {\n key: \"findIndex\",\n value: function findIndex(callback) {\n for (var _i6 = 0; _i6 < this.getCount(); _i6++) {\n var _component2 = this.getComponent(_i6);\n\n if (callback(_component2, _i6)) {\n return _i6;\n }\n }\n\n return -1;\n }\n }, {\n key: \"forEach\",\n value: function forEach(callback) {\n for (var _i7 = 0, _Object$keys2 = Object.keys(this.lookup); _i7 < _Object$keys2.length; _i7++) {\n var _entity2 = _Object$keys2[_i7];\n var entityInNum = Number(_entity2);\n var componentIndex = this.lookup[entityInNum];\n callback(entityInNum, this.getComponent(componentIndex));\n }\n }\n }, {\n key: \"forEachAsync\",\n value: function () {\n var _forEachAsync = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(callback) {\n var _i8, _Object$keys3, _entity3, entityInNum, componentIndex;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _i8 = 0, _Object$keys3 = Object.keys(this.lookup);\n\n case 1:\n if (!(_i8 < _Object$keys3.length)) {\n _context.next = 10;\n break;\n }\n\n _entity3 = _Object$keys3[_i8];\n entityInNum = Number(_entity3);\n componentIndex = this.lookup[entityInNum];\n _context.next = 7;\n return callback(entityInNum, this.getComponent(componentIndex));\n\n case 7:\n _i8++;\n _context.next = 1;\n break;\n\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function forEachAsync(_x) {\n return _forEachAsync.apply(this, arguments);\n }\n\n return forEachAsync;\n }()\n }, {\n key: \"map\",\n value: function map(callback) {\n var result = [];\n\n for (var _i9 = 0, _Object$keys4 = Object.keys(this.lookup); _i9 < _Object$keys4.length; _i9++) {\n var _entity4 = _Object$keys4[_i9];\n var entityInNum = Number(_entity4);\n var componentIndex = this.lookup[entityInNum];\n result.push(callback(entityInNum, this.getComponent(componentIndex)));\n }\n\n return result;\n }\n }]);\n\n return ComponentManager;\n}();\n//# sourceMappingURL=ComponentManager.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/ComponentManager.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Component\", function() { return Component; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ComponentManager\", function() { return ComponentManager; });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _Entity__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Entity */ \"./node_modules/@antv/g-webgpu-core/es/Entity.js\");\n\n\n\n\n\nvar Component = /*#__PURE__*/_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(function Component(data) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Component);\n} //\n);\n\n/**\n * 管理某一类 Component,尽可能做到 AoS 而非 SoA\n * @see https://wickedengine.net/2019/09/29/entity-component-system/\n * @see https://github.com/turanszkij/WickedEngine/blob/master/WickedEngine/wiECS.h\n */\n// tslint:disable-next-line:max-classes-per-file\nvar ComponentManager = /*#__PURE__*/function () {\n /**\n * 不在 Entity 中维护拥有的 Component 列表,反之亦然\n */\n\n function ComponentManager(clazz) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, ComponentManager);\n this.clazz = void 0;\n this.components = [];\n this.entities = [];\n this.lookup = {};\n this.clazz = clazz;\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ComponentManager, [{\n key: \"clear\",\n value: function clear() {\n this.components = [];\n this.entities = [];\n this.lookup = {};\n }\n }, {\n key: \"contains\",\n value: function contains(entity) {\n return this.lookup[entity] > -1;\n }\n }, {\n key: \"create\",\n value: function create(entity, data) {\n this.lookup[entity] = this.components.length;\n var component = new this.clazz(data || {});\n this.components.push(component);\n this.entities.push(entity);\n return component;\n }\n }, {\n key: \"remove\",\n value: function remove(entity) {\n var componentIndex = this.lookup[entity];\n if (componentIndex > -1) {\n if (componentIndex < this.components.length - 1) {\n // 将待删除元素和最后一个元素交换\n // C++ 中有 std::move 这样的操作,避免数据的拷贝\n // @see https://github.com/turanszkij/WickedEngine/blob/master/WickedEngine/wiECS.h#L169\n this.components[componentIndex] = this.components[this.components.length - 1];\n this.entities[componentIndex] = this.entities[this.entities.length - 1];\n this.lookup[this.entities[componentIndex]] = componentIndex;\n }\n }\n\n // 待删除元素已经移动到了最后一个\n this.components.pop();\n this.entities.pop();\n delete this.lookup[entity];\n }\n }, {\n key: \"removeKeepSorted\",\n value: function removeKeepSorted(entity) {\n var componentIndex = this.lookup[entity];\n if (componentIndex > -1) {\n var entity2 = this.entities[componentIndex];\n if (componentIndex < this.components.length - 1) {\n // Move every component left by one that is after this element:\n for (var _i = componentIndex + 1; _i < this.components.length; ++_i) {\n this.components[_i - 1] = this.components[_i];\n }\n // Move every entity left by one that is after this element and update lut:\n for (var _i2 = componentIndex + 1; _i2 < this.entities.length; ++_i2) {\n this.entities[_i2 - 1] = this.entities[_i2];\n this.lookup[this.entities[_i2 - 1]] = _i2 - 1;\n }\n }\n this.components.pop();\n this.entities.pop();\n delete this.lookup[entity2];\n }\n }\n }, {\n key: \"moveItem\",\n value: function moveItem(srcIndex, destIndex) {\n if (srcIndex === destIndex) {\n return;\n }\n\n // Save the moved component and entity:\n var srcComponent = this.components[srcIndex];\n var srcEntity = this.entities[srcIndex];\n\n // Every other entity-component that's in the way gets moved by one and lut is kept updated:\n var direction = srcIndex < destIndex ? 1 : -1;\n for (var _i3 = srcIndex; _i3 !== destIndex; _i3 += direction) {\n var next = _i3 + direction;\n this.components[_i3] = this.components[next];\n this.entities[_i3] = this.entities[next];\n this.lookup[this.entities[_i3]] = _i3;\n }\n\n // Saved entity-component moved to the required position:\n this.components[destIndex] = srcComponent;\n this.entities[destIndex] = srcEntity;\n this.lookup[srcEntity] = destIndex;\n }\n }, {\n key: \"getEntity\",\n value: function getEntity(index) {\n return this.entities[index];\n }\n\n /**\n * 由于缺少类似 C++ 的重载操作符,没法通过 [下标] 直接访问。因此只能增加该方法用于遍历。\n */\n }, {\n key: \"getComponent\",\n value: function getComponent(index) {\n return this.components[index];\n }\n }, {\n key: \"getComponentByEntity\",\n value: function getComponentByEntity(entity) {\n var componentIndex = this.lookup[entity];\n if (componentIndex > -1) {\n return this.components[componentIndex];\n }\n return null;\n }\n }, {\n key: \"getCount\",\n value: function getCount() {\n return this.components.length;\n }\n }, {\n key: \"getEntityByComponentIndex\",\n value: function getEntityByComponentIndex(componentIdx) {\n for (var _i4 = 0, _Object$keys = Object.keys(this.lookup); _i4 < _Object$keys.length; _i4++) {\n var _entity = _Object$keys[_i4];\n var entityInNum = Number(_entity);\n if (this.lookup[entityInNum] === componentIdx) {\n return entityInNum;\n }\n }\n return _Entity__WEBPACK_IMPORTED_MODULE_4__[\"EMPTY\"];\n }\n }, {\n key: \"find\",\n value: function find(callback) {\n for (var _i5 = 0; _i5 < this.getCount(); _i5++) {\n var _component = this.getComponent(_i5);\n if (callback(_component, _i5)) {\n return _component;\n }\n }\n return null;\n }\n }, {\n key: \"findIndex\",\n value: function findIndex(callback) {\n for (var _i6 = 0; _i6 < this.getCount(); _i6++) {\n var _component2 = this.getComponent(_i6);\n if (callback(_component2, _i6)) {\n return _i6;\n }\n }\n return -1;\n }\n }, {\n key: \"forEach\",\n value: function forEach(callback) {\n for (var _i7 = 0, _Object$keys2 = Object.keys(this.lookup); _i7 < _Object$keys2.length; _i7++) {\n var _entity2 = _Object$keys2[_i7];\n var entityInNum = Number(_entity2);\n var componentIndex = this.lookup[entityInNum];\n callback(entityInNum, this.getComponent(componentIndex));\n }\n }\n }, {\n key: \"forEachAsync\",\n value: function () {\n var _forEachAsync = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee(callback) {\n var _i8, _Object$keys3, _entity3, entityInNum, componentIndex;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _i8 = 0, _Object$keys3 = Object.keys(this.lookup);\n case 1:\n if (!(_i8 < _Object$keys3.length)) {\n _context.next = 10;\n break;\n }\n _entity3 = _Object$keys3[_i8];\n entityInNum = Number(_entity3);\n componentIndex = this.lookup[entityInNum];\n _context.next = 7;\n return callback(entityInNum, this.getComponent(componentIndex));\n case 7:\n _i8++;\n _context.next = 1;\n break;\n case 10:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function forEachAsync(_x) {\n return _forEachAsync.apply(this, arguments);\n }\n return forEachAsync;\n }()\n }, {\n key: \"map\",\n value: function map(callback) {\n var result = [];\n for (var _i9 = 0, _Object$keys4 = Object.keys(this.lookup); _i9 < _Object$keys4.length; _i9++) {\n var _entity4 = _Object$keys4[_i9];\n var entityInNum = Number(_entity4);\n var componentIndex = this.lookup[entityInNum];\n result.push(callback(entityInNum, this.getComponent(componentIndex)));\n }\n return result;\n }\n }]);\n return ComponentManager;\n}();\n//# sourceMappingURL=ComponentManager.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/ComponentManager.js?"); /***/ }), @@ -2120,9547 +2430,9312 @@ eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) * /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EMPTY\", function() { return EMPTY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createEntity\", function() { return createEntity; });\nvar EMPTY = -1;\nvar entitySequence = 1;\n/**\n * 类似关系型数据库的主键\n * TODO: 自动生成,考虑序列化\n */\n\nfunction createEntity() {\n return entitySequence++;\n}\n//# sourceMappingURL=Entity.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/Entity.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EMPTY\", function() { return EMPTY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createEntity\", function() { return createEntity; });\nvar EMPTY = -1;\nvar entitySequence = 1;\n\n/**\n * 类似关系型数据库的主键\n * TODO: 自动生成,考虑序列化\n */\nfunction createEntity() {\n return entitySequence++;\n}\n//# sourceMappingURL=Entity.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/Entity.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/framegraph/FrameGraphHandle.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/framegraph/FrameGraphHandle.js ***! - \***************************************************************************************/ -/*! exports provided: FrameGraphHandle */ +/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js ***! + \***********************************************************************/ +/*! exports provided: gl */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FrameGraphHandle\", function() { return FrameGraphHandle; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n\nvar FrameGraphHandle = function FrameGraphHandle() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FrameGraphHandle);\n\n this.index = void 0;\n};\n//# sourceMappingURL=FrameGraphHandle.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/framegraph/FrameGraphHandle.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gl\", function() { return gl; });\n/**\n * WebGL 枚举值\n * @see http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14\n * 使用 babel 插件对常量进行内联,以减少最终打包产物大小\n * @see https://github.com/uber/deck.gl/blob/7.1-release/dev-docs/roadmaps/dist-size-roadmap.md#inline-gl-constants\n * 为了支持 WebGPU,新增 TextureUsage\n * @see https://gpuweb.github.io/gpuweb/#gputextureusage\n */\nvar gl;\n(function (gl) {\n gl[gl[\"DEPTH_BUFFER_BIT\"] = 256] = \"DEPTH_BUFFER_BIT\";\n gl[gl[\"STENCIL_BUFFER_BIT\"] = 1024] = \"STENCIL_BUFFER_BIT\";\n gl[gl[\"COLOR_BUFFER_BIT\"] = 16384] = \"COLOR_BUFFER_BIT\";\n gl[gl[\"POINTS\"] = 0] = \"POINTS\";\n gl[gl[\"LINES\"] = 1] = \"LINES\";\n gl[gl[\"LINE_LOOP\"] = 2] = \"LINE_LOOP\";\n gl[gl[\"LINE_STRIP\"] = 3] = \"LINE_STRIP\";\n gl[gl[\"TRIANGLES\"] = 4] = \"TRIANGLES\";\n gl[gl[\"TRIANGLE_STRIP\"] = 5] = \"TRIANGLE_STRIP\";\n gl[gl[\"TRIANGLE_FAN\"] = 6] = \"TRIANGLE_FAN\";\n gl[gl[\"ZERO\"] = 0] = \"ZERO\";\n gl[gl[\"ONE\"] = 1] = \"ONE\";\n gl[gl[\"SRC_COLOR\"] = 768] = \"SRC_COLOR\";\n gl[gl[\"ONE_MINUS_SRC_COLOR\"] = 769] = \"ONE_MINUS_SRC_COLOR\";\n gl[gl[\"SRC_ALPHA\"] = 770] = \"SRC_ALPHA\";\n gl[gl[\"ONE_MINUS_SRC_ALPHA\"] = 771] = \"ONE_MINUS_SRC_ALPHA\";\n gl[gl[\"DST_ALPHA\"] = 772] = \"DST_ALPHA\";\n gl[gl[\"ONE_MINUS_DST_ALPHA\"] = 773] = \"ONE_MINUS_DST_ALPHA\";\n gl[gl[\"DST_COLOR\"] = 774] = \"DST_COLOR\";\n gl[gl[\"ONE_MINUS_DST_COLOR\"] = 775] = \"ONE_MINUS_DST_COLOR\";\n gl[gl[\"SRC_ALPHA_SATURATE\"] = 776] = \"SRC_ALPHA_SATURATE\";\n gl[gl[\"FUNC_ADD\"] = 32774] = \"FUNC_ADD\";\n gl[gl[\"BLEND_EQUATION\"] = 32777] = \"BLEND_EQUATION\";\n gl[gl[\"BLEND_EQUATION_RGB\"] = 32777] = \"BLEND_EQUATION_RGB\";\n gl[gl[\"BLEND_EQUATION_ALPHA\"] = 34877] = \"BLEND_EQUATION_ALPHA\";\n gl[gl[\"FUNC_SUBTRACT\"] = 32778] = \"FUNC_SUBTRACT\";\n gl[gl[\"FUNC_REVERSE_SUBTRACT\"] = 32779] = \"FUNC_REVERSE_SUBTRACT\";\n gl[gl[\"MAX_EXT\"] = 32776] = \"MAX_EXT\";\n gl[gl[\"MIN_EXT\"] = 32775] = \"MIN_EXT\";\n gl[gl[\"BLEND_DST_RGB\"] = 32968] = \"BLEND_DST_RGB\";\n gl[gl[\"BLEND_SRC_RGB\"] = 32969] = \"BLEND_SRC_RGB\";\n gl[gl[\"BLEND_DST_ALPHA\"] = 32970] = \"BLEND_DST_ALPHA\";\n gl[gl[\"BLEND_SRC_ALPHA\"] = 32971] = \"BLEND_SRC_ALPHA\";\n gl[gl[\"CONSTANT_COLOR\"] = 32769] = \"CONSTANT_COLOR\";\n gl[gl[\"ONE_MINUS_CONSTANT_COLOR\"] = 32770] = \"ONE_MINUS_CONSTANT_COLOR\";\n gl[gl[\"CONSTANT_ALPHA\"] = 32771] = \"CONSTANT_ALPHA\";\n gl[gl[\"ONE_MINUS_CONSTANT_ALPHA\"] = 32772] = \"ONE_MINUS_CONSTANT_ALPHA\";\n gl[gl[\"BLEND_COLOR\"] = 32773] = \"BLEND_COLOR\";\n gl[gl[\"ARRAY_BUFFER\"] = 34962] = \"ARRAY_BUFFER\";\n gl[gl[\"ELEMENT_ARRAY_BUFFER\"] = 34963] = \"ELEMENT_ARRAY_BUFFER\";\n gl[gl[\"ARRAY_BUFFER_BINDING\"] = 34964] = \"ARRAY_BUFFER_BINDING\";\n gl[gl[\"ELEMENT_ARRAY_BUFFER_BINDING\"] = 34965] = \"ELEMENT_ARRAY_BUFFER_BINDING\";\n gl[gl[\"STREAM_DRAW\"] = 35040] = \"STREAM_DRAW\";\n gl[gl[\"STATIC_DRAW\"] = 35044] = \"STATIC_DRAW\";\n gl[gl[\"DYNAMIC_DRAW\"] = 35048] = \"DYNAMIC_DRAW\";\n gl[gl[\"BUFFER_SIZE\"] = 34660] = \"BUFFER_SIZE\";\n gl[gl[\"BUFFER_USAGE\"] = 34661] = \"BUFFER_USAGE\";\n gl[gl[\"CURRENT_VERTEX_ATTRIB\"] = 34342] = \"CURRENT_VERTEX_ATTRIB\";\n gl[gl[\"FRONT\"] = 1028] = \"FRONT\";\n gl[gl[\"BACK\"] = 1029] = \"BACK\";\n gl[gl[\"FRONT_AND_BACK\"] = 1032] = \"FRONT_AND_BACK\";\n gl[gl[\"CULL_FACE\"] = 2884] = \"CULL_FACE\";\n gl[gl[\"BLEND\"] = 3042] = \"BLEND\";\n gl[gl[\"DITHER\"] = 3024] = \"DITHER\";\n gl[gl[\"STENCIL_TEST\"] = 2960] = \"STENCIL_TEST\";\n gl[gl[\"DEPTH_TEST\"] = 2929] = \"DEPTH_TEST\";\n gl[gl[\"SCISSOR_TEST\"] = 3089] = \"SCISSOR_TEST\";\n gl[gl[\"POLYGON_OFFSET_FILL\"] = 32823] = \"POLYGON_OFFSET_FILL\";\n gl[gl[\"SAMPLE_ALPHA_TO_COVERAGE\"] = 32926] = \"SAMPLE_ALPHA_TO_COVERAGE\";\n gl[gl[\"SAMPLE_COVERAGE\"] = 32928] = \"SAMPLE_COVERAGE\";\n gl[gl[\"NO_ERROR\"] = 0] = \"NO_ERROR\";\n gl[gl[\"INVALID_ENUM\"] = 1280] = \"INVALID_ENUM\";\n gl[gl[\"INVALID_VALUE\"] = 1281] = \"INVALID_VALUE\";\n gl[gl[\"INVALID_OPERATION\"] = 1282] = \"INVALID_OPERATION\";\n gl[gl[\"OUT_OF_MEMORY\"] = 1285] = \"OUT_OF_MEMORY\";\n gl[gl[\"CW\"] = 2304] = \"CW\";\n gl[gl[\"CCW\"] = 2305] = \"CCW\";\n gl[gl[\"LINE_WIDTH\"] = 2849] = \"LINE_WIDTH\";\n gl[gl[\"ALIASED_POINT_SIZE_RANGE\"] = 33901] = \"ALIASED_POINT_SIZE_RANGE\";\n gl[gl[\"ALIASED_LINE_WIDTH_RANGE\"] = 33902] = \"ALIASED_LINE_WIDTH_RANGE\";\n gl[gl[\"CULL_FACE_MODE\"] = 2885] = \"CULL_FACE_MODE\";\n gl[gl[\"FRONT_FACE\"] = 2886] = \"FRONT_FACE\";\n gl[gl[\"DEPTH_RANGE\"] = 2928] = \"DEPTH_RANGE\";\n gl[gl[\"DEPTH_WRITEMASK\"] = 2930] = \"DEPTH_WRITEMASK\";\n gl[gl[\"DEPTH_CLEAR_VALUE\"] = 2931] = \"DEPTH_CLEAR_VALUE\";\n gl[gl[\"DEPTH_FUNC\"] = 2932] = \"DEPTH_FUNC\";\n gl[gl[\"STENCIL_CLEAR_VALUE\"] = 2961] = \"STENCIL_CLEAR_VALUE\";\n gl[gl[\"STENCIL_FUNC\"] = 2962] = \"STENCIL_FUNC\";\n gl[gl[\"STENCIL_FAIL\"] = 2964] = \"STENCIL_FAIL\";\n gl[gl[\"STENCIL_PASS_DEPTH_FAIL\"] = 2965] = \"STENCIL_PASS_DEPTH_FAIL\";\n gl[gl[\"STENCIL_PASS_DEPTH_PASS\"] = 2966] = \"STENCIL_PASS_DEPTH_PASS\";\n gl[gl[\"STENCIL_REF\"] = 2967] = \"STENCIL_REF\";\n gl[gl[\"STENCIL_VALUE_MASK\"] = 2963] = \"STENCIL_VALUE_MASK\";\n gl[gl[\"STENCIL_WRITEMASK\"] = 2968] = \"STENCIL_WRITEMASK\";\n gl[gl[\"STENCIL_BACK_FUNC\"] = 34816] = \"STENCIL_BACK_FUNC\";\n gl[gl[\"STENCIL_BACK_FAIL\"] = 34817] = \"STENCIL_BACK_FAIL\";\n gl[gl[\"STENCIL_BACK_PASS_DEPTH_FAIL\"] = 34818] = \"STENCIL_BACK_PASS_DEPTH_FAIL\";\n gl[gl[\"STENCIL_BACK_PASS_DEPTH_PASS\"] = 34819] = \"STENCIL_BACK_PASS_DEPTH_PASS\";\n gl[gl[\"STENCIL_BACK_REF\"] = 36003] = \"STENCIL_BACK_REF\";\n gl[gl[\"STENCIL_BACK_VALUE_MASK\"] = 36004] = \"STENCIL_BACK_VALUE_MASK\";\n gl[gl[\"STENCIL_BACK_WRITEMASK\"] = 36005] = \"STENCIL_BACK_WRITEMASK\";\n gl[gl[\"VIEWPORT\"] = 2978] = \"VIEWPORT\";\n gl[gl[\"SCISSOR_BOX\"] = 3088] = \"SCISSOR_BOX\";\n gl[gl[\"COLOR_CLEAR_VALUE\"] = 3106] = \"COLOR_CLEAR_VALUE\";\n gl[gl[\"COLOR_WRITEMASK\"] = 3107] = \"COLOR_WRITEMASK\";\n gl[gl[\"UNPACK_ALIGNMENT\"] = 3317] = \"UNPACK_ALIGNMENT\";\n gl[gl[\"PACK_ALIGNMENT\"] = 3333] = \"PACK_ALIGNMENT\";\n gl[gl[\"MAX_TEXTURE_SIZE\"] = 3379] = \"MAX_TEXTURE_SIZE\";\n gl[gl[\"MAX_VIEWPORT_DIMS\"] = 3386] = \"MAX_VIEWPORT_DIMS\";\n gl[gl[\"SUBPIXEL_BITS\"] = 3408] = \"SUBPIXEL_BITS\";\n gl[gl[\"RED_BITS\"] = 3410] = \"RED_BITS\";\n gl[gl[\"GREEN_BITS\"] = 3411] = \"GREEN_BITS\";\n gl[gl[\"BLUE_BITS\"] = 3412] = \"BLUE_BITS\";\n gl[gl[\"ALPHA_BITS\"] = 3413] = \"ALPHA_BITS\";\n gl[gl[\"DEPTH_BITS\"] = 3414] = \"DEPTH_BITS\";\n gl[gl[\"STENCIL_BITS\"] = 3415] = \"STENCIL_BITS\";\n gl[gl[\"POLYGON_OFFSET_UNITS\"] = 10752] = \"POLYGON_OFFSET_UNITS\";\n gl[gl[\"POLYGON_OFFSET_FACTOR\"] = 32824] = \"POLYGON_OFFSET_FACTOR\";\n gl[gl[\"TEXTURE_BINDING_2D\"] = 32873] = \"TEXTURE_BINDING_2D\";\n gl[gl[\"SAMPLE_BUFFERS\"] = 32936] = \"SAMPLE_BUFFERS\";\n gl[gl[\"SAMPLES\"] = 32937] = \"SAMPLES\";\n gl[gl[\"SAMPLE_COVERAGE_VALUE\"] = 32938] = \"SAMPLE_COVERAGE_VALUE\";\n gl[gl[\"SAMPLE_COVERAGE_INVERT\"] = 32939] = \"SAMPLE_COVERAGE_INVERT\";\n gl[gl[\"COMPRESSED_TEXTURE_FORMATS\"] = 34467] = \"COMPRESSED_TEXTURE_FORMATS\";\n gl[gl[\"DONT_CARE\"] = 4352] = \"DONT_CARE\";\n gl[gl[\"FASTEST\"] = 4353] = \"FASTEST\";\n gl[gl[\"NICEST\"] = 4354] = \"NICEST\";\n gl[gl[\"GENERATE_MIPMAP_HINT\"] = 33170] = \"GENERATE_MIPMAP_HINT\";\n gl[gl[\"BYTE\"] = 5120] = \"BYTE\";\n gl[gl[\"UNSIGNED_BYTE\"] = 5121] = \"UNSIGNED_BYTE\";\n gl[gl[\"SHORT\"] = 5122] = \"SHORT\";\n gl[gl[\"UNSIGNED_SHORT\"] = 5123] = \"UNSIGNED_SHORT\";\n gl[gl[\"INT\"] = 5124] = \"INT\";\n gl[gl[\"UNSIGNED_INT\"] = 5125] = \"UNSIGNED_INT\";\n gl[gl[\"FLOAT\"] = 5126] = \"FLOAT\";\n gl[gl[\"DEPTH_COMPONENT\"] = 6402] = \"DEPTH_COMPONENT\";\n gl[gl[\"ALPHA\"] = 6406] = \"ALPHA\";\n gl[gl[\"RGB\"] = 6407] = \"RGB\";\n gl[gl[\"RGBA\"] = 6408] = \"RGBA\";\n gl[gl[\"LUMINANCE\"] = 6409] = \"LUMINANCE\";\n gl[gl[\"LUMINANCE_ALPHA\"] = 6410] = \"LUMINANCE_ALPHA\";\n gl[gl[\"UNSIGNED_SHORT_4_4_4_4\"] = 32819] = \"UNSIGNED_SHORT_4_4_4_4\";\n gl[gl[\"UNSIGNED_SHORT_5_5_5_1\"] = 32820] = \"UNSIGNED_SHORT_5_5_5_1\";\n gl[gl[\"UNSIGNED_SHORT_5_6_5\"] = 33635] = \"UNSIGNED_SHORT_5_6_5\";\n gl[gl[\"FRAGMENT_SHADER\"] = 35632] = \"FRAGMENT_SHADER\";\n gl[gl[\"VERTEX_SHADER\"] = 35633] = \"VERTEX_SHADER\";\n gl[gl[\"MAX_VERTEX_ATTRIBS\"] = 34921] = \"MAX_VERTEX_ATTRIBS\";\n gl[gl[\"MAX_VERTEX_UNIFORM_VECTORS\"] = 36347] = \"MAX_VERTEX_UNIFORM_VECTORS\";\n gl[gl[\"MAX_VARYING_VECTORS\"] = 36348] = \"MAX_VARYING_VECTORS\";\n gl[gl[\"MAX_COMBINED_TEXTURE_IMAGE_UNITS\"] = 35661] = \"MAX_COMBINED_TEXTURE_IMAGE_UNITS\";\n gl[gl[\"MAX_VERTEX_TEXTURE_IMAGE_UNITS\"] = 35660] = \"MAX_VERTEX_TEXTURE_IMAGE_UNITS\";\n gl[gl[\"MAX_TEXTURE_IMAGE_UNITS\"] = 34930] = \"MAX_TEXTURE_IMAGE_UNITS\";\n gl[gl[\"MAX_FRAGMENT_UNIFORM_VECTORS\"] = 36349] = \"MAX_FRAGMENT_UNIFORM_VECTORS\";\n gl[gl[\"SHADER_TYPE\"] = 35663] = \"SHADER_TYPE\";\n gl[gl[\"DELETE_STATUS\"] = 35712] = \"DELETE_STATUS\";\n gl[gl[\"LINK_STATUS\"] = 35714] = \"LINK_STATUS\";\n gl[gl[\"VALIDATE_STATUS\"] = 35715] = \"VALIDATE_STATUS\";\n gl[gl[\"ATTACHED_SHADERS\"] = 35717] = \"ATTACHED_SHADERS\";\n gl[gl[\"ACTIVE_UNIFORMS\"] = 35718] = \"ACTIVE_UNIFORMS\";\n gl[gl[\"ACTIVE_ATTRIBUTES\"] = 35721] = \"ACTIVE_ATTRIBUTES\";\n gl[gl[\"SHADING_LANGUAGE_VERSION\"] = 35724] = \"SHADING_LANGUAGE_VERSION\";\n gl[gl[\"CURRENT_PROGRAM\"] = 35725] = \"CURRENT_PROGRAM\";\n gl[gl[\"NEVER\"] = 512] = \"NEVER\";\n gl[gl[\"LESS\"] = 513] = \"LESS\";\n gl[gl[\"EQUAL\"] = 514] = \"EQUAL\";\n gl[gl[\"LEQUAL\"] = 515] = \"LEQUAL\";\n gl[gl[\"GREATER\"] = 516] = \"GREATER\";\n gl[gl[\"NOTEQUAL\"] = 517] = \"NOTEQUAL\";\n gl[gl[\"GEQUAL\"] = 518] = \"GEQUAL\";\n gl[gl[\"ALWAYS\"] = 519] = \"ALWAYS\";\n gl[gl[\"KEEP\"] = 7680] = \"KEEP\";\n gl[gl[\"REPLACE\"] = 7681] = \"REPLACE\";\n gl[gl[\"INCR\"] = 7682] = \"INCR\";\n gl[gl[\"DECR\"] = 7683] = \"DECR\";\n gl[gl[\"INVERT\"] = 5386] = \"INVERT\";\n gl[gl[\"INCR_WRAP\"] = 34055] = \"INCR_WRAP\";\n gl[gl[\"DECR_WRAP\"] = 34056] = \"DECR_WRAP\";\n gl[gl[\"VENDOR\"] = 7936] = \"VENDOR\";\n gl[gl[\"RENDERER\"] = 7937] = \"RENDERER\";\n gl[gl[\"VERSION\"] = 7938] = \"VERSION\";\n gl[gl[\"NEAREST\"] = 9728] = \"NEAREST\";\n gl[gl[\"LINEAR\"] = 9729] = \"LINEAR\";\n gl[gl[\"NEAREST_MIPMAP_NEAREST\"] = 9984] = \"NEAREST_MIPMAP_NEAREST\";\n gl[gl[\"LINEAR_MIPMAP_NEAREST\"] = 9985] = \"LINEAR_MIPMAP_NEAREST\";\n gl[gl[\"NEAREST_MIPMAP_LINEAR\"] = 9986] = \"NEAREST_MIPMAP_LINEAR\";\n gl[gl[\"LINEAR_MIPMAP_LINEAR\"] = 9987] = \"LINEAR_MIPMAP_LINEAR\";\n gl[gl[\"TEXTURE_MAG_FILTER\"] = 10240] = \"TEXTURE_MAG_FILTER\";\n gl[gl[\"TEXTURE_MIN_FILTER\"] = 10241] = \"TEXTURE_MIN_FILTER\";\n gl[gl[\"TEXTURE_WRAP_S\"] = 10242] = \"TEXTURE_WRAP_S\";\n gl[gl[\"TEXTURE_WRAP_T\"] = 10243] = \"TEXTURE_WRAP_T\";\n gl[gl[\"TEXTURE_2D\"] = 3553] = \"TEXTURE_2D\";\n gl[gl[\"TEXTURE\"] = 5890] = \"TEXTURE\";\n gl[gl[\"TEXTURE_CUBE_MAP\"] = 34067] = \"TEXTURE_CUBE_MAP\";\n gl[gl[\"TEXTURE_BINDING_CUBE_MAP\"] = 34068] = \"TEXTURE_BINDING_CUBE_MAP\";\n gl[gl[\"TEXTURE_CUBE_MAP_POSITIVE_X\"] = 34069] = \"TEXTURE_CUBE_MAP_POSITIVE_X\";\n gl[gl[\"TEXTURE_CUBE_MAP_NEGATIVE_X\"] = 34070] = \"TEXTURE_CUBE_MAP_NEGATIVE_X\";\n gl[gl[\"TEXTURE_CUBE_MAP_POSITIVE_Y\"] = 34071] = \"TEXTURE_CUBE_MAP_POSITIVE_Y\";\n gl[gl[\"TEXTURE_CUBE_MAP_NEGATIVE_Y\"] = 34072] = \"TEXTURE_CUBE_MAP_NEGATIVE_Y\";\n gl[gl[\"TEXTURE_CUBE_MAP_POSITIVE_Z\"] = 34073] = \"TEXTURE_CUBE_MAP_POSITIVE_Z\";\n gl[gl[\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"] = 34074] = \"TEXTURE_CUBE_MAP_NEGATIVE_Z\";\n gl[gl[\"MAX_CUBE_MAP_TEXTURE_SIZE\"] = 34076] = \"MAX_CUBE_MAP_TEXTURE_SIZE\";\n gl[gl[\"TEXTURE0\"] = 33984] = \"TEXTURE0\";\n gl[gl[\"TEXTURE1\"] = 33985] = \"TEXTURE1\";\n gl[gl[\"TEXTURE2\"] = 33986] = \"TEXTURE2\";\n gl[gl[\"TEXTURE3\"] = 33987] = \"TEXTURE3\";\n gl[gl[\"TEXTURE4\"] = 33988] = \"TEXTURE4\";\n gl[gl[\"TEXTURE5\"] = 33989] = \"TEXTURE5\";\n gl[gl[\"TEXTURE6\"] = 33990] = \"TEXTURE6\";\n gl[gl[\"TEXTURE7\"] = 33991] = \"TEXTURE7\";\n gl[gl[\"TEXTURE8\"] = 33992] = \"TEXTURE8\";\n gl[gl[\"TEXTURE9\"] = 33993] = \"TEXTURE9\";\n gl[gl[\"TEXTURE10\"] = 33994] = \"TEXTURE10\";\n gl[gl[\"TEXTURE11\"] = 33995] = \"TEXTURE11\";\n gl[gl[\"TEXTURE12\"] = 33996] = \"TEXTURE12\";\n gl[gl[\"TEXTURE13\"] = 33997] = \"TEXTURE13\";\n gl[gl[\"TEXTURE14\"] = 33998] = \"TEXTURE14\";\n gl[gl[\"TEXTURE15\"] = 33999] = \"TEXTURE15\";\n gl[gl[\"TEXTURE16\"] = 34000] = \"TEXTURE16\";\n gl[gl[\"TEXTURE17\"] = 34001] = \"TEXTURE17\";\n gl[gl[\"TEXTURE18\"] = 34002] = \"TEXTURE18\";\n gl[gl[\"TEXTURE19\"] = 34003] = \"TEXTURE19\";\n gl[gl[\"TEXTURE20\"] = 34004] = \"TEXTURE20\";\n gl[gl[\"TEXTURE21\"] = 34005] = \"TEXTURE21\";\n gl[gl[\"TEXTURE22\"] = 34006] = \"TEXTURE22\";\n gl[gl[\"TEXTURE23\"] = 34007] = \"TEXTURE23\";\n gl[gl[\"TEXTURE24\"] = 34008] = \"TEXTURE24\";\n gl[gl[\"TEXTURE25\"] = 34009] = \"TEXTURE25\";\n gl[gl[\"TEXTURE26\"] = 34010] = \"TEXTURE26\";\n gl[gl[\"TEXTURE27\"] = 34011] = \"TEXTURE27\";\n gl[gl[\"TEXTURE28\"] = 34012] = \"TEXTURE28\";\n gl[gl[\"TEXTURE29\"] = 34013] = \"TEXTURE29\";\n gl[gl[\"TEXTURE30\"] = 34014] = \"TEXTURE30\";\n gl[gl[\"TEXTURE31\"] = 34015] = \"TEXTURE31\";\n gl[gl[\"ACTIVE_TEXTURE\"] = 34016] = \"ACTIVE_TEXTURE\";\n gl[gl[\"REPEAT\"] = 10497] = \"REPEAT\";\n gl[gl[\"CLAMP_TO_EDGE\"] = 33071] = \"CLAMP_TO_EDGE\";\n gl[gl[\"MIRRORED_REPEAT\"] = 33648] = \"MIRRORED_REPEAT\";\n gl[gl[\"FLOAT_VEC2\"] = 35664] = \"FLOAT_VEC2\";\n gl[gl[\"FLOAT_VEC3\"] = 35665] = \"FLOAT_VEC3\";\n gl[gl[\"FLOAT_VEC4\"] = 35666] = \"FLOAT_VEC4\";\n gl[gl[\"INT_VEC2\"] = 35667] = \"INT_VEC2\";\n gl[gl[\"INT_VEC3\"] = 35668] = \"INT_VEC3\";\n gl[gl[\"INT_VEC4\"] = 35669] = \"INT_VEC4\";\n gl[gl[\"BOOL\"] = 35670] = \"BOOL\";\n gl[gl[\"BOOL_VEC2\"] = 35671] = \"BOOL_VEC2\";\n gl[gl[\"BOOL_VEC3\"] = 35672] = \"BOOL_VEC3\";\n gl[gl[\"BOOL_VEC4\"] = 35673] = \"BOOL_VEC4\";\n gl[gl[\"FLOAT_MAT2\"] = 35674] = \"FLOAT_MAT2\";\n gl[gl[\"FLOAT_MAT3\"] = 35675] = \"FLOAT_MAT3\";\n gl[gl[\"FLOAT_MAT4\"] = 35676] = \"FLOAT_MAT4\";\n gl[gl[\"SAMPLER_2D\"] = 35678] = \"SAMPLER_2D\";\n gl[gl[\"SAMPLER_CUBE\"] = 35680] = \"SAMPLER_CUBE\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_ENABLED\"] = 34338] = \"VERTEX_ATTRIB_ARRAY_ENABLED\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_SIZE\"] = 34339] = \"VERTEX_ATTRIB_ARRAY_SIZE\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_STRIDE\"] = 34340] = \"VERTEX_ATTRIB_ARRAY_STRIDE\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_TYPE\"] = 34341] = \"VERTEX_ATTRIB_ARRAY_TYPE\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_NORMALIZED\"] = 34922] = \"VERTEX_ATTRIB_ARRAY_NORMALIZED\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_POINTER\"] = 34373] = \"VERTEX_ATTRIB_ARRAY_POINTER\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\"] = 34975] = \"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\";\n gl[gl[\"COMPILE_STATUS\"] = 35713] = \"COMPILE_STATUS\";\n gl[gl[\"LOW_FLOAT\"] = 36336] = \"LOW_FLOAT\";\n gl[gl[\"MEDIUM_FLOAT\"] = 36337] = \"MEDIUM_FLOAT\";\n gl[gl[\"HIGH_FLOAT\"] = 36338] = \"HIGH_FLOAT\";\n gl[gl[\"LOW_INT\"] = 36339] = \"LOW_INT\";\n gl[gl[\"MEDIUM_INT\"] = 36340] = \"MEDIUM_INT\";\n gl[gl[\"HIGH_INT\"] = 36341] = \"HIGH_INT\";\n gl[gl[\"FRAMEBUFFER\"] = 36160] = \"FRAMEBUFFER\";\n gl[gl[\"RENDERBUFFER\"] = 36161] = \"RENDERBUFFER\";\n gl[gl[\"RGBA4\"] = 32854] = \"RGBA4\";\n gl[gl[\"RGB5_A1\"] = 32855] = \"RGB5_A1\";\n gl[gl[\"RGB565\"] = 36194] = \"RGB565\";\n gl[gl[\"DEPTH_COMPONENT16\"] = 33189] = \"DEPTH_COMPONENT16\";\n gl[gl[\"STENCIL_INDEX\"] = 6401] = \"STENCIL_INDEX\";\n gl[gl[\"STENCIL_INDEX8\"] = 36168] = \"STENCIL_INDEX8\";\n gl[gl[\"DEPTH_STENCIL\"] = 34041] = \"DEPTH_STENCIL\";\n gl[gl[\"RENDERBUFFER_WIDTH\"] = 36162] = \"RENDERBUFFER_WIDTH\";\n gl[gl[\"RENDERBUFFER_HEIGHT\"] = 36163] = \"RENDERBUFFER_HEIGHT\";\n gl[gl[\"RENDERBUFFER_INTERNAL_FORMAT\"] = 36164] = \"RENDERBUFFER_INTERNAL_FORMAT\";\n gl[gl[\"RENDERBUFFER_RED_SIZE\"] = 36176] = \"RENDERBUFFER_RED_SIZE\";\n gl[gl[\"RENDERBUFFER_GREEN_SIZE\"] = 36177] = \"RENDERBUFFER_GREEN_SIZE\";\n gl[gl[\"RENDERBUFFER_BLUE_SIZE\"] = 36178] = \"RENDERBUFFER_BLUE_SIZE\";\n gl[gl[\"RENDERBUFFER_ALPHA_SIZE\"] = 36179] = \"RENDERBUFFER_ALPHA_SIZE\";\n gl[gl[\"RENDERBUFFER_DEPTH_SIZE\"] = 36180] = \"RENDERBUFFER_DEPTH_SIZE\";\n gl[gl[\"RENDERBUFFER_STENCIL_SIZE\"] = 36181] = \"RENDERBUFFER_STENCIL_SIZE\";\n gl[gl[\"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\"] = 36048] = \"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\";\n gl[gl[\"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\"] = 36049] = \"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\";\n gl[gl[\"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\"] = 36050] = \"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\";\n gl[gl[\"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\"] = 36051] = \"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\";\n gl[gl[\"COLOR_ATTACHMENT0\"] = 36064] = \"COLOR_ATTACHMENT0\";\n gl[gl[\"DEPTH_ATTACHMENT\"] = 36096] = \"DEPTH_ATTACHMENT\";\n gl[gl[\"STENCIL_ATTACHMENT\"] = 36128] = \"STENCIL_ATTACHMENT\";\n gl[gl[\"DEPTH_STENCIL_ATTACHMENT\"] = 33306] = \"DEPTH_STENCIL_ATTACHMENT\";\n gl[gl[\"NONE\"] = 0] = \"NONE\";\n gl[gl[\"FRAMEBUFFER_COMPLETE\"] = 36053] = \"FRAMEBUFFER_COMPLETE\";\n gl[gl[\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\"] = 36054] = \"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\";\n gl[gl[\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\"] = 36055] = \"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\";\n gl[gl[\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\"] = 36057] = \"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\";\n gl[gl[\"FRAMEBUFFER_UNSUPPORTED\"] = 36061] = \"FRAMEBUFFER_UNSUPPORTED\";\n gl[gl[\"FRAMEBUFFER_BINDING\"] = 36006] = \"FRAMEBUFFER_BINDING\";\n gl[gl[\"RENDERBUFFER_BINDING\"] = 36007] = \"RENDERBUFFER_BINDING\";\n gl[gl[\"MAX_RENDERBUFFER_SIZE\"] = 34024] = \"MAX_RENDERBUFFER_SIZE\";\n gl[gl[\"INVALID_FRAMEBUFFER_OPERATION\"] = 1286] = \"INVALID_FRAMEBUFFER_OPERATION\";\n gl[gl[\"UNPACK_FLIP_Y_WEBGL\"] = 37440] = \"UNPACK_FLIP_Y_WEBGL\";\n gl[gl[\"UNPACK_PREMULTIPLY_ALPHA_WEBGL\"] = 37441] = \"UNPACK_PREMULTIPLY_ALPHA_WEBGL\";\n gl[gl[\"CONTEXT_LOST_WEBGL\"] = 37442] = \"CONTEXT_LOST_WEBGL\";\n gl[gl[\"UNPACK_COLORSPACE_CONVERSION_WEBGL\"] = 37443] = \"UNPACK_COLORSPACE_CONVERSION_WEBGL\";\n gl[gl[\"BROWSER_DEFAULT_WEBGL\"] = 37444] = \"BROWSER_DEFAULT_WEBGL\";\n gl[gl[\"COPY_SRC\"] = 1] = \"COPY_SRC\";\n gl[gl[\"COPY_DST\"] = 2] = \"COPY_DST\";\n gl[gl[\"SAMPLED\"] = 4] = \"SAMPLED\";\n gl[gl[\"STORAGE\"] = 8] = \"STORAGE\";\n gl[gl[\"RENDER_ATTACHMENT\"] = 16] = \"RENDER_ATTACHMENT\";\n})(gl || (gl = {}));\n//# sourceMappingURL=gl.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/framegraph/FrameGraphPass.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/framegraph/FrameGraphPass.js ***! - \*************************************************************************************/ -/*! exports provided: FrameGraphPass */ +/***/ "./node_modules/@antv/g-webgpu-core/es/index.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-core/es/index.js ***! + \******************************************************/ +/*! exports provided: createEntity, Component, ComponentManager, isSafari, gl, ConfigService, AST_TOKEN_TYPES, AST_NODE_TYPES, STORAGE_CLASS, Target, DefineValuePlaceholder */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FrameGraphPass\", function() { return FrameGraphPass; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n\nvar FrameGraphPass = function FrameGraphPass() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, FrameGraphPass);\n\n this.name = void 0;\n this.data = void 0;\n this.execute = void 0;\n this.tearDown = void 0;\n};\n//# sourceMappingURL=FrameGraphPass.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/framegraph/FrameGraphPass.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AST_TOKEN_TYPES\", function() { return AST_TOKEN_TYPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AST_NODE_TYPES\", function() { return AST_NODE_TYPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STORAGE_CLASS\", function() { return STORAGE_CLASS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Target\", function() { return Target; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefineValuePlaceholder\", function() { return DefineValuePlaceholder; });\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Component\", function() { return _ComponentManager__WEBPACK_IMPORTED_MODULE_0__[\"Component\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ComponentManager\", function() { return _ComponentManager__WEBPACK_IMPORTED_MODULE_0__[\"ComponentManager\"]; });\n\n/* harmony import */ var _components_renderer_gl__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components/renderer/gl */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"gl\", function() { return _components_renderer_gl__WEBPACK_IMPORTED_MODULE_1__[\"gl\"]; });\n\n/* harmony import */ var _Entity__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Entity */ \"./node_modules/@antv/g-webgpu-core/es/Entity.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"createEntity\", function() { return _Entity__WEBPACK_IMPORTED_MODULE_2__[\"createEntity\"]; });\n\n/* harmony import */ var _services_config_ConfigService__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./services/config/ConfigService */ \"./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ConfigService\", function() { return _services_config_ConfigService__WEBPACK_IMPORTED_MODULE_3__[\"ConfigService\"]; });\n\n/* harmony import */ var _utils_isSafari__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./utils/isSafari */ \"./node_modules/@antv/g-webgpu-core/es/utils/isSafari.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isSafari\", function() { return _utils_isSafari__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"]; });\n\n\n\n\n\n\nvar AST_TOKEN_TYPES;\n(function (AST_TOKEN_TYPES) {\n AST_TOKEN_TYPES[\"Void\"] = \"Void\";\n AST_TOKEN_TYPES[\"Boolean\"] = \"Boolean\";\n AST_TOKEN_TYPES[\"Float\"] = \"Float\";\n AST_TOKEN_TYPES[\"Uint32\"] = \"Uint32\";\n AST_TOKEN_TYPES[\"Int32\"] = \"Int32\";\n AST_TOKEN_TYPES[\"Vector\"] = \"Vector\";\n AST_TOKEN_TYPES[\"Vector2Float\"] = \"vec2\";\n AST_TOKEN_TYPES[\"Vector3Float\"] = \"vec3\";\n AST_TOKEN_TYPES[\"Vector4Float\"] = \"vec4\";\n AST_TOKEN_TYPES[\"Vector2Boolean\"] = \"vec2\";\n AST_TOKEN_TYPES[\"Vector3Boolean\"] = \"vec3\";\n AST_TOKEN_TYPES[\"Vector4Boolean\"] = \"vec4\";\n AST_TOKEN_TYPES[\"Vector2Uint\"] = \"vec2\";\n AST_TOKEN_TYPES[\"Vector3Uint\"] = \"vec3\";\n AST_TOKEN_TYPES[\"Vector4Uint\"] = \"vec4\";\n AST_TOKEN_TYPES[\"Vector2Int\"] = \"vec2\";\n AST_TOKEN_TYPES[\"Vector3Int\"] = \"vec3\";\n AST_TOKEN_TYPES[\"Vector4Int\"] = \"vec4\";\n AST_TOKEN_TYPES[\"Matrix\"] = \"Matrix\";\n AST_TOKEN_TYPES[\"Matrix3x3Float\"] = \"mat3x3\";\n AST_TOKEN_TYPES[\"Matrix4x4Float\"] = \"mat4x4\";\n AST_TOKEN_TYPES[\"Struct\"] = \"Struct\";\n AST_TOKEN_TYPES[\"FloatArray\"] = \"Float[]\";\n AST_TOKEN_TYPES[\"Vector4FloatArray\"] = \"vec4[]\";\n})(AST_TOKEN_TYPES || (AST_TOKEN_TYPES = {}));\nvar AST_NODE_TYPES;\n(function (AST_NODE_TYPES) {\n AST_NODE_TYPES[\"Program\"] = \"Program\";\n AST_NODE_TYPES[\"Identifier\"] = \"Identifier\";\n AST_NODE_TYPES[\"VariableDeclaration\"] = \"VariableDeclaration\";\n AST_NODE_TYPES[\"BlockStatement\"] = \"BlockStatement\";\n AST_NODE_TYPES[\"ReturnStatement\"] = \"ReturnStatement\";\n AST_NODE_TYPES[\"FunctionDeclaration\"] = \"FunctionDeclaration\";\n AST_NODE_TYPES[\"VariableDeclarator\"] = \"VariableDeclarator\";\n AST_NODE_TYPES[\"AssignmentExpression\"] = \"AssignmentExpression\";\n AST_NODE_TYPES[\"LogicalExpression\"] = \"LogicalExpression\";\n AST_NODE_TYPES[\"BinaryExpression\"] = \"BinaryExpression\";\n AST_NODE_TYPES[\"ArrayExpression\"] = \"ArrayExpression\";\n AST_NODE_TYPES[\"UnaryExpression\"] = \"UnaryExpression\";\n AST_NODE_TYPES[\"UpdateExpression\"] = \"UpdateExpression\";\n AST_NODE_TYPES[\"FunctionExpression\"] = \"FunctionExpression\";\n AST_NODE_TYPES[\"MemberExpression\"] = \"MemberExpression\";\n AST_NODE_TYPES[\"ConditionalExpression\"] = \"ConditionalExpression\";\n AST_NODE_TYPES[\"ExpressionStatement\"] = \"ExpressionStatement\";\n AST_NODE_TYPES[\"CallExpression\"] = \"CallExpression\";\n AST_NODE_TYPES[\"NumThreadStatement\"] = \"NumThreadStatement\";\n AST_NODE_TYPES[\"StorageStatement\"] = \"StorageStatement\";\n AST_NODE_TYPES[\"DoWhileStatement\"] = \"DoWhileStatement\";\n AST_NODE_TYPES[\"WhileStatement\"] = \"WhileStatement\";\n AST_NODE_TYPES[\"ForStatement\"] = \"ForStatement\";\n AST_NODE_TYPES[\"BreakStatement\"] = \"BreakStatement\";\n AST_NODE_TYPES[\"ContinueStatement\"] = \"ContinueStatement\";\n AST_NODE_TYPES[\"IfStatement\"] = \"IfStatement\";\n AST_NODE_TYPES[\"ImportedFunctionStatement\"] = \"ImportedFunctionStatement\";\n})(AST_NODE_TYPES || (AST_NODE_TYPES = {}));\nvar STORAGE_CLASS;\n(function (STORAGE_CLASS) {\n STORAGE_CLASS[\"Input\"] = \"Input\";\n STORAGE_CLASS[\"Output\"] = \"Output\";\n STORAGE_CLASS[\"Uniform\"] = \"Uniform\";\n STORAGE_CLASS[\"Workgroup\"] = \"Workgroup\";\n STORAGE_CLASS[\"UniformConstant\"] = \"UniformConstant\";\n STORAGE_CLASS[\"Image\"] = \"Image\";\n STORAGE_CLASS[\"StorageBuffer\"] = \"StorageBuffer\";\n STORAGE_CLASS[\"Private\"] = \"Private\";\n STORAGE_CLASS[\"Function\"] = \"Function\";\n})(STORAGE_CLASS || (STORAGE_CLASS = {}));\n/**\n * 根据目标平台生成 Shader 代码\n * * WebGL GLSL 1.0\n * * WebGPU Chrome/Edge GLSL 4.5 & WGSL @see https://gpuweb.github.io/gpuweb/wgsl.html\n * * Safari WHLSL (maybe deprecated)\n */\nvar Target;\n(function (Target) {\n Target[\"GLSL100\"] = \"GLSL100\";\n Target[\"GLSL450\"] = \"GLSL450\";\n Target[\"WGSL\"] = \"WGSL\";\n})(Target || (Target = {}));\nvar DefineValuePlaceholder = '__DefineValuePlaceholder__';\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/framegraph/PassNode.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/framegraph/PassNode.js ***! - \*******************************************************************************/ -/*! exports provided: PassNode */ +/***/ "./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js ***! + \******************************************************************************/ +/*! exports provided: ConfigService */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PassNode\", function() { return PassNode; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\nvar PassNode = /*#__PURE__*/function () {\n function PassNode() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, PassNode);\n\n this.name = void 0;\n this.refCount = 0;\n this.hasSideEffect = false;\n this.devirtualize = [];\n this.destroy = [];\n this.reads = [];\n this.writes = [];\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(PassNode, [{\n key: \"read\",\n value: function read(handle) {\n if (!this.reads.find(function (h) {\n return h.index === handle.index;\n })) {\n this.reads.push(handle);\n }\n\n return handle;\n }\n }, {\n key: \"sample\",\n value: function sample(handle) {\n this.read(handle); // TODO: 记录在 this.samples 中\n\n return handle;\n }\n }, {\n key: \"write\",\n value: function write(fg, handle) {\n var existed = this.writes.find(function (h) {\n return h.index === handle.index;\n });\n\n if (existed) {\n return handle;\n }\n\n var node = fg.getResourceNode(handle);\n node.resource.version++;\n\n if (node.resource.imported) {\n this.hasSideEffect = true;\n }\n\n var r = fg.createResourceNode(node.resource);\n var newNode = fg.getResourceNode(r);\n newNode.writer = this;\n this.writes.push(r);\n return r;\n }\n }]);\n\n return PassNode;\n}();\n//# sourceMappingURL=PassNode.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/framegraph/PassNode.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigService\", function() { return ConfigService; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\nvar ConfigService = /*#__PURE__*/function () {\n function ConfigService() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ConfigService);\n this.config = void 0;\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ConfigService, [{\n key: \"get\",\n value: function get() {\n return this.config;\n }\n }, {\n key: \"set\",\n value: function set(config) {\n this.config = config;\n }\n }]);\n return ConfigService;\n}();\n//# sourceMappingURL=ConfigService.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourceEntry.js": -/*!************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourceEntry.js ***! - \************************************************************************************/ -/*! exports provided: ResourceEntry */ +/***/ "./node_modules/@antv/g-webgpu-core/es/utils/isSafari.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-core/es/utils/isSafari.js ***! + \***************************************************************/ +/*! exports provided: isSafari */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResourceEntry\", function() { return ResourceEntry; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _VirtualResource__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./VirtualResource */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/VirtualResource.js\");\n\n\n\n\n\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\nvar ResourceEntry = /*#__PURE__*/function (_VirtualResource) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(ResourceEntry, _VirtualResource);\n\n var _super = _createSuper(ResourceEntry);\n\n function ResourceEntry() {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ResourceEntry);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.version = 0;\n _this.refs = 0;\n _this.name = void 0;\n _this.imported = void 0;\n _this.priority = void 0;\n _this.discardStart = true;\n _this.discardEnd = false;\n _this.descriptor = void 0;\n _this.resource = void 0;\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ResourceEntry, [{\n key: \"preExecuteDestroy\",\n\n /**\n * Lifecycles in FG's execute\n */\n value: function preExecuteDestroy() {\n this.discardEnd = true;\n }\n }, {\n key: \"postExecuteDestroy\",\n value: function postExecuteDestroy() {\n if (!this.imported) {// TODO: 不需要每一帧结束后都销毁资源,可以增加临时资源标志\n // this.resource.destroy();\n }\n }\n }, {\n key: \"postExecuteDevirtualize\",\n value: function postExecuteDevirtualize() {\n this.discardStart = false;\n }\n }, {\n key: \"preExecuteDevirtualize\",\n value: function preExecuteDevirtualize() {\n if (!this.imported) {//\n }\n }\n }]);\n\n return ResourceEntry;\n}(_VirtualResource__WEBPACK_IMPORTED_MODULE_5__[\"VirtualResource\"]);\n//# sourceMappingURL=ResourceEntry.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourceEntry.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSafari\", function() { return isSafari; });\nvar isSafari = typeof navigator !== 'undefined' && /Version\\/[\\d\\.]+.*Safari/.test(navigator.userAgent);\n//# sourceMappingURL=isSafari.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/utils/isSafari.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourceNode.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourceNode.js ***! - \***********************************************************************************/ -/*! exports provided: ResourceNode */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/index.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/index.js ***! + \********************************************************/ +/*! exports provided: WebGLEngine */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResourceNode\", function() { return ResourceNode; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n\nvar ResourceNode = function ResourceNode() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ResourceNode);\n\n this.resource = void 0;\n this.writer = void 0;\n this.readerCount = 0;\n this.version = void 0;\n};\n//# sourceMappingURL=ResourceNode.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourceNode.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _webgl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webgl */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WebGLEngine\", function() { return _webgl__WEBPACK_IMPORTED_MODULE_0__[\"WebGLEngine\"]; });\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourcePool.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourcePool.js ***! - \***********************************************************************************/ -/*! exports provided: ResourcePool */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js ***! + \****************************************************************/ +/*! exports provided: extractUniforms */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ResourcePool\", function() { return ResourcePool; });\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _renderer_gl__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../renderer/gl */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js\");\n\n\n\n\n\n\nvar _dec, _dec2, _class, _class2, _descriptor, _temp;\n\n\n\n\nvar ResourcePool = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_5__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_5__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_6__[\"IDENTIFIER\"].RenderEngine), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function ResourcePool() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ResourcePool);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"engine\", _descriptor, this);\n\n this.resourcePool = {};\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(ResourcePool, [{\n key: \"getOrCreateResource\",\n\n /**\n * 负责实例化虚拟资源,通过引擎服务\n * @param resource 虚拟资源\n */\n value: function getOrCreateResource(resource) {\n if (!this.resourcePool[resource.name]) {\n var _resource$descriptor = resource.descriptor,\n width = _resource$descriptor.width,\n height = _resource$descriptor.height,\n usage = _resource$descriptor.usage;\n this.resourcePool[resource.name] = this.engine.createFramebuffer({\n color: this.engine.createTexture2D({\n width: width,\n height: height,\n wrapS: _renderer_gl__WEBPACK_IMPORTED_MODULE_7__[\"gl\"].CLAMP_TO_EDGE,\n wrapT: _renderer_gl__WEBPACK_IMPORTED_MODULE_7__[\"gl\"].CLAMP_TO_EDGE,\n usage: usage\n })\n });\n }\n\n return this.resourcePool[resource.name];\n }\n }, {\n key: \"clean\",\n value: function clean() {\n this.resourcePool = {};\n }\n }]);\n\n return ResourcePool;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"engine\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=ResourcePool.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourcePool.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extractUniforms\", function() { return extractUniforms; });\n/* harmony import */ var lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! lodash/isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n/* harmony import */ var lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! lodash/isPlainObject */ \"./node_modules/lodash/isPlainObject.js\");\n/* harmony import */ var lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * 考虑结构体命名, eg:\n * a: { b: 1 } -> 'a.b'\n * a: [ { b: 1 } ] -> 'a[0].b'\n */\nfunction extractUniforms(uniforms) {\n var extractedUniforms = {};\n Object.keys(uniforms).forEach(function (uniformName) {\n extractUniformsRecursively(uniformName, uniforms[uniformName], extractedUniforms, '');\n });\n return extractedUniforms;\n}\nfunction extractUniformsRecursively(uniformName, uniformValue, uniforms, prefix) {\n if (uniformValue === null || typeof uniformValue === 'number' ||\n // u_A: 1\n typeof uniformValue === 'boolean' ||\n // u_A: false\n Array.isArray(uniformValue) && typeof uniformValue[0] === 'number' ||\n // u_A: [1, 2, 3]\n lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_0___default()(uniformValue) ||\n // u_A: Float32Array\n // @ts-ignore\n uniformValue === '' ||\n // @ts-ignore\n uniformValue.resize !== undefined) {\n uniforms[\"\".concat(prefix && prefix + '.').concat(uniformName)] = uniformValue;\n return;\n }\n\n // u_Struct.a.b.c\n if (lodash_isPlainObject__WEBPACK_IMPORTED_MODULE_1___default()(uniformValue)) {\n Object.keys(uniformValue).forEach(function (childName) {\n extractUniformsRecursively(childName,\n // @ts-ignore\n uniformValue[childName], uniforms, \"\".concat(prefix && prefix + '.').concat(uniformName));\n });\n }\n\n // u_Struct[0].a\n if (Array.isArray(uniformValue)) {\n // @ts-ignore\n uniformValue.forEach(function (child, idx) {\n Object.keys(child).forEach(function (childName) {\n extractUniformsRecursively(childName,\n // @ts-ignore\n child[childName], uniforms, \"\".concat(prefix && prefix + '.').concat(uniformName, \"[\").concat(idx, \"]\"));\n });\n });\n }\n}\n//# sourceMappingURL=uniform.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/framegraph/System.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/framegraph/System.js ***! - \*****************************************************************************/ -/*! exports provided: FrameGraphSystem */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglAttribute.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglAttribute.js ***! + \**********************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FrameGraphSystem\", function() { return FrameGraphSystem; });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _FrameGraphHandle__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./FrameGraphHandle */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/FrameGraphHandle.js\");\n/* harmony import */ var _FrameGraphPass__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./FrameGraphPass */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/FrameGraphPass.js\");\n/* harmony import */ var _PassNode__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./PassNode */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/PassNode.js\");\n/* harmony import */ var _ResourceEntry__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ResourceEntry */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourceEntry.js\");\n/* harmony import */ var _ResourceNode__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./ResourceNode */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourceNode.js\");\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _class, _class2, _descriptor, _temp;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\n\n\n/**\n * ported from FrameGraph implemented by SakuraRender\n * @see https://zhuanlan.zhihu.com/p/98572442\n * @see https://github.com/SaeruHikari/Sakura/blob/RenderGraph/SakuraCore/Source/Framework/GraphicTypes/FrameGraph/SakuraFrameGraph.cpp\n */\n\nvar FrameGraphSystem = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].RenderEngine), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function FrameGraphSystem() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this, FrameGraphSystem);\n\n this.passNodes = [];\n this.resourceNodes = [];\n this.frameGraphPasses = [];\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"engine\", _descriptor, this);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default()(FrameGraphSystem, [{\n key: \"execute\",\n value: function () {\n var _execute = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee(views) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // this.engine.beginFrame();\n this.compile();\n _context.next = 3;\n return this.executePassNodes(views);\n\n case 3:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function execute(_x) {\n return _execute.apply(this, arguments);\n }\n\n return execute;\n }()\n }, {\n key: \"tearDown\",\n value: function tearDown() {\n this.frameGraphPasses.forEach(function (pass) {\n if (pass.tearDown) {\n pass.tearDown();\n }\n });\n this.reset();\n }\n }, {\n key: \"addPass\",\n value: function addPass(name, setup, execute, tearDown) {\n var frameGraphPass = new _FrameGraphPass__WEBPACK_IMPORTED_MODULE_11__[\"FrameGraphPass\"]();\n frameGraphPass.execute = execute;\n\n if (tearDown) {\n frameGraphPass.tearDown = tearDown;\n }\n\n frameGraphPass.name = name;\n var passNode = new _PassNode__WEBPACK_IMPORTED_MODULE_12__[\"PassNode\"]();\n passNode.name = name;\n this.passNodes.push(passNode);\n this.frameGraphPasses.push(frameGraphPass);\n setup(this, passNode, frameGraphPass);\n return frameGraphPass;\n }\n }, {\n key: \"getPass\",\n value: function getPass(name) {\n return this.frameGraphPasses.find(function (p) {\n return p.name === name;\n });\n }\n }, {\n key: \"compile\",\n value: function compile() {\n var _this = this;\n\n var _iterator = _createForOfIteratorHelper(this.passNodes),\n _step;\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n var _pass = _step.value;\n _pass.refCount = _pass.writes.length + (_pass.hasSideEffect ? 1 : 0);\n\n _pass.reads.forEach(function (handle) {\n _this.resourceNodes[handle.index].readerCount++;\n });\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n var stack = [];\n\n var _iterator2 = _createForOfIteratorHelper(this.resourceNodes),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var node = _step2.value;\n\n if (node.readerCount === 0) {\n stack.push(node);\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n while (stack.length) {\n var pNode = stack.pop();\n var writer = pNode && pNode.writer;\n\n if (writer) {\n if (--writer.refCount === 0) {\n // this pass is culled\n // assert(!writer->hasSideEffect);\n var _iterator3 = _createForOfIteratorHelper(writer.reads),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var resource = _step3.value;\n var r = this.resourceNodes[resource.index];\n\n if (--r.readerCount === 0) {\n stack.push(r);\n }\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }\n } // update the final reference counts\n\n\n this.resourceNodes.forEach(function (node) {\n node.resource.refs += node.readerCount;\n });\n\n var _iterator4 = _createForOfIteratorHelper(this.passNodes),\n _step4;\n\n try {\n for (_iterator4.s(); !(_step4 = _iterator4.n()).done;) {\n var _pass2 = _step4.value;\n\n if (!_pass2.refCount) {\n continue;\n }\n\n var _iterator6 = _createForOfIteratorHelper(_pass2.reads),\n _step6;\n\n try {\n for (_iterator6.s(); !(_step6 = _iterator6.n()).done;) {\n var _resource2 = _step6.value;\n var pResource = this.resourceNodes[_resource2.index].resource;\n pResource.first = pResource.first ? pResource.first : _pass2;\n pResource.last = _pass2;\n }\n } catch (err) {\n _iterator6.e(err);\n } finally {\n _iterator6.f();\n }\n\n var _iterator7 = _createForOfIteratorHelper(_pass2.writes),\n _step7;\n\n try {\n for (_iterator7.s(); !(_step7 = _iterator7.n()).done;) {\n var _resource3 = _step7.value;\n var _pResource = this.resourceNodes[_resource3.index].resource;\n _pResource.first = _pResource.first ? _pResource.first : _pass2;\n _pResource.last = _pass2;\n }\n } catch (err) {\n _iterator7.e(err);\n } finally {\n _iterator7.f();\n }\n }\n } catch (err) {\n _iterator4.e(err);\n } finally {\n _iterator4.f();\n }\n\n for (var priority = 0; priority < 2; priority++) {\n var _iterator5 = _createForOfIteratorHelper(this.resourceNodes),\n _step5;\n\n try {\n for (_iterator5.s(); !(_step5 = _iterator5.n()).done;) {\n var resoureNode = _step5.value;\n var _resource = resoureNode.resource;\n\n if (_resource.priority === priority && _resource.refs) {\n var pFirst = _resource.first;\n var pLast = _resource.last;\n\n if (pFirst && pLast) {\n pFirst.devirtualize.push(_resource);\n pLast.destroy.push(_resource);\n }\n }\n }\n } catch (err) {\n _iterator5.e(err);\n } finally {\n _iterator5.f();\n }\n }\n }\n }, {\n key: \"executePassNodes\",\n value: function () {\n var _executePassNodes = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee2(views) {\n var _iterator8, _step8, _step8$value, index, node, _iterator9, _step9, resource, _iterator10, _step10, _resource4, _iterator11, _step11, _resource5, _iterator12, _step12, _resource6;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n _iterator8 = _createForOfIteratorHelper(this.passNodes.entries());\n _context2.prev = 1;\n\n _iterator8.s();\n\n case 3:\n if ((_step8 = _iterator8.n()).done) {\n _context2.next = 18;\n break;\n }\n\n _step8$value = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(_step8.value, 2), index = _step8$value[0], node = _step8$value[1];\n\n if (!node.refCount) {\n _context2.next = 16;\n break;\n }\n\n _iterator9 = _createForOfIteratorHelper(node.devirtualize);\n\n try {\n for (_iterator9.s(); !(_step9 = _iterator9.n()).done;) {\n resource = _step9.value;\n resource.preExecuteDevirtualize(this.engine);\n }\n } catch (err) {\n _iterator9.e(err);\n } finally {\n _iterator9.f();\n }\n\n _iterator10 = _createForOfIteratorHelper(node.destroy);\n\n try {\n for (_iterator10.s(); !(_step10 = _iterator10.n()).done;) {\n _resource4 = _step10.value;\n\n _resource4.preExecuteDestroy(this.engine);\n }\n } catch (err) {\n _iterator10.e(err);\n } finally {\n _iterator10.f();\n }\n\n _context2.next = 12;\n return this.frameGraphPasses[index].execute(this, this.frameGraphPasses[index], views);\n\n case 12:\n _iterator11 = _createForOfIteratorHelper(node.devirtualize);\n\n try {\n for (_iterator11.s(); !(_step11 = _iterator11.n()).done;) {\n _resource5 = _step11.value;\n\n _resource5.postExecuteDevirtualize(this.engine);\n }\n } catch (err) {\n _iterator11.e(err);\n } finally {\n _iterator11.f();\n }\n\n _iterator12 = _createForOfIteratorHelper(node.destroy);\n\n try {\n for (_iterator12.s(); !(_step12 = _iterator12.n()).done;) {\n _resource6 = _step12.value;\n\n _resource6.postExecuteDestroy(this.engine);\n }\n } catch (err) {\n _iterator12.e(err);\n } finally {\n _iterator12.f();\n }\n\n case 16:\n _context2.next = 3;\n break;\n\n case 18:\n _context2.next = 23;\n break;\n\n case 20:\n _context2.prev = 20;\n _context2.t0 = _context2[\"catch\"](1);\n\n _iterator8.e(_context2.t0);\n\n case 23:\n _context2.prev = 23;\n\n _iterator8.f();\n\n return _context2.finish(23);\n\n case 26:\n this.reset();\n\n case 27:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this, [[1, 20, 23, 26]]);\n }));\n\n function executePassNodes(_x2) {\n return _executePassNodes.apply(this, arguments);\n }\n\n return executePassNodes;\n }()\n }, {\n key: \"reset\",\n value: function reset() {\n this.passNodes = [];\n this.resourceNodes = [];\n this.frameGraphPasses = [];\n }\n }, {\n key: \"getResourceNode\",\n value: function getResourceNode(r) {\n return this.resourceNodes[r.index];\n }\n }, {\n key: \"createResourceNode\",\n value: function createResourceNode(resourceEntry) {\n var resourceNode = new _ResourceNode__WEBPACK_IMPORTED_MODULE_14__[\"ResourceNode\"]();\n resourceNode.resource = resourceEntry;\n resourceNode.version = resourceEntry.version;\n this.resourceNodes.push(resourceNode);\n var fgh = new _FrameGraphHandle__WEBPACK_IMPORTED_MODULE_10__[\"FrameGraphHandle\"]();\n fgh.index = this.resourceNodes.length - 1;\n return fgh;\n }\n }, {\n key: \"createTexture\",\n value: function createTexture(passNode, name, descriptor) {\n var resource = new _ResourceEntry__WEBPACK_IMPORTED_MODULE_13__[\"ResourceEntry\"]();\n resource.name = name;\n resource.descriptor = descriptor;\n return this.createResourceNode(resource);\n }\n }, {\n key: \"createRenderTarget\",\n value: function createRenderTarget(passNode, name, descriptor) {\n var resource = new _ResourceEntry__WEBPACK_IMPORTED_MODULE_13__[\"ResourceEntry\"]();\n resource.name = name;\n resource.descriptor = descriptor;\n return this.createResourceNode(resource);\n }\n }, {\n key: \"present\",\n value: function present(input) {\n this.addPass('Present', function (fg, passNode) {\n passNode.read(input);\n passNode.hasSideEffect = true;\n }, /*#__PURE__*/_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee3() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n })));\n }\n }]);\n\n return FrameGraphSystem;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"engine\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=System.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/framegraph/System.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglAttribute; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes\n */\nvar ReglAttribute = /*#__PURE__*/function () {\n function ReglAttribute(gl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglAttribute);\n this.attribute = void 0;\n this.buffer = void 0;\n var buffer = options.buffer,\n offset = options.offset,\n stride = options.stride,\n normalized = options.normalized,\n size = options.size,\n divisor = options.divisor;\n this.buffer = buffer;\n this.attribute = {\n buffer: buffer.get(),\n offset: offset || 0,\n stride: stride || 0,\n normalized: normalized || false,\n divisor: divisor || 0\n };\n if (size) {\n this.attribute.size = size;\n }\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglAttribute, [{\n key: \"get\",\n value: function get() {\n return this.attribute;\n }\n }, {\n key: \"updateBuffer\",\n value: function updateBuffer(options) {\n this.buffer.subData(options);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.buffer.destroy();\n }\n }]);\n return ReglAttribute;\n}();\n\n//# sourceMappingURL=ReglAttribute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglAttribute.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/framegraph/VirtualResource.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/framegraph/VirtualResource.js ***! - \**************************************************************************************/ -/*! exports provided: VirtualResource */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglBuffer.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglBuffer.js ***! + \*******************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VirtualResource\", function() { return VirtualResource; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n\n\n/**\n * ported from filament\n */\nvar VirtualResource = function VirtualResource() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, VirtualResource);\n\n this.first = void 0;\n this.last = void 0;\n};\n//# sourceMappingURL=VirtualResource.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/framegraph/VirtualResource.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglBuffer; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js\");\n\n\n\n\n\n/**\n * adaptor for regl.Buffer\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers\n */\nvar ReglBuffer = /*#__PURE__*/function () {\n function ReglBuffer(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglBuffer);\n this.buffer = void 0;\n var data = options.data,\n usage = options.usage,\n type = options.type;\n // @ts-ignore\n this.buffer = reGl.buffer({\n data: data,\n usage: _constants__WEBPACK_IMPORTED_MODULE_3__[\"usageMap\"][usage || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].STATIC_DRAW],\n type: _constants__WEBPACK_IMPORTED_MODULE_3__[\"dataTypeMap\"][type || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].UNSIGNED_BYTE]\n // length: 0,\n });\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglBuffer, [{\n key: \"get\",\n value: function get() {\n return this.buffer;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n // this.buffer.destroy();\n }\n }, {\n key: \"subData\",\n value: function subData(_ref) {\n var data = _ref.data,\n offset = _ref.offset;\n // @ts-ignore\n this.buffer.subdata(data, offset);\n }\n }]);\n return ReglBuffer;\n}();\n\n//# sourceMappingURL=ReglBuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglBuffer.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/geometry/GeometryComponent.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/geometry/GeometryComponent.js ***! - \**************************************************************************************/ -/*! exports provided: GeometryComponent */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglComputeModel.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglComputeModel.js ***! + \*************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GeometryComponent\", function() { return GeometryComponent; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n/* harmony import */ var _utils_is_typedarray__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../utils/is-typedarray */ \"./node_modules/@antv/g-webgpu-core/es/utils/is-typedarray.js\");\n\n\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\nvar GeometryComponent = /*#__PURE__*/function (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(GeometryComponent, _Component);\n\n var _super = _createSuper(GeometryComponent);\n\n // instanced count\n function GeometryComponent(data) {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, GeometryComponent);\n\n _this = _super.call(this, data);\n _this.dirty = true;\n _this.attributes = [];\n _this.indices = void 0;\n _this.indicesBuffer = void 0;\n _this.vertexCount = 0;\n _this.maxInstancedCount = void 0;\n _this.aabb = void 0;\n _this.entity = void 0;\n Object.assign(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), data);\n return _this;\n }\n /**\n * @see https://threejs.org/docs/#api/en/core/BufferAttribute\n */\n\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(GeometryComponent, [{\n key: \"setAttribute\",\n value: function setAttribute(name, data, descriptor, bufferGetter) {\n var existed = this.attributes.find(function (a) {\n return a.name === name;\n });\n\n if (!existed) {\n this.attributes.push(_objectSpread(_objectSpread({\n dirty: true,\n name: name,\n data: data\n }, descriptor), {}, {\n bufferGetter: bufferGetter\n }));\n } else {\n existed.data = data;\n existed.dirty = true;\n }\n\n this.dirty = true;\n return this;\n }\n }, {\n key: \"setIndex\",\n value: function setIndex(data) {\n this.indices = new Uint32Array( // @ts-ignore\n data.buffer ? data.buffer : data);\n this.dirty = true;\n return this;\n }\n /**\n * when merge all the geometries into one, we need to transform every vertex's position\n * and every face's normal\n */\n\n }, {\n key: \"applyMatrix\",\n value: function applyMatrix(matrix) {\n var positionAttribute = this.attributes.find(function (_ref) {\n var name = _ref.name;\n return name === 'position';\n });\n var normalAttribute = this.attributes.find(function (_ref2) {\n var name = _ref2.name;\n return name === 'normal';\n });\n\n if (positionAttribute) {\n positionAttribute.dirty = true; // @ts-ignore\n\n if (positionAttribute.data && positionAttribute.data.length) {\n // @ts-ignore\n for (var i = 0; i < positionAttribute.data.length; i += 3) {\n var position = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec4\"].fromValues( // @ts-ignore\n positionAttribute.data[i], // @ts-ignore\n positionAttribute.data[i + 1], // @ts-ignore\n positionAttribute.data[i + 2], 1);\n gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec4\"].transformMat4(position, position, matrix);\n\n if (Object(_utils_is_typedarray__WEBPACK_IMPORTED_MODULE_9__[\"isTypedArray\"])(positionAttribute.data)) {\n // @ts-ignore\n positionAttribute.data.set([position[0], position[1], position[2]], i);\n } else {\n // @ts-ignore\n positionAttribute.data[i] = position[0]; // @ts-ignore\n\n positionAttribute.data[i + 1] = position[1]; // @ts-ignore\n\n positionAttribute.data[i + 2] = position[2];\n }\n }\n }\n }\n\n if (normalAttribute) {\n var normalMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat3\"].normalFromMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat3\"].create(), matrix); // @ts-ignore\n\n if (normalAttribute.data && normalAttribute.data.length) {\n // @ts-ignore\n for (var _i = 0; _i < normalAttribute.data.length; _i += 3) {\n var normal = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues( // @ts-ignore\n normalAttribute.data[_i], // @ts-ignore\n normalAttribute.data[_i + 1], // @ts-ignore\n normalAttribute.data[_i + 2]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].transformMat3(normal, normal, normalMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].normalize(normal, normal);\n\n if (Object(_utils_is_typedarray__WEBPACK_IMPORTED_MODULE_9__[\"isTypedArray\"])(normalAttribute.data)) {\n // @ts-ignore\n normalAttribute.data.set([normal[0], normal[1], normal[2]], _i);\n } else {\n // @ts-ignore\n normalAttribute.data[_i] = normal[0]; // @ts-ignore\n\n normalAttribute.data[_i + 1] = normal[1]; // @ts-ignore\n\n normalAttribute.data[_i + 2] = normal[2];\n }\n }\n }\n }\n }\n }]);\n\n return GeometryComponent;\n}(_ComponentManager__WEBPACK_IMPORTED_MODULE_8__[\"Component\"]);\n//# sourceMappingURL=GeometryComponent.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/geometry/GeometryComponent.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglComputeModel; });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash/isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n/* harmony import */ var lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n/* babel-plugin-inline-import './shaders/quad.vert.glsl' */\nvar quadVert = \"attribute vec3 a_Position;\\nattribute vec2 a_TexCoord;\\n\\nvarying vec2 v_TexCoord;\\n\\nvoid main() {\\n gl_Position = vec4(a_Position, 1.0);\\n v_TexCoord = a_TexCoord;\\n}\";\nvar textureId = 0;\nvar debug = false;\n\n/**\n * adaptor for regl.DrawCommand\n */\nvar ReglComputeModel = /*#__PURE__*/function () {\n function ReglComputeModel(reGl, context) {\n var _this = this;\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, ReglComputeModel);\n this.reGl = reGl;\n this.context = context;\n this.entity = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"createEntity\"])();\n this.texFBO = void 0;\n this.computeCommand = void 0;\n this.textureCache = {};\n this.outputTextureName = void 0;\n this.swapOutputTextureName = void 0;\n this.compiledPingpong = void 0;\n this.dynamicPingpong = void 0;\n var uniforms = {};\n this.context.uniforms.forEach(function (uniform) {\n var name = uniform.name,\n type = uniform.type,\n data = uniform.data,\n isReferer = uniform.isReferer,\n storageClass = uniform.storageClass;\n // store data with a 2D texture\n if (storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"STORAGE_CLASS\"].StorageBuffer) {\n if (!isReferer) {\n _this.textureCache[name] = _this.calcDataTexture(name, type, data);\n var _this$textureCache$na = _this.textureCache[name],\n width = _this$textureCache$na.textureWidth,\n isOutput = _this$textureCache$na.isOutput;\n uniforms[\"\".concat(name, \"Size\")] = [width, width];\n if (isOutput) {\n _this.outputTextureName = name;\n if (_this.context.needPingpong) {\n _this.outputTextureName = \"\".concat(name, \"Output\");\n _this.textureCache[_this.outputTextureName] = _this.calcDataTexture(name, type, data);\n }\n }\n } else {\n // @ts-ignore\n _this.textureCache[name] = {\n data: undefined\n };\n // refer to another kernel's output,\n // the referred kernel may not have been initialized, so we use dynamic way here\n uniforms[\"\".concat(name, \"Size\")] = function () {\n return (\n // @ts-ignore\n data.compiledBundle.context.output.textureSize\n );\n };\n }\n uniforms[name] = function () {\n if (debug) {\n console.log(\"[\".concat(_this.entity, \"]: \").concat(name, \" \").concat(_this.textureCache[name].id));\n }\n return _this.textureCache[name].texture;\n };\n } else if (storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"STORAGE_CLASS\"].Uniform) {\n if (data && (Array.isArray(data) || lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_5___default()(data)) && data.length > 16) {\n // up to mat4 which includes 16 elements\n throw new Error(\"invalid data type \".concat(type));\n }\n // get uniform dynamically\n uniforms[name] = function () {\n return uniform.data;\n };\n }\n });\n var _this$getOuputDataTex = this.getOuputDataTexture(),\n textureWidth = _this$getOuputDataTex.textureWidth,\n texelCount = _this$getOuputDataTex.texelCount;\n\n // 传入 output 纹理尺寸和数据长度,便于多余的 texel 提前退出\n uniforms.u_OutputTextureSize = [textureWidth, textureWidth];\n uniforms.u_OutputTexelCount = texelCount;\n\n // 保存在 Kernel 的上下文中,供其他 Kernel 引用\n this.context.output.textureSize = [textureWidth, textureWidth];\n var drawParams = {\n attributes: {\n a_Position: [[-1, 1, 0], [-1, -1, 0], [1, 1, 0], [1, -1, 0]],\n a_TexCoord: [[0, 1], [0, 0], [1, 1], [1, 0]]\n },\n frag: \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n#else\\n precision mediump float;\\n#endif\\n\".concat(this.context.shader),\n uniforms: uniforms,\n vert: quadVert,\n // TODO: use a fullscreen triangle instead.\n primitive: 'triangle strip',\n count: 4\n };\n this.computeCommand = this.reGl(drawParams);\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(ReglComputeModel, [{\n key: \"run\",\n value: function run() {\n var _this2 = this;\n if (this.context.maxIteration > 1 && this.context.needPingpong) {\n this.compiledPingpong = true;\n }\n // need pingpong when (@in@out and execute(10)) or use `setBinding('out', self)`\n // this.needPingpong =\n // !!(this.context.maxIteration > 1 && this.context.needPingpong);\n\n // if (this.relativeOutputTextureNames.length) {\n // const { id, texture } = this.getOuputDataTexture();\n // this.relativeOutputTextureNames.forEach((name) => {\n // this.textureCache[name].id = id;\n // this.textureCache[name].texture = texture;\n // });\n // this.swap();\n // }\n\n if (this.compiledPingpong || this.dynamicPingpong) {\n this.swap();\n }\n this.texFBO = this.reGl.framebuffer({\n color: this.getOuputDataTexture().texture\n });\n this.texFBO.use(function () {\n _this2.computeCommand();\n });\n if (debug) {\n console.log(\"[\".concat(this.entity, \"]: output \").concat(this.getOuputDataTexture().id));\n }\n }\n }, {\n key: \"readData\",\n value: function () {\n var _readData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_6___default.a.mark(function _callee() {\n var _this3 = this;\n var pixels, _this$getOuputDataTex2, originalDataLength, elementsPerTexel, _this$getOuputDataTex3, typedArrayConstructor, formattedPixels, i;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_6___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.reGl({\n framebuffer: this.texFBO\n })(function () {\n pixels = _this3.reGl.read();\n });\n\n // @ts-ignore\n if (!pixels) {\n _context.next = 6;\n break;\n }\n _this$getOuputDataTex2 = this.getOuputDataTexture(), originalDataLength = _this$getOuputDataTex2.originalDataLength, elementsPerTexel = _this$getOuputDataTex2.elementsPerTexel, _this$getOuputDataTex3 = _this$getOuputDataTex2.typedArrayConstructor, typedArrayConstructor = _this$getOuputDataTex3 === void 0 ? Float32Array : _this$getOuputDataTex3;\n formattedPixels = [];\n if (elementsPerTexel !== 4) {\n for (i = 0; i < pixels.length; i += 4) {\n if (elementsPerTexel === 1) {\n formattedPixels.push(pixels[i]);\n } else if (elementsPerTexel === 2) {\n formattedPixels.push(pixels[i], pixels[i + 1]);\n } else {\n formattedPixels.push(pixels[i], pixels[i + 1], pixels[i + 2]);\n }\n }\n } else {\n // @ts-ignore\n formattedPixels = pixels;\n }\n\n // 截取多余的部分\n // @ts-ignore\n return _context.abrupt(\"return\", new typedArrayConstructor(formattedPixels.slice(0, originalDataLength)));\n case 6:\n return _context.abrupt(\"return\", new Float32Array());\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function readData() {\n return _readData.apply(this, arguments);\n }\n return readData;\n }()\n }, {\n key: \"confirmInput\",\n value: function confirmInput(model, inputName) {\n var inputModel;\n // refer to self, same as pingpong\n if (this.entity === model.entity) {\n this.dynamicPingpong = true;\n inputModel = this;\n } else {\n inputModel = model;\n }\n this.textureCache[inputName].id = inputModel.getOuputDataTexture().id;\n this.textureCache[inputName].texture = inputModel.getOuputDataTexture().texture;\n if (debug) {\n console.log(\"[\".concat(this.entity, \"]: confirm input \").concat(inputName, \" from model \").concat(inputModel.entity, \", \").concat(inputModel.getOuputDataTexture().id));\n }\n }\n }, {\n key: \"updateUniform\",\n value: function updateUniform() {\n // already get uniform's data dynamically when created, do nothing here\n }\n }, {\n key: \"updateBuffer\",\n value: function updateBuffer(bufferName, data) {\n var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n // regenerate data texture\n var buffer = this.context.uniforms.find(function (_ref) {\n var name = _ref.name;\n return name === bufferName;\n });\n if (buffer) {\n var _this$calcDataTexture = this.calcDataTexture(bufferName, buffer.type, data),\n texture = _this$calcDataTexture.texture,\n paddingData = _this$calcDataTexture.data;\n\n // TODO: destroy outdated texture\n this.textureCache[bufferName].data = paddingData;\n this.textureCache[bufferName].texture = texture;\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n // regl will destroy all resources\n }\n }, {\n key: \"swap\",\n value: function swap() {\n if (!this.swapOutputTextureName) {\n this.createSwapOutputDataTexture();\n }\n if (this.compiledPingpong) {\n var outputTextureUniformName = this.context.output.name;\n this.textureCache[outputTextureUniformName].id = this.getOuputDataTexture().id;\n this.textureCache[outputTextureUniformName].texture = this.getOuputDataTexture().texture;\n }\n var tmp = this.outputTextureName;\n this.outputTextureName = this.swapOutputTextureName;\n this.swapOutputTextureName = tmp;\n if (debug) {\n console.log(\"[\".concat(this.entity, \"]: after swap, output \").concat(this.getOuputDataTexture().id));\n }\n }\n }, {\n key: \"getOuputDataTexture\",\n value: function getOuputDataTexture() {\n return this.textureCache[this.outputTextureName];\n }\n }, {\n key: \"createSwapOutputDataTexture\",\n value: function createSwapOutputDataTexture() {\n var texture = this.cloneDataTexture(this.getOuputDataTexture());\n this.swapOutputTextureName = \"\".concat(this.entity, \"-swap\");\n this.textureCache[this.swapOutputTextureName] = texture;\n }\n }, {\n key: \"cloneDataTexture\",\n value: function cloneDataTexture(texture) {\n var data = texture.data,\n textureWidth = texture.textureWidth;\n return _objectSpread(_objectSpread({}, texture), {}, {\n id: textureId++,\n // @ts-ignore\n texture: this.reGl.texture({\n width: textureWidth,\n height: textureWidth,\n data: data,\n type: 'float'\n })\n });\n }\n }, {\n key: \"calcDataTexture\",\n value: function calcDataTexture(name, type, data) {\n var elementsPerTexel = 1;\n if (type === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"AST_TOKEN_TYPES\"].Vector4FloatArray) {\n elementsPerTexel = 4;\n }\n\n // 用 0 补全不足 vec4 的部分\n var paddingData = [];\n for (var i = 0; i < data.length; i += elementsPerTexel) {\n if (elementsPerTexel === 1) {\n paddingData.push(data[i], 0, 0, 0);\n } else if (elementsPerTexel === 2) {\n paddingData.push(data[i], data[i + 1], 0, 0);\n } else if (elementsPerTexel === 3) {\n paddingData.push(data[i], data[i + 1], data[i + 2], 0);\n } else if (elementsPerTexel === 4) {\n paddingData.push(data[i], data[i + 1], data[i + 2], data[i + 3]);\n }\n }\n\n // 使用纹理存储,例如 Array(8) 使用 3 * 3 纹理,末尾空白使用 0 填充\n var originalDataLength = data.length;\n var texelCount = Math.ceil(originalDataLength / elementsPerTexel);\n var width = Math.ceil(Math.sqrt(texelCount));\n var paddingTexelCount = width * width;\n if (texelCount < paddingTexelCount) {\n paddingData.push.apply(paddingData, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(new Array((paddingTexelCount - texelCount) * 4).fill(0)));\n }\n var texture = this.reGl.texture({\n width: width,\n height: width,\n data: paddingData,\n type: 'float'\n });\n return {\n id: textureId++,\n data: paddingData,\n originalDataLength: originalDataLength,\n typedArrayConstructor: lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_5___default()(data) ? data.constructor : undefined,\n textureWidth: width,\n texture: texture,\n texelCount: texelCount,\n elementsPerTexel: elementsPerTexel,\n isOutput: name === this.context.output.name\n };\n }\n }]);\n return ReglComputeModel;\n}();\n\n//# sourceMappingURL=ReglComputeModel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglComputeModel.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/geometry/System.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/geometry/System.js ***! - \***************************************************************************/ -/*! exports provided: GeometrySystem */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglElements.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglElements.js ***! + \*********************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GeometrySystem\", function() { return GeometrySystem; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../.. */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _renderer_gl__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../renderer/gl */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js\");\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _temp;\n\n\n\n\n\nvar GeometrySystem = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].GeometryComponentManager), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].RenderEngine), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function GeometrySystem() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, GeometrySystem);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"geometry\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"engine\", _descriptor2, this);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(GeometrySystem, [{\n key: \"execute\",\n value: function () {\n var _execute = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var _this = this;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.geometry.forEach(function (entity, component) {\n // build buffers for each geometry\n if (component.dirty) {\n component.attributes.forEach(function (attribute) {\n if (attribute.dirty && attribute.data) {\n if (!attribute.buffer) {\n attribute.buffer = _this.engine.createBuffer({\n data: attribute.data,\n type: _renderer_gl__WEBPACK_IMPORTED_MODULE_10__[\"gl\"].FLOAT\n });\n } else {\n var _attribute$buffer;\n\n (_attribute$buffer = attribute.buffer) === null || _attribute$buffer === void 0 ? void 0 : _attribute$buffer.subData({\n data: attribute.data,\n // TODO: support offset in subdata\n offset: 0\n });\n }\n\n attribute.dirty = false;\n }\n }); // create index buffer if needed\n\n if (component.indices) {\n if (!component.indicesBuffer) {\n component.indicesBuffer = _this.engine.createElements({\n data: component.indices,\n count: component.indices.length,\n type: _renderer_gl__WEBPACK_IMPORTED_MODULE_10__[\"gl\"].UNSIGNED_INT,\n usage: _renderer_gl__WEBPACK_IMPORTED_MODULE_10__[\"gl\"].STATIC_DRAW\n });\n } else {\n component.indicesBuffer.subData({\n data: component.indices,\n offset: 0\n });\n }\n }\n\n component.dirty = false;\n }\n });\n\n case 1:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function execute() {\n return _execute.apply(this, arguments);\n }\n\n return execute;\n }()\n }, {\n key: \"tearDown\",\n value: function tearDown() {\n this.geometry.forEach(function (_, geometry) {\n if (geometry.indicesBuffer) {\n geometry.indicesBuffer.destroy();\n }\n\n geometry.attributes.forEach(function (attribute) {\n if (attribute.buffer) {\n attribute.buffer.destroy();\n }\n });\n });\n this.geometry.clear();\n }\n /**\n * @see https://threejs.org/docs/#api/en/core/BufferGeometry\n */\n\n }, {\n key: \"createBufferGeometry\",\n value: function createBufferGeometry() {\n var _ref = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {\n vertexCount: 3\n },\n vertexCount = _ref.vertexCount;\n\n var entity = Object(___WEBPACK_IMPORTED_MODULE_8__[\"createEntity\"])();\n return this.geometry.create(entity, {\n vertexCount: vertexCount\n });\n }\n /**\n * @see https://threejs.org/docs/#api/en/core/InstancedBufferGeometry\n */\n\n }, {\n key: \"createInstancedBufferGeometry\",\n value: function createInstancedBufferGeometry(_ref2) {\n var maxInstancedCount = _ref2.maxInstancedCount,\n vertexCount = _ref2.vertexCount;\n var entity = Object(___WEBPACK_IMPORTED_MODULE_8__[\"createEntity\"])();\n return this.geometry.create(entity, {\n maxInstancedCount: maxInstancedCount,\n vertexCount: vertexCount\n });\n }\n }]);\n\n return GeometrySystem;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"geometry\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"engine\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=System.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/geometry/System.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglElements; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js\");\n\n\n\n\n\n/**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#elements\n */\nvar ReglElements = /*#__PURE__*/function () {\n function ReglElements(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglElements);\n this.elements = void 0;\n var data = options.data,\n usage = options.usage,\n type = options.type,\n count = options.count;\n this.elements = reGl.elements({\n data: data,\n usage: _constants__WEBPACK_IMPORTED_MODULE_3__[\"usageMap\"][usage || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].STATIC_DRAW],\n type: _constants__WEBPACK_IMPORTED_MODULE_3__[\"dataTypeMap\"][type || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].UNSIGNED_BYTE],\n count: count\n });\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglElements, [{\n key: \"get\",\n value: function get() {\n return this.elements;\n }\n }, {\n key: \"subData\",\n value: function subData(_ref) {\n var data = _ref.data;\n this.elements.subdata(data);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.elements.destroy();\n }\n }]);\n return ReglElements;\n}();\n\n//# sourceMappingURL=ReglElements.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglElements.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/material/MaterialComponent.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/material/MaterialComponent.js ***! - \**************************************************************************************/ -/*! exports provided: MaterialComponent */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglFramebuffer.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglFramebuffer.js ***! + \************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MaterialComponent\", function() { return MaterialComponent; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../.. */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n\n\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\nvar MaterialComponent = /*#__PURE__*/function (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(MaterialComponent, _Component);\n\n var _super = _createSuper(MaterialComponent);\n\n // control flow in shaders, eg. USE_UV, USE_MAP...\n function MaterialComponent(data) {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, MaterialComponent);\n\n _this = _super.call(this, data);\n _this.vertexShaderGLSL = void 0;\n _this.fragmentShaderGLSL = void 0;\n _this.defines = {};\n _this.dirty = true;\n _this.uniforms = [];\n _this.cull = {\n enable: true,\n face: ___WEBPACK_IMPORTED_MODULE_7__[\"gl\"].BACK\n };\n _this.depth = {\n enable: true\n };\n _this.blend = void 0;\n _this.entity = void 0;\n _this.type = void 0;\n Object.assign(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this), data);\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(MaterialComponent, [{\n key: \"setDefines\",\n value: function setDefines(defines) {\n this.defines = _objectSpread(_objectSpread({}, this.defines), defines);\n return this;\n }\n }, {\n key: \"setCull\",\n value: function setCull(cull) {\n this.cull = cull;\n return this;\n }\n }, {\n key: \"setDepth\",\n value: function setDepth(depth) {\n this.depth = depth;\n return this;\n }\n }, {\n key: \"setBlend\",\n value: function setBlend(blend) {\n this.blend = blend;\n return this;\n }\n }, {\n key: \"setUniform\",\n value: function setUniform(name, data) {\n var _this2 = this;\n\n if (typeof name !== 'string') {\n Object.keys(name).forEach(function (key) {\n return _this2.setUniform(key, name[key]);\n });\n return this;\n }\n\n var existedUniform = this.uniforms.find(function (u) {\n return u.name === name;\n });\n\n if (!existedUniform) {\n this.uniforms.push({\n name: name,\n dirty: true,\n data: data\n });\n } else {\n existedUniform.dirty = true;\n existedUniform.data = data;\n }\n\n this.dirty = true;\n return this;\n }\n }]);\n\n return MaterialComponent;\n}(_ComponentManager__WEBPACK_IMPORTED_MODULE_8__[\"Component\"]);\n//# sourceMappingURL=MaterialComponent.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/material/MaterialComponent.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglFramebuffer; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\n/**\n * adaptor for regl.Framebuffer\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#framebuffers\n */\nvar ReglFramebuffer = /*#__PURE__*/function () {\n function ReglFramebuffer(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglFramebuffer);\n this.framebuffer = void 0;\n var width = options.width,\n height = options.height,\n color = options.color,\n colors = options.colors,\n depth = options.depth,\n stencil = options.stencil;\n var framebufferOptions = {\n width: width,\n height: height\n };\n if (Array.isArray(colors)) {\n framebufferOptions.colors = colors.map(function (c) {\n return c.get();\n });\n }\n if (color && typeof color !== 'boolean') {\n framebufferOptions.color = color.get();\n }\n\n // TODO: depth & stencil\n\n this.framebuffer = reGl.framebuffer(framebufferOptions);\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglFramebuffer, [{\n key: \"get\",\n value: function get() {\n return this.framebuffer;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.framebuffer.destroy();\n }\n }, {\n key: \"resize\",\n value: function resize(_ref) {\n var width = _ref.width,\n height = _ref.height;\n this.framebuffer.resize(width, height);\n }\n }]);\n return ReglFramebuffer;\n}();\n\n//# sourceMappingURL=ReglFramebuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglFramebuffer.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/material/System.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/material/System.js ***! - \***************************************************************************/ -/*! exports provided: MaterialSystem */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglModel.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglModel.js ***! + \******************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MaterialSystem\", function() { return MaterialSystem; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../.. */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor, _descriptor2, _descriptor3, _temp;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\nvar MaterialSystem = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_10__[\"IDENTIFIER\"].MaterialComponentManager), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_10__[\"IDENTIFIER\"].RenderEngine), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_10__[\"IDENTIFIER\"].ShaderModuleService), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function MaterialSystem() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this, MaterialSystem);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"material\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"engine\", _descriptor2, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"shaderModule\", _descriptor3, this);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default()(MaterialSystem, [{\n key: \"execute\",\n value: function () {\n var _execute = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_1___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n function execute() {\n return _execute.apply(this, arguments);\n }\n\n return execute;\n }()\n }, {\n key: \"tearDown\",\n value: function tearDown() {\n this.material.clear();\n }\n /**\n * @see https://threejs.org/docs/#api/en/materials/ShaderMaterial\n */\n\n }, {\n key: \"createShaderMaterial\",\n value: function createShaderMaterial(params) {\n var entity = Object(___WEBPACK_IMPORTED_MODULE_9__[\"createEntity\"])();\n var vertexShaderGLSL = params.vertexShader;\n var fragmentShaderGLSL = params.fragmentShader;\n var uniforms = [];\n\n if (!this.engine.supportWebGPU) {\n var moduleName = \"material-\".concat(entity);\n this.shaderModule.registerModule(moduleName, {\n vs: params.vertexShader,\n fs: params.fragmentShader\n });\n var materialModule = this.shaderModule.getModule(moduleName);\n vertexShaderGLSL = materialModule.vs;\n fragmentShaderGLSL = materialModule.fs;\n\n if (materialModule.uniforms) {\n // @ts-ignore\n uniforms = Object.keys(materialModule.uniforms).map(function (uniformName) {\n return {\n dirty: true,\n name: uniformName,\n // @ts-ignore\n data: materialModule.uniforms[uniformName]\n };\n });\n }\n }\n\n return this.material.create(entity, _objectSpread(_objectSpread({\n vertexShaderGLSL: vertexShaderGLSL,\n fragmentShaderGLSL: fragmentShaderGLSL\n }, params), {}, {\n uniforms: uniforms\n }));\n }\n }]);\n\n return MaterialSystem;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"material\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"engine\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"shaderModule\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=System.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/material/System.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglModel; });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _utils_uniform__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/uniform */ \"./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js\");\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\n\n/**\n * adaptor for regl.DrawCommand\n */\nvar ReglModel = /*#__PURE__*/function () {\n function ReglModel(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, ReglModel);\n this.reGl = void 0;\n this.drawCommand = void 0;\n this.uniforms = {};\n this.reGl = reGl;\n var vs = options.vs,\n fs = options.fs,\n defines = options.defines,\n attributes = options.attributes,\n uniforms = options.uniforms,\n primitive = options.primitive,\n count = options.count,\n elements = options.elements,\n depth = options.depth,\n blend = options.blend,\n stencil = options.stencil,\n cull = options.cull,\n instances = options.instances,\n scissor = options.scissor,\n viewport = options.viewport;\n var reglUniforms = {};\n if (uniforms) {\n this.uniforms = Object(_utils_uniform__WEBPACK_IMPORTED_MODULE_5__[\"extractUniforms\"])(uniforms);\n Object.keys(uniforms).forEach(function (uniformName) {\n // use regl prop API\n // @ts-ignore\n reglUniforms[uniformName] = reGl.prop(uniformName);\n });\n }\n var reglAttributes = {};\n Object.keys(attributes).forEach(function (name) {\n reglAttributes[name] = attributes[name].get();\n });\n var defineStmts = defines && this.generateDefines(defines) || '';\n var drawParams = {\n attributes: reglAttributes,\n frag: \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n#else\\n precision mediump float;\\n#endif\\n\".concat(defineStmts, \"\\n\").concat(fs),\n uniforms: reglUniforms,\n vert: \"\\n\".concat(defineStmts, \"\\n\").concat(vs),\n primitive: _constants__WEBPACK_IMPORTED_MODULE_6__[\"primitiveMap\"][primitive === undefined ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].TRIANGLES : primitive]\n };\n if (instances) {\n drawParams.instances = instances;\n }\n\n // elements 中可能包含 count,此时不应传入\n if (count) {\n drawParams.count = count;\n }\n if (elements) {\n drawParams.elements = elements.get();\n }\n if (scissor) {\n drawParams.scissor = scissor;\n }\n if (viewport) {\n drawParams.viewport = viewport;\n }\n this.initDepthDrawParams({\n depth: depth\n }, drawParams);\n this.initBlendDrawParams({\n blend: blend\n }, drawParams);\n this.initStencilDrawParams({\n stencil: stencil\n }, drawParams);\n this.initCullDrawParams({\n cull: cull\n }, drawParams);\n this.drawCommand = reGl(drawParams);\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(ReglModel, [{\n key: \"addUniforms\",\n value: function addUniforms(uniforms) {\n this.uniforms = _objectSpread(_objectSpread({}, this.uniforms), Object(_utils_uniform__WEBPACK_IMPORTED_MODULE_5__[\"extractUniforms\"])(uniforms));\n }\n }, {\n key: \"draw\",\n value: function draw(options) {\n var uniforms = _objectSpread(_objectSpread({}, this.uniforms), Object(_utils_uniform__WEBPACK_IMPORTED_MODULE_5__[\"extractUniforms\"])(options.uniforms || {}));\n var reglDrawProps = {};\n Object.keys(uniforms).forEach(function (uniformName) {\n var type = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(uniforms[uniformName]);\n if (type === 'boolean' || type === 'number' || Array.isArray(uniforms[uniformName]) ||\n // @ts-ignore\n uniforms[uniformName].BYTES_PER_ELEMENT) {\n reglDrawProps[uniformName] = uniforms[uniformName];\n } else if (type === 'string') {\n // TODO: image url\n } else {\n reglDrawProps[uniformName] = uniforms[uniformName].get();\n }\n });\n this.drawCommand(reglDrawProps);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n // don't need do anything since we will call `rendererService.cleanup()`\n }\n\n /**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#depth-buffer\n */\n }, {\n key: \"initDepthDrawParams\",\n value: function initDepthDrawParams(_ref, drawParams) {\n var depth = _ref.depth;\n if (depth) {\n drawParams.depth = {\n enable: depth.enable === undefined ? true : !!depth.enable,\n mask: depth.mask === undefined ? true : !!depth.mask,\n func: _constants__WEBPACK_IMPORTED_MODULE_6__[\"depthFuncMap\"][depth.func || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].LESS],\n range: depth.range || [0, 1]\n };\n }\n }\n\n /**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#blending\n */\n }, {\n key: \"initBlendDrawParams\",\n value: function initBlendDrawParams(_ref2, drawParams) {\n var blend = _ref2.blend;\n if (blend) {\n var enable = blend.enable,\n func = blend.func,\n equation = blend.equation,\n _blend$color = blend.color,\n color = _blend$color === void 0 ? [0, 0, 0, 0] : _blend$color;\n // @ts-ignore\n drawParams.blend = {\n enable: !!enable,\n func: {\n srcRGB: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendFuncMap\"][func && func.srcRGB || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].SRC_ALPHA],\n srcAlpha: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendFuncMap\"][func && func.srcAlpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].SRC_ALPHA],\n dstRGB: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendFuncMap\"][func && func.dstRGB || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].ONE_MINUS_SRC_ALPHA],\n dstAlpha: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendFuncMap\"][func && func.dstAlpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].ONE_MINUS_SRC_ALPHA]\n },\n equation: {\n rgb: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendEquationMap\"][equation && equation.rgb || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].FUNC_ADD],\n alpha: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendEquationMap\"][equation && equation.alpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].FUNC_ADD]\n },\n color: color\n };\n }\n }\n\n /**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#stencil\n */\n }, {\n key: \"initStencilDrawParams\",\n value: function initStencilDrawParams(_ref3, drawParams) {\n var stencil = _ref3.stencil;\n if (stencil) {\n var enable = stencil.enable,\n _stencil$mask = stencil.mask,\n mask = _stencil$mask === void 0 ? -1 : _stencil$mask,\n _stencil$func = stencil.func,\n func = _stencil$func === void 0 ? {\n cmp: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].ALWAYS,\n ref: 0,\n mask: -1\n } : _stencil$func,\n _stencil$opFront = stencil.opFront,\n opFront = _stencil$opFront === void 0 ? {\n fail: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP,\n zfail: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP,\n zpass: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP\n } : _stencil$opFront,\n _stencil$opBack = stencil.opBack,\n opBack = _stencil$opBack === void 0 ? {\n fail: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP,\n zfail: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP,\n zpass: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP\n } : _stencil$opBack;\n drawParams.stencil = {\n enable: !!enable,\n mask: mask,\n func: _objectSpread(_objectSpread({}, func), {}, {\n cmp: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilFuncMap\"][func.cmp]\n }),\n opFront: {\n fail: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opFront.fail],\n zfail: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opFront.zfail],\n zpass: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opFront.zpass]\n },\n opBack: {\n fail: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opBack.fail],\n zfail: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opBack.zfail],\n zpass: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opBack.zpass]\n }\n };\n }\n }\n\n /**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#culling\n */\n }, {\n key: \"initCullDrawParams\",\n value: function initCullDrawParams(_ref4, drawParams) {\n var cull = _ref4.cull;\n if (cull) {\n var enable = cull.enable,\n _cull$face = cull.face,\n face = _cull$face === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].BACK : _cull$face;\n drawParams.cull = {\n enable: !!enable,\n face: _constants__WEBPACK_IMPORTED_MODULE_6__[\"cullFaceMap\"][face]\n };\n }\n }\n }, {\n key: \"generateDefines\",\n value: function generateDefines(defines) {\n return Object.keys(defines).map(function (name) {\n return \"#define \".concat(name, \" \").concat(Number(defines[name]));\n }).join('\\n');\n }\n }]);\n return ReglModel;\n}();\n\n//# sourceMappingURL=ReglModel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglModel.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/material/interface.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/material/interface.js ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglTexture2D.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglTexture2D.js ***! + \**********************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/material/interface.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglTexture2D; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js\");\n\n\n\n\n\n/**\n * adaptor for regl.Buffer\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers\n */\nvar ReglTexture2D = /*#__PURE__*/function () {\n function ReglTexture2D(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglTexture2D);\n this.texture = void 0;\n this.width = void 0;\n this.height = void 0;\n var data = options.data,\n _options$type = options.type,\n type = _options$type === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].UNSIGNED_BYTE : _options$type,\n width = options.width,\n height = options.height,\n _options$flipY = options.flipY,\n flipY = _options$flipY === void 0 ? false : _options$flipY,\n _options$format = options.format,\n format = _options$format === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].RGBA : _options$format,\n _options$mipmap = options.mipmap,\n mipmap = _options$mipmap === void 0 ? false : _options$mipmap,\n _options$wrapS = options.wrapS,\n wrapS = _options$wrapS === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].CLAMP_TO_EDGE : _options$wrapS,\n _options$wrapT = options.wrapT,\n wrapT = _options$wrapT === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].CLAMP_TO_EDGE : _options$wrapT,\n _options$aniso = options.aniso,\n aniso = _options$aniso === void 0 ? 0 : _options$aniso,\n _options$alignment = options.alignment,\n alignment = _options$alignment === void 0 ? 1 : _options$alignment,\n _options$premultiplyA = options.premultiplyAlpha,\n premultiplyAlpha = _options$premultiplyA === void 0 ? false : _options$premultiplyA,\n _options$mag = options.mag,\n mag = _options$mag === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].NEAREST : _options$mag,\n _options$min = options.min,\n min = _options$min === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].NEAREST : _options$min,\n _options$colorSpace = options.colorSpace,\n colorSpace = _options$colorSpace === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].BROWSER_DEFAULT_WEBGL : _options$colorSpace;\n this.width = width;\n this.height = height;\n var textureOptions = {\n width: width,\n height: height,\n // @ts-ignore\n type: _constants__WEBPACK_IMPORTED_MODULE_3__[\"dataTypeMap\"][type],\n format: _constants__WEBPACK_IMPORTED_MODULE_3__[\"formatMap\"][format],\n wrapS: _constants__WEBPACK_IMPORTED_MODULE_3__[\"wrapModeMap\"][wrapS],\n wrapT: _constants__WEBPACK_IMPORTED_MODULE_3__[\"wrapModeMap\"][wrapT],\n // @ts-ignore\n mag: _constants__WEBPACK_IMPORTED_MODULE_3__[\"filterMap\"][mag],\n min: _constants__WEBPACK_IMPORTED_MODULE_3__[\"filterMap\"][min],\n alignment: alignment,\n flipY: flipY,\n colorSpace: _constants__WEBPACK_IMPORTED_MODULE_3__[\"colorSpaceMap\"][colorSpace],\n premultiplyAlpha: premultiplyAlpha,\n aniso: aniso\n };\n if (data) {\n textureOptions.data = data;\n }\n if (typeof mipmap === 'number') {\n textureOptions.mipmap = _constants__WEBPACK_IMPORTED_MODULE_3__[\"mipmapMap\"][mipmap];\n } else if (typeof mipmap === 'boolean') {\n textureOptions.mipmap = mipmap;\n }\n this.texture = reGl.texture(textureOptions);\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglTexture2D, [{\n key: \"get\",\n value: function get() {\n return this.texture;\n }\n }, {\n key: \"update\",\n value: function update() {\n // @ts-ignore\n this.texture._texture.bind();\n }\n }, {\n key: \"resize\",\n value: function resize(_ref) {\n var width = _ref.width,\n height = _ref.height;\n this.texture.resize(width, height);\n this.width = width;\n this.height = height;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.texture.destroy();\n }\n }]);\n return ReglTexture2D;\n}();\n\n//# sourceMappingURL=ReglTexture2D.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglTexture2D.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/mesh/CullableComponent.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/mesh/CullableComponent.js ***! - \**********************************************************************************/ -/*! exports provided: Strategy, CullableComponent */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js ***! + \******************************************************************/ +/*! exports provided: primitiveMap, usageMap, dataTypeMap, formatMap, mipmapMap, filterMap, wrapModeMap, colorSpaceMap, depthFuncMap, blendEquationMap, blendFuncMap, stencilFuncMap, stencilOpMap, cullFaceMap */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Strategy\", function() { return Strategy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CullableComponent\", function() { return CullableComponent; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n\n\n\n\n\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n/**\n * @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy\n */\nvar Strategy;\n\n(function (Strategy) {\n Strategy[Strategy[\"Standard\"] = 0] = \"Standard\";\n})(Strategy || (Strategy = {}));\n\nvar CullableComponent = /*#__PURE__*/function (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(CullableComponent, _Component);\n\n var _super = _createSuper(CullableComponent);\n\n function CullableComponent(data) {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, CullableComponent);\n\n _this = _super.call(this, data);\n _this.strategy = Strategy.Standard;\n _this.visibilityPlaneMask = 0;\n _this.visible = false;\n Object.assign(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), data);\n return _this;\n }\n\n return CullableComponent;\n}(_ComponentManager__WEBPACK_IMPORTED_MODULE_5__[\"Component\"]);\n//# sourceMappingURL=CullableComponent.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/mesh/CullableComponent.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"primitiveMap\", function() { return primitiveMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usageMap\", function() { return usageMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataTypeMap\", function() { return dataTypeMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatMap\", function() { return formatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mipmapMap\", function() { return mipmapMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterMap\", function() { return filterMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrapModeMap\", function() { return wrapModeMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"colorSpaceMap\", function() { return colorSpaceMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"depthFuncMap\", function() { return depthFuncMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blendEquationMap\", function() { return blendEquationMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blendFuncMap\", function() { return blendFuncMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"stencilFuncMap\", function() { return stencilFuncMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"stencilOpMap\", function() { return stencilOpMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cullFaceMap\", function() { return cullFaceMap; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n\nvar _primitiveMap, _usageMap, _dataTypeMap, _formatMap, _mipmapMap, _filterMap, _wrapModeMap, _colorSpaceMap, _depthFuncMap, _blendEquationMap, _blendFuncMap, _stencilFuncMap, _stencilOpMap, _cullFaceMap;\n/**\n * @desc 由于 regl 使用大量字符串而非 WebGL 常量,因此需要映射\n */\n\n// @see https://github.com/regl-project/regl/blob/gh-pages/lib/constants/primitives.json\nvar primitiveMap = (_primitiveMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].POINTS, 'points'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINES, 'lines'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINE_LOOP, 'line loop'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINE_STRIP, 'line strip'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLES, 'triangles'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLE_FAN, 'triangle fan'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLE_STRIP, 'triangle strip'), _primitiveMap);\nvar usageMap = (_usageMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_usageMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].STATIC_DRAW, 'static'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_usageMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DYNAMIC_DRAW, 'dynamic'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_usageMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].STREAM_DRAW, 'stream'), _usageMap);\nvar dataTypeMap = (_dataTypeMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].BYTE, 'int8'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].UNSIGNED_INT, 'int16'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].INT, 'int32'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].UNSIGNED_BYTE, 'uint8'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].UNSIGNED_SHORT, 'uint16'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].UNSIGNED_INT, 'uint32'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FLOAT, 'float'), _dataTypeMap);\nvar formatMap = (_formatMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALPHA, 'alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LUMINANCE, 'luminance'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LUMINANCE_ALPHA, 'luminance alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGB, 'rgb'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGBA, 'rgba'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGBA4, 'rgba4'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGB5_A1, 'rgb5 a1'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGB565, 'rgb565'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DEPTH_COMPONENT, 'depth'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DEPTH_STENCIL, 'depth stencil'), _formatMap);\nvar mipmapMap = (_mipmapMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_mipmapMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DONT_CARE, 'dont care'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_mipmapMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NICEST, 'nice'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_mipmapMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FASTEST, 'fast'), _mipmapMap);\nvar filterMap = (_filterMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEAREST, 'nearest'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINEAR, 'linear'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINEAR_MIPMAP_LINEAR, 'mipmap'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEAREST_MIPMAP_LINEAR, 'nearest mipmap linear'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINEAR_MIPMAP_NEAREST, 'linear mipmap nearest'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEAREST_MIPMAP_NEAREST, 'nearest mipmap nearest'), _filterMap);\nvar wrapModeMap = (_wrapModeMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].REPEAT, 'repeat'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].CLAMP_TO_EDGE, 'clamp'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MIRRORED_REPEAT, 'mirror'), _wrapModeMap);\nvar colorSpaceMap = (_colorSpaceMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_colorSpaceMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NONE, 'none'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_colorSpaceMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].BROWSER_DEFAULT_WEBGL, 'browser'), _colorSpaceMap);\nvar depthFuncMap = (_depthFuncMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEVER, 'never'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALWAYS, 'always'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LESS, 'less'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LEQUAL, 'lequal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GREATER, 'greater'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GEQUAL, 'gequal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].EQUAL, 'equal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NOTEQUAL, 'notequal'), _depthFuncMap);\nvar blendEquationMap = (_blendEquationMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_ADD, 'add'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MIN_EXT, 'min'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MAX_EXT, 'max'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_SUBTRACT, 'subtract'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_REVERSE_SUBTRACT, 'reverse subtract'), _blendEquationMap);\nvar blendFuncMap = (_blendFuncMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ZERO, 'zero'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE, 'one'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_COLOR, 'src color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_SRC_COLOR, 'one minus src color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_ALPHA, 'src alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_SRC_ALPHA, 'one minus src alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DST_COLOR, 'dst color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_DST_COLOR, 'one minus dst color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DST_ALPHA, 'dst alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_DST_ALPHA, 'one minus dst alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].CONSTANT_COLOR, 'constant color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_CONSTANT_COLOR, 'one minus constant color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].CONSTANT_ALPHA, 'constant alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_CONSTANT_ALPHA, 'one minus constant alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_ALPHA_SATURATE, 'src alpha saturate'), _blendFuncMap);\nvar stencilFuncMap = (_stencilFuncMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEVER, 'never'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALWAYS, 'always'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LESS, 'less'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LEQUAL, 'lequal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GREATER, 'greater'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GEQUAL, 'gequal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].EQUAL, 'equal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NOTEQUAL, 'notequal'), _stencilFuncMap);\nvar stencilOpMap = (_stencilOpMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ZERO, 'zero'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].KEEP, 'keep'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].REPLACE, 'replace'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].INVERT, 'invert'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].INCR, 'increment'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DECR, 'decrement'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].INCR_WRAP, 'increment wrap'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DECR_WRAP, 'decrement wrap'), _stencilOpMap);\nvar cullFaceMap = (_cullFaceMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cullFaceMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FRONT, 'front'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cullFaceMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].BACK, 'back'), _cullFaceMap);\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/mesh/MeshComponent.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/mesh/MeshComponent.js ***! - \******************************************************************************/ -/*! exports provided: MeshComponent */ +/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/index.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/index.js ***! + \**************************************************************/ +/*! exports provided: WebGLEngine */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshComponent\", function() { return MeshComponent; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n/* harmony import */ var _shape_AABB__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../../shape/AABB */ \"./node_modules/@antv/g-webgpu-core/es/shape/AABB.js\");\n\n\n\n\n\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\nvar MeshComponent = /*#__PURE__*/function (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(MeshComponent, _Component);\n\n var _super = _createSuper(MeshComponent);\n\n /**\n * aabb 应该存在 Mesh 而非 Geometry 中,原因包括:\n * 1. 包围盒会受 transform 影响。例如每次 transform 之后应该重新计算包围盒(center 发生偏移)。\n * 2. 多个 Mesh 可以共享一个 Geometry,但可以各自拥有不同的 aabb\n */\n\n /**\n * transform 之后需要重新计算包围盒\n */\n\n /**\n * 实际渲染 Model\n */\n function MeshComponent(data) {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, MeshComponent);\n\n _this = _super.call(this, data);\n _this.material = void 0;\n _this.geometry = void 0;\n _this.aabb = new _shape_AABB__WEBPACK_IMPORTED_MODULE_6__[\"AABB\"]();\n _this.aabbDirty = true;\n _this.model = void 0;\n _this.visible = true;\n _this.children = [];\n Object.assign(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), data);\n return _this;\n }\n\n return MeshComponent;\n}(_ComponentManager__WEBPACK_IMPORTED_MODULE_5__[\"Component\"]);\n//# sourceMappingURL=MeshComponent.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/mesh/MeshComponent.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLEngine\", function() { return WebGLEngine; });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var regl__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! regl */ \"./node_modules/regl/dist/regl.js\");\n/* harmony import */ var regl__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(regl__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _ReglAttribute__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./ReglAttribute */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglAttribute.js\");\n/* harmony import */ var _ReglBuffer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ReglBuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglBuffer.js\");\n/* harmony import */ var _ReglComputeModel__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ReglComputeModel */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglComputeModel.js\");\n/* harmony import */ var _ReglElements__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ReglElements */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglElements.js\");\n/* harmony import */ var _ReglFramebuffer__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ReglFramebuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglFramebuffer.js\");\n/* harmony import */ var _ReglModel__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ReglModel */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglModel.js\");\n/* harmony import */ var _ReglTexture2D__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ReglTexture2D */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglTexture2D.js\");\n\n\n\n\n/**\n * render w/ regl\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * regl renderer\n */\nvar WebGLEngine = /*#__PURE__*/function () {\n function WebGLEngine() {\n var _this = this;\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, WebGLEngine);\n this.supportWebGPU = false;\n this.useWGSL = false;\n this.$canvas = void 0;\n this.gl = void 0;\n this.inited = void 0;\n this.createModel = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee2(options) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!options.uniforms) {\n _context2.next = 3;\n break;\n }\n _context2.next = 3;\n return Promise.all(Object.keys(options.uniforms).map( /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee(name) {\n var texture;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(options.uniforms[name] &&\n // @ts-ignore\n options.uniforms[name].load !== undefined)) {\n _context.next = 5;\n break;\n }\n _context.next = 3;\n return options.uniforms[name].load();\n case 3:\n texture = _context.sent;\n // @ts-ignore\n options.uniforms[name] = texture;\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n }()));\n case 3:\n return _context2.abrupt(\"return\", new _ReglModel__WEBPACK_IMPORTED_MODULE_11__[\"default\"](_this.gl, options));\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n this.createAttribute = function (options) {\n return new _ReglAttribute__WEBPACK_IMPORTED_MODULE_6__[\"default\"](_this.gl, options);\n };\n this.createBuffer = function (options) {\n return new _ReglBuffer__WEBPACK_IMPORTED_MODULE_7__[\"default\"](_this.gl, options);\n };\n this.createElements = function (options) {\n return new _ReglElements__WEBPACK_IMPORTED_MODULE_9__[\"default\"](_this.gl, options);\n };\n this.createTexture2D = function (options) {\n return new _ReglTexture2D__WEBPACK_IMPORTED_MODULE_12__[\"default\"](_this.gl, options);\n };\n this.createFramebuffer = function (options) {\n return new _ReglFramebuffer__WEBPACK_IMPORTED_MODULE_10__[\"default\"](_this.gl, options);\n };\n this.useFramebuffer = function (framebuffer, drawCommands) {\n _this.gl({\n framebuffer: framebuffer ? framebuffer.get() : null\n })(drawCommands);\n };\n this.createComputeModel = /*#__PURE__*/function () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee3(context) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", new _ReglComputeModel__WEBPACK_IMPORTED_MODULE_8__[\"default\"](_this.gl, context));\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n return function (_x3) {\n return _ref3.apply(this, arguments);\n };\n }();\n this.clear = function (options) {\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clear-the-draw-buffer\n var color = options.color,\n depth = options.depth,\n stencil = options.stencil,\n _options$framebuffer = options.framebuffer,\n framebuffer = _options$framebuffer === void 0 ? null : _options$framebuffer;\n var reglClearOptions = {\n color: color,\n depth: depth,\n stencil: stencil\n };\n reglClearOptions.framebuffer = framebuffer === null ? framebuffer : framebuffer.get();\n _this.gl.clear(reglClearOptions);\n };\n this.setScissor = function (scissor) {\n if (_this.gl && _this.gl._gl) {\n // https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/scissor\n if (scissor.enable && scissor.box) {\n // console.log(scissor.box);\n _this.gl._gl.enable(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].SCISSOR_TEST);\n _this.gl._gl.scissor(scissor.box.x, scissor.box.y, scissor.box.width, scissor.box.height);\n } else {\n _this.gl._gl.disable(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].SCISSOR_TEST);\n }\n _this.gl._refresh();\n }\n };\n this.viewport = function (_ref4) {\n var x = _ref4.x,\n y = _ref4.y,\n width = _ref4.width,\n height = _ref4.height;\n if (_this.gl && _this.gl._gl) {\n // use WebGL context directly\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#unsafe-escape-hatch\n _this.gl._gl.viewport(x, y, width, height);\n _this.gl._refresh();\n }\n };\n this.readPixels = function (options) {\n var framebuffer = options.framebuffer,\n x = options.x,\n y = options.y,\n width = options.width,\n height = options.height;\n var readPixelsOptions = {\n x: x,\n y: y,\n width: width,\n height: height\n };\n if (framebuffer) {\n readPixelsOptions.framebuffer = framebuffer.get();\n }\n return _this.gl.read(readPixelsOptions);\n };\n this.getCanvas = function () {\n return _this.$canvas;\n };\n this.getGLContext = function () {\n return _this.gl._gl;\n };\n this.destroy = function () {\n if (_this.gl) {\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clean-up\n _this.gl.destroy();\n _this.inited = false;\n }\n };\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(WebGLEngine, [{\n key: \"init\",\n value: function () {\n var _init = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.mark(function _callee4(cfg) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_3___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (!this.inited) {\n _context4.next = 2;\n break;\n }\n return _context4.abrupt(\"return\");\n case 2:\n this.$canvas = cfg.canvas;\n // tslint:disable-next-line:typedef\n _context4.next = 5;\n return new Promise(function (resolve, reject) {\n regl__WEBPACK_IMPORTED_MODULE_5___default()({\n canvas: cfg.canvas,\n attributes: {\n alpha: true,\n // use TAA instead of MSAA\n // @see https://www.khronos.org/registry/webgl/specs/1.0/#5.2.1\n antialias: cfg.antialias,\n premultipliedAlpha: true\n // preserveDrawingBuffer: false,\n },\n\n pixelRatio: 1,\n // TODO: use extensions\n extensions: ['OES_element_index_uint', 'OES_texture_float', 'OES_standard_derivatives',\n // wireframe\n 'angle_instanced_arrays' // VSM shadow map\n ],\n\n optionalExtensions: ['EXT_texture_filter_anisotropic', 'EXT_blend_minmax', 'WEBGL_depth_texture'],\n profile: true,\n onDone: function onDone(err, r) {\n if (err || !r) {\n reject(err);\n }\n // @ts-ignore\n resolve(r);\n }\n });\n });\n case 5:\n this.gl = _context4.sent;\n this.inited = true;\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n function init(_x4) {\n return _init.apply(this, arguments);\n }\n return init;\n }()\n }, {\n key: \"isFloatSupported\",\n value: function isFloatSupported() {\n // @see https://github.com/antvis/GWebGPUEngine/issues/26\n // @ts-ignore\n return this.gl.limits.readFloat;\n }\n }, {\n key: \"beginFrame\",\n value: function beginFrame() {\n //\n }\n }, {\n key: \"endFrame\",\n value: function endFrame() {\n //\n }\n }]);\n return WebGLEngine;\n}();\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/mesh/System.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/mesh/System.js ***! - \***********************************************************************/ -/*! exports provided: MeshSystem */ +/***/ "./node_modules/@antv/g-webgpu/es/Kernel.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/g-webgpu/es/Kernel.js ***! + \**************************************************/ +/*! exports provided: Kernel */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MeshSystem\", function() { return MeshSystem; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _shape_Frustum__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../../shape/Frustum */ \"./node_modules/@antv/g-webgpu-core/es/shape/Frustum.js\");\n/* harmony import */ var _utils_math__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../../utils/math */ \"./node_modules/@antv/g-webgpu-core/es/utils/math.js\");\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _temp;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\n\nvar MeshSystem = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].MeshComponentManager), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].CullableComponentManager), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].GeometryComponentManager), _dec5 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].HierarchyComponentManager), _dec6 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].TransformComponentManager), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function MeshSystem() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, MeshSystem);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"mesh\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"cullable\", _descriptor2, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"geometry\", _descriptor3, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"hierarchy\", _descriptor4, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"transform\", _descriptor5, this);\n\n this.planes = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(MeshSystem, [{\n key: \"setFrustumPlanes\",\n value: function setFrustumPlanes(planes) {\n this.planes = planes;\n }\n }, {\n key: \"execute\",\n value: function () {\n var _execute = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(views) {\n var _iterator, _step, view, scene, camera, _iterator2, _step2, entity, component, hierarchyComponent, cullableComponent, geometryComponent, meshTransform, worldTransform, _geometryComponent$aa, center, halfExtents, transformedCenter, rotationScale, transformedHalfExtents, parentCullableComponent;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _iterator = _createForOfIteratorHelper(views);\n\n try {\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n view = _step.value;\n scene = view.getScene();\n camera = view.getCamera(); // get VP matrix from camera\n\n _iterator2 = _createForOfIteratorHelper(scene.getEntities());\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n entity = _step2.value;\n component = this.mesh.getComponentByEntity(entity);\n\n if (component) {\n hierarchyComponent = this.hierarchy.getComponentByEntity(entity);\n cullableComponent = this.cullable.getComponentByEntity(entity);\n geometryComponent = component.geometry;\n meshTransform = this.transform.getComponentByEntity(entity); // update mesh.aabb\n\n if (geometryComponent && geometryComponent.aabb && meshTransform && component.aabbDirty) {\n worldTransform = meshTransform.worldTransform; // apply transform to geometry.aabb\n\n _geometryComponent$aa = geometryComponent.aabb, center = _geometryComponent$aa.center, halfExtents = _geometryComponent$aa.halfExtents;\n transformedCenter = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].transformMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].create(), center, worldTransform);\n rotationScale = Object(_utils_math__WEBPACK_IMPORTED_MODULE_11__[\"getRotationScale\"])(worldTransform, gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat3\"].create());\n transformedHalfExtents = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].transformMat3(gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].create(), halfExtents, rotationScale);\n component.aabb.update(transformedCenter, transformedHalfExtents);\n component.aabbDirty = false;\n } // culling\n\n\n if (cullableComponent && geometryComponent) {\n parentCullableComponent = this.cullable.getComponentByEntity((hierarchyComponent === null || hierarchyComponent === void 0 ? void 0 : hierarchyComponent.parentID) || -1);\n cullableComponent.visibilityPlaneMask = this.computeVisibilityWithPlaneMask(component.aabb, (parentCullableComponent === null || parentCullableComponent === void 0 ? void 0 : parentCullableComponent.visibilityPlaneMask) || _shape_Frustum__WEBPACK_IMPORTED_MODULE_10__[\"Mask\"].INDETERMINATE, this.planes || camera.getFrustum().planes);\n cullableComponent.visible = cullableComponent.visibilityPlaneMask !== _shape_Frustum__WEBPACK_IMPORTED_MODULE_10__[\"Mask\"].OUTSIDE;\n }\n }\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n case 2:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function execute(_x) {\n return _execute.apply(this, arguments);\n }\n\n return execute;\n }()\n }, {\n key: \"tearDown\",\n value: function tearDown() {\n this.cullable.clear();\n this.mesh.clear();\n }\n /**\n *\n * @see「Optimized View Frustum Culling Algorithms for Bounding Boxes」\n * @see https://github.com/antvis/GWebGPUEngine/issues/3\n *\n * * 基础相交测试 the basic intersection test\n * * 标记 masking @see https://cesium.com/blog/2015/08/04/fast-hierarchical-culling/\n * * TODO: 平面一致性测试 the plane-coherency test\n * * TODO: 支持 mesh 指定自身的剔除策略,参考 Babylon.js @see https://doc.babylonjs.com/how_to/optimizing_your_scene#changing-mesh-culling-strategy\n *\n * @param aabb aabb\n * @param parentPlaneMask mask of parent\n * @param planes planes of frustum\n */\n\n }, {\n key: \"computeVisibilityWithPlaneMask\",\n value: function computeVisibilityWithPlaneMask(aabb, parentPlaneMask, planes) {\n if (parentPlaneMask === _shape_Frustum__WEBPACK_IMPORTED_MODULE_10__[\"Mask\"].OUTSIDE || parentPlaneMask === _shape_Frustum__WEBPACK_IMPORTED_MODULE_10__[\"Mask\"].INSIDE) {\n // 父节点完全位于视锥内或者外部,直接返回\n return parentPlaneMask;\n } // Start with MASK_INSIDE (all zeros) so that after the loop, the return value can be compared with MASK_INSIDE.\n // (Because if there are fewer than 31 planes, the upper bits wont be changed.)\n\n\n var mask = _shape_Frustum__WEBPACK_IMPORTED_MODULE_10__[\"Mask\"].INSIDE;\n\n for (var k = 0, len = planes.length; k < len; ++k) {\n // For k greater than 31 (since 31 is the maximum number of INSIDE/INTERSECTING bits we can store), skip the optimization.\n var flag = k < 31 ? 1 << k : 0;\n\n if (k < 31 && (parentPlaneMask & flag) === 0) {\n // 父节点处于当前面内部,可以跳过\n continue;\n } // 使用 p-vertex 和 n-vertex 加速,避免进行平面和 aabb 全部顶点的相交检测\n\n\n var _planes$k = planes[k],\n normal = _planes$k.normal,\n distance = _planes$k.distance;\n\n if (gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].dot(normal, aabb.getNegativeFarPoint(planes[k])) + distance > 0) {\n return _shape_Frustum__WEBPACK_IMPORTED_MODULE_10__[\"Mask\"].OUTSIDE;\n }\n\n if (gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].dot(normal, aabb.getPositiveFarPoint(planes[k])) + distance > 0) {\n // 和当前面相交,对应位置为1,继续检测下一个面\n mask |= flag;\n }\n }\n\n return mask;\n }\n }]);\n\n return MeshSystem;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"mesh\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"cullable\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"geometry\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"hierarchy\", [_dec5], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor5 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"transform\", [_dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=System.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/mesh/System.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Kernel\", function() { return Kernel; });\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! lodash/isTypedArray */ \"./node_modules/lodash/isTypedArray.js\");\n/* harmony import */ var lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! lodash/isNumber */ \"./node_modules/lodash/isNumber.js\");\n/* harmony import */ var lodash_isNumber__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(lodash_isNumber__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var lodash_isArray__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! lodash/isArray */ \"./node_modules/lodash/isArray.js\");\n/* harmony import */ var lodash_isArray__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(lodash_isArray__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _utils_canvas__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./utils/canvas */ \"./node_modules/@antv/g-webgpu/es/utils/canvas.js\");\n\n\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\n\nvar Kernel = /*#__PURE__*/function () {\n function Kernel(engine, configService) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Kernel);\n this.engine = engine;\n this.configService = configService;\n this.model = void 0;\n this.dirty = true;\n this.compiledBundle = void 0;\n this.initPromise = void 0;\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(Kernel, [{\n key: \"init\",\n value: function init() {\n var _this$configService$g = this.configService.get(),\n canvas = _this$configService$g.canvas,\n engineOptions = _this$configService$g.engineOptions;\n this.initPromise = this.engine.init(_objectSpread({\n canvas: canvas || Object(_utils_canvas__WEBPACK_IMPORTED_MODULE_9__[\"createCanvas\"])(),\n // swapChainFormat: WebGPUConstants.TextureFormat.BGRA8Unorm,\n antialiasing: false\n }, engineOptions));\n }\n }, {\n key: \"setBundle\",\n value: function setBundle(bundle) {\n // deep clone\n this.compiledBundle = JSON.parse(JSON.stringify(bundle));\n }\n }, {\n key: \"setDispatch\",\n value: function setDispatch(dispatch) {\n if (this.compiledBundle.context) {\n this.compiledBundle.context.dispatch = dispatch;\n }\n return this;\n }\n }, {\n key: \"setMaxIteration\",\n value: function setMaxIteration(maxIteration) {\n if (this.compiledBundle.context) {\n this.compiledBundle.context.maxIteration = maxIteration;\n }\n return this;\n }\n }, {\n key: \"setBinding\",\n value: function setBinding(name, data) {\n var _this = this;\n if (typeof name === 'string') {\n var isNumberLikeData = lodash_isNumber__WEBPACK_IMPORTED_MODULE_5___default()(data) || lodash_isTypedArray__WEBPACK_IMPORTED_MODULE_4___default()(data) || lodash_isArray__WEBPACK_IMPORTED_MODULE_6___default()(data);\n if (this.compiledBundle && this.compiledBundle.context) {\n // set define, eg. setBinding('MAX_LENGTH', 10)\n var existedDefine = this.compiledBundle.context.defines.find(function (b) {\n return b.name === name;\n });\n if (existedDefine) {\n existedDefine.value = data;\n return this;\n }\n\n // set uniform\n var existedBinding = this.compiledBundle.context.uniforms.find(function (b) {\n return b.name === name;\n });\n if (existedBinding) {\n // update uniform or buffer\n if (isNumberLikeData) {\n // @ts-ignore\n existedBinding.data = data;\n existedBinding.isReferer = false;\n if (existedBinding.storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"STORAGE_CLASS\"].Uniform) {\n if (this.model) {\n // @ts-ignore\n this.model.updateUniform(name, data);\n }\n } else {\n if (this.model) {\n // @ts-ignore\n this.model.updateBuffer(name, data);\n }\n }\n } else {\n // update with another kernel\n existedBinding.isReferer = true;\n // @ts-ignore\n existedBinding.data = data;\n }\n }\n }\n } else {\n Object.keys(name).forEach(function (key) {\n _this.setBinding(key, name[key]);\n });\n }\n return this;\n }\n }, {\n key: \"execute\",\n value: function () {\n var _execute = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7___default.a.mark(function _callee() {\n var _this2 = this;\n var iteration,\n i,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n iteration = _args.length > 0 && _args[0] !== undefined ? _args[0] : 1;\n if (!this.dirty) {\n _context.next = 6;\n break;\n }\n if (this.compiledBundle.context) {\n if (iteration > 1) {\n this.compiledBundle.context.maxIteration = iteration;\n } else {\n this.compiledBundle.context.maxIteration++;\n }\n }\n _context.next = 5;\n return this.compile();\n case 5:\n this.dirty = false;\n case 6:\n this.engine.beginFrame();\n\n // 首先开启当前 frame 的 compute pass\n this.engine.clear({});\n if (this.compiledBundle.context) {\n this.compiledBundle.context.uniforms.filter(function (_ref) {\n var isReferer = _ref.isReferer;\n return isReferer;\n }).forEach(function (_ref2) {\n var data = _ref2.data,\n name = _ref2.name;\n // @ts-ignore\n _this2.model.confirmInput(data.model, name);\n });\n }\n for (i = 0; i < iteration; i++) {\n this.model.run();\n }\n this.engine.endFrame();\n return _context.abrupt(\"return\", this);\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n function execute() {\n return _execute.apply(this, arguments);\n }\n return execute;\n }()\n /**\n * read output from GPUBuffer\n */\n }, {\n key: \"getOutput\",\n value: function () {\n var _getOutput = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7___default.a.mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this.model.readData());\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n function getOutput() {\n return _getOutput.apply(this, arguments);\n }\n return getOutput;\n }()\n }, {\n key: \"compile\",\n value: function () {\n var _compile = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_0___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7___default.a.mark(function _callee3() {\n var context, target, shader;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_7___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.initPromise;\n case 2:\n context = _objectSpread({}, this.compiledBundle.context);\n target = this.engine.supportWebGPU ? this.engine.useWGSL ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"Target\"].WGSL : _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"Target\"].GLSL450 : _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"Target\"].GLSL100;\n shader = this.compiledBundle.shaders[target]; // this.bindings?.forEach(({ name, data }) => {\n // if (name === name.toUpperCase()) {\n // const define = context.defines.find((d) => d.name === name);\n // if (define) {\n // // @ts-ignore\n // define.value = data;\n // }\n // }\n // });\n // 生成运行时 define\n context.defines.filter(function (define) {\n return define.runtime;\n }).forEach(function (define) {\n var valuePlaceHolder = \"\".concat(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"DefineValuePlaceholder\"]).concat(define.name);\n shader = shader.replace(valuePlaceHolder, \"\".concat(define.value));\n });\n context.shader = shader;\n\n // 添加 uniform 绑定的数据\n context.uniforms.forEach(function (uniform) {\n // const binding = this.bindings.find((b) => b.name === uniform.name);\n // if (binding) {\n // // @ts-ignore\n // uniform.data = binding.referer || binding.data;\n // // @ts-ignore\n // uniform.isReferer = !!binding.referer;\n // }\n\n // 未指定数据,尝试根据 uniform 类型初始化\n if (!uniform.data) {\n if (uniform.storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"STORAGE_CLASS\"].StorageBuffer) {\n var sizePerElement = 1;\n if (uniform.type === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"AST_TOKEN_TYPES\"].FloatArray) {\n sizePerElement = 1;\n } else if (uniform.type === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"AST_TOKEN_TYPES\"].Vector4FloatArray) {\n sizePerElement = 4;\n }\n uniform.data = new Float32Array(context.output.length * sizePerElement).fill(0);\n }\n }\n });\n // } else if (uniform.type === 'image2D') {\n // // @ts-ignore\n // buffer.data = new Uint8ClampedArray(context.output.length!).fill(0);\n // }\n\n this.compiledBundle.context = context;\n _context3.next = 11;\n return this.engine.createComputeModel(this.compiledBundle.context);\n case 11:\n this.model = _context3.sent;\n case 12:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n function compile() {\n return _compile.apply(this, arguments);\n }\n return compile;\n }()\n }]);\n return Kernel;\n}();\n//# sourceMappingURL=Kernel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/Kernel.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/mesh/interface.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/mesh/interface.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g-webgpu/es/World.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/g-webgpu/es/World.js ***! + \*************************************************/ +/*! exports provided: World */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=interface.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/mesh/interface.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"World\", function() { return World; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _antv_g_webgpu_engine__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/g-webgpu-engine */ \"./node_modules/@antv/g-webgpu-engine/es/index.js\");\n/* harmony import */ var _Kernel__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Kernel */ \"./node_modules/@antv/g-webgpu/es/Kernel.js\");\n\n\n\n\n\nvar World = /*#__PURE__*/function () {\n function World() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, World);\n this.engine = void 0;\n this.configService = new _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"ConfigService\"]();\n }\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(World, [{\n key: \"setConfig\",\n value: function setConfig(config) {\n this.configService.set(config);\n }\n }, {\n key: \"setEngine\",\n value: function setEngine(engine) {\n this.engine = engine;\n }\n }, {\n key: \"createEntity\",\n value: function createEntity() {\n return Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"createEntity\"])();\n }\n }, {\n key: \"createKernel\",\n value: function createKernel(precompiledBundle) {\n var kernel = new _Kernel__WEBPACK_IMPORTED_MODULE_4__[\"Kernel\"](this.engine, this.configService);\n if (typeof precompiledBundle === 'string') {\n kernel.setBundle(JSON.parse(precompiledBundle));\n } else {\n kernel.setBundle(precompiledBundle);\n }\n kernel.init();\n return kernel;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.engine.destroy();\n }\n }], [{\n key: \"create\",\n value: function create() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var world = new World();\n world.setConfig(config);\n world.setEngine(new _antv_g_webgpu_engine__WEBPACK_IMPORTED_MODULE_3__[\"WebGLEngine\"]());\n return world;\n }\n }]);\n return World;\n}();\n//# sourceMappingURL=World.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/World.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IAttribute.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IAttribute.js ***! - \*******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g-webgpu/es/index.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/g-webgpu/es/index.js ***! + \*************************************************/ +/*! exports provided: World, Kernel */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IAttribute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IAttribute.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Kernel__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Kernel */ \"./node_modules/@antv/g-webgpu/es/Kernel.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Kernel\", function() { return _Kernel__WEBPACK_IMPORTED_MODULE_0__[\"Kernel\"]; });\n\n/* harmony import */ var _World__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./World */ \"./node_modules/@antv/g-webgpu/es/World.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"World\", function() { return _World__WEBPACK_IMPORTED_MODULE_1__[\"World\"]; });\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IBuffer.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IBuffer.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g-webgpu/es/utils/canvas.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/g-webgpu/es/utils/canvas.js ***! + \********************************************************/ +/*! exports provided: createCanvas */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IBuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IBuffer.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createCanvas\", function() { return createCanvas; });\nfunction createCanvas() {\n if (typeof document !== 'undefined') {\n return document.createElement('canvas');\n } else {\n throw new Error('Cannot create a canvas in this context');\n }\n}\n//# sourceMappingURL=canvas.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/canvas.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IComputeModel.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IComputeModel.js ***! - \**********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g6-core/es/behavior/behavior.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/behavior/behavior.js ***! + \************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IComputeModel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IComputeModel.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _behaviorOption__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./behaviorOption */ \"./node_modules/@antv/g6-core/es/behavior/behaviorOption.js\");\n\n\nvar Behavior = /** @class */function () {\n function Behavior() {}\n /**\n * 自定义 Behavior\n * @param type Behavior 名称\n * @param behavior Behavior 定义的方法集合\n */\n Behavior.registerBehavior = function (type, behavior) {\n if (!behavior) {\n throw new Error(\"please specify handler for this behavior: \".concat(type));\n }\n var prototype = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(_behaviorOption__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n Object.assign(prototype, behavior);\n // eslint-disable-next-line func-names\n var base = function base(cfg) {\n var _this = this;\n Object.assign(this, this.getDefaultCfg(), cfg);\n var events = this.getEvents();\n this.events = null;\n var eventsToBind = {};\n if (events) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (handle, event) {\n eventsToBind[event] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"wrapBehavior\"])(_this, handle);\n });\n this.events = eventsToBind;\n }\n };\n base.prototype = prototype;\n Behavior.types[type] = base;\n };\n Behavior.hasBehavior = function (type) {\n return !!Behavior.types[type];\n };\n Behavior.getBehavior = function (type) {\n return Behavior.types[type];\n };\n // 所有自定义的 Behavior 的实例\n Behavior.types = {};\n return Behavior;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Behavior);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/behavior/behavior.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IElements.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IElements.js ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g6-core/es/behavior/behaviorOption.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/behavior/behaviorOption.js ***! + \******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IElements.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IElements.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n// 自定义 Behavior 时候共有的方法\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {};\n },\n /**\n * register event handler, behavior will auto bind events\n * for example:\n * return {\n * click: 'onClick'\n * }\n */\n getEvents: function getEvents() {\n return {};\n },\n updateCfg: function updateCfg(cfg) {\n Object.assign(this, cfg);\n return true;\n },\n shouldBegin: function shouldBegin() {\n return true;\n },\n shouldUpdate: function shouldUpdate() {\n return true;\n },\n shouldEnd: function shouldEnd() {\n return true;\n },\n /**\n * auto bind events when register behavior\n * @param graph Graph instance\n */\n bind: function bind(graph) {\n var _this = this;\n var events = this.events;\n this.graph = graph;\n if (this.type === 'drag-canvas' || this.type === 'brush-select' || this.type === 'lasso-select') {\n graph.get('canvas').set('draggable', true);\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (handler, event) {\n graph.on(event, handler);\n });\n // To avoid the tabs switching makes the keydown related behaviors disable\n document.addEventListener('visibilitychange', function () {\n _this.keydown = false;\n });\n },\n unbind: function unbind(graph) {\n var events = this.events;\n var draggable = graph.get('canvas').get('draggable');\n if (this.type === 'drag-canvas' || this.type === 'brush-select' || this.type === 'lasso-select') {\n graph.get('canvas').set('draggable', false);\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (handler, event) {\n graph.off(event, handler);\n });\n graph.get('canvas').set('draggable', draggable);\n },\n get: function get(val) {\n return this[val];\n },\n set: function set(key, val) {\n this[key] = val;\n return this;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/behavior/behaviorOption.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IFramebuffer.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IFramebuffer.js ***! - \*********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g6-core/es/behavior/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/behavior/index.js ***! + \*********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IFramebuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IFramebuffer.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./behavior */ \"./node_modules/@antv/g6-core/es/behavior/behavior.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_behavior__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/behavior/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IModel.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IModel.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g6-core/es/element/arrow.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/arrow.js ***! + \********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IModel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IModel.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n triangle: function triangle(width, length, d) {\n if (width === void 0) {\n width = 10;\n }\n if (length === void 0) {\n length = 15;\n }\n if (d === void 0) {\n d = 0;\n }\n var begin = d * 2;\n var path = \"M \".concat(begin, \",0 L \").concat(begin + length, \",-\").concat(width / 2, \" L \").concat(begin + length, \",\").concat(width / 2, \" Z\");\n return path;\n },\n vee: function vee(width, length, d) {\n if (width === void 0) {\n width = 15;\n }\n if (length === void 0) {\n length = 20;\n }\n if (d === void 0) {\n d = 0;\n }\n var begin = d * 2;\n var path = \"M \".concat(begin, \",0 L \").concat(begin + length, \",-\").concat(width / 2, \"\\n L \").concat(begin + 2 * length / 3, \",0 L \").concat(begin + length, \",\").concat(width / 2, \" Z\");\n return path;\n },\n circle: function circle(r, d) {\n if (r === void 0) {\n r = 5;\n }\n if (d === void 0) {\n d = 0;\n }\n var begin = d * 2;\n var path = \"M \".concat(begin, \", 0\\n a \").concat(r, \",\").concat(r, \" 0 1,0 \").concat(r * 2, \",0\\n a \").concat(r, \",\").concat(r, \" 0 1,0 \").concat(-r * 2, \",0\");\n return path;\n },\n rect: function rect(width, length, d) {\n if (width === void 0) {\n width = 10;\n }\n if (length === void 0) {\n length = 10;\n }\n if (d === void 0) {\n d = 0;\n }\n var begin = d * 2;\n var path = \"M \".concat(begin, \",\").concat(-width / 2, \" \\n L \").concat(begin + length, \",\").concat(-width / 2, \" \\n L \").concat(begin + length, \",\").concat(width / 2, \" \\n L \").concat(begin, \",\").concat(width / 2, \" Z\");\n return path;\n },\n diamond: function diamond(width, length, d) {\n if (width === void 0) {\n width = 15;\n }\n if (length === void 0) {\n length = 15;\n }\n if (d === void 0) {\n d = 0;\n }\n var begin = d * 2;\n var path = \"M \".concat(begin, \",0 \\n L \").concat(begin + length / 2, \",\").concat(-width / 2, \" \\n L \").concat(begin + length, \",0 \\n L \").concat(begin + length / 2, \",\").concat(width / 2, \" Z\");\n return path;\n },\n triangleRect: function triangleRect(tWidth, tLength, rWidth, rLength, gap, d) {\n if (tWidth === void 0) {\n tWidth = 15;\n }\n if (tLength === void 0) {\n tLength = 15;\n }\n if (rWidth === void 0) {\n rWidth = 15;\n }\n if (rLength === void 0) {\n rLength = 3;\n }\n if (gap === void 0) {\n gap = 5;\n }\n if (d === void 0) {\n d = 0;\n }\n var begin = d * 2;\n var rectBegin = begin + tLength + gap;\n var path = \"M \".concat(begin, \",0 L \").concat(begin + tLength, \",-\").concat(tWidth / 2, \" L \").concat(begin + tLength, \",\").concat(tWidth / 2, \" Z\\n M \").concat(rectBegin, \", -\").concat(rWidth / 2, \"\\n L \").concat(rectBegin + rLength, \" -\").concat(rWidth / 2, \"\\n L \").concat(rectBegin + rLength, \" \").concat(rWidth / 2, \"\\n L \").concat(rectBegin, \" \").concat(rWidth / 2, \"\\n Z\");\n return path;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/arrow.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IMultiPassRenderer.js": -/*!***************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IMultiPassRenderer.js ***! - \***************************************************************************************/ -/*! exports provided: PassType */ +/***/ "./node_modules/@antv/g6-core/es/element/combo.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/combo.js ***! + \********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PassType\", function() { return PassType; });\nvar PassType;\n/**\n * Pass 分两类:\n * 1. 渲染相关 eg. ClearPass、RenderPass、PickingPass、ShadowPass\n * 2. PostProcessing eg. CopyPass、BlurPass\n * 另外考虑到 Pass 之间严格的执行顺序,render 方法必须是异步的\n */\n\n(function (PassType) {\n PassType[\"Normal\"] = \"normal\";\n PassType[\"PostProcessing\"] = \"post-processing\";\n})(PassType || (PassType = {}));\n//# sourceMappingURL=IMultiPassRenderer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IMultiPassRenderer.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _shapeBase__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./shapeBase */ \"./node_modules/@antv/g6-core/es/element/shapeBase.js\");\n\n\n\n\n\nvar singleCombo = {\n itemType: 'combo',\n // 单个图形的类型\n shapeType: 'single-combo',\n /**\n * Combo 标题文本相对图形的位置,默认为 top\n * 位置包括: top, bottom, left, right, center\n * @type {String}\n */\n labelPosition: 'top',\n /**\n * 标题文本相对偏移,当 labelPosition 不为 center 时有效\n * @type {Number}\n */\n refX: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.refX,\n refY: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.refY,\n options: {\n style: {\n stroke: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboStateStyles),\n collapsedSubstituteIcon: {\n show: false,\n img: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ'\n }\n },\n /**\n * 获取 Combo 宽高\n * @internal 返回 Combo 的大小,以 [width, height] 的方式维护\n * @param {Object} cfg Combo 的配置项\n * @return {Array} 宽高\n */\n getSize: function getSize(cfg) {\n var size = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(cfg.size || this.options.size || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.size);\n // size 是数组,若长度为 1,则补长度为 2\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(size) && size.length === 1) {\n size = [size[0], size[0]];\n }\n // size 为数字,则转换为数组\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(size)) {\n size = [size, size];\n }\n return size;\n },\n // 私有方法,不希望扩展的 Combo 复写这个方法\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg) {\n var labelPosition = labelCfg.position || this.labelPosition;\n var cfgStyle = cfg.style;\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(padding)) padding = Math.max.apply(Math, padding);\n var refX = labelCfg.refX,\n refY = labelCfg.refY;\n // 考虑 refX 和 refY = 0 的场景,不用用 labelCfg.refX || Global.nodeLabel.refX\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(refX)) {\n refX = this.refX; // 不居中时的偏移量\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(refY)) {\n refY = this.refY; // 不居中时的偏移量\n }\n\n var size = this.getSize(cfg);\n var r = Math.max(cfgStyle.r, size[0] / 2) || size[0] / 2;\n var dis = r + padding;\n var style;\n switch (labelPosition) {\n case 'top':\n style = {\n x: 0,\n y: -dis - refY,\n textBaseline: 'bottom',\n textAlign: 'center'\n };\n break;\n case 'bottom':\n style = {\n x: 0,\n y: dis + refY,\n textBaseline: 'bottom',\n textAlign: 'center'\n };\n break;\n case 'left':\n style = {\n x: -dis + refX,\n y: 0,\n textAlign: 'left'\n };\n break;\n case 'center':\n style = {\n x: 0,\n y: 0,\n text: cfg.label,\n textAlign: 'center'\n };\n break;\n default:\n style = {\n x: dis + refX,\n y: 0,\n textAlign: 'right'\n };\n break;\n }\n style.text = cfg.label;\n return style;\n },\n drawShape: function drawShape(cfg, group) {\n var shapeType = this.shapeType; // || this.type,都已经加了 shapeType\n var style = this.getShapeStyle(cfg);\n var shape = group.addShape(shapeType, {\n attrs: style,\n draggable: true,\n name: 'combo-shape'\n });\n return shape;\n },\n updateCollapsedIcon: function updateCollapsedIcon(cfg, item, keyShapeStyle) {\n var collapsed = cfg.collapsed,\n _a = cfg.collapsedSubstituteIcon,\n collapsedSubstituteIcon = _a === void 0 ? {} : _a;\n var substituteIconConfig = Object.assign({}, this.options.collapsedSubstituteIcon, collapsedSubstituteIcon);\n var show = substituteIconConfig.show,\n img = substituteIconConfig.img,\n width = substituteIconConfig.width,\n height = substituteIconConfig.height;\n var group = item.getContainer();\n var collapsedIconShape = group.find(function (ele) {\n return ele.get('name') === 'combo-collapsed-substitute-icon';\n });\n var iconShapeExist = collapsedIconShape && !collapsedIconShape.destroyed;\n var keyShape = item.get('keyShape');\n if (collapsed && show) {\n if (iconShapeExist) {\n collapsedIconShape.show();\n } else {\n var sizeAttr = {\n width: width || keyShapeStyle.r * 2 || keyShapeStyle.width,\n height: height || keyShapeStyle.r * 2 || keyShapeStyle.height\n };\n collapsedIconShape = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n img: img,\n x: -sizeAttr.width / 2,\n y: -sizeAttr.height / 2\n }, sizeAttr),\n name: 'combo-collapsed-substitute-icon',\n draggable: true\n });\n }\n keyShape.hide();\n } else if (iconShapeExist) {\n collapsedIconShape.hide();\n keyShape.show();\n }\n },\n updateShape: function updateShape(cfg, item, keyShapeStyle) {\n var _this = this;\n var keyShape = item.get('keyShape');\n var itemAnimate = item.get('animate');\n var animate = itemAnimate && (cfg.animate === undefined ? this.options.animate : cfg.animate);\n if (animate && keyShape.animate) {\n // 更新到展开状态,先将 collapsedIcon 隐藏。否则在动画完成后再出现 collapsedIcon\n if (!cfg.collapsed) {\n this.updateCollapsedIcon(cfg, item, keyShapeStyle);\n }\n keyShape.animate(keyShapeStyle, {\n duration: 200,\n easing: 'easeLinear',\n callback: function callback() {\n if (cfg.collapsed) {\n _this.updateCollapsedIcon(cfg, item, keyShapeStyle);\n }\n }\n });\n } else {\n keyShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, keyShapeStyle));\n this.updateCollapsedIcon(cfg, item, keyShapeStyle);\n }\n this.updateLabel(cfg, item);\n // special for some types of nodes\n }\n};\n\nvar singleComboDef = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _shapeBase__WEBPACK_IMPORTED_MODULE_4__[\"shapeBase\"]), singleCombo);\n_shape__WEBPACK_IMPORTED_MODULE_3__[\"default\"].registerCombo('single-combo', singleComboDef);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/combo.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IRenderbuffer.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IRenderbuffer.js ***! - \**********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g6-core/es/element/combos/circle.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/combos/circle.js ***! + \****************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IRenderbuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IRenderbuffer.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n\n// 圆形 Combo\n_shape__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerCombo('circle', {\n // 自定义节点时的配置\n options: {\n size: [_global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.size[0], _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.size[0]],\n padding: Math.max.apply(Math, _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.padding),\n animate: true,\n style: {\n stroke: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].comboLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].comboLabel.style.fontSize\n },\n refX: 0,\n refY: 0\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].comboStateStyles),\n collapsedSubstituteIcon: {\n show: false,\n img: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ'\n }\n },\n shapeType: 'circle',\n // 文本位置\n labelPosition: 'top',\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n delete style.height;\n delete style.width;\n var keyShape = group.addShape('circle', {\n attrs: style,\n className: 'circle-combo',\n name: 'circle-combo',\n draggable: true\n });\n return keyShape;\n },\n /**\n * 获取 Combo 的样式,供基于该 Combo 自定义时使用\n * @param {Object} cfg Combo 数据模型\n * @return {Object} Combo 的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = this.options.style;\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isArray\"])(padding)) padding = Math.max.apply(Math, padding);\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, defaultStyle, strokeStyle, cfg.style);\n var fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize;\n var r;\n if (fixSize) {\n r = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(fixSize) ? fixSize / 2 : fixSize[0] / 2;\n } else {\n var size = this.getSize(cfg);\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(style.r) || isNaN(style.r)) r = size[0] / 2 || _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.style.r;else r = Math.max(style.r, size[0] / 2) || size[0] / 2;\n }\n style.r = r + padding;\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0\n }, style);\n if (cfg.style) cfg.style.r = r;else {\n cfg.style = {\n r: r\n };\n }\n return styles;\n },\n update: function update(cfg, item) {\n var size = this.getSize(cfg);\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isArray\"])(padding)) padding = Math.max.apply(Math, padding);\n var cfgStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(cfg.style);\n var fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize;\n var r;\n if (fixSize) {\n r = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(fixSize) ? fixSize / 2 : fixSize[0] / 2;\n } else {\n r = Math.max(cfgStyle.r, size[0] / 2) || size[0] / 2;\n }\n cfgStyle.r = r + padding;\n var itemCacheSize = item.get('sizeCache');\n if (itemCacheSize) {\n itemCacheSize.r = cfgStyle.r;\n }\n // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n var strokeStyle = {\n stroke: cfg.color\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, keyShape.attr(), strokeStyle, cfgStyle);\n if (cfg.style) cfg.style.r = r;else {\n cfg.style = {\n r: r\n };\n }\n this.updateShape(cfg, item, style, true);\n }\n}, 'single-combo');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/combos/circle.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IRendererService.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IRendererService.js ***! - \*************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g6-core/es/element/combos/index.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/combos/index.js ***! + \***************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IRendererService.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IRendererService.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _circle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./circle */ \"./node_modules/@antv/g6-core/es/element/combos/circle.js\");\n/* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ \"./node_modules/@antv/g6-core/es/element/combos/rect.js\");\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/combos/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/ITexture2D.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/ITexture2D.js ***! - \*******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g6-core/es/element/combos/rect.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/combos/rect.js ***! + \**************************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=ITexture2D.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/ITexture2D.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n\n\n\n\n_shape__WEBPACK_IMPORTED_MODULE_3__[\"default\"].registerCombo('rect', {\n // 自定义 Combo 时的配置\n options: {\n size: [40, 5],\n padding: [25, 20, 15, 20],\n animate: true,\n style: {\n radius: 0,\n stroke: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n // 连接点,默认为左右\n anchorPoints: [[0, 0.5], [1, 0.5]],\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboStateStyles),\n collapsedSubstituteIcon: {\n show: false,\n img: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ'\n }\n },\n shapeType: 'rect',\n labelPosition: 'top',\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('rect', {\n attrs: style,\n className: 'rect-combo',\n name: 'rect-combo',\n draggable: true\n });\n return keyShape;\n },\n // 私有方法,不希望扩展的 Combo 复写这个方法\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg) {\n var labelPosition = labelCfg.position || this.labelPosition;\n var cfgStyle = cfg.style;\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var refX = labelCfg.refX,\n refY = labelCfg.refY;\n // 考虑 refX 和 refY = 0 的场景,不用用 labelCfg.refX || Global.nodeLabel.refY\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(refX)) {\n refX = this.refX; // 不居中时的偏移量\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(refY)) {\n refY = this.refY; // 不居中时的偏移量\n }\n\n var left = -cfgStyle.width / 2 - padding[3];\n var right = cfgStyle.width / 2 + padding[1];\n var top = -cfgStyle.height / 2 - padding[0];\n var bottom = cfgStyle.height / 2 + padding[2];\n var style;\n switch (labelPosition) {\n case 'top':\n style = {\n x: left + refX,\n y: top + refY,\n textBaseline: 'top',\n textAlign: 'left'\n };\n break;\n case 'bottom':\n style = {\n x: 0,\n y: bottom + refY,\n textBaseline: 'top',\n textAlign: 'center'\n };\n break;\n case 'left':\n style = {\n x: left + refY,\n y: 0,\n textAlign: 'left'\n };\n break;\n case 'center':\n style = {\n x: 0,\n y: 0,\n text: cfg.label,\n textAlign: 'center'\n };\n break;\n case 'top-center':\n style = {\n x: 0,\n y: top + refY,\n textBaseline: 'top',\n textAlign: 'center'\n };\n break;\n default:\n style = {\n x: right + refX,\n y: 0,\n textAlign: 'right'\n };\n break;\n }\n style.text = cfg.label;\n return style;\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = this.options.style;\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle, cfg.style);\n var size = this.getSize(cfg);\n var width;\n var height;\n var fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize;\n if (fixSize) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(fixSize)) {\n width = fixSize;\n height = fixSize;\n } else {\n width = fixSize[0];\n height = fixSize[1];\n }\n } else {\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(style.width) || isNaN(style.width)) width = size[0] || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.width;else width = Math.max(style.width, size[0]) || size[0];\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(style.height) || isNaN(style.height)) height = size[1] || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.height;else height = Math.max(style.height, size[1]) || size[1];\n }\n var x = -width / 2 - padding[3];\n var y = -height / 2 - padding[0];\n style.width = width + padding[1] + padding[3];\n style.height = height + padding[0] + padding[2];\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: x,\n y: y\n }, style);\n if (!cfg.style) {\n cfg.style = {\n width: width,\n height: height\n };\n } else {\n cfg.style.width = width;\n cfg.style.height = height;\n }\n return styles;\n },\n update: function update(cfg, item) {\n var size = this.getSize(cfg);\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var cfgStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(cfg.style);\n var width, height;\n var fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize;\n if (fixSize) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(fixSize)) {\n width = fixSize;\n height = fixSize;\n } else {\n width = fixSize[0];\n height = fixSize[1];\n }\n } else {\n width = Math.max(cfgStyle.width, size[0]) || size[0];\n height = Math.max(cfgStyle.height, size[1]) || size[1];\n }\n cfgStyle.width = width + padding[1] + padding[3];\n cfgStyle.height = height + padding[0] + padding[2];\n var itemCacheSize = item.get('sizeCache');\n if (itemCacheSize) {\n itemCacheSize.width = cfgStyle.width;\n itemCacheSize.height = cfgStyle.height;\n }\n cfgStyle.x = -width / 2 - padding[3];\n cfgStyle.y = -height / 2 - padding[0];\n // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n var strokeStyle = {\n stroke: cfg.color\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, keyShape.attr(), strokeStyle, cfgStyle);\n if (cfg.style) {\n cfg.style.width = width;\n cfg.style.height = height;\n } else {\n cfg.style = {\n width: width,\n height: height\n };\n }\n this.updateShape(cfg, item, style, false);\n }\n}, 'single-combo');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/combos/rect.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/IUniform.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/IUniform.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/g6-core/es/element/edge.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/edge.js ***! + \*******************************************************/ +/*! no exports provided */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("\n//# sourceMappingURL=IUniform.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/IUniform.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/path */ \"./node_modules/@antv/g6-core/es/util/path.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _shapeBase__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./shapeBase */ \"./node_modules/@antv/g6-core/es/element/shapeBase.js\");\n/**\n * @fileOverview 自定义边\n * @description 自定义边中有大量逻辑同自定义节点重复,虽然可以提取成为 mixin ,但是考虑到代码的可读性,还是单独实现。\n */\n\n\n\n\n\n\n\n\nvar CLS_SHAPE = 'edge-shape';\n// start,end 倒置,center 不变\nfunction revertAlign(labelPosition) {\n var textAlign = labelPosition;\n if (labelPosition === 'start') {\n textAlign = 'end';\n } else if (labelPosition === 'end') {\n textAlign = 'start';\n }\n return textAlign;\n}\nvar singleEdge = {\n itemType: 'edge',\n /**\n * 文本的位置\n * @type {String}\n */\n labelPosition: 'center',\n /**\n * 文本的 x 偏移\n * @type {Number}\n */\n refX: 0,\n /**\n * 文本的 y 偏移\n * @type {Number}\n */\n refY: 0,\n /**\n * 文本是否跟着线自动旋转,默认 false\n * @type {Boolean}\n */\n labelAutoRotate: false,\n // 自定义边时的配置\n options: {\n size: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.size,\n style: {\n x: 0,\n y: 0,\n stroke: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.style.stroke,\n lineAppendWidth: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.style.lineAppendWidth\n },\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].edgeLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].edgeLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].windowFontFamily\n }\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].edgeStateStyles)\n },\n /**\n * 获取边的 path\n * @internal 供扩展的边覆盖\n * @param {Array} points 构成边的点的集合\n * @return {Array} 构成 path 的数组\n */\n getPath: function getPath(points) {\n var path = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points, function (point, index) {\n if (index === 0) {\n path.push(['M', point.x, point.y]);\n } else {\n path.push(['L', point.x, point.y]);\n }\n });\n return path;\n },\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = this.options.style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle, cfg.style);\n var size = cfg.size || _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.size;\n cfg = this.getPathPoints(cfg);\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var controlPoints = this.getControlPoints(cfg);\n var points = [startPoint]; // 添加起始点\n // 添加控制点\n if (controlPoints) {\n points = points.concat(controlPoints);\n }\n // 添加结束点\n points.push(endPoint);\n var path = this.getPath(points);\n var styles = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.style, {\n stroke: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.color,\n lineWidth: size,\n path: path\n }, style);\n return styles;\n },\n updateShapeStyle: function updateShapeStyle(cfg, item, updateType) {\n var _a;\n var group = item.getContainer();\n // const strokeStyle: ShapeStyle = {\n // stroke: cfg.color,\n // };\n var shape = ((_a = item.getKeyShape) === null || _a === void 0 ? void 0 : _a.call(item)) || group['shapeMap']['edge-shape']; // group.find((element) => element.get('className') === 'edge-shape');\n var size = cfg.size;\n cfg = this.getPathPoints(cfg);\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var controlPoints = this.getControlPoints(cfg); // || cfg.controlPoints;\n var points = [startPoint]; // 添加起始点\n // 添加控制点\n if (controlPoints) {\n points = points.concat(controlPoints);\n }\n // 添加结束点\n points.push(endPoint);\n var currentAttr = shape.attr();\n // const previousStyle = mix({}, strokeStyle, currentAttr, cfg.style);\n var previousStyle = cfg.style || {};\n if (previousStyle.stroke === undefined) {\n previousStyle.stroke = cfg.color;\n }\n var source = cfg.sourceNode;\n var target = cfg.targetNode;\n var routeCfg = {\n radius: previousStyle.radius\n };\n if (!controlPoints) {\n routeCfg = {\n source: source,\n target: target,\n offset: previousStyle.offset,\n radius: previousStyle.radius\n };\n }\n var path = this.getPath(points, routeCfg);\n var style = {};\n if (updateType === 'move') {\n style = {\n path: path\n };\n } else {\n if (currentAttr.endArrow && previousStyle.endArrow === false) {\n cfg.style.endArrow = {\n path: ''\n };\n }\n if (currentAttr.startArrow && previousStyle.startArrow === false) {\n cfg.style.startArrow = {\n path: ''\n };\n }\n style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, cfg.style);\n if (style.lineWidth === undefined) style.lineWidth = (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(size) ? size : size === null || size === void 0 ? void 0 : size[0]) || currentAttr.lineWidth;\n if (style.path === undefined) style.path = path;\n if (style.stroke === undefined) style.stroke = currentAttr.stroke || cfg.color;\n }\n if (shape) {\n shape.attr(style);\n }\n },\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg, group) {\n var labelPosition = labelCfg.position || this.labelPosition; // 文本的位置用户可以传入\n var style = {};\n var pathShape = group === null || group === void 0 ? void 0 : group['shapeMap'][CLS_SHAPE]; // group?.find((element) => element.get('className') === CLS_SHAPE);\n // 不对 pathShape 进行判空,如果线不存在,说明有问题了\n var pointPercent;\n if (labelPosition === 'start') {\n pointPercent = 0;\n } else if (labelPosition === 'end') {\n pointPercent = 1;\n } else {\n pointPercent = 0.5;\n }\n // 偏移量\n var offsetX = labelCfg.refX || this.refX;\n var offsetY = labelCfg.refY || this.refY;\n // 如果两个节点重叠,线就变成了一个点,这时候label的位置,就是这个点 + 绝对偏移\n if (cfg.startPoint.x === cfg.endPoint.x && cfg.startPoint.y === cfg.endPoint.y) {\n style.x = cfg.startPoint.x + offsetX;\n style.y = cfg.startPoint.y + offsetY;\n style.text = cfg.label;\n return style;\n }\n var autoRotate;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(labelCfg.autoRotate)) autoRotate = this.labelAutoRotate;else autoRotate = labelCfg.autoRotate;\n var offsetStyle = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_2__[\"getLabelPosition\"])(pathShape, pointPercent, offsetX, offsetY, autoRotate);\n style.x = offsetStyle.x;\n style.y = offsetStyle.y;\n style.rotate = offsetStyle.rotate;\n style.textAlign = this._getTextAlign(labelPosition, offsetStyle.angle);\n style.text = cfg.label;\n return style;\n },\n getLabelBgStyleByPosition: function getLabelBgStyleByPosition(label, labelCfg) {\n if (!label) {\n return {};\n }\n var bbox = label.getBBox();\n var backgroundStyle = labelCfg.style && labelCfg.style.background;\n if (!backgroundStyle) {\n return {};\n }\n var padding = backgroundStyle.padding;\n var backgroundWidth = bbox.width + padding[1] + padding[3];\n var backgroundHeight = bbox.height + padding[0] + padding[2];\n var style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, backgroundStyle), {\n width: backgroundWidth,\n height: backgroundHeight,\n x: bbox.minX - padding[3],\n y: bbox.minY - padding[0],\n matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1]\n });\n var autoRotate;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(labelCfg.autoRotate)) autoRotate = this.labelAutoRotate;else autoRotate = labelCfg.autoRotate;\n if (autoRotate) {\n style.matrix = label.attr('matrix') || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n return style;\n },\n // 获取文本对齐方式\n _getTextAlign: function _getTextAlign(labelPosition, angle) {\n var textAlign = 'center';\n if (!angle) {\n return labelPosition;\n }\n angle = angle % (Math.PI * 2); // 取模\n if (labelPosition !== 'center') {\n if (angle >= 0 && angle <= Math.PI / 2 || angle >= 3 / 2 * Math.PI && angle < 2 * Math.PI) {\n textAlign = labelPosition;\n } else {\n textAlign = revertAlign(labelPosition);\n }\n }\n return textAlign;\n },\n /**\n * @internal 获取边的控制点\n * @param {Object} cfg 边的配置项\n * @return {Array} 控制点的数组\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n /**\n * @internal 处理需要重计算点和边的情况\n * @param {Object} cfg 边的配置项\n * @return {Object} 边的配置项\n */\n getPathPoints: function getPathPoints(cfg) {\n return cfg;\n },\n /**\n * 绘制边\n * @override\n * @param {Object} cfg 边的配置项\n * @param {G.Group} group 边的容器\n * @return {IShape} 图形\n */\n drawShape: function drawShape(cfg, group) {\n var shapeStyle = this.getShapeStyle(cfg);\n var shape = group.addShape('path', {\n className: CLS_SHAPE,\n name: CLS_SHAPE,\n attrs: shapeStyle\n });\n group['shapeMap'][CLS_SHAPE] = shape;\n return shape;\n },\n drawLabel: function drawLabel(cfg, group) {\n var defaultLabelCfg = this.options.labelCfg;\n var labelCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, defaultLabelCfg, cfg.labelCfg);\n var labelStyle = this.getLabelStyle(cfg, labelCfg, group);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate;\n var label = group.addShape('text', {\n attrs: labelStyle,\n name: 'text-shape',\n labelRelated: true,\n draggable: true\n });\n group['shapeMap']['text-shape'] = label;\n if (!isNaN(rotate) && rotate !== '') {\n label.rotateAtStart(rotate);\n }\n if (labelStyle.background) {\n var rect = this.drawLabelBg(cfg, group, label, labelStyle, rotate);\n var labelBgClassname = this.itemType + _shapeBase__WEBPACK_IMPORTED_MODULE_7__[\"CLS_LABEL_BG_SUFFIX\"];\n rect.set('classname', labelBgClassname);\n group['shapeMap'][labelBgClassname] = rect;\n label.toFront();\n }\n return label;\n },\n drawLabelBg: function drawLabelBg(cfg, group, label, labelStyle, rotate) {\n var defaultLabelCfg = this.options.labelCfg;\n var labelCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, defaultLabelCfg, cfg.labelCfg);\n var style = this.getLabelBgStyleByPosition(label, labelCfg);\n var rect = group.addShape('rect', {\n name: 'text-bg-shape',\n attrs: style,\n labelRelated: true\n });\n group['shapeMap']['text-bg-shape'] = rect;\n return rect;\n }\n};\nvar singleEdgeDef = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _shapeBase__WEBPACK_IMPORTED_MODULE_7__[\"shapeBase\"]), singleEdge);\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('single-edge', singleEdgeDef);\n// 直线, 不支持控制点\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('line', {\n // 控制点不生效\n getControlPoints: function getControlPoints() {\n return undefined;\n }\n}, 'single-edge');\n// 直线\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('spline', {\n getPath: function getPath(points) {\n var path = Object(_util_path__WEBPACK_IMPORTED_MODULE_4__[\"getSpline\"])(points);\n return path;\n }\n}, 'single-edge');\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('arc', {\n curveOffset: 20,\n clockwise: 1,\n getControlPoints: function getControlPoints(cfg) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var midPoint = {\n x: (startPoint.x + endPoint.x) / 2,\n y: (startPoint.y + endPoint.y) / 2\n };\n var center;\n var arcPoint;\n // 根据给定点计算圆弧\n if (cfg.controlPoints !== undefined) {\n arcPoint = cfg.controlPoints[0];\n center = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"getCircleCenterByPoints\"])(startPoint, arcPoint, endPoint);\n // 根据控制点和直线关系决定 clockwise值\n if (startPoint.x <= endPoint.x && startPoint.y > endPoint.y) {\n this.clockwise = center.x > arcPoint.x ? 0 : 1;\n } else if (startPoint.x <= endPoint.x && startPoint.y < endPoint.y) {\n this.clockwise = center.x > arcPoint.x ? 1 : 0;\n } else if (startPoint.x > endPoint.x && startPoint.y <= endPoint.y) {\n this.clockwise = center.y < arcPoint.y ? 0 : 1;\n } else {\n this.clockwise = center.y < arcPoint.y ? 1 : 0;\n }\n // 若给定点和两端点共线,无法生成圆弧,绘制直线\n if ((arcPoint.x - startPoint.x) / (arcPoint.y - startPoint.y) === (endPoint.x - startPoint.x) / (endPoint.y - startPoint.y)) {\n return [];\n }\n } else {\n // 根据直线连线中点的的偏移计算圆弧\n // 若用户给定偏移量则根据其计算,否则按照默认偏移值计算\n if (cfg.curveOffset === undefined) {\n cfg.curveOffset = this.curveOffset;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(cfg.curveOffset)) {\n cfg.curveOffset = cfg.curveOffset[0];\n }\n if (cfg.curveOffset < 0) {\n this.clockwise = 0;\n } else {\n this.clockwise = 1;\n }\n var vec = {\n x: endPoint.x - startPoint.x,\n y: endPoint.y - startPoint.y\n };\n var edgeAngle = Math.atan2(vec.y, vec.x);\n arcPoint = {\n x: cfg.curveOffset * Math.cos(-Math.PI / 2 + edgeAngle) + midPoint.x,\n y: cfg.curveOffset * Math.sin(-Math.PI / 2 + edgeAngle) + midPoint.y\n };\n center = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"getCircleCenterByPoints\"])(startPoint, arcPoint, endPoint);\n }\n var radius = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"distance\"])(startPoint, center);\n var controlPoints = [{\n x: radius,\n y: radius\n }];\n return controlPoints;\n },\n getPath: function getPath(points) {\n var path = [];\n path.push(['M', points[0].x, points[0].y]);\n // 控制点与端点共线\n if (points.length === 2) {\n path.push(['L', points[1].x, points[1].y]);\n } else {\n path.push(['A', points[1].x, points[1].y, 0, 0, this.clockwise, points[2].x, points[2].y]);\n }\n return path;\n }\n}, 'single-edge');\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('quadratic', {\n curvePosition: 0.5,\n curveOffset: -20,\n getControlPoints: function getControlPoints(cfg) {\n var controlPoints = cfg.controlPoints; // 指定controlPoints\n if (!controlPoints || !controlPoints.length) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset;\n if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(cfg.curveOffset)) cfg.curveOffset = cfg.curveOffset[0];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(cfg.curvePosition)) cfg.curvePosition = cfg.curveOffset[0];\n var innerPoint = Object(_util_path__WEBPACK_IMPORTED_MODULE_4__[\"getControlPoint\"])(startPoint, endPoint, cfg.curvePosition, cfg.curveOffset);\n controlPoints = [innerPoint];\n }\n return controlPoints;\n },\n getPath: function getPath(points) {\n var path = [];\n path.push(['M', points[0].x, points[0].y]);\n path.push(['Q', points[1].x, points[1].y, points[2].x, points[2].y]);\n return path;\n }\n}, 'single-edge');\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('cubic', {\n curvePosition: [1 / 2, 1 / 2],\n curveOffset: [-20, 20],\n getControlPoints: function getControlPoints(cfg) {\n var controlPoints = cfg.controlPoints; // 指定 controlPoints\n if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset;\n if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition];\n if (!controlPoints || !controlPoints.length || controlPoints.length < 2) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var innerPoint1 = Object(_util_path__WEBPACK_IMPORTED_MODULE_4__[\"getControlPoint\"])(startPoint, endPoint, cfg.curvePosition[0], cfg.curveOffset[0]);\n var innerPoint2 = Object(_util_path__WEBPACK_IMPORTED_MODULE_4__[\"getControlPoint\"])(startPoint, endPoint, cfg.curvePosition[1], cfg.curveOffset[1]);\n controlPoints = [innerPoint1, innerPoint2];\n }\n return controlPoints;\n },\n getPath: function getPath(points) {\n var path = [];\n path.push(['M', points[0].x, points[0].y]);\n path.push(['C', points[1].x, points[1].y, points[2].x, points[2].y, points[3].x, points[3].y]);\n return path;\n }\n}, 'single-edge');\n// 垂直方向的三阶贝塞尔曲线,不再考虑用户外部传入的控制点\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('cubic-vertical', {\n curvePosition: [1 / 2, 1 / 2],\n minCurveOffset: [0, 0],\n curveOffset: undefined,\n getControlPoints: function getControlPoints(cfg) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition;\n if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset;\n if (cfg.minCurveOffset === undefined) cfg.minCurveOffset = this.minCurveOffset;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.minCurveOffset)) cfg.minCurveOffset = [cfg.minCurveOffset, -cfg.minCurveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition];\n var yDist = endPoint.y - startPoint.y;\n var curveOffset = [0, 0];\n if (cfg.curveOffset) {\n curveOffset = cfg.curveOffset;\n } else if (Math.abs(yDist) < Math.abs(cfg.minCurveOffset[0])) {\n curveOffset = cfg.minCurveOffset;\n }\n var innerPoint1 = {\n x: startPoint.x,\n y: startPoint.y + yDist * this.curvePosition[0] + curveOffset[0]\n };\n var innerPoint2 = {\n x: endPoint.x,\n y: endPoint.y - yDist * this.curvePosition[1] + curveOffset[1]\n };\n return [innerPoint1, innerPoint2];\n }\n}, 'cubic');\n// 水平方向的三阶贝塞尔曲线,不再考虑用户外部传入的控制点\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('cubic-horizontal', {\n curvePosition: [1 / 2, 1 / 2],\n minCurveOffset: [0, 0],\n curveOffset: undefined,\n getControlPoints: function getControlPoints(cfg) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition;\n if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset;\n if (cfg.minCurveOffset === undefined) cfg.minCurveOffset = this.minCurveOffset;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.minCurveOffset)) cfg.minCurveOffset = [cfg.minCurveOffset, -cfg.minCurveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition];\n var xDist = endPoint.x - startPoint.x;\n var curveOffset = [0, 0];\n if (cfg.curveOffset) {\n curveOffset = cfg.curveOffset;\n } else if (Math.abs(xDist) < Math.abs(cfg.minCurveOffset[0])) {\n curveOffset = cfg.minCurveOffset;\n }\n var innerPoint1 = {\n x: startPoint.x + xDist * this.curvePosition[0] + curveOffset[0],\n y: startPoint.y\n };\n var innerPoint2 = {\n x: endPoint.x - xDist * this.curvePosition[1] + curveOffset[1],\n y: endPoint.y\n };\n var controlPoints = [innerPoint1, innerPoint2];\n return controlPoints;\n }\n}, 'cubic');\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('loop', {\n getPathPoints: function getPathPoints(cfg) {\n return Object(_util_graphic__WEBPACK_IMPORTED_MODULE_2__[\"getLoopCfgs\"])(cfg);\n },\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n afterDraw: function afterDraw(cfg) {\n cfg.controlPoints = undefined;\n },\n afterUpdate: function afterUpdate(cfg) {\n cfg.controlPoints = undefined;\n }\n}, 'cubic');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/edge.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/System.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/System.js ***! - \***************************************************************************/ -/*! exports provided: RendererSystem */ +/***/ "./node_modules/@antv/g6-core/es/element/hull/bubbleset.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/hull/bubbleset.js ***! + \*****************************************************************/ +/*! exports provided: genBubbleSet */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RendererSystem\", function() { return RendererSystem; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _passes_CopyPass__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./passes/CopyPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/CopyPass.js\");\n/* harmony import */ var _passes_PixelPickingPass__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./passes/PixelPickingPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/PixelPickingPass.js\");\n/* harmony import */ var _passes_RenderPass__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./passes/RenderPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/RenderPass.js\");\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _temp;\n\n\n\n\n\n\nvar RendererSystem = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Systems), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"named\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].FrameGraphSystem), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderPassFactory), _dec5 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].ConfigService), _dec6 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].ResourcePool), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function RendererSystem() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, RendererSystem);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"frameGraphSystem\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"renderPassFactory\", _descriptor2, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"configService\", _descriptor3, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"resourcePool\", _descriptor4, this);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(RendererSystem, [{\n key: \"execute\",\n value: function () {\n var _execute = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(views) {\n var _this$renderPassFacto, setupRenderPass, executeRenderPass, renderPass, _this$renderPassFacto2, setupCopyPass, executeCopyPass, tearDownCopyPass, copyPass;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // const pixelPickingPass = this.renderPassFactory(\n // PixelPickingPass.IDENTIFIER,\n // );\n // const {\n // setup: setupPixelPickingPass,\n // execute: executePixelPickingPass,\n // tearDown: tearDownPickingPass,\n // } = pixelPickingPass;\n // this.frameGraphSystem.addPass(\n // PixelPickingPass.IDENTIFIER,\n // setupPixelPickingPass,\n // executePixelPickingPass,\n // tearDownPickingPass,\n // );\n _this$renderPassFacto = this.renderPassFactory(_passes_RenderPass__WEBPACK_IMPORTED_MODULE_11__[\"RenderPass\"].IDENTIFIER), setupRenderPass = _this$renderPassFacto.setup, executeRenderPass = _this$renderPassFacto.execute;\n renderPass = this.frameGraphSystem.addPass(_passes_RenderPass__WEBPACK_IMPORTED_MODULE_11__[\"RenderPass\"].IDENTIFIER, setupRenderPass, executeRenderPass);\n _this$renderPassFacto2 = this.renderPassFactory(_passes_CopyPass__WEBPACK_IMPORTED_MODULE_9__[\"CopyPass\"].IDENTIFIER), setupCopyPass = _this$renderPassFacto2.setup, executeCopyPass = _this$renderPassFacto2.execute, tearDownCopyPass = _this$renderPassFacto2.tearDown;\n copyPass = this.frameGraphSystem.addPass(_passes_CopyPass__WEBPACK_IMPORTED_MODULE_9__[\"CopyPass\"].IDENTIFIER, setupCopyPass, executeCopyPass, tearDownCopyPass);\n this.frameGraphSystem.present(copyPass.data.output); // this.frameGraphSystem.present(renderPass.data.output);\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function execute(_x) {\n return _execute.apply(this, arguments);\n }\n\n return execute;\n }()\n }, {\n key: \"tearDown\",\n value: function tearDown() {\n this.resourcePool.clean();\n }\n }, {\n key: \"pick\",\n value: function pick(position, view) {\n var pickingPass = this.renderPassFactory(_passes_PixelPickingPass__WEBPACK_IMPORTED_MODULE_10__[\"PixelPickingPass\"].IDENTIFIER);\n return pickingPass.pick(position, view);\n }\n }]);\n\n return RendererSystem;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"frameGraphSystem\", [_dec2, _dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"renderPassFactory\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"configService\", [_dec5], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"resourcePool\", [_dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=System.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/System.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"genBubbleSet\", function() { return genBubbleSet; });\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n\nvar defaultOps = {\n maxRoutingIterations: 100,\n maxMarchingIterations: 100,\n pixelGroupSize: 2,\n edgeR0: 10,\n edgeR1: 10,\n nodeR0: 5,\n nodeR1: 10,\n morphBuffer: 5,\n threshold: 0.001,\n skip: 16,\n nodeInfluenceFactor: 1,\n edgeInfluenceFactor: 1,\n negativeNodeInfluenceFactor: -0.5\n};\n/**\n * Marching square algorithm for traching the contour of a pixel group\n * https://www.emanueleferonato.com/2013/03/01/using-marching-squares-algorithm-to-trace-the-contour-of-an-image/\n * @param potentialArea\n * @param threshold\n */\nfunction MarchingSquares(contour, potentialArea, threshold) {\n var marched = false;\n var getVal = function getVal(x, y) {\n return potentialArea.cells[x + y * potentialArea.width];\n };\n var getState = function getState(x, y) {\n var squareVal = 0;\n if (getVal(x - 1, y - 1) >= threshold) {\n squareVal += 1;\n }\n if (getVal(x, y - 1) > threshold) {\n squareVal += 2;\n }\n if (getVal(x - 1, y) > threshold) {\n squareVal += 4;\n }\n if (getVal(x, y) > threshold) {\n squareVal += 8;\n }\n return squareVal;\n };\n var doMarch = function doMarch(xPos, yPos) {\n var x = xPos;\n var y = yPos;\n var prevX;\n var prevY;\n for (var i = 0; i < potentialArea.width * potentialArea.height; i++) {\n prevX = x;\n prevY = y;\n if (contour.findIndex(function (item) {\n return item.x === x && item.y === y;\n }) > -1) {\n if (contour[0].x !== x || contour[0].y !== y) {\n // encountered a loop but haven't returned to start: change direction using conditionals and continue back to start\n } else {\n return true;\n }\n } else {\n contour.push({\n x: x,\n y: y\n });\n }\n var state = getState(x, y);\n // assign the move direction according to state of the square\n switch (state) {\n case -1:\n console.warn('Marched out of bounds');\n return true;\n case 0:\n case 3:\n case 2:\n case 7:\n x++; // go right\n break;\n case 12:\n case 14:\n case 4:\n x--; // go left\n break;\n case 6:\n // go left if come from up else go right\n if (prevX === 0) {\n if (prevY === -1) {\n x -= 1;\n } else {\n x += 1;\n }\n }\n break;\n case 1:\n case 13:\n case 5:\n y--; // go up\n break;\n case 9:\n // go up if come from right else go down\n if (prevX === 1) {\n if (prevY === 0) {\n y -= 1;\n } else {\n y += 1;\n }\n }\n break;\n case 10:\n case 8:\n case 11:\n y++; // go down\n break;\n default:\n console.warn(\"Marching squares invalid state: \".concat(state));\n return true;\n }\n }\n };\n this.march = function () {\n for (var x = 0; x < potentialArea.width && !marched; x += 1) {\n for (var y = 0; y < potentialArea.height && !marched; y += 1) {\n if (getVal(x, y) > threshold && getState(x, y) !== 15) {\n marched = doMarch(x, y);\n }\n }\n }\n return marched;\n };\n}\n/**\n * Space partition & assign value to each cell\n * @param points\n */\nvar initGridCells = function initGridCells(width, height, pixelGroupSize) {\n var scaleWidth = Math.ceil(width / pixelGroupSize);\n var scaleHeight = Math.ceil(height / pixelGroupSize);\n var gridCells = new Float32Array(Math.max(0, scaleWidth * scaleHeight)).fill(0);\n return {\n cells: gridCells,\n width: scaleWidth,\n height: scaleHeight\n };\n};\n/**\n * Find the optimal already visited member to item;\n Optimal: minimize cost(j) = distance(i,j) ∗ countObstacles(i,j)\n * @param item\n * @param visited\n */\nvar pickBestNeighbor = function pickBestNeighbor(item, visited, nonMembers) {\n var closestNeighbour = null;\n var minCost = Number.POSITIVE_INFINITY;\n visited.forEach(function (neighbourItem) {\n var itemP = {\n x: item.getModel().x,\n y: item.getModel().y\n };\n var neighbourItemP = {\n x: neighbourItem.getModel().x,\n y: neighbourItem.getModel().y\n };\n var dist = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"squareDist\"])(itemP, neighbourItemP);\n var directLine = new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](itemP.x, itemP.y, neighbourItemP.x, neighbourItemP.y);\n var numberObstacles = nonMembers.reduce(function (count, _item) {\n if (Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"fractionToLine\"])(_item, directLine) > 0) {\n return count + 1;\n }\n return count;\n }, 0);\n if (dist * Math.pow(numberObstacles + 1, 2) < minCost) {\n closestNeighbour = neighbourItem;\n minCost = dist * Math.pow(numberObstacles + 1, 2);\n }\n });\n return closestNeighbour;\n};\n/**\n * 返回和线相交的item中,离边的起点最近的item\n * @param items\n * @param line\n */\nvar getIntersectItem = function getIntersectItem(items, line) {\n var minDistance = Number.POSITIVE_INFINITY;\n var closestItem = null;\n items.forEach(function (item) {\n var distance = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"fractionToLine\"])(item, line);\n // find closest intersection\n if (distance >= 0 && distance < minDistance) {\n closestItem = item;\n minDistance = distance;\n }\n });\n return closestItem;\n};\n/**\n * Modify the directLine and Route virtual edges around obstacles\n */\nvar computeRoute = function computeRoute(directLine, nonMembers, maxRoutingIterations, morphBuffer) {\n var checkedLines = [];\n var linesToCheck = [];\n linesToCheck.push(directLine);\n var hasIntersection = true;\n var iterations = 0;\n var pointExists = function pointExists(point, lines) {\n var flag = false;\n lines.forEach(function (line) {\n if (flag) return;\n if (Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"isPointsOverlap\"])(point, {\n x: line.x1,\n y: line.y1\n }) || Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"isPointsOverlap\"])(point, {\n x: line.x2,\n y: line.y2\n })) {\n flag = true;\n }\n });\n return flag;\n };\n var isPointInNonMembers = function isPointInNonMembers(point, _nonMembers) {\n for (var _i = 0, _nonMembers_1 = _nonMembers; _i < _nonMembers_1.length; _i++) {\n var item = _nonMembers_1[_i];\n var bbox = item.getBBox();\n var 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]];\n if (Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"isPointInPolygon\"])(itemContour, point.x, point.y)) {\n return true;\n }\n }\n return false;\n };\n // outer loop end when no more intersections or out of iterations\n while (hasIntersection && iterations < maxRoutingIterations) {\n hasIntersection = false;\n var _loop_1 = function _loop_1() {\n var line = linesToCheck.pop();\n var closestItem = getIntersectItem(nonMembers, line);\n if (closestItem) {\n var _a = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"itemIntersectByLine\"])(closestItem, line),\n intersections_1 = _a[0],\n countIntersections = _a[1];\n // if line passes through item\n if (countIntersections === 2) {\n var testReroute = function testReroute(isFirst) {\n var tempMorphBuffer = morphBuffer;\n var virtualNode = rerouteLine(closestItem, tempMorphBuffer, intersections_1, isFirst);\n // test the virtualNode already exists\n var exist = pointExists(virtualNode, linesToCheck) || pointExists(virtualNode, checkedLines);\n var pointInside = isPointInNonMembers(virtualNode, nonMembers);\n while (!exist && pointInside && tempMorphBuffer >= 1) {\n // try a smaller buffer\n tempMorphBuffer /= 1.5;\n virtualNode = rerouteLine(closestItem, tempMorphBuffer, intersections_1, isFirst);\n exist = pointExists(virtualNode, linesToCheck) || pointExists(virtualNode, checkedLines);\n pointInside = isPointInNonMembers(virtualNode, nonMembers);\n }\n // 第二次route时不要求pointInside\n if (virtualNode && !exist && (!isFirst || !pointInside)) {\n // add 2 rerouted lines to check\n linesToCheck.push(new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](line.x1, line.y1, virtualNode.x, virtualNode.y));\n linesToCheck.push(new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](virtualNode.x, virtualNode.y, line.x2, line.y2));\n hasIntersection = true;\n }\n };\n testReroute(true);\n if (!hasIntersection) {\n // if we didn't find a valid point around the first corner, try the second\n testReroute(false);\n }\n }\n }\n // no intersection found, mark this line as completed\n if (!hasIntersection) {\n checkedLines.push(line);\n }\n iterations += 1;\n };\n // inner loop end when out of lines or found an intersection\n while (!hasIntersection && linesToCheck.length) {\n _loop_1();\n }\n }\n // 加入剩余的线\n while (linesToCheck.length) {\n checkedLines.push(linesToCheck.pop());\n }\n return checkedLines;\n};\n/**\n * Connect item with visited members using direct line or virtual edges\n */\nfunction getRoute(item, nonMembers, visited, maxRoutingIterations, morphBuffer) {\n var optimalNeighbor = pickBestNeighbor(item, visited, nonMembers);\n if (optimalNeighbor === null) {\n return [];\n }\n // merge the consecutive lines\n var mergeLines = function mergeLines(checkedLines) {\n var finalRoute = [];\n while (checkedLines.length > 0) {\n var line1 = checkedLines.pop();\n if (checkedLines.length === 0) {\n finalRoute.push(line1);\n break;\n }\n var line2 = checkedLines.pop();\n var mergeLine = new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](line1.x1, line1.y1, line2.x2, line2.y2);\n var closestItem = getIntersectItem(nonMembers, mergeLine);\n // merge most recent line and previous line\n if (!closestItem) {\n checkedLines.push(mergeLine);\n } else {\n finalRoute.push(line1);\n checkedLines.push(line2);\n }\n }\n return finalRoute;\n };\n var directLine = new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](item.getModel().x, item.getModel().y, optimalNeighbor.getModel().x, optimalNeighbor.getModel().y);\n var checkedLines = computeRoute(directLine, nonMembers, maxRoutingIterations, morphBuffer);\n var finalRoute = mergeLines(checkedLines);\n return finalRoute;\n}\n/**\n * Calculate the counter that includes the selected items and exclues the non-selected items\n * @param graph\n * @param members\n * @param nonMembers\n * @param options\n */\nvar genBubbleSet = function genBubbleSet(members, nonMembers, ops) {\n // eslint-disable-next-line no-redeclare\n var options = Object.assign(defaultOps, ops);\n var centroid = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"getPointsCenter\"])(members.map(function (item) {\n return {\n x: item.getModel().x,\n y: item.getModel().y\n };\n }));\n // 按照到中心距离远近排序\n members = members.sort(function (a, b) {\n return Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"squareDist\"])({\n x: a.getModel().x,\n y: a.getModel().y\n }, centroid) - Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"squareDist\"])({\n x: b.getModel().x,\n y: b.getModel().y\n }, centroid);\n });\n var visited = [];\n var virtualEdges = [];\n members.forEach(function (item) {\n var lines = getRoute(item, nonMembers, visited, options.maxRoutingIterations, options.morphBuffer);\n lines.forEach(function (l) {\n virtualEdges.push(l);\n });\n visited.push(item);\n });\n // 由于edge也可以作为member和nonMember传入,暂时不考虑把edges作为参数传入genBubbleSet\n // edges && edges.forEach(e => {\n // virtualEdges.push(new Line(e.getSource().getModel().x, e.getSource().getModel().y, e.getTarget().getModel().x, e.getTarget().getModel().y));\n // });\n var activeRegion = getActiveRregion(members, virtualEdges, options.nodeR0);\n var potentialArea = initGridCells(activeRegion.width, activeRegion.height, options.pixelGroupSize);\n // Use march squares to generate contour\n var contour = [];\n var hull = [];\n for (var iterations = 0; iterations < options.maxMarchingIterations; iterations++) {\n fillPotentialArea(members, nonMembers, virtualEdges, activeRegion, potentialArea, options);\n contour = [];\n hull = [];\n if (!new MarchingSquares(contour, potentialArea, options.threshold).march()) continue;\n var marchedPath = contour.map(function (point) {\n return {\n x: Math.round(point.x * options.pixelGroupSize + activeRegion.minX),\n y: Math.round(point.y * options.pixelGroupSize + activeRegion.minY)\n };\n });\n // 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) }))\n if (marchedPath) {\n var size = marchedPath.length;\n if (options.skip > 1) {\n size = Math.floor(marchedPath.length / options.skip);\n // if we reduced too much (fewer than three points in reduced surface) reduce skip and try again\n while (size < 3 && options.skip > 1) {\n options.skip -= 1;\n size = Math.floor(marchedPath.length / options.skip);\n }\n }\n // copy hull values\n for (var i = 0, j = 0; j < size; j += 1, i += options.skip) {\n hull.push({\n x: marchedPath[i].x,\n y: marchedPath[i].y\n });\n }\n }\n var isContourValid = function isContourValid() {\n for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {\n var item = members_1[_i];\n var hullPoints = hull.map(function (point) {\n return [point.x, point.y];\n });\n if (!Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"isPointInPolygon\"])(hullPoints, item.getBBox().centerX, item.getBBox().centerY)) return false;\n }\n // 不强制要求所有nonMembers都没有包含在内\n // for (const item of nonMembers) {\n // if (isPointInPolygon({ x: item.getBBox().centerX, y: item.getBBox().centerY }, contour)) return false\n // }\n return true;\n };\n if (hull && isContourValid()) {\n return hull;\n }\n // update parameters for next iteration\n options.threshold *= 0.9;\n if (iterations <= options.maxMarchingIterations * 0.5) {\n options.memberInfluenceFactor *= 1.2;\n options.edgeInfluenceFactor *= 1.2;\n } else if (options.nonMemberInfluenceFactor !== 0 && nonMembers.length > 0) {\n // after half the iterations, start increasing positive energy and lowering the threshold\n options.nonMemberInfluenceFactor *= 0.8;\n } else {\n break;\n }\n }\n return hull;\n};\n/**\n * unionboundingbox\n * @param members\n * @param edges\n */\nfunction getActiveRregion(members, edges, offset) {\n var activeRegion = {\n minX: Number.POSITIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n maxX: Number.NEGATIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n var bboxes = [];\n members.forEach(function (item) {\n bboxes.push(item.getBBox());\n });\n edges.forEach(function (l) {\n bboxes.push(l.getBBox());\n });\n for (var _i = 0, bboxes_1 = bboxes; _i < bboxes_1.length; _i++) {\n var bbox = bboxes_1[_i];\n activeRegion.minX = (bbox.minX < activeRegion.minX ? bbox.minX : activeRegion.minX) - offset;\n activeRegion.minY = (bbox.minY < activeRegion.minY ? bbox.minY : activeRegion.minY) - offset;\n activeRegion.maxX = (bbox.maxX > activeRegion.maxX ? bbox.maxX : activeRegion.maxX) + offset;\n activeRegion.maxY = (bbox.maxY > activeRegion.maxY ? bbox.maxY : activeRegion.maxY) + offset;\n }\n activeRegion.width = activeRegion.maxX - activeRegion.minX;\n activeRegion.height = activeRegion.maxY - activeRegion.minY;\n activeRegion.x = activeRegion.minX;\n activeRegion.y = activeRegion.minY;\n return activeRegion;\n}\nfunction fillPotentialArea(members, nonMembers, edges, activeRegion, potentialArea, options) {\n function pos2GridIx(x, offset) {\n var gridIx = Math.floor((x - offset) / options.pixelGroupSize);\n return gridIx < 0 ? 0 : gridIx;\n }\n function gridIx2Pos(x, offset) {\n return x * options.pixelGroupSize + offset;\n }\n // using inverse a for numerical stability\n var nodeInfA = (options.nodeR0 - options.nodeR1) * (options.nodeR0 - options.nodeR1);\n var edgeInfA = (options.edgeR0 - options.edgeR1) * (options.edgeR0 - options.edgeR1);\n var getAffectedRegion = function getAffectedRegion(bbox, thresholdR) {\n var startX = Math.min(pos2GridIx(bbox.minX, thresholdR + activeRegion.minX), potentialArea.width);\n var startY = Math.min(pos2GridIx(bbox.minY, thresholdR + activeRegion.minY), potentialArea.height);\n var endX = Math.min(pos2GridIx(bbox.maxX, -thresholdR + activeRegion.minX), potentialArea.width);\n var endY = Math.min(pos2GridIx(bbox.maxY, -thresholdR + activeRegion.minY), potentialArea.height);\n return [startX, startY, endX, endY];\n };\n var addItemInfluence = function addItemInfluence(item, influenceFactor) {\n var bbox = item.getBBox();\n var _a = getAffectedRegion(bbox, options.nodeR1),\n startX = _a[0],\n startY = _a[1],\n endX = _a[2],\n endY = _a[3];\n // calculate item influence for each cell\n for (var y = startY; y < endY; y += 1) {\n for (var x = startX; x < endX; x += 1) {\n if (influenceFactor < 0 && potentialArea[x + y * potentialArea.width] <= 0) {\n continue;\n }\n var tempX = gridIx2Pos(x, activeRegion.minX);\n var tempY = gridIx2Pos(y, activeRegion.minY);\n var distanceSq = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"pointRectSquareDist\"])({\n x: tempX,\n y: tempY\n }, {\n x: bbox.minX,\n y: bbox.minY,\n width: bbox.width,\n height: bbox.height\n });\n if (distanceSq < Math.pow(options.nodeR1, 2)) {\n var dr = Math.sqrt(distanceSq) - options.nodeR1;\n potentialArea.cells[x + y * potentialArea.width] += influenceFactor * dr * dr;\n }\n }\n }\n };\n var addEdgeInfluence = function addEdgeInfluence(line, influenceFactor) {\n var bbox = line.getBBox();\n var _a = getAffectedRegion(bbox, options.edgeR1),\n startX = _a[0],\n startY = _a[1],\n endX = _a[2],\n endY = _a[3];\n // for every point in active part of potentialArea, calculate distance to nearest point on line and add influence\n for (var y = startY; y < endY; y += 1) {\n for (var x = startX; x < endX; x += 1) {\n if (influenceFactor < 0 && potentialArea.cells[x + y * potentialArea.width] <= 0) {\n continue;\n }\n var tempX = gridIx2Pos(x, activeRegion.minX);\n var tempY = gridIx2Pos(y, activeRegion.minY);\n var minDistanceSq = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"pointLineSquareDist\"])({\n x: tempX,\n y: tempY\n }, line);\n // only influence if less than r1\n if (minDistanceSq < Math.pow(options.edgeR1, 2)) {\n var mdr = Math.sqrt(minDistanceSq) - options.edgeR1;\n potentialArea.cells[x + y * potentialArea.width] += influenceFactor * mdr * mdr;\n }\n }\n }\n };\n if (options.nodeInfluenceFactor) {\n members.forEach(function (item) {\n addItemInfluence(item, options.nodeInfluenceFactor / nodeInfA);\n });\n }\n if (options.edgeInfluenceFactor) {\n edges.forEach(function (edge) {\n addEdgeInfluence(edge, options.edgeInfluenceFactor / edgeInfA);\n });\n }\n if (options.negativeNodeInfluenceFactor) {\n nonMembers.forEach(function (item) {\n addItemInfluence(item, options.negativeNodeInfluenceFactor / nodeInfA);\n });\n }\n}\nfunction rerouteLine(item, buffer, intersections, wrapNormal) {\n var bbox = item.getBBox();\n var topIntersect = intersections[0],\n leftIntersect = intersections[1],\n bottomIntersect = intersections[2],\n rightIntersect = intersections[3];\n var cornerPos = {\n topLeft: {\n x: bbox.minX - buffer,\n y: bbox.minY - buffer\n },\n topRight: {\n x: bbox.maxX + buffer,\n y: bbox.minY - buffer\n },\n bottomLeft: {\n x: bbox.minX - buffer,\n y: bbox.maxY + buffer\n },\n bottomRight: {\n x: bbox.maxX + buffer,\n y: bbox.maxY + buffer\n }\n };\n var totalArea = bbox.height * bbox.width;\n function calcHalfArea(intersect1, intersect2) {\n return bbox.width * ((intersect1.y - bbox.minY + (intersect2.y - bbox.minY)) * 0.5);\n }\n // 根据线和boundingbox相交的情况,确定control point的位置\n if (leftIntersect) {\n // 相交区域有三角形\n if (topIntersect) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight;\n if (bottomIntersect) return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight;\n // 相交区域分成上下两个梯形,比较面积\n var topArea = calcHalfArea(leftIntersect, rightIntersect);\n if (topArea < totalArea * 0.5) {\n if (leftIntersect.y > rightIntersect.y) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight;\n return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft;\n }\n if (leftIntersect.y < rightIntersect.y) return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight;\n return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft;\n }\n if (rightIntersect) {\n if (topIntersect) return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft;\n if (bottomIntersect) return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft;\n }\n // 相交区域分成左右两个梯形\n var leftArea = calcHalfArea(topIntersect, bottomIntersect);\n if (leftArea < totalArea * 0.5) {\n if (topIntersect.x > bottomIntersect.x) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight;\n return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight;\n }\n if (topIntersect.x < bottomIntersect.x) return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft;\n return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft;\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/hull/bubbleset.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js ***! - \***********************************************************************/ -/*! exports provided: gl */ +/***/ "./node_modules/@antv/g6-core/es/element/hull/convexHull.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/hull/convexHull.js ***! + \******************************************************************/ +/*! exports provided: cross, genConvexHull */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gl\", function() { return gl; });\n/**\n * WebGL 枚举值\n * @see http://www.khronos.org/registry/webgl/specs/latest/1.0/#5.14\n * 使用 babel 插件对常量进行内联,以减少最终打包产物大小\n * @see https://github.com/uber/deck.gl/blob/7.1-release/dev-docs/roadmaps/dist-size-roadmap.md#inline-gl-constants\n * 为了支持 WebGPU,新增 TextureUsage\n * @see https://gpuweb.github.io/gpuweb/#gputextureusage\n */\nvar gl;\n\n(function (gl) {\n gl[gl[\"DEPTH_BUFFER_BIT\"] = 256] = \"DEPTH_BUFFER_BIT\";\n gl[gl[\"STENCIL_BUFFER_BIT\"] = 1024] = \"STENCIL_BUFFER_BIT\";\n gl[gl[\"COLOR_BUFFER_BIT\"] = 16384] = \"COLOR_BUFFER_BIT\";\n gl[gl[\"POINTS\"] = 0] = \"POINTS\";\n gl[gl[\"LINES\"] = 1] = \"LINES\";\n gl[gl[\"LINE_LOOP\"] = 2] = \"LINE_LOOP\";\n gl[gl[\"LINE_STRIP\"] = 3] = \"LINE_STRIP\";\n gl[gl[\"TRIANGLES\"] = 4] = \"TRIANGLES\";\n gl[gl[\"TRIANGLE_STRIP\"] = 5] = \"TRIANGLE_STRIP\";\n gl[gl[\"TRIANGLE_FAN\"] = 6] = \"TRIANGLE_FAN\";\n gl[gl[\"ZERO\"] = 0] = \"ZERO\";\n gl[gl[\"ONE\"] = 1] = \"ONE\";\n gl[gl[\"SRC_COLOR\"] = 768] = \"SRC_COLOR\";\n gl[gl[\"ONE_MINUS_SRC_COLOR\"] = 769] = \"ONE_MINUS_SRC_COLOR\";\n gl[gl[\"SRC_ALPHA\"] = 770] = \"SRC_ALPHA\";\n gl[gl[\"ONE_MINUS_SRC_ALPHA\"] = 771] = \"ONE_MINUS_SRC_ALPHA\";\n gl[gl[\"DST_ALPHA\"] = 772] = \"DST_ALPHA\";\n gl[gl[\"ONE_MINUS_DST_ALPHA\"] = 773] = \"ONE_MINUS_DST_ALPHA\";\n gl[gl[\"DST_COLOR\"] = 774] = \"DST_COLOR\";\n gl[gl[\"ONE_MINUS_DST_COLOR\"] = 775] = \"ONE_MINUS_DST_COLOR\";\n gl[gl[\"SRC_ALPHA_SATURATE\"] = 776] = \"SRC_ALPHA_SATURATE\";\n gl[gl[\"FUNC_ADD\"] = 32774] = \"FUNC_ADD\";\n gl[gl[\"BLEND_EQUATION\"] = 32777] = \"BLEND_EQUATION\";\n gl[gl[\"BLEND_EQUATION_RGB\"] = 32777] = \"BLEND_EQUATION_RGB\";\n gl[gl[\"BLEND_EQUATION_ALPHA\"] = 34877] = \"BLEND_EQUATION_ALPHA\";\n gl[gl[\"FUNC_SUBTRACT\"] = 32778] = \"FUNC_SUBTRACT\";\n gl[gl[\"FUNC_REVERSE_SUBTRACT\"] = 32779] = \"FUNC_REVERSE_SUBTRACT\";\n gl[gl[\"MAX_EXT\"] = 32776] = \"MAX_EXT\";\n gl[gl[\"MIN_EXT\"] = 32775] = \"MIN_EXT\";\n gl[gl[\"BLEND_DST_RGB\"] = 32968] = \"BLEND_DST_RGB\";\n gl[gl[\"BLEND_SRC_RGB\"] = 32969] = \"BLEND_SRC_RGB\";\n gl[gl[\"BLEND_DST_ALPHA\"] = 32970] = \"BLEND_DST_ALPHA\";\n gl[gl[\"BLEND_SRC_ALPHA\"] = 32971] = \"BLEND_SRC_ALPHA\";\n gl[gl[\"CONSTANT_COLOR\"] = 32769] = \"CONSTANT_COLOR\";\n gl[gl[\"ONE_MINUS_CONSTANT_COLOR\"] = 32770] = \"ONE_MINUS_CONSTANT_COLOR\";\n gl[gl[\"CONSTANT_ALPHA\"] = 32771] = \"CONSTANT_ALPHA\";\n gl[gl[\"ONE_MINUS_CONSTANT_ALPHA\"] = 32772] = \"ONE_MINUS_CONSTANT_ALPHA\";\n gl[gl[\"BLEND_COLOR\"] = 32773] = \"BLEND_COLOR\";\n gl[gl[\"ARRAY_BUFFER\"] = 34962] = \"ARRAY_BUFFER\";\n gl[gl[\"ELEMENT_ARRAY_BUFFER\"] = 34963] = \"ELEMENT_ARRAY_BUFFER\";\n gl[gl[\"ARRAY_BUFFER_BINDING\"] = 34964] = \"ARRAY_BUFFER_BINDING\";\n gl[gl[\"ELEMENT_ARRAY_BUFFER_BINDING\"] = 34965] = \"ELEMENT_ARRAY_BUFFER_BINDING\";\n gl[gl[\"STREAM_DRAW\"] = 35040] = \"STREAM_DRAW\";\n gl[gl[\"STATIC_DRAW\"] = 35044] = \"STATIC_DRAW\";\n gl[gl[\"DYNAMIC_DRAW\"] = 35048] = \"DYNAMIC_DRAW\";\n gl[gl[\"BUFFER_SIZE\"] = 34660] = \"BUFFER_SIZE\";\n gl[gl[\"BUFFER_USAGE\"] = 34661] = \"BUFFER_USAGE\";\n gl[gl[\"CURRENT_VERTEX_ATTRIB\"] = 34342] = \"CURRENT_VERTEX_ATTRIB\";\n gl[gl[\"FRONT\"] = 1028] = \"FRONT\";\n gl[gl[\"BACK\"] = 1029] = \"BACK\";\n gl[gl[\"FRONT_AND_BACK\"] = 1032] = \"FRONT_AND_BACK\";\n gl[gl[\"CULL_FACE\"] = 2884] = \"CULL_FACE\";\n gl[gl[\"BLEND\"] = 3042] = \"BLEND\";\n gl[gl[\"DITHER\"] = 3024] = \"DITHER\";\n gl[gl[\"STENCIL_TEST\"] = 2960] = \"STENCIL_TEST\";\n gl[gl[\"DEPTH_TEST\"] = 2929] = \"DEPTH_TEST\";\n gl[gl[\"SCISSOR_TEST\"] = 3089] = \"SCISSOR_TEST\";\n gl[gl[\"POLYGON_OFFSET_FILL\"] = 32823] = \"POLYGON_OFFSET_FILL\";\n gl[gl[\"SAMPLE_ALPHA_TO_COVERAGE\"] = 32926] = \"SAMPLE_ALPHA_TO_COVERAGE\";\n gl[gl[\"SAMPLE_COVERAGE\"] = 32928] = \"SAMPLE_COVERAGE\";\n gl[gl[\"NO_ERROR\"] = 0] = \"NO_ERROR\";\n gl[gl[\"INVALID_ENUM\"] = 1280] = \"INVALID_ENUM\";\n gl[gl[\"INVALID_VALUE\"] = 1281] = \"INVALID_VALUE\";\n gl[gl[\"INVALID_OPERATION\"] = 1282] = \"INVALID_OPERATION\";\n gl[gl[\"OUT_OF_MEMORY\"] = 1285] = \"OUT_OF_MEMORY\";\n gl[gl[\"CW\"] = 2304] = \"CW\";\n gl[gl[\"CCW\"] = 2305] = \"CCW\";\n gl[gl[\"LINE_WIDTH\"] = 2849] = \"LINE_WIDTH\";\n gl[gl[\"ALIASED_POINT_SIZE_RANGE\"] = 33901] = \"ALIASED_POINT_SIZE_RANGE\";\n gl[gl[\"ALIASED_LINE_WIDTH_RANGE\"] = 33902] = \"ALIASED_LINE_WIDTH_RANGE\";\n gl[gl[\"CULL_FACE_MODE\"] = 2885] = \"CULL_FACE_MODE\";\n gl[gl[\"FRONT_FACE\"] = 2886] = \"FRONT_FACE\";\n gl[gl[\"DEPTH_RANGE\"] = 2928] = \"DEPTH_RANGE\";\n gl[gl[\"DEPTH_WRITEMASK\"] = 2930] = \"DEPTH_WRITEMASK\";\n gl[gl[\"DEPTH_CLEAR_VALUE\"] = 2931] = \"DEPTH_CLEAR_VALUE\";\n gl[gl[\"DEPTH_FUNC\"] = 2932] = \"DEPTH_FUNC\";\n gl[gl[\"STENCIL_CLEAR_VALUE\"] = 2961] = \"STENCIL_CLEAR_VALUE\";\n gl[gl[\"STENCIL_FUNC\"] = 2962] = \"STENCIL_FUNC\";\n gl[gl[\"STENCIL_FAIL\"] = 2964] = \"STENCIL_FAIL\";\n gl[gl[\"STENCIL_PASS_DEPTH_FAIL\"] = 2965] = \"STENCIL_PASS_DEPTH_FAIL\";\n gl[gl[\"STENCIL_PASS_DEPTH_PASS\"] = 2966] = \"STENCIL_PASS_DEPTH_PASS\";\n gl[gl[\"STENCIL_REF\"] = 2967] = \"STENCIL_REF\";\n gl[gl[\"STENCIL_VALUE_MASK\"] = 2963] = \"STENCIL_VALUE_MASK\";\n gl[gl[\"STENCIL_WRITEMASK\"] = 2968] = \"STENCIL_WRITEMASK\";\n gl[gl[\"STENCIL_BACK_FUNC\"] = 34816] = \"STENCIL_BACK_FUNC\";\n gl[gl[\"STENCIL_BACK_FAIL\"] = 34817] = \"STENCIL_BACK_FAIL\";\n gl[gl[\"STENCIL_BACK_PASS_DEPTH_FAIL\"] = 34818] = \"STENCIL_BACK_PASS_DEPTH_FAIL\";\n gl[gl[\"STENCIL_BACK_PASS_DEPTH_PASS\"] = 34819] = \"STENCIL_BACK_PASS_DEPTH_PASS\";\n gl[gl[\"STENCIL_BACK_REF\"] = 36003] = \"STENCIL_BACK_REF\";\n gl[gl[\"STENCIL_BACK_VALUE_MASK\"] = 36004] = \"STENCIL_BACK_VALUE_MASK\";\n gl[gl[\"STENCIL_BACK_WRITEMASK\"] = 36005] = \"STENCIL_BACK_WRITEMASK\";\n gl[gl[\"VIEWPORT\"] = 2978] = \"VIEWPORT\";\n gl[gl[\"SCISSOR_BOX\"] = 3088] = \"SCISSOR_BOX\";\n gl[gl[\"COLOR_CLEAR_VALUE\"] = 3106] = \"COLOR_CLEAR_VALUE\";\n gl[gl[\"COLOR_WRITEMASK\"] = 3107] = \"COLOR_WRITEMASK\";\n gl[gl[\"UNPACK_ALIGNMENT\"] = 3317] = \"UNPACK_ALIGNMENT\";\n gl[gl[\"PACK_ALIGNMENT\"] = 3333] = \"PACK_ALIGNMENT\";\n gl[gl[\"MAX_TEXTURE_SIZE\"] = 3379] = \"MAX_TEXTURE_SIZE\";\n gl[gl[\"MAX_VIEWPORT_DIMS\"] = 3386] = \"MAX_VIEWPORT_DIMS\";\n gl[gl[\"SUBPIXEL_BITS\"] = 3408] = \"SUBPIXEL_BITS\";\n gl[gl[\"RED_BITS\"] = 3410] = \"RED_BITS\";\n gl[gl[\"GREEN_BITS\"] = 3411] = \"GREEN_BITS\";\n gl[gl[\"BLUE_BITS\"] = 3412] = \"BLUE_BITS\";\n gl[gl[\"ALPHA_BITS\"] = 3413] = \"ALPHA_BITS\";\n gl[gl[\"DEPTH_BITS\"] = 3414] = \"DEPTH_BITS\";\n gl[gl[\"STENCIL_BITS\"] = 3415] = \"STENCIL_BITS\";\n gl[gl[\"POLYGON_OFFSET_UNITS\"] = 10752] = \"POLYGON_OFFSET_UNITS\";\n gl[gl[\"POLYGON_OFFSET_FACTOR\"] = 32824] = \"POLYGON_OFFSET_FACTOR\";\n gl[gl[\"TEXTURE_BINDING_2D\"] = 32873] = \"TEXTURE_BINDING_2D\";\n gl[gl[\"SAMPLE_BUFFERS\"] = 32936] = \"SAMPLE_BUFFERS\";\n gl[gl[\"SAMPLES\"] = 32937] = \"SAMPLES\";\n gl[gl[\"SAMPLE_COVERAGE_VALUE\"] = 32938] = \"SAMPLE_COVERAGE_VALUE\";\n gl[gl[\"SAMPLE_COVERAGE_INVERT\"] = 32939] = \"SAMPLE_COVERAGE_INVERT\";\n gl[gl[\"COMPRESSED_TEXTURE_FORMATS\"] = 34467] = \"COMPRESSED_TEXTURE_FORMATS\";\n gl[gl[\"DONT_CARE\"] = 4352] = \"DONT_CARE\";\n gl[gl[\"FASTEST\"] = 4353] = \"FASTEST\";\n gl[gl[\"NICEST\"] = 4354] = \"NICEST\";\n gl[gl[\"GENERATE_MIPMAP_HINT\"] = 33170] = \"GENERATE_MIPMAP_HINT\";\n gl[gl[\"BYTE\"] = 5120] = \"BYTE\";\n gl[gl[\"UNSIGNED_BYTE\"] = 5121] = \"UNSIGNED_BYTE\";\n gl[gl[\"SHORT\"] = 5122] = \"SHORT\";\n gl[gl[\"UNSIGNED_SHORT\"] = 5123] = \"UNSIGNED_SHORT\";\n gl[gl[\"INT\"] = 5124] = \"INT\";\n gl[gl[\"UNSIGNED_INT\"] = 5125] = \"UNSIGNED_INT\";\n gl[gl[\"FLOAT\"] = 5126] = \"FLOAT\";\n gl[gl[\"DEPTH_COMPONENT\"] = 6402] = \"DEPTH_COMPONENT\";\n gl[gl[\"ALPHA\"] = 6406] = \"ALPHA\";\n gl[gl[\"RGB\"] = 6407] = \"RGB\";\n gl[gl[\"RGBA\"] = 6408] = \"RGBA\";\n gl[gl[\"LUMINANCE\"] = 6409] = \"LUMINANCE\";\n gl[gl[\"LUMINANCE_ALPHA\"] = 6410] = \"LUMINANCE_ALPHA\";\n gl[gl[\"UNSIGNED_SHORT_4_4_4_4\"] = 32819] = \"UNSIGNED_SHORT_4_4_4_4\";\n gl[gl[\"UNSIGNED_SHORT_5_5_5_1\"] = 32820] = \"UNSIGNED_SHORT_5_5_5_1\";\n gl[gl[\"UNSIGNED_SHORT_5_6_5\"] = 33635] = \"UNSIGNED_SHORT_5_6_5\";\n gl[gl[\"FRAGMENT_SHADER\"] = 35632] = \"FRAGMENT_SHADER\";\n gl[gl[\"VERTEX_SHADER\"] = 35633] = \"VERTEX_SHADER\";\n gl[gl[\"MAX_VERTEX_ATTRIBS\"] = 34921] = \"MAX_VERTEX_ATTRIBS\";\n gl[gl[\"MAX_VERTEX_UNIFORM_VECTORS\"] = 36347] = \"MAX_VERTEX_UNIFORM_VECTORS\";\n gl[gl[\"MAX_VARYING_VECTORS\"] = 36348] = \"MAX_VARYING_VECTORS\";\n gl[gl[\"MAX_COMBINED_TEXTURE_IMAGE_UNITS\"] = 35661] = \"MAX_COMBINED_TEXTURE_IMAGE_UNITS\";\n gl[gl[\"MAX_VERTEX_TEXTURE_IMAGE_UNITS\"] = 35660] = \"MAX_VERTEX_TEXTURE_IMAGE_UNITS\";\n gl[gl[\"MAX_TEXTURE_IMAGE_UNITS\"] = 34930] = \"MAX_TEXTURE_IMAGE_UNITS\";\n gl[gl[\"MAX_FRAGMENT_UNIFORM_VECTORS\"] = 36349] = \"MAX_FRAGMENT_UNIFORM_VECTORS\";\n gl[gl[\"SHADER_TYPE\"] = 35663] = \"SHADER_TYPE\";\n gl[gl[\"DELETE_STATUS\"] = 35712] = \"DELETE_STATUS\";\n gl[gl[\"LINK_STATUS\"] = 35714] = \"LINK_STATUS\";\n gl[gl[\"VALIDATE_STATUS\"] = 35715] = \"VALIDATE_STATUS\";\n gl[gl[\"ATTACHED_SHADERS\"] = 35717] = \"ATTACHED_SHADERS\";\n gl[gl[\"ACTIVE_UNIFORMS\"] = 35718] = \"ACTIVE_UNIFORMS\";\n gl[gl[\"ACTIVE_ATTRIBUTES\"] = 35721] = \"ACTIVE_ATTRIBUTES\";\n gl[gl[\"SHADING_LANGUAGE_VERSION\"] = 35724] = \"SHADING_LANGUAGE_VERSION\";\n gl[gl[\"CURRENT_PROGRAM\"] = 35725] = \"CURRENT_PROGRAM\";\n gl[gl[\"NEVER\"] = 512] = \"NEVER\";\n gl[gl[\"LESS\"] = 513] = \"LESS\";\n gl[gl[\"EQUAL\"] = 514] = \"EQUAL\";\n gl[gl[\"LEQUAL\"] = 515] = \"LEQUAL\";\n gl[gl[\"GREATER\"] = 516] = \"GREATER\";\n gl[gl[\"NOTEQUAL\"] = 517] = \"NOTEQUAL\";\n gl[gl[\"GEQUAL\"] = 518] = \"GEQUAL\";\n gl[gl[\"ALWAYS\"] = 519] = \"ALWAYS\";\n gl[gl[\"KEEP\"] = 7680] = \"KEEP\";\n gl[gl[\"REPLACE\"] = 7681] = \"REPLACE\";\n gl[gl[\"INCR\"] = 7682] = \"INCR\";\n gl[gl[\"DECR\"] = 7683] = \"DECR\";\n gl[gl[\"INVERT\"] = 5386] = \"INVERT\";\n gl[gl[\"INCR_WRAP\"] = 34055] = \"INCR_WRAP\";\n gl[gl[\"DECR_WRAP\"] = 34056] = \"DECR_WRAP\";\n gl[gl[\"VENDOR\"] = 7936] = \"VENDOR\";\n gl[gl[\"RENDERER\"] = 7937] = \"RENDERER\";\n gl[gl[\"VERSION\"] = 7938] = \"VERSION\";\n gl[gl[\"NEAREST\"] = 9728] = \"NEAREST\";\n gl[gl[\"LINEAR\"] = 9729] = \"LINEAR\";\n gl[gl[\"NEAREST_MIPMAP_NEAREST\"] = 9984] = \"NEAREST_MIPMAP_NEAREST\";\n gl[gl[\"LINEAR_MIPMAP_NEAREST\"] = 9985] = \"LINEAR_MIPMAP_NEAREST\";\n gl[gl[\"NEAREST_MIPMAP_LINEAR\"] = 9986] = \"NEAREST_MIPMAP_LINEAR\";\n gl[gl[\"LINEAR_MIPMAP_LINEAR\"] = 9987] = \"LINEAR_MIPMAP_LINEAR\";\n gl[gl[\"TEXTURE_MAG_FILTER\"] = 10240] = \"TEXTURE_MAG_FILTER\";\n gl[gl[\"TEXTURE_MIN_FILTER\"] = 10241] = \"TEXTURE_MIN_FILTER\";\n gl[gl[\"TEXTURE_WRAP_S\"] = 10242] = \"TEXTURE_WRAP_S\";\n gl[gl[\"TEXTURE_WRAP_T\"] = 10243] = \"TEXTURE_WRAP_T\";\n gl[gl[\"TEXTURE_2D\"] = 3553] = \"TEXTURE_2D\";\n gl[gl[\"TEXTURE\"] = 5890] = \"TEXTURE\";\n gl[gl[\"TEXTURE_CUBE_MAP\"] = 34067] = \"TEXTURE_CUBE_MAP\";\n gl[gl[\"TEXTURE_BINDING_CUBE_MAP\"] = 34068] = \"TEXTURE_BINDING_CUBE_MAP\";\n gl[gl[\"TEXTURE_CUBE_MAP_POSITIVE_X\"] = 34069] = \"TEXTURE_CUBE_MAP_POSITIVE_X\";\n gl[gl[\"TEXTURE_CUBE_MAP_NEGATIVE_X\"] = 34070] = \"TEXTURE_CUBE_MAP_NEGATIVE_X\";\n gl[gl[\"TEXTURE_CUBE_MAP_POSITIVE_Y\"] = 34071] = \"TEXTURE_CUBE_MAP_POSITIVE_Y\";\n gl[gl[\"TEXTURE_CUBE_MAP_NEGATIVE_Y\"] = 34072] = \"TEXTURE_CUBE_MAP_NEGATIVE_Y\";\n gl[gl[\"TEXTURE_CUBE_MAP_POSITIVE_Z\"] = 34073] = \"TEXTURE_CUBE_MAP_POSITIVE_Z\";\n gl[gl[\"TEXTURE_CUBE_MAP_NEGATIVE_Z\"] = 34074] = \"TEXTURE_CUBE_MAP_NEGATIVE_Z\";\n gl[gl[\"MAX_CUBE_MAP_TEXTURE_SIZE\"] = 34076] = \"MAX_CUBE_MAP_TEXTURE_SIZE\";\n gl[gl[\"TEXTURE0\"] = 33984] = \"TEXTURE0\";\n gl[gl[\"TEXTURE1\"] = 33985] = \"TEXTURE1\";\n gl[gl[\"TEXTURE2\"] = 33986] = \"TEXTURE2\";\n gl[gl[\"TEXTURE3\"] = 33987] = \"TEXTURE3\";\n gl[gl[\"TEXTURE4\"] = 33988] = \"TEXTURE4\";\n gl[gl[\"TEXTURE5\"] = 33989] = \"TEXTURE5\";\n gl[gl[\"TEXTURE6\"] = 33990] = \"TEXTURE6\";\n gl[gl[\"TEXTURE7\"] = 33991] = \"TEXTURE7\";\n gl[gl[\"TEXTURE8\"] = 33992] = \"TEXTURE8\";\n gl[gl[\"TEXTURE9\"] = 33993] = \"TEXTURE9\";\n gl[gl[\"TEXTURE10\"] = 33994] = \"TEXTURE10\";\n gl[gl[\"TEXTURE11\"] = 33995] = \"TEXTURE11\";\n gl[gl[\"TEXTURE12\"] = 33996] = \"TEXTURE12\";\n gl[gl[\"TEXTURE13\"] = 33997] = \"TEXTURE13\";\n gl[gl[\"TEXTURE14\"] = 33998] = \"TEXTURE14\";\n gl[gl[\"TEXTURE15\"] = 33999] = \"TEXTURE15\";\n gl[gl[\"TEXTURE16\"] = 34000] = \"TEXTURE16\";\n gl[gl[\"TEXTURE17\"] = 34001] = \"TEXTURE17\";\n gl[gl[\"TEXTURE18\"] = 34002] = \"TEXTURE18\";\n gl[gl[\"TEXTURE19\"] = 34003] = \"TEXTURE19\";\n gl[gl[\"TEXTURE20\"] = 34004] = \"TEXTURE20\";\n gl[gl[\"TEXTURE21\"] = 34005] = \"TEXTURE21\";\n gl[gl[\"TEXTURE22\"] = 34006] = \"TEXTURE22\";\n gl[gl[\"TEXTURE23\"] = 34007] = \"TEXTURE23\";\n gl[gl[\"TEXTURE24\"] = 34008] = \"TEXTURE24\";\n gl[gl[\"TEXTURE25\"] = 34009] = \"TEXTURE25\";\n gl[gl[\"TEXTURE26\"] = 34010] = \"TEXTURE26\";\n gl[gl[\"TEXTURE27\"] = 34011] = \"TEXTURE27\";\n gl[gl[\"TEXTURE28\"] = 34012] = \"TEXTURE28\";\n gl[gl[\"TEXTURE29\"] = 34013] = \"TEXTURE29\";\n gl[gl[\"TEXTURE30\"] = 34014] = \"TEXTURE30\";\n gl[gl[\"TEXTURE31\"] = 34015] = \"TEXTURE31\";\n gl[gl[\"ACTIVE_TEXTURE\"] = 34016] = \"ACTIVE_TEXTURE\";\n gl[gl[\"REPEAT\"] = 10497] = \"REPEAT\";\n gl[gl[\"CLAMP_TO_EDGE\"] = 33071] = \"CLAMP_TO_EDGE\";\n gl[gl[\"MIRRORED_REPEAT\"] = 33648] = \"MIRRORED_REPEAT\";\n gl[gl[\"FLOAT_VEC2\"] = 35664] = \"FLOAT_VEC2\";\n gl[gl[\"FLOAT_VEC3\"] = 35665] = \"FLOAT_VEC3\";\n gl[gl[\"FLOAT_VEC4\"] = 35666] = \"FLOAT_VEC4\";\n gl[gl[\"INT_VEC2\"] = 35667] = \"INT_VEC2\";\n gl[gl[\"INT_VEC3\"] = 35668] = \"INT_VEC3\";\n gl[gl[\"INT_VEC4\"] = 35669] = \"INT_VEC4\";\n gl[gl[\"BOOL\"] = 35670] = \"BOOL\";\n gl[gl[\"BOOL_VEC2\"] = 35671] = \"BOOL_VEC2\";\n gl[gl[\"BOOL_VEC3\"] = 35672] = \"BOOL_VEC3\";\n gl[gl[\"BOOL_VEC4\"] = 35673] = \"BOOL_VEC4\";\n gl[gl[\"FLOAT_MAT2\"] = 35674] = \"FLOAT_MAT2\";\n gl[gl[\"FLOAT_MAT3\"] = 35675] = \"FLOAT_MAT3\";\n gl[gl[\"FLOAT_MAT4\"] = 35676] = \"FLOAT_MAT4\";\n gl[gl[\"SAMPLER_2D\"] = 35678] = \"SAMPLER_2D\";\n gl[gl[\"SAMPLER_CUBE\"] = 35680] = \"SAMPLER_CUBE\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_ENABLED\"] = 34338] = \"VERTEX_ATTRIB_ARRAY_ENABLED\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_SIZE\"] = 34339] = \"VERTEX_ATTRIB_ARRAY_SIZE\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_STRIDE\"] = 34340] = \"VERTEX_ATTRIB_ARRAY_STRIDE\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_TYPE\"] = 34341] = \"VERTEX_ATTRIB_ARRAY_TYPE\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_NORMALIZED\"] = 34922] = \"VERTEX_ATTRIB_ARRAY_NORMALIZED\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_POINTER\"] = 34373] = \"VERTEX_ATTRIB_ARRAY_POINTER\";\n gl[gl[\"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\"] = 34975] = \"VERTEX_ATTRIB_ARRAY_BUFFER_BINDING\";\n gl[gl[\"COMPILE_STATUS\"] = 35713] = \"COMPILE_STATUS\";\n gl[gl[\"LOW_FLOAT\"] = 36336] = \"LOW_FLOAT\";\n gl[gl[\"MEDIUM_FLOAT\"] = 36337] = \"MEDIUM_FLOAT\";\n gl[gl[\"HIGH_FLOAT\"] = 36338] = \"HIGH_FLOAT\";\n gl[gl[\"LOW_INT\"] = 36339] = \"LOW_INT\";\n gl[gl[\"MEDIUM_INT\"] = 36340] = \"MEDIUM_INT\";\n gl[gl[\"HIGH_INT\"] = 36341] = \"HIGH_INT\";\n gl[gl[\"FRAMEBUFFER\"] = 36160] = \"FRAMEBUFFER\";\n gl[gl[\"RENDERBUFFER\"] = 36161] = \"RENDERBUFFER\";\n gl[gl[\"RGBA4\"] = 32854] = \"RGBA4\";\n gl[gl[\"RGB5_A1\"] = 32855] = \"RGB5_A1\";\n gl[gl[\"RGB565\"] = 36194] = \"RGB565\";\n gl[gl[\"DEPTH_COMPONENT16\"] = 33189] = \"DEPTH_COMPONENT16\";\n gl[gl[\"STENCIL_INDEX\"] = 6401] = \"STENCIL_INDEX\";\n gl[gl[\"STENCIL_INDEX8\"] = 36168] = \"STENCIL_INDEX8\";\n gl[gl[\"DEPTH_STENCIL\"] = 34041] = \"DEPTH_STENCIL\";\n gl[gl[\"RENDERBUFFER_WIDTH\"] = 36162] = \"RENDERBUFFER_WIDTH\";\n gl[gl[\"RENDERBUFFER_HEIGHT\"] = 36163] = \"RENDERBUFFER_HEIGHT\";\n gl[gl[\"RENDERBUFFER_INTERNAL_FORMAT\"] = 36164] = \"RENDERBUFFER_INTERNAL_FORMAT\";\n gl[gl[\"RENDERBUFFER_RED_SIZE\"] = 36176] = \"RENDERBUFFER_RED_SIZE\";\n gl[gl[\"RENDERBUFFER_GREEN_SIZE\"] = 36177] = \"RENDERBUFFER_GREEN_SIZE\";\n gl[gl[\"RENDERBUFFER_BLUE_SIZE\"] = 36178] = \"RENDERBUFFER_BLUE_SIZE\";\n gl[gl[\"RENDERBUFFER_ALPHA_SIZE\"] = 36179] = \"RENDERBUFFER_ALPHA_SIZE\";\n gl[gl[\"RENDERBUFFER_DEPTH_SIZE\"] = 36180] = \"RENDERBUFFER_DEPTH_SIZE\";\n gl[gl[\"RENDERBUFFER_STENCIL_SIZE\"] = 36181] = \"RENDERBUFFER_STENCIL_SIZE\";\n gl[gl[\"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\"] = 36048] = \"FRAMEBUFFER_ATTACHMENT_OBJECT_TYPE\";\n gl[gl[\"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\"] = 36049] = \"FRAMEBUFFER_ATTACHMENT_OBJECT_NAME\";\n gl[gl[\"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\"] = 36050] = \"FRAMEBUFFER_ATTACHMENT_TEXTURE_LEVEL\";\n gl[gl[\"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\"] = 36051] = \"FRAMEBUFFER_ATTACHMENT_TEXTURE_CUBE_MAP_FACE\";\n gl[gl[\"COLOR_ATTACHMENT0\"] = 36064] = \"COLOR_ATTACHMENT0\";\n gl[gl[\"DEPTH_ATTACHMENT\"] = 36096] = \"DEPTH_ATTACHMENT\";\n gl[gl[\"STENCIL_ATTACHMENT\"] = 36128] = \"STENCIL_ATTACHMENT\";\n gl[gl[\"DEPTH_STENCIL_ATTACHMENT\"] = 33306] = \"DEPTH_STENCIL_ATTACHMENT\";\n gl[gl[\"NONE\"] = 0] = \"NONE\";\n gl[gl[\"FRAMEBUFFER_COMPLETE\"] = 36053] = \"FRAMEBUFFER_COMPLETE\";\n gl[gl[\"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\"] = 36054] = \"FRAMEBUFFER_INCOMPLETE_ATTACHMENT\";\n gl[gl[\"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\"] = 36055] = \"FRAMEBUFFER_INCOMPLETE_MISSING_ATTACHMENT\";\n gl[gl[\"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\"] = 36057] = \"FRAMEBUFFER_INCOMPLETE_DIMENSIONS\";\n gl[gl[\"FRAMEBUFFER_UNSUPPORTED\"] = 36061] = \"FRAMEBUFFER_UNSUPPORTED\";\n gl[gl[\"FRAMEBUFFER_BINDING\"] = 36006] = \"FRAMEBUFFER_BINDING\";\n gl[gl[\"RENDERBUFFER_BINDING\"] = 36007] = \"RENDERBUFFER_BINDING\";\n gl[gl[\"MAX_RENDERBUFFER_SIZE\"] = 34024] = \"MAX_RENDERBUFFER_SIZE\";\n gl[gl[\"INVALID_FRAMEBUFFER_OPERATION\"] = 1286] = \"INVALID_FRAMEBUFFER_OPERATION\";\n gl[gl[\"UNPACK_FLIP_Y_WEBGL\"] = 37440] = \"UNPACK_FLIP_Y_WEBGL\";\n gl[gl[\"UNPACK_PREMULTIPLY_ALPHA_WEBGL\"] = 37441] = \"UNPACK_PREMULTIPLY_ALPHA_WEBGL\";\n gl[gl[\"CONTEXT_LOST_WEBGL\"] = 37442] = \"CONTEXT_LOST_WEBGL\";\n gl[gl[\"UNPACK_COLORSPACE_CONVERSION_WEBGL\"] = 37443] = \"UNPACK_COLORSPACE_CONVERSION_WEBGL\";\n gl[gl[\"BROWSER_DEFAULT_WEBGL\"] = 37444] = \"BROWSER_DEFAULT_WEBGL\";\n gl[gl[\"COPY_SRC\"] = 1] = \"COPY_SRC\";\n gl[gl[\"COPY_DST\"] = 2] = \"COPY_DST\";\n gl[gl[\"SAMPLED\"] = 4] = \"SAMPLED\";\n gl[gl[\"STORAGE\"] = 8] = \"STORAGE\";\n gl[gl[\"RENDER_ATTACHMENT\"] = 16] = \"RENDER_ATTACHMENT\";\n})(gl || (gl = {}));\n//# sourceMappingURL=gl.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"genConvexHull\", function() { return genConvexHull; });\n/**\n * Use cross product to judge the direction of the turn.\n * Returns a positive value, if OAB makes a clockwise turn,\n * negative for counter-clockwise turn, and zero if the points are collinear.\n */\nvar cross = function cross(a, b, o) {\n return (a.y - o.y) * (b.x - o.x) - (a.x - o.x) * (b.y - o.y);\n};\n/**\n * Generate a convex hull of given points. Andrew's monotone chain algorithm.\n * @param points An array of [x, y] representing the coordinates of points.\n * @return a list of vertices of the convex hull in counter-clockwise order,\n */\nvar genConvexHull = function genConvexHull(items) {\n var points = items.map(function (item) {\n return {\n x: item.getModel().x,\n y: item.getModel().y\n };\n });\n points.sort(function (a, b) {\n return a.x === b.x ? a.y - b.y : a.x - b.x;\n });\n // remove duplicate points\n var pointMap = {};\n for (var i = points.length - 1; i >= 0; i--) {\n var _a = points[i],\n x = _a.x,\n y = _a.y;\n if (pointMap[\"\".concat(x, \"-\").concat(y)]) points.splice(i, 1);\n pointMap[\"\".concat(x, \"-\").concat(y)] = true;\n }\n if (points.length === 1) {\n return points;\n }\n // build the lower hull\n var lower = [];\n for (var i = 0; i < points.length; i++) {\n while (lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], points[i]) <= 0) {\n lower.pop();\n }\n lower.push(points[i]);\n }\n // build the upper hull\n var upper = [];\n for (var i = points.length - 1; i >= 0; i--) {\n while (upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], points[i]) <= 0) {\n upper.pop();\n }\n upper.push(points[i]);\n }\n upper.pop();\n lower.pop();\n var strictHull = lower.concat(upper);\n return strictHull;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/hull/convexHull.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/index.js ***! - \**************************************************************************/ -/*! no static exports found */ +/***/ "./node_modules/@antv/g6-core/es/element/index.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/index.js ***! + \********************************************************/ +/*! exports provided: Arrow, Marker, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _gl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./gl */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"gl\", function() { return _gl__WEBPACK_IMPORTED_MODULE_0__[\"gl\"]; });\n\n/* harmony import */ var _IAttribute__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./IAttribute */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IAttribute.js\");\n/* harmony import */ var _IAttribute__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_IAttribute__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IAttribute__WEBPACK_IMPORTED_MODULE_1__) if([\"default\",\"gl\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IAttribute__WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _IBuffer__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./IBuffer */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IBuffer.js\");\n/* harmony import */ var _IBuffer__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_IBuffer__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IBuffer__WEBPACK_IMPORTED_MODULE_2__) if([\"default\",\"gl\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IBuffer__WEBPACK_IMPORTED_MODULE_2__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _IComputeModel__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./IComputeModel */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IComputeModel.js\");\n/* harmony import */ var _IComputeModel__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_IComputeModel__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IComputeModel__WEBPACK_IMPORTED_MODULE_3__) if([\"default\",\"gl\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IComputeModel__WEBPACK_IMPORTED_MODULE_3__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _IElements__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./IElements */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IElements.js\");\n/* harmony import */ var _IElements__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_IElements__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IElements__WEBPACK_IMPORTED_MODULE_4__) if([\"default\",\"gl\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IElements__WEBPACK_IMPORTED_MODULE_4__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _IFramebuffer__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./IFramebuffer */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IFramebuffer.js\");\n/* harmony import */ var _IFramebuffer__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_IFramebuffer__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IFramebuffer__WEBPACK_IMPORTED_MODULE_5__) if([\"default\",\"gl\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IFramebuffer__WEBPACK_IMPORTED_MODULE_5__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _IModel__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./IModel */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IModel.js\");\n/* harmony import */ var _IModel__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_IModel__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IModel__WEBPACK_IMPORTED_MODULE_6__) if([\"default\",\"gl\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IModel__WEBPACK_IMPORTED_MODULE_6__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _IMultiPassRenderer__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./IMultiPassRenderer */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IMultiPassRenderer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PassType\", function() { return _IMultiPassRenderer__WEBPACK_IMPORTED_MODULE_7__[\"PassType\"]; });\n\n/* harmony import */ var _IRenderbuffer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./IRenderbuffer */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IRenderbuffer.js\");\n/* harmony import */ var _IRenderbuffer__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_IRenderbuffer__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IRenderbuffer__WEBPACK_IMPORTED_MODULE_8__) if([\"default\",\"gl\",\"PassType\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IRenderbuffer__WEBPACK_IMPORTED_MODULE_8__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _IRendererService__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./IRendererService */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IRendererService.js\");\n/* harmony import */ var _IRendererService__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_IRendererService__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IRendererService__WEBPACK_IMPORTED_MODULE_9__) if([\"default\",\"gl\",\"PassType\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IRendererService__WEBPACK_IMPORTED_MODULE_9__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _ITexture2D__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ITexture2D */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/ITexture2D.js\");\n/* harmony import */ var _ITexture2D__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_ITexture2D__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _ITexture2D__WEBPACK_IMPORTED_MODULE_10__) if([\"default\",\"gl\",\"PassType\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _ITexture2D__WEBPACK_IMPORTED_MODULE_10__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _IUniform__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./IUniform */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/IUniform.js\");\n/* harmony import */ var _IUniform__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(_IUniform__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _IUniform__WEBPACK_IMPORTED_MODULE_11__) if([\"default\",\"gl\",\"PassType\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _IUniform__WEBPACK_IMPORTED_MODULE_11__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node */ \"./node_modules/@antv/g6-core/es/element/node.js\");\n/* harmony import */ var _edge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edge */ \"./node_modules/@antv/g6-core/es/element/edge.js\");\n/* harmony import */ var _combo__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./combo */ \"./node_modules/@antv/g6-core/es/element/combo.js\");\n/* harmony import */ var _combos__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./combos */ \"./node_modules/@antv/g6-core/es/element/combos/index.js\");\n/* harmony import */ var _nodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./nodes */ \"./node_modules/@antv/g6-core/es/element/nodes/index.js\");\n/* harmony import */ var _arrow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./arrow */ \"./node_modules/@antv/g6-core/es/element/arrow.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Arrow\", function() { return _arrow__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _marker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./marker */ \"./node_modules/@antv/g6-core/es/element/marker.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Marker\", function() { return _marker__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_shape__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/CopyPass.js": -/*!************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/CopyPass.js ***! - \************************************************************************************/ -/*! exports provided: CopyPass */ +/***/ "./node_modules/@antv/g6-core/es/element/marker.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/marker.js ***! + \*********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CopyPass\", function() { return CopyPass; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _gl__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../gl */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js\");\n/* harmony import */ var _RenderPass__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./RenderPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/RenderPass.js\");\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _class3, _temp;\n\n\n\n\n/* babel-plugin-inline-import '../../../services/shader-module/shaders/webgl.copy.frag.glsl' */\nvar copyFrag = \"varying vec2 v_UV;\\n\\nuniform sampler2D u_Texture;\\n\\nvoid main() {\\n gl_FragColor = vec4(texture2D(u_Texture, v_UV));\\n}\";\n\n/* babel-plugin-inline-import '../../../services/shader-module/shaders/webgl.copy.vert.glsl' */\nvar copyVert = \"attribute vec2 a_Position;\\n\\nvarying vec2 v_UV;\\n\\nvoid main() {\\n v_UV = 0.5 * (a_Position + 1.0);\\n gl_Position = vec4(a_Position, 0., 1.);\\n}\";\n\n/* babel-plugin-inline-import '../../../services/shader-module/shaders/webgpu.copy.frag.glsl' */\nvar copyFragWebGPU = \"layout(set = 0, binding = 0) uniform sampler u_TextureSampler;\\nlayout(set = 0, binding = 1) uniform texture2D u_Texture;\\n\\nlayout(location = 0) in vec2 v_UV;\\nlayout(location = 0) out vec4 outColor;\\n\\nvoid main() {\\n outColor = texture(sampler2D(u_Texture, u_TextureSampler), v_UV);\\n}\";\n\n/* babel-plugin-inline-import '../../../services/shader-module/shaders/webgpu.copy.vert.glsl' */\nvar copyVertWebGPU = \"layout(location = 0) in vec2 a_Position;\\nlayout(location = 0) out vec2 v_UV;\\n\\nvoid main() {\\n v_UV = 0.5 * (a_Position + 1.0);\\n gl_Position = vec4(a_Position, 0., 1.);\\n}\";\n\n\nvar CopyPass = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_7__[\"IDENTIFIER\"].RenderEngine), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_7__[\"IDENTIFIER\"].ResourcePool), _dec(_class = (_class2 = (_temp = _class3 = function CopyPass() {\n var _this = this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, CopyPass);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"engine\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"resourcePool\", _descriptor2, this);\n\n this.model = void 0;\n\n this.setup = function (fg, passNode, pass) {\n var renderPass = fg.getPass(_RenderPass__WEBPACK_IMPORTED_MODULE_9__[\"RenderPass\"].IDENTIFIER);\n\n if (renderPass) {\n var output = fg.createRenderTarget(passNode, 'render to screen', {\n width: 1,\n height: 1\n });\n pass.data = {\n input: passNode.read(renderPass.data.output),\n output: passNode.write(fg, output)\n };\n }\n };\n\n this.execute = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(fg, pass) {\n var _this$engine, createModel, createAttribute, createBuffer, model, resourceNode, framebuffer;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _this$engine = _this.engine, createModel = _this$engine.createModel, createAttribute = _this$engine.createAttribute, createBuffer = _this$engine.createBuffer;\n\n if (_this.model) {\n _context.next = 6;\n break;\n }\n\n _context.next = 4;\n return createModel({\n vs: _this.engine.supportWebGPU ? copyVertWebGPU : copyVert,\n fs: _this.engine.supportWebGPU ? copyFragWebGPU : copyFrag,\n attributes: {\n // rendering a fullscreen triangle instead of quad\n // @see https://www.saschawillems.de/blog/2016/08/13/vulkan-tutorial-on-rendering-a-fullscreen-quad-without-buffers/\n a_Position: createAttribute({\n buffer: createBuffer({\n data: [-4, -4, 4, -4, 0, 4],\n type: _gl__WEBPACK_IMPORTED_MODULE_8__[\"gl\"].FLOAT\n }),\n size: 2,\n arrayStride: 2 * 4,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 0,\n offset: 0,\n format: 'float2'\n }]\n })\n },\n uniforms: {\n // @ts-ignore\n u_Texture: null\n },\n depth: {\n enable: false\n },\n count: 3,\n blend: {\n // copy pass 需要混合\n // enable: this.getName() === 'copy',\n enable: true\n }\n });\n\n case 4:\n model = _context.sent;\n _this.model = model;\n\n case 6:\n // 实例化资源\n resourceNode = fg.getResourceNode(pass.data.input);\n framebuffer = _this.resourcePool.getOrCreateResource(resourceNode.resource);\n\n _this.engine.useFramebuffer(null, function () {\n _this.engine.clear({\n framebuffer: null,\n color: [0, 0, 0, 0],\n depth: 1,\n stencil: 0\n });\n\n _this.model.draw({\n uniforms: {\n u_Texture: framebuffer // u_ViewportSize: [width, height],\n\n }\n });\n });\n\n case 9:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x, _x2) {\n return _ref.apply(this, arguments);\n };\n }();\n\n this.tearDown = function () {\n _this.model = undefined;\n };\n}, _class3.IDENTIFIER = 'Copy Pass', _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_4___default()(_class2.prototype, \"engine\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_4___default()(_class2.prototype, \"resourcePool\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=CopyPass.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/CopyPass.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n collapse: function collapse(x, y, r) {\n 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]];\n },\n expand: function expand(x, y, r) {\n 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]];\n },\n upTriangle: function upTriangle(x, y, r) {\n var l1 = r * Math.cos(Math.PI / 6);\n var l2 = r * Math.sin(Math.PI / 6);\n return [['M', x - l1, y + l2], ['L', x + l1, y + l2], ['L', x, y - r], ['Z']];\n },\n downTriangle: function downTriangle(x, y, r) {\n var l1 = r * Math.cos(Math.PI / 6);\n var l2 = r * Math.sin(Math.PI / 6);\n return [['M', x - l1, y - l2], ['L', x + l1, y - l2], ['L', x, y + r], ['Z']];\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/marker.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/PixelPickingPass.js": -/*!********************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/PixelPickingPass.js ***! - \********************************************************************************************/ -/*! exports provided: PixelPickingPass */ +/***/ "./node_modules/@antv/g6-core/es/element/node.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/node.js ***! + \*******************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PixelPickingPass\", function() { return PixelPickingPass; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _utils_math__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../utils/math */ \"./node_modules/@antv/g-webgpu-core/es/utils/math.js\");\n/* harmony import */ var _RenderPass__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./RenderPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/RenderPass.js\");\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _class3, _temp;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\nvar PickingStage = {\n NONE: 0.0,\n ENCODE: 1.0,\n HIGHLIGHT: 2.0\n};\n/**\n * color-based picking\n * @see https://threejsfundamentals.org/threejs/lessons/threejs-picking.html\n */\n\nvar PixelPickingPass = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderEngine), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].ResourcePool), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderPassFactory), _dec5 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].MeshComponentManager), _dec(_class = (_class2 = (_temp = _class3 = /*#__PURE__*/function () {\n function PixelPickingPass() {\n var _this = this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, PixelPickingPass);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"engine\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"resourcePool\", _descriptor2, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"renderPassFactory\", _descriptor3, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"mesh\", _descriptor4, this);\n\n this.pickingFBO = void 0;\n this.views = void 0;\n this.highlightEnabled = true;\n this.highlightColor = [255, 0, 0, 255];\n this.alreadyInRendering = false;\n\n this.setup = function (fg, passNode, pass) {\n var output = fg.createRenderTarget(passNode, 'picking fbo', {\n width: 1,\n height: 1\n });\n pass.data = {\n output: passNode.write(fg, output)\n }; // 防止被 FrameGraph 剔除\n\n passNode.hasSideEffect = true;\n };\n\n this.execute = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(fg, pass, views) {\n var _iterator, _step, _loop;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _this.views = views;\n\n if (!_this.alreadyInRendering) {\n _context.next = 3;\n break;\n }\n\n return _context.abrupt(\"return\");\n\n case 3:\n _iterator = _createForOfIteratorHelper(views);\n\n try {\n _loop = function _loop() {\n var view = _step.value;\n\n var _view$getViewport = view.getViewport(),\n width = _view$getViewport.width,\n height = _view$getViewport.height; // throttled\n\n\n _this.alreadyInRendering = true; // 实例化资源\n\n var resourceNode = fg.getResourceNode(pass.data.output);\n _this.pickingFBO = _this.resourcePool.getOrCreateResource(resourceNode.resource); // TODO: only draw 1x1 quad, with offset camera\n\n _this.pickingFBO.resize({\n width: width,\n height: height\n });\n\n _this.engine.useFramebuffer(_this.pickingFBO, function () {\n _this.engine.clear({\n framebuffer: _this.pickingFBO,\n color: [0, 0, 0, 0],\n stencil: 0,\n depth: 1\n }); // 渲染\n\n\n var renderPass = _this.renderPassFactory(_RenderPass__WEBPACK_IMPORTED_MODULE_10__[\"RenderPass\"].IDENTIFIER); // 修改所有\n\n\n var meshes = [];\n var scene = view.getScene();\n\n var _iterator2 = _createForOfIteratorHelper(scene.getEntities()),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var meshEntity = _step2.value;\n\n var mesh = _this.mesh.getComponentByEntity(meshEntity);\n\n var material = mesh.material;\n material.setUniform('u_PickingStage', PickingStage.ENCODE);\n meshes.push(mesh);\n } // @ts-ignore\n\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n\n renderPass.renderView(view);\n meshes.forEach(function (mesh) {\n var material = mesh.material;\n material.setUniform('u_PickingStage', PickingStage.HIGHLIGHT);\n });\n _this.alreadyInRendering = false;\n });\n };\n\n for (_iterator.s(); !(_step = _iterator.n()).done;) {\n _loop();\n }\n } catch (err) {\n _iterator.e(err);\n } finally {\n _iterator.f();\n }\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n }();\n\n this.pick = function (_ref2, view) {\n var x = _ref2.x,\n y = _ref2.y;\n var _this$engine = _this.engine,\n readPixels = _this$engine.readPixels,\n useFramebuffer = _this$engine.useFramebuffer;\n\n var _view$getViewport2 = view.getViewport(),\n width = _view$getViewport2.width,\n height = _view$getViewport2.height;\n\n var xInDevicePixel = x * window.devicePixelRatio;\n var yInDevicePixel = y * window.devicePixelRatio; // const xInDevicePixel = x;\n // const yInDevicePixel = y;\n\n if (xInDevicePixel > width || xInDevicePixel < 0 || yInDevicePixel > height || yInDevicePixel < 0) {\n return;\n }\n\n var pickedColors;\n var pickedFeatureIdx;\n useFramebuffer(_this.pickingFBO, function () {\n // avoid realloc\n pickedColors = readPixels({\n x: Math.round(xInDevicePixel),\n // 视口坐标系原点在左上,而 WebGL 在左下,需要翻转 Y 轴\n y: Math.round(height - (y + 1) * window.devicePixelRatio),\n // y: Math.round(height - (y + 1)),\n width: 1,\n height: 1,\n data: new Uint8Array(1 * 1 * 4),\n framebuffer: _this.pickingFBO\n });\n\n if (pickedColors[0] !== 0 || pickedColors[1] !== 0 || pickedColors[2] !== 0) {\n pickedFeatureIdx = Object(_utils_math__WEBPACK_IMPORTED_MODULE_9__[\"decodePickingColor\"])(pickedColors);\n\n if (_this.highlightEnabled) {\n // 高亮\n _this.highlightPickedFeature(pickedColors, view);\n }\n }\n });\n return pickedFeatureIdx;\n };\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(PixelPickingPass, [{\n key: \"enableHighlight\",\n value: function enableHighlight(enabled) {\n this.highlightEnabled = enabled;\n }\n }, {\n key: \"setHighlightColor\",\n value: function setHighlightColor(color) {\n this.highlightColor = color;\n }\n }, {\n key: \"highlightPickedFeature\",\n\n /**\n * highlight 如果直接修改选中 feature 的 buffer,存在两个问题:\n * 1. 鼠标移走时无法恢复\n * 2. 无法实现高亮颜色与原始原色的 alpha 混合\n * 因此高亮还是放在 shader 中做比较好\n */\n value: function highlightPickedFeature(pickedColors, view) {\n if (pickedColors) {\n var _iterator3 = _createForOfIteratorHelper(view.getScene().getEntities()),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var meshEntity = _step3.value;\n var mesh = this.mesh.getComponentByEntity(meshEntity);\n var material = mesh.material;\n material.setUniform('u_PickingStage', PickingStage.HIGHLIGHT);\n material.setUniform('u_PickingColor', [pickedColors[0], pickedColors[1], pickedColors[2]]);\n material.setUniform('u_HighlightColor', this.highlightColor);\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }\n }]);\n\n return PixelPickingPass;\n}(), _class3.IDENTIFIER = 'PixelPicking Pass', _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"engine\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"resourcePool\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"renderPassFactory\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"mesh\", [_dec5], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=PixelPickingPass.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/PixelPickingPass.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _shapeBase__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shapeBase */ \"./node_modules/@antv/g6-core/es/element/shapeBase.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n\n\n\n\n\n\n\nvar singleNode = {\n itemType: 'node',\n // 单个图形的类型\n shapeType: 'single-node',\n /**\n * 文本相对图形的位置,默认以中心点\n * 位置包括: top, bottom, left, right, center\n * @type {String}\n */\n labelPosition: 'center',\n /**\n * 文本相对偏移,当 labelPosition 不为 center 时有效\n * @type {Number}\n */\n offset: _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].nodeLabel.offset,\n /**\n * 获取节点宽高\n * @internal 返回节点的大小,以 [width, height] 的方式维护\n * @param {Object} cfg 节点的配置项\n * @return {Array} 宽高\n */\n getSize: function getSize(cfg) {\n var _a;\n var size = ((_a = this.mergeStyle) === null || _a === void 0 ? void 0 : _a.size) || cfg.size || this.getOptions({}).size || _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].defaultNode.size; // Global.defaultNode.size; // \n // size 是数组,但长度为1,则补长度为2\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(size) && size.length === 1) {\n size = [size[0], size[0]];\n }\n // size 为数字,则转换为数组\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(size)) {\n size = [size, size];\n }\n return size;\n },\n // 私有方法,不希望扩展的节点复写这个方法\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg) {\n var labelMaxLength = labelCfg.maxLength;\n var text = cfg.label;\n if (labelMaxLength) {\n text = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_6__[\"truncateLabelByLength\"])(text, labelMaxLength);\n }\n var labelPosition = labelCfg.position || this.labelPosition;\n // 默认的位置(最可能的情形),所以放在最上面\n if (labelPosition === 'center') {\n return {\n x: 0,\n y: 0,\n text: text,\n textBaseline: 'middle',\n textAlign: 'center'\n };\n }\n var offset = labelCfg.offset;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(offset)) {\n // 考虑 offset = 0 的场景,不用用 labelCfg.offset || Global.nodeLabel.offset\n offset = this.offset; // 不居中时的偏移量\n }\n\n var size = this.getSize(cfg);\n var style;\n switch (labelPosition) {\n case 'top':\n style = {\n x: 0,\n y: -size[1] / 2 - offset,\n textBaseline: 'bottom',\n textAlign: 'center'\n };\n break;\n case 'bottom':\n style = {\n x: 0,\n y: size[1] / 2 + offset,\n textBaseline: 'top',\n textAlign: 'center'\n };\n break;\n case 'left':\n style = {\n x: -size[0] / 2 - offset,\n y: 0,\n textBaseline: 'middle',\n textAlign: 'right'\n };\n break;\n default:\n style = {\n x: size[0] / 2 + offset,\n y: 0,\n textBaseline: 'middle',\n textAlign: 'left'\n };\n break;\n }\n style.text = text;\n return style;\n },\n getLabelBgStyleByPosition: function getLabelBgStyleByPosition(label, labelCfg) {\n var _a;\n if (!label) return {};\n var backgroundStyle = (_a = labelCfg.style) === null || _a === void 0 ? void 0 : _a.background;\n if (!backgroundStyle) return {};\n var bbox = label.getBBox();\n var padding = Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"formatPadding\"])(backgroundStyle.padding);\n var backgroundWidth = bbox.width + padding[1] + padding[3];\n var backgroundHeight = bbox.height + padding[0] + padding[2];\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: bbox.minX - padding[3],\n y: bbox.minY - padding[0]\n }, backgroundStyle), {\n width: backgroundWidth,\n height: backgroundHeight\n });\n },\n drawShape: function drawShape(cfg, group) {\n var shapeType = this.shapeType; // || this.type,都已经加了 shapeType\n var style = this.getShapeStyle(cfg);\n var shape = group.addShape(shapeType, {\n attrs: style,\n draggable: true,\n name: 'node-shape'\n });\n group['shapeMap']['node-shape'] = shape;\n return shape;\n },\n /**\n * 更新linkPoints\n * @param {Object} cfg 节点数据配置项\n * @param {Group} group Item所在的group\n */\n updateLinkPoints: function updateLinkPoints(cfg, group) {\n var defaultLinkPoints = (this.mergeStyle || this.getOptions(cfg)).linkPoints;\n var markLeft = group['shapeMap']['link-point-left'] || group.find(function (element) {\n return element.get('className') === 'link-point-left';\n });\n var markRight = group['shapeMap']['link-point-right'] || group.find(function (element) {\n return element.get('className') === 'link-point-right';\n });\n var markTop = group['shapeMap']['link-point-top'] || group.find(function (element) {\n return element.get('className') === 'link-point-top';\n });\n var markBottom = group['shapeMap']['link-point-bottom'] || group.find(function (element) {\n return element.get('className') === 'link-point-bottom';\n });\n var currentLinkPoints;\n if (markLeft) {\n currentLinkPoints = markLeft.attr();\n }\n if (markRight && !currentLinkPoints) {\n currentLinkPoints = markRight.attr();\n }\n if (markTop && !currentLinkPoints) {\n currentLinkPoints = markTop.attr();\n }\n if (markBottom && !currentLinkPoints) {\n currentLinkPoints = markBottom.attr();\n }\n if (!currentLinkPoints) currentLinkPoints = defaultLinkPoints;\n var linkPoints = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, currentLinkPoints, cfg.linkPoints);\n var markFill = linkPoints.fill,\n markStroke = linkPoints.stroke,\n borderWidth = linkPoints.lineWidth;\n var markSize = linkPoints.size / 2;\n if (!markSize) markSize = linkPoints.r;\n var _a = cfg.linkPoints ? cfg.linkPoints : {\n left: undefined,\n right: undefined,\n top: undefined,\n bottom: undefined\n },\n left = _a.left,\n right = _a.right,\n top = _a.top,\n bottom = _a.bottom;\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n var styles = {\n r: markSize,\n fill: markFill,\n stroke: markStroke,\n lineWidth: borderWidth\n };\n if (markLeft) {\n if (!left && left !== undefined) {\n markLeft.remove();\n delete group['shapeMap']['link-point-left'];\n } else {\n markLeft.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: -width / 2,\n y: 0\n }));\n }\n } else if (left) {\n var name_1 = 'link-point-left';\n group['shapeMap'][name_1] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: -width / 2,\n y: 0\n }),\n className: name_1,\n name: name_1,\n isAnchorPoint: true\n });\n }\n if (markRight) {\n if (!right && right !== undefined) {\n markRight.remove();\n delete group['shapeMap']['link-point-right'];\n }\n markRight.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: width / 2,\n y: 0\n }));\n } else if (right) {\n var name_2 = 'link-point-right';\n group['shapeMap'][name_2] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: width / 2,\n y: 0\n }),\n className: name_2,\n name: name_2,\n isAnchorPoint: true\n });\n }\n if (markTop) {\n if (!top && top !== undefined) {\n markTop.remove();\n delete group['shapeMap']['link-point-top'];\n }\n markTop.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: 0,\n y: -height / 2\n }));\n } else if (top) {\n var name_3 = 'link-point-top';\n group['shapeMap'][name_3] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: 0,\n y: -height / 2\n }),\n className: name_3,\n name: name_3,\n isAnchorPoint: true\n });\n }\n if (markBottom) {\n if (!bottom && bottom !== undefined) {\n markBottom.remove();\n delete group['shapeMap']['link-point-bottom'];\n } else {\n markBottom.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: 0,\n y: height / 2\n }));\n }\n } else if (bottom) {\n var name_4 = 'link-point-bottom';\n group['shapeMap'][name_4] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: 0,\n y: height / 2\n }),\n className: name_4,\n name: name_4,\n isAnchorPoint: true\n });\n }\n },\n updateShape: function updateShape(cfg, item, keyShapeStyle, hasIcon, updateType) {\n var keyShape = item.get('keyShape');\n keyShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, keyShapeStyle));\n if (!undefined || (updateType === null || updateType === void 0 ? void 0 : updateType.includes('label'))) {\n this.updateLabel(cfg, item, updateType);\n }\n if (hasIcon) {\n this.updateIcon(cfg, item);\n }\n },\n updateIcon: function updateIcon(cfg, item) {\n var _this = this;\n var group = item.getContainer();\n var icon = (this.mergeStyle || this.getOptions(cfg)).icon;\n var _a = cfg.icon ? cfg.icon : {\n show: undefined,\n text: undefined\n },\n show = _a.show,\n text = _a.text;\n var iconShape = group['shapeMap'][\"\".concat(this.type, \"-icon\")] || group.find(function (ele) {\n return ele.get('name') === \"\".concat(_this.type, \"-icon\");\n });\n if (iconShape) {\n // 若原先存在 icon\n if (show || show === undefined) {\n // 若传入 show: true, 或没有设置,则更新原有的 icon 样式\n var iconConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, iconShape.attr(), icon);\n var _b = iconConfig.width,\n w = _b === void 0 ? 20 : _b,\n _c = iconConfig.height,\n h = _c === void 0 ? 20 : _c;\n if (iconConfig.fontFamily === 'iconfont' || iconConfig.hasOwnProperty('text')) {\n w = 0;\n h = 0;\n }\n iconShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, iconConfig), {\n x: -w / 2,\n y: -h / 2\n }));\n } else {\n // 若传入了 show: false 则删除原先的 icon\n iconShape.remove();\n delete group['shapeMap'][\"\".concat(this.type, \"-icon\")];\n }\n } else if (show) {\n // 如果原先不存在 icon,但传入了 show: true,则新增 icon\n var name_5 = \"\".concat(this.type, \"-icon\");\n if (text) {\n group['shapeMap'][name_5] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: name_5,\n name: name_5\n });\n } else {\n var w = icon.width,\n h = icon.height;\n group['shapeMap'][name_5] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, icon), {\n x: -w / 2,\n y: -h / 2\n }),\n className: name_5,\n name: name_5\n });\n }\n // to ensure the label is on the top of all the shapes\n var labelShape = group['shapeMap']['node-label'] || group.find(function (ele) {\n return ele.get('name') === 'node-label';\n });\n if (labelShape) {\n labelShape.toFront();\n }\n }\n }\n};\nvar singleNodeDef = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _shapeBase__WEBPACK_IMPORTED_MODULE_5__[\"shapeBase\"]), singleNode);\n_shape__WEBPACK_IMPORTED_MODULE_4__[\"default\"].registerNode('single-node', singleNodeDef);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/node.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/RenderPass.js": -/*!**************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/RenderPass.js ***! - \**************************************************************************************/ -/*! exports provided: RenderPass */ +/***/ "./node_modules/@antv/g6-core/es/element/nodes/image.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/nodes/image.js ***! + \**************************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RenderPass\", function() { return RenderPass; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _gl__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../gl */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/gl.js\");\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _dec7, _dec8, _dec9, _dec10, _dec11, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _descriptor5, _descriptor6, _descriptor7, _descriptor8, _descriptor9, _class3, _temp;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n\n\n\n\nvar RenderPass = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].MeshComponentManager), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].GeometryComponentManager), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].MaterialComponentManager), _dec5 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].CullableComponentManager), _dec6 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].TransformComponentManager), _dec7 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].HierarchyComponentManager), _dec8 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].Systems), _dec9 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"named\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].FrameGraphSystem), _dec10 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].RenderEngine), _dec11 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].ResourcePool), _dec(_class = (_class2 = (_temp = _class3 = /*#__PURE__*/function () {\n function RenderPass() {\n var _this = this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, RenderPass);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"mesh\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"geometry\", _descriptor2, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"material\", _descriptor3, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"cullable\", _descriptor4, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"transform\", _descriptor5, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"hierarchy\", _descriptor6, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"frameGraphSystem\", _descriptor7, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"engine\", _descriptor8, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"resourcePool\", _descriptor9, this);\n\n this.modelCache = {};\n\n this.setup = function (fg, passNode, pass) {\n var output = fg.createRenderTarget(passNode, 'color buffer', {\n width: 1,\n height: 1,\n usage: _gl__WEBPACK_IMPORTED_MODULE_10__[\"gl\"].RENDER_ATTACHMENT | _gl__WEBPACK_IMPORTED_MODULE_10__[\"gl\"].SAMPLED | _gl__WEBPACK_IMPORTED_MODULE_10__[\"gl\"].COPY_SRC\n });\n pass.data = {\n output: passNode.write(fg, output)\n };\n };\n\n this.execute = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(fg, pass, views) {\n var resourceNode, framebuffer, _iterator, _step, view, canvas;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n resourceNode = fg.getResourceNode(pass.data.output);\n framebuffer = _this.resourcePool.getOrCreateResource(resourceNode.resource); // initialize model of each mesh\n\n _iterator = _createForOfIteratorHelper(views);\n _context.prev = 3;\n\n _iterator.s();\n\n case 5:\n if ((_step = _iterator.n()).done) {\n _context.next = 11;\n break;\n }\n\n view = _step.value;\n _context.next = 9;\n return _this.initView(view);\n\n case 9:\n _context.next = 5;\n break;\n\n case 11:\n _context.next = 16;\n break;\n\n case 13:\n _context.prev = 13;\n _context.t0 = _context[\"catch\"](3);\n\n _iterator.e(_context.t0);\n\n case 16:\n _context.prev = 16;\n\n _iterator.f();\n\n return _context.finish(16);\n\n case 19:\n canvas = _this.engine.getCanvas();\n framebuffer.resize({\n width: canvas.width,\n height: canvas.height\n });\n\n _this.engine.setScissor({\n enable: false\n });\n\n _this.engine.clear({\n framebuffer: framebuffer,\n color: views[0].getClearColor(),\n // TODO: use clearColor defined in view\n depth: 1\n });\n\n _this.engine.useFramebuffer(framebuffer, function () {\n var _iterator2 = _createForOfIteratorHelper(views),\n _step2;\n\n try {\n for (_iterator2.s(); !(_step2 = _iterator2.n()).done;) {\n var view = _step2.value;\n\n // must do rendering in a sync way\n _this.renderView(view);\n }\n } catch (err) {\n _iterator2.e(err);\n } finally {\n _iterator2.f();\n }\n });\n\n case 24:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, null, [[3, 13, 16, 19]]);\n }));\n\n return function (_x, _x2, _x3) {\n return _ref.apply(this, arguments);\n };\n }();\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(RenderPass, [{\n key: \"renderView\",\n value: function renderView(view) {\n var scene = view.getScene();\n var camera = view.getCamera(); // get VP matrix from camera\n\n var viewMatrix = camera.getViewTransform();\n var viewProjectionMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat4\"].multiply(gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat4\"].create(), camera.getPerspective(), viewMatrix); // TODO: use cached planes if camera was not changed\n\n camera.getFrustum().extractFromVPMatrix(viewProjectionMatrix);\n\n var _view$getViewport = view.getViewport(),\n x = _view$getViewport.x,\n y = _view$getViewport.y,\n width = _view$getViewport.width,\n height = _view$getViewport.height;\n\n this.engine.viewport({\n x: x,\n y: y,\n width: width,\n height: height\n }); // this.engine.setScissor({\n // enable: true,\n // box: { x, y, width, height },\n // });\n // this.engine.clear({\n // // framebuffer,\n // color: [1, 1, 1, 1], // TODO: use clearColor defined in view\n // depth: 1,\n // });\n\n var _iterator3 = _createForOfIteratorHelper(scene.getEntities()),\n _step3;\n\n try {\n for (_iterator3.s(); !(_step3 = _iterator3.n()).done;) {\n var meshEntity = _step3.value;\n this.renderMesh(meshEntity, {\n camera: camera,\n view: view,\n viewMatrix: viewMatrix\n });\n }\n } catch (err) {\n _iterator3.e(err);\n } finally {\n _iterator3.f();\n }\n }\n }, {\n key: \"renderMesh\",\n value: function renderMesh(meshEntity, _ref2) {\n var camera = _ref2.camera,\n view = _ref2.view,\n viewMatrix = _ref2.viewMatrix;\n var mesh = this.mesh.getComponentByEntity(meshEntity);\n\n if (!mesh || !mesh.visible) {\n return;\n } // filter meshes with frustum culling\n // if (!this.cullable.getComponentByEntity(meshEntity)?.visible) {\n // return;\n // }\n\n\n var material = mesh.material;\n var geometry = mesh.geometry; // geometry 在自己的 System 中完成脏检查后的更新\n\n if (!geometry || geometry.dirty || !material) {\n return;\n } // get model matrix from mesh\n\n\n var transform = this.transform.getComponentByEntity(meshEntity);\n var modelViewMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat4\"].multiply(gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat4\"].create(), viewMatrix, transform.worldTransform);\n\n var _view$getViewport2 = view.getViewport(),\n width = _view$getViewport2.width,\n height = _view$getViewport2.height; // set MVP matrix, other builtin uniforms @see https://threejs.org/docs/#api/en/renderers/webgl/WebGLProgram\n\n\n material.setUniform({\n projectionMatrix: camera.getPerspective(),\n modelViewMatrix: modelViewMatrix,\n modelMatrix: transform.worldTransform,\n viewMatrix: viewMatrix,\n cameraPosition: camera.getPosition(),\n u_viewport: [width, height]\n });\n\n if (mesh.model) {\n mesh.model.draw({\n uniforms: material.uniforms.reduce(function (cur, prev) {\n cur[prev.name] = prev.data;\n return cur;\n }, {})\n });\n material.uniforms.forEach(function (u) {\n u.dirty = false;\n });\n material.dirty = false;\n }\n }\n }, {\n key: \"initMesh\",\n value: function () {\n var _initMesh = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(meshEntity, view) {\n var mesh, material, geometry, modelCacheKey, _this$engine, createModel, createAttribute, modelInitializationOptions;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n mesh = this.mesh.getComponentByEntity(meshEntity);\n\n if (mesh) {\n _context2.next = 3;\n break;\n }\n\n return _context2.abrupt(\"return\");\n\n case 3:\n material = mesh.material;\n geometry = mesh.geometry;\n\n if (!(!geometry || geometry.dirty || !material)) {\n _context2.next = 7;\n break;\n }\n\n return _context2.abrupt(\"return\");\n\n case 7:\n if (mesh.model) {\n _context2.next = 24;\n break;\n }\n\n modelCacheKey = \"m-\".concat(material.entity, \"-g-\").concat(geometry.entity);\n\n if (!this.modelCache[modelCacheKey]) {\n _context2.next = 12;\n break;\n }\n\n mesh.model = this.modelCache[modelCacheKey];\n return _context2.abrupt(\"return\");\n\n case 12:\n material.setUniform({\n projectionMatrix: 1,\n modelViewMatrix: 1,\n modelMatrix: 1,\n viewMatrix: 1,\n cameraPosition: 1,\n u_viewport: 1\n });\n _this$engine = this.engine, createModel = _this$engine.createModel, createAttribute = _this$engine.createAttribute;\n modelInitializationOptions = {\n vs: material.vertexShaderGLSL,\n fs: material.fragmentShaderGLSL,\n defines: material.defines,\n attributes: geometry.attributes.reduce(function (cur, prev) {\n if (prev.data && prev.buffer) {\n cur[prev.name] = createAttribute({\n buffer: prev.buffer,\n attributes: prev.attributes,\n arrayStride: prev.arrayStride,\n stepMode: prev.stepMode,\n divisor: prev.stepMode === 'vertex' ? 0 : 1\n });\n }\n\n return cur;\n }, {}),\n uniforms: material.uniforms.reduce(function (cur, prev) {\n cur[prev.name] = prev.data;\n return cur;\n }, {}),\n scissor: {\n enable: true,\n // @ts-ignore\n box: function box() {\n return view.getViewport();\n }\n }\n };\n\n if (material.cull) {\n modelInitializationOptions.cull = material.cull;\n }\n\n if (material.depth) {\n modelInitializationOptions.depth = material.depth;\n }\n\n if (material.blend) {\n modelInitializationOptions.blend = material.blend;\n }\n\n if (geometry.indicesBuffer) {\n modelInitializationOptions.elements = geometry.indicesBuffer;\n }\n\n if (geometry.maxInstancedCount) {\n modelInitializationOptions.instances = geometry.maxInstancedCount;\n modelInitializationOptions.count = geometry.vertexCount || 3;\n }\n\n _context2.next = 22;\n return createModel(modelInitializationOptions);\n\n case 22:\n mesh.model = _context2.sent;\n this.modelCache[modelCacheKey] = mesh.model;\n\n case 24:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function initMesh(_x4, _x5) {\n return _initMesh.apply(this, arguments);\n }\n\n return initMesh;\n }()\n }, {\n key: \"initView\",\n value: function () {\n var _initView = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(view) {\n var scene, _iterator4, _step4, meshEntity;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n scene = view.getScene();\n _iterator4 = _createForOfIteratorHelper(scene.getEntities());\n _context3.prev = 2;\n\n _iterator4.s();\n\n case 4:\n if ((_step4 = _iterator4.n()).done) {\n _context3.next = 10;\n break;\n }\n\n meshEntity = _step4.value;\n _context3.next = 8;\n return this.initMesh(meshEntity, view);\n\n case 8:\n _context3.next = 4;\n break;\n\n case 10:\n _context3.next = 15;\n break;\n\n case 12:\n _context3.prev = 12;\n _context3.t0 = _context3[\"catch\"](2);\n\n _iterator4.e(_context3.t0);\n\n case 15:\n _context3.prev = 15;\n\n _iterator4.f();\n\n return _context3.finish(15);\n\n case 18:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this, [[2, 12, 15, 18]]);\n }));\n\n function initView(_x6) {\n return _initView.apply(this, arguments);\n }\n\n return initView;\n }()\n }]);\n\n return RenderPass;\n}(), _class3.IDENTIFIER = 'Render Pass', _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"mesh\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"geometry\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"material\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"cullable\", [_dec5], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor5 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"transform\", [_dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor6 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"hierarchy\", [_dec7], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor7 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"frameGraphSystem\", [_dec8, _dec9], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor8 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"engine\", [_dec10], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor9 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"resourcePool\", [_dec11], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=RenderPass.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/RenderPass.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n\n\n\n/**\n * 基本的图片,可以添加文本,默认文本在图片的下面\n */\n_shape__WEBPACK_IMPORTED_MODULE_1__[\"default\"].registerNode('image', {\n options: {\n img: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ',\n size: 200,\n labelCfg: {\n style: {\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n clipCfg: {\n show: false,\n type: 'circle',\n // circle\n r: 50,\n // ellipse\n rx: 50,\n ry: 35,\n // rect\n width: 50,\n height: 35,\n // polygon\n points: [[30, 12], [12, 30], [30, 48], [48, 30]],\n // path\n 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']],\n // 坐标\n x: 0,\n y: 0\n // clip 的属性样式\n // style: {\n // lineWidth: 1\n // },\n }\n },\n\n shapeType: 'image',\n labelPosition: 'bottom',\n drawShape: function drawShape(cfg, group) {\n var shapeType = this.shapeType;\n var style = this.getShapeStyle(cfg);\n delete style.fill;\n var shape = group.addShape(shapeType, {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n this.drawClip(cfg, shape);\n return shape;\n },\n drawClip: function drawClip(cfg, shape) {\n var clip = (this.mergeStyle || this.getOptions(cfg)).clipCfg;\n if (!clip.show) {\n return;\n }\n // 支持 circle、rect、ellipse、Polygon 及自定义 path clip\n var type = clip.type,\n x = clip.x,\n y = clip.y,\n style = clip.style;\n if (type === 'circle') {\n var r = clip.r;\n shape.setClip({\n type: 'circle',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n r: r,\n x: x,\n y: y\n }, style)\n });\n } else if (type === 'rect') {\n var width = clip.width,\n height = clip.height;\n var rectX = x - width / 2;\n var rectY = y - height / 2;\n shape.setClip({\n type: 'rect',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: rectX,\n y: rectY,\n width: width,\n height: height\n }, style)\n });\n } else if (type === 'ellipse') {\n var rx = clip.rx,\n ry = clip.ry;\n shape.setClip({\n type: 'ellipse',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: x,\n y: y,\n rx: rx,\n ry: ry\n }, style)\n });\n } else if (type === 'polygon') {\n var points = clip.points;\n shape.setClip({\n type: 'polygon',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n points: points\n }, style)\n });\n } else if (type === 'path') {\n var path = clip.path;\n shape.setClip({\n type: 'path',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: path\n }, style)\n });\n }\n },\n getShapeStyle: function getShapeStyle(cfg) {\n var _a = this.mergeStyle || this.getOptions(cfg),\n defaultStyle = _a.style,\n img = _a.img;\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n if (defaultStyle) {\n width = defaultStyle.width || size[0];\n height = defaultStyle.height || size[1];\n }\n var style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height,\n img: img\n }, defaultStyle);\n return style;\n },\n updateShapeStyle: function updateShapeStyle(cfg, item) {\n var group = item.getContainer();\n var shapeClassName = \"\".concat(this.itemType, \"-shape\");\n var shape = group['shapeMap'][shapeClassName] || group.find(function (element) {\n return element.get('className') === shapeClassName;\n }) || item.getKeyShape();\n var shapeStyle = this.getShapeStyle(cfg);\n if (shape && !shape.destroyed) {\n shape.attr(shapeStyle);\n }\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/nodes/image.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/scenegraph/HierarchyComponent.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/scenegraph/HierarchyComponent.js ***! - \*****************************************************************************************/ -/*! exports provided: HierarchyComponent */ +/***/ "./node_modules/@antv/g6-core/es/element/nodes/index.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/nodes/index.js ***! + \**************************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HierarchyComponent\", function() { return HierarchyComponent; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n\n\n\n\n\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\nvar HierarchyComponent = /*#__PURE__*/function (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(HierarchyComponent, _Component);\n\n var _super = _createSuper(HierarchyComponent);\n\n function HierarchyComponent(data) {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, HierarchyComponent);\n\n _this = _super.call(this, data);\n _this.parentID = void 0;\n Object.assign(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_1___default()(_this), data);\n return _this;\n }\n\n return HierarchyComponent;\n}(_ComponentManager__WEBPACK_IMPORTED_MODULE_5__[\"Component\"]);\n//# sourceMappingURL=HierarchyComponent.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/scenegraph/HierarchyComponent.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _simple_circle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./simple-circle */ \"./node_modules/@antv/g6-core/es/element/nodes/simple-circle.js\");\n/* harmony import */ var _simple_rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./simple-rect */ \"./node_modules/@antv/g6-core/es/element/nodes/simple-rect.js\");\n/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./image */ \"./node_modules/@antv/g6-core/es/element/nodes/image.js\");\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/nodes/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/scenegraph/NameComponent.js": -/*!************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/scenegraph/NameComponent.js ***! - \************************************************************************************/ -/*! exports provided: NameComponent */ +/***/ "./node_modules/@antv/g6-core/es/element/nodes/simple-circle.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/nodes/simple-circle.js ***! + \**********************************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NameComponent\", function() { return NameComponent; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n\n\n\n\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_3___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_2___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\nvar NameComponent = /*#__PURE__*/function (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_1___default()(NameComponent, _Component);\n\n var _super = _createSuper(NameComponent);\n\n function NameComponent(data) {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, NameComponent);\n\n _this = _super.call(this, data);\n _this.name = void 0;\n _this.name = data.name || '';\n return _this;\n }\n\n return NameComponent;\n}(_ComponentManager__WEBPACK_IMPORTED_MODULE_4__[\"Component\"]);\n//# sourceMappingURL=NameComponent.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/scenegraph/NameComponent.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n\n\n\n\n// 带有图标的圆,可用于拓扑图中\n_shape__WEBPACK_IMPORTED_MODULE_3__[\"default\"].registerNode('simple-circle', {\n // 自定义节点时的配置\n options: {\n size: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.size,\n style: {\n x: 0,\n y: 0,\n stroke: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeStateStyles)\n },\n shapeType: 'simple-circle',\n // 文本位置\n labelPosition: 'center',\n shapeMap: {},\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n var name = \"\".concat(this.type, \"-keyShape\");\n var keyShape = group.addShape('circle', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: name,\n draggable: true\n });\n group['shapeMap'][name] = keyShape;\n return keyShape;\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var r = size[0] / 2;\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n r: r\n }, style);\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var size = this.getSize(cfg);\n // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n var strokeStyle = {\n stroke: cfg.color,\n r: size[0] / 2\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, keyShape.attr(), strokeStyle, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/nodes/simple-circle.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/scenegraph/System.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/scenegraph/System.js ***! - \*****************************************************************************/ -/*! exports provided: SceneGraphSystem */ +/***/ "./node_modules/@antv/g6-core/es/element/nodes/simple-rect.js": +/*!********************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/nodes/simple-rect.js ***! + \********************************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SceneGraphSystem\", function() { return SceneGraphSystem; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../../identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor, _descriptor2, _descriptor3, _temp;\n\n\n\n\nvar SceneGraphSystem = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].HierarchyComponentManager), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].TransformComponentManager), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"inject\"])(_identifier__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].MeshComponentManager), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function SceneGraphSystem() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, SceneGraphSystem);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"hierarchy\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"transform\", _descriptor2, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"mesh\", _descriptor3, this);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(SceneGraphSystem, [{\n key: \"execute\",\n value: function () {\n var _execute = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.runTransformUpdateSystem();\n this.runHierarchyUpdateSystem();\n\n case 2:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function execute() {\n return _execute.apply(this, arguments);\n }\n\n return execute;\n }()\n }, {\n key: \"tearDown\",\n value: function tearDown() {\n this.hierarchy.clear();\n this.transform.clear();\n }\n }, {\n key: \"getHierarchyComponentManager\",\n value: function getHierarchyComponentManager() {\n return this.hierarchy;\n }\n }, {\n key: \"getTransformComponentManager\",\n value: function getTransformComponentManager() {\n return this.transform;\n }\n }, {\n key: \"runTransformUpdateSystem\",\n value: function runTransformUpdateSystem() {\n var _this = this;\n\n // 原版基于 JobSystem 实现\n this.transform.forEach(function (entity, transform) {\n if (transform.isDirty() || transform.isLocalDirty()) {\n _this.setMeshAABBDirty(_this.mesh.getComponentByEntity(entity));\n\n transform.updateTransform();\n }\n });\n }\n }, {\n key: \"runHierarchyUpdateSystem\",\n value: function runHierarchyUpdateSystem() {\n var _this2 = this;\n\n this.hierarchy.forEach(function (entity, parentComponent) {\n var transformChild = _this2.transform.getComponentByEntity(entity);\n\n var transformParent = _this2.transform.getComponentByEntity(parentComponent.parentID);\n\n if (transformChild !== null && transformParent !== null) {\n transformChild.updateTransformWithParent(transformParent);\n }\n });\n }\n }, {\n key: \"attach\",\n value: function attach(entity, parent, isChildAlreadyInLocalSpace) {\n if (this.hierarchy.contains(entity)) {\n this.detach(entity);\n }\n\n this.hierarchy.create(entity, {\n parentID: parent\n });\n var mesh = this.mesh.getComponentByEntity(parent); // inform parent mesh to update its aabb\n\n this.setMeshAABBDirty(mesh);\n\n if (mesh && mesh.children.indexOf(entity) === -1) {\n mesh.children.push(entity);\n }\n\n if (this.hierarchy.getCount() > 1) {\n for (var i = this.hierarchy.getCount() - 1; i > 0; --i) {\n var parentCandidateEntity = this.hierarchy.getEntity(i); // const parentCandidateComponent = this.hierarchy.getComponent(i);\n\n for (var j = 0; j < i; ++j) {\n var childCandidateEntity = this.hierarchy.getComponent(j);\n\n if (childCandidateEntity.parentID === parentCandidateEntity) {\n this.hierarchy.moveItem(i, j);\n ++i; // next outer iteration will check the same index again as parent candidate, however things were moved upwards, so it will be a different entity!\n\n break;\n }\n }\n }\n } // Re-query parent after potential MoveItem(), because it invalidates references:\n\n\n var parentcomponent = this.hierarchy.getComponentByEntity(entity);\n var transformParent = this.transform.getComponentByEntity(parent);\n\n if (transformParent === null) {\n transformParent = this.transform.create(parent);\n }\n\n var transformChild = this.transform.getComponentByEntity(entity);\n\n if (transformChild === null) {\n transformChild = this.transform.create(entity); // after transforms.Create(), transform_parent pointer could have become invalidated!\n\n transformParent = this.transform.getComponentByEntity(parent);\n }\n\n transformChild.parent = transformParent;\n\n if (!isChildAlreadyInLocalSpace && transformParent) {\n transformChild.matrixTransform(gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat4\"].invert(gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"mat4\"].create(), transformParent.worldTransform));\n transformChild.updateTransform();\n }\n\n if (transformParent) {\n transformChild.updateTransformWithParent(transformParent);\n }\n }\n }, {\n key: \"detach\",\n value: function detach(entity) {\n var self = this.hierarchy.getComponentByEntity(entity);\n\n if (self !== null) {\n var transform = this.transform.getComponentByEntity(entity);\n\n if (transform !== null) {\n transform.parent = null;\n transform.applyTransform();\n }\n\n this.hierarchy.removeKeepSorted(entity); // inform parent mesh to update its aabb\n\n var mesh = this.mesh.getComponentByEntity(self.parentID);\n\n if (mesh) {\n var index = mesh.children.indexOf(entity);\n mesh.children.splice(index, 1);\n }\n\n this.setMeshAABBDirty(mesh);\n }\n }\n }, {\n key: \"detachChildren\",\n value: function detachChildren(parent) {\n var mesh = this.mesh.getComponentByEntity(parent);\n\n if (mesh) {\n mesh.children = [];\n }\n\n for (var i = 0; i < this.hierarchy.getCount();) {\n var _this$hierarchy$getCo;\n\n if (((_this$hierarchy$getCo = this.hierarchy.getComponent(i)) === null || _this$hierarchy$getCo === void 0 ? void 0 : _this$hierarchy$getCo.parentID) === parent) {\n var entity = this.hierarchy.getEntity(i);\n this.detach(entity);\n } else {\n ++i;\n }\n }\n }\n }, {\n key: \"setMeshAABBDirty\",\n value: function setMeshAABBDirty(mesh) {\n if (mesh) {\n mesh.aabbDirty = true;\n }\n }\n }]);\n\n return SceneGraphSystem;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"hierarchy\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"transform\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"mesh\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=System.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/scenegraph/System.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n\n\n\n\n_shape__WEBPACK_IMPORTED_MODULE_3__[\"default\"].registerNode('simple-rect', {\n // 自定义节点时的配置\n options: {\n size: [100, 30],\n style: {\n radius: 0,\n stroke: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n // 连接点,默认为左右\n // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }]\n anchorPoints: [[0, 0.5], [1, 0.5]],\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeStateStyles)\n },\n shapeType: 'simple-rect',\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('rect', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n return keyShape;\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var width = style.width || size[0];\n var height = style.height || size[1];\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height\n }, style);\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer();\n // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var size = this.getSize(cfg);\n var keyShape = item.get('keyShape');\n if (!cfg.size) {\n size[0] = keyShape.attr('width') || defaultStyle.width;\n size[1] = keyShape.attr('height') || defaultStyle.height;\n }\n // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n var strokeStyle = {\n stroke: cfg.color,\n x: -size[0] / 2,\n y: -size[1] / 2,\n width: size[0],\n height: size[1]\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, false, updateType);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/nodes/simple-rect.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/components/scenegraph/TransformComponent.js": -/*!*****************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/components/scenegraph/TransformComponent.js ***! - \*****************************************************************************************/ -/*! exports provided: TransformComponent */ +/***/ "./node_modules/@antv/g6-core/es/element/shape.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/shape.js ***! + \********************************************************/ +/*! exports provided: ShapeFactoryBase, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TransformComponent\", function() { return TransformComponent; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../../ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n\n\n\n\n\n\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\nvar TransformComponent = /*#__PURE__*/function (_Component) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(TransformComponent, _Component);\n\n var _super = _createSuper(TransformComponent);\n\n /**\n * local space RTS\n */\n\n /**\n * XMFLOAT4X4._41\n * @see https://docs.microsoft.com/en-us/windows/win32/api/directxmath/nf-directxmath-xmfloat4x4-xmfloat4x4(constfloat)#remarks\n */\n\n /**\n * world space RTS\n */\n // 高阶函数,利用闭包重复利用临时变量\n // @see playcanvas graph node\n\n /**\n * @see https://docs.microsoft.com/en-us/windows/win32/api/directxmath/nf-directxmath-xmquaternionrotationrollpitchyaw\n */\n\n /**\n * @see https://xiaoiver.github.io/coding/2018/12/28/Camera-%E8%AE%BE%E8%AE%A1-%E4%B8%80.html\n */\n\n /**\n * TODO: 支持以下两种:\n * * translate(x, y, z)\n * * translate(vec3(x, y, z))\n */\n\n /**\n * @see https://en.wikipedia.org/wiki/Centripetal_Catmull%E2%80%93Rom_spline\n */\n // public catmullRom = (() => {\n // const aS = vec3.create();\n // const aR = quat.create();\n // const aT = vec3.create();\n // const bS = vec3.create();\n // const bR = quat.create();\n // const bT = vec3.create();\n // const cS = vec3.create();\n // const cR = quat.create();\n // const cT = vec3.create();\n // const dS = vec3.create();\n // const dR = quat.create();\n // const dT = vec3.create();\n // const R = quat.create();\n // return (\n // a: TransformComponent,\n // b: TransformComponent,\n // c: TransformComponent,\n // d: TransformComponent,\n // t: number,\n // ) => {\n // this.setDirty();\n // mat4.getScaling(aS, a.worldTransform);\n // mat4.getTranslation(aT, a.worldTransform);\n // mat4.getRotation(aR, a.worldTransform);\n // mat4.getScaling(bS, b.worldTransform);\n // mat4.getTranslation(bT, b.worldTransform);\n // mat4.getRotation(bR, b.worldTransform);\n // mat4.getScaling(cS, c.worldTransform);\n // mat4.getTranslation(cT, c.worldTransform);\n // mat4.getRotation(cR, c.worldTransform);\n // mat4.getScaling(dS, d.worldTransform);\n // mat4.getTranslation(dT, d.worldTransform);\n // mat4.getRotation(dR, d.worldTransform);\n // vec3.catmullRom(this.localPosition, aT, bT, cT, dT, t);\n // vec3.catmullRom(R, aR, bR, cR, dR, t);\n // quat.normalize(this.localRotation, R);\n // vec3.catmullRom(this.localScale, aS, bS, cS, dS, t);\n // };\n // })();\n function TransformComponent(data) {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, TransformComponent);\n\n _this = _super.call(this, data);\n _this.dirtyFlag = void 0;\n _this.localDirtyFlag = void 0;\n _this.parent = null;\n _this.localPosition = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 0, 0);\n _this.localRotation = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].fromValues(0, 0, 0, 1);\n _this.localScale = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(1, 1, 1);\n _this.localTransform = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create();\n _this.position = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 0, 0);\n _this.rotation = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].fromValues(0, 0, 0, 1);\n _this.scaling = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(1, 1, 1);\n _this.worldTransform = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create();\n\n _this.matrixTransform = function () {\n var transformed = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create();\n return function (mat) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].multiply(transformed, _this.getLocalTransform(), mat);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getScaling(_this.localScale, transformed);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getTranslation(_this.localPosition, transformed);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getRotation(_this.localRotation, transformed);\n };\n }();\n\n _this.rotateRollPitchYaw = function () {\n var quatX = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create();\n var quatY = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create();\n var quatZ = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create();\n return function (x, y, z) {\n _this.setDirty();\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].fromEuler(quatX, x, 0, 0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].fromEuler(quatY, 0, y, 0);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].fromEuler(quatZ, 0, 0, z);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(_this.localRotation, quatX, _this.localRotation);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(_this.localRotation, _this.localRotation, quatY);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(_this.localRotation, quatZ, _this.localRotation);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].normalize(_this.localRotation, _this.localRotation);\n };\n }();\n\n _this.lerp = function () {\n var aS = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create();\n var aR = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create();\n var aT = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create();\n var bS = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create();\n var bR = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create();\n var bT = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create();\n return function (a, b, t) {\n _this.setDirty();\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getScaling(aS, a.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getTranslation(aT, a.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getRotation(aR, a.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getScaling(bS, b.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getTranslation(bT, b.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getRotation(bR, b.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].lerp(_this.localScale, aS, bS, t);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].slerp(_this.localRotation, aR, bR, t);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].lerp(_this.localPosition, aT, bT, t);\n };\n }();\n\n _this.translate = function () {\n var tr = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create();\n return function (translation) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].add(tr, _this.getPosition(), translation);\n\n _this.setPosition(tr);\n\n _this.setDirty(true);\n\n return _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this);\n };\n }();\n\n _this.translateLocal = function () {\n return function (translation) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformQuat(translation, translation, _this.localRotation);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].add(_this.localPosition, _this.localPosition, translation);\n\n _this.setLocalDirty(true);\n\n return _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this);\n };\n }();\n\n _this.setPosition = function () {\n var parentInvertMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create();\n return function (position) {\n _this.position = position;\n\n _this.setLocalDirty(true);\n\n if (_this.parent === null) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].copy(_this.localPosition, position);\n } else {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].copy(parentInvertMatrix, _this.parent.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].invert(parentInvertMatrix, parentInvertMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(_this.localPosition, position, parentInvertMatrix);\n }\n\n return _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this);\n };\n }();\n\n _this.rotate = function () {\n var parentInvertRotation = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create();\n return function (quaternion) {\n if (_this.parent === null) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(_this.localRotation, _this.localRotation, quaternion);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].normalize(_this.localRotation, _this.localRotation);\n } else {\n var rot = _this.getRotation();\n\n var parentRot = _this.parent.getRotation();\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].copy(parentInvertRotation, parentRot);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].invert(parentInvertRotation, parentInvertRotation);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(parentInvertRotation, parentInvertRotation, quaternion);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(_this.localRotation, quaternion, rot);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].normalize(_this.localRotation, _this.localRotation);\n }\n\n _this.setLocalDirty();\n\n return _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this);\n };\n }();\n\n _this.rotateLocal = function () {\n return function (quaternion) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(_this.localRotation, _this.localRotation, quaternion);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].normalize(_this.localRotation, _this.localRotation);\n\n _this.setLocalDirty(true);\n\n return _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this);\n };\n }();\n\n _this.setRotation = function () {\n var invParentRot = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create();\n return function (rotation) {\n if (_this.parent === null) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].copy(_this.localRotation, rotation);\n } else {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].copy(invParentRot, _this.parent.getRotation());\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].invert(invParentRot, invParentRot);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].copy(_this.localRotation, invParentRot);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].mul(_this.localRotation, _this.localRotation, rotation);\n }\n\n _this.setLocalDirty(true);\n\n return _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_2___default()(_this);\n };\n }();\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(TransformComponent, [{\n key: \"setLocalPosition\",\n value: function setLocalPosition(position) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].copy(this.localPosition, position);\n this.setLocalDirty(true);\n }\n }, {\n key: \"setLocalScale\",\n value: function setLocalScale(scale) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].copy(this.localScale, scale);\n this.setLocalDirty(true);\n }\n }, {\n key: \"setLocalRotation\",\n value: function setLocalRotation(rotation) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].copy(this.localRotation, rotation);\n this.setLocalDirty(true);\n return this;\n }\n }, {\n key: \"isDirty\",\n value: function isDirty() {\n return this.dirtyFlag;\n }\n }, {\n key: \"setDirty\",\n value: function setDirty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (value) {\n this.dirtyFlag |= TransformComponent.DIRTY;\n } else {\n this.dirtyFlag &= ~TransformComponent.DIRTY;\n }\n }\n }, {\n key: \"isLocalDirty\",\n value: function isLocalDirty() {\n return this.localDirtyFlag;\n }\n }, {\n key: \"setLocalDirty\",\n value: function setLocalDirty() {\n var value = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : true;\n\n if (value) {\n this.localDirtyFlag |= TransformComponent.DIRTY;\n this.setDirty(true);\n } else {\n this.localDirtyFlag &= ~TransformComponent.DIRTY;\n }\n }\n }, {\n key: \"updateTransform\",\n value: function updateTransform() {\n if (this.isLocalDirty()) {\n this.getLocalTransform();\n }\n\n if (this.isDirty()) {\n if (this.parent === null) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].copy(this.worldTransform, this.getLocalTransform());\n this.setDirty(false);\n }\n }\n }\n }, {\n key: \"updateTransformWithParent\",\n value: function updateTransformWithParent(parent) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].multiply(this.worldTransform, parent.worldTransform, this.getLocalTransform());\n }\n }, {\n key: \"applyTransform\",\n value: function applyTransform() {\n this.setDirty();\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getScaling(this.localScale, this.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getTranslation(this.localPosition, this.worldTransform);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getRotation(this.localRotation, this.worldTransform);\n }\n }, {\n key: \"clearTransform\",\n value: function clearTransform() {\n this.setDirty();\n this.localPosition = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 0, 0);\n this.localRotation = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].fromValues(0, 0, 0, 1);\n this.localScale = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(1, 1, 1);\n }\n }, {\n key: \"scaleLocal\",\n value: function scaleLocal(scaling) {\n this.setLocalDirty();\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].multiply(this.localScale, this.localScale, scaling);\n return this;\n }\n }, {\n key: \"getLocalPosition\",\n value: function getLocalPosition() {\n return this.localPosition;\n }\n }, {\n key: \"getLocalRotation\",\n value: function getLocalRotation() {\n return this.localRotation;\n }\n }, {\n key: \"getLocalScale\",\n value: function getLocalScale() {\n return this.localScale;\n }\n }, {\n key: \"getLocalTransform\",\n value: function getLocalTransform() {\n if (this.localDirtyFlag) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].fromRotationTranslationScale(this.localTransform, this.localRotation, this.localPosition, this.localScale);\n this.setLocalDirty(false);\n }\n\n return this.localTransform;\n }\n }, {\n key: \"getWorldTransform\",\n value: function getWorldTransform() {\n if (!this.isLocalDirty() && !this.isDirty()) {\n return this.worldTransform;\n }\n\n if (this.parent) {\n this.parent.getWorldTransform();\n }\n\n this.updateTransform();\n return this.worldTransform;\n }\n }, {\n key: \"getPosition\",\n value: function getPosition() {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getTranslation(this.position, this.worldTransform);\n return this.position;\n }\n }, {\n key: \"getRotation\",\n value: function getRotation() {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getRotation(this.rotation, this.worldTransform);\n return this.rotation;\n }\n }, {\n key: \"getScale\",\n value: function getScale() {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].getScaling(this.scaling, this.worldTransform);\n return this.scaling;\n }\n }]);\n\n return TransformComponent;\n}(_ComponentManager__WEBPACK_IMPORTED_MODULE_7__[\"Component\"]);\nTransformComponent.DIRTY = 1 << 0;\n//# sourceMappingURL=TransformComponent.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/components/scenegraph/TransformComponent.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShapeFactoryBase\", function() { return ShapeFactoryBase; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _xml__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./xml */ \"./node_modules/@antv/g6-core/es/element/xml.js\");\n\n\n\nvar cache = {}; // ucfirst 开销过大,进行缓存\n// 首字母大写\nfunction ucfirst(str) {\n if (!cache[str]) {\n cache[str] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"upperFirst\"])(str);\n }\n return cache[str];\n}\n/**\n * 工厂方法的基类\n * @type Shape.FactoryBase\n */\nvar ShapeFactoryBase = {\n /**\n * 默认的形状,当没有指定/匹配 shapeType 时,使用默认的\n * @type {String}\n */\n defaultShapeType: 'defaultType',\n /**\n * 形状的 className,用于搜索\n * @type {String}\n */\n className: null,\n /**\n * 获取绘制 Shape 的工具类,无状态\n * @param {String} type 类型\n * @return {Shape} 工具类\n */\n getShape: function getShape(type) {\n var self = this;\n var shape = self[type] || self[self.defaultShapeType] || self['simple-circle'];\n return shape;\n },\n /**\n * 绘制图形\n * @param {String} type 类型\n * @param {Object} cfg 配置项\n * @param {G.Group} group 图形的分组\n * @return {IShape} 图形对象\n */\n draw: function draw(type, cfg, group) {\n var shape = this.getShape(type);\n group['shapeMap'] = {};\n var rst = shape.draw(cfg, group);\n if (shape.afterDraw) {\n shape.afterDraw(cfg, group, rst);\n }\n return rst;\n },\n /**\n * 更新\n * @param {String} type 类型\n * @param {Object} cfg 配置项\n * @param {G6.Item} item 节点、边、分组等\n */\n baseUpdate: function baseUpdate(type, cfg, item, updateType) {\n var _a, _b;\n var shape = this.getShape(type);\n // 防止没定义 update 函数\n if (shape.update) {\n // shape.mergeStyle = updateType === 'move' || updateType === 'bbox' ? {} : shape.getOptions?.(cfg);\n shape.mergeStyle = (_a = shape.getOptions) === null || _a === void 0 ? void 0 : _a.call(shape, cfg, updateType);\n (_b = shape.update) === null || _b === void 0 ? void 0 : _b.call(shape, cfg, item, updateType);\n }\n if (shape.afterUpdate) {\n shape.afterUpdate(cfg, item);\n }\n },\n /**\n * 设置状态\n * @param {String} type 类型\n * @param {String} name 状态名\n * @param {String | Boolean} value 状态值\n * @param {G6.Item} item 节点、边、分组等\n */\n setState: function setState(type, name, value, item) {\n var shape = this.getShape(type);\n // 调用 shape/shapeBase.ts 中的 setState 方法\n shape.setState(name, value, item);\n },\n /**\n * 是否允许更新,不重新绘制图形\n * @param {String} type 类型\n * @return {Boolean} 是否允许使用更新\n */\n shouldUpdate: function shouldUpdate(type) {\n var shape = this.getShape(type);\n return !!shape.update;\n },\n getControlPoints: function getControlPoints(type, cfg) {\n var shape = this.getShape(type);\n return shape.getControlPoints(cfg);\n },\n /**\n * 获取控制点\n * @param {String} type 节点、边类型\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getAnchorPoints: function getAnchorPoints(type, cfg) {\n var shape = this.getShape(type);\n return shape.getAnchorPoints(cfg);\n }\n};\n/**\n * 元素的框架\n */\nvar ShapeFramework = {\n // 默认样式及配置\n options: {},\n /**\n * 绘制\n */\n draw: function draw(cfg, group) {\n return this.drawShape(cfg, group);\n },\n /**\n * 绘制\n */\n drawShape: function drawShape( /* cfg, group */) {},\n /**\n * 绘制完成后的操作,便于用户继承现有的节点、边\n */\n afterDraw: function afterDraw( /* cfg, group */) {},\n // update(cfg, item) // 默认不定义\n afterUpdate: function afterUpdate( /* cfg, item */) {},\n /**\n * 设置节点、边状态\n */\n setState: function setState( /* name, value, item */) {},\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getAnchorPoints: function getAnchorPoints(cfg) {\n var defaultAnchorPoints = this.options.anchorPoints;\n var anchorPoints = cfg.anchorPoints || defaultAnchorPoints;\n return anchorPoints;\n }\n /* 如果没定义 update 方法,每次都调用 draw 方法\n update(cfg, item) {\n }\n */\n};\n\nvar Shape = /** @class */function () {\n function Shape() {}\n Shape.registerFactory = function (factoryType, cfg) {\n var className = ucfirst(factoryType);\n var factoryBase = ShapeFactoryBase;\n var shapeFactory = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, factoryBase), cfg);\n Shape[className] = shapeFactory;\n shapeFactory.className = className;\n return shapeFactory;\n };\n Shape.getFactory = function (factoryType) {\n var className = ucfirst(factoryType);\n return Shape[className];\n };\n Shape.registerNode = function (shapeType, nodeDefinition, extendShapeType) {\n var shapeFactory = Shape.Node;\n var shapeObj;\n if (typeof nodeDefinition === 'string' || typeof nodeDefinition === 'function') {\n var autoNodeDefinition = Object(_xml__WEBPACK_IMPORTED_MODULE_2__[\"createNodeFromXML\"])(nodeDefinition);\n shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, shapeFactory.getShape('single-node')), autoNodeDefinition);\n } else if (nodeDefinition.jsx) {\n var jsx = nodeDefinition.jsx;\n var autoNodeDefinition = Object(_xml__WEBPACK_IMPORTED_MODULE_2__[\"createNodeFromXML\"])(jsx);\n shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, shapeFactory.getShape('single-node')), autoNodeDefinition), nodeDefinition);\n } else {\n shapeFactory.getShape(extendShapeType);\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, extendShape), nodeDefinition);\n }\n shapeObj.type = shapeType;\n shapeObj.itemType = 'node';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n Shape.registerEdge = function (shapeType, edgeDefinition, extendShapeType) {\n var shapeFactory = Shape.Edge;\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n var shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, extendShape), edgeDefinition);\n shapeObj.type = shapeType;\n shapeObj.itemType = 'edge';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n Shape.registerCombo = function (shapeType, comboDefinition, extendShapeType) {\n var shapeFactory = Shape.Combo;\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n var shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, extendShape), comboDefinition);\n shapeObj.type = shapeType;\n shapeObj.itemType = 'combo';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n return Shape;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Shape);\n// 注册 Node 的工厂方法\nShape.registerFactory('node', {\n defaultShapeType: 'circle'\n});\n// 注册 Edge 的工厂方法\nShape.registerFactory('edge', {\n defaultShapeType: 'line'\n});\n// 注册 Combo 的工厂方法\nShape.registerFactory('combo', {\n defaultShapeType: 'circle'\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/shape.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/identifier.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/identifier.js ***! - \***********************************************************/ -/*! exports provided: IDENTIFIER */ +/***/ "./node_modules/@antv/g6-core/es/element/shapeBase.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/element/shapeBase.js ***! + \************************************************************/ +/*! exports provided: CLS_LABEL_BG_SUFFIX, shapeBase */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IDENTIFIER\", function() { return IDENTIFIER; });\nvar IDENTIFIER = {\n // SceneGraph\n HierarchyComponentManager: Symbol('HierarchyComponentManager'),\n TransformComponentManager: Symbol('TransformComponentManager'),\n NameComponentManager: Symbol('NameComponentManager'),\n SceneGraphSystem: Symbol('SceneGraphSystem'),\n // FrameGraph\n FrameGraphSystem: Symbol('FrameGraphSystem'),\n ResourcePool: Symbol('ResourcePool'),\n ResourceHandleComponentManager: Symbol('ResourceHandleComponentManager'),\n PassNodeComponentManager: Symbol('PassNodeComponentManager'),\n // Renderer\n RendererSystem: Symbol('RendererSystem'),\n RenderPass: Symbol('RenderPass'),\n RenderPassFactory: Symbol('Factory'),\n Renderable: Symbol('Factory'),\n // Mesh\n MeshSystem: Symbol('MeshSystem'),\n MeshComponentManager: Symbol('MeshComponentManager'),\n CullableComponentManager: Symbol('CullableComponentManager'),\n // Geometry\n Geometry: Symbol('Geometry'),\n GeometrySystem: Symbol('GeometrySystem'),\n GeometryComponentManager: Symbol('GeometryComponentManager'),\n // Material\n Material: Symbol('Material'),\n MaterialSystem: Symbol('MaterialSystem'),\n MaterialComponentManager: Symbol('MaterialComponentManager'),\n // RenderPath\n ForwardRenderPath: Symbol('ForwardRenderPath'),\n // ComputeSystem\n ComputeSystem: Symbol('ComputeSystem'),\n ComputeComponentManager: Symbol('ComputeComponentManager'),\n ComputeStrategy: Symbol('ComputeStrategy'),\n Systems: Symbol('Systems'),\n World: Symbol('World'),\n // RenderEngine\n RenderEngine: Symbol('RenderEngine'),\n WebGPUEngine: Symbol('WebGPUEngine'),\n WebGLEngine: Symbol('WebGLEngine'),\n // Shader Module\n ShaderModuleService: Symbol('ShaderModuleService'),\n ConfigService: Symbol('ConfigService'),\n InteractorService: Symbol('InteractorService'),\n IEventEmitter: Symbol('IEventEmitter'),\n // Light\n Light: Symbol('Light')\n};\n//# sourceMappingURL=identifier.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/identifier.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CLS_LABEL_BG_SUFFIX\", function() { return CLS_LABEL_BG_SUFFIX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"shapeBase\", function() { return shapeBase; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__[\"ext\"].transform;\nvar CLS_SHAPE_SUFFIX = '-shape';\nvar CLS_LABEL_SUFFIX = '-label';\nvar ARROWS = ['startArrow', 'endArrow'];\nvar SHAPE_DEFAULT_ATTRS = {\n lineWidth: 1,\n stroke: undefined,\n fill: undefined,\n lineAppendWidth: 1,\n opacity: undefined,\n strokeOpacity: undefined,\n fillOpacity: undefined,\n x: 0,\n y: 0,\n r: 10,\n width: 20,\n height: 20,\n shadowColor: undefined,\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\nvar PATH_SHAPE_DEFAULT_ATTRS = {\n lineWidth: 1,\n stroke: '#000',\n lineDash: undefined,\n startArrow: false,\n endArrow: false,\n opacity: undefined,\n strokeOpacity: undefined,\n fillOpacity: undefined,\n shadowColor: undefined,\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\nvar SHAPES_DEFAULT_ATTRS = {\n edge: PATH_SHAPE_DEFAULT_ATTRS,\n node: SHAPE_DEFAULT_ATTRS,\n combo: SHAPE_DEFAULT_ATTRS\n};\nvar CLS_LABEL_BG_SUFFIX = '-label-bg';\n// 单个 shape 带有一个 label,共用这段代码\nvar shapeBase = {\n // 默认样式及配置\n options: {\n labelCfg: {\n style: {\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].windowFontFamily\n }\n },\n descriptionCfg: {\n style: {\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].windowFontFamily\n }\n }\n },\n itemType: '',\n /**\n * 形状的类型,例如 circle,ellipse,polyline...\n */\n type: '',\n getCustomConfig: function getCustomConfig(cfg) {\n return {};\n },\n getOptions: function getOptions(cfg, updateType) {\n if (updateType === 'move' || (updateType === null || updateType === void 0 ? void 0 : updateType.includes('bbox'))) return cfg;\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"])({}, this.options, this.getCustomConfig(cfg) || {}, cfg);\n },\n /**\n * 绘制节点/边,包含文本\n * @override\n * @param {Object} cfg 节点的配置项\n * @param {G.Group} group 节点的容器\n * @return {IShape} 绘制的图形\n */\n draw: function draw(cfg, group) {\n group['shapeMap'] = {};\n this.mergeStyle = this.getOptions(cfg);\n var shape = this.drawShape(cfg, group);\n shape.set('className', this.itemType + CLS_SHAPE_SUFFIX);\n group['shapeMap'][this.itemType + CLS_SHAPE_SUFFIX] = shape;\n if (cfg.label) {\n var label = this.drawLabel(cfg, group);\n label.set('className', this.itemType + CLS_LABEL_SUFFIX);\n group['shapeMap'][this.itemType + CLS_LABEL_SUFFIX] = label;\n }\n return shape;\n },\n /**\n * 绘制完成后的操作,便于用户继承现有的节点、边\n * @param cfg\n * @param group\n * @param keyShape\n */\n afterDraw: function afterDraw(cfg, group, keyShape) {},\n drawShape: function drawShape(cfg, group) {\n return null;\n },\n drawLabel: function drawLabel(cfg, group) {\n var defaultLabelCfg = (this.mergeStyle || this.getOptions(cfg) || {}).labelCfg;\n // image的情况下有可能为null\n var labelCfg = defaultLabelCfg || {};\n var labelStyle = this.getLabelStyle(cfg, labelCfg, group);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate;\n var label = group.addShape('text', {\n attrs: labelStyle,\n draggable: true,\n className: 'text-shape',\n name: 'text-shape',\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n if (!isNaN(rotate) && rotate !== '') {\n var labelBBox = label.getBBox();\n var labelMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n if (labelStyle.rotateCenter) {\n switch (labelStyle.rotateCenter) {\n case 'center':\n labelMatrix = transform(labelMatrix, [['t', -labelBBox.width / 2, -labelBBox.height / 2], ['r', rotate], ['t', labelBBox.width / 2, labelBBox.height / 2]]);\n break;\n case 'lefttop':\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y], ['r', rotate], ['t', labelStyle.x, labelStyle.y]]);\n break;\n case 'leftcenter':\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y - labelBBox.height / 2], ['r', rotate], ['t', labelStyle.x, labelStyle.y + labelBBox.height / 2]]);\n break;\n default:\n labelMatrix = transform(labelMatrix, [['t', -labelBBox.width / 2, -labelBBox.height / 2], ['r', rotate], ['t', labelBBox.width / 2, labelBBox.height / 2]]);\n break;\n }\n } else {\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y - labelBBox.height / 2], ['r', rotate], ['t', labelStyle.x, labelStyle.y + labelBBox.height / 2]]);\n }\n label.setMatrix(labelMatrix);\n }\n if (labelStyle.background) {\n var rect = this.drawLabelBg(cfg, group, label);\n var labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX;\n rect.set('classname', labelBgClassname);\n group['shapeMap'][labelBgClassname] = rect;\n label.toFront();\n }\n return label;\n },\n drawLabelBg: function drawLabelBg(cfg, group, label) {\n var defaultLabelCfg = this.options.labelCfg;\n var labelCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, defaultLabelCfg, cfg.labelCfg);\n var style = this.getLabelBgStyleByPosition(label, labelCfg);\n var rect = group.addShape('rect', {\n name: 'text-bg-shape',\n attrs: style,\n labelRelated: true\n });\n group['shapeMap']['text-bg-shape'] = rect;\n return rect;\n },\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg, group) {\n return {\n text: cfg.label\n };\n },\n getLabelBgStyleByPosition: function getLabelBgStyleByPosition(label, labelCfg) {\n return {};\n },\n /**\n * 获取文本的配置项\n * @param cfg 节点的配置项\n * @param labelCfg 文本的配置项\n * @param group 父容器,label 的定位可能与图形相关\n */\n getLabelStyle: function getLabelStyle(cfg, labelCfg, group) {\n var calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group);\n var attrName = \"\".concat(this.itemType, \"Label\"); // 取 nodeLabel,edgeLabel 的配置项\n var defaultStyle = _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"][attrName] ? _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"][attrName].style : null;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, defaultStyle), calculateStyle), labelCfg.style);\n },\n /**\n * 获取图形的配置项\n * @param cfg\n */\n getShapeStyle: function getShapeStyle(cfg) {\n return cfg.style;\n },\n /**\n * 更新节点,包含文本\n * @override\n * @param {Object} cfg 节点/边的配置项\n * @param {G6.Item} item 节点/边\n */\n update: function update(cfg, item, updateType) {\n this.updateShapeStyle(cfg, item, updateType);\n this.updateLabel(cfg, item, updateType);\n },\n updateShapeStyle: function updateShapeStyle(cfg, item, updateType) {\n var _a;\n var group = item.getContainer();\n var shape = item.getKeyShape();\n var shapeStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, shape.attr(), cfg.style);\n var _loop_1 = function _loop_1(key) {\n var _b;\n var style = shapeStyle[key];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(style)) {\n // 更新图元素样式,支持更新子元素\n var subShape = ((_a = group['shapeMap']) === null || _a === void 0 ? void 0 : _a[key]) || group.find(function (element) {\n return element.get('name') === key;\n });\n subShape === null || subShape === void 0 ? void 0 : subShape.attr(style);\n } else {\n shape.attr((_b = {}, _b[key] = style, _b));\n }\n };\n for (var key in shapeStyle) {\n _loop_1(key);\n }\n },\n updateLabel: function updateLabel(cfg, item, updateType) {\n var _a, _b;\n var group = item.getContainer();\n var _c = (this.mergeStyle || this.getOptions({}, updateType) || {}).labelCfg,\n labelCfg = _c === void 0 ? {} : _c;\n var labelClassName = this.itemType + CLS_LABEL_SUFFIX;\n var label = group['shapeMap'][labelClassName] || group.find(function (ele) {\n return ele.get('className') === labelClassName;\n });\n var labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX;\n var labelBg = group['shapeMap'][labelBgClassname] || group.find(function (ele) {\n return ele.get('className') === labelBgClassname;\n });\n if (label && cfg.label === undefined) {\n group.removeChild(label);\n delete group['shapeMap'][labelClassName];\n if (labelBg) {\n group.removeChild(labelBg);\n delete group['shapeMap'][labelBgClassname];\n }\n }\n // 防止 cfg.label = \"\" 的情况\n if (cfg.label || cfg.label === '') {\n // 若传入的新配置中有 label,(用户没传入但原先有 label,label 也会有值)\n if (!label) {\n // 若原先不存在 label,则绘制一个新的 label\n var newLabel = this.drawLabel(cfg, group);\n newLabel.set('className', labelClassName);\n group['shapeMap'][labelClassName] = newLabel;\n } else {\n // 若原先存在 label,则更新样式。与 getLabelStyle 不同在于这里需要融合当前 label 的样式\n // 融合 style 以外的属性:position, offset, ...\n if (!updateType || updateType === 'bbox|label' || this.itemType === 'edge' && updateType !== 'style') {\n labelCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"])(labelCfg, cfg.labelCfg);\n }\n // 获取位置信息\n var calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group);\n // 取 nodeLabel,edgeLabel 的配置项\n var cfgStyle = (_a = cfg.labelCfg) === null || _a === void 0 ? void 0 : _a.style;\n // const cfgBgStyle = labelCfg.style?.background;\n // 需要融合当前\b label 的样式 label.attr()。不再需要全局/默认样式,因为已经应用在当前的 label 上\n var labelStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, calculateStyle), cfgStyle);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate;\n // 计算 label 的旋转矩阵\n if (!isNaN(rotate) && rotate !== '') {\n // if G 4.x define the rotateAtStart, use it directly instead of using the following codes\n var rotateMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n rotateMatrix = transform(rotateMatrix, [['t', -labelStyle.x, -labelStyle.y], ['r', rotate], ['t', labelStyle.x, labelStyle.y]]);\n labelStyle.matrix = rotateMatrix;\n label.attr(labelStyle);\n } else {\n if (((_b = label.getMatrix()) === null || _b === void 0 ? void 0 : _b[4]) !== 1) {\n label.resetMatrix();\n }\n label.attr(labelStyle);\n }\n if (!labelBg) {\n if (labelStyle.background) {\n labelBg = this.drawLabelBg(cfg, group, label);\n labelBg.set('classname', labelBgClassname);\n group['shapeMap'][labelBgClassname] = labelBg;\n label.toFront();\n }\n } else if (labelStyle.background) {\n var calculateBgStyle = this.getLabelBgStyleByPosition(label, labelCfg);\n labelBg.attr(calculateBgStyle);\n } else {\n group.removeChild(labelBg);\n }\n }\n }\n },\n // update(cfg, item) // 默认不定义\n afterUpdate: function afterUpdate(cfg, item) {},\n /**\n * 设置节点的状态,主要是交互状态,业务状态请在 draw 方法中实现\n * 单图形的节点仅考虑 selected、active 状态,有其他状态需求的用户自己复写这个方法\n * @override\n * @param {String} name 状态名称\n * @param {String | Boolean} value 状态值\n * @param {G6.Item} item 节点\n */\n setState: function setState(name, value, item) {\n var _a, _b;\n var _c;\n var shape = item.get('keyShape');\n if (!shape || shape.destroyed) return;\n var type = item.getType();\n var stateName = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isBoolean\"])(value) ? name : \"\".concat(name, \":\").concat(value);\n var shapeStateStyle = this.getStateStyle(stateName, item);\n var itemStateStyle = item.getStateStyle(stateName);\n // const originStyle = item.getOriginStyle();\n // 不允许设置一个不存在的状态\n if (!itemStateStyle && !shapeStateStyle) {\n return;\n }\n // 要设置或取消的状态的样式\n // 当没有 state 状态时,默认使用 model.stateStyles 中的样式\n var styles = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, itemStateStyle || shapeStateStyle);\n var group = item.getContainer();\n // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值。使用对象检索更快\n var keptAttrs = {\n x: 1,\n y: 1,\n cx: 1,\n cy: 1,\n matrix: 1\n };\n if (type === 'combo') {\n keptAttrs.r = 1;\n keptAttrs.width = 1;\n keptAttrs.height = 1;\n }\n if (value) {\n var _loop_2 = function _loop_2(key) {\n var _d;\n var style = styles[key];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(style) && !ARROWS.includes(key)) {\n var subShape = ((_c = group['shapeMap']) === null || _c === void 0 ? void 0 : _c[key]) || group.find(function (element) {\n return element.get('name') === key;\n });\n subShape === null || subShape === void 0 ? void 0 : subShape.attr(style);\n } else {\n // 非纯对象,则认为是设置到 keyShape 上面的\n shape.attr((_d = {}, _d[key] = style, _d));\n }\n };\n // style 为要设置的状态的样式\n for (var key in styles) {\n _loop_2(key);\n }\n } else {\n // 所有生效的 state 的样式\n var enableStatesStyle = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_4__[\"cloneBesidesImg\"])(item.getCurrentStatesStyle());\n var model = item.getModel();\n // 原始样式\n var originStyle_1 = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, model.style, Object(_util_graphic__WEBPACK_IMPORTED_MODULE_4__[\"cloneBesidesImg\"])(item.getOriginStyle()));\n var keyShapeName_1 = shape.get('name');\n // cloning shape.attr(), keys.forEach to avoid cloning the img attr, which leads to maximum clone heap #2383\n // const keyShapeStyles = clone(shape.attr())\n var shapeAttrs_1 = shape.attr();\n var keyShapeStyles_1 = {};\n Object.keys(shapeAttrs_1).forEach(function (key) {\n if (key === 'img') return;\n var attr = shapeAttrs_1[key];\n if (attr && _typeof(attr) === 'object') {\n keyShapeStyles_1[key] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(attr);\n } else {\n keyShapeStyles_1[key] = attr;\n }\n });\n // 已有样式 - 要取消的状态的样式\n var filtetDisableStatesStyle = {};\n var _loop_3 = function _loop_3(p) {\n var style = styles[p];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(style) && !ARROWS.includes(p)) {\n var subShape_1 = group['shapeMap'][p] || group.find(function (ele) {\n return ele.get('name') === p;\n });\n if (subShape_1) {\n var subShapeStyles_1 = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_4__[\"cloneBesidesImg\"])(subShape_1.attr());\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(style, function (v, key) {\n if (p === keyShapeName_1 && keyShapeStyles_1[key] && !keptAttrs[key]) {\n delete keyShapeStyles_1[key];\n var value_1 = originStyle_1[p][key] || SHAPES_DEFAULT_ATTRS[type][key];\n shape.attr(key, value_1);\n } else if (subShapeStyles_1[key] || subShapeStyles_1[key] === 0) {\n delete subShapeStyles_1[key];\n var value_2 = originStyle_1[p][key] || SHAPES_DEFAULT_ATTRS[type][key];\n subShape_1.attr(key, value_2);\n }\n });\n filtetDisableStatesStyle[p] = subShapeStyles_1;\n }\n } else {\n if (keyShapeStyles_1[p] && !keptAttrs[p]) {\n delete keyShapeStyles_1[p];\n var value_3 = originStyle_1[p] || (originStyle_1[keyShapeName_1] ? originStyle_1[keyShapeName_1][p] : undefined) || SHAPES_DEFAULT_ATTRS[type][p];\n shape.attr(p, value_3);\n }\n }\n };\n // styles 为要取消的状态的样式\n for (var p in styles) {\n _loop_3(p);\n }\n // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值后,\n // 如果 keyShape 有 name 属性,则 filtetDisableStatesStyle 的格式为 { keyShapeName: {} }\n // 否则为普通对象\n if (!keyShapeName_1) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])(filtetDisableStatesStyle, keyShapeStyles_1);\n } else {\n filtetDisableStatesStyle[keyShapeName_1] = keyShapeStyles_1;\n }\n for (var key in enableStatesStyle) {\n if (keptAttrs[key]) continue;\n var enableStyle = enableStatesStyle[key];\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(enableStyle) || ARROWS.includes(key)) {\n // 把样式属性merge到keyShape中\n if (!keyShapeName_1) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])(originStyle_1, (_a = {}, _a[key] = enableStyle, _a));\n } else {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])(originStyle_1[keyShapeName_1], (_b = {}, _b[key] = enableStyle, _b));\n delete originStyle_1[key];\n }\n delete enableStatesStyle[key];\n }\n }\n var originstyles = {};\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"])(originstyles, originStyle_1, filtetDisableStatesStyle, enableStatesStyle);\n var keyShapeSetted = false;\n var _loop_4 = function _loop_4(originKey) {\n var _e, _f;\n var style = originstyles[originKey];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(style) && !ARROWS.includes(originKey)) {\n var subShape = group['shapeMap'][originKey] || group.find(function (ele) {\n return ele.get('name') === originKey;\n });\n if (subShape) {\n // The text's position and matrix is not allowed to be affected by states\n if (subShape.get('type') === 'text' || subShape.get('labelRelated')) {\n delete style.x;\n delete style.y;\n delete style.matrix;\n }\n if (originKey === keyShapeName_1) {\n if (type === 'combo') {\n delete style.r;\n delete style.width;\n delete style.height;\n }\n keyShapeSetted = true;\n }\n subShape.attr(style);\n }\n } else if (!keyShapeSetted) {\n var value_4 = style || SHAPES_DEFAULT_ATTRS[type][originKey];\n // 当更新 combo 状态时,当不存在 keyShapeName 时候,则认为是设置到 keyShape 上面的\n if (type === 'combo') {\n if (!keyShapeName_1) {\n shape.attr((_e = {}, _e[originKey] = value_4, _e));\n }\n } else {\n shape.attr((_f = {}, _f[originKey] = value_4, _f));\n }\n }\n };\n for (var originKey in originstyles) {\n _loop_4(originKey);\n }\n }\n },\n /**\n * 获取不同状态下的样式\n *\n * @param {string} name 状态名称\n * @param {Item} item Node或Edge的实例\n * @return {object} 样式\n */\n getStateStyle: function getStateStyle(name, item) {\n var model = item.getModel();\n var type = item.getType();\n var _a = this.getOptions(model),\n stateStyles = _a.stateStyles,\n _b = _a.style,\n style = _b === void 0 ? {} : _b;\n var modelStateStyle = model.stateStyles ? model.stateStyles[name] : stateStyles && stateStyles[name];\n if (type === 'combo') {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(modelStateStyle);\n }\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, style, modelStateStyle);\n },\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 锚点的数组,如果为 null,则没有锚点\n */\n getAnchorPoints: function getAnchorPoints(cfg) {\n var _a, _b;\n var anchorPoints = (cfg === null || cfg === void 0 ? void 0 : cfg.anchorPoints) || ((_a = this.getCustomConfig(cfg)) === null || _a === void 0 ? void 0 : _a.anchorPoints) || ((_b = this.options) === null || _b === void 0 ? void 0 : _b.anchorPoints);\n return anchorPoints;\n }\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/shapeBase.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/index.js": +/***/ "./node_modules/@antv/g6-core/es/element/xml.js": /*!******************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/index.js ***! + !*** ./node_modules/@antv/g6-core/es/element/xml.js ***! \******************************************************/ -/*! no static exports found */ +/*! exports provided: xmlDataRenderer, parseXML, getBBox, generateTarget, compareTwoTarget, createNodeFromXML */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AST_TOKEN_TYPES\", function() { return AST_TOKEN_TYPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AST_NODE_TYPES\", function() { return AST_NODE_TYPES; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"STORAGE_CLASS\", function() { return STORAGE_CLASS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Target\", function() { return Target; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DefineValuePlaceholder\", function() { return DefineValuePlaceholder; });\n/* harmony import */ var reflect_metadata__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! reflect-metadata */ \"./node_modules/reflect-metadata/Reflect.js\");\n/* harmony import */ var reflect_metadata__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reflect_metadata__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Component\", function() { return _ComponentManager__WEBPACK_IMPORTED_MODULE_1__[\"Component\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ComponentManager\", function() { return _ComponentManager__WEBPACK_IMPORTED_MODULE_1__[\"ComponentManager\"]; });\n\n/* harmony import */ var _components_framegraph_System__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./components/framegraph/System */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/System.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"FrameGraphSystem\", function() { return _components_framegraph_System__WEBPACK_IMPORTED_MODULE_2__[\"FrameGraphSystem\"]; });\n\n/* harmony import */ var _components_geometry_GeometryComponent__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./components/geometry/GeometryComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/geometry/GeometryComponent.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GeometryComponent\", function() { return _components_geometry_GeometryComponent__WEBPACK_IMPORTED_MODULE_3__[\"GeometryComponent\"]; });\n\n/* harmony import */ var _components_geometry_System__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/geometry/System */ \"./node_modules/@antv/g-webgpu-core/es/components/geometry/System.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GeometrySystem\", function() { return _components_geometry_System__WEBPACK_IMPORTED_MODULE_4__[\"GeometrySystem\"]; });\n\n/* harmony import */ var _components_material_MaterialComponent__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/material/MaterialComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/material/MaterialComponent.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MaterialComponent\", function() { return _components_material_MaterialComponent__WEBPACK_IMPORTED_MODULE_5__[\"MaterialComponent\"]; });\n\n/* harmony import */ var _components_material_System__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/material/System */ \"./node_modules/@antv/g-webgpu-core/es/components/material/System.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MaterialSystem\", function() { return _components_material_System__WEBPACK_IMPORTED_MODULE_6__[\"MaterialSystem\"]; });\n\n/* harmony import */ var _components_mesh_CullableComponent__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/mesh/CullableComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/mesh/CullableComponent.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CullableComponent\", function() { return _components_mesh_CullableComponent__WEBPACK_IMPORTED_MODULE_7__[\"CullableComponent\"]; });\n\n/* harmony import */ var _components_mesh_MeshComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/mesh/MeshComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/mesh/MeshComponent.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MeshComponent\", function() { return _components_mesh_MeshComponent__WEBPACK_IMPORTED_MODULE_8__[\"MeshComponent\"]; });\n\n/* harmony import */ var _components_mesh_System__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/mesh/System */ \"./node_modules/@antv/g-webgpu-core/es/components/mesh/System.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MeshSystem\", function() { return _components_mesh_System__WEBPACK_IMPORTED_MODULE_9__[\"MeshSystem\"]; });\n\n/* harmony import */ var _components_renderer_passes_PixelPickingPass__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/renderer/passes/PixelPickingPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/PixelPickingPass.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PixelPickingPass\", function() { return _components_renderer_passes_PixelPickingPass__WEBPACK_IMPORTED_MODULE_10__[\"PixelPickingPass\"]; });\n\n/* harmony import */ var _components_renderer_System__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./components/renderer/System */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/System.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"RendererSystem\", function() { return _components_renderer_System__WEBPACK_IMPORTED_MODULE_11__[\"RendererSystem\"]; });\n\n/* harmony import */ var _components_scenegraph_HierarchyComponent__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./components/scenegraph/HierarchyComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/scenegraph/HierarchyComponent.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"HierarchyComponent\", function() { return _components_scenegraph_HierarchyComponent__WEBPACK_IMPORTED_MODULE_12__[\"HierarchyComponent\"]; });\n\n/* harmony import */ var _components_scenegraph_System__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./components/scenegraph/System */ \"./node_modules/@antv/g-webgpu-core/es/components/scenegraph/System.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SceneGraphSystem\", function() { return _components_scenegraph_System__WEBPACK_IMPORTED_MODULE_13__[\"SceneGraphSystem\"]; });\n\n/* harmony import */ var _components_scenegraph_TransformComponent__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./components/scenegraph/TransformComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/scenegraph/TransformComponent.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TransformComponent\", function() { return _components_scenegraph_TransformComponent__WEBPACK_IMPORTED_MODULE_14__[\"TransformComponent\"]; });\n\n/* harmony import */ var _Entity__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./Entity */ \"./node_modules/@antv/g-webgpu-core/es/Entity.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"createEntity\", function() { return _Entity__WEBPACK_IMPORTED_MODULE_15__[\"createEntity\"]; });\n\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"IDENTIFIER\", function() { return _identifier__WEBPACK_IMPORTED_MODULE_16__[\"IDENTIFIER\"]; });\n\n/* harmony import */ var _inversify_config__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./inversify.config */ \"./node_modules/@antv/g-webgpu-core/es/inversify.config.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"container\", function() { return _inversify_config__WEBPACK_IMPORTED_MODULE_17__[\"container\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"createWorldContainer\", function() { return _inversify_config__WEBPACK_IMPORTED_MODULE_17__[\"createWorldContainer\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lazyInject\", function() { return _inversify_config__WEBPACK_IMPORTED_MODULE_17__[\"lazyInject\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lazyMultiInject\", function() { return _inversify_config__WEBPACK_IMPORTED_MODULE_17__[\"lazyMultiInject\"]; });\n\n/* harmony import */ var _utils_aabb__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./utils/aabb */ \"./node_modules/@antv/g-webgpu-core/es/utils/aabb.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"generateAABBFromVertices\", function() { return _utils_aabb__WEBPACK_IMPORTED_MODULE_18__[\"generateAABBFromVertices\"]; });\n\n/* harmony import */ var _utils_isSafari__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./utils/isSafari */ \"./node_modules/@antv/g-webgpu-core/es/utils/isSafari.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isSafari\", function() { return _utils_isSafari__WEBPACK_IMPORTED_MODULE_19__[\"isSafari\"]; });\n\n/* empty/unused harmony star reexport *//* harmony import */ var _services__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./services */ \"./node_modules/@antv/g-webgpu-core/es/services/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ConfigService\", function() { return _services__WEBPACK_IMPORTED_MODULE_20__[\"ConfigService\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"IInteractorEvent\", function() { return _services__WEBPACK_IMPORTED_MODULE_20__[\"IInteractorEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InteractorService\", function() { return _services__WEBPACK_IMPORTED_MODULE_20__[\"InteractorService\"]; });\n\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g-webgpu-core/es/shape/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AABB\", function() { return _shape__WEBPACK_IMPORTED_MODULE_21__[\"AABB\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BoundingSphere\", function() { return _shape__WEBPACK_IMPORTED_MODULE_21__[\"BoundingSphere\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Mask\", function() { return _shape__WEBPACK_IMPORTED_MODULE_21__[\"Mask\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Frustum\", function() { return _shape__WEBPACK_IMPORTED_MODULE_21__[\"Frustum\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Plane\", function() { return _shape__WEBPACK_IMPORTED_MODULE_21__[\"Plane\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Ray\", function() { return _shape__WEBPACK_IMPORTED_MODULE_21__[\"Ray\"]; });\n\n/* harmony import */ var _components_renderer__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./components/renderer */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/index.js\");\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _components_renderer__WEBPACK_IMPORTED_MODULE_22__) if([\"default\",\"container\",\"createWorldContainer\",\"lazyInject\",\"lazyMultiInject\",\"createEntity\",\"Component\",\"ComponentManager\",\"IDENTIFIER\",\"FrameGraphSystem\",\"GeometrySystem\",\"RendererSystem\",\"MaterialSystem\",\"MeshSystem\",\"SceneGraphSystem\",\"CullableComponent\",\"MeshComponent\",\"TransformComponent\",\"MaterialComponent\",\"GeometryComponent\",\"HierarchyComponent\",\"isSafari\",\"generateAABBFromVertices\",\"PixelPickingPass\",\"AST_TOKEN_TYPES\",\"AST_NODE_TYPES\",\"STORAGE_CLASS\",\"Target\",\"DefineValuePlaceholder\",\"ConfigService\",\"IInteractorEvent\",\"InteractorService\",\"AABB\",\"BoundingSphere\",\"Mask\",\"Frustum\",\"Plane\",\"Ray\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _components_renderer__WEBPACK_IMPORTED_MODULE_22__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _components_material_interface__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./components/material/interface */ \"./node_modules/@antv/g-webgpu-core/es/components/material/interface.js\");\n/* harmony import */ var _components_material_interface__WEBPACK_IMPORTED_MODULE_23___default = /*#__PURE__*/__webpack_require__.n(_components_material_interface__WEBPACK_IMPORTED_MODULE_23__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _components_material_interface__WEBPACK_IMPORTED_MODULE_23__) if([\"default\",\"container\",\"createWorldContainer\",\"lazyInject\",\"lazyMultiInject\",\"createEntity\",\"Component\",\"ComponentManager\",\"IDENTIFIER\",\"FrameGraphSystem\",\"GeometrySystem\",\"RendererSystem\",\"MaterialSystem\",\"MeshSystem\",\"SceneGraphSystem\",\"CullableComponent\",\"MeshComponent\",\"TransformComponent\",\"MaterialComponent\",\"GeometryComponent\",\"HierarchyComponent\",\"isSafari\",\"generateAABBFromVertices\",\"PixelPickingPass\",\"AST_TOKEN_TYPES\",\"AST_NODE_TYPES\",\"STORAGE_CLASS\",\"Target\",\"DefineValuePlaceholder\",\"ConfigService\",\"IInteractorEvent\",\"InteractorService\",\"AABB\",\"BoundingSphere\",\"Mask\",\"Frustum\",\"Plane\",\"Ray\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _components_material_interface__WEBPACK_IMPORTED_MODULE_23__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _components_mesh_interface__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./components/mesh/interface */ \"./node_modules/@antv/g-webgpu-core/es/components/mesh/interface.js\");\n/* harmony import */ var _components_mesh_interface__WEBPACK_IMPORTED_MODULE_24___default = /*#__PURE__*/__webpack_require__.n(_components_mesh_interface__WEBPACK_IMPORTED_MODULE_24__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _components_mesh_interface__WEBPACK_IMPORTED_MODULE_24__) if([\"default\",\"container\",\"createWorldContainer\",\"lazyInject\",\"lazyMultiInject\",\"createEntity\",\"Component\",\"ComponentManager\",\"IDENTIFIER\",\"FrameGraphSystem\",\"GeometrySystem\",\"RendererSystem\",\"MaterialSystem\",\"MeshSystem\",\"SceneGraphSystem\",\"CullableComponent\",\"MeshComponent\",\"TransformComponent\",\"MaterialComponent\",\"GeometryComponent\",\"HierarchyComponent\",\"isSafari\",\"generateAABBFromVertices\",\"PixelPickingPass\",\"AST_TOKEN_TYPES\",\"AST_NODE_TYPES\",\"STORAGE_CLASS\",\"Target\",\"DefineValuePlaceholder\",\"ConfigService\",\"IInteractorEvent\",\"InteractorService\",\"AABB\",\"BoundingSphere\",\"Mask\",\"Frustum\",\"Plane\",\"Ray\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _components_mesh_interface__WEBPACK_IMPORTED_MODULE_24__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _components_renderer__WEBPACK_IMPORTED_MODULE_22__) if([\"default\",\"container\",\"createWorldContainer\",\"lazyInject\",\"lazyMultiInject\",\"createEntity\",\"Component\",\"ComponentManager\",\"IDENTIFIER\",\"FrameGraphSystem\",\"GeometrySystem\",\"RendererSystem\",\"MaterialSystem\",\"MeshSystem\",\"SceneGraphSystem\",\"CullableComponent\",\"MeshComponent\",\"TransformComponent\",\"MaterialComponent\",\"GeometryComponent\",\"HierarchyComponent\",\"isSafari\",\"generateAABBFromVertices\",\"PixelPickingPass\",\"AST_TOKEN_TYPES\",\"AST_NODE_TYPES\",\"STORAGE_CLASS\",\"Target\",\"DefineValuePlaceholder\",\"ConfigService\",\"IInteractorEvent\",\"InteractorService\",\"AABB\",\"BoundingSphere\",\"Mask\",\"Frustum\",\"Plane\",\"Ray\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _components_renderer__WEBPACK_IMPORTED_MODULE_22__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n// tslint:disable-next-line:no-reference\n/// \n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n/**\n * inspired by Entitas' Systems\n * @see https://github.com/sschmid/Entitas-CSharp/wiki/Systems\n */\n\nvar AST_TOKEN_TYPES;\n\n(function (AST_TOKEN_TYPES) {\n AST_TOKEN_TYPES[\"Void\"] = \"Void\";\n AST_TOKEN_TYPES[\"Boolean\"] = \"Boolean\";\n AST_TOKEN_TYPES[\"Float\"] = \"Float\";\n AST_TOKEN_TYPES[\"Uint32\"] = \"Uint32\";\n AST_TOKEN_TYPES[\"Int32\"] = \"Int32\";\n AST_TOKEN_TYPES[\"Vector\"] = \"Vector\";\n AST_TOKEN_TYPES[\"Vector2Float\"] = \"vec2\";\n AST_TOKEN_TYPES[\"Vector3Float\"] = \"vec3\";\n AST_TOKEN_TYPES[\"Vector4Float\"] = \"vec4\";\n AST_TOKEN_TYPES[\"Vector2Boolean\"] = \"vec2\";\n AST_TOKEN_TYPES[\"Vector3Boolean\"] = \"vec3\";\n AST_TOKEN_TYPES[\"Vector4Boolean\"] = \"vec4\";\n AST_TOKEN_TYPES[\"Vector2Uint\"] = \"vec2\";\n AST_TOKEN_TYPES[\"Vector3Uint\"] = \"vec3\";\n AST_TOKEN_TYPES[\"Vector4Uint\"] = \"vec4\";\n AST_TOKEN_TYPES[\"Vector2Int\"] = \"vec2\";\n AST_TOKEN_TYPES[\"Vector3Int\"] = \"vec3\";\n AST_TOKEN_TYPES[\"Vector4Int\"] = \"vec4\";\n AST_TOKEN_TYPES[\"Matrix\"] = \"Matrix\";\n AST_TOKEN_TYPES[\"Matrix3x3Float\"] = \"mat3x3\";\n AST_TOKEN_TYPES[\"Matrix4x4Float\"] = \"mat4x4\";\n AST_TOKEN_TYPES[\"Struct\"] = \"Struct\";\n AST_TOKEN_TYPES[\"FloatArray\"] = \"Float[]\";\n AST_TOKEN_TYPES[\"Vector4FloatArray\"] = \"vec4[]\";\n})(AST_TOKEN_TYPES || (AST_TOKEN_TYPES = {}));\n\nvar AST_NODE_TYPES;\n\n(function (AST_NODE_TYPES) {\n AST_NODE_TYPES[\"Program\"] = \"Program\";\n AST_NODE_TYPES[\"Identifier\"] = \"Identifier\";\n AST_NODE_TYPES[\"VariableDeclaration\"] = \"VariableDeclaration\";\n AST_NODE_TYPES[\"BlockStatement\"] = \"BlockStatement\";\n AST_NODE_TYPES[\"ReturnStatement\"] = \"ReturnStatement\";\n AST_NODE_TYPES[\"FunctionDeclaration\"] = \"FunctionDeclaration\";\n AST_NODE_TYPES[\"VariableDeclarator\"] = \"VariableDeclarator\";\n AST_NODE_TYPES[\"AssignmentExpression\"] = \"AssignmentExpression\";\n AST_NODE_TYPES[\"LogicalExpression\"] = \"LogicalExpression\";\n AST_NODE_TYPES[\"BinaryExpression\"] = \"BinaryExpression\";\n AST_NODE_TYPES[\"ArrayExpression\"] = \"ArrayExpression\";\n AST_NODE_TYPES[\"UnaryExpression\"] = \"UnaryExpression\";\n AST_NODE_TYPES[\"UpdateExpression\"] = \"UpdateExpression\";\n AST_NODE_TYPES[\"FunctionExpression\"] = \"FunctionExpression\";\n AST_NODE_TYPES[\"MemberExpression\"] = \"MemberExpression\";\n AST_NODE_TYPES[\"ConditionalExpression\"] = \"ConditionalExpression\";\n AST_NODE_TYPES[\"ExpressionStatement\"] = \"ExpressionStatement\";\n AST_NODE_TYPES[\"CallExpression\"] = \"CallExpression\";\n AST_NODE_TYPES[\"NumThreadStatement\"] = \"NumThreadStatement\";\n AST_NODE_TYPES[\"StorageStatement\"] = \"StorageStatement\";\n AST_NODE_TYPES[\"DoWhileStatement\"] = \"DoWhileStatement\";\n AST_NODE_TYPES[\"WhileStatement\"] = \"WhileStatement\";\n AST_NODE_TYPES[\"ForStatement\"] = \"ForStatement\";\n AST_NODE_TYPES[\"BreakStatement\"] = \"BreakStatement\";\n AST_NODE_TYPES[\"ContinueStatement\"] = \"ContinueStatement\";\n AST_NODE_TYPES[\"IfStatement\"] = \"IfStatement\";\n AST_NODE_TYPES[\"ImportedFunctionStatement\"] = \"ImportedFunctionStatement\";\n})(AST_NODE_TYPES || (AST_NODE_TYPES = {}));\n\nvar STORAGE_CLASS;\n\n(function (STORAGE_CLASS) {\n STORAGE_CLASS[\"Input\"] = \"Input\";\n STORAGE_CLASS[\"Output\"] = \"Output\";\n STORAGE_CLASS[\"Uniform\"] = \"Uniform\";\n STORAGE_CLASS[\"Workgroup\"] = \"Workgroup\";\n STORAGE_CLASS[\"UniformConstant\"] = \"UniformConstant\";\n STORAGE_CLASS[\"Image\"] = \"Image\";\n STORAGE_CLASS[\"StorageBuffer\"] = \"StorageBuffer\";\n STORAGE_CLASS[\"Private\"] = \"Private\";\n STORAGE_CLASS[\"Function\"] = \"Function\";\n})(STORAGE_CLASS || (STORAGE_CLASS = {}));\n\n/**\n * 根据目标平台生成 Shader 代码\n * * WebGL GLSL 1.0\n * * WebGPU Chrome/Edge GLSL 4.5 & WGSL @see https://gpuweb.github.io/gpuweb/wgsl.html\n * * Safari WHLSL (maybe deprecated)\n */\nvar Target;\n\n(function (Target) {\n Target[\"GLSL100\"] = \"GLSL100\";\n Target[\"GLSL450\"] = \"GLSL450\";\n Target[\"WGSL\"] = \"WGSL\";\n})(Target || (Target = {}));\n\nvar DefineValuePlaceholder = '__DefineValuePlaceholder__';\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"xmlDataRenderer\", function() { return xmlDataRenderer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseXML\", function() { return parseXML; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBox\", function() { return getBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generateTarget\", function() { return generateTarget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compareTwoTarget\", function() { return compareTwoTarget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createNodeFromXML\", function() { return createNodeFromXML; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n * @fileOverview 从xml建立自定义Node,包含update\n * @author xuzhi.mxz@antfin.com\n */\n\n\n\n/**\n * 一种更宽松的JSON 解析,如果遇到不符合规范的字段会直接转为字符串\n * @param text json 内容\n */\nfunction looseJSONParse(text) {\n if (typeof text !== 'string') {\n return text;\n }\n var safeParse = function safeParse(str) {\n if (typeof str !== 'string') {\n return str;\n }\n try {\n return JSON.parse(str.trim());\n } catch (e) {\n return str.trim();\n }\n };\n var firstAttempt = safeParse(text);\n if (typeof firstAttempt !== 'string') {\n return firstAttempt;\n }\n var tail = function tail(arr) {\n return arr[arr.length - 1];\n };\n var str = text.trim();\n var objectStack = [];\n var syntaxStack = [];\n var isLastPair = function isLastPair() {\n var syntaxes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n syntaxes[_i] = arguments[_i];\n }\n return syntaxes.some(function (syntax) {\n return tail(syntaxStack) === syntax;\n });\n };\n var getValueStore = function getValueStore() {\n return tail(objectStack);\n };\n var rst = null;\n var i = 0;\n var temp = '';\n while (i < str.length) {\n var nowChar = str[i];\n var isInString = isLastPair('\"', \"'\");\n if (!isInString && !nowChar.trim()) {\n i += 1;\n continue;\n }\n var isLastTranslate = str[i - 1] === '\\\\';\n var isInObject = isLastPair('}');\n var isInArray = isLastPair(']');\n var isWaitingValue = isLastPair(',');\n var tempArr = getValueStore();\n if (isInString) {\n if (tail(syntaxStack) === nowChar && !isLastTranslate) {\n syntaxStack.pop();\n var value = safeParse(temp);\n tempArr.push(value);\n rst = value;\n temp = '';\n } else {\n temp += nowChar;\n }\n } else if (isInArray && nowChar === ',') {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n } else if (isInObject && nowChar === ':') {\n syntaxStack.push(',');\n if (temp) {\n tempArr.push(temp);\n temp = '';\n }\n } else if (isWaitingValue && nowChar === ',') {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n syntaxStack.pop();\n } else if (nowChar === '}' && (isInObject || isWaitingValue)) {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n if (isWaitingValue) {\n syntaxStack.pop();\n }\n var obj = {};\n for (var c = 1; c < tempArr.length; c += 2) {\n obj[tempArr[c - 1]] = tempArr[c];\n }\n objectStack.pop();\n if (objectStack.length) {\n tail(objectStack).push(obj);\n }\n syntaxStack.pop();\n rst = obj;\n } else if (nowChar === ']' && isInArray) {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n objectStack.pop();\n if (objectStack.length) {\n tail(objectStack).push(tempArr);\n }\n syntaxStack.pop();\n rst = tempArr;\n } else if (nowChar === '{') {\n objectStack.push([]);\n syntaxStack.push('}');\n } else if (nowChar === '[') {\n objectStack.push([]);\n syntaxStack.push(']');\n } else if (nowChar === '\"') {\n syntaxStack.push('\"');\n } else if (nowChar === \"'\") {\n syntaxStack.push(\"'\");\n } else {\n temp += nowChar;\n }\n i += 1;\n }\n return rst || temp;\n}\nvar keyConvert = function keyConvert(str) {\n return str.split('-').reduce(function (a, b) {\n return a + b.charAt(0).toUpperCase() + b.slice(1);\n });\n};\n/**\n * 简单的一个{{}}模板渲染,不包含任何复杂语法\n * @param xml\n */\nvar xmlDataRenderer = function xmlDataRenderer(xml) {\n return function (data) {\n var len = xml.length;\n var arr = [];\n var i = 0;\n var tmp = '';\n while (i < len) {\n if (xml[i] === '{' && xml[i + 1] === '{') {\n arr.push(tmp);\n tmp = '';\n i += 2;\n } else if (xml[i] === '}' && xml[i + 1] === '}') {\n if (arr.length) {\n var last = arr.pop();\n tmp = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"get\"])(data, tmp, last.endsWith('=') ? \"\\\"{\".concat(tmp, \"}\\\"\") : tmp);\n arr.push(last + tmp);\n }\n i += 2;\n tmp = '';\n } else {\n tmp += xml[i];\n i += 1;\n }\n }\n arr.push(tmp);\n return arr.map(function (e, index) {\n return arr[index - 1] && arr[index - 1].endsWith('=') ? \"\\\"{\".concat(e, \"}\\\"\") : e;\n }).join('');\n };\n};\n/**\n * 解析XML,并转化为相应的JSON结构\n * @param xml xml解析后的节点\n */\nfunction parseXML(xml, cfg) {\n var attrs = {};\n var keys = xml.getAttributeNames && xml.getAttributeNames() || [];\n var children = xml.children && Array.from(xml.children).map(function (e) {\n return parseXML(e, cfg);\n });\n var rst = {};\n var tagName = xml.tagName ? xml.tagName.toLowerCase() : 'group';\n if (tagName === 'text') {\n attrs.text = xml.innerText;\n }\n rst.type = tagName;\n if (tagName === 'img') {\n rst.type = 'image';\n }\n Array.from(keys).forEach(function (k) {\n var key = keyConvert(k);\n var val = xml.getAttribute(k);\n try {\n if (key === 'style' || key === 'attrs') {\n var style = looseJSONParse(val);\n attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, attrs), style);\n } else {\n rst[key] = looseJSONParse(val);\n }\n } catch (e) {\n if (key === 'style') {\n throw e;\n }\n rst[key] = val;\n }\n });\n rst.attrs = attrs;\n if (cfg && cfg.style && rst.name && _typeof(cfg.style[rst.name]) === 'object') {\n rst.attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, rst.attrs), cfg.style[rst.name]);\n }\n if (cfg && cfg.style && rst.keyshape) {\n rst.attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, rst.attrs), cfg.style);\n }\n if (children.length) {\n rst.children = children;\n }\n return rst;\n}\n/**\n * 根据偏移量和内部节点最终的bounding box来得出该shape最终的bbox\n */\nfunction getBBox(node, offset, childrenBBox) {\n var _a = node.attrs,\n attrs = _a === void 0 ? {} : _a;\n var bbox = {\n x: offset.x || 0,\n y: offset.y || 0,\n width: childrenBBox.width || 0,\n height: childrenBBox.height || 0\n };\n var shapeHeight, shapeWidth;\n switch (node.type) {\n case 'maker':\n case 'circle':\n if (attrs.r) {\n shapeWidth = 2 * attrs.r;\n shapeHeight = 2 * attrs.r;\n }\n break;\n case 'text':\n if (attrs.text) {\n shapeWidth = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_2__[\"getTextSize\"])(attrs.text, attrs.fontSize || 12)[0];\n shapeHeight = 16;\n bbox.y += shapeHeight;\n bbox.height = shapeHeight;\n bbox.width = shapeWidth;\n node.attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n fontSize: 12,\n fill: '#000'\n }, attrs);\n }\n break;\n default:\n if (attrs.width) {\n shapeWidth = attrs.width;\n }\n if (attrs.height) {\n shapeHeight = attrs.height;\n }\n }\n if (shapeHeight >= 0) {\n bbox.height = shapeHeight;\n }\n if (shapeWidth >= 0) {\n bbox.width = shapeWidth;\n }\n if (attrs.marginTop) {\n bbox.y += attrs.marginTop;\n }\n if (attrs.marginLeft) {\n bbox.x += attrs.marginLeft;\n }\n return bbox;\n}\n/**\n * 把从xml计算出的结构填上位置信息,补全attrs\n * @param target\n * @param lastOffset\n */\nfunction generateTarget(target, lastOffset) {\n var _a;\n if (lastOffset === void 0) {\n lastOffset = {\n x: 0,\n y: 0\n };\n }\n var defaultBbox = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n width: 0,\n height: 0\n }, lastOffset);\n if ((_a = target.children) === null || _a === void 0 ? void 0 : _a.length) {\n var _b = target.attrs,\n attrs = _b === void 0 ? {} : _b;\n var marginTop = attrs.marginTop;\n var offset = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, lastOffset);\n if (marginTop) {\n offset.y += marginTop;\n }\n for (var index = 0; index < target.children.length; index++) {\n target.children[index].attrs.key = \"\".concat(attrs.key || 'root', \" -\").concat(index, \" \");\n var node = generateTarget(target.children[index], offset);\n if (node.bbox) {\n var bbox = node.bbox;\n if (node.attrs.next === 'inline') {\n offset.x += node.bbox.width;\n } else {\n offset.y += node.bbox.height;\n }\n if (bbox.width + bbox.x > defaultBbox.width) {\n defaultBbox.width = bbox.width + bbox.x;\n }\n if (bbox.height + bbox.y > defaultBbox.height) {\n defaultBbox.height = bbox.height + bbox.y;\n }\n }\n }\n }\n target.bbox = getBBox(target, lastOffset, defaultBbox);\n target.attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, target.attrs), target.bbox);\n return target;\n}\n/**\n * 对比前后两个最终计算出来的node,并对比出最小改动,\n * 动作: 'add' 添加节点 | ’delete‘ 删除节点 | ’change‘ 改变节点attrs | 'restructure' 重构节点\n * @param nowTarget\n * @param formerTarget\n */\nfunction compareTwoTarget(nowTarget, formerTarget) {\n var _a, _b, _c, _d;\n var type = (nowTarget || {}).type;\n var key = ((formerTarget === null || formerTarget === void 0 ? void 0 : formerTarget.attrs) || {}).key;\n if (key && nowTarget) {\n nowTarget.attrs.key = key;\n }\n if (!nowTarget && formerTarget) {\n return {\n action: 'delete',\n val: formerTarget,\n type: type,\n key: key\n };\n }\n if (nowTarget && !formerTarget) {\n return {\n action: 'add',\n val: nowTarget,\n type: type\n };\n }\n if (!nowTarget && !formerTarget) {\n return {\n action: 'same',\n type: type\n };\n }\n var children = [];\n if (((_a = nowTarget.children) === null || _a === void 0 ? void 0 : _a.length) > 0 || ((_b = formerTarget.children) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n var length_1 = Math.max((_c = nowTarget.children) === null || _c === void 0 ? void 0 : _c.length, (_d = formerTarget.children) === null || _d === void 0 ? void 0 : _d.length);\n var formerChildren = formerTarget.children || [];\n var nowChildren = nowTarget.children || [];\n for (var index = 0; index < length_1; index += 1) {\n children.push(compareTwoTarget(nowChildren[index], formerChildren[index]));\n }\n }\n var formerKeys = Object.keys(formerTarget.attrs);\n var nowKeys = Object.keys(nowTarget.attrs);\n if (formerTarget.type !== nowTarget.type) {\n return {\n action: 'restructure',\n nowTarget: nowTarget,\n formerTarget: formerTarget,\n key: key,\n children: children\n };\n }\n if (formerKeys.filter(function (e) {\n return e !== 'children';\n }).some(function (e) {\n return nowTarget.attrs[e] !== formerTarget.attrs[e] || !nowKeys.includes(e);\n })) {\n return {\n action: 'change',\n val: nowTarget,\n children: children,\n type: type,\n key: key\n };\n }\n return {\n action: 'same',\n children: children,\n type: type,\n key: key\n };\n}\n/**\n * 根据xml或者返回xml的函数构建自定义节点的结构\n * @param gen\n */\nfunction createNodeFromXML(gen) {\n var structures = {};\n var compileXML = function compileXML(cfg) {\n var rawStr = typeof gen === 'function' ? gen(cfg) : gen;\n var target = xmlDataRenderer(rawStr)(cfg);\n var xmlParser = document.createElement('div');\n xmlParser.innerHTML = target;\n var xml = xmlParser.children[0];\n var result = generateTarget(parseXML(xml, cfg));\n xmlParser.remove();\n return result;\n };\n return {\n draw: function draw(cfg, group) {\n var resultTarget = compileXML(cfg);\n var keyshape = group;\n var renderTarget = function renderTarget(target) {\n var _a = target.attrs,\n attrs = _a === void 0 ? {} : _a,\n bbox = target.bbox,\n type = target.type,\n children = target.children,\n rest = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(target, [\"attrs\", \"bbox\", \"type\", \"children\"]);\n if (target.type !== 'group') {\n var shape = group.addShape(target.type, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n attrs: attrs,\n origin: {\n bbox: bbox,\n type: type,\n children: children\n }\n }, rest));\n if (target.keyshape) {\n keyshape = shape;\n }\n }\n if (target.children) {\n target.children.forEach(function (n) {\n return renderTarget(n);\n });\n }\n };\n renderTarget(resultTarget);\n structures[cfg.id] = [resultTarget];\n return keyshape;\n },\n update: function update(cfg, node) {\n if (!structures[cfg.id]) {\n structures[cfg.id] = [];\n }\n var container = node.getContainer();\n var children = container.get('children');\n var newTarget = compileXML(cfg);\n var lastTarget = structures[cfg.id].pop();\n var diffResult = compareTwoTarget(newTarget, lastTarget);\n var addShape = function addShape(shape) {\n var _a;\n if (shape.type !== 'group') {\n container.addShape(shape.type, {\n attrs: shape.attrs\n });\n }\n if ((_a = shape.children) === null || _a === void 0 ? void 0 : _a.length) {\n shape.children.map(function (e) {\n return addShape(e);\n });\n }\n };\n var delShape = function delShape(shape) {\n var _a;\n var targetShape = children.find(function (e) {\n return e.attrs.key === shape.attrs.key;\n });\n if (targetShape) {\n container.removeChild(targetShape);\n }\n if ((_a = shape.children) === null || _a === void 0 ? void 0 : _a.length) {\n shape.children.map(function (e) {\n return delShape(e);\n });\n }\n };\n var updateTarget = function updateTarget(target) {\n var key = target.key;\n if (target.type !== 'group') {\n var targetShape = children.find(function (e) {\n return e.attrs.key === key;\n });\n switch (target.action) {\n case 'change':\n if (targetShape) {\n var originAttr = target.val.keyshape ? node.getOriginStyle() : {};\n targetShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, originAttr), target.val.attrs));\n }\n break;\n case 'add':\n addShape(target.val);\n break;\n case 'delete':\n delShape(target.val);\n break;\n case 'restructure':\n delShape(target.formerTarget);\n addShape(target.nowTarget);\n break;\n default:\n break;\n }\n }\n if (target.children) {\n target.children.forEach(function (n) {\n return updateTarget(n);\n });\n }\n };\n updateTarget(diffResult);\n structures[cfg.id].push(newTarget);\n },\n getAnchorPoints: function getAnchorPoints() {\n return [[0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0]];\n }\n };\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/xml.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/inversify.config.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/inversify.config.js ***! - \*****************************************************************/ -/*! exports provided: container, lazyInject, lazyMultiInject, createWorldContainer */ +/***/ "./node_modules/@antv/g6-core/es/global.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/global.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"container\", function() { return container; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lazyInject\", function() { return lazyInject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lazyMultiInject\", function() { return lazyMultiInject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createWorldContainer\", function() { return createWorldContainer; });\n/* harmony import */ var reflect_metadata__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! reflect-metadata */ \"./node_modules/reflect-metadata/Reflect.js\");\n/* harmony import */ var reflect_metadata__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(reflect_metadata__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var inversify_inject_decorators__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! inversify-inject-decorators */ \"./node_modules/inversify-inject-decorators/lib/index.js\");\n/* harmony import */ var inversify_inject_decorators__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(inversify_inject_decorators__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _ComponentManager__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./ComponentManager */ \"./node_modules/@antv/g-webgpu-core/es/ComponentManager.js\");\n/* harmony import */ var _components_framegraph_ResourcePool__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./components/framegraph/ResourcePool */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/ResourcePool.js\");\n/* harmony import */ var _components_framegraph_System__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./components/framegraph/System */ \"./node_modules/@antv/g-webgpu-core/es/components/framegraph/System.js\");\n/* harmony import */ var _components_geometry_GeometryComponent__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./components/geometry/GeometryComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/geometry/GeometryComponent.js\");\n/* harmony import */ var _components_geometry_System__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./components/geometry/System */ \"./node_modules/@antv/g-webgpu-core/es/components/geometry/System.js\");\n/* harmony import */ var _components_material_MaterialComponent__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./components/material/MaterialComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/material/MaterialComponent.js\");\n/* harmony import */ var _components_material_System__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./components/material/System */ \"./node_modules/@antv/g-webgpu-core/es/components/material/System.js\");\n/* harmony import */ var _components_mesh_CullableComponent__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./components/mesh/CullableComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/mesh/CullableComponent.js\");\n/* harmony import */ var _components_mesh_MeshComponent__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./components/mesh/MeshComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/mesh/MeshComponent.js\");\n/* harmony import */ var _components_mesh_System__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./components/mesh/System */ \"./node_modules/@antv/g-webgpu-core/es/components/mesh/System.js\");\n/* harmony import */ var _components_renderer_passes_CopyPass__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./components/renderer/passes/CopyPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/CopyPass.js\");\n/* harmony import */ var _components_renderer_passes_PixelPickingPass__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./components/renderer/passes/PixelPickingPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/PixelPickingPass.js\");\n/* harmony import */ var _components_renderer_passes_RenderPass__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./components/renderer/passes/RenderPass */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/passes/RenderPass.js\");\n/* harmony import */ var _components_renderer_System__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./components/renderer/System */ \"./node_modules/@antv/g-webgpu-core/es/components/renderer/System.js\");\n/* harmony import */ var _components_scenegraph_HierarchyComponent__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./components/scenegraph/HierarchyComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/scenegraph/HierarchyComponent.js\");\n/* harmony import */ var _components_scenegraph_NameComponent__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./components/scenegraph/NameComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/scenegraph/NameComponent.js\");\n/* harmony import */ var _components_scenegraph_System__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./components/scenegraph/System */ \"./node_modules/@antv/g-webgpu-core/es/components/scenegraph/System.js\");\n/* harmony import */ var _components_scenegraph_TransformComponent__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./components/scenegraph/TransformComponent */ \"./node_modules/@antv/g-webgpu-core/es/components/scenegraph/TransformComponent.js\");\n/* harmony import */ var _identifier__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./identifier */ \"./node_modules/@antv/g-webgpu-core/es/identifier.js\");\n/* harmony import */ var _services_config_ConfigService__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./services/config/ConfigService */ \"./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js\");\n/* harmony import */ var _services_interactor_IteractorService__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./services/interactor/IteractorService */ \"./node_modules/@antv/g-webgpu-core/es/services/interactor/IteractorService.js\");\n/* harmony import */ var _services_shader_module_ShaderModuleService__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./services/shader-module/ShaderModuleService */ \"./node_modules/@antv/g-webgpu-core/es/services/shader-module/ShaderModuleService.js\");\n/**\n * Root Container\n * @see /dev-docs/IoC 容器、依赖注入与服务说明.md\n */\n\n\n\n\n\n\n\n // import { InteractionSystem } from './components/interaction/System';\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // @see https://github.com/inversify/InversifyJS/blob/master/wiki/container_api.md#defaultscope\n\nvar container = new inversify__WEBPACK_IMPORTED_MODULE_1__[\"Container\"](); // @see https://github.com/inversify/InversifyJS/blob/master/wiki/inheritance.md#what-can-i-do-when-my-base-class-is-provided-by-a-third-party-module\n// decorate(injectable(), EventEmitter);\n// container.bind(IDENTIFIER.IEventEmitter).to(EventEmitter);\n// 支持使用 new 而非容器实例化的场景,同时禁止 lazyInject cache\n// @see https://github.com/inversify/inversify-inject-decorators#caching-vs-non-caching-behaviour\n\nvar DECORATORS = inversify_inject_decorators__WEBPACK_IMPORTED_MODULE_2___default()(container, false);\n// Add babel legacy decorators support\n// @see https://github.com/inversify/InversifyJS/issues/1050\n// @see https://github.com/inversify/InversifyJS/issues/1026#issuecomment-504936034\nvar lazyInject = function lazyInject(serviceIdentifier) {\n var original = DECORATORS.lazyInject(serviceIdentifier); // the 'descriptor' parameter is actually always defined for class fields for Babel, but is considered undefined for TSC\n // so we just hack it with ?/! combination to avoid \"TS1240: Unable to resolve signature of property decorator when called as an expression\"\n\n return function (proto, key, descriptor) {\n // make it work as usual\n original.call(this, proto, key); // return link to proto, so own value wont be 'undefined' after component's creation\n\n if (descriptor) {\n descriptor.initializer = function () {\n return proto[key];\n };\n }\n };\n};\nvar lazyMultiInject = function lazyMultiInject(serviceIdentifier) {\n var original = DECORATORS.lazyMultiInject(serviceIdentifier); // the 'descriptor' parameter is actually always defined for class fields for Babel, but is considered undefined for TSC\n // so we just hack it with ?/! combination to avoid \"TS1240: Unable to resolve signature of property decorator when called as an expression\"\n\n return function (proto, key, descriptor) {\n // make it work as usual\n original.call(this, proto, key);\n\n if (descriptor) {\n // return link to proto, so own value wont be 'undefined' after component's creation\n descriptor.initializer = function () {\n return proto[key];\n };\n }\n };\n};\n/** global services */\n\ncontainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].ShaderModuleService).to(_services_shader_module_ShaderModuleService__WEBPACK_IMPORTED_MODULE_24__[\"default\"]).inSingletonScope();\n/**\n * bind global component managers in root container\n */\n\ncontainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].NameComponentManager).toConstantValue(new _ComponentManager__WEBPACK_IMPORTED_MODULE_3__[\"ComponentManager\"](_components_scenegraph_NameComponent__WEBPACK_IMPORTED_MODULE_18__[\"NameComponent\"]));\ncontainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].HierarchyComponentManager).toConstantValue(new _ComponentManager__WEBPACK_IMPORTED_MODULE_3__[\"ComponentManager\"](_components_scenegraph_HierarchyComponent__WEBPACK_IMPORTED_MODULE_17__[\"HierarchyComponent\"]));\ncontainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].TransformComponentManager).toConstantValue(new _ComponentManager__WEBPACK_IMPORTED_MODULE_3__[\"ComponentManager\"](_components_scenegraph_TransformComponent__WEBPACK_IMPORTED_MODULE_20__[\"TransformComponent\"]));\ncontainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].MeshComponentManager).toConstantValue(new _ComponentManager__WEBPACK_IMPORTED_MODULE_3__[\"ComponentManager\"](_components_mesh_MeshComponent__WEBPACK_IMPORTED_MODULE_11__[\"MeshComponent\"]));\ncontainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].CullableComponentManager).toConstantValue(new _ComponentManager__WEBPACK_IMPORTED_MODULE_3__[\"ComponentManager\"](_components_mesh_CullableComponent__WEBPACK_IMPORTED_MODULE_10__[\"CullableComponent\"]));\ncontainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].GeometryComponentManager).toConstantValue(new _ComponentManager__WEBPACK_IMPORTED_MODULE_3__[\"ComponentManager\"](_components_geometry_GeometryComponent__WEBPACK_IMPORTED_MODULE_6__[\"GeometryComponent\"]));\ncontainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].MaterialComponentManager).toConstantValue(new _ComponentManager__WEBPACK_IMPORTED_MODULE_3__[\"ComponentManager\"](_components_material_MaterialComponent__WEBPACK_IMPORTED_MODULE_8__[\"MaterialComponent\"])); // https://github.com/inversify/InversifyJS/blob/master/wiki/hierarchical_di.md#support-for-hierarchical-di-systems\n\nfunction createWorldContainer() {\n var worldContainer = new inversify__WEBPACK_IMPORTED_MODULE_1__[\"Container\"]();\n worldContainer.parent = container;\n /**\n * bind systems\n */\n\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].Systems).to(_components_scenegraph_System__WEBPACK_IMPORTED_MODULE_19__[\"SceneGraphSystem\"]).inSingletonScope().whenTargetNamed(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].SceneGraphSystem);\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].Systems).to(_components_framegraph_System__WEBPACK_IMPORTED_MODULE_5__[\"FrameGraphSystem\"]).inSingletonScope().whenTargetNamed(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].FrameGraphSystem);\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].Systems).to(_components_mesh_System__WEBPACK_IMPORTED_MODULE_12__[\"MeshSystem\"]).inSingletonScope().whenTargetNamed(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].MeshSystem);\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].Systems).to(_components_geometry_System__WEBPACK_IMPORTED_MODULE_7__[\"GeometrySystem\"]).inSingletonScope().whenTargetNamed(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].GeometrySystem);\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].Systems).to(_components_material_System__WEBPACK_IMPORTED_MODULE_9__[\"MaterialSystem\"]).inSingletonScope().whenTargetNamed(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].MaterialSystem);\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].Systems).to(_components_renderer_System__WEBPACK_IMPORTED_MODULE_16__[\"RendererSystem\"]).inSingletonScope().whenTargetNamed(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].RendererSystem); // 资源池\n\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].ResourcePool).to(_components_framegraph_ResourcePool__WEBPACK_IMPORTED_MODULE_4__[\"ResourcePool\"]).inSingletonScope();\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].ConfigService).to(_services_config_ConfigService__WEBPACK_IMPORTED_MODULE_22__[\"ConfigService\"]).inSingletonScope();\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].InteractorService).to(_services_interactor_IteractorService__WEBPACK_IMPORTED_MODULE_23__[\"InteractorService\"]).inSingletonScope();\n /**\n * bind render passes\n */\n\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].RenderPass).to(_components_renderer_passes_RenderPass__WEBPACK_IMPORTED_MODULE_15__[\"RenderPass\"]).inSingletonScope().whenTargetNamed(_components_renderer_passes_RenderPass__WEBPACK_IMPORTED_MODULE_15__[\"RenderPass\"].IDENTIFIER);\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].RenderPass).to(_components_renderer_passes_CopyPass__WEBPACK_IMPORTED_MODULE_13__[\"CopyPass\"]).inSingletonScope().whenTargetNamed(_components_renderer_passes_CopyPass__WEBPACK_IMPORTED_MODULE_13__[\"CopyPass\"].IDENTIFIER);\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].RenderPass).to(_components_renderer_passes_PixelPickingPass__WEBPACK_IMPORTED_MODULE_14__[\"PixelPickingPass\"]).inSingletonScope().whenTargetNamed(_components_renderer_passes_PixelPickingPass__WEBPACK_IMPORTED_MODULE_14__[\"PixelPickingPass\"].IDENTIFIER);\n worldContainer.bind(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].RenderPassFactory).toFactory(function (context) {\n return function (name) {\n return context.container.getNamed(_identifier__WEBPACK_IMPORTED_MODULE_21__[\"IDENTIFIER\"].RenderPass, name);\n };\n });\n return worldContainer;\n}\n//# sourceMappingURL=inversify.config.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/inversify.config.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar subjectColor = 'rgb(95, 149, 255)';\nvar backColor = 'rgb(255, 255, 255)';\nvar textColor = 'rgb(0, 0, 0)';\nvar activeFill = 'rgb(247, 250, 255)';\nvar nodeMainFill = 'rgb(239, 244, 255)';\nvar comboFill = 'rgb(253, 253, 253)';\nvar disabledFill = 'rgb(250, 250, 250)';\nvar edgeMainStroke = 'rgb(224, 224, 224)';\nvar edgeInactiveStroke = 'rgb(234, 234, 234)';\nvar edgeDisablesStroke = 'rgb(245, 245, 245)';\nvar inactiveStroke = 'rgb(191, 213, 255)';\nvar highlightStroke = '#4572d9';\nvar highlightFill = 'rgb(223, 234, 255)';\nvar colorSet = {\n // for nodes\n mainStroke: subjectColor,\n mainFill: nodeMainFill,\n activeStroke: subjectColor,\n activeFill: activeFill,\n inactiveStroke: inactiveStroke,\n inactiveFill: activeFill,\n selectedStroke: subjectColor,\n selectedFill: backColor,\n highlightStroke: highlightStroke,\n highlightFill: highlightFill,\n disableStroke: edgeMainStroke,\n disableFill: disabledFill,\n // for edges\n edgeMainStroke: edgeMainStroke,\n edgeActiveStroke: subjectColor,\n edgeInactiveStroke: edgeInactiveStroke,\n edgeSelectedStroke: subjectColor,\n edgeHighlightStroke: subjectColor,\n edgeDisableStroke: edgeDisablesStroke,\n // for combos\n comboMainStroke: edgeMainStroke,\n comboMainFill: comboFill,\n comboActiveStroke: subjectColor,\n comboActiveFill: activeFill,\n comboInactiveStroke: edgeMainStroke,\n comboInactiveFill: comboFill,\n comboSelectedStroke: subjectColor,\n comboSelectedFill: comboFill,\n comboHighlightStroke: highlightStroke,\n comboHighlightFill: comboFill,\n comboDisableStroke: edgeInactiveStroke,\n comboDisableFill: disabledFill\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: '0.8.23',\n rootContainerClassName: 'root-container',\n nodeContainerClassName: 'node-container',\n edgeContainerClassName: 'edge-container',\n comboContainerClassName: 'combo-container',\n delegateContainerClassName: 'delegate-container',\n defaultLoopPosition: 'top',\n nodeLabel: {\n style: {\n fill: '#000',\n fontSize: 12,\n textAlign: 'center',\n textBaseline: 'middle'\n },\n offset: 4 // 节点的默认文本不居中时的偏移量\n },\n\n defaultNode: {\n type: 'circle',\n style: {\n lineWidth: 1,\n stroke: colorSet.mainStroke,\n fill: nodeMainFill\n },\n size: 20,\n color: colorSet.mainStroke,\n linkPoints: {\n size: 8,\n lineWidth: 1,\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke\n }\n },\n // 节点应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n nodeStateStyles: {\n active: {\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke,\n lineWidth: 2,\n shadowColor: colorSet.mainStroke,\n shadowBlur: 10\n },\n selected: {\n fill: colorSet.selectedFill,\n stroke: colorSet.selectedStroke,\n lineWidth: 4,\n shadowColor: colorSet.selectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n fill: colorSet.highlightFill,\n stroke: colorSet.highlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n fill: colorSet.inactiveFill,\n stroke: colorSet.inactiveStroke,\n lineWidth: 1\n },\n disable: {\n fill: colorSet.disableFill,\n stroke: colorSet.disableStroke,\n lineWidth: 1\n }\n },\n edgeLabel: {\n style: {\n fill: textColor,\n textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n }\n },\n defaultEdge: {\n type: 'line',\n size: 1,\n style: {\n stroke: colorSet.edgeMainStroke,\n lineAppendWidth: 2\n },\n color: colorSet.edgeMainStroke\n },\n // 边应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n edgeStateStyles: {\n active: {\n stroke: colorSet.edgeActiveStroke,\n lineWidth: 1\n },\n selected: {\n stroke: colorSet.edgeSelectedStroke,\n lineWidth: 2,\n shadowColor: colorSet.edgeSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.edgeHighlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.edgeInactiveStroke,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.edgeDisableStroke,\n lineWidth: 1\n }\n },\n comboLabel: {\n style: {\n fill: textColor,\n // textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n },\n refY: 10,\n refX: 10 // Combo 的默认文本不居中时的偏移量\n },\n\n defaultCombo: {\n type: 'circle',\n style: {\n fill: colorSet.comboMainFill,\n lineWidth: 1,\n stroke: colorSet.comboMainStroke,\n r: 5,\n width: 20,\n height: 10\n },\n size: [20, 5],\n color: colorSet.comboMainStroke,\n padding: [25, 20, 15, 20]\n },\n // combo 应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n comboStateStyles: {\n active: {\n stroke: colorSet.comboActiveStroke,\n lineWidth: 1,\n fill: colorSet.comboActiveFill\n },\n selected: {\n stroke: colorSet.comboSelectedStroke,\n lineWidth: 2,\n fill: colorSet.comboSelectedFill,\n shadowColor: colorSet.comboSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.comboHighlightStroke,\n lineWidth: 2,\n fill: colorSet.comboHighlightFill,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.comboInactiveStroke,\n fill: colorSet.comboInactiveFill,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.comboDisableStroke,\n fill: colorSet.comboDisableFill,\n lineWidth: 1\n }\n },\n delegateStyle: {\n fill: '#F3F9FF',\n fillOpacity: 0.5,\n stroke: '#1890FF',\n strokeOpacity: 0.9,\n lineDash: [5, 5]\n },\n windowFontFamily: typeof window !== 'undefined' && window.getComputedStyle && document.body ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif'\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/global.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js ***! - \******************************************************************************/ -/*! exports provided: ConfigService */ +/***/ "./node_modules/@antv/g6-core/es/graph/controller/event.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/graph/controller/event.js ***! + \*****************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ConfigService\", function() { return ConfigService; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nvar _dec, _class, _temp;\n\n\nvar ConfigService = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_2__[\"injectable\"])(), _dec(_class = (_temp = /*#__PURE__*/function () {\n function ConfigService() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ConfigService);\n\n this.config = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ConfigService, [{\n key: \"get\",\n value: function get() {\n return this.config;\n }\n }, {\n key: \"set\",\n value: function set(config) {\n this.config = config;\n }\n }]);\n\n return ConfigService;\n}(), _temp)) || _class);\n//# sourceMappingURL=ConfigService.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar EventController = /** @class */function () {\n function EventController(graph) {\n this.graph = graph;\n this.destroyed = false;\n this.initEvents();\n }\n return EventController;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (EventController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/event.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/services/config/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/services/config/index.js ***! - \**********************************************************************/ -/*! exports provided: ConfigService */ +/***/ "./node_modules/@antv/g6-core/es/graph/controller/index.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/graph/controller/index.js ***! + \*****************************************************************/ +/*! exports provided: ModeController, ViewController, ItemController, StateController */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ConfigService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ConfigService */ \"./node_modules/@antv/g-webgpu-core/es/services/config/ConfigService.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ConfigService\", function() { return _ConfigService__WEBPACK_IMPORTED_MODULE_0__[\"ConfigService\"]; });\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/services/config/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mode */ \"./node_modules/@antv/g6-core/es/graph/controller/mode.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ModeController\", function() { return _mode__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view */ \"./node_modules/@antv/g6-core/es/graph/controller/view.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ViewController\", function() { return _view__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./item */ \"./node_modules/@antv/g6-core/es/graph/controller/item.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ItemController\", function() { return _item__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./state */ \"./node_modules/@antv/g6-core/es/graph/controller/state.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"StateController\", function() { return _state__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/services/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/services/index.js ***! - \***************************************************************/ -/*! exports provided: ConfigService, IInteractorEvent, InteractorService */ +/***/ "./node_modules/@antv/g6-core/es/graph/controller/item.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/graph/controller/item.js ***! + \****************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _config__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./config */ \"./node_modules/@antv/g-webgpu-core/es/services/config/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ConfigService\", function() { return _config__WEBPACK_IMPORTED_MODULE_0__[\"ConfigService\"]; });\n\n/* harmony import */ var _interactor__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./interactor */ \"./node_modules/@antv/g-webgpu-core/es/services/interactor/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"IInteractorEvent\", function() { return _interactor__WEBPACK_IMPORTED_MODULE_1__[\"IInteractorEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InteractorService\", function() { return _interactor__WEBPACK_IMPORTED_MODULE_1__[\"InteractorService\"]; });\n\n/* harmony import */ var _shader_module__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./shader-module */ \"./node_modules/@antv/g-webgpu-core/es/services/shader-module/index.js\");\n/* empty/unused harmony star reexport */\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/services/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _item_edge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../item/edge */ \"./node_modules/@antv/g6-core/es/item/edge.js\");\n/* harmony import */ var _item_node__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../item/node */ \"./node_modules/@antv/g6-core/es/item/node.js\");\n/* harmony import */ var _item_combo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../item/combo */ \"./node_modules/@antv/g6-core/es/item/combo.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n\n\n\n\n\n\nvar NODE = 'node';\nvar EDGE = 'edge';\nvar VEDGE = 'vedge';\nvar COMBO = 'combo';\nvar CFG_PREFIX = 'default';\nvar MAPPER_SUFFIX = 'Mapper';\nvar STATE_SUFFIX = 'stateStyles';\nvar ItemController = /** @class */function () {\n function ItemController(graph) {\n var _this = this;\n this.edgeToBeUpdateMap = {};\n /**\n * 更新边限流,同时可以防止相同的边频繁重复更新\n * */\n this.throttleRefresh = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"throttle\"])(function (_) {\n var graph = _this.graph;\n if (!graph || graph.get('destroyed')) return;\n var edgeToBeUpdateMap = _this.edgeToBeUpdateMap;\n if (!edgeToBeUpdateMap) return;\n var edgeValues = Object.values(edgeToBeUpdateMap);\n if (!edgeValues.length) return;\n edgeValues.forEach(function (obj) {\n var edge = obj.edge;\n if (!edge || edge.destroyed) return;\n var source = edge.getSource();\n var target = edge.getTarget();\n if (!source || source.destroyed || !target || target.destroyed) return;\n edge.refresh(obj.updateType);\n });\n _this.edgeToBeUpdateMap = {};\n }, 16, {\n trailing: true,\n leading: true\n });\n this.graph = graph;\n this.destroyed = false;\n }\n /**\n * 增加 Item 实例\n *\n * @param {ITEM_TYPE} type 实例类型,node 或 edge\n * @param {(NodeConfig & EdgeConfig)} model 数据模型\n * @returns {(Item)}\n * @memberof ItemController\n */\n ItemController.prototype.addItem = function (type, model) {\n var graph = this.graph;\n var vType = type === VEDGE ? EDGE : type;\n var parent = graph.get(\"\".concat(vType, \"Group\")) || graph.get('group');\n var upperType = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"upperFirst\"])(vType);\n var item = null;\n // 获取 this.get('styles') 中的值\n var styles = graph.get(vType + Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"upperFirst\"])(STATE_SUFFIX)) || {};\n var defaultModel = graph.get(CFG_PREFIX + upperType);\n if (model[STATE_SUFFIX]) {\n // 设置 this.get('styles') 中的值\n styles = model[STATE_SUFFIX];\n }\n if (defaultModel) {\n // 很多布局会直接修改原数据模型,所以不能用 merge 的形式,逐个写入原 model 中\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(defaultModel, function (val, cfg) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isObject\"])(val) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(val)) {\n model[cfg] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, val, model[cfg]);\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(val)) {\n model[cfg] = model[cfg] || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(defaultModel[cfg]);\n } else {\n model[cfg] = model[cfg] || defaultModel[cfg];\n }\n });\n }\n var mapper = graph.get(vType + MAPPER_SUFFIX);\n if (mapper) {\n var mappedModel_1 = mapper(model);\n if (mappedModel_1[STATE_SUFFIX]) {\n // 设置 this.get('styles') 中的值\n styles = mappedModel_1[STATE_SUFFIX];\n delete mappedModel_1[STATE_SUFFIX];\n }\n // 如果配置了 defaultEdge 或 defaultNode,则将默认配置的数据也合并进去\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(mappedModel_1, function (val, cfg) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isObject\"])(val) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(val)) {\n model[cfg] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, model[cfg], val);\n } else {\n model[cfg] = mappedModel_1[cfg] || model[cfg];\n }\n });\n }\n graph.emit('beforeadditem', {\n type: type,\n model: model\n });\n if (type === EDGE || type === VEDGE) {\n var source = void 0;\n var target = void 0;\n source = model.source; // eslint-disable-line prefer-destructuring\n target = model.target; // eslint-disable-line prefer-destructuring\n if (source && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(source)) {\n source = graph.findById(source);\n }\n if (target && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(target)) {\n target = graph.findById(target);\n }\n if (!source || !target) {\n console.warn(\"The source or target node of edge \".concat(model.id, \" does not exist!\"));\n return;\n }\n if (source.getType && source.getType() === 'combo') {\n model.isComboEdge = true;\n // graph.updateCombo(source as ICombo);\n }\n\n if (target.getType && target.getType() === 'combo') {\n model.isComboEdge = true;\n // graph.updateCombo(target as ICombo);\n }\n\n item = new _item_edge__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n model: model,\n source: source,\n target: target,\n styles: styles,\n linkCenter: graph.get('linkCenter'),\n group: parent.addGroup()\n });\n } else if (type === NODE) {\n item = new _item_node__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n model: model,\n styles: styles,\n group: parent.addGroup()\n });\n } else if (type === COMBO) {\n var children = model.children;\n var comboBBox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getComboBBox\"])(children, graph);\n var bboxX = void 0,\n bboxY = void 0;\n if (!isNaN(comboBBox.x)) bboxX = comboBBox.x;else if (isNaN(model.x)) bboxX = Math.random() * 100;\n if (!isNaN(comboBBox.y)) bboxY = comboBBox.y;else if (isNaN(model.y)) bboxY = Math.random() * 100;\n if (isNaN(model.x) || isNaN(model.y)) {\n model.x = bboxX;\n model.y = bboxY;\n } else {\n // if there is x y in model, place the combo according to it and move its succeed items. that means, the priority of the combo's position is higher than succeed items'\n var dx = model.x - bboxX;\n var dy = model.y - bboxY;\n // In the same time, adjust the children's positions\n this.updateComboSucceeds(model.id, dx, dy, children);\n }\n var comboGroup = parent.addGroup();\n comboGroup.setZIndex(model.depth);\n item = new _item_combo__WEBPACK_IMPORTED_MODULE_4__[\"default\"]({\n model: model,\n styles: styles,\n animate: graph.get('animate'),\n bbox: model.collapsed ? Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getComboBBox\"])([], graph) : comboBBox,\n group: comboGroup\n });\n // if it is a circle combo, diagonal length of the children's bbox should be the diameter of the combo's bbox\n if (!model.collapsed && item.getKeyShape().get('type') === 'circle') {\n comboBBox.width = Math.hypot(comboBBox.height, comboBBox.width);\n comboBBox.height = comboBBox.width;\n item.set('bbox', comboBBox);\n item.refresh();\n }\n var comboModel_1 = item.getModel();\n (children || []).forEach(function (child) {\n var childItem = graph.findById(child.id);\n item.addChild(childItem);\n child.depth = comboModel_1.depth + 2;\n });\n }\n if (item) {\n item.setOptimize(graph.getNodes().length > graph.get('optimizeThreshold'));\n graph.get(\"\".concat(type, \"s\")).push(item);\n graph.get('itemMap')[item.get('id')] = item;\n graph.emit('afteradditem', {\n item: item,\n model: model\n });\n // eslint-disable-next-line consistent-return\n return item;\n }\n };\n /**\n * 更新节点或边\n *\n * @param {Item} item ID 或 实例\n * @param {(EdgeConfig | Partial)} cfg 数据模型\n * @returns\n * @memberof ItemController\n */\n ItemController.prototype.updateItem = function (item, cfg) {\n var _this = this;\n var _a, _b;\n var graph = this.graph;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n if (!item || item.destroyed) {\n return;\n }\n // 更新的 item 的类型\n var type = '';\n if (item.getType) type = item.getType();\n var mapper = graph.get(type + MAPPER_SUFFIX);\n var model = item.getModel();\n var oriX = model.x,\n oriY = model.y;\n var updateType = item.getUpdateType(cfg);\n if (mapper) {\n var result = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, model, cfg);\n var mappedModel = mapper(result);\n // 将 update 时候用户传入的参数与mapperModel做deepMix,以便复用之前设置的参数值\n var newModel = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, model, mappedModel, cfg);\n if (mappedModel[STATE_SUFFIX]) {\n item.set('styles', newModel[STATE_SUFFIX]);\n delete newModel[STATE_SUFFIX];\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(newModel, function (val, key) {\n cfg[key] = val;\n });\n } else {\n // merge update传进来的对象参数,model中没有的数据不做处理,对象和字符串值也不做处理,直接替换原来的\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(cfg, function (val, key) {\n if (model[key]) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isObject\"])(val) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(val)) {\n cfg[key] = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, model[key]), cfg[key]);\n }\n }\n });\n }\n // emit beforeupdateitem 事件\n graph.emit('beforeupdateitem', {\n item: item,\n cfg: cfg\n });\n if (type === EDGE) {\n // 若是边要更新source || target, 为了不影响示例内部model,并且重新计算startPoint和endPoint,手动设置\n if (cfg.source) {\n var source = cfg.source;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(source)) {\n source = graph.findById(source);\n }\n item.setSource(source);\n }\n if (cfg.target) {\n var target = cfg.target;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(target)) {\n target = graph.findById(target);\n }\n item.setTarget(target);\n }\n item.update(cfg);\n } else if (type === NODE) {\n item.update(cfg, updateType);\n var edges = item.getEdges();\n if (updateType === 'move') {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges, function (edge) {\n _this.edgeToBeUpdateMap[edge.getID()] = {\n edge: edge,\n updateType: updateType\n };\n _this.throttleRefresh();\n });\n } else if (updateType === null || updateType === void 0 ? void 0 : updateType.includes('bbox')) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges, function (edge) {\n edge.refresh(updateType);\n });\n }\n } else if (type === COMBO) {\n item.update(cfg, updateType);\n if (!isNaN(cfg.x) || !isNaN(cfg.y)) {\n // if there is x y in model, place the combo according to it and move its succeed items. that means, the priority of the combo's position is higher than succeed items'\n var dx = cfg.x - oriX || 0;\n var dy = cfg.y - oriY || 0;\n // In the same time, adjust the children's positions\n this.updateComboSucceeds(model.id, dx, dy);\n }\n var edges_1 = item.getEdges();\n var refreshEdge = (updateType === null || updateType === void 0 ? void 0 : updateType.includes('bbox')) || updateType === 'move';\n if (refreshEdge && type === COMBO) {\n var shapeFactory = item.get('shapeFactory');\n var shapeType = model.type || 'circle';\n var comboAnimate = model.animate === undefined || cfg.animate === undefined ? (_b = (_a = shapeFactory[shapeType]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.animate : model.animate || cfg.animate;\n if (comboAnimate) {\n setTimeout(function () {\n if (!item || item.destroyed) return;\n var keyShape = item.getKeyShape();\n if (!keyShape || keyShape.destroyed) return;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges_1, function (edge) {\n if (edge && !edge.destroyed) edge.refresh();\n });\n }, 201);\n } else {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges_1, function (edge) {\n edge.refresh();\n });\n }\n }\n }\n item.setOptimize(graph.getNodes().length > graph.get('optimizeThreshold'));\n graph.emit('afterupdateitem', {\n item: item,\n cfg: cfg\n });\n };\n /**\n * 根据 combo 的子元素更新 combo 的位置及大小\n *\n * @param {ICombo} combo ID 或 实例\n * @returns\n * @memberof ItemController\n */\n ItemController.prototype.updateCombo = function (combo, children, followCombo) {\n var _this = this;\n var _a, _b;\n var graph = this.graph;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(combo)) {\n combo = graph.findById(combo);\n }\n if (!combo || combo.destroyed) {\n return;\n }\n var model = combo.getModel();\n var comboBBox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getComboBBox\"])(children, graph, combo);\n var comboX = comboBBox.x,\n comboY = comboBBox.y;\n combo.set('bbox', comboBBox);\n var x = comboX,\n y = comboY;\n if (followCombo) {\n // position of combo model first\n x = isNaN(model.x) ? comboX : model.x;\n y = isNaN(model.y) ? comboY : model.y;\n } else {\n // position of succeed items first\n x = isNaN(comboX) ? model.x : comboX;\n y = isNaN(comboY) ? model.y : comboY;\n }\n combo.update({\n x: x,\n y: y\n });\n var shapeFactory = combo.get('shapeFactory');\n var shapeType = model.type || 'circle';\n var comboAnimate = model.animate === undefined ? (_b = (_a = shapeFactory[shapeType]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.animate : model.animate;\n if (comboAnimate) {\n setTimeout(function () {\n if (!combo || combo.destroyed) return;\n var keyShape = combo.getKeyShape();\n if (!keyShape || keyShape.destroyed) return;\n combo.getShapeCfg(model); // 更新 combo 缓存的 size\n _this.updateComboEdges(combo);\n }, 201);\n } else {\n this.updateComboEdges(combo);\n }\n };\n ItemController.prototype.updateComboEdges = function (combo) {\n var _a, _b;\n var combEdges = combo.getEdges() || [];\n for (var i = 0; i < combEdges.length; i++) {\n var edge = combEdges[i];\n if (!(edge === null || edge === void 0 ? void 0 : edge.destroyed) && !((_a = edge === null || edge === void 0 ? void 0 : edge.getSource()) === null || _a === void 0 ? void 0 : _a.destroyed) && !((_b = edge === null || edge === void 0 ? void 0 : edge.getTarget()) === null || _b === void 0 ? void 0 : _b.destroyed)) {\n edge.refresh();\n }\n }\n };\n /**\n * 收起 combo,隐藏相关元素\n */\n ItemController.prototype.collapseCombo = function (combo, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var graph = this.graph;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(combo)) {\n combo = graph.findById(combo);\n }\n var children = combo.getChildren();\n children.nodes.forEach(function (node) {\n graph.hideItem(node, stack);\n });\n children.combos.forEach(function (c) {\n graph.hideItem(c, stack);\n });\n };\n /**\n * 根据位置差量 dx dy,更新 comboId 后继元素的位置\n * */\n ItemController.prototype.updateComboSucceeds = function (comboId, dx, dy, children) {\n var _this = this;\n if (children === void 0) {\n children = [];\n }\n var graph = this.graph;\n if (!dx && !dy) return;\n var kids = children;\n if (!(kids === null || kids === void 0 ? void 0 : kids.length)) {\n var comboTrees = graph.get('comboTrees');\n comboTrees === null || comboTrees === void 0 ? void 0 : comboTrees.forEach(function (child) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTree\"])(child, function (subTree) {\n if (subTree.id === comboId) {\n kids = subTree.children;\n return false;\n }\n return true;\n });\n });\n }\n kids === null || kids === void 0 ? void 0 : kids.forEach(function (child) {\n var childItem = graph.findById(child.id);\n if (childItem) {\n var childModel = childItem.getModel();\n _this.updateItem(child.id, {\n x: (childModel.x || 0) + dx,\n y: (childModel.y || 0) + dy\n });\n }\n });\n };\n /**\n * 展开 combo,相关元素出现\n * 若子 combo 原先是收起状态,则保持它的收起状态\n */\n ItemController.prototype.expandCombo = function (combo, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var graph = this.graph;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(combo)) {\n combo = graph.findById(combo);\n }\n var children = combo.getChildren();\n var edgeSet = new Set();\n children.nodes.forEach(function (node) {\n graph.showItem(node, stack);\n node.getEdges().forEach(function (edge) {\n return edgeSet.add(edge);\n });\n });\n children.combos.forEach(function (c) {\n if (c.getModel().collapsed) {\n c.show();\n } else {\n graph.showItem(c, stack);\n }\n c.getEdges().forEach(function (edge) {\n return edgeSet.add(edge);\n });\n });\n edgeSet.forEach(function (edge) {\n return edge.refresh();\n });\n };\n /**\n * 删除指定的节点或边\n *\n * @param {Item} item item ID 或实例\n * @returns {void}\n * @memberof ItemController\n */\n ItemController.prototype.removeItem = function (item) {\n var _this = this;\n var graph = this.graph;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n if (!item || item.destroyed) {\n return;\n }\n var itemModel = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(item.getModel());\n var type = '';\n if (item.getType) type = item.getType();\n graph.emit('beforeremoveitem', {\n item: itemModel,\n type: type\n });\n var items = graph.get(\"\".concat(type, \"s\"));\n var index = items.indexOf(item);\n if (index > -1) items.splice(index, 1);\n if (type === EDGE) {\n var vitems = graph.get(\"v\".concat(type, \"s\"));\n var vindex = vitems.indexOf(item);\n if (vindex > -1) vitems.splice(vindex, 1);\n }\n var itemId = item.get('id');\n var itemMap = graph.get('itemMap');\n delete itemMap[itemId];\n var comboTrees = graph.get('comboTrees');\n var id = item.get('id');\n if (type === NODE) {\n var comboId = item.getModel().comboId;\n if (comboTrees && comboId) {\n var brothers_1 = comboTrees;\n var found_1 = false; // the flag to terminate the forEach circulation\n // remove the node from the children array of its parent fromt he tree\n comboTrees.forEach(function (ctree) {\n if (found_1) return;\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTree\"])(ctree, function (combo) {\n if (combo.id === id && brothers_1) {\n var bidx = brothers_1.indexOf(combo);\n brothers_1.splice(bidx, 1);\n found_1 = true;\n return false; // terminate the traverse\n }\n\n brothers_1 = combo.children;\n return true;\n });\n });\n }\n // 若移除的是节点,需要将与之相连的边一同删除\n var edges = item.getEdges();\n for (var i = edges.length - 1; i >= 0; i--) {\n graph.removeItem(edges[i], false);\n }\n if (comboId) graph.updateCombo(comboId);\n } else if (type === COMBO) {\n var parentId = item.getModel().parentId;\n var comboInTree_1;\n // find the subtree rooted at the item to be removed\n var found_2 = false; // the flag to terminate the forEach circulation\n (comboTrees || []).forEach(function (ctree) {\n if (found_2) return;\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTree\"])(ctree, function (combo) {\n if (combo.id === id) {\n comboInTree_1 = combo;\n found_2 = true;\n return false; // terminate the traverse\n }\n\n return true;\n });\n });\n comboInTree_1.removed = true;\n if (comboInTree_1 && comboInTree_1.children) {\n comboInTree_1.children.forEach(function (child) {\n _this.removeItem(child.id);\n });\n }\n // 若移除的是 combo,需要将与之相连的边一同删除\n var edges = item.getEdges();\n for (var i = edges.length; i >= 0; i--) {\n graph.removeItem(edges[i], false);\n }\n if (parentId) graph.updateCombo(parentId);\n }\n item.destroy();\n graph.emit('afterremoveitem', {\n item: itemModel,\n type: type\n });\n };\n /**\n * 更新 item 状态\n *\n * @param {Item} item Item 实例\n * @param {string} state 状态名称\n * @param {boolean} value 是否启用状态或状态值\n * @returns {void}\n * @memberof ItemController\n */\n ItemController.prototype.setItemState = function (item, state, value) {\n var graph = this.graph;\n var stateName = state;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(value)) {\n stateName = \"\".concat(state, \":\").concat(value);\n }\n // 已经存在要设置的 state,或不存在 state 的样式为 undefined\n if (item.hasState(stateName) === value && value ||\n // 当该状态已经存在且现在需要设置为 true 时,不需要继续。当该状态不存在,且设置为 false 时,需要继续\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(value) && item.hasState(stateName)) {\n // 当该状态 value 是字符串,且已经存在该状态,不需要继续\n return;\n }\n graph.emit('beforeitemstatechange', {\n item: item,\n state: stateName,\n enabled: value\n });\n item.setState(state, value);\n graph.autoPaint();\n graph.emit('afteritemstatechange', {\n item: item,\n state: stateName,\n enabled: value\n });\n };\n /**\n * 将指定状态的优先级提升为最高优先级\n * @param {Item} item 元素id或元素实例\n * @param state 状态名称\n */\n ItemController.prototype.priorityState = function (item, state) {\n var graph = this.graph;\n var currentItem = item;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n currentItem = graph.findById(item);\n }\n // 先取消已有的 state\n this.setItemState(currentItem, state, false);\n // 再设置state,则此时该优先级为最高\n this.setItemState(currentItem, state, true);\n };\n /**\n * 清除所有指定的状态\n *\n * @param {Item} item Item 实例\n * @param {string[]} states 状态名称集合\n * @memberof ItemController\n */\n ItemController.prototype.clearItemStates = function (item, states) {\n var graph = this.graph;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n graph.emit('beforeitemstatesclear', {\n item: item,\n states: states\n });\n item.clearStates(states);\n graph.emit('afteritemstatesclear', {\n item: item,\n states: states\n });\n };\n /**\n * 刷新指定的 Item\n *\n * @param {Item} item Item ID 或 实例\n * @memberof ItemController\n */\n ItemController.prototype.refreshItem = function (item) {\n var graph = this.graph;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n graph.emit('beforeitemrefresh', {\n item: item\n });\n // 调用 Item 的 refresh 方法,实现刷新功能\n item.refresh();\n graph.emit('afteritemrefresh', {\n item: item\n });\n };\n /**\n * 根据 graph 上用 combos 数据生成的 comboTree 来增加所有 combos\n *\n * @param {ComboTree[]} comboTrees graph 上用 combos 数据生成的 comboTree\n * @param {ComboConfig[]} comboModels combos 数据\n * @memberof ItemController\n */\n ItemController.prototype.addCombos = function (comboTrees, comboModels) {\n var _this = this;\n var graph = this.graph;\n (comboTrees || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTreeUp\"])(ctree, function (child) {\n var comboModel;\n comboModels.forEach(function (model) {\n if (model.id === child.id) {\n model.children = child.children;\n model.depth = child.depth;\n comboModel = model;\n }\n });\n if (comboModel) {\n _this.addItem('combo', comboModel);\n }\n return true;\n });\n });\n var comboGroup = graph.get('comboGroup');\n if (comboGroup) comboGroup.sort();\n };\n /**\n * 改变Item的显示状态\n *\n * @param {Item} item Item ID 或 实例\n * @param {boolean} visible 是否显示\n * @memberof ItemController\n */\n ItemController.prototype.changeItemVisibility = function (item, visible) {\n var _this = this;\n var graph = this.graph;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n if (!item) {\n console.warn('The item to be shown or hidden does not exist!');\n return;\n }\n graph.emit('beforeitemvisibilitychange', {\n item: item,\n visible: visible\n });\n item.changeVisibility(visible);\n if (item.getType && item.getType() === NODE) {\n var edges = item.getEdges();\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges, function (edge) {\n // 若隐藏节点,则将与之关联的边也隐藏\n // 若显示节点,则将与之关联的边也显示,但是需要判断边两端的节点都是可见的\n if (visible && !(edge.get('source').isVisible() && edge.get('target').isVisible())) {\n return;\n }\n _this.changeItemVisibility(edge, visible);\n });\n } else if (item.getType && item.getType() === COMBO) {\n var comboTrees = graph.get('comboTrees');\n var id_1 = item.get('id');\n var children_1 = [];\n var found_3 = false; // flag the terminate the forEach\n (comboTrees || []).forEach(function (ctree) {\n if (found_3) return;\n if (!ctree.children || ctree.children.length === 0) return;\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTree\"])(ctree, function (combo) {\n if (combo.id === id_1) {\n children_1 = combo.children;\n found_3 = true;\n return false; // terminate the traverse\n }\n\n return true;\n });\n });\n if (children_1 && (!visible || visible && !item.getModel().collapsed)) {\n children_1.forEach(function (child) {\n var childItem = graph.findById(child.id);\n _this.changeItemVisibility(childItem, visible);\n });\n }\n var edges = item.getEdges();\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges, function (edge) {\n // 若隐藏 combo,则将与 combo 本身关联的边也隐藏\n // 若显示 combo,则将与 combo 本身关联的边也显示,但是需要判断边两端的节点都是可见的\n if (visible && !(edge.get('source').isVisible() && edge.get('target').isVisible())) {\n return;\n }\n _this.changeItemVisibility(edge, visible);\n });\n }\n graph.emit('afteritemvisibilitychange', {\n item: item,\n visible: visible\n });\n return item;\n };\n ItemController.prototype.destroy = function () {\n this.graph = null;\n this.destroyed = true;\n };\n return ItemController;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (ItemController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/item.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/services/interactor/IteractorService.js": -/*!*************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/services/interactor/IteractorService.js ***! - \*************************************************************************************/ -/*! exports provided: IInteractorEvent, InteractorService */ +/***/ "./node_modules/@antv/g6-core/es/graph/controller/layout.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/graph/controller/layout.js ***! + \******************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"IInteractorEvent\", function() { return IInteractorEvent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InteractorService\", function() { return InteractorService; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nvar _dec, _class;\n\n\nvar IInteractorEvent;\n\n(function (IInteractorEvent) {\n IInteractorEvent[\"PANSTART\"] = \"PANSTART\";\n IInteractorEvent[\"PANEND\"] = \"PANEND\";\n IInteractorEvent[\"PANMOVE\"] = \"PANMOVE\";\n IInteractorEvent[\"PINCH\"] = \"PINCH\";\n IInteractorEvent[\"KEYDOWN\"] = \"KEYDOWN\";\n IInteractorEvent[\"KEYUP\"] = \"KEYUP\";\n IInteractorEvent[\"HOVER\"] = \"HOVER\";\n})(IInteractorEvent || (IInteractorEvent = {}));\n\nvar InteractorService = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_2__[\"injectable\"])(), _dec(_class = /*#__PURE__*/function () {\n function InteractorService() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, InteractorService);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(InteractorService, [{\n key: \"listen\",\n value: function listen(canvas) {}\n }, {\n key: \"on\",\n value: function on(event, args) {}\n }, {\n key: \"connect\",\n value: function connect() {}\n }, {\n key: \"disconnect\",\n value: function disconnect() {}\n }, {\n key: \"destroy\",\n value: function destroy() {}\n }]);\n\n return InteractorService;\n}()) || _class);\n//# sourceMappingURL=IteractorService.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/services/interactor/IteractorService.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n/* harmony import */ var _util_layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/layout */ \"./node_modules/@antv/g6-core/es/util/layout.js\");\n\n\n\n\nvar LayoutController = /** @class */function () {\n function LayoutController(graph) {\n this.graph = graph;\n this.layoutCfg = graph.get('layout') || {};\n this.layoutType = this.getLayoutType();\n this.layoutMethods = [];\n this.initLayout();\n }\n // eslint-disable-next-line class-methods-use-this\n LayoutController.prototype.initLayout = function () {\n // no data before rendering\n };\n LayoutController.prototype.getLayoutType = function () {\n return this.getLayoutCfgType(this.layoutCfg);\n };\n LayoutController.prototype.getLayoutCfgType = function (layoutCfg) {\n var type = layoutCfg.type;\n // type should be top priority\n if (type) {\n return type;\n }\n var pipes = layoutCfg.pipes;\n if (Array.isArray(pipes)) {\n return pipes.map(function (pipe) {\n return (pipe === null || pipe === void 0 ? void 0 : pipe.type) || '';\n });\n }\n return null;\n };\n LayoutController.prototype.isLayoutTypeSame = function (cfg) {\n var current = this.getLayoutCfgType(cfg);\n var preHasPipes = Array.isArray(this.layoutType);\n var currentHasPipes = Array.isArray(current);\n // already has pipes, and the new one is pipes\n if (preHasPipes && currentHasPipes) {\n return this.layoutType.every(function (type, index) {\n return type === current[index];\n });\n }\n // only one of the pre and current is pipes\n if (Array.isArray(current) || Array.isArray(this.layoutType)) {\n return false;\n }\n // both of the pre and current are not pipes\n return (cfg === null || cfg === void 0 ? void 0 : cfg.type) === this.layoutType;\n };\n // 绘制\n LayoutController.prototype.refreshLayout = function () {\n var _a = this,\n graph = _a.graph,\n layoutType = _a.layoutType,\n _b = _a.layoutCfg,\n layoutCfg = _b === void 0 ? {} : _b;\n if (!graph) return;\n var animate = layoutCfg.animate;\n var isDefaultAnimateLayout = animate === undefined && (layoutType === 'force' || layoutType === 'force2');\n var forceAnimate = Object(_util_layout__WEBPACK_IMPORTED_MODULE_3__[\"isForce\"])(layoutType) && (animate || isDefaultAnimateLayout);\n if (graph.get('animate') && !forceAnimate) {\n graph.positionsAnimate(layoutType === 'comboCombined');\n } else {\n graph.refreshPositions(layoutType === 'comboCombined');\n }\n };\n // 更换布局\n LayoutController.prototype.changeLayout = function (cfg) {\n var disableTriggerLayout = cfg.disableTriggerLayout,\n otherCfgs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(cfg, [\"disableTriggerLayout\"]);\n this.layoutCfg = otherCfgs;\n this.layoutType = otherCfgs.type || this.layoutType;\n // 不触发重新布局,仅更新参数\n if (disableTriggerLayout) return;\n this.layout();\n };\n // 更换数据\n LayoutController.prototype.changeData = function (success) {\n this.layout(success);\n };\n LayoutController.prototype.destoryLayoutMethods = function () {\n var layoutMethods = this.layoutMethods;\n var destroyedLayoutTypes = [];\n layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.forEach(function (layoutMethod) {\n var _a;\n var layoutType = (_a = layoutMethod.getType) === null || _a === void 0 ? void 0 : _a.call(layoutMethod);\n if (layoutType) destroyedLayoutTypes.push(layoutType);\n layoutMethod.destroy();\n });\n this.layoutMethods = [];\n return destroyedLayoutTypes;\n };\n // 销毁布局,不能使用 this.destroy,因为 controller 还需要被使用,只是把布局算法销毁\n LayoutController.prototype.destroyLayout = function () {\n this.destoryLayoutMethods();\n var graph = this.graph;\n if (graph && !graph.get('destroyed')) {\n graph.set('layout', undefined);\n }\n this.layoutCfg = undefined;\n this.layoutType = undefined;\n this.layoutMethods = undefined;\n };\n // 从 this.graph 获取数据\n LayoutController.prototype.setDataFromGraph = function () {\n var _a;\n var nodes = [];\n var hiddenNodes = [];\n var edges = [];\n var hiddenEdges = [];\n var comboEdges = [];\n var combos = [];\n var hiddenCombos = [];\n var nodeItems = this.graph.getNodes();\n var edgeItems = this.graph.getEdges();\n var comboItems = this.graph.getCombos();\n var nodeLength = nodeItems.length;\n for (var i = 0; i < nodeLength; i++) {\n var nodeItem = nodeItems[i];\n if (!nodeItem || nodeItem.destroyed) continue;\n var model = nodeItem.getModel();\n if (!nodeItem.isVisible()) {\n hiddenNodes.push(model);\n continue;\n }\n nodes.push(model);\n }\n var edgeLength = edgeItems.length;\n for (var i = 0; i < edgeLength; i++) {\n var edgeItem = edgeItems[i];\n if (!edgeItem || edgeItem.destroyed) continue;\n var model = edgeItem.getModel();\n if (!edgeItem.isVisible()) {\n hiddenEdges.push(model);\n continue;\n }\n if (!model.isComboEdge) edges.push(model);else comboEdges.push(model);\n }\n var comboLength = comboItems.length;\n for (var i = 0; i < comboLength; i++) {\n var comboItem = comboItems[i];\n if (comboItem.destroyed) continue;\n var model = comboItem.getModel();\n if (!comboItem.isVisible()) {\n hiddenCombos.push(model);\n continue;\n }\n combos.push(model);\n }\n return {\n nodes: nodes,\n hiddenNodes: hiddenNodes,\n edges: edges,\n hiddenEdges: hiddenEdges,\n combos: combos,\n hiddenCombos: hiddenCombos,\n comboEdges: comboEdges,\n vedges: (_a = this.graph.get('vedges')) === null || _a === void 0 ? void 0 : _a.map(function (edge) {\n return edge.getModel();\n })\n };\n };\n // 重新布局\n LayoutController.prototype.relayout = function (reloadData) {\n var _this = this;\n var _a = this,\n graph = _a.graph,\n layoutMethods = _a.layoutMethods,\n layoutCfg = _a.layoutCfg;\n if (!graph || graph.get('destroyed')) return;\n var start = Promise.resolve();\n if (reloadData) {\n this.data = this.setDataFromGraph();\n var nodes = this.data.nodes;\n if (!nodes) {\n return false;\n }\n start = this.initPositions(layoutCfg.center, nodes);\n }\n graph.emit('beforelayout');\n layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.forEach(function (layoutMethod, index) {\n var currentCfg = layoutCfg[index] || layoutCfg;\n start = start.then(function () {\n var _a;\n var relayoutPromise = _this.execLayoutMethod(currentCfg, index);\n if (index === layoutMethods.length - 1) {\n (_a = layoutCfg.onAllLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(layoutCfg);\n }\n return relayoutPromise;\n });\n });\n };\n // 筛选参与布局的nodes和edges\n LayoutController.prototype.filterLayoutData = function (data, cfg) {\n var nodes = data.nodes,\n edges = data.edges,\n rest = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(data, [\"nodes\", \"edges\"]);\n if (!nodes) {\n return data;\n }\n var nodesFilter;\n var edegsFilter;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(cfg === null || cfg === void 0 ? void 0 : cfg.nodesFilter)) {\n nodesFilter = cfg.nodesFilter;\n } else {\n nodesFilter = function nodesFilter() {\n return true;\n };\n }\n var fNodes = nodes.filter(nodesFilter);\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(cfg === null || cfg === void 0 ? void 0 : cfg.edgesFilter)) {\n edegsFilter = cfg.edgesFilter;\n } else {\n var nodesMap_1 = fNodes.reduce(function (acc, cur) {\n acc[cur.id] = true;\n return acc;\n }, {});\n edegsFilter = function edegsFilter(edge) {\n return nodesMap_1[edge.source] && nodesMap_1[edge.target];\n };\n }\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n nodes: fNodes,\n edges: edges.filter(edegsFilter)\n }, rest);\n };\n LayoutController.prototype.getLayoutBBox = function (nodes) {\n var graph = this.graph;\n var graphGroupNodes = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"groupBy\"])(graph.getNodes(), function (n) {\n return n.getModel().layoutOrder;\n });\n var layoutNodes = Object.values(graphGroupNodes).map(function (value) {\n var bbox = Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"calculationItemsBBox\"])(value);\n bbox.size = [bbox.width, bbox.height];\n return bbox;\n });\n var groupNodes = Object.values(Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"groupBy\"])(nodes, 'layoutOrder'));\n return {\n groupNodes: groupNodes,\n layoutNodes: layoutNodes\n };\n };\n // 控制布局动画\n // eslint-disable-next-line class-methods-use-this\n LayoutController.prototype.layoutAnimate = function () {};\n // 将当前节点的平均中心移动到原点\n LayoutController.prototype.moveToZero = function () {\n var graph = this.graph;\n var data = graph.get('data');\n var nodes = data.nodes;\n if (nodes[0].x === undefined || nodes[0].x === null || Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(nodes[0].x)) {\n return;\n }\n var meanCenter = [0, 0];\n var nodeLength = nodes.length;\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n meanCenter[0] += node.x;\n meanCenter[1] += node.y;\n }\n meanCenter[0] /= nodes.length;\n meanCenter[1] /= nodes.length;\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n node.x -= meanCenter[0];\n node.y -= meanCenter[1];\n }\n };\n // 初始化节点到 center 附近\n LayoutController.prototype.initPositions = function (center, nodes) {\n var _a;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\n var graph, nodesToInit, nodeLength;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_b) {\n graph = this.graph;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length)) {\n return [2 /*return*/, Promise.resolve()];\n }\n nodesToInit = nodes.filter(function (node) {\n return Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(node.x) || Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(node.y);\n });\n nodeLength = nodesToInit ? nodesToInit.length : 0;\n if (!nodeLength) return [2 /*return*/];\n return [2 /*return*/, (_a = this.initWithPreset) === null || _a === void 0 ? void 0 : _a.call(this, function () {},\n // onFullfillment\n function () {\n var width = graph.get('width') * 0.85;\n var height = graph.get('height') * 0.85;\n var horiNum = Math.ceil(Math.sqrt(nodeLength) * (width / height));\n var vertiNum = Math.ceil(nodeLength / horiNum);\n var horiGap = width / (horiNum - 1);\n var vertiGap = height / (vertiNum - 1);\n if (!isFinite(horiGap) || !horiGap) horiGap = 0;\n if (!isFinite(vertiGap) || !horiGap) vertiGap = 0;\n var beginX = center[0] - width / 2;\n var beginY = center[1] - height / 2;\n var allHavePos = true;\n for (var i = 0; i < nodeLength; i++) {\n var node = nodesToInit[i];\n if (Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(+node.x)) {\n allHavePos = false;\n node.x = i % horiNum * horiGap + beginX;\n }\n if (Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(+node.y)) {\n allHavePos = false;\n node.y = Math.floor(i / horiNum) * vertiGap + beginY;\n }\n }\n })];\n });\n });\n };\n LayoutController.prototype.destroy = function () {\n this.graph = null;\n this.destoryLayoutMethods();\n this.destroyed = true;\n };\n return LayoutController;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayoutController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/layout.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/services/interactor/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/services/interactor/index.js ***! - \**************************************************************************/ -/*! exports provided: IInteractorEvent, InteractorService */ +/***/ "./node_modules/@antv/g6-core/es/graph/controller/mode.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/graph/controller/mode.js ***! + \****************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _IteractorService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./IteractorService */ \"./node_modules/@antv/g-webgpu-core/es/services/interactor/IteractorService.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"IInteractorEvent\", function() { return _IteractorService__WEBPACK_IMPORTED_MODULE_0__[\"IInteractorEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"InteractorService\", function() { return _IteractorService__WEBPACK_IMPORTED_MODULE_0__[\"InteractorService\"]; });\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/services/interactor/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _behavior_behavior__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../behavior/behavior */ \"./node_modules/@antv/g6-core/es/behavior/behavior.js\");\n\n\nvar ModeController = /** @class */function () {\n function ModeController(graph) {\n this.graph = graph;\n this.destroyed = false;\n this.modes = graph.get('modes') || {\n default: []\n };\n this.formatModes();\n this.mode = graph.get('defaultMode') || 'default';\n this.currentBehaves = [];\n this.setMode(this.mode);\n }\n ModeController.prototype.formatModes = function () {\n var modes = this.modes;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(modes, function (mode) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(mode, function (behavior, i) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(behavior)) {\n mode[i] = {\n type: behavior\n };\n }\n });\n });\n };\n ModeController.prototype.setBehaviors = function (mode) {\n var graph = this.graph;\n var behaviors = this.modes[mode];\n var behaves = [];\n var behave;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(behaviors || [], function (behavior) {\n var BehaviorInstance = _behavior_behavior__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getBehavior(behavior.type || behavior);\n if (!BehaviorInstance) {\n return;\n }\n behave = new BehaviorInstance(behavior);\n if (behave) {\n behave.bind(graph);\n behaves.push(behave);\n }\n });\n this.currentBehaves = behaves;\n };\n ModeController.mergeBehaviors = function (modeBehaviors, behaviors) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(behaviors, function (behavior) {\n if (modeBehaviors.indexOf(behavior) < 0) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(behavior)) {\n behavior = {\n type: behavior\n };\n }\n modeBehaviors.push(behavior);\n }\n });\n return modeBehaviors;\n };\n ModeController.filterBehaviors = function (modeBehaviors, behaviors) {\n var result = [];\n modeBehaviors.forEach(function (behavior) {\n var type = '';\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(behavior)) {\n type = behavior;\n } else {\n // eslint-disable-next-line prefer-destructuring\n type = behavior.type;\n }\n if (behaviors.indexOf(type) < 0) {\n result.push(behavior);\n }\n });\n return result;\n };\n ModeController.prototype.setMode = function (mode) {\n var _a = this,\n modes = _a.modes,\n graph = _a.graph;\n var current = mode;\n var behaviors = modes[current];\n if (!behaviors) {\n return;\n }\n graph.emit('beforemodechange', {\n mode: mode\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(this.currentBehaves, function (behave) {\n if (behave.delegate) behave.delegate.remove();\n behave.unbind(graph);\n });\n this.setBehaviors(current);\n graph.emit('aftermodechange', {\n mode: mode\n });\n this.mode = mode;\n };\n ModeController.prototype.getMode = function () {\n return this.mode;\n };\n /**\n * 动态增加或删除 Behavior\n *\n * @param {ModeType[]} behaviors\n * @param {(ModeType[] | ModeType)} modes\n * @param {boolean} isAdd\n * @returns {Mode}\n * @memberof Mode\n */\n ModeController.prototype.manipulateBehaviors = function (behaviors, modes, isAdd) {\n var _this = this;\n var behaves;\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(behaviors)) {\n behaves = [behaviors];\n } else {\n behaves = behaviors;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(modes)) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(modes, function (mode) {\n if (!_this.modes[mode]) {\n if (isAdd) {\n _this.modes[mode] = behaves;\n }\n } else if (isAdd) {\n _this.modes[mode] = ModeController.mergeBehaviors(_this.modes[mode] || [], behaves);\n } else {\n _this.modes[mode] = ModeController.filterBehaviors(_this.modes[mode] || [], behaves);\n }\n });\n return this;\n }\n var currentMode = modes;\n if (!modes) {\n currentMode = this.mode; // isString(this.mode) ? this.mode : this.mode.type\n }\n\n if (!this.modes[currentMode]) {\n if (isAdd) {\n this.modes[currentMode] = behaves;\n }\n }\n if (isAdd) {\n this.modes[currentMode] = ModeController.mergeBehaviors(this.modes[currentMode] || [], behaves);\n } else {\n this.modes[currentMode] = ModeController.filterBehaviors(this.modes[currentMode] || [], behaves);\n }\n this.formatModes();\n this.setMode(this.mode);\n return this;\n };\n /**\n * 更新行为参数\n * @param {string | ModeOption | ModeType} behavior 需要更新的行为\n * @param {string | string[]} modes 指定的模式中的行为,不指定则为 default\n * @return {Graph} Graph\n */\n ModeController.prototype.updateBehavior = function (behavior, newCfg, mode) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(behavior)) {\n behavior = {\n type: behavior\n };\n }\n var behaviorSet = [];\n if (!mode || mode === this.mode || mode === 'default') {\n behaviorSet = this.currentBehaves;\n if (!behaviorSet || !behaviorSet.length) {\n console.warn('Update behavior failed! There is no behaviors in this mode on the graph.');\n return this;\n }\n var length_1 = behaviorSet.length;\n for (var i = 0; i < length_1; i++) {\n var behave = behaviorSet[i];\n if (behave.type === behavior.type) {\n behave.updateCfg(newCfg);\n return this;\n }\n if (i === length_1 - 1) console.warn('Update behavior failed! There is no such behavior in the mode');\n }\n } else {\n behaviorSet = this.modes[mode];\n if (!behaviorSet || !behaviorSet.length) {\n console.warn('Update behavior failed! There is no behaviors in this mode on the graph.');\n return this;\n }\n var length_2 = behaviorSet.length;\n for (var i = 0; i < length_2; i++) {\n var behave = behaviorSet[i];\n if (behave.type === behavior.type || behave === behavior.type) {\n if (behave === behavior.type) behave = {\n type: behave\n };\n Object.assign(behave, newCfg);\n behaviorSet[i] = behave;\n return this;\n }\n if (i === length_2 - 1) console.warn('Update behavior failed! There is no such behavior in the mode');\n }\n }\n return this;\n };\n ModeController.prototype.destroy = function () {\n this.graph = null;\n this.modes = null;\n this.currentBehaves = null;\n this.destroyed = true;\n };\n return ModeController;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModeController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/mode.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/services/shader-module/ShaderModuleService.js": -/*!*******************************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/services/shader-module/ShaderModuleService.js ***! - \*******************************************************************************************/ +/***/ "./node_modules/@antv/g6-core/es/graph/controller/state.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/graph/controller/state.js ***! + \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ShaderModuleService; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _utils_shader_module__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../utils/shader-module */ \"./node_modules/@antv/g-webgpu-core/es/utils/shader-module.js\");\n/* harmony import */ var _utils_uniq__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../utils/uniq */ \"./node_modules/@antv/g-webgpu-core/es/utils/uniq.js\");\n\n\n\n\nvar _dec, _class, _temp;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\n\n/* babel-plugin-inline-import './shaders/webgl.picking.frag.glsl' */\nvar pickingFrag = \"varying vec4 v_PickingResult;\\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\\nuniform float u_PickingStage : 0.0;\\n\\n#define PICKING_ENCODE 1.0\\n#define PICKING_HIGHLIGHT 2.0\\n#define COLOR_SCALE 1. / 255.\\n\\n/*\\n * Returns highlight color if this item is selected.\\n */\\nvec4 filterHighlightColor(vec4 color) {\\n bool selected = bool(v_PickingResult.a);\\n\\n if (selected) {\\n vec4 highLightColor = u_HighlightColor * COLOR_SCALE;\\n\\n float highLightAlpha = highLightColor.a;\\n float highLightRatio = highLightAlpha / (highLightAlpha + color.a * (1.0 - highLightAlpha));\\n\\n vec3 resultRGB = mix(color.rgb, highLightColor.rgb, highLightRatio);\\n return vec4(resultRGB, color.a);\\n } else {\\n return color;\\n }\\n}\\n\\n/*\\n * Returns picking color if picking enabled else unmodified argument.\\n */\\nvec4 filterPickingColor(vec4 color) {\\n vec3 pickingColor = v_PickingResult.rgb;\\n if (u_PickingStage == PICKING_ENCODE && length(pickingColor) < 0.001) {\\n discard;\\n }\\n return u_PickingStage == PICKING_ENCODE ? vec4(pickingColor, step(0.001,color.a)): color;\\n}\\n\\n/*\\n * Returns picking color if picking is enabled if not\\n * highlight color if this item is selected, otherwise unmodified argument.\\n */\\nvec4 filterColor(vec4 color) {\\n return filterPickingColor(filterHighlightColor(color));\\n}\\n\";\n\n/* babel-plugin-inline-import './shaders/webgl.picking.vert.glsl' */\nvar pickingVert = \"attribute vec3 a_PickingColor;\\nvarying vec4 v_PickingResult;\\n\\nuniform vec3 u_PickingColor : [0, 0, 0];\\nuniform vec4 u_HighlightColor : [0, 0, 0, 0];\\nuniform float u_PickingStage : 0.0;\\nuniform float u_PickingThreshold : 1.0;\\nuniform float u_PickingBuffer: 0.0;\\n\\n#define PICKING_ENCODE 1.0\\n#define PICKING_HIGHLIGHT 2.0\\n#define COLOR_SCALE 1. / 255.\\n\\nbool isVertexPicked(vec3 vertexColor) {\\n return\\n abs(vertexColor.r - u_PickingColor.r) < u_PickingThreshold &&\\n abs(vertexColor.g - u_PickingColor.g) < u_PickingThreshold &&\\n abs(vertexColor.b - u_PickingColor.b) < u_PickingThreshold;\\n}\\n\\nvoid setPickingColor(vec3 pickingColor) {\\n // compares only in highlight stage\\n v_PickingResult.a = float((u_PickingStage == PICKING_HIGHLIGHT) && isVertexPicked(pickingColor));\\n\\n // Stores the picking color so that the fragment shader can render it during picking\\n v_PickingResult.rgb = pickingColor * COLOR_SCALE;\\n}\\n\\nfloat setPickingSize(float x) {\\n return u_PickingStage == PICKING_ENCODE ? x + u_PickingBuffer : x;\\n}\";\n\n/* babel-plugin-inline-import './shaders/webgl.sdf2d.frag.glsl' */\nvar sdf2dFrag = \"/**\\n * 2D signed distance field functions\\n * @see http://www.iquilezles.org/www/articles/distfunctions2d/distfunctions2d.htm\\n */\\n\\nfloat ndot(vec2 a, vec2 b ) { return a.x*b.x - a.y*b.y; }\\n\\nfloat sdCircle(vec2 p, float r) {\\n return length(p) - r;\\n}\\n\\nfloat sdEquilateralTriangle(vec2 p) {\\n float k = sqrt(3.0);\\n p.x = abs(p.x) - 1.0;\\n p.y = p.y + 1.0/k;\\n if( p.x + k*p.y > 0.0 ) p = vec2(p.x-k*p.y,-k*p.x-p.y)/2.0;\\n p.x -= clamp( p.x, -2.0, 0.0 );\\n return -length(p)*sign(p.y);\\n}\\n\\nfloat sdBox(vec2 p, vec2 b) {\\n vec2 d = abs(p)-b;\\n return length(max(d,vec2(0))) + min(max(d.x,d.y),0.0);\\n}\\n\\nfloat sdPentagon(vec2 p, float r) {\\n vec3 k = vec3(0.809016994,0.587785252,0.726542528);\\n p.x = abs(p.x);\\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\\n p -= vec2(clamp(p.x,-r*k.z,r*k.z),r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdHexagon(vec2 p, float r) {\\n vec3 k = vec3(-0.866025404,0.5,0.577350269);\\n p = abs(p);\\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdOctogon(vec2 p, float r) {\\n vec3 k = vec3(-0.9238795325, 0.3826834323, 0.4142135623 );\\n p = abs(p);\\n p -= 2.0*min(dot(vec2( k.x,k.y),p),0.0)*vec2( k.x,k.y);\\n p -= 2.0*min(dot(vec2(-k.x,k.y),p),0.0)*vec2(-k.x,k.y);\\n p -= vec2(clamp(p.x, -k.z*r, k.z*r), r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdHexagram(vec2 p, float r) {\\n vec4 k=vec4(-0.5,0.8660254038,0.5773502692,1.7320508076);\\n p = abs(p);\\n p -= 2.0*min(dot(k.xy,p),0.0)*k.xy;\\n p -= 2.0*min(dot(k.yx,p),0.0)*k.yx;\\n p -= vec2(clamp(p.x,r*k.z,r*k.w),r);\\n return length(p)*sign(p.y);\\n}\\n\\nfloat sdRhombus(vec2 p, vec2 b) {\\n vec2 q = abs(p);\\n float h = clamp((-2.0*ndot(q,b)+ndot(b,b))/dot(b,b),-1.0,1.0);\\n float d = length( q - 0.5*b*vec2(1.0-h,1.0+h) );\\n return d * sign( q.x*b.y + q.y*b.x - b.x*b.y );\\n}\\n\\nfloat sdVesica(vec2 p, float r, float d) {\\n p = abs(p);\\n float b = sqrt(r*r-d*d); // can delay this sqrt\\n return ((p.y-b)*d>p.x*b)\\n ? length(p-vec2(0.0,b))\\n : length(p-vec2(-d,0.0))-r;\\n}\";\nvar precisionRegExp = /precision\\s+(high|low|medium)p\\s+float/;\nvar globalDefaultprecision = '#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n #else\\n precision mediump float;\\n#endif\\n';\nvar includeRegExp = /#pragma include ([\"^+\"]?[\"\\ \"[a-zA-Z_0-9](.*)\"]*?)/g;\nvar ShaderModuleService = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_3__[\"injectable\"])(), _dec(_class = (_temp = /*#__PURE__*/function () {\n function ShaderModuleService() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, ShaderModuleService);\n\n this.moduleCache = {};\n this.rawContentCache = {};\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(ShaderModuleService, [{\n key: \"registerBuiltinModules\",\n value: function registerBuiltinModules() {\n this.destroy();\n this.registerModule('picking', {\n vs: pickingVert,\n fs: pickingFrag\n });\n this.registerModule('sdf2d', {\n vs: '',\n fs: sdf2dFrag\n });\n }\n }, {\n key: \"registerModule\",\n value: function registerModule(moduleName, moduleParams) {\n // prevent registering the same module multiple times\n if (this.rawContentCache[moduleName]) {\n return;\n }\n\n var _moduleParams$vs = moduleParams.vs,\n vs = _moduleParams$vs === void 0 ? '' : _moduleParams$vs,\n _moduleParams$fs = moduleParams.fs,\n fs = _moduleParams$fs === void 0 ? '' : _moduleParams$fs,\n declaredUniforms = moduleParams.uniforms;\n\n var _extractUniforms = Object(_utils_shader_module__WEBPACK_IMPORTED_MODULE_4__[\"extractUniforms\"])(vs),\n extractedVS = _extractUniforms.content,\n vsUniforms = _extractUniforms.uniforms;\n\n var _extractUniforms2 = Object(_utils_shader_module__WEBPACK_IMPORTED_MODULE_4__[\"extractUniforms\"])(fs),\n extractedFS = _extractUniforms2.content,\n fsUniforms = _extractUniforms2.uniforms;\n\n this.rawContentCache[moduleName] = {\n fs: extractedFS,\n uniforms: _objectSpread(_objectSpread(_objectSpread({}, vsUniforms), fsUniforms), declaredUniforms),\n vs: extractedVS\n };\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.moduleCache = {};\n this.rawContentCache = {};\n }\n }, {\n key: \"getModule\",\n value: function getModule(moduleName) {\n var _this = this;\n\n if (this.moduleCache[moduleName]) {\n return this.moduleCache[moduleName];\n }\n\n var rawVS = this.rawContentCache[moduleName].vs || '';\n var rawFS = this.rawContentCache[moduleName].fs || '';\n\n var _this$processModule = this.processModule(rawVS, [], 'vs'),\n vs = _this$processModule.content,\n vsIncludeList = _this$processModule.includeList;\n\n var _this$processModule2 = this.processModule(rawFS, [], 'fs'),\n fs = _this$processModule2.content,\n fsIncludeList = _this$processModule2.includeList;\n\n var compiledFs = fs; // TODO: extract uniforms and their default values from GLSL\n\n var uniforms = Object(_utils_uniq__WEBPACK_IMPORTED_MODULE_5__[\"uniq\"])(vsIncludeList.concat(fsIncludeList).concat(moduleName)).reduce(function (prev, cur) {\n return _objectSpread(_objectSpread({}, prev), _this.rawContentCache[cur].uniforms);\n }, {});\n /**\n * set default precision for fragment shader\n * https://stackoverflow.com/questions/28540290/why-it-is-necessary-to-set-precision-for-the-fragment-shader\n */\n\n if (!precisionRegExp.test(fs)) {\n compiledFs = globalDefaultprecision + fs;\n }\n\n this.moduleCache[moduleName] = {\n fs: compiledFs.trim(),\n uniforms: uniforms,\n vs: vs.trim()\n };\n return this.moduleCache[moduleName];\n }\n }, {\n key: \"processModule\",\n value: function processModule(rawContent, includeList, type) {\n var _this2 = this;\n\n var compiled = rawContent.replace(includeRegExp, function (_, strMatch) {\n var includeOpt = strMatch.split(' ');\n var includeName = includeOpt[0].replace(/\"/g, '');\n\n if (includeList.indexOf(includeName) > -1) {\n return '';\n }\n\n var txt = _this2.rawContentCache[includeName][type];\n includeList.push(includeName);\n\n var _this2$processModule = _this2.processModule(txt || '', includeList, type),\n content = _this2$processModule.content;\n\n return content;\n });\n return {\n content: compiled,\n includeList: includeList\n };\n }\n }]);\n\n return ShaderModuleService;\n}(), _temp)) || _class);\n\n//# sourceMappingURL=ShaderModuleService.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/services/shader-module/ShaderModuleService.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar StateController = /** @class */function () {\n function StateController(graph) {\n this.graph = graph;\n this.destroyed = false;\n }\n /**\n * 更新 Item 的状态\n *\n * @param {Item} item Item实例\n * @param {string} state 状态名称\n * @param {boolean} enabled 状态是否可用\n * @memberof State\n */\n StateController.prototype.updateState = function (item, state, enabled) {\n var graphStates = this.graph.get('states');\n var key = state;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(enabled)) key = \"\".concat(state, \":\").concat(enabled);\n if (!graphStates[key]) graphStates[key] = [];\n if (enabled) graphStates[key].push(item);else graphStates[key] = graphStates[key].filter(function (itemInState) {\n return itemInState !== item;\n });\n this.graph.set('states', graphStates);\n this.graph.emit('graphstatechange', {\n states: graphStates\n });\n };\n /**\n * 批量更新 states,兼容 updateState,支持更新一个 state\n *\n * @param {Item} item\n * @param {(string | string[])} states\n * @param {boolean} enabled\n * @memberof State\n */\n StateController.prototype.updateStates = function (item, states, enabled) {\n var graphStates = this.graph.get('states');\n var stateNames = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(states) ? [states] : states;\n stateNames.forEach(function (stateName) {\n var key = stateName;\n if (!graphStates[key]) graphStates[key] = [];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(enabled)) key = \"\".concat(stateName, \":\").concat(enabled);\n if (enabled) graphStates[key].push(item);else graphStates[key] = graphStates[key].filter(function (itemInState) {\n return itemInState !== item;\n });\n });\n this.graph.set('states', graphStates);\n this.graph.emit('graphstatechange', {\n states: states\n });\n };\n StateController.prototype.destroy = function () {\n this.graph = null;\n this.destroyed = true;\n };\n return StateController;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (StateController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/state.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/services/shader-module/index.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/services/shader-module/index.js ***! - \*****************************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-core/es/graph/controller/view.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/graph/controller/view.js ***! + \****************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _ShaderModuleService__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./ShaderModuleService */ \"./node_modules/@antv/g-webgpu-core/es/services/shader-module/ShaderModuleService.js\");\n/* empty/unused harmony star reexport */\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/services/shader-module/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/matrix-util/lib/ext */ \"./node_modules/@antv/matrix-util/lib/ext.js\");\n/* harmony import */ var _antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n\n\n\n\n\n\nvar ViewController = /** @class */function () {\n function ViewController(graph) {\n this.destroyed = false;\n this.graph = graph;\n this.destroyed = false;\n }\n // get view center coordinate\n ViewController.prototype.getViewCenter = function () {\n var padding = this.getFormatPadding();\n var graph = this.graph;\n var width = this.graph.get('width');\n var height = graph.get('height');\n return {\n x: (width - padding[1] - padding[3]) / 2 + padding[3],\n y: (height - padding[0] - padding[2]) / 2 + padding[0]\n };\n };\n ViewController.prototype.fitCenter = function (animate, animateCfg) {\n var graph = this.graph;\n var group = graph.get('group');\n var bbox;\n // if reaches optimizeThreshold, fitView according to the 4 corner nodes\n var nodes = graph.getNodes();\n if (nodes.length > graph.get('optimizeThreshold')) {\n var minX_1 = Infinity;\n var minY_1 = Infinity;\n var maxX_1 = -Infinity;\n var maxY_1 = -Infinity;\n nodes.forEach(function (node) {\n var _a = node.getModel(),\n x = _a.x,\n y = _a.y;\n if (minX_1 > x) minX_1 = x;\n if (minY_1 > y) minY_1 = y;\n if (maxX_1 < x) maxX_1 = x;\n if (maxY_1 < y) maxY_1 = y;\n });\n var matrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var _a = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"applyMatrix\"])({\n x: minX_1,\n y: minY_1\n }, matrix),\n transMinX = _a.x,\n transMinY = _a.y;\n var _b = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"applyMatrix\"])({\n x: maxX_1,\n y: maxY_1\n }, matrix),\n transMaxX = _b.x,\n transMaxY = _b.y;\n bbox = {\n minX: transMinX,\n maxX: transMaxX,\n minY: transMinY,\n maxY: transMaxY,\n width: transMaxX - transMinX,\n height: transMaxY - transMinY,\n x: transMinX,\n y: transMinY\n };\n } else {\n bbox = group.getCanvasBBox();\n }\n if (bbox.width === 0 || bbox.height === 0) return;\n var viewCenter = this.getViewCenter();\n var groupCenter = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n };\n graph.translate(viewCenter.x - groupCenter.x, viewCenter.y - groupCenter.y, animate, animateCfg);\n };\n ViewController.prototype.animatedFitView = function (group, startMatrix, animateCfg, bbox, viewCenter, groupCenter, ratio, zoomToFit) {\n var graph = this.graph;\n animateCfg = animateCfg ? animateCfg : {\n duration: 500,\n easing: 'easeCubic'\n };\n // start from the default matrix\n var matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n // Translate\n var vx = bbox.x + viewCenter.x - groupCenter.x - bbox.minX;\n var vy = bbox.y + viewCenter.y - groupCenter.y - bbox.minY;\n if (Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(vx) || Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(vy)) return;\n var translatedMatrix = Object(_antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4__[\"transform\"])(matrix, [['t', vx, vy]]);\n if (!zoomToFit) {\n // If zooming is not needed just animate the current translated matrix and return\n var animationConfig_1 = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getAnimateCfgWithCallback\"])({\n animateCfg: animateCfg,\n callback: function callback() {\n graph.emit('viewportchange', {\n action: 'translate',\n matrix: translatedMatrix\n });\n }\n });\n group.animate(function (ratio) {\n return {\n matrix: Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"lerpArray\"])(startMatrix, translatedMatrix, ratio)\n };\n }, animationConfig_1);\n return;\n }\n // Zoom\n var minZoom = graph.get('minZoom');\n var maxZoom = graph.get('maxZoom');\n var realRatio = ratio;\n if (minZoom && ratio < minZoom) {\n realRatio = minZoom;\n console.warn('fitview failed, ratio out of range, ratio: %f', ratio, 'graph minzoom has been used instead');\n } else if (maxZoom && ratio > maxZoom) {\n realRatio = maxZoom;\n console.warn('fitview failed, ratio out of range, ratio: %f', ratio, 'graph maxzoom has been used instead');\n }\n var zoomedMatrix = Object(_antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4__[\"transform\"])(translatedMatrix, [['t', -viewCenter.x, -viewCenter.y], ['s', realRatio, realRatio], ['t', viewCenter.x, viewCenter.y]]);\n // Animation\n var animationConfig = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getAnimateCfgWithCallback\"])({\n animateCfg: animateCfg,\n callback: function callback() {\n group.setMatrix(zoomedMatrix);\n graph.emit('viewportchange', {\n action: 'translate',\n matrix: translatedMatrix\n });\n graph.emit('viewportchange', {\n action: 'zoom',\n matrix: zoomedMatrix\n });\n }\n });\n group.stopAnimate();\n group.setMatrix(startMatrix);\n group.animate(function (ratio) {\n return {\n matrix: Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"lerpArray\"])(startMatrix, zoomedMatrix, ratio)\n };\n }, animationConfig);\n };\n // fit view graph\n ViewController.prototype.fitView = function (animate, animateCfg) {\n var graph = this.graph;\n var padding = this.getFormatPadding();\n var width = graph.get('width');\n var height = graph.get('height');\n var group = graph.get('group');\n var startMatrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n group.resetMatrix();\n var bbox;\n // if reaches optimizeThreshold, fitView according to the 4 corner nodes\n var nodes = graph.getNodes();\n if (nodes.length > graph.get('optimizeThreshold')) {\n var minX_2 = Infinity;\n var minY_2 = Infinity;\n var maxX_2 = -Infinity;\n var maxY_2 = -Infinity;\n nodes.forEach(function (node) {\n var _a = node.getModel(),\n x = _a.x,\n y = _a.y;\n if (minX_2 > x) minX_2 = x;\n if (minY_2 > y) minY_2 = y;\n if (maxX_2 < x) maxX_2 = x;\n if (maxY_2 < y) maxY_2 = y;\n });\n bbox = {\n minX: minX_2,\n maxX: maxX_2,\n minY: minY_2,\n maxY: maxY_2,\n width: maxX_2 - minX_2,\n height: maxY_2 - minY_2,\n x: minX_2,\n y: minY_2\n };\n } else {\n bbox = group.getCanvasBBox();\n }\n if (bbox.width === 0 || bbox.height === 0) return;\n var viewCenter = this.getViewCenter();\n var groupCenter = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n };\n // Compute ratio\n var w = (width - padding[1] - padding[3]) / bbox.width;\n var h = (height - padding[0] - padding[2]) / bbox.height;\n var ratio = w;\n if (w > h) {\n ratio = h;\n }\n if (animate) {\n this.animatedFitView(group, startMatrix, animateCfg, bbox, viewCenter, groupCenter, ratio, true);\n } else {\n var dx = viewCenter.x - groupCenter.x;\n var dy = viewCenter.y - groupCenter.y;\n if (Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(dx) || Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(dy)) return;\n graph.translate(dx, dy);\n if (!graph.zoom(ratio, viewCenter)) {\n console.warn('zoom failed, ratio out of range, ratio: %f', ratio);\n }\n }\n };\n // fit view graph by rule\n ViewController.prototype.fitViewByRules = function (rules, animate, animateCfg) {\n var _a = rules.onlyOutOfViewPort,\n onlyOutOfViewPort = _a === void 0 ? false : _a,\n _b = rules.direction,\n direction = _b === void 0 ? 'both' : _b,\n _c = rules.ratioRule,\n ratioRule = _c === void 0 ? 'min' : _c;\n var graph = this.graph;\n var padding = this.getFormatPadding();\n var width = graph.get('width');\n var height = graph.get('height');\n var group = graph.get('group');\n var startMatrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n group.resetMatrix();\n var bbox;\n // if reaches optimizeThreshold, fitView according to the 4 corner nodes\n var nodes = graph.getNodes();\n if (nodes.length > graph.get('optimizeThreshold')) {\n var minX_3 = Infinity;\n var minY_3 = Infinity;\n var maxX_3 = -Infinity;\n var maxY_3 = -Infinity;\n nodes.forEach(function (node) {\n var _a = node.getModel(),\n x = _a.x,\n y = _a.y;\n if (minX_3 > x) minX_3 = x;\n if (minY_3 > y) minY_3 = y;\n if (maxX_3 < x) maxX_3 = x;\n if (maxY_3 < y) maxY_3 = y;\n });\n bbox = {\n minX: minX_3,\n maxX: maxX_3,\n minY: minY_3,\n maxY: maxY_3,\n width: maxX_3 - minX_3,\n height: maxY_3 - minY_3,\n x: minX_3,\n y: minY_3\n };\n } else {\n bbox = group.getCanvasBBox();\n }\n if (bbox.width === 0 || bbox.height === 0) return;\n var viewCenter = this.getViewCenter();\n var groupCenter = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n };\n // Compute ratio\n var wRatio = (width - padding[1] - padding[3]) / bbox.width;\n var hRatio = (height - padding[0] - padding[2]) / bbox.height;\n var ratio;\n if (direction === 'x') {\n ratio = wRatio;\n } else if (direction === 'y') {\n ratio = hRatio;\n } else {\n // ratioRule\n ratio = ratioRule === 'max' ? Math.max(wRatio, hRatio) : Math.min(wRatio, hRatio);\n }\n // 如果设置了仅对超出视口宽高的场景进行fitview,则没超出的场景zoom取1\n if (onlyOutOfViewPort) {\n ratio = ratio < 1 ? ratio : 1;\n }\n if (animate) {\n this.animatedFitView(group, startMatrix, animateCfg, bbox, viewCenter, groupCenter, ratio, true);\n } else {\n var initZoomRatio = graph.getZoom();\n var endZoom = initZoomRatio * ratio;\n var minZoom = graph.get('minZoom');\n // 如果zoom小于最小zoom, 则以最小zoom为准\n if (endZoom < minZoom) {\n endZoom = minZoom;\n console.warn('fitview failed, ratio out of range, ratio: %f', ratio, 'graph minzoom has been used instead');\n }\n graph.translate(viewCenter.x - groupCenter.x, viewCenter.y - groupCenter.y);\n graph.zoomTo(endZoom, viewCenter);\n }\n };\n ViewController.prototype.getFormatPadding = function () {\n var padding = this.graph.get('fitViewPadding');\n return Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"formatPadding\"])(padding);\n };\n ViewController.prototype.focusPoint = function (point, animate, animateCfg) {\n var _this = this;\n var viewCenter = this.getViewCenter();\n var modelCenter = this.getPointByCanvas(viewCenter.x, viewCenter.y);\n var viewportMatrix = this.graph.get('group').getMatrix();\n if (!viewportMatrix) viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n if (animate) {\n var dx_1 = (modelCenter.x - point.x) * viewportMatrix[0];\n var dy_1 = (modelCenter.y - point.y) * viewportMatrix[4];\n var lastX_1 = 0;\n var lastY_1 = 0;\n var newX_1 = 0;\n var newY_1 = 0;\n // 动画每次平移一点,直到目标位置\n this.graph.get('canvas').animate(function (ratio) {\n newX_1 = dx_1 * ratio;\n newY_1 = dy_1 * ratio;\n _this.graph.translate(newX_1 - lastX_1, newY_1 - lastY_1);\n lastX_1 = newX_1;\n lastY_1 = newY_1;\n }, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, animateCfg));\n } else {\n this.graph.translate((modelCenter.x - point.x) * viewportMatrix[0], (modelCenter.y - point.y) * viewportMatrix[4]);\n }\n };\n /**\n * 将 Canvas 坐标转成视口坐标\n * @param canvasX canvas x 坐标\n * @param canvasY canvas y 坐标\n */\n ViewController.prototype.getPointByCanvas = function (canvasX, canvasY) {\n var viewportMatrix = this.graph.get('group').getMatrix();\n if (!viewportMatrix) {\n viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var point = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"invertMatrix\"])({\n x: canvasX,\n y: canvasY\n }, viewportMatrix);\n return point;\n };\n /**\n * 将页面坐标转成视口坐标\n * @param clientX 页面 x 坐标\n * @param clientY 页面 y 坐标\n */\n ViewController.prototype.getPointByClient = function (clientX, clientY) {\n var canvas = this.graph.get('canvas');\n var canvasPoint = canvas.getPointByClient(clientX, clientY);\n return this.getPointByCanvas(canvasPoint.x, canvasPoint.y);\n };\n /**\n * 将视口坐标转成页面坐标\n * @param x 视口 x 坐标\n * @param y 视口 y 坐标\n */\n ViewController.prototype.getClientByPoint = function (x, y) {\n var canvas = this.graph.get('canvas');\n var canvasPoint = this.getCanvasByPoint(x, y);\n var point = canvas.getClientByPoint(canvasPoint.x, canvasPoint.y);\n return {\n x: point.x,\n y: point.y\n };\n };\n /**\n * 将视口坐标转成 Canvas 坐标\n * @param x 视口 x 坐标\n * @param y 视口 y 坐标\n */\n ViewController.prototype.getCanvasByPoint = function (x, y) {\n var viewportMatrix = this.graph.get('group').getMatrix();\n if (!viewportMatrix) {\n viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n return Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"applyMatrix\"])({\n x: x,\n y: y\n }, viewportMatrix);\n };\n /**\n * 将元素移动到画布中心\n * @param item Item 实例或 id\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n ViewController.prototype.focus = function (item, animate, animateCfg) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = this.graph.findById(item);\n }\n if (item) {\n var x = 0,\n y = 0;\n if (item.getType && item.getType() === 'edge') {\n var sourceMatrix = item.getSource().get('group').getMatrix();\n var targetMatrix = item.getTarget().get('group').getMatrix();\n if (sourceMatrix && targetMatrix) {\n x = (sourceMatrix[6] + targetMatrix[6]) / 2;\n y = (sourceMatrix[7] + targetMatrix[7]) / 2;\n } else if (sourceMatrix || targetMatrix) {\n x = sourceMatrix ? sourceMatrix[6] : targetMatrix[6];\n y = sourceMatrix ? sourceMatrix[7] : targetMatrix[7];\n }\n } else {\n var group = item.get('group');\n var matrix = group.getMatrix();\n if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n x = matrix[6];\n y = matrix[7];\n }\n // 用实际位置而不是model中的x,y,防止由于拖拽等的交互导致model的x,y并不是当前的x,y\n this.focusPoint({\n x: x,\n y: y\n }, animate, animateCfg);\n }\n };\n ViewController.prototype.focusItems = function (items, zoomToFit, animate, animateCfg) {\n if (!items.length) {\n return;\n }\n var graph = this.graph;\n var padding = this.getFormatPadding();\n var width = graph.get('width');\n var height = graph.get('height');\n var group = graph.get('group');\n var startMatrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n group.resetMatrix();\n var bbox = {\n x: 0,\n y: 0,\n minX: Number.MAX_SAFE_INTEGER,\n minY: Number.MAX_SAFE_INTEGER,\n maxX: Number.MIN_SAFE_INTEGER,\n maxY: Number.MIN_SAFE_INTEGER,\n width: 0,\n height: 0\n };\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var item = items_1[_i];\n var itemBBox = item.getBBox();\n if (itemBBox.minX < bbox.minX) {\n bbox.minX = itemBBox.minX;\n }\n if (itemBBox.minY < bbox.minY) {\n bbox.minY = itemBBox.minY;\n }\n if (itemBBox.maxX > bbox.maxX) {\n bbox.maxX = itemBBox.maxX;\n }\n if (itemBBox.maxY > bbox.maxY) {\n bbox.maxY = itemBBox.maxY;\n }\n }\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n if (bbox.width === 0 || bbox.height === 0) return;\n var viewCenter = this.getViewCenter();\n var groupCenter = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n };\n // Compute ratio\n var w = (width - padding[1] - padding[3]) / bbox.width;\n var h = (height - padding[0] - padding[2]) / bbox.height;\n var ratio = w;\n if (w > h) {\n ratio = h;\n }\n if (animate) {\n this.animatedFitView(group, startMatrix, animateCfg, bbox, viewCenter, groupCenter, ratio, zoomToFit);\n } else {\n graph.translate(viewCenter.x - groupCenter.x, viewCenter.y - groupCenter.y);\n if (zoomToFit && !graph.zoom(ratio, viewCenter)) {\n console.warn('zoom failed, ratio out of range, ratio: %f', ratio);\n }\n }\n };\n /**\n * 改变 canvas 画布的宽度和高度\n * @param width canvas 宽度\n * @param height canvas 高度\n */\n ViewController.prototype.changeSize = function (width, height) {\n var graph = this.graph;\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(width) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(height)) {\n throw Error('invalid canvas width & height, please make sure width & height type is number');\n }\n graph.set({\n width: width,\n height: height\n });\n var canvas = graph.get('canvas');\n canvas.changeSize(width, height);\n // change the size of grid plugin if it exists on graph\n var plugins = graph.get('plugins');\n plugins.forEach(function (plugin) {\n if (plugin.get('gridContainer')) {\n // 网格定位信息初始化\n plugin.positionInit();\n }\n });\n };\n ViewController.prototype.destroy = function () {\n this.graph = null;\n this.destroyed = false;\n };\n return ViewController;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (ViewController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/view.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/shape/AABB.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/shape/AABB.js ***! - \***********************************************************/ -/*! exports provided: AABB */ +/***/ "./node_modules/@antv/g6-core/es/graph/graph.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/graph/graph.js ***! + \******************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AABB\", function() { return AABB; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n\n\n\n\n/**\n * Axis-Aligned Bounding Box\n * 为了便于后续 Frustum Culling,通过查找表定义 p-vertex 和 n-vertex\n * @see https://github.com/antvis/GWebGPUEngine/issues/3\n */\nvar AABB = /*#__PURE__*/function () {\n function AABB(center, halfExtents) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, AABB);\n\n this.center = void 0;\n this.halfExtents = void 0;\n this.min = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\n this.max = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\n this.update(center, halfExtents);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(AABB, [{\n key: \"update\",\n value: function update(center, halfExtents) {\n this.center = center || gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\n this.halfExtents = halfExtents || gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(0.5, 0.5, 0.5);\n this.min = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].sub(this.min, this.center, this.halfExtents);\n this.max = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].add(this.max, this.center, this.halfExtents);\n }\n }, {\n key: \"setMinMax\",\n value: function setMinMax(min, max) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].add(this.center, max, min);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].scale(this.center, this.center, 0.5);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].sub(this.halfExtents, max, min);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].scale(this.halfExtents, this.halfExtents, 0.5);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(this.min, min);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(this.max, max);\n }\n }, {\n key: \"getMin\",\n value: function getMin() {\n return this.min;\n }\n }, {\n key: \"getMax\",\n value: function getMax() {\n return this.max;\n }\n }, {\n key: \"add\",\n value: function add(aabb) {\n var tc = this.center;\n var tcx = tc[0];\n var tcy = tc[1];\n var tcz = tc[2];\n var th = this.halfExtents;\n var thx = th[0];\n var thy = th[1];\n var thz = th[2];\n var tminx = tcx - thx;\n var tmaxx = tcx + thx;\n var tminy = tcy - thy;\n var tmaxy = tcy + thy;\n var tminz = tcz - thz;\n var tmaxz = tcz + thz;\n var oc = aabb.center;\n var ocx = oc[0];\n var ocy = oc[1];\n var ocz = oc[2];\n var oh = aabb.halfExtents;\n var ohx = oh[0];\n var ohy = oh[1];\n var ohz = oh[2];\n var ominx = ocx - ohx;\n var omaxx = ocx + ohx;\n var ominy = ocy - ohy;\n var omaxy = ocy + ohy;\n var ominz = ocz - ohz;\n var omaxz = ocz + ohz;\n\n if (ominx < tminx) {\n tminx = ominx;\n }\n\n if (omaxx > tmaxx) {\n tmaxx = omaxx;\n }\n\n if (ominy < tminy) {\n tminy = ominy;\n }\n\n if (omaxy > tmaxy) {\n tmaxy = omaxy;\n }\n\n if (ominz < tminz) {\n tminz = ominz;\n }\n\n if (omaxz > tmaxz) {\n tmaxz = omaxz;\n }\n\n tc[0] = (tminx + tmaxx) * 0.5;\n tc[1] = (tminy + tmaxy) * 0.5;\n tc[2] = (tminz + tmaxz) * 0.5;\n th[0] = (tmaxx - tminx) * 0.5;\n th[1] = (tmaxy - tminy) * 0.5;\n th[2] = (tmaxz - tminz) * 0.5;\n this.min[0] = tminx;\n this.min[1] = tminy;\n this.min[2] = tminz;\n this.max[0] = tmaxx;\n this.max[1] = tmaxy;\n this.max[2] = tmaxz;\n }\n }, {\n key: \"intersects\",\n value: function intersects(aabb) {\n var aMax = this.getMax();\n var aMin = this.getMin();\n var bMax = aabb.getMax();\n var bMin = aabb.getMin();\n return aMin[0] <= bMax[0] && aMax[0] >= bMin[0] && aMin[1] <= bMax[1] && aMax[1] >= bMin[1] && aMin[2] <= bMax[2] && aMax[2] >= bMin[2];\n }\n }, {\n key: \"containsPoint\",\n value: function containsPoint(point) {\n var min = this.getMin();\n var max = this.getMax();\n return !(point[0] < min[0] || point[0] > max[0] || point[1] < min[1] || point[1] > max[1] || point[2] < min[2] || point[2] > max[2]);\n }\n /**\n * get n-vertex\n * @param plane plane of CullingVolume\n */\n\n }, {\n key: \"getNegativeFarPoint\",\n value: function getNegativeFarPoint(plane) {\n if (plane.pnVertexFlag === 0x111) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create(), this.min);\n } else if (plane.pnVertexFlag === 0x110) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.min[0], this.min[1], this.max[2]);\n } else if (plane.pnVertexFlag === 0x101) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.min[0], this.max[1], this.min[2]);\n } else if (plane.pnVertexFlag === 0x100) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.min[0], this.max[1], this.max[2]);\n } else if (plane.pnVertexFlag === 0x011) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.max[0], this.min[1], this.min[2]);\n } else if (plane.pnVertexFlag === 0x010) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.max[0], this.min[1], this.max[2]);\n } else if (plane.pnVertexFlag === 0x001) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.max[0], this.max[1], this.min[2]);\n } else {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.max[0], this.max[1], this.max[2]);\n }\n }\n /**\n * get p-vertex\n * @param plane plane of CullingVolume\n */\n\n }, {\n key: \"getPositiveFarPoint\",\n value: function getPositiveFarPoint(plane) {\n if (plane.pnVertexFlag === 0x111) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create(), this.max);\n } else if (plane.pnVertexFlag === 0x110) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.max[0], this.max[1], this.min[2]);\n } else if (plane.pnVertexFlag === 0x101) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.max[0], this.min[1], this.max[2]);\n } else if (plane.pnVertexFlag === 0x100) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.max[0], this.min[1], this.min[2]);\n } else if (plane.pnVertexFlag === 0x011) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.min[0], this.max[1], this.max[2]);\n } else if (plane.pnVertexFlag === 0x010) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.min[0], this.max[1], this.min[2]);\n } else if (plane.pnVertexFlag === 0x001) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.min[0], this.min[1], this.max[2]);\n } else {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(this.min[0], this.min[1], this.min[2]);\n }\n }\n }]);\n\n return AABB;\n}();\n//# sourceMappingURL=AABB.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/shape/AABB.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_event_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/event-emitter */ \"./node_modules/@antv/event-emitter/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/algorithm */ \"./node_modules/@antv/algorithm/es/index.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _util_validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/validation */ \"./node_modules/@antv/g6-core/es/util/validation.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _controller__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./controller */ \"./node_modules/@antv/g6-core/es/graph/controller/index.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _item_hull__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../item/hull */ \"./node_modules/@antv/g6-core/es/item/hull.js\");\n\n\n\n\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__[\"ext\"].transform;\nvar NODE = 'node';\nvar AbstractGraph = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(AbstractGraph, _super);\n function AbstractGraph(cfg) {\n var _this = _super.call(this) || this;\n /**\n * 根据 comboTree 结构整理 Combo 相关的图形绘制层级,包括 Combo 本身、节点、边\n * @param {GraphData} data 数据\n */\n _this.sortCombos = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"debounce\"])(function () {\n var comboSorted = _this.get('comboSorted');\n if (!_this || _this.destroyed || comboSorted) return;\n _this.set('comboSorted', true);\n var depthMap = [];\n var dataDepthMap = {};\n var comboTrees = _this.get('comboTrees');\n (comboTrees || []).forEach(function (cTree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(cTree, function (child) {\n if (depthMap[child.depth]) depthMap[child.depth].push(child.id);else depthMap[child.depth] = [child.id];\n dataDepthMap[child.id] = child.depth;\n return true;\n });\n });\n var edges = _this.getEdges().concat(_this.get('vedges'));\n (edges || []).forEach(function (edgeItem) {\n var edge = edgeItem.getModel();\n var sourceDepth = dataDepthMap[edge.source] || 0;\n var targetDepth = dataDepthMap[edge.target] || 0;\n var depth = Math.max(sourceDepth, targetDepth);\n if (depthMap[depth]) depthMap[depth].push(edge.id);else depthMap[depth] = [edge.id];\n });\n depthMap.forEach(function (array) {\n if (!array || !array.length) return;\n for (var i = array.length - 1; i >= 0; i--) {\n var item = _this.findById(array[i]);\n if (item) item.toFront();\n }\n });\n }, 500, false);\n _this.cfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"])(_this.getDefaultCfg(), cfg);\n _this.init();\n _this.animating = false;\n _this.destroyed = false;\n // 启用 stack 后,实例化 undoStack 和 redoStack\n if (_this.cfg.enabledStack) {\n // 实例化 undo 和 redo 栈\n _this.undoStack = new _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"Stack\"](_this.cfg.maxStep);\n _this.redoStack = new _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"Stack\"](_this.cfg.maxStep);\n }\n return _this;\n }\n AbstractGraph.prototype.init = function () {\n this.initCanvas();\n // instance controller\n var viewController = new _controller__WEBPACK_IMPORTED_MODULE_8__[\"ViewController\"](this);\n var modeController = new _controller__WEBPACK_IMPORTED_MODULE_8__[\"ModeController\"](this);\n var itemController = new _controller__WEBPACK_IMPORTED_MODULE_8__[\"ItemController\"](this);\n var stateController = new _controller__WEBPACK_IMPORTED_MODULE_8__[\"StateController\"](this);\n this.set({\n viewController: viewController,\n modeController: modeController,\n itemController: itemController,\n stateController: stateController\n });\n // 初始化布局机制\n this.initLayoutController();\n // 初始化事件机制\n this.initEventController();\n this.initGroups();\n /** 初始化插件 */\n this.initPlugins();\n };\n // 初始化所有 Group\n AbstractGraph.prototype.initGroups = function () {\n var canvas = this.get('canvas');\n if (!canvas) return;\n var el = canvas.get('el');\n var _a = (el || {}).id,\n id = _a === void 0 ? 'g6' : _a;\n var group = canvas.addGroup({\n id: \"\".concat(id, \"-root\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].rootContainerClassName\n });\n if (this.get('groupByTypes')) {\n var edgeGroup = group.addGroup({\n id: \"\".concat(id, \"-edge\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].edgeContainerClassName\n });\n var nodeGroup = group.addGroup({\n id: \"\".concat(id, \"-node\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].nodeContainerClassName\n });\n var comboGroup = group.addGroup({\n id: \"\".concat(id, \"-combo\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].comboContainerClassName\n });\n // 用于存储自定义的群组\n comboGroup.toBack();\n this.set({\n nodeGroup: nodeGroup,\n edgeGroup: edgeGroup,\n comboGroup: comboGroup\n });\n }\n var delegateGroup = group.addGroup({\n id: \"\".concat(id, \"-delegate\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].delegateContainerClassName\n });\n this.set({\n delegateGroup: delegateGroup\n });\n this.set('group', group);\n };\n // eslint-disable-next-line class-methods-use-this\n AbstractGraph.prototype.getDefaultCfg = function () {\n return {\n /**\n * Container could be dom object or dom id\n */\n container: undefined,\n /**\n * Canvas width\n * unit pixel if undefined force fit width\n */\n width: undefined,\n /**\n * Canvas height\n * unit pixel if undefined force fit height\n */\n height: undefined,\n /**\n * renderer canvas or svg\n * @type {string}\n */\n renderer: 'canvas',\n /**\n * control graph behaviors\n */\n modes: {},\n /**\n * 注册插件\n */\n plugins: [],\n /**\n * source data\n */\n data: {},\n /**\n * Fit view padding (client scale)\n */\n fitViewPadding: 10,\n /**\n * Minimum scale size\n */\n minZoom: 0.02,\n /**\n * Maxmum scale size\n */\n maxZoom: 10,\n /**\n * capture events\n */\n event: true,\n /**\n * group node & edges into different graphic groups\n */\n groupByTypes: true,\n /**\n * determine if it's a directed graph\n */\n directed: false,\n /**\n * when data or shape changed, should canvas draw automatically\n */\n autoPaint: true,\n /**\n * store all the node instances\n */\n nodes: [],\n /**\n * store all the edge instances\n */\n edges: [],\n /**\n * store all the combo instances\n */\n combos: [],\n /**\n * store all the edge instances which are virtual edges related to collapsed combo\n */\n vedges: [],\n /**\n * all the instances indexed by id\n */\n itemMap: {},\n /**\n * 边直接连接到节点的中心,不再考虑锚点\n */\n linkCenter: false,\n /**\n * 默认的节点配置,data 上定义的配置会覆盖这些配置。例如:\n * defaultNode: {\n * type: 'rect',\n * size: [60, 40],\n * style: {\n * //... 样式配置项\n * }\n * }\n * 若数据项为 { id: 'node', x: 100, y: 100 }\n * 实际创建的节点模型是 { id: 'node', x: 100, y: 100, type: 'rect', size: [60, 40] }\n * 若数据项为 { id: 'node', x: 100, y: 100, type: 'circle' }\n * 实际创建的节点模型是 { id: 'node', x: 100, y: 100, type: 'circle', size: [60, 40] }\n */\n defaultNode: {},\n /**\n * 默认边配置,data 上定义的配置会覆盖这些配置。用法同 defaultNode\n */\n defaultEdge: {},\n /**\n * 节点默认样式,也可以添加状态样式\n * 例如:\n * const graph = new G6.Graph({\n * nodeStateStyles: {\n * selected: { fill: '#ccc', stroke: '#666' },\n * active: { lineWidth: 2 }\n * },\n * ...\n * });\n *\n */\n nodeStateStyles: {},\n /**\n * 边默认样式,用法同nodeStateStyle\n */\n edgeStateStyles: {},\n /**\n * graph 状态\n */\n states: {},\n /**\n * 是否启用全局动画\n */\n animate: false,\n /**\n * 动画设置,仅在 animate 为 true 时有效\n */\n animateCfg: {\n /**\n * 帧回调函数,用于自定义节点运动路径,为空时线性运动\n */\n onFrame: undefined,\n /**\n * 动画时长(ms)\n */\n duration: 500,\n /**\n * 指定动画动效\n */\n easing: 'easeLinear'\n },\n callback: undefined,\n // 默认不启用 undo & redo 功能\n enabledStack: false,\n // 只有当 enabledStack 为 true 时才起作用\n maxStep: 10,\n // 存储图上的 tooltip dom,方便销毁\n tooltips: [],\n // 达到这一节点数量(默认值 1000),将开启性能优化模式。目前包括:节点状态样式变更是否影响相关边的更新\n optimizeThreshold: 1000\n };\n };\n /**\n * 将值设置到 this.cfg 变量上面\n * @param key 键 或 对象值\n * @param val 值\n */\n AbstractGraph.prototype.set = function (key, val) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(key)) {\n this.cfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, this.cfg), key);\n } else {\n this.cfg[key] = val;\n }\n if (key === 'enabledStack' && val && !this.undoStack && !this.redoStack) {\n this.undoStack = new _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"Stack\"](this.cfg.maxStep);\n this.redoStack = new _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"Stack\"](this.cfg.maxStep);\n }\n return this;\n };\n /**\n * 获取 this.cfg 中的值\n * @param key 键\n */\n AbstractGraph.prototype.get = function (key) {\n var _a;\n return (_a = this.cfg) === null || _a === void 0 ? void 0 : _a[key];\n };\n /**\n * 获取 graph 的根图形分组\n * @return 根 group\n */\n AbstractGraph.prototype.getGroup = function () {\n return this.get('group');\n };\n /**\n * 获取 graph 的 DOM 容器\n * @return DOM 容器\n */\n AbstractGraph.prototype.getContainer = function () {\n return this.get('container');\n };\n /**\n * 获取 graph 的最小缩放比例\n * @return minZoom\n */\n AbstractGraph.prototype.getMinZoom = function () {\n return this.get('minZoom');\n };\n /**\n * 设置 graph 的最小缩放比例\n * @return minZoom\n */\n AbstractGraph.prototype.setMinZoom = function (ratio) {\n return this.set('minZoom', ratio);\n };\n /**\n * 获取 graph 的最大缩放比例\n * @param maxZoom\n */\n AbstractGraph.prototype.getMaxZoom = function () {\n return this.get('maxZoom');\n };\n /**\n * 设置 graph 的最大缩放比例\n * @param maxZoom\n */\n AbstractGraph.prototype.setMaxZoom = function (ratio) {\n return this.set('maxZoom', ratio);\n };\n /**\n * 获取 graph 的宽度\n * @return width\n */\n AbstractGraph.prototype.getWidth = function () {\n return this.get('width');\n };\n /**\n * 获取 graph 的高度\n * @return width\n */\n AbstractGraph.prototype.getHeight = function () {\n return this.get('height');\n };\n /**\n * 清理元素多个状态\n * @param {string|Item} item 元素id或元素实例\n * @param {string[]} states 状态\n */\n AbstractGraph.prototype.clearItemStates = function (item, states) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n item = this.findById(item);\n }\n var itemController = this.get('itemController');\n if (!states) {\n states = item.get('states');\n }\n itemController.clearItemStates(item, states);\n var stateController = this.get('stateController');\n stateController.updateStates(item, states, false);\n };\n /**\n * 设置各个节点样式,以及在各种状态下节点 keyShape 的样式。\n * 若是自定义节点切在各种状态下\n * graph.node(node => {\n * return {\n * type: 'rect',\n * label: node.id,\n * style: { fill: '#666' },\n * stateStyles: {\n * selected: { fill: 'blue' },\n * custom: { fill: 'green' }\n * }\n * }\n * });\n * @param {function} nodeFn 指定每个节点样式\n */\n AbstractGraph.prototype.node = function (nodeFn) {\n if (typeof nodeFn === 'function') {\n this.set('nodeMapper', nodeFn);\n }\n };\n /**\n * 设置各个边样式\n * @param {function} edgeFn 指定每个边的样式,用法同 node\n */\n AbstractGraph.prototype.edge = function (edgeFn) {\n if (typeof edgeFn === 'function') {\n this.set('edgeMapper', edgeFn);\n }\n };\n /**\n * 设置各个 combo 的配置\n * @param comboFn\n */\n AbstractGraph.prototype.combo = function (comboFn) {\n if (typeof comboFn === 'function') {\n this.set('comboMapper', comboFn);\n }\n };\n /**\n * 根据 ID 查询图元素实例\n * @param id 图元素 ID\n */\n AbstractGraph.prototype.findById = function (id) {\n return this.get('itemMap')[id];\n };\n /**\n * 根据对应规则查找单个元素\n * @param {ITEM_TYPE} type 元素类型(node | edge | group)\n * @param {(item: T, index: number) => T} fn 指定规则\n * @return {T} 元素实例\n */\n AbstractGraph.prototype.find = function (type, fn) {\n var result;\n var items = this.get(\"\".concat(type, \"s\"));\n // eslint-disable-next-line consistent-return\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(items, function (item, i) {\n if (fn(item, i)) {\n result = item;\n return result;\n }\n });\n return result;\n };\n /**\n * 查找所有满足规则的元素\n * @param {string} type 元素类型(node|edge)\n * @param {string} fn 指定规则\n * @return {array} 元素实例\n */\n AbstractGraph.prototype.findAll = function (type, fn) {\n var result = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(this.get(\"\".concat(type, \"s\")), function (item, i) {\n if (fn(item, i)) {\n result.push(item);\n }\n });\n return result;\n };\n /**\n * 查找所有处于指定状态的元素\n * @param {string} type 元素类型(node|edge)\n * @param {string} state 状态\n * @return {object} 元素实例\n */\n AbstractGraph.prototype.findAllByState = function (type, state, additionalFilter) {\n if (additionalFilter) {\n return this.findAll(type, function (item) {\n return item.hasState(state) && additionalFilter(item);\n });\n } else {\n return this.findAll(type, function (item) {\n return item.hasState(state);\n });\n }\n };\n /**\n * 平移画布\n * @param dx 水平方向位移\n * @param dy 垂直方向位移\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n AbstractGraph.prototype.translate = function (dx, dy, animate, animateCfg) {\n var _this = this;\n var group = this.get('group');\n var matrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(group.getMatrix());\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n if (animate) {\n var animateConfig = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"getAnimateCfgWithCallback\"])({\n animateCfg: animateCfg,\n callback: function callback() {\n return _this.emit('viewportchange', {\n action: 'translate',\n matrix: group.getMatrix()\n });\n }\n });\n Object(_util_math__WEBPACK_IMPORTED_MODULE_5__[\"move\"])(group, {\n x: group.getCanvasBBox().x + dx,\n y: group.getCanvasBBox().y + dy\n }, animate, animateConfig || {\n duration: 500,\n easing: 'easeCubic'\n });\n } else {\n matrix = transform(matrix, [['t', dx, dy]]);\n group.setMatrix(matrix);\n this.emit('viewportchange', {\n action: 'translate',\n matrix: matrix\n });\n this.autoPaint();\n }\n };\n /**\n * 平移画布到某点\n * @param {number} x 水平坐标\n * @param {number} y 垂直坐标\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n AbstractGraph.prototype.moveTo = function (x, y, animate, animateCfg) {\n var group = this.get('group');\n Object(_util_math__WEBPACK_IMPORTED_MODULE_5__[\"move\"])(group, {\n x: x,\n y: y\n }, animate, animateCfg || {\n duration: 500,\n easing: 'easeCubic'\n });\n this.emit('viewportchange', {\n action: 'move',\n matrix: group.getMatrix()\n });\n };\n /**\n * 调整视口适应视图\n * @param {object} padding 四周围边距\n * @param {FitViewRules} rules fitView的规则\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n AbstractGraph.prototype.fitView = function (padding, rules, animate, animateCfg) {\n if (padding) {\n this.set('fitViewPadding', padding);\n }\n var viewController = this.get('viewController');\n if (rules) {\n viewController.fitViewByRules(rules, animate, animateCfg);\n } else {\n viewController.fitView(animate, animateCfg);\n }\n this.autoPaint();\n };\n /**\n * 调整视口适应视图,不缩放,仅将图 bbox 中心对齐到画布中心\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n AbstractGraph.prototype.fitCenter = function (animate, animateCfg) {\n var viewController = this.get('viewController');\n viewController.fitCenter(animate, animateCfg);\n this.autoPaint();\n };\n /**\n * 新增行为\n * @param {string | ModeOption | ModeType[]} behaviors 添加的行为\n * @param {string | string[]} modes 添加到对应的模式\n * @return {Graph} Graph\n */\n AbstractGraph.prototype.addBehaviors = function (behaviors, modes) {\n var modeController = this.get('modeController');\n modeController.manipulateBehaviors(behaviors, modes, true);\n return this;\n };\n /**\n * 移除行为\n * @param {string | ModeOption | ModeType[]} behaviors 移除的行为\n * @param {string | string[]} modes 从指定的模式中移除\n * @return {Graph} Graph\n */\n AbstractGraph.prototype.removeBehaviors = function (behaviors, modes) {\n var modeController = this.get('modeController');\n modeController.manipulateBehaviors(behaviors, modes, false);\n return this;\n };\n /**\n * 更新行为参数\n * @param {string | ModeOption | ModeType} behavior 需要更新的行为\n * @param {string | string[]} modes 指定的模式中的行为,不指定则为 default\n * @return {Graph} Graph\n */\n AbstractGraph.prototype.updateBehavior = function (behavior, newCfg, mode) {\n var modeController = this.get('modeController');\n modeController.updateBehavior(behavior, newCfg, mode);\n return this;\n };\n /**\n * 伸缩窗口\n * @param ratio 伸缩比例\n * @param center 以center的x, y坐标为中心缩放\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n * @return {boolean} 缩放是否成功\n */\n AbstractGraph.prototype.zoom = function (ratio, center, animate, animateCfg) {\n var _this = this;\n var group = this.get('group');\n var matrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(group.getMatrix()) || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var minZoom = this.get('minZoom');\n var maxZoom = this.get('maxZoom');\n var currentZoom = this.getZoom() || 1;\n var targetZoom = currentZoom * ratio;\n var finalRatio = ratio;\n var failed = false;\n if (minZoom && targetZoom < minZoom) {\n finalRatio = minZoom / currentZoom;\n failed = true;\n } else if (maxZoom && targetZoom > maxZoom) {\n finalRatio = maxZoom / currentZoom;\n failed = true;\n }\n if (center) {\n matrix = transform(matrix, [['t', -center.x, -center.y], ['s', finalRatio, finalRatio], ['t', center.x, center.y]]);\n } else {\n matrix = transform(matrix, [['s', finalRatio, finalRatio]]);\n }\n if (animate) {\n // Clone the original matrix to perform the animation\n var aniMatrix_1 = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(group.getMatrix());\n if (!aniMatrix_1) {\n aniMatrix_1 = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var initialRatio_1 = aniMatrix_1[0];\n var targetRatio_1 = initialRatio_1 * finalRatio;\n var animateConfig = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"getAnimateCfgWithCallback\"])({\n animateCfg: animateCfg,\n callback: function callback() {\n return _this.emit('viewportchange', {\n action: 'zoom',\n matrix: group.getMatrix()\n });\n }\n });\n group.animate(function (ratio) {\n if (ratio === 1) {\n // Reuse the first transformation\n aniMatrix_1 = matrix;\n } else {\n var scale = Object(_util_math__WEBPACK_IMPORTED_MODULE_5__[\"lerp\"])(initialRatio_1, targetRatio_1, ratio) / aniMatrix_1[0];\n if (center) {\n aniMatrix_1 = transform(aniMatrix_1, [['t', -center.x, -center.y], ['s', scale, scale], ['t', center.x, center.y]]);\n } else {\n aniMatrix_1 = transform(aniMatrix_1, [['s', scale, scale]]);\n }\n }\n return {\n matrix: aniMatrix_1\n };\n }, animateConfig);\n } else {\n group.setMatrix(matrix);\n this.emit('viewportchange', {\n action: 'zoom',\n matrix: matrix\n });\n this.autoPaint();\n }\n return !failed;\n };\n /**\n * 伸缩视口到一固定比例\n * @param {number} toRatio 伸缩比例\n * @param {Point} center 以center的x, y坐标为中心缩放\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n * @return {boolean} 缩放是否成功\n */\n AbstractGraph.prototype.zoomTo = function (toRatio, center, animate, animateCfg) {\n var ratio = toRatio / this.getZoom();\n return this.zoom(ratio, center, animate, animateCfg);\n };\n /**\n * 将元素移动到视口中心\n * @param {Item} item 指定元素\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n AbstractGraph.prototype.focusItem = function (item, animate, animateCfg) {\n var viewController = this.get('viewController');\n var isAnimate = false;\n if (animate) isAnimate = true;else if (animate === undefined) isAnimate = this.get('animate');\n var curAniamteCfg = {};\n if (animateCfg) curAniamteCfg = animateCfg;else if (animateCfg === undefined) curAniamteCfg = this.get('animateCfg');\n viewController.focus(item, isAnimate, curAniamteCfg);\n this.autoPaint();\n };\n /**\n * Focus on the passed items\n * @param {Item[]} items Items you want to focus on\n * @param {boolean} zoomToFit Wether to zoom on the passed items\n * @param {boolean} animate Wether to animate the transition\n * @param {GraphAnimateConfig} animateCfg Animation configuration\n */\n AbstractGraph.prototype.focusItems = function (items, zoomToFit, animate, animateCfg) {\n var viewController = this.get('viewController');\n viewController.focusItems(items, zoomToFit, animate, animateCfg);\n };\n /**\n * 自动重绘\n * @internal 仅供内部更新机制调用,外部根据需求调用 render 或 paint 接口\n */\n AbstractGraph.prototype.autoPaint = function () {\n if (this.get('autoPaint')) {\n this.paint();\n }\n };\n /**\n * 仅画布重新绘制\n */\n AbstractGraph.prototype.paint = function () {\n this.emit('beforepaint');\n this.get('canvas').draw();\n this.emit('afterpaint');\n };\n /**\n * 将屏幕坐标转换为视口坐标\n * @param {number} clientX 屏幕x坐标\n * @param {number} clientY 屏幕y坐标\n * @return {Point} 视口坐标\n */\n AbstractGraph.prototype.getPointByClient = function (clientX, clientY) {\n var viewController = this.get('viewController');\n return viewController.getPointByClient(clientX, clientY);\n };\n /**\n * 将绘制坐标转换为屏幕坐标\n * @param {number} x 绘制坐标 x\n * @param {number} y 绘制坐标 y\n * @return {Point} 绘制坐标\n */\n AbstractGraph.prototype.getClientByPoint = function (x, y) {\n var viewController = this.get('viewController');\n return viewController.getClientByPoint(x, y);\n };\n /**\n * 将画布坐标转换为绘制坐标\n * @param {number} canvasX 画布 x 坐标\n * @param {number} canvasY 画布 y 坐标\n * @return {object} 绘制坐标\n */\n AbstractGraph.prototype.getPointByCanvas = function (canvasX, canvasY) {\n var viewController = this.get('viewController');\n return viewController.getPointByCanvas(canvasX, canvasY);\n };\n /**\n * 将绘制坐标转换为画布坐标\n * @param {number} x 绘制坐标 x\n * @param {number} y 绘制坐标 y\n * @return {object} 画布坐标\n */\n AbstractGraph.prototype.getCanvasByPoint = function (x, y) {\n var viewController = this.get('viewController');\n return viewController.getCanvasByPoint(x, y);\n };\n /**\n * 获取图内容的中心绘制坐标\n * @return {object} 中心绘制坐标\n */\n AbstractGraph.prototype.getGraphCenterPoint = function () {\n var bbox = this.get('group').getCanvasBBox();\n return {\n x: (bbox.minX + bbox.maxX) / 2,\n y: (bbox.minY + bbox.maxY) / 2\n };\n };\n /**\n * 获取视口中心绘制坐标\n * @return {object} 视口中心绘制坐标\n */\n AbstractGraph.prototype.getViewPortCenterPoint = function () {\n return this.getPointByCanvas(this.get('width') / 2, this.get('height') / 2);\n };\n /**\n * 显示元素\n * @param {Item} item 指定元素\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n AbstractGraph.prototype.showItem = function (item, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var itemController = this.get('itemController');\n var object = itemController.changeItemVisibility(item, true);\n if (stack && this.get('enabledStack')) {\n var id = object.getID();\n var type = object.getType();\n var before = {};\n var after = {};\n switch (type) {\n case 'node':\n before.nodes = [{\n id: id,\n visible: false\n }];\n after.nodes = [{\n id: id,\n visible: true\n }];\n break;\n case 'edge':\n before.nodes = [{\n id: id,\n visible: false\n }];\n after.edges = [{\n id: id,\n visible: true\n }];\n break;\n case 'combo':\n before.nodes = [{\n id: id,\n visible: false\n }];\n after.combos = [{\n id: id,\n visible: true\n }];\n break;\n default:\n break;\n }\n this.pushStack('visible', {\n before: before,\n after: after\n });\n }\n };\n /**\n * 隐藏元素\n * @param {Item} item 指定元素\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n AbstractGraph.prototype.hideItem = function (item, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var itemController = this.get('itemController');\n var object = itemController.changeItemVisibility(item, false);\n if (stack && this.get('enabledStack')) {\n var id = object.getID();\n var type = object.getType();\n var before = {};\n var after = {};\n switch (type) {\n case 'node':\n before.nodes = [{\n id: id,\n visible: true\n }];\n after.nodes = [{\n id: id,\n visible: false\n }];\n break;\n case 'edge':\n before.nodes = [{\n id: id,\n visible: true\n }];\n after.edges = [{\n id: id,\n visible: false\n }];\n break;\n case 'combo':\n before.nodes = [{\n id: id,\n visible: true\n }];\n after.combos = [{\n id: id,\n visible: false\n }];\n break;\n default:\n break;\n }\n this.pushStack('visible', {\n before: before,\n after: after\n });\n }\n };\n /**\n * 刷新元素\n * @param {string|object} item 元素id或元素实例\n */\n AbstractGraph.prototype.refreshItem = function (item) {\n var itemController = this.get('itemController');\n itemController.refreshItem(item);\n };\n /**\n * 设置是否在更新/刷新后自动重绘\n * @param {boolean} auto 自动重绘\n */\n AbstractGraph.prototype.setAutoPaint = function (auto) {\n var self = this;\n self.set('autoPaint', auto);\n var canvas = self.get('canvas');\n canvas.set('autoDraw', auto);\n };\n /**\n * 删除元素\n * @param {Item} item 元素id或元素实例\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n AbstractGraph.prototype.remove = function (item, stack) {\n if (stack === void 0) {\n stack = true;\n }\n this.removeItem(item, stack);\n };\n /**\n * 删除元素\n * @param {Item} item 元素id或元素实例\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n AbstractGraph.prototype.removeItem = function (item, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var nodeItem = item;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) nodeItem = this.findById(item);\n if (!nodeItem && Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n console.warn(\"The item \".concat(item, \" to be removed does not exist!\"));\n } else if (nodeItem) {\n var type = '';\n if (nodeItem.getType) type = nodeItem.getType();\n // 将删除的元素入栈\n if (stack && this.get('enabledStack')) {\n var deletedModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, nodeItem.getModel()), {\n itemType: type\n });\n var before = {};\n switch (type) {\n case 'node':\n {\n before.nodes = [deletedModel];\n before.edges = [];\n var edges = nodeItem.getEdges();\n for (var i = edges.length - 1; i >= 0; i--) {\n before.edges.push(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, edges[i].getModel()), {\n itemType: 'edge'\n }));\n }\n break;\n }\n case 'edge':\n before.edges = [deletedModel];\n break;\n case 'combo':\n before.combos = [deletedModel];\n break;\n default:\n break;\n }\n this.pushStack('delete', {\n before: before,\n after: {}\n });\n }\n if (type === 'node') {\n var model = nodeItem.getModel();\n // 如果删除的是节点,且该节点存在于某个 Combo 中,则需要先将 node 从 combo 中移除,否则删除节点后,操作 combo 会出错\n if (model.comboId) {\n this.updateComboTree(nodeItem, undefined, false);\n }\n }\n var itemController = this.get('itemController');\n itemController.removeItem(nodeItem);\n if (type === 'combo') {\n var newComboTrees = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"reconstructTree\"])(this.get('comboTrees'));\n this.set('comboTrees', newComboTrees);\n }\n }\n };\n AbstractGraph.prototype.innerAddItem = function (type, model, itemController) {\n // 添加节点、边或combo之前,先验证数据是否符合规范\n if (!Object(_util_validation__WEBPACK_IMPORTED_MODULE_6__[\"singleDataValidation\"])(type, model)) {\n return false;\n }\n if (model.id && this.findById(model.id)) {\n console.warn(\"This item exists already. Be sure the id %c\".concat(model.id, \"%c is unique.\"), 'font-size: 20px; color: red;', '');\n return;\n }\n var item;\n var comboTrees = this.get('comboTrees') || [];\n if (type === 'combo') {\n var itemMap_1 = this.get('itemMap');\n var foundParent_1 = false;\n comboTrees.forEach(function (ctree) {\n if (foundParent_1) return; // terminate the forEach after the tree containing the item is done\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n // find the parent\n if (model.parentId === child.id) {\n foundParent_1 = true;\n var newCombo = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n id: model.id,\n depth: child.depth + 2\n }, model);\n if (child.children) child.children.push(newCombo);else child.children = [newCombo];\n model.depth = newCombo.depth;\n item = itemController.addItem(type, model);\n }\n var childItem = itemMap_1[child.id];\n // after the parent is found, update all the ancestors\n if (foundParent_1 && childItem && childItem.getType && childItem.getType() === 'combo') {\n itemController.updateCombo(childItem, child.children);\n }\n return true;\n });\n });\n // if the parent is not found, add it to the root\n if (!foundParent_1) {\n var newCombo = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n id: model.id,\n depth: 0\n }, model);\n model.depth = newCombo.depth;\n comboTrees.push(newCombo);\n item = itemController.addItem(type, model);\n }\n this.set('comboTrees', comboTrees);\n if (model.collapsed) {\n this.collapseCombo(item, false);\n this.updateCombo(item);\n }\n } else if (type === 'node' && Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(model.comboId) && comboTrees) {\n var parentCombo = this.findById(model.comboId);\n if (parentCombo && parentCombo.getType && parentCombo.getType() !== 'combo') {\n console.warn(\"'\".concat(model.comboId, \"' is not a id of a combo in the graph, the node will be added without combo.\"));\n }\n item = itemController.addItem(type, model);\n var itemMap_2 = this.get('itemMap');\n var foundParent_2 = false,\n foundNode_1 = false;\n comboTrees.forEach(function (ctree) {\n if (foundNode_1 || foundParent_2) return; // terminate the forEach\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n if (child.id === model.id) {\n // if the item exists in the tree already, terminate\n foundNode_1 = true;\n return false;\n }\n if (model.comboId === child.id && !foundNode_1) {\n // found the parent, add the item to the children of its parent in the tree\n foundParent_2 = true;\n var cloneNode = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(model);\n cloneNode.itemType = 'node';\n if (child.children) child.children.push(cloneNode);else child.children = [cloneNode];\n cloneNode.depth = child.depth + 1;\n }\n // update the size of all the ancestors\n if (foundParent_2 && itemMap_2[child.id].getType && itemMap_2[child.id].getType() === 'combo') {\n itemController.updateCombo(itemMap_2[child.id], child.children);\n }\n return true;\n });\n });\n } else {\n item = itemController.addItem(type, model);\n }\n if (type === 'node' && model.comboId || type === 'combo' && model.parentId) {\n // add the combo to the parent's children array\n var parentCombo = this.findById(model.comboId || model.parentId);\n if (parentCombo && parentCombo.getType && parentCombo.getType() === 'combo') parentCombo.addChild(item);\n }\n return item;\n };\n /**\n * 新增元素\n * @param {ITEM_TYPE} type 元素类型(node | edge)\n * @param {ModelConfig} model 元素数据模型\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n * @param {boolean} sortCombo 本次操作是否需要更新 combo 层级顺序,内部参数,用户在外部使用 addItem 时始终时需要更新\n * @return {Item} 元素实例\n */\n AbstractGraph.prototype.addItem = function (type, model, stack, sortCombo) {\n if (stack === void 0) {\n stack = true;\n }\n if (sortCombo === void 0) {\n sortCombo = true;\n }\n var currentComboSorted = this.get('comboSorted');\n this.set('comboSorted', currentComboSorted && !sortCombo);\n var itemController = this.get('itemController');\n var item = this.innerAddItem(type, model, itemController);\n if (item === false || item === true) {\n return item;\n }\n var combos = this.get('combos');\n if (combos && combos.length > 0) {\n this.sortCombos();\n }\n this.autoPaint();\n if (stack && this.get('enabledStack')) {\n var addedModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, item.getModel()), {\n itemType: type\n });\n var after = {};\n switch (type) {\n case 'node':\n after.nodes = [addedModel];\n break;\n case 'edge':\n after.edges = [addedModel];\n break;\n case 'combo':\n after.combos = [addedModel];\n break;\n default:\n break;\n }\n this.pushStack('add', {\n before: {},\n after: after\n });\n }\n return item;\n };\n AbstractGraph.prototype.addItems = function (items, stack, sortCombo) {\n if (items === void 0) {\n items = [];\n }\n if (stack === void 0) {\n stack = true;\n }\n if (sortCombo === void 0) {\n sortCombo = true;\n }\n var currentComboSorted = this.get('comboSorted');\n this.set('comboSorted', currentComboSorted && !sortCombo);\n var itemController = this.get('itemController');\n var returnItems = [];\n // 1. add anything that is not an edge.\n // Add undefined as a placeholder for the next cycle. This way we return items matching the input order\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (item.type !== 'edge' && item.type !== 'vedge') {\n returnItems.push(this.innerAddItem(item.type, item.model, itemController));\n } else {\n returnItems.push(undefined);\n }\n }\n // 2. add all the edges\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n if (item.type === 'edge' || item.type === 'vedge') {\n returnItems[i] = this.innerAddItem(item.type, item.model, itemController);\n }\n }\n if (sortCombo) {\n var combos = this.get('combos');\n if (combos && combos.length > 0) {\n this.sortCombos();\n }\n }\n this.autoPaint();\n if (stack && this.get('enabledStack')) {\n var after = {\n nodes: [],\n edges: [],\n combos: []\n };\n for (var i = 0; i < items.length; i++) {\n var type = items[i].type;\n var returnItem = returnItems[i];\n if (!!returnItem && returnItem !== true) {\n var addedModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, returnItem.getModel()), {\n itemType: type\n });\n switch (type) {\n case 'node':\n after.nodes.push(addedModel);\n break;\n case 'edge':\n after.edges.push(addedModel);\n break;\n case 'combo':\n after.combos.push(addedModel);\n break;\n default:\n break;\n }\n }\n }\n this.pushStack('addItems', {\n before: {},\n after: after\n });\n }\n return returnItems;\n };\n /**\n * 新增元素\n * @param {ITEM_TYPE} type 元素类型(node | edge)\n * @param {ModelConfig} model 元素数据模型\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n * @param {boolean} sortCombo 本次操作是否需要更新 combo 层级顺序,内部参数,用户在外部使用 addItem 时始终时需要更新\n * @return {Item} 元素实例\n */\n AbstractGraph.prototype.add = function (type, model, stack, sortCombo) {\n if (stack === void 0) {\n stack = true;\n }\n if (sortCombo === void 0) {\n sortCombo = true;\n }\n return this.addItem(type, model, stack, sortCombo);\n };\n /**\n * 更新元素\n * @param {Item} item 元素id或元素实例\n * @param {Partial | EdgeConfig} cfg 需要更新的数据\n */\n AbstractGraph.prototype.updateItem = function (item, cfg, stack) {\n var _this = this;\n if (stack === void 0) {\n stack = true;\n }\n var itemController = this.get('itemController');\n var currentItem;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n currentItem = this.findById(item);\n } else {\n currentItem = item;\n }\n var stackEnabled = stack && this.get('enabledStack');\n var unupdatedModel;\n if (stackEnabled) {\n unupdatedModel = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(currentItem.getModel());\n }\n var type = '';\n if (currentItem.getType) type = currentItem.getType();\n var states = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], currentItem.getStates(), true);\n if (type === 'combo') {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n return _this.setItemState(currentItem, state, false);\n });\n }\n itemController.updateItem(currentItem, cfg);\n if (type === 'combo') {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n return _this.setItemState(currentItem, state, true);\n });\n }\n if (stackEnabled) {\n var before = {\n nodes: [],\n edges: [],\n combos: []\n };\n var after = {\n nodes: [],\n edges: [],\n combos: []\n };\n var afterModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n id: unupdatedModel.id\n }, cfg);\n switch (type) {\n case 'node':\n before.nodes.push(unupdatedModel);\n after.nodes.push(afterModel);\n break;\n case 'edge':\n before.edges.push(unupdatedModel);\n after.edges.push(afterModel);\n break;\n case 'combo':\n before.combos.push(unupdatedModel);\n after.combos.push(afterModel);\n break;\n default:\n break;\n }\n this.pushStack('update', {\n before: before,\n after: after\n });\n }\n };\n /**\n * 更新元素\n * @param {Item} item 元素id或元素实例\n * @param {Partial | EdgeConfig} cfg 需要更新的数据\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n AbstractGraph.prototype.update = function (item, cfg, stack) {\n if (stack === void 0) {\n stack = true;\n }\n this.updateItem(item, cfg, stack);\n };\n /**\n * 设置元素状态\n * @param {Item} item 元素id或元素实例\n * @param {string} state 状态名称\n * @param {string | boolean} value 是否启用状态 或 状态值\n */\n AbstractGraph.prototype.setItemState = function (item, state, value) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n item = this.findById(item);\n }\n var itemController = this.get('itemController');\n itemController.setItemState(item, state, value);\n var stateController = this.get('stateController');\n stateController.updateState(item, state, value);\n };\n /**\n * 将指定状态的优先级提升为最高优先级\n * @param {Item} item 元素id或元素实例\n * @param state 状态名称\n */\n AbstractGraph.prototype.priorityState = function (item, state) {\n var itemController = this.get('itemController');\n itemController.priorityState(item, state);\n };\n /**\n * 设置视图初始化数据\n * @param {GraphData} data 初始化数据\n */\n AbstractGraph.prototype.data = function (data) {\n Object(_util_validation__WEBPACK_IMPORTED_MODULE_6__[\"dataValidation\"])(data);\n this.set('data', data);\n };\n /**\n * 根据data接口的数据渲染视图\n */\n AbstractGraph.prototype.render = function () {\n var self = this;\n this.set('comboSorted', false);\n var data = this.get('data');\n if (this.get('enabledStack')) {\n // render 之前清空 redo 和 undo 栈\n this.clearStack();\n }\n if (!data) {\n throw new Error('data must be defined first');\n }\n var _a = data.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = data.edges,\n edges = _b === void 0 ? [] : _b,\n _c = data.combos,\n combos = _c === void 0 ? [] : _c;\n this.clear(true);\n this.emit('beforerender');\n self.addItems(nodes.map(function (node) {\n return {\n type: 'node',\n model: node\n };\n }), false, false);\n // process the data to tree structure\n if ((combos === null || combos === void 0 ? void 0 : combos.length) !== 0) {\n var comboTrees = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"plainCombosToTrees\"])(combos, nodes);\n this.set('comboTrees', comboTrees);\n // add combos\n self.addCombos(combos);\n }\n self.addItems(edges.map(function (edge) {\n return {\n type: 'edge',\n model: edge\n };\n }), false, false);\n var animate = self.get('animate');\n if (self.get('fitView') || self.get('fitCenter')) {\n self.set('animate', false);\n }\n // layout\n var layoutController = self.get('layoutController');\n if (layoutController) {\n layoutController.layout(success);\n if (this.destroyed) return;\n } else {\n success();\n }\n // 将在 onLayoutEnd 中被调用\n function success() {\n // 自底向上将 collapsed 的 combo 合起\n (self.get('comboTrees') || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n var item = self.findById(child.id);\n if (item.getType() === 'combo' && child.collapsed) {\n self.collapseCombo(child.id, false);\n self.updateCombo(item);\n }\n return true;\n });\n });\n // fitView 与 fitCenter 共存时,fitView 优先,fitCenter 不再执行\n if (self.get('fitView')) {\n self.fitView();\n } else if (self.get('fitCenter')) {\n self.fitCenter();\n }\n self.autoPaint();\n self.emit('afterrender');\n if (self.get('fitView') || self.get('fitCenter')) {\n self.set('animate', animate);\n }\n setTimeout(function () {\n var _a;\n (_a = self.getCombos()) === null || _a === void 0 ? void 0 : _a.forEach(function (combo) {\n combo.set('animate', true);\n });\n }, 0);\n }\n if (!this.get('groupByTypes')) {\n if (combos && combos.length !== 0) {\n this.sortCombos();\n } else {\n // 为提升性能,选择数量少的进行操作\n if (data.nodes && data.edges && data.nodes.length < data.edges.length) {\n var nodesArr = this.getNodes();\n // 遍历节点实例,将所有节点提前。\n nodesArr.forEach(function (node) {\n node.toFront();\n });\n } else {\n var edgesArr = this.getEdges();\n // 遍历节点实例,将所有节点提前。\n edgesArr.forEach(function (edge) {\n edge.toBack();\n });\n }\n }\n }\n };\n /**\n * 接收数据进行渲染\n * @Param {Object} data 初始化数据\n */\n AbstractGraph.prototype.read = function (data) {\n this.data(data);\n this.render();\n };\n // 比较item\n AbstractGraph.prototype.diffItems = function (type, items, models) {\n var self = this;\n var item;\n var itemMap = this.get('itemMap');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(models, function (model) {\n item = itemMap[model.id];\n if (item) {\n if (self.get('animate') && type === NODE) {\n var containerMatrix = item.getContainer().getMatrix();\n if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n item.set('originAttrs', {\n x: containerMatrix[6],\n y: containerMatrix[7]\n });\n }\n self.updateItem(item, model, false);\n } else {\n item = self.addItem(type, model, false);\n }\n if (item) items[\"\".concat(type, \"s\")].push(item);\n });\n };\n /**\n * 更改源数据,根据新数据重新渲染视图\n * @param {GraphData | TreeGraphData} data 源数据\n * @param {boolean} 是否入栈,默认为true\n * @return {object} this\n */\n AbstractGraph.prototype.changeData = function (propsData, stack) {\n var _this = this;\n var _a;\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n var data = propsData || self.get('data');\n if (!Object(_util_validation__WEBPACK_IMPORTED_MODULE_6__[\"dataValidation\"])(data)) {\n return this;\n }\n this.emit('beforechangedata');\n if (stack && this.get('enabledStack')) {\n this.pushStack('changedata', {\n before: self.save(),\n after: data\n });\n }\n this.set('comboSorted', false);\n // 删除 hulls\n this.removeHulls();\n // 更改数据源后,取消所有状态\n this.getNodes().map(function (node) {\n return self.clearItemStates(node);\n });\n this.getEdges().map(function (edge) {\n return self.clearItemStates(edge);\n });\n var canvas = this.get('canvas');\n var localRefresh = canvas.get('localRefresh');\n canvas.set('localRefresh', false);\n if (!self.get('data')) {\n self.data(data);\n self.render();\n }\n var itemMap = this.get('itemMap');\n var items = {\n nodes: [],\n edges: []\n };\n var combosData = data.combos;\n if (combosData) {\n var comboTrees = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"plainCombosToTrees\"])(combosData, data.nodes);\n this.set('comboTrees', comboTrees);\n } else {\n this.set('comboTrees', []);\n }\n this.diffItems('node', items, data.nodes);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(itemMap, function (item, id) {\n itemMap[id].getModel().depth = 0;\n if (item.getType && item.getType() === 'edge') return;\n if (item.getType && item.getType() === 'combo') {\n delete itemMap[id];\n item.destroy();\n } else if (items.nodes.indexOf(item) < 0) {\n delete itemMap[id];\n self.remove(item, false);\n }\n });\n // clear the destroyed combos here to avoid removing sub nodes before removing the parent combo\n var comboItems = this.getCombos();\n var combosLength = comboItems.length;\n for (var i = combosLength - 1; i >= 0; i--) {\n if (comboItems[i].destroyed) {\n comboItems.splice(i, 1);\n }\n }\n // process the data to tree structure\n if (combosData) {\n // add combos\n self.addCombos(combosData);\n if (!this.get('groupByTypes')) {\n this.sortCombos();\n }\n }\n this.diffItems('edge', items, data.edges);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(itemMap, function (item, id) {\n if (item.getType && (item.getType() === 'node' || item.getType() === 'combo')) return;\n if (items.edges.indexOf(item) < 0) {\n delete itemMap[id];\n self.remove(item, false);\n }\n });\n // 自底向上将 collapsed 的 combo 合起\n (this.get('comboTrees') || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n var item = _this.findById(child.id);\n if (item.getType() === 'combo' && child.collapsed) {\n _this.collapseCombo(child.id, false);\n }\n return true;\n });\n });\n this.set({\n nodes: items.nodes,\n edges: items.edges\n });\n var _b = (this.get('layout') || {}).relayoutAtChangeData,\n relayoutAtChangeData = _b === void 0 ? true : _b;\n var layoutController = this.get('layoutController');\n if (relayoutAtChangeData && layoutController) {\n layoutController.changeData(function () {\n setTimeout(function () {\n var _a;\n (_a = self.getCombos()) === null || _a === void 0 ? void 0 : _a.forEach(function (combo) {\n combo.set('animate', true);\n });\n }, 0);\n });\n if (self.get('animate') && !layoutController.getLayoutType()) {\n // 如果没有指定布局\n self.positionsAnimate();\n (_a = self.getCombos()) === null || _a === void 0 ? void 0 : _a.forEach(function (combo) {\n return combo.set('animate', true);\n });\n } else {\n self.autoPaint();\n }\n }\n setTimeout(function () {\n canvas.set('localRefresh', localRefresh);\n }, 16);\n this.set('data', data);\n this.emit('afterchangedata');\n return this;\n };\n /**\n * 私有方法,在 render 和 changeData 的时候批量添加数据中所有平铺的 combos\n * @param {ComboConfig[]} combos 平铺的 combos 数据\n */\n AbstractGraph.prototype.addCombos = function (combos) {\n var self = this;\n var comboTrees = self.get('comboTrees');\n var itemController = this.get('itemController');\n itemController.addCombos(comboTrees, combos);\n };\n /**\n * 根据已经存在的节点或 combo 创建新的 combo\n * @param combo combo ID 或 Combo 配置\n * @param childrenIds 添加到 Combo 中的元素,包括节点和 combo\n */\n AbstractGraph.prototype.createCombo = function (combo, childrenIds, stack) {\n var _this = this;\n if (stack === void 0) {\n stack = true;\n }\n var itemController = this.get('itemController');\n this.set('comboSorted', false);\n // step 1: 创建新的 Combo\n var comboId = '';\n var comboConfig;\n if (!combo) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n comboId = combo;\n comboConfig = {\n id: combo\n };\n } else {\n comboId = combo.id;\n if (!comboId) {\n console.warn('Create combo failed. Please assign a unique string id for the adding combo.');\n return;\n }\n comboConfig = combo;\n }\n var shouldStack = stack && this.get('enabledStack');\n // cache the children's old parent for stack\n var childrenParentCache = {\n nodes: [],\n combos: []\n };\n if (shouldStack) {\n childrenIds.forEach(function (childId) {\n var childItem = _this.findById(childId);\n var childType = childItem.getType();\n if (childType !== 'node' && childType !== 'combo') return;\n var childModel = childItem.getModel();\n childrenParentCache[\"\".concat(childType, \"s\")].push({\n id: childId,\n parentId: childType === 'node' ? childModel.comboId : childModel.parentId\n });\n });\n }\n // step 2: Pull children out of their parents\n var comboTrees = this.get('comboTrees');\n var childrenIdsSet = new Set(childrenIds);\n var pulledComboTreesById = new Map();\n if (comboTrees) {\n comboTrees.forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (treeNode, parentTreeNode, index) {\n if (childrenIdsSet.has(treeNode.id)) {\n if (parentTreeNode) {\n var parentItem = _this.findById(parentTreeNode.id);\n var item = _this.findById(treeNode.id);\n // Removing current item from the tree during the traversal is ok because children traversal is done\n // in an *inverse order* - indices of the next-traversed items are not disturbed by the removal.\n parentTreeNode.children.splice(index, 1);\n parentItem.removeChild(item);\n // We have to update the parent node geometry since nodes were removed from them, _while they are still visible_\n // (combos may be moved inside the new combo and become hidden)\n itemController.updateCombo(parentItem, parentTreeNode.children);\n }\n if (treeNode.itemType === 'combo') {\n pulledComboTreesById.set(treeNode.id, treeNode);\n }\n }\n return true;\n });\n });\n comboTrees = comboTrees.filter(function (ctree) {\n return !childrenIdsSet.has(ctree.id);\n });\n this.set('comboTrees', comboTrees);\n }\n // step 3: 更新 children,根据类型添加 comboId 或 parentId\n var newChildrenParent = {\n nodes: [],\n combos: []\n };\n var trees = childrenIds.map(function (elementId) {\n var item = _this.findById(elementId);\n var model = item.getModel();\n var type = '';\n if (item.getType) type = item.getType();\n // Combos will be just moved around, so their children can be preserved\n var cItem = pulledComboTreesById.get(elementId) || {\n id: item.getID(),\n itemType: type\n };\n if (type === 'combo') {\n cItem.parentId = comboId;\n model.parentId = comboId;\n } else if (type === 'node') {\n cItem.comboId = comboId;\n model.comboId = comboId;\n }\n if (shouldStack) {\n newChildrenParent[\"\".concat(type, \"s\")].push({\n id: model.id,\n parentId: comboId\n });\n }\n return cItem;\n });\n comboConfig.children = trees;\n // step 4: 添加 Combo,addItem 时会将子将元素添加到 Combo 中\n this.addItem('combo', comboConfig, false);\n this.set('comboSorted', false);\n // step 5: 更新 comboTrees 结构\n if (comboTrees) {\n comboTrees.forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(ctree, function (treeNode) {\n // Set the children to the newly created combo\n if (treeNode.id === comboId) {\n treeNode.itemType = 'combo';\n treeNode.children = trees;\n return false;\n }\n return true;\n });\n });\n this.sortCombos();\n }\n if (shouldStack) {\n newChildrenParent.combos.push(comboConfig);\n this.pushStack('createCombo', {\n before: childrenParentCache,\n after: newChildrenParent\n });\n }\n // Fixes issue of nested child combos not being interactive (under parent on graph).\n var comboItem = this.findById(comboId);\n if (!comboItem.getModel().parentId && comboItem.getChildren().combos.length) {\n this.updateComboTree(comboItem, undefined, false);\n }\n setTimeout(function () {\n comboItem.set('animate', true);\n }, 0);\n };\n /**\n * 解散 combo\n * @param {String | INode | ICombo} combo 需要被解散的 Combo item 或 id\n */\n AbstractGraph.prototype.uncombo = function (combo, stack) {\n var _this = this;\n var _a, _b;\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n var comboItem = combo;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n comboItem = this.findById(combo);\n }\n if (!comboItem || comboItem.getType && comboItem.getType() !== 'combo') {\n console.warn('The item is not a combo!');\n return;\n }\n var comboModel = comboItem.getModel();\n var parentId = comboItem.getModel().parentId;\n var comboTrees = self.get('comboTrees');\n if (!comboTrees) comboTrees = [];\n var itemMap = this.get('itemMap');\n var comboId = comboItem.get('id');\n var treeToBeUncombo;\n var brothers = [];\n var comboItems = this.get('combos');\n var parentItem = this.findById(parentId);\n var shouldStack = stack && this.get('enabledStack');\n var comboConfig = {};\n if (shouldStack) {\n comboConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(comboModel);\n comboConfig.children = [];\n }\n comboTrees.forEach(function (ctree) {\n if (treeToBeUncombo) return; // terminate the forEach\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (subtree) {\n var _a;\n // find the combo to be uncomboed, delete the combo from map and cache\n if (subtree.id === comboId) {\n treeToBeUncombo = subtree;\n // delete the related edges\n var edgeIds = comboItem.getEdges().map(function (edge) {\n return edge.getID();\n });\n edgeIds.forEach(function (edgeId) {\n _this.removeItem(edgeId, false);\n });\n var index = comboItems.indexOf(comboItem);\n comboItems.splice(index, 1);\n delete itemMap[comboId];\n var itemModel = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(comboItem.getModel());\n comboItem.destroy();\n _this.emit('afterremoveitem', {\n item: itemModel,\n type: 'combo'\n });\n }\n // 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\n if (parentId && treeToBeUncombo && subtree.id === parentId) {\n parentItem.removeCombo(comboItem);\n brothers = subtree.children; // the combo's brothers\n // remove the combo from its brothers array\n var index = brothers.indexOf(treeToBeUncombo);\n if (index !== -1) {\n brothers.splice(index, 1);\n }\n // append the combo's children to the combo's brothers array\n (_a = treeToBeUncombo.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n var item = _this.findById(child.id);\n var childModel = item.getModel();\n if (item.getType && item.getType() === 'combo') {\n child.parentId = parentId;\n delete child.comboId;\n childModel.parentId = parentId; // update the parentId of the model\n delete childModel.comboId;\n } else if (item.getType && item.getType() === 'node') {\n child.comboId = parentId;\n childModel.comboId = parentId; // update the parentId of the model\n }\n\n parentItem.addChild(item);\n brothers.push(child);\n });\n _this.updateCombo(parentItem);\n return false;\n }\n return true;\n });\n });\n // if the parentId is not found, remove the combo from the roots\n if (!parentId && treeToBeUncombo) {\n var index = comboTrees.indexOf(treeToBeUncombo);\n comboTrees.splice(index, 1);\n // modify the parentId of the children\n (_a = treeToBeUncombo.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n child.parentId = undefined;\n var childModel = _this.findById(child.id).getModel();\n delete childModel.parentId; // update the parentId of the model\n delete childModel.comboId; // update the comboId of the model\n if (child.itemType !== 'node') comboTrees.push(child);\n });\n }\n if (shouldStack) {\n // cache the children's old parent and combo model for stack\n var childrenParentCache_1 = {\n nodes: [],\n combos: []\n };\n var childNewParent_1 = {\n nodes: [],\n combos: []\n };\n (_b = treeToBeUncombo.children) === null || _b === void 0 ? void 0 : _b.forEach(function (child) {\n var childItem = _this.findById(child.id);\n var childType = childItem.getType();\n if (childType !== 'node' && childType !== 'combo') return;\n childrenParentCache_1[\"\".concat(childType, \"s\")].push({\n id: child.id,\n parentId: comboId\n });\n childNewParent_1[\"\".concat(childType, \"s\")].push({\n id: child.id,\n parentId: parentId\n });\n });\n childrenParentCache_1.combos.push(comboConfig);\n this.pushStack('uncombo', {\n before: childrenParentCache_1,\n after: childNewParent_1\n });\n }\n };\n /**\n * 根据 combo 位置更新内部节点位置 followCombo = true\n * 或根据内部元素的 bbox 更新所有 combos 的绘制,包括 combos 的位置和范围,followCombo = false\n */\n AbstractGraph.prototype.updateCombos = function (followCombo) {\n var _this = this;\n if (followCombo === void 0) {\n followCombo = false;\n }\n var self = this;\n var comboTrees = this.get('comboTrees');\n var itemController = self.get('itemController');\n var itemMap = self.get('itemMap');\n (comboTrees || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n var _a;\n if (!child) {\n return true;\n }\n var childItem = itemMap[child.id];\n if (((_a = childItem === null || childItem === void 0 ? void 0 : childItem.getType) === null || _a === void 0 ? void 0 : _a.call(childItem)) === 'combo') {\n // 更新具体的 Combo 之前先清除所有的已有状态,以免将 state 中的样式更新为 Combo 的样式\n var states = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], childItem.getStates(), true);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n return _this.setItemState(childItem, state, false);\n });\n // 更新具体的 Combo\n itemController.updateCombo(childItem, child.children, followCombo);\n // 更新 Combo 后,还原已有的状态\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n return _this.setItemState(childItem, state, true);\n });\n }\n return true;\n });\n });\n self.sortCombos();\n };\n /**\n * 根据节点的 bbox 更新 combo 及其祖先 combos 的绘制,包括 combos 的位置和范围\n * @param {String | ICombo} combo 需要被更新的 Combo 或 id,若指定,则该 Combo 及所有祖先 Combod 都会被更新\n */\n AbstractGraph.prototype.updateCombo = function (combo) {\n var _this = this;\n var self = this;\n var comboItem = combo;\n var comboId;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n comboItem = this.findById(combo);\n }\n if (!comboItem || comboItem.getType && comboItem.getType() !== 'combo') {\n console.warn('The item to be updated is not a combo!');\n return;\n }\n comboId = comboItem.get('id');\n var comboTrees = this.get('comboTrees');\n var itemController = self.get('itemController');\n var itemMap = self.get('itemMap');\n (comboTrees || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n if (!child) {\n return true;\n }\n var childItem = itemMap[child.id];\n if (comboId === child.id && childItem && childItem.getType && childItem.getType() === 'combo') {\n // 更新具体的 Combo 之前先清除所有的已有状态,以免将 state 中的样式更新为 Combo 的样式\n var states = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], childItem.getStates(), true);\n // || !item.getStateStyle(stateName)\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n if (childItem.getStateStyle(state)) {\n _this.setItemState(childItem, state, false);\n }\n });\n // 更新具体的 Combo\n itemController.updateCombo(childItem, child.children);\n // 更新 Combo 后,还原已有的状态\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n if (childItem.getStateStyle(state)) {\n _this.setItemState(childItem, state, true);\n }\n });\n if (comboId) comboId = child.parentId;\n }\n return true;\n });\n });\n };\n /**\n * 更新树结构,例如移动子树等\n * @param {String | INode | ICombo} item 需要被更新的 Combo 或 节点 id\n * @param {string | undefined} parentId 新的父 combo id,undefined 代表没有父 combo\n */\n AbstractGraph.prototype.updateComboTree = function (item, parentId, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n this.set('comboSorted', false);\n var uItem;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n uItem = self.findById(item);\n } else {\n uItem = item;\n }\n var model = uItem.getModel();\n var oldParentId = model.comboId || model.parentId;\n var type = '';\n if (uItem.getType) type = uItem.getType();\n // 若 item 是 Combo,且 parentId 是其子孙 combo 的 id,则警告并终止\n if (parentId && type === 'combo') {\n var comboTrees = this.get('comboTrees');\n var valid_1 = true;\n var itemSubTree_1;\n (comboTrees || []).forEach(function (ctree) {\n if (itemSubTree_1) return;\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(ctree, function (subTree) {\n if (itemSubTree_1) return;\n // 找到从 item 开始的子树\n if (subTree.id === uItem.getID()) {\n itemSubTree_1 = subTree;\n }\n return true;\n });\n });\n // 在以 item 为根的子树中寻找与 parentId 相同的后继元素\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(itemSubTree_1, function (subTree) {\n if (subTree.id === parentId) {\n valid_1 = false;\n return false;\n }\n return true;\n });\n // parentId 是 item 的一个后继元素,不能进行更新\n if (!valid_1) {\n console.warn('Failed to update the combo tree! The parentId points to a descendant of the combo!');\n return;\n }\n }\n if (stack && this.get('enabledStack')) {\n var beforeData = {},\n afterData = {};\n if (type === 'combo') {\n beforeData.combos = [{\n id: model.id,\n parentId: model.parentId\n }];\n afterData.combos = [{\n id: model.id,\n parentId: parentId\n }];\n } else if (type === 'node') {\n beforeData.nodes = [{\n id: model.id,\n parentId: model.comboId\n }];\n afterData.nodes = [{\n id: model.id,\n parentId: parentId\n }];\n }\n this.pushStack('updateComboTree', {\n before: beforeData,\n after: afterData\n });\n }\n // 当 combo 存在 parentId 或 comboId 时,才将其移除\n if (model.parentId || model.comboId) {\n var combo = this.findById(model.parentId || model.comboId);\n if (combo) {\n combo.removeChild(uItem);\n }\n }\n if (type === 'combo') {\n model.parentId = parentId;\n } else if (type === 'node') {\n model.comboId = parentId;\n }\n // 只有当移入到指定 combo 时才添加\n if (parentId) {\n var parentCombo = this.findById(parentId);\n if (parentCombo) {\n // 将元素添加到 parentCombo 中\n parentCombo.addChild(uItem);\n }\n }\n // 如果原先有父亲 combo,则从原父 combo 的子元素数组中删除\n if (oldParentId) {\n var parentCombo = this.findById(oldParentId);\n if (parentCombo) {\n // 将元素从 parentCombo 中移除\n parentCombo.removeChild(uItem);\n }\n }\n var newComboTrees = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"reconstructTree\"])(this.get('comboTrees'), model.id, parentId);\n this.set('comboTrees', newComboTrees);\n this.updateCombos();\n };\n /**\n * 导出图数据\n * @return {object} data\n */\n AbstractGraph.prototype.save = function () {\n var nodes = [];\n var edges = [];\n var combos = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(this.get('nodes'), function (node) {\n nodes.push(node.getModel());\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(this.get('edges'), function (edge) {\n edges.push(edge.getModel());\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(this.get('combos'), function (combo) {\n combos.push(combo.getModel());\n });\n return {\n nodes: nodes,\n edges: edges,\n combos: combos\n };\n };\n /**\n * 改变画布大小\n * @param {number} width 画布宽度\n * @param {number} height 画布高度\n * @return {object} this\n */\n AbstractGraph.prototype.changeSize = function (width, height) {\n var viewController = this.get('viewController');\n viewController.changeSize(width, height);\n return this;\n };\n /**\n * 当源数据在外部发生变更时,根据新数据刷新视图。但是不刷新节点位置\n */\n AbstractGraph.prototype.refresh = function () {\n var self = this;\n self.emit('beforegraphrefresh');\n if (self.get('animate')) {\n self.positionsAnimate();\n } else {\n var nodes = self.get('nodes');\n var edges = self.get('edges');\n var vedges = self.get('edges');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(nodes, function (node) {\n node.refresh();\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(edges, function (edge) {\n edge.refresh();\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(vedges, function (vedge) {\n vedge.refresh();\n });\n }\n self.emit('aftergraphrefresh');\n self.autoPaint();\n };\n /**\n * 获取当前图中所有节点的item实例\n * @return {INode} item数组\n */\n AbstractGraph.prototype.getNodes = function () {\n return this.get('nodes');\n };\n /**\n * 获取当前图中所有边的item实例\n * @return {IEdge} item数组\n */\n AbstractGraph.prototype.getEdges = function () {\n return this.get('edges');\n };\n /**\n * 获取图中所有的 combo 实例\n */\n AbstractGraph.prototype.getCombos = function () {\n return this.get('combos');\n };\n /**\n * 获取指定 Combo 中所有的节点\n * @param comboId combo ID\n */\n AbstractGraph.prototype.getComboChildren = function (combo) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n combo = this.findById(combo);\n }\n if (!combo || combo.getType && combo.getType() !== 'combo') {\n console.warn('The combo does not exist!');\n return;\n }\n return combo.getChildren();\n };\n /**\n * 根据 graph 上的 animateCfg 进行视图中节点位置动画接口\n */\n AbstractGraph.prototype.positionsAnimate = function (referComboModel) {\n var self = this;\n self.emit('beforeanimate');\n var animateCfg = self.get('animateCfg');\n var onFrame = animateCfg.onFrame;\n var nodes = referComboModel ? self.getNodes().concat(self.getCombos()) : self.getNodes();\n var toNodes = nodes.map(function (node) {\n var model = node.getModel();\n return {\n id: model.id,\n x: model.x,\n y: model.y\n };\n });\n self.stopAnimate();\n var canvas = self.get('canvas');\n self.animating = true;\n setTimeout(function () {\n canvas.animate(function (ratio) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(toNodes, function (data) {\n var node = self.findById(data.id);\n if (!node || node.destroyed) {\n return;\n }\n var originAttrs = node.get('originAttrs');\n var model = node.get('model');\n var containerMatrix = node.getContainer().getMatrix();\n if (originAttrs === undefined || originAttrs === null) {\n // 变换前存在位置,设置到 originAttrs 上。否则标记 0 表示变换前不存在位置,不需要计算动画\n if (containerMatrix) {\n originAttrs = {\n x: containerMatrix[6],\n y: containerMatrix[7]\n };\n }\n node.set('originAttrs', originAttrs || 0);\n }\n if (onFrame) {\n var attrs = onFrame(node, ratio, data, originAttrs || {\n x: 0,\n y: 0\n });\n node.set('model', Object.assign(model, attrs));\n } else if (originAttrs) {\n // 变换前存在位置,进行动画\n model.x = originAttrs.x + (data.x - originAttrs.x) * ratio;\n model.y = originAttrs.y + (data.y - originAttrs.y) * ratio;\n } else {\n // 若在变换前不存在位置信息,则直接放到最终位置上\n model.x = data.x;\n model.y = data.y;\n }\n });\n self.refreshPositions(referComboModel);\n }, {\n duration: animateCfg.duration,\n easing: animateCfg.easing,\n callback: function callback() {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(nodes, function (node) {\n node.set('originAttrs', null);\n });\n if (animateCfg.callback) {\n animateCfg.callback();\n }\n self.emit('afteranimate');\n self.animating = false;\n }\n });\n }, 0);\n };\n /**\n * 当节点位置在外部发生改变时,刷新所有节点位置,重计算边\n */\n AbstractGraph.prototype.refreshPositions = function (referComboModel) {\n var self = this;\n self.emit('beforegraphrefreshposition');\n var nodes = self.get('nodes');\n var edges = self.get('edges');\n var vedges = self.get('vedges');\n var combos = self.get('combos');\n var model;\n var updatedNodes = {};\n var updateItems = function updateItems(items) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(items, function (item) {\n model = item.getModel();\n var originAttrs = item.get('originAttrs');\n if (originAttrs && model.x === originAttrs.x && model.y === originAttrs.y) {\n return;\n }\n var changed = item.updatePosition({\n x: model.x,\n y: model.y\n });\n updatedNodes[model.id] = changed;\n if (model.comboId) updatedNodes[model.comboId] = updatedNodes[model.comboId] || changed;\n if (model.parentId) updatedNodes[model.parentId] = updatedNodes[model.parentId] || changed;\n });\n };\n updateItems(combos);\n updateItems(nodes);\n if (combos && combos.length !== 0) {\n if (referComboModel) {\n updateItems(combos);\n self.updateCombos();\n } else {\n self.updateCombos();\n }\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(edges, function (edge) {\n var sourceModel = edge.getSource().getModel();\n var target = edge.getTarget();\n // 避免 target 是纯对象的情况下调用 getModel 方法\n // 拖动生成边的时候 target 会是纯对象\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(target)) {\n var targetModel = target.getModel();\n if (updatedNodes[sourceModel.id] || updatedNodes[targetModel.id] || edge.getModel().isComboEdge) {\n edge.refresh();\n }\n }\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(vedges, function (vedge) {\n vedge.refresh();\n });\n self.emit('aftergraphrefreshposition');\n self.autoPaint();\n };\n AbstractGraph.prototype.stopAnimate = function () {\n var canvas = this.get('canvas');\n var timeline = canvas.cfg.timeline;\n if (timeline) {\n timeline.stopAllAnimations();\n }\n };\n AbstractGraph.prototype.isAnimating = function () {\n return this.animating;\n };\n /**\n * 获取当前视口伸缩比例\n * @return {number} 比例\n */\n AbstractGraph.prototype.getZoom = function () {\n var matrix = this.get('group').getMatrix();\n return matrix ? matrix[0] : 1;\n };\n /**\n * 获取当前的行为模式\n * @return {string} 当前行为模式\n */\n AbstractGraph.prototype.getCurrentMode = function () {\n var modeController = this.get('modeController');\n return modeController.getMode();\n };\n /**\n * 切换行为模式\n * @param {string} mode 指定模式\n * @return {object} this\n */\n AbstractGraph.prototype.setMode = function (mode) {\n var modeController = this.get('modeController');\n modeController.setMode(mode);\n return this;\n };\n /**\n * 清除画布元素\n * @return {object} this\n */\n AbstractGraph.prototype.clear = function (avoidEmit) {\n var _a;\n if (avoidEmit === void 0) {\n avoidEmit = false;\n }\n (_a = this.get('canvas')) === null || _a === void 0 ? void 0 : _a.clear();\n this.initGroups();\n // 清空画布时同时清除数据\n this.set({\n itemMap: {},\n nodes: [],\n edges: [],\n vedges: [],\n groups: [],\n combos: [],\n comboTrees: []\n });\n if (!avoidEmit) this.emit('afterrender');\n return this;\n };\n /**\n * 更换布局配置项\n * @param {object} cfg 新布局配置项\n * @param {'center' | 'begin'} align 对齐方式,可选中心(center)对齐到对齐点,或左上角(begin)对齐到对齐点\n * @param {IPoint} alignPoint 画布上的对齐点,为 Canvas 坐标系(Canvas DOM)\n * 若 cfg 含有 type 字段或为 String 类型,且与现有布局方法不同,则更换布局\n * 若 cfg 不包括 type ,则保持原有布局方法,仅更新布局配置项\n */\n AbstractGraph.prototype.updateLayout = function (cfg, align, alignPoint, stack) {\n var _this = this;\n if (cfg === void 0) {\n cfg = {};\n }\n if (stack === void 0) {\n stack = true;\n }\n var layoutController = this.get('layoutController');\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(cfg)) {\n cfg = {\n type: cfg\n };\n }\n // align the graph after layout\n if (align) {\n var toPoint_1 = alignPoint;\n if (!toPoint_1) {\n if (align === 'begin') toPoint_1 = {\n x: 0,\n y: 0\n };else toPoint_1 = {\n x: this.getWidth() / 2,\n y: this.getHeight() / 2\n };\n }\n // translate to point coordinate system\n toPoint_1 = this.getPointByCanvas(toPoint_1.x, toPoint_1.y);\n var forceTypes = ['force', 'gForce', 'fruchterman', 'force2'];\n // if it is force layout, only center takes effect, and assign center force\n if (forceTypes.includes(cfg.type) || !cfg.type && forceTypes.includes(layoutController === null || layoutController === void 0 ? void 0 : layoutController.layoutType)) {\n cfg.center = [toPoint_1.x, toPoint_1.y];\n } else {\n this.once('afterlayout', function (e) {\n var matrix = _this.getGroup().getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n toPoint_1.x = toPoint_1.x * matrix[0] + matrix[6];\n toPoint_1.y = toPoint_1.y * matrix[0] + matrix[7];\n var _a = _this.getGroup().getCanvasBBox(),\n minX = _a.minX,\n maxX = _a.maxX,\n minY = _a.minY,\n maxY = _a.maxY;\n var bboxPoint = {\n x: (minX + maxX) / 2,\n y: (minY + maxY) / 2\n };\n if (align === 'begin') {\n bboxPoint.x = minX;\n bboxPoint.y = minY;\n }\n _this.translate(toPoint_1.x - bboxPoint.x, toPoint_1.y - bboxPoint.y);\n });\n }\n }\n var oriLayoutCfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, this.get('layout'));\n var layoutCfg = {};\n Object.assign(layoutCfg, oriLayoutCfg, cfg);\n if (cfg.pipes && !cfg.type) delete layoutCfg.type;else if (!cfg.pipes && layoutCfg.type) delete layoutCfg.pipes;\n this.set('layout', layoutCfg);\n if (!layoutController) return;\n if (layoutController.isLayoutTypeSame(layoutCfg) && layoutCfg.gpuEnabled === oriLayoutCfg.gpuEnabled) {\n // no type or same type, or switch the gpu and cpu, update layout\n layoutController.updateLayoutCfg(layoutCfg);\n } else {\n // has different type, change layout\n layoutController.changeLayout(layoutCfg);\n }\n if (stack && this.get('enabledStack')) {\n this.pushStack('layout', {\n before: oriLayoutCfg,\n after: layoutCfg\n });\n }\n };\n /**\n * 销毁布局,changeData 时不会再使用原来的布局方法对新数据进行布局\n */\n AbstractGraph.prototype.destroyLayout = function () {\n var layoutController = this.get('layoutController');\n layoutController === null || layoutController === void 0 ? void 0 : layoutController.destroyLayout();\n };\n /**\n * 重新以当前示例中配置的属性进行一次布局\n */\n AbstractGraph.prototype.layout = function () {\n var _a;\n var layoutController = this.get('layoutController');\n var layoutCfg = this.get('layout');\n if (!layoutCfg || !layoutController) return;\n if (layoutCfg.workerEnabled) {\n // 如果使用web worker布局\n layoutController.layout();\n return;\n }\n if ((_a = layoutController.layoutMethods) === null || _a === void 0 ? void 0 : _a.length) {\n layoutController.relayout(true);\n } else {\n layoutController.layout();\n }\n };\n /**\n * 收起指定的 combo\n * @param {string | ICombo} combo combo ID 或 combo item\n */\n AbstractGraph.prototype.collapseCombo = function (combo, stack) {\n var _this = this;\n if (stack === void 0) {\n stack = true;\n }\n if (this.destroyed) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n combo = this.findById(combo);\n }\n if (!combo) {\n console.warn('The combo to be collapsed does not exist!');\n return;\n }\n this.emit('beforecollapseexpandcombo', {\n action: 'collapse',\n item: combo\n });\n var comboModel = combo.getModel();\n var itemController = this.get('itemController');\n itemController.collapseCombo(combo, stack);\n comboModel.collapsed = true;\n // add virtual edges\n var edges = this.getEdges().concat(this.get('vedges'));\n // find all the descendant nodes and combos\n var cNodesCombos = [];\n var comboTrees = this.get('comboTrees');\n var found = false;\n (comboTrees || []).forEach(function (ctree) {\n if (found) return; // if the combo is found, terminate the forEach\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(ctree, function (subTree) {\n // if the combo is found and it is traversing the other branches, terminate\n if (found && subTree.depth <= comboModel.depth) return false;\n // if the combo is found\n if (comboModel.id === subTree.id) found = true;\n if (found) {\n // if the combo is found, concat the descendant nodes and combos\n var item = _this.findById(subTree.id);\n if (item && item.getType && item.getType() === 'combo') {\n cNodesCombos = cNodesCombos.concat(item.getNodes());\n cNodesCombos = cNodesCombos.concat(item.getCombos());\n }\n }\n return true;\n });\n });\n var addedVEdgeMap = {};\n edges.forEach(function (edge) {\n var _a = edge.getModel(),\n isVEdge = _a.isVEdge,\n _b = _a.size,\n size = _b === void 0 ? 1 : _b;\n if (edge.isVisible() && !isVEdge) return;\n var source = edge.getSource();\n var target = edge.getTarget();\n var otherEnd = null;\n var otherEndIsSource;\n if (source.getModel().id === comboModel.id || cNodesCombos.includes(source) && !cNodesCombos.includes(target)) {\n // source is the current combo, or descent node/combo is the source but not the target)\n otherEnd = target;\n otherEndIsSource = false;\n } else if (target.getModel().id === comboModel.id || !cNodesCombos.includes(source) && cNodesCombos.includes(target)) {\n // target is the current combo, or descent node/combo is the target but not the source)\n otherEnd = source;\n otherEndIsSource = true;\n }\n if (otherEnd) {\n if (isVEdge) {\n _this.removeItem(edge, false);\n return;\n }\n var otherEndModel = otherEnd.getModel();\n while (!otherEnd.isVisible()) {\n var otherEndPId = otherEndModel.parentId,\n otherEndCId = otherEndModel.comboId;\n var otherEndParentId = otherEndPId || otherEndCId;\n otherEnd = _this.findById(otherEndParentId);\n if (!otherEnd || !otherEndParentId) return; // all the ancestors are hidden, then ignore the edge\n otherEndModel = otherEnd.getModel();\n }\n var otherEndId = otherEndModel.id;\n var vEdgeInfo = otherEndIsSource ? {\n source: otherEndId,\n target: comboModel.id,\n size: size,\n isVEdge: true\n } : {\n source: comboModel.id,\n target: otherEndId,\n size: size,\n isVEdge: true\n };\n var key = \"\".concat(vEdgeInfo.source, \"-\").concat(vEdgeInfo.target);\n if (addedVEdgeMap[key]) {\n addedVEdgeMap[key].size += size;\n return;\n }\n addedVEdgeMap[key] = vEdgeInfo;\n }\n });\n // update the width of the virtual edges, which is the sum of merged actual edges\n // be attention that the actual edges with same endpoints but different directions will be represented by two different virtual edges\n this.addItems(Object.values(addedVEdgeMap).map(function (edgeInfo) {\n return {\n type: 'vedge',\n model: edgeInfo\n };\n }), false);\n this.emit('aftercollapseexpandcombo', {\n action: 'collapse',\n item: combo\n });\n };\n /**\n * 展开指定的 combo\n * @param {string | ICombo} combo combo ID 或 combo item\n */\n AbstractGraph.prototype.expandCombo = function (combo, stack) {\n var _this = this;\n if (stack === void 0) {\n stack = true;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n combo = this.findById(combo);\n }\n if (!combo || combo.getType && combo.getType() !== 'combo') {\n console.warn('The combo to be collapsed does not exist!');\n return;\n }\n this.emit('beforecollapseexpandcombo', {\n action: 'expand',\n item: combo\n });\n var comboModel = combo.getModel();\n var itemController = this.get('itemController');\n itemController.expandCombo(combo, stack);\n comboModel.collapsed = false;\n // add virtual edges\n var edges = this.getEdges().concat(this.get('vedges'));\n // find all the descendant nodes and combos\n var cNodesCombos = [];\n var comboTrees = this.get('comboTrees');\n var found = false;\n (comboTrees || []).forEach(function (ctree) {\n if (found) return; // if the combo is found, terminate\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(ctree, function (subTree) {\n // if the combo is found and it is traversing the other branches, terminate\n if (found && subTree.depth <= comboModel.depth) return false;\n if (comboModel.id === subTree.id) found = true;\n if (found) {\n var item = _this.findById(subTree.id);\n if (item && item.getType && item.getType() === 'combo') {\n cNodesCombos = cNodesCombos.concat(item.getNodes());\n cNodesCombos = cNodesCombos.concat(item.getCombos());\n }\n }\n return true;\n });\n });\n var addedVEdgeMap = {};\n edges.forEach(function (edge) {\n if (edge.isVisible() && !edge.getModel().isVEdge) return;\n var source = edge.getSource();\n var target = edge.getTarget();\n var sourceId = source.get('id');\n var targetId = target.get('id');\n var otherEnd = null;\n var otherEndIsSource;\n if (sourceId === comboModel.id || cNodesCombos.includes(source) && !cNodesCombos.includes(target)) {\n // the source is in the combo, the target is not\n otherEnd = target;\n otherEndIsSource = false;\n } else if (targetId === comboModel.id || !cNodesCombos.includes(source) && cNodesCombos.includes(target)) {\n // the target is in the combo, the source is not\n otherEnd = source;\n otherEndIsSource = true;\n } else if (cNodesCombos.includes(source) && cNodesCombos.includes(target)) {\n // both source and target are in the combo, if the target and source are both visible, show the edge\n if (source.isVisible() && target.isVisible()) {\n edge.show();\n }\n }\n if (otherEnd) {\n var _a = edge.getModel(),\n isVEdge = _a.isVEdge,\n _b = _a.size,\n size = _b === void 0 ? 1 : _b;\n // ignore the virtual edges\n if (isVEdge) {\n _this.removeItem(edge, false);\n return;\n }\n var otherEndModel = otherEnd.getModel();\n // find the nearest visible ancestor\n while (!otherEnd.isVisible()) {\n var otherEndPId = otherEndModel.parentId,\n otherEndCId = otherEndModel.comboId;\n var otherEndParentId = otherEndPId || otherEndCId;\n otherEnd = _this.findById(otherEndParentId);\n if (!otherEnd || !otherEndParentId) {\n return; // if all the ancestors of the oppsite are all hidden, ignore the edge\n }\n\n otherEndModel = otherEnd.getModel();\n }\n var otherEndId = otherEndModel.id;\n var selfEnd = otherEndIsSource ? target : source;\n var selfEndModel = selfEnd.getModel();\n // find the nearest visible ancestor\n while (!selfEnd.isVisible()) {\n var selfEndPId = selfEndModel.parentId,\n selfEndCId = selfEndModel.comboId;\n var selfEndParentId = selfEndPId || selfEndCId;\n selfEnd = _this.findById(selfEndParentId);\n if (!selfEnd || !selfEndParentId) {\n return; // if all the ancestors of the oppsite are all hidden, ignore the edge\n }\n\n if (selfEndModel.comboId === comboModel.id || selfEndModel.parentId === comboModel.id) {\n break; // if the next ancestor is the combo, break the while\n }\n\n selfEndModel = selfEnd.getModel();\n }\n var selfEndId = selfEndModel.id;\n if (otherEndId) {\n var vEdgeInfo = otherEndIsSource ? {\n source: otherEndId,\n target: selfEndId,\n isVEdge: true,\n size: size\n } : {\n source: selfEndId,\n target: otherEndId,\n isVEdge: true,\n size: size\n };\n var vedgeId = \"\".concat(vEdgeInfo.source, \"-\").concat(vEdgeInfo.target);\n // update the width of the virtual edges, which is the sum of merged actual edges\n // be attention that the actual edges with same endpoints but different directions will be represented by two different virtual edges\n if (addedVEdgeMap[vedgeId]) {\n addedVEdgeMap[vedgeId].size += size;\n return;\n }\n addedVEdgeMap[vedgeId] = vEdgeInfo;\n }\n }\n });\n this.addItems(Object.values(addedVEdgeMap).map(function (edgeInfo) {\n return {\n type: 'vedge',\n model: edgeInfo\n };\n }), false);\n this.emit('aftercollapseexpandcombo', {\n action: 'expand',\n item: combo\n });\n };\n AbstractGraph.prototype.collapseExpandCombo = function (combo, stack) {\n if (stack === void 0) {\n stack = true;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n combo = this.findById(combo);\n }\n if (!combo || combo.getType && combo.getType() !== 'combo') return;\n var comboModel = combo.getModel();\n // if one ancestor combo of the combo is collapsed, it should not be collapsed or expanded\n var parentItem = this.findById(comboModel.parentId);\n while (parentItem) {\n var parentModel = parentItem.getModel();\n if (parentModel.collapsed) {\n console.warn(\"Fail to expand the combo since it's ancestor combo is collapsed.\");\n parentItem = undefined;\n return;\n }\n parentItem = this.findById(parentModel.parentId);\n }\n var collapsed = comboModel.collapsed;\n // 该群组已经处于收起状态,需要展开\n if (collapsed) {\n this.expandCombo(combo, stack);\n } else {\n this.collapseCombo(combo, stack);\n }\n this.updateCombo(combo);\n };\n /**\n * 获取节点所有的邻居节点\n *\n * @param {(string | INode)} node 节点 ID 或实例\n * @returns {INode[]}\n * @memberof IAbstractGraph\n */\n AbstractGraph.prototype.getNeighbors = function (node, type) {\n var item = node;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(node)) {\n item = this.findById(node);\n }\n return item.getNeighbors(type);\n };\n /**\n * 获取 node 的度数\n *\n * @param {(string | INode)} node 节点 ID 或实例\n * @param {('in' | 'out' | 'total' | 'all' | undefined)} 度数类型,in 入度,out 出度,total 总度数,all 返回三种类型度数的对象\n * @returns {Number | Object} 该节点的度数\n * @memberof IAbstractGraph\n */\n AbstractGraph.prototype.getNodeDegree = function (node, type, refresh) {\n if (type === void 0) {\n type = undefined;\n }\n if (refresh === void 0) {\n refresh = false;\n }\n var item = node;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(node)) {\n item = this.findById(node);\n }\n var degrees = this.get('degrees');\n if (!degrees || refresh) {\n degrees = Object(_antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"getDegree\"])(this.save());\n this.set('degrees', degrees);\n }\n var nodeDegrees = degrees[item.getID()];\n var res = 0;\n // 如果是通过 addItem 后面新增加的节点,此时它的所有度数都为 0\n if (!nodeDegrees) {\n return 0;\n }\n switch (type) {\n case 'in':\n res = nodeDegrees.inDegree;\n break;\n case 'out':\n res = nodeDegrees.outDegree;\n break;\n case 'all':\n res = nodeDegrees;\n break;\n default:\n res = nodeDegrees.degree;\n break;\n }\n return res;\n };\n AbstractGraph.prototype.getUndoStack = function () {\n return this.undoStack;\n };\n AbstractGraph.prototype.getRedoStack = function () {\n return this.redoStack;\n };\n /**\n * 获取 undo 和 redo 栈的数据\n */\n AbstractGraph.prototype.getStackData = function () {\n if (!this.get('enabledStack')) {\n return null;\n }\n return {\n undoStack: this.undoStack.toArray(),\n redoStack: this.redoStack.toArray()\n };\n };\n /**\n * 清空 undo stack & redo stack\n */\n AbstractGraph.prototype.clearStack = function () {\n if (this.get('enabledStack')) {\n this.undoStack.clear();\n this.redoStack.clear();\n this.emit('stackchange', {\n undoStack: this.undoStack,\n redoStack: this.redoStack\n });\n }\n };\n /**\n * 将操作类型和操作数据入栈\n * @param action 操作类型\n * @param data 入栈的数据\n * @param stackType 栈的类型\n */\n AbstractGraph.prototype.pushStack = function (action, data, stackType) {\n if (action === void 0) {\n action = 'update';\n }\n if (stackType === void 0) {\n stackType = 'undo';\n }\n if (!this.get('enabledStack')) {\n console.warn('请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !');\n return;\n }\n var stackData = data ? Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(data) : {\n before: {},\n after: Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(this.save())\n };\n if (stackType === 'redo') {\n this.redoStack.push({\n action: action,\n data: stackData\n });\n } else {\n this.undoStack.push({\n action: action,\n data: stackData\n });\n }\n this.emit('stackchange', {\n action: action,\n stackType: stackType,\n undoStack: this.undoStack,\n redoStack: this.redoStack\n });\n };\n /**\n * 获取邻接矩阵\n *\n * @param {boolean} cache 是否使用缓存的\n * @param {boolean} directed 是否是有向图,默认取 graph.directed\n * @returns {Matrix} 邻接矩阵\n * @memberof IAbstractGraph\n */\n AbstractGraph.prototype.getAdjMatrix = function (cache, directed) {\n if (cache === void 0) {\n cache = true;\n }\n if (directed === undefined) directed = this.get('directed');\n var currentAdjMatrix = this.get('adjMatrix');\n if (!currentAdjMatrix || !cache) {\n currentAdjMatrix = Object(_antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"getAdjMatrix\"])(this.save(), directed);\n this.set('adjMatrix', currentAdjMatrix);\n }\n return currentAdjMatrix;\n };\n /**\n * 获取最短路径矩阵\n *\n * @param {boolean} cache 是否使用缓存的\n * @param {boolean} directed 是否是有向图,默认取 graph.directed\n * @returns {Matrix} 最短路径矩阵\n * @memberof IAbstractGraph\n */\n AbstractGraph.prototype.getShortestPathMatrix = function (cache, directed) {\n if (cache === void 0) {\n cache = true;\n }\n if (directed === undefined) directed = this.get('directed');\n var currentAdjMatrix = this.get('adjMatrix');\n var currentShourtestPathMatrix = this.get('shortestPathMatrix');\n if (!currentAdjMatrix || !cache) {\n currentAdjMatrix = Object(_antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"getAdjMatrix\"])(this.save(), directed);\n this.set('adjMatrix', currentAdjMatrix);\n }\n if (!currentShourtestPathMatrix || !cache) {\n currentShourtestPathMatrix = Object(_antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"floydWarshall\"])(this.save(), directed);\n this.set('shortestPathMatrix', currentShourtestPathMatrix);\n }\n return currentShourtestPathMatrix;\n };\n /**\n * 重新定义监听函数,复写参数类型\n */\n AbstractGraph.prototype.on = function (eventName, callback, once) {\n return _super.prototype.on.call(this, eventName, callback, once);\n };\n /**\n * 销毁画布\n */\n AbstractGraph.prototype.destroy = function () {\n var _a, _b, _c, _d, _e;\n this.emit('beforedestroy');\n this.clear();\n // 清空栈数据\n this.clearStack();\n (_a = this.get('itemController')) === null || _a === void 0 ? void 0 : _a.destroy();\n (_b = this.get('modeController')) === null || _b === void 0 ? void 0 : _b.destroy();\n (_c = this.get('viewController')) === null || _c === void 0 ? void 0 : _c.destroy();\n (_d = this.get('stateController')) === null || _d === void 0 ? void 0 : _d.destroy();\n (_e = this.get('canvas')) === null || _e === void 0 ? void 0 : _e.destroy();\n this.cfg = null;\n this.destroyed = true;\n this.redoStack = null;\n this.undoStack = null;\n this.emit('afterdestroy');\n };\n /**\n * 创建凸包或凹包轮廓\n * @param cfg HullCfg 轮廓配置项\n */\n AbstractGraph.prototype.createHull = function (cfg) {\n if (!cfg.members || cfg.members.length < 1) {\n console.warn('Create hull failed! The members is empty.');\n return;\n }\n var parent = this.get('hullGroup');\n var hullMap = this.get('hullMap');\n if (!hullMap) {\n hullMap = {};\n this.set('hullMap', hullMap);\n }\n if (!parent || parent.get('destroyed')) {\n parent = this.get('group').addGroup({\n id: 'hullGroup'\n });\n parent.toBack();\n this.set('hullGroup', parent);\n }\n if (hullMap[cfg.id]) {\n console.warn('Existed hull id.');\n return hullMap[cfg.id];\n }\n var group = parent.addGroup({\n id: \"\".concat(cfg.id, \"-container\")\n });\n var hull = new _item_hull__WEBPACK_IMPORTED_MODULE_10__[\"default\"](this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, cfg), {\n group: group\n }));\n var hullId = hull.id;\n hullMap[hullId] = hull;\n return hull;\n };\n /**\n * 获取当前 graph 中存在的包裹轮廓\n * @return {[key: string]: Hull} Hull 的 map,hullId 对应的 hull 实例\n */\n AbstractGraph.prototype.getHulls = function () {\n return this.get('hullMap');\n };\n /**\n * 根据 hullId 获取对应的 hull\n * @return Hull\n */\n AbstractGraph.prototype.getHullById = function (hullId) {\n return this.get('hullMap')[hullId];\n };\n AbstractGraph.prototype.removeHull = function (hull) {\n var _a;\n var hullInstance;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(hull)) {\n hullInstance = this.getHullById(hull);\n } else {\n hullInstance = hull;\n }\n (_a = this.get('hullMap')) === null || _a === void 0 ? true : delete _a[hullInstance.id];\n hullInstance.destroy();\n };\n AbstractGraph.prototype.removeHulls = function () {\n var hulls = this.getHulls();\n if (!hulls || !Object.keys(hulls).length) return;\n Object.keys(hulls).forEach(function (key) {\n var hull = hulls[key];\n hull.destroy();\n });\n this.set('hullMap', {});\n };\n return AbstractGraph;\n}(_antv_event_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (AbstractGraph);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/graph.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/shape/BoundingSphere.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/shape/BoundingSphere.js ***! - \*********************************************************************/ -/*! exports provided: BoundingSphere */ +/***/ "./node_modules/@antv/g6-core/es/index.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/index.js ***! + \************************************************/ +/*! exports provided: G6GraphEvent, Arrow, Shape, Node, Edge, Combo, Hull, Marker, registerNode, registerCombo, AbstractGraph, Util, registerEdge, registerBehavior, AbstractLayout, AbstractEvent, BaseGlobal, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BoundingSphere\", function() { return BoundingSphere; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n\n\n\nvar tmpVecA = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\nvar BoundingSphere = /*#__PURE__*/function () {\n function BoundingSphere(center, radius) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, BoundingSphere);\n\n this.center = void 0;\n this.radius = void 0;\n this.center = center || gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\n this.radius = radius || 0.5;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(BoundingSphere, [{\n key: \"containsPoint\",\n value: function containsPoint(point) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].sub(tmpVecA, point, this.center);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].length(tmpVecA) < this.radius * this.radius;\n }\n }, {\n key: \"intersects\",\n value: function intersects(sphere) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].sub(tmpVecA, sphere.center, this.center);\n var totalRadius = sphere.radius + this.radius;\n\n if (gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].length(tmpVecA) <= totalRadius * totalRadius) {\n return true;\n }\n\n return false;\n }\n }]);\n\n return BoundingSphere;\n}();\n//# sourceMappingURL=BoundingSphere.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/shape/BoundingSphere.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerNode\", function() { return registerNode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerCombo\", function() { return registerCombo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerEdge\", function() { return registerEdge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerBehavior\", function() { return registerBehavior; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BaseGlobal\", function() { return BaseGlobal; });\n/* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./behavior */ \"./node_modules/@antv/g6-core/es/behavior/index.js\");\n/* harmony import */ var _graph_graph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./graph/graph */ \"./node_modules/@antv/g6-core/es/graph/graph.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGraph\", function() { return _graph_graph__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ \"./node_modules/@antv/g6-core/es/element/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Arrow\", function() { return _element__WEBPACK_IMPORTED_MODULE_2__[\"Arrow\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Marker\", function() { return _element__WEBPACK_IMPORTED_MODULE_2__[\"Marker\"]; });\n\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/g6-core/es/util/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Util\", function() { return _util__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _graph_controller_layout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./graph/controller/layout */ \"./node_modules/@antv/g6-core/es/graph/controller/layout.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractLayout\", function() { return _graph_controller_layout__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _graph_controller_event__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./graph/controller/event */ \"./node_modules/@antv/g6-core/es/graph/controller/event.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractEvent\", function() { return _graph_controller_event__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _item_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./item/node */ \"./node_modules/@antv/g6-core/es/item/node.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return _item_node__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _item_edge__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./item/edge */ \"./node_modules/@antv/g6-core/es/item/edge.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Edge\", function() { return _item_edge__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _item_hull__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./item/hull */ \"./node_modules/@antv/g6-core/es/item/hull.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Hull\", function() { return _item_hull__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _item_combo__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./item/combo */ \"./node_modules/@antv/g6-core/es/item/combo.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Combo\", function() { return _item_combo__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/g6-core/es/types/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _types__WEBPACK_IMPORTED_MODULE_11__[\"G6GraphEvent\"]; });\n\n\n\n\n\n\n// 用于 PC 和 Mobile 端分别实现 layout 和 updateLayoutCfg 方法\n\n\n\n\n\n\nvar registerNode = _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerNode;\nvar registerEdge = _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerEdge;\nvar registerCombo = _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerCombo;\nvar registerBehavior = _behavior__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerBehavior;\nvar BaseGlobal = _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].version,\n AbstractGraph: _graph_graph__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n BaseGlobal: BaseGlobal,\n Util: _util__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n Shape: _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Node: _item_node__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n Edge: _item_edge__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n Combo: _item_combo__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n Hull: _item_hull__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n registerNode: _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerNode,\n registerEdge: _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerEdge,\n registerCombo: _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerCombo,\n registerBehavior: _behavior__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerBehavior,\n Arrow: _element__WEBPACK_IMPORTED_MODULE_2__[\"Arrow\"],\n Marker: _element__WEBPACK_IMPORTED_MODULE_2__[\"Marker\"],\n AbstractLayout: _graph_controller_layout__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n AbstractEvent: _graph_controller_event__WEBPACK_IMPORTED_MODULE_6__[\"default\"]\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/shape/Frustum.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/shape/Frustum.js ***! - \**************************************************************/ -/*! exports provided: Mask, Frustum */ +/***/ "./node_modules/@antv/g6-core/es/interface/behavior.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/interface/behavior.js ***! + \*************************************************************/ +/*! exports provided: G6GraphEvent */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Mask\", function() { return Mask; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Frustum\", function() { return Frustum; });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _Plane__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Plane */ \"./node_modules/@antv/g-webgpu-core/es/shape/Plane.js\");\n\n\n\n\n\nvar Mask;\n\n(function (Mask) {\n Mask[Mask[\"OUTSIDE\"] = 4294967295] = \"OUTSIDE\";\n Mask[Mask[\"INSIDE\"] = 0] = \"INSIDE\";\n Mask[Mask[\"INDETERMINATE\"] = 2147483647] = \"INDETERMINATE\";\n})(Mask || (Mask = {}));\n\nvar Frustum = /*#__PURE__*/function () {\n function Frustum(planes) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Frustum);\n\n this.planes = [];\n\n if (planes) {\n this.planes = planes;\n } else {\n for (var i = 0; i < 6; i++) {\n this.planes.push(new _Plane__WEBPACK_IMPORTED_MODULE_4__[\"Plane\"]());\n }\n }\n }\n /**\n * extract 6 planes from vpMatrix\n * @see http://www8.cs.umu.se/kurser/5DV051/HT12/lab/plane_extraction.pdf\n * @param vpMatrix viewProjectionMatrix\n */\n\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Frustum, [{\n key: \"extractFromVPMatrix\",\n value: function extractFromVPMatrix(vpMatrix) {\n var _vpMatrix = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(vpMatrix, 16),\n m0 = _vpMatrix[0],\n m1 = _vpMatrix[1],\n m2 = _vpMatrix[2],\n m3 = _vpMatrix[3],\n m4 = _vpMatrix[4],\n m5 = _vpMatrix[5],\n m6 = _vpMatrix[6],\n m7 = _vpMatrix[7],\n m8 = _vpMatrix[8],\n m9 = _vpMatrix[9],\n m10 = _vpMatrix[10],\n m11 = _vpMatrix[11],\n m12 = _vpMatrix[12],\n m13 = _vpMatrix[13],\n m14 = _vpMatrix[14],\n m15 = _vpMatrix[15]; // right\n\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_3__[\"vec3\"].set(this.planes[0].normal, m3 - m0, m7 - m4, m11 - m8);\n this.planes[0].distance = -(m15 - m12); // left\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_3__[\"vec3\"].set(this.planes[1].normal, m3 + m0, m7 + m4, m11 + m8);\n this.planes[1].distance = -(m15 + m12); // bottom\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_3__[\"vec3\"].set(this.planes[2].normal, m3 + m1, m7 + m5, m11 + m9);\n this.planes[2].distance = -(m15 + m13); // top\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_3__[\"vec3\"].set(this.planes[3].normal, m3 - m1, m7 - m5, m11 - m9);\n this.planes[3].distance = -(m15 - m13); // far\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_3__[\"vec3\"].set(this.planes[4].normal, m3 - m2, m7 - m6, m11 - m10);\n this.planes[4].distance = -(m15 - m14); // near\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_3__[\"vec3\"].set(this.planes[5].normal, m3 + m2, m7 + m6, m11 + m10);\n this.planes[5].distance = -(m15 + m14);\n this.planes.forEach(function (plane) {\n plane.normalize();\n plane.updatePNVertexFlag();\n });\n }\n }]);\n\n return Frustum;\n}();\n//# sourceMappingURL=Frustum.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/shape/Frustum.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return G6GraphEvent; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n\n\nvar G6GraphEvent = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(G6GraphEvent, _super);\n function G6GraphEvent(type, event) {\n var _this = _super.call(this, type, event) || this;\n _this.item = event.item;\n _this.canvasX = event.canvasX;\n _this.canvasY = event.canvasY;\n _this.wheelDelta = event.wheelDelta;\n _this.detail = event.detail;\n return _this;\n }\n return G6GraphEvent;\n}(_antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"Event\"]);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/behavior.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/shape/Plane.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/shape/Plane.js ***! - \************************************************************/ -/*! exports provided: Plane */ +/***/ "./node_modules/@antv/g6-core/es/interface/graph.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/interface/graph.js ***! + \**********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Plane\", function() { return Plane; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n\n\n\nvar Plane = /*#__PURE__*/function () {\n /**\n * lookup table for p-vertex & n-vertex when doing frustum culling\n */\n function Plane(distance, normal) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Plane);\n\n this.distance = void 0;\n this.normal = void 0;\n this.pnVertexFlag = void 0;\n this.distance = distance || 0;\n this.normal = normal || gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(0, 1, 0);\n this.updatePNVertexFlag();\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Plane, [{\n key: \"updatePNVertexFlag\",\n value: function updatePNVertexFlag() {\n this.pnVertexFlag = (Number(this.normal[0] >= 0) << 8) + (Number(this.normal[1] >= 0) << 4) + Number(this.normal[2] >= 0);\n }\n }, {\n key: \"distanceToPoint\",\n value: function distanceToPoint(point) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].dot(point, this.normal) - this.distance;\n }\n }, {\n key: \"normalize\",\n value: function normalize() {\n var invLen = 1 / gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].len(this.normal);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].scale(this.normal, this.normal, invLen);\n this.distance *= invLen;\n }\n }, {\n key: \"intersectsLine\",\n value: function intersectsLine(start, end, point) {\n var d0 = this.distanceToPoint(start);\n var d1 = this.distanceToPoint(end);\n var t = d0 / (d0 - d1);\n var intersects = t >= 0 && t <= 1;\n\n if (intersects && point) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].lerp(point, start, end, t);\n }\n\n return intersects;\n }\n }]);\n\n return Plane;\n}();\n//# sourceMappingURL=Plane.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/shape/Plane.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/graph.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/shape/Ray.js": +/***/ "./node_modules/@antv/g6-core/es/interface/index.js": /*!**********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/shape/Ray.js ***! + !*** ./node_modules/@antv/g6-core/es/interface/index.js ***! \**********************************************************/ -/*! exports provided: Ray */ +/*! exports provided: G6GraphEvent */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Ray\", function() { return Ray; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n\n\n\nvar tmpVecA = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\nvar tmpVecB = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\nvar tmpVecC = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\nvar tmpVecD = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\nvar tmpVecE = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\n/**\n * 包含求交方法:\n * * intersectsShape(Shape, intersection) 返回交点和求交结果\n * @see https://github.com/playcanvas/engine/blob/master/src/shape/bounding-box.js#L161\n * @see https://github.com/mrdoob/three.js/blob/dev/src/math/Ray.js\n */\n\nvar Ray = /*#__PURE__*/function () {\n function Ray(origin, direction) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Ray);\n\n this.origin = void 0;\n this.direction = void 0;\n this.origin = origin || gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create();\n this.direction = direction || gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].fromValues(0, 0, -1);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Ray, [{\n key: \"intersectsAABB\",\n value: function intersectsAABB(aabb, intersection) {\n return intersection ? this.intersectAABBWithIntersection(aabb, intersection) : this.intersectsAABBWithoutIntersection(aabb);\n }\n }, {\n key: \"intersectsSphere\",\n value: function intersectsSphere(sphere, intersection) {\n var m = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].sub(tmpVecA, this.origin, sphere.center);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].normalize(tmpVecB, gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(tmpVecB, this.direction));\n var b = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].dot(m, tmpVecB);\n var c = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].dot(m, m) - sphere.radius * sphere.radius; // exit if ray's origin outside of sphere (c > 0) and ray pointing away from s (b > 0)\n\n if (c > 0 && b > 0) {\n return null;\n }\n\n var discr = b * b - c; // a negative discriminant corresponds to ray missing sphere\n\n if (discr < 0) {\n return false;\n } // ray intersects sphere, compute smallest t value of intersection\n\n\n var t = Math.abs(-b - Math.sqrt(discr)); // if t is negative, ray started inside sphere so clamp t to zero\n\n if (intersection) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(intersection, this.direction);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].scaleAndAdd(intersection, this.origin, intersection, t);\n }\n\n return true;\n }\n }, {\n key: \"intersectsPlane\",\n value: function intersectsPlane(plane, intersection) {\n var t = (plane.distance - gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].dot(plane.normal, this.origin)) / gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].dot(plane.normal, this.direction);\n var intersects = t >= 0;\n\n if (intersects && intersection) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].scaleAndAdd(intersection, this.origin, this.direction, t);\n }\n\n return intersects;\n }\n /**\n * faster than implements like Three.js\n * @see https://github.com/playcanvas/engine/blob/master/src/shape/bounding-box.js#L161\n */\n\n }, {\n key: \"intersectsAABBWithoutIntersection\",\n value: function intersectsAABBWithoutIntersection(aabb) {\n var diff = tmpVecA;\n var cross = tmpVecB;\n var prod = tmpVecC;\n var absDiff = tmpVecD;\n var absDir = tmpVecE;\n var rayDir = this.direction;\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].sub(diff, this.origin, aabb.center);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].set(absDiff, Math.abs(diff[0]), Math.abs(diff[1]), Math.abs(diff[2]));\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].mul(prod, diff, rayDir);\n\n if (absDiff[0] > aabb.halfExtents[0] && prod[0] >= 0 || absDiff[1] > aabb.halfExtents[1] && prod[1] >= 0 || absDiff[2] > aabb.halfExtents[2] && prod[2] >= 0) {\n return false;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].set(absDir, Math.abs(rayDir[0]), Math.abs(rayDir[1]), Math.abs(rayDir[2]));\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].cross(cross, rayDir, diff);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].set(cross, Math.abs(cross[0]), Math.abs(cross[1]), Math.abs(cross[2]));\n return !(cross[0] > aabb.halfExtents[1] * absDir[2] + aabb.halfExtents[2] * absDir[1] || cross[1] > aabb.halfExtents[0] * absDir[2] + aabb.halfExtents[2] * absDir[0] || cross[2] > aabb.halfExtents[0] * absDir[1] + aabb.halfExtents[1] * absDir[0]);\n }\n }, {\n key: \"intersectAABBWithIntersection\",\n value: function intersectAABBWithIntersection(aabb, intersection) {\n var tMin = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create(), aabb.getMin());\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].sub(tMin, tMin, this.origin);\n var tMax = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].create(), aabb.getMax());\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].sub(tMax, tMax, this.origin);\n var dir = this.direction; // Ensure that we are not dividing it by zero\n\n if (dir[0] === 0) {\n tMin[0] = tMin[0] < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;\n tMax[0] = tMax[0] < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;\n } else {\n tMin[0] /= dir[0];\n tMax[0] /= dir[0];\n }\n\n if (dir[1] === 0) {\n tMin[1] = tMin[1] < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;\n tMax[1] = tMax[1] < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;\n } else {\n tMin[1] /= dir[1];\n tMax[1] /= dir[1];\n }\n\n if (dir[2] === 0) {\n tMin[2] = tMin[2] < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;\n tMax[2] = tMax[2] < 0 ? -Number.MAX_VALUE : Number.MAX_VALUE;\n } else {\n tMin[2] /= dir[2];\n tMax[2] /= dir[2];\n }\n\n var realMin = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].set(tmpVecC, Math.min(tMin[0], tMax[0]), Math.min(tMin[1], tMax[1]), Math.min(tMin[2], tMax[2]));\n var realMax = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].set(tmpVecD, Math.max(tMin[0], tMax[0]), Math.max(tMin[1], tMax[1]), Math.max(tMin[2], tMax[2]));\n var minMax = Math.min(Math.min(realMax[0], realMax[1]), realMax[2]);\n var maxMin = Math.max(Math.max(realMin[0], realMin[1]), realMin[2]);\n var intersects = minMax >= maxMin && maxMin >= 0;\n\n if (intersects) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(intersection, this.direction);\n gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].scaleAndAdd(intersection, this.origin, intersection, maxMin);\n }\n\n return intersects;\n }\n }]);\n\n return Ray;\n}();\n//# sourceMappingURL=Ray.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/shape/Ray.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./graph */ \"./node_modules/@antv/g6-core/es/interface/graph.js\");\n/* empty/unused harmony star reexport *//* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./behavior */ \"./node_modules/@antv/g6-core/es/interface/behavior.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _behavior__WEBPACK_IMPORTED_MODULE_1__[\"G6GraphEvent\"]; });\n\n/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./item */ \"./node_modules/@antv/g6-core/es/interface/item.js\");\n/* empty/unused harmony star reexport *//* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/interface/shape.js\");\n/* empty/unused harmony star reexport */\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/shape/index.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/shape/index.js ***! - \************************************************************/ -/*! exports provided: AABB, BoundingSphere, Mask, Frustum, Plane, Ray */ +/***/ "./node_modules/@antv/g6-core/es/interface/item.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/interface/item.js ***! + \*********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _AABB__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./AABB */ \"./node_modules/@antv/g-webgpu-core/es/shape/AABB.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AABB\", function() { return _AABB__WEBPACK_IMPORTED_MODULE_0__[\"AABB\"]; });\n\n/* harmony import */ var _BoundingSphere__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./BoundingSphere */ \"./node_modules/@antv/g-webgpu-core/es/shape/BoundingSphere.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BoundingSphere\", function() { return _BoundingSphere__WEBPACK_IMPORTED_MODULE_1__[\"BoundingSphere\"]; });\n\n/* harmony import */ var _Frustum__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Frustum */ \"./node_modules/@antv/g-webgpu-core/es/shape/Frustum.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Mask\", function() { return _Frustum__WEBPACK_IMPORTED_MODULE_2__[\"Mask\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Frustum\", function() { return _Frustum__WEBPACK_IMPORTED_MODULE_2__[\"Frustum\"]; });\n\n/* harmony import */ var _Plane__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./Plane */ \"./node_modules/@antv/g-webgpu-core/es/shape/Plane.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Plane\", function() { return _Plane__WEBPACK_IMPORTED_MODULE_3__[\"Plane\"]; });\n\n/* harmony import */ var _Ray__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./Ray */ \"./node_modules/@antv/g-webgpu-core/es/shape/Ray.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Ray\", function() { return _Ray__WEBPACK_IMPORTED_MODULE_4__[\"Ray\"]; });\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/shape/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/item.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/utils/aabb.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/utils/aabb.js ***! - \***********************************************************/ -/*! exports provided: generateAABBFromVertices */ +/***/ "./node_modules/@antv/g6-core/es/interface/shape.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/interface/shape.js ***! + \**********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generateAABBFromVertices\", function() { return generateAABBFromVertices; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _shape_AABB__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shape/AABB */ \"./node_modules/@antv/g-webgpu-core/es/shape/AABB.js\");\n\n\n/**\n * generate AABB with positions\n * @param positions [x1,y1,z1, x2,y2,z2]\n */\n\nfunction generateAABBFromVertices(positions) {\n var aabb = new _shape_AABB__WEBPACK_IMPORTED_MODULE_1__[\"AABB\"]();\n var min = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].fromValues(positions[0], positions[1], positions[2]);\n var max = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].fromValues(positions[0], positions[1], positions[2]);\n\n for (var i = 3; i < positions.length;) {\n var x = positions[i++];\n var y = positions[i++];\n var z = positions[i++];\n\n if (x < min[0]) {\n min[0] = x;\n }\n\n if (y < min[1]) {\n min[1] = y;\n }\n\n if (z < min[2]) {\n min[2] = z;\n }\n\n if (x > max[0]) {\n max[0] = x;\n }\n\n if (y > max[1]) {\n max[1] = y;\n }\n\n if (z > max[2]) {\n max[2] = z;\n }\n }\n\n aabb.setMinMax(min, max);\n return aabb;\n}\n//# sourceMappingURL=aabb.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/utils/aabb.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/shape.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/utils/is-number.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/utils/is-number.js ***! - \****************************************************************/ -/*! exports provided: isNumber */ +/***/ "./node_modules/@antv/g6-core/es/item/combo.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/item/combo.js ***! + \*****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return isNumber; });\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n//# sourceMappingURL=is-number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/utils/is-number.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node */ \"./node_modules/@antv/g6-core/es/item/node.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n\n\nvar CACHE_BBOX = 'bboxCache';\nvar CACHE_CANVAS_BBOX = 'bboxCanvasCache';\nvar CACHE_SIZE = 'sizeCache';\nvar CACHE_ANCHOR_POINTS = 'anchorPointsCache';\nvar Combo = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Combo, _super);\n function Combo() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Combo.prototype.getDefaultCfg = function () {\n return {\n type: 'combo',\n nodes: [],\n edges: [],\n combos: []\n };\n };\n Combo.prototype.getShapeCfg = function (model) {\n var styles = this.get('styles');\n var bbox = this.get('bbox');\n if (styles && bbox) {\n // merge graph的item样式与数据模型中的样式\n var newModel = model;\n var modelSize = Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"isNumber\"])(model.size) ? [model.size, model.size] : model.size;\n var modelFixSize = Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"isNumber\"])(model.fixSize) ? [model.fixSize, model.fixSize] : model.fixSize;\n var useModelSize = modelSize || modelFixSize || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.size;\n var size = {\n r: (Math.max(bbox.width, bbox.height) || Math.max(useModelSize[0], useModelSize[1])) / 2,\n width: bbox.width || useModelSize[0],\n height: bbox.height || useModelSize[1]\n };\n newModel.style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), model.style), size);\n var padding = model.padding || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"isNumber\"])(padding)) {\n size.r += padding;\n size.width += padding * 2;\n size.height += padding * 2;\n } else {\n size.r = size.r + Math.max.apply(Math, padding);\n size.width += padding[1] + padding[3] || padding[1] * 2;\n size.height += padding[0] + padding[2] || padding[0] * 2;\n }\n this.set(CACHE_SIZE, size);\n return newModel;\n }\n return model;\n };\n /**\n * 根据 keyshape 计算包围盒\n */\n Combo.prototype.calculateCanvasBBox = function () {\n if (this.destroyed) return;\n var keyShape = this.get('keyShape');\n var group = this.get('group');\n var cacheBBox = this.get(CACHE_BBOX) || {};\n var oriX = cacheBBox.x;\n var oriY = cacheBBox.x;\n var cacheSize = this.get(CACHE_SIZE);\n // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n var bbox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_3__[\"getBBox\"])(keyShape, group);\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n if (cacheSize) {\n cacheSize.width = Math.max(cacheSize.width, bbox.width);\n cacheSize.height = Math.max(cacheSize.height, bbox.height);\n this.set(CACHE_SIZE, cacheSize);\n var type = keyShape.get('type');\n if (type === 'circle') {\n bbox.width = cacheSize.r * 2;\n bbox.height = cacheSize.r * 2;\n } else {\n bbox.width = cacheSize.width;\n bbox.height = cacheSize.height;\n }\n bbox.minX = bbox.centerX - bbox.width / 2;\n bbox.minY = bbox.centerY - bbox.height / 2;\n bbox.maxX = bbox.centerX + bbox.width / 2;\n bbox.maxY = bbox.centerY + bbox.height / 2;\n } else {\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n }\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n if (bbox.x !== oriX || bbox.y !== oriY) this.set(CACHE_ANCHOR_POINTS, null);\n return bbox;\n };\n /**\n * 获取 Combo 中所有的子元素,包括 Combo、Node 及 Edge\n */\n Combo.prototype.getChildren = function () {\n var self = this;\n return {\n nodes: self.getNodes(),\n combos: self.getCombos()\n };\n };\n /**\n * 获取 Combo 中所有子节点\n */\n Combo.prototype.getNodes = function () {\n var self = this;\n return self.get('nodes');\n };\n /**\n * 获取 Combo 中所有子 combo\n */\n Combo.prototype.getCombos = function () {\n var self = this;\n return self.get('combos');\n };\n /**\n * 向 Combo 中增加子 combo 或 node\n * @param item Combo 或节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n Combo.prototype.addChild = function (item) {\n var self = this;\n var itemType = item.getType();\n switch (itemType) {\n case 'node':\n self.addNode(item);\n break;\n case 'combo':\n self.addCombo(item);\n break;\n default:\n console.warn('Only node or combo items are allowed to be added into a combo');\n return false;\n }\n return true;\n };\n /**\n * 向 Combo 中增加 combo\n * @param combo Combo 实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n Combo.prototype.addCombo = function (combo) {\n var self = this;\n self.get('combos').push(combo);\n return true;\n };\n /**\n * 向 Combo 中添加节点\n * @param node 节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n Combo.prototype.addNode = function (node) {\n var self = this;\n self.get('nodes').push(node);\n return true;\n };\n /**\n * 向 Combo 中增加子 combo 或 node\n * @param item Combo 或节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n Combo.prototype.removeChild = function (item) {\n var self = this;\n var itemType = item.getType();\n switch (itemType) {\n case 'node':\n self.removeNode(item);\n break;\n case 'combo':\n self.removeCombo(item);\n break;\n default:\n console.warn('Only node or combo items are allowed to be added into a combo');\n return false;\n }\n return true;\n };\n /**\n * 从 Combo 中移除指定的 combo\n * @param combo Combo 实例\n * @return boolean 移除成功返回 true,否则返回 false\n */\n Combo.prototype.removeCombo = function (combo) {\n if (!combo) return;\n var combos = this.getCombos();\n var index = combos.indexOf(combo);\n if (index > -1) {\n combos.splice(index, 1);\n return true;\n }\n return false;\n };\n /**\n * 向 Combo 中移除指定的节点\n * @param node 节点实例\n * @return boolean 移除成功返回 true,否则返回 false\n */\n Combo.prototype.removeNode = function (node) {\n if (!node) return;\n var nodes = this.getNodes();\n var index = nodes.indexOf(node);\n if (index > -1) {\n nodes.splice(index, 1);\n return true;\n }\n return false;\n };\n Combo.prototype.getUpdateType = function (cfg) {\n return undefined;\n };\n /**\n * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n Combo.prototype.getBBox = function () {\n this.set(CACHE_CANVAS_BBOX, null);\n var bbox = this.calculateCanvasBBox();\n return bbox;\n };\n Combo.prototype.clearCache = function () {\n this.set(CACHE_BBOX, null); // 清理缓存的 bbox\n this.set(CACHE_CANVAS_BBOX, null);\n this.set(CACHE_ANCHOR_POINTS, null);\n };\n Combo.prototype.destroy = function () {\n if (!this.destroyed) {\n var animate = this.get('animate');\n var group = this.get('group');\n if (animate) {\n group.stopAnimate();\n }\n group['shapeMap'] = {};\n this.clearCache();\n this.set(CACHE_SIZE, null);\n this.set('bbox', null);\n group.remove();\n this._cfg = null;\n this.destroyed = true;\n }\n };\n return Combo;\n}(_node__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Combo);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/combo.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/utils/is-typedarray.js": -/*!********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/utils/is-typedarray.js ***! - \********************************************************************/ -/*! exports provided: isTypedArray */ +/***/ "./node_modules/@antv/g6-core/es/item/edge.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/item/edge.js ***! + \****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isTypedArray\", function() { return isTypedArray; });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n/** `Object#toString` result references. */\n\nvar argsTag = '[object Arguments]';\nvar arrayTag = '[object Array]';\nvar boolTag = '[object Boolean]';\nvar dateTag = '[object Date]';\nvar errorTag = '[object Error]';\nvar funcTag = '[object Function]';\nvar mapTag = '[object Map]';\nvar numberTag = '[object Number]';\nvar objectTag = '[object Object]';\nvar regexpTag = '[object RegExp]';\nvar setTag = '[object Set]';\nvar stringTag = '[object String]';\nvar weakMapTag = '[object WeakMap]';\nvar arrayBufferTag = '[object ArrayBuffer]';\nvar dataViewTag = '[object DataView]';\nvar float32Tag = '[object Float32Array]';\nvar float64Tag = '[object Float64Array]';\nvar int8Tag = '[object Int8Array]';\nvar int16Tag = '[object Int16Array]';\nvar int32Tag = '[object Int32Array]';\nvar uint8Tag = '[object Uint8Array]';\nvar uint8ClampedTag = '[object Uint8ClampedArray]';\nvar uint16Tag = '[object Uint16Array]';\nvar uint32Tag = '[object Uint32Array]';\n/** Used to identify `toStringTag` values of typed arrays. */\n\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n\nfunction baseUnary(func) {\n return function (value) {\n return func(value);\n };\n}\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar objectToString = objectProto.toString;\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\nfunction isLength(value) {\n return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER;\n}\n\nfunction isObjectLike(value) {\n return !!value && _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value) === 'object';\n}\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n\n\nvar isTypedArray = baseIsTypedArray;\n//# sourceMappingURL=is-typedarray.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/utils/is-typedarray.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./item */ \"./node_modules/@antv/g6-core/es/item/item.js\");\n\n\n\nvar END_MAP = {\n source: 'start',\n target: 'end'\n};\nvar ITEM_NAME_SUFFIX = 'Node'; // 端点的后缀,如 sourceNode, targetNode\nvar POINT_NAME_SUFFIX = 'Point'; // 起点或者结束点的后缀,如 startPoint, endPoint\nvar ANCHOR_NAME_SUFFIX = 'Anchor';\nvar Edge = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Edge, _super);\n function Edge() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Edge.prototype.getDefaultCfg = function () {\n return {\n type: 'edge',\n sourceNode: null,\n targetNode: null,\n startPoint: null,\n endPoint: null,\n linkCenter: false\n };\n };\n Edge.prototype.setEnd = function (name, value) {\n var pointName = END_MAP[name] + POINT_NAME_SUFFIX;\n var itemName = name + ITEM_NAME_SUFFIX;\n var preItem = this.get(itemName);\n if (preItem && !preItem.destroyed) {\n // 如果之前存在节点,则移除掉边\n preItem.removeEdge(this);\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(value)) {\n // 如果设置成具体的点,则清理节点\n this.set(pointName, value);\n this.set(itemName, null);\n } else if (value) {\n value.addEdge(this);\n this.set(itemName, value);\n this.set(pointName, null);\n }\n };\n /**\n * 获取连接点的坐标\n * @param name source | target\n * @param model 边的数据模型\n * @param controlPoints 控制点\n */\n Edge.prototype.getLinkPoint = function (name, model, controlPoints) {\n var pointName = END_MAP[name] + POINT_NAME_SUFFIX;\n var itemName = name + ITEM_NAME_SUFFIX;\n var point = this.get(pointName);\n if (!point) {\n var item = this.get(itemName);\n var anchorName = name + ANCHOR_NAME_SUFFIX;\n var prePoint = this.getPrePoint(name, controlPoints);\n var anchorIndex = model[anchorName];\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(anchorIndex)) {\n // 如果有锚点,则使用锚点索引获取连接点\n point = item.getLinkPointByAnchor(anchorIndex);\n }\n // 如果锚点没有对应的点或者没有锚点,则直接计算连接点\n point = point || item.getLinkPoint(prePoint);\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(point.index)) {\n this.set(\"\".concat(name, \"AnchorIndex\"), point.index);\n }\n }\n return point;\n };\n /**\n * 获取同端点进行连接的点,计算交汇点\n * @param name\n * @param controlPoints\n */\n Edge.prototype.getPrePoint = function (name, controlPoints) {\n if (controlPoints && controlPoints.length) {\n var index = name === 'source' ? 0 : controlPoints.length - 1;\n return controlPoints[index];\n }\n var oppositeName = name === 'source' ? 'target' : 'source'; // 取另一个节点的位置\n return this.getEndPoint(oppositeName);\n };\n /**\n * 获取端点的位置\n * @param name\n */\n Edge.prototype.getEndPoint = function (name) {\n var itemName = name + ITEM_NAME_SUFFIX;\n var pointName = END_MAP[name] + POINT_NAME_SUFFIX;\n var item = this.get(itemName);\n // 如果有端点,直接使用 model\n if (item && !item.destroyed) {\n return item.get('model');\n } // 否则直接使用点\n return this.get(pointName);\n };\n /**\n * 通过端点的中心获取控制点\n * @param model\n */\n Edge.prototype.getControlPointsByCenter = function (model) {\n var sourcePoint = this.getEndPoint('source');\n var targetPoint = this.getEndPoint('target');\n var shapeFactory = this.get('shapeFactory');\n var type = model.type;\n return shapeFactory.getControlPoints(type, {\n startPoint: sourcePoint,\n endPoint: targetPoint\n });\n };\n Edge.prototype.getEndCenter = function (name) {\n var itemName = name + ITEM_NAME_SUFFIX;\n var pointName = END_MAP[name] + POINT_NAME_SUFFIX;\n var item = this.get(itemName);\n // 如果有端点,直接使用 model\n if (item) {\n var bbox = item.getBBox();\n return {\n x: bbox.centerX,\n y: bbox.centerY\n };\n } // 否则直接使用点\n return this.get(pointName);\n };\n Edge.prototype.init = function () {\n _super.prototype.init.call(this);\n // 初始化两个端点\n this.setSource(this.get('source'));\n this.setTarget(this.get('target'));\n };\n Edge.prototype.getShapeCfg = function (model, updateType) {\n var self = this;\n var linkCenter = self.get('linkCenter'); // 如果连接到中心,忽视锚点、忽视控制点\n var cfg = (updateType === null || updateType === void 0 ? void 0 : updateType.includes('move')) ? model : _super.prototype.getShapeCfg.call(this, model);\n if (linkCenter) {\n cfg.startPoint = self.getEndCenter('source');\n cfg.endPoint = self.getEndCenter('target');\n } else {\n var controlPoints = cfg.controlPoints || self.getControlPointsByCenter(cfg);\n cfg.startPoint = self.getLinkPoint('source', model, controlPoints);\n cfg.endPoint = self.getLinkPoint('target', model, controlPoints);\n }\n cfg.sourceNode = self.get('sourceNode');\n cfg.targetNode = self.get('targetNode');\n return cfg;\n };\n /**\n * 获取边的数据模型\n */\n Edge.prototype.getModel = function () {\n var out = this.get('model');\n var sourceItem = this.get(\"source\".concat(ITEM_NAME_SUFFIX));\n var targetItem = this.get(\"target\".concat(ITEM_NAME_SUFFIX));\n if (sourceItem) {\n delete out[\"source\".concat(ITEM_NAME_SUFFIX)];\n } else {\n out.source = this.get(\"start\".concat(POINT_NAME_SUFFIX));\n }\n if (targetItem) {\n delete out[\"target\".concat(ITEM_NAME_SUFFIX)];\n } else {\n out.target = this.get(\"end\".concat(POINT_NAME_SUFFIX));\n }\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(out.source) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(out.source)) {\n out.source = out.source.getID();\n }\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(out.target) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(out.target)) {\n out.target = out.target.getID();\n }\n return out;\n };\n Edge.prototype.setSource = function (source) {\n this.setEnd('source', source);\n this.set('source', source);\n };\n Edge.prototype.setTarget = function (target) {\n this.setEnd('target', target);\n this.set('target', target);\n };\n Edge.prototype.getSource = function () {\n return this.get('source');\n };\n Edge.prototype.getTarget = function () {\n return this.get('target');\n };\n Edge.prototype.updatePosition = function () {\n return false;\n };\n /**\n * 边不需要重计算容器位置,直接重新计算 path 位置\n * @param {object} cfg 待更新数据\n */\n Edge.prototype.update = function (cfg, updateType) {\n if (updateType === void 0) {\n updateType = undefined;\n }\n var model = this.get('model');\n var oriVisible = model.visible;\n var cfgVisible = cfg.visible;\n if (oriVisible !== cfgVisible && cfgVisible !== undefined) this.changeVisibility(cfgVisible);\n var sourceItem = this.get('source');\n var targetItem = this.get('target');\n if (!sourceItem || sourceItem.destroyed || !targetItem || targetItem.destroyed) return;\n var styles = this.get('styles');\n if (cfg.stateStyles) {\n // 更新 item 时更新 this.get('styles') 中的值\n var stateStyles = cfg.stateStyles;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(styles, stateStyles);\n delete cfg.stateStyles;\n }\n Object.assign(model, cfg);\n this.updateShape(updateType);\n this.afterUpdate();\n this.clearCache();\n };\n Edge.prototype.destroy = function () {\n var sourceItem = this.get(\"source\".concat(ITEM_NAME_SUFFIX));\n var targetItem = this.get(\"target\".concat(ITEM_NAME_SUFFIX));\n if (sourceItem && !sourceItem.destroyed) {\n sourceItem.removeEdge(this);\n }\n if (targetItem && !targetItem.destroyed) {\n targetItem.removeEdge(this);\n }\n _super.prototype.destroy.call(this);\n };\n return Edge;\n}(_item__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Edge);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/edge.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/utils/isSafari.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/utils/isSafari.js ***! - \***************************************************************/ -/*! exports provided: isSafari */ +/***/ "./node_modules/@antv/g6-core/es/item/hull.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/item/hull.js ***! + \****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSafari\", function() { return isSafari; });\nvar isSafari = typeof navigator !== 'undefined' && /Version\\/[\\d\\.]+.*Safari/.test(navigator.userAgent);\n//# sourceMappingURL=isSafari.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/utils/isSafari.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_path_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/path-util */ \"./node_modules/@antv/path-util/esm/index.js\");\n/* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/path */ \"./node_modules/@antv/g6-core/es/util/path.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _element_hull_convexHull__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../element/hull/convexHull */ \"./node_modules/@antv/g6-core/es/element/hull/convexHull.js\");\n/* harmony import */ var _element_hull_bubbleset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../element/hull/bubbleset */ \"./node_modules/@antv/g6-core/es/element/hull/bubbleset.js\");\n\n\n\n\n\n\n\n/**\n * 用于包裹内部的成员的轮廓。\n * convex hull(凸包):http://geomalgorithms.com/a10-_hull-1.html#Monotone%20Chain\n * bubble: 使用 bubbleset算法,refer: http://vialab.science.uoit.ca/wp-content/papercite-data/pdf/col2009c.pdf\n * 通过配置 padding 可以调节包裹轮廓对节点的松紧程度\n */\nvar Hull = /** @class */function () {\n function Hull(graph, cfg) {\n this.cfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])(this.getDefaultCfg(), cfg);\n this.graph = graph;\n this.id = this.cfg.id;\n this.group = this.cfg.group;\n this.members = this.cfg.members.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? graph.findById(item) : item;\n });\n this.nonMembers = this.cfg.nonMembers.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? graph.findById(item) : item;\n });\n this.setPadding();\n this.setType();\n this.path = this.calcPath(this.members, this.nonMembers);\n this.render();\n }\n Hull.prototype.getDefaultCfg = function () {\n return {\n id: 'g6-hull',\n type: 'round-convex',\n members: [],\n nonMembers: [],\n style: {\n fill: 'lightblue',\n stroke: 'blue',\n opacity: 0.2\n },\n padding: 10\n };\n };\n Hull.prototype.setPadding = function () {\n var nodeSize = this.members.length && this.members[0].getKeyShape().getCanvasBBox().width / 2;\n this.padding = this.cfg.padding > 0 ? this.cfg.padding + nodeSize : 10 + nodeSize;\n this.cfg.bubbleCfg = {\n nodeR0: this.padding - nodeSize,\n nodeR1: this.padding - nodeSize,\n morphBuffer: this.padding - nodeSize\n };\n };\n Hull.prototype.setType = function () {\n this.type = this.cfg.type;\n if (this.members.length < 3) {\n this.type = 'round-convex';\n }\n if (this.type !== 'round-convex' && this.type !== 'smooth-convex' && this.type !== 'bubble') {\n console.warn('The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default.');\n this.type = 'round-convex';\n }\n };\n Hull.prototype.calcPath = function (members, nonMembers) {\n var contour, path, hull;\n switch (this.type) {\n case 'round-convex':\n contour = Object(_element_hull_convexHull__WEBPACK_IMPORTED_MODULE_5__[\"genConvexHull\"])(members);\n hull = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"roundedHull\"])(contour.map(function (p) {\n return [p.x, p.y];\n }), this.padding);\n path = Object(_antv_path_util__WEBPACK_IMPORTED_MODULE_2__[\"parsePathString\"])(hull);\n break;\n case 'smooth-convex':\n contour = Object(_element_hull_convexHull__WEBPACK_IMPORTED_MODULE_5__[\"genConvexHull\"])(members);\n if (contour.length === 2) {\n hull = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"roundedHull\"])(contour.map(function (p) {\n return [p.x, p.y];\n }), this.padding);\n path = Object(_antv_path_util__WEBPACK_IMPORTED_MODULE_2__[\"parsePathString\"])(hull);\n } else if (contour.length > 2) {\n hull = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"paddedHull\"])(contour.map(function (p) {\n return [p.x, p.y];\n }), this.padding);\n path = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"getClosedSpline\"])(hull);\n }\n break;\n case 'bubble':\n contour = Object(_element_hull_bubbleset__WEBPACK_IMPORTED_MODULE_6__[\"genBubbleSet\"])(members, nonMembers, this.cfg.bubbleCfg);\n path = contour.length >= 2 && Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"getClosedSpline\"])(contour);\n break;\n default:\n }\n return path;\n };\n Hull.prototype.render = function () {\n this.group.addShape('path', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: this.path\n }, this.cfg.style),\n id: this.id,\n name: this.cfg.id,\n capture: false\n });\n this.group.toBack();\n };\n /**\n * 增加hull的成员,同时如果该成员原先在nonMembers中,则从nonMembers中去掉\n * @param item 节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n Hull.prototype.addMember = function (item) {\n if (!item) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) item = this.graph.findById(item);\n this.members.push(item);\n var index = this.nonMembers.indexOf(item);\n if (index > -1) {\n this.nonMembers.splice(index, 1);\n }\n this.updateData(this.members, this.nonMembers);\n return true;\n };\n /**\n * 增加hull需要排除的节点,同时如果该成员原先在members中,则从members中去掉\n * @param item 节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n Hull.prototype.addNonMember = function (item) {\n if (!item) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) item = this.graph.findById(item);\n this.nonMembers.push(item);\n var index = this.members.indexOf(item);\n if (index > -1) {\n this.members.splice(index, 1);\n }\n this.updateData(this.members, this.nonMembers);\n return true;\n };\n /**\n * 移除hull中的成员\n * @param node 节点实例\n * @return boolean 移除成功返回 true,否则返回 false\n */\n Hull.prototype.removeMember = function (item) {\n if (!item) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) item = this.graph.findById(item);\n var index = this.members.indexOf(item);\n if (index > -1) {\n this.members.splice(index, 1);\n this.updateData(this.members, this.nonMembers);\n return true;\n }\n return false;\n };\n /**\n * @param node 节点实例\n * @return boolean 移除成功返回 true,否则返回 false\n */\n Hull.prototype.removeNonMember = function (item) {\n if (!item) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) item = this.graph.findById(item);\n var index = this.nonMembers.indexOf(item);\n if (index > -1) {\n this.nonMembers.splice(index, 1);\n this.updateData(this.members, this.nonMembers);\n return true;\n }\n return false;\n };\n Hull.prototype.updateData = function (members, nonMembers) {\n var _this = this;\n this.group.findById(this.id).remove();\n if (members) this.members = members.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? _this.graph.findById(item) : item;\n });\n if (nonMembers) this.nonMembers = nonMembers.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? _this.graph.findById(item) : item;\n });\n this.path = this.calcPath(this.members, this.nonMembers);\n this.render();\n };\n Hull.prototype.updateStyle = function (cfg) {\n var path = this.group.findById(this.id);\n path.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, cfg));\n };\n /**\n * 更新 hull\n * @param cfg hull 配置项\n */\n Hull.prototype.updateCfg = function (cfg) {\n var _this = this;\n this.cfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])(this.cfg, cfg);\n this.id = this.cfg.id;\n this.group = this.cfg.group;\n if (cfg.members) {\n this.members = this.cfg.members.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? _this.graph.findById(item) : item;\n });\n }\n if (cfg.nonMembers) {\n this.nonMembers = this.cfg.nonMembers.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? _this.graph.findById(item) : item;\n });\n }\n // TODO padding 设置太大,会影响到 contain 结果\n this.setPadding();\n this.setType();\n this.path = this.calcPath(this.members, this.nonMembers);\n this.render();\n };\n /**\n * 判断是否在hull内部\n * @param item\n */\n Hull.prototype.contain = function (item) {\n var _this = this;\n var nodeItem;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n nodeItem = this.graph.findById(item);\n } else {\n nodeItem = item;\n }\n var shapePoints;\n var shape = nodeItem.getKeyShape();\n if (nodeItem.get('type') === 'path') {\n shapePoints = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"pathToPoints\"])(shape.attr('path'));\n } else {\n var shapeBBox = shape.getCanvasBBox();\n shapePoints = [[shapeBBox.minX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.maxY], [shapeBBox.minX, shapeBBox.maxY]];\n }\n shapePoints = shapePoints.map(function (canvasPoint) {\n var point = _this.graph.getPointByCanvas(canvasPoint[0], canvasPoint[1]);\n return [point.x, point.y];\n });\n return Object(_util_math__WEBPACK_IMPORTED_MODULE_4__[\"isPolygonsIntersect\"])(shapePoints, Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"pathToPoints\"])(this.path));\n };\n Hull.prototype.destroy = function () {\n this.group.remove();\n this.cfg = null;\n };\n return Hull;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Hull);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/hull.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/utils/math.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/utils/math.js ***! - \***********************************************************/ -/*! exports provided: getAngle, createVec3, getRotationScale, decodePickingColor, encodePickingColor */ +/***/ "./node_modules/@antv/g6-core/es/item/item.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/item/item.js ***! + \****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAngle\", function() { return getAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createVec3\", function() { return createVec3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRotationScale\", function() { return getRotationScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decodePickingColor\", function() { return decodePickingColor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encodePickingColor\", function() { return encodePickingColor; });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/g-webgpu-core/es/utils/is-number.js\");\n\n\n\nfunction getAngle(angle) {\n if (angle === undefined) {\n return 0;\n } else if (angle > 360 || angle < -360) {\n return angle % 360;\n }\n\n return angle;\n}\nfunction createVec3(x, y, z) {\n if (Object(_is_number__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(x)) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].fromValues(x, y, z);\n }\n\n if (x.length === 3) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].clone(x);\n } // @ts-ignore\n\n\n return gl_matrix__WEBPACK_IMPORTED_MODULE_1__[\"vec3\"].fromValues(x[0], x[1], x[2]);\n}\nfunction getRotationScale(matrix, result) {\n result[0] = matrix[0];\n result[1] = matrix[1];\n result[2] = matrix[2];\n result[3] = matrix[4];\n result[4] = matrix[5];\n result[5] = matrix[6];\n result[6] = matrix[8];\n result[7] = matrix[9];\n result[8] = matrix[10];\n return result;\n}\nfunction decodePickingColor(color) {\n var _color = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(color, 3),\n i1 = _color[0],\n i2 = _color[1],\n i3 = _color[2]; // 1 was added to seperate from no selection\n\n\n var index = i1 + i2 * 256 + i3 * 65536 - 1;\n return index;\n}\nfunction encodePickingColor(featureIdx) {\n return [featureIdx + 1 & 255, featureIdx + 1 >> 8 & 255, featureIdx + 1 >> 8 >> 8 & 255];\n}\n//# sourceMappingURL=math.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/utils/math.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _element_shape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../element/shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _util_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n\n\n\n\n\n\nvar CACHE_BBOX = 'bboxCache';\nvar CACHE_CANVAS_BBOX = 'bboxCanvasCache';\nvar ARROWS = ['startArrow', 'endArrow'];\nvar ItemBase = /** @class */function () {\n function ItemBase(cfg) {\n this._cfg = {};\n this.destroyed = false;\n // 是否开启优化,由 graph 根据当前图上节点数量来控制\n this.optimize = false;\n var defaultCfg = {\n /**\n * id\n * @type {string}\n */\n id: undefined,\n /**\n * 类型\n * @type {string}\n */\n type: 'item',\n /**\n * data model\n * @type {object}\n */\n model: {},\n /**\n * g group\n * @type {G.Group}\n */\n group: undefined,\n /**\n * is open animate\n * @type {boolean}\n */\n animate: false,\n /**\n * visible - not group visible\n * @type {boolean}\n */\n visible: true,\n /**\n * locked - lock node\n * @type {boolean}\n */\n locked: false,\n /**\n * capture event\n * @type {boolean}\n */\n event: true,\n /**\n * key shape to calculate item's bbox\n * @type object\n */\n keyShape: undefined,\n /**\n * item's states, such as selected or active\n * @type Array\n */\n states: []\n };\n this._cfg = Object.assign(defaultCfg, this.getDefaultCfg(), cfg);\n var model = this.get('model');\n var id = model.id;\n var itemType = this.get('type');\n if (typeof id === 'undefined') {\n id = Object(_util_base__WEBPACK_IMPORTED_MODULE_5__[\"uniqueId\"])(itemType);\n } else if (typeof id !== 'string') {\n id = String(id);\n }\n this.get('model').id = id;\n this.set('id', id);\n var group = cfg.group;\n if (group) {\n group.set('item', this);\n group.set('id', id);\n }\n this.init();\n this.draw();\n var shapeType = model.shape || model.type || (itemType === 'edge' ? 'line' : 'circle');\n var shapeFactory = this.get('shapeFactory');\n if (shapeFactory && shapeFactory[shapeType]) {\n var options = shapeFactory[shapeType].options;\n // merge the stateStyles from item and shape\n if (options && options.stateStyles) {\n var styles = this.get('styles') || model.stateStyles;\n styles = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, options.stateStyles, styles);\n this.set('styles', styles);\n }\n }\n }\n /**\n * 根据 keyshape 计算包围盒\n */\n ItemBase.prototype.calculateBBox = function () {\n var keyShape = this.get('keyShape');\n var group = this.get('group');\n // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n var bbox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_3__[\"getBBox\"])(keyShape, group);\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n return bbox;\n };\n /**\n * 根据 keyshape 计算包围盒\n */\n ItemBase.prototype.calculateCanvasBBox = function () {\n var keyShape = this.get('keyShape');\n var group = this.get('group');\n // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n var bbox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_3__[\"getBBox\"])(keyShape, group);\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n return bbox;\n };\n /**\n * draw shape\n */\n ItemBase.prototype.drawInner = function () {\n var self = this;\n var shapeFactory = self.get('shapeFactory');\n var group = self.get('group');\n var model = self.get('model');\n group.clear();\n var visible = model.visible;\n if (visible !== undefined && !visible) self.changeVisibility(visible);\n if (!shapeFactory) {\n return;\n }\n self.updatePosition(model);\n var cfg = self.getShapeCfg(model); // 可能会附加额外信息\n var shapeType = cfg.type;\n var keyShape = shapeFactory.draw(shapeType, cfg, group);\n if (keyShape) {\n self.set('keyShape', keyShape);\n keyShape.set('isKeyShape', true);\n keyShape.set('draggable', true);\n }\n this.setOriginStyle();\n // 防止由于用户外部修改 model 中的 shape 导致 shape 不更新\n this.set('currentShape', shapeType);\n this.restoreStates(shapeFactory, shapeType);\n };\n /**\n * 设置图元素原始样式\n * @param keyShape 图元素 keyShape\n * @param group Group 容器\n */\n ItemBase.prototype.setOriginStyle = function () {\n var group = this.get('group');\n var children = group.get('children');\n var keyShape = this.getKeyShape();\n var self = this;\n var keyShapeName = keyShape.get('name');\n if (!this.get('originStyle')) {\n // 第一次 set originStyle,直接拿首次渲染所有图形的 attrs\n var originStyles = {};\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var shapeType = child.get('type');\n var name_1 = child.get('name');\n if (name_1 && name_1 !== keyShapeName) {\n originStyles[name_1] = shapeType !== 'image' ? Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(child.attr()) : self.getShapeStyleByName(name_1);\n // The text's position and matrix is not allowed to be affected by states\n if (shapeType === 'text' && originStyles[name_1]) {\n delete originStyles[name_1].x;\n delete originStyles[name_1].y;\n delete originStyles[name_1].matrix;\n }\n } else {\n var keyShapeStyle = self.getShapeStyleByName(); // 可优化,需要去除 child.attr 中其他 shape 名的对象\n delete keyShapeStyle.path;\n delete keyShapeStyle.matrix;\n if (!keyShapeName) {\n Object.assign(originStyles, keyShapeStyle);\n } else {\n // 若 keyShape 有 name 且 !name,这个图形不是 keyShape,给这个图形一个 name\n if (!name_1) {\n var shapeName = Object(_util_base__WEBPACK_IMPORTED_MODULE_5__[\"uniqueId\"])('shape');\n child.set('name', shapeName);\n group['shapeMap'][shapeName] = child;\n originStyles[shapeName] = shapeType !== 'image' ? Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(child.attr()) : self.getShapeStyleByName(name_1);\n } else {\n originStyles[keyShapeName] = keyShapeStyle;\n }\n }\n }\n }\n self.set('originStyle', originStyles);\n } else {\n // 第二次 set originStyles,需要找到不是 stateStyles 的样式,更新到 originStyles 中\n // 上一次设置的 originStyle,是初始的 shape attrs\n var styles_1 = this.get('originStyle');\n // let styles: ShapeStyle = {};\n if (keyShapeName && !styles_1[keyShapeName]) styles_1[keyShapeName] = {};\n // 获取当前状态样式\n var currentStatesStyle_1 = this.getCurrentStatesStyle();\n var _loop_1 = function _loop_1(i) {\n var child = children[i];\n var name_2 = child.get('name');\n var shapeAttrs = child.attr();\n if (name_2 && name_2 !== keyShapeName) {\n // 有 name 的非 keyShape 图形\n var shapeStateStyle_1 = currentStatesStyle_1[name_2];\n if (!styles_1[name_2]) styles_1[name_2] = {};\n if (shapeStateStyle_1) {\n Object.keys(shapeAttrs).forEach(function (key) {\n var value = shapeAttrs[key];\n if (value !== shapeStateStyle_1[key]) styles_1[name_2][key] = value;\n });\n } else {\n styles_1[name_2] = child.get('type') !== 'image' ? Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(shapeAttrs) : self.getShapeStyleByName(name_2);\n }\n } else {\n var shapeAttrs_1 = child.attr();\n var keyShapeStateStyles_1 = {};\n Object.keys(currentStatesStyle_1).forEach(function (styleKey) {\n var subStyle = currentStatesStyle_1[styleKey];\n if (styleKey === keyShapeName || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(subStyle)) {\n keyShapeStateStyles_1[styleKey] = subStyle;\n }\n });\n Object.keys(shapeAttrs_1).forEach(function (key) {\n var value = shapeAttrs_1[key];\n // 如果是对象且不是 arrow,则是其他 shape 的样式\n // if (isPlainObject(value) && ARROWS.indexOf(name) === -1) return;\n if (keyShapeStateStyles_1[key] !== value) {\n if (keyShapeName) styles_1[keyShapeName][key] = value;else styles_1[key] = value;\n }\n });\n }\n };\n // 遍历当前所有图形的 attrs,找到不是 stateStyles 的样式更新到 originStyles 中\n for (var i = 0; i < children.length; i++) {\n _loop_1(i);\n }\n delete styles_1.path;\n delete styles_1.matrix;\n delete styles_1.x;\n delete styles_1.y;\n if (styles_1[keyShapeName]) {\n delete styles_1[keyShapeName].x;\n delete styles_1[keyShapeName].y;\n delete styles_1[keyShapeName].matrix;\n delete styles_1[keyShapeName].path;\n }\n self.set('originStyle', styles_1);\n }\n };\n /**\n * restore shape states\n * @param shapeFactory\n * @param shapeType\n */\n ItemBase.prototype.restoreStates = function (shapeFactory, shapeType) {\n var self = this;\n var states = self.get('states');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(states, function (state) {\n shapeFactory.setState(shapeType, state, true, self);\n });\n };\n ItemBase.prototype.init = function () {\n var shapeFactory = _element_shape__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getFactory(this.get('type'));\n this.set('shapeFactory', shapeFactory);\n };\n /**\n * 获取属性\n * @internal 仅内部类使用\n * @param {String} key 属性名\n * @return {object | string | number} 属性值\n */\n ItemBase.prototype.get = function (key) {\n return this._cfg[key];\n };\n /**\n * 设置属性\n * @internal 仅内部类使用\n * @param {String|Object} key 属性名,也可以是对象\n * @param {object | string | number} val 属性值\n */\n ItemBase.prototype.set = function (key, val) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(key)) {\n this._cfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, this._cfg), key);\n } else {\n this._cfg[key] = val;\n }\n };\n ItemBase.prototype.getDefaultCfg = function () {\n return {};\n };\n /**\n * 更新/刷新等操作后,清除 cache\n */\n ItemBase.prototype.clearCache = function () {\n this.set(CACHE_BBOX, null);\n this.set(CACHE_CANVAS_BBOX, null);\n };\n /**\n * 渲染前的逻辑,提供给子类复写\n */\n ItemBase.prototype.beforeDraw = function () {};\n /**\n * 渲染后的逻辑,提供给子类复写\n */\n ItemBase.prototype.afterDraw = function () {};\n /**\n * 更新后做一些工作\n */\n ItemBase.prototype.afterUpdate = function () {};\n /**\n * draw shape\n */\n ItemBase.prototype.draw = function () {\n this.beforeDraw();\n this.drawInner();\n this.afterDraw();\n };\n ItemBase.prototype.getShapeStyleByName = function (name) {\n var group = this.get('group');\n var currentShape;\n if (name) {\n currentShape = group['shapeMap'][name] || group.find(function (element) {\n return element.get('name') === name;\n });\n } else {\n currentShape = this.getKeyShape();\n }\n if (currentShape) {\n var styles_2 = {};\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(currentShape.attr(), function (val, key) {\n // 修改 img 通过 updateItem 实现\n if (key !== 'img' || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(val)) {\n styles_2[key] = val;\n }\n });\n return styles_2;\n }\n return {};\n };\n ItemBase.prototype.getShapeCfg = function (model, updateType) {\n var styles = this.get('styles');\n if (styles) {\n // merge graph的item样式与数据模型中的样式\n var newModel = model;\n newModel.style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), model.style);\n return newModel;\n }\n return model;\n };\n /**\n * 获取指定状态的样式,去除了全局样式\n * @param state 状态名称\n */\n ItemBase.prototype.getStateStyle = function (state) {\n var styles = this.get('styles');\n var stateStyle = styles && styles[state];\n return stateStyle;\n };\n /**\n * get keyshape style\n */\n ItemBase.prototype.getOriginStyle = function () {\n return this.get('originStyle');\n };\n ItemBase.prototype.getCurrentStatesStyle = function () {\n var self = this;\n var styles = {};\n var states = self.getStates();\n if (!states || !states.length) {\n return this.get('originStyle');\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(self.getStates(), function (state) {\n styles = Object.assign(styles, self.getStateStyle(state));\n });\n return styles;\n };\n /**\n * 更改元素状态, visible 不属于这个范畴\n * @internal 仅提供内部类 graph 使用\n * @param {String} state 状态名\n * @param {Boolean} value 节点状态值\n */\n ItemBase.prototype.setState = function (state, value) {\n var states = this.get('states');\n var shapeFactory = this.get('shapeFactory');\n var stateName = state;\n var filterStateName = state;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(value)) {\n stateName = \"\".concat(state, \":\").concat(value);\n filterStateName = \"\".concat(state, \":\");\n }\n var newStates = states;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isBoolean\"])(value)) {\n var index = states.indexOf(filterStateName);\n if (value) {\n if (index > -1) {\n return;\n }\n states.push(stateName);\n } else if (index > -1) {\n states.splice(index, 1);\n }\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(value)) {\n // 过滤掉 states 中 filterStateName 相关的状态\n var filterStates = states.filter(function (name) {\n return name.includes(filterStateName);\n });\n if (filterStates.length > 0) {\n this.clearStates(filterStates);\n }\n newStates = newStates.filter(function (name) {\n return !name.includes(filterStateName);\n });\n newStates.push(stateName);\n this.set('states', newStates);\n }\n if (shapeFactory) {\n var model = this.get('model');\n var type = model.type;\n // 调用 shape/shape.ts 中的 setState\n shapeFactory.setState(type, state, value, this);\n }\n };\n /**\n * 清除指定的状态,如果参数为空,则不做任务处理\n * @param states 状态名称\n */\n ItemBase.prototype.clearStates = function (states) {\n var self = this;\n var originStates = self.getStates();\n var shapeFactory = self.get('shapeFactory');\n var model = self.get('model');\n var shape = model.type;\n if (!states) {\n states = originStates;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(states)) {\n states = [states];\n }\n var newStates = originStates.filter(function (state) {\n return states.indexOf(state) === -1;\n });\n self.set('states', newStates);\n states.forEach(function (state) {\n shapeFactory.setState(shape, state, false, self);\n });\n };\n /**\n * 设置是否开启性能优化模式\n * 目前影响:节点的状态样式更新是否影响相关边的更新\n * @param {Boolean} enableOptimize 是否开启\n */\n ItemBase.prototype.setOptimize = function (enableOptimize) {\n this.optimize = enableOptimize;\n };\n /**\n * 节点的图形容器\n * @return {G.Group} 图形容器\n */\n ItemBase.prototype.getContainer = function () {\n return this.get('group');\n };\n /**\n * 节点的关键形状,用于计算节点大小,连线截距等\n * @return {IShapeBase} 关键形状\n */\n ItemBase.prototype.getKeyShape = function () {\n return this.get('keyShape');\n };\n /**\n * 节点数据模型\n * @return {Object} 数据模型\n */\n ItemBase.prototype.getModel = function () {\n return this.get('model');\n };\n /**\n * 节点类型\n * @return {string} 节点的类型\n */\n ItemBase.prototype.getType = function () {\n return this.get('type');\n };\n /**\n * 获取 Item 的ID\n */\n ItemBase.prototype.getID = function () {\n return this.get('id');\n };\n /**\n * 是否是 Item 对象,悬空边情况下进行判定\n */\n ItemBase.prototype.isItem = function () {\n return true;\n };\n /**\n * 获取当前元素的所有状态\n * @return {Array} 元素的所有状态\n */\n ItemBase.prototype.getStates = function () {\n return this.get('states');\n };\n /**\n * 当前元素是否处于某状态\n * @param {String} state 状态名\n * @return {Boolean} 是否处于某状态\n */\n ItemBase.prototype.hasState = function (state) {\n var states = this.getStates();\n return states.indexOf(state) >= 0;\n };\n /**\n * 刷新一般用于处理几种情况\n * 1. item model 在外部被改变\n * 2. 边的节点位置发生改变,需要重新计算边\n *\n * 因为数据从外部被修改无法判断一些属性是否被修改,直接走位置和 shape 的更新\n */\n ItemBase.prototype.refresh = function (updateType) {\n var model = this.get('model');\n // 更新元素位置\n this.updatePosition(model);\n // 更新元素内容,样式\n this.updateShape(updateType);\n // 做一些更新之后的操作\n this.afterUpdate();\n // 清除缓存\n this.clearCache();\n };\n ItemBase.prototype.getUpdateType = function (cfg) {\n return undefined;\n };\n /**\n * 将更新应用到 model 上,刷新属性\n * @internal 仅提供给 Graph 使用,外部直接调用 graph.update 接口\n * @param {Object} cfg 配置项,可以是增量信息\n */\n ItemBase.prototype.update = function (cfg, updateType) {\n if (updateType === void 0) {\n updateType = undefined;\n }\n var model = this.get('model');\n // 仅仅移动位置时,既不更新,也不重绘\n if (updateType === 'move') {\n this.updatePosition(cfg);\n } else {\n var oriVisible = model.visible;\n var cfgVisible = cfg.visible;\n if (oriVisible !== cfgVisible && cfgVisible !== undefined) this.changeVisibility(cfgVisible);\n var originPosition = {\n x: model.x,\n y: model.y\n };\n cfg.x = isNaN(+cfg.x) ? model.x : +cfg.x;\n cfg.y = isNaN(+cfg.y) ? model.y : +cfg.y;\n var styles = this.get('styles');\n if (cfg.stateStyles) {\n // 更新 item 时更新 this.get('styles') 中的值\n var stateStyles = cfg.stateStyles;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(styles, stateStyles);\n delete cfg.stateStyles;\n }\n // 直接将更新合到原数据模型上,可以保证用户在外部修改源数据然后刷新时的样式符合期待。\n Object.assign(model, cfg);\n // 如果 x,y 有变化,先重置位置\n if (originPosition.x !== cfg.x || originPosition.y !== cfg.y) {\n this.updatePosition(cfg);\n }\n this.updateShape(updateType);\n }\n this.afterUpdate();\n this.clearCache();\n };\n /**\n * 更新元素内容,样式\n */\n ItemBase.prototype.updateShape = function (updateType) {\n var shapeFactory = this.get('shapeFactory');\n var model = this.get('model');\n var shape = model.type;\n // 判定是否允许更新\n // 1. 注册的节点允许更新(即有继承的/复写的 update 方法,即 update 方法没有被复写为 undefined)\n // 2. 更新后的 shape 等于原先的 shape\n if (shapeFactory.shouldUpdate(shape) && shape === this.get('currentShape')) {\n var updateCfg = this.getShapeCfg(model, updateType);\n shapeFactory.baseUpdate(shape, updateCfg, this, updateType);\n // 更新完以后重新设置原始样式\n if (updateType !== 'move') this.setOriginStyle();\n } else {\n // 如果不满足上面两种状态,重新绘制\n this.draw();\n }\n // 更新后重置节点状态\n this.restoreStates(shapeFactory, shape);\n };\n /**\n * 更新位置,避免整体重绘\n * @param {object} cfg 待更新数据\n */\n ItemBase.prototype.updatePosition = function (cfg) {\n var model = this.get('model');\n var x = isNaN(+cfg.x) ? +model.x : +cfg.x;\n var y = isNaN(+cfg.y) ? +model.y : +cfg.y;\n var group = this.get('group');\n if (isNaN(x) || isNaN(y)) {\n return false;\n }\n model.x = x;\n model.y = y;\n var matrix = group.getMatrix();\n if (matrix && matrix[6] === x && matrix[7] === y) return false;\n group.resetMatrix();\n // G 4.0 element 中移除了矩阵相关方法,详见https://www.yuque.com/antv/blog/kxzk9g#4rMMV\n Object(_util_math__WEBPACK_IMPORTED_MODULE_4__[\"translate\"])(group, {\n x: x,\n y: y\n });\n this.clearCache(); // 位置更新后需要清除缓存\n return true;\n };\n /**\n * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n ItemBase.prototype.getBBox = function () {\n // 计算 bbox 开销有些大,缓存\n var bbox = this.get(CACHE_BBOX);\n if (!bbox) {\n bbox = this.calculateBBox();\n this.set(CACHE_BBOX, bbox);\n }\n return bbox;\n };\n /**\n * 获取 item 相对于画布的包围盒,会将从顶层到当前元素的 matrix 都计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n ItemBase.prototype.getCanvasBBox = function () {\n // 计算 bbox 开销大,缓存\n var bbox = this.get(CACHE_CANVAS_BBOX);\n if (!bbox) {\n bbox = this.calculateCanvasBBox();\n this.set(CACHE_CANVAS_BBOX, bbox);\n }\n return bbox;\n };\n /**\n * 将元素放到最前面\n */\n ItemBase.prototype.toFront = function () {\n var group = this.get('group');\n group.toFront();\n };\n /**\n * 将元素放到最后面\n */\n ItemBase.prototype.toBack = function () {\n var group = this.get('group');\n group.toBack();\n };\n /**\n * 显示元素\n */\n ItemBase.prototype.show = function () {\n this.changeVisibility(true);\n };\n /**\n * 隐藏元素\n */\n ItemBase.prototype.hide = function () {\n this.changeVisibility(false);\n };\n /**\n * 更改是否显示\n * @param {Boolean} visible 是否显示\n */\n ItemBase.prototype.changeVisibility = function (visible) {\n var group = this.get('group');\n if (visible) {\n group.show();\n } else {\n group.hide();\n }\n this.set('visible', visible);\n };\n /**\n * 元素是否可见\n * @return {Boolean} 返回该元素是否可见\n */\n ItemBase.prototype.isVisible = function () {\n return this.get('visible');\n };\n /**\n * 是否拾取及出发该元素的交互事件\n * @param {Boolean} enable 标识位\n */\n ItemBase.prototype.enableCapture = function (enable) {\n var group = this.get('group');\n if (group) {\n group.set('capture', enable);\n }\n };\n ItemBase.prototype.destroy = function () {\n if (!this.destroyed) {\n var animate = this.get('animate');\n var group = this.get('group');\n if (animate) {\n group.stopAnimate();\n }\n group['shapeMap'] = {};\n this.clearCache();\n group.remove();\n this._cfg = null;\n this.destroyed = true;\n }\n };\n return ItemBase;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (ItemBase);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/item.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/utils/shader-module.js": -/*!********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/utils/shader-module.js ***! - \********************************************************************/ -/*! exports provided: getUniformLengthByType, extractUniforms */ +/***/ "./node_modules/@antv/g6-core/es/item/node.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/item/node.js ***! + \****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getUniformLengthByType\", function() { return getUniformLengthByType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extractUniforms\", function() { return extractUniforms; });\nfunction getUniformLengthByType(type) {\n var arrayLength = 0;\n\n switch (type) {\n case 'vec2':\n case 'ivec2':\n arrayLength = 2;\n break;\n\n case 'vec3':\n case 'ivec3':\n arrayLength = 3;\n break;\n\n case 'vec4':\n case 'ivec4':\n case 'mat2':\n arrayLength = 4;\n break;\n\n case 'mat3':\n arrayLength = 9;\n break;\n\n case 'mat4':\n arrayLength = 16;\n break;\n\n default:\n }\n\n return arrayLength;\n}\nvar uniformRegExp = /uniform\\s+(bool|float|int|vec2|vec3|vec4|ivec2|ivec3|ivec4|mat2|mat3|mat4|sampler2D|samplerCube)\\s+([\\s\\S]*?);/g;\nfunction extractUniforms(content) {\n var uniforms = {};\n content = content.replace(uniformRegExp, function (_, type, c) {\n var defaultValues = c.split(':');\n var uniformName = defaultValues[0].trim();\n var defaultValue = '';\n\n if (defaultValues.length > 1) {\n defaultValue = defaultValues[1].trim();\n } // set default value for uniform according to its type\n // eg. vec2 u -> [0.0, 0.0]\n\n\n switch (type) {\n case 'bool':\n defaultValue = defaultValue === 'true';\n break;\n\n case 'float':\n case 'int':\n defaultValue = Number(defaultValue);\n break;\n\n case 'vec2':\n case 'vec3':\n case 'vec4':\n case 'ivec2':\n case 'ivec3':\n case 'ivec4':\n case 'mat2':\n case 'mat3':\n case 'mat4':\n if (defaultValue) {\n defaultValue = defaultValue.replace('[', '').replace(']', '').split(',').reduce(function (prev, cur) {\n prev.push(Number(cur.trim()));\n return prev;\n }, []);\n } else {\n defaultValue = new Array(getUniformLengthByType(type)).fill(0);\n }\n\n break;\n\n default:\n } // @ts-ignore\n\n\n uniforms[uniformName] = defaultValue;\n return \"uniform \".concat(type, \" \").concat(uniformName, \";\\n\");\n });\n return {\n content: content,\n uniforms: uniforms\n };\n}\n//# sourceMappingURL=shader-module.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/utils/shader-module.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./item */ \"./node_modules/@antv/g6-core/es/item/item.js\");\n\n\n\n\nvar CACHE_ANCHOR_POINTS = 'anchorPointsCache';\nvar CACHE_BBOX = 'bboxCache';\nvar Node = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Node, _super);\n function Node() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n Node.prototype.getNearestPoint = function (points, curPoint) {\n var index = 0;\n var nearestPoint = points[0];\n var minDistance = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"distance\"])(points[0], curPoint);\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n var dis = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"distance\"])(point, curPoint);\n if (dis < minDistance) {\n nearestPoint = point;\n minDistance = dis;\n index = i;\n }\n }\n nearestPoint.anchorIndex = index;\n return nearestPoint;\n };\n Node.prototype.getDefaultCfg = function () {\n return {\n type: 'node',\n edges: []\n };\n };\n /**\n * 获取从节点关联的所有边\n */\n Node.prototype.getEdges = function () {\n return this.get('edges');\n };\n /**\n * 获取所有的入边\n */\n Node.prototype.getInEdges = function () {\n var self = this;\n return this.get('edges').filter(function (edge) {\n return edge.get('target') === self;\n });\n };\n /**\n * 获取所有的出边\n */\n Node.prototype.getOutEdges = function () {\n var self = this;\n return this.get('edges').filter(function (edge) {\n return edge.get('source') === self;\n });\n };\n /**\n * 获取节点的邻居节点\n *\n * @returns {INode[]}\n * @memberof Node\n */\n Node.prototype.getNeighbors = function (type) {\n var _this = this;\n var edges = this.get('edges');\n if (type === 'target') {\n // 当前节点为 source,它所指向的目标节点\n var neighborsConverter_1 = function neighborsConverter_1(edge) {\n return edge.getSource() === _this;\n };\n return edges.filter(neighborsConverter_1).map(function (edge) {\n return edge.getTarget();\n });\n }\n if (type === 'source') {\n // 当前节点为 target,它所指向的源节点\n var neighborsConverter_2 = function neighborsConverter_2(edge) {\n return edge.getTarget() === _this;\n };\n return edges.filter(neighborsConverter_2).map(function (edge) {\n return edge.getSource();\n });\n }\n // 若未指定 type ,则返回所有邻居\n var neighborsConverter = function neighborsConverter(edge) {\n return edge.getSource() === _this ? edge.getTarget() : edge.getSource();\n };\n return edges.map(neighborsConverter);\n };\n /**\n * 根据锚点的索引获取连接点\n * @param {Number} index 索引\n */\n Node.prototype.getLinkPointByAnchor = function (index) {\n var anchorPoints = this.getAnchorPoints();\n return anchorPoints[index];\n };\n /**\n * 获取连接点\n * @param point\n */\n Node.prototype.getLinkPoint = function (point) {\n var keyShape = this.get('keyShape');\n var type = keyShape.get('type');\n var itemType = this.get('type');\n var centerX;\n var centerY;\n var bbox = this.getBBox();\n if (itemType === 'combo') {\n centerX = bbox.centerX || (bbox.maxX + bbox.minX) / 2;\n centerY = bbox.centerY || (bbox.maxY + bbox.minY) / 2;\n } else {\n centerX = bbox.centerX;\n centerY = bbox.centerY;\n }\n var anchorPoints = this.getAnchorPoints();\n var intersectPoint;\n switch (type) {\n case 'circle':\n intersectPoint = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"getCircleIntersectByPoint\"])({\n x: centerX,\n y: centerY,\n r: bbox.width / 2\n }, point);\n break;\n case 'ellipse':\n intersectPoint = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"getEllipseIntersectByPoint\"])({\n x: centerX,\n y: centerY,\n rx: bbox.width / 2,\n ry: bbox.height / 2\n }, point);\n break;\n default:\n intersectPoint = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"getRectIntersectByPoint\"])(bbox, point);\n }\n var linkPoint = intersectPoint;\n // 如果存在锚点,则使用交点计算最近的锚点\n if (anchorPoints.length) {\n if (!linkPoint) {\n // 如果计算不出交点\n linkPoint = point;\n }\n linkPoint = this.getNearestPoint(anchorPoints, linkPoint);\n }\n if (!linkPoint) {\n // 如果最终依然没法找到锚点和连接点,直接返回中心点\n linkPoint = {\n x: centerX,\n y: centerY\n };\n }\n return linkPoint;\n };\n /**\n * 获取锚点的定义\n * @return {array} anchorPoints\n */\n Node.prototype.getAnchorPoints = function () {\n var anchorPoints = this.get(CACHE_ANCHOR_POINTS);\n if (!anchorPoints) {\n anchorPoints = [];\n var shapeFactory = this.get('shapeFactory');\n var bbox_1 = this.getBBox();\n var model = this.get('model');\n var shapeCfg = this.getShapeCfg(model);\n var type = model.type;\n var points = shapeFactory.getAnchorPoints(type, shapeCfg) || [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points, function (pointArr, index) {\n var point = {\n x: bbox_1.minX + pointArr[0] * bbox_1.width,\n y: bbox_1.minY + pointArr[1] * bbox_1.height,\n anchorIndex: index\n };\n anchorPoints.push(point);\n });\n this.set(CACHE_ANCHOR_POINTS, anchorPoints);\n }\n return anchorPoints;\n };\n /**\n * add edge\n * @param edge Edge instance\n */\n Node.prototype.addEdge = function (edge) {\n this.get('edges').push(edge);\n };\n /**\n * 锁定节点\n */\n Node.prototype.lock = function () {\n this.set('locked', true);\n };\n /**\n * 解锁锁定的节点\n */\n Node.prototype.unlock = function () {\n this.set('locked', false);\n };\n Node.prototype.hasLocked = function () {\n return this.get('locked');\n };\n /**\n * 移除边\n * @param {Edge} edge 边\n */\n Node.prototype.removeEdge = function (edge) {\n var edges = this.getEdges();\n var index = edges.indexOf(edge);\n if (index > -1) edges.splice(index, 1);\n };\n Node.prototype.clearCache = function () {\n this.set(CACHE_BBOX, null); // 清理缓存的 bbox\n this.set(CACHE_ANCHOR_POINTS, null);\n };\n /**\n * 判断更新的种类,move 表示仅移动,bbox 表示大小有变化,style 表示仅与大小无关的参数变化\n * @param cfg 节点数据模型\n */\n Node.prototype.getUpdateType = function (cfg) {\n var _a, _b, _c, _d, _e;\n if (!cfg) return undefined;\n var existX = !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(cfg.x);\n var existY = !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(cfg.y);\n var keys = Object.keys(cfg);\n // 仅有一个字段,包含 x 或者 包含 y\n // 两个字段,同时有 x,同时有 y\n if (keys.length === 1 && (existX || existY) || keys.length === 2 && existX && existY) return 'move';\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.x) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.y) || cfg.type || cfg.anchorPoints || cfg.size || (cfg === null || cfg === void 0 ? void 0 : cfg.style) && (((_a = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _a === void 0 ? void 0 : _a.r) || ((_b = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _b === void 0 ? void 0 : _b.width) || ((_c = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _c === void 0 ? void 0 : _c.height) || ((_d = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _d === void 0 ? void 0 : _d.rx) || ((_e = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _e === void 0 ? void 0 : _e.ry))) return 'bbox|label';\n var updateLabel = keys.includes('label') || keys.includes('labelCfg');\n return updateLabel ? 'style|label' : 'style';\n };\n Node.prototype.setState = function (state, value) {\n var _this = this;\n if (this.optimize) {\n _super.prototype.setState.call(this, state, value);\n return;\n }\n this.runWithBBoxAffected(function () {\n return _super.prototype.setState.call(_this, state, value);\n });\n };\n Node.prototype.clearStates = function (states) {\n var _this = this;\n if (this.optimize) {\n _super.prototype.clearStates.call(this, states);\n return;\n }\n this.runWithBBoxAffected(function () {\n return _super.prototype.clearStates.call(_this, states);\n });\n };\n Node.prototype.runWithBBoxAffected = function (fn) {\n var bboxAffectedStyleKeys = ['r', 'width', 'height', 'rx', 'ry', 'lineWidth'];\n var beforeAttrs = this.getKeyShape().attr();\n var bboxAffectedStyleBefore = {};\n Object.keys(this.getKeyShape().attr()).forEach(function (key) {\n if (bboxAffectedStyleKeys.includes(key)) bboxAffectedStyleBefore[key] = beforeAttrs[key];\n });\n fn();\n // if the state styles affect the bbox, the bbox cache should be cleared to get correct edge connecting points\n var afterAttrs = this.getKeyShape().attr();\n for (var i = 0; i < bboxAffectedStyleKeys.length; i++) {\n var key = bboxAffectedStyleKeys[i];\n if (afterAttrs[key] !== bboxAffectedStyleBefore[key]) {\n this.clearCache();\n this.getEdges().forEach(function (edge) {\n return edge.refresh();\n });\n break;\n }\n }\n };\n return Node;\n}(_item__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Node);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/node.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-core/es/utils/uniq.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-core/es/utils/uniq.js ***! - \***********************************************************/ -/*! exports provided: uniq */ +/***/ "./node_modules/@antv/g6-core/es/types/index.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/types/index.js ***! + \******************************************************/ +/*! exports provided: G6GraphEvent */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uniq\", function() { return uniq; });\nfunction uniq(array) {\n return array.filter(function (v, i, a) {\n return a.indexOf(v) === i;\n });\n}\n//# sourceMappingURL=uniq.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-core/es/utils/uniq.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../interface */ \"./node_modules/@antv/g6-core/es/interface/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _interface__WEBPACK_IMPORTED_MODULE_0__[\"G6GraphEvent\"]; });\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/types/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/index.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/index.js ***! - \********************************************************/ -/*! exports provided: WebGLEngine, WebGPUEngine */ +/***/ "./node_modules/@antv/g6-core/es/util/base.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/base.js ***! + \****************************************************/ +/*! exports provided: uniqueId, formatPadding, cloneEvent, isViewportChanged, isNaN, calculationItemsBBox, processParallelEdges */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _webgl__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./webgl */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WebGLEngine\", function() { return _webgl__WEBPACK_IMPORTED_MODULE_0__[\"WebGLEngine\"]; });\n\n/* harmony import */ var _webgpu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./webgpu */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WebGPUEngine\", function() { return _webgpu__WEBPACK_IMPORTED_MODULE_1__[\"WebGPUEngine\"]; });\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return uniqueId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatPadding\", function() { return formatPadding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cloneEvent\", function() { return cloneEvent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isViewportChanged\", function() { return isViewportChanged; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNaN\", function() { return isNaN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"calculationItemsBBox\", function() { return calculationItemsBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"processParallelEdges\", function() { return processParallelEdges; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _interface_behavior__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../interface/behavior */ \"./node_modules/@antv/g6-core/es/interface/behavior.js\");\n\n\nvar uniqueId = function uniqueId(type) {\n return \"\".concat(type, \"-\").concat(Math.random()).concat(Date.now());\n};\n/**\n * turn padding into [top, right, bottom, right]\n * @param {Number|Array} padding input padding\n * @return {array} output\n */\nvar formatPadding = function formatPadding(padding) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(padding)) {\n switch (padding.length) {\n case 4:\n return padding;\n case 3:\n padding.push(padding[1]);\n return padding;\n case 2:\n return padding.concat(padding);\n case 1:\n return [padding[0], padding[0], padding[0], padding[0]];\n default:\n return [0, 0, 0, 0];\n }\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(padding)) {\n return [padding, padding, padding, padding];\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(padding)) {\n var intPadding = parseInt(padding, 10);\n return [intPadding, intPadding, intPadding, intPadding];\n }\n return [0, 0, 0, 0];\n};\n/**\n * clone event\n * @param e\n */\nvar cloneEvent = function cloneEvent(e) {\n var event = new _interface_behavior__WEBPACK_IMPORTED_MODULE_1__[\"G6GraphEvent\"](e.type, e);\n event.clientX = e.clientX;\n event.clientY = e.clientY;\n event.x = e.x;\n event.y = e.y;\n event.target = e.target;\n event.currentTarget = e.currentTarget;\n event.bubbles = true;\n event.item = e.item;\n return event;\n};\n/**\n * 判断 viewport 是否改变,通过和单位矩阵对比\n * @param matrix Viewport 的 Matrix\n */\nvar isViewportChanged = function isViewportChanged(matrix) {\n // matrix 为 null, 则说明没有变化\n if (!matrix) {\n return false;\n }\n var MATRIX_LEN = 9;\n var ORIGIN_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0; i < MATRIX_LEN; i++) {\n if (matrix[i] !== ORIGIN_MATRIX[i]) {\n return true;\n }\n }\n return false;\n};\nvar isNaN = function isNaN(input) {\n return Number.isNaN(Number(input));\n};\n/**\n * 计算一组 Item 的 BBox\n * @param items 选中的一组Item,可以是 node 或 combo\n */\nvar calculationItemsBBox = function calculationItemsBBox(items) {\n var minx = Infinity;\n var maxx = -Infinity;\n var miny = Infinity;\n var maxy = -Infinity;\n // 获取已节点的所有最大最小x y值\n for (var i = 0; i < items.length; i++) {\n var element = items[i];\n var bbox = element.getBBox();\n var minX = bbox.minX,\n minY = bbox.minY,\n maxX = bbox.maxX,\n maxY = bbox.maxY;\n if (minX < minx) {\n minx = minX;\n }\n if (minY < miny) {\n miny = minY;\n }\n if (maxX > maxx) {\n maxx = maxX;\n }\n if (maxY > maxy) {\n maxy = maxY;\n }\n }\n var x = Math.floor(minx);\n var y = Math.floor(miny);\n var width = Math.ceil(maxx) - Math.floor(minx);\n var height = Math.ceil(maxy) - Math.floor(miny);\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n minX: minx,\n minY: miny,\n maxX: maxx,\n maxY: maxy\n };\n};\n/**\n * 若 edges 中存在两端点相同的边,使用 quadratic 边并自动计算 curveOffset 使它们不相互重叠\n * 文档: https://g6.antv.antgroup.com/en/api/Util\n * @param edges 边数据集合\n * @param offsetDiff 相邻两边的 offset 之差\n * @param multiEdgeType\n * @param singleEdgeType\n * @param loopEdgeType\n */\nvar processParallelEdges = function processParallelEdges(edges, offsetDiff, multiEdgeType, singleEdgeType, loopEdgeType) {\n if (offsetDiff === void 0) {\n offsetDiff = 15;\n }\n if (multiEdgeType === void 0) {\n multiEdgeType = 'quadratic';\n }\n if (singleEdgeType === void 0) {\n singleEdgeType = undefined;\n }\n if (loopEdgeType === void 0) {\n loopEdgeType = undefined;\n }\n var len = edges.length;\n var cod = offsetDiff * 2;\n var loopPosition = ['top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left'];\n var edgeMap = {};\n var tags = [];\n var reverses = {};\n for (var i = 0; i < len; i++) {\n var edge = edges[i];\n var source = edge.source,\n target = edge.target;\n var sourceTarget = \"\".concat(source, \"-\").concat(target);\n if (tags[i]) continue;\n if (!edgeMap[sourceTarget]) {\n edgeMap[sourceTarget] = [];\n }\n tags[i] = true;\n edgeMap[sourceTarget].push(edge);\n for (var j = 0; j < len; j++) {\n if (i === j) continue;\n var sedge = edges[j];\n var src = sedge.source;\n var dst = sedge.target;\n // 两个节点之间共同的边\n // 第一条的source = 第二条的target\n // 第一条的target = 第二条的source\n if (!tags[j]) {\n if (source === dst && target === src) {\n edgeMap[sourceTarget].push(sedge);\n tags[j] = true;\n reverses[\"\".concat(src, \"|\").concat(dst, \"|\").concat(edgeMap[sourceTarget].length - 1)] = true;\n } else if (source === src && target === dst) {\n edgeMap[sourceTarget].push(sedge);\n tags[j] = true;\n }\n }\n }\n }\n for (var key in edgeMap) {\n var arcEdges = edgeMap[key];\n var length_1 = arcEdges.length;\n for (var k = 0; k < length_1; k++) {\n var current = arcEdges[k];\n if (current.source === current.target) {\n if (loopEdgeType) current.type = loopEdgeType;\n // 超过8条自环边,则需要重新处理\n current.loopCfg = {\n position: loopPosition[k % 8],\n dist: Math.floor(k / 8) * 20 + 50\n };\n continue;\n }\n if (length_1 === 1 && singleEdgeType && current.source !== current.target) {\n current.type = singleEdgeType;\n continue;\n }\n current.type = multiEdgeType;\n var sign = (k % 2 === 0 ? 1 : -1) * (reverses[\"\".concat(current.source, \"|\").concat(current.target, \"|\").concat(k)] ? -1 : 1);\n if (length_1 % 2 === 1) {\n current.curveOffset = sign * Math.ceil(k / 2) * cod;\n } else {\n current.curveOffset = sign * (Math.floor(k / 2) * cod + offsetDiff);\n }\n }\n }\n return edges;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/base.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/utils/dom.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/utils/dom.js ***! - \************************************************************/ -/*! exports provided: isWindowObjectExist, loadScript, loadScriptAsync */ +/***/ "./node_modules/@antv/g6-core/es/util/color.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/color.js ***! + \*****************************************************/ +/*! exports provided: defaultSubjectColors */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isWindowObjectExist\", function() { return isWindowObjectExist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadScript\", function() { return loadScript; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"loadScriptAsync\", function() { return loadScriptAsync; });\nfunction isWindowObjectExist() {\n return typeof window !== 'undefined';\n}\nfunction loadScript(scriptUrl, onSuccess, onError, scriptId) {\n if (!isWindowObjectExist()) {\n return;\n }\n\n var head = document.getElementsByTagName('head')[0];\n var script = document.createElement('script');\n script.setAttribute('type', 'text/javascript');\n script.setAttribute('src', scriptUrl);\n\n if (scriptId) {\n script.id = scriptId;\n }\n\n script.onload = function () {\n if (onSuccess) {\n onSuccess();\n }\n };\n\n script.onerror = function (e) {\n if (onError) {\n onError(\"Unable to load script '\".concat(scriptUrl, \"'\"), e);\n }\n };\n\n head.appendChild(script);\n}\nfunction loadScriptAsync(scriptUrl, scriptId) {\n return new Promise(function (resolve, reject) {\n loadScript(scriptUrl, function () {\n resolve();\n }, function (message, exception) {\n reject(exception);\n });\n });\n}\n//# sourceMappingURL=dom.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/utils/dom.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultSubjectColors\", function() { return defaultSubjectColors; });\nvar defaultSubjectColors = ['#5F95FF', '#61DDAA', '#65789B', '#F6BD16', '#7262FD', '#78D3F8', '#9661BC', '#F6903D', '#008685', '#F08BB4'];\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/color.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/utils/is-number.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/utils/is-number.js ***! - \******************************************************************/ -/*! exports provided: isNumber */ +/***/ "./node_modules/@antv/g6-core/es/util/graphic.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/graphic.js ***! + \*******************************************************/ +/*! exports provided: getBBox, getLoopCfgs, getLabelPosition, traverseTree, traverseTreeUp, getLetterWidth, getTextSize, truncateLabelByLength, plainCombosToTrees, reconstructTree, getComboBBox, shouldRefreshEdge, cloneBesidesImg, getAnimateCfgWithCallback */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return isNumber; });\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n//# sourceMappingURL=is-number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/utils/is-number.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBox\", function() { return getBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLoopCfgs\", function() { return getLoopCfgs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLabelPosition\", function() { return getLabelPosition; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseTree\", function() { return traverseTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseTreeUp\", function() { return traverseTreeUp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLetterWidth\", function() { return getLetterWidth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTextSize\", function() { return getTextSize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"truncateLabelByLength\", function() { return truncateLabelByLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"plainCombosToTrees\", function() { return plainCombosToTrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reconstructTree\", function() { return reconstructTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getComboBBox\", function() { return getComboBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"shouldRefreshEdge\", function() { return shouldRefreshEdge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cloneBesidesImg\", function() { return cloneBesidesImg; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAnimateCfgWithCallback\", function() { return getAnimateCfgWithCallback; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _letterAspectRatio__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./letterAspectRatio */ \"./node_modules/@antv/g6-core/es/util/letterAspectRatio.js\");\n/* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n\n\n\n\n\n\nvar PI = Math.PI,\n sin = Math.sin,\n cos = Math.cos;\n// 一共支持8个方向的自环,每个环占的角度是45度,在计算时再二分,为22.5度\nvar SELF_LINK_SIN = sin(PI / 8);\nvar SELF_LINK_COS = cos(PI / 8);\nvar getBBox = function getBBox(element, group) {\n var bbox = element.getBBox();\n var leftTop = {\n x: bbox.minX,\n y: bbox.minY\n };\n var rightBottom = {\n x: bbox.maxX,\n y: bbox.maxY\n };\n // 根据父元素变换矩阵\n if (group) {\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n leftTop = Object(_math__WEBPACK_IMPORTED_MODULE_5__[\"applyMatrix\"])(leftTop, matrix);\n rightBottom = Object(_math__WEBPACK_IMPORTED_MODULE_5__[\"applyMatrix\"])(rightBottom, matrix);\n }\n var lx = leftTop.x,\n ly = leftTop.y;\n var rx = rightBottom.x,\n ry = rightBottom.y;\n return {\n x: lx,\n y: ly,\n minX: lx,\n minY: ly,\n maxX: rx,\n maxY: ry,\n width: rx - lx,\n height: ry - ly\n };\n};\n/**\n * get loop edge config\n * @param cfg edge config\n */\nvar getLoopCfgs = function getLoopCfgs(cfg) {\n var item = cfg.sourceNode || cfg.targetNode;\n var container = item.get('group');\n var containerMatrix = container.getMatrix();\n if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var keyShape = item.getKeyShape();\n var bbox = keyShape.getBBox();\n var loopCfg = cfg.loopCfg || {};\n // 距离keyShape边的最高距离\n var dist = loopCfg.dist || Math.max(bbox.width, bbox.height) * 2;\n // 自环边与keyShape的相对位置关系\n var position = loopCfg.position || _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].defaultLoopPosition;\n // 中心取节点 keyShape bbox 的中心位置 + 节点位置坐标\n var center = [(bbox.minX + bbox.maxX) / 2 + containerMatrix[6], (bbox.minY + bbox.maxY) / 2 + containerMatrix[7]];\n var startPoint = [cfg.startPoint.x, cfg.startPoint.y];\n var endPoint = [cfg.endPoint.x, cfg.endPoint.y];\n var halfOfHeight = bbox.height / 2;\n var halfOfWidth = bbox.width / 2;\n var rstart = halfOfHeight;\n var rend = halfOfHeight;\n var sinDeltaStart = rstart * SELF_LINK_SIN;\n var cosDeltaStart = rstart * SELF_LINK_COS;\n var sinDeltaEnd = rend * SELF_LINK_SIN;\n var cosDeltaEnd = rend * SELF_LINK_COS;\n var shapeType = keyShape.get('type');\n // 美观考虑,pointPadding 默认取宽高中最小的1/4\n var defaultPointPadding = Math.min(halfOfHeight / 2, halfOfWidth / 2);\n var maxPointPadding = Math.min(halfOfHeight, halfOfWidth);\n // 对于非圆形节点设置的连接点与节点中心坐标(`top-right`,`bottom-right`,`top-left`,`bottom-left`较特殊,为四个角坐标)在 x 轴或 y 轴方向的偏移量,默认为  `节点宽高中最小值的1/4`\n var pointPadding = (loopCfg === null || loopCfg === void 0 ? void 0 : loopCfg.pointPadding) ? Math.min(maxPointPadding, loopCfg === null || loopCfg === void 0 ? void 0 : loopCfg.pointPadding) : defaultPointPadding;\n // 如果定义了锚点的,直接用锚点坐标,否则,根据自环的 cfg 计算\n if (startPoint[0] === endPoint[0] && startPoint[1] === endPoint[1]) {\n switch (position) {\n case 'top':\n if (shapeType === 'circle') {\n startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd];\n } else {\n startPoint = [center[0] - pointPadding, center[1] - halfOfHeight];\n endPoint = [center[0] + pointPadding, center[1] - halfOfHeight];\n }\n break;\n case 'top-right':\n rstart = halfOfHeight;\n rend = halfOfWidth;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + cosDeltaEnd, center[1] - sinDeltaEnd];\n } else {\n startPoint = [center[0] + halfOfWidth - pointPadding, center[1] - halfOfHeight];\n endPoint = [center[0] + halfOfWidth, center[1] - halfOfHeight + pointPadding];\n }\n break;\n case 'right':\n rstart = halfOfWidth;\n rend = halfOfWidth;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + cosDeltaStart, center[1] - sinDeltaStart];\n endPoint = [center[0] + cosDeltaEnd, center[1] + sinDeltaEnd];\n } else {\n startPoint = [center[0] + halfOfWidth, center[1] - pointPadding];\n endPoint = [center[0] + halfOfWidth, center[1] + pointPadding];\n }\n break;\n case 'bottom-right':\n rstart = halfOfWidth;\n rend = halfOfHeight;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + cosDeltaStart, center[1] + sinDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] + cosDeltaEnd];\n } else {\n startPoint = [center[0] + halfOfWidth, center[1] + halfOfHeight - pointPadding];\n endPoint = [center[0] + halfOfWidth - pointPadding, center[1] + halfOfHeight];\n }\n break;\n case 'bottom':\n rstart = halfOfHeight;\n rend = halfOfHeight;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + sinDeltaStart, center[1] + cosDeltaStart];\n endPoint = [center[0] - sinDeltaEnd, center[1] + cosDeltaEnd];\n } else {\n startPoint = [center[0] - pointPadding, center[1] + halfOfHeight];\n endPoint = [center[0] + pointPadding, center[1] + halfOfHeight];\n }\n break;\n case 'bottom-left':\n rstart = halfOfHeight;\n rend = halfOfWidth;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - sinDeltaStart, center[1] + cosDeltaStart];\n endPoint = [center[0] - cosDeltaEnd, center[1] + sinDeltaEnd];\n } else {\n startPoint = [center[0] - halfOfWidth, center[1] + halfOfHeight - pointPadding];\n endPoint = [center[0] - halfOfWidth + pointPadding, center[1] + halfOfHeight];\n }\n break;\n case 'left':\n rstart = halfOfWidth;\n rend = halfOfWidth;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - cosDeltaStart, center[1] + sinDeltaStart];\n endPoint = [center[0] - cosDeltaEnd, center[1] - sinDeltaEnd];\n } else {\n startPoint = [center[0] - halfOfWidth, center[1] - pointPadding];\n endPoint = [center[0] - halfOfWidth, center[1] + pointPadding];\n }\n break;\n case 'top-left':\n rstart = halfOfWidth;\n rend = halfOfHeight;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - cosDeltaStart, center[1] - sinDeltaStart];\n endPoint = [center[0] - sinDeltaEnd, center[1] - cosDeltaEnd];\n } else {\n startPoint = [center[0] - halfOfWidth + pointPadding, center[1] - halfOfHeight];\n endPoint = [center[0] - halfOfWidth, center[1] - halfOfHeight + pointPadding];\n }\n break;\n default:\n rstart = halfOfWidth;\n rend = halfOfWidth;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd];\n }\n // 如果逆时针画,交换起点和终点\n if (loopCfg.clockwise === false) {\n var swap = [startPoint[0], startPoint[1]];\n startPoint = [endPoint[0], endPoint[1]];\n endPoint = [swap[0], swap[1]];\n }\n }\n var startVec = [startPoint[0] - center[0], startPoint[1] - center[1]];\n var scaleRateStart = (rstart + dist) / rstart;\n var scaleRateEnd = (rend + dist) / rend;\n if (loopCfg.clockwise === false) {\n scaleRateStart = (rend + dist) / rend;\n scaleRateEnd = (rstart + dist) / rstart;\n }\n var startExtendVec = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__[\"vec2\"].scale([0, 0], startVec, scaleRateStart);\n var controlPoint1 = [center[0] + startExtendVec[0], center[1] + startExtendVec[1]];\n var endVec = [endPoint[0] - center[0], endPoint[1] - center[1]];\n var endExtendVec = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__[\"vec2\"].scale([0, 0], endVec, scaleRateEnd);\n var controlPoint2 = [center[0] + endExtendVec[0], center[1] + endExtendVec[1]];\n cfg.startPoint = {\n x: startPoint[0],\n y: startPoint[1]\n };\n cfg.endPoint = {\n x: endPoint[0],\n y: endPoint[1]\n };\n cfg.controlPoints = [{\n x: controlPoint1[0],\n y: controlPoint1[1]\n }, {\n x: controlPoint2[0],\n y: controlPoint2[1]\n }];\n return cfg;\n};\n/**\n * 根据 label 所在线条的位置百分比,计算 label 坐标\n * @param {object} pathShape G 的 path 实例,一般是 Edge 实例的 keyShape\n * @param {number} percent 范围 0 - 1 的线条百分比\n * @param {number} refX x 轴正方向为基准的 label 偏移\n * @param {number} refY y 轴正方向为基准的 label 偏移\n * @param {boolean} rotate 是否根据线条斜率旋转文本\n * @return {object} 文本的 x, y, 文本的旋转角度\n */\nvar getLabelPosition = function getLabelPosition(pathShape, percent, refX, refY, rotate) {\n var TAN_OFFSET = 0.0001;\n var vector = [];\n var point = pathShape === null || pathShape === void 0 ? void 0 : pathShape.getPoint(percent);\n if (!point) {\n return {\n x: 0,\n y: 0,\n angle: 0\n };\n }\n // 头尾最可能,放在最前面,使用 g path 上封装的方法\n if (percent < TAN_OFFSET) {\n vector = pathShape.getStartTangent().reverse();\n } else if (percent > 1 - TAN_OFFSET) {\n vector = pathShape.getEndTangent();\n } else {\n // 否则取指定位置的点,与少量偏移的点,做微分向量\n var offsetPoint = pathShape === null || pathShape === void 0 ? void 0 : pathShape.getPoint(percent + TAN_OFFSET);\n vector.push([point.x, point.y]);\n vector.push([offsetPoint.x, offsetPoint.y]);\n }\n var rad = Math.atan2(vector[1][1] - vector[0][1], vector[1][0] - vector[0][0]);\n if (rad < 0) {\n rad += PI * 2;\n }\n if (refX) {\n point.x += cos(rad) * refX;\n point.y += sin(rad) * refX;\n }\n if (refY) {\n // 默认方向是 x 轴正方向,法线是 求出角度 - 90°\n var normal = rad - PI / 2;\n // 若法线角度在 y 轴负方向,切到正方向,保证 refY 相对于 y 轴正方向\n if (rad > 1 / 2 * PI && rad < 3 * 1 / 2 * PI) {\n normal -= PI;\n }\n point.x += cos(normal) * refY;\n point.y += sin(normal) * refY;\n }\n var result = {\n x: point.x,\n y: point.y,\n angle: rad\n };\n if (rotate) {\n if (rad > 0.5 * PI && rad < 1.5 * PI) {\n rad -= PI;\n }\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n rotate: rad\n }, result);\n }\n return result;\n};\n/**\n * depth first traverse, from root to leaves, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverse = function traverse(data, parent, index, fn) {\n if (fn(data, parent, index) === false) {\n return false;\n }\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverse(data.children[i], data, i, fn)) return false;\n }\n }\n return true;\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseUp = function traverseUp(data, parent, index, fn) {\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverseUp(data.children[i], data, i, fn)) return;\n }\n }\n if (fn(data, parent, index) === false) {\n return false;\n }\n return true;\n};\n/**\n * depth first traverse, from root to leaves, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseTree = function traverseTree(data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n traverse(data, null, -1, fn);\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseTreeUp = function traverseTreeUp(data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n traverseUp(data, null, -1, fn);\n};\n/**\n *\n * @param letter the letter\n * @param fontSize\n * @return the letter's width\n */\nvar getLetterWidth = function getLetterWidth(letter, fontSize) {\n return fontSize * (_letterAspectRatio__WEBPACK_IMPORTED_MODULE_4__[\"default\"][letter] || 1);\n};\n/**\n *\n * @param text the text\n * @param fontSize\n * @return the text's size\n */\nvar getTextSize = function getTextSize(text, fontSize) {\n var width = 0;\n var pattern = new RegExp(\"[\\u4E00-\\u9FA5]+\");\n text.split('').forEach(function (letter) {\n if (pattern.test(letter)) {\n // 中文字符\n width += fontSize;\n } else {\n width += getLetterWidth(letter, fontSize);\n }\n });\n return [width, fontSize];\n};\nvar truncateLabelByLength = function truncateLabelByLength(text, length) {\n if (typeof length !== 'number' || length <= 0 || length >= text.length) {\n return text;\n }\n return text.substring(0, length) + '...';\n};\n/**\n * construct the trees from combos data\n * @param array the combos array\n * @param nodes the nodes array\n * @return the tree\n */\nvar plainCombosToTrees = function plainCombosToTrees(array, nodes) {\n var result = [];\n var addedMap = {};\n var modelMap = {};\n array.forEach(function (d) {\n modelMap[d.id] = d;\n });\n array.forEach(function (d, i) {\n var cd = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"clone\"])(d);\n cd.itemType = 'combo';\n cd.children = undefined;\n if (cd.parentId === cd.id) {\n console.warn(\"The parentId for combo \".concat(cd.id, \" can not be the same as the combo's id\"));\n delete cd.parentId;\n } else if (cd.parentId && !modelMap[cd.parentId]) {\n console.warn(\"The parent combo for combo \".concat(cd.id, \" does not exist!\"));\n delete cd.parentId;\n }\n var mappedObj = addedMap[cd.id];\n if (mappedObj) {\n cd.children = mappedObj.children;\n addedMap[cd.id] = cd;\n mappedObj = cd;\n if (!mappedObj.parentId) {\n result.push(mappedObj);\n return;\n }\n var mappedParent = addedMap[mappedObj.parentId];\n if (mappedParent) {\n if (mappedParent.children) mappedParent.children.push(cd);else mappedParent.children = [cd];\n } else {\n var parent_1 = {\n id: mappedObj.parentId,\n children: [mappedObj]\n };\n addedMap[mappedObj.parentId] = parent_1;\n addedMap[cd.id] = cd;\n }\n return;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isString\"])(d.parentId)) {\n var parent_2 = addedMap[d.parentId];\n if (parent_2) {\n if (parent_2.children) parent_2.children.push(cd);else parent_2.children = [cd];\n addedMap[cd.id] = cd;\n } else {\n var pa = {\n id: d.parentId,\n children: [cd]\n };\n addedMap[pa.id] = pa;\n addedMap[cd.id] = cd;\n }\n } else {\n result.push(cd);\n addedMap[cd.id] = cd;\n }\n });\n // proccess the nodes\n var nodeMap = {};\n (nodes || []).forEach(function (node) {\n nodeMap[node.id] = node;\n var combo = addedMap[node.comboId];\n if (combo) {\n var cnode = {\n id: node.id,\n comboId: node.comboId\n };\n if (combo.children) combo.children.push(cnode);else combo.children = [cnode];\n cnode.itemType = 'node';\n addedMap[node.id] = cnode;\n }\n });\n // assign the depth for each element\n var maxDepth = 0;\n result.forEach(function (tree) {\n tree.depth = maxDepth + 10;\n traverseTree(tree, function (child) {\n var parent;\n var itemType = addedMap[child.id].itemType;\n if (itemType === 'node') {\n parent = addedMap[child.comboId];\n } else {\n parent = addedMap[child.parentId];\n }\n if (parent) {\n if (itemType === 'node') child.depth = maxDepth + 1;else child.depth = maxDepth + 10;\n } else {\n child.depth = maxDepth + 10;\n }\n if (maxDepth < child.depth) maxDepth = child.depth;\n var oriNodeModel = nodeMap[child.id];\n if (oriNodeModel) {\n oriNodeModel.depth = child.depth;\n }\n return true;\n });\n });\n return result;\n};\nvar reconstructTree = function reconstructTree(trees, subtreeId, newParentId) {\n var _a;\n var brothers = trees;\n var subtree;\n var comboChildsMap = {\n root: {\n children: trees\n }\n };\n var foundSubTree = false;\n var oldParentId = 'root';\n (trees || []).forEach(function (tree) {\n if (foundSubTree) return;\n if (tree.id === subtreeId) {\n subtree = tree;\n if (tree.itemType === 'combo') {\n subtree.parentId = newParentId;\n } else {\n subtree.comboId = newParentId;\n }\n foundSubTree = true;\n return;\n }\n traverseTree(tree, function (child) {\n var _a;\n comboChildsMap[child.id] = {\n children: (child === null || child === void 0 ? void 0 : child.children) || []\n };\n // store the old parent id to delete the subtree from the old parent's children in next recursion\n brothers = (_a = comboChildsMap[child.parentId || child.comboId || 'root']) === null || _a === void 0 ? void 0 : _a.children;\n if (child && (child.removed || subtreeId === child.id) && brothers) {\n oldParentId = child.parentId || child.comboId || 'root';\n subtree = child;\n // re-assign the parentId or comboId for the moved subtree\n if (child.itemType === 'combo') {\n subtree.parentId = newParentId;\n } else {\n subtree.comboId = newParentId;\n }\n foundSubTree = true;\n return false;\n }\n return true;\n });\n });\n brothers = (_a = comboChildsMap[oldParentId]) === null || _a === void 0 ? void 0 : _a.children;\n var index = brothers ? brothers.indexOf(subtree) : -1;\n if (index > -1) brothers.splice(index, 1);\n // 如果遍历完整棵树还没有找到,说明之前就不在树中\n if (!foundSubTree) {\n subtree = {\n id: subtreeId,\n itemType: 'node',\n comboId: newParentId\n };\n comboChildsMap[subtreeId] = {\n children: undefined\n };\n }\n // append to new parent\n if (subtreeId) {\n var found_1 = false;\n // newParentId is undefined means the subtree will have no parent\n if (newParentId) {\n var newParentDepth_1 = 0;\n (trees || []).forEach(function (tree) {\n if (found_1) return; // terminate\n traverseTree(tree, function (child) {\n // append subtree to the new parent ans assign the depth to the subtree\n if (newParentId === child.id) {\n found_1 = true;\n if (child.children) child.children.push(subtree);else child.children = [subtree];\n newParentDepth_1 = child.depth;\n if (subtree.itemType === 'node') subtree.depth = newParentDepth_1 + 2;else subtree.depth = newParentDepth_1 + 1;\n return false; // terminate\n }\n\n return true;\n });\n });\n } else if ((!newParentId || !found_1) && subtree.itemType !== 'node') {\n // if the newParentId is undefined or it is not found in the tree, add the subTree to the root\n trees.push(subtree);\n }\n // update the depth of the subtree and its children from the subtree\n var currentDepth_1 = subtree.depth;\n traverseTree(subtree, function (child) {\n if (child.itemType === 'node') currentDepth_1 += 2;else currentDepth_1 += 1;\n child.depth = currentDepth_1;\n return true;\n });\n }\n return trees;\n};\nvar getComboBBox = function getComboBBox(children, graph, combo) {\n var comboBBox = {\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity,\n x: undefined,\n y: undefined,\n width: undefined,\n height: undefined,\n centerX: undefined,\n centerY: undefined\n };\n if (!children || children.length === 0) {\n var comboModel = combo === null || combo === void 0 ? void 0 : combo.getModel();\n var _a = comboModel || {},\n x = _a.x,\n y = _a.y,\n fixSize = _a.fixSize,\n collapsed = _a.collapsed,\n fixCollapseSize = _a.fixCollapseSize;\n var useFixSize = collapsed ? fixCollapseSize : fixSize;\n var _b = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(useFixSize) ? useFixSize : [useFixSize, useFixSize],\n width = _b[0],\n height = _b[1];\n var halfSize = [width / 2, height / 2];\n return {\n minX: x - halfSize[0],\n minY: y - halfSize[1],\n maxX: x + halfSize[0],\n maxY: y + halfSize[1],\n x: x,\n y: y,\n width: width,\n height: height\n };\n }\n children.forEach(function (child) {\n var childItem = graph.findById(child.id);\n if (!childItem || !childItem.isVisible()) return; // ignore hidden children\n childItem.set('bboxCanvasCache', undefined);\n var childBBox = childItem.getCanvasBBox();\n if (childBBox.x && comboBBox.minX > childBBox.minX) comboBBox.minX = childBBox.minX;\n if (childBBox.y && comboBBox.minY > childBBox.minY) comboBBox.minY = childBBox.minY;\n if (childBBox.x && comboBBox.maxX < childBBox.maxX) comboBBox.maxX = childBBox.maxX;\n if (childBBox.y && comboBBox.maxY < childBBox.maxY) comboBBox.maxY = childBBox.maxY;\n });\n comboBBox.x = (comboBBox.minX + comboBBox.maxX) / 2;\n comboBBox.y = (comboBBox.minY + comboBBox.maxY) / 2;\n comboBBox.width = comboBBox.maxX - comboBBox.minX;\n comboBBox.height = comboBBox.maxY - comboBBox.minY;\n comboBBox.centerX = (comboBBox.minX + comboBBox.maxX) / 2;\n comboBBox.centerY = (comboBBox.minY + comboBBox.maxY) / 2;\n // if it is a circle combo, diagnal length of the children's bbox should be the diameter of the combo's bbox\n if ((combo === null || combo === void 0 ? void 0 : combo.getKeyShape().get('type')) === 'circle') {\n comboBBox.width = Math.hypot(comboBBox.height, comboBBox.width);\n comboBBox.height = comboBBox.width;\n }\n Object.keys(comboBBox).forEach(function (key) {\n if (comboBBox[key] === Infinity || comboBBox[key] === -Infinity) {\n comboBBox[key] = undefined;\n }\n });\n return comboBBox;\n};\nvar shouldRefreshEdge = function shouldRefreshEdge(cfg) {\n var refreshEdge = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(cfg.x) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(cfg.y) || cfg.type || cfg.anchorPoints || cfg.size;\n if (cfg.style) refreshEdge = refreshEdge || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(cfg.style.r) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(cfg.style.width) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(cfg.style.height) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(cfg.style.rx) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(cfg.style.ry);\n return refreshEdge;\n};\nvar cloneBesidesImg = function cloneBesidesImg(obj) {\n var clonedObj = {};\n Object.keys(obj).forEach(function (key1) {\n var obj2 = obj[key1];\n if (key1 === 'img' && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isString\"])(obj2)) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isObject\"])(obj2) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(obj2)) {\n var clonedObj2_1 = {};\n Object.keys(obj2).forEach(function (key2) {\n var v = obj2[key2];\n if (key2 === 'img' && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isString\"])(v)) return;\n clonedObj2_1[key2] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"clone\"])(v);\n });\n clonedObj[key1] = clonedObj2_1;\n } else {\n clonedObj[key1] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"clone\"])(obj2);\n }\n });\n return clonedObj;\n};\nvar getAnimateCfgWithCallback = function getAnimateCfgWithCallback(_a) {\n var animateCfg = _a.animateCfg,\n callback = _a.callback;\n var animateConfig;\n if (!animateCfg) {\n animateConfig = {\n duration: 500,\n callback: callback\n };\n } else {\n animateConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"clone\"])(animateCfg);\n if (animateCfg.callback) {\n var animateCfgCallback_1 = animateCfg.callback;\n animateConfig.callback = function () {\n callback();\n animateCfgCallback_1();\n };\n } else {\n animateConfig.callback = callback;\n }\n }\n return animateConfig;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/graphic.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/utils/is-object.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/utils/is-object.js ***! - \******************************************************************/ -/*! exports provided: isObject */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return isObject; });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n\nfunction isObject(value) {\n var type = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value);\n\n return value != null && (type === 'object' || type === 'function');\n}\n//# sourceMappingURL=is-object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/utils/is-object.js?"); - -/***/ }), - -/***/ "./node_modules/@antv/g-webgpu-engine/es/utils/is-typedarray.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/utils/is-typedarray.js ***! - \**********************************************************************/ -/*! exports provided: isTypedArray */ +/***/ "./node_modules/@antv/g6-core/es/util/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/index.js ***! + \*****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isTypedArray\", function() { return isTypedArray; });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n/** `Object#toString` result references. */\n\nvar argsTag = '[object Arguments]';\nvar arrayTag = '[object Array]';\nvar boolTag = '[object Boolean]';\nvar dateTag = '[object Date]';\nvar errorTag = '[object Error]';\nvar funcTag = '[object Function]';\nvar mapTag = '[object Map]';\nvar numberTag = '[object Number]';\nvar objectTag = '[object Object]';\nvar regexpTag = '[object RegExp]';\nvar setTag = '[object Set]';\nvar stringTag = '[object String]';\nvar weakMapTag = '[object WeakMap]';\nvar arrayBufferTag = '[object ArrayBuffer]';\nvar dataViewTag = '[object DataView]';\nvar float32Tag = '[object Float32Array]';\nvar float64Tag = '[object Float64Array]';\nvar int8Tag = '[object Int8Array]';\nvar int16Tag = '[object Int16Array]';\nvar int32Tag = '[object Int32Array]';\nvar uint8Tag = '[object Uint8Array]';\nvar uint8ClampedTag = '[object Uint8ClampedArray]';\nvar uint16Tag = '[object Uint16Array]';\nvar uint32Tag = '[object Uint32Array]';\n/** Used to identify `toStringTag` values of typed arrays. */\n\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n\nfunction baseUnary(func) {\n return function (value) {\n return func(value);\n };\n}\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar objectToString = objectProto.toString;\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\nfunction isLength(value) {\n return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER;\n}\n\nfunction isObjectLike(value) {\n return !!value && _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value) === 'object';\n}\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n\n\nvar isTypedArray = baseIsTypedArray;\n//# sourceMappingURL=is-typedarray.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/utils/is-typedarray.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _graphic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path */ \"./node_modules/@antv/g6-core/es/util/path.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./color */ \"./node_modules/@antv/g6-core/es/util/color.js\");\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/g6-core/es/util/layout.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_7__[\"ext\"].transform;\nvar Util = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _base__WEBPACK_IMPORTED_MODULE_4__), _graphic__WEBPACK_IMPORTED_MODULE_2__), _path__WEBPACK_IMPORTED_MODULE_3__), _math__WEBPACK_IMPORTED_MODULE_1__), _color__WEBPACK_IMPORTED_MODULE_5__), _layout__WEBPACK_IMPORTED_MODULE_6__), {\n transform: transform,\n mat3: _antv_matrix_util__WEBPACK_IMPORTED_MODULE_7__[\"mat3\"]\n});\n/* harmony default export */ __webpack_exports__[\"default\"] = (Util);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js ***! - \****************************************************************/ -/*! exports provided: extractUniforms */ +/***/ "./node_modules/@antv/g6-core/es/util/layout.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/layout.js ***! + \******************************************************/ +/*! exports provided: isForce */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extractUniforms\", function() { return extractUniforms; });\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/g-webgpu-engine/es/utils/is-object.js\");\n/* harmony import */ var _is_typedarray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-typedarray */ \"./node_modules/@antv/g-webgpu-engine/es/utils/is-typedarray.js\");\n\n\n/**\n * 考虑结构体命名, eg:\n * a: { b: 1 } -> 'a.b'\n * a: [ { b: 1 } ] -> 'a[0].b'\n */\n\nfunction extractUniforms(uniforms) {\n var extractedUniforms = {};\n Object.keys(uniforms).forEach(function (uniformName) {\n extractUniformsRecursively(uniformName, uniforms[uniformName], extractedUniforms, '');\n });\n return extractedUniforms;\n}\n\nfunction extractUniformsRecursively(uniformName, uniformValue, uniforms, prefix) {\n if (uniformValue === null || typeof uniformValue === 'number' || // u_A: 1\n typeof uniformValue === 'boolean' || // u_A: false\n Array.isArray(uniformValue) && typeof uniformValue[0] === 'number' || // u_A: [1, 2, 3]\n Object(_is_typedarray__WEBPACK_IMPORTED_MODULE_1__[\"isTypedArray\"])(uniformValue) || // u_A: Float32Array\n // @ts-ignore\n uniformValue === '' || // @ts-ignore\n uniformValue.resize !== undefined) {\n uniforms[\"\".concat(prefix && prefix + '.').concat(uniformName)] = uniformValue;\n return;\n } // u_Struct.a.b.c\n\n\n if (Object(_is_object__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(uniformValue)) {\n Object.keys(uniformValue).forEach(function (childName) {\n extractUniformsRecursively(childName, // @ts-ignore\n uniformValue[childName], uniforms, \"\".concat(prefix && prefix + '.').concat(uniformName));\n });\n } // u_Struct[0].a\n\n\n if (Array.isArray(uniformValue)) {\n // @ts-ignore\n uniformValue.forEach(function (child, idx) {\n Object.keys(child).forEach(function (childName) {\n extractUniformsRecursively(childName, // @ts-ignore\n child[childName], uniforms, \"\".concat(prefix && prefix + '.').concat(uniformName, \"[\").concat(idx, \"]\"));\n });\n });\n }\n}\n//# sourceMappingURL=uniform.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isForce\", function() { return isForce; });\nvar isForce = function isForce(layoutType) {\n return layoutType === 'force' || layoutType === 'g6force' || layoutType === 'gForce' || layoutType === 'force2';\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/layout.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglAttribute.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglAttribute.js ***! - \**********************************************************************/ +/***/ "./node_modules/@antv/g6-core/es/util/letterAspectRatio.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/letterAspectRatio.js ***! + \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglAttribute; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\n/**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#attributes\n */\nvar ReglAttribute = /*#__PURE__*/function () {\n function ReglAttribute(gl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglAttribute);\n\n this.attribute = void 0;\n this.buffer = void 0;\n var buffer = options.buffer,\n offset = options.offset,\n stride = options.stride,\n normalized = options.normalized,\n size = options.size,\n divisor = options.divisor;\n this.buffer = buffer;\n this.attribute = {\n buffer: buffer.get(),\n offset: offset || 0,\n stride: stride || 0,\n normalized: normalized || false,\n divisor: divisor || 0\n };\n\n if (size) {\n this.attribute.size = size;\n }\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglAttribute, [{\n key: \"get\",\n value: function get() {\n return this.attribute;\n }\n }, {\n key: \"updateBuffer\",\n value: function updateBuffer(options) {\n this.buffer.subData(options);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.buffer.destroy();\n }\n }]);\n\n return ReglAttribute;\n}();\n\n\n//# sourceMappingURL=ReglAttribute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglAttribute.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ' ': 0.3329986572265625,\n a: 0.5589996337890625,\n A: 0.6569992065429687,\n b: 0.58599853515625,\n B: 0.6769989013671875,\n c: 0.5469985961914062,\n C: 0.7279998779296875,\n d: 0.58599853515625,\n D: 0.705999755859375,\n e: 0.554998779296875,\n E: 0.63699951171875,\n f: 0.37299957275390627,\n F: 0.5769989013671875,\n g: 0.5909988403320312,\n G: 0.7479995727539063,\n h: 0.555999755859375,\n H: 0.7199996948242188,\n i: 0.255999755859375,\n I: 0.23699951171875,\n j: 0.26699981689453123,\n J: 0.5169998168945312,\n k: 0.5289993286132812,\n K: 0.6899993896484375,\n l: 0.23499908447265624,\n L: 0.5879989624023437,\n m: 0.854998779296875,\n M: 0.8819992065429687,\n n: 0.5589996337890625,\n N: 0.7189987182617188,\n o: 0.58599853515625,\n O: 0.7669998168945312,\n p: 0.58599853515625,\n P: 0.6419998168945312,\n q: 0.58599853515625,\n Q: 0.7669998168945312,\n r: 0.3649993896484375,\n R: 0.6759994506835938,\n s: 0.504998779296875,\n S: 0.6319992065429687,\n t: 0.354998779296875,\n T: 0.6189987182617187,\n u: 0.5599990844726562,\n U: 0.7139999389648437,\n v: 0.48199920654296874,\n V: 0.6389999389648438,\n w: 0.754998779296875,\n W: 0.929998779296875,\n x: 0.5089996337890625,\n X: 0.63699951171875,\n y: 0.4959991455078125,\n Y: 0.66199951171875,\n z: 0.48699951171875,\n Z: 0.6239990234375,\n '0': 0.6,\n '1': 0.40099945068359377,\n '2': 0.6,\n '3': 0.6,\n '4': 0.6,\n '5': 0.6,\n '6': 0.6,\n '7': 0.5469985961914062,\n '8': 0.6,\n '9': 0.6,\n '[': 0.3329986572265625,\n ']': 0.3329986572265625,\n ',': 0.26399993896484375,\n '.': 0.26399993896484375,\n ';': 0.26399993896484375,\n ':': 0.26399993896484375,\n '{': 0.3329986572265625,\n '}': 0.3329986572265625,\n '\\\\': 0.5,\n '|': 0.19499969482421875,\n '=': 0.604998779296875,\n '+': 0.604998779296875,\n '-': 0.604998779296875,\n _: 0.5,\n '`': 0.3329986572265625,\n ' ~': 0.8329986572265625,\n '!': 0.3329986572265625,\n '@': 0.8579986572265625,\n '#': 0.6,\n $: 0.6,\n '%': 0.9699996948242188,\n '^': 0.517999267578125,\n '&': 0.7259994506835937,\n '*': 0.505999755859375,\n '(': 0.3329986572265625,\n ')': 0.3329986572265625,\n '<': 0.604998779296875,\n '>': 0.604998779296875,\n '/': 0.5,\n '?': 0.53699951171875\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/letterAspectRatio.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglBuffer.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglBuffer.js ***! - \*******************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-core/es/util/math.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/math.js ***! + \****************************************************/ +/*! exports provided: compare, getLineIntersect, getRectIntersectByPoint, getCircleIntersectByPoint, getEllipseIntersectByPoint, applyMatrix, invertMatrix, getCircleCenterByPoints, distance, scaleMatrix, floydWarshall, getAdjMatrix, translate, move, scale, rotate, getDegree, isPointInPolygon, intersectBBox, isPolygonsIntersect, Line, getBBoxBoundLine, itemIntersectByLine, fractionToLine, getPointsCenter, squareDist, pointLineSquareDist, isPointsOverlap, pointRectSquareDist, pointLineDistance, lerp, lerpArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglBuffer; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js\");\n\n\n\n\n/**\n * adaptor for regl.Buffer\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers\n */\n\nvar ReglBuffer = /*#__PURE__*/function () {\n function ReglBuffer(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglBuffer);\n\n this.buffer = void 0;\n var data = options.data,\n usage = options.usage,\n type = options.type; // @ts-ignore\n\n this.buffer = reGl.buffer({\n data: data,\n usage: _constants__WEBPACK_IMPORTED_MODULE_3__[\"usageMap\"][usage || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].STATIC_DRAW],\n type: _constants__WEBPACK_IMPORTED_MODULE_3__[\"dataTypeMap\"][type || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].UNSIGNED_BYTE] // length: 0,\n\n });\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglBuffer, [{\n key: \"get\",\n value: function get() {\n return this.buffer;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {// this.buffer.destroy();\n }\n }, {\n key: \"subData\",\n value: function subData(_ref) {\n var data = _ref.data,\n offset = _ref.offset;\n // @ts-ignore\n this.buffer.subdata(data, offset);\n }\n }]);\n\n return ReglBuffer;\n}();\n\n\n//# sourceMappingURL=ReglBuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglBuffer.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compare\", function() { return compare; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLineIntersect\", function() { return getLineIntersect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRectIntersectByPoint\", function() { return getRectIntersectByPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCircleIntersectByPoint\", function() { return getCircleIntersectByPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getEllipseIntersectByPoint\", function() { return getEllipseIntersectByPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyMatrix\", function() { return applyMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invertMatrix\", function() { return invertMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCircleCenterByPoints\", function() { return getCircleCenterByPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleMatrix\", function() { return scaleMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floydWarshall\", function() { return floydWarshall; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAdjMatrix\", function() { return getAdjMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"move\", function() { return move; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDegree\", function() { return getDegree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPointInPolygon\", function() { return isPointInPolygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersectBBox\", function() { return intersectBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPolygonsIntersect\", function() { return isPolygonsIntersect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Line\", function() { return Line; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxBoundLine\", function() { return getBBoxBoundLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itemIntersectByLine\", function() { return itemIntersectByLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fractionToLine\", function() { return fractionToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPointsCenter\", function() { return getPointsCenter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squareDist\", function() { return squareDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointLineSquareDist\", function() { return pointLineSquareDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPointsOverlap\", function() { return isPointsOverlap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointRectSquareDist\", function() { return pointRectSquareDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointLineDistance\", function() { return pointLineDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerpArray\", function() { return lerpArray; });\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"ext\"].transform;\n/**\n * 对比对象,用于对象数组排序\n * @param {string} attributeName 排序依据的字段名称\n * @param {number} min 最小值\n * @param {number} max 最大值\n * @return {boolean} bool 布尔\n */\nvar compare = function compare(attributeName) {\n return function (m, n) {\n return m[attributeName] - n[attributeName];\n };\n};\n/**\n * 是否在区间内\n * @param {number} value 值\n * @param {number} min 最小值\n * @param {number} max 最大值\n * @return {boolean} bool 布尔\n */\nvar isBetween = function isBetween(value, min, max) {\n return value >= min && value <= max;\n};\n/**\n * 获取两条线段的交点\n * @param {Point} p0 第一条线段起点\n * @param {Point} p1 第一条线段终点\n * @param {Point} p2 第二条线段起点\n * @param {Point} p3 第二条线段终点\n * @return {Point} 交点\n */\nvar getLineIntersect = function getLineIntersect(p0, p1, p2, p3) {\n var tolerance = 0.0001;\n var E = {\n x: p2.x - p0.x,\n y: p2.y - p0.y\n };\n var D0 = {\n x: p1.x - p0.x,\n y: p1.y - p0.y\n };\n var D1 = {\n x: p3.x - p2.x,\n y: p3.y - p2.y\n };\n var kross = D0.x * D1.y - D0.y * D1.x;\n var sqrKross = kross * kross;\n var invertKross = 1 / kross;\n var sqrLen0 = D0.x * D0.x + D0.y * D0.y;\n var sqrLen1 = D1.x * D1.x + D1.y * D1.y;\n if (sqrKross > tolerance * sqrLen0 * sqrLen1) {\n var s = (E.x * D1.y - E.y * D1.x) * invertKross;\n var t = (E.x * D0.y - E.y * D0.x) * invertKross;\n if (!isBetween(s, 0, 1) || !isBetween(t, 0, 1)) return null;\n return {\n x: p0.x + s * D0.x,\n y: p0.y + s * D0.y\n };\n }\n return null;\n};\n/**\n * point and rectangular intersection point\n * @param {IRect} rect rect\n * @param {Point} point point\n * @return {PointPoint} rst;\n */\nvar getRectIntersectByPoint = function getRectIntersectByPoint(rect, point) {\n var x = rect.x,\n y = rect.y,\n width = rect.width,\n height = rect.height;\n var cx = x + width / 2;\n var cy = y + height / 2;\n var points = [];\n var center = {\n x: cx,\n y: cy\n };\n points.push({\n x: x,\n y: y\n });\n points.push({\n x: x + width,\n y: y\n });\n points.push({\n x: x + width,\n y: y + height\n });\n points.push({\n x: x,\n y: y + height\n });\n points.push({\n x: x,\n y: y\n });\n var rst = null;\n for (var i = 1; i < points.length; i++) {\n rst = getLineIntersect(points[i - 1], points[i], center, point);\n if (rst) {\n break;\n }\n }\n return rst;\n};\n/**\n * get point and circle inIntersect\n * @param {ICircle} circle 圆点,x,y,r\n * @param {Point} point 点 x,y\n * @return {Point} applied point\n */\nvar getCircleIntersectByPoint = function getCircleIntersectByPoint(circle, point) {\n var cx = circle.x,\n cy = circle.y,\n r = circle.r;\n var x = point.x,\n y = point.y;\n var dx = x - cx;\n var dy = y - cy;\n if (dx * dx + dy * dy < r * r) {\n return null;\n }\n var angle = Math.atan(dy / dx);\n return {\n x: cx + Math.abs(r * Math.cos(angle)) * Math.sign(dx),\n y: cy + Math.abs(r * Math.sin(angle)) * Math.sign(dy)\n };\n};\n/**\n * get point and ellipse inIntersect\n * @param {Object} ellipse 椭圆 x,y,rx,ry\n * @param {Object} point 点 x,y\n * @return {object} applied point\n */\nvar getEllipseIntersectByPoint = function getEllipseIntersectByPoint(ellipse, point) {\n var a = ellipse.rx;\n var b = ellipse.ry;\n var cx = ellipse.x;\n var cy = ellipse.y;\n var dx = point.x - cx;\n var dy = point.y - cy;\n // 直接通过 x,y 求夹角,求出来的范围是 -PI, PI\n var angle = Math.atan2(dy / b, dx / a);\n if (angle < 0) {\n angle += 2 * Math.PI; // 转换到 0,2PI\n }\n\n return {\n x: cx + a * Math.cos(angle),\n y: cy + b * Math.sin(angle)\n };\n};\n/**\n * coordinate matrix transformation\n * @param {number} point coordinate\n * @param {Matrix} matrix matrix\n * @param {number} tag could be 0 or 1\n * @return {Point} transformed point\n */\nvar applyMatrix = function applyMatrix(point, matrix, tag) {\n if (tag === void 0) {\n tag = 1;\n }\n var vector = [point.x, point.y, tag];\n if (!matrix || isNaN(matrix[0])) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat3(vector, vector, matrix);\n return {\n x: vector[0],\n y: vector[1]\n };\n};\n/**\n * coordinate matrix invert transformation\n * @param {number} point coordinate\n * @param {number} matrix matrix\n * @param {number} tag could be 0 or 1\n * @return {object} transformed point\n */\nvar invertMatrix = function invertMatrix(point, matrix, tag) {\n if (tag === void 0) {\n tag = 1;\n }\n if (!matrix || isNaN(matrix[0])) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var inversedMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert([1, 0, 0, 0, 1, 0, 0, 0, 1], matrix);\n if (!inversedMatrix) {\n inversedMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var vector = [point.x, point.y, tag];\n _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat3(vector, vector, inversedMatrix);\n return {\n x: vector[0],\n y: vector[1]\n };\n};\n/**\n *\n * @param p1 First coordinate\n * @param p2 second coordinate\n * @param p3 three coordinate\n */\nvar getCircleCenterByPoints = function getCircleCenterByPoints(p1, p2, p3) {\n var a = p1.x - p2.x;\n var b = p1.y - p2.y;\n var c = p1.x - p3.x;\n var d = p1.y - p3.y;\n var e = (p1.x * p1.x - p2.x * p2.x - p2.y * p2.y + p1.y * p1.y) / 2;\n var f = (p1.x * p1.x - p3.x * p3.x - p3.y * p3.y + p1.y * p1.y) / 2;\n var denominator = b * c - a * d;\n return {\n x: -(d * e - b * f) / denominator,\n y: -(a * f - c * e) / denominator\n };\n};\n/**\n * get distance by two points\n * @param p1 first point\n * @param p2 second point\n */\nvar distance = function distance(p1, p2) {\n var vx = p1.x - p2.x;\n var vy = p1.y - p2.y;\n return Math.sqrt(vx * vx + vy * vy);\n};\n/**\n * scale matrix\n * @param matrix [ [], [], [] ]\n * @param ratio\n */\nvar scaleMatrix = function scaleMatrix(matrix, ratio) {\n var result = [];\n matrix.forEach(function (row) {\n var newRow = [];\n row.forEach(function (v) {\n newRow.push(v * ratio);\n });\n result.push(newRow);\n });\n return result;\n};\n/**\n * Floyd Warshall algorithm for shortest path distances matrix\n * @param {array} adjMatrix adjacency matrix\n * @return {array} distances shortest path distances matrix\n */\nvar floydWarshall = function floydWarshall(adjMatrix) {\n // initialize\n var dist = [];\n var size = adjMatrix.length;\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n } else if (adjMatrix[i][j] === 0 || !adjMatrix[i][j]) {\n dist[i][j] = Infinity;\n } else {\n dist[i][j] = adjMatrix[i][j];\n }\n }\n }\n // floyd\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n return dist;\n};\n/**\n * get adjacency matrix\n * @param data graph data\n * @param directed whether it's a directed graph\n */\nvar getAdjMatrix = function getAdjMatrix(data, directed) {\n var nodes = data.nodes,\n edges = data.edges;\n var matrix = [];\n // map node with index in data.nodes\n var nodeMap = {};\n if (!nodes) {\n throw new Error('invalid nodes data!');\n }\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n if (edges) {\n edges.forEach(function (e) {\n var source = e.source,\n target = e.target;\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n matrix[sIndex][tIndex] = 1;\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n return matrix;\n};\n/**\n * 平移group\n * @param group Group 实例\n * @param vec 移动向量\n */\nvar translate = function translate(group, vec) {\n group.translate(vec.x, vec.y);\n};\n/**\n * 移动到指定坐标点\n * @param group Group 实例\n * @param point 移动到的坐标点\n */\nvar move = function move(group, point, animate, animateCfg) {\n if (animateCfg === void 0) {\n animateCfg = {\n duration: 500\n };\n }\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var bbox = group.getCanvasBBox();\n var vx = point.x - bbox.minX;\n var vy = point.y - bbox.minY;\n if (animate) {\n var dx_1 = vx * matrix[0];\n var dy_1 = vy * matrix[4];\n var lastX_1 = 0;\n var lastY_1 = 0;\n var newX_1 = 0;\n var newY_1 = 0;\n group.animate(function (ratio) {\n newX_1 = dx_1 * ratio;\n newY_1 = dy_1 * ratio;\n matrix = transform(matrix, [['t', newX_1 - lastX_1, newY_1 - lastY_1]]);\n lastX_1 = newX_1;\n lastY_1 = newY_1;\n return {\n matrix: matrix\n };\n }, animateCfg);\n } else {\n var movedMatrix = transform(matrix, [['t', vx, vy]]);\n group.setMatrix(movedMatrix);\n }\n};\n/**\n * 缩放 group\n * @param group Group 实例\n * @param point 在x 和 y 方向上的缩放比例\n */\nvar scale = function scale(group, ratio) {\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var scaleXY = ratio;\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(ratio)) {\n scaleXY = [ratio, ratio];\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(ratio) && ratio.length === 1) {\n scaleXY = [ratio[0], ratio[0]];\n }\n matrix = transform(matrix, [['s', scaleXY[0], scaleXY[1]]]);\n group.setMatrix(matrix);\n};\n/**\n *\n * @param group Group 实例\n * @param ratio 选择角度\n */\nvar rotate = function rotate(group, angle) {\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n matrix = transform(matrix, [['r', angle]]);\n group.setMatrix(matrix);\n};\nvar getDegree = function getDegree(n, nodeIdxMap, edges) {\n var degrees = [];\n for (var i = 0; i < n; i++) {\n degrees[i] = 0;\n }\n edges.forEach(function (e) {\n if (e.source) {\n degrees[nodeIdxMap[e.source]] += 1;\n }\n if (e.target) {\n degrees[nodeIdxMap[e.target]] += 1;\n }\n });\n return degrees;\n};\n// 判断点Q是否在p1和p2的线段上\nfunction onSegment(p1, p2, q) {\n 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])) {\n return true;\n }\n return false;\n}\n/**\n * 判断点P在多边形内-射线法. Borrow from https://github.com/antvis/util/blob/master/packages/path-util/src/point-in-polygon.ts\n * @param points\n * @param x\n * @param y\n */\nvar isPointInPolygon = function isPointInPolygon(points, x, y) {\n var isHit = false;\n var n = points.length;\n // 判断两个double在eps精度下的大小关系\n var tolerance = 1e-6;\n function dcmp(xValue) {\n if (Math.abs(xValue) < tolerance) {\n return 0;\n }\n return xValue < 0 ? -1 : 1;\n }\n if (n <= 2) {\n // svg 中点小于 3 个时,不显示,也无法被拾取\n return false;\n }\n for (var i = 0; i < n; i++) {\n var p1 = points[i];\n var p2 = points[(i + 1) % n];\n if (onSegment(p1, p2, [x, y])) {\n // 点在多边形一条边上\n return true;\n }\n // 前一个判断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) {\n isHit = !isHit;\n }\n }\n return isHit;\n};\n// 判断两个BBox是否相交\nvar intersectBBox = function intersectBBox(box1, box2) {\n return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);\n};\nvar lineIntersectPolygon = function lineIntersectPolygon(lines, line) {\n var isIntersect = false;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(lines, function (l) {\n if (getLineIntersect(l.from, l.to, line.from, line.to)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n};\n/**\n * 判断两个polygon是否相交。\n * borrow from @antv/path-util\n * @param points1 polygon1的顶点数组\n * @param points2 polygon2的顶点数组\n */\nvar isPolygonsIntersect = function isPolygonsIntersect(points1, points2) {\n var getBBox = function getBBox(points) {\n var xArr = points.map(function (p) {\n return p[0];\n });\n var yArr = points.map(function (p) {\n return p[1];\n });\n return {\n minX: Math.min.apply(null, xArr),\n maxX: Math.max.apply(null, xArr),\n minY: Math.min.apply(null, yArr),\n maxY: Math.max.apply(null, yArr)\n };\n };\n var parseToLines = function parseToLines(points) {\n var lines = [];\n var count = points.length;\n for (var i = 0; i < count - 1; i++) {\n var point = points[i];\n var next = points[i + 1];\n lines.push({\n from: {\n x: point[0],\n y: point[1]\n },\n to: {\n x: next[0],\n y: next[1]\n }\n });\n }\n if (lines.length > 1) {\n var first = points[0];\n var last = points[count - 1];\n lines.push({\n from: {\n x: last[0],\n y: last[1]\n },\n to: {\n x: first[0],\n y: first[1]\n }\n });\n }\n return lines;\n };\n // 空数组,或者一个点返回 false\n if (points1.length < 2 || points2.length < 2) {\n return false;\n }\n var bbox1 = getBBox(points1);\n var bbox2 = getBBox(points2);\n // 判定包围盒是否相交,比判定点是否在多边形内要快的多,可以筛选掉大多数情况\n if (!intersectBBox(bbox1, bbox2)) {\n return false;\n }\n var isIn = false;\n // 判定点是否在多边形内部,一旦有一个点在另一个多边形内,则返回\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points2, function (point) {\n if (isPointInPolygon(points1, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points1, function (point) {\n if (isPointInPolygon(points2, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n var lines1 = parseToLines(points1);\n var lines2 = parseToLines(points2);\n var isIntersect = false;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(lines2, function (line) {\n if (lineIntersectPolygon(lines1, line)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n};\nvar Line = /** @class */function () {\n function Line(x1, y1, x2, y2) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n }\n Line.prototype.getBBox = function () {\n var minX = Math.min(this.x1, this.x2);\n var minY = Math.min(this.y1, this.y2);\n var maxX = Math.max(this.x1, this.x2);\n var maxY = Math.max(this.y1, this.y2);\n var res = {\n x: minX,\n y: minY,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n width: maxX - minX,\n height: maxY - minY\n };\n return res;\n };\n return Line;\n}();\n\nvar getBBoxBoundLine = function getBBoxBoundLine(bbox, direction) {\n var bounds = {\n top: [bbox.minX, bbox.minY, bbox.maxX, bbox.minY],\n left: [bbox.minX, bbox.minY, bbox.minX, bbox.maxY],\n bottom: [bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY],\n right: [bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY]\n };\n return bounds[direction];\n};\n/**\n * 计算两条线段相交时,相交点对第一条线段上的分割比例\n */\nvar fractionAlongLineA = function fractionAlongLineA(la, lb) {\n var uaT = (lb.x2 - lb.x1) * (la.y1 - lb.y1) - (lb.y2 - lb.y1) * (la.x1 - lb.x1);\n var ubT = (la.x2 - la.x1) * (la.y1 - lb.y1) - (la.y2 - la.y1) * (la.x1 - lb.x1);\n var uB = (lb.y2 - lb.y1) * (la.x2 - la.x1) - (lb.x2 - lb.x1) * (la.y2 - la.y1);\n if (uB) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return ua;\n }\n }\n return Number.POSITIVE_INFINITY;\n};\nvar itemIntersectByLine = function itemIntersectByLine(item, line) {\n var directions = ['top', 'left', 'bottom', 'right'];\n var bbox = item.getBBox();\n var countIntersections = 0;\n var intersections = [];\n for (var i = 0; i < 4; i++) {\n var _a = getBBoxBoundLine(bbox, directions[i]),\n x1 = _a[0],\n y1 = _a[1],\n x2 = _a[2],\n y2 = _a[3];\n intersections[i] = getLineIntersect({\n x: line.x1,\n y: line.y1\n }, {\n x: line.x2,\n y: line.y2\n }, {\n x: x1,\n y: y1\n }, {\n x: x2,\n y: y2\n });\n if (intersections[i]) {\n countIntersections += 1;\n }\n }\n return [intersections, countIntersections];\n};\nvar fractionToLine = function fractionToLine(item, line) {\n var directions = ['top', 'left', 'bottom', 'right'];\n var bbox = item.getBBox();\n var minDistance = Number.POSITIVE_INFINITY;\n var countIntersections = 0;\n for (var i = 0; i < 4; i++) {\n var _a = getBBoxBoundLine(bbox, directions[i]),\n x1 = _a[0],\n y1 = _a[1],\n x2 = _a[2],\n y2 = _a[3];\n var testDistance = fractionAlongLineA(line, new Line(x1, y1, x2, y2));\n testDistance = Math.abs(testDistance - 0.5);\n if (testDistance >= 0 && testDistance <= 1) {\n countIntersections += 1;\n minDistance = testDistance < minDistance ? testDistance : minDistance;\n }\n }\n if (countIntersections === 0) return -1;\n return minDistance;\n};\nvar getPointsCenter = function getPointsCenter(points) {\n var centerX = 0;\n var centerY = 0;\n if (points.length > 0) {\n for (var _i = 0, points_1 = points; _i < points_1.length; _i++) {\n var point = points_1[_i];\n centerX += point.x;\n centerY += point.y;\n }\n centerX /= points.length;\n centerY /= points.length;\n }\n return {\n x: centerX,\n y: centerY\n };\n};\nvar squareDist = function squareDist(a, b) {\n return Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2);\n};\nvar pointLineSquareDist = function pointLineSquareDist(point, line) {\n var x1 = line.x1;\n var y1 = line.y1;\n var x2 = line.x2 - x1;\n var y2 = line.y2 - y1;\n var px = point.x - x1;\n var py = point.y - y1;\n var dotprod = px * x2 + py * y2;\n var projlenSq;\n if (dotprod <= 0) {\n projlenSq = 0;\n } else {\n px = x2 - px;\n py = y2 - py;\n dotprod = px * x2 + py * y2;\n if (dotprod <= 0) {\n projlenSq = 0;\n } else {\n projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2);\n }\n }\n var lenSq = px * px + py * py - projlenSq;\n if (lenSq < 0) {\n lenSq = 0;\n }\n return lenSq;\n};\nvar isPointsOverlap = function isPointsOverlap(p1, p2, e) {\n if (e === void 0) {\n e = 1e-3;\n }\n return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2) < Math.pow(e, 2);\n};\n/**\n * 点到矩形的距离的平方:矩形内部点视作距离为0,外部的点若投影落在矩形边上则为点到矩形边的最近的垂直距离,否则为点到矩形顶点的距离,\n * @param point IPoint\n * @param rect IRect\n */\nvar pointRectSquareDist = function pointRectSquareDist(point, rect) {\n var isLeft = point.x < rect.x;\n var isRight = point.x > rect.x + rect.width;\n var isTop = point.y > rect.y + rect.height;\n var isBottom = point.y < rect.y;\n var isPointOutside = isLeft || isRight || isTop || isBottom;\n if (!isPointOutside) {\n return 0;\n }\n if (isTop && !isLeft && !isRight) {\n return Math.pow(rect.y + rect.height - point.y, 2);\n }\n if (isBottom && !isLeft && !isRight) {\n return Math.pow(point.y - rect.y, 2);\n }\n if (isLeft && !isTop && !isBottom) {\n return Math.pow(rect.x - point.x, 2);\n }\n if (isRight && !isTop && !isBottom) {\n return Math.pow(rect.x + rect.width - point.x, 2);\n }\n var dx = Math.min(Math.abs(rect.x - point.x), Math.abs(rect.x + rect.width - point.x));\n var dy = Math.min(Math.abs(rect.y - point.y), Math.abs(rect.y + rect.height - point.y));\n return dx * dx + dy * dy;\n};\n/**\n * point to line distance\n * @param {array} line 线的四个顶点 [x1, y1, x2, y2]\n * @param {object} point 坐标点 {x, y}\n * @return {Number|NaN} distance\n */\nvar pointLineDistance = function pointLineDistance(line, point) {\n var x1 = line[0],\n y1 = line[1],\n x2 = line[2],\n y2 = line[3];\n var x = point.x,\n y = point.y;\n var d = [x2 - x1, y2 - y1];\n if (_antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].exactEquals(d, [0, 0])) {\n return NaN;\n }\n var u = [-d[1], d[0]];\n // @ts-ignore\n _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize(u, u);\n var a = [x - x1, y - y1];\n // @ts-ignore\n return Math.abs(_antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].dot(a, u));\n};\n/**\n * Linearly interpolate between start and end, where alpha is the percent distance along the line.\n * alpha = 0 will be start, and alpha = 1 will be end.\n * @param {number} start\n * @param {number} end\n * @param {number} alpha interpolation factor, typically in the closed interval [0, 1]\n * @returns {number}\n */\nvar lerp = function lerp(start, end, alpha) {\n return start + (end - start) * alpha;\n};\n/**\n * Linearly interpolate between start and end arrays, where alpha is the percent distance along the line.\n * alpha = 0 will be start, and alpha = 1 will be end.\n * @param {number[]} start\n * @param {number[]} end\n * @param {number} alpha interpolation factor, typically in the closed interval [0, 1]\n * @returns {number[]}\n */\nvar lerpArray = function lerpArray(start, end, alpha) {\n var len = Math.min(start.length, end.length);\n var out = new Array(len);\n for (var i = 0; i < len; i++) {\n out[i] = lerp(start[i], end[i], alpha);\n }\n return out;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/math.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglComputeModel.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglComputeModel.js ***! - \*************************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-core/es/util/path.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/path.js ***! + \****************************************************/ +/*! exports provided: getSpline, getControlPoint, pointsToPolygon, pathToPoints, getClosedSpline, roundedHull, paddedHull, getStarPath */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglComputeModel; });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _utils_is_typedarray__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/is-typedarray */ \"./node_modules/@antv/g-webgpu-engine/es/utils/is-typedarray.js\");\n\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\n/* babel-plugin-inline-import './shaders/quad.vert.glsl' */\nvar quadVert = \"attribute vec3 a_Position;\\nattribute vec2 a_TexCoord;\\n\\nvarying vec2 v_TexCoord;\\n\\nvoid main() {\\n gl_Position = vec4(a_Position, 1.0);\\n v_TexCoord = a_TexCoord;\\n}\";\nvar textureId = 0;\nvar debug = false;\n/**\n * adaptor for regl.DrawCommand\n */\n\nvar ReglComputeModel = /*#__PURE__*/function () {\n function ReglComputeModel(reGl, context) {\n var _this = this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this, ReglComputeModel);\n\n this.reGl = reGl;\n this.context = context;\n this.entity = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__[\"createEntity\"])();\n this.texFBO = void 0;\n this.computeCommand = void 0;\n this.textureCache = {};\n this.outputTextureName = void 0;\n this.swapOutputTextureName = void 0;\n this.compiledPingpong = void 0;\n this.dynamicPingpong = void 0;\n var uniforms = {};\n this.context.uniforms.forEach(function (uniform) {\n var name = uniform.name,\n type = uniform.type,\n data = uniform.data,\n isReferer = uniform.isReferer,\n storageClass = uniform.storageClass; // store data with a 2D texture\n\n if (storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__[\"STORAGE_CLASS\"].StorageBuffer) {\n if (!isReferer) {\n _this.textureCache[name] = _this.calcDataTexture(name, type, data);\n var _this$textureCache$na = _this.textureCache[name],\n width = _this$textureCache$na.textureWidth,\n isOutput = _this$textureCache$na.isOutput;\n uniforms[\"\".concat(name, \"Size\")] = [width, width];\n\n if (isOutput) {\n _this.outputTextureName = name;\n\n if (_this.context.needPingpong) {\n _this.outputTextureName = \"\".concat(name, \"Output\");\n _this.textureCache[_this.outputTextureName] = _this.calcDataTexture(name, type, data);\n }\n }\n } else {\n // @ts-ignore\n _this.textureCache[name] = {\n data: undefined\n }; // refer to another kernel's output,\n // the referred kernel may not have been initialized, so we use dynamic way here\n\n uniforms[\"\".concat(name, \"Size\")] = function () {\n return (// @ts-ignore\n data.compiledBundle.context.output.textureSize\n );\n };\n }\n\n uniforms[name] = function () {\n if (debug) {\n console.log(\"[\".concat(_this.entity, \"]: \").concat(name, \" \").concat(_this.textureCache[name].id));\n }\n\n return _this.textureCache[name].texture;\n };\n } else if (storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__[\"STORAGE_CLASS\"].Uniform) {\n if (data && (Array.isArray(data) || Object(_utils_is_typedarray__WEBPACK_IMPORTED_MODULE_7__[\"isTypedArray\"])(data)) && data.length > 16) {\n // up to mat4 which includes 16 elements\n throw new Error(\"invalid data type \".concat(type));\n } // get uniform dynamically\n\n\n uniforms[name] = function () {\n return uniform.data;\n };\n }\n });\n\n var _this$getOuputDataTex = this.getOuputDataTexture(),\n textureWidth = _this$getOuputDataTex.textureWidth,\n texelCount = _this$getOuputDataTex.texelCount; // 传入 output 纹理尺寸和数据长度,便于多余的 texel 提前退出\n\n\n uniforms.u_OutputTextureSize = [textureWidth, textureWidth];\n uniforms.u_OutputTexelCount = texelCount; // 保存在 Kernel 的上下文中,供其他 Kernel 引用\n\n this.context.output.textureSize = [textureWidth, textureWidth];\n var drawParams = {\n attributes: {\n a_Position: [[-1, 1, 0], [-1, -1, 0], [1, 1, 0], [1, -1, 0]],\n a_TexCoord: [[0, 1], [0, 0], [1, 1], [1, 0]]\n },\n frag: \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n#else\\n precision mediump float;\\n#endif\\n\".concat(this.context.shader),\n uniforms: uniforms,\n vert: quadVert,\n // TODO: use a fullscreen triangle instead.\n primitive: 'triangle strip',\n count: 4\n };\n this.computeCommand = this.reGl(drawParams);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default()(ReglComputeModel, [{\n key: \"run\",\n value: function run() {\n var _this2 = this;\n\n if (this.context.maxIteration > 1 && this.context.needPingpong) {\n this.compiledPingpong = true;\n } // need pingpong when (@in@out and execute(10)) or use `setBinding('out', self)`\n // this.needPingpong =\n // !!(this.context.maxIteration > 1 && this.context.needPingpong);\n // if (this.relativeOutputTextureNames.length) {\n // const { id, texture } = this.getOuputDataTexture();\n // this.relativeOutputTextureNames.forEach((name) => {\n // this.textureCache[name].id = id;\n // this.textureCache[name].texture = texture;\n // });\n // this.swap();\n // }\n\n\n if (this.compiledPingpong || this.dynamicPingpong) {\n this.swap();\n }\n\n this.texFBO = this.reGl.framebuffer({\n color: this.getOuputDataTexture().texture\n });\n this.texFBO.use(function () {\n _this2.computeCommand();\n });\n\n if (debug) {\n console.log(\"[\".concat(this.entity, \"]: output \").concat(this.getOuputDataTexture().id));\n }\n }\n }, {\n key: \"readData\",\n value: function () {\n var _readData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_3___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee() {\n var _this3 = this;\n\n var pixels, _this$getOuputDataTex2, originalDataLength, elementsPerTexel, _this$getOuputDataTex3, typedArrayConstructor, formattedPixels, i;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n this.reGl({\n framebuffer: this.texFBO\n })(function () {\n pixels = _this3.reGl.read();\n }); // @ts-ignore\n\n if (!pixels) {\n _context.next = 6;\n break;\n }\n\n _this$getOuputDataTex2 = this.getOuputDataTexture(), originalDataLength = _this$getOuputDataTex2.originalDataLength, elementsPerTexel = _this$getOuputDataTex2.elementsPerTexel, _this$getOuputDataTex3 = _this$getOuputDataTex2.typedArrayConstructor, typedArrayConstructor = _this$getOuputDataTex3 === void 0 ? Float32Array : _this$getOuputDataTex3;\n formattedPixels = [];\n\n if (elementsPerTexel !== 4) {\n for (i = 0; i < pixels.length; i += 4) {\n if (elementsPerTexel === 1) {\n formattedPixels.push(pixels[i]);\n } else if (elementsPerTexel === 2) {\n formattedPixels.push(pixels[i], pixels[i + 1]);\n } else {\n formattedPixels.push(pixels[i], pixels[i + 1], pixels[i + 2]);\n }\n }\n } else {\n // @ts-ignore\n formattedPixels = pixels;\n } // 截取多余的部分\n // @ts-ignore\n\n\n return _context.abrupt(\"return\", new typedArrayConstructor(formattedPixels.slice(0, originalDataLength)));\n\n case 6:\n return _context.abrupt(\"return\", new Float32Array());\n\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function readData() {\n return _readData.apply(this, arguments);\n }\n\n return readData;\n }()\n }, {\n key: \"confirmInput\",\n value: function confirmInput(model, inputName) {\n var inputModel; // refer to self, same as pingpong\n\n if (this.entity === model.entity) {\n this.dynamicPingpong = true;\n inputModel = this;\n } else {\n inputModel = model;\n }\n\n this.textureCache[inputName].id = inputModel.getOuputDataTexture().id;\n this.textureCache[inputName].texture = inputModel.getOuputDataTexture().texture;\n\n if (debug) {\n console.log(\"[\".concat(this.entity, \"]: confirm input \").concat(inputName, \" from model \").concat(inputModel.entity, \", \").concat(inputModel.getOuputDataTexture().id));\n }\n }\n }, {\n key: \"updateUniform\",\n value: function updateUniform() {// already get uniform's data dynamically when created, do nothing here\n }\n }, {\n key: \"updateBuffer\",\n value: function updateBuffer(bufferName, data) {\n var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n // regenerate data texture\n var buffer = this.context.uniforms.find(function (_ref) {\n var name = _ref.name;\n return name === bufferName;\n });\n\n if (buffer) {\n var _this$calcDataTexture = this.calcDataTexture(bufferName, buffer.type, data),\n texture = _this$calcDataTexture.texture,\n paddingData = _this$calcDataTexture.data; // TODO: destroy outdated texture\n\n\n this.textureCache[bufferName].data = paddingData;\n this.textureCache[bufferName].texture = texture;\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {// regl will destroy all resources\n }\n }, {\n key: \"swap\",\n value: function swap() {\n if (!this.swapOutputTextureName) {\n this.createSwapOutputDataTexture();\n }\n\n if (this.compiledPingpong) {\n var outputTextureUniformName = this.context.output.name;\n this.textureCache[outputTextureUniformName].id = this.getOuputDataTexture().id;\n this.textureCache[outputTextureUniformName].texture = this.getOuputDataTexture().texture;\n }\n\n var tmp = this.outputTextureName;\n this.outputTextureName = this.swapOutputTextureName;\n this.swapOutputTextureName = tmp;\n\n if (debug) {\n console.log(\"[\".concat(this.entity, \"]: after swap, output \").concat(this.getOuputDataTexture().id));\n }\n }\n }, {\n key: \"getOuputDataTexture\",\n value: function getOuputDataTexture() {\n return this.textureCache[this.outputTextureName];\n }\n }, {\n key: \"createSwapOutputDataTexture\",\n value: function createSwapOutputDataTexture() {\n var texture = this.cloneDataTexture(this.getOuputDataTexture());\n this.swapOutputTextureName = \"\".concat(this.entity, \"-swap\");\n this.textureCache[this.swapOutputTextureName] = texture;\n }\n }, {\n key: \"cloneDataTexture\",\n value: function cloneDataTexture(texture) {\n var data = texture.data,\n textureWidth = texture.textureWidth;\n return _objectSpread(_objectSpread({}, texture), {}, {\n id: textureId++,\n // @ts-ignore\n texture: this.reGl.texture({\n width: textureWidth,\n height: textureWidth,\n data: data,\n type: 'float'\n })\n });\n }\n }, {\n key: \"calcDataTexture\",\n value: function calcDataTexture(name, type, data) {\n var elementsPerTexel = 1;\n\n if (type === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__[\"AST_TOKEN_TYPES\"].Vector4FloatArray) {\n elementsPerTexel = 4;\n } // 用 0 补全不足 vec4 的部分\n\n\n var paddingData = [];\n\n for (var i = 0; i < data.length; i += elementsPerTexel) {\n if (elementsPerTexel === 1) {\n paddingData.push(data[i], 0, 0, 0);\n } else if (elementsPerTexel === 2) {\n paddingData.push(data[i], data[i + 1], 0, 0);\n } else if (elementsPerTexel === 3) {\n paddingData.push(data[i], data[i + 1], data[i + 2], 0);\n } else if (elementsPerTexel === 4) {\n paddingData.push(data[i], data[i + 1], data[i + 2], data[i + 3]);\n }\n } // 使用纹理存储,例如 Array(8) 使用 3 * 3 纹理,末尾空白使用 0 填充\n\n\n var originalDataLength = data.length;\n var texelCount = Math.ceil(originalDataLength / elementsPerTexel);\n var width = Math.ceil(Math.sqrt(texelCount));\n var paddingTexelCount = width * width;\n\n if (texelCount < paddingTexelCount) {\n paddingData.push.apply(paddingData, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(new Array((paddingTexelCount - texelCount) * 4).fill(0)));\n }\n\n var texture = this.reGl.texture({\n width: width,\n height: width,\n data: paddingData,\n type: 'float'\n });\n return {\n id: textureId++,\n data: paddingData,\n originalDataLength: originalDataLength,\n typedArrayConstructor: Object(_utils_is_typedarray__WEBPACK_IMPORTED_MODULE_7__[\"isTypedArray\"])(data) ? data.constructor : undefined,\n textureWidth: width,\n texture: texture,\n texelCount: texelCount,\n elementsPerTexel: elementsPerTexel,\n isOutput: name === this.context.output.name\n };\n }\n }]);\n\n return ReglComputeModel;\n}();\n\n\n//# sourceMappingURL=ReglComputeModel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglComputeModel.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSpline\", function() { return getSpline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getControlPoint\", function() { return getControlPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointsToPolygon\", function() { return pointsToPolygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pathToPoints\", function() { return pathToPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getClosedSpline\", function() { return getClosedSpline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"roundedHull\", function() { return roundedHull; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"paddedHull\", function() { return paddedHull; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getStarPath\", function() { return getStarPath; });\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_path_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/path-util */ \"./node_modules/@antv/path-util/esm/index.js\");\n\n\n/**\n * 替换字符串中的字段\n * @param {String} str 模版字符串\n * @param {Object} o json data\n */\nvar substitute = function substitute(str, o) {\n if (!str || !o) {\n return str;\n }\n return str.replace(/\\\\?\\{([^{}]+)\\}/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.slice(1);\n }\n var res = o[name];\n if (res === 0) res = '0';\n return res || '';\n });\n};\n/**\n * 给定坐标获取三次贝塞尔曲线的 M 及 C 值\n * @param points coordinate set\n */\nvar getSpline = function getSpline(points) {\n var data = [];\n if (points.length < 2) {\n throw new Error(\"point length must largn than 2, now it's \".concat(points.length));\n }\n for (var _i = 0, points_1 = points; _i < points_1.length; _i++) {\n var point = points_1[_i];\n var x = point.x,\n y = point.y;\n data.push(x);\n data.push(y);\n }\n var spliePath = Object(_antv_path_util__WEBPACK_IMPORTED_MODULE_1__[\"catmullRom2Bezier\"])(data);\n spliePath.unshift(['M', points[0].x, points[0].y]);\n return spliePath;\n};\n/**\n * 根据起始点、相对位置、偏移量计算控制点\n * @param {IPoint} startPoint 起始点,包含 x,y\n * @param {IPoint} endPoint 结束点, 包含 x,y\n * @param {Number} percent 相对位置,范围 0-1\n * @param {Number} offset 偏移量\n * @return {IPoint} 控制点,包含 x,y\n */\nvar getControlPoint = function getControlPoint(startPoint, endPoint, percent, offset) {\n if (percent === void 0) {\n percent = 0;\n }\n if (offset === void 0) {\n offset = 0;\n }\n var point = {\n x: (1 - percent) * startPoint.x + percent * endPoint.x,\n y: (1 - percent) * startPoint.y + percent * endPoint.y\n };\n var tangent = [0, 0];\n _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize(tangent, [endPoint.x - startPoint.x, endPoint.y - startPoint.y]);\n if (!tangent || !tangent[0] && !tangent[1]) {\n tangent = [0, 0];\n }\n var perpendicular = [-tangent[1] * offset, tangent[0] * offset]; // 垂直向量\n point.x += perpendicular[0];\n point.y += perpendicular[1];\n return point;\n};\n/**\n * 点集转化为Path多边形\n * @param {Array} points 点集\n * @param {Boolen} z 是否封闭\n * @return {Array} Path\n */\nvar pointsToPolygon = function pointsToPolygon(points, z) {\n var length = points.length;\n if (!length) {\n return '';\n }\n var path = '';\n var str = '';\n for (var i = 0; i < length; i++) {\n var item = points[i];\n if (i === 0) {\n str = 'M{x} {y}';\n } else {\n str = 'L{x} {y}';\n }\n path += substitute(str, item);\n }\n if (z) {\n path += 'Z';\n }\n return path;\n};\nvar pathToPoints = function pathToPoints(path) {\n var points = [];\n path.forEach(function (seg) {\n var command = seg[0];\n if (command !== 'A') {\n for (var i = 1; i < seg.length; i = i + 2) {\n points.push([seg[i], seg[i + 1]]);\n }\n } else {\n var length_1 = seg.length;\n points.push([seg[length_1 - 2], seg[length_1 - 1]]);\n }\n });\n return points;\n};\n/**\n * 生成平滑的闭合曲线\n * @param points\n */\nvar getClosedSpline = function getClosedSpline(points) {\n if (points.length < 2) {\n throw new Error(\"point length must larger than 2, now it's \".concat(points.length));\n }\n var first = points[0];\n var second = points[1];\n var last = points[points.length - 1];\n var lastSecond = points[points.length - 2];\n points.unshift(last);\n points.unshift(lastSecond);\n points.push(first);\n points.push(second);\n var closedPath = [];\n for (var i = 1; i < points.length - 2; i += 1) {\n var x0 = points[i - 1].x;\n var y0 = points[i - 1].y;\n var x1 = points[i].x;\n var y1 = points[i].y;\n var x2 = points[i + 1].x;\n var y2 = points[i + 1].y;\n var x3 = i !== points.length - 2 ? points[i + 2].x : x2;\n var y3 = i !== points.length - 2 ? points[i + 2].y : y2;\n var cp1x = x1 + (x2 - x0) / 6;\n var cp1y = y1 + (y2 - y0) / 6;\n var cp2x = x2 - (x3 - x1) / 6;\n var cp2y = y2 - (y3 - y1) / 6;\n closedPath.push(['C', cp1x, cp1y, cp2x, cp2y, x2, y2]);\n }\n closedPath.unshift(['M', last.x, last.y]);\n return closedPath;\n};\nvar vecScaleTo = function vecScaleTo(v, length) {\n // Vector with direction of v with specified length\n return _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize([0, 0], v), length);\n};\nvar unitNormal = function unitNormal(p0, p1) {\n // Returns the unit normal to the line segment from p0 to p1.\n var n = [p0[1] - p1[1], p1[0] - p0[0]];\n var nLength = Math.sqrt(n[0] * n[0] + n[1] * n[1]);\n if (nLength === 0) {\n throw new Error('p0 should not be equal to p1');\n }\n return [n[0] / nLength, n[1] / nLength];\n};\nvar vecFrom = function vecFrom(p0, p1) {\n // Vector from p0 to p1\n return [p1[0] - p0[0], p1[1] - p0[1]];\n};\n/**\n * 传入的节点作为多边形顶点,生成有圆角的多边形\n * @param polyPoints 多边形顶点\n * @param padding 在原多边形基础上增加最终轮廓和原多边形的空白间隔\n */\nfunction roundedHull(polyPoints, padding) {\n // The rounded hull path around a single point\n var roundedHull1 = function roundedHull1(points) {\n var p1 = [points[0][0], points[0][1] - padding];\n var p2 = [points[0][0], points[0][1] + padding];\n return \"M \".concat(p1, \" A \").concat(padding, \",\").concat(padding, \",0,0,0,\").concat(p2, \" A \").concat(padding, \",\").concat(padding, \",0,0,0,\").concat(p1);\n };\n // The rounded hull path around two points\n var roundedHull2 = function roundedHull2(points) {\n var offsetVector = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], unitNormal(points[0], points[1]), padding);\n var invOffsetVector = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], offsetVector, -1);\n var p0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[0], offsetVector);\n var p1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[1], offsetVector);\n var p2 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[1], invOffsetVector);\n var p3 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[0], invOffsetVector);\n return \"M \".concat(p0, \" L \").concat(p1, \" A \").concat([padding, padding, '0,0,0', p2].join(','), \" L \").concat(p3, \" A \").concat([padding, padding, '0,0,0', p0].join(','));\n };\n // 特殊情况处理:节点数小于等于2\n if (!polyPoints || polyPoints.length < 1) return '';\n if (polyPoints.length === 1) return roundedHull1(polyPoints);\n if (polyPoints.length === 2) return roundedHull2(polyPoints);\n var segments = new Array(polyPoints.length);\n // Calculate each offset (outwards) segment of the convex hull.\n for (var segmentIndex = 0; segmentIndex < segments.length; ++segmentIndex) {\n var p0 = segmentIndex === 0 ? polyPoints[polyPoints.length - 1] : polyPoints[segmentIndex - 1];\n var p1 = polyPoints[segmentIndex];\n // Compute the offset vector for the line segment, with length = padding.\n var offset = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], unitNormal(p0, p1), padding);\n segments[segmentIndex] = [_antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], p0, offset), _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], p1, offset)];\n }\n var arcData = \"A \".concat([padding, padding, '0,0,0,'].join(','));\n segments = segments.map(function (segment, index) {\n var pathFragment = '';\n if (index === 0) {\n pathFragment = \"M \".concat(segments[segments.length - 1][1], \" \");\n }\n pathFragment += \"\".concat(arcData + segment[0], \" L \").concat(segment[1]);\n return pathFragment;\n });\n return segments.join(' ');\n}\n/**\n * 传入的节点作为多边形顶点,生成平滑的闭合多边形\n * @param polyPoints\n * @param padding\n */\nfunction paddedHull(polyPoints, padding) {\n var pointCount = polyPoints.length;\n var smoothHull1 = function smoothHull1(points) {\n // Returns the path for a circular hull around a single point.\n var p1 = [points[0][0], points[0][1] - padding];\n var p2 = [points[0][0], points[0][1] + padding];\n return \"M \".concat(p1, \" A \").concat([padding, padding, '0,0,0', p2].join(','), \" A \").concat([padding, padding, '0,0,0', p1].join(','));\n };\n // Returns the path for a rounded hull around two points.\n var smoothHull2 = function smoothHull2(points) {\n var v = vecFrom(points[0], points[1]);\n var extensionVec = vecScaleTo(v, padding);\n var extension0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[0], _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], extensionVec, -1));\n var extension1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[1], extensionVec);\n var tangentHalfLength = 1.2 * padding;\n var controlDelta = vecScaleTo(_antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize([0, 0], v), tangentHalfLength);\n var invControlDelta = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], controlDelta, -1);\n var control0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], extension0, invControlDelta);\n var control1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], extension1, invControlDelta);\n var control3 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], extension0, controlDelta);\n // return [\n // ['M', extension0[0], extension0[1]],\n // ['C', control0, control1, extension1],\n // ['S', control3, extension0],\n // 'Z',\n // ];\n return \"M \".concat(extension0, \" C \").concat([control0, control1, extension1].join(','), \" S \").concat([control3, extension0].join(','), \" Z\");\n };\n // Handle special cases\n if (!polyPoints || pointCount < 1) return '';\n if (pointCount === 1) return smoothHull1(polyPoints);\n if (pointCount === 2) return smoothHull2(polyPoints);\n var hullPoints = polyPoints.map(function (point, index) {\n var pNext = polyPoints[(index + 1) % pointCount];\n return {\n p: point,\n v: _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize([0, 0], vecFrom(point, pNext))\n };\n });\n // Compute the expanded hull points, and the nearest prior control point for each.\n for (var i = 0; i < hullPoints.length; ++i) {\n var priorIndex = i > 0 ? i - 1 : pointCount - 1;\n var extensionVec = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize([0, 0], _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], hullPoints[priorIndex].v, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], hullPoints[i].v, -1)));\n hullPoints[i].p = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], hullPoints[i].p, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], extensionVec, padding));\n }\n return hullPoints.map(function (obj) {\n var point = obj.p;\n return {\n x: point[0],\n y: point[1]\n };\n });\n}\n/**\n * get a path of a star with outer radius and inner radius\n * @param outerR\n * @param innerR\n * @returns\n */\nvar getStarPath = function getStarPath(outerR, innerR) {\n var path = [];\n for (var i = 0; i < 5; i++) {\n var x1 = Math.cos((18 + 72 * i) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * i) / 180 * Math.PI) * outerR;\n var x2 = Math.cos((54 + 72 * i) / 180 * Math.PI) * innerR;\n var y2 = Math.sin((54 + 72 * i) / 180 * Math.PI) * innerR;\n if (i === 0) {\n path.push(['M', x1, -y1]);\n } else {\n path.push(['L', x1, -y1]);\n }\n path.push(['L', x2, -y2]);\n }\n path.push(['Z']);\n return path;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/path.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglElements.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglElements.js ***! - \*********************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-core/es/util/validation.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-core/es/util/validation.js ***! + \**********************************************************/ +/*! exports provided: dataValidation, singleDataValidation */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglElements; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js\");\n\n\n\n\n/**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#elements\n */\n\nvar ReglElements = /*#__PURE__*/function () {\n function ReglElements(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglElements);\n\n this.elements = void 0;\n var data = options.data,\n usage = options.usage,\n type = options.type,\n count = options.count;\n this.elements = reGl.elements({\n data: data,\n usage: _constants__WEBPACK_IMPORTED_MODULE_3__[\"usageMap\"][usage || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].STATIC_DRAW],\n type: _constants__WEBPACK_IMPORTED_MODULE_3__[\"dataTypeMap\"][type || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].UNSIGNED_BYTE],\n count: count\n });\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglElements, [{\n key: \"get\",\n value: function get() {\n return this.elements;\n }\n }, {\n key: \"subData\",\n value: function subData(_ref) {\n var data = _ref.data;\n this.elements.subdata(data);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.elements.destroy();\n }\n }]);\n\n return ReglElements;\n}();\n\n\n//# sourceMappingURL=ReglElements.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglElements.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataValidation\", function() { return dataValidation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"singleDataValidation\", function() { return singleDataValidation; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _graphic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n\n\n\n/**\n * 验证关系图或树图数据的合法性,必须符合以下规则才会渲染图:\n * 1. 必须传入数据\n * 2. 节点的 ID 必须为字符串,暂不支持数字类型,如果支持数字类型,会出现类似 123 与 '123' 是否相等的问题\n * 3. 边的 source 和 target 值必须在节点 ID 中存在\n * @param data 关系图或树图数据\n * @return boolean 全部验证通过返回 true,否则返回 false\n */\nvar dataValidation = function dataValidation(data) {\n // 1. 必须传入数据\n if (!data) {\n console.error('G6 Error Tips: the data must be defined');\n return false;\n }\n // 2. 节点的 ID 必须为字符串或数字类型\n var nodes = data.nodes,\n edges = data.edges,\n _a = data.combos,\n combos = _a === void 0 ? [] : _a;\n if (!nodes && !edges) {\n var validated_1 = true;\n // 不存在 nodes 和 edges,则说明是 TreeGraphData,按 TreeGraphData 规则验证\n Object(_graphic__WEBPACK_IMPORTED_MODULE_2__[\"traverseTree\"])(data, function (param) {\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(param.id)) {\n validated_1 = false;\n return false;\n }\n return true;\n });\n return validated_1;\n }\n var nonNode = (nodes || []).find(function (node) {\n return !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(node.id);\n });\n if (nonNode) {\n console.warn(\"G6 Warning Tips: missing 'id' property, or %c\".concat(nonNode.id, \"%c is not a string.\"), 'font-size: 20px; color: red;', '');\n return false;\n }\n // 3. 边的 source 和 target 必须存在于节点 或 Combo中\n var nodeIds = (nodes || []).map(function (node) {\n return node.id;\n });\n var comboIds = combos === null || combos === void 0 ? void 0 : combos.map(function (combo) {\n return combo.id;\n });\n var ids = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], nodeIds, true), comboIds, true);\n var nonEdges = (edges || []).find(function (edge) {\n return !ids.includes(edge.source) || !ids.includes(edge.target);\n });\n if (nonEdges) {\n console.warn(\"G6 Warning Tips: The source %c\".concat(nonEdges.source, \"%c or the target %c\").concat(nonEdges.target, \"%c of the edge do not exist in the nodes or combos.\"), 'font-size: 20px; color: red;', '', 'font-size: 20px; color: red;', '');\n return false;\n }\n return true;\n};\n/**\n * 验证添加节点、边或从combo时的数据\n * @param type 节点、边或从combo\n * @param data 添加的单条数据\n * @return boolean 全部验证通过返回 true,否则返回 false\n */\nvar singleDataValidation = function singleDataValidation(type, data) {\n if (type === 'node' || type === 'combo') {\n // 必须有 id 字段,且id必须为字符串类型\n if (data.id && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(data.id)) {\n console.warn(\"G6 Warning Tips: missing 'id' property, or the 'id' %c\".concat(data.id, \"%c is not a string.\"), 'font-size: 20px; color: red;', '');\n return false;\n }\n } else if (type === 'edge') {\n // 必须有 source 和 target 字段\n if (!data.source || !data.target) {\n console.warn(\"G6 Warning Tips: missing 'source' or 'target' for the edge.\");\n return false;\n }\n }\n return true;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/validation.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglFramebuffer.js": -/*!************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglFramebuffer.js ***! - \************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/element/shape.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/element/shape.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglFramebuffer; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\n/**\n * adaptor for regl.Framebuffer\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#framebuffers\n */\nvar ReglFramebuffer = /*#__PURE__*/function () {\n function ReglFramebuffer(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglFramebuffer);\n\n this.framebuffer = void 0;\n var width = options.width,\n height = options.height,\n color = options.color,\n colors = options.colors,\n depth = options.depth,\n stencil = options.stencil;\n var framebufferOptions = {\n width: width,\n height: height\n };\n\n if (Array.isArray(colors)) {\n framebufferOptions.colors = colors.map(function (c) {\n return c.get();\n });\n }\n\n if (color && typeof color !== 'boolean') {\n framebufferOptions.color = color.get();\n } // TODO: depth & stencil\n\n\n this.framebuffer = reGl.framebuffer(framebufferOptions);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglFramebuffer, [{\n key: \"get\",\n value: function get() {\n return this.framebuffer;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.framebuffer.destroy();\n }\n }, {\n key: \"resize\",\n value: function resize(_ref) {\n var width = _ref.width,\n height = _ref.height;\n this.framebuffer.resize(width, height);\n }\n }]);\n\n return ReglFramebuffer;\n}();\n\n\n//# sourceMappingURL=ReglFramebuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglFramebuffer.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.ShapeFactoryBase = void 0;\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _xml = __webpack_require__(/*! ./xml */ \"./node_modules/@antv/g6-core/lib/element/xml.js\");\nvar cache = {}; // ucfirst 开销过大,进行缓存\n// 首字母大写\nfunction ucfirst(str) {\n if (!cache[str]) {\n cache[str] = (0, _util.upperFirst)(str);\n }\n return cache[str];\n}\n/**\n * 工厂方法的基类\n * @type Shape.FactoryBase\n */\nvar ShapeFactoryBase = exports.ShapeFactoryBase = {\n /**\n * 默认的形状,当没有指定/匹配 shapeType 时,使用默认的\n * @type {String}\n */\n defaultShapeType: 'defaultType',\n /**\n * 形状的 className,用于搜索\n * @type {String}\n */\n className: null,\n /**\n * 获取绘制 Shape 的工具类,无状态\n * @param {String} type 类型\n * @return {Shape} 工具类\n */\n getShape: function getShape(type) {\n var self = this;\n var shape = self[type] || self[self.defaultShapeType] || self['simple-circle'];\n return shape;\n },\n /**\n * 绘制图形\n * @param {String} type 类型\n * @param {Object} cfg 配置项\n * @param {G.Group} group 图形的分组\n * @return {IShape} 图形对象\n */\n draw: function draw(type, cfg, group) {\n var shape = this.getShape(type);\n group['shapeMap'] = {};\n var rst = shape.draw(cfg, group);\n if (shape.afterDraw) {\n shape.afterDraw(cfg, group, rst);\n }\n return rst;\n },\n /**\n * 更新\n * @param {String} type 类型\n * @param {Object} cfg 配置项\n * @param {G6.Item} item 节点、边、分组等\n */\n baseUpdate: function baseUpdate(type, cfg, item, updateType) {\n var _a, _b;\n var shape = this.getShape(type);\n // 防止没定义 update 函数\n if (shape.update) {\n // shape.mergeStyle = updateType === 'move' || updateType === 'bbox' ? {} : shape.getOptions?.(cfg);\n shape.mergeStyle = (_a = shape.getOptions) === null || _a === void 0 ? void 0 : _a.call(shape, cfg, updateType);\n (_b = shape.update) === null || _b === void 0 ? void 0 : _b.call(shape, cfg, item, updateType);\n }\n if (shape.afterUpdate) {\n shape.afterUpdate(cfg, item);\n }\n },\n /**\n * 设置状态\n * @param {String} type 类型\n * @param {String} name 状态名\n * @param {String | Boolean} value 状态值\n * @param {G6.Item} item 节点、边、分组等\n */\n setState: function setState(type, name, value, item) {\n var shape = this.getShape(type);\n // 调用 shape/shapeBase.ts 中的 setState 方法\n shape.setState(name, value, item);\n },\n /**\n * 是否允许更新,不重新绘制图形\n * @param {String} type 类型\n * @return {Boolean} 是否允许使用更新\n */\n shouldUpdate: function shouldUpdate(type) {\n var shape = this.getShape(type);\n return !!shape.update;\n },\n getControlPoints: function getControlPoints(type, cfg) {\n var shape = this.getShape(type);\n return shape.getControlPoints(cfg);\n },\n /**\n * 获取控制点\n * @param {String} type 节点、边类型\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getAnchorPoints: function getAnchorPoints(type, cfg) {\n var shape = this.getShape(type);\n return shape.getAnchorPoints(cfg);\n }\n};\n/**\n * 元素的框架\n */\nvar ShapeFramework = {\n // 默认样式及配置\n options: {},\n /**\n * 绘制\n */\n draw: function draw(cfg, group) {\n return this.drawShape(cfg, group);\n },\n /**\n * 绘制\n */\n drawShape: function drawShape( /* cfg, group */) {},\n /**\n * 绘制完成后的操作,便于用户继承现有的节点、边\n */\n afterDraw: function afterDraw( /* cfg, group */) {},\n // update(cfg, item) // 默认不定义\n afterUpdate: function afterUpdate( /* cfg, item */) {},\n /**\n * 设置节点、边状态\n */\n setState: function setState( /* name, value, item */) {},\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getAnchorPoints: function getAnchorPoints(cfg) {\n var defaultAnchorPoints = this.options.anchorPoints;\n var anchorPoints = cfg.anchorPoints || defaultAnchorPoints;\n return anchorPoints;\n }\n /* 如果没定义 update 方法,每次都调用 draw 方法\n update(cfg, item) {\n }\n */\n};\n\nvar Shape = /** @class */function () {\n function Shape() {}\n Shape.registerFactory = function (factoryType, cfg) {\n var className = ucfirst(factoryType);\n var factoryBase = ShapeFactoryBase;\n var shapeFactory = (0, _tslib.__assign)((0, _tslib.__assign)({}, factoryBase), cfg);\n Shape[className] = shapeFactory;\n shapeFactory.className = className;\n return shapeFactory;\n };\n Shape.getFactory = function (factoryType) {\n var className = ucfirst(factoryType);\n return Shape[className];\n };\n Shape.registerNode = function (shapeType, nodeDefinition, extendShapeType) {\n var shapeFactory = Shape.Node;\n var shapeObj;\n if (typeof nodeDefinition === 'string' || typeof nodeDefinition === 'function') {\n var autoNodeDefinition = (0, _xml.createNodeFromXML)(nodeDefinition);\n shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)({}, shapeFactory.getShape('single-node')), autoNodeDefinition);\n } else if (nodeDefinition.jsx) {\n var jsx = nodeDefinition.jsx;\n var autoNodeDefinition = (0, _xml.createNodeFromXML)(jsx);\n shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, shapeFactory.getShape('single-node')), autoNodeDefinition), nodeDefinition);\n } else {\n shapeFactory.getShape(extendShapeType);\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)({}, extendShape), nodeDefinition);\n }\n shapeObj.type = shapeType;\n shapeObj.itemType = 'node';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n Shape.registerEdge = function (shapeType, edgeDefinition, extendShapeType) {\n var shapeFactory = Shape.Edge;\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n var shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)({}, extendShape), edgeDefinition);\n shapeObj.type = shapeType;\n shapeObj.itemType = 'edge';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n Shape.registerCombo = function (shapeType, comboDefinition, extendShapeType) {\n var shapeFactory = Shape.Combo;\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n var shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)({}, extendShape), comboDefinition);\n shapeObj.type = shapeType;\n shapeObj.itemType = 'combo';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n return Shape;\n}();\nvar _default = exports.default = Shape; // 注册 Node 的工厂方法\nShape.registerFactory('node', {\n defaultShapeType: 'circle'\n});\n// 注册 Edge 的工厂方法\nShape.registerFactory('edge', {\n defaultShapeType: 'line'\n});\n// 注册 Combo 的工厂方法\nShape.registerFactory('combo', {\n defaultShapeType: 'circle'\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/element/shape.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglModel.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglModel.js ***! - \******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/element/shapeBase.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/element/shapeBase.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglModel; });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _utils_uniform__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../utils/uniform */ \"./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js\");\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\n\n/**\n * adaptor for regl.DrawCommand\n */\nvar ReglModel = /*#__PURE__*/function () {\n function ReglModel(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, ReglModel);\n\n this.reGl = void 0;\n this.drawCommand = void 0;\n this.uniforms = {};\n this.reGl = reGl;\n var vs = options.vs,\n fs = options.fs,\n defines = options.defines,\n attributes = options.attributes,\n uniforms = options.uniforms,\n primitive = options.primitive,\n count = options.count,\n elements = options.elements,\n depth = options.depth,\n blend = options.blend,\n stencil = options.stencil,\n cull = options.cull,\n instances = options.instances,\n scissor = options.scissor,\n viewport = options.viewport;\n var reglUniforms = {};\n\n if (uniforms) {\n this.uniforms = Object(_utils_uniform__WEBPACK_IMPORTED_MODULE_5__[\"extractUniforms\"])(uniforms);\n Object.keys(uniforms).forEach(function (uniformName) {\n // use regl prop API\n // @ts-ignore\n reglUniforms[uniformName] = reGl.prop(uniformName);\n });\n }\n\n var reglAttributes = {};\n Object.keys(attributes).forEach(function (name) {\n reglAttributes[name] = attributes[name].get();\n });\n var defineStmts = defines && this.generateDefines(defines) || '';\n var drawParams = {\n attributes: reglAttributes,\n frag: \"#ifdef GL_FRAGMENT_PRECISION_HIGH\\n precision highp float;\\n#else\\n precision mediump float;\\n#endif\\n\".concat(defineStmts, \"\\n\").concat(fs),\n uniforms: reglUniforms,\n vert: \"\\n\".concat(defineStmts, \"\\n\").concat(vs),\n primitive: _constants__WEBPACK_IMPORTED_MODULE_6__[\"primitiveMap\"][primitive === undefined ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].TRIANGLES : primitive]\n };\n\n if (instances) {\n drawParams.instances = instances;\n } // elements 中可能包含 count,此时不应传入\n\n\n if (count) {\n drawParams.count = count;\n }\n\n if (elements) {\n drawParams.elements = elements.get();\n }\n\n if (scissor) {\n drawParams.scissor = scissor;\n }\n\n if (viewport) {\n drawParams.viewport = viewport;\n }\n\n this.initDepthDrawParams({\n depth: depth\n }, drawParams);\n this.initBlendDrawParams({\n blend: blend\n }, drawParams);\n this.initStencilDrawParams({\n stencil: stencil\n }, drawParams);\n this.initCullDrawParams({\n cull: cull\n }, drawParams);\n this.drawCommand = reGl(drawParams);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(ReglModel, [{\n key: \"addUniforms\",\n value: function addUniforms(uniforms) {\n this.uniforms = _objectSpread(_objectSpread({}, this.uniforms), Object(_utils_uniform__WEBPACK_IMPORTED_MODULE_5__[\"extractUniforms\"])(uniforms));\n }\n }, {\n key: \"draw\",\n value: function draw(options) {\n var uniforms = _objectSpread(_objectSpread({}, this.uniforms), Object(_utils_uniform__WEBPACK_IMPORTED_MODULE_5__[\"extractUniforms\"])(options.uniforms || {}));\n\n var reglDrawProps = {};\n Object.keys(uniforms).forEach(function (uniformName) {\n var type = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(uniforms[uniformName]);\n\n if (type === 'boolean' || type === 'number' || Array.isArray(uniforms[uniformName]) || // @ts-ignore\n uniforms[uniformName].BYTES_PER_ELEMENT) {\n reglDrawProps[uniformName] = uniforms[uniformName];\n } else if (type === 'string') {// TODO: image url\n } else {\n reglDrawProps[uniformName] = uniforms[uniformName].get();\n }\n });\n this.drawCommand(reglDrawProps);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {// don't need do anything since we will call `rendererService.cleanup()`\n }\n /**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#depth-buffer\n */\n\n }, {\n key: \"initDepthDrawParams\",\n value: function initDepthDrawParams(_ref, drawParams) {\n var depth = _ref.depth;\n\n if (depth) {\n drawParams.depth = {\n enable: depth.enable === undefined ? true : !!depth.enable,\n mask: depth.mask === undefined ? true : !!depth.mask,\n func: _constants__WEBPACK_IMPORTED_MODULE_6__[\"depthFuncMap\"][depth.func || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].LESS],\n range: depth.range || [0, 1]\n };\n }\n }\n /**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#blending\n */\n\n }, {\n key: \"initBlendDrawParams\",\n value: function initBlendDrawParams(_ref2, drawParams) {\n var blend = _ref2.blend;\n\n if (blend) {\n var enable = blend.enable,\n func = blend.func,\n equation = blend.equation,\n _blend$color = blend.color,\n color = _blend$color === void 0 ? [0, 0, 0, 0] : _blend$color; // @ts-ignore\n\n drawParams.blend = {\n enable: !!enable,\n func: {\n srcRGB: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendFuncMap\"][func && func.srcRGB || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].SRC_ALPHA],\n srcAlpha: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendFuncMap\"][func && func.srcAlpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].SRC_ALPHA],\n dstRGB: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendFuncMap\"][func && func.dstRGB || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].ONE_MINUS_SRC_ALPHA],\n dstAlpha: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendFuncMap\"][func && func.dstAlpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].ONE_MINUS_SRC_ALPHA]\n },\n equation: {\n rgb: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendEquationMap\"][equation && equation.rgb || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].FUNC_ADD],\n alpha: _constants__WEBPACK_IMPORTED_MODULE_6__[\"blendEquationMap\"][equation && equation.alpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].FUNC_ADD]\n },\n color: color\n };\n }\n }\n /**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#stencil\n */\n\n }, {\n key: \"initStencilDrawParams\",\n value: function initStencilDrawParams(_ref3, drawParams) {\n var stencil = _ref3.stencil;\n\n if (stencil) {\n var enable = stencil.enable,\n _stencil$mask = stencil.mask,\n mask = _stencil$mask === void 0 ? -1 : _stencil$mask,\n _stencil$func = stencil.func,\n func = _stencil$func === void 0 ? {\n cmp: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].ALWAYS,\n ref: 0,\n mask: -1\n } : _stencil$func,\n _stencil$opFront = stencil.opFront,\n opFront = _stencil$opFront === void 0 ? {\n fail: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP,\n zfail: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP,\n zpass: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP\n } : _stencil$opFront,\n _stencil$opBack = stencil.opBack,\n opBack = _stencil$opBack === void 0 ? {\n fail: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP,\n zfail: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP,\n zpass: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].KEEP\n } : _stencil$opBack;\n drawParams.stencil = {\n enable: !!enable,\n mask: mask,\n func: _objectSpread(_objectSpread({}, func), {}, {\n cmp: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilFuncMap\"][func.cmp]\n }),\n opFront: {\n fail: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opFront.fail],\n zfail: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opFront.zfail],\n zpass: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opFront.zpass]\n },\n opBack: {\n fail: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opBack.fail],\n zfail: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opBack.zfail],\n zpass: _constants__WEBPACK_IMPORTED_MODULE_6__[\"stencilOpMap\"][opBack.zpass]\n }\n };\n }\n }\n /**\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#culling\n */\n\n }, {\n key: \"initCullDrawParams\",\n value: function initCullDrawParams(_ref4, drawParams) {\n var cull = _ref4.cull;\n\n if (cull) {\n var enable = cull.enable,\n _cull$face = cull.face,\n face = _cull$face === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].BACK : _cull$face;\n drawParams.cull = {\n enable: !!enable,\n face: _constants__WEBPACK_IMPORTED_MODULE_6__[\"cullFaceMap\"][face]\n };\n }\n }\n }, {\n key: \"generateDefines\",\n value: function generateDefines(defines) {\n return Object.keys(defines).map(function (name) {\n return \"#define \".concat(name, \" \").concat(Number(defines[name]));\n }).join('\\n');\n }\n }]);\n\n return ReglModel;\n}();\n\n\n//# sourceMappingURL=ReglModel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglModel.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.shapeBase = exports.CLS_LABEL_BG_SUFFIX = void 0;\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar _global = _interopRequireDefault(__webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/lib/global.js\"));\nvar _matrixUtil = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _graphic = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/lib/util/graphic.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\nvar transform = _matrixUtil.ext.transform;\nvar CLS_SHAPE_SUFFIX = '-shape';\nvar CLS_LABEL_SUFFIX = '-label';\nvar ARROWS = ['startArrow', 'endArrow'];\nvar SHAPE_DEFAULT_ATTRS = {\n lineWidth: 1,\n stroke: undefined,\n fill: undefined,\n lineAppendWidth: 1,\n opacity: undefined,\n strokeOpacity: undefined,\n fillOpacity: undefined,\n x: 0,\n y: 0,\n r: 10,\n width: 20,\n height: 20,\n shadowColor: undefined,\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\nvar PATH_SHAPE_DEFAULT_ATTRS = {\n lineWidth: 1,\n stroke: '#000',\n lineDash: undefined,\n startArrow: false,\n endArrow: false,\n opacity: undefined,\n strokeOpacity: undefined,\n fillOpacity: undefined,\n shadowColor: undefined,\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\nvar SHAPES_DEFAULT_ATTRS = {\n edge: PATH_SHAPE_DEFAULT_ATTRS,\n node: SHAPE_DEFAULT_ATTRS,\n combo: SHAPE_DEFAULT_ATTRS\n};\nvar CLS_LABEL_BG_SUFFIX = exports.CLS_LABEL_BG_SUFFIX = '-label-bg';\n// 单个 shape 带有一个 label,共用这段代码\nvar shapeBase = exports.shapeBase = {\n // 默认样式及配置\n options: {\n labelCfg: {\n style: {\n fontFamily: _global.default.windowFontFamily\n }\n },\n descriptionCfg: {\n style: {\n fontFamily: _global.default.windowFontFamily\n }\n }\n },\n itemType: '',\n /**\n * 形状的类型,例如 circle,ellipse,polyline...\n */\n type: '',\n getCustomConfig: function getCustomConfig(cfg) {\n return {};\n },\n getOptions: function getOptions(cfg, updateType) {\n if (updateType === 'move' || (updateType === null || updateType === void 0 ? void 0 : updateType.includes('bbox'))) return cfg;\n return (0, _util.deepMix)({}, this.options, this.getCustomConfig(cfg) || {}, cfg);\n },\n /**\n * 绘制节点/边,包含文本\n * @override\n * @param {Object} cfg 节点的配置项\n * @param {G.Group} group 节点的容器\n * @return {IShape} 绘制的图形\n */\n draw: function draw(cfg, group) {\n group['shapeMap'] = {};\n this.mergeStyle = this.getOptions(cfg);\n var shape = this.drawShape(cfg, group);\n shape.set('className', this.itemType + CLS_SHAPE_SUFFIX);\n group['shapeMap'][this.itemType + CLS_SHAPE_SUFFIX] = shape;\n if (cfg.label) {\n var label = this.drawLabel(cfg, group);\n label.set('className', this.itemType + CLS_LABEL_SUFFIX);\n group['shapeMap'][this.itemType + CLS_LABEL_SUFFIX] = label;\n }\n return shape;\n },\n /**\n * 绘制完成后的操作,便于用户继承现有的节点、边\n * @param cfg\n * @param group\n * @param keyShape\n */\n afterDraw: function afterDraw(cfg, group, keyShape) {},\n drawShape: function drawShape(cfg, group) {\n return null;\n },\n drawLabel: function drawLabel(cfg, group) {\n var defaultLabelCfg = (this.mergeStyle || this.getOptions(cfg) || {}).labelCfg;\n // image的情况下有可能为null\n var labelCfg = defaultLabelCfg || {};\n var labelStyle = this.getLabelStyle(cfg, labelCfg, group);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate;\n var label = group.addShape('text', {\n attrs: labelStyle,\n draggable: true,\n className: 'text-shape',\n name: 'text-shape',\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n if (!isNaN(rotate) && rotate !== '') {\n var labelBBox = label.getBBox();\n var labelMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n if (labelStyle.rotateCenter) {\n switch (labelStyle.rotateCenter) {\n case 'center':\n labelMatrix = transform(labelMatrix, [['t', -labelBBox.width / 2, -labelBBox.height / 2], ['r', rotate], ['t', labelBBox.width / 2, labelBBox.height / 2]]);\n break;\n case 'lefttop':\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y], ['r', rotate], ['t', labelStyle.x, labelStyle.y]]);\n break;\n case 'leftcenter':\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y - labelBBox.height / 2], ['r', rotate], ['t', labelStyle.x, labelStyle.y + labelBBox.height / 2]]);\n break;\n default:\n labelMatrix = transform(labelMatrix, [['t', -labelBBox.width / 2, -labelBBox.height / 2], ['r', rotate], ['t', labelBBox.width / 2, labelBBox.height / 2]]);\n break;\n }\n } else {\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y - labelBBox.height / 2], ['r', rotate], ['t', labelStyle.x, labelStyle.y + labelBBox.height / 2]]);\n }\n label.setMatrix(labelMatrix);\n }\n if (labelStyle.background) {\n var rect = this.drawLabelBg(cfg, group, label);\n var labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX;\n rect.set('classname', labelBgClassname);\n group['shapeMap'][labelBgClassname] = rect;\n label.toFront();\n }\n return label;\n },\n drawLabelBg: function drawLabelBg(cfg, group, label) {\n var defaultLabelCfg = this.options.labelCfg;\n var labelCfg = (0, _util.mix)({}, defaultLabelCfg, cfg.labelCfg);\n var style = this.getLabelBgStyleByPosition(label, labelCfg);\n var rect = group.addShape('rect', {\n name: 'text-bg-shape',\n attrs: style,\n labelRelated: true\n });\n group['shapeMap']['text-bg-shape'] = rect;\n return rect;\n },\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg, group) {\n return {\n text: cfg.label\n };\n },\n getLabelBgStyleByPosition: function getLabelBgStyleByPosition(label, labelCfg) {\n return {};\n },\n /**\n * 获取文本的配置项\n * @param cfg 节点的配置项\n * @param labelCfg 文本的配置项\n * @param group 父容器,label 的定位可能与图形相关\n */\n getLabelStyle: function getLabelStyle(cfg, labelCfg, group) {\n var calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group);\n var attrName = \"\".concat(this.itemType, \"Label\"); // 取 nodeLabel,edgeLabel 的配置项\n var defaultStyle = _global.default[attrName] ? _global.default[attrName].style : null;\n return (0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, defaultStyle), calculateStyle), labelCfg.style);\n },\n /**\n * 获取图形的配置项\n * @param cfg\n */\n getShapeStyle: function getShapeStyle(cfg) {\n return cfg.style;\n },\n /**\n * 更新节点,包含文本\n * @override\n * @param {Object} cfg 节点/边的配置项\n * @param {G6.Item} item 节点/边\n */\n update: function update(cfg, item, updateType) {\n this.updateShapeStyle(cfg, item, updateType);\n this.updateLabel(cfg, item, updateType);\n },\n updateShapeStyle: function updateShapeStyle(cfg, item, updateType) {\n var _a;\n var group = item.getContainer();\n var shape = item.getKeyShape();\n var shapeStyle = (0, _util.mix)({}, shape.attr(), cfg.style);\n var _loop_1 = function _loop_1(key) {\n var _b;\n var style = shapeStyle[key];\n if ((0, _util.isPlainObject)(style)) {\n // 更新图元素样式,支持更新子元素\n var subShape = ((_a = group['shapeMap']) === null || _a === void 0 ? void 0 : _a[key]) || group.find(function (element) {\n return element.get('name') === key;\n });\n subShape === null || subShape === void 0 ? void 0 : subShape.attr(style);\n } else {\n shape.attr((_b = {}, _b[key] = style, _b));\n }\n };\n for (var key in shapeStyle) {\n _loop_1(key);\n }\n },\n updateLabel: function updateLabel(cfg, item, updateType) {\n var _a, _b;\n var group = item.getContainer();\n var _c = (this.mergeStyle || this.getOptions({}, updateType) || {}).labelCfg,\n labelCfg = _c === void 0 ? {} : _c;\n var labelClassName = this.itemType + CLS_LABEL_SUFFIX;\n var label = group['shapeMap'][labelClassName] || group.find(function (ele) {\n return ele.get('className') === labelClassName;\n });\n var labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX;\n var labelBg = group['shapeMap'][labelBgClassname] || group.find(function (ele) {\n return ele.get('className') === labelBgClassname;\n });\n if (label && cfg.label === undefined) {\n group.removeChild(label);\n delete group['shapeMap'][labelClassName];\n if (labelBg) {\n group.removeChild(labelBg);\n delete group['shapeMap'][labelBgClassname];\n }\n }\n // 防止 cfg.label = \"\" 的情况\n if (cfg.label || cfg.label === '') {\n // 若传入的新配置中有 label,(用户没传入但原先有 label,label 也会有值)\n if (!label) {\n // 若原先不存在 label,则绘制一个新的 label\n var newLabel = this.drawLabel(cfg, group);\n newLabel.set('className', labelClassName);\n group['shapeMap'][labelClassName] = newLabel;\n } else {\n // 若原先存在 label,则更新样式。与 getLabelStyle 不同在于这里需要融合当前 label 的样式\n // 融合 style 以外的属性:position, offset, ...\n if (!updateType || updateType === 'bbox|label' || this.itemType === 'edge' && updateType !== 'style') {\n labelCfg = (0, _util.deepMix)(labelCfg, cfg.labelCfg);\n }\n // 获取位置信息\n var calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group);\n // 取 nodeLabel,edgeLabel 的配置项\n var cfgStyle = (_a = cfg.labelCfg) === null || _a === void 0 ? void 0 : _a.style;\n // const cfgBgStyle = labelCfg.style?.background;\n // 需要融合当前\b label 的样式 label.attr()。不再需要全局/默认样式,因为已经应用在当前的 label 上\n var labelStyle = (0, _tslib.__assign)((0, _tslib.__assign)({}, calculateStyle), cfgStyle);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate;\n // 计算 label 的旋转矩阵\n if (!isNaN(rotate) && rotate !== '') {\n // if G 4.x define the rotateAtStart, use it directly instead of using the following codes\n var rotateMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n rotateMatrix = transform(rotateMatrix, [['t', -labelStyle.x, -labelStyle.y], ['r', rotate], ['t', labelStyle.x, labelStyle.y]]);\n labelStyle.matrix = rotateMatrix;\n label.attr(labelStyle);\n } else {\n if (((_b = label.getMatrix()) === null || _b === void 0 ? void 0 : _b[4]) !== 1) {\n label.resetMatrix();\n }\n label.attr(labelStyle);\n }\n if (!labelBg) {\n if (labelStyle.background) {\n labelBg = this.drawLabelBg(cfg, group, label);\n labelBg.set('classname', labelBgClassname);\n group['shapeMap'][labelBgClassname] = labelBg;\n label.toFront();\n }\n } else if (labelStyle.background) {\n var calculateBgStyle = this.getLabelBgStyleByPosition(label, labelCfg);\n labelBg.attr(calculateBgStyle);\n } else {\n group.removeChild(labelBg);\n }\n }\n }\n },\n // update(cfg, item) // 默认不定义\n afterUpdate: function afterUpdate(cfg, item) {},\n /**\n * 设置节点的状态,主要是交互状态,业务状态请在 draw 方法中实现\n * 单图形的节点仅考虑 selected、active 状态,有其他状态需求的用户自己复写这个方法\n * @override\n * @param {String} name 状态名称\n * @param {String | Boolean} value 状态值\n * @param {G6.Item} item 节点\n */\n setState: function setState(name, value, item) {\n var _a, _b;\n var _c;\n var shape = item.get('keyShape');\n if (!shape || shape.destroyed) return;\n var type = item.getType();\n var stateName = (0, _util.isBoolean)(value) ? name : \"\".concat(name, \":\").concat(value);\n var shapeStateStyle = this.getStateStyle(stateName, item);\n var itemStateStyle = item.getStateStyle(stateName);\n // const originStyle = item.getOriginStyle();\n // 不允许设置一个不存在的状态\n if (!itemStateStyle && !shapeStateStyle) {\n return;\n }\n // 要设置或取消的状态的样式\n // 当没有 state 状态时,默认使用 model.stateStyles 中的样式\n var styles = (0, _util.mix)({}, itemStateStyle || shapeStateStyle);\n var group = item.getContainer();\n // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值。使用对象检索更快\n var keptAttrs = {\n x: 1,\n y: 1,\n cx: 1,\n cy: 1,\n matrix: 1\n };\n if (type === 'combo') {\n keptAttrs.r = 1;\n keptAttrs.width = 1;\n keptAttrs.height = 1;\n }\n if (value) {\n var _loop_2 = function _loop_2(key) {\n var _d;\n var style = styles[key];\n if ((0, _util.isPlainObject)(style) && !ARROWS.includes(key)) {\n var subShape = ((_c = group['shapeMap']) === null || _c === void 0 ? void 0 : _c[key]) || group.find(function (element) {\n return element.get('name') === key;\n });\n subShape === null || subShape === void 0 ? void 0 : subShape.attr(style);\n } else {\n // 非纯对象,则认为是设置到 keyShape 上面的\n shape.attr((_d = {}, _d[key] = style, _d));\n }\n };\n // style 为要设置的状态的样式\n for (var key in styles) {\n _loop_2(key);\n }\n } else {\n // 所有生效的 state 的样式\n var enableStatesStyle = (0, _graphic.cloneBesidesImg)(item.getCurrentStatesStyle());\n var model = item.getModel();\n // 原始样式\n var originStyle_1 = (0, _util.mix)({}, model.style, (0, _graphic.cloneBesidesImg)(item.getOriginStyle()));\n var keyShapeName_1 = shape.get('name');\n // cloning shape.attr(), keys.forEach to avoid cloning the img attr, which leads to maximum clone heap #2383\n // const keyShapeStyles = clone(shape.attr())\n var shapeAttrs_1 = shape.attr();\n var keyShapeStyles_1 = {};\n Object.keys(shapeAttrs_1).forEach(function (key) {\n if (key === 'img') return;\n var attr = shapeAttrs_1[key];\n if (attr && _typeof(attr) === 'object') {\n keyShapeStyles_1[key] = (0, _util.clone)(attr);\n } else {\n keyShapeStyles_1[key] = attr;\n }\n });\n // 已有样式 - 要取消的状态的样式\n var filtetDisableStatesStyle = {};\n var _loop_3 = function _loop_3(p) {\n var style = styles[p];\n if ((0, _util.isPlainObject)(style) && !ARROWS.includes(p)) {\n var subShape_1 = group['shapeMap'][p] || group.find(function (ele) {\n return ele.get('name') === p;\n });\n if (subShape_1) {\n var subShapeStyles_1 = (0, _graphic.cloneBesidesImg)(subShape_1.attr());\n (0, _util.each)(style, function (v, key) {\n if (p === keyShapeName_1 && keyShapeStyles_1[key] && !keptAttrs[key]) {\n delete keyShapeStyles_1[key];\n var value_1 = originStyle_1[p][key] || SHAPES_DEFAULT_ATTRS[type][key];\n shape.attr(key, value_1);\n } else if (subShapeStyles_1[key] || subShapeStyles_1[key] === 0) {\n delete subShapeStyles_1[key];\n var value_2 = originStyle_1[p][key] || SHAPES_DEFAULT_ATTRS[type][key];\n subShape_1.attr(key, value_2);\n }\n });\n filtetDisableStatesStyle[p] = subShapeStyles_1;\n }\n } else {\n if (keyShapeStyles_1[p] && !keptAttrs[p]) {\n delete keyShapeStyles_1[p];\n var value_3 = originStyle_1[p] || (originStyle_1[keyShapeName_1] ? originStyle_1[keyShapeName_1][p] : undefined) || SHAPES_DEFAULT_ATTRS[type][p];\n shape.attr(p, value_3);\n }\n }\n };\n // styles 为要取消的状态的样式\n for (var p in styles) {\n _loop_3(p);\n }\n // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值后,\n // 如果 keyShape 有 name 属性,则 filtetDisableStatesStyle 的格式为 { keyShapeName: {} }\n // 否则为普通对象\n if (!keyShapeName_1) {\n (0, _util.mix)(filtetDisableStatesStyle, keyShapeStyles_1);\n } else {\n filtetDisableStatesStyle[keyShapeName_1] = keyShapeStyles_1;\n }\n for (var key in enableStatesStyle) {\n if (keptAttrs[key]) continue;\n var enableStyle = enableStatesStyle[key];\n if (!(0, _util.isPlainObject)(enableStyle) || ARROWS.includes(key)) {\n // 把样式属性merge到keyShape中\n if (!keyShapeName_1) {\n (0, _util.mix)(originStyle_1, (_a = {}, _a[key] = enableStyle, _a));\n } else {\n (0, _util.mix)(originStyle_1[keyShapeName_1], (_b = {}, _b[key] = enableStyle, _b));\n delete originStyle_1[key];\n }\n delete enableStatesStyle[key];\n }\n }\n var originstyles = {};\n (0, _util.deepMix)(originstyles, originStyle_1, filtetDisableStatesStyle, enableStatesStyle);\n var keyShapeSetted = false;\n var _loop_4 = function _loop_4(originKey) {\n var _e, _f;\n var style = originstyles[originKey];\n if ((0, _util.isPlainObject)(style) && !ARROWS.includes(originKey)) {\n var subShape = group['shapeMap'][originKey] || group.find(function (ele) {\n return ele.get('name') === originKey;\n });\n if (subShape) {\n // The text's position and matrix is not allowed to be affected by states\n if (subShape.get('type') === 'text' || subShape.get('labelRelated')) {\n delete style.x;\n delete style.y;\n delete style.matrix;\n }\n if (originKey === keyShapeName_1) {\n if (type === 'combo') {\n delete style.r;\n delete style.width;\n delete style.height;\n }\n keyShapeSetted = true;\n }\n subShape.attr(style);\n }\n } else if (!keyShapeSetted) {\n var value_4 = style || SHAPES_DEFAULT_ATTRS[type][originKey];\n // 当更新 combo 状态时,当不存在 keyShapeName 时候,则认为是设置到 keyShape 上面的\n if (type === 'combo') {\n if (!keyShapeName_1) {\n shape.attr((_e = {}, _e[originKey] = value_4, _e));\n }\n } else {\n shape.attr((_f = {}, _f[originKey] = value_4, _f));\n }\n }\n };\n for (var originKey in originstyles) {\n _loop_4(originKey);\n }\n }\n },\n /**\n * 获取不同状态下的样式\n *\n * @param {string} name 状态名称\n * @param {Item} item Node或Edge的实例\n * @return {object} 样式\n */\n getStateStyle: function getStateStyle(name, item) {\n var model = item.getModel();\n var type = item.getType();\n var _a = this.getOptions(model),\n stateStyles = _a.stateStyles,\n _b = _a.style,\n style = _b === void 0 ? {} : _b;\n var modelStateStyle = model.stateStyles ? model.stateStyles[name] : stateStyles && stateStyles[name];\n if (type === 'combo') {\n return (0, _util.clone)(modelStateStyle);\n }\n return (0, _util.mix)({}, style, modelStateStyle);\n },\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 锚点的数组,如果为 null,则没有锚点\n */\n getAnchorPoints: function getAnchorPoints(cfg) {\n var _a, _b;\n var anchorPoints = (cfg === null || cfg === void 0 ? void 0 : cfg.anchorPoints) || ((_a = this.getCustomConfig(cfg)) === null || _a === void 0 ? void 0 : _a.anchorPoints) || ((_b = this.options) === null || _b === void 0 ? void 0 : _b.anchorPoints);\n return anchorPoints;\n }\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/element/shapeBase.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/ReglTexture2D.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/ReglTexture2D.js ***! - \**********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/element/xml.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/element/xml.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return ReglTexture2D; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js\");\n\n\n\n\n/**\n * adaptor for regl.Buffer\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers\n */\n\nvar ReglTexture2D = /*#__PURE__*/function () {\n function ReglTexture2D(reGl, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, ReglTexture2D);\n\n this.texture = void 0;\n this.width = void 0;\n this.height = void 0;\n var data = options.data,\n _options$type = options.type,\n type = _options$type === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].UNSIGNED_BYTE : _options$type,\n width = options.width,\n height = options.height,\n _options$flipY = options.flipY,\n flipY = _options$flipY === void 0 ? false : _options$flipY,\n _options$format = options.format,\n format = _options$format === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].RGBA : _options$format,\n _options$mipmap = options.mipmap,\n mipmap = _options$mipmap === void 0 ? false : _options$mipmap,\n _options$wrapS = options.wrapS,\n wrapS = _options$wrapS === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].CLAMP_TO_EDGE : _options$wrapS,\n _options$wrapT = options.wrapT,\n wrapT = _options$wrapT === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].CLAMP_TO_EDGE : _options$wrapT,\n _options$aniso = options.aniso,\n aniso = _options$aniso === void 0 ? 0 : _options$aniso,\n _options$alignment = options.alignment,\n alignment = _options$alignment === void 0 ? 1 : _options$alignment,\n _options$premultiplyA = options.premultiplyAlpha,\n premultiplyAlpha = _options$premultiplyA === void 0 ? false : _options$premultiplyA,\n _options$mag = options.mag,\n mag = _options$mag === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].NEAREST : _options$mag,\n _options$min = options.min,\n min = _options$min === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].NEAREST : _options$min,\n _options$colorSpace = options.colorSpace,\n colorSpace = _options$colorSpace === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].BROWSER_DEFAULT_WEBGL : _options$colorSpace;\n this.width = width;\n this.height = height;\n var textureOptions = {\n width: width,\n height: height,\n // @ts-ignore\n type: _constants__WEBPACK_IMPORTED_MODULE_3__[\"dataTypeMap\"][type],\n format: _constants__WEBPACK_IMPORTED_MODULE_3__[\"formatMap\"][format],\n wrapS: _constants__WEBPACK_IMPORTED_MODULE_3__[\"wrapModeMap\"][wrapS],\n wrapT: _constants__WEBPACK_IMPORTED_MODULE_3__[\"wrapModeMap\"][wrapT],\n // @ts-ignore\n mag: _constants__WEBPACK_IMPORTED_MODULE_3__[\"filterMap\"][mag],\n min: _constants__WEBPACK_IMPORTED_MODULE_3__[\"filterMap\"][min],\n alignment: alignment,\n flipY: flipY,\n colorSpace: _constants__WEBPACK_IMPORTED_MODULE_3__[\"colorSpaceMap\"][colorSpace],\n premultiplyAlpha: premultiplyAlpha,\n aniso: aniso\n };\n\n if (data) {\n textureOptions.data = data;\n }\n\n if (typeof mipmap === 'number') {\n textureOptions.mipmap = _constants__WEBPACK_IMPORTED_MODULE_3__[\"mipmapMap\"][mipmap];\n } else if (typeof mipmap === 'boolean') {\n textureOptions.mipmap = mipmap;\n }\n\n this.texture = reGl.texture(textureOptions);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(ReglTexture2D, [{\n key: \"get\",\n value: function get() {\n return this.texture;\n }\n }, {\n key: \"update\",\n value: function update() {\n // @ts-ignore\n this.texture._texture.bind();\n }\n }, {\n key: \"resize\",\n value: function resize(_ref) {\n var width = _ref.width,\n height = _ref.height;\n this.texture.resize(width, height);\n this.width = width;\n this.height = height;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.texture.destroy();\n }\n }]);\n\n return ReglTexture2D;\n}();\n\n\n//# sourceMappingURL=ReglTexture2D.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/ReglTexture2D.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.compareTwoTarget = compareTwoTarget;\nexports.createNodeFromXML = createNodeFromXML;\nexports.generateTarget = generateTarget;\nexports.getBBox = getBBox;\nexports.parseXML = parseXML;\nexports.xmlDataRenderer = void 0;\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _graphic = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/lib/util/graphic.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); } /**\n * @fileOverview 从xml建立自定义Node,包含update\n * @author xuzhi.mxz@antfin.com\n */\n/**\n * 一种更宽松的JSON 解析,如果遇到不符合规范的字段会直接转为字符串\n * @param text json 内容\n */\nfunction looseJSONParse(text) {\n if (typeof text !== 'string') {\n return text;\n }\n var safeParse = function safeParse(str) {\n if (typeof str !== 'string') {\n return str;\n }\n try {\n return JSON.parse(str.trim());\n } catch (e) {\n return str.trim();\n }\n };\n var firstAttempt = safeParse(text);\n if (typeof firstAttempt !== 'string') {\n return firstAttempt;\n }\n var tail = function tail(arr) {\n return arr[arr.length - 1];\n };\n var str = text.trim();\n var objectStack = [];\n var syntaxStack = [];\n var isLastPair = function isLastPair() {\n var syntaxes = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n syntaxes[_i] = arguments[_i];\n }\n return syntaxes.some(function (syntax) {\n return tail(syntaxStack) === syntax;\n });\n };\n var getValueStore = function getValueStore() {\n return tail(objectStack);\n };\n var rst = null;\n var i = 0;\n var temp = '';\n while (i < str.length) {\n var nowChar = str[i];\n var isInString = isLastPair('\"', \"'\");\n if (!isInString && !nowChar.trim()) {\n i += 1;\n continue;\n }\n var isLastTranslate = str[i - 1] === '\\\\';\n var isInObject = isLastPair('}');\n var isInArray = isLastPair(']');\n var isWaitingValue = isLastPair(',');\n var tempArr = getValueStore();\n if (isInString) {\n if (tail(syntaxStack) === nowChar && !isLastTranslate) {\n syntaxStack.pop();\n var value = safeParse(temp);\n tempArr.push(value);\n rst = value;\n temp = '';\n } else {\n temp += nowChar;\n }\n } else if (isInArray && nowChar === ',') {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n } else if (isInObject && nowChar === ':') {\n syntaxStack.push(',');\n if (temp) {\n tempArr.push(temp);\n temp = '';\n }\n } else if (isWaitingValue && nowChar === ',') {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n syntaxStack.pop();\n } else if (nowChar === '}' && (isInObject || isWaitingValue)) {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n if (isWaitingValue) {\n syntaxStack.pop();\n }\n var obj = {};\n for (var c = 1; c < tempArr.length; c += 2) {\n obj[tempArr[c - 1]] = tempArr[c];\n }\n objectStack.pop();\n if (objectStack.length) {\n tail(objectStack).push(obj);\n }\n syntaxStack.pop();\n rst = obj;\n } else if (nowChar === ']' && isInArray) {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n objectStack.pop();\n if (objectStack.length) {\n tail(objectStack).push(tempArr);\n }\n syntaxStack.pop();\n rst = tempArr;\n } else if (nowChar === '{') {\n objectStack.push([]);\n syntaxStack.push('}');\n } else if (nowChar === '[') {\n objectStack.push([]);\n syntaxStack.push(']');\n } else if (nowChar === '\"') {\n syntaxStack.push('\"');\n } else if (nowChar === \"'\") {\n syntaxStack.push(\"'\");\n } else {\n temp += nowChar;\n }\n i += 1;\n }\n return rst || temp;\n}\nvar keyConvert = function keyConvert(str) {\n return str.split('-').reduce(function (a, b) {\n return a + b.charAt(0).toUpperCase() + b.slice(1);\n });\n};\n/**\n * 简单的一个{{}}模板渲染,不包含任何复杂语法\n * @param xml\n */\nvar xmlDataRenderer = exports.xmlDataRenderer = function xmlDataRenderer(xml) {\n return function (data) {\n var len = xml.length;\n var arr = [];\n var i = 0;\n var tmp = '';\n while (i < len) {\n if (xml[i] === '{' && xml[i + 1] === '{') {\n arr.push(tmp);\n tmp = '';\n i += 2;\n } else if (xml[i] === '}' && xml[i + 1] === '}') {\n if (arr.length) {\n var last = arr.pop();\n tmp = (0, _util.get)(data, tmp, last.endsWith('=') ? \"\\\"{\".concat(tmp, \"}\\\"\") : tmp);\n arr.push(last + tmp);\n }\n i += 2;\n tmp = '';\n } else {\n tmp += xml[i];\n i += 1;\n }\n }\n arr.push(tmp);\n return arr.map(function (e, index) {\n return arr[index - 1] && arr[index - 1].endsWith('=') ? \"\\\"{\".concat(e, \"}\\\"\") : e;\n }).join('');\n };\n};\n/**\n * 解析XML,并转化为相应的JSON结构\n * @param xml xml解析后的节点\n */\nfunction parseXML(xml, cfg) {\n var attrs = {};\n var keys = xml.getAttributeNames && xml.getAttributeNames() || [];\n var children = xml.children && Array.from(xml.children).map(function (e) {\n return parseXML(e, cfg);\n });\n var rst = {};\n var tagName = xml.tagName ? xml.tagName.toLowerCase() : 'group';\n if (tagName === 'text') {\n attrs.text = xml.innerText;\n }\n rst.type = tagName;\n if (tagName === 'img') {\n rst.type = 'image';\n }\n Array.from(keys).forEach(function (k) {\n var key = keyConvert(k);\n var val = xml.getAttribute(k);\n try {\n if (key === 'style' || key === 'attrs') {\n var style = looseJSONParse(val);\n attrs = (0, _tslib.__assign)((0, _tslib.__assign)({}, attrs), style);\n } else {\n rst[key] = looseJSONParse(val);\n }\n } catch (e) {\n if (key === 'style') {\n throw e;\n }\n rst[key] = val;\n }\n });\n rst.attrs = attrs;\n if (cfg && cfg.style && rst.name && _typeof(cfg.style[rst.name]) === 'object') {\n rst.attrs = (0, _tslib.__assign)((0, _tslib.__assign)({}, rst.attrs), cfg.style[rst.name]);\n }\n if (cfg && cfg.style && rst.keyshape) {\n rst.attrs = (0, _tslib.__assign)((0, _tslib.__assign)({}, rst.attrs), cfg.style);\n }\n if (children.length) {\n rst.children = children;\n }\n return rst;\n}\n/**\n * 根据偏移量和内部节点最终的bounding box来得出该shape最终的bbox\n */\nfunction getBBox(node, offset, childrenBBox) {\n var _a = node.attrs,\n attrs = _a === void 0 ? {} : _a;\n var bbox = {\n x: offset.x || 0,\n y: offset.y || 0,\n width: childrenBBox.width || 0,\n height: childrenBBox.height || 0\n };\n var shapeHeight, shapeWidth;\n switch (node.type) {\n case 'maker':\n case 'circle':\n if (attrs.r) {\n shapeWidth = 2 * attrs.r;\n shapeHeight = 2 * attrs.r;\n }\n break;\n case 'text':\n if (attrs.text) {\n shapeWidth = (0, _graphic.getTextSize)(attrs.text, attrs.fontSize || 12)[0];\n shapeHeight = 16;\n bbox.y += shapeHeight;\n bbox.height = shapeHeight;\n bbox.width = shapeWidth;\n node.attrs = (0, _tslib.__assign)({\n fontSize: 12,\n fill: '#000'\n }, attrs);\n }\n break;\n default:\n if (attrs.width) {\n shapeWidth = attrs.width;\n }\n if (attrs.height) {\n shapeHeight = attrs.height;\n }\n }\n if (shapeHeight >= 0) {\n bbox.height = shapeHeight;\n }\n if (shapeWidth >= 0) {\n bbox.width = shapeWidth;\n }\n if (attrs.marginTop) {\n bbox.y += attrs.marginTop;\n }\n if (attrs.marginLeft) {\n bbox.x += attrs.marginLeft;\n }\n return bbox;\n}\n/**\n * 把从xml计算出的结构填上位置信息,补全attrs\n * @param target\n * @param lastOffset\n */\nfunction generateTarget(target, lastOffset) {\n var _a;\n if (lastOffset === void 0) {\n lastOffset = {\n x: 0,\n y: 0\n };\n }\n var defaultBbox = (0, _tslib.__assign)({\n x: 0,\n y: 0,\n width: 0,\n height: 0\n }, lastOffset);\n if ((_a = target.children) === null || _a === void 0 ? void 0 : _a.length) {\n var _b = target.attrs,\n attrs = _b === void 0 ? {} : _b;\n var marginTop = attrs.marginTop;\n var offset = (0, _tslib.__assign)({}, lastOffset);\n if (marginTop) {\n offset.y += marginTop;\n }\n for (var index = 0; index < target.children.length; index++) {\n target.children[index].attrs.key = \"\".concat(attrs.key || 'root', \" -\").concat(index, \" \");\n var node = generateTarget(target.children[index], offset);\n if (node.bbox) {\n var bbox = node.bbox;\n if (node.attrs.next === 'inline') {\n offset.x += node.bbox.width;\n } else {\n offset.y += node.bbox.height;\n }\n if (bbox.width + bbox.x > defaultBbox.width) {\n defaultBbox.width = bbox.width + bbox.x;\n }\n if (bbox.height + bbox.y > defaultBbox.height) {\n defaultBbox.height = bbox.height + bbox.y;\n }\n }\n }\n }\n target.bbox = getBBox(target, lastOffset, defaultBbox);\n target.attrs = (0, _tslib.__assign)((0, _tslib.__assign)({}, target.attrs), target.bbox);\n return target;\n}\n/**\n * 对比前后两个最终计算出来的node,并对比出最小改动,\n * 动作: 'add' 添加节点 | ’delete‘ 删除节点 | ’change‘ 改变节点attrs | 'restructure' 重构节点\n * @param nowTarget\n * @param formerTarget\n */\nfunction compareTwoTarget(nowTarget, formerTarget) {\n var _a, _b, _c, _d;\n var type = (nowTarget || {}).type;\n var key = ((formerTarget === null || formerTarget === void 0 ? void 0 : formerTarget.attrs) || {}).key;\n if (key && nowTarget) {\n nowTarget.attrs.key = key;\n }\n if (!nowTarget && formerTarget) {\n return {\n action: 'delete',\n val: formerTarget,\n type: type,\n key: key\n };\n }\n if (nowTarget && !formerTarget) {\n return {\n action: 'add',\n val: nowTarget,\n type: type\n };\n }\n if (!nowTarget && !formerTarget) {\n return {\n action: 'same',\n type: type\n };\n }\n var children = [];\n if (((_a = nowTarget.children) === null || _a === void 0 ? void 0 : _a.length) > 0 || ((_b = formerTarget.children) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n var length_1 = Math.max((_c = nowTarget.children) === null || _c === void 0 ? void 0 : _c.length, (_d = formerTarget.children) === null || _d === void 0 ? void 0 : _d.length);\n var formerChildren = formerTarget.children || [];\n var nowChildren = nowTarget.children || [];\n for (var index = 0; index < length_1; index += 1) {\n children.push(compareTwoTarget(nowChildren[index], formerChildren[index]));\n }\n }\n var formerKeys = Object.keys(formerTarget.attrs);\n var nowKeys = Object.keys(nowTarget.attrs);\n if (formerTarget.type !== nowTarget.type) {\n return {\n action: 'restructure',\n nowTarget: nowTarget,\n formerTarget: formerTarget,\n key: key,\n children: children\n };\n }\n if (formerKeys.filter(function (e) {\n return e !== 'children';\n }).some(function (e) {\n return nowTarget.attrs[e] !== formerTarget.attrs[e] || !nowKeys.includes(e);\n })) {\n return {\n action: 'change',\n val: nowTarget,\n children: children,\n type: type,\n key: key\n };\n }\n return {\n action: 'same',\n children: children,\n type: type,\n key: key\n };\n}\n/**\n * 根据xml或者返回xml的函数构建自定义节点的结构\n * @param gen\n */\nfunction createNodeFromXML(gen) {\n var structures = {};\n var compileXML = function compileXML(cfg) {\n var rawStr = typeof gen === 'function' ? gen(cfg) : gen;\n var target = xmlDataRenderer(rawStr)(cfg);\n var xmlParser = document.createElement('div');\n xmlParser.innerHTML = target;\n var xml = xmlParser.children[0];\n var result = generateTarget(parseXML(xml, cfg));\n xmlParser.remove();\n return result;\n };\n return {\n draw: function draw(cfg, group) {\n var resultTarget = compileXML(cfg);\n var keyshape = group;\n var renderTarget = function renderTarget(target) {\n var _a = target.attrs,\n attrs = _a === void 0 ? {} : _a,\n bbox = target.bbox,\n type = target.type,\n children = target.children,\n rest = (0, _tslib.__rest)(target, [\"attrs\", \"bbox\", \"type\", \"children\"]);\n if (target.type !== 'group') {\n var shape = group.addShape(target.type, (0, _tslib.__assign)({\n attrs: attrs,\n origin: {\n bbox: bbox,\n type: type,\n children: children\n }\n }, rest));\n if (target.keyshape) {\n keyshape = shape;\n }\n }\n if (target.children) {\n target.children.forEach(function (n) {\n return renderTarget(n);\n });\n }\n };\n renderTarget(resultTarget);\n structures[cfg.id] = [resultTarget];\n return keyshape;\n },\n update: function update(cfg, node) {\n if (!structures[cfg.id]) {\n structures[cfg.id] = [];\n }\n var container = node.getContainer();\n var children = container.get('children');\n var newTarget = compileXML(cfg);\n var lastTarget = structures[cfg.id].pop();\n var diffResult = compareTwoTarget(newTarget, lastTarget);\n var addShape = function addShape(shape) {\n var _a;\n if (shape.type !== 'group') {\n container.addShape(shape.type, {\n attrs: shape.attrs\n });\n }\n if ((_a = shape.children) === null || _a === void 0 ? void 0 : _a.length) {\n shape.children.map(function (e) {\n return addShape(e);\n });\n }\n };\n var delShape = function delShape(shape) {\n var _a;\n var targetShape = children.find(function (e) {\n return e.attrs.key === shape.attrs.key;\n });\n if (targetShape) {\n container.removeChild(targetShape);\n }\n if ((_a = shape.children) === null || _a === void 0 ? void 0 : _a.length) {\n shape.children.map(function (e) {\n return delShape(e);\n });\n }\n };\n var updateTarget = function updateTarget(target) {\n var key = target.key;\n if (target.type !== 'group') {\n var targetShape = children.find(function (e) {\n return e.attrs.key === key;\n });\n switch (target.action) {\n case 'change':\n if (targetShape) {\n var originAttr = target.val.keyshape ? node.getOriginStyle() : {};\n targetShape.attr((0, _tslib.__assign)((0, _tslib.__assign)({}, originAttr), target.val.attrs));\n }\n break;\n case 'add':\n addShape(target.val);\n break;\n case 'delete':\n delShape(target.val);\n break;\n case 'restructure':\n delShape(target.formerTarget);\n addShape(target.nowTarget);\n break;\n default:\n break;\n }\n }\n if (target.children) {\n target.children.forEach(function (n) {\n return updateTarget(n);\n });\n }\n };\n updateTarget(diffResult);\n structures[cfg.id].push(newTarget);\n },\n getAnchorPoints: function getAnchorPoints() {\n return [[0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0]];\n }\n };\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/element/xml.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js ***! - \******************************************************************/ -/*! exports provided: primitiveMap, usageMap, dataTypeMap, formatMap, mipmapMap, filterMap, wrapModeMap, colorSpaceMap, depthFuncMap, blendEquationMap, blendFuncMap, stencilFuncMap, stencilOpMap, cullFaceMap */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/global.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/global.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"primitiveMap\", function() { return primitiveMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"usageMap\", function() { return usageMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataTypeMap\", function() { return dataTypeMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatMap\", function() { return formatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mipmapMap\", function() { return mipmapMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterMap\", function() { return filterMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrapModeMap\", function() { return wrapModeMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"colorSpaceMap\", function() { return colorSpaceMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"depthFuncMap\", function() { return depthFuncMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blendEquationMap\", function() { return blendEquationMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blendFuncMap\", function() { return blendFuncMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"stencilFuncMap\", function() { return stencilFuncMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"stencilOpMap\", function() { return stencilOpMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cullFaceMap\", function() { return cullFaceMap; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n\n\nvar _primitiveMap, _usageMap, _dataTypeMap, _formatMap, _mipmapMap, _filterMap, _wrapModeMap, _colorSpaceMap, _depthFuncMap, _blendEquationMap, _blendFuncMap, _stencilFuncMap, _stencilOpMap, _cullFaceMap;\n\n/**\n * @desc 由于 regl 使用大量字符串而非 WebGL 常量,因此需要映射\n */\n\n// @see https://github.com/regl-project/regl/blob/gh-pages/lib/constants/primitives.json\nvar primitiveMap = (_primitiveMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].POINTS, 'points'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINES, 'lines'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINE_LOOP, 'line loop'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINE_STRIP, 'line strip'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLES, 'triangles'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLE_FAN, 'triangle fan'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLE_STRIP, 'triangle strip'), _primitiveMap);\nvar usageMap = (_usageMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_usageMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].STATIC_DRAW, 'static'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_usageMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DYNAMIC_DRAW, 'dynamic'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_usageMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].STREAM_DRAW, 'stream'), _usageMap);\nvar dataTypeMap = (_dataTypeMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].BYTE, 'int8'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].UNSIGNED_INT, 'int16'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].INT, 'int32'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].UNSIGNED_BYTE, 'uint8'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].UNSIGNED_SHORT, 'uint16'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].UNSIGNED_INT, 'uint32'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_dataTypeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FLOAT, 'float'), _dataTypeMap);\nvar formatMap = (_formatMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALPHA, 'alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LUMINANCE, 'luminance'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LUMINANCE_ALPHA, 'luminance alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGB, 'rgb'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGBA, 'rgba'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGBA4, 'rgba4'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGB5_A1, 'rgb5 a1'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGB565, 'rgb565'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DEPTH_COMPONENT, 'depth'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DEPTH_STENCIL, 'depth stencil'), _formatMap);\nvar mipmapMap = (_mipmapMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_mipmapMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DONT_CARE, 'dont care'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_mipmapMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NICEST, 'nice'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_mipmapMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FASTEST, 'fast'), _mipmapMap);\nvar filterMap = (_filterMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEAREST, 'nearest'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINEAR, 'linear'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINEAR_MIPMAP_LINEAR, 'mipmap'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEAREST_MIPMAP_LINEAR, 'nearest mipmap linear'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINEAR_MIPMAP_NEAREST, 'linear mipmap nearest'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEAREST_MIPMAP_NEAREST, 'nearest mipmap nearest'), _filterMap);\nvar wrapModeMap = (_wrapModeMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].REPEAT, 'repeat'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].CLAMP_TO_EDGE, 'clamp'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MIRRORED_REPEAT, 'mirror'), _wrapModeMap);\nvar colorSpaceMap = (_colorSpaceMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_colorSpaceMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NONE, 'none'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_colorSpaceMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].BROWSER_DEFAULT_WEBGL, 'browser'), _colorSpaceMap);\nvar depthFuncMap = (_depthFuncMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEVER, 'never'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALWAYS, 'always'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LESS, 'less'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LEQUAL, 'lequal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GREATER, 'greater'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GEQUAL, 'gequal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].EQUAL, 'equal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NOTEQUAL, 'notequal'), _depthFuncMap);\nvar blendEquationMap = (_blendEquationMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_ADD, 'add'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MIN_EXT, 'min'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MAX_EXT, 'max'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_SUBTRACT, 'subtract'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_REVERSE_SUBTRACT, 'reverse subtract'), _blendEquationMap);\nvar blendFuncMap = (_blendFuncMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ZERO, 'zero'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE, 'one'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_COLOR, 'src color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_SRC_COLOR, 'one minus src color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_ALPHA, 'src alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_SRC_ALPHA, 'one minus src alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DST_COLOR, 'dst color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_DST_COLOR, 'one minus dst color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DST_ALPHA, 'dst alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_DST_ALPHA, 'one minus dst alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].CONSTANT_COLOR, 'constant color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_CONSTANT_COLOR, 'one minus constant color'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].CONSTANT_ALPHA, 'constant alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_CONSTANT_ALPHA, 'one minus constant alpha'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_ALPHA_SATURATE, 'src alpha saturate'), _blendFuncMap);\nvar stencilFuncMap = (_stencilFuncMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEVER, 'never'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALWAYS, 'always'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LESS, 'less'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LEQUAL, 'lequal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GREATER, 'greater'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GEQUAL, 'gequal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].EQUAL, 'equal'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NOTEQUAL, 'notequal'), _stencilFuncMap);\nvar stencilOpMap = (_stencilOpMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ZERO, 'zero'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].KEEP, 'keep'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].REPLACE, 'replace'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].INVERT, 'invert'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].INCR, 'increment'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DECR, 'decrement'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].INCR_WRAP, 'increment wrap'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_stencilOpMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DECR_WRAP, 'decrement wrap'), _stencilOpMap);\nvar cullFaceMap = (_cullFaceMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cullFaceMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FRONT, 'front'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_cullFaceMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].BACK, 'back'), _cullFaceMap);\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/constants.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar subjectColor = 'rgb(95, 149, 255)';\nvar backColor = 'rgb(255, 255, 255)';\nvar textColor = 'rgb(0, 0, 0)';\nvar activeFill = 'rgb(247, 250, 255)';\nvar nodeMainFill = 'rgb(239, 244, 255)';\nvar comboFill = 'rgb(253, 253, 253)';\nvar disabledFill = 'rgb(250, 250, 250)';\nvar edgeMainStroke = 'rgb(224, 224, 224)';\nvar edgeInactiveStroke = 'rgb(234, 234, 234)';\nvar edgeDisablesStroke = 'rgb(245, 245, 245)';\nvar inactiveStroke = 'rgb(191, 213, 255)';\nvar highlightStroke = '#4572d9';\nvar highlightFill = 'rgb(223, 234, 255)';\nvar colorSet = {\n // for nodes\n mainStroke: subjectColor,\n mainFill: nodeMainFill,\n activeStroke: subjectColor,\n activeFill: activeFill,\n inactiveStroke: inactiveStroke,\n inactiveFill: activeFill,\n selectedStroke: subjectColor,\n selectedFill: backColor,\n highlightStroke: highlightStroke,\n highlightFill: highlightFill,\n disableStroke: edgeMainStroke,\n disableFill: disabledFill,\n // for edges\n edgeMainStroke: edgeMainStroke,\n edgeActiveStroke: subjectColor,\n edgeInactiveStroke: edgeInactiveStroke,\n edgeSelectedStroke: subjectColor,\n edgeHighlightStroke: subjectColor,\n edgeDisableStroke: edgeDisablesStroke,\n // for combos\n comboMainStroke: edgeMainStroke,\n comboMainFill: comboFill,\n comboActiveStroke: subjectColor,\n comboActiveFill: activeFill,\n comboInactiveStroke: edgeMainStroke,\n comboInactiveFill: comboFill,\n comboSelectedStroke: subjectColor,\n comboSelectedFill: comboFill,\n comboHighlightStroke: highlightStroke,\n comboHighlightFill: comboFill,\n comboDisableStroke: edgeInactiveStroke,\n comboDisableFill: disabledFill\n};\nvar _default = exports.default = {\n version: '0.8.23',\n rootContainerClassName: 'root-container',\n nodeContainerClassName: 'node-container',\n edgeContainerClassName: 'edge-container',\n comboContainerClassName: 'combo-container',\n delegateContainerClassName: 'delegate-container',\n defaultLoopPosition: 'top',\n nodeLabel: {\n style: {\n fill: '#000',\n fontSize: 12,\n textAlign: 'center',\n textBaseline: 'middle'\n },\n offset: 4 // 节点的默认文本不居中时的偏移量\n },\n\n defaultNode: {\n type: 'circle',\n style: {\n lineWidth: 1,\n stroke: colorSet.mainStroke,\n fill: nodeMainFill\n },\n size: 20,\n color: colorSet.mainStroke,\n linkPoints: {\n size: 8,\n lineWidth: 1,\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke\n }\n },\n // 节点应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n nodeStateStyles: {\n active: {\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke,\n lineWidth: 2,\n shadowColor: colorSet.mainStroke,\n shadowBlur: 10\n },\n selected: {\n fill: colorSet.selectedFill,\n stroke: colorSet.selectedStroke,\n lineWidth: 4,\n shadowColor: colorSet.selectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n fill: colorSet.highlightFill,\n stroke: colorSet.highlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n fill: colorSet.inactiveFill,\n stroke: colorSet.inactiveStroke,\n lineWidth: 1\n },\n disable: {\n fill: colorSet.disableFill,\n stroke: colorSet.disableStroke,\n lineWidth: 1\n }\n },\n edgeLabel: {\n style: {\n fill: textColor,\n textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n }\n },\n defaultEdge: {\n type: 'line',\n size: 1,\n style: {\n stroke: colorSet.edgeMainStroke,\n lineAppendWidth: 2\n },\n color: colorSet.edgeMainStroke\n },\n // 边应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n edgeStateStyles: {\n active: {\n stroke: colorSet.edgeActiveStroke,\n lineWidth: 1\n },\n selected: {\n stroke: colorSet.edgeSelectedStroke,\n lineWidth: 2,\n shadowColor: colorSet.edgeSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.edgeHighlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.edgeInactiveStroke,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.edgeDisableStroke,\n lineWidth: 1\n }\n },\n comboLabel: {\n style: {\n fill: textColor,\n // textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n },\n refY: 10,\n refX: 10 // Combo 的默认文本不居中时的偏移量\n },\n\n defaultCombo: {\n type: 'circle',\n style: {\n fill: colorSet.comboMainFill,\n lineWidth: 1,\n stroke: colorSet.comboMainStroke,\n r: 5,\n width: 20,\n height: 10\n },\n size: [20, 5],\n color: colorSet.comboMainStroke,\n padding: [25, 20, 15, 20]\n },\n // combo 应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n comboStateStyles: {\n active: {\n stroke: colorSet.comboActiveStroke,\n lineWidth: 1,\n fill: colorSet.comboActiveFill\n },\n selected: {\n stroke: colorSet.comboSelectedStroke,\n lineWidth: 2,\n fill: colorSet.comboSelectedFill,\n shadowColor: colorSet.comboSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.comboHighlightStroke,\n lineWidth: 2,\n fill: colorSet.comboHighlightFill,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.comboInactiveStroke,\n fill: colorSet.comboInactiveFill,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.comboDisableStroke,\n fill: colorSet.comboDisableFill,\n lineWidth: 1\n }\n },\n delegateStyle: {\n fill: '#F3F9FF',\n fillOpacity: 0.5,\n stroke: '#1890FF',\n strokeOpacity: 0.9,\n lineDash: [5, 5]\n },\n windowFontFamily: typeof window !== 'undefined' && window.getComputedStyle && document.body ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif'\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/global.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgl/index.js": +/***/ "./node_modules/@antv/g6-core/lib/interface/behavior.js": /*!**************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgl/index.js ***! + !*** ./node_modules/@antv/g6-core/lib/interface/behavior.js ***! \**************************************************************/ -/*! exports provided: WebGLEngine */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGLEngine\", function() { return WebGLEngine; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var regl__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! regl */ \"./node_modules/regl/dist/regl.js\");\n/* harmony import */ var regl__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(regl__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _ReglAttribute__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./ReglAttribute */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglAttribute.js\");\n/* harmony import */ var _ReglBuffer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./ReglBuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglBuffer.js\");\n/* harmony import */ var _ReglComputeModel__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./ReglComputeModel */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglComputeModel.js\");\n/* harmony import */ var _ReglElements__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./ReglElements */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglElements.js\");\n/* harmony import */ var _ReglFramebuffer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./ReglFramebuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglFramebuffer.js\");\n/* harmony import */ var _ReglModel__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./ReglModel */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglModel.js\");\n/* harmony import */ var _ReglTexture2D__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./ReglTexture2D */ \"./node_modules/@antv/g-webgpu-engine/es/webgl/ReglTexture2D.js\");\n\n\n\n\n\nvar _dec, _class, _temp;\n\n/**\n * render w/ regl\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md\n */\n\n\n\n\n\n\n\n\n\n\n/**\n * regl renderer\n */\n\nvar WebGLEngine = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_5__[\"injectable\"])(), _dec(_class = (_temp = /*#__PURE__*/function () {\n function WebGLEngine() {\n var _this = this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, WebGLEngine);\n\n this.supportWebGPU = false;\n this.useWGSL = false;\n this.$canvas = void 0;\n this.gl = void 0;\n this.inited = void 0;\n\n this.createModel = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(options) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!options.uniforms) {\n _context2.next = 3;\n break;\n }\n\n _context2.next = 3;\n return Promise.all(Object.keys(options.uniforms).map( /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(name) {\n var texture;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!(options.uniforms[name] && options.uniforms[name].load !== undefined)) {\n _context.next = 5;\n break;\n }\n\n _context.next = 3;\n return options.uniforms[name].load();\n\n case 3:\n texture = _context.sent;\n // @ts-ignore\n options.uniforms[name] = texture;\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n }()));\n\n case 3:\n return _context2.abrupt(\"return\", new _ReglModel__WEBPACK_IMPORTED_MODULE_12__[\"default\"](_this.gl, options));\n\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n\n this.createAttribute = function (options) {\n return new _ReglAttribute__WEBPACK_IMPORTED_MODULE_7__[\"default\"](_this.gl, options);\n };\n\n this.createBuffer = function (options) {\n return new _ReglBuffer__WEBPACK_IMPORTED_MODULE_8__[\"default\"](_this.gl, options);\n };\n\n this.createElements = function (options) {\n return new _ReglElements__WEBPACK_IMPORTED_MODULE_10__[\"default\"](_this.gl, options);\n };\n\n this.createTexture2D = function (options) {\n return new _ReglTexture2D__WEBPACK_IMPORTED_MODULE_13__[\"default\"](_this.gl, options);\n };\n\n this.createFramebuffer = function (options) {\n return new _ReglFramebuffer__WEBPACK_IMPORTED_MODULE_11__[\"default\"](_this.gl, options);\n };\n\n this.useFramebuffer = function (framebuffer, drawCommands) {\n _this.gl({\n framebuffer: framebuffer ? framebuffer.get() : null\n })(drawCommands);\n };\n\n this.createComputeModel = /*#__PURE__*/function () {\n var _ref3 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(context) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n return _context3.abrupt(\"return\", new _ReglComputeModel__WEBPACK_IMPORTED_MODULE_9__[\"default\"](_this.gl, context));\n\n case 1:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3);\n }));\n\n return function (_x3) {\n return _ref3.apply(this, arguments);\n };\n }();\n\n this.clear = function (options) {\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clear-the-draw-buffer\n var color = options.color,\n depth = options.depth,\n stencil = options.stencil,\n _options$framebuffer = options.framebuffer,\n framebuffer = _options$framebuffer === void 0 ? null : _options$framebuffer;\n var reglClearOptions = {\n color: color,\n depth: depth,\n stencil: stencil\n };\n reglClearOptions.framebuffer = framebuffer === null ? framebuffer : framebuffer.get();\n\n _this.gl.clear(reglClearOptions);\n };\n\n this.setScissor = function (scissor) {\n if (_this.gl && _this.gl._gl) {\n // https://developer.mozilla.org/zh-CN/docs/Web/API/WebGLRenderingContext/scissor\n if (scissor.enable && scissor.box) {\n // console.log(scissor.box);\n _this.gl._gl.enable(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].SCISSOR_TEST);\n\n _this.gl._gl.scissor(scissor.box.x, scissor.box.y, scissor.box.width, scissor.box.height);\n } else {\n _this.gl._gl.disable(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"gl\"].SCISSOR_TEST);\n }\n\n _this.gl._refresh();\n }\n };\n\n this.viewport = function (_ref4) {\n var x = _ref4.x,\n y = _ref4.y,\n width = _ref4.width,\n height = _ref4.height;\n\n if (_this.gl && _this.gl._gl) {\n // use WebGL context directly\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#unsafe-escape-hatch\n _this.gl._gl.viewport(x, y, width, height);\n\n _this.gl._refresh();\n }\n };\n\n this.readPixels = function (options) {\n var framebuffer = options.framebuffer,\n x = options.x,\n y = options.y,\n width = options.width,\n height = options.height;\n var readPixelsOptions = {\n x: x,\n y: y,\n width: width,\n height: height\n };\n\n if (framebuffer) {\n readPixelsOptions.framebuffer = framebuffer.get();\n }\n\n return _this.gl.read(readPixelsOptions);\n };\n\n this.getCanvas = function () {\n return _this.$canvas;\n };\n\n this.getGLContext = function () {\n return _this.gl._gl;\n };\n\n this.destroy = function () {\n if (_this.gl) {\n // @see https://github.com/regl-project/regl/blob/gh-pages/API.md#clean-up\n _this.gl.destroy();\n\n _this.inited = false;\n }\n };\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(WebGLEngine, [{\n key: \"init\",\n value: function () {\n var _init = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee4(cfg) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n if (!this.inited) {\n _context4.next = 2;\n break;\n }\n\n return _context4.abrupt(\"return\");\n\n case 2:\n this.$canvas = cfg.canvas; // tslint:disable-next-line:typedef\n\n _context4.next = 5;\n return new Promise(function (resolve, reject) {\n regl__WEBPACK_IMPORTED_MODULE_6___default()({\n canvas: cfg.canvas,\n attributes: {\n alpha: true,\n // use TAA instead of MSAA\n // @see https://www.khronos.org/registry/webgl/specs/1.0/#5.2.1\n antialias: cfg.antialias,\n premultipliedAlpha: true // preserveDrawingBuffer: false,\n\n },\n pixelRatio: 1,\n // TODO: use extensions\n extensions: ['OES_element_index_uint', 'OES_texture_float', 'OES_standard_derivatives', // wireframe\n 'angle_instanced_arrays' // VSM shadow map\n ],\n optionalExtensions: ['EXT_texture_filter_anisotropic', 'EXT_blend_minmax', 'WEBGL_depth_texture'],\n profile: true,\n onDone: function onDone(err, r) {\n if (err || !r) {\n reject(err);\n } // @ts-ignore\n\n\n resolve(r);\n }\n });\n });\n\n case 5:\n this.gl = _context4.sent;\n this.inited = true;\n\n case 7:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function init(_x4) {\n return _init.apply(this, arguments);\n }\n\n return init;\n }()\n }, {\n key: \"isFloatSupported\",\n value: function isFloatSupported() {\n // @see https://github.com/antvis/GWebGPUEngine/issues/26\n // @ts-ignore\n return this.gl.limits.readFloat;\n }\n }, {\n key: \"beginFrame\",\n value: function beginFrame() {//\n }\n }, {\n key: \"endFrame\",\n value: function endFrame() {//\n }\n }]);\n\n return WebGLEngine;\n}(), _temp)) || _class);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgl/index.js?"); - -/***/ }), - -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUAttribute.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUAttribute.js ***! - \*************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WebGPUAttribute; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\nvar WebGPUAttribute = /*#__PURE__*/function () {\n function WebGPUAttribute(engine, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, WebGPUAttribute);\n\n this.engine = engine;\n this.options = options;\n this.attribute = void 0;\n this.buffer = void 0;\n var _options = options,\n buffer = _options.buffer,\n offset = _options.offset,\n stride = _options.stride,\n normalized = _options.normalized,\n size = _options.size,\n divisor = _options.divisor,\n arrayStride = _options.arrayStride,\n attributes = _options.attributes,\n stepMode = _options.stepMode;\n this.buffer = buffer;\n this.attribute = {\n buffer: buffer.get(),\n offset: offset || 0,\n stride: stride || 0,\n normalized: normalized || false,\n divisor: divisor || 0,\n arrayStride: arrayStride || 0,\n // @ts-ignore\n attributes: attributes,\n stepMode: stepMode || 'vertex'\n };\n\n if (size) {\n this.attribute.size = size;\n }\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(WebGPUAttribute, [{\n key: \"get\",\n value: function get() {\n return this.attribute;\n }\n }, {\n key: \"updateBuffer\",\n value: function updateBuffer(options) {\n this.buffer.subData(options);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.buffer.destroy();\n }\n }]);\n\n return WebGPUAttribute;\n}();\n\n\n//# sourceMappingURL=WebGPUAttribute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUAttribute.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.G6GraphEvent = void 0;\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar _gBase = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\nvar G6GraphEvent = exports.G6GraphEvent = /** @class */function (_super) {\n (0, _tslib.__extends)(G6GraphEvent, _super);\n function G6GraphEvent(type, event) {\n var _this = _super.call(this, type, event) || this;\n _this.item = event.item;\n _this.canvasX = event.canvasX;\n _this.canvasY = event.canvasY;\n _this.wheelDelta = event.wheelDelta;\n _this.detail = event.detail;\n return _this;\n }\n return G6GraphEvent;\n}(_gBase.Event);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/interface/behavior.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUBuffer.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUBuffer.js ***! - \**********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/item/item.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/item/item.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WebGPUBuffer; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__);\n\n\n\n\n\nvar WebGPUBuffer = /*#__PURE__*/function () {\n function WebGPUBuffer(engine, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, WebGPUBuffer);\n\n this.engine = engine;\n this.options = options;\n this.buffer = void 0;\n var _options = options,\n data = _options.data,\n usage = _options.usage,\n type = _options.type;\n this.buffer = this.createBuffer(data instanceof Array ? new Float32Array(data) : data, // TODO: WebGL 和 WebGPU buffer usage 映射关系\n usage || _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__[\"BufferUsage\"].Vertex | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__[\"BufferUsage\"].CopyDst);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(WebGPUBuffer, [{\n key: \"get\",\n value: function get() {\n return this.buffer;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.buffer.destroy();\n }\n }, {\n key: \"subData\",\n value: function subData(_ref) {\n var data = _ref.data,\n offset = _ref.offset;\n this.setSubData(this.buffer, offset, data instanceof Array ? new Float32Array(data) : data);\n }\n }, {\n key: \"createBuffer\",\n value: function createBuffer(view, flags) {\n // @ts-ignore\n var padding = view.byteLength % 4;\n var verticesBufferDescriptor = {\n // @ts-ignore\n size: view.byteLength + padding,\n usage: flags\n };\n var buffer = this.engine.device.createBuffer(verticesBufferDescriptor);\n this.setSubData(buffer, 0, view);\n return buffer;\n }\n /**\n * 不同于 Babylon.js 的版本,使用最新的 GPUQueue.writeBuffer 方法\n * @see https://gpuweb.github.io/gpuweb/#dom-gpuqueue-writebuffer\n * 已废弃创建一个临时的 mapped buffer 用于拷贝数据 @see https://gpuweb.github.io/gpuweb/#GPUDevice-createBufferMapped\n * @see https://github.com/gpuweb/gpuweb/blob/master/design/BufferOperations.md#updating-data-to-an-existing-buffer-like-webgls-buffersubdata\n */\n\n }, {\n key: \"setSubData\",\n value: function setSubData(destBuffer, destOffset, srcArrayBuffer) {\n // deprecated API setSubData\n // destBuffer.setSubData(0, srcArrayBuffer);\n // deprecated API createBufferMapped\n // use createBuffer & getMappedRange instead\n // const [srcBuffer, arrayBuffer] = this.engine.device.createBufferMapped({\n // size: byteCount,\n // usage: WebGPUConstants.BufferUsage.CopySrc,\n // });\n var queue = _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"isSafari\"] ? // @ts-ignore\n this.engine.device.getQueue() : this.engine.device.defaultQueue; // @ts-ignore\n\n queue.writeBuffer(destBuffer, destOffset, srcArrayBuffer);\n }\n }]);\n\n return WebGPUBuffer;\n}();\n\n\n//# sourceMappingURL=WebGPUBuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUBuffer.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _shape = _interopRequireDefault(__webpack_require__(/*! ../element/shape */ \"./node_modules/@antv/g6-core/lib/element/shape.js\"));\nvar _graphic = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/lib/util/graphic.js\");\nvar _math = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/lib/util/math.js\");\nvar _base = __webpack_require__(/*! ../util/base */ \"./node_modules/@antv/g6-core/lib/util/base.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar CACHE_BBOX = 'bboxCache';\nvar CACHE_CANVAS_BBOX = 'bboxCanvasCache';\nvar ARROWS = ['startArrow', 'endArrow'];\nvar ItemBase = /** @class */function () {\n function ItemBase(cfg) {\n this._cfg = {};\n this.destroyed = false;\n // 是否开启优化,由 graph 根据当前图上节点数量来控制\n this.optimize = false;\n var defaultCfg = {\n /**\n * id\n * @type {string}\n */\n id: undefined,\n /**\n * 类型\n * @type {string}\n */\n type: 'item',\n /**\n * data model\n * @type {object}\n */\n model: {},\n /**\n * g group\n * @type {G.Group}\n */\n group: undefined,\n /**\n * is open animate\n * @type {boolean}\n */\n animate: false,\n /**\n * visible - not group visible\n * @type {boolean}\n */\n visible: true,\n /**\n * locked - lock node\n * @type {boolean}\n */\n locked: false,\n /**\n * capture event\n * @type {boolean}\n */\n event: true,\n /**\n * key shape to calculate item's bbox\n * @type object\n */\n keyShape: undefined,\n /**\n * item's states, such as selected or active\n * @type Array\n */\n states: []\n };\n this._cfg = Object.assign(defaultCfg, this.getDefaultCfg(), cfg);\n var model = this.get('model');\n var id = model.id;\n var itemType = this.get('type');\n if (typeof id === 'undefined') {\n id = (0, _base.uniqueId)(itemType);\n } else if (typeof id !== 'string') {\n id = String(id);\n }\n this.get('model').id = id;\n this.set('id', id);\n var group = cfg.group;\n if (group) {\n group.set('item', this);\n group.set('id', id);\n }\n this.init();\n this.draw();\n var shapeType = model.shape || model.type || (itemType === 'edge' ? 'line' : 'circle');\n var shapeFactory = this.get('shapeFactory');\n if (shapeFactory && shapeFactory[shapeType]) {\n var options = shapeFactory[shapeType].options;\n // merge the stateStyles from item and shape\n if (options && options.stateStyles) {\n var styles = this.get('styles') || model.stateStyles;\n styles = (0, _util.deepMix)({}, options.stateStyles, styles);\n this.set('styles', styles);\n }\n }\n }\n /**\n * 根据 keyshape 计算包围盒\n */\n ItemBase.prototype.calculateBBox = function () {\n var keyShape = this.get('keyShape');\n var group = this.get('group');\n // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n var bbox = (0, _graphic.getBBox)(keyShape, group);\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n return bbox;\n };\n /**\n * 根据 keyshape 计算包围盒\n */\n ItemBase.prototype.calculateCanvasBBox = function () {\n var keyShape = this.get('keyShape');\n var group = this.get('group');\n // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n var bbox = (0, _graphic.getBBox)(keyShape, group);\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n return bbox;\n };\n /**\n * draw shape\n */\n ItemBase.prototype.drawInner = function () {\n var self = this;\n var shapeFactory = self.get('shapeFactory');\n var group = self.get('group');\n var model = self.get('model');\n group.clear();\n var visible = model.visible;\n if (visible !== undefined && !visible) self.changeVisibility(visible);\n if (!shapeFactory) {\n return;\n }\n self.updatePosition(model);\n var cfg = self.getShapeCfg(model); // 可能会附加额外信息\n var shapeType = cfg.type;\n var keyShape = shapeFactory.draw(shapeType, cfg, group);\n if (keyShape) {\n self.set('keyShape', keyShape);\n keyShape.set('isKeyShape', true);\n keyShape.set('draggable', true);\n }\n this.setOriginStyle();\n // 防止由于用户外部修改 model 中的 shape 导致 shape 不更新\n this.set('currentShape', shapeType);\n this.restoreStates(shapeFactory, shapeType);\n };\n /**\n * 设置图元素原始样式\n * @param keyShape 图元素 keyShape\n * @param group Group 容器\n */\n ItemBase.prototype.setOriginStyle = function () {\n var group = this.get('group');\n var children = group.get('children');\n var keyShape = this.getKeyShape();\n var self = this;\n var keyShapeName = keyShape.get('name');\n if (!this.get('originStyle')) {\n // 第一次 set originStyle,直接拿首次渲染所有图形的 attrs\n var originStyles = {};\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var shapeType = child.get('type');\n var name_1 = child.get('name');\n if (name_1 && name_1 !== keyShapeName) {\n originStyles[name_1] = shapeType !== 'image' ? (0, _util.clone)(child.attr()) : self.getShapeStyleByName(name_1);\n // The text's position and matrix is not allowed to be affected by states\n if (shapeType === 'text' && originStyles[name_1]) {\n delete originStyles[name_1].x;\n delete originStyles[name_1].y;\n delete originStyles[name_1].matrix;\n }\n } else {\n var keyShapeStyle = self.getShapeStyleByName(); // 可优化,需要去除 child.attr 中其他 shape 名的对象\n delete keyShapeStyle.path;\n delete keyShapeStyle.matrix;\n if (!keyShapeName) {\n Object.assign(originStyles, keyShapeStyle);\n } else {\n // 若 keyShape 有 name 且 !name,这个图形不是 keyShape,给这个图形一个 name\n if (!name_1) {\n var shapeName = (0, _base.uniqueId)('shape');\n child.set('name', shapeName);\n group['shapeMap'][shapeName] = child;\n originStyles[shapeName] = shapeType !== 'image' ? (0, _util.clone)(child.attr()) : self.getShapeStyleByName(name_1);\n } else {\n originStyles[keyShapeName] = keyShapeStyle;\n }\n }\n }\n }\n self.set('originStyle', originStyles);\n } else {\n // 第二次 set originStyles,需要找到不是 stateStyles 的样式,更新到 originStyles 中\n // 上一次设置的 originStyle,是初始的 shape attrs\n var styles_1 = this.get('originStyle');\n // let styles: ShapeStyle = {};\n if (keyShapeName && !styles_1[keyShapeName]) styles_1[keyShapeName] = {};\n // 获取当前状态样式\n var currentStatesStyle_1 = this.getCurrentStatesStyle();\n var _loop_1 = function _loop_1(i) {\n var child = children[i];\n var name_2 = child.get('name');\n var shapeAttrs = child.attr();\n if (name_2 && name_2 !== keyShapeName) {\n // 有 name 的非 keyShape 图形\n var shapeStateStyle_1 = currentStatesStyle_1[name_2];\n if (!styles_1[name_2]) styles_1[name_2] = {};\n if (shapeStateStyle_1) {\n Object.keys(shapeAttrs).forEach(function (key) {\n var value = shapeAttrs[key];\n if (value !== shapeStateStyle_1[key]) styles_1[name_2][key] = value;\n });\n } else {\n styles_1[name_2] = child.get('type') !== 'image' ? (0, _util.clone)(shapeAttrs) : self.getShapeStyleByName(name_2);\n }\n } else {\n var shapeAttrs_1 = child.attr();\n var keyShapeStateStyles_1 = {};\n Object.keys(currentStatesStyle_1).forEach(function (styleKey) {\n var subStyle = currentStatesStyle_1[styleKey];\n if (styleKey === keyShapeName || !(0, _util.isPlainObject)(subStyle)) {\n keyShapeStateStyles_1[styleKey] = subStyle;\n }\n });\n Object.keys(shapeAttrs_1).forEach(function (key) {\n var value = shapeAttrs_1[key];\n // 如果是对象且不是 arrow,则是其他 shape 的样式\n // if (isPlainObject(value) && ARROWS.indexOf(name) === -1) return;\n if (keyShapeStateStyles_1[key] !== value) {\n if (keyShapeName) styles_1[keyShapeName][key] = value;else styles_1[key] = value;\n }\n });\n }\n };\n // 遍历当前所有图形的 attrs,找到不是 stateStyles 的样式更新到 originStyles 中\n for (var i = 0; i < children.length; i++) {\n _loop_1(i);\n }\n delete styles_1.path;\n delete styles_1.matrix;\n delete styles_1.x;\n delete styles_1.y;\n if (styles_1[keyShapeName]) {\n delete styles_1[keyShapeName].x;\n delete styles_1[keyShapeName].y;\n delete styles_1[keyShapeName].matrix;\n delete styles_1[keyShapeName].path;\n }\n self.set('originStyle', styles_1);\n }\n };\n /**\n * restore shape states\n * @param shapeFactory\n * @param shapeType\n */\n ItemBase.prototype.restoreStates = function (shapeFactory, shapeType) {\n var self = this;\n var states = self.get('states');\n (0, _util.each)(states, function (state) {\n shapeFactory.setState(shapeType, state, true, self);\n });\n };\n ItemBase.prototype.init = function () {\n var shapeFactory = _shape.default.getFactory(this.get('type'));\n this.set('shapeFactory', shapeFactory);\n };\n /**\n * 获取属性\n * @internal 仅内部类使用\n * @param {String} key 属性名\n * @return {object | string | number} 属性值\n */\n ItemBase.prototype.get = function (key) {\n return this._cfg[key];\n };\n /**\n * 设置属性\n * @internal 仅内部类使用\n * @param {String|Object} key 属性名,也可以是对象\n * @param {object | string | number} val 属性值\n */\n ItemBase.prototype.set = function (key, val) {\n if ((0, _util.isPlainObject)(key)) {\n this._cfg = (0, _tslib.__assign)((0, _tslib.__assign)({}, this._cfg), key);\n } else {\n this._cfg[key] = val;\n }\n };\n ItemBase.prototype.getDefaultCfg = function () {\n return {};\n };\n /**\n * 更新/刷新等操作后,清除 cache\n */\n ItemBase.prototype.clearCache = function () {\n this.set(CACHE_BBOX, null);\n this.set(CACHE_CANVAS_BBOX, null);\n };\n /**\n * 渲染前的逻辑,提供给子类复写\n */\n ItemBase.prototype.beforeDraw = function () {};\n /**\n * 渲染后的逻辑,提供给子类复写\n */\n ItemBase.prototype.afterDraw = function () {};\n /**\n * 更新后做一些工作\n */\n ItemBase.prototype.afterUpdate = function () {};\n /**\n * draw shape\n */\n ItemBase.prototype.draw = function () {\n this.beforeDraw();\n this.drawInner();\n this.afterDraw();\n };\n ItemBase.prototype.getShapeStyleByName = function (name) {\n var group = this.get('group');\n var currentShape;\n if (name) {\n currentShape = group['shapeMap'][name] || group.find(function (element) {\n return element.get('name') === name;\n });\n } else {\n currentShape = this.getKeyShape();\n }\n if (currentShape) {\n var styles_2 = {};\n (0, _util.each)(currentShape.attr(), function (val, key) {\n // 修改 img 通过 updateItem 实现\n if (key !== 'img' || (0, _util.isString)(val)) {\n styles_2[key] = val;\n }\n });\n return styles_2;\n }\n return {};\n };\n ItemBase.prototype.getShapeCfg = function (model, updateType) {\n var styles = this.get('styles');\n if (styles) {\n // merge graph的item样式与数据模型中的样式\n var newModel = model;\n newModel.style = (0, _tslib.__assign)((0, _tslib.__assign)({}, styles), model.style);\n return newModel;\n }\n return model;\n };\n /**\n * 获取指定状态的样式,去除了全局样式\n * @param state 状态名称\n */\n ItemBase.prototype.getStateStyle = function (state) {\n var styles = this.get('styles');\n var stateStyle = styles && styles[state];\n return stateStyle;\n };\n /**\n * get keyshape style\n */\n ItemBase.prototype.getOriginStyle = function () {\n return this.get('originStyle');\n };\n ItemBase.prototype.getCurrentStatesStyle = function () {\n var self = this;\n var styles = {};\n var states = self.getStates();\n if (!states || !states.length) {\n return this.get('originStyle');\n }\n (0, _util.each)(self.getStates(), function (state) {\n styles = Object.assign(styles, self.getStateStyle(state));\n });\n return styles;\n };\n /**\n * 更改元素状态, visible 不属于这个范畴\n * @internal 仅提供内部类 graph 使用\n * @param {String} state 状态名\n * @param {Boolean} value 节点状态值\n */\n ItemBase.prototype.setState = function (state, value) {\n var states = this.get('states');\n var shapeFactory = this.get('shapeFactory');\n var stateName = state;\n var filterStateName = state;\n if ((0, _util.isString)(value)) {\n stateName = \"\".concat(state, \":\").concat(value);\n filterStateName = \"\".concat(state, \":\");\n }\n var newStates = states;\n if ((0, _util.isBoolean)(value)) {\n var index = states.indexOf(filterStateName);\n if (value) {\n if (index > -1) {\n return;\n }\n states.push(stateName);\n } else if (index > -1) {\n states.splice(index, 1);\n }\n } else if ((0, _util.isString)(value)) {\n // 过滤掉 states 中 filterStateName 相关的状态\n var filterStates = states.filter(function (name) {\n return name.includes(filterStateName);\n });\n if (filterStates.length > 0) {\n this.clearStates(filterStates);\n }\n newStates = newStates.filter(function (name) {\n return !name.includes(filterStateName);\n });\n newStates.push(stateName);\n this.set('states', newStates);\n }\n if (shapeFactory) {\n var model = this.get('model');\n var type = model.type;\n // 调用 shape/shape.ts 中的 setState\n shapeFactory.setState(type, state, value, this);\n }\n };\n /**\n * 清除指定的状态,如果参数为空,则不做任务处理\n * @param states 状态名称\n */\n ItemBase.prototype.clearStates = function (states) {\n var self = this;\n var originStates = self.getStates();\n var shapeFactory = self.get('shapeFactory');\n var model = self.get('model');\n var shape = model.type;\n if (!states) {\n states = originStates;\n }\n if ((0, _util.isString)(states)) {\n states = [states];\n }\n var newStates = originStates.filter(function (state) {\n return states.indexOf(state) === -1;\n });\n self.set('states', newStates);\n states.forEach(function (state) {\n shapeFactory.setState(shape, state, false, self);\n });\n };\n /**\n * 设置是否开启性能优化模式\n * 目前影响:节点的状态样式更新是否影响相关边的更新\n * @param {Boolean} enableOptimize 是否开启\n */\n ItemBase.prototype.setOptimize = function (enableOptimize) {\n this.optimize = enableOptimize;\n };\n /**\n * 节点的图形容器\n * @return {G.Group} 图形容器\n */\n ItemBase.prototype.getContainer = function () {\n return this.get('group');\n };\n /**\n * 节点的关键形状,用于计算节点大小,连线截距等\n * @return {IShapeBase} 关键形状\n */\n ItemBase.prototype.getKeyShape = function () {\n return this.get('keyShape');\n };\n /**\n * 节点数据模型\n * @return {Object} 数据模型\n */\n ItemBase.prototype.getModel = function () {\n return this.get('model');\n };\n /**\n * 节点类型\n * @return {string} 节点的类型\n */\n ItemBase.prototype.getType = function () {\n return this.get('type');\n };\n /**\n * 获取 Item 的ID\n */\n ItemBase.prototype.getID = function () {\n return this.get('id');\n };\n /**\n * 是否是 Item 对象,悬空边情况下进行判定\n */\n ItemBase.prototype.isItem = function () {\n return true;\n };\n /**\n * 获取当前元素的所有状态\n * @return {Array} 元素的所有状态\n */\n ItemBase.prototype.getStates = function () {\n return this.get('states');\n };\n /**\n * 当前元素是否处于某状态\n * @param {String} state 状态名\n * @return {Boolean} 是否处于某状态\n */\n ItemBase.prototype.hasState = function (state) {\n var states = this.getStates();\n return states.indexOf(state) >= 0;\n };\n /**\n * 刷新一般用于处理几种情况\n * 1. item model 在外部被改变\n * 2. 边的节点位置发生改变,需要重新计算边\n *\n * 因为数据从外部被修改无法判断一些属性是否被修改,直接走位置和 shape 的更新\n */\n ItemBase.prototype.refresh = function (updateType) {\n var model = this.get('model');\n // 更新元素位置\n this.updatePosition(model);\n // 更新元素内容,样式\n this.updateShape(updateType);\n // 做一些更新之后的操作\n this.afterUpdate();\n // 清除缓存\n this.clearCache();\n };\n ItemBase.prototype.getUpdateType = function (cfg) {\n return undefined;\n };\n /**\n * 将更新应用到 model 上,刷新属性\n * @internal 仅提供给 Graph 使用,外部直接调用 graph.update 接口\n * @param {Object} cfg 配置项,可以是增量信息\n */\n ItemBase.prototype.update = function (cfg, updateType) {\n if (updateType === void 0) {\n updateType = undefined;\n }\n var model = this.get('model');\n // 仅仅移动位置时,既不更新,也不重绘\n if (updateType === 'move') {\n this.updatePosition(cfg);\n } else {\n var oriVisible = model.visible;\n var cfgVisible = cfg.visible;\n if (oriVisible !== cfgVisible && cfgVisible !== undefined) this.changeVisibility(cfgVisible);\n var originPosition = {\n x: model.x,\n y: model.y\n };\n cfg.x = isNaN(+cfg.x) ? model.x : +cfg.x;\n cfg.y = isNaN(+cfg.y) ? model.y : +cfg.y;\n var styles = this.get('styles');\n if (cfg.stateStyles) {\n // 更新 item 时更新 this.get('styles') 中的值\n var stateStyles = cfg.stateStyles;\n (0, _util.mix)(styles, stateStyles);\n delete cfg.stateStyles;\n }\n // 直接将更新合到原数据模型上,可以保证用户在外部修改源数据然后刷新时的样式符合期待。\n Object.assign(model, cfg);\n // 如果 x,y 有变化,先重置位置\n if (originPosition.x !== cfg.x || originPosition.y !== cfg.y) {\n this.updatePosition(cfg);\n }\n this.updateShape(updateType);\n }\n this.afterUpdate();\n this.clearCache();\n };\n /**\n * 更新元素内容,样式\n */\n ItemBase.prototype.updateShape = function (updateType) {\n var shapeFactory = this.get('shapeFactory');\n var model = this.get('model');\n var shape = model.type;\n // 判定是否允许更新\n // 1. 注册的节点允许更新(即有继承的/复写的 update 方法,即 update 方法没有被复写为 undefined)\n // 2. 更新后的 shape 等于原先的 shape\n if (shapeFactory.shouldUpdate(shape) && shape === this.get('currentShape')) {\n var updateCfg = this.getShapeCfg(model, updateType);\n shapeFactory.baseUpdate(shape, updateCfg, this, updateType);\n // 更新完以后重新设置原始样式\n if (updateType !== 'move') this.setOriginStyle();\n } else {\n // 如果不满足上面两种状态,重新绘制\n this.draw();\n }\n // 更新后重置节点状态\n this.restoreStates(shapeFactory, shape);\n };\n /**\n * 更新位置,避免整体重绘\n * @param {object} cfg 待更新数据\n */\n ItemBase.prototype.updatePosition = function (cfg) {\n var model = this.get('model');\n var x = isNaN(+cfg.x) ? +model.x : +cfg.x;\n var y = isNaN(+cfg.y) ? +model.y : +cfg.y;\n var group = this.get('group');\n if (isNaN(x) || isNaN(y)) {\n return false;\n }\n model.x = x;\n model.y = y;\n var matrix = group.getMatrix();\n if (matrix && matrix[6] === x && matrix[7] === y) return false;\n group.resetMatrix();\n // G 4.0 element 中移除了矩阵相关方法,详见https://www.yuque.com/antv/blog/kxzk9g#4rMMV\n (0, _math.translate)(group, {\n x: x,\n y: y\n });\n this.clearCache(); // 位置更新后需要清除缓存\n return true;\n };\n /**\n * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n ItemBase.prototype.getBBox = function () {\n // 计算 bbox 开销有些大,缓存\n var bbox = this.get(CACHE_BBOX);\n if (!bbox) {\n bbox = this.calculateBBox();\n this.set(CACHE_BBOX, bbox);\n }\n return bbox;\n };\n /**\n * 获取 item 相对于画布的包围盒,会将从顶层到当前元素的 matrix 都计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n ItemBase.prototype.getCanvasBBox = function () {\n // 计算 bbox 开销大,缓存\n var bbox = this.get(CACHE_CANVAS_BBOX);\n if (!bbox) {\n bbox = this.calculateCanvasBBox();\n this.set(CACHE_CANVAS_BBOX, bbox);\n }\n return bbox;\n };\n /**\n * 将元素放到最前面\n */\n ItemBase.prototype.toFront = function () {\n var group = this.get('group');\n group.toFront();\n };\n /**\n * 将元素放到最后面\n */\n ItemBase.prototype.toBack = function () {\n var group = this.get('group');\n group.toBack();\n };\n /**\n * 显示元素\n */\n ItemBase.prototype.show = function () {\n this.changeVisibility(true);\n };\n /**\n * 隐藏元素\n */\n ItemBase.prototype.hide = function () {\n this.changeVisibility(false);\n };\n /**\n * 更改是否显示\n * @param {Boolean} visible 是否显示\n */\n ItemBase.prototype.changeVisibility = function (visible) {\n var group = this.get('group');\n if (visible) {\n group.show();\n } else {\n group.hide();\n }\n this.set('visible', visible);\n };\n /**\n * 元素是否可见\n * @return {Boolean} 返回该元素是否可见\n */\n ItemBase.prototype.isVisible = function () {\n return this.get('visible');\n };\n /**\n * 是否拾取及出发该元素的交互事件\n * @param {Boolean} enable 标识位\n */\n ItemBase.prototype.enableCapture = function (enable) {\n var group = this.get('group');\n if (group) {\n group.set('capture', enable);\n }\n };\n ItemBase.prototype.destroy = function () {\n if (!this.destroyed) {\n var animate = this.get('animate');\n var group = this.get('group');\n if (animate) {\n group.stopAnimate();\n }\n group['shapeMap'] = {};\n this.clearCache();\n group.remove();\n this._cfg = null;\n this.destroyed = true;\n }\n };\n return ItemBase;\n}();\nvar _default = exports.default = ItemBase;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/item/item.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUComputeModel.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUComputeModel.js ***! - \****************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/util/base.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/util/base.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WebGPUComputeModel; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _utils_is_number__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../utils/is-number */ \"./node_modules/@antv/g-webgpu-engine/es/utils/is-number.js\");\n/* harmony import */ var _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./WebGPUBuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUBuffer.js\");\n\n\n\n\n\n\n\n\n\n\nvar WebGPUComputeModel = /*#__PURE__*/function () {\n /**\n * 用于后续渲染时动态更新\n */\n function WebGPUComputeModel(engine, context) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, WebGPUComputeModel);\n\n this.engine = engine;\n this.context = context;\n this.entity = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"createEntity\"])();\n this.uniformGPUBufferLayout = [];\n this.uniformBuffer = void 0;\n this.vertexBuffers = {};\n this.outputBuffer = void 0;\n this.bindGroupEntries = void 0;\n this.bindGroup = void 0;\n this.computePipeline = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(WebGPUComputeModel, [{\n key: \"init\",\n value: function () {\n var _init = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var _this = this;\n\n var _yield$this$compileCo, computeStage, buffers, uniforms, bufferBindingIndex, offset, mergedUniformData;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _context.next = 2;\n return this.compileComputePipelineStageDescriptor(this.context.shader);\n\n case 2:\n _yield$this$compileCo = _context.sent;\n computeStage = _yield$this$compileCo.computeStage;\n buffers = this.context.uniforms.filter(function (uniform) {\n return uniform.storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"STORAGE_CLASS\"].StorageBuffer;\n });\n uniforms = this.context.uniforms.filter(function (uniform) {\n return uniform.storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"STORAGE_CLASS\"].Uniform;\n });\n bufferBindingIndex = uniforms.length ? 1 : 0;\n this.bindGroupEntries = [];\n\n if (bufferBindingIndex) {\n offset = 0; // FIXME: 所有 uniform 合并成一个 buffer,固定使用 Float32Array 存储,确实会造成一些内存的浪费\n // we use std140 layout @see https://www.khronos.org/opengl/wiki/Interface_Block_(GLSL)\n\n mergedUniformData = [];\n uniforms.forEach(function (uniform) {\n if (Object(_utils_is_number__WEBPACK_IMPORTED_MODULE_7__[\"isNumber\"])(uniform.data)) {\n _this.uniformGPUBufferLayout.push({\n name: uniform.name,\n offset: offset\n });\n\n offset += 4; // @ts-ignore\n\n mergedUniformData.push(uniform.data);\n } else {\n var _uniform$data;\n\n // @ts-ignore\n var originDataLength = ((_uniform$data = uniform.data) === null || _uniform$data === void 0 ? void 0 : _uniform$data.length) || 1;\n\n if (originDataLength === 3) {\n // vec3 -> vec4\n // @see http://ptgmedia.pearsoncmg.com/images/9780321552624/downloads/0321552628_AppL.pdf\n originDataLength = 4; // @ts-ignore\n\n uniform.data.push(0);\n } // 4 elements per block/line\n\n\n var padding = offset / 4 % 4;\n\n if (padding > 0) {\n var space = 4 - padding;\n\n if (originDataLength > 1 && originDataLength <= space) {\n if (originDataLength === 2) {\n if (space === 3) {\n offset += 4;\n mergedUniformData.push(0);\n } // @ts-ignore\n\n\n mergedUniformData.push.apply(mergedUniformData, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default()(uniform.data));\n\n _this.uniformGPUBufferLayout.push({\n name: uniform.name,\n offset: offset\n });\n }\n } else {\n for (var i = 0; i < space; i++) {\n offset += 4;\n mergedUniformData.push(0);\n } // @ts-ignore\n\n\n mergedUniformData.push.apply(mergedUniformData, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default()(uniform.data));\n\n _this.uniformGPUBufferLayout.push({\n name: uniform.name,\n offset: offset\n });\n }\n }\n\n offset += 4 * originDataLength;\n }\n });\n this.uniformBuffer = new _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_8__[\"default\"](this.engine, {\n // TODO: 处理 Struct 和 boolean\n // @ts-ignore\n data: mergedUniformData instanceof Array ? // @ts-ignore\n new Float32Array(mergedUniformData) : mergedUniformData,\n usage: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"BufferUsage\"].Uniform | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"BufferUsage\"].CopyDst\n });\n this.bindGroupEntries.push({\n binding: 0,\n resource: {\n buffer: this.uniformBuffer.get()\n }\n });\n } // create GPUBuffers for storeage buffers\n\n\n buffers.forEach(function (buffer) {\n if (buffer.data !== null) {\n if (buffer.type === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"AST_TOKEN_TYPES\"].Vector4FloatArray || buffer.type === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"AST_TOKEN_TYPES\"].FloatArray) {\n var gpuBuffer;\n\n if (buffer.name === _this.context.output.name) {\n gpuBuffer = new _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_8__[\"default\"](_this.engine, {\n // @ts-ignore\n data: isFinite(Number(buffer.data)) ? [buffer.data] : buffer.data,\n usage: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"BufferUsage\"].Storage | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"BufferUsage\"].CopyDst | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"BufferUsage\"].CopySrc\n });\n _this.outputBuffer = gpuBuffer;\n _this.context.output = {\n name: buffer.name,\n // @ts-ignore\n length: isFinite(Number(buffer.data)) ? 1 : buffer.data.length,\n typedArrayConstructor: Float32Array,\n gpuBuffer: gpuBuffer.get()\n };\n } else {\n if (buffer.isReferer) {\n // @ts-ignore\n if (buffer.data.model && buffer.data.model.outputBuffer) {\n // @ts-ignore\n gpuBuffer = buffer.data.model.outputBuffer;\n } else {// referred kernel haven't been executed\n }\n } else {\n gpuBuffer = new _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_8__[\"default\"](_this.engine, {\n // @ts-ignore\n data: isFinite(Number(buffer.data)) ? [buffer.data] : buffer.data,\n usage: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"BufferUsage\"].Storage | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"BufferUsage\"].CopyDst | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"BufferUsage\"].CopySrc\n });\n }\n } // @ts-ignore\n\n\n _this.vertexBuffers[buffer.name] = gpuBuffer;\n\n _this.bindGroupEntries.push({\n binding: bufferBindingIndex,\n resource: {\n name: buffer.name,\n refer: gpuBuffer ? undefined : buffer.data,\n // @ts-ignore\n buffer: gpuBuffer ? gpuBuffer.get() : undefined\n }\n });\n\n bufferBindingIndex++;\n }\n }\n }); // create compute pipeline layout\n\n this.computePipeline = this.engine.device.createComputePipeline({\n computeStage: computeStage\n });\n console.log(this.bindGroupEntries);\n this.bindGroup = this.engine.device.createBindGroup({\n layout: this.computePipeline.getBindGroupLayout(0),\n entries: this.bindGroupEntries\n });\n\n case 13:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function init() {\n return _init.apply(this, arguments);\n }\n\n return init;\n }()\n }, {\n key: \"destroy\",\n value: function destroy() {\n var _this2 = this;\n\n if (this.uniformBuffer) {\n this.uniformBuffer.destroy();\n }\n\n Object.keys(this.vertexBuffers).forEach(function (bufferName) {\n return _this2.vertexBuffers[bufferName].destroy();\n });\n }\n }, {\n key: \"readData\",\n value: function () {\n var _readData = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2() {\n var output, length, typedArrayConstructor, gpuBuffer, byteCount, gpuReadBuffer, encoder, queue, arraybuffer, typedArray;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n output = this.context.output;\n\n if (!output) {\n _context2.next = 16;\n break;\n }\n\n length = output.length, typedArrayConstructor = output.typedArrayConstructor, gpuBuffer = output.gpuBuffer;\n\n if (!gpuBuffer) {\n _context2.next = 16;\n break;\n }\n\n // await gpuBuffer.mapAsync(WebGPUConstants.MapMode.Read);\n // const arraybuffer = gpuBuffer.getMappedRange();\n // let arraybuffer;\n // if (isSafari) {\n // arraybuffer = await gpuBuffer.mapReadAsync();\n // } else {\n byteCount = length * typedArrayConstructor.BYTES_PER_ELEMENT; // @see https://developers.google.com/web/updates/2019/08/get-started-with-gpu-compute-on-the-web\n\n gpuReadBuffer = this.engine.device.createBuffer({\n size: byteCount,\n usage: GPUBufferUsage.COPY_DST | GPUBufferUsage.MAP_READ\n });\n encoder = this.engine.device.createCommandEncoder();\n encoder.copyBufferToBuffer(gpuBuffer, 0, gpuReadBuffer, 0, byteCount);\n queue = _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"isSafari\"] ? // @ts-ignore\n this.engine.device.getQueue() : this.engine.device.defaultQueue;\n queue.submit([encoder.finish()]);\n _context2.next = 12;\n return gpuReadBuffer.mapAsync(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_6__[\"MapMode\"].Read);\n\n case 12:\n arraybuffer = gpuReadBuffer.getMappedRange();\n typedArray = new typedArrayConstructor(arraybuffer.slice(0));\n gpuReadBuffer.unmap();\n return _context2.abrupt(\"return\", typedArray);\n\n case 16:\n return _context2.abrupt(\"return\", new Float32Array());\n\n case 17:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function readData() {\n return _readData.apply(this, arguments);\n }\n\n return readData;\n }()\n }, {\n key: \"run\",\n value: function run() {\n if (this.engine.currentComputePass) {\n var _this$engine$currentC;\n\n this.engine.currentComputePass.setPipeline(this.computePipeline); // this.bindGroupEntries.forEach((entry) => {\n // if (!entry.resource.buffer) {\n // // get referred kernel's output\n // const gpuBuffer = (entry.resource.refer.model as WebGPUComputeModel)\n // .outputBuffer;\n // this.vertexBuffers[entry.resource.name] = gpuBuffer;\n // entry.resource.buffer = gpuBuffer.get();\n // }\n // });\n // const bindGroup = this.engine.device.createBindGroup({\n // layout: this.computePipeline.getBindGroupLayout(0),\n // entries: this.bindGroupEntries,\n // });\n\n this.engine.currentComputePass.setBindGroup(0, this.bindGroup);\n\n (_this$engine$currentC = this.engine.currentComputePass).dispatch.apply(_this$engine$currentC, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_1___default()(this.context.dispatch));\n }\n }\n }, {\n key: \"updateBuffer\",\n value: function updateBuffer(bufferName, data) {\n var offset = arguments.length > 2 && arguments[2] !== undefined ? arguments[2] : 0;\n var buffer = this.vertexBuffers[bufferName];\n\n if (buffer) {\n buffer.subData({\n data: data,\n offset: offset\n });\n }\n }\n }, {\n key: \"updateUniform\",\n value: function updateUniform(uniformName, data) {\n var layout = this.uniformGPUBufferLayout.find(function (l) {\n return l.name === uniformName;\n });\n\n if (layout) {\n this.uniformBuffer.subData({\n data: Number.isFinite(data) ? new Float32Array([data]) : new Float32Array(data),\n offset: layout.offset\n });\n }\n }\n }, {\n key: \"confirmInput\",\n value: function confirmInput(model, inputName) {\n // copy output GPUBuffer of kernel\n var inputBuffer = this.vertexBuffers[inputName];\n var outputBuffer = model.outputBuffer;\n\n if (inputBuffer && outputBuffer && inputBuffer !== outputBuffer) {\n var encoder = this.engine.device.createCommandEncoder();\n var _context$output = model.context.output,\n length = _context$output.length,\n typedArrayConstructor = _context$output.typedArrayConstructor;\n var byteCount = length * typedArrayConstructor.BYTES_PER_ELEMENT;\n encoder.copyBufferToBuffer(outputBuffer.get(), 0, inputBuffer.get(), 0, byteCount);\n var queue = _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"isSafari\"] ? // @ts-ignore\n this.engine.device.getQueue() : this.engine.device.defaultQueue;\n queue.submit([encoder.finish()]);\n }\n }\n }, {\n key: \"compileShaderToSpirV\",\n value: function compileShaderToSpirV(source, type, shaderVersion) {\n return this.compileRawShaderToSpirV(shaderVersion + source, type);\n }\n }, {\n key: \"compileRawShaderToSpirV\",\n value: function compileRawShaderToSpirV(source, type) {\n return this.engine.glslang.compileGLSL(source, type);\n }\n }, {\n key: \"compileComputePipelineStageDescriptor\",\n value: function () {\n var _compileComputePipelineStageDescriptor = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(computeCode) {\n var computeShader, shaderVersion;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n computeShader = computeCode;\n shaderVersion = '#version 450\\n';\n\n if (this.engine.options.useWGSL) {\n _context3.next = 6;\n break;\n }\n\n _context3.next = 5;\n return this.compileShaderToSpirV(computeCode, 'compute', shaderVersion);\n\n case 5:\n computeShader = _context3.sent;\n\n case 6:\n return _context3.abrupt(\"return\", {\n computeStage: {\n module: this.engine.device.createShaderModule({\n code: computeShader,\n // @ts-ignore\n isWHLSL: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"isSafari\"]\n }),\n entryPoint: 'main'\n }\n });\n\n case 7:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function compileComputePipelineStageDescriptor(_x) {\n return _compileComputePipelineStageDescriptor.apply(this, arguments);\n }\n\n return compileComputePipelineStageDescriptor;\n }()\n }]);\n\n return WebGPUComputeModel;\n}();\n\n\n//# sourceMappingURL=WebGPUComputeModel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUComputeModel.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.uniqueId = exports.processParallelEdges = exports.isViewportChanged = exports.isNaN = exports.formatPadding = exports.cloneEvent = exports.calculationItemsBBox = void 0;\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _behavior = __webpack_require__(/*! ../interface/behavior */ \"./node_modules/@antv/g6-core/lib/interface/behavior.js\");\nvar uniqueId = exports.uniqueId = function uniqueId(type) {\n return \"\".concat(type, \"-\").concat(Math.random()).concat(Date.now());\n};\n/**\n * turn padding into [top, right, bottom, right]\n * @param {Number|Array} padding input padding\n * @return {array} output\n */\nvar formatPadding = exports.formatPadding = function formatPadding(padding) {\n if ((0, _util.isArray)(padding)) {\n switch (padding.length) {\n case 4:\n return padding;\n case 3:\n padding.push(padding[1]);\n return padding;\n case 2:\n return padding.concat(padding);\n case 1:\n return [padding[0], padding[0], padding[0], padding[0]];\n default:\n return [0, 0, 0, 0];\n }\n }\n if ((0, _util.isNumber)(padding)) {\n return [padding, padding, padding, padding];\n } else if ((0, _util.isString)(padding)) {\n var intPadding = parseInt(padding, 10);\n return [intPadding, intPadding, intPadding, intPadding];\n }\n return [0, 0, 0, 0];\n};\n/**\n * clone event\n * @param e\n */\nvar cloneEvent = exports.cloneEvent = function cloneEvent(e) {\n var event = new _behavior.G6GraphEvent(e.type, e);\n event.clientX = e.clientX;\n event.clientY = e.clientY;\n event.x = e.x;\n event.y = e.y;\n event.target = e.target;\n event.currentTarget = e.currentTarget;\n event.bubbles = true;\n event.item = e.item;\n return event;\n};\n/**\n * 判断 viewport 是否改变,通过和单位矩阵对比\n * @param matrix Viewport 的 Matrix\n */\nvar isViewportChanged = exports.isViewportChanged = function isViewportChanged(matrix) {\n // matrix 为 null, 则说明没有变化\n if (!matrix) {\n return false;\n }\n var MATRIX_LEN = 9;\n var ORIGIN_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0; i < MATRIX_LEN; i++) {\n if (matrix[i] !== ORIGIN_MATRIX[i]) {\n return true;\n }\n }\n return false;\n};\nvar isNaN = exports.isNaN = function isNaN(input) {\n return Number.isNaN(Number(input));\n};\n/**\n * 计算一组 Item 的 BBox\n * @param items 选中的一组Item,可以是 node 或 combo\n */\nvar calculationItemsBBox = exports.calculationItemsBBox = function calculationItemsBBox(items) {\n var minx = Infinity;\n var maxx = -Infinity;\n var miny = Infinity;\n var maxy = -Infinity;\n // 获取已节点的所有最大最小x y值\n for (var i = 0; i < items.length; i++) {\n var element = items[i];\n var bbox = element.getBBox();\n var minX = bbox.minX,\n minY = bbox.minY,\n maxX = bbox.maxX,\n maxY = bbox.maxY;\n if (minX < minx) {\n minx = minX;\n }\n if (minY < miny) {\n miny = minY;\n }\n if (maxX > maxx) {\n maxx = maxX;\n }\n if (maxY > maxy) {\n maxy = maxY;\n }\n }\n var x = Math.floor(minx);\n var y = Math.floor(miny);\n var width = Math.ceil(maxx) - Math.floor(minx);\n var height = Math.ceil(maxy) - Math.floor(miny);\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n minX: minx,\n minY: miny,\n maxX: maxx,\n maxY: maxy\n };\n};\n/**\n * 若 edges 中存在两端点相同的边,使用 quadratic 边并自动计算 curveOffset 使它们不相互重叠\n * 文档: https://g6.antv.antgroup.com/en/api/Util\n * @param edges 边数据集合\n * @param offsetDiff 相邻两边的 offset 之差\n * @param multiEdgeType\n * @param singleEdgeType\n * @param loopEdgeType\n */\nvar processParallelEdges = exports.processParallelEdges = function processParallelEdges(edges, offsetDiff, multiEdgeType, singleEdgeType, loopEdgeType) {\n if (offsetDiff === void 0) {\n offsetDiff = 15;\n }\n if (multiEdgeType === void 0) {\n multiEdgeType = 'quadratic';\n }\n if (singleEdgeType === void 0) {\n singleEdgeType = undefined;\n }\n if (loopEdgeType === void 0) {\n loopEdgeType = undefined;\n }\n var len = edges.length;\n var cod = offsetDiff * 2;\n var loopPosition = ['top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left'];\n var edgeMap = {};\n var tags = [];\n var reverses = {};\n for (var i = 0; i < len; i++) {\n var edge = edges[i];\n var source = edge.source,\n target = edge.target;\n var sourceTarget = \"\".concat(source, \"-\").concat(target);\n if (tags[i]) continue;\n if (!edgeMap[sourceTarget]) {\n edgeMap[sourceTarget] = [];\n }\n tags[i] = true;\n edgeMap[sourceTarget].push(edge);\n for (var j = 0; j < len; j++) {\n if (i === j) continue;\n var sedge = edges[j];\n var src = sedge.source;\n var dst = sedge.target;\n // 两个节点之间共同的边\n // 第一条的source = 第二条的target\n // 第一条的target = 第二条的source\n if (!tags[j]) {\n if (source === dst && target === src) {\n edgeMap[sourceTarget].push(sedge);\n tags[j] = true;\n reverses[\"\".concat(src, \"|\").concat(dst, \"|\").concat(edgeMap[sourceTarget].length - 1)] = true;\n } else if (source === src && target === dst) {\n edgeMap[sourceTarget].push(sedge);\n tags[j] = true;\n }\n }\n }\n }\n for (var key in edgeMap) {\n var arcEdges = edgeMap[key];\n var length_1 = arcEdges.length;\n for (var k = 0; k < length_1; k++) {\n var current = arcEdges[k];\n if (current.source === current.target) {\n if (loopEdgeType) current.type = loopEdgeType;\n // 超过8条自环边,则需要重新处理\n current.loopCfg = {\n position: loopPosition[k % 8],\n dist: Math.floor(k / 8) * 20 + 50\n };\n continue;\n }\n if (length_1 === 1 && singleEdgeType && current.source !== current.target) {\n current.type = singleEdgeType;\n continue;\n }\n current.type = multiEdgeType;\n var sign = (k % 2 === 0 ? 1 : -1) * (reverses[\"\".concat(current.source, \"|\").concat(current.target, \"|\").concat(k)] ? -1 : 1);\n if (length_1 % 2 === 1) {\n current.curveOffset = sign * Math.ceil(k / 2) * cod;\n } else {\n current.curveOffset = sign * (Math.floor(k / 2) * cod + offsetDiff);\n }\n }\n }\n return edges;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/util/base.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUElements.js": -/*!************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUElements.js ***! - \************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/util/graphic.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/util/graphic.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WebGPUElements; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./WebGPUBuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUBuffer.js\");\n\n\n\n\n\nvar WebGPUElements = /*#__PURE__*/function () {\n function WebGPUElements(engine, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, WebGPUElements);\n\n this.engine = engine;\n this.options = options;\n this.indexCount = void 0;\n this.buffer = void 0;\n var _options = options,\n data = _options.data,\n usage = _options.usage,\n type = _options.type,\n count = _options.count;\n this.indexCount = count || 0;\n this.buffer = new _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_3__[\"default\"](engine, {\n // @ts-ignore\n data: data instanceof Array ? new Uint16Array(data) : data,\n usage: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BufferUsage\"].Index | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BufferUsage\"].CopyDst\n });\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(WebGPUElements, [{\n key: \"get\",\n value: function get() {\n return this.buffer;\n }\n }, {\n key: \"subData\",\n value: function subData(options) {\n this.buffer.subData(options);\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n this.buffer.destroy();\n }\n }]);\n\n return WebGPUElements;\n}();\n\n\n//# sourceMappingURL=WebGPUElements.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUElements.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.truncateLabelByLength = exports.traverseTreeUp = exports.traverseTree = exports.shouldRefreshEdge = exports.reconstructTree = exports.plainCombosToTrees = exports.getTextSize = exports.getLoopCfgs = exports.getLetterWidth = exports.getLabelPosition = exports.getComboBBox = exports.getBBox = exports.getAnimateCfgWithCallback = exports.cloneBesidesImg = void 0;\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\nvar _matrixUtil = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar _global = _interopRequireDefault(__webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/lib/global.js\"));\nvar _letterAspectRatio = _interopRequireDefault(__webpack_require__(/*! ./letterAspectRatio */ \"./node_modules/@antv/g6-core/lib/util/letterAspectRatio.js\"));\nvar _math = __webpack_require__(/*! ./math */ \"./node_modules/@antv/g6-core/lib/util/math.js\");\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\nvar PI = Math.PI,\n sin = Math.sin,\n cos = Math.cos;\n// 一共支持8个方向的自环,每个环占的角度是45度,在计算时再二分,为22.5度\nvar SELF_LINK_SIN = sin(PI / 8);\nvar SELF_LINK_COS = cos(PI / 8);\nvar getBBox = exports.getBBox = function getBBox(element, group) {\n var bbox = element.getBBox();\n var leftTop = {\n x: bbox.minX,\n y: bbox.minY\n };\n var rightBottom = {\n x: bbox.maxX,\n y: bbox.maxY\n };\n // 根据父元素变换矩阵\n if (group) {\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n leftTop = (0, _math.applyMatrix)(leftTop, matrix);\n rightBottom = (0, _math.applyMatrix)(rightBottom, matrix);\n }\n var lx = leftTop.x,\n ly = leftTop.y;\n var rx = rightBottom.x,\n ry = rightBottom.y;\n return {\n x: lx,\n y: ly,\n minX: lx,\n minY: ly,\n maxX: rx,\n maxY: ry,\n width: rx - lx,\n height: ry - ly\n };\n};\n/**\n * get loop edge config\n * @param cfg edge config\n */\nvar getLoopCfgs = exports.getLoopCfgs = function getLoopCfgs(cfg) {\n var item = cfg.sourceNode || cfg.targetNode;\n var container = item.get('group');\n var containerMatrix = container.getMatrix();\n if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var keyShape = item.getKeyShape();\n var bbox = keyShape.getBBox();\n var loopCfg = cfg.loopCfg || {};\n // 距离keyShape边的最高距离\n var dist = loopCfg.dist || Math.max(bbox.width, bbox.height) * 2;\n // 自环边与keyShape的相对位置关系\n var position = loopCfg.position || _global.default.defaultLoopPosition;\n // 中心取节点 keyShape bbox 的中心位置 + 节点位置坐标\n var center = [(bbox.minX + bbox.maxX) / 2 + containerMatrix[6], (bbox.minY + bbox.maxY) / 2 + containerMatrix[7]];\n var startPoint = [cfg.startPoint.x, cfg.startPoint.y];\n var endPoint = [cfg.endPoint.x, cfg.endPoint.y];\n var halfOfHeight = bbox.height / 2;\n var halfOfWidth = bbox.width / 2;\n var rstart = halfOfHeight;\n var rend = halfOfHeight;\n var sinDeltaStart = rstart * SELF_LINK_SIN;\n var cosDeltaStart = rstart * SELF_LINK_COS;\n var sinDeltaEnd = rend * SELF_LINK_SIN;\n var cosDeltaEnd = rend * SELF_LINK_COS;\n var shapeType = keyShape.get('type');\n // 美观考虑,pointPadding 默认取宽高中最小的1/4\n var defaultPointPadding = Math.min(halfOfHeight / 2, halfOfWidth / 2);\n var maxPointPadding = Math.min(halfOfHeight, halfOfWidth);\n // 对于非圆形节点设置的连接点与节点中心坐标(`top-right`,`bottom-right`,`top-left`,`bottom-left`较特殊,为四个角坐标)在 x 轴或 y 轴方向的偏移量,默认为  `节点宽高中最小值的1/4`\n var pointPadding = (loopCfg === null || loopCfg === void 0 ? void 0 : loopCfg.pointPadding) ? Math.min(maxPointPadding, loopCfg === null || loopCfg === void 0 ? void 0 : loopCfg.pointPadding) : defaultPointPadding;\n // 如果定义了锚点的,直接用锚点坐标,否则,根据自环的 cfg 计算\n if (startPoint[0] === endPoint[0] && startPoint[1] === endPoint[1]) {\n switch (position) {\n case 'top':\n if (shapeType === 'circle') {\n startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd];\n } else {\n startPoint = [center[0] - pointPadding, center[1] - halfOfHeight];\n endPoint = [center[0] + pointPadding, center[1] - halfOfHeight];\n }\n break;\n case 'top-right':\n rstart = halfOfHeight;\n rend = halfOfWidth;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + cosDeltaEnd, center[1] - sinDeltaEnd];\n } else {\n startPoint = [center[0] + halfOfWidth - pointPadding, center[1] - halfOfHeight];\n endPoint = [center[0] + halfOfWidth, center[1] - halfOfHeight + pointPadding];\n }\n break;\n case 'right':\n rstart = halfOfWidth;\n rend = halfOfWidth;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + cosDeltaStart, center[1] - sinDeltaStart];\n endPoint = [center[0] + cosDeltaEnd, center[1] + sinDeltaEnd];\n } else {\n startPoint = [center[0] + halfOfWidth, center[1] - pointPadding];\n endPoint = [center[0] + halfOfWidth, center[1] + pointPadding];\n }\n break;\n case 'bottom-right':\n rstart = halfOfWidth;\n rend = halfOfHeight;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + cosDeltaStart, center[1] + sinDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] + cosDeltaEnd];\n } else {\n startPoint = [center[0] + halfOfWidth, center[1] + halfOfHeight - pointPadding];\n endPoint = [center[0] + halfOfWidth - pointPadding, center[1] + halfOfHeight];\n }\n break;\n case 'bottom':\n rstart = halfOfHeight;\n rend = halfOfHeight;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + sinDeltaStart, center[1] + cosDeltaStart];\n endPoint = [center[0] - sinDeltaEnd, center[1] + cosDeltaEnd];\n } else {\n startPoint = [center[0] - pointPadding, center[1] + halfOfHeight];\n endPoint = [center[0] + pointPadding, center[1] + halfOfHeight];\n }\n break;\n case 'bottom-left':\n rstart = halfOfHeight;\n rend = halfOfWidth;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - sinDeltaStart, center[1] + cosDeltaStart];\n endPoint = [center[0] - cosDeltaEnd, center[1] + sinDeltaEnd];\n } else {\n startPoint = [center[0] - halfOfWidth, center[1] + halfOfHeight - pointPadding];\n endPoint = [center[0] - halfOfWidth + pointPadding, center[1] + halfOfHeight];\n }\n break;\n case 'left':\n rstart = halfOfWidth;\n rend = halfOfWidth;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - cosDeltaStart, center[1] + sinDeltaStart];\n endPoint = [center[0] - cosDeltaEnd, center[1] - sinDeltaEnd];\n } else {\n startPoint = [center[0] - halfOfWidth, center[1] - pointPadding];\n endPoint = [center[0] - halfOfWidth, center[1] + pointPadding];\n }\n break;\n case 'top-left':\n rstart = halfOfWidth;\n rend = halfOfHeight;\n if (shapeType === 'circle') {\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - cosDeltaStart, center[1] - sinDeltaStart];\n endPoint = [center[0] - sinDeltaEnd, center[1] - cosDeltaEnd];\n } else {\n startPoint = [center[0] - halfOfWidth + pointPadding, center[1] - halfOfHeight];\n endPoint = [center[0] - halfOfWidth, center[1] - halfOfHeight + pointPadding];\n }\n break;\n default:\n rstart = halfOfWidth;\n rend = halfOfWidth;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd];\n }\n // 如果逆时针画,交换起点和终点\n if (loopCfg.clockwise === false) {\n var swap = [startPoint[0], startPoint[1]];\n startPoint = [endPoint[0], endPoint[1]];\n endPoint = [swap[0], swap[1]];\n }\n }\n var startVec = [startPoint[0] - center[0], startPoint[1] - center[1]];\n var scaleRateStart = (rstart + dist) / rstart;\n var scaleRateEnd = (rend + dist) / rend;\n if (loopCfg.clockwise === false) {\n scaleRateStart = (rend + dist) / rend;\n scaleRateEnd = (rstart + dist) / rstart;\n }\n var startExtendVec = _matrixUtil.vec2.scale([0, 0], startVec, scaleRateStart);\n var controlPoint1 = [center[0] + startExtendVec[0], center[1] + startExtendVec[1]];\n var endVec = [endPoint[0] - center[0], endPoint[1] - center[1]];\n var endExtendVec = _matrixUtil.vec2.scale([0, 0], endVec, scaleRateEnd);\n var controlPoint2 = [center[0] + endExtendVec[0], center[1] + endExtendVec[1]];\n cfg.startPoint = {\n x: startPoint[0],\n y: startPoint[1]\n };\n cfg.endPoint = {\n x: endPoint[0],\n y: endPoint[1]\n };\n cfg.controlPoints = [{\n x: controlPoint1[0],\n y: controlPoint1[1]\n }, {\n x: controlPoint2[0],\n y: controlPoint2[1]\n }];\n return cfg;\n};\n/**\n * 根据 label 所在线条的位置百分比,计算 label 坐标\n * @param {object} pathShape G 的 path 实例,一般是 Edge 实例的 keyShape\n * @param {number} percent 范围 0 - 1 的线条百分比\n * @param {number} refX x 轴正方向为基准的 label 偏移\n * @param {number} refY y 轴正方向为基准的 label 偏移\n * @param {boolean} rotate 是否根据线条斜率旋转文本\n * @return {object} 文本的 x, y, 文本的旋转角度\n */\nvar getLabelPosition = exports.getLabelPosition = function getLabelPosition(pathShape, percent, refX, refY, rotate) {\n var TAN_OFFSET = 0.0001;\n var vector = [];\n var point = pathShape === null || pathShape === void 0 ? void 0 : pathShape.getPoint(percent);\n if (!point) {\n return {\n x: 0,\n y: 0,\n angle: 0\n };\n }\n // 头尾最可能,放在最前面,使用 g path 上封装的方法\n if (percent < TAN_OFFSET) {\n vector = pathShape.getStartTangent().reverse();\n } else if (percent > 1 - TAN_OFFSET) {\n vector = pathShape.getEndTangent();\n } else {\n // 否则取指定位置的点,与少量偏移的点,做微分向量\n var offsetPoint = pathShape === null || pathShape === void 0 ? void 0 : pathShape.getPoint(percent + TAN_OFFSET);\n vector.push([point.x, point.y]);\n vector.push([offsetPoint.x, offsetPoint.y]);\n }\n var rad = Math.atan2(vector[1][1] - vector[0][1], vector[1][0] - vector[0][0]);\n if (rad < 0) {\n rad += PI * 2;\n }\n if (refX) {\n point.x += cos(rad) * refX;\n point.y += sin(rad) * refX;\n }\n if (refY) {\n // 默认方向是 x 轴正方向,法线是 求出角度 - 90°\n var normal = rad - PI / 2;\n // 若法线角度在 y 轴负方向,切到正方向,保证 refY 相对于 y 轴正方向\n if (rad > 1 / 2 * PI && rad < 3 * 1 / 2 * PI) {\n normal -= PI;\n }\n point.x += cos(normal) * refY;\n point.y += sin(normal) * refY;\n }\n var result = {\n x: point.x,\n y: point.y,\n angle: rad\n };\n if (rotate) {\n if (rad > 0.5 * PI && rad < 1.5 * PI) {\n rad -= PI;\n }\n return (0, _tslib.__assign)({\n rotate: rad\n }, result);\n }\n return result;\n};\n/**\n * depth first traverse, from root to leaves, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverse = function traverse(data, parent, index, fn) {\n if (fn(data, parent, index) === false) {\n return false;\n }\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverse(data.children[i], data, i, fn)) return false;\n }\n }\n return true;\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseUp = function traverseUp(data, parent, index, fn) {\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverseUp(data.children[i], data, i, fn)) return;\n }\n }\n if (fn(data, parent, index) === false) {\n return false;\n }\n return true;\n};\n/**\n * depth first traverse, from root to leaves, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseTree = exports.traverseTree = function traverseTree(data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n traverse(data, null, -1, fn);\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseTreeUp = exports.traverseTreeUp = function traverseTreeUp(data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n traverseUp(data, null, -1, fn);\n};\n/**\n *\n * @param letter the letter\n * @param fontSize\n * @return the letter's width\n */\nvar getLetterWidth = exports.getLetterWidth = function getLetterWidth(letter, fontSize) {\n return fontSize * (_letterAspectRatio.default[letter] || 1);\n};\n/**\n *\n * @param text the text\n * @param fontSize\n * @return the text's size\n */\nvar getTextSize = exports.getTextSize = function getTextSize(text, fontSize) {\n var width = 0;\n var pattern = new RegExp(\"[\\u4E00-\\u9FA5]+\");\n text.split('').forEach(function (letter) {\n if (pattern.test(letter)) {\n // 中文字符\n width += fontSize;\n } else {\n width += getLetterWidth(letter, fontSize);\n }\n });\n return [width, fontSize];\n};\nvar truncateLabelByLength = exports.truncateLabelByLength = function truncateLabelByLength(text, length) {\n if (typeof length !== 'number' || length <= 0 || length >= text.length) {\n return text;\n }\n return text.substring(0, length) + '...';\n};\n/**\n * construct the trees from combos data\n * @param array the combos array\n * @param nodes the nodes array\n * @return the tree\n */\nvar plainCombosToTrees = exports.plainCombosToTrees = function plainCombosToTrees(array, nodes) {\n var result = [];\n var addedMap = {};\n var modelMap = {};\n array.forEach(function (d) {\n modelMap[d.id] = d;\n });\n array.forEach(function (d, i) {\n var cd = (0, _util.clone)(d);\n cd.itemType = 'combo';\n cd.children = undefined;\n if (cd.parentId === cd.id) {\n console.warn(\"The parentId for combo \".concat(cd.id, \" can not be the same as the combo's id\"));\n delete cd.parentId;\n } else if (cd.parentId && !modelMap[cd.parentId]) {\n console.warn(\"The parent combo for combo \".concat(cd.id, \" does not exist!\"));\n delete cd.parentId;\n }\n var mappedObj = addedMap[cd.id];\n if (mappedObj) {\n cd.children = mappedObj.children;\n addedMap[cd.id] = cd;\n mappedObj = cd;\n if (!mappedObj.parentId) {\n result.push(mappedObj);\n return;\n }\n var mappedParent = addedMap[mappedObj.parentId];\n if (mappedParent) {\n if (mappedParent.children) mappedParent.children.push(cd);else mappedParent.children = [cd];\n } else {\n var parent_1 = {\n id: mappedObj.parentId,\n children: [mappedObj]\n };\n addedMap[mappedObj.parentId] = parent_1;\n addedMap[cd.id] = cd;\n }\n return;\n }\n if ((0, _util.isString)(d.parentId)) {\n var parent_2 = addedMap[d.parentId];\n if (parent_2) {\n if (parent_2.children) parent_2.children.push(cd);else parent_2.children = [cd];\n addedMap[cd.id] = cd;\n } else {\n var pa = {\n id: d.parentId,\n children: [cd]\n };\n addedMap[pa.id] = pa;\n addedMap[cd.id] = cd;\n }\n } else {\n result.push(cd);\n addedMap[cd.id] = cd;\n }\n });\n // proccess the nodes\n var nodeMap = {};\n (nodes || []).forEach(function (node) {\n nodeMap[node.id] = node;\n var combo = addedMap[node.comboId];\n if (combo) {\n var cnode = {\n id: node.id,\n comboId: node.comboId\n };\n if (combo.children) combo.children.push(cnode);else combo.children = [cnode];\n cnode.itemType = 'node';\n addedMap[node.id] = cnode;\n }\n });\n // assign the depth for each element\n var maxDepth = 0;\n result.forEach(function (tree) {\n tree.depth = maxDepth + 10;\n traverseTree(tree, function (child) {\n var parent;\n var itemType = addedMap[child.id].itemType;\n if (itemType === 'node') {\n parent = addedMap[child.comboId];\n } else {\n parent = addedMap[child.parentId];\n }\n if (parent) {\n if (itemType === 'node') child.depth = maxDepth + 1;else child.depth = maxDepth + 10;\n } else {\n child.depth = maxDepth + 10;\n }\n if (maxDepth < child.depth) maxDepth = child.depth;\n var oriNodeModel = nodeMap[child.id];\n if (oriNodeModel) {\n oriNodeModel.depth = child.depth;\n }\n return true;\n });\n });\n return result;\n};\nvar reconstructTree = exports.reconstructTree = function reconstructTree(trees, subtreeId, newParentId) {\n var _a;\n var brothers = trees;\n var subtree;\n var comboChildsMap = {\n root: {\n children: trees\n }\n };\n var foundSubTree = false;\n var oldParentId = 'root';\n (trees || []).forEach(function (tree) {\n if (foundSubTree) return;\n if (tree.id === subtreeId) {\n subtree = tree;\n if (tree.itemType === 'combo') {\n subtree.parentId = newParentId;\n } else {\n subtree.comboId = newParentId;\n }\n foundSubTree = true;\n return;\n }\n traverseTree(tree, function (child) {\n var _a;\n comboChildsMap[child.id] = {\n children: (child === null || child === void 0 ? void 0 : child.children) || []\n };\n // store the old parent id to delete the subtree from the old parent's children in next recursion\n brothers = (_a = comboChildsMap[child.parentId || child.comboId || 'root']) === null || _a === void 0 ? void 0 : _a.children;\n if (child && (child.removed || subtreeId === child.id) && brothers) {\n oldParentId = child.parentId || child.comboId || 'root';\n subtree = child;\n // re-assign the parentId or comboId for the moved subtree\n if (child.itemType === 'combo') {\n subtree.parentId = newParentId;\n } else {\n subtree.comboId = newParentId;\n }\n foundSubTree = true;\n return false;\n }\n return true;\n });\n });\n brothers = (_a = comboChildsMap[oldParentId]) === null || _a === void 0 ? void 0 : _a.children;\n var index = brothers ? brothers.indexOf(subtree) : -1;\n if (index > -1) brothers.splice(index, 1);\n // 如果遍历完整棵树还没有找到,说明之前就不在树中\n if (!foundSubTree) {\n subtree = {\n id: subtreeId,\n itemType: 'node',\n comboId: newParentId\n };\n comboChildsMap[subtreeId] = {\n children: undefined\n };\n }\n // append to new parent\n if (subtreeId) {\n var found_1 = false;\n // newParentId is undefined means the subtree will have no parent\n if (newParentId) {\n var newParentDepth_1 = 0;\n (trees || []).forEach(function (tree) {\n if (found_1) return; // terminate\n traverseTree(tree, function (child) {\n // append subtree to the new parent ans assign the depth to the subtree\n if (newParentId === child.id) {\n found_1 = true;\n if (child.children) child.children.push(subtree);else child.children = [subtree];\n newParentDepth_1 = child.depth;\n if (subtree.itemType === 'node') subtree.depth = newParentDepth_1 + 2;else subtree.depth = newParentDepth_1 + 1;\n return false; // terminate\n }\n\n return true;\n });\n });\n } else if ((!newParentId || !found_1) && subtree.itemType !== 'node') {\n // if the newParentId is undefined or it is not found in the tree, add the subTree to the root\n trees.push(subtree);\n }\n // update the depth of the subtree and its children from the subtree\n var currentDepth_1 = subtree.depth;\n traverseTree(subtree, function (child) {\n if (child.itemType === 'node') currentDepth_1 += 2;else currentDepth_1 += 1;\n child.depth = currentDepth_1;\n return true;\n });\n }\n return trees;\n};\nvar getComboBBox = exports.getComboBBox = function getComboBBox(children, graph, combo) {\n var comboBBox = {\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity,\n x: undefined,\n y: undefined,\n width: undefined,\n height: undefined,\n centerX: undefined,\n centerY: undefined\n };\n if (!children || children.length === 0) {\n var comboModel = combo === null || combo === void 0 ? void 0 : combo.getModel();\n var _a = comboModel || {},\n x = _a.x,\n y = _a.y,\n fixSize = _a.fixSize,\n collapsed = _a.collapsed,\n fixCollapseSize = _a.fixCollapseSize;\n var useFixSize = collapsed ? fixCollapseSize : fixSize;\n var _b = (0, _util.isArray)(useFixSize) ? useFixSize : [useFixSize, useFixSize],\n width = _b[0],\n height = _b[1];\n var halfSize = [width / 2, height / 2];\n return {\n minX: x - halfSize[0],\n minY: y - halfSize[1],\n maxX: x + halfSize[0],\n maxY: y + halfSize[1],\n x: x,\n y: y,\n width: width,\n height: height\n };\n }\n children.forEach(function (child) {\n var childItem = graph.findById(child.id);\n if (!childItem || !childItem.isVisible()) return; // ignore hidden children\n childItem.set('bboxCanvasCache', undefined);\n var childBBox = childItem.getCanvasBBox();\n if (childBBox.x && comboBBox.minX > childBBox.minX) comboBBox.minX = childBBox.minX;\n if (childBBox.y && comboBBox.minY > childBBox.minY) comboBBox.minY = childBBox.minY;\n if (childBBox.x && comboBBox.maxX < childBBox.maxX) comboBBox.maxX = childBBox.maxX;\n if (childBBox.y && comboBBox.maxY < childBBox.maxY) comboBBox.maxY = childBBox.maxY;\n });\n comboBBox.x = (comboBBox.minX + comboBBox.maxX) / 2;\n comboBBox.y = (comboBBox.minY + comboBBox.maxY) / 2;\n comboBBox.width = comboBBox.maxX - comboBBox.minX;\n comboBBox.height = comboBBox.maxY - comboBBox.minY;\n comboBBox.centerX = (comboBBox.minX + comboBBox.maxX) / 2;\n comboBBox.centerY = (comboBBox.minY + comboBBox.maxY) / 2;\n // if it is a circle combo, diagnal length of the children's bbox should be the diameter of the combo's bbox\n if ((combo === null || combo === void 0 ? void 0 : combo.getKeyShape().get('type')) === 'circle') {\n comboBBox.width = Math.hypot(comboBBox.height, comboBBox.width);\n comboBBox.height = comboBBox.width;\n }\n Object.keys(comboBBox).forEach(function (key) {\n if (comboBBox[key] === Infinity || comboBBox[key] === -Infinity) {\n comboBBox[key] = undefined;\n }\n });\n return comboBBox;\n};\nvar shouldRefreshEdge = exports.shouldRefreshEdge = function shouldRefreshEdge(cfg) {\n var refreshEdge = (0, _util.isNumber)(cfg.x) || (0, _util.isNumber)(cfg.y) || cfg.type || cfg.anchorPoints || cfg.size;\n if (cfg.style) refreshEdge = refreshEdge || (0, _util.isNumber)(cfg.style.r) || (0, _util.isNumber)(cfg.style.width) || (0, _util.isNumber)(cfg.style.height) || (0, _util.isNumber)(cfg.style.rx) || (0, _util.isNumber)(cfg.style.ry);\n return refreshEdge;\n};\nvar cloneBesidesImg = exports.cloneBesidesImg = function cloneBesidesImg(obj) {\n var clonedObj = {};\n Object.keys(obj).forEach(function (key1) {\n var obj2 = obj[key1];\n if (key1 === 'img' && !(0, _util.isString)(obj2)) return;\n if ((0, _util.isObject)(obj2) && !(0, _util.isArray)(obj2)) {\n var clonedObj2_1 = {};\n Object.keys(obj2).forEach(function (key2) {\n var v = obj2[key2];\n if (key2 === 'img' && !(0, _util.isString)(v)) return;\n clonedObj2_1[key2] = (0, _util.clone)(v);\n });\n clonedObj[key1] = clonedObj2_1;\n } else {\n clonedObj[key1] = (0, _util.clone)(obj2);\n }\n });\n return clonedObj;\n};\nvar getAnimateCfgWithCallback = exports.getAnimateCfgWithCallback = function getAnimateCfgWithCallback(_a) {\n var animateCfg = _a.animateCfg,\n callback = _a.callback;\n var animateConfig;\n if (!animateCfg) {\n animateConfig = {\n duration: 500,\n callback: callback\n };\n } else {\n animateConfig = (0, _util.clone)(animateCfg);\n if (animateCfg.callback) {\n var animateCfgCallback_1 = animateCfg.callback;\n animateConfig.callback = function () {\n callback();\n animateCfgCallback_1();\n };\n } else {\n animateConfig.callback = callback;\n }\n }\n return animateConfig;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/util/graphic.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUFramebuffer.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUFramebuffer.js ***! - \***************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/util/letterAspectRatio.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/util/letterAspectRatio.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WebGPUFramebuffer; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n\n\n\nvar WebGPUFramebuffer = /*#__PURE__*/function () {\n function WebGPUFramebuffer(engine, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, WebGPUFramebuffer);\n\n this.engine = engine;\n this.options = options;\n this.colorTexture = void 0;\n this.depthTexture = void 0;\n this.width = 0;\n this.height = 0;\n var _options = options,\n width = _options.width,\n height = _options.height,\n color = _options.color,\n colors = _options.colors,\n depth = _options.depth,\n stencil = _options.stencil;\n\n if (color) {\n this.colorTexture = color;\n }\n\n if (depth) {\n this.depthTexture = depth;\n } // TODO: depth & stencil\n\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(WebGPUFramebuffer, [{\n key: \"get\",\n value: function get() {\n var _this$colorTexture, _this$depthTexture;\n\n return {\n color: (_this$colorTexture = this.colorTexture) === null || _this$colorTexture === void 0 ? void 0 : _this$colorTexture.get(),\n depth: (_this$depthTexture = this.depthTexture) === null || _this$depthTexture === void 0 ? void 0 : _this$depthTexture.get()\n };\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n var _this$colorTexture2, _this$depthTexture2;\n\n (_this$colorTexture2 = this.colorTexture) === null || _this$colorTexture2 === void 0 ? void 0 : _this$colorTexture2.destroy();\n (_this$depthTexture2 = this.depthTexture) === null || _this$depthTexture2 === void 0 ? void 0 : _this$depthTexture2.destroy();\n }\n }, {\n key: \"resize\",\n value: function resize(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n if (width !== this.width || height !== this.height) {\n var _this$colorTexture3, _this$depthTexture3;\n\n (_this$colorTexture3 = this.colorTexture) === null || _this$colorTexture3 === void 0 ? void 0 : _this$colorTexture3.resize({\n width: width,\n height: height\n });\n (_this$depthTexture3 = this.depthTexture) === null || _this$depthTexture3 === void 0 ? void 0 : _this$depthTexture3.resize({\n width: width,\n height: height\n });\n }\n\n this.width = width;\n this.height = height;\n }\n }]);\n\n return WebGPUFramebuffer;\n}();\n\n\n//# sourceMappingURL=WebGPUFramebuffer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUFramebuffer.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = exports.default = {\n ' ': 0.3329986572265625,\n a: 0.5589996337890625,\n A: 0.6569992065429687,\n b: 0.58599853515625,\n B: 0.6769989013671875,\n c: 0.5469985961914062,\n C: 0.7279998779296875,\n d: 0.58599853515625,\n D: 0.705999755859375,\n e: 0.554998779296875,\n E: 0.63699951171875,\n f: 0.37299957275390627,\n F: 0.5769989013671875,\n g: 0.5909988403320312,\n G: 0.7479995727539063,\n h: 0.555999755859375,\n H: 0.7199996948242188,\n i: 0.255999755859375,\n I: 0.23699951171875,\n j: 0.26699981689453123,\n J: 0.5169998168945312,\n k: 0.5289993286132812,\n K: 0.6899993896484375,\n l: 0.23499908447265624,\n L: 0.5879989624023437,\n m: 0.854998779296875,\n M: 0.8819992065429687,\n n: 0.5589996337890625,\n N: 0.7189987182617188,\n o: 0.58599853515625,\n O: 0.7669998168945312,\n p: 0.58599853515625,\n P: 0.6419998168945312,\n q: 0.58599853515625,\n Q: 0.7669998168945312,\n r: 0.3649993896484375,\n R: 0.6759994506835938,\n s: 0.504998779296875,\n S: 0.6319992065429687,\n t: 0.354998779296875,\n T: 0.6189987182617187,\n u: 0.5599990844726562,\n U: 0.7139999389648437,\n v: 0.48199920654296874,\n V: 0.6389999389648438,\n w: 0.754998779296875,\n W: 0.929998779296875,\n x: 0.5089996337890625,\n X: 0.63699951171875,\n y: 0.4959991455078125,\n Y: 0.66199951171875,\n z: 0.48699951171875,\n Z: 0.6239990234375,\n '0': 0.6,\n '1': 0.40099945068359377,\n '2': 0.6,\n '3': 0.6,\n '4': 0.6,\n '5': 0.6,\n '6': 0.6,\n '7': 0.5469985961914062,\n '8': 0.6,\n '9': 0.6,\n '[': 0.3329986572265625,\n ']': 0.3329986572265625,\n ',': 0.26399993896484375,\n '.': 0.26399993896484375,\n ';': 0.26399993896484375,\n ':': 0.26399993896484375,\n '{': 0.3329986572265625,\n '}': 0.3329986572265625,\n '\\\\': 0.5,\n '|': 0.19499969482421875,\n '=': 0.604998779296875,\n '+': 0.604998779296875,\n '-': 0.604998779296875,\n _: 0.5,\n '`': 0.3329986572265625,\n ' ~': 0.8329986572265625,\n '!': 0.3329986572265625,\n '@': 0.8579986572265625,\n '#': 0.6,\n $: 0.6,\n '%': 0.9699996948242188,\n '^': 0.517999267578125,\n '&': 0.7259994506835937,\n '*': 0.505999755859375,\n '(': 0.3329986572265625,\n ')': 0.3329986572265625,\n '<': 0.604998779296875,\n '>': 0.604998779296875,\n '/': 0.5,\n '?': 0.53699951171875\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/util/letterAspectRatio.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUModel.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUModel.js ***! - \*********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-core/lib/util/math.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-core/lib/util/math.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WebGPUModel; });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _utils_uniform__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/uniform */ \"./node_modules/@antv/g-webgpu-engine/es/utils/uniform.js\");\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/constants.js\");\n/* harmony import */ var _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./WebGPUBuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUBuffer.js\");\n\n\n\n\n\n\n\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_3___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\n\n\n\n// @ts-ignore\nfunction concatenate(resultConstructor) {\n var totalLength = 0;\n\n for (var _len = arguments.length, arrays = new Array(_len > 1 ? _len - 1 : 0), _key = 1; _key < _len; _key++) {\n arrays[_key - 1] = arguments[_key];\n }\n\n for (var _i = 0, _arrays = arrays; _i < _arrays.length; _i++) {\n var arr = _arrays[_i];\n totalLength += arr.length;\n }\n\n var result = new resultConstructor(totalLength);\n var offset = 0;\n\n for (var _i2 = 0, _arrays2 = arrays; _i2 < _arrays2.length; _i2++) {\n var _arr = _arrays2[_i2];\n result.set(_arr, offset);\n offset += _arr.length;\n }\n\n return result;\n}\n\nvar WebGPUModel = /*#__PURE__*/function () {\n /**\n * 用于后续渲染时动态更新\n */\n\n /**\n * vertex\n */\n\n /**\n * indices's buffer\n */\n function WebGPUModel(engine, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_5___default()(this, WebGPUModel);\n\n this.engine = engine;\n this.options = options;\n this.pipelineLayout = void 0;\n this.renderPipeline = void 0;\n this.uniformsBindGroupLayout = void 0;\n this.uniformBindGroup = void 0;\n this.uniformBuffer = void 0;\n this.uniforms = {};\n this.uniformGPUBufferLayout = [];\n this.attributeCache = {};\n this.indexBuffer = void 0;\n this.indexCount = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_6___default()(WebGPUModel, [{\n key: \"init\",\n value: function () {\n var _init = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee() {\n var _this = this;\n\n var _this$options, vs, fs, attributes, uniforms, primitive, count, elements, depth, blend, stencil, cull, instances, _yield$this$compilePi, vertexStage, fragmentStage, vertexState, descriptor;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n _this$options = this.options, vs = _this$options.vs, fs = _this$options.fs, attributes = _this$options.attributes, uniforms = _this$options.uniforms, primitive = _this$options.primitive, count = _this$options.count, elements = _this$options.elements, depth = _this$options.depth, blend = _this$options.blend, stencil = _this$options.stencil, cull = _this$options.cull, instances = _this$options.instances; // build shaders first\n\n _context.next = 3;\n return this.compilePipelineStageDescriptor(vs, fs, null);\n\n case 3:\n _yield$this$compilePi = _context.sent;\n vertexStage = _yield$this$compilePi.vertexStage;\n fragmentStage = _yield$this$compilePi.fragmentStage;\n\n if (uniforms) {\n // create uniform bind groups & layout\n this.buildUniformBindGroup(uniforms);\n }\n\n if (elements) {\n this.indexBuffer = elements.get();\n this.indexCount = elements.indexCount;\n } // TODO: instanced array\n\n\n vertexState = {\n vertexBuffers: Object.keys(attributes).map(function (attributeName, i) {\n var attribute = attributes[attributeName];\n\n var _attribute$get = attribute.get(),\n arrayStride = _attribute$get.arrayStride,\n stepMode = _attribute$get.stepMode,\n ats = _attribute$get.attributes;\n\n _this.attributeCache[attributeName] = attribute;\n return {\n arrayStride: arrayStride,\n stepMode: stepMode,\n attributes: ats\n };\n })\n };\n descriptor = {\n sampleCount: this.engine.mainPassSampleCount,\n primitiveTopology: _constants__WEBPACK_IMPORTED_MODULE_10__[\"primitiveMap\"][primitive || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"gl\"].TRIANGLES],\n rasterizationState: _objectSpread(_objectSpread({}, this.getDefaultRasterizationStateDescriptor()), {}, {\n // TODO: support frontface\n cullMode: Object(_constants__WEBPACK_IMPORTED_MODULE_10__[\"getCullMode\"])({\n cull: cull\n })\n }),\n depthStencilState: Object(_constants__WEBPACK_IMPORTED_MODULE_10__[\"getDepthStencilStateDescriptor\"])({\n depth: depth,\n stencil: stencil\n }),\n colorStates: Object(_constants__WEBPACK_IMPORTED_MODULE_10__[\"getColorStateDescriptors\"])({\n blend: blend\n }, this.engine.options.swapChainFormat),\n layout: this.pipelineLayout,\n vertexStage: vertexStage,\n fragmentStage: fragmentStage,\n vertexState: vertexState\n }; // create pipeline\n\n this.renderPipeline = this.engine.device.createRenderPipeline(descriptor);\n\n case 11:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function init() {\n return _init.apply(this, arguments);\n }\n\n return init;\n }()\n }, {\n key: \"addUniforms\",\n value: function addUniforms(uniforms) {\n this.uniforms = _objectSpread(_objectSpread({}, this.uniforms), Object(_utils_uniform__WEBPACK_IMPORTED_MODULE_9__[\"extractUniforms\"])(uniforms));\n }\n }, {\n key: \"draw\",\n value: function draw(options) {\n var _this2 = this;\n\n var renderPass = this.engine.getCurrentRenderPass();\n\n var uniforms = _objectSpread(_objectSpread({}, this.uniforms), Object(_utils_uniform__WEBPACK_IMPORTED_MODULE_9__[\"extractUniforms\"])(options.uniforms || {}));\n\n var bindGroupBindings = []; // TODO: uniform 发生修改\n\n Object.keys(uniforms).forEach(function (uniformName) {\n var type = _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_1___default()(uniforms[uniformName]);\n\n if (type === 'boolean' || type === 'number' || Array.isArray(uniforms[uniformName]) || // @ts-ignore\n uniforms[uniformName].BYTES_PER_ELEMENT) {\n var _this2$uniformGPUBuff;\n\n var offset = (_this2$uniformGPUBuff = _this2.uniformGPUBufferLayout.find(function (_ref) {\n var name = _ref.name;\n return name === uniformName;\n })) === null || _this2$uniformGPUBuff === void 0 ? void 0 : _this2$uniformGPUBuff.offset;\n\n if (offset !== null) {\n _this2.uniformBuffer.subData({\n // @ts-ignore\n data: uniforms[uniformName],\n // @ts-ignore\n offset: offset\n });\n }\n } else {\n var _this2$uniformGPUBuff2;\n\n var _offset = (_this2$uniformGPUBuff2 = _this2.uniformGPUBufferLayout.find(function (_ref2) {\n var name = _ref2.name;\n return name === uniformName;\n })) === null || _this2$uniformGPUBuff2 === void 0 ? void 0 : _this2$uniformGPUBuff2.offset;\n\n if (_offset !== null) {\n var textureOrFramebuffer = uniforms[uniformName].get();\n\n var _ref3 = // @ts-ignore\n textureOrFramebuffer.color || textureOrFramebuffer,\n texture = _ref3.texture,\n sampler = _ref3.sampler;\n\n if (sampler) {\n bindGroupBindings.push({\n // @ts-ignore\n binding: _offset,\n resource: sampler\n }); // @ts-ignore\n\n _offset++;\n }\n\n bindGroupBindings.push({\n // @ts-ignore\n binding: _offset,\n resource: texture.createView()\n });\n }\n }\n });\n\n if (this.uniformBuffer) {\n bindGroupBindings[0] = {\n binding: 0,\n resource: {\n buffer: this.uniformBuffer.get() // 返回 GPUBuffer 原生对象\n\n }\n };\n }\n\n this.uniformBindGroup = this.engine.device.createBindGroup({\n layout: this.uniformsBindGroupLayout,\n entries: bindGroupBindings\n });\n\n if (this.renderPipeline) {\n renderPass.setPipeline(this.renderPipeline);\n }\n\n renderPass.setBindGroup(0, this.uniformBindGroup);\n\n if (this.indexBuffer) {\n renderPass.setIndexBuffer(this.indexBuffer.get(), _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"IndexFormat\"].Uint32, 0);\n }\n\n Object.keys(this.attributeCache).forEach(function (attributeName, i) {\n renderPass.setVertexBuffer(0 + i, _this2.attributeCache[attributeName].get().buffer, 0);\n }); // renderPass.draw(verticesCount, instancesCount, verticesStart, 0);\n\n if (this.indexBuffer) {\n renderPass.drawIndexed(this.indexCount, this.options.instances || 1, 0, 0, 0);\n } else {\n renderPass.draw(this.options.count || 0, this.options.instances || 0, 0, 0);\n }\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n throw new Error('Method not implemented.');\n }\n }, {\n key: \"compilePipelineStageDescriptor\",\n value: function () {\n var _compilePipelineStageDescriptor = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_4___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.mark(function _callee2(vertexCode, fragmentCode, defines) {\n var shaderVersion, vertexShader, fragmentShader;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_2___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n shaderVersion = '#version 450\\n';\n vertexShader = vertexCode;\n fragmentShader = fragmentCode;\n\n if (this.engine.options.useWGSL) {\n _context2.next = 10;\n break;\n }\n\n _context2.next = 6;\n return this.compileShaderToSpirV(vertexCode, 'vertex', shaderVersion);\n\n case 6:\n vertexShader = _context2.sent;\n _context2.next = 9;\n return this.compileShaderToSpirV(fragmentCode, 'fragment', shaderVersion);\n\n case 9:\n fragmentShader = _context2.sent;\n\n case 10:\n return _context2.abrupt(\"return\", this.createPipelineStageDescriptor(vertexShader, fragmentShader));\n\n case 11:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function compilePipelineStageDescriptor(_x, _x2, _x3) {\n return _compilePipelineStageDescriptor.apply(this, arguments);\n }\n\n return compilePipelineStageDescriptor;\n }()\n }, {\n key: \"compileShaderToSpirV\",\n value: function compileShaderToSpirV(source, type, shaderVersion) {\n return this.compileRawShaderToSpirV(shaderVersion + source, type);\n }\n }, {\n key: \"compileRawShaderToSpirV\",\n value: function compileRawShaderToSpirV(source, type) {\n return this.engine.glslang.compileGLSL(source, type);\n }\n }, {\n key: \"createPipelineStageDescriptor\",\n value: function createPipelineStageDescriptor(vertexShader, fragmentShader) {\n return {\n vertexStage: {\n module: this.engine.device.createShaderModule({\n code: vertexShader,\n // @ts-ignore\n isWHLSL: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"isSafari\"]\n }),\n entryPoint: 'main'\n },\n fragmentStage: {\n module: this.engine.device.createShaderModule({\n code: fragmentShader,\n // @ts-ignore\n isWHLSL: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"isSafari\"]\n }),\n entryPoint: 'main'\n }\n };\n }\n /**\n * @see https://gpuweb.github.io/gpuweb/#rasterization-state\n */\n\n }, {\n key: \"getDefaultRasterizationStateDescriptor\",\n value: function getDefaultRasterizationStateDescriptor() {\n return {\n frontFace: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"FrontFace\"].CCW,\n cullMode: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"CullMode\"].None,\n depthBias: 0,\n depthBiasSlopeScale: 0,\n depthBiasClamp: 0\n };\n }\n }, {\n key: \"buildUniformBindGroup\",\n value: function buildUniformBindGroup(uniforms) {\n var _this3 = this;\n\n var offset = 0; // FIXME: 所有 uniform 合并成一个 buffer,固定使用 Float32Array 存储,确实会造成一些内存的浪费\n\n var mergedUniformData = concatenate.apply(void 0, [Float32Array].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(Object.keys(uniforms).map(function (uniformName) {\n if (uniforms[uniformName]) {\n _this3.uniformGPUBufferLayout.push({\n name: uniformName,\n offset: offset\n }); // @ts-ignore\n\n\n offset += (uniforms[uniformName].length || 1) * 4;\n return uniforms[uniformName];\n } else {\n // texture & framebuffer\n return [];\n }\n }))));\n var entries = [];\n var hasUniform = false;\n\n if (mergedUniformData.length) {\n hasUniform = true; // TODO: 所有 uniform 绑定到 slot 0,通过解析 Shader 代码判定可见性\n\n entries.push({\n // TODO: 暂时都绑定到 slot 0\n binding: 0,\n visibility: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"ShaderStage\"].Fragment | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"ShaderStage\"].Vertex,\n // TODO: 暂时 VS 和 FS 都可见\n type: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"BindingType\"].UniformBuffer\n });\n } // 声明 texture & sampler\n\n\n Object.keys(uniforms).filter(function (uniformName) {\n return uniforms[uniformName] === null;\n }).forEach(function (uniformName, i) {\n _this3.uniformGPUBufferLayout.push({\n name: uniformName,\n offset: i * 2 + (hasUniform ? 1 : 0)\n });\n\n entries.push({\n // Sampler\n binding: i * 2 + (hasUniform ? 1 : 0),\n visibility: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"ShaderStage\"].Fragment,\n type: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"BindingType\"].Sampler\n }, {\n // Texture view\n binding: i * 2 + (hasUniform ? 1 : 0) + 1,\n visibility: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"ShaderStage\"].Fragment,\n type: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"BindingType\"].SampledTexture\n });\n });\n this.uniformsBindGroupLayout = this.engine.device.createBindGroupLayout({\n // 最新 API 0.0.22 版本使用 entries。Chrome Canary 84.0.4110.0 已实现。\n // 使用 bindings 会报 Warning: GPUBindGroupLayoutDescriptor.bindings is deprecated: renamed to entries\n // @see https://github.com/antvis/GWebGPUEngine/issues/5\n entries: entries\n });\n this.pipelineLayout = this.engine.device.createPipelineLayout({\n bindGroupLayouts: [this.uniformsBindGroupLayout]\n });\n\n if (hasUniform) {\n this.uniformBuffer = new _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_11__[\"default\"](this.engine, {\n // TODO: 处理 Struct 和 boolean\n // @ts-ignore\n data: mergedUniformData instanceof Array ? // @ts-ignore\n new Float32Array(mergedUniformData) : mergedUniformData,\n usage: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"BufferUsage\"].Uniform | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"BufferUsage\"].CopyDst\n });\n }\n }\n }]);\n\n return WebGPUModel;\n}();\n\n\n//# sourceMappingURL=WebGPUModel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUModel.js?"); +eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.translate = exports.squareDist = exports.scaleMatrix = exports.scale = exports.rotate = exports.pointRectSquareDist = exports.pointLineSquareDist = exports.pointLineDistance = exports.move = exports.lerpArray = exports.lerp = exports.itemIntersectByLine = exports.isPolygonsIntersect = exports.isPointsOverlap = exports.isPointInPolygon = exports.invertMatrix = exports.intersectBBox = exports.getRectIntersectByPoint = exports.getPointsCenter = exports.getLineIntersect = exports.getEllipseIntersectByPoint = exports.getDegree = exports.getCircleIntersectByPoint = exports.getCircleCenterByPoints = exports.getBBoxBoundLine = exports.getAdjMatrix = exports.fractionToLine = exports.floydWarshall = exports.distance = exports.compare = exports.applyMatrix = exports.Line = void 0;\nvar _matrixUtil = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar transform = _matrixUtil.ext.transform;\n/**\n * 对比对象,用于对象数组排序\n * @param {string} attributeName 排序依据的字段名称\n * @param {number} min 最小值\n * @param {number} max 最大值\n * @return {boolean} bool 布尔\n */\nvar compare = exports.compare = function compare(attributeName) {\n return function (m, n) {\n return m[attributeName] - n[attributeName];\n };\n};\n/**\n * 是否在区间内\n * @param {number} value 值\n * @param {number} min 最小值\n * @param {number} max 最大值\n * @return {boolean} bool 布尔\n */\nvar isBetween = function isBetween(value, min, max) {\n return value >= min && value <= max;\n};\n/**\n * 获取两条线段的交点\n * @param {Point} p0 第一条线段起点\n * @param {Point} p1 第一条线段终点\n * @param {Point} p2 第二条线段起点\n * @param {Point} p3 第二条线段终点\n * @return {Point} 交点\n */\nvar getLineIntersect = exports.getLineIntersect = function getLineIntersect(p0, p1, p2, p3) {\n var tolerance = 0.0001;\n var E = {\n x: p2.x - p0.x,\n y: p2.y - p0.y\n };\n var D0 = {\n x: p1.x - p0.x,\n y: p1.y - p0.y\n };\n var D1 = {\n x: p3.x - p2.x,\n y: p3.y - p2.y\n };\n var kross = D0.x * D1.y - D0.y * D1.x;\n var sqrKross = kross * kross;\n var invertKross = 1 / kross;\n var sqrLen0 = D0.x * D0.x + D0.y * D0.y;\n var sqrLen1 = D1.x * D1.x + D1.y * D1.y;\n if (sqrKross > tolerance * sqrLen0 * sqrLen1) {\n var s = (E.x * D1.y - E.y * D1.x) * invertKross;\n var t = (E.x * D0.y - E.y * D0.x) * invertKross;\n if (!isBetween(s, 0, 1) || !isBetween(t, 0, 1)) return null;\n return {\n x: p0.x + s * D0.x,\n y: p0.y + s * D0.y\n };\n }\n return null;\n};\n/**\n * point and rectangular intersection point\n * @param {IRect} rect rect\n * @param {Point} point point\n * @return {PointPoint} rst;\n */\nvar getRectIntersectByPoint = exports.getRectIntersectByPoint = function getRectIntersectByPoint(rect, point) {\n var x = rect.x,\n y = rect.y,\n width = rect.width,\n height = rect.height;\n var cx = x + width / 2;\n var cy = y + height / 2;\n var points = [];\n var center = {\n x: cx,\n y: cy\n };\n points.push({\n x: x,\n y: y\n });\n points.push({\n x: x + width,\n y: y\n });\n points.push({\n x: x + width,\n y: y + height\n });\n points.push({\n x: x,\n y: y + height\n });\n points.push({\n x: x,\n y: y\n });\n var rst = null;\n for (var i = 1; i < points.length; i++) {\n rst = getLineIntersect(points[i - 1], points[i], center, point);\n if (rst) {\n break;\n }\n }\n return rst;\n};\n/**\n * get point and circle inIntersect\n * @param {ICircle} circle 圆点,x,y,r\n * @param {Point} point 点 x,y\n * @return {Point} applied point\n */\nvar getCircleIntersectByPoint = exports.getCircleIntersectByPoint = function getCircleIntersectByPoint(circle, point) {\n var cx = circle.x,\n cy = circle.y,\n r = circle.r;\n var x = point.x,\n y = point.y;\n var dx = x - cx;\n var dy = y - cy;\n if (dx * dx + dy * dy < r * r) {\n return null;\n }\n var angle = Math.atan(dy / dx);\n return {\n x: cx + Math.abs(r * Math.cos(angle)) * Math.sign(dx),\n y: cy + Math.abs(r * Math.sin(angle)) * Math.sign(dy)\n };\n};\n/**\n * get point and ellipse inIntersect\n * @param {Object} ellipse 椭圆 x,y,rx,ry\n * @param {Object} point 点 x,y\n * @return {object} applied point\n */\nvar getEllipseIntersectByPoint = exports.getEllipseIntersectByPoint = function getEllipseIntersectByPoint(ellipse, point) {\n var a = ellipse.rx;\n var b = ellipse.ry;\n var cx = ellipse.x;\n var cy = ellipse.y;\n var dx = point.x - cx;\n var dy = point.y - cy;\n // 直接通过 x,y 求夹角,求出来的范围是 -PI, PI\n var angle = Math.atan2(dy / b, dx / a);\n if (angle < 0) {\n angle += 2 * Math.PI; // 转换到 0,2PI\n }\n\n return {\n x: cx + a * Math.cos(angle),\n y: cy + b * Math.sin(angle)\n };\n};\n/**\n * coordinate matrix transformation\n * @param {number} point coordinate\n * @param {Matrix} matrix matrix\n * @param {number} tag could be 0 or 1\n * @return {Point} transformed point\n */\nvar applyMatrix = exports.applyMatrix = function applyMatrix(point, matrix, tag) {\n if (tag === void 0) {\n tag = 1;\n }\n var vector = [point.x, point.y, tag];\n if (!matrix || isNaN(matrix[0])) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n _matrixUtil.vec3.transformMat3(vector, vector, matrix);\n return {\n x: vector[0],\n y: vector[1]\n };\n};\n/**\n * coordinate matrix invert transformation\n * @param {number} point coordinate\n * @param {number} matrix matrix\n * @param {number} tag could be 0 or 1\n * @return {object} transformed point\n */\nvar invertMatrix = exports.invertMatrix = function invertMatrix(point, matrix, tag) {\n if (tag === void 0) {\n tag = 1;\n }\n if (!matrix || isNaN(matrix[0])) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var inversedMatrix = _matrixUtil.mat3.invert([1, 0, 0, 0, 1, 0, 0, 0, 1], matrix);\n if (!inversedMatrix) {\n inversedMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var vector = [point.x, point.y, tag];\n _matrixUtil.vec3.transformMat3(vector, vector, inversedMatrix);\n return {\n x: vector[0],\n y: vector[1]\n };\n};\n/**\n *\n * @param p1 First coordinate\n * @param p2 second coordinate\n * @param p3 three coordinate\n */\nvar getCircleCenterByPoints = exports.getCircleCenterByPoints = function getCircleCenterByPoints(p1, p2, p3) {\n var a = p1.x - p2.x;\n var b = p1.y - p2.y;\n var c = p1.x - p3.x;\n var d = p1.y - p3.y;\n var e = (p1.x * p1.x - p2.x * p2.x - p2.y * p2.y + p1.y * p1.y) / 2;\n var f = (p1.x * p1.x - p3.x * p3.x - p3.y * p3.y + p1.y * p1.y) / 2;\n var denominator = b * c - a * d;\n return {\n x: -(d * e - b * f) / denominator,\n y: -(a * f - c * e) / denominator\n };\n};\n/**\n * get distance by two points\n * @param p1 first point\n * @param p2 second point\n */\nvar distance = exports.distance = function distance(p1, p2) {\n var vx = p1.x - p2.x;\n var vy = p1.y - p2.y;\n return Math.sqrt(vx * vx + vy * vy);\n};\n/**\n * scale matrix\n * @param matrix [ [], [], [] ]\n * @param ratio\n */\nvar scaleMatrix = exports.scaleMatrix = function scaleMatrix(matrix, ratio) {\n var result = [];\n matrix.forEach(function (row) {\n var newRow = [];\n row.forEach(function (v) {\n newRow.push(v * ratio);\n });\n result.push(newRow);\n });\n return result;\n};\n/**\n * Floyd Warshall algorithm for shortest path distances matrix\n * @param {array} adjMatrix adjacency matrix\n * @return {array} distances shortest path distances matrix\n */\nvar floydWarshall = exports.floydWarshall = function floydWarshall(adjMatrix) {\n // initialize\n var dist = [];\n var size = adjMatrix.length;\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n } else if (adjMatrix[i][j] === 0 || !adjMatrix[i][j]) {\n dist[i][j] = Infinity;\n } else {\n dist[i][j] = adjMatrix[i][j];\n }\n }\n }\n // floyd\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n return dist;\n};\n/**\n * get adjacency matrix\n * @param data graph data\n * @param directed whether it's a directed graph\n */\nvar getAdjMatrix = exports.getAdjMatrix = function getAdjMatrix(data, directed) {\n var nodes = data.nodes,\n edges = data.edges;\n var matrix = [];\n // map node with index in data.nodes\n var nodeMap = {};\n if (!nodes) {\n throw new Error('invalid nodes data!');\n }\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n if (edges) {\n edges.forEach(function (e) {\n var source = e.source,\n target = e.target;\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n matrix[sIndex][tIndex] = 1;\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n return matrix;\n};\n/**\n * 平移group\n * @param group Group 实例\n * @param vec 移动向量\n */\nvar translate = exports.translate = function translate(group, vec) {\n group.translate(vec.x, vec.y);\n};\n/**\n * 移动到指定坐标点\n * @param group Group 实例\n * @param point 移动到的坐标点\n */\nvar move = exports.move = function move(group, point, animate, animateCfg) {\n if (animateCfg === void 0) {\n animateCfg = {\n duration: 500\n };\n }\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var bbox = group.getCanvasBBox();\n var vx = point.x - bbox.minX;\n var vy = point.y - bbox.minY;\n if (animate) {\n var dx_1 = vx * matrix[0];\n var dy_1 = vy * matrix[4];\n var lastX_1 = 0;\n var lastY_1 = 0;\n var newX_1 = 0;\n var newY_1 = 0;\n group.animate(function (ratio) {\n newX_1 = dx_1 * ratio;\n newY_1 = dy_1 * ratio;\n matrix = transform(matrix, [['t', newX_1 - lastX_1, newY_1 - lastY_1]]);\n lastX_1 = newX_1;\n lastY_1 = newY_1;\n return {\n matrix: matrix\n };\n }, animateCfg);\n } else {\n var movedMatrix = transform(matrix, [['t', vx, vy]]);\n group.setMatrix(movedMatrix);\n }\n};\n/**\n * 缩放 group\n * @param group Group 实例\n * @param point 在x 和 y 方向上的缩放比例\n */\nvar scale = exports.scale = function scale(group, ratio) {\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n var scaleXY = ratio;\n if (!(0, _util.isArray)(ratio)) {\n scaleXY = [ratio, ratio];\n }\n if ((0, _util.isArray)(ratio) && ratio.length === 1) {\n scaleXY = [ratio[0], ratio[0]];\n }\n matrix = transform(matrix, [['s', scaleXY[0], scaleXY[1]]]);\n group.setMatrix(matrix);\n};\n/**\n *\n * @param group Group 实例\n * @param ratio 选择角度\n */\nvar rotate = exports.rotate = function rotate(group, angle) {\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n matrix = transform(matrix, [['r', angle]]);\n group.setMatrix(matrix);\n};\nvar getDegree = exports.getDegree = function getDegree(n, nodeIdxMap, edges) {\n var degrees = [];\n for (var i = 0; i < n; i++) {\n degrees[i] = 0;\n }\n edges.forEach(function (e) {\n if (e.source) {\n degrees[nodeIdxMap[e.source]] += 1;\n }\n if (e.target) {\n degrees[nodeIdxMap[e.target]] += 1;\n }\n });\n return degrees;\n};\n// 判断点Q是否在p1和p2的线段上\nfunction onSegment(p1, p2, q) {\n 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])) {\n return true;\n }\n return false;\n}\n/**\n * 判断点P在多边形内-射线法. Borrow from https://github.com/antvis/util/blob/master/packages/path-util/src/point-in-polygon.ts\n * @param points\n * @param x\n * @param y\n */\nvar isPointInPolygon = exports.isPointInPolygon = function isPointInPolygon(points, x, y) {\n var isHit = false;\n var n = points.length;\n // 判断两个double在eps精度下的大小关系\n var tolerance = 1e-6;\n function dcmp(xValue) {\n if (Math.abs(xValue) < tolerance) {\n return 0;\n }\n return xValue < 0 ? -1 : 1;\n }\n if (n <= 2) {\n // svg 中点小于 3 个时,不显示,也无法被拾取\n return false;\n }\n for (var i = 0; i < n; i++) {\n var p1 = points[i];\n var p2 = points[(i + 1) % n];\n if (onSegment(p1, p2, [x, y])) {\n // 点在多边形一条边上\n return true;\n }\n // 前一个判断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) {\n isHit = !isHit;\n }\n }\n return isHit;\n};\n// 判断两个BBox是否相交\nvar intersectBBox = exports.intersectBBox = function intersectBBox(box1, box2) {\n return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);\n};\nvar lineIntersectPolygon = function lineIntersectPolygon(lines, line) {\n var isIntersect = false;\n (0, _util.each)(lines, function (l) {\n if (getLineIntersect(l.from, l.to, line.from, line.to)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n};\n/**\n * 判断两个polygon是否相交。\n * borrow from @antv/path-util\n * @param points1 polygon1的顶点数组\n * @param points2 polygon2的顶点数组\n */\nvar isPolygonsIntersect = exports.isPolygonsIntersect = function isPolygonsIntersect(points1, points2) {\n var getBBox = function getBBox(points) {\n var xArr = points.map(function (p) {\n return p[0];\n });\n var yArr = points.map(function (p) {\n return p[1];\n });\n return {\n minX: Math.min.apply(null, xArr),\n maxX: Math.max.apply(null, xArr),\n minY: Math.min.apply(null, yArr),\n maxY: Math.max.apply(null, yArr)\n };\n };\n var parseToLines = function parseToLines(points) {\n var lines = [];\n var count = points.length;\n for (var i = 0; i < count - 1; i++) {\n var point = points[i];\n var next = points[i + 1];\n lines.push({\n from: {\n x: point[0],\n y: point[1]\n },\n to: {\n x: next[0],\n y: next[1]\n }\n });\n }\n if (lines.length > 1) {\n var first = points[0];\n var last = points[count - 1];\n lines.push({\n from: {\n x: last[0],\n y: last[1]\n },\n to: {\n x: first[0],\n y: first[1]\n }\n });\n }\n return lines;\n };\n // 空数组,或者一个点返回 false\n if (points1.length < 2 || points2.length < 2) {\n return false;\n }\n var bbox1 = getBBox(points1);\n var bbox2 = getBBox(points2);\n // 判定包围盒是否相交,比判定点是否在多边形内要快的多,可以筛选掉大多数情况\n if (!intersectBBox(bbox1, bbox2)) {\n return false;\n }\n var isIn = false;\n // 判定点是否在多边形内部,一旦有一个点在另一个多边形内,则返回\n (0, _util.each)(points2, function (point) {\n if (isPointInPolygon(points1, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n (0, _util.each)(points1, function (point) {\n if (isPointInPolygon(points2, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n var lines1 = parseToLines(points1);\n var lines2 = parseToLines(points2);\n var isIntersect = false;\n (0, _util.each)(lines2, function (line) {\n if (lineIntersectPolygon(lines1, line)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n};\nvar Line = exports.Line = /** @class */function () {\n function Line(x1, y1, x2, y2) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n }\n Line.prototype.getBBox = function () {\n var minX = Math.min(this.x1, this.x2);\n var minY = Math.min(this.y1, this.y2);\n var maxX = Math.max(this.x1, this.x2);\n var maxY = Math.max(this.y1, this.y2);\n var res = {\n x: minX,\n y: minY,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n width: maxX - minX,\n height: maxY - minY\n };\n return res;\n };\n return Line;\n}();\nvar getBBoxBoundLine = exports.getBBoxBoundLine = function getBBoxBoundLine(bbox, direction) {\n var bounds = {\n top: [bbox.minX, bbox.minY, bbox.maxX, bbox.minY],\n left: [bbox.minX, bbox.minY, bbox.minX, bbox.maxY],\n bottom: [bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY],\n right: [bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY]\n };\n return bounds[direction];\n};\n/**\n * 计算两条线段相交时,相交点对第一条线段上的分割比例\n */\nvar fractionAlongLineA = function fractionAlongLineA(la, lb) {\n var uaT = (lb.x2 - lb.x1) * (la.y1 - lb.y1) - (lb.y2 - lb.y1) * (la.x1 - lb.x1);\n var ubT = (la.x2 - la.x1) * (la.y1 - lb.y1) - (la.y2 - la.y1) * (la.x1 - lb.x1);\n var uB = (lb.y2 - lb.y1) * (la.x2 - la.x1) - (lb.x2 - lb.x1) * (la.y2 - la.y1);\n if (uB) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return ua;\n }\n }\n return Number.POSITIVE_INFINITY;\n};\nvar itemIntersectByLine = exports.itemIntersectByLine = function itemIntersectByLine(item, line) {\n var directions = ['top', 'left', 'bottom', 'right'];\n var bbox = item.getBBox();\n var countIntersections = 0;\n var intersections = [];\n for (var i = 0; i < 4; i++) {\n var _a = getBBoxBoundLine(bbox, directions[i]),\n x1 = _a[0],\n y1 = _a[1],\n x2 = _a[2],\n y2 = _a[3];\n intersections[i] = getLineIntersect({\n x: line.x1,\n y: line.y1\n }, {\n x: line.x2,\n y: line.y2\n }, {\n x: x1,\n y: y1\n }, {\n x: x2,\n y: y2\n });\n if (intersections[i]) {\n countIntersections += 1;\n }\n }\n return [intersections, countIntersections];\n};\nvar fractionToLine = exports.fractionToLine = function fractionToLine(item, line) {\n var directions = ['top', 'left', 'bottom', 'right'];\n var bbox = item.getBBox();\n var minDistance = Number.POSITIVE_INFINITY;\n var countIntersections = 0;\n for (var i = 0; i < 4; i++) {\n var _a = getBBoxBoundLine(bbox, directions[i]),\n x1 = _a[0],\n y1 = _a[1],\n x2 = _a[2],\n y2 = _a[3];\n var testDistance = fractionAlongLineA(line, new Line(x1, y1, x2, y2));\n testDistance = Math.abs(testDistance - 0.5);\n if (testDistance >= 0 && testDistance <= 1) {\n countIntersections += 1;\n minDistance = testDistance < minDistance ? testDistance : minDistance;\n }\n }\n if (countIntersections === 0) return -1;\n return minDistance;\n};\nvar getPointsCenter = exports.getPointsCenter = function getPointsCenter(points) {\n var centerX = 0;\n var centerY = 0;\n if (points.length > 0) {\n for (var _i = 0, points_1 = points; _i < points_1.length; _i++) {\n var point = points_1[_i];\n centerX += point.x;\n centerY += point.y;\n }\n centerX /= points.length;\n centerY /= points.length;\n }\n return {\n x: centerX,\n y: centerY\n };\n};\nvar squareDist = exports.squareDist = function squareDist(a, b) {\n return Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2);\n};\nvar pointLineSquareDist = exports.pointLineSquareDist = function pointLineSquareDist(point, line) {\n var x1 = line.x1;\n var y1 = line.y1;\n var x2 = line.x2 - x1;\n var y2 = line.y2 - y1;\n var px = point.x - x1;\n var py = point.y - y1;\n var dotprod = px * x2 + py * y2;\n var projlenSq;\n if (dotprod <= 0) {\n projlenSq = 0;\n } else {\n px = x2 - px;\n py = y2 - py;\n dotprod = px * x2 + py * y2;\n if (dotprod <= 0) {\n projlenSq = 0;\n } else {\n projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2);\n }\n }\n var lenSq = px * px + py * py - projlenSq;\n if (lenSq < 0) {\n lenSq = 0;\n }\n return lenSq;\n};\nvar isPointsOverlap = exports.isPointsOverlap = function isPointsOverlap(p1, p2, e) {\n if (e === void 0) {\n e = 1e-3;\n }\n return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2) < Math.pow(e, 2);\n};\n/**\n * 点到矩形的距离的平方:矩形内部点视作距离为0,外部的点若投影落在矩形边上则为点到矩形边的最近的垂直距离,否则为点到矩形顶点的距离,\n * @param point IPoint\n * @param rect IRect\n */\nvar pointRectSquareDist = exports.pointRectSquareDist = function pointRectSquareDist(point, rect) {\n var isLeft = point.x < rect.x;\n var isRight = point.x > rect.x + rect.width;\n var isTop = point.y > rect.y + rect.height;\n var isBottom = point.y < rect.y;\n var isPointOutside = isLeft || isRight || isTop || isBottom;\n if (!isPointOutside) {\n return 0;\n }\n if (isTop && !isLeft && !isRight) {\n return Math.pow(rect.y + rect.height - point.y, 2);\n }\n if (isBottom && !isLeft && !isRight) {\n return Math.pow(point.y - rect.y, 2);\n }\n if (isLeft && !isTop && !isBottom) {\n return Math.pow(rect.x - point.x, 2);\n }\n if (isRight && !isTop && !isBottom) {\n return Math.pow(rect.x + rect.width - point.x, 2);\n }\n var dx = Math.min(Math.abs(rect.x - point.x), Math.abs(rect.x + rect.width - point.x));\n var dy = Math.min(Math.abs(rect.y - point.y), Math.abs(rect.y + rect.height - point.y));\n return dx * dx + dy * dy;\n};\n/**\n * point to line distance\n * @param {array} line 线的四个顶点 [x1, y1, x2, y2]\n * @param {object} point 坐标点 {x, y}\n * @return {Number|NaN} distance\n */\nvar pointLineDistance = exports.pointLineDistance = function pointLineDistance(line, point) {\n var x1 = line[0],\n y1 = line[1],\n x2 = line[2],\n y2 = line[3];\n var x = point.x,\n y = point.y;\n var d = [x2 - x1, y2 - y1];\n if (_matrixUtil.vec2.exactEquals(d, [0, 0])) {\n return NaN;\n }\n var u = [-d[1], d[0]];\n // @ts-ignore\n _matrixUtil.vec2.normalize(u, u);\n var a = [x - x1, y - y1];\n // @ts-ignore\n return Math.abs(_matrixUtil.vec2.dot(a, u));\n};\n/**\n * Linearly interpolate between start and end, where alpha is the percent distance along the line.\n * alpha = 0 will be start, and alpha = 1 will be end.\n * @param {number} start\n * @param {number} end\n * @param {number} alpha interpolation factor, typically in the closed interval [0, 1]\n * @returns {number}\n */\nvar lerp = exports.lerp = function lerp(start, end, alpha) {\n return start + (end - start) * alpha;\n};\n/**\n * Linearly interpolate between start and end arrays, where alpha is the percent distance along the line.\n * alpha = 0 will be start, and alpha = 1 will be end.\n * @param {number[]} start\n * @param {number[]} end\n * @param {number} alpha interpolation factor, typically in the closed interval [0, 1]\n * @returns {number[]}\n */\nvar lerpArray = exports.lerpArray = function lerpArray(start, end, alpha) {\n var len = Math.min(start.length, end.length);\n var out = new Array(len);\n for (var i = 0; i < len; i++) {\n out[i] = lerp(start[i], end[i], alpha);\n }\n return out;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/util/math.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUTexture2D.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUTexture2D.js ***! - \*************************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-element/es/edges/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/edges/index.js ***! + \*********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WebGPUTexture2D; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _constants__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/constants.js\");\n\n\n\n\n\n/**\n * adaptor for regl.Buffer\n * @see https://github.com/regl-project/regl/blob/gh-pages/API.md#buffers\n */\n\nvar WebGPUTexture2D = /*#__PURE__*/function () {\n function WebGPUTexture2D(engine, options) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, WebGPUTexture2D);\n\n this.engine = engine;\n this.options = options;\n this.texture = void 0;\n this.sampler = void 0;\n this.width = void 0;\n this.height = void 0;\n this.createTexture();\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(WebGPUTexture2D, [{\n key: \"get\",\n value: function get() {\n return {\n texture: this.texture,\n sampler: this.sampler\n };\n }\n }, {\n key: \"update\",\n value: function update() {// TODO\n }\n }, {\n key: \"resize\",\n value: function resize(_ref) {\n var width = _ref.width,\n height = _ref.height;\n\n // TODO: it seems that Texture doesn't support `resize`\n if (width !== this.width || height !== this.height) {\n this.destroy();\n this.createTexture();\n }\n\n this.width = width;\n this.height = height;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n if (this.texture) {\n this.texture.destroy();\n }\n }\n }, {\n key: \"createTexture\",\n value: function createTexture() {\n var _this$options = this.options,\n data = _this$options.data,\n _this$options$type = _this$options.type,\n type = _this$options$type === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].UNSIGNED_BYTE : _this$options$type,\n width = _this$options.width,\n height = _this$options.height,\n _this$options$flipY = _this$options.flipY,\n flipY = _this$options$flipY === void 0 ? false : _this$options$flipY,\n _this$options$format = _this$options.format,\n format = _this$options$format === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].RGBA : _this$options$format,\n _this$options$mipmap = _this$options.mipmap,\n mipmap = _this$options$mipmap === void 0 ? false : _this$options$mipmap,\n _this$options$wrapS = _this$options.wrapS,\n wrapS = _this$options$wrapS === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].CLAMP_TO_EDGE : _this$options$wrapS,\n _this$options$wrapT = _this$options.wrapT,\n wrapT = _this$options$wrapT === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].CLAMP_TO_EDGE : _this$options$wrapT,\n _this$options$aniso = _this$options.aniso,\n aniso = _this$options$aniso === void 0 ? 0 : _this$options$aniso,\n _this$options$alignme = _this$options.alignment,\n alignment = _this$options$alignme === void 0 ? 1 : _this$options$alignme,\n _this$options$premult = _this$options.premultiplyAlpha,\n premultiplyAlpha = _this$options$premult === void 0 ? false : _this$options$premult,\n _this$options$mag = _this$options.mag,\n mag = _this$options$mag === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].NEAREST : _this$options$mag,\n _this$options$min = _this$options.min,\n min = _this$options$min === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].NEAREST : _this$options$min,\n _this$options$colorSp = _this$options.colorSpace,\n colorSpace = _this$options$colorSp === void 0 ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_2__[\"gl\"].BROWSER_DEFAULT_WEBGL : _this$options$colorSp,\n usage = _this$options.usage;\n this.width = width;\n this.height = height;\n this.texture = this.engine.device.createTexture({\n size: [width, height, 1],\n // TODO: arrayLayerCount is deprecated: use size.depth\n // arrayLayerCount: 1,\n mipLevelCount: 1,\n // TODO: https://gpuweb.github.io/gpuweb/#dom-gputextureviewdescriptor-miplevelcount\n sampleCount: 1,\n dimension: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__[\"TextureDimension\"].E2d,\n format: _constants__WEBPACK_IMPORTED_MODULE_4__[\"formatMap\"][format],\n // could throw texture binding usage mismatch\n usage: usage || _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__[\"TextureUsage\"].Sampled | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__[\"TextureUsage\"].CopyDst\n });\n\n if (!usage || usage & _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_3__[\"TextureUsage\"].Sampled) {\n this.sampler = this.engine.device.createSampler({\n addressModeU: _constants__WEBPACK_IMPORTED_MODULE_4__[\"wrapModeMap\"][wrapS],\n addressModeV: _constants__WEBPACK_IMPORTED_MODULE_4__[\"wrapModeMap\"][wrapT],\n addressModeW: _constants__WEBPACK_IMPORTED_MODULE_4__[\"wrapModeMap\"][wrapS],\n // TODO: same as addressModeU\n magFilter: _constants__WEBPACK_IMPORTED_MODULE_4__[\"filterMap\"][mag],\n minFilter: _constants__WEBPACK_IMPORTED_MODULE_4__[\"filterMap\"][min],\n maxAnisotropy: aniso // @see https://gpuweb.github.io/gpuweb/#dom-gpusamplerdescriptor-maxanisotropy\n\n });\n }\n }\n }]);\n\n return WebGPUTexture2D;\n}();\n\n\n//# sourceMappingURL=WebGPUTexture2D.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUTexture2D.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _polyline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./polyline */ \"./node_modules/@antv/g6-element/es/edges/polyline.js\");\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/edges/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/constants.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/constants.js ***! - \*******************************************************************/ -/*! exports provided: primitiveMap, depthFuncMap, blendEquationMap, blendFuncMap, formatMap, filterMap, wrapModeMap, getCullMode, getDepthStencilStateDescriptor, getColorStateDescriptors */ +/***/ "./node_modules/@antv/g6-element/es/edges/polyline-util.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/edges/polyline-util.js ***! + \*****************************************************************/ +/*! exports provided: getBBoxFromPoint, getBBoxFromPoints, isBBoxesOverlapping, filterConnectPoints, simplifyPolyline, getSimplePolyline, getExpandedBBox, isHorizontalPort, getExpandedBBoxPoint, mergeBBox, getPointsFromBBox, isPointOutsideBBox, getBBoxXCrossPoints, getBBoxYCrossPoints, getBBoxCrossPointsByPoint, distance, _costByPoints, heuristicCostEstimate, reconstructPath, removeFrom, isSegmentsIntersected, isSegmentCrossingBBox, getNeighborPoints, pathFinder, isBending, getBorderRadiusPoints, getPathWithBorderRadiusByPolyline, getPolylinePoints, removeRedundantPoint, SortedArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"primitiveMap\", function() { return primitiveMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"depthFuncMap\", function() { return depthFuncMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blendEquationMap\", function() { return blendEquationMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"blendFuncMap\", function() { return blendFuncMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatMap\", function() { return formatMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterMap\", function() { return filterMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrapModeMap\", function() { return wrapModeMap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCullMode\", function() { return getCullMode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDepthStencilStateDescriptor\", function() { return getDepthStencilStateDescriptor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getColorStateDescriptors\", function() { return getColorStateDescriptors; });\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__);\n\n\nvar _primitiveMap, _depthFuncMap, _blendEquationMap, _blendFuncMap, _formatMap, _filterMap, _wrapModeMap;\n\n\n // WebGPU 不支持 LINE_LOOP & TRIANGLE_FAN\n\nvar primitiveMap = (_primitiveMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].POINTS, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"PrimitiveTopology\"].PointList), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINES, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"PrimitiveTopology\"].LineList), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINE_LOOP, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"PrimitiveTopology\"].LineList), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINE_STRIP, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"PrimitiveTopology\"].LineStrip), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLES, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"PrimitiveTopology\"].TriangleList), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLE_FAN, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"PrimitiveTopology\"].TriangleList), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_primitiveMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].TRIANGLE_STRIP, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"PrimitiveTopology\"].TriangleStrip), _primitiveMap);\nvar depthFuncMap = (_depthFuncMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEVER, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].Never), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALWAYS, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].Always), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LESS, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].Less), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LEQUAL, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].LessEqual), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GREATER, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].Greater), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].GEQUAL, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].GreaterEqual), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].EQUAL, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].Equal), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_depthFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NOTEQUAL, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].NotEqual), _depthFuncMap);\nvar blendEquationMap = (_blendEquationMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_ADD, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendOperation\"].Add), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MIN_EXT, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendOperation\"].Min), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MAX_EXT, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendOperation\"].Max), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_SUBTRACT, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendOperation\"].Subtract), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendEquationMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_REVERSE_SUBTRACT, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendOperation\"].ReverseSubtract), _blendEquationMap); // @see https://gpuweb.github.io/gpuweb/#blend-state\n// 不支持 'constant alpha' 和 'one minus constant alpha'\n\nvar blendFuncMap = (_blendFuncMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ZERO, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].Zero), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].One), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_COLOR, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].SrcColor), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_SRC_COLOR, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].OneMinusSrcColor), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_ALPHA, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].SrcAlpha), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_SRC_ALPHA, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].OneMinusSrcAlpha), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DST_COLOR, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].DstColor), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_DST_COLOR, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].OneMinusDstColor), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DST_ALPHA, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].DstAlpha), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_DST_ALPHA, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].OneMinusDstAlpha), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].CONSTANT_COLOR, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].BlendColor), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE_MINUS_CONSTANT_COLOR, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].OneMinusBlendColor), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_blendFuncMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].SRC_ALPHA_SATURATE, _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"BlendFactor\"].SrcAlphaSaturated), _blendFuncMap); // @see https://gpuweb.github.io/gpuweb/#texture-formats\n\nvar formatMap = (_formatMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALPHA, 'r8unorm'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].RGBA, 'rgba8unorm'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DEPTH_COMPONENT, 'depth32float'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_formatMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].DEPTH_STENCIL, 'depth24plus-stencil8'), _formatMap); // @see https://gpuweb.github.io/gpuweb/#enumdef-gpufiltermode\n\nvar filterMap = (_filterMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].NEAREST, 'nearest'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_filterMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].LINEAR, 'linear'), _filterMap); // @see https://gpuweb.github.io/gpuweb/#enumdef-gpuaddressmode\n\nvar wrapModeMap = (_wrapModeMap = {}, _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].REPEAT, 'repeat'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].CLAMP_TO_EDGE, 'clamp-to-edge'), _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_wrapModeMap, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].MIRRORED_REPEAT, 'mirror-repeat'), _wrapModeMap);\nfunction getCullMode(_ref) {\n var cull = _ref.cull;\n\n if (!cull || !cull.enable) {\n return _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CullMode\"].None;\n }\n\n if (cull.face) {\n return cull.face === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FRONT ? _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CullMode\"].Front : _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CullMode\"].Back;\n }\n}\nfunction getDepthStencilStateDescriptor(_ref2) {\n var depth = _ref2.depth,\n stencil = _ref2.stencil;\n // TODO: stencil\n var stencilFrontBack = {\n compare: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"CompareFunction\"].Always,\n depthFailOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"StencilOperation\"].Keep,\n failOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"StencilOperation\"].Keep,\n passOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"StencilOperation\"].Keep\n };\n return {\n depthWriteEnabled: depth && depth.enable,\n depthCompare: depthFuncMap[(depth === null || depth === void 0 ? void 0 : depth.func) || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ALWAYS],\n format: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"TextureFormat\"].Depth24PlusStencil8,\n stencilFront: stencilFrontBack,\n stencilBack: stencilFrontBack,\n stencilReadMask: 0xffffffff,\n stencilWriteMask: 0xffffffff\n };\n}\n/**\n * @see https://gpuweb.github.io/gpuweb/#color-state\n */\n\nfunction getColorStateDescriptors(_ref3, swapChainFormat) {\n var blend = _ref3.blend;\n return [{\n format: swapChainFormat,\n // https://gpuweb.github.io/gpuweb/#blend-state\n alphaBlend: {\n srcFactor: blendFuncMap[blend && blend.func && blend.func.srcAlpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE],\n dstFactor: blendFuncMap[blend && blend.func && blend.func.dstAlpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ZERO],\n operation: blendEquationMap[blend && blend.equation && blend.equation.alpha || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_ADD]\n },\n colorBlend: {\n srcFactor: blendFuncMap[blend && blend.func && blend.func.srcRGB || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ONE],\n dstFactor: blendFuncMap[blend && blend.func && blend.func.dstRGB || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].ZERO],\n operation: blendEquationMap[blend && blend.equation && blend.equation.rgb || _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_1__[\"gl\"].FUNC_ADD]\n },\n writeMask: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_2__[\"ColorWrite\"].All\n }];\n}\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/constants.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxFromPoint\", function() { return getBBoxFromPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxFromPoints\", function() { return getBBoxFromPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBBoxesOverlapping\", function() { return isBBoxesOverlapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterConnectPoints\", function() { return filterConnectPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"simplifyPolyline\", function() { return simplifyPolyline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSimplePolyline\", function() { return getSimplePolyline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getExpandedBBox\", function() { return getExpandedBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isHorizontalPort\", function() { return isHorizontalPort; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getExpandedBBoxPoint\", function() { return getExpandedBBoxPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeBBox\", function() { return mergeBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPointsFromBBox\", function() { return getPointsFromBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPointOutsideBBox\", function() { return isPointOutsideBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxXCrossPoints\", function() { return getBBoxXCrossPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxYCrossPoints\", function() { return getBBoxYCrossPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxCrossPointsByPoint\", function() { return getBBoxCrossPointsByPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_costByPoints\", function() { return _costByPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"heuristicCostEstimate\", function() { return heuristicCostEstimate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reconstructPath\", function() { return reconstructPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeFrom\", function() { return removeFrom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSegmentsIntersected\", function() { return isSegmentsIntersected; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSegmentCrossingBBox\", function() { return isSegmentCrossingBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNeighborPoints\", function() { return getNeighborPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pathFinder\", function() { return pathFinder; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBending\", function() { return isBending; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBorderRadiusPoints\", function() { return getBorderRadiusPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPathWithBorderRadiusByPolyline\", function() { return getPathWithBorderRadiusByPolyline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPolylinePoints\", function() { return getPolylinePoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeRedundantPoint\", function() { return removeRedundantPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SortedArray\", function() { return SortedArray; });\nvar getBBoxFromPoint = function getBBoxFromPoint(point) {\n var x = point.x,\n y = point.y;\n return {\n x: x,\n y: y,\n centerX: x,\n centerY: y,\n minX: x,\n minY: y,\n maxX: x,\n maxY: y,\n height: 0,\n width: 0\n };\n};\nvar getBBoxFromPoints = function getBBoxFromPoints(points) {\n if (points === void 0) {\n points = [];\n }\n var xs = [];\n var ys = [];\n points.forEach(function (p) {\n xs.push(p.x);\n ys.push(p.y);\n });\n var minX = Math.min.apply(Math, xs);\n var maxX = Math.max.apply(Math, xs);\n var minY = Math.min.apply(Math, ys);\n var maxY = Math.max.apply(Math, ys);\n return {\n centerX: (minX + maxX) / 2,\n centerY: (minY + maxY) / 2,\n maxX: maxX,\n maxY: maxY,\n minX: minX,\n minY: minY,\n height: maxY - minY,\n width: maxX - minX\n };\n};\nvar isBBoxesOverlapping = function isBBoxesOverlapping(b1, b2) {\n return Math.abs(b1.centerX - b2.centerX) * 2 < b1.width + b2.width && Math.abs(b1.centerY - b2.centerY) * 2 < b1.height + b2.height;\n};\nvar filterConnectPoints = function filterConnectPoints(points) {\n // pre-process: remove duplicated points\n var result = [];\n var map = {};\n var pointsLength = points.length;\n for (var i = pointsLength - 1; i >= 0; i--) {\n var p = points[i];\n p.id = \"\".concat(p.x, \"|||\").concat(p.y);\n if (!map[p.id]) {\n map[p.id] = p;\n result.push(p);\n }\n }\n return result;\n};\nvar simplifyPolyline = function simplifyPolyline(points) {\n return filterConnectPoints(points);\n};\nvar getSimplePolyline = function getSimplePolyline(sPoint, tPoint) {\n return [sPoint, {\n x: sPoint.x,\n y: tPoint.y\n }, tPoint];\n};\nvar getExpandedBBox = function getExpandedBBox(bbox, offset) {\n if (bbox.width || bbox.height) {\n return {\n centerX: bbox.centerX,\n centerY: bbox.centerY,\n minX: bbox.minX - offset,\n minY: bbox.minY - offset,\n maxX: bbox.maxX + offset,\n maxY: bbox.maxY + offset,\n height: bbox.height + 2 * offset,\n width: bbox.width + 2 * offset\n };\n }\n // when it is a point\n return bbox;\n};\nvar isHorizontalPort = function isHorizontalPort(port, bbox) {\n var dx = Math.abs(port.x - bbox.centerX);\n var dy = Math.abs(port.y - bbox.centerY);\n if (dx === 0 && dy === 0) return 0;\n return dx / bbox.width > dy / bbox.height;\n};\nvar getExpandedBBoxPoint = function getExpandedBBoxPoint(bbox,\n// 将原来节点 bbox 扩展了 offset 后的 bbox,且被 gridSize 格式化\npoint,\n// 被 gridSize 格式化后的位置(anchorPoint)\nanotherPoint) {\n var isHorizontal = isHorizontalPort(point, bbox);\n if (isHorizontal === 0) {\n // 说明锚点是节点中心,linkCenter: true。需要根据两个节点的相对关系决定方向\n var x = bbox.centerX;\n var y = bbox.centerY;\n if (anotherPoint.y < point.y) {\n // 另一端在左上/右上方时,总是从上方走\n y = bbox.minY;\n } else if (anotherPoint.x > point.x) {\n // 另一端在右下方,往右边走\n x = bbox.maxX;\n } else if (anotherPoint.x < point.x) {\n // 另一端在左下方,往左边走\n x = bbox.minX;\n } else if (anotherPoint.x === point.x) {\n // 另一段在正下方,往下走\n y = bbox.maxY;\n }\n return {\n x: x,\n y: y\n };\n }\n if (isHorizontal) {\n return {\n x: point.x > bbox.centerX ? bbox.maxX : bbox.minX,\n y: point.y\n };\n }\n return {\n x: point.x,\n y: point.y > bbox.centerY ? bbox.maxY : bbox.minY\n };\n};\n/**\n *\n * @param b1\n * @param b2\n */\nvar mergeBBox = function mergeBBox(b1, b2) {\n var minX = Math.min(b1.minX, b2.minX);\n var minY = Math.min(b1.minY, b2.minY);\n var maxX = Math.max(b1.maxX, b2.maxX);\n var maxY = Math.max(b1.maxY, b2.maxY);\n return {\n centerX: (minX + maxX) / 2,\n centerY: (minY + maxY) / 2,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n height: maxY - minY,\n width: maxX - minX\n };\n};\nvar getPointsFromBBox = function getPointsFromBBox(bbox) {\n // anticlockwise\n return [{\n x: bbox.minX,\n y: bbox.minY\n }, {\n x: bbox.maxX,\n y: bbox.minY\n }, {\n x: bbox.maxX,\n y: bbox.maxY\n }, {\n x: bbox.minX,\n y: bbox.maxY\n }];\n};\nvar isPointOutsideBBox = function isPointOutsideBBox(point, bbox) {\n var x = point.x,\n y = point.y;\n return x < bbox.minX || x > bbox.maxX || y < bbox.minY || y > bbox.maxY;\n};\nvar getBBoxXCrossPoints = function getBBoxXCrossPoints(bbox, x) {\n if (x < bbox.minX || x > bbox.maxX) {\n return [];\n }\n return [{\n x: x,\n y: bbox.minY\n }, {\n x: x,\n y: bbox.maxY\n }];\n};\nvar getBBoxYCrossPoints = function getBBoxYCrossPoints(bbox, y) {\n if (y < bbox.minY || y > bbox.maxY) {\n return [];\n }\n return [{\n x: bbox.minX,\n y: y\n }, {\n x: bbox.maxX,\n y: y\n }];\n};\nvar getBBoxCrossPointsByPoint = function getBBoxCrossPointsByPoint(bbox, point) {\n return getBBoxXCrossPoints(bbox, point.x).concat(getBBoxYCrossPoints(bbox, point.y));\n};\n/**\n * 曼哈顿距离\n */\nvar distance = function distance(p1, p2) {\n return Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y);\n};\n/**\n * 如果 points 中的一个节点 x 与 p 相等,则消耗 -2。y 同\n * 即优先选择和 points 在同一水平线 / 垂直线上的点\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\nvar _costByPoints = function _costByPoints(p, points) {\n var offset = -2;\n var result = 0;\n points.forEach(function (point) {\n if (point) {\n if (p.x === point.x) {\n result += offset;\n }\n if (p.y === point.y) {\n result += offset;\n }\n }\n });\n return result;\n};\n/**\n * ps 经过 p 到 pt 的距离,减去其他路过节点造成的消耗\n */\nvar heuristicCostEstimate = function heuristicCostEstimate(p, ps, pt, source, target) {\n return distance(p, ps) + distance(p, pt) + _costByPoints(p, [ps, pt, source, target]);\n};\nvar reconstructPath = function reconstructPath(pathPoints, pointById, cameFrom, currentId, iterator) {\n if (iterator === void 0) {\n iterator = 0;\n }\n pathPoints.unshift(pointById[currentId]);\n if (cameFrom[currentId] && cameFrom[currentId] !== currentId && iterator <= 100) {\n reconstructPath(pathPoints, pointById, cameFrom, cameFrom[currentId], iterator + 1);\n }\n};\n/**\n * 从 arr 中删去 item\n */\nvar removeFrom = function removeFrom(arr, item) {\n var index = arr.indexOf(item);\n if (index > -1) {\n arr.splice(index, 1);\n }\n};\nvar isSegmentsIntersected = function isSegmentsIntersected(p0, p1, p2, p3) {\n var v1x = p2.x - p0.x;\n var v1y = p2.y - p0.y;\n var v2x = p3.x - p0.x;\n var v2y = p3.y - p0.y;\n var v3x = p2.x - p1.x;\n var v3y = p2.y - p1.y;\n var v4x = p3.x - p1.x;\n var v4y = p3.y - p1.y;\n var pd1 = v1x * v2y - v1y * v2x;\n var pd2 = v3x * v4y - v3y * v4x;\n var pd3 = v1x * v3y - v1y * v3x;\n var pd4 = v2x * v4y - v2y * v4x;\n return pd1 * pd2 <= 0 && pd3 * pd4 <= 0;\n};\nvar isSegmentCrossingBBox = function isSegmentCrossingBBox(p1, p2, bbox) {\n if (bbox.width || bbox.height) {\n var _a = getPointsFromBBox(bbox),\n pa = _a[0],\n pb = _a[1],\n pc = _a[2],\n pd = _a[3];\n return isSegmentsIntersected(p1, p2, pa, pb) || isSegmentsIntersected(p1, p2, pa, pd) || isSegmentsIntersected(p1, p2, pb, pc) || isSegmentsIntersected(p1, p2, pc, pd);\n }\n return false;\n};\n/**\n * 在 points 中找到满足 x 或 y 和 point 的 x 或 y 相等,且与 point 连线不经过 bbox1 与 bbox2 的点\n */\nvar getNeighborPoints = function getNeighborPoints(points, point, bbox1, bbox2) {\n var neighbors = [];\n points.forEach(function (p) {\n if (p === point) return;\n if (p.x === point.x || p.y === point.y) {\n if (isSegmentCrossingBBox(p, point, bbox1) || isSegmentCrossingBBox(p, point, bbox2)) return;\n neighbors.push(p);\n }\n });\n return filterConnectPoints(neighbors);\n};\nvar pathFinder = function pathFinder(points, start, goal, sBBox, tBBox, os, ot) {\n var _a;\n // A-Star Algorithm\n var closedSet = [];\n var openSet = (_a = {}, _a[start.id] = start, _a);\n var cameFrom = {};\n var gScore = {}; // all default values are Infinity\n var fScore = {}; // all default values are Infinity\n gScore[start.id] = 0;\n fScore[start.id] = heuristicCostEstimate(start, goal, start);\n var sortedOpenSet = new SortedArray();\n sortedOpenSet.add({\n id: start.id,\n value: fScore[start.id]\n });\n var pointById = {};\n points.forEach(function (p) {\n pointById[p.id] = p;\n });\n var current;\n while (Object.keys(openSet).length) {\n var minId = sortedOpenSet.minId(false);\n if (minId) {\n current = openSet[minId];\n } else {\n break;\n }\n // 若 openSet 中 fScore 最小的点就是终点\n if (current === goal) {\n // ending condition\n var pathPoints = [];\n reconstructPath(pathPoints, pointById, cameFrom, goal.id);\n return pathPoints;\n }\n delete openSet[current.id];\n sortedOpenSet.remove(current.id);\n closedSet.push(current);\n var neighborPoints = getNeighborPoints(points, current, sBBox, tBBox);\n var iterateNeighbors = function iterateNeighbors(items) {\n items.forEach(function (neighbor) {\n if (closedSet.indexOf(neighbor) !== -1) {\n return;\n }\n var neighborId = neighbor.id;\n if (!openSet[neighborId]) {\n openSet[neighborId] = neighbor;\n }\n var tentativeGScore = fScore[current.id] + distance(current, neighbor); // + distance(neighbor, goal);\n if (gScore[neighborId] && tentativeGScore >= gScore[neighborId]) {\n sortedOpenSet.add({\n id: neighborId,\n value: fScore[neighborId]\n });\n return;\n }\n cameFrom[neighborId] = current.id;\n gScore[neighborId] = tentativeGScore;\n fScore[neighborId] = gScore[neighborId] + heuristicCostEstimate(neighbor, goal, start, os, ot);\n sortedOpenSet.add({\n id: neighborId,\n value: fScore[neighborId]\n });\n });\n };\n iterateNeighbors(neighborPoints);\n }\n // throw new Error('Cannot find path');\n return [start, goal];\n};\nvar isBending = function isBending(p0, p1, p2) {\n return !(p0.x === p1.x && p1.x === p2.x || p0.y === p1.y && p1.y === p2.y);\n};\nvar getBorderRadiusPoints = function getBorderRadiusPoints(p0, p1, p2, r) {\n var d0 = distance(p0, p1);\n var d1 = distance(p2, p1);\n if (d0 < r) {\n r = d0;\n }\n if (d1 < r) {\n r = d1;\n }\n var ps = {\n x: p1.x - r / d0 * (p1.x - p0.x),\n y: p1.y - r / d0 * (p1.y - p0.y)\n };\n var pt = {\n x: p1.x - r / d1 * (p1.x - p2.x),\n y: p1.y - r / d1 * (p1.y - p2.y)\n };\n return [ps, pt];\n};\nvar getPathWithBorderRadiusByPolyline = function getPathWithBorderRadiusByPolyline(points, borderRadius) {\n var pathSegments = [];\n var startPoint = points[0];\n pathSegments.push(\"M\".concat(startPoint.x, \" \").concat(startPoint.y));\n points.forEach(function (p, i) {\n var p1 = points[i + 1];\n var p2 = points[i + 2];\n if (p1 && p2) {\n if (isBending(p, p1, p2)) {\n var _a = getBorderRadiusPoints(p, p1, p2, borderRadius),\n ps = _a[0],\n pt = _a[1];\n pathSegments.push(\"L\".concat(ps.x, \" \").concat(ps.y));\n pathSegments.push(\"Q\".concat(p1.x, \" \").concat(p1.y, \" \").concat(pt.x, \" \").concat(pt.y));\n pathSegments.push(\"L\".concat(pt.x, \" \").concat(pt.y));\n } else {\n pathSegments.push(\"L\".concat(p1.x, \" \").concat(p1.y));\n }\n } else if (p1) {\n pathSegments.push(\"L\".concat(p1.x, \" \").concat(p1.y));\n }\n });\n return pathSegments.join('');\n};\nvar getPolylinePoints = function getPolylinePoints(start, end, sNode, tNode, offset) {\n var sBBox, tBBox;\n if (!sNode || !sNode.getType()) {\n sBBox = getBBoxFromPoint(start);\n } else if (sNode.getType() === 'combo') {\n var sKeyShapeBBox = sNode.getKeyShape().getBBox();\n if (sKeyShapeBBox) {\n var _a = sNode.getModel(),\n sx = _a.x,\n sy = _a.y;\n sBBox = {\n x: sx,\n y: sy,\n width: sKeyShapeBBox.width,\n height: sKeyShapeBBox.height,\n minX: sKeyShapeBBox.minX + sx,\n maxX: sKeyShapeBBox.maxX + sx,\n minY: sKeyShapeBBox.minY + sy,\n maxY: sKeyShapeBBox.maxY + sy\n };\n sBBox.centerX = (sBBox.minX + sBBox.maxX) / 2;\n sBBox.centerY = (sBBox.minY + sBBox.maxY) / 2;\n } else {\n sBBox = getBBoxFromPoint(start);\n }\n } else {\n sBBox = sNode && sNode.getBBox();\n }\n if (!tNode || !tNode.getType()) {\n tBBox = getBBoxFromPoint(end);\n } else if (tNode.getType() === 'combo') {\n var tKeyShapeBBox = tNode.getKeyShape().getBBox();\n if (tKeyShapeBBox) {\n var _b = tNode.getModel(),\n tx = _b.x,\n ty = _b.y;\n tBBox = {\n x: tx,\n y: ty,\n width: tKeyShapeBBox.width,\n height: tKeyShapeBBox.height,\n minX: tKeyShapeBBox.minX + tx,\n maxX: tKeyShapeBBox.maxX + tx,\n minY: tKeyShapeBBox.minY + ty,\n maxY: tKeyShapeBBox.maxY + ty\n };\n tBBox.centerX = (tBBox.minX + tBBox.maxX) / 2;\n tBBox.centerY = (tBBox.minY + tBBox.maxY) / 2;\n } else {\n tBBox = getBBoxFromPoint(end);\n }\n } else {\n tBBox = tNode && tNode.getBBox();\n }\n // if (isBBoxesOverlapping(sBBox, tBBox)) {\n // // source and target nodes are overlapping\n // return simplifyPolyline(getSimplePolyline(start, end));\n // }\n var sxBBox = getExpandedBBox(sBBox, offset);\n var txBBox = getExpandedBBox(tBBox, offset);\n // if (isBBoxesOverlapping(sxBBox, txBBox)) {\n // // the expanded bounding boxes of source and target nodes are overlapping\n // return simplifyPolyline(getSimplePolyline(start, end));\n // }\n var sPoint = getExpandedBBoxPoint(sxBBox, start, end);\n var tPoint = getExpandedBBoxPoint(txBBox, end, start);\n var lineBBox = getBBoxFromPoints([sPoint, tPoint]);\n var sMixBBox = mergeBBox(sxBBox, lineBBox);\n var tMixBBox = mergeBBox(txBBox, lineBBox);\n var connectPoints = [];\n connectPoints = connectPoints.concat(getPointsFromBBox(sMixBBox)).concat(getPointsFromBBox(tMixBBox));\n var centerPoint = {\n x: (start.x + end.x) / 2,\n y: (start.y + end.y) / 2\n };\n [lineBBox, sMixBBox, tMixBBox].forEach(function (bbox) {\n connectPoints = connectPoints.concat(getBBoxCrossPointsByPoint(bbox, centerPoint).filter(function (p) {\n return isPointOutsideBBox(p, sxBBox) && isPointOutsideBBox(p, txBBox);\n }));\n });\n [{\n x: sPoint.x,\n y: tPoint.y\n }, {\n x: tPoint.x,\n y: sPoint.y\n }].forEach(function (p) {\n // impossible!!\n if (isPointOutsideBBox(p, sxBBox) && isPointOutsideBBox(p, txBBox) // &&\n // isPointInsideBBox(p, sMixBBox) && isPointInsideBBox(p, tMixBBox)\n ) {\n connectPoints.push(p);\n }\n });\n connectPoints.unshift(sPoint);\n connectPoints.push(tPoint);\n // filter out dulplicated points in connectPoints\n connectPoints = filterConnectPoints(connectPoints); // , sxBBox, txBBox, outerBBox\n var pathPoints = pathFinder(connectPoints, sPoint, tPoint, sBBox, tBBox, start, end);\n pathPoints.unshift(start);\n pathPoints.push(end);\n return simplifyPolyline(pathPoints);\n};\n/**\n * 去除连续同 x 不同 y 的中间点;去除连续同 y 不同 x 的中间点\n * @param points 坐标集合 { x: number, y: number, id: string }[]\n * @returns\n */\nvar removeRedundantPoint = function removeRedundantPoint(points) {\n if (!(points === null || points === void 0 ? void 0 : points.length)) return points;\n var beginPoint = points[points.length - 1];\n var current = {\n x: beginPoint.x,\n y: beginPoint.y\n };\n var continueSameX = [beginPoint];\n var continueSameY = [beginPoint];\n for (var i = points.length - 2; i >= 0; i--) {\n var point = points[i];\n if (point.x === current.x) {\n continueSameX.push(point);\n } else {\n continueSameX = [point];\n current.x = point.x;\n }\n if (point.y === current.y) {\n continueSameY.push(point);\n } else {\n continueSameY = [point];\n current.y = point.y;\n }\n if (continueSameX.length > 2) {\n var removeIdx = points.indexOf(continueSameX[1]);\n if (removeIdx > -1) points.splice(removeIdx, 1);\n continue;\n }\n if (continueSameY.length > 2) {\n var removeIdx = points.indexOf(continueSameY[1]);\n if (removeIdx > -1) points.splice(removeIdx, 1);\n }\n }\n return points;\n};\n/**\n * sorted array ascendly\n * add new item to proper index when calling add\n */\nvar SortedArray = /** @class */function () {\n function SortedArray() {\n this.arr = [];\n this.map = {};\n this.arr = [];\n this.map = {};\n }\n SortedArray.prototype._innerAdd = function (item, length) {\n var idxRange = [0, length - 1];\n while (idxRange[1] - idxRange[0] > 1) {\n var midIdx = Math.floor((idxRange[0] + idxRange[1]) / 2);\n if (this.arr[midIdx].value > item.value) {\n idxRange[1] = midIdx;\n } else if (this.arr[midIdx].value < item.value) {\n idxRange[0] = midIdx;\n } else {\n this.arr.splice(midIdx, 0, item);\n this.map[item.id] = true;\n return;\n }\n }\n this.arr.splice(idxRange[1], 0, item);\n this.map[item.id] = true;\n };\n SortedArray.prototype.add = function (item) {\n // 已经存在,先移除\n delete this.map[item.id];\n var length = this.arr.length;\n if (!length) {\n this.arr.push(item);\n this.map[item.id] = true;\n return;\n }\n // 比最后一个大,加入尾部\n if (this.arr[length - 1].value < item.value) {\n this.arr.push(item);\n this.map[item.id] = true;\n return;\n }\n this._innerAdd(item, length);\n };\n // only remove from the map to avoid cost\n // clear the invalid (not in the map) item when calling minId(true)\n SortedArray.prototype.remove = function (id) {\n if (!this.map[id]) return;\n delete this.map[id];\n };\n SortedArray.prototype._clearAndGetMinId = function () {\n var res;\n for (var i = this.arr.length - 1; i >= 0; i--) {\n if (this.map[this.arr[i].id]) res = this.arr[i].id;else this.arr.splice(i, 1);\n }\n return res;\n };\n SortedArray.prototype._findFirstId = function () {\n while (this.arr.length) {\n var first = this.arr.shift();\n if (this.map[first.id]) return first.id;\n }\n };\n SortedArray.prototype.minId = function (clear) {\n if (clear) {\n return this._clearAndGetMinId();\n } else {\n return this._findFirstId();\n }\n };\n return SortedArray;\n}();\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/edges/polyline-util.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/glslang.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/glslang.js ***! - \*****************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-element/es/edges/polyline.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/edges/polyline.js ***! + \************************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _utils_dom__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../utils/dom */ \"./node_modules/@antv/g-webgpu-engine/es/utils/dom.js\");\n\n\n\nvar glslang;\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () {\n return _ref.apply(this, arguments);\n});\n\nfunction _ref() {\n _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!glslang) {\n _context.next = 2;\n break;\n }\n\n return _context.abrupt(\"return\", glslang);\n\n case 2:\n _context.next = 4;\n return Object(_utils_dom__WEBPACK_IMPORTED_MODULE_2__[\"loadScriptAsync\"])('https://preview.babylonjs.com/glslang/glslang.js');\n\n case 4:\n glslang = window.glslang('https://preview.babylonjs.com/glslang/glslang.wasm');\n return _context.abrupt(\"return\", glslang);\n\n case 6:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n return _ref.apply(this, arguments);\n}\n//# sourceMappingURL=glslang.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/glslang.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _polyline_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./polyline-util */ \"./node_modules/@antv/g6-element/es/edges/polyline-util.js\");\n/* harmony import */ var _router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./router */ \"./node_modules/@antv/g6-element/es/edges/router.js\");\n\n\n\n\n\n// 折线\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"registerEdge\"])('polyline', {\n options: {\n color: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.color,\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.size,\n style: {\n radius: 0,\n offset: 15,\n x: 0,\n y: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.style.stroke,\n lineAppendWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.style.lineAppendWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].edgeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].edgeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].windowFontFamily\n }\n },\n routeCfg: {\n obstacles: [],\n maxAllowedDirectionChange: Math.PI,\n maximumLoops: 500,\n gridSize: 10 // 指定精度\n },\n\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].edgeStateStyles)\n },\n shapeType: 'polyline',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var shapeStyle = this.getShapeStyle(cfg);\n if (shapeStyle.radius === 0) delete shapeStyle.radius;\n var keyShape = group.addShape('path', {\n className: 'edge-shape',\n name: 'edge-shape',\n attrs: shapeStyle\n });\n group['shapeMap']['edge-shape'] = keyShape;\n return keyShape;\n },\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = this.options.style;\n var strokeStyle = {\n stroke: cfg.color\n };\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle, cfg.style);\n cfg = this.getPathPoints(cfg);\n this.radius = style.radius;\n this.offset = style.offset;\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var controlPoints = this.getControlPoints(cfg);\n var points = [startPoint]; // 添加起始点\n // 添加控制点\n if (controlPoints) {\n points = points.concat(controlPoints);\n }\n // 添加结束点\n points.push(endPoint);\n var source = cfg.sourceNode;\n var target = cfg.targetNode;\n var radius = style.radius;\n var defaultRouteCfg = this.options.routeCfg;\n var routeCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultRouteCfg, cfg.routeCfg);\n routeCfg.offset = style.offset;\n var path = this.getPath(points, source, target, radius, routeCfg, !Boolean(controlPoints));\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(path) && path.length <= 1 || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(path) && path.indexOf('L') === -1) {\n path = 'M0 0, L0 0';\n }\n if (isNaN(startPoint.x) || isNaN(startPoint.y) || isNaN(endPoint.x) || isNaN(endPoint.y)) {\n path = 'M0 0, L0 0';\n }\n var attrs = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.style, style, {\n lineWidth: cfg.size,\n path: path\n });\n return attrs;\n },\n updateShapeStyle: function updateShapeStyle(cfg, item) {\n var group = item.getContainer();\n if (!item.isVisible()) return;\n var strokeStyle = {\n stroke: cfg.color\n };\n var shape = group['shapeMap']['edge-shape'] || group.find(function (element) {\n return element.get('className') === 'edge-shape';\n }) || item.getKeyShape();\n var size = cfg.size;\n cfg = this.getPathPoints(cfg);\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var controlPoints = this.getControlPoints(cfg); // || cfg.controlPoints;\n var points = [startPoint]; // 添加起始点\n // 添加控制点\n if (controlPoints) {\n points = points.concat(controlPoints);\n }\n // 添加结束点\n points.push(endPoint);\n var currentAttr = shape.attr();\n var previousStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, strokeStyle, currentAttr, cfg.style);\n var source = cfg.sourceNode;\n var target = cfg.targetNode;\n var radius = previousStyle.radius;\n var defaultRouteCfg = this.options.routeCfg;\n var routeCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultRouteCfg, cfg.routeCfg);\n routeCfg.offset = previousStyle.offset;\n var path = this.getPath(points, source, target, radius, routeCfg, !Boolean(controlPoints));\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(path) && path.length <= 1 || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(path) && path.indexOf('L') === -1) {\n path = 'M0 0, L0 0';\n }\n if (isNaN(startPoint.x) || isNaN(startPoint.y) || isNaN(endPoint.x) || isNaN(endPoint.y)) {\n path = 'M0 0, L0 0';\n }\n if (currentAttr.endArrow && previousStyle.endArrow === false) {\n cfg.style.endArrow = {\n path: ''\n };\n }\n if (currentAttr.startArrow && previousStyle.startArrow === false) {\n cfg.style.startArrow = {\n path: ''\n };\n }\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(strokeStyle, shape.attr(), {\n lineWidth: size,\n path: path\n }, cfg.style);\n if (shape) {\n shape.attr(style);\n }\n },\n getPath: function getPath(points, source, target, radius, routeCfg, auto) {\n var offset = routeCfg.offset,\n obstacles = routeCfg.obstacles;\n var simple = routeCfg.simple;\n // 指定了控制点\n if (!offset || points.length > 2 || auto === false) {\n if (radius) {\n return Object(_polyline_util__WEBPACK_IMPORTED_MODULE_3__[\"getPathWithBorderRadiusByPolyline\"])(points, radius);\n }\n var pathArray_1 = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points, function (point, index) {\n if (index === 0) {\n pathArray_1.push(['M', point.x, point.y]);\n } else {\n pathArray_1.push(['L', point.x, point.y]);\n }\n });\n return pathArray_1;\n }\n // 未指定控制点\n if (simple !== false && !(obstacles === null || obstacles === void 0 ? void 0 : obstacles.length)) simple = true;\n var polylinePoints = simple ? Object(_polyline_util__WEBPACK_IMPORTED_MODULE_3__[\"getPolylinePoints\"])(points[points.length - 1], points[0], target, source, offset) : Object(_router__WEBPACK_IMPORTED_MODULE_4__[\"pathFinder\"])(points[0], points[points.length - 1], source, target, routeCfg);\n if (!polylinePoints || !polylinePoints.length) return 'M0 0, L0 0';\n if (radius) {\n var res_1 = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_3__[\"getPathWithBorderRadiusByPolyline\"])(polylinePoints, radius);\n return res_1;\n }\n // 去除连续同 x 不同 y 的中间点;去除连续同 y 不同 x 的中间点\n polylinePoints = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_3__[\"removeRedundantPoint\"])(polylinePoints);\n var res = _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"Util\"].pointsToPolygon(polylinePoints);\n return res;\n }\n}, 'single-edge');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/edges/polyline.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu-engine/es/webgpu/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu-engine/es/webgpu/index.js ***! - \***************************************************************/ -/*! exports provided: WebGPUEngine */ +/***/ "./node_modules/@antv/g6-element/es/edges/router.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/edges/router.js ***! + \**********************************************************/ +/*! exports provided: octolinearCfg, pathFinder */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"WebGPUEngine\", function() { return WebGPUEngine; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _glslang__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./glslang */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/glslang.js\");\n/* harmony import */ var _WebGPUAttribute__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./WebGPUAttribute */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUAttribute.js\");\n/* harmony import */ var _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./WebGPUBuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUBuffer.js\");\n/* harmony import */ var _WebGPUComputeModel__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./WebGPUComputeModel */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUComputeModel.js\");\n/* harmony import */ var _WebGPUElements__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./WebGPUElements */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUElements.js\");\n/* harmony import */ var _WebGPUFramebuffer__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./WebGPUFramebuffer */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUFramebuffer.js\");\n/* harmony import */ var _WebGPUModel__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./WebGPUModel */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUModel.js\");\n/* harmony import */ var _WebGPUTexture2D__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./WebGPUTexture2D */ \"./node_modules/@antv/g-webgpu-engine/es/webgpu/WebGPUTexture2D.js\");\n\n\n\n\n\nvar _dec, _class, _temp;\n\n/**\n * implements renderService with WebGPU API\n * @see https://webgpu.io/\n * @see https://github.com/BabylonJS/Babylon.js/blob/WebGPU/src/Engines/webgpuEngine.ts\n */\n // import { Glslang } from '@webgpu/glslang/dist/web-devel/glslang.onefile';\n\n\n\n\n\n\n\n\n\n\n\nvar WebGPUEngine = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"injectable\"])(), _dec(_class = (_temp = /*#__PURE__*/function () {\n function WebGPUEngine() {\n var _this = this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, WebGPUEngine);\n\n this.supportWebGPU = true;\n this.useWGSL = false;\n this.options = void 0;\n this.canvas = void 0;\n this.context = void 0;\n this.glslang = void 0;\n this.adapter = void 0;\n this.device = void 0;\n this.swapChain = void 0;\n this.mainPassSampleCount = void 0;\n this.mainTexture = void 0;\n this.depthTexture = void 0;\n this.mainColorAttachments = void 0;\n this.mainTextureExtends = void 0;\n this.mainDepthAttachment = void 0;\n this.uploadEncoder = void 0;\n this.renderEncoder = void 0;\n this.computeEncoder = void 0;\n this.renderTargetEncoder = void 0;\n this.commandBuffers = new Array(4).fill(undefined);\n this.currentRenderPass = null;\n this.mainRenderPass = null;\n this.currentRenderTargetViewDescriptor = void 0;\n this.currentComputePass = null;\n this.bundleEncoder = void 0;\n this.tempBuffers = [];\n this.currentRenderTarget = null;\n this.uploadEncoderDescriptor = {\n label: 'upload'\n };\n this.renderEncoderDescriptor = {\n label: 'render'\n };\n this.renderTargetEncoderDescriptor = {\n label: 'renderTarget'\n };\n this.computeEncoderDescriptor = {\n label: 'compute'\n };\n this.pipelines = {};\n this.computePipelines = {};\n this.defaultSampleCount = 4;\n this.clearDepthValue = 1;\n this.clearStencilValue = 0;\n this.transientViewport = {\n x: Infinity,\n y: 0,\n width: 0,\n height: 0\n };\n this.cachedViewport = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n\n this.clear = function (options) {\n var framebuffer = options.framebuffer,\n color = options.color,\n depth = options.depth,\n stencil = options.stencil;\n\n if (_this.options.supportCompute) {\n _this.startComputePass();\n } // We need to recreate the render pass so that the new parameters for clear color / depth / stencil are taken into account\n\n\n if (_this.currentRenderTarget) {\n if (_this.currentRenderPass) {\n _this.endRenderTargetRenderPass();\n }\n\n _this.startRenderTargetRenderPass(_this.currentRenderTarget, color ? color : null, !!depth, !!stencil);\n } else {\n // if (this.useReverseDepthBuffer) {\n // this._depthCullingState.depthFunc = Constants.GREATER;\n // }\n _this.mainColorAttachments[0].loadValue = color ? color : _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"LoadOp\"].Load;\n _this.mainDepthAttachment.depthLoadValue = depth ? depth : _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"LoadOp\"].Load;\n _this.mainDepthAttachment.stencilLoadValue = stencil ? _this.clearStencilValue : _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"LoadOp\"].Load;\n\n if (_this.mainRenderPass) {\n _this.endMainRenderPass();\n }\n\n _this.startMainRenderPass();\n }\n };\n\n this.createModel = /*#__PURE__*/function () {\n var _ref = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee(options) {\n var model;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n model = new _WebGPUModel__WEBPACK_IMPORTED_MODULE_13__[\"default\"](_this, options);\n _context.next = 3;\n return model.init();\n\n case 3:\n return _context.abrupt(\"return\", model);\n\n case 4:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee);\n }));\n\n return function (_x) {\n return _ref.apply(this, arguments);\n };\n }();\n\n this.createAttribute = function (options) {\n return new _WebGPUAttribute__WEBPACK_IMPORTED_MODULE_8__[\"default\"](_this, options);\n };\n\n this.createBuffer = function (options) {\n return new _WebGPUBuffer__WEBPACK_IMPORTED_MODULE_9__[\"default\"](_this, options);\n };\n\n this.createElements = function (options) {\n return new _WebGPUElements__WEBPACK_IMPORTED_MODULE_11__[\"default\"](_this, options);\n };\n\n this.createTexture2D = function (options) {\n return new _WebGPUTexture2D__WEBPACK_IMPORTED_MODULE_14__[\"default\"](_this, options);\n };\n\n this.createFramebuffer = function (options) {\n return new _WebGPUFramebuffer__WEBPACK_IMPORTED_MODULE_12__[\"default\"](_this, options);\n };\n\n this.useFramebuffer = function (framebuffer, drawCommands) {\n // bind\n if (_this.currentRenderTarget) {\n _this.unbindFramebuffer(_this.currentRenderTarget);\n }\n\n _this.currentRenderTarget = framebuffer; // TODO: use mipmap options in framebuffer\n\n _this.currentRenderTargetViewDescriptor = {\n dimension: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureViewDimension\"].E2d,\n // mipLevelCount: bindWithMipMaps ? WebGPUTextureHelper.computeNumMipmapLevels(texture.width, texture.height) - lodLevel : 1,\n // baseArrayLayer: faceIndex,\n // baseMipLevel: lodLevel,\n arrayLayerCount: 1,\n aspect: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureAspect\"].All\n };\n _this.currentRenderPass = null;\n drawCommands();\n };\n\n this.createComputeModel = /*#__PURE__*/function () {\n var _ref2 = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2(context) {\n var model;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n model = new _WebGPUComputeModel__WEBPACK_IMPORTED_MODULE_10__[\"default\"](_this, context);\n _context2.next = 3;\n return model.init();\n\n case 3:\n return _context2.abrupt(\"return\", model);\n\n case 4:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2);\n }));\n\n return function (_x2) {\n return _ref2.apply(this, arguments);\n };\n }();\n\n this.getCanvas = function () {\n return _this.canvas;\n };\n\n this.getGLContext = function () {\n throw new Error('Method not implemented.');\n };\n\n this.viewport = function (_ref3) {\n var x = _ref3.x,\n y = _ref3.y,\n width = _ref3.width,\n height = _ref3.height;\n\n if (!_this.currentRenderPass) {\n // call viewport() before current render pass created\n _this.transientViewport = {\n x: x,\n y: y,\n width: width,\n height: height\n };\n } else if (_this.transientViewport.x !== Infinity) {\n var renderPass = _this.getCurrentRenderPass(); // @see https://gpuweb.github.io/gpuweb/#dom-gpurenderpassencoder-setviewport\n\n\n renderPass.setViewport(_this.transientViewport.x, _this.transientViewport.y, _this.transientViewport.width, _this.transientViewport.height, 0, 1);\n } else if (x !== _this.cachedViewport.x || y !== _this.cachedViewport.y || width !== _this.cachedViewport.width || height !== _this.cachedViewport.height) {\n _this.cachedViewport = {\n x: x,\n y: y,\n width: width,\n height: height\n };\n\n var _renderPass = _this.getCurrentRenderPass();\n\n _renderPass.setViewport(x, y, width, height, 0, 1);\n }\n };\n\n this.readPixels = function (options) {\n throw new Error('Method not implemented.');\n };\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(WebGPUEngine, [{\n key: \"isFloatSupported\",\n value: function isFloatSupported() {\n return true;\n }\n }, {\n key: \"init\",\n value: function () {\n var _init = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3(config) {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n this.canvas = config.canvas;\n this.options = config;\n this.useWGSL = !!config.useWGSL;\n this.mainPassSampleCount = config.antialiasing ? this.defaultSampleCount : 1;\n _context3.next = 6;\n return this.initGlslang();\n\n case 6:\n this.initContextAndSwapChain();\n this.initMainAttachments();\n\n case 8:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function init(_x3) {\n return _init.apply(this, arguments);\n }\n\n return init;\n }()\n }, {\n key: \"setScissor\",\n value: function setScissor(scissor) {\n throw new Error('Method not implemented.');\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n if (this.mainTexture) {\n this.mainTexture.destroy();\n }\n\n if (this.depthTexture) {\n this.depthTexture.destroy();\n }\n\n this.tempBuffers.forEach(function (buffer) {\n return buffer.destroy();\n });\n this.tempBuffers = [];\n }\n }, {\n key: \"beginFrame\",\n value: function beginFrame() {\n this.uploadEncoder = this.device.createCommandEncoder(this.uploadEncoderDescriptor);\n this.renderEncoder = this.device.createCommandEncoder(this.renderEncoderDescriptor);\n this.renderTargetEncoder = this.device.createCommandEncoder(this.renderTargetEncoderDescriptor);\n\n if (this.options.supportCompute) {\n this.computeEncoder = this.device.createCommandEncoder(this.computeEncoderDescriptor);\n }\n }\n }, {\n key: \"endFrame\",\n value: function endFrame() {\n if (this.options.supportCompute) {\n this.endComputePass();\n }\n\n this.endMainRenderPass();\n this.commandBuffers[0] = this.uploadEncoder.finish();\n this.commandBuffers[1] = this.renderEncoder.finish();\n\n if (this.options.supportCompute) {\n this.commandBuffers[2] = this.computeEncoder.finish();\n }\n\n this.commandBuffers[3] = this.renderTargetEncoder.finish();\n\n if (_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"]) {\n this.device // @ts-ignore\n .getQueue().submit(this.commandBuffers.filter(function (buffer) {\n return buffer;\n }));\n } else {\n this.device.defaultQueue.submit(this.commandBuffers.filter(function (buffer) {\n return buffer;\n }));\n }\n }\n }, {\n key: \"getCurrentRenderPass\",\n value: function getCurrentRenderPass() {\n if (this.currentRenderTarget && !this.currentRenderPass) {\n this.startRenderTargetRenderPass(this.currentRenderTarget, null, false, false);\n } else if (!this.currentRenderPass) {\n this.startMainRenderPass();\n }\n\n return this.currentRenderPass;\n }\n }, {\n key: \"initGlslang\",\n value: function () {\n var _initGlslang = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee4() {\n var _navigator, _navigator$gpu;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee4$(_context4) {\n while (1) {\n switch (_context4.prev = _context4.next) {\n case 0:\n _context4.next = 2;\n return Object(_glslang__WEBPACK_IMPORTED_MODULE_7__[\"default\"])();\n\n case 2:\n this.glslang = _context4.sent;\n _context4.next = 5;\n return (_navigator = navigator) === null || _navigator === void 0 ? void 0 : (_navigator$gpu = _navigator.gpu) === null || _navigator$gpu === void 0 ? void 0 : _navigator$gpu.requestAdapter();\n\n case 5:\n this.adapter = _context4.sent;\n _context4.next = 8;\n return this.adapter.requestDevice();\n\n case 8:\n this.device = _context4.sent;\n\n case 9:\n case \"end\":\n return _context4.stop();\n }\n }\n }, _callee4, this);\n }));\n\n function initGlslang() {\n return _initGlslang.apply(this, arguments);\n }\n\n return initGlslang;\n }()\n }, {\n key: \"initContextAndSwapChain\",\n value: function initContextAndSwapChain() {\n this.context = this.canvas.getContext(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"] ? 'gpu' : 'gpupresent');\n this.swapChain = this.context.configureSwapChain({\n device: this.device,\n format: this.options.swapChainFormat,\n usage: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureUsage\"].OutputAttachment | _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureUsage\"].CopySrc\n });\n }\n }, {\n key: \"initMainAttachments\",\n value: function initMainAttachments() {\n this.mainTextureExtends = {\n width: this.canvas.width,\n height: this.canvas.height,\n depth: 1\n };\n\n if (this.options.antialiasing) {\n var mainTextureDescriptor = {\n size: this.mainTextureExtends,\n // TODO: arrayLayerCount is deprecated: use size.depth\n // arrayLayerCount: 1,\n mipLevelCount: 1,\n sampleCount: this.mainPassSampleCount,\n dimension: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureDimension\"].E2d,\n format: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureFormat\"].BGRA8Unorm,\n usage: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureUsage\"].OutputAttachment\n };\n\n if (this.mainTexture) {\n this.mainTexture.destroy();\n }\n\n this.mainTexture = this.device.createTexture(mainTextureDescriptor);\n this.mainColorAttachments = [{\n attachment: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"] ? // @ts-ignore\n this.mainTexture.createDefaultView() : this.mainTexture.createView(),\n loadValue: [0, 0, 0, 1],\n storeOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"StoreOp\"].Store\n }];\n } else {\n this.mainColorAttachments = [{\n attachment: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"] ? // @ts-ignore\n this.swapChain.getCurrentTexture().createDefaultView() : this.swapChain.getCurrentTexture().createView(),\n loadValue: [0, 0, 0, 1],\n storeOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"StoreOp\"].Store\n }];\n }\n\n var depthTextureDescriptor = {\n size: this.mainTextureExtends,\n // arrayLayerCount: 1,\n mipLevelCount: 1,\n sampleCount: this.mainPassSampleCount,\n dimension: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureDimension\"].E2d,\n format: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"] ? 'depth32float-stencil8' : _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureFormat\"].Depth24PlusStencil8,\n usage: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"TextureUsage\"].OutputAttachment\n };\n\n if (this.depthTexture) {\n this.depthTexture.destroy();\n }\n\n this.depthTexture = this.device.createTexture( // @ts-ignore\n depthTextureDescriptor);\n this.mainDepthAttachment = {\n attachment: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"] ? // @ts-ignore\n this.depthTexture.createDefaultView() : this.depthTexture.createView(),\n depthLoadValue: this.clearDepthValue,\n depthStoreOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"StoreOp\"].Store,\n stencilLoadValue: this.clearStencilValue,\n stencilStoreOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"StoreOp\"].Store\n };\n }\n }, {\n key: \"startComputePass\",\n value: function startComputePass() {\n if (this.currentComputePass) {\n this.endComputePass();\n }\n\n this.currentComputePass = this.computeEncoder.beginComputePass();\n }\n }, {\n key: \"startMainRenderPass\",\n value: function startMainRenderPass() {\n if (this.currentRenderPass && !this.currentRenderTarget) {\n this.endMainRenderPass();\n } // Resolve in case of MSAA\n\n\n if (this.options.antialiasing) {\n this.mainColorAttachments[0].resolveTarget = _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"] ? // @ts-ignore\n this.swapChain.getCurrentTexture().createDefaultView() : this.swapChain.getCurrentTexture().createView();\n } else {\n this.mainColorAttachments[0].attachment = _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_4__[\"isSafari\"] ? // @ts-ignore\n this.swapChain.getCurrentTexture().createDefaultView() : this.swapChain.getCurrentTexture().createView();\n }\n\n this.currentRenderPass = this.renderEncoder.beginRenderPass({\n colorAttachments: this.mainColorAttachments,\n depthStencilAttachment: this.mainDepthAttachment // TODO: use framebuffer's depth & stencil\n\n });\n this.mainRenderPass = this.currentRenderPass;\n\n if (this.cachedViewport) {\n this.viewport(this.cachedViewport);\n }\n }\n }, {\n key: \"startRenderTargetRenderPass\",\n value: function startRenderTargetRenderPass(renderTarget, clearColor, clearDepth) {\n var _renderTarget$get$col, _renderTarget$get$dep;\n\n var clearStencil = arguments.length > 3 && arguments[3] !== undefined ? arguments[3] : false;\n var gpuTexture = (_renderTarget$get$col = renderTarget.get().color) === null || _renderTarget$get$col === void 0 ? void 0 : _renderTarget$get$col.texture;\n var colorTextureView;\n\n if (gpuTexture) {\n colorTextureView = gpuTexture.createView(this.currentRenderTargetViewDescriptor);\n }\n\n var depthStencilTexture = (_renderTarget$get$dep = renderTarget.get().depth) === null || _renderTarget$get$dep === void 0 ? void 0 : _renderTarget$get$dep.texture;\n var depthStencilTextureView;\n\n if (depthStencilTexture) {\n depthStencilTextureView = depthStencilTexture.createView();\n }\n\n var renderPass = this.renderTargetEncoder.beginRenderPass({\n colorAttachments: [{\n attachment: colorTextureView,\n loadValue: clearColor !== null ? clearColor : _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"LoadOp\"].Load,\n storeOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"StoreOp\"].Store\n }],\n depthStencilAttachment: depthStencilTexture && depthStencilTextureView ? {\n attachment: depthStencilTextureView,\n depthLoadValue: clearDepth ? this.clearDepthValue : _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"LoadOp\"].Load,\n depthStoreOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"StoreOp\"].Store,\n stencilLoadValue: clearStencil ? this.clearStencilValue : _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"LoadOp\"].Load,\n stencilStoreOp: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_5__[\"StoreOp\"].Store\n } : undefined\n });\n this.currentRenderPass = renderPass;\n\n if (this.cachedViewport) {\n this.viewport(this.cachedViewport);\n } // TODO WEBGPU set the scissor rect and the stencil reference value\n\n }\n }, {\n key: \"endMainRenderPass\",\n value: function endMainRenderPass() {\n if (this.currentRenderPass === this.mainRenderPass && this.currentRenderPass !== null) {\n this.currentRenderPass.endPass();\n this.resetCachedViewport();\n this.currentRenderPass = null;\n this.mainRenderPass = null;\n }\n }\n }, {\n key: \"endComputePass\",\n value: function endComputePass() {\n if (this.currentComputePass) {\n this.currentComputePass.endPass();\n this.currentComputePass = null;\n }\n }\n }, {\n key: \"endRenderTargetRenderPass\",\n value: function endRenderTargetRenderPass() {\n if (this.currentRenderPass) {\n this.currentRenderPass.endPass();\n this.resetCachedViewport();\n }\n }\n }, {\n key: \"resetCachedViewport\",\n value: function resetCachedViewport() {\n this.cachedViewport = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n }\n }, {\n key: \"unbindFramebuffer\",\n value: function unbindFramebuffer(framebuffer) {\n // unbind\n if (this.currentRenderPass && this.currentRenderPass !== this.mainRenderPass) {\n this.endRenderTargetRenderPass();\n }\n\n this.transientViewport.x = Infinity;\n this.currentRenderTarget = null; // if (texture.generateMipMaps && !disableGenerateMipMaps && !texture.isCube) {\n // this._generateMipmaps(texture);\n // }\n\n this.currentRenderPass = this.mainRenderPass;\n }\n }]);\n\n return WebGPUEngine;\n}(), _temp)) || _class);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu-engine/es/webgpu/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"octolinearCfg\", function() { return octolinearCfg; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pathFinder\", function() { return pathFinder; });\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _polyline_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./polyline-util */ \"./node_modules/@antv/g6-element/es/edges/polyline-util.js\");\n/**\n * 通过配置不同的 costFunc, distFunc, constraints 可以得到不同效果的 router\n * generalRouter: 不限制搜索时的移动方向,避开障碍即可\n * orthogonal: 线必须沿着竖直或水平方向(4个方向)\n * octolinearRouter: 线沿着竖直、水平、对角线方向(8个方向)\n */\n\n\n\nvar manhattanDist = function manhattanDist(p1, p2) {\n return Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y);\n};\nvar eucliDist = function eucliDist(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n};\nvar straightPath = function straightPath(start, end) {\n // console.warn('fallbackRoute: straight path');\n return [start, end];\n};\nvar simplePolyline = function simplePolyline(start, end, startNode, endNode, cfg) {\n return Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"simplifyPolyline\"])(Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"getPolylinePoints\"])(start, end, startNode, endNode, cfg.offset));\n};\n// getPolylinePoints\nvar defaultCfg = {\n offset: 20,\n maxAllowedDirectionChange: Math.PI / 2,\n maximumLoops: 2000,\n gridSize: 10,\n directions: [{\n stepX: 1,\n stepY: 0\n }, {\n stepX: -1,\n stepY: 0\n }, {\n stepX: 0,\n stepY: 1\n }, {\n stepX: 0,\n stepY: -1\n } // top\n ],\n\n get penalties() {\n return {\n 0: 0,\n 45: this.gridSize / 2,\n 90: this.gridSize / 2\n };\n },\n distFunc: manhattanDist,\n fallbackRoute: simplePolyline\n};\nvar octolinearCfg = {\n maxAllowedDirectionChange: Math.PI / 4,\n // 8 个方向: 上下左右 + 45度斜线方向\n directions: [{\n stepX: 1,\n stepY: 0\n }, {\n stepX: 1,\n stepY: 1\n }, {\n stepX: 0,\n stepY: 1\n }, {\n stepX: -1,\n stepY: 1\n }, {\n stepX: -1,\n stepY: 0\n }, {\n stepX: -1,\n stepY: -1\n }, {\n stepX: 0,\n stepY: -1\n }, {\n stepX: 1,\n stepY: -1\n }],\n distFunc: eucliDist,\n fallbackRoute: straightPath\n};\nvar pos2GridIx = function pos2GridIx(pos, gridSize) {\n var gridIx = Math.round(Math.abs(pos / gridSize));\n var sign = pos < 0 ? -1 : 1;\n return gridIx < 0 ? 0 : sign * gridIx;\n};\nvar getObstacleMap = function getObstacleMap(items, gridSize, offset) {\n var map = {};\n items.forEach(function (item) {\n // create-edge 时,当边类型为 polyline 时 endNode 为 null\n if (!item) return;\n var bbox = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"getExpandedBBox\"])(item.getBBox(), offset);\n for (var x = pos2GridIx(bbox.minX, gridSize); x <= pos2GridIx(bbox.maxX, gridSize); x += 1) {\n for (var y = pos2GridIx(bbox.minY, gridSize); y <= pos2GridIx(bbox.maxY, gridSize); y += 1) {\n map[\"\".concat(x, \"|||\").concat(y)] = true;\n }\n }\n });\n return map;\n};\n/**\n * 方向角:计算从 p1 到 p2 的射线与水平线形成的夹角度数(顺时针从右侧0°转到该射线的角度)\n * @param p1 PolyPoint\n * @param p2 PolyPoint\n */\nvar getDirectionAngle = function getDirectionAngle(p1, p2) {\n var deltaX = p2.x - p1.x;\n var deltaY = p2.y - p1.y;\n if (deltaX || deltaY) {\n return Math.atan2(deltaY, deltaX);\n }\n return 0;\n};\n/**\n * 方向角的改变,取小于180度角\n * @param angle1\n * @param angle2\n */\nvar getAngleDiff = function getAngleDiff(angle1, angle2) {\n var directionChange = Math.abs(angle1 - angle2);\n return directionChange > Math.PI ? 2 * Math.PI - directionChange : directionChange;\n // return directionChange > 180 ? 360 - directionChange : directionChange;\n};\n// Path finder //\nvar estimateCost = function estimateCost(from, endPoints, distFunc) {\n var min = Infinity;\n for (var i = 0, len = endPoints.length; i < len; i++) {\n var cost = distFunc(from, endPoints[i]);\n if (cost < min) {\n min = cost;\n }\n }\n return min;\n};\n// 计算考虑 offset 后的 BBox 上的连接点\nvar getBoxPoints = function getBoxPoints(point,\n// 被 gridSize 格式化后的位置(anchorPoint)\noriPoint,\n// 未被 gridSize 格式化的位置(anchorPoint)\nnode,\n// 原始节点,用于获取 bbox\nanotherPoint,\n// 另一端被 gridSize 格式化后的位置\ncfg) {\n var points = [];\n // create-edge 生成边的过程中,endNode 为 null\n if (!node) {\n return [point];\n }\n var directions = cfg.directions,\n offset = cfg.offset;\n var bbox = node.getBBox();\n var isInside = oriPoint.x > bbox.minX && oriPoint.x < bbox.maxX && oriPoint.y > bbox.minY && oriPoint.y < bbox.maxY;\n var expandBBox = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"getExpandedBBox\"])(bbox, offset);\n for (var i in expandBBox) {\n expandBBox[i] = pos2GridIx(expandBBox[i], cfg.gridSize);\n }\n if (isInside) {\n // 如果 anchorPoint 在节点内部,允许第一段线穿过节点\n for (var _i = 0, directions_1 = directions; _i < directions_1.length; _i++) {\n var dir = directions_1[_i];\n var bounds = [[{\n x: expandBBox.minX,\n y: expandBBox.minY\n }, {\n x: expandBBox.maxX,\n y: expandBBox.minY\n }], [{\n x: expandBBox.minX,\n y: expandBBox.minY\n }, {\n x: expandBBox.minX,\n y: expandBBox.maxY\n }], [{\n x: expandBBox.maxX,\n y: expandBBox.minY\n }, {\n x: expandBBox.maxX,\n y: expandBBox.maxY\n }], [{\n x: expandBBox.minX,\n y: expandBBox.maxY\n }, {\n x: expandBBox.maxX,\n y: expandBBox.maxY\n }]];\n for (var i = 0; i < 4; i++) {\n var boundLine = bounds[i];\n var insterctP_1 = _antv_g6_core__WEBPACK_IMPORTED_MODULE_0__[\"Util\"].getLineIntersect(point, {\n x: point.x + dir.stepX * expandBBox.width,\n y: point.y + dir.stepY * expandBBox.height\n }, boundLine[0], boundLine[1]);\n if (insterctP_1 && !Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"isSegmentCrossingBBox\"])(point, insterctP_1, bbox)) {\n insterctP_1.id = \"\".concat(insterctP_1.x, \"|||\").concat(insterctP_1.y);\n points.push(insterctP_1);\n }\n }\n }\n return points;\n }\n // 如果 anchorPoint 在节点上,只有一个可选方向\n var insterctP = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"getExpandedBBoxPoint\"])(expandBBox, point, anotherPoint);\n insterctP.id = \"\".concat(insterctP.x, \"|||\").concat(insterctP.y);\n return [insterctP];\n};\nvar getDirectionChange = function getDirectionChange(current, neighbor, cameFrom, scaleStartPoint) {\n var directionAngle = getDirectionAngle(current, neighbor);\n var currentCameFrom = cameFrom[current.id];\n if (!currentCameFrom) {\n var startAngle = getDirectionAngle(scaleStartPoint, current);\n return getAngleDiff(startAngle, directionAngle);\n }\n var prevDirectionAngle = getDirectionAngle({\n x: currentCameFrom.x,\n y: currentCameFrom.y\n }, current);\n return getAngleDiff(prevDirectionAngle, directionAngle);\n};\nvar getControlPoints = function getControlPoints(current, cameFrom, scaleStartPoint, endPoint, startPoint, scaleEndPoint, gridSize) {\n var controlPoints = [endPoint];\n var pointZero = endPoint;\n var currentId = current.id;\n var currentX = current.x;\n var currentY = current.y;\n var lastPoint = {\n x: currentX,\n y: currentY,\n id: currentId\n };\n if (getDirectionChange(lastPoint, scaleEndPoint, cameFrom, scaleStartPoint)) {\n pointZero = {\n x: scaleEndPoint.x === endPoint.x ? endPoint.x : lastPoint.x * gridSize,\n y: scaleEndPoint.y === endPoint.y ? endPoint.y : lastPoint.y * gridSize\n };\n controlPoints.unshift(pointZero);\n }\n var currentCameFrom = cameFrom[currentId];\n while (currentCameFrom && currentCameFrom.id !== currentId) {\n var point = {\n x: currentX,\n y: currentY,\n id: currentId\n };\n var prePoint = {\n x: currentCameFrom.x,\n y: currentCameFrom.y,\n id: currentCameFrom.id\n };\n var directionChange = getDirectionChange(prePoint, point, cameFrom, scaleStartPoint);\n if (directionChange) {\n pointZero = {\n x: prePoint.x === point.x ? pointZero.x : prePoint.x * gridSize,\n y: prePoint.y === point.y ? pointZero.y : prePoint.y * gridSize\n };\n controlPoints.unshift(pointZero);\n }\n currentId = prePoint.id;\n currentX = prePoint.x;\n currentY = prePoint.y;\n currentCameFrom = cameFrom[currentId];\n }\n // 和startNode对齐\n controlPoints[0].x = currentX === scaleStartPoint.x ? startPoint.x : pointZero.x;\n controlPoints[0].y = currentY === scaleStartPoint.y ? startPoint.y : pointZero.y;\n controlPoints.unshift(startPoint);\n return controlPoints;\n};\nvar pathFinder = function pathFinder(startPoint, endPoint, startNode, endNode, routerCfg) {\n if (isNaN(startPoint.x) || isNaN(endPoint.x)) return [];\n var cfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])(defaultCfg, routerCfg);\n cfg.obstacles = cfg.obstacles || [];\n var penalties = cfg.penalties,\n gridSize = cfg.gridSize;\n var map = getObstacleMap(cfg.obstacles.concat([startNode, endNode]), gridSize, cfg.offset);\n var scaleStartPoint = {\n x: pos2GridIx(startPoint.x, gridSize),\n y: pos2GridIx(startPoint.y, gridSize)\n };\n var scaleEndPoint = {\n x: pos2GridIx(endPoint.x, gridSize),\n y: pos2GridIx(endPoint.y, gridSize)\n };\n startPoint.id = \"\".concat(scaleStartPoint.x, \"|||\").concat(scaleStartPoint.y);\n endPoint.id = \"\".concat(scaleEndPoint.x, \"|||\").concat(scaleEndPoint.y);\n var startPoints = getBoxPoints(scaleStartPoint, startPoint, startNode, scaleEndPoint, cfg);\n var endPoints = getBoxPoints(scaleEndPoint, endPoint, endNode, scaleStartPoint, cfg);\n startPoints.forEach(function (point) {\n delete map[point.id];\n });\n endPoints.forEach(function (point) {\n delete map[point.id];\n });\n var openSet = {};\n var closedSet = {};\n var cameFrom = {};\n // 从起点到当前点已产生的 cost, default: Infinity\n var gScore = {};\n // 起点经过当前点到达终点预估的 cost, default: Infinity\n var fScore = {};\n var sortedOpenSet = new _polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"SortedArray\"]();\n // initialize\n for (var i = 0; i < startPoints.length; i++) {\n var firstStep = startPoints[i];\n openSet[firstStep.id] = firstStep;\n gScore[firstStep.id] = 0;\n fScore[firstStep.id] = estimateCost(firstStep, endPoints, cfg.distFunc);\n sortedOpenSet.add({\n id: firstStep.id,\n value: fScore[firstStep.id]\n });\n }\n var remainLoops = cfg.maximumLoops;\n var current, direction, neighbor, neighborCost, costFromStart, directionChange;\n var curCost = Infinity;\n var endPointMap = {};\n endPoints.forEach(function (point) {\n endPointMap[\"\".concat(point.x, \"|||\").concat(point.y)] = true;\n });\n Object.keys(openSet).forEach(function (key) {\n var id = openSet[key].id;\n if (fScore[id] <= curCost) {\n curCost = fScore[id];\n current = openSet[id];\n }\n });\n while (Object.keys(openSet).length > 0 && remainLoops > 0) {\n var minId = sortedOpenSet.minId((remainLoops + 1) % 30 === 0);\n if (minId) {\n current = openSet[minId];\n } else {\n break;\n }\n // 如果 fScore 最小的点就是终点\n if (endPointMap[\"\".concat(current.x, \"|||\").concat(current.y)]) {\n return getControlPoints(current, cameFrom, scaleStartPoint, endPoint, startPoint, scaleEndPoint, gridSize);\n }\n delete openSet[current.id];\n sortedOpenSet.remove(current.id);\n closedSet[current.id] = true;\n // 获取符合条件的下一步的候选连接点\n // 沿候选方向走一步\n for (var i = 0; i < cfg.directions.length; i++) {\n direction = cfg.directions[i];\n var neighborId = \"\".concat(Math.round(current.x) + direction.stepX, \"|||\").concat(Math.round(current.y) + direction.stepY);\n neighbor = {\n x: current.x + direction.stepX,\n y: current.y + direction.stepY,\n id: neighborId\n };\n if (closedSet[neighborId]) continue;\n directionChange = getDirectionChange(current, neighbor, cameFrom, scaleStartPoint);\n if (directionChange > cfg.maxAllowedDirectionChange) continue;\n if (map[neighborId]) continue; // 如果交叉则跳过\n // 将候选点加入 openSet, 并计算每个候选点的 cost\n if (!openSet[neighborId]) {\n openSet[neighborId] = neighbor;\n }\n var directionPenalties = penalties[directionChange];\n neighborCost = cfg.distFunc(current, neighbor) + (isNaN(directionPenalties) ? gridSize : directionPenalties);\n costFromStart = gScore[current.id] + neighborCost;\n var neighborGScore = gScore[neighborId];\n if (neighborGScore && costFromStart >= neighborGScore) {\n continue;\n }\n cameFrom[neighborId] = current;\n gScore[neighborId] = costFromStart;\n fScore[neighborId] = costFromStart + estimateCost(neighbor, endPoints, cfg.distFunc);\n sortedOpenSet.add({\n id: neighborId,\n value: fScore[neighborId]\n });\n }\n remainLoops -= 1;\n }\n return cfg.fallbackRoute(startPoint, endPoint, startNode, endNode, cfg);\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/edges/router.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/Kernel.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/Kernel.js ***! - \**************************************************/ -/*! exports provided: Kernel */ +/***/ "./node_modules/@antv/g6-element/es/index.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/index.js ***! + \***************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Kernel\", function() { return Kernel; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _utils_canvas__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./utils/canvas */ \"./node_modules/@antv/g-webgpu/es/utils/canvas.js\");\n/* harmony import */ var _utils_is_array__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./utils/is-array */ \"./node_modules/@antv/g-webgpu/es/utils/is-array.js\");\n/* harmony import */ var _utils_is_number__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./utils/is-number */ \"./node_modules/@antv/g-webgpu/es/utils/is-number.js\");\n/* harmony import */ var _utils_is_typedarray__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./utils/is-typedarray */ \"./node_modules/@antv/g-webgpu/es/utils/is-typedarray.js\");\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _temp;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_2___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n // tslint:disable-next-line:no-submodule-imports\n\n\n\n\n\n\n\nvar Kernel = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderEngine), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].ConfigService), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function Kernel() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this, Kernel);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"engine\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"configService\", _descriptor2, this);\n\n this.entity = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"createEntity\"])();\n this.model = void 0;\n this.dirty = true;\n this.compiledBundle = void 0;\n this.initPromise = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default()(Kernel, [{\n key: \"init\",\n value: function init() {\n var _this$configService$g = this.configService.get(),\n canvas = _this$configService$g.canvas,\n engineOptions = _this$configService$g.engineOptions;\n\n this.initPromise = this.engine.init(_objectSpread({\n canvas: canvas || Object(_utils_canvas__WEBPACK_IMPORTED_MODULE_11__[\"createCanvas\"])(),\n swapChainFormat: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_9__[\"TextureFormat\"].BGRA8Unorm,\n antialiasing: false\n }, engineOptions));\n }\n }, {\n key: \"setBundle\",\n value: function setBundle(bundle) {\n // deep clone\n this.compiledBundle = JSON.parse(JSON.stringify(bundle));\n }\n }, {\n key: \"setDispatch\",\n value: function setDispatch(dispatch) {\n if (this.compiledBundle.context) {\n this.compiledBundle.context.dispatch = dispatch;\n }\n\n return this;\n }\n }, {\n key: \"setMaxIteration\",\n value: function setMaxIteration(maxIteration) {\n if (this.compiledBundle.context) {\n this.compiledBundle.context.maxIteration = maxIteration;\n }\n\n return this;\n }\n }, {\n key: \"setBinding\",\n value: function setBinding(name, data) {\n var _this = this;\n\n if (typeof name === 'string') {\n var isNumberLikeData = Object(_utils_is_number__WEBPACK_IMPORTED_MODULE_13__[\"isNumber\"])(data) || Object(_utils_is_typedarray__WEBPACK_IMPORTED_MODULE_14__[\"isTypedArray\"])(data) || Object(_utils_is_array__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(data);\n\n if (this.compiledBundle && this.compiledBundle.context) {\n // set define, eg. setBinding('MAX_LENGTH', 10)\n var existedDefine = this.compiledBundle.context.defines.find(function (b) {\n return b.name === name;\n });\n\n if (existedDefine) {\n existedDefine.value = data;\n return this;\n } // set uniform\n\n\n var existedBinding = this.compiledBundle.context.uniforms.find(function (b) {\n return b.name === name;\n });\n\n if (existedBinding) {\n // update uniform or buffer\n if (isNumberLikeData) {\n // @ts-ignore\n existedBinding.data = data;\n existedBinding.isReferer = false;\n\n if (existedBinding.storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"STORAGE_CLASS\"].Uniform) {\n if (this.model) {\n // @ts-ignore\n this.model.updateUniform(name, data);\n }\n } else {\n if (this.model) {\n // @ts-ignore\n this.model.updateBuffer(name, data);\n }\n }\n } else {\n // update with another kernel\n existedBinding.isReferer = true; // @ts-ignore\n\n existedBinding.data = data;\n }\n }\n }\n } else {\n Object.keys(name).forEach(function (key) {\n _this.setBinding(key, name[key]);\n });\n }\n\n return this;\n }\n }, {\n key: \"execute\",\n value: function () {\n var _execute = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var _this2 = this;\n\n var iteration,\n i,\n _args = arguments;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n iteration = _args.length > 0 && _args[0] !== undefined ? _args[0] : 1;\n\n if (!this.dirty) {\n _context.next = 6;\n break;\n }\n\n if (this.compiledBundle.context) {\n if (iteration > 1) {\n this.compiledBundle.context.maxIteration = iteration;\n } else {\n this.compiledBundle.context.maxIteration++;\n }\n }\n\n _context.next = 5;\n return this.compile();\n\n case 5:\n this.dirty = false;\n\n case 6:\n this.engine.beginFrame(); // 首先开启当前 frame 的 compute pass\n\n this.engine.clear({});\n\n if (this.compiledBundle.context) {\n this.compiledBundle.context.uniforms.filter(function (_ref) {\n var isReferer = _ref.isReferer;\n return isReferer;\n }).forEach(function (_ref2) {\n var data = _ref2.data,\n name = _ref2.name;\n\n // @ts-ignore\n _this2.model.confirmInput(data.model, name);\n });\n }\n\n for (i = 0; i < iteration; i++) {\n this.model.run();\n }\n\n this.engine.endFrame();\n return _context.abrupt(\"return\", this);\n\n case 12:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function execute() {\n return _execute.apply(this, arguments);\n }\n\n return execute;\n }()\n /**\n * read output from GPUBuffer\n */\n\n }, {\n key: \"getOutput\",\n value: function () {\n var _getOutput = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2() {\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n return _context2.abrupt(\"return\", this.model.readData());\n\n case 1:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this);\n }));\n\n function getOutput() {\n return _getOutput.apply(this, arguments);\n }\n\n return getOutput;\n }()\n }, {\n key: \"compile\",\n value: function () {\n var _compile = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee3() {\n var context, target, shader;\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee3$(_context3) {\n while (1) {\n switch (_context3.prev = _context3.next) {\n case 0:\n _context3.next = 2;\n return this.initPromise;\n\n case 2:\n context = _objectSpread({}, this.compiledBundle.context);\n target = this.engine.supportWebGPU ? this.engine.useWGSL ? _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"Target\"].WGSL : _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"Target\"].GLSL450 : _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"Target\"].GLSL100;\n shader = this.compiledBundle.shaders[target]; // this.bindings?.forEach(({ name, data }) => {\n // if (name === name.toUpperCase()) {\n // const define = context.defines.find((d) => d.name === name);\n // if (define) {\n // // @ts-ignore\n // define.value = data;\n // }\n // }\n // });\n // 生成运行时 define\n\n context.defines.filter(function (define) {\n return define.runtime;\n }).forEach(function (define) {\n var valuePlaceHolder = \"\".concat(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"DefineValuePlaceholder\"]).concat(define.name);\n shader = shader.replace(valuePlaceHolder, \"\".concat(define.value));\n });\n context.shader = shader; // 添加 uniform 绑定的数据\n\n context.uniforms.forEach(function (uniform) {\n // const binding = this.bindings.find((b) => b.name === uniform.name);\n // if (binding) {\n // // @ts-ignore\n // uniform.data = binding.referer || binding.data;\n // // @ts-ignore\n // uniform.isReferer = !!binding.referer;\n // }\n // 未指定数据,尝试根据 uniform 类型初始化\n if (!uniform.data) {\n if (uniform.storageClass === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"STORAGE_CLASS\"].StorageBuffer) {\n var sizePerElement = 1;\n\n if (uniform.type === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"AST_TOKEN_TYPES\"].FloatArray) {\n sizePerElement = 1;\n } else if (uniform.type === _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"AST_TOKEN_TYPES\"].Vector4FloatArray) {\n sizePerElement = 4;\n }\n\n uniform.data = new Float32Array(context.output.length * sizePerElement).fill(0);\n }\n }\n }); // } else if (uniform.type === 'image2D') {\n // // @ts-ignore\n // buffer.data = new Uint8ClampedArray(context.output.length!).fill(0);\n // }\n\n this.compiledBundle.context = context;\n _context3.next = 11;\n return this.engine.createComputeModel(this.compiledBundle.context);\n\n case 11:\n this.model = _context3.sent;\n\n case 12:\n case \"end\":\n return _context3.stop();\n }\n }\n }, _callee3, this);\n }));\n\n function compile() {\n return _compile.apply(this, arguments);\n }\n\n return compile;\n }()\n }]);\n\n return Kernel;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"engine\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"configService\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=Kernel.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/Kernel.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nodes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nodes */ \"./node_modules/@antv/g6-element/es/nodes/index.js\");\n/* harmony import */ var _edges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edges */ \"./node_modules/@antv/g6-element/es/edges/index.js\");\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/Renderer.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/Renderer.js ***! - \****************************************************/ -/*! exports provided: Renderer */ +/***/ "./node_modules/@antv/g6-element/es/nodes/circle.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/nodes/circle.js ***! + \**********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Renderer\", function() { return Renderer; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_9__);\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _class, _class2, _descriptor, _descriptor2, _descriptor3, _temp;\n\nfunction _createForOfIteratorHelper(o, allowArrayLike) { var it; if (typeof Symbol === \"undefined\" || o[Symbol.iterator] == null) { if (Array.isArray(o) || (it = _unsupportedIterableToArray(o)) || allowArrayLike && o && typeof o.length === \"number\") { if (it) o = it; var i = 0; var F = function F() {}; return { s: F, n: function n() { if (i >= o.length) return { done: true }; return { done: false, value: o[i++] }; }, e: function e(_e) { throw _e; }, f: F }; } throw new TypeError(\"Invalid attempt to iterate non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); } var normalCompletion = true, didErr = false, err; return { s: function s() { it = o[Symbol.iterator](); }, n: function n() { var step = it.next(); normalCompletion = step.done; return step; }, e: function e(_e2) { didErr = true; err = _e2; }, f: function f() { try { if (!normalCompletion && it.return != null) it.return(); } finally { if (didErr) throw err; } } }; }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\n // tslint:disable-next-line:no-submodule-imports\n\n\n\n\n/* babel-plugin-inline-import './material/shaders/map.frag.declaration.glsl' */\nvar mapFragDeclaration = \"#ifdef USE_MAP\\n uniform sampler2D map;\\n#endif\";\n\n/* babel-plugin-inline-import './material/shaders/map.frag.main.glsl' */\nvar mapFragMain = \"#ifdef USE_MAP\\n vec4 texelColor = texture2D(map, vUv);\\n // texelColor = mapTexelToLinear(texelColor);\\n diffuseColor *= texelColor;\\n#endif\";\n\n/* babel-plugin-inline-import './material/shaders/uv.frag.declaration.glsl' */\nvar uvFragDeclaration = \"#if (defined( USE_UV ) && ! defined( UVS_VERTEX_ONLY ))\\n varying vec2 vUv;\\n#endif\";\n\n/* babel-plugin-inline-import './material/shaders/uv.vert.declaration.glsl' */\nvar uvVertDeclaration = \"#ifdef USE_UV\\n attribute vec2 uv;\\n\\t#ifdef UVS_VERTEX_ONLY\\n vec2 vUv;\\n\\t#else\\n\\t\\tvarying vec2 vUv;\\n\\t#endif\\n\\tuniform mat3 uvTransform;\\n#endif\";\n\n/* babel-plugin-inline-import './material/shaders/uv.vert.main.glsl' */\nvar uvVertMain = \"#ifdef USE_UV\\n vUv = (uvTransform * vec3(uv, 1)).xy;\\n#endif\";\nvar Renderer = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_9__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_9__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"IDENTIFIER\"].RenderEngine), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_9__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"IDENTIFIER\"].ShaderModuleService), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_9__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"IDENTIFIER\"].ConfigService), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function Renderer() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, Renderer);\n\n this.container = void 0;\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"engine\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"shaderModule\", _descriptor2, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(this, \"configService\", _descriptor3, this);\n\n this.inited = false;\n this.rendering = false;\n this.pendings = [];\n this.views = [];\n this.size = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(Renderer, [{\n key: \"init\",\n value: function () {\n var _init = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var systems, config, _iterator, _step, system;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n // 模块化处理\n this.shaderModule.registerBuiltinModules();\n this.shaderModule.registerModule('uv.vert.declaration', {\n vs: uvVertDeclaration\n });\n this.shaderModule.registerModule('uv.vert.main', {\n vs: uvVertMain\n });\n this.shaderModule.registerModule('uv.frag.declaration', {\n fs: uvFragDeclaration\n });\n this.shaderModule.registerModule('map.frag.declaration', {\n fs: mapFragDeclaration\n });\n this.shaderModule.registerModule('map.frag.main', {\n fs: mapFragMain\n });\n systems = this.container.getAll(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"IDENTIFIER\"].Systems);\n config = this.configService.get();\n\n if (!config.canvas) {\n _context.next = 30;\n break;\n }\n\n _context.next = 11;\n return this.engine.init({\n canvas: config.canvas,\n swapChainFormat: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_8__[\"TextureFormat\"].BGRA8Unorm,\n antialiasing: false\n });\n\n case 11:\n _iterator = _createForOfIteratorHelper(systems);\n _context.prev = 12;\n\n _iterator.s();\n\n case 14:\n if ((_step = _iterator.n()).done) {\n _context.next = 21;\n break;\n }\n\n system = _step.value;\n\n if (!system.initialize) {\n _context.next = 19;\n break;\n }\n\n _context.next = 19;\n return system.initialize();\n\n case 19:\n _context.next = 14;\n break;\n\n case 21:\n _context.next = 26;\n break;\n\n case 23:\n _context.prev = 23;\n _context.t0 = _context[\"catch\"](12);\n\n _iterator.e(_context.t0);\n\n case 26:\n _context.prev = 26;\n\n _iterator.f();\n\n return _context.finish(26);\n\n case 29:\n this.inited = true;\n\n case 30:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this, [[12, 23, 26, 29]]);\n }));\n\n function init() {\n return _init.apply(this, arguments);\n }\n\n return init;\n }()\n }, {\n key: \"render\",\n value: function () {\n var _render = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_1___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee2() {\n var systems,\n _len,\n views,\n _key,\n _iterator2,\n _step2,\n system,\n _args2 = arguments;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee2$(_context2) {\n while (1) {\n switch (_context2.prev = _context2.next) {\n case 0:\n if (!(!this.inited || this.rendering)) {\n _context2.next = 2;\n break;\n }\n\n return _context2.abrupt(\"return\");\n\n case 2:\n if (this.pendings.length) {\n this.pendings.forEach(function (pending) {\n pending();\n });\n }\n\n this.rendering = true;\n this.engine.beginFrame();\n systems = this.container.getAll(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_7__[\"IDENTIFIER\"].Systems);\n\n for (_len = _args2.length, views = new Array(_len), _key = 0; _key < _len; _key++) {\n views[_key] = _args2[_key];\n }\n\n _iterator2 = _createForOfIteratorHelper(systems);\n _context2.prev = 8;\n\n _iterator2.s();\n\n case 10:\n if ((_step2 = _iterator2.n()).done) {\n _context2.next = 17;\n break;\n }\n\n system = _step2.value;\n\n if (!system.execute) {\n _context2.next = 15;\n break;\n }\n\n _context2.next = 15;\n return system.execute(views);\n\n case 15:\n _context2.next = 10;\n break;\n\n case 17:\n _context2.next = 22;\n break;\n\n case 19:\n _context2.prev = 19;\n _context2.t0 = _context2[\"catch\"](8);\n\n _iterator2.e(_context2.t0);\n\n case 22:\n _context2.prev = 22;\n\n _iterator2.f();\n\n return _context2.finish(22);\n\n case 25:\n // 录制一遍绘制命令,后续直接播放\n // if (this.useRenderBundle) {\n // if (!this.renderBundleRecorded) {\n // this.engine.startRecordBundle();\n // if (this.onUpdate) {\n // await this.onUpdate(this.engine);\n // }\n // this.renderBundle = this.engine.stopRecordBundle();\n // this.renderBundleRecorded = true;\n // }\n // this.engine.executeBundles([this.renderBundle]);\n // } else {\n // if (this.onUpdate) {\n // await this.onUpdate(this.engine);\n // }\n // }\n this.engine.endFrame();\n this.rendering = false;\n\n case 27:\n case \"end\":\n return _context2.stop();\n }\n }\n }, _callee2, this, [[8, 19, 22, 25]]);\n }));\n\n function render() {\n return _render.apply(this, arguments);\n }\n\n return render;\n }()\n }, {\n key: \"clear\",\n value: function clear(options) {\n var _this = this;\n\n if (this.inited) {\n this.engine.clear(options);\n } else {\n this.pendings.unshift(function () {\n _this.engine.clear(options);\n\n _this.pendings.shift();\n });\n }\n\n return this;\n } // public setScissor(\n // scissor: Partial<{\n // enable: boolean;\n // box: {\n // x: number;\n // y: number;\n // width: number;\n // height: number;\n // };\n // }>,\n // ) {\n // this.engine.setScissor(scissor);\n // return this;\n // }\n\n }, {\n key: \"setSize\",\n value: function setSize(_ref) {\n var width = _ref.width,\n height = _ref.height;\n var canvas = this.engine.getCanvas();\n this.size = {\n width: width,\n height: height\n };\n canvas.width = width;\n canvas.height = height;\n return this;\n }\n }, {\n key: \"getSize\",\n value: function getSize() {\n return this.size;\n }\n }]);\n\n return Renderer;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"engine\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"shaderModule\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_5___default()(_class2.prototype, \"configService\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=Renderer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/Renderer.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n// 带有图标的圆,可用于拓扑图中\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('circle', {\n // 自定义节点时的配置\n options: {\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.size,\n style: {\n x: 0,\n y: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'circle',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n defaultIcon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var icon = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"deepMix\"])({}, defaultIcon, cfg.icon);\n var name = \"\".concat(this.type, \"-keyShape\");\n var keyShape = group.addShape('circle', {\n attrs: style,\n className: name,\n name: name,\n draggable: true\n });\n group['shapeMap'][name] = keyShape;\n var width = icon.width,\n height = icon.height,\n show = icon.show,\n text = icon.text;\n if (show) {\n var iconName = \"\".concat(this.type, \"-icon\");\n if (text) {\n group['shapeMap'][iconName] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: iconName,\n name: iconName,\n draggable: true\n });\n } else {\n group['shapeMap'][iconName] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2\n }, icon),\n className: iconName,\n name: iconName,\n draggable: true\n });\n }\n }\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var linkPoints = (this.mergeStyle || this.getOptions(cfg)).linkPoints;\n if (!linkPoints) return;\n var _a = linkPoints || {},\n top = _a.top,\n left = _a.left,\n right = _a.right,\n bottom = _a.bottom,\n markSize = _a.size,\n markR = _a.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(_a, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n var size = this.getSize(cfg);\n var r = size[0] / 2;\n if (left) {\n // left circle\n var name_1 = 'link-point-left';\n group['shapeMap'][name_1] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -r,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: name_1,\n name: name_1,\n isAnchorPoint: true\n });\n }\n if (right) {\n // right circle\n var name_2 = 'link-point-right';\n group['shapeMap'][name_2] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: r,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: name_2,\n name: name_2,\n isAnchorPoint: true\n });\n }\n if (top) {\n // top circle\n var name_3 = 'link-point-top';\n group['shapeMap'][name_3] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -r,\n r: markSize / 2 || markR || 5\n }),\n className: name_3,\n name: name_3,\n isAnchorPoint: true\n });\n }\n if (bottom) {\n // bottom circle\n var name_4 = 'link-point-bottom';\n group['shapeMap'][name_4] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: r,\n r: markSize / 2 || markR || 5\n }),\n className: name_4,\n name: name_4,\n isAnchorPoint: true\n });\n }\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"deepMix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var r = size[0] / 2;\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n r: r\n }, style);\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer();\n var size = this.getSize(cfg);\n var style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, cfg.style);\n if (cfg.style.stroke === undefined && cfg.color) {\n style.stroke = cfg.color;\n }\n if (cfg.style.r === undefined && !isNaN(size[0])) {\n style.r = size[0] / 2;\n }\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/circle.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/Scene.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/Scene.js ***! - \*************************************************/ -/*! exports provided: Scene */ +/***/ "./node_modules/@antv/g6-element/es/nodes/diamond.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/nodes/diamond.js ***! + \***********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Scene\", function() { return Scene; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nvar _dec, _class, _temp;\n\n\nvar Scene = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_2__[\"injectable\"])(), _dec(_class = (_temp = /*#__PURE__*/function () {\n function Scene() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Scene);\n\n this.entities = [];\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Scene, [{\n key: \"getEntities\",\n value: function getEntities() {\n return this.entities;\n }\n }, {\n key: \"addRenderable\",\n value: function addRenderable(renderable) {\n this.addEntity(renderable.getEntity());\n return this;\n }\n }, {\n key: \"removeRenderable\",\n value: function removeRenderable(renderable) {\n this.removeEntity(renderable.getEntity());\n return this;\n }\n }, {\n key: \"addLight\",\n value: function addLight() {}\n }, {\n key: \"addEntity\",\n value: function addEntity(entity) {\n if (this.entities.indexOf(entity) === -1) {\n this.entities.push(entity);\n }\n\n return this;\n }\n }, {\n key: \"removeEntity\",\n value: function removeEntity(entity) {\n var index = this.entities.indexOf(entity);\n this.entities.splice(index, 1);\n return this;\n }\n }]);\n\n return Scene;\n}(), _temp)) || _class);\n//# sourceMappingURL=Scene.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/Scene.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n// 菱形shape\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('diamond', {\n // 自定义节点时的配置\n options: {\n size: [80, 80],\n style: {\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'diamond',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n icon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('path', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var w = icon.width,\n h = icon.height,\n show = icon.show,\n text = icon.text;\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -w / 2,\n y: -h / 2\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n if (left) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n if (right) {\n // right circle\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n if (top) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n if (bottom) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n },\n getPath: function getPath(cfg) {\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n var path = [['M', 0, -height / 2], ['L', width / 2, 0], ['L', 0, height / 2], ['L', -width / 2, 0], ['Z'] // 封闭\n ];\n\n return path;\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, strokeStyle);\n var path = this.getPath(cfg);\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: path\n }, style);\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer();\n // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n var defaultStyle = this.getOptions({}).style;\n var path = this.getPath(cfg);\n // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n var strokeStyle = {\n stroke: cfg.color,\n path: path\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/diamond.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/View.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/View.js ***! - \************************************************/ -/*! exports provided: View */ +/***/ "./node_modules/@antv/g6-element/es/nodes/donut.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/nodes/donut.js ***! + \*********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"View\", function() { return View; });\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _class, _class2, _descriptor, _temp;\n\n\n\nvar View = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].Systems), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"named\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].RendererSystem), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function View() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, View);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"rendererSystem\", _descriptor, this);\n\n this.camera = void 0;\n this.scene = void 0;\n this.viewport = {\n x: 0,\n y: 0,\n width: 0,\n height: 0\n };\n this.clearColor = [1, 1, 1, 1];\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(View, [{\n key: \"getCamera\",\n value: function getCamera() {\n return this.camera;\n }\n }, {\n key: \"getScene\",\n value: function getScene() {\n return this.scene;\n }\n }, {\n key: \"getViewport\",\n value: function getViewport() {\n return this.viewport;\n }\n }, {\n key: \"getClearColor\",\n value: function getClearColor() {\n return this.clearColor;\n }\n }, {\n key: \"setCamera\",\n value: function setCamera(camera) {\n this.camera = camera;\n return this;\n }\n }, {\n key: \"setScene\",\n value: function setScene(scene) {\n this.scene = scene;\n return this;\n }\n }, {\n key: \"setViewport\",\n value: function setViewport(viewport) {\n this.viewport = viewport;\n return this;\n }\n }, {\n key: \"setClearColor\",\n value: function setClearColor(clearColor) {\n this.clearColor = clearColor;\n return this;\n }\n }, {\n key: \"pick\",\n value: function pick(position) {\n return this.rendererSystem.pick(position, this);\n }\n }]);\n\n return View;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"rendererSystem\", [_dec2, _dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=View.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/View.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\nvar defaultSubjectColors = _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].defaultSubjectColors;\nvar FAN_NAME_PREFIX = 'fan-shape-';\n// 饼图节点\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('donut', {\n // 自定义节点时的配置\n options: {\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.size,\n style: {\n x: 0,\n y: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'circle',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n defaultIcon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var icon = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"deepMix\"])({}, defaultIcon, cfg.icon);\n var keyShape = group.addShape('circle', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n draggable: true,\n name: \"\".concat(this.type, \"-keyShape\")\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var width = icon.width,\n height = icon.height,\n show = icon.show,\n text = icon.text;\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n // draw the fan shapes\n drawFans(cfg, group, keyShape);\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n updateShape: function updateShape(cfg, item, keyShapeStyle, hasIcon, updateType) {\n // here cfg is merged configure including old model and new configs\n var keyShape = item.get('keyShape');\n keyShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, keyShapeStyle));\n updateFans(cfg, item, keyShape);\n if (!undefined || (updateType === null || updateType === void 0 ? void 0 : updateType.includes('label'))) {\n this.updateLabel(cfg, item, updateType);\n }\n if (hasIcon) {\n this.updateIcon(cfg, item);\n }\n }\n}, 'circle');\n/**\n * draws the fan shapes\n * @param cfg\n * @param group\n * @param keyShape\n * @returns\n */\nvar drawFans = function drawFans(cfg, group, keyShape) {\n var _a = cfg.donutAttrs,\n donutAttrs = _a === void 0 ? {} : _a,\n _b = cfg.donutColorMap,\n donutColorMap = _b === void 0 ? {} : _b;\n var attrNum = Object.keys(donutAttrs).length;\n if (donutAttrs && attrNum > 1) {\n var _c = getDonutConfig(donutAttrs, donutColorMap),\n configs = _c.configs,\n totalValue = _c.totalValue;\n if (totalValue) {\n var _d = getDonutSize(keyShape),\n lineWidth = _d.lineWidth,\n arcR = _d.arcR;\n var arcBegin = [arcR, 0];\n var beginAngle = 0;\n if (attrNum === 1) {\n // draw a path represents a circle\n drawFan(group, {\n arcR: arcR,\n arcBegin: arcBegin,\n beginAngle: beginAngle,\n config: configs[0],\n fanIndex: 0,\n lineWidth: lineWidth,\n totalValue: totalValue,\n drawWhole: true\n });\n return;\n }\n for (var i = 0; i < configs.length; i++) {\n var result = drawFan(group, {\n arcR: arcR,\n arcBegin: arcBegin,\n beginAngle: beginAngle,\n config: configs[i],\n fanIndex: i,\n lineWidth: lineWidth,\n totalValue: totalValue\n });\n if (result.shouldEnd) return;\n arcBegin = result.arcBegin;\n beginAngle = result.beginAngle;\n }\n }\n }\n};\n/**\n * draws one fan shape and returns the next position and angle\n * @param group\n * @param fanConfig\n * @returns\n */\nvar drawFan = function drawFan(group, fanConfig) {\n var arcR = fanConfig.arcR,\n arcBegin = fanConfig.arcBegin,\n beginAngle = fanConfig.beginAngle,\n config = fanConfig.config,\n fanIndex = fanConfig.fanIndex,\n lineWidth = fanConfig.lineWidth,\n totalValue = fanConfig.totalValue,\n _a = fanConfig.drawWhole,\n drawWhole = _a === void 0 ? false : _a,\n _b = fanConfig.updateShape,\n updateShape = _b === void 0 ? undefined : _b;\n var percent = config.value / totalValue;\n if (percent < 0.001) {\n // too small to add a fan\n return {\n beginAngle: beginAngle,\n arcBegin: arcBegin,\n shape: undefined,\n shouldEnd: false\n };\n }\n var arcEnd, endAngle, isBig;\n // draw a path represents the whole circle, or the percentage is close to 1\n if (drawWhole || percent > 0.999) {\n arcEnd = [arcR, 0.0001]; // [arcR * cos(2 * PI), -arcR * sin(2 * PI)]\n isBig = 1;\n } else {\n var angle = percent * Math.PI * 2;\n endAngle = beginAngle + angle;\n arcEnd = [arcR * Math.cos(endAngle), -arcR * Math.sin(endAngle)];\n isBig = angle > Math.PI ? 1 : 0;\n }\n var style = {\n path: [['M', arcBegin[0], arcBegin[1]], ['A', arcR, arcR, 0, isBig, 0, arcEnd[0], arcEnd[1]]],\n stroke: config.color || (updateShape === null || updateShape === void 0 ? void 0 : updateShape.attr('stroke')) || defaultSubjectColors[fanIndex % defaultSubjectColors.length],\n lineWidth: lineWidth\n };\n if (updateShape) {\n // update\n updateShape.attr(style);\n } else {\n // draw\n group['shapeMap'][\"\".concat(FAN_NAME_PREFIX).concat(fanIndex)] = group.addShape('path', {\n attrs: style,\n name: \"\".concat(FAN_NAME_PREFIX).concat(fanIndex),\n draggable: true\n });\n }\n return {\n beginAngle: endAngle,\n arcBegin: arcEnd,\n shape: group['shapeMap'][\"\".concat(FAN_NAME_PREFIX).concat(fanIndex)],\n shouldEnd: drawWhole || percent > 0.999\n };\n};\n/**\n * utilizes the existing fan shapes, update them with new configs\n * removes the redundent fan shapes\n * or adds more fan shapes\n * @param cfg\n * @param item\n * @param keyShape\n */\nvar updateFans = function updateFans(cfg, item, keyShape) {\n var donutAttrs = cfg.donutAttrs,\n _a = cfg.donutColorMap,\n donutColorMap = _a === void 0 ? {} : _a;\n var visitMap = {};\n var group = item.getContainer();\n if (donutAttrs) {\n var _b = getDonutConfig(donutAttrs, donutColorMap),\n configs = _b.configs,\n totalValue = _b.totalValue;\n if (totalValue) {\n var _c = getDonutSize(keyShape),\n lineWidth = _c.lineWidth,\n arcR = _c.arcR;\n var arcBegin = [arcR, 0];\n var beginAngle = 0;\n for (var i = 0; i < configs.length; i++) {\n var shapeName = \"\".concat(FAN_NAME_PREFIX).concat(i);\n var result = drawFan(group, {\n arcR: arcR,\n arcBegin: arcBegin,\n beginAngle: beginAngle,\n config: configs[i],\n fanIndex: i,\n lineWidth: lineWidth,\n totalValue: totalValue,\n drawWhole: configs.length === 1,\n updateShape: group['shapeMap'][shapeName]\n });\n if (result.shape) visitMap[shapeName] = true;\n if (result.shouldEnd) break;\n arcBegin = result.arcBegin;\n beginAngle = result.beginAngle;\n }\n }\n }\n // remove the old shapes which are not visited, including the situation taht donutAttrs is empty\n var fanKeys = Object.keys(group['shapeMap']).filter(function (key) {\n return key.includes(FAN_NAME_PREFIX);\n });\n fanKeys.forEach(function (key) {\n if (!visitMap[key]) {\n group['shapeMap'][key].remove(true);\n delete group['shapeMap'][key];\n }\n });\n};\n/**\n * calculate the total value and format single value for each fan\n * @param donutAttrs\n * @param donutColorMap\n * @returns\n */\nvar getDonutConfig = function getDonutConfig(donutAttrs, donutColorMap) {\n var totalValue = 0;\n var configs = [];\n Object.keys(donutAttrs).forEach(function (name) {\n var value = +donutAttrs[name];\n if (isNaN(value)) return;\n configs.push({\n key: name,\n value: value,\n color: donutColorMap[name]\n });\n totalValue += value;\n });\n return {\n totalValue: totalValue,\n configs: configs\n };\n};\n/**\n * calculate the lineWidth and radius for fan shapes according to the keyShape's radius\n * @param keyShape\n * @returns\n */\nvar getDonutSize = function getDonutSize(keyShape) {\n var keyShapeR = keyShape.attr('r');\n var innerR = 0.6 * keyShapeR; // 甜甜圈的内环半径\n var arcR = (keyShapeR + innerR) / 2; // 内环半径与外环半径的平均值\n var lineWidth = keyShapeR - innerR;\n return {\n lineWidth: lineWidth,\n arcR: arcR\n };\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/donut.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/World.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/World.js ***! - \*************************************************/ -/*! exports provided: World */ +/***/ "./node_modules/@antv/g6-element/es/nodes/ellipse.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/nodes/ellipse.js ***! + \***********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"World\", function() { return World; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var _antv_g_webgpu_engine__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @antv/g-webgpu-engine */ \"./node_modules/@antv/g-webgpu-engine/es/index.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @webgpu/types/dist/constants */ \"./node_modules/@webgpu/types/dist/constants.js\");\n/* harmony import */ var _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _camera_Camera__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./camera/Camera */ \"./node_modules/@antv/g-webgpu/es/camera/Camera.js\");\n/* harmony import */ var _geometry__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./geometry */ \"./node_modules/@antv/g-webgpu/es/geometry/index.js\");\n/* harmony import */ var _geometry_Box__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./geometry/Box */ \"./node_modules/@antv/g-webgpu/es/geometry/Box.js\");\n/* harmony import */ var _geometry_Merged__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./geometry/Merged */ \"./node_modules/@antv/g-webgpu/es/geometry/Merged.js\");\n/* harmony import */ var _geometry_Plane__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./geometry/Plane */ \"./node_modules/@antv/g-webgpu/es/geometry/Plane.js\");\n/* harmony import */ var _geometry_Sphere__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./geometry/Sphere */ \"./node_modules/@antv/g-webgpu/es/geometry/Sphere.js\");\n/* harmony import */ var _Kernel__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./Kernel */ \"./node_modules/@antv/g-webgpu/es/Kernel.js\");\n/* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./material */ \"./node_modules/@antv/g-webgpu/es/material/index.js\");\n/* harmony import */ var _material_basic__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./material/basic */ \"./node_modules/@antv/g-webgpu/es/material/basic/index.js\");\n/* harmony import */ var _renderable_grid__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./renderable/grid */ \"./node_modules/@antv/g-webgpu/es/renderable/grid/index.js\");\n/* harmony import */ var _renderable_line__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./renderable/line */ \"./node_modules/@antv/g-webgpu/es/renderable/line/index.js\");\n/* harmony import */ var _renderable_point__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./renderable/point */ \"./node_modules/@antv/g-webgpu/es/renderable/point/index.js\");\n/* harmony import */ var _renderable_Renderable__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./renderable/Renderable */ \"./node_modules/@antv/g-webgpu/es/renderable/Renderable.js\");\n/* harmony import */ var _Renderer__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./Renderer */ \"./node_modules/@antv/g-webgpu/es/Renderer.js\");\n/* harmony import */ var _Scene__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./Scene */ \"./node_modules/@antv/g-webgpu/es/Scene.js\");\n/* harmony import */ var _texture_Cache__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./texture/Cache */ \"./node_modules/@antv/g-webgpu/es/texture/Cache.js\");\n/* harmony import */ var _texture_Texture2D__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./texture/Texture2D */ \"./node_modules/@antv/g-webgpu/es/texture/Texture2D.js\");\n/* harmony import */ var _utils_canvas__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./utils/canvas */ \"./node_modules/@antv/g-webgpu/es/utils/canvas.js\");\n/* harmony import */ var _View__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./View */ \"./node_modules/@antv/g-webgpu/es/View.js\");\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _class, _class2, _descriptor, _temp;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n// tslint:disable-next-line:no-reference\n/// \n\n // tslint:disable-next-line:no-submodule-imports\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar World = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].ConfigService), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function World() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this, World);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"configService\", _descriptor, this);\n\n this.container = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default()(World, [{\n key: \"getEngine\",\n value: function () {\n var _getEngine = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var engine, _this$configService$g, canvas, engineOptions;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n engine = this.container.get(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderEngine);\n _this$configService$g = this.configService.get(), canvas = _this$configService$g.canvas, engineOptions = _this$configService$g.engineOptions;\n _context.next = 4;\n return engine.init(_objectSpread({\n canvas: canvas || Object(_utils_canvas__WEBPACK_IMPORTED_MODULE_29__[\"createCanvas\"])(),\n swapChainFormat: _webgpu_types_dist_constants__WEBPACK_IMPORTED_MODULE_10__[\"TextureFormat\"].BGRA8Unorm,\n antialiasing: false\n }, engineOptions));\n\n case 4:\n return _context.abrupt(\"return\", engine);\n\n case 5:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function getEngine() {\n return _getEngine.apply(this, arguments);\n }\n\n return getEngine;\n }()\n /**\n * get transform component\n * @param entity\n */\n\n }, {\n key: \"getTransformComponent\",\n value: function getTransformComponent(entity) {\n var manager = this.container.get(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].TransformComponentManager);\n return manager.getComponentByEntity(entity);\n }\n }, {\n key: \"getMeshComponent\",\n value: function getMeshComponent(entity) {\n var manager = this.container.get(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].MeshComponentManager);\n return manager.getComponentByEntity(entity);\n }\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this.configService.set(config);\n }\n }, {\n key: \"setContainer\",\n value: function setContainer(container) {\n this.container = container;\n }\n }, {\n key: \"getContainer\",\n value: function getContainer() {\n return this.container;\n }\n }, {\n key: \"createEntity\",\n value: function createEntity() {\n return Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"createEntity\"])();\n }\n }, {\n key: \"createScene\",\n value: function createScene() {\n return this.container.get(_Scene__WEBPACK_IMPORTED_MODULE_26__[\"Scene\"]);\n }\n }, {\n key: \"createCamera\",\n value: function createCamera() {\n return this.container.get(_camera_Camera__WEBPACK_IMPORTED_MODULE_12__[\"Camera\"]);\n }\n }, {\n key: \"createView\",\n value: function createView() {\n return this.container.get(_View__WEBPACK_IMPORTED_MODULE_30__[\"View\"]);\n } // public createLight(type: string,) {\n // return this.container.getNamed(IDENTIFIER.Light, type)\n // }\n\n }, {\n key: \"createRenderable\",\n value: function createRenderable(type, config) {\n var renderable = type ? this.container.getNamed(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Renderable, type) : this.container.get(_renderable_Renderable__WEBPACK_IMPORTED_MODULE_24__[\"Renderable\"]);\n\n var entity = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"createEntity\"])();\n\n renderable.setConfig(config || {});\n renderable.setEntity(entity);\n return renderable;\n }\n }, {\n key: \"createGeometry\",\n value: function createGeometry(type, config) {\n var geometry = this.container.getNamed(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Geometry, type);\n\n var entity = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"createEntity\"])();\n\n geometry.setConfig(config || {});\n geometry.setEntity(entity);\n return geometry.getComponent();\n }\n }, {\n key: \"createMaterial\",\n value: function createMaterial(type, config) {\n var material = this.container.getNamed(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Material, type);\n\n var entity = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"createEntity\"])();\n\n material.setConfig(config || {});\n material.setEntity(entity, type);\n return material.getComponent();\n }\n }, {\n key: \"createTexture2D\",\n value: function createTexture2D(config) {\n var texture = this.container.get(_texture_Texture2D__WEBPACK_IMPORTED_MODULE_28__[\"Texture2D\"]);\n texture.setConfig(config);\n return texture;\n }\n }, {\n key: \"createBufferGeometry\",\n value: function createBufferGeometry(params) {\n var geometrySystem = this.container.getNamed(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Systems, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].GeometrySystem);\n return geometrySystem.createBufferGeometry(params);\n }\n }, {\n key: \"createInstancedBufferGeometry\",\n value: function createInstancedBufferGeometry(params) {\n var geometrySystem = this.container.getNamed(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Systems, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].GeometrySystem);\n return geometrySystem.createInstancedBufferGeometry(params);\n }\n }, {\n key: \"createShaderMaterial\",\n value: function createShaderMaterial(params) {\n var materialSystem = this.container.getNamed(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Systems, _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].MaterialSystem);\n return materialSystem.createShaderMaterial(params);\n }\n }, {\n key: \"createKernel\",\n value: function createKernel(precompiledBundle) {\n var kernel = this.container.get(_Kernel__WEBPACK_IMPORTED_MODULE_18__[\"Kernel\"]);\n\n if (typeof precompiledBundle === 'string') {\n kernel.setBundle(JSON.parse(precompiledBundle));\n } else {\n kernel.setBundle(precompiledBundle);\n }\n\n kernel.init();\n return kernel;\n }\n }, {\n key: \"createRenderer\",\n value: function createRenderer() {\n var renderer = this.container.get(_Renderer__WEBPACK_IMPORTED_MODULE_25__[\"Renderer\"]);\n renderer.container = this.container;\n renderer.init();\n return renderer;\n }\n }, {\n key: \"destroy\",\n value: function destroy() {\n var systems = this.container.getAll(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Systems);\n systems.forEach(function (system) {\n if (system.tearDown) {\n system.tearDown();\n }\n });\n var engine = this.container.get(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderEngine);\n engine.destroy();\n var interactor = this.container.get(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].InteractorService);\n interactor.destroy();\n }\n }], [{\n key: \"create\",\n value: function create() {\n var config = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n var worldContainer = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"createWorldContainer\"])(); // bind render engine, fallback to WebGL\n\n var engineClazz = !navigator.gpu ? _antv_g_webgpu_engine__WEBPACK_IMPORTED_MODULE_9__[\"WebGLEngine\"] : _antv_g_webgpu_engine__WEBPACK_IMPORTED_MODULE_9__[\"WebGPUEngine\"];\n\n if (!worldContainer.isBound(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderEngine)) {\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderEngine) // @ts-ignore\n .to(engineClazz).inSingletonScope();\n }\n\n worldContainer.bind(_Renderer__WEBPACK_IMPORTED_MODULE_25__[\"Renderer\"]).toSelf();\n worldContainer.bind(_Kernel__WEBPACK_IMPORTED_MODULE_18__[\"Kernel\"]).toSelf();\n worldContainer.bind(_renderable_Renderable__WEBPACK_IMPORTED_MODULE_24__[\"Renderable\"]).toSelf();\n worldContainer.bind(_View__WEBPACK_IMPORTED_MODULE_30__[\"View\"]).toSelf();\n worldContainer.bind(_camera_Camera__WEBPACK_IMPORTED_MODULE_12__[\"Camera\"]).toSelf();\n worldContainer.bind(_Scene__WEBPACK_IMPORTED_MODULE_26__[\"Scene\"]).toSelf();\n worldContainer.bind(World).toSelf();\n worldContainer.bind(_texture_Cache__WEBPACK_IMPORTED_MODULE_27__[\"TextureCache\"]).toSelf();\n worldContainer.bind(_texture_Texture2D__WEBPACK_IMPORTED_MODULE_28__[\"Texture2D\"]).toSelf(); // bind geometries\n\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Geometry).to(_geometry_Box__WEBPACK_IMPORTED_MODULE_14__[\"Box\"]).whenTargetNamed(_geometry__WEBPACK_IMPORTED_MODULE_13__[\"Geometry\"].BOX);\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Geometry).to(_geometry_Sphere__WEBPACK_IMPORTED_MODULE_17__[\"Sphere\"]).whenTargetNamed(_geometry__WEBPACK_IMPORTED_MODULE_13__[\"Geometry\"].SPHERE);\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Geometry).to(_geometry_Plane__WEBPACK_IMPORTED_MODULE_16__[\"Plane\"]).whenTargetNamed(_geometry__WEBPACK_IMPORTED_MODULE_13__[\"Geometry\"].PLANE);\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Geometry).to(_geometry_Merged__WEBPACK_IMPORTED_MODULE_15__[\"Merged\"]).whenTargetNamed(_geometry__WEBPACK_IMPORTED_MODULE_13__[\"Geometry\"].MERGED); // bind materials\n\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Material).to(_material_basic__WEBPACK_IMPORTED_MODULE_20__[\"Basic\"]).whenTargetNamed(_material__WEBPACK_IMPORTED_MODULE_19__[\"Material\"].BASIC); // bind renderables\n\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Renderable).to(_renderable_point__WEBPACK_IMPORTED_MODULE_23__[\"Point\"]).whenTargetNamed(_renderable_Renderable__WEBPACK_IMPORTED_MODULE_24__[\"Renderable\"].POINT);\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Renderable).to(_renderable_line__WEBPACK_IMPORTED_MODULE_22__[\"Line\"]).whenTargetNamed(_renderable_Renderable__WEBPACK_IMPORTED_MODULE_24__[\"Renderable\"].LINE);\n worldContainer.bind(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].Renderable).to(_renderable_grid__WEBPACK_IMPORTED_MODULE_21__[\"Grid\"]).whenTargetNamed(_renderable_Renderable__WEBPACK_IMPORTED_MODULE_24__[\"Renderable\"].GRID);\n var world = worldContainer.get(World);\n world.setContainer(worldContainer);\n world.setConfig(config);\n return world;\n }\n }]);\n\n return World;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"configService\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=World.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/World.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n/**\n * 基本的椭圆,可以添加文本,默认文本居中\n */\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('ellipse', {\n // 自定义节点时的配置\n options: {\n size: [80, 40],\n style: {\n x: 0,\n y: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'ellipse',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n icon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('ellipse', {\n attrs: style,\n className: 'ellipse-keyShape',\n name: 'ellipse-keyShape',\n draggable: true\n });\n group['shapeMap']['ellipse-keyShape'] = keyShape;\n var width = icon.width,\n height = icon.height,\n show = icon.show,\n text = icon.text;\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n var size = this.getSize(cfg);\n var rx = size[0] / 2;\n var ry = size[1] / 2;\n if (left) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -rx,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n if (right) {\n // right circle\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: rx,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n if (top) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -ry,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n if (bottom) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: ry,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var rx = size[0] / 2;\n var ry = size[1] / 2;\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n rx: rx,\n ry: ry\n }, style);\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer();\n // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n var defaultStyle = this.getOptions({}).style;\n var size = this.getSize(cfg);\n var strokeStyle = {\n stroke: cfg.color,\n rx: size[0] / 2,\n ry: size[1] / 2\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/ellipse.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/camera/Camera.js": +/***/ "./node_modules/@antv/g6-element/es/nodes/index.js": /*!*********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/camera/Camera.js ***! + !*** ./node_modules/@antv/g6-element/es/nodes/index.js ***! \*********************************************************/ -/*! exports provided: CAMERA_TYPE, CAMERA_TRACKING_MODE, CAMERA_PROJECTION_MODE, Camera */ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CAMERA_TYPE\", function() { return CAMERA_TYPE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CAMERA_TRACKING_MODE\", function() { return CAMERA_TRACKING_MODE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CAMERA_PROJECTION_MODE\", function() { return CAMERA_PROJECTION_MODE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Camera\", function() { return Camera; });\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _utils_math__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../utils/math */ \"./node_modules/@antv/g-webgpu/es/utils/math.js\");\n/* harmony import */ var _Landmark__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./Landmark */ \"./node_modules/@antv/g-webgpu/es/camera/Landmark.js\");\n\n\n\n\n\n\nvar _dec, _dec2, _class, _class2, _descriptor, _class3, _temp;\n\n\n\n\n\n\nvar CAMERA_TYPE;\n\n(function (CAMERA_TYPE) {\n CAMERA_TYPE[\"ORBITING\"] = \"ORBITING\";\n CAMERA_TYPE[\"EXPLORING\"] = \"EXPLORING\";\n CAMERA_TYPE[\"TRACKING\"] = \"TRACKING\";\n})(CAMERA_TYPE || (CAMERA_TYPE = {}));\n\nvar CAMERA_TRACKING_MODE;\n\n(function (CAMERA_TRACKING_MODE) {\n CAMERA_TRACKING_MODE[\"DEFAULT\"] = \"DEFAULT\";\n CAMERA_TRACKING_MODE[\"ROTATIONAL\"] = \"ROTATIONAL\";\n CAMERA_TRACKING_MODE[\"TRANSLATIONAL\"] = \"TRANSLATIONAL\";\n CAMERA_TRACKING_MODE[\"CINEMATIC\"] = \"CINEMATIC\";\n})(CAMERA_TRACKING_MODE || (CAMERA_TRACKING_MODE = {}));\n\nvar CAMERA_PROJECTION_MODE;\n\n(function (CAMERA_PROJECTION_MODE) {\n CAMERA_PROJECTION_MODE[\"ORTHOGRAPHIC\"] = \"ORTHOGRAPHIC\";\n CAMERA_PROJECTION_MODE[\"PERSPECTIVE\"] = \"PERSPECTIVE\";\n})(CAMERA_PROJECTION_MODE || (CAMERA_PROJECTION_MODE = {}));\n\nvar DEG_2_RAD = Math.PI / 180;\nvar RAD_2_DEG = 180 / Math.PI;\n/**\n * 参考「WebGL Insights - 23.Designing Cameras for WebGL Applications」,基于 Responsible Camera 思路设计\n * 保存相机参数,定义相机动作:\n * 1. dolly 沿 n 轴移动\n * 2. pan 沿 u v 轴移动\n * 3. rotate 以方位角旋转\n * 4. 移动到 Landmark,具有平滑的动画效果,其间禁止其他用户交互\n */\n\nvar Camera = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].InteractorService), _dec(_class = (_class2 = (_temp = _class3 = /*#__PURE__*/function () {\n function Camera() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Camera);\n\n this.matrix = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create();\n this.right = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(1, 0, 0);\n this.up = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 1, 0);\n this.forward = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 0, 1);\n this.position = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 0, 1);\n this.focalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 0, 0);\n this.distanceVector = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 0, 0);\n this.distance = 1;\n this.azimuth = 0;\n this.elevation = 0;\n this.roll = 0;\n this.relAzimuth = 0;\n this.relElevation = 0;\n this.relRoll = 0;\n this.dollyingStep = 0;\n this.maxDistance = Infinity;\n this.minDistance = -Infinity;\n this.rotateWorld = false;\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"interactor\", _descriptor, this);\n\n this.fov = 30;\n this.near = 0.1;\n this.far = 10000;\n this.aspect = 1;\n this.left = void 0;\n this.rright = void 0;\n this.top = void 0;\n this.bottom = void 0;\n this.zoom = 1;\n this.perspective = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create();\n this.view = void 0;\n this.following = undefined;\n this.type = CAMERA_TYPE.EXPLORING;\n this.trackingMode = CAMERA_TRACKING_MODE.DEFAULT;\n this.projectionMode = CAMERA_PROJECTION_MODE.PERSPECTIVE;\n this.frustum = new _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"Frustum\"]();\n this.landmarks = [];\n this.landmarkAnimationID = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Camera, [{\n key: \"clone\",\n value: function clone() {\n var camera = new Camera();\n camera.setType(this.type, undefined);\n camera.interactor = this.interactor;\n return camera;\n }\n }, {\n key: \"getProjectionMode\",\n value: function getProjectionMode() {\n return this.projectionMode;\n }\n }, {\n key: \"getPerspective\",\n value: function getPerspective() {\n return this.perspective;\n }\n }, {\n key: \"getFrustum\",\n value: function getFrustum() {\n return this.frustum;\n }\n }, {\n key: \"getPosition\",\n value: function getPosition() {\n return this.position;\n }\n }, {\n key: \"setType\",\n value: function setType(type, trackingMode) {\n this.type = type;\n\n if (this.type === CAMERA_TYPE.EXPLORING) {\n this.setWorldRotation(true);\n } else {\n this.setWorldRotation(false);\n }\n\n this._getAngles();\n\n if (this.type === CAMERA_TYPE.TRACKING && trackingMode !== undefined) {\n this.setTrackingMode(trackingMode);\n }\n\n return this;\n }\n }, {\n key: \"setProjectionMode\",\n value: function setProjectionMode(projectionMode) {\n this.projectionMode = projectionMode;\n return this;\n }\n }, {\n key: \"setTrackingMode\",\n value: function setTrackingMode(trackingMode) {\n if (this.type !== CAMERA_TYPE.TRACKING) {\n throw new Error('Impossible to set a tracking mode if the camera is not of tracking type');\n }\n\n this.trackingMode = trackingMode;\n return this;\n }\n /**\n * If flag is true, it reverses the azimuth and elevation angles.\n * Subsequent calls to rotate, setAzimuth, setElevation,\n * changeAzimuth or changeElevation will cause the inverted effect.\n * setRoll or changeRoll is not affected by this method.\n *\n * This inversion is useful when one wants to simulate that the world\n * is moving, instead of the camera.\n *\n * By default the camera angles are not reversed.\n * @param {Boolean} flag the boolean flag to reverse the angles.\n */\n\n }, {\n key: \"setWorldRotation\",\n value: function setWorldRotation(flag) {\n this.rotateWorld = flag;\n\n this._getAngles();\n }\n /**\n * 计算 MV 矩阵,为相机矩阵的逆矩阵\n */\n\n }, {\n key: \"getViewTransform\",\n value: function getViewTransform() {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].invert(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create(), this.matrix);\n }\n }, {\n key: \"getWorldTransform\",\n value: function getWorldTransform() {\n return this.matrix;\n }\n /**\n * 设置相机矩阵\n */\n\n }, {\n key: \"setMatrix\",\n value: function setMatrix(matrix) {\n this.matrix = matrix;\n\n this._update();\n\n return this;\n }\n }, {\n key: \"setAspect\",\n value: function setAspect(aspect) {\n this.setPerspective(this.near, this.far, this.fov, aspect);\n return this;\n }\n /**\n * Sets an offset in a larger frustum, used in PixelPicking\n */\n\n }, {\n key: \"setViewOffset\",\n value: function setViewOffset(fullWidth, fullHeight, x, y, width, height) {\n this.aspect = fullWidth / fullHeight;\n\n if (this.view === undefined) {\n this.view = {\n enabled: true,\n fullWidth: 1,\n fullHeight: 1,\n offsetX: 0,\n offsetY: 0,\n width: 1,\n height: 1\n };\n }\n\n this.view.enabled = true;\n this.view.fullWidth = fullWidth;\n this.view.fullHeight = fullHeight;\n this.view.offsetX = x;\n this.view.offsetY = y;\n this.view.width = width;\n this.view.height = height;\n\n if (this.projectionMode === CAMERA_PROJECTION_MODE.PERSPECTIVE) {\n this.setPerspective(this.near, this.far, this.fov, this.aspect);\n } else {\n this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);\n }\n\n return this;\n }\n }, {\n key: \"clearViewOffset\",\n value: function clearViewOffset() {\n if (this.view !== undefined) {\n this.view.enabled = false;\n }\n\n if (this.projectionMode === CAMERA_PROJECTION_MODE.PERSPECTIVE) {\n this.setPerspective(this.near, this.far, this.fov, this.aspect);\n } else {\n this.setOrthographic(this.left, this.rright, this.top, this.bottom, this.near, this.far);\n }\n\n return this;\n }\n }, {\n key: \"setPerspective\",\n value: function setPerspective(near, far, fov, aspect) {\n this.projectionMode = CAMERA_PROJECTION_MODE.PERSPECTIVE;\n this.fov = fov;\n this.near = near;\n this.far = far;\n this.aspect = aspect;\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].perspective(this.perspective, this.fov * DEG_2_RAD, this.aspect, this.near, this.far);\n return this;\n }\n }, {\n key: \"setOrthographic\",\n value: function setOrthographic(l, r, t, b, near, far) {\n this.projectionMode = CAMERA_PROJECTION_MODE.ORTHOGRAPHIC;\n this.rright = r;\n this.left = l;\n this.top = t;\n this.bottom = b;\n this.near = near;\n this.far = far;\n var dx = (this.rright - this.left) / (2 * this.zoom);\n var dy = (this.top - this.bottom) / (2 * this.zoom);\n var cx = (this.rright + this.left) / 2;\n var cy = (this.top + this.bottom) / 2;\n var left = cx - dx;\n var right = cx + dx;\n var top = cy + dy;\n var bottom = cy - dy;\n\n if (this.view !== undefined && this.view.enabled) {\n var scaleW = (this.rright - this.left) / this.view.fullWidth / this.zoom;\n var scaleH = (this.top - this.bottom) / this.view.fullHeight / this.zoom;\n left += scaleW * this.view.offsetX;\n right = left + scaleW * this.view.width;\n top -= scaleH * this.view.offsetY;\n bottom = top - scaleH * this.view.height;\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].ortho(this.perspective, left, right, top, bottom, near, far);\n return this;\n }\n /**\n * 设置相机位置\n */\n\n }, {\n key: \"setPosition\",\n value: function setPosition(x, y, z) {\n this._setPosition(x, y, z);\n\n this.setFocalPoint(this.focalPoint);\n return this;\n }\n /**\n * 设置视点位置\n */\n\n }, {\n key: \"setFocalPoint\",\n value: function setFocalPoint(x, y, z) {\n var up = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].fromValues(0, 1, 0);\n this.focalPoint = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"createVec3\"])(x, y, z);\n\n if (this.trackingMode === CAMERA_TRACKING_MODE.CINEMATIC) {\n var d = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create(), this.focalPoint, this.position);\n x = d[0];\n y = d[1];\n z = d[2];\n var r = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].length(d);\n var el = Math.asin(y / r) * RAD_2_DEG;\n var az = 90 + Math.atan2(z, x) * RAD_2_DEG;\n var m = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].rotateY(m, m, az * DEG_2_RAD);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].rotateX(m, m, el * DEG_2_RAD);\n up = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create(), [0, 1, 0], m);\n }\n\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].invert(this.matrix, gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].lookAt(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create(), this.position, this.focalPoint, up));\n\n this._getAxes();\n\n this._getDistance();\n\n this._getAngles();\n\n return this;\n }\n /**\n * 固定当前视点,按指定距离放置相机\n */\n\n }, {\n key: \"setDistance\",\n value: function setDistance(d) {\n if (this.distance === d || d < 0) {\n return;\n }\n\n this.distance = d;\n\n if (this.distance < 0.0002) {\n this.distance = 0.0002;\n }\n\n this.dollyingStep = this.distance / 100;\n var pos = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create();\n d = this.distance;\n var n = this.forward;\n var f = this.focalPoint;\n pos[0] = d * n[0] + f[0];\n pos[1] = d * n[1] + f[1];\n pos[2] = d * n[2] + f[2];\n\n this._setPosition(pos);\n\n return this;\n }\n }, {\n key: \"setMaxDistance\",\n value: function setMaxDistance(d) {\n this.maxDistance = d;\n return this;\n }\n }, {\n key: \"setMinDistance\",\n value: function setMinDistance(d) {\n this.minDistance = d;\n return this;\n }\n /**\n * Changes the initial azimuth of the camera\n */\n\n }, {\n key: \"changeAzimuth\",\n value: function changeAzimuth(az) {\n this.setAzimuth(this.azimuth + az);\n return this;\n }\n /**\n * Changes the initial elevation of the camera\n */\n\n }, {\n key: \"changeElevation\",\n value: function changeElevation(el) {\n this.setElevation(this.elevation + el);\n return this;\n }\n /**\n * Changes the initial roll of the camera\n */\n\n }, {\n key: \"changeRoll\",\n value: function changeRoll(rl) {\n this.setRoll(this.roll + rl);\n return this;\n }\n /**\n * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置\n * @param {Number} el the azimuth in degrees\n */\n\n }, {\n key: \"setAzimuth\",\n value: function setAzimuth(az) {\n this.azimuth = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(az);\n this.computeMatrix();\n\n this._getAxes();\n\n if (this.type === CAMERA_TYPE.ORBITING || this.type === CAMERA_TYPE.EXPLORING) {\n this._getPosition();\n } else if (this.type === CAMERA_TYPE.TRACKING) {\n this._getFocalPoint();\n }\n\n return this;\n }\n }, {\n key: \"getAzimuth\",\n value: function getAzimuth() {\n return this.azimuth;\n }\n /**\n * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置\n * @param {Number} el the elevation in degrees\n */\n\n }, {\n key: \"setElevation\",\n value: function setElevation(el) {\n this.elevation = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(el);\n this.computeMatrix();\n\n this._getAxes();\n\n if (this.type === CAMERA_TYPE.ORBITING || this.type === CAMERA_TYPE.EXPLORING) {\n this._getPosition();\n } else if (this.type === CAMERA_TYPE.TRACKING) {\n this._getFocalPoint();\n }\n\n return this;\n }\n /**\n * 设置相机方位角,不同相机模式下需要重新计算相机位置或者是视点位置\n * @param {Number} angle the roll angle\n */\n\n }, {\n key: \"setRoll\",\n value: function setRoll(angle) {\n this.roll = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(angle);\n this.computeMatrix();\n\n this._getAxes();\n\n if (this.type === CAMERA_TYPE.ORBITING || this.type === CAMERA_TYPE.EXPLORING) {\n this._getPosition();\n } else if (this.type === CAMERA_TYPE.TRACKING) {\n this._getFocalPoint();\n }\n\n return this;\n }\n /**\n * Changes the azimuth and elevation with respect to the current camera axes\n * @param {Number} azimuth the relative azimuth\n * @param {Number} elevation the relative elevation\n * @param {Number} roll the relative roll\n */\n\n }, {\n key: \"rotate\",\n value: function rotate(azimuth, elevation, roll) {\n if (this.type === CAMERA_TYPE.EXPLORING) {\n azimuth = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(azimuth);\n elevation = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(elevation);\n roll = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(roll);\n var rotX = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].setAxisAngle(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), [1, 0, 0], (this.rotateWorld ? 1 : -1) * elevation * DEG_2_RAD);\n var rotY = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].setAxisAngle(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), [0, 1, 0], (this.rotateWorld ? 1 : -1) * azimuth * DEG_2_RAD);\n var rotZ = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].setAxisAngle(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), [0, 0, 1], roll * DEG_2_RAD);\n var rotQ = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), rotY, rotX);\n rotQ = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), rotQ, rotZ);\n var rotMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].fromQuat(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create(), rotQ);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].translate(this.matrix, this.matrix, [0, 0, -this.distance]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].multiply(this.matrix, this.matrix, rotMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].translate(this.matrix, this.matrix, [0, 0, this.distance]);\n } else {\n if (Math.abs(this.elevation + elevation) > 90) {\n return;\n }\n\n this.relElevation = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(elevation);\n this.relAzimuth = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(azimuth);\n this.relRoll = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"getAngle\"])(roll);\n this.elevation += this.relElevation;\n this.azimuth += this.relAzimuth;\n this.roll += this.relRoll;\n this.computeMatrix();\n }\n\n this._getAxes();\n\n if (this.type === CAMERA_TYPE.ORBITING || this.type === CAMERA_TYPE.EXPLORING) {\n this._getPosition();\n } else if (this.type === CAMERA_TYPE.TRACKING) {\n this._getFocalPoint();\n }\n\n this._update();\n\n return this;\n }\n /**\n * 沿水平(right) & 垂直(up)平移相机\n */\n\n }, {\n key: \"pan\",\n value: function pan(tx, ty) {\n var coords = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"createVec3\"])(tx, ty, 0);\n var pos = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].clone(this.position);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].add(pos, pos, gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].scale(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create(), this.right, coords[0]));\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].add(pos, pos, gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].scale(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create(), this.up, coords[1]));\n\n this._setPosition(pos);\n\n return this;\n }\n /**\n * 沿 n 轴移动,当距离视点远时移动速度较快,离视点越近速度越慢\n */\n\n }, {\n key: \"dolly\",\n value: function dolly(value) {\n var n = this.forward;\n var pos = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].clone(this.position);\n var step = value * this.dollyingStep;\n var updatedDistance = this.distance + value * this.dollyingStep; // 限制视点距离范围\n\n step = Math.max(Math.min(updatedDistance, this.maxDistance), this.minDistance) - this.distance;\n pos[0] += step * n[0];\n pos[1] += step * n[1];\n pos[2] += step * n[2];\n\n this._setPosition(pos);\n\n if (this.type === CAMERA_TYPE.ORBITING || this.type === CAMERA_TYPE.EXPLORING) {\n // 重新计算视点距离\n this._getDistance();\n } else if (this.type === CAMERA_TYPE.TRACKING) {\n // 保持视距,移动视点位置\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].add(this.focalPoint, pos, this.distanceVector);\n }\n\n return this;\n }\n }, {\n key: \"createLandmark\",\n value: function createLandmark(name, params) {\n var camera = this.clone();\n camera.setPosition(params.position);\n camera.setFocalPoint(params.focalPoint);\n\n if (params.roll !== undefined) {\n camera.setRoll(params.roll);\n }\n\n var landmark = new _Landmark__WEBPACK_IMPORTED_MODULE_9__[\"default\"](name, camera);\n this.landmarks.push(landmark);\n return landmark;\n }\n }, {\n key: \"setLandmark\",\n value: function setLandmark(name) {\n var landmark = new _Landmark__WEBPACK_IMPORTED_MODULE_9__[\"default\"](name, this);\n this.landmarks.push(landmark);\n return this;\n }\n }, {\n key: \"gotoLandmark\",\n value: function gotoLandmark(name) {\n var _this = this;\n\n var duration = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : 1000;\n var landmark = this.landmarks.find(function (l) {\n return l.name === name;\n });\n\n if (landmark) {\n if (duration === 0) {\n landmark.retrieve(this);\n return;\n }\n\n if (this.landmarkAnimationID !== undefined) {\n window.cancelAnimationFrame(this.landmarkAnimationID);\n } // TODO: do not process events during animation\n\n\n this.interactor.disconnect();\n var destPosition = landmark.getPosition();\n var destFocalPoint = landmark.getFocalPoint();\n var destRoll = landmark.getRoll();\n var timeStart;\n\n var animate = function animate(timestamp) {\n if (timeStart === undefined) {\n timeStart = timestamp;\n }\n\n var elapsed = timestamp - timeStart; // TODO: use better ease function\n\n var t = (1 - Math.cos(elapsed / duration * Math.PI)) / 2;\n var interFocalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create();\n var interPosition = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create();\n var interRoll = 0;\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].lerp(interFocalPoint, _this.focalPoint, destFocalPoint, t);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].lerp(interPosition, _this.position, destPosition, t);\n interRoll = _this.roll * (1 - t) + destRoll * t;\n\n _this.setFocalPoint(interFocalPoint);\n\n _this.setPosition(interPosition);\n\n _this.setRoll(interRoll);\n\n _this.computeMatrix();\n\n var dist = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].dist(interFocalPoint, destFocalPoint) + gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].dist(interPosition, destPosition);\n\n if (dist > 0.01) {//\n } else {\n _this.setFocalPoint(interFocalPoint);\n\n _this.setPosition(interPosition);\n\n _this.setRoll(interRoll);\n\n _this.computeMatrix();\n\n _this.interactor.connect();\n\n return;\n }\n\n if (elapsed < duration) {\n _this.landmarkAnimationID = window.requestAnimationFrame(animate);\n }\n };\n\n window.requestAnimationFrame(animate);\n }\n }\n /**\n * 根据相机矩阵重新计算各种相机参数\n */\n\n }, {\n key: \"_update\",\n value: function _update() {\n this._getAxes();\n\n this._getPosition();\n\n this._getDistance();\n\n this._getAngles();\n }\n /**\n * 计算相机矩阵\n */\n\n }, {\n key: \"computeMatrix\",\n value: function computeMatrix() {\n var rotX;\n var rotY; // 使用四元数描述 3D 旋转\n // @see https://xiaoiver.github.io/coding/2018/12/28/Camera-%E8%AE%BE%E8%AE%A1-%E4%B8%80.html\n\n var rotZ = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].setAxisAngle(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), [0, 0, 1], this.roll * DEG_2_RAD);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].identity(this.matrix); // only consider HCS for EXPLORING and ORBITING cameras\n\n rotX = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].setAxisAngle(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), [1, 0, 0], (this.rotateWorld && this.type !== CAMERA_TYPE.TRACKING || this.type === CAMERA_TYPE.TRACKING ? 1 : -1) * this.elevation * DEG_2_RAD);\n rotY = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].setAxisAngle(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), [0, 1, 0], (this.rotateWorld && this.type !== CAMERA_TYPE.TRACKING || this.type === CAMERA_TYPE.TRACKING ? 1 : -1) * this.azimuth * DEG_2_RAD);\n var rotQ = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), rotY, rotX);\n rotQ = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].multiply(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"quat\"].create(), rotQ, rotZ);\n var rotMatrix = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].fromQuat(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].create(), rotQ);\n\n if (this.type === CAMERA_TYPE.ORBITING || this.type === CAMERA_TYPE.EXPLORING) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].translate(this.matrix, this.matrix, this.focalPoint);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].multiply(this.matrix, this.matrix, rotMatrix);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].translate(this.matrix, this.matrix, [0, 0, this.distance]);\n } else if (this.type === CAMERA_TYPE.TRACKING) {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].translate(this.matrix, this.matrix, this.position);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat4\"].multiply(this.matrix, this.matrix, rotMatrix);\n }\n }\n /**\n * Sets the camera position in the camera matrix\n */\n\n }, {\n key: \"_setPosition\",\n value: function _setPosition(x, y, z) {\n this.position = Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"createVec3\"])(x, y, z);\n var m = this.matrix;\n m[12] = this.position[0];\n m[13] = this.position[1];\n m[14] = this.position[2];\n m[15] = 1;\n }\n /**\n * Recalculates axes based on the current matrix\n */\n\n }, {\n key: \"_getAxes\",\n value: function _getAxes() {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].copy(this.right, Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"createVec3\"])(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec4\"].transformMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec4\"].create(), [1, 0, 0, 0], this.matrix)));\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].copy(this.up, Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"createVec3\"])(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec4\"].transformMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec4\"].create(), [0, 1, 0, 0], this.matrix)));\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].copy(this.forward, Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"createVec3\"])(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec4\"].transformMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec4\"].create(), [0, 0, 1, 0], this.matrix)));\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].normalize(this.right, this.right);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].normalize(this.up, this.up);\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].normalize(this.forward, this.forward);\n }\n /**\n * Recalculates euler angles based on the current state\n */\n\n }, {\n key: \"_getAngles\",\n value: function _getAngles() {\n // Recalculates angles\n var x = this.distanceVector[0];\n var y = this.distanceVector[1];\n var z = this.distanceVector[2];\n var r = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].length(this.distanceVector); // FAST FAIL: If there is no distance we cannot compute angles\n\n if (r === 0) {\n this.elevation = 0;\n this.azimuth = 0;\n return;\n }\n\n if (this.type === CAMERA_TYPE.TRACKING) {\n this.elevation = Math.asin(y / r) * RAD_2_DEG;\n this.azimuth = Math.atan2(-x, -z) * RAD_2_DEG;\n } else {\n if (this.rotateWorld) {\n this.elevation = Math.asin(y / r) * RAD_2_DEG;\n this.azimuth = Math.atan2(-x, -z) * RAD_2_DEG;\n } else {\n this.elevation = -Math.asin(y / r) * RAD_2_DEG;\n this.azimuth = -Math.atan2(-x, -z) * RAD_2_DEG;\n }\n }\n }\n /**\n * 重新计算相机位置,只有 ORBITING 模式相机位置才会发生变化\n */\n\n }, {\n key: \"_getPosition\",\n value: function _getPosition() {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].copy(this.position, Object(_utils_math__WEBPACK_IMPORTED_MODULE_8__[\"createVec3\"])(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec4\"].transformMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec4\"].create(), [0, 0, 0, 1], this.matrix))); // 相机位置变化,需要重新计算视距\n\n this._getDistance();\n }\n /**\n * 重新计算视点,只有 TRACKING 模式视点才会发生变化\n */\n\n }, {\n key: \"_getFocalPoint\",\n value: function _getFocalPoint() {\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].transformMat3(this.distanceVector, [0, 0, -this.distance], gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat3\"].fromMat4(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"mat3\"].create(), this.matrix));\n gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].add(this.focalPoint, this.position, this.distanceVector); // 视点变化,需要重新计算视距\n\n this._getDistance();\n }\n /**\n * 重新计算视距\n */\n\n }, {\n key: \"_getDistance\",\n value: function _getDistance() {\n this.distanceVector = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].subtract(gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].create(), this.focalPoint, this.position);\n this.distance = gl_matrix__WEBPACK_IMPORTED_MODULE_6__[\"vec3\"].length(this.distanceVector);\n this.dollyingStep = this.distance / 100;\n }\n }]);\n\n return Camera;\n}(), _class3.ProjectionMode = {\n ORTHOGRAPHIC: 'ORTHOGRAPHIC',\n PERSPECTIVE: 'PERSPECTIVE'\n}, _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"interactor\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=Camera.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/camera/Camera.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _circle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./circle */ \"./node_modules/@antv/g6-element/es/nodes/circle.js\");\n/* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ \"./node_modules/@antv/g6-element/es/nodes/rect.js\");\n/* harmony import */ var _ellipse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ellipse */ \"./node_modules/@antv/g6-element/es/nodes/ellipse.js\");\n/* harmony import */ var _diamond__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diamond */ \"./node_modules/@antv/g6-element/es/nodes/diamond.js\");\n/* harmony import */ var _triangle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./triangle */ \"./node_modules/@antv/g6-element/es/nodes/triangle.js\");\n/* harmony import */ var _modelRect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelRect */ \"./node_modules/@antv/g6-element/es/nodes/modelRect.js\");\n/* harmony import */ var _star__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./star */ \"./node_modules/@antv/g6-element/es/nodes/star.js\");\n/* harmony import */ var _donut__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./donut */ \"./node_modules/@antv/g6-element/es/nodes/donut.js\");\n\n\n\n\n\n\n\n\n// import './image';\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/camera/Landmark.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/camera/Landmark.js ***! - \***********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-element/es/nodes/modelRect.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/nodes/modelRect.js ***! + \*************************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Landmark; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n\n\n\n\n/**\n * 保存相机状态,便于后续在多个 Landmark 间移动\n */\nvar Landmark = /*#__PURE__*/function () {\n function Landmark(name, c) {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Landmark);\n\n this.name = void 0;\n this.matrix = void 0;\n this.right = void 0;\n this.up = void 0;\n this.forward = void 0;\n this.position = void 0;\n this.focalPoint = void 0;\n this.distanceVector = void 0;\n this.distance = void 0;\n this.dollyingStep = void 0;\n this.azimuth = 0;\n this.elevation = 0;\n this.roll = 0;\n this.relAzimuth = 0;\n this.relElevation = 0;\n this.relRoll = 0;\n this.name = name;\n this.matrix = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"mat4\"].clone(c.matrix);\n this.right = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].clone(c.right);\n this.up = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].clone(c.up);\n this.forward = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].clone(c.forward);\n this.position = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].clone(c.position);\n this.focalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].clone(c.focalPoint);\n this.distanceVector = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].clone(c.distanceVector);\n this.azimuth = c.azimuth;\n this.elevation = c.elevation;\n this.roll = c.roll;\n this.relAzimuth = c.relAzimuth;\n this.relElevation = c.relElevation;\n this.relRoll = c.relRoll;\n this.dollyingStep = c.dollyingStep;\n this.distance = c.distance;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Landmark, [{\n key: \"getPosition\",\n value: function getPosition() {\n return this.position;\n }\n }, {\n key: \"getFocalPoint\",\n value: function getFocalPoint() {\n return this.focalPoint;\n }\n }, {\n key: \"getRoll\",\n value: function getRoll() {\n return this.roll;\n }\n }, {\n key: \"retrieve\",\n value: function retrieve(c) {\n c.matrix = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"mat4\"].copy(c.matrix, this.matrix);\n c.right = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(c.right, this.right);\n c.up = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(c.up, this.up);\n c.forward = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(c.forward, this.forward);\n c.position = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(c.position, this.position);\n c.focalPoint = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(c.focalPoint, this.focalPoint);\n c.distanceVector = gl_matrix__WEBPACK_IMPORTED_MODULE_2__[\"vec3\"].copy(c.distanceVector, this.distanceVector);\n c.azimuth = this.azimuth;\n c.elevation = this.elevation;\n c.roll = this.roll;\n c.relAzimuth = this.relAzimuth;\n c.relElevation = this.relElevation;\n c.relRoll = this.relRoll;\n c.dollyingStep = this.dollyingStep;\n c.distance = this.distance;\n }\n }]);\n\n return Landmark;\n}();\n\n\n//# sourceMappingURL=Landmark.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/camera/Landmark.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n\n\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"registerNode\"])('modelRect', {\n // 自定义节点时的配置\n options: {\n size: [185, 70],\n style: {\n radius: 5,\n stroke: '#69c0ff',\n fill: '#ffffff',\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.style.lineWidth,\n fillOpacity: 1\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: '#595959',\n fontSize: 14,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].windowFontFamily\n },\n offset: 30 // 距离左侧的 offset,没有设置 y 轴上移动的配置\n },\n\n descriptionCfg: {\n style: {\n fontSize: 12,\n fill: '#bfbfbf',\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].windowFontFamily\n },\n paddingTop: 0\n },\n preRect: {\n show: true,\n width: 4,\n fill: '#40a9ff',\n radius: 2\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: 10,\n lineWidth: 1,\n fill: '#72CC4A',\n stroke: '#72CC4A'\n },\n // 节点中icon配置\n logoIcon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: true,\n x: 0,\n y: 0,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg',\n width: 16,\n height: 16,\n // 用于调整图标的左右位置\n offset: 0\n },\n // 节点中表示状态的icon配置\n stateIcon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: true,\n x: 0,\n y: 0,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg',\n width: 16,\n height: 16,\n // 用于调整图标的左右位置\n offset: -5\n },\n // 连接点,默认为左右\n // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }]\n anchorPoints: [[0, 0.5], [1, 0.5]]\n },\n shapeType: 'modelRect',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).preRect,\n preRect = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n var keyShape = group.addShape('rect', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var preRectShow = preRect.show,\n preRectStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(preRect, [\"show\"]);\n if (preRectShow) {\n group['shapeMap']['pre-rect'] = group.addShape('rect', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n height: height\n }, preRectStyle),\n className: 'pre-rect',\n name: 'pre-rect',\n draggable: true\n });\n }\n this.drawLogoIcon(cfg, group);\n this.drawStateIcon(cfg, group);\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n /**\n * 绘制模型矩形左边的logo图标\n * @param {Object} cfg 数据配置项\n * @param {Group} group Group实例\n */\n drawLogoIcon: function drawLogoIcon(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).logoIcon,\n logoIcon = _a === void 0 ? {} : _a;\n var size = this.getSize(cfg);\n var width = size[0];\n if (logoIcon.show) {\n var w = logoIcon.width,\n h = logoIcon.height,\n x = logoIcon.x,\n y = logoIcon.y,\n offset = logoIcon.offset,\n text = logoIcon.text,\n logoIconStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(logoIcon, [\"width\", \"height\", \"x\", \"y\", \"offset\", \"text\"]);\n if (text) {\n group['shapeMap']['rect-logo-icon'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, logoIconStyle),\n className: 'rect-logo-icon',\n name: 'rect-logo-icon',\n draggable: true\n });\n } else {\n group['shapeMap']['rect-logo-icon'] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, logoIconStyle), {\n x: x || -width / 2 + w + offset,\n y: y || -h / 2,\n width: w,\n height: h\n }),\n className: 'rect-logo-icon',\n name: 'rect-logo-icon',\n draggable: true\n });\n }\n }\n },\n /**\n * 绘制模型矩形右边的状态图标\n * @param {Object} cfg 数据配置项\n * @param {Group} group Group实例\n */\n drawStateIcon: function drawStateIcon(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).stateIcon,\n stateIcon = _a === void 0 ? {} : _a;\n var size = this.getSize(cfg);\n var width = size[0];\n if (stateIcon.show) {\n var w = stateIcon.width,\n h = stateIcon.height,\n x = stateIcon.x,\n y = stateIcon.y,\n offset = stateIcon.offset,\n text = stateIcon.text,\n iconStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(stateIcon, [\"width\", \"height\", \"x\", \"y\", \"offset\", \"text\"]);\n if (text) {\n group['shapeMap']['rect-state-icon'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, iconStyle),\n className: 'rect-state-icon',\n name: 'rect-state-icon',\n draggable: true\n });\n } else {\n group['shapeMap']['rect-state-icon'] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, iconStyle), {\n x: x || width / 2 - w + offset,\n y: y || -h / 2,\n width: w,\n height: h\n }),\n className: 'rect-state-icon',\n name: 'rect-state-icon',\n draggable: true\n });\n }\n }\n },\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n if (left) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n if (right) {\n // right circle\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n if (top) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n if (bottom) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n },\n drawLabel: function drawLabel(cfg, group) {\n var _a = this.getOptions(cfg),\n _b = _a.labelCfg,\n labelCfg = _b === void 0 ? {} : _b,\n _c = _a.logoIcon,\n logoIcon = _c === void 0 ? {} : _c,\n _d = _a.descriptionCfg,\n descriptionCfg = _d === void 0 ? {} : _d;\n var size = this.getSize(cfg);\n var width = size[0];\n var label = null;\n var show = logoIcon.show,\n w = logoIcon.width;\n var offsetX = -width / 2 + labelCfg.offset;\n if (show) {\n offsetX = -width / 2 + w + labelCfg.offset;\n }\n var fontStyle = labelCfg.style;\n var descriptionStyle = descriptionCfg.style,\n descriptionPaddingTop = descriptionCfg.paddingTop;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(cfg.description)) {\n label = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, fontStyle), {\n x: offsetX,\n y: -5,\n text: cfg.label\n }),\n className: 'text-shape',\n name: 'text-shape',\n draggable: true,\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n group['shapeMap']['rect-description'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, descriptionStyle), {\n x: offsetX,\n y: 17 + (descriptionPaddingTop || 0),\n text: cfg.description\n }),\n className: 'rect-description',\n name: 'rect-description',\n draggable: true,\n labelRelated: true\n });\n } else {\n label = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, fontStyle), {\n x: offsetX,\n y: 7,\n text: cfg.label\n }),\n className: 'text-shape',\n name: 'text-shape',\n draggable: true,\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n }\n return label;\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var width = style.width || size[0];\n var height = style.height || size[1];\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height\n }, style);\n return styles;\n },\n update: function update(cfg, item) {\n var _a = this.mergeStyle || this.getOptions(cfg),\n _b = _a.style,\n style = _b === void 0 ? {} : _b,\n _c = _a.labelCfg,\n labelCfg = _c === void 0 ? {} : _c,\n _d = _a.descriptionCfg,\n descriptionCfg = _d === void 0 ? {} : _d;\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n var keyShape = item.get('keyShape');\n keyShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, style), {\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height\n }));\n var group = item.getContainer();\n var logoIconShape = group['shapeMap']['rect-logo-icon'] || group.find(function (element) {\n return element.get('className') === 'rect-logo-icon';\n });\n var currentLogoIconAttr = logoIconShape ? logoIconShape.attr() : {};\n var logoIcon = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, currentLogoIconAttr, cfg.logoIcon);\n var w = logoIcon.width;\n if (w === undefined) {\n w = this.options.logoIcon.width;\n }\n var show = cfg.logoIcon ? cfg.logoIcon.show : undefined;\n var offset = labelCfg.offset;\n var offsetX = -width / 2 + w + offset;\n if (!show && show !== undefined) {\n offsetX = -width / 2 + offset;\n }\n var label = group['shapeMap']['node-label'] || group.find(function (element) {\n return element.get('className') === 'node-label';\n });\n var description = group['shapeMap']['rect-description'] || group.find(function (element) {\n return element.get('className') === 'rect-description';\n });\n if (cfg.label) {\n if (!label) {\n group['shapeMap']['node-label'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, labelCfg.style), {\n x: offsetX,\n y: cfg.description ? -5 : 7,\n text: cfg.label\n }),\n className: 'node-label',\n name: 'node-label',\n draggable: true,\n labelRelated: true\n });\n } else {\n var cfgStyle = cfg.labelCfg ? cfg.labelCfg.style : {};\n var labelStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, label.attr(), cfgStyle);\n if (cfg.label) labelStyle.text = cfg.label;\n labelStyle.x = offsetX;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(cfg.description)) labelStyle.y = -5;\n if (description) {\n description.resetMatrix();\n description.attr({\n x: offsetX\n });\n }\n label.resetMatrix();\n label.attr(labelStyle);\n }\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(cfg.description)) {\n var paddingTop = descriptionCfg.paddingTop;\n if (!description) {\n group['shapeMap']['rect-description'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, descriptionCfg.style), {\n x: offsetX,\n y: 17 + (paddingTop || 0),\n text: cfg.description\n }),\n className: 'rect-description',\n name: 'rect-description',\n draggable: true,\n labelRelated: true\n });\n } else {\n var cfgStyle = cfg.descriptionCfg ? cfg.descriptionCfg.style : {};\n var descriptionStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, description.attr(), cfgStyle);\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(cfg.description)) descriptionStyle.text = cfg.description;\n descriptionStyle.x = offsetX;\n description.resetMatrix();\n description.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, descriptionStyle), {\n y: 17 + (paddingTop || 0)\n }));\n }\n }\n var preRectShape = group['shapeMap']['pre-rect'] || group.find(function (element) {\n return element.get('className') === 'pre-rect';\n });\n if (preRectShape && !preRectShape.destroyed) {\n var preRect = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, preRectShape.attr(), cfg.preRect);\n preRectShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, preRect), {\n x: -width / 2,\n y: -height / 2,\n height: height\n }));\n }\n if (logoIconShape && !logoIconShape.destroyed) {\n if (!show && show !== undefined) {\n logoIconShape.remove();\n delete group['shapeMap']['pre-rect'];\n } else {\n var logoW = logoIcon.width,\n h = logoIcon.height,\n x = logoIcon.x,\n y = logoIcon.y,\n logoOffset = logoIcon.offset,\n logoIconStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(logoIcon, [\"width\", \"height\", \"x\", \"y\", \"offset\"]);\n logoIconShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, logoIconStyle), {\n x: x || -width / 2 + logoW + logoOffset,\n y: y || -h / 2,\n width: logoW,\n height: h\n }));\n }\n } else if (show) {\n this.drawLogoIcon(cfg, group);\n }\n var stateIconShape = group['shapeMap']['rect-state-icon'] || group.find(function (element) {\n return element.get('className') === 'rect-state-icon';\n });\n var currentStateIconAttr = stateIconShape ? stateIconShape.attr() : {};\n var stateIcon = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, currentStateIconAttr, cfg.stateIcon);\n if (stateIconShape) {\n if (!stateIcon.show && stateIcon.show !== undefined) {\n stateIconShape.remove();\n delete group['shapeMap']['rect-state-icon'];\n }\n var stateW = stateIcon.width,\n h = stateIcon.height,\n x = stateIcon.x,\n y = stateIcon.y,\n stateOffset = stateIcon.offset,\n stateIconStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(stateIcon, [\"width\", \"height\", \"x\", \"y\", \"offset\"]);\n stateIconShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, stateIconStyle), {\n x: x || width / 2 - stateW + stateOffset,\n y: y || -h / 2,\n width: stateW,\n height: h\n }));\n } else if (stateIcon.show) {\n this.drawStateIcon(cfg, group);\n }\n this.updateLinkPoints(cfg, group);\n },\n getOptions: function getOptions(cfg, updateType) {\n if (updateType === 'move') return cfg;\n // different from baseShape, the config should be mixed when the updateType is not 'move'\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, this.options, this.getCustomConfig(cfg) || {}, cfg);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/modelRect.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/geometry/Box.js": +/***/ "./node_modules/@antv/g6-element/es/nodes/rect.js": /*!********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/geometry/Box.js ***! + !*** ./node_modules/@antv/g6-element/es/nodes/rect.js ***! \********************************************************/ -/*! exports provided: Box */ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Box\", function() { return Box; });\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/slicedToArray */ \"./node_modules/@babel/runtime/helpers/slicedToArray.js\");\n/* harmony import */ var _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! . */ \"./node_modules/@antv/g-webgpu/es/geometry/index.js\");\n\n\n\n\n\n\n\nvar _dec, _class;\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\n\nvar primitiveUv1Padding = 4.0 / 64;\nvar primitiveUv1PaddingScale = 1.0 - primitiveUv1Padding * 2;\nvar\n/**\n * borrow from playcanvas:\n * Creates a procedural box-shaped mesh\n */\nBox = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_8__[\"injectable\"])(), _dec(_class = /*#__PURE__*/function (_Geometry) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Box, _Geometry);\n\n var _super = _createSuper(Box);\n\n function Box() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Box);\n\n return _super.apply(this, arguments);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Box, [{\n key: \"onEntityCreated\",\n value: function onEntityCreated() {\n var _this$config = this.config,\n _this$config$widthSeg = _this$config.widthSegments,\n widthSegments = _this$config$widthSeg === void 0 ? 1 : _this$config$widthSeg,\n _this$config$heightSe = _this$config.heightSegments,\n heightSegments = _this$config$heightSe === void 0 ? 1 : _this$config$heightSe,\n _this$config$depthSeg = _this$config.depthSegments,\n depthSegments = _this$config$depthSeg === void 0 ? 1 : _this$config$depthSeg,\n _this$config$halfExte = _this$config.halfExtents,\n halfExtents = _this$config$halfExte === void 0 ? gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(0.5, 0.5, 0.5) : _this$config$halfExte;\n var ws = widthSegments;\n var hs = heightSegments;\n var ds = depthSegments;\n\n var _halfExtents = _babel_runtime_helpers_slicedToArray__WEBPACK_IMPORTED_MODULE_0___default()(halfExtents, 3),\n hex = _halfExtents[0],\n hey = _halfExtents[1],\n hez = _halfExtents[2];\n\n var corners = [gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(-hex, -hey, hez), gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(hex, -hey, hez), gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(hex, hey, hez), gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(-hex, hey, hez), gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(hex, -hey, -hez), gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(-hex, -hey, -hez), gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(-hex, hey, -hez), gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].fromValues(hex, hey, -hez)];\n var faceAxes = [[0, 1, 3], // FRONT\n [4, 5, 7], // BACK\n [3, 2, 6], // TOP\n [1, 0, 4], // BOTTOM\n [1, 4, 2], // RIGHT\n [5, 0, 6] // LEFT\n ];\n var faceNormals = [[0, 0, 1], // FRONT\n [0, 0, -1], // BACK\n [0, 1, 0], // TOP\n [0, -1, 0], // BOTTOM\n [1, 0, 0], // RIGHT\n [-1, 0, 0] // LEFT\n ];\n var sides = {\n FRONT: 0,\n BACK: 1,\n TOP: 2,\n BOTTOM: 3,\n RIGHT: 4,\n LEFT: 5\n };\n var positions = [];\n var normals = [];\n var uvs = [];\n var uvs1 = [];\n var indices = [];\n var vcounter = 0;\n\n var generateFace = function generateFace(side, uSegments, vSegments) {\n var u;\n var v;\n var i;\n var j;\n\n for (i = 0; i <= uSegments; i++) {\n for (j = 0; j <= vSegments; j++) {\n var temp1 = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].create();\n var temp2 = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].create();\n var temp3 = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].create();\n var r = gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].create();\n gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].lerp(temp1, corners[faceAxes[side][0]], corners[faceAxes[side][1]], i / uSegments);\n gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].lerp(temp2, corners[faceAxes[side][0]], corners[faceAxes[side][2]], j / vSegments);\n gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].sub(temp3, temp2, corners[faceAxes[side][0]]);\n gl_matrix__WEBPACK_IMPORTED_MODULE_7__[\"vec3\"].add(r, temp1, temp3);\n u = i / uSegments;\n v = j / vSegments;\n positions.push(r[0], r[1], r[2]);\n normals.push(faceNormals[side][0], faceNormals[side][1], faceNormals[side][2]);\n uvs.push(u, v); // pack as 3x2\n // 1/3 will be empty, but it's either that or stretched pixels\n // TODO: generate non-rectangular lightMaps, so we could use space without stretching\n\n u /= 3;\n v /= 3;\n u = u * primitiveUv1PaddingScale + primitiveUv1Padding;\n v = v * primitiveUv1PaddingScale + primitiveUv1Padding;\n u += side % 3 / 3;\n v += Math.floor(side / 3) / 3;\n uvs1.push(u, v);\n\n if (i < uSegments && j < vSegments) {\n indices.push(vcounter + vSegments + 1, vcounter + 1, vcounter);\n indices.push(vcounter + vSegments + 1, vcounter + vSegments + 2, vcounter + 1);\n }\n\n vcounter++;\n }\n }\n };\n\n generateFace(sides.FRONT, ws, hs);\n generateFace(sides.BACK, ws, hs);\n generateFace(sides.TOP, ws, ds);\n generateFace(sides.BOTTOM, ws, ds);\n generateFace(sides.RIGHT, ds, hs);\n generateFace(sides.LEFT, ds, hs); // generate AABB\n\n var aabb = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__[\"generateAABBFromVertices\"])(positions);\n var component = this.getComponent();\n component.indices = Uint32Array.from(indices);\n component.aabb = aabb;\n component.vertexCount = vcounter;\n component.attributes = [{\n dirty: true,\n name: 'position',\n data: Float32Array.from(positions),\n arrayStride: 4 * 3,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 0,\n offset: 0,\n format: 'float3'\n }]\n }, {\n dirty: true,\n name: 'normal',\n data: Float32Array.from(normals),\n arrayStride: 4 * 3,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 1,\n offset: 0,\n format: 'float3'\n }]\n }, {\n dirty: true,\n name: 'uv',\n data: Float32Array.from(uvs),\n arrayStride: 4 * 2,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 2,\n offset: 0,\n format: 'float2'\n }]\n }]; // TODO: barycentric & tangent\n }\n }]);\n\n return Box;\n}(___WEBPACK_IMPORTED_MODULE_9__[\"Geometry\"])) || _class);\n//# sourceMappingURL=Box.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/geometry/Box.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n\n\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"registerNode\"])('rect', {\n // 自定义节点时的配置\n options: {\n size: [100, 30],\n style: {\n radius: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n // 连接点,默认为左右\n // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }]\n anchorPoints: [[0, 0.5], [1, 0.5]],\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'rect',\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('rect', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n if (left) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n if (right) {\n // right circle\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n if (top) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n if (bottom) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var width = style.width || size[0];\n var height = style.height || size[1];\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height\n }, style);\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer();\n // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n var defaultStyle = this.getOptions({}).style;\n var size = this.getSize(cfg);\n var keyShape = item.get('keyShape');\n if (!cfg.size) {\n size[0] = keyShape.attr('width') || defaultStyle.width;\n size[1] = keyShape.attr('height') || defaultStyle.height;\n }\n // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n var strokeStyle = {\n stroke: cfg.color,\n x: -size[0] / 2,\n y: -size[1] / 2,\n width: size[0],\n height: size[1]\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, false, updateType);\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/rect.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/geometry/Merged.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/geometry/Merged.js ***! - \***********************************************************/ -/*! exports provided: Merged */ +/***/ "./node_modules/@antv/g6-element/es/nodes/star.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/nodes/star.js ***! + \********************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Merged\", function() { return Merged; });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! . */ \"./node_modules/@antv/g-webgpu/es/geometry/index.js\");\n/* harmony import */ var _utils_is_number__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../utils/is-number */ \"./node_modules/@antv/g-webgpu/es/utils/is-number.js\");\n/* harmony import */ var _utils_is_typedarray__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../utils/is-typedarray */ \"./node_modules/@antv/g-webgpu/es/utils/is-typedarray.js\");\n/* harmony import */ var _utils_typedarray__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../utils/typedarray */ \"./node_modules/@antv/g-webgpu/es/utils/typedarray.js\");\n\n\n\n\n\n\n\nvar _dec, _class;\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_5___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_4___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\n\n\n\nvar\n/**\n * merge many geometries into one, use a batch of draw calls\n */\nMerged = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_7__[\"injectable\"])(), _dec(_class = /*#__PURE__*/function (_Geometry) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_3___default()(Merged, _Geometry);\n\n var _super = _createSuper(Merged);\n\n function Merged() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Merged);\n\n return _super.apply(this, arguments);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Merged, [{\n key: \"onEntityCreated\",\n value: function onEntityCreated() {\n var _this$config$geometri = this.config.geometries,\n geometries = _this$config$geometri === void 0 ? [] : _this$config$geometri;\n var mergedComponent = this.getComponent();\n mergedComponent.aabb = new _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_6__[\"AABB\"]();\n var mergedAttributes = [];\n var mergedIndices = [];\n var indexOffset = 0;\n geometries.forEach(function (geometry) {\n var aabb = geometry.aabb,\n indices = geometry.indices,\n vertexCount = geometry.vertexCount,\n attributes = geometry.attributes; // merge aabb\n\n mergedComponent.aabb.add(aabb);\n mergedComponent.vertexCount += vertexCount; // merge indices\n\n if (indices) {\n mergedIndices.push.apply(mergedIndices, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(indices.map(function (index) {\n return index + indexOffset;\n })));\n }\n\n indexOffset += vertexCount; // merge attributes\n\n attributes.forEach(function (attribute, i) {\n if (!mergedAttributes[i]) {\n mergedAttributes[i] = attribute;\n mergedAttributes[i].dirty = true;\n } else {\n if (attribute.data) {\n if (Object(_utils_is_number__WEBPACK_IMPORTED_MODULE_9__[\"isNumber\"])(attribute.data)) {\n // @ts-ignore\n mergedAttributes[i].push(attribute.data);\n } else if (Object(_utils_is_typedarray__WEBPACK_IMPORTED_MODULE_10__[\"isTypedArray\"])(attribute.data)) {\n // @ts-ignore\n mergedAttributes[i].data = Object(_utils_typedarray__WEBPACK_IMPORTED_MODULE_11__[\"merge\"])( // @ts-ignore\n mergedAttributes[i].data, attribute.data);\n } else {\n // @ts-ignore\n mergedAttributes[i].data = mergedAttributes[i].data.concat(attribute.data);\n }\n }\n }\n });\n });\n mergedComponent.attributes = mergedAttributes;\n mergedComponent.indices = Uint32Array.from(mergedIndices);\n mergedComponent.dirty = true;\n }\n }]);\n\n return Merged;\n}(___WEBPACK_IMPORTED_MODULE_8__[\"Geometry\"])) || _class);\n//# sourceMappingURL=Merged.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/geometry/Merged.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n// 五角星shape\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('star', {\n // 自定义节点时的配置\n options: {\n size: 60,\n style: {\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'star',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n icon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('path', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var w = icon.width,\n h = icon.height,\n show = icon.show,\n text = icon.text;\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -w / 2,\n y: -h / 2\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n leftBottom = linkPoints.leftBottom,\n rightBottom = linkPoints.rightBottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"leftBottom\", \"rightBottom\", \"size\", \"r\"]);\n var size = this.getSize(cfg);\n var outerR = size[0];\n if (right) {\n // right circle\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 0) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 0) / 180 * Math.PI) * outerR;\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right'\n });\n }\n if (top) {\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 1) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 1) / 180 * Math.PI) * outerR;\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top'\n });\n }\n if (left) {\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 2) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 2) / 180 * Math.PI) * outerR;\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left'\n });\n }\n if (leftBottom) {\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 3) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 3) / 180 * Math.PI) * outerR;\n // left bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left-bottom',\n name: 'link-point-left-bottom'\n });\n }\n if (rightBottom) {\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 4) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 4) / 180 * Math.PI) * outerR;\n // left bottom circle\n group['shapeMap']['link-point-right-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right-bottom',\n name: 'link-point-right-bottom'\n });\n }\n },\n getPath: function getPath(cfg) {\n var size = this.getSize(cfg);\n var outerR = size[0];\n var defaultInnerR = outerR * 3 / 8;\n var innerR = cfg.innerR || defaultInnerR;\n return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].getStarPath(outerR, innerR);\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖原来默认的 stroke 属性。但 cfg 中但 stroke 属性优先级更高\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, strokeStyle);\n var path = this.getPath(cfg);\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: path\n }, style);\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer();\n // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n var defaultStyle = this.getOptions({}).style;\n var path = this.getPath(cfg);\n // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n var strokeStyle = {\n stroke: cfg.color,\n path: path\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n },\n /**\n * 更新linkPoints\n * @param {Object} cfg 节点数据配置项\n * @param {Group} group Item所在的group\n */\n updateLinkPoints: function updateLinkPoints(cfg, group) {\n var defaultLinkPoints = this.getOptions({}).linkPoints;\n var markLeft = group['shapeMap']['link-point-left'] || group.find(function (element) {\n return element.get('className') === 'link-point-left';\n });\n var markRight = group['shapeMap']['link-point-right'] || group.find(function (element) {\n return element.get('className') === 'link-point-right';\n });\n var markTop = group['shapeMap']['link-point-top'] || group.find(function (element) {\n return element.get('className') === 'link-point-top';\n });\n var markLeftBottom = group['shapeMap']['link-point-left-bottom'] || group.find(function (element) {\n return element.get('className') === 'link-point-left-bottom';\n });\n var markRightBottom = group['shapeMap']['link-point-left-bottom'] || group.find(function (element) {\n return element.get('className') === 'link-point-right-bottom';\n });\n var currentLinkPoints = defaultLinkPoints;\n var existLinkPoint = markLeft || markRight || markTop || markLeftBottom || markRightBottom;\n if (existLinkPoint) {\n currentLinkPoints = existLinkPoint.attr();\n }\n var linkPoints = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, currentLinkPoints, cfg.linkPoints);\n var markFill = linkPoints.fill,\n markStroke = linkPoints.stroke,\n borderWidth = linkPoints.lineWidth;\n var markSize = linkPoints.size / 2;\n if (!markSize) markSize = linkPoints.r;\n var _a = cfg.linkPoints ? cfg.linkPoints : {\n left: undefined,\n right: undefined,\n top: undefined,\n leftBottom: undefined,\n rightBottom: undefined\n },\n left = _a.left,\n right = _a.right,\n top = _a.top,\n leftBottom = _a.leftBottom,\n rightBottom = _a.rightBottom;\n var size = this.getSize(cfg);\n var outerR = size[0];\n var styles = {\n r: markSize,\n fill: markFill,\n stroke: markStroke,\n lineWidth: borderWidth\n };\n var x = Math.cos((18 + 72 * 0) / 180 * Math.PI) * outerR;\n var y = Math.sin((18 + 72 * 0) / 180 * Math.PI) * outerR;\n if (markRight) {\n if (!right && right !== undefined) {\n markRight.remove();\n delete group['shapeMap']['link-point-right'];\n } else {\n markRight.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (right) {\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n x = Math.cos((18 + 72 * 1) / 180 * Math.PI) * outerR;\n y = Math.sin((18 + 72 * 1) / 180 * Math.PI) * outerR;\n if (markTop) {\n if (!top && top !== undefined) {\n markTop.remove();\n delete group['shapeMap']['link-point-top'];\n } else {\n markTop.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (top) {\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n x = Math.cos((18 + 72 * 2) / 180 * Math.PI) * outerR;\n y = Math.sin((18 + 72 * 2) / 180 * Math.PI) * outerR;\n if (markLeft) {\n if (!left && left !== undefined) {\n markLeft.remove();\n delete group['shapeMap']['link-point-left'];\n } else {\n markLeft.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (left) {\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n x = Math.cos((18 + 72 * 3) / 180 * Math.PI) * outerR;\n y = Math.sin((18 + 72 * 3) / 180 * Math.PI) * outerR;\n if (markLeftBottom) {\n if (!leftBottom && leftBottom !== undefined) {\n markLeftBottom.remove();\n delete group['shapeMap']['link-point-left-bottom'];\n } else {\n markLeftBottom.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (leftBottom) {\n group['shapeMap']['link-point-left-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-left-bottom',\n name: 'link-point-left-bottom',\n isAnchorPoint: true\n });\n }\n x = Math.cos((18 + 72 * 4) / 180 * Math.PI) * outerR;\n y = Math.sin((18 + 72 * 4) / 180 * Math.PI) * outerR;\n if (markRightBottom) {\n if (!rightBottom && rightBottom !== undefined) {\n markRightBottom.remove();\n delete group['shapeMap']['link-point-right-bottom'];\n } else {\n markRightBottom.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (rightBottom) {\n group['shapeMap']['link-point-right-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-right-bottom',\n name: 'link-point-right-bottom',\n isAnchorPoint: true\n });\n }\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/star.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/geometry/Plane.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/geometry/Plane.js ***! - \**********************************************************/ -/*! exports provided: Plane */ +/***/ "./node_modules/@antv/g6-element/es/nodes/triangle.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/g6-element/es/nodes/triangle.js ***! + \************************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Plane\", function() { return Plane; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! . */ \"./node_modules/@antv/g-webgpu/es/geometry/index.js\");\n\n\n\n\n\n\nvar _dec, _class;\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\nvar\n/**\n * borrow from playcanvas\n */\nPlane = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"injectable\"])(), _dec(_class = /*#__PURE__*/function (_Geometry) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(Plane, _Geometry);\n\n var _super = _createSuper(Plane);\n\n function Plane() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Plane);\n\n return _super.apply(this, arguments);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Plane, [{\n key: \"onEntityCreated\",\n value: function onEntityCreated() {\n var _this$config = this.config,\n _this$config$halfExte = _this$config.halfExtents,\n halfExtents = _this$config$halfExte === void 0 ? [0.5, 0.5] : _this$config$halfExte,\n _this$config$widthSeg = _this$config.widthSegments,\n widthSegments = _this$config$widthSeg === void 0 ? 5 : _this$config$widthSeg,\n _this$config$lengthSe = _this$config.lengthSegments,\n lengthSegments = _this$config$lengthSe === void 0 ? 5 : _this$config$lengthSe;\n var positions = [];\n var normals = [];\n var uvs = [];\n var indices = [];\n var vcounter = 0;\n\n for (var i = 0; i <= widthSegments; i++) {\n for (var j = 0; j <= lengthSegments; j++) {\n var x = -halfExtents[0] + 2.0 * halfExtents[0] * i / widthSegments;\n var y = 0.0;\n var z = -(-halfExtents[1] + 2.0 * halfExtents[1] * j / lengthSegments);\n var u = i / widthSegments;\n var v = j / lengthSegments;\n positions.push(x, y, z);\n normals.push(0.0, 1.0, 0.0);\n uvs.push(u, v);\n\n if (i < widthSegments && j < lengthSegments) {\n indices.push(vcounter + lengthSegments + 1, vcounter + 1, vcounter);\n indices.push(vcounter + lengthSegments + 1, vcounter + lengthSegments + 2, vcounter + 1);\n }\n\n vcounter++;\n }\n } // generate AABB\n\n\n var aabb = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"generateAABBFromVertices\"])(positions);\n var component = this.getComponent();\n component.indices = Uint32Array.from(indices);\n component.aabb = aabb;\n component.vertexCount = vcounter;\n component.attributes = [{\n dirty: true,\n name: 'position',\n data: Float32Array.from(positions),\n arrayStride: 4 * 3,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 0,\n offset: 0,\n format: 'float3'\n }]\n }, {\n dirty: true,\n name: 'normal',\n data: Float32Array.from(normals),\n arrayStride: 4 * 3,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 1,\n offset: 0,\n format: 'float3'\n }]\n }, {\n dirty: true,\n name: 'uv',\n data: Float32Array.from(uvs),\n arrayStride: 4 * 2,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 2,\n offset: 0,\n format: 'float2'\n }]\n }]; // TODO: barycentric & tangent\n }\n }]);\n\n return Plane;\n}(___WEBPACK_IMPORTED_MODULE_7__[\"Geometry\"])) || _class);\n//# sourceMappingURL=Plane.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/geometry/Plane.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n// 三角形\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('triangle', {\n // 自定义节点时的配置\n options: {\n size: 40,\n direction: 'up',\n style: {\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize\n },\n offset: 15\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20,\n offset: 6\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'triangle',\n // 文本位置\n labelPosition: 'bottom',\n drawShape: function drawShape(cfg, group) {\n var _a = this.mergeStyle || this.getOptions(cfg),\n _b = _a.icon,\n icon = _b === void 0 ? {} : _b,\n defaultDirection = _a.direction;\n var style = this.getShapeStyle(cfg);\n var direction = cfg.direction || defaultDirection;\n var keyShape = group.addShape('path', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var w = icon.width,\n h = icon.height,\n show = icon.show,\n offset = icon.offset,\n text = icon.text;\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n var iconW = -w / 2;\n var iconH = -h / 2;\n if (direction === 'up' || direction === 'down') {\n iconH += offset;\n }\n if (direction === 'left' || direction === 'right') {\n iconW += offset;\n }\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: iconW,\n y: iconH\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = this.mergeStyle || this.getOptions(cfg),\n _b = _a.linkPoints,\n linkPoints = _b === void 0 ? {} : _b,\n defaultDirection = _a.direction;\n var direction = cfg.direction || defaultDirection;\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n var size = this.getSize(cfg);\n var len = size[0];\n if (left) {\n // up down left right 四个方向的坐标均不相同\n var leftPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n if (direction === 'up') {\n leftPos = [-r, diffY];\n } else if (direction === 'down') {\n leftPos = [-r, -diffY];\n } else if (direction === 'left') {\n leftPos = [-r, r - diffY];\n }\n if (leftPos) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: leftPos[0],\n y: leftPos[1],\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left'\n });\n }\n }\n if (right) {\n // right circle\n // up down left right 四个方向的坐标均不相同\n var rightPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n if (direction === 'up') {\n rightPos = [r, diffY];\n } else if (direction === 'down') {\n rightPos = [r, -diffY];\n } else if (direction === 'right') {\n rightPos = [r, r - diffY];\n }\n if (rightPos) {\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: rightPos[0],\n y: rightPos[1],\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right'\n });\n }\n }\n if (top) {\n // up down left right 四个方向的坐标均不相同\n var topPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n if (direction === 'up') {\n topPos = [r - diffY, -diffY];\n } else if (direction === 'left') {\n topPos = [r, -diffY];\n } else if (direction === 'right') {\n topPos = [-r, -diffY];\n }\n if (topPos) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: topPos[0],\n y: topPos[1],\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top'\n });\n }\n }\n if (bottom) {\n // up down left right 四个方向的坐标均不相同\n var bottomPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n if (direction === 'down') {\n bottomPos = [-r + diffY, diffY];\n } else if (direction === 'left') {\n bottomPos = [r, diffY];\n } else if (direction === 'right') {\n bottomPos = [-r, diffY];\n }\n if (bottomPos) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: bottomPos[0],\n y: bottomPos[1],\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom'\n });\n }\n }\n },\n getPath: function getPath(cfg) {\n var defaultDirection = (this.mergeStyle || this.getOptions(cfg)).direction;\n var direction = cfg.direction || defaultDirection;\n var size = this.getSize(cfg);\n var len = size[0];\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n var path = [['M', -r, diffY], ['L', 0, -diffY], ['L', r, diffY], ['Z'] // 封闭\n ];\n\n if (direction === 'down') {\n path = [['M', -r, -diffY], ['L', r, -diffY], ['L', 0, diffY], ['Z'] // 封闭\n ];\n } else if (direction === 'left') {\n path = [['M', -r, r - diffY], ['L', r, -r], ['L', r, r], ['Z'] // 封闭\n ];\n } else if (direction === 'right') {\n path = [['M', r, r - diffY], ['L', -r, r], ['L', -r, -r], ['Z'] // 封闭\n ];\n }\n\n return path;\n },\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n };\n // 如果设置了color,则覆盖默认的stroke属性\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, strokeStyle);\n var path = this.getPath(cfg);\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: path\n }, style);\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer();\n // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n var defaultStyle = this.getOptions({}).style;\n var path = this.getPath(cfg);\n // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n var strokeStyle = {\n stroke: cfg.color,\n path: path\n };\n // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n },\n /**\n * 更新linkPoints\n * @param {Object} cfg 节点数据配置项\n * @param {Group} group Item所在的group\n */\n updateLinkPoints: function updateLinkPoints(cfg, group) {\n var _a = this.getOptions({}),\n defaultLinkPoints = _a.linkPoints,\n defaultDirection = _a.direction;\n var direction = cfg.direction || defaultDirection;\n var markLeft = group['shapeMap']['link-point-left'] || group.find(function (element) {\n return element.get('className') === 'link-point-left';\n });\n var markRight = group['shapeMap']['link-point-right'] || group.find(function (element) {\n return element.get('className') === 'link-point-right';\n });\n var markTop = group['shapeMap']['link-point-top'] || group.find(function (element) {\n return element.get('className') === 'link-point-top';\n });\n var markBottom = group['shapeMap']['link-point-bottom'] || group.find(function (element) {\n return element.get('className') === 'link-point-bottom';\n });\n var currentLinkPoints = defaultLinkPoints;\n var existLinkPoint = markLeft || markRight || markTop || markBottom;\n if (existLinkPoint) {\n currentLinkPoints = existLinkPoint.attr();\n }\n var linkPoints = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, currentLinkPoints, cfg.linkPoints);\n var markFill = linkPoints.fill,\n markStroke = linkPoints.stroke,\n borderWidth = linkPoints.lineWidth;\n var markSize = linkPoints.size / 2;\n if (!markSize) markSize = linkPoints.r;\n var _b = cfg.linkPoints ? cfg.linkPoints : {\n left: undefined,\n right: undefined,\n top: undefined,\n bottom: undefined\n },\n left = _b.left,\n right = _b.right,\n top = _b.top,\n bottom = _b.bottom;\n var size = this.getSize(cfg);\n var len = size[0];\n var styles = {\n r: markSize,\n fill: markFill,\n stroke: markStroke,\n lineWidth: borderWidth\n };\n var leftPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n if (direction === 'up') {\n leftPos = [-r, diffY];\n } else if (direction === 'down') {\n leftPos = [-r, -diffY];\n } else if (direction === 'left') {\n leftPos = [-r, r - diffY];\n }\n if (leftPos) {\n if (markLeft) {\n if (!left && left !== undefined) {\n markLeft.remove();\n delete group['shapeMap']['link-point-left'];\n } else {\n markLeft.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: leftPos[0],\n y: leftPos[1]\n }));\n }\n } else if (left) {\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: leftPos[0],\n y: leftPos[1]\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n }\n var rightPos = null;\n if (direction === 'up') {\n rightPos = [r, diffY];\n } else if (direction === 'down') {\n rightPos = [r, -diffY];\n } else if (direction === 'right') {\n rightPos = [r, r - diffY];\n }\n if (rightPos) {\n if (markRight) {\n if (!right && right !== undefined) {\n markRight.remove();\n delete group['shapeMap']['link-point-right'];\n } else {\n markRight.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: rightPos[0],\n y: rightPos[1]\n }));\n }\n } else if (right) {\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: rightPos[0],\n y: rightPos[1]\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n }\n var topPos = null;\n if (direction === 'up') {\n topPos = [r - diffY, -diffY];\n } else if (direction === 'left') {\n topPos = [r, -diffY];\n } else if (direction === 'right') {\n topPos = [-r, -diffY];\n }\n if (topPos) {\n if (markTop) {\n if (!top && top !== undefined) {\n markTop.remove();\n delete group['shapeMap']['link-point-top'];\n } else {\n // top circle\n markTop.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: topPos[0],\n y: topPos[1]\n }));\n }\n } else if (top) {\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: topPos[0],\n y: topPos[1]\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n }\n var bottomPos = null;\n if (direction === 'down') {\n bottomPos = [-r + diffY, diffY];\n } else if (direction === 'left') {\n bottomPos = [r, diffY];\n } else if (direction === 'right') {\n bottomPos = [-r, diffY];\n }\n if (bottomPos) {\n if (markBottom) {\n if (!bottom && bottom !== undefined) {\n markBottom.remove();\n delete group['shapeMap']['link-point-bottom'];\n } else {\n markBottom.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: bottomPos[0],\n y: bottomPos[1]\n }));\n }\n } else if (bottom) {\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: bottomPos[0],\n y: bottomPos[1]\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n }\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/triangle.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/geometry/Sphere.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/geometry/Sphere.js ***! - \***********************************************************/ -/*! exports provided: Sphere */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/activate-relations.js": +/*!********************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/activate-relations.js ***! + \********************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Sphere\", function() { return Sphere; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! . */ \"./node_modules/@antv/g-webgpu/es/geometry/index.js\");\n\n\n\n\n\n\nvar _dec, _class;\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_4___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_3___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\nvar\n/**\n * borrow from playcanvas\n */\nSphere = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"injectable\"])(), _dec(_class = /*#__PURE__*/function (_Geometry) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_2___default()(Sphere, _Geometry);\n\n var _super = _createSuper(Sphere);\n\n function Sphere() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, Sphere);\n\n return _super.apply(this, arguments);\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(Sphere, [{\n key: \"onEntityCreated\",\n value: function onEntityCreated() {\n var _this$config = this.config,\n _this$config$radius = _this$config.radius,\n radius = _this$config$radius === void 0 ? 0.5 : _this$config$radius,\n _this$config$latitude = _this$config.latitudeBands,\n latitudeBands = _this$config$latitude === void 0 ? 16 : _this$config$latitude,\n _this$config$longitud = _this$config.longitudeBands,\n longitudeBands = _this$config$longitud === void 0 ? 16 : _this$config$longitud;\n var positions = [];\n var normals = [];\n var uvs = [];\n var indices = [];\n\n for (var lat = 0; lat <= latitudeBands; lat++) {\n var theta = lat * Math.PI / latitudeBands;\n var sinTheta = Math.sin(theta);\n var cosTheta = Math.cos(theta);\n\n for (var lon = 0; lon <= longitudeBands; lon++) {\n // Sweep the sphere from the positive Z axis to match a 3DS Max sphere\n var phi = lon * 2 * Math.PI / longitudeBands - Math.PI / 2.0;\n var sinPhi = Math.sin(phi);\n var cosPhi = Math.cos(phi);\n var x = cosPhi * sinTheta;\n var y = cosTheta;\n var z = sinPhi * sinTheta;\n var u = 1.0 - lon / longitudeBands;\n var v = 1.0 - lat / latitudeBands;\n positions.push(x * radius, y * radius, z * radius);\n normals.push(x, y, z);\n uvs.push(u, v);\n }\n }\n\n for (var _lat = 0; _lat < latitudeBands; ++_lat) {\n for (var _lon = 0; _lon < longitudeBands; ++_lon) {\n var first = _lat * (longitudeBands + 1) + _lon;\n var second = first + longitudeBands + 1;\n indices.push(first + 1, second, first);\n indices.push(first + 1, second + 1, second);\n }\n } // generate AABB\n\n\n var aabb = Object(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"generateAABBFromVertices\"])(positions);\n var component = this.getComponent();\n component.indices = Uint32Array.from(indices);\n component.aabb = aabb;\n component.vertexCount = positions.length / 3;\n component.attributes = [{\n dirty: true,\n name: 'position',\n data: Float32Array.from(positions),\n arrayStride: 4 * 3,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 0,\n offset: 0,\n format: 'float3'\n }]\n }, {\n dirty: true,\n name: 'normal',\n data: Float32Array.from(normals),\n arrayStride: 4 * 3,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 1,\n offset: 0,\n format: 'float3'\n }]\n }, {\n dirty: true,\n name: 'uv',\n data: Float32Array.from(uvs),\n arrayStride: 4 * 2,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 2,\n offset: 0,\n format: 'float2'\n }]\n }]; // TODO: barycentric & tangent\n }\n }]);\n\n return Sphere;\n}(___WEBPACK_IMPORTED_MODULE_7__[\"Geometry\"])) || _class);\n//# sourceMappingURL=Sphere.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/geometry/Sphere.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar clickNodeId = null;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n // 可选 mouseenter || click\n // 选择 click 会监听 touch,mouseenter 不会监听\n trigger: 'mouseenter',\n activeState: 'active',\n inactiveState: 'inactive',\n resetSelected: false,\n shouldClearStatusOnSecond: false,\n shouldUpdate: function shouldUpdate() {\n return true;\n }\n };\n },\n getEvents: function getEvents() {\n if (this.get('trigger') === 'mouseenter') {\n return {\n 'node:mouseenter': 'setAllItemStates',\n 'combo:mouseenter': 'setAllItemStates',\n 'node:mouseleave': 'clearActiveState',\n 'combo:mouseleave': 'clearActiveState'\n };\n }\n return {\n 'node:click': 'setAllItemStates',\n 'combo:click': 'setAllItemStates',\n 'canvas:click': 'clearActiveState',\n 'node:touchstart': 'setOnTouchStart',\n 'combo:touchstart': 'setOnTouchStart',\n 'canvas:touchstart': 'clearOnTouchStart'\n };\n },\n setOnTouchStart: function setOnTouchStart(e) {\n var self = this;\n try {\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n if (event1 && event2) {\n return;\n }\n e.preventDefault();\n } catch (e) {\n console.warn('Touch original event not exist!');\n }\n self.setAllItemStates(e);\n },\n clearOnTouchStart: function clearOnTouchStart(e) {\n var self = this;\n try {\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n if (event1 && event2) {\n return;\n }\n e.preventDefault();\n } catch (e) {\n console.warn('Touch original event not exist!');\n }\n self.clearActiveState(e);\n },\n setAllItemStates: function setAllItemStates(e) {\n clearTimeout(this.timer);\n this.throttleSetAllItemStates(e, this);\n },\n clearActiveState: function clearActiveState(e) {\n var _this = this;\n // avoid clear state frequently, it costs a lot since all the items' states on the graph need to be cleared\n var shouldClearStatusOnSecond = this.shouldClearStatusOnSecond;\n if (shouldClearStatusOnSecond) {\n clickNodeId = null;\n }\n this.timer = setTimeout(function () {\n _this.throttleClearActiveState(e, _this);\n }, 50);\n },\n throttleSetAllItemStates: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"throttle\"])(function (e, self) {\n var item = e.item;\n var graph = self.graph;\n if (!graph || graph.destroyed) return;\n self.item = item;\n if (!self.shouldUpdate(e.item, {\n event: e,\n action: 'activate'\n }, self)) {\n return;\n }\n var shouldClearStatusOnSecond = self.shouldClearStatusOnSecond;\n var currentNodeId = item.getModel().id;\n if (clickNodeId === currentNodeId && shouldClearStatusOnSecond) {\n self.throttleClearActiveState(e, self);\n clickNodeId = null;\n return;\n }\n var activeState = self.activeState;\n var inactiveState = self.inactiveState;\n var nodes = graph.getNodes();\n var combos = graph.getCombos();\n var edges = graph.getEdges();\n var vEdges = graph.get('vedges');\n var nodeLength = nodes.length;\n var comboLength = combos.length;\n var edgeLength = edges.length;\n var vEdgeLength = vEdges.length;\n var inactiveItems = self.inactiveItems || {};\n var activeItems = self.activeItems || {};\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n var nodeId = node.getID();\n var hasSelected = node.hasState('selected');\n if (self.resetSelected) {\n if (hasSelected) {\n graph.setItemState(node, 'selected', false);\n }\n }\n if (activeItems[nodeId]) {\n graph.setItemState(node, activeState, false);\n delete activeItems[nodeId];\n }\n if (inactiveState && !inactiveItems[nodeId]) {\n graph.setItemState(node, inactiveState, true);\n inactiveItems[nodeId] = node;\n }\n }\n for (var i = 0; i < comboLength; i++) {\n var combo = combos[i];\n var comboId = combo.getID();\n var hasSelected = combo.hasState('selected');\n if (self.resetSelected) {\n if (hasSelected) {\n graph.setItemState(combo, 'selected', false);\n }\n }\n if (activeItems[comboId]) {\n graph.setItemState(combo, activeState, false);\n delete activeItems[comboId];\n }\n if (inactiveState && !inactiveItems[comboId]) {\n graph.setItemState(combo, inactiveState, true);\n inactiveItems[comboId] = combo;\n }\n }\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n var edgeId = edge.getID();\n if (activeItems[edgeId]) {\n graph.setItemState(edge, activeState, false);\n delete activeItems[edgeId];\n }\n if (inactiveState && !inactiveItems[edgeId]) {\n graph.setItemState(edge, inactiveState, true);\n inactiveItems[edgeId] = edge;\n }\n }\n for (var i = 0; i < vEdgeLength; i++) {\n var vEdge = vEdges[i];\n var vEdgeId = vEdge.getID();\n if (activeItems[vEdgeId]) {\n graph.setItemState(vEdge, activeState, false);\n delete activeItems[vEdgeId];\n }\n if (inactiveState && !inactiveItems[vEdgeId]) {\n graph.setItemState(vEdge, inactiveState, true);\n inactiveItems[vEdgeId] = vEdge;\n }\n }\n if (item && !item.destroyed) {\n if (inactiveState) {\n graph.setItemState(item, inactiveState, false);\n delete inactiveItems[item.getID()];\n }\n if (!activeItems[item.getID()]) {\n graph.setItemState(item, activeState, true);\n activeItems[item.getID()] = item;\n }\n var rEdges = item.getEdges();\n var rEdgeLegnth = rEdges.length;\n for (var i = 0; i < rEdgeLegnth; i++) {\n var edge = rEdges[i];\n var edgeId = edge.getID();\n var otherEnd = void 0;\n if (edge.getSource() === item) {\n otherEnd = edge.getTarget();\n } else {\n otherEnd = edge.getSource();\n }\n var otherEndId = otherEnd.getID();\n if (inactiveState && inactiveItems[otherEndId]) {\n graph.setItemState(otherEnd, inactiveState, false);\n delete inactiveItems[otherEndId];\n }\n if (!activeItems[otherEndId]) {\n graph.setItemState(otherEnd, activeState, true);\n activeItems[otherEndId] = otherEnd;\n }\n if (inactiveItems[edgeId]) {\n graph.setItemState(edge, inactiveState, false);\n delete inactiveItems[edgeId];\n }\n if (!activeItems[edgeId]) {\n graph.setItemState(edge, activeState, true);\n activeItems[edgeId] = edge;\n }\n edge.toFront();\n }\n }\n self.activeItems = activeItems;\n self.inactiveItems = inactiveItems;\n if (shouldClearStatusOnSecond) {\n clickNodeId = item.getModel().id;\n }\n graph.emit('afteractivaterelations', {\n item: e.item,\n action: 'activate'\n });\n }, 50, {\n trailing: true,\n leading: true\n }),\n throttleClearActiveState: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"throttle\"])(function (e, self) {\n var graph = self.get('graph');\n if (!graph || graph.destroyed) return;\n if (!self.shouldUpdate(e.item, {\n event: e,\n action: 'deactivate'\n }, self)) return;\n var activeState = self.activeState;\n var inactiveState = self.inactiveState;\n var activeItems = self.activeItems || {};\n var inactiveItems = self.inactiveItems || {};\n Object.values(activeItems).filter(function (item) {\n return !item.destroyed;\n }).forEach(function (item) {\n graph.clearItemStates(item, activeState);\n });\n Object.values(inactiveItems).filter(function (item) {\n return !item.destroyed;\n }).forEach(function (item) {\n graph.clearItemStates(item, inactiveState);\n });\n self.activeItems = {};\n self.inactiveItems = {};\n graph.emit('afteractivaterelations', {\n item: e.item || self.get('item'),\n action: 'deactivate'\n });\n }, 50, {\n trailing: true,\n leading: true\n })\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/activate-relations.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/geometry/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/geometry/index.js ***! - \**********************************************************/ -/*! exports provided: Geometry */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/brush-select.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/brush-select.js ***! + \**************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Geometry\", function() { return Geometry; });\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\nvar _dec, _dec2, _class, _class2, _descriptor, _class3, _temp;\n\n\n\nvar Geometry = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].GeometryComponentManager), _dec(_class = (_class2 = (_temp = _class3 = /*#__PURE__*/function () {\n function Geometry() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Geometry);\n\n this.config = void 0;\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"geometry\", _descriptor, this);\n\n this.entity = void 0;\n this.component = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Geometry, [{\n key: \"getEntity\",\n value: function getEntity() {\n return this.entity;\n }\n }, {\n key: \"getComponent\",\n value: function getComponent() {\n return this.component;\n }\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this.config = config;\n }\n }, {\n key: \"setEntity\",\n value: function setEntity(entity) {\n this.entity = entity;\n this.component = this.geometry.create(entity);\n this.component.entity = entity;\n this.onEntityCreated();\n }\n }, {\n key: \"onEntityCreated\",\n value: function onEntityCreated() {//\n }\n }]);\n\n return Geometry;\n}(), _class3.BOX = 'box', _class3.SPHERE = 'sphere', _class3.PLANE = 'plane', _class3.MERGED = 'merged', _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"geometry\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/geometry/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar min = Math.min,\n max = Math.max,\n abs = Math.abs;\nvar DEFAULT_TRIGGER = 'shift';\nvar ALLOW_EVENTS = ['drag', 'shift', 'ctrl', 'alt', 'control'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n brushStyle: {\n fill: '#EEF6FF',\n fillOpacity: 0.4,\n stroke: '#DDEEFE',\n lineWidth: 1\n },\n onSelect: function onSelect() {},\n onDeselect: function onDeselect() {},\n selectedState: 'selected',\n trigger: DEFAULT_TRIGGER,\n includeEdges: true,\n includeCombos: false,\n selectOnCombo: false,\n selectedEdges: [],\n selectedNodes: [],\n selectedCombos: []\n };\n },\n getEvents: function getEvents() {\n // 检测输入是否合法\n if (!(ALLOW_EVENTS.indexOf(this.trigger.toLowerCase()) > -1)) {\n this.trigger = DEFAULT_TRIGGER;\n console.warn(\"Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'\");\n }\n if (this.trigger === 'drag') {\n return {\n dragstart: 'onMouseDown',\n drag: 'onMouseMove',\n dragend: 'onMouseUp',\n 'canvas:click': 'clearStates'\n };\n }\n return {\n dragstart: 'onMouseDown',\n drag: 'onMouseMove',\n dragend: 'onMouseUp',\n 'canvas:click': 'clearStates',\n keyup: 'onKeyUp',\n keydown: 'onKeyDown'\n };\n },\n onMouseDown: function onMouseDown(e) {\n // 按在node上面拖动时候不应该是框选\n var item = e.item;\n var brush = this.brush;\n var selectOnCombo = this.selectOnCombo;\n var isCombo = (item === null || item === void 0 ? void 0 : item.getType()) === 'combo';\n // 若在 combo 上操作,且不允许在 combo 上选择,则不继续\n if (isCombo && !selectOnCombo) {\n return;\n }\n // 若不在 combo 上操作,而是其他的 item ,则不继续\n if (!isCombo && item) {\n return;\n }\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n if (this.selectedNodes && this.selectedNodes.length !== 0) {\n this.clearStates();\n }\n if (!brush) {\n brush = this.createBrush();\n }\n this.originPoint = {\n x: e.canvasX,\n y: e.canvasY\n };\n brush.attr({\n width: 0,\n height: 0\n });\n brush.show();\n this.dragging = true;\n },\n onMouseMove: function onMouseMove(e) {\n if (!this.dragging) {\n return;\n }\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n this.updateBrush(e);\n },\n onMouseUp: function onMouseUp(e) {\n var graph = this.graph;\n // TODO: 触发了 canvas:click 导致 clearStates\n if (!this.brush && !this.dragging) {\n return;\n }\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n this.brush.remove(true); // remove and destroy\n this.brush = null;\n this.getSelectedNodes(e);\n this.dragging = false;\n },\n clearStates: function clearStates() {\n var _a = this,\n graph = _a.graph,\n selectedState = _a.selectedState;\n var nodes = graph.findAllByState('node', selectedState);\n var edges = graph.findAllByState('edge', selectedState);\n var combos = graph.findAllByState('combo', selectedState);\n nodes.forEach(function (node) {\n return graph.setItemState(node, selectedState, false);\n });\n edges.forEach(function (edge) {\n return graph.setItemState(edge, selectedState, false);\n });\n combos.forEach(function (combo) {\n return graph.setItemState(combo, selectedState, false);\n });\n this.selectedNodes = [];\n this.selectedEdges = [];\n this.selectedCombos = [];\n if (this.onDeselect) {\n this.onDeselect(this.selectedNodes, this.selectedEdges, this.selectedCombos);\n }\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: [],\n edges: [],\n combos: []\n },\n select: false\n });\n },\n isBBoxCenterInRect: function isBBoxCenterInRect(item, left, right, top, bottom) {\n var bbox = item.getBBox();\n return bbox.centerX >= left && bbox.centerX <= right && bbox.centerY >= top && bbox.centerY <= bottom;\n },\n getSelectedNodes: function getSelectedNodes(e) {\n var _this = this;\n var _a = this,\n graph = _a.graph,\n originPoint = _a.originPoint,\n shouldUpdate = _a.shouldUpdate,\n isBBoxCenterInRect = _a.isBBoxCenterInRect;\n var state = this.selectedState;\n var p1 = {\n x: e.x,\n y: e.y\n };\n var p2 = graph.getPointByCanvas(originPoint.x, originPoint.y);\n var left = min(p1.x, p2.x);\n var right = max(p1.x, p2.x);\n var top = min(p1.y, p2.y);\n var bottom = max(p1.y, p2.y);\n var selectedNodes = [];\n var selectedIds = [];\n graph.getNodes().forEach(function (node) {\n if (node.isVisible() &&\n // 隐藏节点不能被选中\n isBBoxCenterInRect(node, left, right, top, bottom) && shouldUpdate(node, 'select', _this)) {\n selectedNodes.push(node);\n var model = node.getModel();\n selectedIds.push(model.id);\n graph.setItemState(node, state, true);\n }\n });\n var selectedEdges = [];\n if (this.includeEdges) {\n // 选中边,边的source和target都在选中的节点中时才选中\n selectedNodes.forEach(function (node) {\n var edges = node.getOutEdges();\n edges.forEach(function (edge) {\n if (!edge.isVisible()) return; // 隐藏边不能够被选中\n var model = edge.getModel();\n var source = model.source,\n target = model.target;\n if (selectedIds.includes(source) && selectedIds.includes(target) && shouldUpdate(edge, 'select', _this)) {\n selectedEdges.push(edge);\n graph.setItemState(edge, _this.selectedState, true);\n }\n });\n });\n }\n var selectedCombos = [];\n if (this.includeCombos) {\n graph.getCombos().forEach(function (combo) {\n if (combo.isVisible() &&\n // 隐藏节点不能被选中\n isBBoxCenterInRect(combo, left, right, top, bottom) && shouldUpdate(combo, 'select', _this)) {\n selectedCombos.push(combo);\n var model = combo.getModel();\n selectedIds.push(model.id);\n graph.setItemState(combo, state, true);\n }\n });\n }\n this.selectedEdges = selectedEdges;\n this.selectedNodes = selectedNodes;\n this.selectedCombos = selectedCombos;\n if (this.onSelect) {\n this.onSelect(selectedNodes, selectedEdges, selectedCombos);\n }\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges,\n combos: selectedCombos\n },\n select: true\n });\n },\n createBrush: function createBrush() {\n var self = this;\n var brush = self.graph.get('canvas').addShape('rect', {\n attrs: self.brushStyle,\n capture: false,\n name: 'brush-shape'\n });\n this.brush = brush;\n this.delegate = brush;\n return brush;\n },\n updateBrush: function updateBrush(e) {\n var originPoint = this.originPoint;\n this.brush.attr({\n width: abs(e.canvasX - originPoint.x),\n height: abs(e.canvasY - originPoint.y),\n x: min(e.canvasX, originPoint.x),\n y: min(e.canvasY, originPoint.y)\n });\n },\n onKeyDown: function onKeyDown(e) {\n var code = e.key;\n if (!code) {\n return;\n }\n var triggerLowerCase = this.trigger.toLowerCase();\n var codeLowerCase = code.toLowerCase();\n // 按住 control 键时,允许用户设置 trigger 为 ctrl\n if (codeLowerCase === triggerLowerCase || codeLowerCase === 'control' && triggerLowerCase === 'ctrl' || codeLowerCase === 'ctrl' && triggerLowerCase === 'control') {\n this.keydown = true;\n } else {\n this.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n if (this.brush) {\n // 清除所有选中状态后,设置拖得动状态为false,并清除框选的brush\n this.brush.remove(true);\n this.brush = null;\n this.dragging = false;\n }\n this.keydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/brush-select.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/index.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/index.js ***! - \*************************************************/ -/*! exports provided: World, Kernel, Camera, Renderable, Geometry, Material */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/click-select.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/click-select.js ***! + \**************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _camera_Camera__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./camera/Camera */ \"./node_modules/@antv/g-webgpu/es/camera/Camera.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Camera\", function() { return _camera_Camera__WEBPACK_IMPORTED_MODULE_0__[\"Camera\"]; });\n\n/* harmony import */ var _geometry__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./geometry */ \"./node_modules/@antv/g-webgpu/es/geometry/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Geometry\", function() { return _geometry__WEBPACK_IMPORTED_MODULE_1__[\"Geometry\"]; });\n\n/* harmony import */ var _Kernel__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./Kernel */ \"./node_modules/@antv/g-webgpu/es/Kernel.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Kernel\", function() { return _Kernel__WEBPACK_IMPORTED_MODULE_2__[\"Kernel\"]; });\n\n/* harmony import */ var _material__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./material */ \"./node_modules/@antv/g-webgpu/es/material/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Material\", function() { return _material__WEBPACK_IMPORTED_MODULE_3__[\"Material\"]; });\n\n/* harmony import */ var _renderable_Renderable__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./renderable/Renderable */ \"./node_modules/@antv/g-webgpu/es/renderable/Renderable.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Renderable\", function() { return _renderable_Renderable__WEBPACK_IMPORTED_MODULE_4__[\"Renderable\"]; });\n\n/* harmony import */ var _World__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./World */ \"./node_modules/@antv/g-webgpu/es/World.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"World\", function() { return _World__WEBPACK_IMPORTED_MODULE_5__[\"World\"]; });\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar DEFAULT_TRIGGER = 'shift';\nvar ALLOW_EVENTS = ['shift', 'ctrl', 'alt', 'control'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n multiple: true,\n trigger: DEFAULT_TRIGGER,\n selectedState: 'selected',\n selectNode: true,\n selectEdge: false,\n selectCombo: true\n };\n },\n getEvents: function getEvents() {\n var self = this;\n // 检测输入是否合法\n if (!(ALLOW_EVENTS.indexOf(self.trigger.toLowerCase()) > -1)) {\n self.trigger = DEFAULT_TRIGGER;\n // eslint-disable-next-line no-console\n console.warn(\"Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'\");\n }\n if (!self.multiple) {\n return {\n 'node:click': 'onClick',\n 'combo:click': 'onClick',\n 'edge:click': 'onClick',\n 'canvas:click': 'onCanvasClick'\n };\n }\n return {\n 'node:click': 'onClick',\n 'combo:click': 'onClick',\n 'edge:click': 'onClick',\n 'canvas:click': 'onCanvasClick',\n keyup: 'onKeyUp',\n keydown: 'onKeyDown'\n };\n },\n onClick: function onClick(evt) {\n var self = this;\n var item = evt.item;\n if (!item || item.destroyed) {\n return;\n }\n var type = item.getType();\n var graph = self.graph,\n keydown = self.keydown,\n multiple = self.multiple,\n shouldUpdate = self.shouldUpdate,\n shouldBegin = self.shouldBegin;\n if (!shouldBegin(evt, self)) {\n return;\n }\n // allow to select multiple nodes but did not press a key || do not allow the select multiple nodes\n if (!keydown || !multiple) {\n var selected = graph.findAllByState('node', self.selectedState).concat(graph.findAllByState('edge', self.selectedState)).concat(graph.findAllByState('combo', self.selectedState));\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(selected, function (selectedItem) {\n if (selectedItem !== item) {\n graph.setItemState(selectedItem, self.selectedState, false);\n }\n });\n }\n // check if the item could be selected, given the current cfg\n var itemSelectable = function () {\n switch (type) {\n case 'node':\n return self.selectNode;\n case 'edge':\n return self.selectEdge;\n case 'combo':\n return self.selectCombo;\n default:\n return false;\n }\n }();\n if (!itemSelectable) {\n var selectedNodes = graph.findAllByState('node', self.selectedState);\n var selectedEdges = graph.findAllByState('edge', self.selectedState);\n var selectedCombos = graph.findAllByState('combo', self.selectedState);\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges,\n combos: selectedCombos\n },\n select: false\n });\n return;\n }\n if (item.hasState(self.selectedState)) {\n if (shouldUpdate(evt, self)) {\n graph.setItemState(item, self.selectedState, false);\n }\n var selectedNodes = graph.findAllByState('node', self.selectedState);\n var selectedEdges = graph.findAllByState('edge', self.selectedState);\n var selectedCombos = graph.findAllByState('combo', self.selectedState);\n graph.emit('nodeselectchange', {\n target: item,\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges,\n combos: selectedCombos\n },\n select: false\n });\n } else {\n if (shouldUpdate(evt, self)) {\n graph.setItemState(item, self.selectedState, true);\n }\n var selectedNodes = graph.findAllByState('node', self.selectedState);\n var selectedEdges = graph.findAllByState('edge', self.selectedState);\n var selectedCombos = graph.findAllByState('combo', self.selectedState);\n graph.emit('nodeselectchange', {\n target: item,\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges,\n combos: selectedCombos\n },\n select: true\n });\n }\n },\n onCanvasClick: function onCanvasClick(evt) {\n var _this = this;\n var _a = this,\n graph = _a.graph,\n shouldBegin = _a.shouldBegin;\n if (!shouldBegin(evt, this)) {\n return;\n }\n var selected = graph.findAllByState('node', this.selectedState);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(selected, function (node) {\n graph.setItemState(node, _this.selectedState, false);\n });\n var selectedEdges = graph.findAllByState('edge', this.selectedState);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(selectedEdges, function (edge) {\n graph.setItemState(edge, _this.selectedState, false);\n });\n var selectedCombos = graph.findAllByState('combo', this.selectedState);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(selectedCombos, function (combo) {\n graph.setItemState(combo, _this.selectedState, false);\n });\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: [],\n edges: [],\n combos: []\n },\n select: false\n });\n },\n onKeyDown: function onKeyDown(e) {\n var self = this;\n var code = e.key;\n if (!code) {\n return;\n }\n if (code.toLowerCase() === this.trigger.toLowerCase() || code.toLowerCase() === 'control') {\n self.keydown = true;\n } else {\n self.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n var self = this;\n self.keydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/click-select.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/material/basic/index.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/material/basic/index.js ***! - \****************************************************************/ -/*! exports provided: Basic */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/collapse-expand-combo.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/collapse-expand-combo.js ***! + \***********************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Basic\", function() { return Basic; });\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! .. */ \"./node_modules/@antv/g-webgpu/es/material/index.js\");\n\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _temp;\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\n\n\n/* babel-plugin-inline-import './shaders/webgl.basic.frag.glsl' */\nvar webglFragmentShaderGLSL = \"varying vec4 fragColor;\\n\\n#pragma include \\\"uv.frag.declaration\\\"\\n#pragma include \\\"map.frag.declaration\\\"\\n\\nvoid main() {\\n vec4 diffuseColor = fragColor;\\n\\n #pragma include \\\"map.frag.main\\\"\\n\\n gl_FragColor = diffuseColor;\\n}\";\n\n/* babel-plugin-inline-import './shaders/webgl.basic.vert.glsl' */\nvar webglVertexShaderGLSL = \"attribute vec3 position;\\nattribute vec3 normal;\\n\\nuniform mat4 projectionMatrix;\\nuniform mat4 modelViewMatrix;\\nuniform vec4 color;\\n\\nvarying vec4 fragColor;\\n\\n#pragma include \\\"uv.vert.declaration\\\"\\n\\nvoid main() {\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(position, 1.0);\\n fragColor = color;\\n\\n #pragma include \\\"uv.vert.main\\\"\\n}\";\n\n/* babel-plugin-inline-import './shaders/webgpu.basic.frag.glsl' */\nvar webgpuFragmentShaderGLSL = \"// layout(set = 0, binding = 1) uniform WireframeUniforms {\\n// float lineWidth;\\n// vec4 lineColor;\\n// } wireframe;\\n\\nlayout(location = 0) in vec4 fragColor;\\n// layout(location = 1) in vec3 v_Barycentric;\\n\\nlayout(location = 0) out vec4 outColor;\\n\\n// wireframe\\n// float edgeFactor() {\\n// vec3 d = fwidth(v_Barycentric);\\n// vec3 a3 = smoothstep(vec3(0.0), d * wireframe.lineWidth, v_Barycentric);\\n// return min(min(a3.x, a3.y), a3.z);\\n// }\\n\\nvoid main() {\\n // outColor = mix(fragColor, wireframe.lineColor, (1.0 - edgeFactor()));\\n outColor = fragColor;\\n}\";\n\n/* babel-plugin-inline-import './shaders/webgpu.basic.vert.glsl' */\nvar webgpuVertexShaderGLSL = \"layout(set = 0, binding = 0) uniform Uniforms {\\n vec4 color;\\n mat4 projectionMatrix;\\n mat4 modelViewMatrix;\\n} uniforms;\\n\\nlayout(location = 0) in vec3 position;\\n// layout(location = 1) in vec3 barycentric;\\n\\nlayout(location = 0) out vec4 fragColor;\\n// layout(location = 1) out vec3 v_Barycentric;\\n\\nvoid main() {\\n gl_Position = uniforms.projectionMatrix * uniforms.modelViewMatrix * vec4(position, 1.0);\\n fragColor = uniforms.color;\\n // v_Barycentric = barycentric;\\n}\";\nvar\n/**\n * This material is not affected by lights.\n * @see https://threejs.org/docs/#api/en/materials/MeshBasicMaterial\n */\nBasic = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].RenderEngine), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].ShaderModuleService), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function (_Material) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Basic, _Material);\n\n var _super = _createSuper(Basic);\n\n function Basic() {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Basic);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_this, \"engine\", _descriptor, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_this, \"shaderModuleService\", _descriptor2, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this));\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Basic, [{\n key: \"onEntityCreated\",\n value: function onEntityCreated() {\n var component = this.getComponent();\n var vertexShaderGLSL = this.engine.supportWebGPU ? webgpuVertexShaderGLSL : webglVertexShaderGLSL;\n var fragmentShaderGLSL = this.engine.supportWebGPU ? webgpuFragmentShaderGLSL : webglFragmentShaderGLSL;\n this.shaderModuleService.registerModule('material-basic', {\n vs: vertexShaderGLSL,\n fs: fragmentShaderGLSL\n });\n\n var _this$shaderModuleSer = this.shaderModuleService.getModule('material-basic'),\n vs = _this$shaderModuleSer.vs,\n fs = _this$shaderModuleSer.fs,\n extractedUniforms = _this$shaderModuleSer.uniforms;\n\n component.vertexShaderGLSL = vs;\n component.fragmentShaderGLSL = fs; // @ts-ignore\n\n component.setUniform(extractedUniforms);\n\n if (this.config.map) {\n component.setDefines({\n USE_UV: 1,\n USE_MAP: 1\n });\n component.setUniform({\n // @ts-ignore\n map: this.config.map,\n uvTransform: gl_matrix__WEBPACK_IMPORTED_MODULE_10__[\"mat3\"].create()\n });\n }\n }\n }]);\n\n return Basic;\n}(___WEBPACK_IMPORTED_MODULE_12__[\"Material\"]), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7___default()(_class2.prototype, \"engine\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7___default()(_class2.prototype, \"shaderModuleService\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/material/basic/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/*\n * @Author: Shiwu\n * @Description: 收起和展开 Combo\n */\nvar DEFAULT_TRIGGER = 'dblclick';\nvar ALLOW_EVENTS = ['click', 'dblclick'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n trigger: DEFAULT_TRIGGER,\n relayout: true\n };\n },\n getEvents: function getEvents() {\n var _a;\n var trigger;\n // 检测输入是否合法\n if (ALLOW_EVENTS.includes(this.trigger)) {\n trigger = this.trigger;\n } else {\n trigger = DEFAULT_TRIGGER;\n // eslint-disable-next-line no-console\n console.warn(\"Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'\");\n }\n return _a = {}, _a[\"combo:\".concat(trigger)] = 'onComboClick', _a;\n },\n onComboClick: function onComboClick(evt) {\n var item = evt.item;\n var _a = this,\n graph = _a.graph,\n relayout = _a.relayout;\n if (!item || item.destroyed || item.getType() !== 'combo') return;\n var model = item.getModel();\n var comboId = model.id;\n if (!comboId) {\n return;\n }\n graph.collapseExpandCombo(comboId);\n if (relayout && graph.get('layout')) graph.layout();else graph.refreshPositions();\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/collapse-expand-combo.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/material/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/material/index.js ***! - \**********************************************************/ -/*! exports provided: Material */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/collapse-expand.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/collapse-expand.js ***! + \*****************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Material\", function() { return Material; });\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\nvar _dec, _dec2, _class, _class2, _descriptor, _class3, _temp;\n\n\n\nvar Material = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].MaterialComponentManager), _dec(_class = (_class2 = (_temp = _class3 = /*#__PURE__*/function () {\n function Material() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Material);\n\n this.config = void 0;\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"material\", _descriptor, this);\n\n this.entity = void 0;\n this.component = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Material, [{\n key: \"getEntity\",\n value: function getEntity() {\n return this.entity;\n }\n }, {\n key: \"getComponent\",\n value: function getComponent() {\n return this.component;\n }\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this.config = config;\n }\n }, {\n key: \"setEntity\",\n value: function setEntity(entity, type) {\n this.entity = entity;\n this.component = this.material.create(entity);\n this.component.entity = entity;\n this.component.type = type;\n this.onEntityCreated();\n }\n }, {\n key: \"onEntityCreated\",\n value: function onEntityCreated() {//\n }\n }]);\n\n return Material;\n}(), _class3.BASIC = 'basic', _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"material\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/material/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar DEFAULT_TRIGGER = 'click';\nvar ALLOW_EVENTS = ['click', 'dblclick'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n /**\n * 发生收缩/扩展变化时的回调\n */\n trigger: DEFAULT_TRIGGER,\n onChange: function onChange() {}\n };\n },\n getEvents: function getEvents() {\n var _a;\n var trigger;\n // 检测输入是否合法\n if (ALLOW_EVENTS.includes(this.trigger)) {\n trigger = this.trigger;\n } else {\n trigger = DEFAULT_TRIGGER;\n // eslint-disable-next-line no-console\n console.warn(\"Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'\");\n }\n return _a = {}, _a[\"node:\".concat(trigger)] = 'onNodeClick',\n // 支持移动端事件\n _a.touchstart = 'onNodeClick', _a;\n },\n onNodeClick: function onNodeClick(e) {\n var _this = this;\n // avoid click being triggered on dblclick\n if (this.trigger === 'click') {\n if (this.timer) {\n clearTimeout(this.timer);\n this.timer = 0;\n return;\n }\n this.timer = setTimeout(function () {\n _this.toggle(e);\n clearTimeout(_this.timer);\n _this.timer = 0;\n }, 200);\n } else {\n this.toggle(e);\n }\n },\n toggle: function toggle(e) {\n var item = e.item;\n if (!item) return;\n // 如果节点进行过更新,model 会进行 merge,直接改 model 就不能改布局,所以需要去改源数据\n var sourceData = this.graph.findDataById(item.get('id'));\n if (!sourceData) {\n return;\n }\n var children = sourceData.children;\n // 叶子节点的收缩和展开没有意义\n if (!children || children.length === 0) {\n return;\n }\n var collapsed = !sourceData.collapsed;\n if (!this.shouldBegin(e, collapsed, this)) {\n return;\n }\n sourceData.collapsed = collapsed;\n item.getModel().collapsed = collapsed;\n this.graph.emit('itemcollapsed', {\n item: e.item,\n collapsed: collapsed\n });\n if (!this.shouldUpdate(e, collapsed, this)) {\n return;\n }\n this.onChange(item, collapsed, this);\n this.graph.layout();\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/collapse-expand.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/renderable/Renderable.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/renderable/Renderable.js ***! - \*****************************************************************/ -/*! exports provided: Renderable */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/create-edge.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/create-edge.js ***! + \*************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Renderable\", function() { return Renderable; });\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_6__);\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _descriptor4, _class3, _temp;\n\n\n\nvar Renderable = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].MeshComponentManager), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].CullableComponentManager), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].TransformComponentManager), _dec5 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].Systems), _dec6 = Object(inversify__WEBPACK_IMPORTED_MODULE_6__[\"named\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_5__[\"IDENTIFIER\"].SceneGraphSystem), _dec(_class = (_class2 = (_temp = _class3 = /*#__PURE__*/function () {\n function Renderable() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Renderable);\n\n this.attributes = {};\n this.config = void 0;\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"mesh\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"cullable\", _descriptor2, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"transform\", _descriptor3, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(this, \"sceneGraphSystem\", _descriptor4, this);\n\n this.meshComponent = void 0;\n this.transformComponent = void 0;\n this.entity = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Renderable, [{\n key: \"getEntity\",\n value: function getEntity() {\n return this.entity;\n }\n }, {\n key: \"getTransformComponent\",\n value: function getTransformComponent() {\n return this.transformComponent;\n }\n }, {\n key: \"getMeshComponent\",\n value: function getMeshComponent() {\n return this.meshComponent;\n }\n }, {\n key: \"setConfig\",\n value: function setConfig(config) {\n this.config = config;\n }\n }, {\n key: \"setEntity\",\n value: function setEntity(entity) {\n this.entity = entity;\n this.cullable.create(entity);\n this.meshComponent = this.mesh.create(entity);\n this.transformComponent = this.transform.create(entity);\n this.onEntityCreated();\n }\n }, {\n key: \"setMaterial\",\n value: function setMaterial(material) {\n this.meshComponent.material = material;\n return this;\n }\n }, {\n key: \"setGeometry\",\n value: function setGeometry(geometry) {\n this.meshComponent.geometry = geometry;\n return this;\n }\n }, {\n key: \"setAttributes\",\n value: function setAttributes(attributes) {\n var _this = this;\n\n Object.keys(attributes).forEach(function (name) {\n if (attributes[name] !== undefined && attributes[name] !== _this.attributes[name]) {\n _this.onAttributeChanged({\n name: name,\n data: attributes[name]\n });\n\n _this.attributes[name] = attributes[name];\n }\n });\n }\n }, {\n key: \"setVisible\",\n value: function setVisible(visible) {\n var _this2 = this;\n\n this.meshComponent.visible = visible;\n this.meshComponent.children.forEach(function (childEntity) {\n var child = _this2.mesh.getComponentByEntity(childEntity);\n\n if (child) {\n child.visible = visible;\n }\n });\n return this;\n }\n }, {\n key: \"isVisible\",\n value: function isVisible() {\n return this.meshComponent.visible;\n }\n }, {\n key: \"attach\",\n value: function attach(parentRenderable) {\n this.sceneGraphSystem.attach(this.entity, parentRenderable.entity);\n return this;\n }\n }, {\n key: \"detach\",\n value: function detach() {\n this.sceneGraphSystem.detach(this.entity);\n return this;\n }\n }, {\n key: \"detachChildren\",\n value: function detachChildren() {\n this.sceneGraphSystem.detachChildren(this.entity);\n return this;\n }\n }, {\n key: \"onEntityCreated\",\n value: function onEntityCreated() {//\n }\n }, {\n key: \"onAttributeChanged\",\n value: function onAttributeChanged(_ref) {\n var name = _ref.name,\n data = _ref.data;\n\n if (this.meshComponent && this.meshComponent.material) {\n this.meshComponent.material.setUniform(this.convertAttributeName2UniformName(name), data);\n }\n }\n }, {\n key: \"convertAttributeName2UniformName\",\n value: function convertAttributeName2UniformName(attributeName) {\n return attributeName;\n }\n }]);\n\n return Renderable;\n}(), _class3.POINT = 'point', _class3.LINE = 'line', _class3.GRID = 'grid', _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"mesh\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"cullable\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"transform\", [_dec4], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor4 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_3___default()(_class2.prototype, \"sceneGraphSystem\", [_dec5, _dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=Renderable.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/renderable/Renderable.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\nvar DEFAULT_TRIGGER = 'click';\nvar ALLOW_EVENTS = ['click', 'drag'];\nvar DEFAULT_KEY = undefined;\nvar ALLOW_KEYS = ['shift', 'ctrl', 'control', 'alt', 'meta', undefined];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n trigger: DEFAULT_TRIGGER,\n key: DEFAULT_KEY,\n edgeConfig: {},\n getEdgeConfig: undefined\n };\n },\n getEvents: function getEvents() {\n var self = this;\n // 检测输入是否合法\n if (!(ALLOW_EVENTS.indexOf(self.trigger.toLowerCase()) > -1)) {\n self.trigger = DEFAULT_TRIGGER;\n // eslint-disable-next-line no-console\n console.warn(\"Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'\");\n }\n if (self.key && ALLOW_KEYS.indexOf(self.key.toLowerCase()) === -1) {\n self.trigger = DEFAULT_KEY;\n // eslint-disable-next-line no-console\n console.warn(\"Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined\");\n }\n var events;\n if (self.trigger === 'drag') {\n events = {\n 'node:dragstart': 'onClick',\n 'combo:dragstart': 'onClick',\n drag: 'updateEndPoint',\n 'node:drop': 'onClick',\n 'combo:drop': 'onClick',\n dragend: 'onDragEnd'\n };\n } else if (self.trigger === 'click') {\n events = {\n 'node:click': 'onClick',\n mousemove: 'updateEndPoint',\n 'edge:click': 'cancelCreating',\n 'canvas:click': 'cancelCreating',\n 'combo:click': 'onClick'\n };\n }\n if (self.key) {\n events.keydown = 'onKeyDown';\n events.keyup = 'onKeyUp';\n }\n return events;\n },\n onDragEnd: function onDragEnd(ev) {\n var self = this;\n if (self.key && !self.keydown) return;\n var item = ev.item;\n if (!item || item.getID() === self.source || item.getType() !== 'node') self.cancelCreating({\n item: self.edge,\n x: ev.x,\n y: ev.y\n });\n },\n // 如果边的起点没有指定,则根据起点创建新边;如果起点已经指定而终点未指定,则指定终点\n onClick: function onClick(ev) {\n var self = this;\n if (self.key && !self.keydown) return;\n var node = ev.item;\n var graph = self.graph;\n var model = node.getModel();\n var getEdgeConfig = self.getEdgeConfig;\n // 如果起点已经指定而终点未指定,则指定终点\n if (self.addingEdge && self.edge) {\n if (!self.shouldEnd(ev, self)) return;\n var edgeConfig = void 0;\n if (getEdgeConfig && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(getEdgeConfig)) {\n edgeConfig = getEdgeConfig({\n source: self.source,\n target: model.id\n }, self);\n } else {\n edgeConfig = self.edgeConfig;\n }\n var updateCfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n target: model.id\n }, edgeConfig);\n if (self.source === model.id) {\n updateCfg.type = 'loop';\n }\n graph.emit('beforecreateedge', {});\n graph.updateItem(self.edge, updateCfg, false);\n if (graph.get('enabledStack')) {\n var addedModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, self.edge.getModel()), {\n itemType: 'edge'\n });\n var after = {};\n after.edges = [addedModel];\n graph.pushStack('add', {\n before: {},\n after: after\n });\n }\n graph.emit('aftercreateedge', {\n edge: self.edge\n });\n // 暂时将该边的 capture 恢复为 true\n self.edge.getKeyShape().set('capture', true);\n self.edge = null;\n self.addingEdge = false;\n } else {\n // 如果边的起点没有指定,则根据起点创建新边\n if (!self.shouldBegin(ev, self)) return;\n // 获取自定义 edge 配置\n var edgeConfig = void 0;\n if (getEdgeConfig && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(getEdgeConfig)) {\n edgeConfig = getEdgeConfig({\n source: model.id,\n target: model.id\n }, self);\n } else {\n edgeConfig = self.edgeConfig;\n }\n self.edge = graph.addItem('edge', Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n source: model.id,\n target: model.id\n }, edgeConfig), false);\n self.source = model.id;\n self.addingEdge = true;\n // 暂时将该边的 capture 设置为 false,这样可以拾取到后面的元素\n self.edge.getKeyShape().set('capture', false);\n }\n },\n // 边的起点已经确定,边的末端跟随鼠标移动\n updateEndPoint: function updateEndPoint(ev) {\n var self = this;\n if (self.key && !self.keydown) return;\n if (self.edge && self.edge.destroyed) self.cancelCreating({\n item: self.edge\n });\n var point = {\n x: ev.x,\n y: ev.y\n };\n // 若此时 source 节点已经被移除,结束添加边\n if (!self.graph.findById(self.source)) {\n self.addingEdge = false;\n return;\n }\n if (self.addingEdge && self.edge) {\n // 更新边的终点为鼠标位置\n self.graph.updateItem(self.edge, {\n target: point\n }, false);\n }\n },\n // 取消增加边,删除该边;或指定终点\n cancelCreating: function cancelCreating(ev) {\n var _a, _b;\n var self = this;\n if (self.key && !self.keydown) return;\n var graph = self.graph;\n var currentEdge = ev.item;\n if (self.addingEdge && (self.edge === currentEdge || ((_b = (_a = ev.target) === null || _a === void 0 ? void 0 : _a.isCanvas) === null || _b === void 0 ? void 0 : _b.call(_a)))) {\n if (self.edge && !self.edge.destroyed) graph.removeItem(self.edge, false);\n self.edge = null;\n self.addingEdge = false;\n return;\n }\n },\n onKeyDown: function onKeyDown(e) {\n var self = this;\n var code = e.key;\n if (!code) {\n return;\n }\n if (code.toLowerCase() === self.key.toLowerCase()) {\n self.keydown = true;\n } else {\n self.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n var self = this;\n if (self.addingEdge && self.edge) {\n // 清除正在增加的边\n self.graph.removeItem(self.edge, false);\n self.addingEdge = false;\n self.edge = null;\n }\n this.keydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/create-edge.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/renderable/grid/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/renderable/grid/index.js ***! - \*****************************************************************/ -/*! exports provided: Grid */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/drag-canvas.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/drag-canvas.js ***! + \*************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Grid\", function() { return Grid; });\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _Renderable__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ../Renderable */ \"./node_modules/@antv/g-webgpu/es/renderable/Renderable.js\");\n\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _temp;\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_6___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_5___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\n\n/* babel-plugin-inline-import './shaders/webgl.grid.frag.glsl' */\nvar gridFrag = \"// generate grid, borrow from clay.gl viewer\\n// @see https://github.com/pissang/clay-viewer/blob/master/src/graphic/ground.glsl\\n#extension GL_OES_standard_derivatives : enable\\n\\nvarying vec3 v_Position;\\n// varying vec3 v_Normal;\\n\\nuniform float u_GridSize : 5;\\nuniform float u_GridSize2 : .5;\\nuniform vec4 u_GridColor : [0, 0, 0, 1];\\nuniform vec4 u_GridColor2 : [0.3, 0.3, 0.3, 1];\\nuniform bool u_GridEnabled : true;\\n\\n// uniform vec3 u_LightDirection;\\n// uniform vec3 u_LightColor;\\n// uniform vec3 u_Camera;\\n\\nvoid main() {\\n // vec3 n = v_Normal;\\n // vec3 l = normalize(u_LightDirection);\\n // float NdotL = clamp(dot(n, l), 0.001, 1.0);\\n\\n gl_FragColor = vec4(1.);\\n\\n if (u_GridEnabled) {\\n float wx = v_Position.x;\\n float wz = v_Position.z;\\n // float x0 = abs(fract(wx / u_GridSize - 0.5) - 0.5) / fwidth(wx) * u_GridSize / 2.0;\\n // float z0 = abs(fract(wz / u_GridSize - 0.5) - 0.5) / fwidth(wz) * u_GridSize / 2.0;\\n\\n float x1 = abs(fract(wx / u_GridSize2 - 0.5) - 0.5) / fwidth(wx) * u_GridSize2;\\n float z1 = abs(fract(wz / u_GridSize2 - 0.5) - 0.5) / fwidth(wz) * u_GridSize2;\\n\\n // float v0 = 1.0 - clamp(min(x0, z0), 0.0, 1.0);\\n float v1 = 1.0 - clamp(min(x1, z1), 0.0, 1.0);\\n // if (v0 > 0.1) {\\n // gl_FragColor = mix(gl_FragColor, u_GridColor, v0);\\n // }\\n // else {\\n gl_FragColor = mix(gl_FragColor, u_GridColor2, v1);\\n // }\\n }\\n\\n // float shadowFactor = calcShadow(u_ShadowMap, v_PositionFromLight, l, n);\\n // vec3 diffuseColor = u_LightColor * NdotL * shadowFactor;\\n\\n // gl_FragColor.rgb *= diffuseColor;\\n}\";\n\n/* babel-plugin-inline-import './shaders/webgl.grid.vert.glsl' */\nvar gridVert = \"attribute vec3 a_Position;\\n\\nvarying vec3 v_Position;\\n\\nuniform mat4 projectionMatrix;\\nuniform mat4 modelViewMatrix;\\n\\nvoid main() {\\n v_Position = a_Position;\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_Position, 1.);\\n}\";\nvar Grid = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].Systems), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"named\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].MaterialSystem), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].Systems), _dec5 = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"named\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].GeometrySystem), _dec6 = Object(inversify__WEBPACK_IMPORTED_MODULE_10__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"IDENTIFIER\"].ShaderModuleService), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function (_Renderable) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_4___default()(Grid, _Renderable);\n\n var _super = _createSuper(Grid);\n\n function Grid() {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_1___default()(this, Grid);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_this, \"materialSystem\", _descriptor, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_this, \"geometrySystem\", _descriptor2, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_0___default()(_this, \"shaderModuleService\", _descriptor3, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_3___default()(_this));\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_2___default()(Grid, [{\n key: \"onAttributeChanged\",\n value: function onAttributeChanged(_ref) {\n var name = _ref.name,\n data = _ref.data;\n var mesh = this.getMeshComponent();\n\n if (mesh && mesh.material) {\n if (name === 'gridColor') {\n mesh.material.setUniform('u_GridColor', data);\n mesh.material.setUniform('u_GridColor2', data);\n } else if (name === 'gridSize') {\n mesh.material.setUniform('u_GridSize', data);\n mesh.material.setUniform('u_GridSize2', data);\n }\n }\n }\n }, {\n key: \"onEntityCreated\",\n value: function onEntityCreated() {\n this.shaderModuleService.registerModule('grid', {\n vs: gridVert,\n fs: gridFrag\n });\n\n var _this$shaderModuleSer = this.shaderModuleService.getModule('grid'),\n vs = _this$shaderModuleSer.vs,\n fs = _this$shaderModuleSer.fs,\n extractedUniforms = _this$shaderModuleSer.uniforms;\n\n var material = this.materialSystem.createShaderMaterial({\n vertexShader: vs,\n fragmentShader: fs\n });\n this.setMaterial(material);\n var geometry = this.geometrySystem.createBufferGeometry({\n vertexCount: 4\n });\n this.setGeometry(geometry);\n material.setCull({\n enable: false,\n face: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"gl\"].BACK\n }).setDepth({\n enable: true,\n func: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_9__[\"gl\"].LESS\n }); // @ts-ignore\n\n material.setUniform(extractedUniforms);\n this.setAttributes({\n gridColor: this.config.gridColor,\n gridSize: this.config.gridSize\n });\n geometry.setIndex([0, 3, 2, 2, 1, 0]);\n geometry.setAttribute('a_Position', Float32Array.from([-4, -1, -4, 4, -1, -4, 4, -1, 4, -4, -1, 4]), {\n arrayStride: 4 * 2,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 0,\n offset: 0,\n format: 'float2'\n }]\n });\n }\n }]);\n\n return Grid;\n}(_Renderable__WEBPACK_IMPORTED_MODULE_11__[\"Renderable\"]), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7___default()(_class2.prototype, \"materialSystem\", [_dec2, _dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7___default()(_class2.prototype, \"geometrySystem\", [_dec4, _dec5], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_7___default()(_class2.prototype, \"shaderModuleService\", [_dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/renderable/grid/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n\n\nvar cloneEvent = _util__WEBPACK_IMPORTED_MODULE_1__[\"default\"].cloneEvent,\n isNaN = _util__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isNaN;\nvar abs = Math.abs;\nvar DRAG_OFFSET = 10;\nvar ALLOW_EVENTS = ['shift', 'ctrl', 'alt', 'control'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n direction: 'both',\n enableOptimize: false,\n // drag-canvas 可拖动的扩展范围,默认为 0,即最多可以拖动一屏的位置\n // 当设置的值大于 0 时,即拖动可以超过一屏\n // 当设置的值小于 0 时,相当于缩小了可拖动范围\n // 具体实例可参考:https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*IFfoS67_HssAAAAAAAAAAAAAARQnAQ\n scalableRange: 0,\n allowDragOnItem: false\n };\n },\n getEvents: function getEvents() {\n return {\n 'mousedown': 'onMouseDown',\n 'drag': 'onDragMove',\n 'dragend': 'onMouseUp',\n 'canvas:click': 'onMouseUp',\n 'keyup': 'onKeyUp',\n 'focus': 'onKeyUp',\n 'keydown': 'onKeyDown',\n 'touchstart': 'onTouchStart',\n 'touchmove': 'onTouchMove',\n 'touchend': 'onMouseUp'\n };\n },\n updateViewport: function updateViewport(e) {\n var origin = this.origin;\n var clientX = +e.clientX;\n var clientY = +e.clientY;\n if (isNaN(clientX) || isNaN(clientY)) {\n return;\n }\n var dx = clientX - origin.x;\n var dy = clientY - origin.y;\n if (this.get('direction') === 'x') {\n dy = 0;\n } else if (this.get('direction') === 'y') {\n dx = 0;\n }\n this.origin = {\n x: clientX,\n y: clientY\n };\n var width = this.graph.get('width');\n var height = this.graph.get('height');\n var graphCanvasBBox = this.graph.get('canvas').getCanvasBBox();\n var expandWidth = this.scalableRange;\n var expandHeight = this.scalableRange;\n // 若 scalableRange 是 0~1 的小数,则作为比例考虑\n if (expandWidth < 1 && expandWidth > -1) {\n expandWidth = width * expandWidth;\n expandHeight = height * expandHeight;\n }\n if (graphCanvasBBox.minX <= width + expandWidth && graphCanvasBBox.minX + dx > width + expandWidth || graphCanvasBBox.maxX + expandWidth >= 0 && graphCanvasBBox.maxX + expandWidth + dx < 0) {\n dx = 0;\n }\n if (graphCanvasBBox.minY <= height + expandHeight && graphCanvasBBox.minY + dy > height + expandHeight || graphCanvasBBox.maxY + expandHeight >= 0 && graphCanvasBBox.maxY + expandHeight + dy < 0) {\n dy = 0;\n }\n this.graph.translate(dx, dy);\n },\n onTouchStart: function onTouchStart(e) {\n var self = this;\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n // 如果是双指操作,不允许拖拽画布\n if (event1 && event2) {\n return;\n }\n e.preventDefault();\n this.mousedown = true;\n self.onDragStart(e);\n },\n onMouseDown: function onMouseDown(e) {\n this.mousedown = true;\n },\n onDragMove: function onDragMove(evt) {\n if (!this.mousedown) return;\n if (!this.dragstart) {\n // dragstart\n this.dragstart = true;\n this.onDragStart(evt);\n } else {\n // drag\n this.onDrag(evt);\n }\n },\n onDragStart: function onDragStart(e) {\n var self = this;\n var event = e.originalEvent;\n // TODO: 'name' doesn't exist on `IG6GraphEvent`, we should consider typing it so users get autocomplete and other benefits\n if (event && e.name !== 'touchstart' && event.button !== 0) {\n return;\n }\n if (e.name !== 'touchstart' && typeof window !== 'undefined' && window.event && !window.event.buttons && !window.event.button) {\n return;\n }\n if (!this.shouldBegin(e, this)) {\n return;\n }\n if (self.keydown) return;\n if (!this.allowDrag(e)) return;\n self.origin = {\n x: e.clientX,\n y: e.clientY\n };\n self.dragging = false;\n if (this.enableOptimize) {\n // 拖动 canvas 过程中隐藏所有的边及label\n var graph = this.graph;\n var edges = graph.getEdges();\n for (var i = 0, len = edges.length; i < len; i++) {\n var shapes = edges[i].get('group').get('children');\n if (!shapes) continue;\n shapes.forEach(function (shape) {\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n });\n }\n var nodes = graph.getNodes();\n for (var j = 0, nodeLen = nodes.length; j < nodeLen; j++) {\n var container = nodes[j].getContainer();\n var children = container.get('children');\n for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {\n var child = children_1[_i];\n var isKeyShape = child.get('isKeyShape');\n if (!isKeyShape) {\n child.set('ori-visibility', child.get('ori-visibility') || child.get('visible'));\n child.hide();\n }\n }\n }\n }\n // 绑定浏览器右键监听,触发拖拽结束,结束拖拽时移除\n if (typeof window !== 'undefined') {\n var self_1 = this;\n this.handleDOMContextMenu = function (e) {\n return self_1.onMouseUp(e);\n };\n document.body.addEventListener('contextmenu', this.handleDOMContextMenu);\n }\n },\n onTouchMove: function onTouchMove(e) {\n var self = this;\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n // 如果是双指操作,不允许拖拽画布,结束拖拽\n if (event1 && event2) {\n this.onMouseUp(e);\n return;\n }\n e.preventDefault();\n self.onDrag(e);\n },\n onDrag: function onDrag(e) {\n if (!this.mousedown) return;\n var graph = this.graph;\n if (this.keydown) return;\n if (!this.allowDrag(e)) return;\n e = cloneEvent(e);\n if (!this.origin) {\n return;\n }\n if (!this.dragging) {\n if (abs(this.origin.x - e.clientX) + abs(this.origin.y - e.clientY) < DRAG_OFFSET) {\n return;\n }\n if (this.shouldBegin(e, this)) {\n e.type = 'dragstart';\n graph.emit('canvas:dragstart', e);\n this.originPosition = {\n x: e.clientX,\n y: e.clientY\n };\n this.dragging = true;\n }\n } else {\n e.type = 'drag';\n graph.emit('canvas:drag', e);\n }\n if (this.shouldUpdate(e, this)) {\n this.updateViewport(e);\n }\n },\n onMouseUp: function onMouseUp(e) {\n var _a, _b;\n this.mousedown = false;\n this.dragstart = false;\n var graph = this.graph;\n if (this.keydown) return;\n var currentZoom = graph.getZoom();\n var modeController = graph.get('modeController');\n var zoomCanvas = (_b = (_a = modeController === null || modeController === void 0 ? void 0 : modeController.modes[modeController.mode]) === null || _a === void 0 ? void 0 : _a.filter(function (behavior) {\n return behavior.type === 'zoom-canvas';\n })) === null || _b === void 0 ? void 0 : _b[0];\n var optimizeZoom = zoomCanvas ? zoomCanvas.optimizeZoom || 0.1 : 0;\n if (this.enableOptimize) {\n // 拖动结束后显示所有的边\n var edges = graph.getEdges();\n for (var i = 0, len = edges.length; i < len; i++) {\n var shapes = edges[i].get('group').get('children');\n if (!shapes) continue;\n shapes.forEach(function (shape) {\n var oriVis = shape.get('ori-visibility');\n shape.set('ori-visibility', undefined);\n if (oriVis) shape.show();\n });\n }\n if (currentZoom > optimizeZoom) {\n var nodes = graph.getNodes();\n for (var j = 0, nodeLen = nodes.length; j < nodeLen; j++) {\n var container = nodes[j].getContainer();\n var children = container.get('children');\n for (var _i = 0, children_2 = children; _i < children_2.length; _i++) {\n var child = children_2[_i];\n var isKeyShape = child.get('isKeyShape');\n if (!isKeyShape) {\n var oriVis = child.get('ori-visibility');\n child.set('ori-visibility', undefined);\n if (oriVis) child.show();\n }\n }\n }\n }\n }\n if (!this.dragging) {\n this.origin = null;\n return;\n }\n e = cloneEvent(e);\n if (this.shouldEnd(e, this)) {\n this.updateViewport(e);\n }\n e.type = 'dragend';\n e.dx = e.clientX - this.originPosition.x;\n e.dy = e.clientY - this.originPosition.y;\n graph.emit('canvas:dragend', e);\n this.endDrag();\n // 结束拖拽时移除浏览器右键监听\n if (typeof window !== 'undefined') {\n document.body.removeEventListener('contextmenu', this.handleDOMContextMenu);\n }\n },\n endDrag: function endDrag() {\n this.origin = null;\n this.dragging = false;\n this.dragbegin = false;\n this.mousedown = false;\n this.dragstart = false;\n },\n onKeyDown: function onKeyDown(e) {\n var self = this;\n var code = e.key;\n if (!code) {\n return;\n }\n if (ALLOW_EVENTS.indexOf(code.toLowerCase()) > -1) {\n self.keydown = true;\n } else {\n self.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n this.keydown = false;\n this.origin = null;\n this.dragging = false;\n this.dragbegin = false;\n },\n allowDrag: function allowDrag(evt) {\n var _a, _b;\n var target = evt.target;\n var targetIsCanvas = target && target.isCanvas && target.isCanvas();\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isBoolean\"])(this.allowDragOnItem) && !this.allowDragOnItem && !targetIsCanvas) return false;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(this.allowDragOnItem)) {\n var _c = this.allowDragOnItem,\n node = _c.node,\n edge = _c.edge,\n combo = _c.combo;\n var itemType = (_b = (_a = evt.item) === null || _a === void 0 ? void 0 : _a.getType) === null || _b === void 0 ? void 0 : _b.call(_a);\n if (!node && itemType === 'node') return false;\n if (!edge && itemType === 'edge') return false;\n if (!combo && itemType === 'combo') return false;\n }\n return true;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/drag-canvas.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/renderable/line/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/renderable/line/index.js ***! - \*****************************************************************/ -/*! exports provided: Line */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/drag-combo.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/drag-combo.js ***! + \************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Line\", function() { return Line; });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_11___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_11__);\n/* harmony import */ var _utils_polyline_normals__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ../../utils/polyline-normals */ \"./node_modules/@antv/g-webgpu/es/utils/polyline-normals.js\");\n/* harmony import */ var _Renderable__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../Renderable */ \"./node_modules/@antv/g-webgpu/es/renderable/Renderable.js\");\n\n\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _temp;\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_7___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_6___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\n\n\n/* babel-plugin-inline-import './shaders/webgl.line.frag.glsl' */\nvar lineFrag = \"uniform float u_dash_array : 0.02;\\nuniform float u_dash_offset : 0;\\nuniform float u_dash_ratio : 0;\\nuniform float u_thickness : 0.02;\\n\\nvarying vec4 v_color;\\nvarying vec2 v_normal;\\nvarying float v_counters;\\n\\nvoid main() {\\n float blur = 1. - smoothstep(0.98, 1., length(v_normal));\\n\\n gl_FragColor = v_color;\\n gl_FragColor.a *= blur * ceil(mod(v_counters + u_dash_offset, u_dash_array) - (u_dash_array * u_dash_ratio));\\n}\";\n\n/* babel-plugin-inline-import './shaders/webgl.line.vert.glsl' */\nvar lineVert = \"attribute vec2 a_pos;\\nattribute vec4 a_color;\\nattribute float a_line_miter;\\nattribute vec2 a_line_normal;\\nattribute float a_counters;\\n\\nuniform mat4 projectionMatrix;\\nuniform mat4 modelViewMatrix;\\nuniform float u_thickness : 0.02;\\nuniform vec2 u_viewport;\\n\\nvarying vec4 v_color;\\nvarying vec2 v_normal;\\nvarying float v_counters;\\n\\nvoid main() {\\n v_color = a_color;\\n v_counters = a_counters;\\n\\n vec3 normal = normalize(vec3(a_line_normal, 0.0));\\n\\n vec4 offset = vec4(normal * u_thickness / 2.0 * a_line_miter, 0.0);\\n\\n v_normal = vec2(normal * sign(a_line_miter));\\n\\n gl_Position = projectionMatrix * modelViewMatrix * vec4(a_pos, 0.0, 1.0) + offset;\\n}\\n\";\nvar Line = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_10__[\"IDENTIFIER\"].Systems), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"named\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_10__[\"IDENTIFIER\"].MaterialSystem), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_10__[\"IDENTIFIER\"].Systems), _dec5 = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"named\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_10__[\"IDENTIFIER\"].GeometrySystem), _dec6 = Object(inversify__WEBPACK_IMPORTED_MODULE_11__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_10__[\"IDENTIFIER\"].ShaderModuleService), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function (_Renderable) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_5___default()(Line, _Renderable);\n\n var _super = _createSuper(Line);\n\n function Line() {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_2___default()(this, Line);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_this, \"materialSystem\", _descriptor, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default()(_this));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_this, \"geometrySystem\", _descriptor2, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default()(_this));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_1___default()(_this, \"shaderModuleService\", _descriptor3, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_4___default()(_this));\n\n _this.vertexCount = void 0;\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_3___default()(Line, [{\n key: \"onAttributeChanged\",\n value: function onAttributeChanged(_ref) {\n var name = _ref.name,\n data = _ref.data;\n var mesh = this.getMeshComponent();\n\n if (mesh && mesh.material) {\n switch (name) {\n case 'dashArray':\n mesh.material.setUniform('u_dash_array', data);\n break;\n\n case 'dashOffset':\n mesh.material.setUniform('u_dash_offset', data);\n break;\n\n case 'dashRatio':\n mesh.material.setUniform('u_dash_ratio', data);\n break;\n\n case 'thickness':\n mesh.material.setUniform('u_thickness', data);\n break;\n\n case 'color':\n var colors = new Array(this.vertexCount).fill(undefined).map(function () {\n return data;\n }).reduce(function (prev, cur) {\n // @ts-ignore\n return [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(prev), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(cur));\n }, []); // @ts-ignore\n\n mesh.geometry.setAttribute('a_color', Float32Array.from(colors), {\n arrayStride: 4 * 4,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 1,\n offset: 0,\n format: 'float4'\n }]\n });\n break;\n }\n }\n }\n }, {\n key: \"onEntityCreated\",\n value: function onEntityCreated() {\n var _this2 = this;\n\n this.shaderModuleService.registerModule('line', {\n vs: lineVert,\n fs: lineFrag\n });\n\n var _this$shaderModuleSer = this.shaderModuleService.getModule('line'),\n vs = _this$shaderModuleSer.vs,\n fs = _this$shaderModuleSer.fs,\n extractedUniforms = _this$shaderModuleSer.uniforms;\n\n var material = this.materialSystem.createShaderMaterial({\n vertexShader: vs,\n fragmentShader: fs\n });\n\n var _getNormals = Object(_utils_polyline_normals__WEBPACK_IMPORTED_MODULE_12__[\"default\"])(this.config.points, false),\n normals = _getNormals.normals,\n attrIndex = _getNormals.attrIndex,\n attrPos = _getNormals.attrPos,\n attrCounters = _getNormals.attrCounters;\n\n var vertexCount = attrPos.length;\n this.vertexCount = vertexCount;\n var geometry = this.geometrySystem.createBufferGeometry({\n vertexCount: vertexCount\n });\n this.setMaterial(material);\n this.setGeometry(geometry);\n material.setCull({\n enable: false,\n face: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_10__[\"gl\"].BACK\n }) // @ts-ignore\n .setUniform(extractedUniforms);\n this.setAttributes({\n dashArray: this.config.dashArray,\n dashOffset: this.config.dashOffset,\n dashRatio: this.config.dashRatio,\n thickness: this.config.thickness\n });\n var attrNormal = [];\n var attrMiter = [];\n normals.forEach(function (n) {\n var norm = n[0];\n var miter = n[1];\n attrNormal.push([norm[0], norm[1]]); // @ts-ignore\n\n attrMiter.push(miter);\n }); // [[0,1,2], [2,1,3]]\n\n geometry.setIndex(attrIndex.reduce(function (prev, cur) {\n return [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(prev), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(cur));\n }, []));\n geometry.setAttribute('a_pos', Float32Array.from(attrPos.reduce(function (prev, cur) {\n return [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(prev), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(cur));\n }, [])), {\n arrayStride: 4 * 2,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 0,\n offset: 0,\n format: 'float2'\n }]\n });\n var colors = new Array(vertexCount).fill(undefined).map(function () {\n return _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(_this2.config.color);\n }).reduce(function (prev, cur) {\n return [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(prev), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(cur));\n }, []);\n geometry.setAttribute('a_color', Float32Array.from(colors), {\n arrayStride: 4 * 4,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 1,\n offset: 0,\n format: 'float4'\n }]\n });\n geometry.setAttribute('a_line_miter', Float32Array.from(attrMiter), {\n arrayStride: 4 * 1,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 2,\n offset: 0,\n format: 'float'\n }]\n });\n geometry.setAttribute('a_line_normal', Float32Array.from(attrNormal.reduce(function (prev, cur) {\n return [].concat(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(prev), _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(cur));\n }, [])), {\n arrayStride: 4 * 2,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 3,\n offset: 0,\n format: 'float2'\n }]\n });\n geometry.setAttribute('a_counters', Float32Array.from(attrCounters), {\n arrayStride: 4 * 1,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 4,\n offset: 0,\n format: 'float'\n }]\n });\n }\n }]);\n\n return Line;\n}(_Renderable__WEBPACK_IMPORTED_MODULE_13__[\"Renderable\"]), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_8___default()(_class2.prototype, \"materialSystem\", [_dec2, _dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_8___default()(_class2.prototype, \"geometrySystem\", [_dec4, _dec5], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_8___default()(_class2.prototype, \"shaderModuleService\", [_dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/renderable/line/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-pc/es/global.js\");\n\n/*\n * @Author: moyee\n * @LastEditors: moyee\n * @Description: 拖动 Combo\n */\n\n\n\nvar calculationItemsBBox = _util__WEBPACK_IMPORTED_MODULE_2__[\"default\"].calculationItemsBBox;\n/**\n * 遍历拖动的 Combo 下的所有 Combo\n * @param data 拖动的 Combo\n * @param fn\n */\nvar traverseCombo = function traverseCombo(data, fn) {\n if (fn(data) === false) {\n return;\n }\n if (data) {\n var combos = data.get('combos');\n if (combos.length === 0) {\n return false;\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(combos, function (child) {\n traverseCombo(child, fn);\n });\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n enableDelegate: false,\n delegateStyle: {},\n // 拖动节点过程中是否只改变 Combo 的大小,而不改变其结构\n onlyChangeComboSize: false,\n // 拖动过程中目标 combo 状态样式\n activeState: '',\n selectedState: 'selected',\n enableStack: true\n };\n },\n getEvents: function getEvents() {\n return {\n 'combo:mousedown': 'onMouseDown',\n 'combo:dragstart': 'onDragStart',\n 'combo:drag': 'onDrag',\n 'combo:dragend': 'onDragEnd',\n 'combo:drop': 'onDrop',\n 'node:drop': 'onNodeDrop',\n 'combo:dragenter': 'onDragEnter',\n 'combo:dragleave': 'onDragLeave'\n };\n },\n validationCombo: function validationCombo(evt) {\n var item = evt.item;\n if (!item || item.destroyed) {\n return false;\n }\n if (!this.shouldUpdate(evt, this)) {\n return false;\n }\n var type = item.getType();\n if (type !== 'combo') {\n return false;\n }\n return true;\n },\n onMouseDown: function onMouseDown(evt) {\n this.origin = {\n x: evt.x,\n y: evt.y\n };\n },\n onDragStart: function onDragStart(evt) {\n var _this = this;\n var graph = this.graph;\n var item = evt.item;\n this.currentShouldEnd = true;\n if (!this.validationCombo(evt)) return;\n this.targets = [];\n // 获取所有选中的 Combo\n var combos = graph.findAllByState('combo', this.selectedState);\n var currentCombo = item.get('id');\n var dragCombos = combos.filter(function (combo) {\n var comboId = combo.get('id');\n return currentCombo === comboId;\n });\n if (dragCombos.length === 0) {\n this.targets.push(item);\n } else {\n this.targets = combos;\n }\n var beforeDragItems = [];\n this.targets.forEach(function (t) {\n var _a = t.getModel(),\n x = _a.x,\n y = _a.y,\n id = _a.id;\n beforeDragItems.push({\n x: x,\n y: y,\n id: id\n });\n });\n this.set('beforeDragItems', beforeDragItems);\n if (this.activeState) {\n this.targets.map(function (combo) {\n var model = combo.getModel();\n if (model.parentId) {\n var parentCombo = graph.findById(model.parentId);\n if (parentCombo) {\n graph.setItemState(parentCombo, _this.activeState, true);\n }\n }\n });\n }\n this.point = {};\n this.originPoint = {};\n this.currentItemChildCombos = [];\n traverseCombo(item, function (param) {\n if (param.destroyed) {\n return false;\n }\n var model = param.getModel();\n _this.currentItemChildCombos.push(model.id);\n return true;\n });\n },\n onDrag: function onDrag(evt) {\n var _this = this;\n if (!this.origin) {\n return;\n }\n if (!this.validationCombo(evt)) return;\n if (this.enableDelegate) {\n this.updateDelegate(evt);\n } else {\n if (this.activeState) {\n var graph_1 = this.graph;\n var item = evt.item;\n var model_1 = item.getModel();\n // 拖动过程中实时计算距离\n var combos = graph_1.getCombos();\n var sourceBBox = item.getBBox();\n var centerX_1 = sourceBBox.centerX,\n centerY_1 = sourceBBox.centerY,\n width_1 = sourceBBox.width;\n // 参与计算的 Combo,需要排除掉:\n // 1、拖动 combo 自己\n // 2、拖动 combo 的 parent\n // 3、拖动 Combo 的 children\n var calcCombos = combos.filter(function (combo) {\n var cmodel = combo.getModel();\n // 被拖动的是最外层的 Combo,无 parent,排除自身和子元素\n if (!model_1.parentId) {\n return cmodel.id !== model_1.id && !_this.currentItemChildCombos.includes(cmodel.id);\n }\n return cmodel.id !== model_1.id && !_this.currentItemChildCombos.includes(cmodel.id);\n });\n calcCombos.map(function (combo) {\n var _a = combo.getBBox(),\n cx = _a.centerX,\n cy = _a.centerY,\n w = _a.width;\n // 拖动的 combo 和要进入的 combo 之间的距离\n var disX = centerX_1 - cx;\n var disY = centerY_1 - cy;\n // 圆心距离\n var distance = 2 * Math.sqrt(disX * disX + disY * disY);\n if (width_1 + w - distance > 0.8 * width_1) {\n graph_1.setItemState(combo, _this.activeState, true);\n } else {\n graph_1.setItemState(combo, _this.activeState, false);\n }\n });\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(this.targets, function (item) {\n _this.updateCombo(item, evt);\n });\n if (this.onlyChangeComboSize) {\n // 拖动节点过程中,动态改变 Combo 的大小\n this.updateParentCombos();\n }\n }\n },\n updatePositions: function updatePositions(evt, restore) {\n var _this = this;\n // 当启用 delegate 时,拖动结束时需要更新 combo\n if (this.enableDelegate || restore) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(this.targets, function (item) {\n _this.updateCombo(item, evt, restore);\n });\n }\n },\n onDrop: function onDrop(evt) {\n var _this = this;\n // 被放下的目标 combo\n var item = evt.item;\n this.currentShouldEnd = this.shouldEnd(evt, item, this);\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.currentShouldEnd || !item || !this.targets || item.destroyed) return;\n var graph = this.graph;\n var targetModel = item.getModel();\n this.targets.map(function (combo) {\n var model = combo.getModel();\n if (model.parentId !== targetModel.id) {\n if (_this.activeState) {\n graph.setItemState(item, _this.activeState, false);\n }\n // 将 Combo 放置到某个 Combo 上面时,只有当 onlyChangeComboSize 为 false 时候才更新 Combo 结构\n if (!_this.onlyChangeComboSize) {\n graph.updateComboTree(combo, targetModel.id, false);\n } else {\n graph.updateCombo(combo);\n }\n } else {\n graph.updateCombo(item);\n }\n });\n this.end(item, evt);\n // 如果已经拖放下了,则不需要再通过距离判断了\n this.endComparison = true;\n },\n onNodeDrop: function onNodeDrop(evt) {\n var _this = this;\n if (!this.targets || this.targets.length === 0) return;\n var graph = this.graph;\n var item = evt.item;\n var comboId = item.getModel().comboId;\n var newParentCombo = comboId ? graph.findById(comboId) : undefined;\n this.currentShouldEnd = this.shouldEnd(evt, newParentCombo, this);\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.currentShouldEnd) return;\n var droppedCombo;\n // 如果被放置的的节点有 comboId,且这个 comboId 与正在被拖拽的 combo 的父 id 不相同,则更新父亲为 comboId\n if (comboId) {\n if (this.activeState) {\n var combo = graph.findById(comboId);\n graph.setItemState(combo, this.activeState, false);\n }\n this.targets.map(function (combo) {\n if (!_this.onlyChangeComboSize) {\n if (comboId !== combo.getID()) {\n droppedCombo = graph.findById(comboId);\n if (comboId !== combo.getModel().parentId) graph.updateComboTree(combo, comboId, false);\n }\n } else {\n graph.updateCombo(combo);\n }\n });\n } else {\n // 如果被放置的节点没有 comboId,且正在被拖拽的 combo 有父 id,则更新父亲为 undefined\n this.targets.map(function (combo) {\n if (!_this.onlyChangeComboSize) {\n var model = combo.getModel();\n if (model.comboId) {\n graph.updateComboTree(combo, undefined, false);\n }\n } else {\n graph.updateCombo(combo);\n }\n });\n }\n // 如果已经拖放下了,则不需要再通过距离判断了\n this.endComparison = true;\n this.end(droppedCombo, evt);\n },\n onDragEnter: function onDragEnter(evt) {\n if (!this.origin) {\n return;\n }\n if (!this.validationCombo(evt)) return;\n var item = evt.item;\n var graph = this.graph;\n if (this.activeState) {\n graph.setItemState(item, this.activeState, true);\n }\n },\n onDragLeave: function onDragLeave(evt) {\n if (!this.origin) {\n return;\n }\n if (!this.validationCombo(evt)) return;\n var item = evt.item;\n var graph = this.graph;\n if (this.activeState) {\n graph.setItemState(item, this.activeState, false);\n }\n },\n onDragEnd: function onDragEnd(evt) {\n if (!this.targets || this.targets.length === 0) return;\n var item = evt.item;\n if (this.currentShouldEnd) {\n this.updatePositions(evt);\n }\n var parentCombo = this.getParentCombo(item.getModel().parentId);\n var graph = this.graph;\n if (parentCombo && this.activeState) {\n graph.setItemState(parentCombo, this.activeState, false);\n }\n this.end(undefined, evt);\n },\n end: function end(comboDropedOn, evt) {\n var _this = this;\n if (!this.origin) return;\n var graph = this.graph;\n // 删除delegate shape\n if (this.delegateShape) {\n var delegateGroup = graph.get('delegateGroup');\n delegateGroup.clear();\n this.delegateShape = null;\n }\n if (comboDropedOn && this.activeState) {\n graph.setItemState(comboDropedOn, this.activeState, false);\n }\n // 若没有被放置的 combo,则是被放置在画布上\n if (!comboDropedOn) {\n var stack_1 = graph.get('enabledStack') && this.enableStack;\n var stackData_1 = {\n before: {\n nodes: [],\n edges: [],\n combos: [].concat(this.get('beforeDragItems'))\n },\n after: {\n nodes: [],\n edges: [],\n combos: []\n }\n };\n this.targets.map(function (combo) {\n // 将 Combo 放置到某个 Combo 上面时,只有当 onlyChangeComboSize 为 false 时候才更新 Combo 结构\n if (!_this.onlyChangeComboSize) {\n graph.updateComboTree(combo, undefined, stack_1);\n } else {\n graph.updateCombo(combo);\n var _a = combo.getModel(),\n x = _a.x,\n y = _a.y,\n id = _a.id;\n stackData_1.after.combos.push({\n x: x,\n y: y,\n id: id\n });\n graph.pushStack('update', stackData_1);\n }\n });\n }\n this.point = [];\n this.origin = null;\n this.originPoint = null;\n this.targets.length = 0;\n },\n /**\n * 遍历 comboTree,分别更新 node 和 combo\n * @param data\n * @param fn\n */\n traverse: function traverse(data, fn, edgesToBeUpdate) {\n var _this = this;\n if (edgesToBeUpdate === void 0) {\n edgesToBeUpdate = {};\n }\n if (fn(data, edgesToBeUpdate) === false) {\n return;\n }\n if (data) {\n var combos = data.get('combos');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(combos, function (child) {\n _this.traverse(child, fn, edgesToBeUpdate);\n });\n var nodes = data.get('nodes');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(nodes, function (child) {\n _this.traverse(child, fn, edgesToBeUpdate);\n });\n }\n },\n updateCombo: function updateCombo(item, evt, restore) {\n this.updateSingleItem(item, evt, restore);\n var edgesToBeUpdate = {};\n this.traverse(item, function (paramItem, paramEdgesMap) {\n if (paramItem.destroyed) {\n return false;\n }\n paramItem.getEdges().forEach(function (edge) {\n return paramEdgesMap[edge.getID()] = edge;\n });\n return true;\n }, edgesToBeUpdate);\n Object.values(edgesToBeUpdate).forEach(function (edge) {\n return edge.refresh();\n });\n },\n /**\n *\n * @param item 当前正在拖动的元素\n * @param evt\n */\n updateSingleItem: function updateSingleItem(item, evt, restore) {\n var origin = this.origin;\n var graph = this.graph;\n var model = item.getModel();\n var itemId = item.get('id');\n if (!this.point[itemId]) {\n this.point[itemId] = {\n x: model.x,\n y: model.y\n };\n }\n var x = evt.x - origin.x + this.point[itemId].x;\n var y = evt.y - origin.y + this.point[itemId].y;\n if (restore) {\n x += origin.x - evt.x;\n y += origin.y - evt.y;\n }\n graph.updateItem(item, {\n x: x,\n y: y\n }, false);\n // item.getEdges()?.forEach(edge => edge.refresh());\n },\n\n /**\n * 根据 ID 获取父 Combo\n * @param parentId 父 Combo ID\n */\n getParentCombo: function getParentCombo(parentId) {\n var graph = this.graph;\n if (!parentId) {\n return undefined;\n }\n var parentCombo = graph.findById(parentId);\n if (!parentCombo) {\n return undefined;\n }\n return parentCombo;\n },\n updateDelegate: function updateDelegate(evt) {\n var graph = this.graph;\n // 当没有 delegate shape 时创建\n if (!this.delegateShape) {\n var delegateGroup = graph.get('delegateGroup');\n var bbox = null;\n if (this.targets.length > 1) {\n bbox = calculationItemsBBox(this.targets);\n } else {\n bbox = this.targets[0].getBBox();\n }\n var x = bbox.x,\n y = bbox.y,\n width = bbox.width,\n height = bbox.height,\n minX = bbox.minX,\n minY = bbox.minY;\n this.originPoint = {\n x: x,\n y: y,\n width: width,\n height: height,\n minX: minX,\n minY: minY\n };\n var attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].delegateStyle), this.delegateStyle);\n this.delegateShape = delegateGroup.addShape('rect', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n width: bbox.width,\n height: bbox.height,\n x: bbox.x,\n y: bbox.y\n }, attrs),\n name: 'combo-delegate-shape'\n });\n this.delegateShape.set('capture', false);\n this.delegate = this.delegateShape;\n } else {\n var clientX = evt.x - this.origin.x + this.originPoint.minX;\n var clientY = evt.y - this.origin.y + this.originPoint.minY;\n this.delegateShape.attr({\n x: clientX,\n y: clientY\n });\n }\n },\n /**\n * updates the parent combos' size and position\n */\n updateParentCombos: function updateParentCombos() {\n var _a = this,\n graph = _a.graph,\n targets = _a.targets;\n var comboParentMap = {};\n targets === null || targets === void 0 ? void 0 : targets.forEach(function (target) {\n var comboId = target.getModel().parentId;\n if (comboId) comboParentMap[comboId] = graph.findById(comboId);\n });\n Object.values(comboParentMap).forEach(function (combo) {\n if (combo) graph.updateCombo(combo);\n });\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/drag-combo.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/renderable/point/index.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/renderable/point/index.js ***! - \******************************************************************/ -/*! exports provided: Point */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/drag-node.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/drag-node.js ***! + \***********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Point\", function() { return Point; });\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/toConsumableArray */ \"./node_modules/@babel/runtime/helpers/toConsumableArray.js\");\n/* harmony import */ var _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/assertThisInitialized */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n/* harmony import */ var _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/inherits */ \"./node_modules/@babel/runtime/helpers/inherits.js\");\n/* harmony import */ var _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/possibleConstructorReturn */ \"./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js\");\n/* harmony import */ var _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @babel/runtime/helpers/getPrototypeOf */ \"./node_modules/@babel/runtime/helpers/getPrototypeOf.js\");\n/* harmony import */ var _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_10___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_10__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_12___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_12__);\n/* harmony import */ var _utils_picking__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ../../utils/picking */ \"./node_modules/@antv/g-webgpu/es/utils/picking.js\");\n/* harmony import */ var _Renderable__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ../Renderable */ \"./node_modules/@antv/g-webgpu/es/renderable/Renderable.js\");\n\n\n\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _dec4, _dec5, _dec6, _class, _class2, _descriptor, _descriptor2, _descriptor3, _temp;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8___default()(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _babel_runtime_helpers_getPrototypeOf__WEBPACK_IMPORTED_MODULE_8___default()(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _babel_runtime_helpers_possibleConstructorReturn__WEBPACK_IMPORTED_MODULE_7___default()(this, result); }; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Date.prototype.toString.call(Reflect.construct(Date, [], function () {})); return true; } catch (e) { return false; } }\n\n\n\n\n\n\n/* babel-plugin-inline-import './shaders/webgl.point.frag.glsl' */\nvar pointFrag = \"uniform float u_blur : 0.05;\\nuniform float u_opacity : 0.7;\\nuniform float u_stroke_width : 0.01;\\nuniform vec4 u_stroke_color : [0, 0, 0, 0];\\nuniform float u_stroke_opacity : 1;\\n\\nvarying vec4 v_color;\\nvarying vec4 v_data;\\nvarying float v_radius;\\n\\n#pragma include \\\"sdf2d\\\"\\n#pragma include \\\"picking\\\"\\n\\nvoid main() {\\n int shape = int(floor(v_data.w + 0.5));\\n\\n float antialiasblur = v_data.z;\\n float antialiased_blur = -max(u_blur, antialiasblur);\\n float r = v_radius / (v_radius + u_stroke_width);\\n\\n float outer_df;\\n float inner_df;\\n // 'circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'\\n // if (shape == 0) {\\n outer_df = sdCircle(v_data.xy, 1.0);\\n inner_df = sdCircle(v_data.xy, r);\\n // } else if (shape == 1) {\\n // outer_df = sdEquilateralTriangle(1.1 * v_data.xy);\\n // inner_df = sdEquilateralTriangle(1.1 / r * v_data.xy);\\n // } else if (shape == 2) {\\n // outer_df = sdBox(v_data.xy, vec2(1.));\\n // inner_df = sdBox(v_data.xy, vec2(r));\\n // } else if (shape == 3) {\\n // outer_df = sdPentagon(v_data.xy, 0.8);\\n // inner_df = sdPentagon(v_data.xy, r * 0.8);\\n // } else if (shape == 4) {\\n // outer_df = sdHexagon(v_data.xy, 0.8);\\n // inner_df = sdHexagon(v_data.xy, r * 0.8);\\n // } else if (shape == 5) {\\n // outer_df = sdOctogon(v_data.xy, 1.0);\\n // inner_df = sdOctogon(v_data.xy, r);\\n // } else if (shape == 6) {\\n // outer_df = sdHexagram(v_data.xy, 0.52);\\n // inner_df = sdHexagram(v_data.xy, r * 0.52);\\n // } else if (shape == 7) {\\n // outer_df = sdRhombus(v_data.xy, vec2(1.0));\\n // inner_df = sdRhombus(v_data.xy, vec2(r));\\n // } else if (shape == 8) {\\n // outer_df = sdVesica(v_data.xy, 1.1, 0.8);\\n // inner_df = sdVesica(v_data.xy, r * 1.1, r * 0.8);\\n // }\\n\\n float opacity_t = smoothstep(0.0, antialiased_blur, outer_df);\\n\\n float color_t = u_stroke_width < 0.01 ? 0.0 : smoothstep(\\n antialiased_blur,\\n 0.0,\\n inner_df\\n );\\n vec4 strokeColor = u_stroke_color == vec4(0) ? v_color : u_stroke_color;\\n\\n gl_FragColor = mix(vec4(v_color.rgb, v_color.a * u_opacity), strokeColor * u_stroke_opacity, color_t);\\n gl_FragColor.a = gl_FragColor.a * opacity_t;\\n\\n gl_FragColor = filterColor(gl_FragColor);\\n}\";\n\n/* babel-plugin-inline-import './shaders/webgl.point.vert.glsl' */\nvar pointVert = \"attribute vec2 position;\\nattribute vec4 color;\\nattribute float shape;\\nattribute vec2 offset;\\nattribute float size;\\n\\nuniform mat4 projectionMatrix;\\nuniform mat4 modelViewMatrix;\\n\\nuniform float u_stroke_width : 0.01;\\nuniform float u_device_pixel_ratio;\\nuniform vec2 u_viewport;\\n\\nvarying vec4 v_color;\\nvarying vec4 v_data;\\nvarying float v_radius;\\n\\n#pragma include \\\"picking\\\"\\n\\nvoid main() {\\n v_color = color;\\n v_radius = size;\\n\\n lowp float antialiasblur = 1.0 / u_device_pixel_ratio * (size + u_stroke_width);\\n\\n // construct point coords\\n v_data = vec4(position, antialiasblur, shape);\\n\\n gl_Position = projectionMatrix * modelViewMatrix\\n * vec4(position * size + offset, 0.0, 1.0);\\n\\n setPickingColor(a_PickingColor);\\n}\";\nvar pointShapes = ['circle', 'triangle', 'square', 'pentagon', 'hexagon', 'octogon', 'hexagram', 'rhombus', 'vesica'];\nvar Point = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_12__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_12__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_11__[\"IDENTIFIER\"].Systems), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_12__[\"named\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_11__[\"IDENTIFIER\"].MaterialSystem), _dec4 = Object(inversify__WEBPACK_IMPORTED_MODULE_12__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_11__[\"IDENTIFIER\"].Systems), _dec5 = Object(inversify__WEBPACK_IMPORTED_MODULE_12__[\"named\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_11__[\"IDENTIFIER\"].GeometrySystem), _dec6 = Object(inversify__WEBPACK_IMPORTED_MODULE_12__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_11__[\"IDENTIFIER\"].ShaderModuleService), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function (_Renderable) {\n _babel_runtime_helpers_inherits__WEBPACK_IMPORTED_MODULE_6___default()(Point, _Renderable);\n\n var _super = _createSuper(Point);\n\n function Point() {\n var _this;\n\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_3___default()(this, Point);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(_this, \"materialSystem\", _descriptor, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(_this, \"geometrySystem\", _descriptor2, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this));\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_2___default()(_this, \"shaderModuleService\", _descriptor3, _babel_runtime_helpers_assertThisInitialized__WEBPACK_IMPORTED_MODULE_5___default()(_this));\n\n return _this;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_4___default()(Point, [{\n key: \"onAttributeChanged\",\n value: function onAttributeChanged(_ref) {\n var name = _ref.name,\n data = _ref.data;\n var mesh = this.getMeshComponent();\n\n if (mesh && mesh.material) {\n if (name === 'strokeWidth') {\n mesh.material.setUniform('u_stroke_width', data);\n } else if (name === 'strokeColor') {\n mesh.material.setUniform('u_stroke_color', data);\n } else if (name === 'strokeOpacity') {\n mesh.material.setUniform('u_stroke_opacity', data);\n } else if (name === 'opacity') {\n mesh.material.setUniform('u_opacity', data);\n } else if (name === 'blur') {\n mesh.material.setUniform('u_blur', data);\n }\n }\n }\n }, {\n key: \"onEntityCreated\",\n value: function onEntityCreated() {\n this.shaderModuleService.registerModule('grid', {\n vs: pointVert,\n fs: pointFrag\n });\n\n var _this$shaderModuleSer = this.shaderModuleService.getModule('grid'),\n vs = _this$shaderModuleSer.vs,\n fs = _this$shaderModuleSer.fs,\n extractedUniforms = _this$shaderModuleSer.uniforms;\n\n var material = this.materialSystem.createShaderMaterial({\n vertexShader: vs,\n fragmentShader: fs,\n cull: {\n enable: false\n },\n depth: {\n enable: false\n },\n blend: {\n enable: true,\n func: {\n srcRGB: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_11__[\"gl\"].SRC_ALPHA,\n dstRGB: _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_11__[\"gl\"].ONE_MINUS_SRC_ALPHA,\n srcAlpha: 1,\n dstAlpha: 1\n }\n }\n }); // TODO: support define stroke-relative props per point\n\n material.setUniform(_objectSpread({\n u_device_pixel_ratio: window.devicePixelRatio\n }, extractedUniforms));\n var attributes = this.buildAttributes();\n var geometry = this.geometrySystem.createInstancedBufferGeometry({\n maxInstancedCount: attributes.instancedOffsets.length / 2,\n vertexCount: 6\n });\n geometry.setIndex([0, 2, 1, 0, 3, 2]);\n geometry.setAttribute('position', Float32Array.from(attributes.positions), {\n arrayStride: 4 * 2,\n stepMode: 'vertex',\n attributes: [{\n shaderLocation: 0,\n offset: 0,\n format: 'float2'\n }]\n });\n geometry.setAttribute('offset', Float32Array.from(attributes.instancedOffsets), {\n arrayStride: 4 * 2,\n stepMode: 'instance',\n attributes: [{\n shaderLocation: 1,\n offset: 0,\n format: 'float2'\n }]\n });\n geometry.setAttribute('color', Float32Array.from(attributes.instancedColors), {\n arrayStride: 4 * 4,\n stepMode: 'instance',\n attributes: [{\n shaderLocation: 2,\n offset: 0,\n format: 'float4'\n }]\n });\n geometry.setAttribute('size', Float32Array.from(attributes.instancedSizes), {\n arrayStride: 4,\n stepMode: 'instance',\n attributes: [{\n shaderLocation: 3,\n offset: 0,\n format: 'float'\n }]\n });\n geometry.setAttribute('shape', Float32Array.from(attributes.instancedShapes), {\n arrayStride: 4,\n stepMode: 'instance',\n attributes: [{\n shaderLocation: 4,\n offset: 0,\n format: 'float'\n }]\n });\n geometry.setAttribute('a_PickingColor', Float32Array.from(attributes.instancedPickingColors), {\n arrayStride: 4 * 3,\n stepMode: 'instance',\n attributes: [{\n shaderLocation: 6,\n offset: 0,\n format: 'float3'\n }]\n });\n this.setMaterial(material);\n this.setGeometry(geometry);\n }\n }, {\n key: \"buildAttribute\",\n value: function buildAttribute(config, attributes, index) {\n var _attributes$instanced, _attributes$instanced2, _attributes$instanced3, _attributes$instanced4;\n\n (_attributes$instanced = attributes.instancedPickingColors).push.apply(_attributes$instanced, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(Object(_utils_picking__WEBPACK_IMPORTED_MODULE_13__[\"encodePickingColor\"])(config.id || index)));\n\n attributes.instancedShapes.push(pointShapes.indexOf(config.shape || 'circle'));\n\n (_attributes$instanced2 = attributes.instancedColors).push.apply(_attributes$instanced2, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(config.color || [1, 0, 0, 1]));\n\n (_attributes$instanced3 = attributes.instancedOffsets).push.apply(_attributes$instanced3, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(config.position || [0, 0]));\n\n (_attributes$instanced4 = attributes.instancedSizes).push.apply(_attributes$instanced4, _babel_runtime_helpers_toConsumableArray__WEBPACK_IMPORTED_MODULE_0___default()(config.size || [0.2, 0.2]));\n }\n }, {\n key: \"buildAttributes\",\n value: function buildAttributes() {\n var _this2 = this;\n\n var attributes = {\n positions: [1, 1, 1, -1, -1, -1, -1, 1],\n instancedOffsets: [],\n instancedColors: [],\n instancedSizes: [],\n instancedShapes: [],\n instancedPickingColors: []\n };\n\n if (Array.isArray(this.config)) {\n this.config.forEach(function (config, i) {\n _this2.buildAttribute(config, attributes, i);\n });\n } else {\n this.buildAttribute(this.config, attributes, 0);\n }\n\n return attributes;\n }\n }]);\n\n return Point;\n}(_Renderable__WEBPACK_IMPORTED_MODULE_14__[\"Renderable\"]), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_9___default()(_class2.prototype, \"materialSystem\", [_dec2, _dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_9___default()(_class2.prototype, \"geometrySystem\", [_dec4, _dec5], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor3 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_9___default()(_class2.prototype, \"shaderModuleService\", [_dec6], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/renderable/point/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-pc/es/global.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n updateEdge: true,\n delegateStyle: {},\n // 是否开启delegate\n enableDelegate: false,\n // 拖动节点过程中是否只改变 Combo 的大小,而不改变其结构\n onlyChangeComboSize: false,\n // 拖动过程中目标 combo 状态样式\n comboActiveState: '',\n selectedState: 'selected',\n enableOptimize: false,\n enableDebounce: false,\n enableStack: true\n };\n },\n getEvents: function getEvents() {\n return {\n 'node:mousedown': 'onMouseDown',\n drag: 'onDragMove',\n dragend: 'onDragEnd',\n 'combo:dragenter': 'onDragEnter',\n 'combo:dragleave': 'onDragLeave',\n 'combo:drop': 'onDropCombo',\n 'node:drop': 'onDropNode',\n 'canvas:drop': 'onDropCanvas',\n touchstart: 'onTouchStart',\n touchmove: 'onTouchMove',\n touchend: 'onDragEnd',\n afterchangedata: 'onDragEnd'\n };\n },\n validationCombo: function validationCombo(item) {\n if (!this.origin || !item || item.destroyed) {\n return false;\n }\n var type = item.getType();\n if (type !== 'combo') {\n return false;\n }\n return true;\n },\n onTouchStart: function onTouchStart(evt) {\n if (!evt.item) return;\n var self = this;\n try {\n var touches = evt.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n if (event1 && event2) {\n return;\n }\n evt.preventDefault();\n } catch (e) {\n console.warn('Touch original event not exist!');\n }\n this.mousedown = {\n item: evt.item,\n target: evt.target,\n origin: {\n x: evt.x,\n y: evt.y\n }\n };\n this.dragstart = true;\n self.onDragStart(evt);\n },\n onTouchMove: function onTouchMove(e) {\n var self = this;\n try {\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n if (event1 && event2) {\n self.onDragEnd(e);\n return;\n }\n e.preventDefault();\n } catch (e) {\n console.warn('Touch original event not exist!');\n }\n self.onDrag(e);\n },\n /**\n * cache the manipulated item and target, since drag and dragend are global events but not node:*\n * @param evt event param\n */\n onMouseDown: function onMouseDown(evt) {\n this.mousedown = {\n item: evt.item,\n target: evt.target,\n origin: {\n x: evt.x,\n y: evt.y\n }\n };\n // 绑定浏览器监听,触发拖拽结束,结束拖拽时移除\n if (typeof window !== 'undefined' && !this.windowEventBinded) {\n this.windowEventBinded = true;\n document.body.addEventListener('contextmenu', this.onDragEnd.bind(this));\n document.body.addEventListener('mouseup', this.onDragEnd.bind(this));\n }\n },\n /**\n * trigger dragstart/drag by mousedown and drag events\n * @param evt event param\n */\n onDragMove: function onDragMove(evt) {\n var _a, _b;\n if (((_b = (_a = evt.item) === null || _a === void 0 ? void 0 : _a.getType) === null || _b === void 0 ? void 0 : _b.call(_a)) !== 'node') {\n this.onDragEnd();\n return;\n }\n if (!this.mousedown) return;\n if (!this.dragstart) {\n // dragstart\n this.dragstart = true;\n this.onDragStart(evt);\n } else {\n // drag\n this.onDrag(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, evt), this.mousedown));\n }\n },\n /**\n * 开始拖动节点\n * @param evt\n */\n onDragStart: function onDragStart(evt) {\n var _this = this;\n this.currentShouldEnd = true;\n if (!this.shouldBegin(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, evt), this.mousedown), this)) {\n return;\n }\n var _a = this.mousedown,\n item = _a.item,\n target = _a.target;\n if (!item || item.destroyed || item.hasLocked()) {\n return;\n }\n // 拖动时,设置拖动元素的 capture 为false,则不拾取拖动的元素\n var group = item.getContainer();\n group.set('capture', false);\n if (!this.cachedCaptureItems) this.cachedCaptureItems = [];\n this.cachedCaptureItems.push(item);\n // 如果拖动的target 是linkPoints / anchorPoints 则不允许拖动\n if (target) {\n var isAnchorPoint = target.get('isAnchorPoint');\n if (isAnchorPoint) {\n return;\n }\n }\n var graph = this.graph;\n this.targets = [];\n // 将节点拖入到指定的 Combo\n this.targetCombo = null;\n // 获取所有选中的元素\n var nodes = graph.findAllByState('node', this.selectedState);\n var currentNodeId = item.get('id');\n // 当前拖动的节点是否是选中的节点\n var dragNodes = nodes.filter(function (node) {\n var nodeId = node.get('id');\n return currentNodeId === nodeId;\n });\n // 只拖动当前节点\n if (dragNodes.length === 0) {\n this.targets.push(item);\n } else if (nodes.length > 1) {\n // 拖动多个节点\n nodes.forEach(function (node) {\n var locked = node.hasLocked();\n if (!locked) {\n _this.targets.push(node);\n }\n });\n } else {\n this.targets.push(item);\n }\n if (this.graph.get('enabledStack') && this.enableStack) {\n var beforeDragNodes_1 = [];\n this.targets.forEach(function (t) {\n var _a = t.getModel(),\n x = _a.x,\n y = _a.y,\n id = _a.id;\n beforeDragNodes_1.push({\n x: x,\n y: y,\n id: id\n });\n });\n this.set('beforeDragNodes', beforeDragNodes_1);\n }\n this.hidenEdge = {};\n if (this.get('updateEdge') && this.enableOptimize && !this.enableDelegate) {\n this.targets.forEach(function (node) {\n var edges = node.getEdges();\n edges.forEach(function (edge) {\n if (!edge.isVisible()) return;\n _this.hidenEdge[edge.getID()] = true;\n edge.hide();\n });\n });\n }\n this.origin = this.mousedown.origin;\n this.point = {};\n this.originPoint = {};\n },\n /**\n * 持续拖动节点\n * @param evt\n */\n onDrag: function onDrag(evt) {\n var _this = this;\n if (!this.mousedown || !this.origin) return;\n if (!this.shouldUpdate(evt, this)) return;\n if (this.get('enableDelegate')) {\n this.updateDelegate(evt);\n } else {\n if (this.enableDebounce) {\n this.debounceUpdate({\n targets: this.targets,\n graph: this.graph,\n point: this.point,\n origin: this.origin,\n evt: evt,\n updateEdge: this.get('updateEdge'),\n onlyChangeComboSize: this.onlyChangeComboSize,\n updateParentCombos: this.updateParentCombos\n });\n } else {\n var parentComboMap_1 = {};\n this.targets.map(function (target) {\n _this.update(target, evt);\n var parentComboId = target.getModel().comboId;\n if (parentComboId) parentComboMap_1[parentComboId] = _this.graph.findById(parentComboId);\n });\n if (this.onlyChangeComboSize) {\n // 拖动节点过程中,动态改变 Combo 的大小\n this.updateParentCombos();\n }\n }\n }\n },\n /**\n * 拖动结束,设置拖动元素capture为true,更新元素位置,如果是拖动涉及到 combo,则更新 combo 结构\n * @param evt\n */\n onDragEnd: function onDragEnd(evt) {\n var _this = this;\n var _a;\n this.mousedown = false;\n this.dragstart = false;\n // 移除浏览器监听\n if (typeof window !== 'undefined' && this.windowEventBinded) {\n this.windowEventBinded = false;\n document.body.removeEventListener('contextmenu', this.onDragEnd.bind(this));\n document.body.removeEventListener('mouseup', this.onDragEnd.bind(this));\n }\n if (!this.origin) {\n return;\n }\n // 拖动结束后,设置拖动元素 group 的 capture 为 true,允许拾取拖动元素\n (_a = this.cachedCaptureItems) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {\n var group = item.getContainer();\n group.set('capture', true);\n });\n this.cachedCaptureItems = [];\n if (this.delegateRect) {\n this.delegateRect.remove();\n this.delegateRect = null;\n }\n if (this.get('updateEdge') && this.enableOptimize && !this.enableDelegate) {\n this.targets.forEach(function (node) {\n var edges = node.getEdges();\n edges.forEach(function (edge) {\n if (_this.hidenEdge[edge.getID()]) edge.show();\n edge.refresh();\n });\n });\n }\n this.hidenEdge = {};\n var graph = this.graph;\n // 拖动结束后,入栈\n if (graph.get('enabledStack') && this.enableStack) {\n var stackData_1 = {\n before: {\n nodes: [],\n edges: [],\n combos: []\n },\n after: {\n nodes: [],\n edges: [],\n combos: []\n }\n };\n this.get('beforeDragNodes').forEach(function (model) {\n stackData_1.before.nodes.push(model);\n });\n this.targets.forEach(function (target) {\n var _a = target.getModel(),\n x = _a.x,\n y = _a.y,\n id = _a.id;\n stackData_1.after.nodes.push({\n x: x,\n y: y,\n id: id\n });\n });\n graph.pushStack('update', Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(stackData_1));\n }\n // 拖动结束后emit事件,将当前操作的节点抛出去,目标节点为null\n graph.emit('dragnodeend', {\n items: this.targets,\n targetItem: null\n });\n this.point = {};\n this.origin = null;\n this.originPoint = {};\n this.targets.length = 0;\n this.targetCombo = null;\n },\n /**\n * 拖动过程中将节点放置到 combo 上\n * @param evt\n */\n onDropCombo: function onDropCombo(evt) {\n var item = evt.item;\n this.currentShouldEnd = this.shouldEnd(evt, item, this);\n // 若不允许结束,则将节点位置设置回初识位置。后面的逻辑仍需要执行\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.currentShouldEnd || !this.validationCombo(item)) return;\n var graph = this.graph;\n if (this.comboActiveState) {\n graph.setItemState(item, this.comboActiveState, false);\n }\n this.targetCombo = item;\n // 拖动结束后是动态改变 Combo 大小还是将节点从 Combo 中删除\n if (this.onlyChangeComboSize) {\n // 拖动节点结束后,动态改变 Combo 的大小\n graph.updateCombos();\n } else {\n var targetComboModel_1 = item.getModel();\n this.targets.map(function (node) {\n var nodeModel = node.getModel();\n if (nodeModel.comboId !== targetComboModel_1.id) {\n graph.updateComboTree(node, targetComboModel_1.id);\n }\n });\n graph.updateCombo(item);\n }\n // 将节点拖动到 combo 上面,emit事件抛出当前操作的节点及目标 combo\n graph.emit('dragnodeend', {\n items: this.targets,\n targetItem: this.targetCombo\n });\n },\n onDropCanvas: function onDropCanvas(evt) {\n var graph = this.graph;\n this.currentShouldEnd = this.shouldEnd(evt, undefined, this);\n // 若不允许结束,则将节点位置设置回初识位置。后面的逻辑仍需要执行\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.targets || this.targets.length === 0 || !this.currentShouldEnd) return;\n if (this.onlyChangeComboSize) {\n this.updateParentCombos();\n } else {\n this.targets.map(function (node) {\n // 拖动的节点有 comboId,即是从其他 combo 中拖出时才处理\n var model = node.getModel();\n if (model.comboId) {\n graph.updateComboTree(node);\n }\n });\n }\n },\n /**\n * 拖动放置到某个 combo 中的子 node 上\n * @param evt\n */\n onDropNode: function onDropNode(evt) {\n if (!this.targets || this.targets.length === 0) return;\n var self = this;\n var item = evt.item;\n var graph = self.graph;\n var comboId = item.getModel().comboId;\n var newParentCombo = comboId ? graph.findById(comboId) : undefined;\n this.currentShouldEnd = this.shouldEnd(evt, newParentCombo, this);\n // 若不允许结束,则将节点位置设置回初识位置。后面的逻辑仍需要执行\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.currentShouldEnd) return;\n if (this.onlyChangeComboSize) {\n this.updateParentCombos();\n } else if (comboId) {\n var combo = graph.findById(comboId);\n if (self.comboActiveState) {\n graph.setItemState(combo, self.comboActiveState, false);\n }\n this.targets.map(function (node) {\n var nodeModel = node.getModel();\n if (comboId !== nodeModel.comboId) {\n graph.updateComboTree(node, comboId);\n }\n });\n graph.updateCombo(combo);\n } else {\n this.targets.map(function (node) {\n var model = node.getModel();\n if (model.comboId) {\n graph.updateComboTree(node);\n }\n });\n }\n // 将节点拖动到另外个节点上面,emit 事件抛出当前操作的节点及目标节点\n graph.emit('dragnodeend', {\n items: this.targets,\n targetItem: item\n });\n },\n /**\n * 将节点拖入到 Combo 中\n * @param evt\n */\n onDragEnter: function onDragEnter(evt) {\n var item = evt.item;\n if (!this.validationCombo(item)) return;\n var graph = this.graph;\n if (this.comboActiveState) {\n graph.setItemState(item, this.comboActiveState, true);\n }\n },\n /**\n * 将节点从 Combo 中拖出\n * @param evt\n */\n onDragLeave: function onDragLeave(evt) {\n var item = evt.item;\n if (!this.validationCombo(item)) return;\n var graph = this.graph;\n if (this.comboActiveState) {\n graph.setItemState(item, this.comboActiveState, false);\n }\n },\n updatePositions: function updatePositions(evt, restore) {\n var _this = this;\n if (!this.targets || this.targets.length === 0) return;\n // 当开启 delegate 时,拖动结束后需要更新所有已选中节点的位置\n if (this.get('enableDelegate')) {\n if (this.enableDebounce) this.debounceUpdate({\n targets: this.targets,\n graph: this.graph,\n point: this.point,\n origin: this.origin,\n evt: evt,\n updateEdge: this.get('updateEdge'),\n onlyChangeComboSize: this.onlyChangeComboSize,\n updateParentCombos: this.updateParentCombos\n });else if (!restore) this.targets.map(function (node) {\n return _this.update(node, evt);\n });\n } else this.targets.map(function (node) {\n return _this.update(node, evt, restore);\n });\n },\n /**\n * 更新节点\n * @param item 拖动的节点实例\n * @param evt\n */\n update: function update(item, evt, restore) {\n var origin = this.origin;\n var model = item.get('model');\n var nodeId = item.get('id');\n if (!this.point[nodeId]) {\n this.point[nodeId] = {\n x: model.x || 0,\n y: model.y || 0\n };\n }\n var x = evt.x - origin.x + this.point[nodeId].x;\n var y = evt.y - origin.y + this.point[nodeId].y;\n if (restore) {\n x += origin.x - evt.x;\n y += origin.y - evt.y;\n }\n var pos = {\n x: x,\n y: y\n };\n if (this.get('updateEdge')) {\n this.graph.updateItem(item, pos, false);\n } else {\n item.updatePosition(pos);\n }\n },\n /**\n * 限流更新节点\n * @param item 拖动的节点实例\n * @param evt\n */\n debounceUpdate: Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"debounce\"])(function (event) {\n var targets = event.targets,\n graph = event.graph,\n point = event.point,\n origin = event.origin,\n evt = event.evt,\n updateEdge = event.updateEdge,\n onlyChangeComboSize = event.onlyChangeComboSize,\n updateParentCombos = event.updateParentCombos;\n targets.map(function (item) {\n var model = item.get('model');\n var nodeId = item.get('id');\n if (!point[nodeId]) {\n point[nodeId] = {\n x: model.x || 0,\n y: model.y || 0\n };\n }\n var x = evt.x - origin.x + point[nodeId].x;\n var y = evt.y - origin.y + point[nodeId].y;\n var pos = {\n x: x,\n y: y\n };\n if (updateEdge) {\n graph.updateItem(item, pos, false);\n } else {\n item.updatePosition(pos);\n }\n });\n if (onlyChangeComboSize) {\n updateParentCombos(graph, targets);\n }\n }, 50, true),\n /**\n * 更新拖动元素时的delegate\n * @param {Event} evt 事件句柄\n * @param {number} x 拖动单个元素时候的x坐标\n * @param {number} y 拖动单个元素时候的y坐标\n */\n updateDelegate: function updateDelegate(evt) {\n var graph = this.graph;\n if (!this.delegateRect) {\n // 拖动多个\n var parent_1 = graph.get('group');\n var attrs = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].delegateStyle, this.delegateStyle);\n var _a = this.calculationGroupPosition(evt),\n cx = _a.x,\n cy = _a.y,\n width = _a.width,\n height = _a.height,\n minX = _a.minX,\n minY = _a.minY;\n this.originPoint = {\n x: cx,\n y: cy,\n width: width,\n height: height,\n minX: minX,\n minY: minY\n };\n // model上的x, y是相对于图形中心的,delegateShape是g实例,x,y是绝对坐标\n this.delegateRect = parent_1.addShape('rect', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n width: width,\n height: height,\n x: cx,\n y: cy\n }, attrs),\n name: 'rect-delegate-shape'\n });\n this.delegate = this.delegateRect;\n this.delegateRect.set('capture', false);\n } else {\n var clientX = evt.x - this.origin.x + this.originPoint.minX;\n var clientY = evt.y - this.origin.y + this.originPoint.minY;\n this.delegateRect.attr({\n x: clientX,\n y: clientY\n });\n }\n },\n /**\n * 计算delegate位置,包括左上角左边及宽度和高度\n * @memberof ItemGroup\n * @return {object} 计算出来的delegate坐标信息及宽高\n */\n calculationGroupPosition: function calculationGroupPosition(evt) {\n var nodes = this.targets;\n if (nodes.length === 0) {\n nodes.push(evt.item);\n }\n var minx = Infinity;\n var maxx = -Infinity;\n var miny = Infinity;\n var maxy = -Infinity;\n // 获取已节点的所有最大最小x y值\n for (var i = 0; i < nodes.length; i++) {\n var element = nodes[i];\n var bbox = element.getBBox();\n var minX = bbox.minX,\n minY = bbox.minY,\n maxX = bbox.maxX,\n maxY = bbox.maxY;\n if (minX < minx) {\n minx = minX;\n }\n if (minY < miny) {\n miny = minY;\n }\n if (maxX > maxx) {\n maxx = maxX;\n }\n if (maxY > maxy) {\n maxy = maxY;\n }\n }\n var x = Math.floor(minx);\n var y = Math.floor(miny);\n var width = Math.ceil(maxx) - Math.floor(minx);\n var height = Math.ceil(maxy) - Math.floor(miny);\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n minX: minx,\n minY: miny\n };\n },\n /**\n * updates the parent combos' size and position\n * @param paramGraph param for debounce function, where 'this' is not available\n * @param paramTargets param for debounce function, where 'this' is not available\n */\n updateParentCombos: function updateParentCombos(paramGraph, paramTargets) {\n var graph = paramGraph || this.graph;\n var targets = paramTargets || this.targets;\n var comboParentMap = {};\n targets === null || targets === void 0 ? void 0 : targets.forEach(function (target) {\n var comboId = target.getModel().comboId;\n if (comboId) comboParentMap[comboId] = graph.findById(comboId);\n });\n Object.values(comboParentMap).forEach(function (combo) {\n if (combo) graph.updateCombo(combo);\n });\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/drag-node.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/texture/Cache.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/texture/Cache.js ***! - \*********************************************************/ -/*! exports provided: TextureCache */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/edge-tooltip.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/edge-tooltip.js ***! + \**************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TextureCache\", function() { return TextureCache; });\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_2__);\n\n\n\nvar _dec, _class, _temp;\n\n\nvar TextureCache = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_2__[\"injectable\"])(), _dec(_class = (_temp = /*#__PURE__*/function () {\n function TextureCache() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_0___default()(this, TextureCache);\n\n this.cache = {};\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_1___default()(TextureCache, [{\n key: \"get\",\n value: function get(name) {\n return this.cache[name];\n }\n }, {\n key: \"set\",\n value: function set(name, texture) {\n this.cache[name] = texture;\n }\n }]);\n\n return TextureCache;\n}(), _temp)) || _class);\n//# sourceMappingURL=Cache.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/texture/Cache.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _tooltip_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tooltip-base */ \"./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n getDefaultCfg: function getDefaultCfg() {\n return {\n item: 'edge',\n offset: 12,\n formatText: function formatText(model) {\n return \"source: \".concat(model.source, \" target: \").concat(model.target);\n }\n };\n },\n getEvents: function getEvents() {\n return {\n 'edge:mouseenter': 'onMouseEnter',\n 'edge:mouseleave': 'onMouseLeave',\n 'edge:mousemove': 'onMouseMove',\n afterremoveitem: 'onMouseLeave'\n };\n }\n}, _tooltip_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/edge-tooltip.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/texture/Texture2D.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/texture/Texture2D.js ***! - \*************************************************************/ -/*! exports provided: Texture2D */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/index.js ***! + \*******************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Texture2D\", function() { return Texture2D; });\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/regenerator */ \"./node_modules/@babel/runtime/regenerator/index.js\");\n/* harmony import */ var _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @babel/runtime/helpers/defineProperty */ \"./node_modules/@babel/runtime/helpers/defineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @babel/runtime/helpers/asyncToGenerator */ \"./node_modules/@babel/runtime/helpers/asyncToGenerator.js\");\n/* harmony import */ var _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @babel/runtime/helpers/initializerDefineProperty */ \"./node_modules/@babel/runtime/helpers/initializerDefineProperty.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @babel/runtime/helpers/classCallCheck */ \"./node_modules/@babel/runtime/helpers/classCallCheck.js\");\n/* harmony import */ var _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @babel/runtime/helpers/createClass */ \"./node_modules/@babel/runtime/helpers/createClass.js\");\n/* harmony import */ var _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5__);\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @babel/runtime/helpers/applyDecoratedDescriptor */ \"./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js\");\n/* harmony import */ var _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6__);\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @babel/runtime/helpers/initializerWarningHelper */ \"./node_modules/@babel/runtime/helpers/initializerWarningHelper.js\");\n/* harmony import */ var _babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_initializerWarningHelper__WEBPACK_IMPORTED_MODULE_7__);\n/* harmony import */ var _antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @antv/g-webgpu-core */ \"./node_modules/@antv/g-webgpu-core/es/index.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! inversify */ \"./node_modules/inversify/lib/inversify.js\");\n/* harmony import */ var inversify__WEBPACK_IMPORTED_MODULE_9___default = /*#__PURE__*/__webpack_require__.n(inversify__WEBPACK_IMPORTED_MODULE_9__);\n/* harmony import */ var _Cache__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./Cache */ \"./node_modules/@antv/g-webgpu/es/texture/Cache.js\");\n\n\n\n\n\n\n\n\n\nvar _dec, _dec2, _dec3, _class, _class2, _descriptor, _descriptor2, _temp;\n\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); if (enumerableOnly) symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; }); keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = arguments[i] != null ? arguments[i] : {}; if (i % 2) { ownKeys(Object(source), true).forEach(function (key) { _babel_runtime_helpers_defineProperty__WEBPACK_IMPORTED_MODULE_1___default()(target, key, source[key]); }); } else if (Object.getOwnPropertyDescriptors) { Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)); } else { ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } } return target; }\n\n\n\n\nvar Texture2D = (_dec = Object(inversify__WEBPACK_IMPORTED_MODULE_9__[\"injectable\"])(), _dec2 = Object(inversify__WEBPACK_IMPORTED_MODULE_9__[\"inject\"])(_Cache__WEBPACK_IMPORTED_MODULE_10__[\"TextureCache\"]), _dec3 = Object(inversify__WEBPACK_IMPORTED_MODULE_9__[\"inject\"])(_antv_g_webgpu_core__WEBPACK_IMPORTED_MODULE_8__[\"IDENTIFIER\"].RenderEngine), _dec(_class = (_class2 = (_temp = /*#__PURE__*/function () {\n function Texture2D() {\n _babel_runtime_helpers_classCallCheck__WEBPACK_IMPORTED_MODULE_4___default()(this, Texture2D);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"textureCache\", _descriptor, this);\n\n _babel_runtime_helpers_initializerDefineProperty__WEBPACK_IMPORTED_MODULE_3___default()(this, \"engine\", _descriptor2, this);\n\n this.config = void 0;\n this.loaded = false;\n this.texture = void 0;\n }\n\n _babel_runtime_helpers_createClass__WEBPACK_IMPORTED_MODULE_5___default()(Texture2D, [{\n key: \"setConfig\",\n value: function setConfig(config) {\n this.config = config;\n }\n }, {\n key: \"isLoaded\",\n value: function isLoaded() {\n return this.loaded;\n } // public update(config: ITexture2DInitializationOptions) {\n // if (this.loaded && this.texture) {\n // const t = this.texture.get();\n // }\n // }\n\n }, {\n key: \"load\",\n value: function () {\n var _load = _babel_runtime_helpers_asyncToGenerator__WEBPACK_IMPORTED_MODULE_2___default()( /*#__PURE__*/_babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.mark(function _callee() {\n var _this = this;\n\n return _babel_runtime_regenerator__WEBPACK_IMPORTED_MODULE_0___default.a.wrap(function _callee$(_context) {\n while (1) {\n switch (_context.prev = _context.next) {\n case 0:\n if (!this.config.url) {\n _context.next = 4;\n break;\n }\n\n return _context.abrupt(\"return\", new Promise(function (resolve, reject) {\n var existed = _this.textureCache.get(_this.config.url);\n\n if (existed) {\n resolve(existed);\n } else {\n var image = new Image();\n image.crossOrigin = 'Anonymous';\n image.src = _this.config.url;\n\n image.onload = function () {\n var texture = _this.engine.createTexture2D(_objectSpread(_objectSpread({}, _this.config), {}, {\n data: image,\n width: image.width,\n height: image.height,\n flipY: true\n }));\n\n _this.textureCache.set(_this.config.url, texture);\n\n _this.texture = texture;\n _this.loaded = true;\n resolve(texture);\n };\n\n image.onerror = function () {\n reject();\n };\n }\n }));\n\n case 4:\n this.loaded = true;\n this.texture = this.engine.createTexture2D(this.config);\n return _context.abrupt(\"return\", this.texture);\n\n case 7:\n case \"end\":\n return _context.stop();\n }\n }\n }, _callee, this);\n }));\n\n function load() {\n return _load.apply(this, arguments);\n }\n\n return load;\n }()\n }]);\n\n return Texture2D;\n}(), _temp), (_descriptor = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"textureCache\", [_dec2], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n}), _descriptor2 = _babel_runtime_helpers_applyDecoratedDescriptor__WEBPACK_IMPORTED_MODULE_6___default()(_class2.prototype, \"engine\", [_dec3], {\n configurable: true,\n enumerable: true,\n writable: true,\n initializer: null\n})), _class2)) || _class);\n//# sourceMappingURL=Texture2D.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/texture/Texture2D.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _drag_canvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./drag-canvas */ \"./node_modules/@antv/g6-pc/es/behavior/drag-canvas.js\");\n/* harmony import */ var _drag_node__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./drag-node */ \"./node_modules/@antv/g6-pc/es/behavior/drag-node.js\");\n/* harmony import */ var _activate_relations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./activate-relations */ \"./node_modules/@antv/g6-pc/es/behavior/activate-relations.js\");\n/* harmony import */ var _brush_select__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./brush-select */ \"./node_modules/@antv/g6-pc/es/behavior/brush-select.js\");\n/* harmony import */ var _click_select__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./click-select */ \"./node_modules/@antv/g6-pc/es/behavior/click-select.js\");\n/* harmony import */ var _zoom_canvas__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./zoom-canvas */ \"./node_modules/@antv/g6-pc/es/behavior/zoom-canvas.js\");\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./tooltip */ \"./node_modules/@antv/g6-pc/es/behavior/tooltip.js\");\n/* harmony import */ var _edge_tooltip__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./edge-tooltip */ \"./node_modules/@antv/g6-pc/es/behavior/edge-tooltip.js\");\n/* harmony import */ var _collapse_expand__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./collapse-expand */ \"./node_modules/@antv/g6-pc/es/behavior/collapse-expand.js\");\n/* harmony import */ var _drag_combo__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./drag-combo */ \"./node_modules/@antv/g6-pc/es/behavior/drag-combo.js\");\n/* harmony import */ var _collapse_expand_combo__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collapse-expand-combo */ \"./node_modules/@antv/g6-pc/es/behavior/collapse-expand-combo.js\");\n/* harmony import */ var _lasso_select__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lasso-select */ \"./node_modules/@antv/g6-pc/es/behavior/lasso-select.js\");\n/* harmony import */ var _create_edge__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./create-edge */ \"./node_modules/@antv/g6-pc/es/behavior/create-edge.js\");\n/* harmony import */ var _shortcuts_call__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./shortcuts-call */ \"./node_modules/@antv/g6-pc/es/behavior/shortcuts-call.js\");\n/* harmony import */ var _scroll_canvas__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./scroll-canvas */ \"./node_modules/@antv/g6-pc/es/behavior/scroll-canvas.js\");\n\n\n// import Behavior from './behavior';\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar behaviors = {\n 'drag-canvas': _drag_canvas__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n 'zoom-canvas': _zoom_canvas__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n 'drag-node': _drag_node__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n 'activate-relations': _activate_relations__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n 'brush-select': _brush_select__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'click-select': _click_select__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n 'lasso-select': _lasso_select__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n tooltip: _tooltip__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n 'edge-tooltip': _edge_tooltip__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n 'collapse-expand': _collapse_expand__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n 'drag-combo': _drag_combo__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n 'collapse-expand-combo': _collapse_expand_combo__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n 'create-edge': _create_edge__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n 'shortcuts-call': _shortcuts_call__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n 'scroll-canvas': _scroll_canvas__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n};\nObject(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(behaviors, function (behavior, type) {\n Object(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerBehavior\"])(type, behavior);\n});\n// export default Behavior;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/canvas.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/canvas.js ***! - \********************************************************/ -/*! exports provided: createCanvas */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/lasso-select.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/lasso-select.js ***! + \**************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createCanvas\", function() { return createCanvas; });\nfunction createCanvas() {\n if (typeof document !== 'undefined') {\n return document.createElement('canvas');\n } else {\n throw new Error('Cannot create a canvas in this context');\n }\n}\n//# sourceMappingURL=canvas.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/canvas.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n\n\nvar isPolygonsIntersect = _util__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isPolygonsIntersect,\n pathToPoints = _util__WEBPACK_IMPORTED_MODULE_1__[\"default\"].pathToPoints;\nvar DEFAULT_TRIGGER = 'shift';\nvar ALLOW_EVENTS = ['drag', 'shift', 'ctrl', 'alt', 'control'];\nvar isItemIntersecPolygon = function isItemIntersecPolygon(item, polyPoints) {\n var shapePoints;\n var shape = item.getKeyShape();\n if (item.get('type') === 'path') {\n shapePoints = pathToPoints(shape.attr('path'));\n } else {\n var shapeBBox = shape.getCanvasBBox();\n shapePoints = [[shapeBBox.minX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.maxY], [shapeBBox.minX, shapeBBox.maxY]];\n }\n return isPolygonsIntersect(polyPoints, shapePoints);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n delegateStyle: {\n fill: '#EEF6FF',\n fillOpacity: 0.4,\n stroke: '#DDEEFE',\n lineWidth: 1\n },\n onSelect: function onSelect() {},\n onDeselect: function onDeselect() {},\n shouldDeselect: undefined,\n selectedState: 'selected',\n trigger: DEFAULT_TRIGGER,\n includeEdges: true,\n selectedEdges: [],\n selectedNodes: []\n // multiple: false,\n };\n },\n\n getEvents: function getEvents() {\n // 检测输入是否合法\n if (!(ALLOW_EVENTS.indexOf(this.trigger.toLowerCase()) > -1)) {\n this.trigger = DEFAULT_TRIGGER;\n console.warn(\"Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'\");\n }\n if (this.trigger === 'drag') {\n return {\n dragstart: 'onDragStart',\n drag: 'onDragMove',\n dragend: 'onDragEnd',\n 'canvas:click': 'clearStates'\n };\n }\n return {\n dragstart: 'onDragStart',\n drag: 'onDragMove',\n dragend: 'onDragEnd',\n keyup: 'onKeyUp',\n keydown: 'onKeyDown',\n 'canvas:click': 'clearStates'\n };\n },\n onDragStart: function onDragStart(e) {\n var lasso = this.lasso;\n var item = e.item;\n // 排除在节点上拖动\n if (item) {\n return;\n }\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n if (this.selectedNodes && this.selectedNodes.length !== 0) {\n this.clearStates('dragstart');\n }\n if (!lasso) {\n lasso = this.createLasso();\n }\n this.dragging = true;\n this.originPoint = {\n x: e.x,\n y: e.y\n };\n this.points.push(this.originPoint);\n lasso.show();\n },\n onDragMove: function onDragMove(e) {\n if (!this.dragging) {\n return;\n }\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n this.points.push({\n x: e.x,\n y: e.y\n });\n this.updateLasso(e);\n },\n onDragEnd: function onDragEnd(e) {\n if (!this.lasso && !this.dragging) {\n return;\n }\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n this.points.push(this.originPoint);\n this.getSelectedItems();\n this.lasso.remove(true);\n this.lasso = null;\n this.points = [];\n this.dragging = false;\n },\n getLassoPath: function getLassoPath() {\n var points = this.points;\n var path = [];\n if (points.length) {\n points.forEach(function (point, index) {\n if (index === 0) {\n path.push(['M', point.x, point.y]);\n } else {\n path.push(['L', point.x, point.y]);\n }\n });\n path.push(['L', points[0].x, points[0].y]);\n }\n return path;\n },\n clearStates: function clearStates(action) {\n if (action === void 0) {\n action = 'canvas:click';\n }\n var _a = this,\n graph = _a.graph,\n selectedState = _a.selectedState,\n shouldDeselect = _a.shouldDeselect;\n var nodes = graph.findAllByState('node', selectedState);\n var edges = graph.findAllByState('edge', selectedState);\n if (!shouldDeselect || shouldDeselect({\n action: action,\n nodes: nodes,\n edges: edges\n })) {\n nodes.forEach(function (node) {\n return graph.setItemState(node, selectedState, false);\n });\n edges.forEach(function (edge) {\n return graph.setItemState(edge, selectedState, false);\n });\n }\n if (this.onDeselect) {\n this.onDeselect(this.selectedNodes, this.selectedEdges);\n }\n this.selectedNodes = [];\n this.selectedEdges = [];\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: [],\n edges: []\n },\n select: false\n });\n },\n getSelectedItems: function getSelectedItems() {\n var _this = this;\n var _a = this,\n graph = _a.graph,\n shouldUpdate = _a.shouldUpdate;\n var lassoContour = this.points.map(function (point) {\n return [graph.getCanvasByPoint(point.x, point.y).x, graph.getCanvasByPoint(point.x, point.y).y];\n });\n var state = this.selectedState;\n var selectedNodes = [];\n var selectedIds = [];\n graph.getNodes().forEach(function (node) {\n if (!node.isVisible()) return; // 隐藏节点不能被选中\n if (isItemIntersecPolygon(node, lassoContour)) {\n if (shouldUpdate(node, 'select', _this)) {\n selectedNodes.push(node);\n var model = node.getModel();\n selectedIds.push(model.id);\n graph.setItemState(node, state, true);\n }\n }\n });\n var selectedEdges = [];\n if (this.includeEdges) {\n // 选中边,边的source和target都在选中的节点中时才选中\n selectedNodes.forEach(function (node) {\n var edges = node.getOutEdges();\n edges.forEach(function (edge) {\n if (!edge.isVisible()) return; // 隐藏边不能够被选中\n var model = edge.getModel();\n var source = model.source,\n target = model.target;\n if (selectedIds.includes(source) && selectedIds.includes(target) && shouldUpdate(edge, 'select', _this)) {\n selectedEdges.push(edge);\n graph.setItemState(edge, _this.selectedState, true);\n }\n });\n });\n }\n this.selectedEdges = selectedEdges;\n this.selectedNodes = selectedNodes;\n if (this.onSelect) {\n this.onSelect(selectedNodes, selectedEdges);\n }\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges\n },\n select: true\n });\n },\n createLasso: function createLasso() {\n var self = this;\n var lasso = self.graph.get('delegateGroup').addShape('path', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: []\n }, self.delegateStyle),\n capture: false,\n name: 'lasso-shape'\n });\n this.lasso = lasso;\n this.delegate = lasso;\n this.points = [];\n return lasso;\n },\n updateLasso: function updateLasso(e) {\n var self = this;\n this.lasso.attr({\n path: self.getLassoPath()\n });\n },\n onKeyDown: function onKeyDown(e) {\n var code = e.key;\n if (!code) {\n return;\n }\n // if (this.selectedNodes && this.selectedNodes.length !== 0) {\n // this.clearStates();\n // }\n if (code.toLowerCase() === this.trigger.toLowerCase()) {\n this.keydown = true;\n } else {\n this.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n if (this.lasso) {\n // 清除所有选中状态后,设置拖得动状态为false,并清除框选的lasso\n this.lasso.remove(true);\n this.lasso = null;\n this.points = [];\n this.dragging = false;\n }\n this.keydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/lasso-select.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/is-array.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/is-array.js ***! - \**********************************************************/ +/***/ "./node_modules/@antv/g6-pc/es/behavior/scroll-canvas.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/scroll-canvas.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/g-webgpu/es/utils/is-type.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Array.isArray ? Array.isArray(value) : Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Array');\n});\n//# sourceMappingURL=is-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/is-array.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar ALLOW_EVENTS = ['shift', 'ctrl', 'alt', 'control', 'meta'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n direction: 'both',\n enableOptimize: false,\n zoomKey: 'ctrl',\n // scroll-canvas 可滚动的扩展范围,默认为 0,即最多可以滚动一屏的位置\n // 当设置的值大于 0 时,即滚动可以超过一屏\n // 当设置的值小于 0 时,相当于缩小了可滚动范围\n // 具体实例可参考:https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*IFfoS67_HssAAAAAAAAAAAAAARQnAQ\n scalableRange: 0,\n allowDragOnItem: true\n };\n },\n getEvents: function getEvents() {\n if (!this.zoomKey || ALLOW_EVENTS.indexOf(this.zoomKey) === -1) this.zoomKey = 'ctrl';\n return {\n wheel: 'onWheel'\n };\n },\n onWheel: function onWheel(ev) {\n var _this = this;\n if (!this.allowDrag(ev)) return;\n var graph = this.graph;\n var zoomKeys = Array.isArray(this.zoomKey) ? [].concat(this.zoomKey) : [this.zoomKey];\n if (zoomKeys.includes('control')) zoomKeys.push('ctrl');\n var keyDown = zoomKeys.some(function (ele) {\n return ev[\"\".concat(ele, \"Key\")];\n });\n if (keyDown) {\n var canvas = graph.get('canvas');\n var point = canvas.getPointByClient(ev.clientX, ev.clientY);\n var ratio = graph.getZoom();\n if (ev.wheelDelta > 0) {\n ratio = ratio + ratio * 0.05;\n } else {\n ratio = ratio - ratio * 0.05;\n }\n graph.zoomTo(ratio, {\n x: point.x,\n y: point.y\n });\n } else {\n var dx = ev.deltaX || ev.movementX;\n var dy = ev.deltaY || ev.movementY;\n if (!dy && navigator.userAgent.indexOf('Firefox') > -1) dy = -ev.wheelDelta * 125 / 3;\n var width = this.graph.get('width');\n var height = this.graph.get('height');\n var graphCanvasBBox = this.graph.get('canvas').getCanvasBBox();\n var expandWidth = this.scalableRange;\n var expandHeight = this.scalableRange;\n // 若 scalableRange 是 0~1 的小数,则作为比例考虑\n if (expandWidth < 1 && expandWidth > -1) {\n expandWidth = width * expandWidth;\n expandHeight = height * expandHeight;\n }\n var minX = graphCanvasBBox.minX,\n maxX = graphCanvasBBox.maxX,\n minY = graphCanvasBBox.minY,\n maxY = graphCanvasBBox.maxY;\n if (dx > 0) {\n if (maxX < -expandWidth) {\n dx = 0;\n } else if (maxX - dx < -expandWidth) {\n dx = maxX + expandWidth;\n }\n } else if (dx < 0) {\n if (minX > width + expandWidth) {\n dx = 0;\n } else if (minX - dx > width + expandWidth) {\n dx = minX - (width + expandWidth);\n }\n }\n if (dy > 0) {\n if (maxY < -expandHeight) {\n dy = 0;\n } else if (maxY - dy < -expandHeight) {\n dy = maxY + expandHeight;\n }\n } else if (dy < 0) {\n if (minY > height + expandHeight) {\n dy = 0;\n } else if (minY - dy > height + expandHeight) {\n dy = minY - (height + expandHeight);\n }\n }\n if (this.get('direction') === 'x') {\n dy = 0;\n } else if (this.get('direction') === 'y') {\n dx = 0;\n }\n graph.translate(-dx, -dy);\n }\n ev.preventDefault();\n // hide the shapes when the zoom ratio is smaller than optimizeZoom\n // hide the shapes when zoomming\n var enableOptimize = this.get('enableOptimize');\n if (enableOptimize) {\n var optimizeZoom_1 = this.get('optimizeZoom');\n var optimized = this.get('optimized');\n var nodes_1 = graph.getNodes();\n var edges_1 = graph.getEdges();\n var nodesLength_1 = nodes_1.length;\n var edgesLength_1 = edges_1.length;\n // hiding\n if (!optimized) {\n for (var n = 0; n < nodesLength_1; n++) {\n var node = nodes_1[n];\n if (!node.destroyed) {\n var children = node.get('group').get('children');\n var childrenLength = children.length;\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n if (!shape.destoryed && !shape.get('isKeyShape')) {\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n }\n }\n }\n }\n for (var edgeIndex = 0; edgeIndex < edgesLength_1; edgeIndex++) {\n var edge = edges_1[edgeIndex];\n var children = edge.get('group').get('children');\n var childrenLength = children.length;\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n }\n }\n this.set('optimized', true);\n }\n // showing after 100ms\n clearTimeout(this.get('timeout'));\n var timeout = setTimeout(function () {\n var currentZoom = graph.getZoom();\n var curOptimized = _this.get('optimized');\n if (curOptimized) {\n _this.set('optimized', false);\n for (var n = 0; n < nodesLength_1; n++) {\n var node = nodes_1[n];\n var children = node.get('group').get('children');\n var childrenLength = children.length;\n if (currentZoom < optimizeZoom_1) {\n var keyShape = node.getKeyShape();\n var oriVis = keyShape.get('ori-visibility');\n if (oriVis) keyShape.show();\n } else {\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n var oriVis = shape.get('ori-visibility');\n if (!shape.get('visible') && oriVis) {\n if (oriVis) shape.show();\n }\n }\n }\n }\n for (var edgeIndex = 0; edgeIndex < edgesLength_1; edgeIndex++) {\n var edge = edges_1[edgeIndex];\n var children = edge.get('group').get('children');\n var childrenLength = children.length;\n if (currentZoom < optimizeZoom_1) {\n var keyShape = edge.getKeyShape();\n var oriVis = keyShape.get('ori-visibility');\n if (oriVis) keyShape.show();\n } else {\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n if (!shape.get('visible')) {\n var oriVis = shape.get('ori-visibility');\n if (oriVis) shape.show();\n }\n }\n }\n }\n }\n }, 100);\n this.set('timeout', timeout);\n }\n },\n allowDrag: function allowDrag(evt) {\n var _a, _b;\n var target = evt.target;\n var targetIsCanvas = target && target.isCanvas && target.isCanvas();\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isBoolean\"])(this.allowDragOnItem) && !this.allowDragOnItem && !targetIsCanvas) return false;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(this.allowDragOnItem)) {\n var _c = this.allowDragOnItem,\n node = _c.node,\n edge = _c.edge,\n combo = _c.combo;\n var itemType = (_b = (_a = evt.item) === null || _a === void 0 ? void 0 : _a.getType) === null || _b === void 0 ? void 0 : _b.call(_a);\n if (!node && itemType === 'node') return false;\n if (!edge && itemType === 'edge') return false;\n if (!combo && itemType === 'combo') return false;\n }\n return true;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/scroll-canvas.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/is-number.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/is-number.js ***! - \***********************************************************/ -/*! exports provided: isNumber */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/shortcuts-call.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/shortcuts-call.js ***! + \****************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar DEFAULT_TRIGGER = 'ctrl';\nvar ALLOW_EVENTS = ['shift', 'ctrl', 'alt', 'control'];\nvar DEFAULT_COMBINED_KEY = '1';\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n trigger: DEFAULT_TRIGGER,\n combinedKey: DEFAULT_COMBINED_KEY,\n functionName: 'fitView',\n functionParams: []\n };\n },\n getEvents: function getEvents() {\n // 检测输入是否合法\n if (!(ALLOW_EVENTS.indexOf(this.trigger.toLowerCase()) > -1)) {\n this.trigger = DEFAULT_TRIGGER;\n console.warn(\"Behavior shortcuts-fit-view \\u7684 trigger \\u53C2\\u6570 '\".concat(this.trigger, \"' \\u4E0D\\u5408\\u6CD5\\uFF0C\\u8BF7\\u8F93\\u5165 'drag'\\u3001'shift'\\u3001'ctrl' \\u6216 'alt'\"));\n }\n if (this.combinedKey === this.trigger) {\n this.combinedKey = undefined;\n }\n return {\n keyup: 'onKeyUp',\n keydown: 'onKeyDown'\n };\n },\n onKeyDown: function onKeyDown(e) {\n var code = e.key;\n if (!code) {\n return;\n }\n var triggerLowerCase = this.trigger.toLowerCase();\n var codeLowerCase = code.toLowerCase();\n // 按住 control 键时,允许用户设置 trigger 为 ctrl\n if (!this.triggerKeydown) {\n if (codeLowerCase === triggerLowerCase || codeLowerCase === 'control' && triggerLowerCase === 'ctrl' || codeLowerCase === 'ctrl' && triggerLowerCase === 'control') {\n this.triggerKeydown = true;\n } else {\n this.triggerKeydown = false;\n }\n }\n var graph = this.graph;\n if (!graph[this.functionName]) {\n console.warn(\"Behavior shortcuts-fit-view \\u7684 functionName \\u53C2\\u6570 '\".concat(this.functionName, \"' \\u4E0D\\u5408\\u6CD5\\uFF0C\\u5B83\\u4E0D\\u662F Graph \\u7684\\u4E00\\u4E2A\\u51FD\\u6570\\u540D\"));\n return {};\n }\n // 未配置 combinedKey,直接 fitView\n if (this.triggerKeydown && !this.combinedKey) {\n if (this.functionParams && this.functionParams.length) graph[this.functionName].apply(graph, this.functionParams);else graph[this.functionName]();\n return;\n }\n var combinedKeyLowerCase = this.combinedKey.toLowerCase();\n if (this.triggerKeydown) {\n if (codeLowerCase === combinedKeyLowerCase || codeLowerCase === 'control' && combinedKeyLowerCase === 'ctrl' || codeLowerCase === 'ctrl' && combinedKeyLowerCase === 'control') {\n if (this.functionParams && this.functionParams.length) graph[this.functionName].apply(graph, this.functionParams);else graph[this.functionName]();\n }\n }\n },\n onKeyUp: function onKeyUp() {\n if (this.brush) {\n // 清除所有选中状态后,设置拖得动状态为false,并清除框选的brush\n this.brush.remove(true);\n this.brush = null;\n this.dragging = false;\n }\n this.triggerKeydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/shortcuts-call.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js ***! + \**************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return isNumber; });\nfunction isNumber(value) {\n return typeof value === 'number';\n}\n//# sourceMappingURL=is-number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/is-number.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n onMouseEnter: function onMouseEnter(e) {\n var item = e.item;\n this.currentTarget = item;\n this.showTooltip(e);\n this.graph.emit('tooltipchange', {\n item: e.item,\n action: 'show'\n });\n },\n onMouseMove: function onMouseMove(e) {\n if (!this.shouldUpdate(e, this)) {\n this.hideTooltip();\n return;\n }\n if (!this.currentTarget || e.item !== this.currentTarget) {\n return;\n }\n this.updatePosition(e);\n },\n onMouseLeave: function onMouseLeave(e) {\n if (!this.shouldEnd(e, this)) {\n return;\n }\n this.hideTooltip();\n this.graph.emit('tooltipchange', {\n item: this.currentTarget,\n action: 'hide'\n });\n this.currentTarget = null;\n },\n showTooltip: function showTooltip(e) {\n var container = this.container;\n if (!e.item || e.item.destroyed) {\n return;\n }\n if (!container) {\n container = this.createTooltip(this.graph.get('canvas'));\n this.container = container;\n }\n var text = this.formatText(e.item.get('model'), e);\n container.innerHTML = text;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.container, {\n visibility: 'visible'\n });\n this.updatePosition(e);\n },\n hideTooltip: function hideTooltip() {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.container, {\n visibility: 'hidden'\n });\n },\n updatePosition: function updatePosition(e) {\n var shouldBegin = this.get('shouldBegin');\n var _a = this,\n width = _a.width,\n height = _a.height,\n container = _a.container,\n graph = _a.graph;\n if (!shouldBegin(e, this)) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(container, {\n visibility: 'hidden'\n });\n return;\n }\n var point = graph.getPointByClient(e.clientX, e.clientY);\n var _b = graph.getCanvasByPoint(point.x, point.y),\n x = _b.x,\n y = _b.y;\n var bbox = container.getBoundingClientRect();\n if (x > width / 2) {\n x -= bbox.width;\n } else {\n x += this.offset;\n }\n if (y > height / 2) {\n y -= bbox.height;\n } else {\n y += this.offset;\n }\n var left = \"\".concat(x, \"px\");\n var top = \"\".concat(y, \"px\");\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.container, {\n left: left,\n top: top,\n visibility: 'visible'\n });\n },\n createTooltip: function createTooltip(canvas) {\n var el = canvas.get('el');\n el.style.position = 'relative';\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n el.parentNode.appendChild(container);\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(container, {\n position: 'absolute',\n visibility: 'visible'\n });\n this.width = canvas.get('width');\n this.height = canvas.get('height');\n this.container = container;\n this.graph.get('tooltips').push(container);\n return container;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/is-type.js": +/***/ "./node_modules/@antv/g6-pc/es/behavior/tooltip.js": /*!*********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/is-type.js ***! + !*** ./node_modules/@antv/g6-pc/es/behavior/tooltip.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar toString = {}.toString;\n\nvar isType = function isType(value, type) {\n return toString.call(value) === '[object ' + type + ']';\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (isType);\n//# sourceMappingURL=is-type.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/is-type.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _tooltip_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tooltip-base */ \"./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n getDefaultCfg: function getDefaultCfg() {\n return {\n item: 'node',\n offset: 12,\n formatText: function formatText(model) {\n return model.label;\n }\n };\n },\n getEvents: function getEvents() {\n return {\n 'node:mouseenter': 'onMouseEnter',\n 'node:mouseleave': 'onMouseLeave',\n 'node:mousemove': 'onMouseMove',\n afterremoveitem: 'onMouseLeave'\n };\n }\n}, _tooltip_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/tooltip.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/is-typedarray.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/is-typedarray.js ***! - \***************************************************************/ -/*! exports provided: isTypedArray */ +/***/ "./node_modules/@antv/g6-pc/es/behavior/zoom-canvas.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/behavior/zoom-canvas.js ***! + \*************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isTypedArray\", function() { return isTypedArray; });\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @babel/runtime/helpers/typeof */ \"./node_modules/@babel/runtime/helpers/typeof.js\");\n/* harmony import */ var _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0__);\n\n\n/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n/** `Object#toString` result references. */\n\nvar argsTag = '[object Arguments]';\nvar arrayTag = '[object Array]';\nvar boolTag = '[object Boolean]';\nvar dateTag = '[object Date]';\nvar errorTag = '[object Error]';\nvar funcTag = '[object Function]';\nvar mapTag = '[object Map]';\nvar numberTag = '[object Number]';\nvar objectTag = '[object Object]';\nvar regexpTag = '[object RegExp]';\nvar setTag = '[object Set]';\nvar stringTag = '[object String]';\nvar weakMapTag = '[object WeakMap]';\nvar arrayBufferTag = '[object ArrayBuffer]';\nvar dataViewTag = '[object DataView]';\nvar float32Tag = '[object Float32Array]';\nvar float64Tag = '[object Float64Array]';\nvar int8Tag = '[object Int8Array]';\nvar int16Tag = '[object Int16Array]';\nvar int32Tag = '[object Int32Array]';\nvar uint8Tag = '[object Uint8Array]';\nvar uint8ClampedTag = '[object Uint8ClampedArray]';\nvar uint16Tag = '[object Uint16Array]';\nvar uint32Tag = '[object Uint32Array]';\n/** Used to identify `toStringTag` values of typed arrays. */\n\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] = typedArrayTags[int8Tag] = typedArrayTags[int16Tag] = typedArrayTags[int32Tag] = typedArrayTags[uint8Tag] = typedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] = typedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] = typedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] = typedArrayTags[dataViewTag] = typedArrayTags[dateTag] = typedArrayTags[errorTag] = typedArrayTags[funcTag] = typedArrayTags[mapTag] = typedArrayTags[numberTag] = typedArrayTags[objectTag] = typedArrayTags[regexpTag] = typedArrayTags[setTag] = typedArrayTags[stringTag] = typedArrayTags[weakMapTag] = false;\n/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\n\nfunction baseUnary(func) {\n return function (value) {\n return func(value);\n };\n}\n/** Used for built-in method references. */\n\n\nvar objectProto = Object.prototype;\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\n\nvar objectToString = objectProto.toString;\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\n\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) && isLength(value.length) && !!typedArrayTags[objectToString.call(value)];\n}\n\nfunction isLength(value) {\n return typeof value === 'number' && value > -1 && value % 1 === 0 && value <= MAX_SAFE_INTEGER;\n}\n\nfunction isObjectLike(value) {\n return !!value && _babel_runtime_helpers_typeof__WEBPACK_IMPORTED_MODULE_0___default()(value) === 'object';\n}\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\n\n\nvar isTypedArray = baseIsTypedArray;\n//# sourceMappingURL=is-typedarray.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/is-typedarray.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_browser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/browser */ \"./node_modules/@antv/g6-pc/es/util/browser.js\");\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"ext\"].transform;\nvar DELTA = 0.05;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n this.isFireFox = Object(_util_browser__WEBPACK_IMPORTED_MODULE_2__[\"getBrowserName\"])() === 'firefox';\n return {\n sensitivity: 2,\n minZoom: undefined,\n maxZoom: undefined,\n enableOptimize: false,\n optimizeZoom: 0.1,\n fixSelectedItems: {\n fixAll: false,\n fixLineWidth: false,\n fixLabel: false,\n fixState: 'selected'\n },\n animate: false,\n animateCfg: {\n duration: 500\n }\n };\n },\n getEvents: function getEvents() {\n var fixSelectedItems = this.fixSelectedItems;\n if (!fixSelectedItems.fixState) fixSelectedItems.fixState = 'selected';\n if (fixSelectedItems.fixAll) {\n fixSelectedItems.fixLineWidth = true;\n fixSelectedItems.fixLabel = true;\n }\n return {\n wheel: 'onWheel',\n touchstart: 'onTouchStart',\n touchmove: 'onTouchMove',\n touchend: 'onTouchEnd'\n };\n },\n onTouchStart: function onTouchStart(evt) {\n var touches = evt.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n evt.preventDefault();\n // 如果不是缩放事件则禁止继续执行\n if (!event2) {\n return;\n }\n if (this.shouldBegin && !this.shouldBegin(evt, this)) {\n return;\n }\n // 第一个触摸点位置\n this.startPoint = {\n pageX: event1.pageX,\n pageY: event1.pageY\n };\n this.moveable = true;\n if (event2) {\n this.endPoint = {\n pageX: event2.pageX,\n pageY: event2.pageY\n };\n }\n this.originScale = this.graph.getZoom() || this.currentScale || 1;\n },\n onTouchMove: function onTouchMove(evt) {\n if (!this.moveable) {\n return;\n }\n evt.preventDefault();\n var touches = evt.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n if (!event2) {\n return;\n }\n if (!this.endPoint) {\n this.endPoint = {\n pageX: event2.pageX,\n pageY: event2.pageY\n };\n }\n // 获取坐标之间的距离\n var getDistance = function getDistance(start, end) {\n return Math.hypot(end.x - start.x, end.y - start.y);\n };\n // 双指缩放比例\n var scale = getDistance({\n x: event1.pageX,\n y: event1.pageY\n }, {\n x: event2.pageX,\n y: event2.pageY\n }) / getDistance({\n x: this.startPoint.pageX,\n y: this.startPoint.pageY\n }, {\n x: this.endPoint.pageX,\n y: this.endPoint.pageY\n });\n // 应用到画布上的缩放比例\n var zoom = this.originScale * scale;\n // 缓存当前的缩放比例\n this.currentScale = zoom;\n var minZoom = this.get('minZoom') || this.graph.get('minZoom');\n var maxZoom = this.get('maxZoom') || this.graph.get('maxZoom');\n if (zoom > maxZoom || zoom < minZoom) {\n return;\n }\n var animate = this.get('animate');\n var animateCfg = this.get('animateCfg');\n var canvas = this.graph.get('canvas');\n var point = canvas.getPointByClient(evt.clientX, evt.clientY);\n this.graph.zoomTo(zoom, {\n x: point.x,\n y: point.y\n }, animate, animateCfg);\n this.graph.emit('wheelzoom', evt);\n },\n onTouchEnd: function onTouchEnd() {\n this.moveable = false;\n this.endPoint = null;\n },\n onWheel: function onWheel(e) {\n var _this = this;\n var _a = this,\n graph = _a.graph,\n fixSelectedItems = _a.fixSelectedItems;\n if (this.shouldBegin && !this.shouldBegin(e, this)) {\n return;\n }\n if (!this.shouldUpdate(e, this)) {\n return;\n }\n e.preventDefault();\n var canvas = graph.get('canvas');\n var point = canvas.getPointByClient(e.clientX, e.clientY);\n var sensitivity = this.get('sensitivity');\n var graphZoom = graph.getZoom();\n var ratio = graphZoom;\n var zoom = graphZoom;\n // 兼容IE、Firefox及Chrome\n if (this.isFireFox) {\n if (e.deltaY > 0 || e.wheelDelta < 0) {\n ratio = 1 - DELTA * sensitivity;\n } else {\n ratio = 1 / (1 - DELTA * sensitivity);\n }\n } else {\n if (e.wheelDelta < 0) {\n ratio = 1 - DELTA * sensitivity;\n } else {\n ratio = 1 / (1 - DELTA * sensitivity);\n }\n }\n zoom = graphZoom * ratio;\n var minZoom = this.get('minZoom') || graph.get('minZoom');\n var maxZoom = this.get('maxZoom') || graph.get('maxZoom');\n if (zoom > maxZoom) {\n zoom = maxZoom;\n } else if (zoom < minZoom) {\n zoom = minZoom;\n }\n // hide the shapes when the zoom ratio is smaller than optimizeZoom\n // hide the shapes when zoomming\n var enableOptimize = this.get('enableOptimize');\n if (enableOptimize) {\n var optimizeZoom_1 = this.get('optimizeZoom');\n var optimized = this.get('optimized');\n var nodes_1 = graph.getNodes();\n var edges_1 = graph.getEdges();\n var nodesLength_1 = nodes_1.length;\n var edgesLength_1 = edges_1.length;\n // hiding\n if (!optimized) {\n for (var n = 0; n < nodesLength_1; n++) {\n var node = nodes_1[n];\n if (!node.destroyed) {\n var children = node.get('group').get('children');\n var childrenLength = children.length;\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n if (!shape.destoryed && !shape.get('isKeyShape')) {\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n }\n }\n }\n }\n for (var edgeIndex = 0; edgeIndex < edgesLength_1; edgeIndex++) {\n var edge = edges_1[edgeIndex];\n var children = edge.get('group').get('children');\n var childrenLength = children.length;\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n }\n }\n this.set('optimized', true);\n }\n // showing after 100ms\n clearTimeout(this.get('timeout'));\n var timeout = setTimeout(function () {\n var currentZoom = graph.getZoom();\n var curOptimized = _this.get('optimized');\n if (curOptimized) {\n _this.set('optimized', false);\n for (var n = 0; n < nodesLength_1; n++) {\n var node = nodes_1[n];\n var children = node.get('group').get('children');\n var childrenLength = children.length;\n if (currentZoom < optimizeZoom_1) {\n var keyShape = node.getKeyShape();\n var oriVis = keyShape.get('ori-visibility');\n keyShape.set('ori-visibility', undefined);\n if (oriVis) keyShape.show();\n } else {\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n var oriVis = shape.get('ori-visibility');\n shape.set('ori-visibility', undefined);\n if (!shape.get('visible') && oriVis) {\n if (oriVis) shape.show();\n }\n }\n }\n }\n for (var edgeIndex = 0; edgeIndex < edgesLength_1; edgeIndex++) {\n var edge = edges_1[edgeIndex];\n var children = edge.get('group').get('children');\n var childrenLength = children.length;\n if (currentZoom < optimizeZoom_1) {\n var keyShape = edge.getKeyShape();\n var oriVis = keyShape.get('ori-visibility');\n keyShape.set('ori-visibility', undefined);\n if (oriVis) keyShape.show();\n } else {\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n if (!shape.get('visible')) {\n var oriVis = shape.get('ori-visibility');\n shape.set('ori-visibility', undefined);\n if (oriVis) shape.show();\n }\n }\n }\n }\n }\n }, 100);\n this.set('timeout', timeout);\n }\n // fix the items when zooming\n if (graphZoom <= 1) {\n var fixNodes = void 0,\n fixEdges = void 0;\n if (fixSelectedItems.fixAll || fixSelectedItems.fixLineWidth || fixSelectedItems.fixLabel) {\n fixNodes = graph.findAllByState('node', fixSelectedItems.fixState);\n fixEdges = graph.findAllByState('edge', fixSelectedItems.fixState);\n var scale = graphZoom / zoom;\n var fixNodesLength = fixNodes.length;\n for (var fn = 0; fn < fixNodesLength; fn++) {\n var node = fixNodes[fn];\n var group = node.getContainer();\n var nodeModel = node.getModel();\n var originStyle = node.getOriginStyle();\n var itemStateStyle = node.getStateStyle(fixSelectedItems.fixState);\n var shapeStateStyle = node.get('shapeFactory').getShape(nodeModel.type).getStateStyle(fixSelectedItems.fixState, node)[fixSelectedItems.fixState];\n if (fixSelectedItems.fixAll) {\n if (zoom <= 1) {\n var groupMatrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(group.getMatrix());\n if (!groupMatrix) groupMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var _b = node.getModel(),\n x = _b.x,\n y = _b.y;\n groupMatrix = transform(groupMatrix, [['t', -x, -y], ['s', scale, scale], ['t', x, y]]);\n group.setMatrix(groupMatrix);\n }\n } else {\n var children = group.get('children');\n var childrenLength = children.length;\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n var fontSize = void 0,\n lineWidth = void 0;\n if (fixSelectedItems.fixLabel) {\n var shapeType = shape.get('type');\n if (shapeType === 'text') {\n fontSize = shape.attr('fontSize') || 12;\n var itemStyle = itemStateStyle[shape.get('name')];\n var shapeStyle = shapeStateStyle[shape.get('name')];\n var itemFontSize = itemStyle ? itemStyle.fontSize : 12;\n var shapeFontSize = shapeStyle ? shapeStyle.fontSize : 12;\n var oriFontSize = itemFontSize || shapeFontSize || 12;\n if (zoom <= 1) shape.attr('fontSize', oriFontSize / zoom); // * graphZoom / zoom\n if (lineWidth) break;\n }\n }\n if (fixSelectedItems.fixLineWidth) {\n if (shape.get('isKeyShape')) {\n lineWidth = shape.attr('lineWidth') || 0;\n var oriLineWidth = itemStateStyle.lineWidth || shapeStateStyle.lineWidth || originStyle.lineWidth || 0;\n if (zoom <= 1) shape.attr('lineWidth', oriLineWidth / zoom); // * graphZoom / zoom\n if (fontSize) break;\n }\n }\n }\n }\n }\n var fixEdgesLength = fixEdges.length;\n for (var fe = 0; fe < fixEdgesLength; fe++) {\n var edge = fixEdges[fe];\n var group = edge.getContainer();\n var children = group.get('children');\n var nodeModel = edge.getModel();\n var itemStateStyle = edge.getStateStyle(fixSelectedItems.fixState);\n var shapeStateStyle = edge.get('shapeFactory').getShape(nodeModel.type).getStateStyle(fixSelectedItems.fixState, edge)[fixSelectedItems.fixState];\n var childrenLength = children.length;\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n var fontSize = void 0,\n lineWidth = void 0;\n if (fixSelectedItems.fixLabel || fixSelectedItems.fixAll) {\n var shapeType = shape.get('type');\n if (shapeType === 'text') {\n fontSize = shape.attr('fontSize') || 12;\n var itemStyle = itemStateStyle[shape.get('name')];\n var shapeStyle = shapeStateStyle[shape.get('name')];\n var itemFontSize = itemStyle ? itemStyle.fontSize : 12;\n var shapeFontSize = shapeStyle ? shapeStyle.fontSize : 12;\n var oriFontSize = itemFontSize || shapeFontSize || 12;\n if (zoom <= 1) shape.attr('fontSize', oriFontSize / zoom);\n if (lineWidth) break;\n }\n }\n if (fixSelectedItems.fixLineWidth || fixSelectedItems.fixAll) {\n if (shape.get('isKeyShape')) {\n lineWidth = shape.attr('lineWidth') || 0;\n var oriLineWidth = itemStateStyle.lineWidth || shapeStateStyle.lineWidth || 1;\n if (zoom <= 1) shape.attr('lineWidth', oriLineWidth / zoom);\n if (fontSize) break;\n }\n }\n }\n }\n }\n }\n var animate = this.get('animate');\n var animateCfg = this.get('animateCfg');\n graph.zoomTo(zoom, {\n x: point.x,\n y: point.y\n }, animate, animateCfg);\n graph.emit('wheelzoom', e);\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/zoom-canvas.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/math.js": +/***/ "./node_modules/@antv/g6-pc/es/element/index.js": /*!******************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/math.js ***! + !*** ./node_modules/@antv/g6-pc/es/element/index.js ***! \******************************************************/ -/*! exports provided: getAngle, createVec3 */ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAngle\", function() { return getAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createVec3\", function() { return createVec3; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/g-webgpu/es/utils/is-number.js\");\n\n\nfunction getAngle(angle) {\n if (angle === undefined) {\n return 0;\n } else if (angle > 360 || angle < -360) {\n return angle % 360;\n }\n\n return angle;\n}\nfunction createVec3(x, y, z) {\n if (Object(_is_number__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(x)) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].fromValues(x, y, z);\n }\n\n if (x.length === 3) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].clone(x);\n } // @ts-ignore\n\n\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].fromValues(x[0], x[1], x[2]);\n}\n//# sourceMappingURL=math.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/math.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_g6_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-element */ \"./node_modules/@antv/g6-element/es/index.js\");\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/element/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/picking.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/picking.js ***! - \*********************************************************/ -/*! exports provided: encodePickingColor */ +/***/ "./node_modules/@antv/g6-pc/es/global.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/global.js ***! + \***********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"encodePickingColor\", function() { return encodePickingColor; });\nfunction encodePickingColor(featureIdx) {\n return [featureIdx + 1 & 255, featureIdx + 1 >> 8 & 255, featureIdx + 1 >> 8 >> 8 & 255];\n}\n//# sourceMappingURL=picking.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/picking.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/color */ \"./node_modules/@antv/g6-pc/es/util/color.js\");\n\nvar subjectColor = 'rgb(95, 149, 255)';\nvar backColor = 'rgb(255, 255, 255)';\nvar textColor = 'rgb(0, 0, 0)';\nvar colorSet = Object(_util_color__WEBPACK_IMPORTED_MODULE_0__[\"getColorsWithSubjectColor\"])(subjectColor, backColor);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: '0.8.23',\n rootContainerClassName: 'root-container',\n nodeContainerClassName: 'node-container',\n edgeContainerClassName: 'edge-container',\n comboContainerClassName: 'combo-container',\n delegateContainerClassName: 'delegate-container',\n defaultLoopPosition: 'top',\n nodeLabel: {\n style: {\n fill: '#000',\n fontSize: 12,\n textAlign: 'center',\n textBaseline: 'middle'\n },\n offset: 4 // 节点的默认文本不居中时的偏移量\n },\n\n defaultNode: {\n type: 'circle',\n style: {\n lineWidth: 1,\n stroke: colorSet.mainStroke,\n fill: colorSet.mainFill\n },\n size: 20,\n color: colorSet.mainStroke,\n linkPoints: {\n size: 8,\n lineWidth: 1,\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke\n }\n },\n // 节点应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n nodeStateStyles: {\n active: {\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke,\n lineWidth: 2,\n shadowColor: colorSet.mainStroke,\n shadowBlur: 10\n },\n selected: {\n fill: colorSet.selectedFill,\n stroke: colorSet.selectedStroke,\n lineWidth: 4,\n shadowColor: colorSet.selectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n fill: colorSet.highlightFill,\n stroke: colorSet.highlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n fill: colorSet.inactiveFill,\n stroke: colorSet.inactiveStroke,\n lineWidth: 1\n },\n disable: {\n fill: colorSet.disableFill,\n stroke: colorSet.disableStroke,\n lineWidth: 1\n }\n },\n edgeLabel: {\n style: {\n fill: textColor,\n textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n }\n },\n defaultEdge: {\n type: 'line',\n size: 1,\n style: {\n stroke: colorSet.edgeMainStroke,\n lineAppendWidth: 2\n },\n color: colorSet.edgeMainStroke\n },\n // 边应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n edgeStateStyles: {\n active: {\n stroke: colorSet.edgeActiveStroke,\n lineWidth: 1\n },\n selected: {\n stroke: colorSet.edgeSelectedStroke,\n lineWidth: 2,\n shadowColor: colorSet.edgeSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.edgeHighlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.edgeInactiveStroke,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.edgeDisableStroke,\n lineWidth: 1\n }\n },\n comboLabel: {\n style: {\n fill: textColor,\n // textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n },\n refY: 10,\n refX: 10 // Combo 的默认文本不居中时的偏移量\n },\n\n defaultCombo: {\n type: 'circle',\n style: {\n fill: colorSet.comboMainFill,\n lineWidth: 1,\n stroke: colorSet.comboMainStroke,\n r: 5,\n width: 20,\n height: 10\n },\n size: [20, 5],\n color: colorSet.comboMainStroke,\n padding: [25, 20, 15, 20]\n },\n // combo 应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n comboStateStyles: {\n active: {\n stroke: colorSet.comboActiveStroke,\n lineWidth: 1,\n fill: colorSet.comboActiveFill\n },\n selected: {\n stroke: colorSet.comboSelectedStroke,\n lineWidth: 2,\n fill: colorSet.comboSelectedFill,\n shadowColor: colorSet.comboSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.comboHighlightStroke,\n lineWidth: 2,\n fill: colorSet.comboHighlightFill,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.comboInactiveStroke,\n fill: colorSet.comboInactiveFill,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.comboDisableStroke,\n fill: colorSet.comboDisableFill,\n lineWidth: 1\n }\n },\n delegateStyle: {\n fill: '#F3F9FF',\n fillOpacity: 0.5,\n stroke: '#1890FF',\n strokeOpacity: 0.9,\n lineDash: [5, 5]\n },\n // 文本水印默认配置\n textWaterMarkerConfig: {\n width: 150,\n height: 100,\n compatible: false,\n text: {\n x: 0,\n y: 60,\n lineHeight: 20,\n rotate: 20,\n fontSize: 14,\n fontFamily: 'Microsoft YaHei',\n fill: 'rgba(0, 0, 0, 0.1)',\n baseline: 'Middle'\n }\n },\n imageWaterMarkerConfig: {\n width: 150,\n height: 130,\n compatible: false,\n image: {\n x: 0,\n y: 0,\n width: 30,\n height: 20,\n rotate: 0\n }\n },\n waterMarkerImage: 'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg'\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/global.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/polyline-normals.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/polyline-normals.js ***! - \******************************************************************/ +/***/ "./node_modules/@antv/g6-pc/es/graph/controller/event.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/graph/controller/event.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gl_vec2__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-vec2 */ \"./node_modules/gl-vec2/index.js\");\n/* harmony import */ var gl_vec2__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(gl_vec2__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! polyline-miter-util */ \"./node_modules/polyline-miter-util/index.js\");\n/* harmony import */ var polyline_miter_util__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__);\n// @ts-ignore\n // @ts-ignore\n\n\n\nfunction extrusions(positions, out, point, normal, scale) {\n addNext(out, normal, -scale);\n addNext(out, normal, scale);\n positions.push(point);\n positions.push(point);\n}\n\nfunction addNext(out, normal, length) {\n out.push([[normal[0], normal[1]], length]);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (points, closed, indexOffset) {\n var lineA = [0, 0];\n var lineB = [0, 0];\n var tangent = [0, 0];\n var miter = [0, 0];\n\n var _lastFlip = -1;\n\n var _started = false;\n var _normal = null;\n var tmp = Object(gl_vec2__WEBPACK_IMPORTED_MODULE_0__[\"create\"])();\n var count = indexOffset || 0;\n var miterLimit = 3;\n var out = [];\n var attrPos = [];\n var attrIndex = [];\n var attrCounters = [0, 0];\n\n if (closed) {\n points = points.slice();\n points.push(points[0]);\n }\n\n var total = points.length;\n\n for (var i = 1; i < total; i++) {\n var index = count;\n var last = points[i - 1];\n var cur = points[i];\n var next = i < points.length - 1 ? points[i + 1] : null;\n attrCounters.push(i / total, i / total);\n Object(polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__[\"direction\"])(lineA, cur, last);\n\n if (!_normal) {\n _normal = [0, 0];\n Object(polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__[\"normal\"])(_normal, lineA);\n }\n\n if (!_started) {\n _started = true;\n extrusions(attrPos, out, last, _normal, 1);\n }\n\n attrIndex.push([index + 0, index + 1, index + 2]);\n\n if (!next) {\n // no miter, simple segment\n Object(polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__[\"normal\"])(_normal, lineA); // reset normal\n\n extrusions(attrPos, out, cur, _normal, 1);\n attrIndex.push(_lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]);\n count += 2;\n } else {\n // miter with last\n // get unit dir of next line\n Object(polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__[\"direction\"])(lineB, next, cur); // stores tangent & miter\n\n var miterLen = Object(polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__[\"computeMiter\"])(tangent, miter, lineA, lineB, 1); // get orientation\n\n var flip = Object(gl_vec2__WEBPACK_IMPORTED_MODULE_0__[\"dot\"])(tangent, _normal) < 0 ? -1 : 1;\n var bevel = miterLen > miterLimit; // 处理相邻线段重叠的情况\n\n if (!isFinite(miterLen)) {\n Object(polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__[\"normal\"])(_normal, lineA); // reset normal\n\n extrusions(attrPos, out, cur, _normal, 1);\n attrIndex.push(_lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]);\n count += 2;\n _lastFlip = flip;\n continue;\n }\n\n if (bevel) {\n miterLen = miterLimit;\n attrCounters.push(i / total); // next two points in our first segment\n\n addNext(out, _normal, -flip);\n attrPos.push(cur);\n addNext(out, miter, miterLen * flip);\n attrPos.push(cur);\n attrIndex.push(_lastFlip !== -flip ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]); // now add the bevel triangle\n\n attrIndex.push([index + 2, index + 3, index + 4]);\n Object(polyline_miter_util__WEBPACK_IMPORTED_MODULE_1__[\"normal\"])(tmp, lineB);\n Object(gl_vec2__WEBPACK_IMPORTED_MODULE_0__[\"copy\"])(_normal, tmp); // store normal for next round\n\n addNext(out, _normal, -flip);\n attrPos.push(cur); // the miter is now the normal for our next join\n\n count += 3;\n } else {\n // miter\n // next two points for our miter join\n extrusions(attrPos, out, cur, miter, miterLen);\n attrIndex.push(_lastFlip === 1 ? [index, index + 2, index + 3] : [index + 2, index + 1, index + 3]);\n flip = -1; // the miter is now the normal for our next join\n\n Object(gl_vec2__WEBPACK_IMPORTED_MODULE_0__[\"copy\"])(_normal, miter);\n count += 2;\n }\n\n _lastFlip = flip;\n }\n }\n\n return {\n normals: out,\n attrIndex: attrIndex,\n attrPos: attrPos,\n attrCounters: attrCounters\n };\n});\n//# sourceMappingURL=polyline-normals.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/polyline-normals.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n\n\n\n\nvar cloneEvent = _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].cloneEvent,\n isViewportChanged = _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].isViewportChanged;\nvar EventController = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(EventController, _super);\n function EventController(graph) {\n var _this = _super.call(this, graph) || this;\n _this.extendEvents = [];\n _this.dragging = false;\n _this.mousedown = false;\n _this.preItem = null;\n _this.destroy();\n _this.graph = graph;\n _this.destroyed = false;\n _this.initEvents();\n return _this;\n }\n // 初始化 G6 中的事件\n EventController.prototype.initEvents = function () {\n var _a = this,\n graph = _a.graph,\n _b = _a.extendEvents,\n extendEvents = _b === void 0 ? [] : _b;\n var canvas = graph.get('canvas');\n // canvas.set('draggable', true);\n var el = canvas.get('el');\n var canvasHandler = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"wrapBehavior\"])(this, 'onCanvasEvents');\n var originHandler = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"wrapBehavior\"])(this, 'onExtendEvents');\n var wheelHandler = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"wrapBehavior\"])(this, 'onWheelEvent');\n // each(EVENTS, event => {\n // canvas.off(event).on(event, canvasHandler);\n // });\n canvas.off('*').on('*', canvasHandler);\n this.canvasHandler = canvasHandler;\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(el, 'wheel', wheelHandler));\n if (typeof window !== 'undefined') {\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(window, 'keydown', originHandler));\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(window, 'keyup', originHandler));\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(window, 'focus', originHandler));\n }\n // 数据变更,重置一些状态\n if (this.resetHandler) graph.off('afterchangedata', this.resetHandler);\n this.resetHandler = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"wrapBehavior\"])(this, 'resetStatus');\n graph.on('afterchangedata', this.resetHandler);\n };\n // 获取 shape 的 item 对象\n EventController.getItemRoot = function (shape) {\n while (shape && !shape.get('item')) {\n shape = shape.get('parent');\n }\n return shape;\n };\n /**\n * 处理 canvas 事件\n * @param evt 事件句柄\n */\n EventController.prototype.onCanvasEvents = function (evt) {\n var _this = this;\n var graph = this.graph;\n var canvas = graph.get('canvas');\n var target = evt.target;\n var eventType = evt.type;\n switch (eventType) {\n // solve G's problem: mousemove and mouseup are not triggered with drag and dragend\n case 'drag':\n this.onCanvasEvents(Object.assign({}, evt, {\n type: 'mousemove'\n }));\n break;\n case 'dragend':\n this.onCanvasEvents(Object.assign({}, evt, {\n type: 'mouseup'\n }));\n break;\n // solve G's problem: mousedown on other DOMs, mouseup on canvas, click event is triggered unexpectedly\n case 'mousedown':\n this.mousedown = true;\n break;\n case 'mouseup':\n // mouseup happend before click, so setTimeout to reset the tag for reference in click event\n setTimeout(function () {\n return _this.mousedown = false;\n });\n break;\n case 'click':\n // the mousedown is not happend, the click is invalid\n if (!this.mousedown) return;\n break;\n default:\n break;\n }\n /**\n * (clientX, clientY): 相对于页面的坐标;\n * (canvasX, canvasY): 相对于 左上角的坐标;\n * (x, y): 相对于整个画布的坐标, 与 model 的 x, y 是同一维度的。\n */\n evt.canvasX = evt.x;\n evt.canvasY = evt.y;\n var point = {\n x: evt.canvasX,\n y: evt.canvasY\n };\n var group = graph.get('group');\n var matrix = group.getMatrix();\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n if (isViewportChanged(matrix)) {\n point = graph.getPointByClient(evt.clientX, evt.clientY);\n }\n evt.x = point.x;\n evt.y = point.y;\n evt.currentTarget = graph;\n if (target === canvas) {\n if (eventType === 'mousemove' || eventType === 'mouseleave') {\n this.handleMouseMove(evt, 'canvas');\n }\n evt.target = canvas;\n evt.item = null;\n graph.emit(eventType, evt);\n graph.emit(\"canvas:\".concat(eventType), evt);\n return;\n }\n var itemShape = EventController.getItemRoot(target);\n if (!itemShape) {\n graph.emit(eventType, evt);\n return;\n }\n var item = itemShape.get('item');\n if (item.destroyed) {\n return;\n }\n var type = item.getType();\n // 事件target是触发事件的Shape实例,item是触发事件的item实例\n evt.target = target;\n evt.item = item;\n if (evt.canvasX === evt.x && evt.canvasY === evt.y) {\n var canvasPoint = graph.getCanvasByPoint(evt.x, evt.y);\n evt.canvasX = canvasPoint.x;\n evt.canvasY = canvasPoint.y;\n }\n if (evt.name && !evt.name.includes(':')) {\n graph.emit(\"\".concat(type, \":\").concat(eventType), evt); // emit('node:click', evt)\n graph.emit(eventType, evt); // emit('click', evt);\n } else if (evt.name) {\n graph.emit(evt.name, evt); // emit('text-shape:click', evt)\n }\n\n if (eventType === 'dragstart') {\n this.dragging = true;\n }\n if (eventType === 'dragend') {\n this.dragging = false;\n }\n if (eventType === 'mousemove') {\n this.handleMouseMove(evt, type);\n }\n };\n /**\n * 处理扩展事件\n * @param evt 事件句柄\n */\n EventController.prototype.onExtendEvents = function (evt) {\n this.graph.emit(evt.type, evt);\n };\n /**\n * 处理滚轮事件\n * @param evt 事件句柄\n */\n EventController.prototype.onWheelEvent = function (evt) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNil\"])(evt.wheelDelta)) {\n evt.wheelDelta = -evt.detail;\n }\n this.graph.emit('wheel', evt);\n };\n /**\n * 处理鼠标移动的事件\n * @param evt 事件句柄\n * @param type item 类型\n */\n EventController.prototype.handleMouseMove = function (evt, type) {\n var _a = this,\n graph = _a.graph,\n preItem = _a.preItem;\n var canvas = graph.get('canvas');\n var item = evt.target === canvas ? null : evt.item;\n evt = cloneEvent(evt);\n // 从前一个item直接移动到当前item,触发前一个item的leave事件\n if (preItem && preItem !== item && !preItem.destroyed) {\n evt.item = preItem;\n this.emitCustomEvent(preItem.getType(), 'mouseleave', evt);\n if (this.dragging) {\n this.emitCustomEvent(preItem.getType(), 'dragleave', evt);\n }\n }\n // 从一个item或canvas移动到当前item,触发当前item的enter事件\n if (item && preItem !== item) {\n evt.item = item;\n this.emitCustomEvent(type, 'mouseenter', evt);\n if (this.dragging) {\n this.emitCustomEvent(type, 'dragenter', evt);\n }\n }\n this.preItem = item;\n };\n /**\n * 在 graph 上面 emit 事件\n * @param itemType item 类型\n * @param eventType 事件类型\n * @param evt 事件句柄\n */\n EventController.prototype.emitCustomEvent = function (itemType, eventType, evt) {\n evt.type = eventType;\n this.graph.emit(\"\".concat(itemType, \":\").concat(eventType), evt);\n };\n EventController.prototype.resetStatus = function () {\n this.mousedown = false;\n this.dragging = false;\n this.preItem = null;\n };\n EventController.prototype.destroy = function () {\n var _a = this,\n graph = _a.graph,\n canvasHandler = _a.canvasHandler,\n extendEvents = _a.extendEvents;\n var canvas = graph.get('canvas');\n // each(EVENTS, event => {\n // canvas.off(event, canvasHandler);\n // });\n canvas.off('*', canvasHandler);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(extendEvents, function (event) {\n event.remove();\n });\n this.resetStatus();\n this.extendEvents.length = 0;\n this.canvasHandler = null;\n this.resetHandler = null;\n this.destroyed = true;\n };\n return EventController;\n}(_antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"AbstractEvent\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (EventController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/controller/event.js?"); /***/ }), -/***/ "./node_modules/@antv/g-webgpu/es/utils/typedarray.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g-webgpu/es/utils/typedarray.js ***! - \************************************************************/ -/*! exports provided: merge */ +/***/ "./node_modules/@antv/g6-pc/es/graph/controller/index.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/graph/controller/index.js ***! + \***************************************************************/ +/*! exports provided: EventController, LayoutController */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"merge\", function() { return merge; });\nfunction merge(a, b) {\n // Checks for truthy values on both arrays\n if (!a && !b) {\n throw new Error('Please specify valid arguments for parameters a and b.');\n } // Checks for truthy values or empty arrays on each argument\n // to avoid the unnecessary construction of a new array and\n // the type comparison\n\n\n if (!b || b.length === 0) {\n return a;\n }\n\n if (!a || a.length === 0) {\n return b;\n } // Make sure that both typed arrays are of the same type\n\n\n if (Object.prototype.toString.call(a) !== Object.prototype.toString.call(b)) {\n throw new Error('The types of the two arguments passed for parameters a and b do not match.');\n } // @ts-ignore\n\n\n var c = new a.constructor(a.length + b.length);\n c.set(a);\n c.set(b, a.length);\n return c;\n}\n//# sourceMappingURL=typedarray.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/g-webgpu/es/utils/typedarray.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event */ \"./node_modules/@antv/g6-pc/es/graph/controller/event.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EventController\", function() { return _event__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/g6-pc/es/graph/controller/layout.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LayoutController\", function() { return _layout__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/controller/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/behavior/behavior.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/behavior/behavior.js ***! - \************************************************************/ +/***/ "./node_modules/@antv/g6-pc/es/graph/controller/layout.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/graph/controller/layout.js ***! + \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _behaviorOption__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./behaviorOption */ \"./node_modules/@antv/g6-core/es/behavior/behaviorOption.js\");\n\n\n\nvar Behavior =\n/** @class */\nfunction () {\n function Behavior() {}\n /**\n * 自定义 Behavior\n * @param type Behavior 名称\n * @param behavior Behavior 定义的方法集合\n */\n\n\n Behavior.registerBehavior = function (type, behavior) {\n if (!behavior) {\n throw new Error(\"please specify handler for this behavior: \".concat(type));\n }\n\n var prototype = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(_behaviorOption__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n Object.assign(prototype, behavior); // eslint-disable-next-line func-names\n\n var base = function base(cfg) {\n var _this = this;\n\n Object.assign(this, this.getDefaultCfg(), cfg);\n var events = this.getEvents();\n this.events = null;\n var eventsToBind = {};\n\n if (events) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (handle, event) {\n eventsToBind[event] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"wrapBehavior\"])(_this, handle);\n });\n this.events = eventsToBind;\n }\n };\n\n base.prototype = prototype;\n Behavior.types[type] = base;\n };\n\n Behavior.hasBehavior = function (type) {\n return !!Behavior.types[type];\n };\n\n Behavior.getBehavior = function (type) {\n return Behavior.types[type];\n }; // 所有自定义的 Behavior 的实例\n\n\n Behavior.types = {};\n return Behavior;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Behavior);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/behavior/behavior.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../layout */ \"./node_modules/@antv/g6-pc/es/layout/index.js\");\n/* harmony import */ var _layout_worker_layout__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../layout/worker/layout */ \"./node_modules/@antv/g6-pc/es/layout/worker/layout.js\");\n/* harmony import */ var _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../layout/worker/layoutConst */ \"./node_modules/@antv/g6-pc/es/layout/worker/layoutConst.js\");\n/* harmony import */ var _util_gpu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/gpu */ \"./node_modules/@antv/g6-pc/es/util/gpu.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n\n\n\n\n\n\n\n// eslint-disable-next-line @typescript-eslint/no-implied-eval\nvar mockRaf = function mockRaf(cb) {\n return setTimeout(cb, 16);\n};\nvar mockCaf = function mockCaf(reqId) {\n return clearTimeout(reqId);\n};\nvar helper = {\n // pollyfill\n requestAnimationFrame: function requestAnimationFrame(callback) {\n var fn = typeof window !== 'undefined' ? window.requestAnimationFrame || window.webkitRequestAnimationFrame || mockRaf : mockRaf;\n return fn(callback);\n },\n cancelAnimationFrame: function cancelAnimationFrame(requestId) {\n var fn = typeof window !== 'undefined' ? window.cancelAnimationFrame || window.webkitCancelAnimationFrame || mockCaf : mockCaf;\n return fn(requestId);\n }\n};\nvar GPU_LAYOUT_NAMES = ['fruchterman', 'gForce'];\nvar LAYOUT_PIPES_ADJUST_NAMES = ['force', 'grid', 'circular'];\nvar LayoutController = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(LayoutController, _super);\n // the configurations of the layout\n // private layoutCfg: any; // LayoutOptions\n // the type name of the layout\n // private layoutType: string;\n // private data: GraphData;\n // private layoutMethods: typeof Layout;\n function LayoutController(graph) {\n var _this = _super.call(this, graph) || this;\n _this.graph = graph;\n _this.layoutCfg = graph.get('layout') || {};\n _this.layoutType = _this.getLayoutType();\n _this.worker = null;\n _this.workerData = {};\n _this.initLayout();\n return _this;\n }\n // eslint-disable-next-line class-methods-use-this\n LayoutController.prototype.initLayout = function () {\n // no data before rendering\n };\n // get layout worker and create one if not exists\n LayoutController.prototype.getWorker = function () {\n if (this.worker) {\n return this.worker;\n }\n if (typeof Worker === 'undefined') {\n // 如果当前浏览器不支持 web worker,则不使用 web worker\n console.warn('Web worker is not supported in current browser.');\n this.worker = null;\n } else {\n this.worker = Object(_layout_worker_layout__WEBPACK_IMPORTED_MODULE_3__[\"LayoutWorker\"])(this.layoutCfg.workerScriptURL);\n }\n return this.worker;\n };\n // stop layout worker\n LayoutController.prototype.stopWorker = function () {\n var workerData = this.workerData;\n if (!this.worker) {\n return;\n }\n this.worker.terminate();\n this.worker = null;\n // 重新开始新的布局之前,先取消之前布局的requestAnimationFrame。\n if (workerData.requestId) {\n helper.cancelAnimationFrame(workerData.requestId);\n workerData.requestId = null;\n }\n if (workerData.requestId2) {\n helper.cancelAnimationFrame(workerData.requestId2);\n workerData.requestId2 = null;\n }\n };\n LayoutController.prototype.execLayoutMethod = function (layoutCfg, order) {\n var _this = this;\n return new Promise(function (reslove, reject) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n var graph, layoutType, onTick_1, animate_1, isDefaultAnimateLayout_1, tick, enableTick, layoutMethod, onTick_2, tick, layoutData;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n graph = this.graph;\n if (!graph || graph.get('destroyed')) return [2 /*return*/];\n layoutType = layoutCfg.type;\n // 每个布局方法都需要注册\n layoutCfg.onLayoutEnd = function () {\n graph.emit('aftersublayout', {\n type: layoutType\n });\n reslove();\n };\n // 若用户指定开启 gpu,且当前浏览器支持 webgl,且该算法存在 GPU 版本(目前仅支持 fruchterman 和 gForce),使用 gpu 版本的布局\n if (layoutType && this.isGPU) {\n if (!hasGPUVersion(layoutType)) {\n console.warn(\"The '\".concat(layoutType, \"' layout does not support GPU calculation for now, it will run in CPU.\"));\n } else {\n layoutType = \"\".concat(layoutType, \"-gpu\");\n }\n }\n if (_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].isForce(layoutType)) {\n onTick_1 = layoutCfg.onTick, animate_1 = layoutCfg.animate;\n isDefaultAnimateLayout_1 = animate_1 === undefined && (layoutType === 'force' || layoutType === 'force2');\n tick = function tick() {\n if (onTick_1) {\n onTick_1();\n }\n if (animate_1 || isDefaultAnimateLayout_1) graph.refreshPositions();\n };\n layoutCfg.tick = tick;\n } else if (layoutType === 'comboForce' || layoutType === 'comboCombined') {\n layoutCfg.comboTrees = graph.get('comboTrees');\n }\n enableTick = false;\n try {\n layoutMethod = new _layout__WEBPACK_IMPORTED_MODULE_2__[\"Layout\"][layoutType](layoutCfg);\n if (this.layoutMethods[order]) {\n this.layoutMethods[order].destroy();\n }\n this.layoutMethods[order] = layoutMethod;\n } catch (e) {\n console.warn(\"The layout method: '\".concat(layoutType, \"' does not exist! Please specify it first.\"));\n reject();\n }\n // 是否需要迭代的方式完成布局。这里是来自布局对象的实例属性,是由布局的定义者在布局类定义的。\n enableTick = layoutMethod.enableTick;\n if (enableTick) {\n onTick_2 = layoutCfg.onTick;\n tick = function tick() {\n if (onTick_2) {\n onTick_2();\n }\n graph.refreshPositions();\n };\n layoutMethod.tick = tick;\n }\n layoutData = this.filterLayoutData(this.data, layoutCfg);\n addLayoutOrder(layoutData, order);\n layoutMethod.init(layoutData);\n // 若存在节点没有位置信息,且没有设置 layout,在 initPositions 中 random 给出了所有节点的位置,不需要再次执行 random 布局\n // 所有节点都有位置信息,且指定了 layout,则执行布局(代表不是第一次进行布局)\n graph.emit('beforesublayout', {\n type: layoutType\n });\n return [4 /*yield*/, layoutMethod.execute()];\n case 1:\n _a.sent();\n if (layoutMethod.isCustomLayout && layoutCfg.onLayoutEnd) layoutCfg.onLayoutEnd();\n return [2 /*return*/];\n }\n });\n });\n });\n };\n\n LayoutController.prototype.updateLayoutMethod = function (layoutMethod, layoutCfg) {\n var _this = this;\n return new Promise(function (reslove, reject) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n var graph, layoutType, onTick_3, animate_2, isDefaultAnimateLayout_2, tick, layoutData;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n graph = this.graph;\n layoutType = layoutCfg === null || layoutCfg === void 0 ? void 0 : layoutCfg.type;\n // 每个布局方法都需要注册\n layoutCfg.onLayoutEnd = function () {\n graph.emit('aftersublayout', {\n type: layoutType\n });\n reslove();\n };\n if (_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].isForce(layoutType)) {\n onTick_3 = layoutCfg.onTick, animate_2 = layoutCfg.animate;\n isDefaultAnimateLayout_2 = animate_2 === undefined && (layoutType === 'force' || layoutType === 'force2');\n tick = function tick() {\n onTick_3 === null || onTick_3 === void 0 ? void 0 : onTick_3();\n if (animate_2 || isDefaultAnimateLayout_2) graph.refreshPositions();\n };\n layoutCfg.tick = tick;\n }\n layoutData = this.filterLayoutData(this.data, layoutCfg);\n layoutMethod.init(layoutData);\n layoutMethod.updateCfg(layoutCfg);\n graph.emit('beforesublayout', {\n type: layoutType\n });\n return [4 /*yield*/, layoutMethod.execute()];\n case 1:\n _a.sent();\n if (layoutMethod.isCustomLayout && layoutCfg.onLayoutEnd) layoutCfg.onLayoutEnd();\n return [2 /*return*/];\n }\n });\n });\n });\n };\n /**\n * @param {function} success callback\n * @return {boolean} 是否使用web worker布局\n */\n LayoutController.prototype.layout = function (success) {\n var _this = this;\n var _a;\n var graph = this.graph;\n if (!graph || graph.get('destroyed')) return;\n this.data = this.setDataFromGraph();\n var _b = this.data,\n nodes = _b.nodes,\n hiddenNodes = _b.hiddenNodes;\n if (!nodes) {\n return false;\n }\n var width = graph.get('width');\n var height = graph.get('height');\n var layoutCfg = {};\n Object.assign(layoutCfg, {\n width: width,\n height: height,\n center: [width / 2, height / 2]\n }, this.layoutCfg);\n this.layoutCfg = layoutCfg;\n var layoutType = layoutCfg.type;\n var prevHasNodes = false;\n (_a = this.layoutMethods) === null || _a === void 0 ? void 0 : _a.forEach(function (method) {\n var _a;\n return prevHasNodes = !!((_a = method.nodes) === null || _a === void 0 ? void 0 : _a.length) || prevHasNodes;\n });\n var preLayoutTypes = this.destoryLayoutMethods();\n graph.emit('beforelayout');\n var start = Promise.resolve();\n // 增量情况下(上一次的布局与当前布局一致),上一次有节点,使用 treakInit\n if (prevHasNodes && layoutType && (preLayoutTypes === null || preLayoutTypes === void 0 ? void 0 : preLayoutTypes.length) === 1 && preLayoutTypes[0] === layoutType) {\n this.tweakInit();\n } else {\n // 初始化位置,若配置了 preset,则使用 preset 的参数生成布局作为预布局,否则使用 grid\n start = this.initPositions(layoutCfg.center, nodes);\n }\n // init hidden nodes\n var initHiddenPromise = this.initPositions(layoutCfg.center, hiddenNodes);\n initHiddenPromise.then();\n // 若用户指定开启 gpu,且当前浏览器支持 webgl,且该算法存在 GPU 版本(目前仅支持 fruchterman 和 gForce),使用 gpu 版本的布局\n this.isGPU = getGPUEnabled(layoutCfg, layoutType);\n // 在 onAllLayoutEnd 中执行用户自定义 onLayoutEnd,触发 afterlayout、更新节点位置、fitView/fitCenter、触发 afterrender\n var onLayoutEnd = layoutCfg.onLayoutEnd,\n layoutEndFormatted = layoutCfg.layoutEndFormatted,\n adjust = layoutCfg.adjust;\n if (!layoutEndFormatted) {\n layoutCfg.layoutEndFormatted = true;\n layoutCfg.onAllLayoutEnd = function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n // 执行用户自定义 onLayoutEnd\n if (onLayoutEnd) {\n onLayoutEnd(nodes);\n }\n // 更新节点位置\n this.refreshLayout();\n if (!(adjust && layoutCfg.pipes)) return [3 /*break*/, 2];\n return [4 /*yield*/, this.adjustPipesBox(this.data, adjust)];\n case 1:\n _a.sent();\n this.refreshLayout();\n _a.label = 2;\n case 2:\n // 触发 afterlayout\n graph.emit('afterlayout');\n return [2 /*return*/];\n }\n });\n });\n };\n }\n\n this.stopWorker();\n if (layoutCfg.workerEnabled && this.layoutWithWorker(this.data, success)) {\n // 如果启用布局web worker并且浏览器支持web worker,用web worker布局。否则回退到不用web worker布局。\n return true;\n }\n var hasLayout = false;\n if (layoutCfg.type) {\n hasLayout = true;\n start = start.then(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.execLayoutMethod(layoutCfg, 0)];\n case 1:\n return [2 /*return*/, _a.sent()];\n }\n });\n });\n });\n } else if (layoutCfg.pipes) {\n hasLayout = true;\n layoutCfg.pipes.forEach(function (cfg, index) {\n start = start.then(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.execLayoutMethod(cfg, index)];\n case 1:\n return [2 /*return*/, _a.sent()];\n }\n });\n });\n });\n });\n }\n if (hasLayout) {\n // 最后统一在外部调用onAllLayoutEnd\n start.then(function () {\n if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd();\n // 在执行 execute 后立即执行 success,且在 timeBar 中有 throttle,可以防止 timeBar 监听 afterrender 进行 changeData 后 layout,从而死循环\n // 对于 force 一类布局完成后的 fitView 需要用户自己在 onLayoutEnd 中配置\n if (success) success();\n }).catch(function (error) {\n console.warn('graph layout failed,', error);\n });\n } else {\n // 无布局配置\n graph.refreshPositions();\n success === null || success === void 0 ? void 0 : success();\n }\n return false;\n };\n /**\n * 增量数据初始化位置\n */\n LayoutController.prototype.tweakInit = function () {\n var _a = this,\n data = _a.data,\n graph = _a.graph;\n var nodes = data.nodes,\n edges = data.edges;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length)) return;\n var positionMap = {};\n nodes.forEach(function (node) {\n var x = node.x,\n y = node.y;\n if (!isNaN(x) && !isNaN(y)) {\n positionMap[node.id] = {\n x: x,\n y: y\n };\n // 有位置信息,则是原有节点,增加 mass\n node.mass = node.mass || 2;\n }\n });\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourcePosition = positionMap[source];\n var targetPosition = positionMap[target];\n if (!sourcePosition && targetPosition) {\n positionMap[source] = {\n x: targetPosition.x + (Math.random() - 0.5) * 80,\n y: targetPosition.y + (Math.random() - 0.5) * 80\n };\n } else if (!targetPosition && sourcePosition) {\n positionMap[target] = {\n x: sourcePosition.x + (Math.random() - 0.5) * 80,\n y: sourcePosition.y + (Math.random() - 0.5) * 80\n };\n }\n });\n var width = graph.get('width');\n var height = graph.get('height');\n nodes.forEach(function (node) {\n var position = positionMap[node.id] || {\n x: width / 2 + (Math.random() - 0.5) * 20,\n y: height / 2 + (Math.random() - 0.5) * 20\n };\n node.x = position.x;\n node.y = position.y;\n });\n };\n LayoutController.prototype.initWithPreset = function (hasPresetCallback, noPresetCallback) {\n var _this = this;\n return new Promise(function (resolve, reject) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n var _a, layoutCfg, data, preset, isGPU, layoutType, presetLayout;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_b) {\n switch (_b.label) {\n case 0:\n _a = this, layoutCfg = _a.layoutCfg, data = _a.data;\n preset = layoutCfg.preset;\n if (!(preset === null || preset === void 0 ? void 0 : preset.type) || !_layout__WEBPACK_IMPORTED_MODULE_2__[\"Layout\"][preset === null || preset === void 0 ? void 0 : preset.type]) {\n noPresetCallback === null || noPresetCallback === void 0 ? void 0 : noPresetCallback();\n resolve();\n return [2 /*return*/, false];\n }\n isGPU = getGPUEnabled(preset, preset.type);\n layoutType = isGPU ? \"\".concat(preset.type, \"-gpu\") : preset.type;\n presetLayout = new _layout__WEBPACK_IMPORTED_MODULE_2__[\"Layout\"][layoutType](preset);\n delete layoutCfg.preset;\n presetLayout.init(data);\n return [4 /*yield*/, presetLayout.execute()];\n case 1:\n _b.sent();\n hasPresetCallback === null || hasPresetCallback === void 0 ? void 0 : hasPresetCallback();\n resolve();\n return [2 /*return*/, true];\n }\n });\n });\n });\n };\n /**\n * layout with web worker\n * @param {object} data graph data\n * @return {boolean} 是否支持web worker\n */\n LayoutController.prototype.layoutWithWorker = function (data, success) {\n var _this = this;\n var _a = this,\n layoutCfg = _a.layoutCfg,\n graph = _a.graph;\n var worker = this.getWorker();\n // 每次worker message event handler调用之间的共享数据,会被修改。\n var workerData = this.workerData;\n if (!worker) {\n return false;\n }\n workerData.requestId = null;\n workerData.requestId2 = null;\n workerData.currentTick = null;\n workerData.currentTickData = null;\n graph.emit('beforelayout');\n var start = Promise.resolve();\n var hasLayout = false;\n if (layoutCfg.type) {\n hasLayout = true;\n start = start.then(function () {\n return _this.runWebworker(worker, data, layoutCfg);\n });\n } else if (layoutCfg.pipes) {\n hasLayout = true;\n var _loop_1 = function _loop_1(cfg) {\n start = start.then(function () {\n return _this.runWebworker(worker, data, cfg);\n });\n };\n for (var _i = 0, _b = layoutCfg.pipes; _i < _b.length; _i++) {\n var cfg = _b[_i];\n _loop_1(cfg);\n }\n }\n if (hasLayout) {\n // 最后统一在外部调用onAllLayoutEnd\n start.then(function () {\n if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd();\n success === null || success === void 0 ? void 0 : success();\n }).catch(function (error) {\n console.error('layout failed', error);\n });\n }\n return true;\n };\n LayoutController.prototype.runWebworker = function (worker, allData, layoutCfg) {\n var _this = this;\n var isGPU = this.isGPU;\n var data = this.filterLayoutData(allData, layoutCfg);\n var nodes = data.nodes,\n edges = data.edges;\n var offScreenCanvas = document.createElement('canvas');\n var gpuWorkerAbility = isGPU && typeof window !== 'undefined' &&\n // eslint-disable-next-line @typescript-eslint/dot-notation\n window.navigator && !navigator[\"gpu\"] &&\n // WebGPU 还不支持 OffscreenCanvas\n 'OffscreenCanvas' in window && 'transferControlToOffscreen' in offScreenCanvas;\n // NOTE: postMessage的message参数里面不能包含函数,否则postMessage会报错,\n // 例如:'function could not be cloned'。\n // 详情参考:https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\n // 所以这里需要把过滤layoutCfg里的函数字段过滤掉。\n var filteredLayoutCfg = filterObject(layoutCfg, function (value) {\n return typeof value !== 'function';\n });\n if (!gpuWorkerAbility) {\n worker.postMessage({\n type: _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].RUN,\n nodes: nodes,\n edges: edges,\n layoutCfg: filteredLayoutCfg\n });\n } else {\n var offscreen = offScreenCanvas.transferControlToOffscreen();\n // filteredLayoutCfg.canvas = offscreen;\n filteredLayoutCfg.type = \"\".concat(filteredLayoutCfg.type, \"-gpu\");\n worker.postMessage({\n type: _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].GPURUN,\n nodes: nodes,\n edges: edges,\n layoutCfg: filteredLayoutCfg,\n canvas: offscreen\n }, [offscreen]);\n }\n return new Promise(function (reslove, reject) {\n worker.onmessage = function (event) {\n _this.handleWorkerMessage(reslove, reject, event, data, layoutCfg);\n };\n });\n };\n // success callback will be called when updating graph positions for the first time.\n LayoutController.prototype.handleWorkerMessage = function (reslove, reject, event, data, layoutCfg) {\n var _a = this,\n graph = _a.graph,\n workerData = _a.workerData;\n var eventData = event.data;\n var type = eventData.type;\n var onTick = function onTick() {\n if (layoutCfg.onTick) {\n layoutCfg.onTick();\n }\n };\n switch (type) {\n case _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].TICK:\n workerData.currentTick = eventData.currentTick;\n workerData.currentTickData = eventData;\n if (!workerData.requestId) {\n workerData.requestId = helper.requestAnimationFrame(function requestId() {\n updateLayoutPosition(data, eventData);\n graph.refreshPositions();\n onTick();\n if (eventData.currentTick === eventData.totalTicks) {\n // 如果是最后一次tick\n reslove();\n } else if (workerData.currentTick === eventData.totalTicks) {\n // 注意这里workerData.currentTick可能已经不再是前面赋值时候的值了,\n // 因为在requestAnimationFrame等待时间里,可能产生新的tick。\n // 如果当前tick不是最后一次tick,并且所有的tick消息都已发出来了,那么需要用最后一次tick的数据再刷新一次。\n workerData.requestId2 = helper.requestAnimationFrame(function requestId2() {\n updateLayoutPosition(data, workerData.currentTickData);\n graph.refreshPositions();\n workerData.requestId2 = null;\n onTick();\n reslove();\n });\n }\n workerData.requestId = null;\n });\n }\n break;\n case _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].END:\n // 如果没有tick消息(非力导布局)\n if (workerData.currentTick == null) {\n updateLayoutPosition(data, eventData);\n reslove();\n }\n break;\n case _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].GPUEND:\n // 如果没有tick消息(非力导布局)\n if (workerData.currentTick == null) {\n updateGPUWorkerLayoutPosition(data, eventData);\n reslove();\n }\n break;\n case _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].ERROR:\n console.warn('Web-Worker layout error!', eventData.message);\n reject();\n break;\n default:\n reject();\n break;\n }\n };\n // 更新布局参数\n LayoutController.prototype.updateLayoutCfg = function (cfg) {\n var _this = this;\n var _a = this,\n graph = _a.graph,\n layoutMethods = _a.layoutMethods;\n if (!graph || graph.get('destroyed')) return;\n // disableTriggerLayout 不触发重新布局,仅更新参数\n var disableTriggerLayout = cfg.disableTriggerLayout,\n otherCfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(cfg, [\"disableTriggerLayout\"]);\n var layoutCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_6__[\"mix\"])({}, this.layoutCfg, otherCfg);\n this.layoutCfg = layoutCfg;\n // disableTriggerLayout 不触发重新布局,仅更新参数\n if (disableTriggerLayout) {\n return;\n }\n if (!(layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.length)) {\n this.layout();\n return;\n }\n this.data = this.setDataFromGraph();\n this.stopWorker();\n if (otherCfg.workerEnabled && this.layoutWithWorker(this.data, null)) {\n // 如果启用布局web worker并且浏览器支持web worker,用web worker布局。否则回退到不用web worker布局。\n return;\n }\n graph.emit('beforelayout');\n var start = Promise.resolve();\n var hasLayout = false;\n if ((layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.length) === 1) {\n hasLayout = true;\n start = start.then(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.updateLayoutMethod(layoutMethods[0], layoutCfg)];\n case 1:\n return [2 /*return*/, _a.sent()];\n }\n });\n });\n });\n } else if (layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.length) {\n hasLayout = true;\n layoutMethods.forEach(function (layoutMethod, index) {\n var currentCfg = layoutCfg.pipes[index];\n start = start.then(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4 /*yield*/, this.updateLayoutMethod(layoutMethod, currentCfg)];\n case 1:\n return [2 /*return*/, _a.sent()];\n }\n });\n });\n });\n });\n }\n if (hasLayout) {\n start.then(function () {\n if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd();\n }).catch(function (error) {\n console.warn('layout failed', error);\n });\n }\n };\n LayoutController.prototype.adjustPipesBox = function (data, adjust) {\n var _this = this;\n return new Promise(function (resolve) {\n var nodes = data.nodes;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length)) {\n resolve();\n }\n if (!LAYOUT_PIPES_ADJUST_NAMES.includes(adjust)) {\n console.warn(\"The adjust type \".concat(adjust, \" is not supported yet, please assign it with 'force', 'grid', or 'circular'.\"));\n resolve();\n }\n var layoutCfg = {\n center: _this.layoutCfg.center,\n nodeSize: function nodeSize(d) {\n return Math.max(d.height, d.width);\n },\n preventOverlap: true,\n onLayoutEnd: function onLayoutEnd() {}\n };\n // 计算出大单元\n var _a = _this.getLayoutBBox(nodes),\n groupNodes = _a.groupNodes,\n layoutNodes = _a.layoutNodes;\n var preNodes = Object(_antv_util__WEBPACK_IMPORTED_MODULE_6__[\"clone\"])(layoutNodes);\n // 根据大单元坐标的变化,调整这里面每个小单元nodes\n layoutCfg.onLayoutEnd = function () {\n layoutNodes === null || layoutNodes === void 0 ? void 0 : layoutNodes.forEach(function (ele, index) {\n var _a, _b, _c;\n var dx = ele.x - ((_a = preNodes[index]) === null || _a === void 0 ? void 0 : _a.x);\n var dy = ele.y - ((_b = preNodes[index]) === null || _b === void 0 ? void 0 : _b.y);\n (_c = groupNodes[index]) === null || _c === void 0 ? void 0 : _c.forEach(function (n) {\n n.x += dx;\n n.y += dy;\n });\n });\n resolve();\n };\n var layoutMethod = new _layout__WEBPACK_IMPORTED_MODULE_2__[\"Layout\"][adjust](layoutCfg);\n layoutMethod.layout({\n nodes: layoutNodes\n });\n });\n };\n LayoutController.prototype.destroy = function () {\n this.destoryLayoutMethods();\n var worker = this.worker;\n if (worker) {\n worker.terminate();\n this.worker = null;\n }\n this.destroyed = true;\n this.graph.set('layout', undefined);\n this.layoutCfg = undefined;\n this.layoutType = undefined;\n this.layoutMethods = undefined;\n this.graph = null;\n };\n return LayoutController;\n}(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"AbstractLayout\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayoutController);\nfunction updateLayoutPosition(data, layoutData) {\n var nodes = data.nodes;\n var layoutNodes = layoutData.nodes;\n var nodeLength = nodes.length;\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n node.x = layoutNodes[i].x;\n node.y = layoutNodes[i].y;\n }\n}\nfunction filterObject(collection, callback) {\n var result = {};\n if (collection && _typeof(collection) === 'object') {\n Object.keys(collection).forEach(function (key) {\n if (collection.hasOwnProperty(key) && callback(collection[key])) {\n result[key] = collection[key];\n }\n });\n return result;\n }\n return collection;\n}\nfunction updateGPUWorkerLayoutPosition(data, layoutData) {\n var nodes = data.nodes;\n var vertexEdgeData = layoutData.vertexEdgeData;\n var nodeLength = nodes.length;\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n var x = vertexEdgeData[4 * i];\n var y = vertexEdgeData[4 * i + 1];\n node.x = x;\n node.y = y;\n }\n}\nfunction addLayoutOrder(data, order) {\n var _a;\n if (!((_a = data === null || data === void 0 ? void 0 : data.nodes) === null || _a === void 0 ? void 0 : _a.length)) {\n return;\n }\n var nodes = data.nodes;\n nodes.forEach(function (node) {\n node.layoutOrder = order;\n });\n}\nfunction hasGPUVersion(layoutName) {\n return GPU_LAYOUT_NAMES.includes(layoutName);\n}\nfunction getGPUEnabled(layoutCfg, layoutType) {\n var type = layoutType;\n // 防止用户直接用 -gpu 结尾指定布局\n if (layoutType && layoutType.split('-')[1] === 'gpu') {\n type = layoutType.split('-')[0];\n layoutCfg.gpuEnabled = true;\n }\n var enableGPU = false;\n if (layoutCfg.gpuEnabled) {\n enableGPU = true;\n // 打开下面语句将会导致 webworker 报找不到 window\n if (!Object(_util_gpu__WEBPACK_IMPORTED_MODULE_5__[\"gpuDetector\"])().webgl) {\n console.warn(\"Your browser does not support webGL or GPGPU. The layout will run in CPU.\");\n enableGPU = false;\n }\n }\n // the layout does not support GPU, will run in CPU\n if (enableGPU && !hasGPUVersion(type)) {\n console.warn(\"The '\".concat(type, \"' layout does not support GPU calculation for now, it will run in CPU.\"));\n enableGPU = false;\n }\n return enableGPU;\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/controller/layout.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/behavior/behaviorOption.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/behavior/behaviorOption.js ***! - \******************************************************************/ +/***/ "./node_modules/@antv/g6-pc/es/graph/graph.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/graph/graph.js ***! + \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n // 自定义 Behavior 时候共有的方法\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {};\n },\n\n /**\n * register event handler, behavior will auto bind events\n * for example:\n * return {\n * click: 'onClick'\n * }\n */\n getEvents: function getEvents() {\n return {};\n },\n updateCfg: function updateCfg(cfg) {\n Object.assign(this, cfg);\n return true;\n },\n shouldBegin: function shouldBegin() {\n return true;\n },\n shouldUpdate: function shouldUpdate() {\n return true;\n },\n shouldEnd: function shouldEnd() {\n return true;\n },\n\n /**\n * auto bind events when register behavior\n * @param graph Graph instance\n */\n bind: function bind(graph) {\n var _this = this;\n\n var events = this.events;\n this.graph = graph;\n\n if (this.type === 'drag-canvas' || this.type === 'brush-select' || this.type === 'lasso-select') {\n graph.get('canvas').set('draggable', true);\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (handler, event) {\n graph.on(event, handler);\n }); // To avoid the tabs switching makes the keydown related behaviors disable\n\n document.addEventListener('visibilitychange', function () {\n _this.keydown = false;\n });\n },\n unbind: function unbind(graph) {\n var events = this.events;\n var draggable = graph.get('canvas').get('draggable');\n\n if (this.type === 'drag-canvas' || this.type === 'brush-select' || this.type === 'lasso-select') {\n graph.get('canvas').set('draggable', false);\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (handler, event) {\n graph.off(event, handler);\n });\n graph.get('canvas').set('draggable', draggable);\n },\n get: function get(val) {\n return this[val];\n },\n set: function set(key, val) {\n this[key] = val;\n return this;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/behavior/behaviorOption.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\n/* harmony import */ var _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-svg */ \"./node_modules/@antv/g-svg/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-pc/es/global.js\");\n/* harmony import */ var _util_image__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ../util/image */ \"./node_modules/@antv/g6-pc/es/util/image.js\");\n/* harmony import */ var _controller__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./controller */ \"./node_modules/@antv/g6-pc/es/graph/controller/index.js\");\n\n\n\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__[\"ext\"].transform;\nvar SVG = 'svg';\nvar Graph = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Graph, _super);\n function Graph(cfg) {\n var _this = _super.call(this, cfg) || this;\n var defaultNode = _this.get('defaultNode');\n if (!defaultNode) {\n _this.set('defaultNode', {\n type: 'circle'\n });\n }\n if (!defaultNode.type) {\n defaultNode.type = 'circle';\n _this.set('defaultNode', defaultNode);\n }\n _this.destroyed = false;\n return _this;\n }\n Graph.prototype.initLayoutController = function () {\n var layoutController = new _controller__WEBPACK_IMPORTED_MODULE_9__[\"LayoutController\"](this);\n this.set({\n layoutController: layoutController\n });\n };\n Graph.prototype.initEventController = function () {\n var eventController = new _controller__WEBPACK_IMPORTED_MODULE_9__[\"EventController\"](this);\n this.set({\n eventController: eventController\n });\n };\n Graph.prototype.initCanvas = function () {\n var container = this.get('container');\n if (typeof container === 'string') {\n container = document.getElementById(container);\n this.set('container', container);\n }\n if (!container) {\n throw new Error('invalid container');\n }\n var clientWidth = container.clientWidth,\n clientHeight = container.clientHeight;\n var width = this.get('width') || clientWidth;\n var height = this.get('height') || clientHeight;\n if (!this.get('width') && !this.get('height')) {\n this.set('width', clientWidth);\n this.set('height', clientHeight);\n }\n var renderer = this.get('renderer');\n var canvas;\n if (renderer === SVG) {\n canvas = new _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__[\"Canvas\"]({\n container: container,\n width: width,\n height: height\n });\n } else {\n var canvasCfg = {\n container: container,\n width: width,\n height: height\n };\n var pixelRatio = this.get('pixelRatio');\n if (pixelRatio) {\n canvasCfg.pixelRatio = pixelRatio;\n window.devicePixelRatio = pixelRatio;\n }\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasCfg);\n }\n this.set('canvas', canvas);\n };\n Graph.prototype.initPlugins = function () {\n var self = this;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"each\"])(self.get('plugins'), function (plugin) {\n if (!plugin.destroyed && plugin.initPlugin) {\n plugin.initPlugin(self);\n }\n });\n };\n /**\n * 增加图片下载水印功能\n */\n Graph.prototype.downloadImageWatermark = function (watermarker, context, width, height) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\n var watermarkStr, watermarkbase64, img;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n watermarkStr = watermarker.style.backgroundImage;\n watermarkbase64 = watermarkStr.slice(5, watermarkStr.length - 2);\n img = new Image();\n img.src = watermarkbase64;\n return [4 /*yield*/, new Promise(function (resolve) {\n img.onload = function () {\n var pat = context.createPattern(img, 'repeat');\n context.rect(0, 0, width, height);\n context.fillStyle = pat;\n context.fill();\n resolve('');\n };\n })];\n case 1:\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n /**\n * 用于生成图片 (异步callback)\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {string} backgroundColor 图片背景色\n * @return {string} 图片 dataURL\n */\n Graph.prototype.asyncToDataUrl = function (type, backgroundColor, callback, widths, heights, vCanvasEl) {\n var _this = this;\n var watermarker = document.querySelector('.g6-graph-watermarker');\n var canvas = this.get('canvas');\n var renderer = canvas.getRenderer();\n var canvasDom = vCanvasEl || canvas.get('el');\n var dataURL = '';\n if (!type) type = 'image/png';\n setTimeout(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n var cloneNode, svgDocType, svgDoc, svgData, imageData, context, width, height, compositeOperation, pixelRatio;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(renderer === 'svg')) return [3 /*break*/, 1];\n cloneNode = canvasDom.cloneNode(true);\n svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');\n svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);\n svgDoc.replaceChild(cloneNode, svgDoc.documentElement);\n svgData = new XMLSerializer().serializeToString(svgDoc);\n dataURL = \"data:image/svg+xml;charset=utf8,\".concat(encodeURIComponent(svgData));\n return [3 /*break*/, 4];\n case 1:\n imageData = void 0;\n context = canvasDom.getContext('2d');\n width = widths || this.get('width');\n height = heights || this.get('height');\n compositeOperation = void 0;\n if (!watermarker) return [3 /*break*/, 3];\n return [4 /*yield*/, this.downloadImageWatermark(watermarker, context, width, height)];\n case 2:\n _a.sent();\n _a.label = 3;\n case 3:\n if (backgroundColor) {\n pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;\n try {\n imageData = context.getImageData(0, 0, width * pixelRatio, height * pixelRatio);\n compositeOperation = context.globalCompositeOperation;\n context.globalCompositeOperation = 'destination-over';\n context.fillStyle = backgroundColor;\n context.fillRect(0, 0, width, height);\n } catch (error) {\n console.error('Download image failed. Out of memory at ImageData creation');\n }\n }\n dataURL = canvasDom.toDataURL(type);\n if (backgroundColor) {\n context.clearRect(0, 0, width, height);\n context.putImageData(imageData, 0, 0);\n context.globalCompositeOperation = compositeOperation;\n }\n _a.label = 4;\n case 4:\n if (callback) callback(dataURL);\n return [2 /*return*/];\n }\n });\n });\n }, 16);\n };\n /**\n * 返回可见区域的图的 dataUrl,用于生成图片\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {string} backgroundColor 图片背景色\n * @return {string} 图片 dataURL\n */\n Graph.prototype.toDataURL = function (type, backgroundColor) {\n var canvas = this.get('canvas');\n var renderer = canvas.getRenderer();\n var canvasDom = canvas.get('el');\n if (!type) type = 'image/png';\n var dataURL = '';\n if (renderer === 'svg') {\n var cloneNode = canvasDom.cloneNode(true);\n var svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');\n var svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);\n svgDoc.replaceChild(cloneNode, svgDoc.documentElement);\n var svgData = new XMLSerializer().serializeToString(svgDoc);\n dataURL = \"data:image/svg+xml;charset=utf8,\".concat(encodeURIComponent(svgData));\n } else {\n var imageData = void 0;\n var context = canvasDom.getContext('2d');\n var width = Math.max(this.get('width'), 500);\n var height = Math.max(this.get('height'), 500);\n var compositeOperation = void 0;\n if (backgroundColor) {\n var pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n try {\n imageData = context.getImageData(0, 0, width * pixelRatio, height * pixelRatio);\n compositeOperation = context.globalCompositeOperation;\n context.globalCompositeOperation = 'destination-over';\n context.fillStyle = backgroundColor;\n context.fillRect(0, 0, width, height);\n } catch (error) {\n console.error('Download image failed. Out of memory at ImageData creation');\n }\n }\n dataURL = canvasDom.toDataURL(type);\n if (backgroundColor) {\n context.clearRect(0, 0, width, height);\n context.putImageData(imageData, 0, 0);\n context.globalCompositeOperation = compositeOperation;\n }\n }\n return dataURL;\n };\n /**\n * 返回整个图(包括超出可见区域的部分)的 dataUrl,用于生成图片\n * @param {Function} callback 异步生成 dataUrl 完成后的回调函数,在这里处理生成的 dataUrl 字符串\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {Object} imageConfig 图片配置项,包括背景色和上下左右的 padding\n */\n Graph.prototype.toFullDataURL = function (callback, type, imageConfig) {\n var bbox = this.get('group').getCanvasBBox();\n var height = bbox.height;\n var width = bbox.width;\n var renderer = this.get('renderer');\n var vContainerDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_6__[\"createDom\"])('
');\n var backgroundColor = imageConfig ? imageConfig.backgroundColor : undefined;\n var padding = imageConfig ? imageConfig.padding : undefined;\n if (!padding) padding = [0, 0, 0, 0];else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var vHeight = height + padding[0] + padding[2];\n var vWidth = width + padding[1] + padding[3];\n var canvasOptions = {\n container: vContainerDOM,\n height: vHeight,\n width: vWidth,\n quickHit: true\n };\n var vCanvas = renderer === 'svg' ? new _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__[\"Canvas\"](canvasOptions) : new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasOptions);\n var group = this.get('group');\n var vGroup = group.clone();\n var matrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"clone\"])(vGroup.getMatrix());\n if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var centerX = (bbox.maxX + bbox.minX) / 2;\n var centerY = (bbox.maxY + bbox.minY) / 2;\n matrix = transform(matrix, [['t', -centerX, -centerY], ['t', width / 2 + padding[3], height / 2 + padding[0]]]);\n vGroup.resetMatrix();\n vGroup.setMatrix(matrix);\n vCanvas.add(vGroup);\n var vCanvasEl = vCanvas.get('el');\n var dataURL = '';\n if (!type) type = 'image/png';\n setTimeout(function () {\n if (renderer === 'svg') {\n var cloneNode = vCanvasEl.cloneNode(true);\n var svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');\n var svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);\n svgDoc.replaceChild(cloneNode, svgDoc.documentElement);\n var svgData = new XMLSerializer().serializeToString(svgDoc);\n dataURL = \"data:image/svg+xml;charset=utf8,\".concat(encodeURIComponent(svgData));\n } else {\n var imageData = void 0;\n var context = vCanvasEl.getContext('2d');\n var compositeOperation = void 0;\n if (backgroundColor) {\n var pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;\n try {\n imageData = context.getImageData(0, 0, vWidth * pixelRatio, vHeight * pixelRatio);\n compositeOperation = context.globalCompositeOperation;\n context.globalCompositeOperation = 'destination-over';\n context.fillStyle = backgroundColor;\n context.fillRect(0, 0, vWidth, vHeight);\n } catch (error) {\n console.error('Download image failed. Out of memory at ImageData creation');\n }\n }\n dataURL = vCanvasEl.toDataURL(type);\n if (backgroundColor) {\n context.clearRect(0, 0, vWidth, vHeight);\n context.putImageData(imageData, 0, 0);\n context.globalCompositeOperation = compositeOperation;\n }\n }\n if (callback) callback(dataURL);\n }, 16);\n };\n /**\n * 导出包含全图的图片\n * @param {String} name 图片的名称\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {Object} imageConfig 图片配置项,包括背景色和上下左右的 padding\n */\n Graph.prototype.downloadFullImage = function (name, type, imageConfig) {\n var _this = this;\n var bbox = this.get('group').getCanvasBBox();\n var height = bbox.height;\n var width = bbox.width;\n var renderer = this.get('renderer');\n var vContainerDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_6__[\"createDom\"])('
');\n var watermarker = document.querySelector('.g6-graph-watermarker');\n var backgroundColor = imageConfig ? imageConfig.backgroundColor : undefined;\n var padding = imageConfig ? imageConfig.padding : undefined;\n if (!padding) padding = [0, 0, 0, 0];else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var vHeight = height + padding[0] + padding[2];\n var vWidth = width + padding[1] + padding[3];\n if (watermarker) {\n var _a = this.get('graphWaterMarker').cfg || {},\n wmWidth = _a.width,\n wmHeight = _a.height;\n vHeight = Math.ceil(vHeight / wmHeight) * wmHeight;\n vWidth = Math.ceil(vWidth / wmWidth) * wmWidth;\n }\n var canvasOptions = {\n container: vContainerDOM,\n height: vHeight,\n width: vWidth\n };\n var vCanvas = renderer === 'svg' ? new _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__[\"Canvas\"](canvasOptions) : new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasOptions);\n var group = this.get('group');\n // clone group and clone image shape's clip\n var vGroup = Object(_util_image__WEBPACK_IMPORTED_MODULE_8__[\"cloneGElement\"])(group);\n var matrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"clone\"])(vGroup.getMatrix());\n if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var centerX = (bbox.maxX + bbox.minX) / 2;\n var centerY = (bbox.maxY + bbox.minY) / 2;\n matrix = transform(matrix, [['t', -centerX, -centerY], ['t', width / 2 + padding[3], height / 2 + padding[0]]]);\n vGroup.resetMatrix();\n vGroup.setMatrix(matrix);\n vCanvas.add(vGroup);\n var vCanvasEl = vCanvas.get('el');\n if (!type) type = 'image/png';\n this.asyncToDataUrl(type, backgroundColor, function (dataURL) {\n var link = document.createElement('a');\n var fileName = (name || 'graph') + (renderer === 'svg' ? '.svg' : \".\".concat(type.split('/')[1]));\n _this.dataURLToImage(dataURL, renderer, link, fileName);\n var e = document.createEvent('MouseEvents');\n e.initEvent('click', false, false);\n link.dispatchEvent(e);\n }, vWidth, vHeight, vCanvasEl);\n };\n /**\n * 画布导出图片,图片仅包含画布可见区域部分内容\n * @param {String} name 图片的名称\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {string} backgroundColor 图片背景色\n */\n Graph.prototype.downloadImage = function (name, type, backgroundColor) {\n var _this = this;\n var self = this;\n self.stopAnimate();\n var canvas = self.get('canvas');\n var renderer = canvas.getRenderer();\n if (!type) type = 'image/png';\n var fileName = (name || 'graph') + (renderer === 'svg' ? '.svg' : \".\".concat(type.split('/')[1]));\n var link = document.createElement('a');\n self.asyncToDataUrl(type, backgroundColor, function (dataURL) {\n _this.dataURLToImage(dataURL, renderer, link, fileName);\n var e = document.createEvent('MouseEvents');\n e.initEvent('click', false, false);\n link.dispatchEvent(e);\n });\n };\n Graph.prototype.dataURLToImage = function (dataURL, renderer, link, fileName) {\n if (!dataURL || dataURL === 'data:') {\n console.error('Download image failed. The graph is too large or there is invalid attribute values in graph items');\n return;\n }\n if (typeof window !== 'undefined') {\n if (window.Blob && window.URL && renderer !== 'svg') {\n var arr = dataURL.split(',');\n var mime = '';\n if (arr && arr.length > 0) {\n var match = arr[0].match(/:(.*?);/);\n // eslint-disable-next-line prefer-destructuring\n if (match && match.length >= 2) mime = match[1];\n }\n var bstr = atob(arr[1]);\n var n = bstr.length;\n var u8arr = new Uint8Array(n);\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n var blobObj_1 = new Blob([u8arr], {\n type: mime\n });\n if (window.navigator.msSaveBlob) {\n window.navigator.msSaveBlob(blobObj_1, fileName);\n } else {\n link.addEventListener('click', function () {\n link.download = fileName;\n link.href = window.URL.createObjectURL(blobObj_1);\n });\n }\n } else {\n link.addEventListener('click', function () {\n link.download = fileName;\n link.href = dataURL;\n });\n }\n }\n };\n /**\n * 添加插件\n * @param {object} plugin 插件实例\n */\n Graph.prototype.addPlugin = function (plugin) {\n var self = this;\n if (plugin.destroyed) {\n return;\n }\n self.get('plugins').push(plugin);\n plugin.initPlugin(self);\n };\n /**\n * 添加插件\n * @param {object} plugin 插件实例\n */\n Graph.prototype.removePlugin = function (plugin) {\n var plugins = this.get('plugins');\n var index = plugins.indexOf(plugin);\n if (index >= 0) {\n plugin.destroyPlugin();\n plugins.splice(index, 1);\n }\n };\n /**\n * 设置图片水印\n * @param {string} imgURL 图片水印的url地址\n * @param {WaterMarkerConfig} config 文本水印的配置项\n */\n Graph.prototype.setImageWaterMarker = function (imgURL, config) {\n if (imgURL === void 0) {\n imgURL = _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].waterMarkerImage;\n }\n var container = this.get('container');\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n var canvas = this.get('graphWaterMarker');\n var waterMarkerConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"deepMix\"])({}, _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].imageWaterMarkerConfig, config);\n var width = waterMarkerConfig.width,\n height = waterMarkerConfig.height,\n compatible = waterMarkerConfig.compatible,\n image = waterMarkerConfig.image;\n if (!imgURL) {\n var dom = compatible ? container : document.querySelector('.g6-graph-watermarker');\n if (dom) dom.style.cssText = undefined;\n if (canvas) canvas.clear();\n return;\n }\n if (!canvas) {\n var canvasCfg = {\n container: container,\n width: width,\n height: height,\n capture: false\n };\n var pixelRatio = this.get('pixelRatio');\n if (pixelRatio) {\n canvasCfg.pixelRatio = pixelRatio;\n window.devicePixelRatio = pixelRatio;\n }\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasCfg);\n this.set('graphWaterMarker', canvas);\n } else {\n canvas.clear();\n }\n canvas.get('el').style.display = 'none';\n var ctx = canvas.get('context');\n var rotate = image.rotate,\n x = image.x,\n y = image.y;\n // 旋转20度\n ctx.rotate(-rotate * Math.PI / 180);\n var img = new Image();\n img.crossOrigin = 'anonymous';\n img.src = imgURL;\n img.onload = function () {\n ctx.drawImage(img, x, y, image.width, image.height);\n // 恢复旋转角度\n ctx.rotate(rotate * Math.PI / 180);\n // 默认按照现代浏览器处理\n if (!compatible) {\n var box = document.querySelector('.g6-graph-watermarker');\n if (!box) {\n box = document.createElement('div');\n box.className = 'g6-graph-watermarker';\n }\n box.className = 'g6-graph-watermarker';\n if (!canvas.destroyed) {\n box.style.cssText = \"background-image: url(\".concat(canvas.get('el').toDataURL('image/png'), \");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;\");\n container.appendChild(box);\n }\n } else {\n // 当需要兼容不支持 pointer-events属性的浏览器时,将 compatible 设置为 true\n container.style.cssText = \"background-image: url(\".concat(canvas.get('el').toDataURL('image/png'), \");background-repeat:repeat;\");\n }\n };\n };\n /**\n * 设置文本水印\n * @param {string[]} texts 水印的文本内容\n * @param {WaterMarkerConfig} config 文本水印的配置项\n */\n Graph.prototype.setTextWaterMarker = function (texts, config) {\n var container = this.get('container');\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n var canvas = this.get('graphWaterMarker');\n var waterMarkerConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"deepMix\"])({}, _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].textWaterMarkerConfig, config);\n var width = waterMarkerConfig.width,\n height = waterMarkerConfig.height,\n compatible = waterMarkerConfig.compatible,\n text = waterMarkerConfig.text;\n if (!(texts === null || texts === void 0 ? void 0 : texts.length)) {\n var dom = compatible ? container : document.querySelector('.g6-graph-watermarker');\n if (dom) dom.style.cssText = undefined;\n if (canvas) canvas.clear();\n return;\n }\n if (!canvas) {\n var canvasCfg = {\n container: container,\n width: width,\n height: height,\n capture: false\n };\n var pixelRatio = this.get('pixelRatio');\n if (pixelRatio) {\n canvasCfg.pixelRatio = pixelRatio;\n window.devicePixelRatio = pixelRatio;\n }\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasCfg);\n this.set('graphWaterMarker', canvas);\n } else {\n canvas.clear();\n }\n canvas.get('el').style.display = 'none';\n var ctx = canvas.get('context');\n var rotate = text.rotate,\n fill = text.fill,\n fontFamily = text.fontFamily,\n fontSize = text.fontSize,\n baseline = text.baseline,\n x = text.x,\n y = text.y,\n lineHeight = text.lineHeight;\n // 旋转20度\n ctx.rotate(-rotate * Math.PI / 180);\n // 设置文字样式\n ctx.font = \"\".concat(fontSize, \"px \").concat(fontFamily);\n // 设置文字颜色\n ctx.fillStyle = fill;\n ctx.textBaseline = baseline;\n var displayTexts = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isString\"])(texts) ? [texts] : texts;\n for (var i = displayTexts.length - 1; i >= 0; i--) {\n // 将文字绘制到画布\n ctx.fillText(displayTexts[i], x, y + i * lineHeight);\n }\n // 恢复旋转角度\n ctx.rotate(rotate * Math.PI / 180);\n // 默认按照现代浏览器处理\n if (!compatible) {\n var box = document.querySelector('.g6-graph-watermarker');\n if (!box) {\n box = document.createElement('div');\n box.className = 'g6-graph-watermarker';\n }\n box.style.cssText = \"background-image: url(\".concat(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;\");\n container.appendChild(box);\n } else {\n // 当需要兼容不支持 pointer-events属性的浏览器时,将 compatible 设置为 true\n container.style.cssText = \"background-image: url(\".concat(canvas.get('el').toDataURL('image/png'), \");background-repeat:repeat;\");\n }\n };\n /**\n * 销毁画布\n */\n Graph.prototype.destroy = function () {\n var _a, _b, _c, _d;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"each\"])(this.get('plugins'), function (plugin) {\n plugin.destroyPlugin();\n });\n // destroy tooltip doms, removed when upgrade G6 4.0\n var tooltipDOMs = this.get('tooltips');\n if (tooltipDOMs) {\n for (var i = 0; i < tooltipDOMs.length; i++) {\n var container = tooltipDOMs[i];\n if (!container) continue;\n var parent_1 = container.parentElement;\n if (!parent_1) continue;\n parent_1.removeChild(container);\n }\n }\n (_a = this.get('eventController')) === null || _a === void 0 ? void 0 : _a.destroy();\n (_b = this.get('layoutController')) === null || _b === void 0 ? void 0 : _b.destroy();\n // this.get('eventController').destroy();\n // this.get('itemController').destroy();\n // this.get('modeController').destroy();\n // this.get('viewController').destroy();\n // this.get('stateController').destroy();\n // this.get('canvas').destroy();\n (_c = this.get('graphWaterMarker')) === null || _c === void 0 ? void 0 : _c.destroy();\n (_d = document.querySelector('.g6-graph-watermarker')) === null || _d === void 0 ? void 0 : _d.remove();\n _super.prototype.destroy.call(this);\n };\n return Graph;\n}(_antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"AbstractGraph\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Graph);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/graph.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/behavior/index.js": +/***/ "./node_modules/@antv/g6-pc/es/graph/tree-graph.js": /*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/behavior/index.js ***! + !*** ./node_modules/@antv/g6-pc/es/graph/tree-graph.js ***! \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./behavior */ \"./node_modules/@antv/g6-core/es/behavior/behavior.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_behavior__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/behavior/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_hierarchy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/hierarchy */ \"./node_modules/@antv/hierarchy/build/hierarchy.js\");\n/* harmony import */ var _antv_hierarchy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_antv_hierarchy__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n/* harmony import */ var _util_deepClone__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/deepClone */ \"./node_modules/@antv/g6-pc/es/util/deepClone.js\");\n/* harmony import */ var _graph__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./graph */ \"./node_modules/@antv/g6-pc/es/graph/graph.js\");\n\n\n\n\n\n\nvar radialLayout = _util__WEBPACK_IMPORTED_MODULE_3__[\"default\"].radialLayout,\n traverseTree = _util__WEBPACK_IMPORTED_MODULE_3__[\"default\"].traverseTree;\nvar TreeGraph = /** @class */function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(TreeGraph, _super);\n function TreeGraph(cfg) {\n var _this = _super.call(this, cfg) || this;\n _this.layoutAnimating = false;\n // 用于缓存动画结束后需要删除的节点\n _this.set('removeList', []);\n _this.set('layoutMethod', _this.getLayout());\n return _this;\n }\n /**\n * 通过 Layout 配置获取布局配置\n */\n TreeGraph.prototype.getLayout = function () {\n var layout = this.get('layout');\n if (!layout) {\n return null;\n }\n if (typeof layout === 'function') {\n return layout;\n }\n if (!layout.type) {\n layout.type = 'dendrogram';\n }\n if (!layout.direction) {\n layout.direction = layout.type === 'indented' ? 'LR' : 'TB';\n }\n if (layout.radial) {\n return function (data) {\n var layoutData = _antv_hierarchy__WEBPACK_IMPORTED_MODULE_1___default.a[layout.type](data, layout);\n radialLayout(layoutData);\n return layoutData;\n };\n }\n return function (data) {\n return _antv_hierarchy__WEBPACK_IMPORTED_MODULE_1___default.a[layout.type](data, layout);\n };\n };\n /**\n * 返回指定节点在树图数据中的索引\n * @param children 树图数据\n * @param child 树图中某一个 Item 的数据\n */\n TreeGraph.indexOfChild = function (children, id) {\n var index = -1;\n // eslint-disable-next-line consistent-return\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(children, function (former, i) {\n if (id === former.id) {\n index = i;\n return false;\n }\n });\n return index;\n };\n TreeGraph.prototype.getDefaultCfg = function () {\n var cfg = _super.prototype.getDefaultCfg.call(this);\n // 树图默认打开动画\n cfg.animate = true;\n return cfg;\n };\n /**\n * 向🌲树中添加数据\n * @param treeData 树图数据\n * @param parent 父节点实例\n * @param animate 是否开启动画\n */\n TreeGraph.prototype.innerAddChild = function (treeData, parent, animate) {\n var self = this;\n var model = treeData.data;\n if (model) {\n // model 中应存储真实的数据,特别是真实的 children\n model.x = treeData.x;\n model.y = treeData.y;\n model.depth = treeData.depth;\n }\n var node = self.addItem('node', model, false);\n if (parent) {\n node.set('parent', parent);\n if (animate) {\n var origin_1 = parent.get('originAttrs');\n if (origin_1) {\n node.set('originAttrs', origin_1);\n } else {\n var parentModel = parent.getModel();\n node.set('originAttrs', {\n x: parentModel.x,\n y: parentModel.y\n });\n }\n }\n var childrenList = parent.get('children');\n if (!childrenList) {\n parent.set('children', [node]);\n } else {\n childrenList.push(node);\n }\n self.addItem('edge', {\n source: parent.get('id'),\n target: node.get('id'),\n id: \"\".concat(parent.get('id'), \":\").concat(node.get('id'))\n }, false);\n }\n // 渲染到视图上应参考布局的children, 避免多绘制了收起的节点\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(treeData.children || [], function (child) {\n self.innerAddChild(child, node, animate);\n });\n self.emit('afteraddchild', {\n item: node,\n parent: parent\n });\n return node;\n };\n /**\n * 将数据上的变更转换到视图上\n * @param data\n * @param parent\n * @param animate\n */\n TreeGraph.prototype.innerUpdateChild = function (data, parent, animate) {\n var self = this;\n var current = self.findById(data.id);\n // 若子树不存在,整体添加即可\n if (!current) {\n self.innerAddChild(data, parent, animate);\n return;\n }\n // 更新新节点下所有子节点\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(data.children || [], function (child) {\n self.innerUpdateChild(child, current, animate);\n });\n // 用现在节点的children实例来删除移除的子节点\n var children = current.get('children');\n if (children) {\n var len = children.length;\n if (len > 0) {\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i].getModel();\n if (TreeGraph.indexOfChild(data.children || [], child.id) === -1) {\n self.innerRemoveChild(child.id, {\n x: data.x,\n y: data.y\n }, animate);\n // 更新父节点下缓存的子节点 item 实例列表\n children.splice(i, 1);\n }\n }\n }\n }\n var oriX;\n var oriY;\n if (current.get('originAttrs')) {\n oriX = current.get('originAttrs').x;\n oriY = current.get('originAttrs').y;\n }\n var model = current.getModel();\n if (animate) {\n // 如果有动画,先缓存节点运动再更新节点\n current.set('originAttrs', {\n x: model.x,\n y: model.y\n });\n }\n current.set('model', Object.assign(model, data.data));\n if (oriX !== data.x || oriY !== data.y) {\n current.updatePosition({\n x: data.x,\n y: data.y\n });\n }\n };\n /**\n * 删除子节点Item对象\n * @param id\n * @param to\n * @param animate\n */\n TreeGraph.prototype.innerRemoveChild = function (id, to, animate) {\n var self = this;\n var node = self.findById(id);\n if (!node) {\n return;\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(node.get('children'), function (child) {\n self.innerRemoveChild(child.getModel().id, to, animate);\n });\n if (animate) {\n var model = node.getModel();\n node.set('to', to);\n node.set('originAttrs', {\n x: model.x,\n y: model.y\n });\n self.get('removeList').push(node);\n } else {\n self.removeItem(node, false);\n }\n };\n /**\n * 更新数据模型,差量更新并重新渲染\n * @param {object} data 数据模型\n */\n TreeGraph.prototype.changeData = function (data, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n // 更改数据源后,取消所有状态\n this.getNodes().map(function (node) {\n return self.clearItemStates(node);\n });\n this.getEdges().map(function (edge) {\n return self.clearItemStates(edge);\n });\n if (stack && this.get('enabledStack')) {\n this.pushStack('changedata', {\n before: self.get('originData'),\n after: data || self.get('data')\n });\n }\n if (data) {\n self.data(data);\n self.render(false);\n } else {\n self.layout(this.get('fitView'));\n }\n };\n /**\n * 已更名为 updateLayout,为保持兼容暂且保留。\n * 更改并应用树布局算法\n * @param {object} layout 布局算法\n */\n TreeGraph.prototype.changeLayout = function (layout) {\n // eslint-disable-next-line no-console\n console.warn('Please call updateLayout instead of changeLayout. changeLayout will be discarded soon');\n var self = this;\n self.updateLayout(layout);\n };\n /**\n * 更改并应用树布局算法\n * @param {object} layout 布局算法\n */\n TreeGraph.prototype.updateLayout = function (layout, align, alignPoint, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n if (!layout) {\n // eslint-disable-next-line no-console\n console.warn('layout cannot be null');\n return;\n }\n if (stack && this.get('enabledStack')) {\n this.pushStack('layout', {\n before: self.get('layout'),\n after: layout\n });\n }\n self.set('layout', layout);\n self.set('layoutMethod', self.getLayout());\n self.layout();\n // align the graph after layout\n if (align) {\n var toPoint = alignPoint;\n if (!toPoint) {\n if (align === 'begin') toPoint = {\n x: 0,\n y: 0\n };else toPoint = {\n x: this.getWidth() / 2,\n y: this.getHeight() / 2\n };\n }\n // translate to point coordinate system\n toPoint = this.getPointByCanvas(toPoint.x, toPoint.y);\n var matrix = this.getGroup().getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n toPoint.x = toPoint.x * matrix[0] + matrix[6];\n toPoint.y = toPoint.y * matrix[0] + matrix[7];\n var _a = this.getGroup().getCanvasBBox(),\n minX = _a.minX,\n maxX = _a.maxX,\n minY = _a.minY,\n maxY = _a.maxY;\n var bboxPoint = {\n x: (minX + maxX) / 2,\n y: (minY + maxY) / 2\n };\n if (align === 'begin') {\n bboxPoint.x = minX;\n bboxPoint.y = minY;\n }\n this.translate(toPoint.x - bboxPoint.x, toPoint.y - bboxPoint.y);\n }\n };\n /**\n * 已更名为 layout,为保持兼容暂且保留。\n * 根据目前的 data 刷新布局,更新到画布上。用于变更数据之后刷新视图。\n * @param {boolean} fitView 更新布局时是否需要适应窗口\n */\n TreeGraph.prototype.refreshLayout = function (fitView) {\n // eslint-disable-next-line no-console\n console.warn('Please call layout instead of refreshLayout. refreshLayout will be discarded soon');\n var self = this;\n self.layout(fitView);\n };\n /**\n * 根据目前的 data 刷新布局,更新到画布上。用于变更数据之后刷新视图。\n * @param {boolean} fitView 更新布局时是否需要适应窗口\n */\n TreeGraph.prototype.layout = function (fitView) {\n var _this = this;\n var self = this;\n var data = self.get('data');\n var layoutMethod = self.get('layoutMethod');\n var layoutConfig = self.get('layout');\n var layoutData = data;\n if (layoutConfig === null || layoutConfig === void 0 ? void 0 : layoutConfig.excludeInvisibles) {\n data = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"clone\"])(self.get('data'));\n var cacheChidMap_1 = {};\n traverseTree(data, function (subTree) {\n var siblings = subTree.children;\n if (!(siblings === null || siblings === void 0 ? void 0 : siblings.length)) return true;\n for (var i = siblings.length - 1; i >= 0; i--) {\n var node = _this.findById(siblings[i].id);\n var isHidden = node ? !node.isVisible() : siblings[i].visible === false;\n if (isHidden) {\n cacheChidMap_1[subTree.id] = cacheChidMap_1[subTree.id] || [];\n cacheChidMap_1[subTree.id].push({\n idx: i,\n child: siblings.splice(i, 1)[0]\n });\n }\n }\n });\n layoutData = layoutMethod ? layoutMethod(data, self.get('layout')) : data;\n traverseTree(layoutData, function (subTree) {\n var cachedItems = cacheChidMap_1[subTree.id];\n if (cachedItems === null || cachedItems === void 0 ? void 0 : cachedItems.length) {\n for (var i = cachedItems.length - 1; i >= 0; i--) {\n var _a = cachedItems[i],\n idx = _a.idx,\n child = _a.child;\n subTree.children.splice(idx, 0, child);\n }\n }\n });\n } else {\n layoutData = layoutMethod ? layoutMethod(data, self.get('layout')) : data;\n }\n var animate = self.get('animate');\n self.emit('beforerefreshlayout', {\n data: data,\n layoutData: layoutData\n });\n self.emit('beforelayout');\n self.innerUpdateChild(layoutData, undefined, animate);\n if (fitView) {\n var viewController = self.get('viewController');\n viewController.fitView();\n }\n if (!animate) {\n // 如果没有动画,目前仅更新了节点的位置,刷新一下边的样式\n self.refresh();\n self.paint();\n } else {\n self.layoutAnimate(layoutData);\n }\n self.emit('afterrefreshlayout', {\n data: data,\n layoutData: layoutData\n });\n self.emit('afterlayout');\n };\n /**\n * 添加子树到对应 id 的节点\n * @param {TreeGraphData} data 子树数据模型\n * @param {string} parent 子树的父节点id\n */\n TreeGraph.prototype.addChild = function (data, parent, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n self.emit('beforeaddchild', {\n model: data,\n parent: parent\n });\n // 将数据添加到源数据中,走changeData方法\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isString\"])(parent)) {\n parent = parent.get('id');\n }\n var parentData = self.findDataById(parent);\n if (parentData) {\n if (!parentData.children) {\n parentData.children = [];\n }\n parentData.children.push(data);\n var parentItem = self.findById(parent);\n parentItem.refresh();\n self.changeData(undefined, stack);\n }\n };\n /**\n * 更新某个节点下的所有子节点\n * @param {TreeGraphData[]} data 子树数据模型集合\n * @param {string} parent 子树的父节点id\n */\n TreeGraph.prototype.updateChildren = function (data, parentId, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n // 如果没有父节点或找不到该节点,是全量的更新,直接重置data\n var parentItem = self.findById(parentId);\n if (!parentId || !parentItem) {\n console.warn(\"Update children failed! There is no node with id '\".concat(parentId, \"'\"));\n return;\n }\n var parentModel = self.findDataById(parentId);\n parentModel.children = data;\n parentItem.refresh();\n self.changeData(undefined, stack);\n };\n /**\n * 更新源数据,差量更新子树\n * @param {TreeGraphData} data 子树数据模型\n * @param {string} parentId 子树的父节点id\n */\n TreeGraph.prototype.updateChild = function (data, parentId, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n // 如果没有父节点或找不到该节点,是全量的更新,直接重置data\n if (!parentId || !self.findById(parentId)) {\n self.changeData(data, stack);\n return;\n }\n var parentModel = self.findDataById(parentId);\n var current = self.findById(data.id);\n if (!parentModel.children) {\n // 当 current 不存在时,children 为空数组\n parentModel.children = [];\n }\n // 如果不存在该节点,则添加\n if (!current) {\n parentModel.children.push(data);\n } else {\n var index = TreeGraph.indexOfChild(parentModel.children, data.id);\n if (index > -1) parentModel.children[index] = data;\n }\n var parentItem = self.findById(parentId);\n parentItem === null || parentItem === void 0 ? void 0 : parentItem.refresh();\n self.changeData(undefined, stack);\n };\n /**\n * 删除子树\n * @param {string} id 子树根节点id\n */\n TreeGraph.prototype.removeChild = function (id, stack) {\n if (stack === void 0) {\n stack = true;\n }\n var self = this;\n var node = self.findById(id);\n var parent;\n if (!node) {\n parent = self.getNodes().find(function (node) {\n var children = node.getModel().children || [];\n return !!children.find(function (child) {\n return child.id === id;\n });\n });\n } else {\n parent = node === null || node === void 0 ? void 0 : node.get('parent');\n }\n if (parent && !parent.destroyed) {\n var parentId = parent.get('id');\n var parentNode = self.findDataById(parentId);\n var siblings = parentNode && parentNode.children || [];\n var index = TreeGraph.indexOfChild(siblings, id);\n siblings.splice(index, 1);\n parent.refresh();\n }\n self.changeData(undefined, stack);\n };\n /**\n * 根据id获取对应的源数据\n * @param {string} id 元素id\n * @param {TreeGraphData | undefined} parent 从哪个节点开始寻找,为空时从根节点开始查找\n * @return {TreeGraphData} 对应源数据\n */\n TreeGraph.prototype.findDataById = function (id, parent) {\n var self = this;\n if (!parent) {\n parent = self.get('data');\n }\n if (id === parent.id) {\n return parent;\n }\n var result = null;\n // eslint-disable-next-line consistent-return\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(parent.children || [], function (child) {\n if (child.id === id) {\n result = child;\n return false;\n }\n result = self.findDataById(id, child);\n if (result) {\n return false;\n }\n });\n return result;\n };\n /**\n * 布局动画接口,用于数据更新时做节点位置更新的动画\n * @param {TreeGraphData} data 更新的数据\n * @param {function} onFrame 定义节点位置更新时如何移动\n */\n TreeGraph.prototype.layoutAnimate = function (data, onFrame) {\n var self = this;\n var animateCfg = this.get('animateCfg');\n self.emit('beforeanimate', {\n data: data\n });\n // 如果边中没有指定锚点,但是本身有锚点控制,在动画过程中保持锚点不变\n self.getEdges().forEach(function (edge) {\n var model = edge.get('model');\n if (!model.sourceAnchor) {\n model.sourceAnchor = edge.get('sourceAnchorIndex');\n }\n });\n this.get('canvas').animate(function (ratio) {\n traverseTree(data, function (child) {\n var node = self.findById(child.id);\n // 只有当存在node的时候才执行\n if (node) {\n var origin_2 = node.get('originAttrs');\n var model = node.get('model');\n if (!origin_2) {\n origin_2 = {\n x: model.x,\n y: model.y\n };\n node.set('originAttrs', origin_2);\n }\n if (onFrame) {\n var attrs = onFrame(node, ratio, origin_2, data);\n node.set('model', Object.assign(model, attrs));\n } else {\n model.x = origin_2.x + (child.x - origin_2.x) * ratio;\n model.y = origin_2.y + (child.y - origin_2.y) * ratio;\n }\n }\n return true;\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(self.get('removeList'), function (node) {\n var model = node.getModel();\n var from = node.get('originAttrs');\n var to = node.get('to');\n model.x = from.x + (to.x - from.x) * ratio;\n model.y = from.y + (to.y - from.y) * ratio;\n });\n self.refreshPositions();\n }, {\n duration: animateCfg.duration,\n easing: animateCfg.ease,\n callback: function callback() {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(self.getNodes(), function (node) {\n node.set('originAttrs', null);\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(self.get('removeList'), function (node) {\n self.removeItem(node, false);\n });\n self.set('removeList', []);\n if (animateCfg.callback) {\n animateCfg.callback();\n }\n self.emit('afteranimate', {\n data: data\n });\n },\n delay: animateCfg.delay\n });\n };\n /**\n * 立即停止布局动画\n */\n TreeGraph.prototype.stopLayoutAnimate = function () {\n this.get('canvas').stopAnimate();\n this.emit('layoutanimateend', {\n data: this.get('data')\n });\n this.layoutAnimating = false;\n };\n /**\n * 是否在布局动画\n * @return {boolean} 是否有布局动画\n */\n TreeGraph.prototype.isLayoutAnimating = function () {\n return this.layoutAnimating;\n };\n /**\n * 根据data接口的数据渲染视图\n */\n TreeGraph.prototype.render = function (clearStack) {\n if (clearStack === void 0) {\n clearStack = true;\n }\n var self = this;\n var data = self.get('data');\n if (!data || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isObject\"])(data) || !Object.keys(data).length) {\n throw new Error('data must be defined first');\n }\n self.clear();\n if (clearStack && this.get('enabledStack')) {\n // render 之前清空 redo 和 undo 栈\n this.clearStack();\n }\n self.emit('beforerender');\n self.layout(this.get('fitView'));\n self.emit('afterrender');\n };\n /**\n * 导出图数据\n * @return {object} data\n */\n TreeGraph.prototype.save = function () {\n return this.get('data');\n };\n /**\n * 设置视图初始化数据\n * @param {TreeGraphData} data 初始化数据\n */\n TreeGraph.prototype.data = function (data) {\n _super.prototype.data.call(this, data);\n this.set('originData', Object(_util_deepClone__WEBPACK_IMPORTED_MODULE_4__[\"deepClone\"])(data));\n };\n return TreeGraph;\n}(_graph__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (TreeGraph);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/tree-graph.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/arrow.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/arrow.js ***! - \********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-pc/es/index.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/index.js ***! + \**********************************************/ +/*! exports provided: G6GraphEvent, Node, Edge, Combo, Hull, registerNode, registerCombo, AbstractGraph, registerEdge, registerBehavior, AbstractLayout, AbstractEvent, BaseGlobal, Graph, TreeGraph, Util, Layout, TreeLayout, registerLayout, Global, Minimap, Grid, Bundling, Menu, Fisheye, Algorithm, ToolBar, Tooltip, TimeBar, ImageMinimap, EdgeFilterLens, SnapLine, Legend, Annotation, Arrow, Marker, Shape, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n triangle: function triangle(width, length, d) {\n if (width === void 0) {\n width = 10;\n }\n\n if (length === void 0) {\n length = 15;\n }\n\n if (d === void 0) {\n d = 0;\n }\n\n var begin = d * 2;\n var path = \"M \".concat(begin, \",0 L \").concat(begin + length, \",-\").concat(width / 2, \" L \").concat(begin + length, \",\").concat(width / 2, \" Z\");\n return path;\n },\n vee: function vee(width, length, d) {\n if (width === void 0) {\n width = 15;\n }\n\n if (length === void 0) {\n length = 20;\n }\n\n if (d === void 0) {\n d = 0;\n }\n\n var begin = d * 2;\n var path = \"M \".concat(begin, \",0 L \").concat(begin + length, \",-\").concat(width / 2, \"\\n L \").concat(begin + 2 * length / 3, \",0 L \").concat(begin + length, \",\").concat(width / 2, \" Z\");\n return path;\n },\n circle: function circle(r, d) {\n if (r === void 0) {\n r = 5;\n }\n\n if (d === void 0) {\n d = 0;\n }\n\n var begin = d * 2;\n var path = \"M \".concat(begin, \", 0\\n a \").concat(r, \",\").concat(r, \" 0 1,0 \").concat(r * 2, \",0\\n a \").concat(r, \",\").concat(r, \" 0 1,0 \").concat(-r * 2, \",0\");\n return path;\n },\n rect: function rect(width, length, d) {\n if (width === void 0) {\n width = 10;\n }\n\n if (length === void 0) {\n length = 10;\n }\n\n if (d === void 0) {\n d = 0;\n }\n\n var begin = d * 2;\n var path = \"M \".concat(begin, \",\").concat(-width / 2, \" \\n L \").concat(begin + length, \",\").concat(-width / 2, \" \\n L \").concat(begin + length, \",\").concat(width / 2, \" \\n L \").concat(begin, \",\").concat(width / 2, \" Z\");\n return path;\n },\n diamond: function diamond(width, length, d) {\n if (width === void 0) {\n width = 15;\n }\n\n if (length === void 0) {\n length = 15;\n }\n\n if (d === void 0) {\n d = 0;\n }\n\n var begin = d * 2;\n var path = \"M \".concat(begin, \",0 \\n L \").concat(begin + length / 2, \",\").concat(-width / 2, \" \\n L \").concat(begin + length, \",0 \\n L \").concat(begin + length / 2, \",\").concat(width / 2, \" Z\");\n return path;\n },\n triangleRect: function triangleRect(tWidth, tLength, rWidth, rLength, gap, d) {\n if (tWidth === void 0) {\n tWidth = 15;\n }\n\n if (tLength === void 0) {\n tLength = 15;\n }\n\n if (rWidth === void 0) {\n rWidth = 15;\n }\n\n if (rLength === void 0) {\n rLength = 3;\n }\n\n if (gap === void 0) {\n gap = 5;\n }\n\n if (d === void 0) {\n d = 0;\n }\n\n var begin = d * 2;\n var rectBegin = begin + tLength + gap;\n var path = \"M \".concat(begin, \",0 L \").concat(begin + tLength, \",-\").concat(tWidth / 2, \" L \").concat(begin + tLength, \",\").concat(tWidth / 2, \" Z\\n M \").concat(rectBegin, \", -\").concat(rWidth / 2, \"\\n L \").concat(rectBegin + rLength, \" -\").concat(rWidth / 2, \"\\n L \").concat(rectBegin + rLength, \" \").concat(rWidth / 2, \"\\n L \").concat(rectBegin, \" \").concat(rWidth / 2, \"\\n Z\");\n return path;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/arrow.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Minimap\", function() { return Minimap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Grid\", function() { return Grid; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Bundling\", function() { return Bundling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return Menu; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Fisheye\", function() { return Fisheye; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Algorithm\", function() { return Algorithm; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ToolBar\", function() { return ToolBar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Tooltip\", function() { return Tooltip; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TimeBar\", function() { return TimeBar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ImageMinimap\", function() { return ImageMinimap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EdgeFilterLens\", function() { return EdgeFilterLens; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SnapLine\", function() { return SnapLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Legend\", function() { return Legend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Annotation\", function() { return Annotation; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Arrow\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Arrow\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Marker\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Marker\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Shape\"]; });\n\n/* harmony import */ var _antv_algorithm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/algorithm */ \"./node_modules/@antv/algorithm/es/index.js\");\n/* harmony import */ var _antv_algorithm_lib_asyncIndex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/algorithm/lib/asyncIndex */ \"./node_modules/@antv/algorithm/lib/asyncIndex.js\");\n/* harmony import */ var _antv_algorithm_lib_asyncIndex__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_antv_algorithm_lib_asyncIndex__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _graph_graph__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./graph/graph */ \"./node_modules/@antv/g6-pc/es/graph/graph.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Graph\", function() { return _graph_graph__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _graph_tree_graph__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./graph/tree-graph */ \"./node_modules/@antv/g6-pc/es/graph/tree-graph.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeGraph\", function() { return _graph_tree_graph__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/g6-pc/es/layout/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Layout\", function() { return _layout__WEBPACK_IMPORTED_MODULE_6__[\"Layout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeLayout\", function() { return _layout__WEBPACK_IMPORTED_MODULE_6__[\"TreeLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerLayout\", function() { return _layout__WEBPACK_IMPORTED_MODULE_6__[\"registerLayout\"]; });\n\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./global */ \"./node_modules/@antv/g6-pc/es/global.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Global\", function() { return _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Util\", function() { return _util__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./plugin */ \"./node_modules/@antv/g6-pc/es/plugin/index.js\");\n/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./element */ \"./node_modules/@antv/g6-pc/es/element/index.js\");\n/* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./behavior */ \"./node_modules/@antv/g6-pc/es/behavior/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"G6GraphEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Node\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Edge\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Edge\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Combo\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Combo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Hull\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Hull\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerNode\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerCombo\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerCombo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGraph\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"AbstractGraph\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerEdge\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerEdge\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerBehavior\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerBehavior\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractLayout\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"AbstractLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractEvent\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"AbstractEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BaseGlobal\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"]; });\n\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/g6-pc/es/types/index.js\");\n/* empty/unused harmony star reexport *//* harmony import */ var _interface_graph__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./interface/graph */ \"./node_modules/@antv/g6-pc/es/interface/graph.js\");\n/* empty/unused harmony star reexport */\n\n\n\n\n\n\n\n\n\n\n\nvar Algorithm = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_algorithm__WEBPACK_IMPORTED_MODULE_2__), _antv_algorithm_lib_asyncIndex__WEBPACK_IMPORTED_MODULE_3__);\nvar Grid = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Grid;\nvar Minimap = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Minimap;\nvar Bundling = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Bundling;\nvar Menu = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Menu;\nvar Fisheye = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Fisheye;\nvar ToolBar = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].ToolBar;\nvar Tooltip = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Tooltip;\nvar TimeBar = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].TimeBar;\nvar ImageMinimap = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].ImageMinimap;\nvar EdgeFilterLens = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].EdgeFilterLens;\nvar SnapLine = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].SnapLine;\nvar Legend = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Legend;\nvar Annotation = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Annotation;\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].version,\n Graph: _graph_graph__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n TreeGraph: _graph_tree_graph__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n Util: _util__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n Layout: _layout__WEBPACK_IMPORTED_MODULE_6__[\"Layout\"],\n TreeLayout: _layout__WEBPACK_IMPORTED_MODULE_6__[\"TreeLayout\"],\n registerLayout: _layout__WEBPACK_IMPORTED_MODULE_6__[\"registerLayout\"],\n Global: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n registerBehavior: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerBehavior\"],\n registerCombo: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerCombo\"],\n registerEdge: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerEdge\"],\n registerNode: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"],\n Minimap: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Minimap,\n Grid: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Grid,\n Bundling: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Bundling,\n Menu: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Menu,\n ToolBar: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].ToolBar,\n Tooltip: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Tooltip,\n Legend: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Legend,\n TimeBar: TimeBar,\n SnapLine: SnapLine,\n Fisheye: Fisheye,\n ImageMinimap: ImageMinimap,\n EdgeFilterLens: EdgeFilterLens,\n Annotation: Annotation,\n Algorithm: Algorithm,\n Arrow: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Arrow\"],\n Marker: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Marker\"],\n Shape: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Shape\"]\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/combo.js": +/***/ "./node_modules/@antv/g6-pc/es/interface/graph.js": /*!********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/combo.js ***! + !*** ./node_modules/@antv/g6-pc/es/interface/graph.js ***! \********************************************************/ /*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _shapeBase__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./shapeBase */ \"./node_modules/@antv/g6-core/es/element/shapeBase.js\");\n\n\n\n\n\nvar singleCombo = {\n itemType: 'combo',\n // 单个图形的类型\n shapeType: 'single-combo',\n\n /**\n * Combo 标题文本相对图形的位置,默认为 top\n * 位置包括: top, bottom, left, right, center\n * @type {String}\n */\n labelPosition: 'top',\n\n /**\n * 标题文本相对偏移,当 labelPosition 不为 center 时有效\n * @type {Number}\n */\n refX: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.refX,\n refY: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.refY,\n options: {\n style: {\n stroke: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboStateStyles),\n collapsedSubstituteIcon: {\n show: false,\n img: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ'\n }\n },\n\n /**\n * 获取 Combo 宽高\n * @internal 返回 Combo 的大小,以 [width, height] 的方式维护\n * @param {Object} cfg Combo 的配置项\n * @return {Array} 宽高\n */\n getSize: function getSize(cfg) {\n var size = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(cfg.size || this.options.size || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.size); // size 是数组,若长度为 1,则补长度为 2\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(size) && size.length === 1) {\n size = [size[0], size[0]];\n } // size 为数字,则转换为数组\n\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(size)) {\n size = [size, size];\n }\n\n return size;\n },\n // 私有方法,不希望扩展的 Combo 复写这个方法\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg) {\n var labelPosition = labelCfg.position || this.labelPosition;\n var cfgStyle = cfg.style;\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(padding)) padding = padding[0];\n var refX = labelCfg.refX,\n refY = labelCfg.refY; // 考虑 refX 和 refY = 0 的场景,不用用 labelCfg.refX || Global.nodeLabel.refX\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(refX)) {\n refX = this.refX; // 不居中时的偏移量\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(refY)) {\n refY = this.refY; // 不居中时的偏移量\n }\n\n var size = this.getSize(cfg);\n var r = Math.max(cfgStyle.r, size[0] / 2) || size[0] / 2;\n var dis = r + padding;\n var style;\n\n switch (labelPosition) {\n case 'top':\n style = {\n x: 0,\n y: -dis - refY,\n textBaseline: 'bottom',\n textAlign: 'center'\n };\n break;\n\n case 'bottom':\n style = {\n x: 0,\n y: dis + refY,\n textBaseline: 'bottom',\n textAlign: 'center'\n };\n break;\n\n case 'left':\n style = {\n x: -dis + refX,\n y: 0,\n textAlign: 'left'\n };\n break;\n\n case 'center':\n style = {\n x: 0,\n y: 0,\n text: cfg.label,\n textAlign: 'center'\n };\n break;\n\n default:\n style = {\n x: dis + refX,\n y: 0,\n textAlign: 'right'\n };\n break;\n }\n\n style.text = cfg.label;\n return style;\n },\n drawShape: function drawShape(cfg, group) {\n var shapeType = this.shapeType; // || this.type,都已经加了 shapeType\n\n var style = this.getShapeStyle(cfg);\n var shape = group.addShape(shapeType, {\n attrs: style,\n draggable: true,\n name: 'combo-shape'\n });\n return shape;\n },\n updateCollapsedIcon: function updateCollapsedIcon(cfg, item, keyShapeStyle) {\n var collapsed = cfg.collapsed,\n _a = cfg.collapsedSubstituteIcon,\n collapsedSubstituteIcon = _a === void 0 ? {} : _a;\n var subsitututeIconConfig = Object.assign({}, this.options.collapsedSubstituteIcon, collapsedSubstituteIcon);\n var show = subsitututeIconConfig.show,\n img = subsitututeIconConfig.img,\n width = subsitututeIconConfig.width,\n height = subsitututeIconConfig.height;\n var group = item.getContainer();\n var collapsedIconShape = group.find(function (ele) {\n return ele.get('name') === 'combo-collapsed-substitute-icon';\n });\n var iconShapeExist = collapsedIconShape && !collapsedIconShape.destroyed;\n\n if (collapsed && show) {\n if (iconShapeExist) {\n collapsedIconShape.show();\n } else {\n var sizeAttr = {\n width: width || keyShapeStyle.r * 2 || keyShapeStyle.width,\n height: height || keyShapeStyle.r * 2 || keyShapeStyle.height\n };\n group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n img: img,\n x: -sizeAttr.width / 2,\n y: -sizeAttr.height / 2\n }, sizeAttr),\n name: 'combo-collapsed-substitute-icon',\n draggable: true\n });\n }\n } else if (iconShapeExist) {\n collapsedIconShape.hide();\n }\n },\n updateShape: function updateShape(cfg, item, keyShapeStyle) {\n var _this = this;\n\n var keyShape = item.get('keyShape');\n var itemAnimate = item.get('animate');\n var animate = itemAnimate && (cfg.animate === undefined ? this.options.animate : cfg.animate);\n\n if (animate && keyShape.animate) {\n // 更新到展开状态,先将 collapsedIcon 隐藏。否则在动画完成后再出现 collapsedIcon\n if (!cfg.collapsed) {\n this.updateCollapsedIcon(cfg, item, keyShapeStyle);\n }\n\n keyShape.animate(keyShapeStyle, {\n duration: 200,\n easing: 'easeLinear',\n callback: function callback() {\n if (cfg.collapsed) {\n _this.updateCollapsedIcon(cfg, item, keyShapeStyle);\n }\n }\n });\n } else {\n keyShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, keyShapeStyle));\n this.updateCollapsedIcon(cfg, item, keyShapeStyle);\n }\n\n this.updateLabel(cfg, item); // special for some types of nodes\n }\n};\n\nvar singleComboDef = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _shapeBase__WEBPACK_IMPORTED_MODULE_4__[\"shapeBase\"]), singleCombo);\n\n_shape__WEBPACK_IMPORTED_MODULE_3__[\"default\"].registerCombo('single-combo', singleComboDef);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/combo.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/interface/graph.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/combos/circle.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/combos/circle.js ***! - \****************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/layout/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/layout/index.js ***! + \*****************************************************/ +/*! exports provided: TreeLayout, Layout, registerLayout */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n // 圆形 Combo\n\n_shape__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerCombo('circle', {\n // 自定义节点时的配置\n options: {\n size: [_global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.size[0], _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.size[0]],\n padding: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.padding[0],\n animate: true,\n style: {\n stroke: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].comboLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].comboLabel.style.fontSize\n },\n refX: 0,\n refY: 0\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].comboStateStyles),\n collapsedSubstituteIcon: {\n show: false,\n img: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ'\n }\n },\n shapeType: 'circle',\n // 文本位置\n labelPosition: 'top',\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n delete style.height;\n delete style.width;\n var keyShape = group.addShape('circle', {\n attrs: style,\n className: 'circle-combo',\n name: 'circle-combo',\n draggable: true\n });\n return keyShape;\n },\n\n /**\n * 获取 Combo 的样式,供基于该 Combo 自定义时使用\n * @param {Object} cfg Combo 数据模型\n * @return {Object} Combo 的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = this.options.style;\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isArray\"])(padding)) padding = padding[0];\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, defaultStyle, strokeStyle, cfg.style);\n var fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize;\n var r;\n\n if (fixSize) {\n r = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(fixSize) ? fixSize : fixSize[0];\n } else {\n var size = this.getSize(cfg);\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(style.r) || isNaN(style.r)) r = size[0] / 2 || _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].defaultCombo.style.r;else r = Math.max(style.r, size[0] / 2) || size[0] / 2;\n }\n\n style.r = r + padding;\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0\n }, style);\n\n if (cfg.style) cfg.style.r = r;else {\n cfg.style = {\n r: r\n };\n }\n return styles;\n },\n update: function update(cfg, item) {\n var size = this.getSize(cfg);\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isArray\"])(padding)) padding = padding[0];\n var cfgStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(cfg.style);\n var fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize;\n var r;\n\n if (fixSize) {\n r = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"])(fixSize) ? fixSize : fixSize[0];\n } else {\n r = Math.max(cfgStyle.r, size[0] / 2) || size[0] / 2;\n }\n\n cfgStyle.r = r + padding;\n var itemCacheSize = item.get('sizeCache');\n\n if (itemCacheSize) {\n itemCacheSize.r = cfgStyle.r;\n } // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n\n\n var strokeStyle = {\n stroke: cfg.color\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, keyShape.attr(), strokeStyle, cfgStyle);\n if (cfg.style) cfg.style.r = r;else {\n cfg.style = {\n r: r\n };\n }\n this.updateShape(cfg, item, style, true);\n }\n}, 'single-combo');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/combos/circle.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerLayout\", function() { return registerLayout; });\n/* harmony import */ var _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/layout/lib */ \"./node_modules/@antv/layout/lib/index.js\");\n/* harmony import */ var _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Layout\", function() { return _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"Layouts\"]; });\n\n/* harmony import */ var _tree_layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tree-layout */ \"./node_modules/@antv/g6-pc/es/layout/tree-layout.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeLayout\", function() { return _tree_layout__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n\n\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('grid', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"GridLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('random', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"RandomLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('force', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ForceLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('circular', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"CircularLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('dagre', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"DagreLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('dagreCompound', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"DagreCompoundLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('radial', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"RadialLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('concentric', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ConcentricLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('mds', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"MDSLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('fruchterman', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"FruchtermanLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('fruchterman-gpu', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"FruchtermanGPULayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('gForce', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"GForceLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('force2', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"Force2Layout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('gForce-gpu', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"GForceGPULayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('comboForce', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ComboForceLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('comboCombined', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ComboCombinedLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('forceAtlas2', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ForceAtlas2Layout\"]);\nvar registerLayout = function registerLayout(name, layoutOverride) {\n layoutOverride.isCustomLayout = true;\n _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"Layouts\"][name] = Object(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])(name, layoutOverride);\n};\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/combos/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/combos/index.js ***! - \***************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/layout/tree-layout.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/layout/tree-layout.js ***! + \***********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _circle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./circle */ \"./node_modules/@antv/g6-core/es/element/combos/circle.js\");\n/* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ \"./node_modules/@antv/g6-core/es/element/combos/rect.js\");\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/combos/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_hierarchy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/hierarchy */ \"./node_modules/@antv/hierarchy/build/hierarchy.js\");\n/* harmony import */ var _antv_hierarchy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_antv_hierarchy__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n\n\nvar radialLayout = _util__WEBPACK_IMPORTED_MODULE_1__[\"default\"].radialLayout;\nvar TreeLayout = /** @class */function () {\n function TreeLayout(cfg) {\n this.type = cfg.type;\n this.radial = cfg.radial;\n this.config = cfg;\n }\n TreeLayout.prototype.init = function (data) {\n var _this = this;\n this.data = data;\n if (this.radial) {\n this.layoutMethod = function (data) {\n var layoutData = _antv_hierarchy__WEBPACK_IMPORTED_MODULE_0___default.a[_this.type](data, _this.config);\n radialLayout(layoutData);\n return layoutData;\n };\n return;\n }\n this.layoutMethod = function (data) {\n return _antv_hierarchy__WEBPACK_IMPORTED_MODULE_0___default.a[_this.type](data, _this.config);\n };\n };\n TreeLayout.prototype.execute = function () {\n return this.layoutMethod(this.data, this.config);\n };\n TreeLayout.prototype.layout = function (data) {\n this.init(data);\n return this.execute();\n };\n return TreeLayout;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (TreeLayout);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/tree-layout.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/combos/rect.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/combos/rect.js ***! - \**************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/layout/worker/layout.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/layout/worker/layout.js ***! + \*************************************************************/ +/*! exports provided: LayoutWorker */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n\n\n\n\n_shape__WEBPACK_IMPORTED_MODULE_3__[\"default\"].registerCombo('rect', {\n // 自定义 Combo 时的配置\n options: {\n size: [40, 5],\n padding: [25, 20, 15, 20],\n animate: true,\n style: {\n radius: 0,\n stroke: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n // 连接点,默认为左右\n anchorPoints: [[0, 0.5], [1, 0.5]],\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].comboStateStyles),\n collapsedSubstituteIcon: {\n show: false,\n img: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*RsnHRqLfJn4AAAAAAAAAAAAAARQnAQ'\n }\n },\n shapeType: 'rect',\n labelPosition: 'top',\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('rect', {\n attrs: style,\n className: 'rect-combo',\n name: 'rect-combo',\n draggable: true\n });\n return keyShape;\n },\n // 私有方法,不希望扩展的 Combo 复写这个方法\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg) {\n var labelPosition = labelCfg.position || this.labelPosition;\n var cfgStyle = cfg.style;\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var refX = labelCfg.refX,\n refY = labelCfg.refY; // 考虑 refX 和 refY = 0 的场景,不用用 labelCfg.refX || Global.nodeLabel.refY\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(refX)) {\n refX = this.refX; // 不居中时的偏移量\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(refY)) {\n refY = this.refY; // 不居中时的偏移量\n }\n\n var leftDis = cfgStyle.width / 2 + padding[3];\n var topDis = cfgStyle.height / 2 + padding[0];\n var style;\n\n switch (labelPosition) {\n case 'top':\n style = {\n x: 0 - leftDis + refX,\n y: 0 - topDis + refY,\n textBaseline: 'top',\n textAlign: 'left'\n };\n break;\n\n case 'bottom':\n style = {\n x: 0,\n y: topDis + refY,\n textBaseline: 'bottom',\n textAlign: 'center'\n };\n break;\n\n case 'left':\n style = {\n x: 0 - leftDis + refY,\n y: 0,\n textAlign: 'left'\n };\n break;\n\n case 'center':\n style = {\n x: 0,\n y: 0,\n text: cfg.label,\n textAlign: 'center'\n };\n break;\n\n default:\n style = {\n x: leftDis + refX,\n y: 0,\n textAlign: 'right'\n };\n break;\n }\n\n style.text = cfg.label;\n return style;\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = this.options.style;\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle, cfg.style);\n var size = this.getSize(cfg);\n var width;\n var height;\n var fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize;\n\n if (fixSize) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(fixSize)) {\n width = fixSize;\n height = fixSize;\n } else {\n width = fixSize[0];\n height = fixSize[1];\n }\n } else {\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(style.width) || isNaN(style.width)) width = size[0] || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.width;else width = Math.max(style.width, size[0]) || size[0];\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(style.height) || isNaN(style.height)) height = size[1] || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.style.height;else height = Math.max(style.height, size[1]) || size[1];\n }\n\n var x = -width / 2 - padding[3];\n var y = -height / 2 - padding[0];\n style.width = width + padding[1] + padding[3];\n style.height = height + padding[0] + padding[2];\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: x,\n y: y\n }, style);\n\n if (!cfg.style) {\n cfg.style = {\n width: width,\n height: height\n };\n } else {\n cfg.style.width = width;\n cfg.style.height = height;\n }\n\n return styles;\n },\n update: function update(cfg, item) {\n var size = this.getSize(cfg);\n var padding = cfg.padding || this.options.padding;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var cfgStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(cfg.style);\n var width, height;\n var fixSize = cfg.collapsed && cfg.fixCollapseSize ? cfg.fixCollapseSize : cfg.fixSize;\n\n if (fixSize) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(fixSize)) {\n width = fixSize;\n height = fixSize;\n } else {\n width = fixSize[0];\n height = fixSize[1];\n }\n } else {\n width = Math.max(cfgStyle.width, size[0]) || size[0];\n height = Math.max(cfgStyle.height, size[1]) || size[1];\n }\n\n cfgStyle.width = width + padding[1] + padding[3];\n cfgStyle.height = height + padding[0] + padding[2];\n var itemCacheSize = item.get('sizeCache');\n\n if (itemCacheSize) {\n itemCacheSize.width = cfgStyle.width;\n itemCacheSize.height = cfgStyle.height;\n }\n\n cfgStyle.x = -width / 2 - padding[3];\n cfgStyle.y = -height / 2 - padding[0]; // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n\n var strokeStyle = {\n stroke: cfg.color\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, keyShape.attr(), strokeStyle, cfgStyle);\n\n if (cfg.style) {\n cfg.style.width = width;\n cfg.style.height = height;\n } else {\n cfg.style = {\n width: width,\n height: height\n };\n }\n\n this.updateShape(cfg, item, style, false);\n }\n}, 'single-combo');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/combos/rect.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LayoutWorker\", function() { return LayoutWorker; });\n/* harmony import */ var _work__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./work */ \"./node_modules/@antv/g6-pc/es/layout/worker/work.js\");\n\nvar LayoutWorker = function LayoutWorker(workerScriptURL) {\n if (workerScriptURL === void 0) {\n workerScriptURL = 'https://unpkg.com/@antv/layout@0.3.23/dist/layout.min.js';\n }\n function workerCode() {\n var LAYOUT_MESSAGE = {\n // run layout\n RUN: 'LAYOUT_RUN',\n // layout ended with success\n END: 'LAYOUT_END',\n // layout error\n ERROR: 'LAYOUT_ERROR',\n // layout tick, used in force directed layout\n TICK: 'LAYOUT_TICK',\n GPURUN: 'GPU_LAYOUT_RUN',\n GPUEND: 'GPU_LAYOUT_END'\n };\n // @ts-ignore\n layout.registerLayout('grid', layout.GridLayout);\n // @ts-ignore\n layout.registerLayout('random', layout.RandomLayout);\n // @ts-ignore\n layout.registerLayout('force', layout.ForceLayout);\n // @ts-ignore\n layout.registerLayout('force2', layout.Force2Layout);\n // @ts-ignore\n layout.registerLayout('circular', layout.CircularLayout);\n // @ts-ignore\n layout.registerLayout('dagre', layout.DagreLayout);\n // @ts-ignore\n layout.registerLayout('dagreCompound', layout.DagreCompoundLayout);\n // @ts-ignore\n layout.registerLayout('radial', layout.RadialLayout);\n // @ts-ignore\n layout.registerLayout('concentric', layout.ConcentricLayout);\n // @ts-ignore\n layout.registerLayout('mds', layout.MDSLayout);\n // @ts-ignore\n layout.registerLayout('fruchterman', layout.FruchtermanLayout);\n // @ts-ignore\n layout.registerLayout('fruchterman-gpu', layout.FruchtermanGPULayout);\n // @ts-ignore\n layout.registerLayout('gForce', layout.GForceLayout);\n // @ts-ignore\n layout.registerLayout('gForce-gpu', layout.GForceGPULayout);\n // @ts-ignore\n layout.registerLayout('comboForce', layout.ComboForceLayout);\n // @ts-ignore\n layout.registerLayout('comboCombined', layout.ComboCombinedLayout);\n // @ts-ignore\n layout.registerLayout('forceAtlas2', layout.ForceAtlas2Layout);\n function isLayoutMessage(event) {\n var type = event.data.type;\n return type === LAYOUT_MESSAGE.RUN || type === LAYOUT_MESSAGE.GPURUN;\n }\n function handleLayoutMessage(event) {\n var _this = this;\n var type = event.data.type;\n switch (type) {\n case LAYOUT_MESSAGE.RUN:\n {\n var _a = event.data,\n nodes_1 = _a.nodes,\n edges = _a.edges,\n _b = _a.layoutCfg,\n layoutCfg = _b === void 0 ? {} : _b;\n var layoutType = layoutCfg.type;\n // @ts-ignore\n var LayoutClass = layout.getLayoutByName(layoutType);\n if (!LayoutClass) {\n this.postMessage({\n type: LAYOUT_MESSAGE.ERROR,\n message: \"layout \".concat(layoutType, \" not found\")\n });\n break;\n }\n // eslint-disable-next-line prefer-const\n var layoutMethod_1;\n layoutCfg.onLayoutEnd = function () {\n _this.postMessage({\n type: LAYOUT_MESSAGE.END,\n nodes: nodes_1\n });\n layoutMethod_1 === null || layoutMethod_1 === void 0 ? void 0 : layoutMethod_1.destroy();\n };\n layoutMethod_1 = new LayoutClass(layoutCfg);\n layoutMethod_1.init({\n nodes: nodes_1,\n edges: edges\n });\n layoutMethod_1.execute();\n break;\n }\n case LAYOUT_MESSAGE.GPURUN:\n {\n var _c = event.data,\n nodes = _c.nodes,\n edges = _c.edges,\n _d = _c.layoutCfg,\n layoutCfg = _d === void 0 ? {} : _d,\n canvas = _c.canvas;\n var layoutType = layoutCfg.type;\n // @ts-ignore\n var LayoutClass = layout.getLayoutByName(layoutType);\n if (!LayoutClass) {\n this.postMessage({\n type: LAYOUT_MESSAGE.ERROR,\n message: \"layout \".concat(layoutType, \" not found\")\n });\n break;\n }\n if (layoutType.split('-')[1] !== 'gpu') {\n this.postMessage({\n type: LAYOUT_MESSAGE.ERROR,\n message: \"layout \".concat(layoutType, \" does not support GPU\")\n });\n break;\n }\n var layoutMethod = new LayoutClass(layoutCfg);\n layoutMethod.init({\n nodes: nodes,\n edges: edges\n });\n layoutMethod.executeWithWorker(canvas, this);\n break;\n }\n default:\n break;\n }\n }\n onmessage = function onmessage(event) {\n if (isLayoutMessage(event)) {\n handleLayoutMessage(event);\n }\n };\n }\n var layoutWorker = new _work__WEBPACK_IMPORTED_MODULE_0__[\"default\"](workerCode, workerScriptURL);\n return layoutWorker;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/worker/layout.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/edge.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/edge.js ***! - \*******************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/layout/worker/layoutConst.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/layout/worker/layoutConst.js ***! + \******************************************************************/ +/*! exports provided: LAYOUT_MESSAGE */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/path */ \"./node_modules/@antv/g6-core/es/util/path.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _shapeBase__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./shapeBase */ \"./node_modules/@antv/g6-core/es/element/shapeBase.js\");\n/**\n * @fileOverview 自定义边\n * @description 自定义边中有大量逻辑同自定义节点重复,虽然可以提取成为 mixin ,但是考虑到代码的可读性,还是单独实现。\n */\n\n\n\n\n\n\n\n\nvar CLS_SHAPE = 'edge-shape'; // start,end 倒置,center 不变\n\nfunction revertAlign(labelPosition) {\n var textAlign = labelPosition;\n\n if (labelPosition === 'start') {\n textAlign = 'end';\n } else if (labelPosition === 'end') {\n textAlign = 'start';\n }\n\n return textAlign;\n}\n\nvar singleEdge = {\n itemType: 'edge',\n\n /**\n * 文本的位置\n * @type {String}\n */\n labelPosition: 'center',\n\n /**\n * 文本的 x 偏移\n * @type {Number}\n */\n refX: 0,\n\n /**\n * 文本的 y 偏移\n * @type {Number}\n */\n refY: 0,\n\n /**\n * 文本是否跟着线自动旋转,默认 false\n * @type {Boolean}\n */\n labelAutoRotate: false,\n // 自定义边时的配置\n options: {\n size: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.size,\n style: {\n x: 0,\n y: 0,\n stroke: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.style.stroke,\n lineAppendWidth: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.style.lineAppendWidth\n },\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].edgeLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].edgeLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].windowFontFamily\n }\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].edgeStateStyles)\n },\n\n /**\n * 获取边的 path\n * @internal 供扩展的边覆盖\n * @param {Array} points 构成边的点的集合\n * @return {Array} 构成 path 的数组\n */\n getPath: function getPath(points) {\n var path = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points, function (point, index) {\n if (index === 0) {\n path.push(['M', point.x, point.y]);\n } else {\n path.push(['L', point.x, point.y]);\n }\n });\n return path;\n },\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = this.options.style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle, cfg.style);\n var size = cfg.size || _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.size;\n cfg = this.getPathPoints(cfg);\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var controlPoints = this.getControlPoints(cfg);\n var points = [startPoint]; // 添加起始点\n // 添加控制点\n\n if (controlPoints) {\n points = points.concat(controlPoints);\n } // 添加结束点\n\n\n points.push(endPoint);\n var path = this.getPath(points);\n var styles = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.style, {\n stroke: _global__WEBPACK_IMPORTED_MODULE_5__[\"default\"].defaultEdge.color,\n lineWidth: size,\n path: path\n }, style);\n return styles;\n },\n updateShapeStyle: function updateShapeStyle(cfg, item, updateType) {\n var _a;\n\n var group = item.getContainer(); // const strokeStyle: ShapeStyle = {\n // stroke: cfg.color,\n // };\n\n var shape = ((_a = item.getKeyShape) === null || _a === void 0 ? void 0 : _a.call(item)) || group['shapeMap']['edge-shape']; // group.find((element) => element.get('className') === 'edge-shape');\n\n var size = cfg.size;\n cfg = this.getPathPoints(cfg);\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var controlPoints = this.getControlPoints(cfg); // || cfg.controlPoints;\n\n var points = [startPoint]; // 添加起始点\n // 添加控制点\n\n if (controlPoints) {\n points = points.concat(controlPoints);\n } // 添加结束点\n\n\n points.push(endPoint);\n var currentAttr = shape.attr(); // const previousStyle = mix({}, strokeStyle, currentAttr, cfg.style);\n\n var previousStyle = cfg.style || {};\n\n if (previousStyle.stroke === undefined) {\n previousStyle.stroke = cfg.color;\n }\n\n var source = cfg.sourceNode;\n var target = cfg.targetNode;\n var routeCfg = {\n radius: previousStyle.radius\n };\n\n if (!controlPoints) {\n routeCfg = {\n source: source,\n target: target,\n offset: previousStyle.offset,\n radius: previousStyle.radius\n };\n }\n\n var path = this.getPath(points, routeCfg);\n var style = {};\n\n if (updateType === 'move') {\n style = {\n path: path\n };\n } else {\n if (currentAttr.endArrow && previousStyle.endArrow === false) {\n cfg.style.endArrow = {\n path: ''\n };\n }\n\n if (currentAttr.startArrow && previousStyle.startArrow === false) {\n cfg.style.startArrow = {\n path: ''\n };\n }\n\n style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, cfg.style);\n if (style.lineWidth === undefined) style.lineWdith = (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(size) ? size : size === null || size === void 0 ? void 0 : size[0]) || currentAttr.lineWidth;\n if (style.path === undefined) style.path = path;\n if (style.stroke === undefined) style.stroke = currentAttr.stroke || cfg.color;\n }\n\n if (shape) {\n shape.attr(style);\n }\n },\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg, group) {\n var labelPosition = labelCfg.position || this.labelPosition; // 文本的位置用户可以传入\n\n var style = {};\n var pathShape = group === null || group === void 0 ? void 0 : group['shapeMap'][CLS_SHAPE]; // group?.find((element) => element.get('className') === CLS_SHAPE);\n // 不对 pathShape 进行判空,如果线不存在,说明有问题了\n\n var pointPercent;\n\n if (labelPosition === 'start') {\n pointPercent = 0;\n } else if (labelPosition === 'end') {\n pointPercent = 1;\n } else {\n pointPercent = 0.5;\n } // 偏移量\n\n\n var offsetX = labelCfg.refX || this.refX;\n var offsetY = labelCfg.refY || this.refY; // 如果两个节点重叠,线就变成了一个点,这时候label的位置,就是这个点 + 绝对偏移\n\n if (cfg.startPoint.x === cfg.endPoint.x && cfg.startPoint.y === cfg.endPoint.y) {\n style.x = cfg.startPoint.x + offsetX;\n style.y = cfg.startPoint.y + offsetY;\n style.text = cfg.label;\n return style;\n }\n\n var autoRotate;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(labelCfg.autoRotate)) autoRotate = this.labelAutoRotate;else autoRotate = labelCfg.autoRotate;\n var offsetStyle = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_2__[\"getLabelPosition\"])(pathShape, pointPercent, offsetX, offsetY, autoRotate);\n style.x = offsetStyle.x;\n style.y = offsetStyle.y;\n style.rotate = offsetStyle.rotate;\n style.textAlign = this._getTextAlign(labelPosition, offsetStyle.angle);\n style.text = cfg.label;\n return style;\n },\n getLabelBgStyleByPosition: function getLabelBgStyleByPosition(label, labelCfg) {\n if (!label) {\n return {};\n }\n\n var bbox = label.getBBox();\n var backgroundStyle = labelCfg.style && labelCfg.style.background;\n\n if (!backgroundStyle) {\n return {};\n }\n\n var padding = backgroundStyle.padding;\n var backgroundWidth = bbox.width + padding[1] + padding[3];\n var backgroundHeight = bbox.height + padding[0] + padding[2];\n\n var style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, backgroundStyle), {\n width: backgroundWidth,\n height: backgroundHeight,\n x: bbox.minX - padding[3],\n y: bbox.minY - padding[0],\n matrix: [1, 0, 0, 0, 1, 0, 0, 0, 1]\n });\n\n var autoRotate;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(labelCfg.autoRotate)) autoRotate = this.labelAutoRotate;else autoRotate = labelCfg.autoRotate;\n\n if (autoRotate) {\n style.matrix = label.attr('matrix') || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n return style;\n },\n // 获取文本对齐方式\n _getTextAlign: function _getTextAlign(labelPosition, angle) {\n var textAlign = 'center';\n\n if (!angle) {\n return labelPosition;\n }\n\n angle = angle % (Math.PI * 2); // 取模\n\n if (labelPosition !== 'center') {\n if (angle >= 0 && angle <= Math.PI / 2 || angle >= 3 / 2 * Math.PI && angle < 2 * Math.PI) {\n textAlign = labelPosition;\n } else {\n textAlign = revertAlign(labelPosition);\n }\n }\n\n return textAlign;\n },\n\n /**\n * @internal 获取边的控制点\n * @param {Object} cfg 边的配置项\n * @return {Array} 控制点的数组\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n\n /**\n * @internal 处理需要重计算点和边的情况\n * @param {Object} cfg 边的配置项\n * @return {Object} 边的配置项\n */\n getPathPoints: function getPathPoints(cfg) {\n return cfg;\n },\n\n /**\n * 绘制边\n * @override\n * @param {Object} cfg 边的配置项\n * @param {G.Group} group 边的容器\n * @return {IShape} 图形\n */\n drawShape: function drawShape(cfg, group) {\n var shapeStyle = this.getShapeStyle(cfg);\n var shape = group.addShape('path', {\n className: CLS_SHAPE,\n name: CLS_SHAPE,\n attrs: shapeStyle\n });\n group['shapeMap'][CLS_SHAPE] = shape;\n return shape;\n },\n drawLabel: function drawLabel(cfg, group) {\n var defaultLabelCfg = this.options.labelCfg;\n var labelCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, defaultLabelCfg, cfg.labelCfg);\n var labelStyle = this.getLabelStyle(cfg, labelCfg, group);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate;\n var label = group.addShape('text', {\n attrs: labelStyle,\n name: 'text-shape',\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n\n if (!isNaN(rotate) && rotate !== '') {\n label.rotateAtStart(rotate);\n }\n\n if (labelStyle.background) {\n var rect = this.drawLabelBg(cfg, group, label, labelStyle, rotate);\n var labelBgClassname = this.itemType + _shapeBase__WEBPACK_IMPORTED_MODULE_7__[\"CLS_LABEL_BG_SUFFIX\"];\n rect.set('classname', labelBgClassname);\n group['shapeMap'][labelBgClassname] = rect;\n label.toFront();\n }\n\n return label;\n },\n drawLabelBg: function drawLabelBg(cfg, group, label, labelStyle, rotate) {\n var defaultLabelCfg = this.options.labelCfg;\n var labelCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, defaultLabelCfg, cfg.labelCfg);\n var style = this.getLabelBgStyleByPosition(label, labelCfg);\n var rect = group.addShape('rect', {\n name: 'text-bg-shape',\n attrs: style,\n labelRelated: true\n });\n group['shapeMap']['text-bg-shape'] = rect;\n return rect;\n }\n};\n\nvar singleEdgeDef = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _shapeBase__WEBPACK_IMPORTED_MODULE_7__[\"shapeBase\"]), singleEdge);\n\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('single-edge', singleEdgeDef); // 直线, 不支持控制点\n\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('line', {\n // 控制点不生效\n getControlPoints: function getControlPoints() {\n return undefined;\n }\n}, 'single-edge'); // 直线\n\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('spline', {\n getPath: function getPath(points) {\n var path = Object(_util_path__WEBPACK_IMPORTED_MODULE_4__[\"getSpline\"])(points);\n return path;\n }\n}, 'single-edge');\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('arc', {\n curveOffset: 20,\n clockwise: 1,\n getControlPoints: function getControlPoints(cfg) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var midPoint = {\n x: (startPoint.x + endPoint.x) / 2,\n y: (startPoint.y + endPoint.y) / 2\n };\n var center;\n var arcPoint; // 根据给定点计算圆弧\n\n if (cfg.controlPoints !== undefined) {\n arcPoint = cfg.controlPoints[0];\n center = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"getCircleCenterByPoints\"])(startPoint, arcPoint, endPoint); // 根据控制点和直线关系决定 clockwise值\n\n if (startPoint.x <= endPoint.x && startPoint.y > endPoint.y) {\n this.clockwise = center.x > arcPoint.x ? 0 : 1;\n } else if (startPoint.x <= endPoint.x && startPoint.y < endPoint.y) {\n this.clockwise = center.x > arcPoint.x ? 1 : 0;\n } else if (startPoint.x > endPoint.x && startPoint.y <= endPoint.y) {\n this.clockwise = center.y < arcPoint.y ? 0 : 1;\n } else {\n this.clockwise = center.y < arcPoint.y ? 1 : 0;\n } // 若给定点和两端点共线,无法生成圆弧,绘制直线\n\n\n if ((arcPoint.x - startPoint.x) / (arcPoint.y - startPoint.y) === (endPoint.x - startPoint.x) / (endPoint.y - startPoint.y)) {\n return [];\n }\n } else {\n // 根据直线连线中点的的偏移计算圆弧\n // 若用户给定偏移量则根据其计算,否则按照默认偏移值计算\n if (cfg.curveOffset === undefined) {\n cfg.curveOffset = this.curveOffset;\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(cfg.curveOffset)) {\n cfg.curveOffset = cfg.curveOffset[0];\n }\n\n if (cfg.curveOffset < 0) {\n this.clockwise = 0;\n } else {\n this.clockwise = 1;\n }\n\n var vec = {\n x: endPoint.x - startPoint.x,\n y: endPoint.y - startPoint.y\n };\n var edgeAngle = Math.atan2(vec.y, vec.x);\n arcPoint = {\n x: cfg.curveOffset * Math.cos(-Math.PI / 2 + edgeAngle) + midPoint.x,\n y: cfg.curveOffset * Math.sin(-Math.PI / 2 + edgeAngle) + midPoint.y\n };\n center = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"getCircleCenterByPoints\"])(startPoint, arcPoint, endPoint);\n }\n\n var radius = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"distance\"])(startPoint, center);\n var controlPoints = [{\n x: radius,\n y: radius\n }];\n return controlPoints;\n },\n getPath: function getPath(points) {\n var path = [];\n path.push(['M', points[0].x, points[0].y]); // 控制点与端点共线\n\n if (points.length === 2) {\n path.push(['L', points[1].x, points[1].y]);\n } else {\n path.push(['A', points[1].x, points[1].y, 0, 0, this.clockwise, points[2].x, points[2].y]);\n }\n\n return path;\n }\n}, 'single-edge');\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('quadratic', {\n curvePosition: 0.5,\n curveOffset: -20,\n getControlPoints: function getControlPoints(cfg) {\n var controlPoints = cfg.controlPoints; // 指定controlPoints\n\n if (!controlPoints || !controlPoints.length) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset;\n if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(this.curveOffset)) cfg.curveOffset = cfg.curveOffset[0];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(this.curvePosition)) cfg.curvePosition = cfg.curveOffset[0];\n var innerPoint = Object(_util_path__WEBPACK_IMPORTED_MODULE_4__[\"getControlPoint\"])(startPoint, endPoint, cfg.curvePosition, cfg.curveOffset);\n controlPoints = [innerPoint];\n }\n\n return controlPoints;\n },\n getPath: function getPath(points) {\n var path = [];\n path.push(['M', points[0].x, points[0].y]);\n path.push(['Q', points[1].x, points[1].y, points[2].x, points[2].y]);\n return path;\n }\n}, 'single-edge');\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('cubic', {\n curvePosition: [1 / 2, 1 / 2],\n curveOffset: [-20, 20],\n getControlPoints: function getControlPoints(cfg) {\n var controlPoints = cfg.controlPoints; // 指定 controlPoints\n\n if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset;\n if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition];\n\n if (!controlPoints || !controlPoints.length || controlPoints.length < 2) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var innerPoint1 = Object(_util_path__WEBPACK_IMPORTED_MODULE_4__[\"getControlPoint\"])(startPoint, endPoint, cfg.curvePosition[0], cfg.curveOffset[0]);\n var innerPoint2 = Object(_util_path__WEBPACK_IMPORTED_MODULE_4__[\"getControlPoint\"])(startPoint, endPoint, cfg.curvePosition[1], cfg.curveOffset[1]);\n controlPoints = [innerPoint1, innerPoint2];\n }\n\n return controlPoints;\n },\n getPath: function getPath(points) {\n var path = [];\n path.push(['M', points[0].x, points[0].y]);\n path.push(['C', points[1].x, points[1].y, points[2].x, points[2].y, points[3].x, points[3].y]);\n return path;\n }\n}, 'single-edge'); // 垂直方向的三阶贝塞尔曲线,不再考虑用户外部传入的控制点\n\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('cubic-vertical', {\n curvePosition: [1 / 2, 1 / 2],\n minCurveOffset: [0, 0],\n curveOffset: undefined,\n getControlPoints: function getControlPoints(cfg) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition;\n if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset;\n if (cfg.minCurveOffset === undefined) cfg.minCurveOffset = this.minCurveOffset;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.minCurveOffset)) cfg.minCurveOffset = [cfg.minCurveOffset, -cfg.minCurveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition];\n var yDist = endPoint.y - startPoint.y;\n var curveOffset = [0, 0];\n\n if (cfg.curveOffset) {\n curveOffset = cfg.curveOffset;\n } else if (Math.abs(yDist) < Math.abs(cfg.minCurveOffset[0])) {\n curveOffset = cfg.minCurveOffset;\n }\n\n var innerPoint1 = {\n x: startPoint.x,\n y: startPoint.y + yDist * this.curvePosition[0] + curveOffset[0]\n };\n var innerPoint2 = {\n x: endPoint.x,\n y: endPoint.y - yDist * this.curvePosition[1] + curveOffset[1]\n };\n return [innerPoint1, innerPoint2];\n }\n}, 'cubic'); // 水平方向的三阶贝塞尔曲线,不再考虑用户外部传入的控制点\n\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('cubic-horizontal', {\n curvePosition: [1 / 2, 1 / 2],\n minCurveOffset: [0, 0],\n curveOffset: undefined,\n getControlPoints: function getControlPoints(cfg) {\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n if (cfg.curvePosition === undefined) cfg.curvePosition = this.curvePosition;\n if (cfg.curveOffset === undefined) cfg.curveOffset = this.curveOffset;\n if (cfg.minCurveOffset === undefined) cfg.minCurveOffset = this.minCurveOffset;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curveOffset)) cfg.curveOffset = [cfg.curveOffset, -cfg.curveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.minCurveOffset)) cfg.minCurveOffset = [cfg.minCurveOffset, -cfg.minCurveOffset];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.curvePosition)) cfg.curvePosition = [cfg.curvePosition, 1 - cfg.curvePosition];\n var xDist = endPoint.x - startPoint.x;\n var curveOffset = [0, 0];\n\n if (cfg.curveOffset) {\n curveOffset = cfg.curveOffset;\n } else if (Math.abs(xDist) < Math.abs(cfg.minCurveOffset[0])) {\n curveOffset = cfg.minCurveOffset;\n }\n\n var innerPoint1 = {\n x: startPoint.x + xDist * this.curvePosition[0] + curveOffset[0],\n y: startPoint.y\n };\n var innerPoint2 = {\n x: endPoint.x - xDist * this.curvePosition[1] + curveOffset[1],\n y: endPoint.y\n };\n var controlPoints = [innerPoint1, innerPoint2];\n return controlPoints;\n }\n}, 'cubic');\n_shape__WEBPACK_IMPORTED_MODULE_6__[\"default\"].registerEdge('loop', {\n getPathPoints: function getPathPoints(cfg) {\n return Object(_util_graphic__WEBPACK_IMPORTED_MODULE_2__[\"getLoopCfgs\"])(cfg);\n },\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n afterDraw: function afterDraw(cfg) {\n cfg.controlPoints = undefined;\n },\n afterUpdate: function afterUpdate(cfg) {\n cfg.controlPoints = undefined;\n }\n}, 'cubic');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/edge.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LAYOUT_MESSAGE\", function() { return LAYOUT_MESSAGE; });\n/**\n * @fileoverview constants for layout\n * @author changzhe.zb@antfin.com\n */\n/** layout message type */\nvar LAYOUT_MESSAGE = {\n // run layout\n RUN: 'LAYOUT_RUN',\n // layout ended with success\n END: 'LAYOUT_END',\n // layout error\n ERROR: 'LAYOUT_ERROR',\n // layout tick, used in force directed layout\n TICK: 'LAYOUT_TICK',\n GPURUN: 'GPU_LAYOUT_RUN',\n GPUEND: 'GPU_LAYOUT_END'\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/worker/layoutConst.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/hull/bubbleset.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/hull/bubbleset.js ***! - \*****************************************************************/ -/*! exports provided: genBubbleSet */ +/***/ "./node_modules/@antv/g6-pc/es/layout/worker/work.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/layout/worker/work.js ***! + \***********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"genBubbleSet\", function() { return genBubbleSet; });\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n\nvar defaultOps = {\n maxRoutingIterations: 100,\n maxMarchingIterations: 100,\n pixelGroupSize: 2,\n edgeR0: 10,\n edgeR1: 10,\n nodeR0: 5,\n nodeR1: 10,\n morphBuffer: 5,\n threshold: 0.001,\n skip: 16,\n nodeInfluenceFactor: 1,\n edgeInfluenceFactor: 1,\n negativeNodeInfluenceFactor: -0.5\n};\n/**\n * Marching square algorithm for traching the contour of a pixel group\n * https://www.emanueleferonato.com/2013/03/01/using-marching-squares-algorithm-to-trace-the-contour-of-an-image/\n * @param potentialArea\n * @param threshold\n */\n\nfunction MarchingSquares(contour, potentialArea, threshold) {\n var marched = false;\n\n var getVal = function getVal(x, y) {\n return potentialArea.cells[x + y * potentialArea.width];\n };\n\n var getState = function getState(x, y) {\n var squareVal = 0;\n\n if (getVal(x - 1, y - 1) >= threshold) {\n squareVal += 1;\n }\n\n if (getVal(x, y - 1) > threshold) {\n squareVal += 2;\n }\n\n if (getVal(x - 1, y) > threshold) {\n squareVal += 4;\n }\n\n if (getVal(x, y) > threshold) {\n squareVal += 8;\n }\n\n return squareVal;\n };\n\n var doMarch = function doMarch(xPos, yPos) {\n var x = xPos;\n var y = yPos;\n var prevX;\n var prevY;\n\n for (var i = 0; i < potentialArea.width * potentialArea.height; i++) {\n prevX = x;\n prevY = y;\n\n if (contour.findIndex(function (item) {\n return item.x === x && item.y === y;\n }) > -1) {\n 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\n } else {\n return true;\n }\n } else {\n contour.push({\n x: x,\n y: y\n });\n }\n\n var state = getState(x, y); // assign the move direction according to state of the square\n\n switch (state) {\n case -1:\n console.warn('Marched out of bounds');\n return true;\n\n case 0:\n case 3:\n case 2:\n case 7:\n x++; // go right\n\n break;\n\n case 12:\n case 14:\n case 4:\n x--; // go left\n\n break;\n\n case 6:\n // go left if come from up else go right\n if (prevX === 0) {\n if (prevY === -1) {\n x -= 1;\n } else {\n x += 1;\n }\n }\n\n break;\n\n case 1:\n case 13:\n case 5:\n y--; // go up\n\n break;\n\n case 9:\n // go up if come from right else go down\n if (prevX === 1) {\n if (prevY === 0) {\n y -= 1;\n } else {\n y += 1;\n }\n }\n\n break;\n\n case 10:\n case 8:\n case 11:\n y++; // go down\n\n break;\n\n default:\n console.warn(\"Marching squares invalid state: \".concat(state));\n return true;\n }\n }\n };\n\n this.march = function () {\n for (var x = 0; x < potentialArea.width && !marched; x += 1) {\n for (var y = 0; y < potentialArea.height && !marched; y += 1) {\n if (getVal(x, y) > threshold && getState(x, y) !== 15) {\n marched = doMarch(x, y);\n }\n }\n }\n\n return marched;\n };\n}\n/**\n * Space partition & assign value to each cell\n * @param points\n */\n\n\nvar initGridCells = function initGridCells(width, height, pixelGroupSize) {\n var scaleWidth = Math.ceil(width / pixelGroupSize);\n var scaleHeight = Math.ceil(height / pixelGroupSize);\n var gridCells = new Float32Array(Math.max(0, scaleWidth * scaleHeight)).fill(0);\n return {\n cells: gridCells,\n width: scaleWidth,\n height: scaleHeight\n };\n};\n/**\n * Find the optimal already visited member to item;\n Optimal: minimize cost(j) = distance(i,j) ∗ countObstacles(i,j)\n * @param item\n * @param visited\n */\n\n\nvar pickBestNeighbor = function pickBestNeighbor(item, visited, nonMembers) {\n var closestNeighbour = null;\n var minCost = Number.POSITIVE_INFINITY;\n visited.forEach(function (neighbourItem) {\n var itemP = {\n x: item.getModel().x,\n y: item.getModel().y\n };\n var neighbourItemP = {\n x: neighbourItem.getModel().x,\n y: neighbourItem.getModel().y\n };\n var dist = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"squareDist\"])(itemP, neighbourItemP);\n var directLine = new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](itemP.x, itemP.y, neighbourItemP.x, neighbourItemP.y);\n var numberObstacles = nonMembers.reduce(function (count, _item) {\n if (Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"fractionToLine\"])(_item, directLine) > 0) {\n return count + 1;\n }\n\n return count;\n }, 0);\n\n if (dist * Math.pow(numberObstacles + 1, 2) < minCost) {\n closestNeighbour = neighbourItem;\n minCost = dist * Math.pow(numberObstacles + 1, 2);\n }\n });\n return closestNeighbour;\n};\n/**\n * 返回和线相交的item中,离边的起点最近的item\n * @param items\n * @param line\n */\n\n\nvar getIntersectItem = function getIntersectItem(items, line) {\n var minDistance = Number.POSITIVE_INFINITY;\n var closestItem = null;\n items.forEach(function (item) {\n var distance = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"fractionToLine\"])(item, line); // find closest intersection\n\n if (distance >= 0 && distance < minDistance) {\n closestItem = item;\n minDistance = distance;\n }\n });\n return closestItem;\n};\n/**\n * Modify the directLine and Route virtual edges around obstacles\n */\n\n\nvar computeRoute = function computeRoute(directLine, nonMembers, maxRoutingIterations, morphBuffer) {\n var checkedLines = [];\n var linesToCheck = [];\n linesToCheck.push(directLine);\n var hasIntersection = true;\n var iterations = 0;\n\n var pointExists = function pointExists(point, lines) {\n var flag = false;\n lines.forEach(function (line) {\n if (flag) return;\n\n if (Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"isPointsOverlap\"])(point, {\n x: line.x1,\n y: line.y1\n }) || Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"isPointsOverlap\"])(point, {\n x: line.x2,\n y: line.y2\n })) {\n flag = true;\n }\n });\n return flag;\n };\n\n var isPointInNonMembers = function isPointInNonMembers(point, _nonMembers) {\n for (var _i = 0, _nonMembers_1 = _nonMembers; _i < _nonMembers_1.length; _i++) {\n var item = _nonMembers_1[_i];\n var bbox = item.getBBox();\n var 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]];\n\n if (Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"isPointInPolygon\"])(itemContour, point.x, point.y)) {\n return true;\n }\n }\n\n return false;\n }; // outer loop end when no more intersections or out of iterations\n\n\n while (hasIntersection && iterations < maxRoutingIterations) {\n hasIntersection = false;\n\n var _loop_1 = function _loop_1() {\n var line = linesToCheck.pop();\n var closestItem = getIntersectItem(nonMembers, line);\n\n if (closestItem) {\n var _a = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"itemIntersectByLine\"])(closestItem, line),\n intersections_1 = _a[0],\n countIntersections = _a[1]; // if line passes through item\n\n\n if (countIntersections === 2) {\n var testReroute = function testReroute(isFirst) {\n var tempMorphBuffer = morphBuffer;\n var virtualNode = rerouteLine(closestItem, tempMorphBuffer, intersections_1, isFirst); // test the virtualNode already exists\n\n var exist = pointExists(virtualNode, linesToCheck) || pointExists(virtualNode, checkedLines);\n var pointInside = isPointInNonMembers(virtualNode, nonMembers);\n\n while (!exist && pointInside && tempMorphBuffer >= 1) {\n // try a smaller buffer\n tempMorphBuffer /= 1.5;\n virtualNode = rerouteLine(closestItem, tempMorphBuffer, intersections_1, isFirst);\n exist = pointExists(virtualNode, linesToCheck) || pointExists(virtualNode, checkedLines);\n pointInside = isPointInNonMembers(virtualNode, nonMembers);\n } // 第二次route时不要求pointInside\n\n\n if (virtualNode && !exist && (!isFirst || !pointInside)) {\n // add 2 rerouted lines to check\n linesToCheck.push(new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](line.x1, line.y1, virtualNode.x, virtualNode.y));\n linesToCheck.push(new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](virtualNode.x, virtualNode.y, line.x2, line.y2));\n hasIntersection = true;\n }\n };\n\n testReroute(true);\n\n if (!hasIntersection) {\n // if we didn't find a valid point around the first corner, try the second\n testReroute(false);\n }\n }\n } // no intersection found, mark this line as completed\n\n\n if (!hasIntersection) {\n checkedLines.push(line);\n }\n\n iterations += 1;\n }; // inner loop end when out of lines or found an intersection\n\n\n while (!hasIntersection && linesToCheck.length) {\n _loop_1();\n }\n } // 加入剩余的线\n\n\n while (linesToCheck.length) {\n checkedLines.push(linesToCheck.pop());\n }\n\n return checkedLines;\n};\n/**\n * Connect item with visited members using direct line or virtual edges\n */\n\n\nfunction getRoute(item, nonMembers, visited, maxRoutingIterations, morphBuffer) {\n var optimalNeighbor = pickBestNeighbor(item, visited, nonMembers);\n\n if (optimalNeighbor === null) {\n return [];\n } // merge the consecutive lines\n\n\n var mergeLines = function mergeLines(checkedLines) {\n var finalRoute = [];\n\n while (checkedLines.length > 0) {\n var line1 = checkedLines.pop();\n\n if (checkedLines.length === 0) {\n finalRoute.push(line1);\n break;\n }\n\n var line2 = checkedLines.pop();\n var mergeLine = new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](line1.x1, line1.y1, line2.x2, line2.y2);\n var closestItem = getIntersectItem(nonMembers, mergeLine); // merge most recent line and previous line\n\n if (!closestItem) {\n checkedLines.push(mergeLine);\n } else {\n finalRoute.push(line1);\n checkedLines.push(line2);\n }\n }\n\n return finalRoute;\n };\n\n var directLine = new _util_math__WEBPACK_IMPORTED_MODULE_0__[\"Line\"](item.getModel().x, item.getModel().y, optimalNeighbor.getModel().x, optimalNeighbor.getModel().y);\n var checkedLines = computeRoute(directLine, nonMembers, maxRoutingIterations, morphBuffer);\n var finalRoute = mergeLines(checkedLines);\n return finalRoute;\n}\n/**\n * Calculate the countor that includes the selected items and exclues the non-selected items\n * @param graph\n * @param members\n * @param nonMembers\n * @param options\n */\n\n\nvar genBubbleSet = function genBubbleSet(members, nonMembers, ops) {\n // eslint-disable-next-line no-redeclare\n var options = Object.assign(defaultOps, ops);\n var centroid = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"getPointsCenter\"])(members.map(function (item) {\n return {\n x: item.getModel().x,\n y: item.getModel().y\n };\n })); // 按照到中心距离远近排序\n\n members = members.sort(function (a, b) {\n return Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"squareDist\"])({\n x: a.getModel().x,\n y: a.getModel().y\n }, centroid) - Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"squareDist\"])({\n x: b.getModel().x,\n y: b.getModel().y\n }, centroid);\n });\n var visited = [];\n var virtualEdges = [];\n members.forEach(function (item) {\n var lines = getRoute(item, nonMembers, visited, options.maxRoutingIterations, options.morphBuffer);\n lines.forEach(function (l) {\n virtualEdges.push(l);\n });\n visited.push(item);\n }); // 由于edge也可以作为member和nonMember传入,暂时不考虑把edges作为参数传入genBubbleSet\n // edges && edges.forEach(e => {\n // virtualEdges.push(new Line(e.getSource().getModel().x, e.getSource().getModel().y, e.getTarget().getModel().x, e.getTarget().getModel().y));\n // });\n\n var activeRegion = getActiveRregion(members, virtualEdges, options.nodeR0);\n var potentialArea = initGridCells(activeRegion.width, activeRegion.height, options.pixelGroupSize); // Use march squares to generate contour\n\n var contour = [];\n var hull = [];\n\n for (var iterations = 0; iterations < options.maxMarchingIterations; iterations++) {\n fillPotentialArea(members, nonMembers, virtualEdges, activeRegion, potentialArea, options);\n contour = [];\n hull = [];\n if (!new MarchingSquares(contour, potentialArea, options.threshold).march()) continue;\n var marchedPath = contour.map(function (point) {\n return {\n x: Math.round(point.x * options.pixelGroupSize + activeRegion.minX),\n y: Math.round(point.y * options.pixelGroupSize + activeRegion.minY)\n };\n }); // 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) }))\n\n if (marchedPath) {\n var size = marchedPath.length;\n\n if (options.skip > 1) {\n size = Math.floor(marchedPath.length / options.skip); // if we reduced too much (fewer than three points in reduced surface) reduce skip and try again\n\n while (size < 3 && options.skip > 1) {\n options.skip -= 1;\n size = Math.floor(marchedPath.length / options.skip);\n }\n } // copy hull values\n\n\n for (var i = 0, j = 0; j < size; j += 1, i += options.skip) {\n hull.push({\n x: marchedPath[i].x,\n y: marchedPath[i].y\n });\n }\n }\n\n var isContourValid = function isContourValid() {\n for (var _i = 0, members_1 = members; _i < members_1.length; _i++) {\n var item = members_1[_i];\n var hullPoints = hull.map(function (point) {\n return [point.x, point.y];\n });\n if (!Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"isPointInPolygon\"])(hullPoints, item.getBBox().centerX, item.getBBox().centerY)) return false;\n } // 不强制要求所有nonMembers都没有包含在内\n // for (const item of nonMembers) {\n // if (isPointInPolygon({ x: item.getBBox().centerX, y: item.getBBox().centerY }, contour)) return false\n // }\n\n\n return true;\n };\n\n if (hull && isContourValid()) {\n return hull;\n } // update parameters for next iteraction\n\n\n options.threshold *= 0.9;\n\n if (iterations <= options.maxMarchingIterations * 0.5) {\n options.memberInfluenceFactor *= 1.2;\n options.edgeInfluenceFactor *= 1.2;\n } else if (options.nonMemberInfluenceFactor !== 0 && nonMembers.length > 0) {\n // after half the iterations, start increasing positive energy and lowering the threshold\n options.nonMemberInfluenceFactor *= 0.8;\n } else {\n break;\n }\n }\n\n return hull;\n};\n/**\n * unionboundingbox\n * @param members\n * @param edges\n */\n\nfunction getActiveRregion(members, edges, offset) {\n var activeRegion = {\n minX: Number.POSITIVE_INFINITY,\n minY: Number.POSITIVE_INFINITY,\n maxX: Number.NEGATIVE_INFINITY,\n maxY: Number.NEGATIVE_INFINITY,\n width: 0,\n height: 0,\n x: 0,\n y: 0\n };\n var bboxes = [];\n members.forEach(function (item) {\n bboxes.push(item.getBBox());\n });\n edges.forEach(function (l) {\n bboxes.push(l.getBBox());\n });\n\n for (var _i = 0, bboxes_1 = bboxes; _i < bboxes_1.length; _i++) {\n var bbox = bboxes_1[_i];\n activeRegion.minX = (bbox.minX < activeRegion.minX ? bbox.minX : activeRegion.minX) - offset;\n activeRegion.minY = (bbox.minY < activeRegion.minY ? bbox.minY : activeRegion.minY) - offset;\n activeRegion.maxX = (bbox.maxX > activeRegion.maxX ? bbox.maxX : activeRegion.maxX) + offset;\n activeRegion.maxY = (bbox.maxY > activeRegion.maxY ? bbox.maxY : activeRegion.maxY) + offset;\n }\n\n activeRegion.width = activeRegion.maxX - activeRegion.minX;\n activeRegion.height = activeRegion.maxY - activeRegion.minY;\n activeRegion.x = activeRegion.minX;\n activeRegion.y = activeRegion.minY;\n return activeRegion;\n}\n\nfunction fillPotentialArea(members, nonMembers, edges, activeRegion, potentialArea, options) {\n function pos2GridIx(x, offset) {\n var gridIx = Math.floor((x - offset) / options.pixelGroupSize);\n return gridIx < 0 ? 0 : gridIx;\n }\n\n function gridIx2Pos(x, offset) {\n return x * options.pixelGroupSize + offset;\n } // using inverse a for numerical stability\n\n\n var nodeInfA = (options.nodeR0 - options.nodeR1) * (options.nodeR0 - options.nodeR1);\n var edgeInfA = (options.edgeR0 - options.edgeR1) * (options.edgeR0 - options.edgeR1);\n\n var getAffectedRegion = function getAffectedRegion(bbox, thresholdR) {\n var startX = Math.min(pos2GridIx(bbox.minX, thresholdR + activeRegion.minX), potentialArea.width);\n var startY = Math.min(pos2GridIx(bbox.minY, thresholdR + activeRegion.minY), potentialArea.height);\n var endX = Math.min(pos2GridIx(bbox.maxX, -thresholdR + activeRegion.minX), potentialArea.width);\n var endY = Math.min(pos2GridIx(bbox.maxY, -thresholdR + activeRegion.minY), potentialArea.height);\n return [startX, startY, endX, endY];\n };\n\n var addItemInfluence = function addItemInfluence(item, influenceFactor) {\n var bbox = item.getBBox();\n\n var _a = getAffectedRegion(bbox, options.nodeR1),\n startX = _a[0],\n startY = _a[1],\n endX = _a[2],\n endY = _a[3]; // calculate item influence for each cell\n\n\n for (var y = startY; y < endY; y += 1) {\n for (var x = startX; x < endX; x += 1) {\n if (influenceFactor < 0 && potentialArea[x + y * potentialArea.width] <= 0) {\n continue;\n }\n\n var tempX = gridIx2Pos(x, activeRegion.minX);\n var tempY = gridIx2Pos(y, activeRegion.minY);\n var distanceSq = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"pointRectSquareDist\"])({\n x: tempX,\n y: tempY\n }, {\n x: bbox.minX,\n y: bbox.minY,\n width: bbox.width,\n height: bbox.height\n });\n\n if (distanceSq < Math.pow(options.nodeR1, 2)) {\n var dr = Math.sqrt(distanceSq) - options.nodeR1;\n potentialArea.cells[x + y * potentialArea.width] += influenceFactor * dr * dr;\n }\n }\n }\n };\n\n var addEdgeInfluence = function addEdgeInfluence(line, influenceFactor) {\n var bbox = line.getBBox();\n\n var _a = getAffectedRegion(bbox, options.edgeR1),\n startX = _a[0],\n startY = _a[1],\n endX = _a[2],\n endY = _a[3]; // for every point in active part of potentialArea, calculate distance to nearest point on line and add influence\n\n\n for (var y = startY; y < endY; y += 1) {\n for (var x = startX; x < endX; x += 1) {\n if (influenceFactor < 0 && potentialArea.cells[x + y * potentialArea.width] <= 0) {\n continue;\n }\n\n var tempX = gridIx2Pos(x, activeRegion.minX);\n var tempY = gridIx2Pos(y, activeRegion.minY);\n var minDistanceSq = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"pointLineSquareDist\"])({\n x: tempX,\n y: tempY\n }, line); // only influence if less than r1\n\n if (minDistanceSq < Math.pow(options.edgeR1, 2)) {\n var mdr = Math.sqrt(minDistanceSq) - options.edgeR1;\n potentialArea.cells[x + y * potentialArea.width] += influenceFactor * mdr * mdr;\n }\n }\n }\n };\n\n if (options.nodeInfluenceFactor) {\n members.forEach(function (item) {\n addItemInfluence(item, options.nodeInfluenceFactor / nodeInfA);\n });\n }\n\n if (options.edgeInfluenceFactor) {\n edges.forEach(function (edge) {\n addEdgeInfluence(edge, options.edgeInfluenceFactor / edgeInfA);\n });\n }\n\n if (options.negativeNodeInfluenceFactor) {\n nonMembers.forEach(function (item) {\n addItemInfluence(item, options.negativeNodeInfluenceFactor / nodeInfA);\n });\n }\n}\n\nfunction rerouteLine(item, buffer, intersections, wrapNormal) {\n var bbox = item.getBBox();\n var topIntersect = intersections[0],\n leftIntersect = intersections[1],\n bottomIntersect = intersections[2],\n rightIntersect = intersections[3];\n var cornerPos = {\n topLeft: {\n x: bbox.minX - buffer,\n y: bbox.minY - buffer\n },\n topRight: {\n x: bbox.maxX + buffer,\n y: bbox.minY - buffer\n },\n bottomLeft: {\n x: bbox.minX - buffer,\n y: bbox.maxY + buffer\n },\n bottomRight: {\n x: bbox.maxX + buffer,\n y: bbox.maxY + buffer\n }\n };\n var totalArea = bbox.height * bbox.width;\n\n function calcHalfArea(intersect1, intersect2) {\n return bbox.width * ((intersect1.y - bbox.minY + (intersect2.y - bbox.minY)) * 0.5);\n } // 根据线和boundingbox相交的情况,确定control point的位置\n\n\n if (leftIntersect) {\n // 相交区域有三角形\n if (topIntersect) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight;\n if (bottomIntersect) return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight; // 相交区域分成上下两个梯形,比较面积\n\n var topArea = calcHalfArea(leftIntersect, rightIntersect);\n\n if (topArea < totalArea * 0.5) {\n if (leftIntersect.y > rightIntersect.y) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight;\n return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft;\n }\n\n if (leftIntersect.y < rightIntersect.y) return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight;\n return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft;\n }\n\n if (rightIntersect) {\n if (topIntersect) return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft;\n if (bottomIntersect) return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft;\n } // 相交区域分成左右两个梯形\n\n\n var leftArea = calcHalfArea(topIntersect, bottomIntersect);\n\n if (leftArea < totalArea * 0.5) {\n if (topIntersect.x > bottomIntersect.x) return wrapNormal ? cornerPos.topLeft : cornerPos.bottomRight;\n return wrapNormal ? cornerPos.bottomLeft : cornerPos.topRight;\n }\n\n if (topIntersect.x < bottomIntersect.x) return wrapNormal ? cornerPos.topRight : cornerPos.bottomLeft;\n return wrapNormal ? cornerPos.bottomRight : cornerPos.topLeft;\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/hull/bubbleset.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar WebWorker = /** @class */function () {\n function WebWorker(worker, workerScirptURL) {\n var code = worker.toString();\n var blob = new Blob([\"importScripts('\".concat(workerScirptURL, \"');(\").concat(code, \")()\")], {\n type: 'text/javascript'\n });\n return new Worker(URL.createObjectURL(blob));\n }\n return WebWorker;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (WebWorker);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/worker/work.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/hull/convexHull.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/hull/convexHull.js ***! - \******************************************************************/ -/*! exports provided: cross, genConvexHull */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/g6-pc/es/plugin/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/plugin/index.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"genConvexHull\", function() { return genConvexHull; });\n/**\n * Use cross product to judge the direction of the turn.\n * Returns a positive value, if OAB makes a clockwise turn,\n * negative for counter-clockwise turn, and zero if the points are collinear.\n */\nvar cross = function cross(a, b, o) {\n return (a.y - o.y) * (b.x - o.x) - (a.x - o.x) * (b.y - o.y);\n};\n/**\n * Generate a convex hull of given points. Andrew's monotone chain algorithm.\n * @param points An array of [x, y] representing the coordinates of points.\n * @return a list of vertices of the convex hull in counter-clockwise order,\n */\n\nvar genConvexHull = function genConvexHull(items) {\n var points = items.map(function (item) {\n return {\n x: item.getModel().x,\n y: item.getModel().y\n };\n });\n points.sort(function (a, b) {\n return a.x === b.x ? a.y - b.y : a.x - b.x;\n });\n\n if (points.length === 1) {\n return points;\n } // build the lower hull\n\n\n var lower = [];\n\n for (var i = 0; i < points.length; i++) {\n while (lower.length >= 2 && cross(lower[lower.length - 2], lower[lower.length - 1], points[i]) <= 0) {\n lower.pop();\n }\n\n lower.push(points[i]);\n } // build the upper hull\n\n\n var upper = [];\n\n for (var i = points.length - 1; i >= 0; i--) {\n while (upper.length >= 2 && cross(upper[upper.length - 2], upper[upper.length - 1], points[i]) <= 0) {\n upper.pop();\n }\n\n upper.push(points[i]);\n }\n\n upper.pop();\n lower.pop();\n var strictHull = lower.concat(upper);\n return strictHull;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/hull/convexHull.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_g6_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-plugin */ \"./node_modules/@antv/g6-plugin/es/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_antv_g6_plugin__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n// export default {};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/plugin/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/index.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/index.js ***! - \********************************************************/ -/*! exports provided: Arrow, Marker, default */ +/***/ "./node_modules/@antv/g6-pc/es/types/index.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/types/index.js ***! + \****************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node */ \"./node_modules/@antv/g6-core/es/element/node.js\");\n/* harmony import */ var _edge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./edge */ \"./node_modules/@antv/g6-core/es/element/edge.js\");\n/* harmony import */ var _combo__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./combo */ \"./node_modules/@antv/g6-core/es/element/combo.js\");\n/* harmony import */ var _combos__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./combos */ \"./node_modules/@antv/g6-core/es/element/combos/index.js\");\n/* harmony import */ var _nodes__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./nodes */ \"./node_modules/@antv/g6-core/es/element/nodes/index.js\");\n/* harmony import */ var _arrow__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./arrow */ \"./node_modules/@antv/g6-core/es/element/arrow.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Arrow\", function() { return _arrow__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _marker__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./marker */ \"./node_modules/@antv/g6-core/es/element/marker.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Marker\", function() { return _marker__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_shape__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/types/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/marker.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/marker.js ***! - \*********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-pc/es/util/browser.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/util/browser.js ***! + \*****************************************************/ +/*! exports provided: getBrowserName */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n collapse: function collapse(x, y, r) {\n 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]];\n },\n expand: function expand(x, y, r) {\n 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]];\n },\n upTriangle: function upTriangle(x, y, r) {\n var l1 = r * Math.cos(Math.PI / 6);\n var l2 = r * Math.sin(Math.PI / 6);\n return [['M', x - l1, y + l2], ['L', x + l1, y + l2], ['L', x, y - r], ['Z']];\n },\n downTriangle: function downTriangle(x, y, r) {\n var l1 = r * Math.cos(Math.PI / 6);\n var l2 = r * Math.sin(Math.PI / 6);\n return [['M', x - l1, y - l2], ['L', x + l1, y - l2], ['L', x, y + r], ['Z']];\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/marker.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBrowserName\", function() { return getBrowserName; });\n/**\n * Get current browser name.\n * @returns browser name\n */\nvar getBrowserName = function getBrowserName() {\n var userAgent = navigator.userAgent.toLowerCase();\n if (userAgent.indexOf('firefox') > -1) return 'firefox';\n if (userAgent.indexOf('safari') > -1) return 'safari';\n if (userAgent.indexOf('opr') > -1) return 'opera';\n if (userAgent.indexOf('chrome') > -1) return 'chrome';\n if (userAgent.indexOf('trident') > -1) return 'ie 11';\n if (userAgent.indexOf('ie') > -1) return 'ie';\n return 'unknown';\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/browser.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/node.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/node.js ***! - \*******************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/util/color.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/util/color.js ***! + \***************************************************/ +/*! exports provided: mixColor, getColorsWithSubjectColor, getColorSetsBySubjectColors */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _shapeBase__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./shapeBase */ \"./node_modules/@antv/g6-core/es/element/shapeBase.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n\n\n\n\n\n\n\nvar singleNode = {\n itemType: 'node',\n // 单个图形的类型\n shapeType: 'single-node',\n\n /**\n * 文本相对图形的位置,默认以中心点\n * 位置包括: top, bottom, left, right, center\n * @type {String}\n */\n labelPosition: 'center',\n\n /**\n * 文本相对偏移,当 labelPosition 不为 center 时有效\n * @type {Number}\n */\n offset: _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].nodeLabel.offset,\n\n /**\n * 获取节点宽高\n * @internal 返回节点的大小,以 [width, height] 的方式维护\n * @param {Object} cfg 节点的配置项\n * @return {Array} 宽高\n */\n getSize: function getSize(cfg) {\n var _a;\n\n var size = ((_a = this.mergeStyle) === null || _a === void 0 ? void 0 : _a.size) || cfg.size || this.getOptions({}).size || _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].defaultNode.size; // Global.defaultNode.size; // \n // size 是数组,但长度为1,则补长度为2\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(size) && size.length === 1) {\n size = [size[0], size[0]];\n } // size 为数字,则转换为数组\n\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(size)) {\n size = [size, size];\n }\n\n return size;\n },\n // 私有方法,不希望扩展的节点复写这个方法\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg) {\n var labelMaxLength = labelCfg.maxLength;\n var text = cfg.label;\n\n if (labelMaxLength) {\n text = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_6__[\"truncateLabelByLength\"])(text, labelMaxLength);\n }\n\n var labelPosition = labelCfg.position || this.labelPosition; // 默认的位置(最可能的情形),所以放在最上面\n\n if (labelPosition === 'center') {\n return {\n x: 0,\n y: 0,\n text: text,\n textBaseline: 'middle',\n textAlign: 'center'\n };\n }\n\n var offset = labelCfg.offset;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(offset)) {\n // 考虑 offset = 0 的场景,不用用 labelCfg.offset || Global.nodeLabel.offset\n offset = this.offset; // 不居中时的偏移量\n }\n\n var size = this.getSize(cfg);\n var style;\n\n switch (labelPosition) {\n case 'top':\n style = {\n x: 0,\n y: -size[1] / 2 - offset,\n textBaseline: 'bottom',\n textAlign: 'center'\n };\n break;\n\n case 'bottom':\n style = {\n x: 0,\n y: size[1] / 2 + offset,\n textBaseline: 'top',\n textAlign: 'center'\n };\n break;\n\n case 'left':\n style = {\n x: -size[0] / 2 - offset,\n y: 0,\n textBaseline: 'middle',\n textAlign: 'right'\n };\n break;\n\n default:\n style = {\n x: size[0] / 2 + offset,\n y: 0,\n textBaseline: 'middle',\n textAlign: 'left'\n };\n break;\n }\n\n style.text = text;\n return style;\n },\n getLabelBgStyleByPosition: function getLabelBgStyleByPosition(label, labelCfg) {\n var _a;\n\n if (!label) return {};\n var backgroundStyle = (_a = labelCfg.style) === null || _a === void 0 ? void 0 : _a.background;\n if (!backgroundStyle) return {};\n var bbox = label.getBBox();\n var padding = Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"formatPadding\"])(backgroundStyle.padding);\n var backgroundWidth = bbox.width + padding[1] + padding[3];\n var backgroundHeight = bbox.height + padding[0] + padding[2];\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: bbox.minX - padding[3],\n y: bbox.minY - padding[0]\n }, backgroundStyle), {\n width: backgroundWidth,\n height: backgroundHeight\n });\n },\n drawShape: function drawShape(cfg, group) {\n var shapeType = this.shapeType; // || this.type,都已经加了 shapeType\n\n var style = this.getShapeStyle(cfg);\n var shape = group.addShape(shapeType, {\n attrs: style,\n draggable: true,\n name: 'node-shape'\n });\n group['shapeMap']['node-shape'] = shape;\n return shape;\n },\n\n /**\n * 更新linkPoints\n * @param {Object} cfg 节点数据配置项\n * @param {Group} group Item所在的group\n */\n updateLinkPoints: function updateLinkPoints(cfg, group) {\n var defaultLinkPoints = (this.mergeStyle || this.getOptions(cfg)).linkPoints;\n var markLeft = group['shapeMap']['link-point-left'] || group.find(function (element) {\n return element.get('className') === 'link-point-left';\n });\n var markRight = group['shapeMap']['link-point-right'] || group.find(function (element) {\n return element.get('className') === 'link-point-right';\n });\n var markTop = group['shapeMap']['link-point-top'] || group.find(function (element) {\n return element.get('className') === 'link-point-top';\n });\n var markBottom = group['shapeMap']['link-point-bottom'] || group.find(function (element) {\n return element.get('className') === 'link-point-bottom';\n });\n var currentLinkPoints;\n\n if (markLeft) {\n currentLinkPoints = markLeft.attr();\n }\n\n if (markRight && !currentLinkPoints) {\n currentLinkPoints = markRight.attr();\n }\n\n if (markTop && !currentLinkPoints) {\n currentLinkPoints = markTop.attr();\n }\n\n if (markBottom && !currentLinkPoints) {\n currentLinkPoints = markBottom.attr();\n }\n\n if (!currentLinkPoints) currentLinkPoints = defaultLinkPoints;\n var linkPoints = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, currentLinkPoints, cfg.linkPoints);\n var markFill = linkPoints.fill,\n markStroke = linkPoints.stroke,\n borderWidth = linkPoints.lineWidth;\n var markSize = linkPoints.size / 2;\n if (!markSize) markSize = linkPoints.r;\n\n var _a = cfg.linkPoints ? cfg.linkPoints : {\n left: undefined,\n right: undefined,\n top: undefined,\n bottom: undefined\n },\n left = _a.left,\n right = _a.right,\n top = _a.top,\n bottom = _a.bottom;\n\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n var styles = {\n r: markSize,\n fill: markFill,\n stroke: markStroke,\n lineWidth: borderWidth\n };\n\n if (markLeft) {\n if (!left && left !== undefined) {\n markLeft.remove();\n delete group['shapeMap']['link-point-left'];\n } else {\n markLeft.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: -width / 2,\n y: 0\n }));\n }\n } else if (left) {\n var name_1 = 'link-point-left';\n group['shapeMap'][name_1] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: -width / 2,\n y: 0\n }),\n className: name_1,\n name: name_1,\n isAnchorPoint: true\n });\n }\n\n if (markRight) {\n if (!right && right !== undefined) {\n markRight.remove();\n delete group['shapeMap']['link-point-right'];\n }\n\n markRight.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: width / 2,\n y: 0\n }));\n } else if (right) {\n var name_2 = 'link-point-right';\n group['shapeMap'][name_2] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: width / 2,\n y: 0\n }),\n className: name_2,\n name: name_2,\n isAnchorPoint: true\n });\n }\n\n if (markTop) {\n if (!top && top !== undefined) {\n markTop.remove();\n delete group['shapeMap']['link-point-top'];\n }\n\n markTop.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: 0,\n y: -height / 2\n }));\n } else if (top) {\n var name_3 = 'link-point-top';\n group['shapeMap'][name_3] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: 0,\n y: -height / 2\n }),\n className: name_3,\n name: name_3,\n isAnchorPoint: true\n });\n }\n\n if (markBottom) {\n if (!bottom && bottom !== undefined) {\n markBottom.remove();\n delete group['shapeMap']['link-point-bottom'];\n } else {\n markBottom.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: 0,\n y: height / 2\n }));\n }\n } else if (bottom) {\n var name_4 = 'link-point-bottom';\n group['shapeMap'][name_4] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: 0,\n y: height / 2\n }),\n className: name_4,\n name: name_4,\n isAnchorPoint: true\n });\n }\n },\n updateShape: function updateShape(cfg, item, keyShapeStyle, hasIcon, updateType) {\n var keyShape = item.get('keyShape');\n keyShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, keyShapeStyle));\n\n if (!undefined || (updateType === null || updateType === void 0 ? void 0 : updateType.includes('label'))) {\n this.updateLabel(cfg, item, updateType);\n }\n\n if (hasIcon) {\n this.updateIcon(cfg, item);\n }\n },\n updateIcon: function updateIcon(cfg, item) {\n var _this = this;\n\n var group = item.getContainer();\n var icon = (this.mergeStyle || this.getOptions(cfg)).icon;\n\n var _a = cfg.icon ? cfg.icon : {\n show: undefined,\n text: undefined\n },\n show = _a.show,\n text = _a.text;\n\n var iconShape = group['shapeMap'][\"\".concat(this.type, \"-icon\")] || group.find(function (ele) {\n return ele.get('name') === \"\".concat(_this.type, \"-icon\");\n });\n\n if (iconShape) {\n // 若原先存在 icon\n if (show || show === undefined) {\n // 若传入 show: true, 或没有设置,则更新原有的 icon 样式\n var iconConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, iconShape.attr(), icon);\n var _b = iconConfig.width,\n w = _b === void 0 ? 20 : _b,\n _c = iconConfig.height,\n h = _c === void 0 ? 20 : _c;\n\n if (iconConfig.fontFamily === 'iconfont' || iconConfig.hasOwnProperty('text')) {\n w = 0;\n h = 0;\n }\n\n iconShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, iconConfig), {\n x: -w / 2,\n y: -h / 2\n }));\n } else {\n // 若传入了 show: false 则删除原先的 icon\n iconShape.remove();\n delete group['shapeMap'][\"\".concat(this.type, \"-icon\")];\n }\n } else if (show) {\n // 如果原先不存在 icon,但传入了 show: true,则新增 icon\n var name_5 = \"\".concat(this.type, \"-icon\");\n\n if (text) {\n group['shapeMap'][name_5] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: name_5,\n name: name_5\n });\n } else {\n var w = icon.width,\n h = icon.height;\n group['shapeMap'][name_5] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, icon), {\n x: -w / 2,\n y: -h / 2\n }),\n className: name_5,\n name: name_5\n });\n } // to ensure the label is on the top of all the shapes\n\n\n var labelShape = group['shapeMap']['node-label'] || group.find(function (ele) {\n return ele.get('name') === 'node-label';\n });\n\n if (labelShape) {\n labelShape.toFront();\n }\n }\n }\n};\n\nvar singleNodeDef = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _shapeBase__WEBPACK_IMPORTED_MODULE_5__[\"shapeBase\"]), singleNode);\n\n_shape__WEBPACK_IMPORTED_MODULE_4__[\"default\"].registerNode('single-node', singleNodeDef);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/node.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mixColor\", function() { return mixColor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getColorsWithSubjectColor\", function() { return getColorsWithSubjectColor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getColorSetsBySubjectColors\", function() { return getColorSetsBySubjectColors; });\n/* harmony import */ var color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! color */ \"./node_modules/color/index.js\");\n/* harmony import */ var color__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(color__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _ant_design_colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/colors */ \"./node_modules/@ant-design/colors/dist/index.esm.js\");\n\n\n/**\n * get the mix color of backColor and frontColor with alpha\n * @param backColor background color\n * @param frontColor foreground color\n * @param frontAlpha the opacity of foreground color\n */\nvar mixColor = function mixColor(backColor, frontColor, frontAlpha) {\n var bc = color__WEBPACK_IMPORTED_MODULE_0___default()(backColor);\n var fc = color__WEBPACK_IMPORTED_MODULE_0___default()(frontColor);\n return color__WEBPACK_IMPORTED_MODULE_0___default()([(1 - frontAlpha) * bc.red() + frontAlpha * fc.red(), (1 - frontAlpha) * bc.green() + frontAlpha * fc.green(), (1 - frontAlpha) * bc.blue() + frontAlpha * fc.blue()]).rgb();\n};\nvar getColorsWithDefaultTheme = function getColorsWithDefaultTheme(subjectColor, backColor, disableColor) {\n if (backColor === void 0) {\n backColor = '#fff';\n }\n if (disableColor === void 0) {\n disableColor = 'rgb(150, 150, 150)';\n }\n var subjectColor005 = mixColor(backColor, subjectColor, 0.05).rgb().toString();\n var subjectColor01 = mixColor(backColor, subjectColor, 0.1).rgb().toString();\n var subjectColor02 = mixColor(backColor, subjectColor, 0.2).rgb().toString();\n var subjectColor04 = mixColor(backColor, subjectColor, 0.4).rgb().toString();\n var disableColor002 = mixColor(backColor, disableColor, 0.02).rgb().toString();\n var disableColor005 = mixColor(backColor, disableColor, 0.05).rgb().toString();\n var disableColor01 = mixColor(backColor, disableColor, 0.1).rgb().toString();\n var disableColor02 = mixColor(backColor, disableColor, 0.2).rgb().toString();\n var disableColor03 = mixColor(backColor, disableColor, 0.3).rgb().toString();\n var paletteFromSubject = Object(_ant_design_colors__WEBPACK_IMPORTED_MODULE_1__[\"generate\"])(subjectColor, {\n theme: 'default',\n backgroundColor: backColor\n });\n var subjectHex = color__WEBPACK_IMPORTED_MODULE_0___default()(subjectColor).hex().toLowerCase();\n var subjectIdx = paletteFromSubject.indexOf(subjectHex);\n var deeperSubject = subjectColor;\n if (subjectIdx !== -1) {\n deeperSubject = paletteFromSubject[subjectIdx + 1];\n }\n return {\n // for nodes\n mainStroke: subjectColor,\n mainFill: subjectColor01,\n activeStroke: subjectColor,\n activeFill: subjectColor005,\n inactiveStroke: subjectColor04,\n inactiveFill: subjectColor005,\n selectedStroke: subjectColor,\n selectedFill: backColor,\n highlightStroke: deeperSubject,\n highlightFill: subjectColor02,\n disableStroke: disableColor03,\n disableFill: disableColor005,\n // for edges\n edgeMainStroke: disableColor03,\n edgeActiveStroke: subjectColor,\n edgeInactiveStroke: disableColor02,\n edgeSelectedStroke: subjectColor,\n edgeHighlightStroke: subjectColor,\n edgeDisableStroke: disableColor01,\n // for combos\n comboMainStroke: disableColor03,\n comboMainFill: disableColor002,\n comboActiveStroke: subjectColor,\n comboActiveFill: subjectColor005,\n comboInactiveStroke: disableColor03,\n comboInactiveFill: disableColor002,\n comboSelectedStroke: subjectColor,\n comboSelectedFill: disableColor002,\n comboHighlightStroke: deeperSubject,\n comboHighlightFill: disableColor002,\n comboDisableStroke: disableColor02,\n comboDisableFill: disableColor005\n };\n};\nvar getColorsWithDarkTheme = function getColorsWithDarkTheme(subjectColor, backColor, disableColor) {\n if (backColor === void 0) {\n backColor = '#fff';\n }\n if (disableColor === void 0) {\n disableColor = '#777';\n }\n var subjectColor02 = mixColor(backColor, subjectColor, 0.2).rgb().toString();\n var subjectColor03 = mixColor(backColor, subjectColor, 0.3).rgb().toString();\n var subjectColor06 = mixColor(backColor, subjectColor, 0.6).rgb().toString();\n var subjectColor08 = mixColor(backColor, subjectColor, 0.8).rgb().toString();\n var disableColor02 = mixColor(backColor, disableColor, 0.2).rgb().toString();\n var disableColor025 = mixColor(backColor, disableColor, 0.25).rgb().toString();\n var disableColor03 = mixColor(backColor, disableColor, 0.3).rgb().toString();\n var disableColor04 = mixColor(backColor, disableColor, 0.4).rgb().toString();\n var disableColor05 = mixColor(backColor, disableColor, 0.5).rgb().toString();\n var paletteFromSubject = Object(_ant_design_colors__WEBPACK_IMPORTED_MODULE_1__[\"generate\"])(subjectColor, {\n theme: 'dark',\n backgroundColor: backColor\n });\n var subjectHex = color__WEBPACK_IMPORTED_MODULE_0___default()(subjectColor).hex().toLowerCase();\n var subjectIdx = paletteFromSubject.indexOf(subjectHex);\n var deeperSubject = subjectColor;\n if (subjectIdx !== -1) {\n deeperSubject = paletteFromSubject[subjectIdx + 1];\n }\n return {\n // for nodes\n mainStroke: subjectColor08,\n mainFill: subjectColor02,\n activeStroke: subjectColor,\n activeFill: subjectColor03,\n inactiveStroke: subjectColor08,\n inactiveFill: subjectColor02,\n selectedStroke: subjectColor,\n selectedFill: subjectColor02,\n highlightStroke: subjectColor,\n highlightFill: subjectColor06,\n disableStroke: disableColor05,\n disableFill: disableColor025,\n // for edges\n edgeMainStroke: disableColor,\n edgeActiveStroke: subjectColor,\n edgeInactiveStroke: disableColor,\n edgeSelectedStroke: subjectColor,\n edgeHighlightStroke: subjectColor,\n edgeDisableStroke: disableColor03,\n // for combos\n comboMainStroke: disableColor04,\n comboMainFill: disableColor025,\n comboActiveStroke: subjectColor,\n comboActiveFill: disableColor02,\n comboInactiveStroke: disableColor04,\n comboInactiveFill: disableColor025,\n comboSelectedStroke: subjectColor,\n comboSelectedFill: disableColor02,\n comboHighlightStroke: deeperSubject,\n comboHighlightFill: disableColor025,\n comboDisableStroke: disableColor04,\n comboDisableFill: disableColor02\n };\n};\n/**\n * get the set of colors according to the subject color and background color\n * @param subjectColor the subject color\n * @param backColor background color\n * @param disableColor the color for disable state\n */\nvar getColorsWithSubjectColor = function getColorsWithSubjectColor(subjectColor, backColor, theme, disableColor) {\n if (backColor === void 0) {\n backColor = '#fff';\n }\n if (theme === void 0) {\n theme = 'default';\n }\n if (disableColor === void 0) {\n disableColor = 'rgb(150, 150, 150)';\n }\n if (theme === 'default') return getColorsWithDefaultTheme(subjectColor, backColor, 'rgb(150, 150, 150)');\n return getColorsWithDarkTheme(subjectColor, backColor, '#777');\n};\nvar getColorSetsBySubjectColors = function getColorSetsBySubjectColors(subjectColors, backColor, theme, disableColor) {\n if (backColor === void 0) {\n backColor = '#fff';\n }\n if (theme === void 0) {\n theme = 'default';\n }\n if (disableColor === void 0) {\n disableColor = 'rgb(150, 150, 150)';\n }\n var sets = [];\n subjectColors.forEach(function (sColor) {\n sets.push(getColorsWithSubjectColor(sColor, backColor, theme, disableColor));\n });\n return sets;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/color.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/nodes/image.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/nodes/image.js ***! - \**************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/util/deepClone.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/util/deepClone.js ***! + \*******************************************************/ +/*! exports provided: deepClone */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n\n\n\n/**\n * 基本的图片,可以添加文本,默认文本在图片的下面\n */\n\n_shape__WEBPACK_IMPORTED_MODULE_1__[\"default\"].registerNode('image', {\n options: {\n img: 'https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*eD7nT6tmYgAAAAAAAAAAAABkARQnAQ',\n size: 200,\n labelCfg: {\n style: {\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n clipCfg: {\n show: false,\n type: 'circle',\n // circle\n r: 50,\n // ellipse\n rx: 50,\n ry: 35,\n // rect\n width: 50,\n height: 35,\n // polygon\n points: [[30, 12], [12, 30], [30, 48], [48, 30]],\n // path\n 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']],\n // 坐标\n x: 0,\n y: 0 // clip 的属性样式\n // style: {\n // lineWidth: 1\n // },\n\n }\n },\n shapeType: 'image',\n labelPosition: 'bottom',\n drawShape: function drawShape(cfg, group) {\n var shapeType = this.shapeType;\n var style = this.getShapeStyle(cfg);\n delete style.fill;\n var shape = group.addShape(shapeType, {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n this.drawClip(cfg, shape);\n return shape;\n },\n drawClip: function drawClip(cfg, shape) {\n var clip = (this.mergeStyle || this.getOptions(cfg)).clipCfg;\n\n if (!clip.show) {\n return;\n } // 支持 circle、rect、ellipse、Polygon 及自定义 path clip\n\n\n var type = clip.type,\n x = clip.x,\n y = clip.y,\n style = clip.style;\n\n if (type === 'circle') {\n var r = clip.r;\n shape.setClip({\n type: 'circle',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n r: r,\n x: x,\n y: y\n }, style)\n });\n } else if (type === 'rect') {\n var width = clip.width,\n height = clip.height;\n var rectX = x - width / 2;\n var rectY = y - height / 2;\n shape.setClip({\n type: 'rect',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: rectX,\n y: rectY,\n width: width,\n height: height\n }, style)\n });\n } else if (type === 'ellipse') {\n var rx = clip.rx,\n ry = clip.ry;\n shape.setClip({\n type: 'ellipse',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: x,\n y: y,\n rx: rx,\n ry: ry\n }, style)\n });\n } else if (type === 'polygon') {\n var points = clip.points;\n shape.setClip({\n type: 'polygon',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n points: points\n }, style)\n });\n } else if (type === 'path') {\n var path = clip.path;\n shape.setClip({\n type: 'path',\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: path\n }, style)\n });\n }\n },\n getShapeStyle: function getShapeStyle(cfg) {\n var _a = this.mergeStyle || this.getOptions(cfg),\n defaultStyle = _a.style,\n img = _a.img;\n\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n\n if (defaultStyle) {\n width = defaultStyle.width || size[0];\n height = defaultStyle.height || size[1];\n }\n\n var style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height,\n img: img\n }, defaultStyle);\n\n return style;\n },\n updateShapeStyle: function updateShapeStyle(cfg, item) {\n var group = item.getContainer();\n var shapeClassName = \"\".concat(this.itemType, \"-shape\");\n var shape = group['shapeMap'][shapeClassName] || group.find(function (element) {\n return element.get('className') === shapeClassName;\n }) || item.getKeyShape();\n var shapeStyle = this.getShapeStyle(cfg);\n\n if (shape && !shape.destroyed) {\n shape.attr(shapeStyle);\n }\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/nodes/image.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deepClone\", function() { return deepClone; });\nfunction _typeof(o) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) { return typeof o; } : function (o) { return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o; }, _typeof(o); }\n/**\n * 递归进行深拷贝. 模拟还原 JSON.parse + JSON.stringify\n */\nfunction traverseClone(obj, hash) {\n if (hash === void 0) {\n hash = new WeakMap();\n }\n if (obj === null) return obj;\n if (obj instanceof Date) return new Date(obj);\n if (obj instanceof RegExp) return new RegExp(obj);\n // 可能是对象或者普通的值 如果是函数的话是不需要深拷贝\n if (_typeof(obj) !== 'object') return obj;\n // 对象分为两种,一种是数组一种是普通的对象\n if (hash.get(obj)) return hash.get(obj);\n var cloneObj = Array.isArray(obj) ? [] : {};\n // 找到的是所属于自己的属性才拷贝\n hash.set(obj, cloneObj);\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && obj[key] !== undefined) {\n // 实现一个递归拷贝\n cloneObj[key] = traverseClone(obj[key], hash);\n }\n }\n return cloneObj;\n}\nfunction deepClone(data) {\n try {\n return structuredClone(data);\n } catch (err) {\n return traverseClone(data);\n }\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/deepClone.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/nodes/index.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/nodes/index.js ***! - \**************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/util/gpu.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/util/gpu.js ***! + \*************************************************/ +/*! exports provided: gpuDetector */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _simple_circle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./simple-circle */ \"./node_modules/@antv/g6-core/es/element/nodes/simple-circle.js\");\n/* harmony import */ var _simple_rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./simple-rect */ \"./node_modules/@antv/g6-core/es/element/nodes/simple-rect.js\");\n/* harmony import */ var _image__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./image */ \"./node_modules/@antv/g6-core/es/element/nodes/image.js\");\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/nodes/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gpuDetector\", function() { return gpuDetector; });\n/**\n * 调用 gpuDetector.webgl 判断当前浏览器是否支持 webgl。(支持 gpgpu 的浏览器一定也支持 webgl)\n */\nvar gpuDetector = function gpuDetector() {\n if (typeof window === 'undefined' || typeof document === 'undefined') return {};\n return {\n canvas: !!window.CanvasRenderingContext2D,\n webgl: function () {\n try {\n var canvas = document.createElement('canvas');\n return !!(window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')));\n } catch (e) {\n return false;\n }\n }(),\n workers: !!window.Worker,\n fileapi: window.File && window.FileReader && window.FileList && window.Blob,\n getWebGLErrorMessage: function getWebGLErrorMessage() {\n var element = document.createElement('div');\n element.id = 'webgl-error-message';\n element.style.fontFamily = 'monospace';\n element.style.fontSize = '13px';\n element.style.fontWeight = 'normal';\n element.style.textAlign = 'center';\n element.style.background = '#fff';\n element.style.color = '#000';\n element.style.padding = '1.5em';\n element.style.width = '400px';\n element.style.margin = '5em auto 0';\n if (!this.webgl) {\n element.innerHTML = window.WebGLRenderingContext ? ['Your graphics card does not seem to support WebGL.
', 'Find out how to get it here.'].join('\\n') : ['Your browser does not seem to support WebGL.
', 'Find out how to get it here.'].join('\\n');\n }\n return element;\n },\n addGetWebGLMessage: function addGetWebGLMessage(parameters) {\n parameters = parameters || {};\n var parent = parameters.parent !== undefined ? parameters.parent : document.body;\n var id = parameters.id !== undefined ? parameters.id : 'oldie';\n var element = gpuDetector().getWebGLErrorMessage();\n element.id = id;\n parent.appendChild(element);\n }\n };\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/gpu.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/nodes/simple-circle.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/nodes/simple-circle.js ***! - \**********************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/util/image.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/util/image.js ***! + \***************************************************/ +/*! exports provided: cloneGElement */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n\n\n\n // 带有图标的圆,可用于拓扑图中\n\n_shape__WEBPACK_IMPORTED_MODULE_3__[\"default\"].registerNode('simple-circle', {\n // 自定义节点时的配置\n options: {\n size: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.size,\n style: {\n x: 0,\n y: 0,\n stroke: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeStateStyles)\n },\n shapeType: 'simple-circle',\n // 文本位置\n labelPosition: 'center',\n shapeMap: {},\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n var name = \"\".concat(this.type, \"-keyShape\");\n var keyShape = group.addShape('circle', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: name,\n draggable: true\n });\n group['shapeMap'][name] = keyShape;\n return keyShape;\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var r = size[0] / 2;\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n r: r\n }, style);\n\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var size = this.getSize(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n\n var strokeStyle = {\n stroke: cfg.color,\n r: size[0] / 2\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, keyShape.attr(), strokeStyle, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/nodes/simple-circle.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cloneGElement\", function() { return cloneGElement; });\n/**\n * Clone group and clone the clip shapes of image shapes.\n * @param group group to be cloned\n * @returns cloned group with same clipped shapes of original group\n */\nvar cloneGElement = function cloneGElement(element) {\n var vElement = element.clone();\n applyCloneClip(element, vElement);\n return vElement;\n};\n/**\n * Apply the clipShape for image shapes from original element to cloned one (clonedElement).\n * @param element original element\n * @param clonedElement cloned element of original element\n */\nvar applyCloneClip = function applyCloneClip(element, clonedElement) {\n var _a;\n if (element.isGroup() && clonedElement.isGroup()) {\n (_a = element.get('children')) === null || _a === void 0 ? void 0 : _a.forEach(function (child, i) {\n var clonedChild = clonedElement.get('children')[i];\n applyCloneClip(child, clonedChild);\n });\n }\n var type = element.get('type');\n var clonedType = clonedElement.get('type');\n if (type !== 'image' || clonedType !== 'image') return;\n var clipShape = element.get('clipShape');\n if (clipShape) {\n clonedElement.setClip({\n type: clipShape.get('type'),\n attrs: clipShape.attr()\n });\n }\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/image.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/nodes/simple-rect.js": -/*!********************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/nodes/simple-rect.js ***! - \********************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-pc/es/util/index.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/util/index.js ***! + \***************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n\n\n\n\n_shape__WEBPACK_IMPORTED_MODULE_3__[\"default\"].registerNode('simple-rect', {\n // 自定义节点时的配置\n options: {\n size: [100, 30],\n style: {\n radius: 0,\n stroke: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.stroke,\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.fill,\n lineWidth: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultNode.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeLabel.style.fill,\n fontSize: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeLabel.style.fontSize,\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].windowFontFamily\n }\n },\n // 连接点,默认为左右\n // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }]\n anchorPoints: [[0, 0.5], [1, 0.5]],\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].nodeStateStyles)\n },\n shapeType: 'simple-rect',\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('rect', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n return keyShape;\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var width = style.width || size[0];\n var height = style.height || size[1];\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height\n }, style);\n\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var size = this.getSize(cfg);\n var keyShape = item.get('keyShape');\n\n if (!cfg.size) {\n size[0] = keyShape.attr('width') || defaultStyle.width;\n size[1] = keyShape.attr('height') || defaultStyle.height;\n } // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n\n\n var strokeStyle = {\n stroke: cfg.color,\n x: -size[0] / 2,\n y: -size[1] / 2,\n width: size[0],\n height: size[1]\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, false, updateType);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/nodes/simple-rect.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color */ \"./node_modules/@antv/g6-pc/es/util/color.js\");\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/g6-pc/es/util/layout.js\");\n/* harmony import */ var _gpu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gpu */ \"./node_modules/@antv/g6-pc/es/util/gpu.js\");\n/* harmony import */ var _browser__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./browser */ \"./node_modules/@antv/g6-pc/es/util/browser.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n\n\n\n\n\n\nvar G6Util = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_5__[\"Util\"]), _color__WEBPACK_IMPORTED_MODULE_1__), _layout__WEBPACK_IMPORTED_MODULE_2__), _gpu__WEBPACK_IMPORTED_MODULE_3__), _browser__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (G6Util);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/shape.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/shape.js ***! - \********************************************************/ -/*! exports provided: ShapeFactoryBase, default */ +/***/ "./node_modules/@antv/g6-pc/es/util/layout.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/g6-pc/es/util/layout.js ***! + \****************************************************/ +/*! exports provided: proccessToFunc, buildTextureData, buildTextureDataWithOneEdgeAttr, buildTextureDataWithTwoEdgeAttr, attributesToTextureData, arrayToTextureData, radialLayout */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ShapeFactoryBase\", function() { return ShapeFactoryBase; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _xml__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./xml */ \"./node_modules/@antv/g6-core/es/element/xml.js\");\n\n\n\nvar cache = {}; // ucfirst 开销过大,进行缓存\n// 首字母大写\n\nfunction ucfirst(str) {\n if (!cache[str]) {\n cache[str] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"upperFirst\"])(str);\n }\n\n return cache[str];\n}\n/**\n * 工厂方法的基类\n * @type Shape.FactoryBase\n */\n\n\nvar ShapeFactoryBase = {\n /**\n * 默认的形状,当没有指定/匹配 shapeType 时,使用默认的\n * @type {String}\n */\n defaultShapeType: 'defaultType',\n\n /**\n * 形状的 className,用于搜索\n * @type {String}\n */\n className: null,\n\n /**\n * 获取绘制 Shape 的工具类,无状态\n * @param {String} type 类型\n * @return {Shape} 工具类\n */\n getShape: function getShape(type) {\n var self = this;\n var shape = self[type] || self[self.defaultShapeType] || self['simple-circle'];\n return shape;\n },\n\n /**\n * 绘制图形\n * @param {String} type 类型\n * @param {Object} cfg 配置项\n * @param {G.Group} group 图形的分组\n * @return {IShape} 图形对象\n */\n draw: function draw(type, cfg, group) {\n var shape = this.getShape(type);\n group['shapeMap'] = {};\n var rst = shape.draw(cfg, group);\n\n if (shape.afterDraw) {\n shape.afterDraw(cfg, group, rst);\n }\n\n return rst;\n },\n\n /**\n * 更新\n * @param {String} type 类型\n * @param {Object} cfg 配置项\n * @param {G6.Item} item 节点、边、分组等\n */\n baseUpdate: function baseUpdate(type, cfg, item, updateType) {\n var _a, _b;\n\n var shape = this.getShape(type); // 防止没定义 update 函数\n\n if (shape.update) {\n // shape.mergeStyle = updateType === 'move' || updateType === 'bbox' ? {} : shape.getOptions?.(cfg);\n shape.mergeStyle = (_a = shape.getOptions) === null || _a === void 0 ? void 0 : _a.call(shape, cfg, updateType);\n (_b = shape.update) === null || _b === void 0 ? void 0 : _b.call(shape, cfg, item, updateType);\n }\n\n if (shape.afterUpdate) {\n shape.afterUpdate(cfg, item);\n }\n },\n\n /**\n * 设置状态\n * @param {String} type 类型\n * @param {String} name 状态名\n * @param {String | Boolean} value 状态值\n * @param {G6.Item} item 节点、边、分组等\n */\n setState: function setState(type, name, value, item) {\n var shape = this.getShape(type); // 调用 shape/shapeBase.ts 中的 setState 方法\n\n shape.setState(name, value, item);\n },\n\n /**\n * 是否允许更新,不重新绘制图形\n * @param {String} type 类型\n * @return {Boolean} 是否允许使用更新\n */\n shouldUpdate: function shouldUpdate(type) {\n var shape = this.getShape(type);\n return !!shape.update;\n },\n getControlPoints: function getControlPoints(type, cfg) {\n var shape = this.getShape(type);\n return shape.getControlPoints(cfg);\n },\n\n /**\n * 获取控制点\n * @param {String} type 节点、边类型\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getAnchorPoints: function getAnchorPoints(type, cfg) {\n var shape = this.getShape(type);\n return shape.getAnchorPoints(cfg);\n }\n};\n/**\n * 元素的框架\n */\n\nvar ShapeFramework = {\n // 默认样式及配置\n options: {},\n\n /**\n * 绘制\n */\n draw: function draw(cfg, group) {\n return this.drawShape(cfg, group);\n },\n\n /**\n * 绘制\n */\n drawShape: function\n /* cfg, group */\n drawShape() {},\n\n /**\n * 绘制完成后的操作,便于用户继承现有的节点、边\n */\n afterDraw: function\n /* cfg, group */\n afterDraw() {},\n // update(cfg, item) // 默认不定义\n afterUpdate: function\n /* cfg, item */\n afterUpdate() {},\n\n /**\n * 设置节点、边状态\n */\n setState: function\n /* name, value, item */\n setState() {},\n\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getAnchorPoints: function getAnchorPoints(cfg) {\n var defaultAnchorPoints = this.options.anchorPoints;\n var anchorPoints = cfg.anchorPoints || defaultAnchorPoints;\n return anchorPoints;\n }\n /* 如果没定义 update 方法,每次都调用 draw 方法\n update(cfg, item) {\n }\n */\n\n};\n\nvar Shape =\n/** @class */\nfunction () {\n function Shape() {}\n\n Shape.registerFactory = function (factoryType, cfg) {\n var className = ucfirst(factoryType);\n var factoryBase = ShapeFactoryBase;\n\n var shapeFactory = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, factoryBase), cfg);\n\n Shape[className] = shapeFactory;\n shapeFactory.className = className;\n return shapeFactory;\n };\n\n Shape.getFactory = function (factoryType) {\n var className = ucfirst(factoryType);\n return Shape[className];\n };\n\n Shape.registerNode = function (shapeType, nodeDefinition, extendShapeType) {\n var shapeFactory = Shape.Node;\n var shapeObj;\n\n if (typeof nodeDefinition === 'string' || typeof nodeDefinition === 'function') {\n var autoNodeDefinition = Object(_xml__WEBPACK_IMPORTED_MODULE_2__[\"createNodeFromXML\"])(nodeDefinition);\n shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, shapeFactory.getShape('single-node')), autoNodeDefinition);\n } else if (nodeDefinition.jsx) {\n var jsx = nodeDefinition.jsx;\n var autoNodeDefinition = Object(_xml__WEBPACK_IMPORTED_MODULE_2__[\"createNodeFromXML\"])(jsx);\n shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, shapeFactory.getShape('single-node')), autoNodeDefinition), nodeDefinition);\n } else {\n shapeFactory.getShape(extendShapeType);\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, extendShape), nodeDefinition);\n }\n\n shapeObj.type = shapeType;\n shapeObj.itemType = 'node';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n\n Shape.registerEdge = function (shapeType, edgeDefinition, extendShapeType) {\n var shapeFactory = Shape.Edge;\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n\n var shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, extendShape), edgeDefinition);\n\n shapeObj.type = shapeType;\n shapeObj.itemType = 'edge';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n\n Shape.registerCombo = function (shapeType, comboDefinition, extendShapeType) {\n var shapeFactory = Shape.Combo;\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n\n var shapeObj = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, extendShape), comboDefinition);\n\n shapeObj.type = shapeType;\n shapeObj.itemType = 'combo';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n\n return Shape;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Shape); // 注册 Node 的工厂方法\n\nShape.registerFactory('node', {\n defaultShapeType: 'circle'\n}); // 注册 Edge 的工厂方法\n\nShape.registerFactory('edge', {\n defaultShapeType: 'line'\n}); // 注册 Combo 的工厂方法\n\nShape.registerFactory('combo', {\n defaultShapeType: 'circle'\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/shape.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proccessToFunc\", function() { return proccessToFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildTextureData\", function() { return buildTextureData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildTextureDataWithOneEdgeAttr\", function() { return buildTextureDataWithOneEdgeAttr; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildTextureDataWithTwoEdgeAttr\", function() { return buildTextureDataWithTwoEdgeAttr; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"attributesToTextureData\", function() { return attributesToTextureData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayToTextureData\", function() { return arrayToTextureData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radialLayout\", function() { return radialLayout; });\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\nvar traverseTree = _antv_g6_core__WEBPACK_IMPORTED_MODULE_0__[\"Util\"].traverseTree;\n/**\n * 将 number | Function 类型的参数转换为 return number 的 Function\n * @param {number | Function} value 需要被转换的值\n * @param {number} defaultV 返回函数的默认返回值\n * @return {Function} 转换后的函数\n */\nvar proccessToFunc = function proccessToFunc(value, defaultV) {\n var func;\n if (!value) {\n func = function func(d) {\n return defaultV || 1;\n };\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value)) {\n func = function func(d) {\n return value;\n };\n } else {\n func = value;\n }\n return func;\n};\n/**\n * 将节点和边数据转换为 GPU 可读的数组。并返回 maxEdgePerVetex,每个节点上最多的边数\n * @param {NodeConfig[]} nodes 需要被转换的值\n * @param {EdgeConfig[]} edges 返回函数的默认返回值\n * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n */\nvar buildTextureData = function buildTextureData(nodes, edges) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]);\n nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]);\n }\n var maxEdgePerVetex = 0;\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i];\n var len = dests.length;\n dataArray[i * 4 + 2] = offset;\n dataArray[i * 4 + 3] = dests.length;\n maxEdgePerVetex = Math.max(maxEdgePerVetex, dests.length);\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n }\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n return {\n array: new Float32Array(dataArray),\n maxEdgePerVetex: maxEdgePerVetex\n };\n};\n/**\n * 将节点和边数据转换为 GPU 可读的数组,每条边带有一个属性。并返回 maxEdgePerVetex,每个节点上最多的边数\n * @param {NodeConfig[]} nodes 节点数组\n * @param {EdgeConfig[]} edges 边数组\n * @param {Function} attrs 读取边属性的函数\n * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n */\nvar buildTextureDataWithOneEdgeAttr = function buildTextureDataWithOneEdgeAttr(nodes, edges, attrs) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]);\n nodeDict[mapIdPos[e.source]].push(attrs(e)); // 理想边长,后续可以改成每条边不同\n nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]);\n nodeDict[mapIdPos[e.target]].push(attrs(e)); // 理想边长,后续可以改成每条边不同\n }\n\n var maxEdgePerVetex = 0;\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长……\n var len = dests.length;\n dataArray[i * 4 + 2] = offset;\n dataArray[i * 4 + 3] = len / 2; // 第四位存储与该节点相关的所有节点个数\n maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 2);\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n }\n // 不是 4 的倍数,填充 0\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n return {\n array: new Float32Array(dataArray),\n maxEdgePerVetex: maxEdgePerVetex\n };\n};\n/**\n * 将节点和边数据转换为 GPU 可读的数组,每条边带有一个以上属性。并返回 maxEdgePerVetex,每个节点上最多的边数\n * @param {NodeConfig[]} nodes 节点数组\n * @param {EdgeConfig[]} edges 边数组\n * @param {Function} attrs 读取边属性的函数\n * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n */\nvar buildTextureDataWithTwoEdgeAttr = function buildTextureDataWithTwoEdgeAttr(nodes, edges, attrs1, attrs2) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]);\n nodeDict[mapIdPos[e.source]].push(attrs1(e));\n nodeDict[mapIdPos[e.source]].push(attrs2(e));\n nodeDict[mapIdPos[e.source]].push(0);\n nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]);\n nodeDict[mapIdPos[e.target]].push(attrs1(e));\n nodeDict[mapIdPos[e.target]].push(attrs2(e));\n nodeDict[mapIdPos[e.target]].push(0);\n }\n var maxEdgePerVetex = 0;\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长……\n var len = dests.length;\n // dataArray[i * 4 + 2] = offset;\n // dataArray[i * 4 + 3] = len / 4; // 第四位存储与该节点相关的所有节点个数\n // pack offset & length into float32: offset 20bit, length 12bit\n dataArray[i * 4 + 2] = offset + 1048576 * len / 4;\n dataArray[i * 4 + 3] = 0; // 第四位存储与上一次的距离差值\n maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 4);\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n }\n // 不是 4 的倍数,填充 0\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n return {\n array: new Float32Array(dataArray),\n maxEdgePerVetex: maxEdgePerVetex\n };\n};\n/**\n * transform the extended attributes of nodes or edges to a texture array\n * @param {string[]} attributeNames attributes' name to be read from items and put into output array\n * @param {ModelConfig[]} items the items to be read\n * @return {Float32Array} the attributes' value array to be read by GPU\n */\nvar attributesToTextureData = function attributesToTextureData(attributeNames, items) {\n var dataArray = [];\n var attributeNum = attributeNames.length;\n var attributeStringMap = {};\n items.forEach(function (item) {\n attributeNames.forEach(function (name, i) {\n if (attributeStringMap[item[name]] === undefined) {\n attributeStringMap[item[name]] = Object.keys(attributeStringMap).length;\n }\n dataArray.push(attributeStringMap[item[name]]);\n // insure each node's attributes take inter number of grids\n if (i === attributeNum - 1) {\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n }\n });\n });\n return {\n array: new Float32Array(dataArray),\n count: Object.keys(attributeStringMap).length\n };\n};\n/**\n * transform the number array format of extended attributes of nodes or edges to a texture array\n * @param {string[]} attributeNames attributes' name to be read from items and put into output array\n * @return {Float32Array} the attributes' value array to be read by GPU\n */\nvar arrayToTextureData = function arrayToTextureData(valueArrays) {\n var dataArray = [];\n var attributeNum = valueArrays.length;\n var itemNum = valueArrays[0].length;\n var _loop_1 = function _loop_1(j) {\n valueArrays.forEach(function (valueArray, i) {\n dataArray.push(valueArray[j]);\n // insure each node's attributes take inter number of grids\n if (i === attributeNum - 1) {\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n }\n });\n };\n for (var j = 0; j < itemNum; j++) {\n _loop_1(j);\n }\n return new Float32Array(dataArray);\n};\n/**\n *\n * @param data Tree graph data\n * @param layout\n */\nvar radialLayout = function radialLayout(data, layout) {\n // 布局方式有 H / V / LR / RL / TB / BT\n var VERTICAL_LAYOUTS = ['V', 'TB', 'BT'];\n var min = {\n x: Infinity,\n y: Infinity\n };\n var max = {\n x: -Infinity,\n y: -Infinity\n };\n // 默认布局是垂直布局TB,此时x对应rad,y对应r\n var rScale = 'x';\n var radScale = 'y';\n if (layout && VERTICAL_LAYOUTS.indexOf(layout) >= 0) {\n // 若是水平布局,y对应rad,x对应r\n radScale = 'x';\n rScale = 'y';\n }\n var count = 0;\n traverseTree(data, function (node) {\n count++;\n if (node.x > max.x) {\n max.x = node.x;\n }\n if (node.x < min.x) {\n min.x = node.x;\n }\n if (node.y > max.y) {\n max.y = node.y;\n }\n if (node.y < min.y) {\n min.y = node.y;\n }\n return true;\n });\n var avgRad = Math.PI * 2 / count;\n var radDiff = max[radScale] - min[radScale];\n if (radDiff === 0) {\n return data;\n }\n traverseTree(data, function (node) {\n var radial = (node[radScale] - min[radScale]) / radDiff * (Math.PI * 2 - avgRad) + avgRad;\n var r = Math.abs(rScale === 'x' ? node.x - data.x : node.y - data.y);\n node.x = r * Math.cos(radial);\n node.y = r * Math.sin(radial);\n return true;\n });\n return data;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/layout.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/shapeBase.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/shapeBase.js ***! - \************************************************************/ -/*! exports provided: CLS_LABEL_BG_SUFFIX, shapeBase */ +/***/ "./node_modules/@antv/g6-plugin/es/annotation/index.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/annotation/index.js ***! + \*************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CLS_LABEL_BG_SUFFIX\", function() { return CLS_LABEL_BG_SUFFIX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"shapeBase\", function() { return shapeBase; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__[\"ext\"].transform;\nvar CLS_SHAPE_SUFFIX = '-shape';\nvar CLS_LABEL_SUFFIX = '-label';\nvar ARROWS = ['startArrow', 'endArrow'];\nvar SHAPE_DEFAULT_ATTRS = {\n lineWidth: 1,\n stroke: undefined,\n fill: undefined,\n lineAppendWidth: 1,\n opacity: undefined,\n strokeOpacity: undefined,\n fillOpacity: undefined,\n x: 0,\n y: 0,\n r: 10,\n width: 20,\n height: 20,\n shadowColor: undefined,\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\nvar PATH_SHAPE_DEFAULT_ATTRS = {\n lineWidth: 1,\n stroke: '#000',\n lineDash: undefined,\n startArrow: false,\n endArrow: false,\n opacity: undefined,\n strokeOpacity: undefined,\n fillOpacity: undefined,\n shadowColor: undefined,\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\nvar SHAPES_DEFAULT_ATTRS = {\n edge: PATH_SHAPE_DEFAULT_ATTRS,\n node: SHAPE_DEFAULT_ATTRS,\n combo: SHAPE_DEFAULT_ATTRS\n};\nvar CLS_LABEL_BG_SUFFIX = '-label-bg'; // 单个 shape 带有一个 label,共用这段代码\n\nvar shapeBase = {\n // 默认样式及配置\n options: {\n labelCfg: {\n style: {\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].windowFontFamily\n }\n },\n descriptionCfg: {\n style: {\n fontFamily: _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"].windowFontFamily\n }\n }\n },\n itemType: '',\n\n /**\n * 形状的类型,例如 circle,ellipse,polyline...\n */\n type: '',\n getCustomConfig: function getCustomConfig(cfg) {\n return {};\n },\n getOptions: function getOptions(cfg, updateType) {\n if (updateType === 'move' || (updateType === null || updateType === void 0 ? void 0 : updateType.includes('bbox'))) {\n return {};\n }\n\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"])({}, this.options, this.getCustomConfig(cfg) || {}, cfg);\n },\n\n /**\n * 绘制节点/边,包含文本\n * @override\n * @param {Object} cfg 节点的配置项\n * @param {G.Group} group 节点的容器\n * @return {IShape} 绘制的图形\n */\n draw: function draw(cfg, group) {\n group['shapeMap'] = {};\n this.mergeStyle = this.getOptions(cfg);\n var shape = this.drawShape(cfg, group);\n shape.set('className', this.itemType + CLS_SHAPE_SUFFIX);\n group['shapeMap'][this.itemType + CLS_SHAPE_SUFFIX] = shape;\n\n if (cfg.label) {\n var label = this.drawLabel(cfg, group);\n label.set('className', this.itemType + CLS_LABEL_SUFFIX);\n group['shapeMap'][this.itemType + CLS_LABEL_SUFFIX] = label;\n }\n\n return shape;\n },\n\n /**\n * 绘制完成后的操作,便于用户继承现有的节点、边\n * @param cfg\n * @param group\n * @param keyShape\n */\n afterDraw: function afterDraw(cfg, group, keyShape) {},\n drawShape: function drawShape(cfg, group) {\n return null;\n },\n drawLabel: function drawLabel(cfg, group) {\n var defaultLabelCfg = (this.mergeStyle || this.getOptions(cfg) || {}).labelCfg; // image的情况下有可能为null\n\n var labelCfg = defaultLabelCfg || {};\n var labelStyle = this.getLabelStyle(cfg, labelCfg, group);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate;\n var label = group.addShape('text', {\n attrs: labelStyle,\n draggable: true,\n className: 'text-shape',\n name: 'text-shape',\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n\n if (!isNaN(rotate) && rotate !== '') {\n var labelBBox = label.getBBox();\n var labelMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n if (labelStyle.rotateCenter) {\n switch (labelStyle.rotateCenter) {\n case 'center':\n labelMatrix = transform(labelMatrix, [['t', -labelBBox.width / 2, -labelBBox.height / 2], ['r', rotate], ['t', labelBBox.width / 2, labelBBox.height / 2]]);\n break;\n\n case 'lefttop':\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y], ['r', rotate], ['t', labelStyle.x, labelStyle.y]]);\n break;\n\n case 'leftcenter':\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y - labelBBox.height / 2], ['r', rotate], ['t', labelStyle.x, labelStyle.y + labelBBox.height / 2]]);\n break;\n\n default:\n labelMatrix = transform(labelMatrix, [['t', -labelBBox.width / 2, -labelBBox.height / 2], ['r', rotate], ['t', labelBBox.width / 2, labelBBox.height / 2]]);\n break;\n }\n } else {\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y - labelBBox.height / 2], ['r', rotate], ['t', labelStyle.x, labelStyle.y + labelBBox.height / 2]]);\n }\n\n label.setMatrix(labelMatrix);\n }\n\n if (labelStyle.background) {\n var rect = this.drawLabelBg(cfg, group, label);\n var labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX;\n rect.set('classname', labelBgClassname);\n group['shapeMap'][labelBgClassname] = rect;\n label.toFront();\n }\n\n return label;\n },\n drawLabelBg: function drawLabelBg(cfg, group, label) {\n var defaultLabelCfg = this.options.labelCfg;\n var labelCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, defaultLabelCfg, cfg.labelCfg);\n var style = this.getLabelBgStyleByPosition(label, labelCfg);\n var rect = group.addShape('rect', {\n name: 'text-bg-shape',\n attrs: style,\n labelRelated: true\n });\n group['shapeMap']['text-bg-shape'] = rect;\n return rect;\n },\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg, group) {\n return {\n text: cfg.label\n };\n },\n getLabelBgStyleByPosition: function getLabelBgStyleByPosition(label, labelCfg) {\n return {};\n },\n\n /**\n * 获取文本的配置项\n * @param cfg 节点的配置项\n * @param labelCfg 文本的配置项\n * @param group 父容器,label 的定位可能与图形相关\n */\n getLabelStyle: function getLabelStyle(cfg, labelCfg, group) {\n var calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group);\n var attrName = \"\".concat(this.itemType, \"Label\"); // 取 nodeLabel,edgeLabel 的配置项\n\n var defaultStyle = _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"][attrName] ? _global__WEBPACK_IMPORTED_MODULE_1__[\"default\"][attrName].style : null;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, defaultStyle), calculateStyle), labelCfg.style);\n },\n\n /**\n * 获取图形的配置项\n * @param cfg\n */\n getShapeStyle: function getShapeStyle(cfg) {\n return cfg.style;\n },\n\n /**\n * 更新节点,包含文本\n * @override\n * @param {Object} cfg 节点/边的配置项\n * @param {G6.Item} item 节点/边\n */\n update: function update(cfg, item, updateType) {\n this.updateShapeStyle(cfg, item, updateType);\n this.updateLabel(cfg, item, updateType);\n },\n updateShapeStyle: function updateShapeStyle(cfg, item, updateType) {\n var _a;\n\n var group = item.getContainer();\n var shape = item.getKeyShape();\n var shapeStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, shape.attr(), cfg.style);\n\n var _loop_1 = function _loop_1(key) {\n var _b;\n\n var style = shapeStyle[key];\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(style)) {\n // 更新图元素样式,支持更新子元素\n var subShape = ((_a = group['shapeMap']) === null || _a === void 0 ? void 0 : _a[key]) || group.find(function (element) {\n return element.get('name') === key;\n });\n subShape === null || subShape === void 0 ? void 0 : subShape.attr(style);\n } else {\n shape.attr((_b = {}, _b[key] = style, _b));\n }\n };\n\n for (var key in shapeStyle) {\n _loop_1(key);\n }\n },\n updateLabel: function updateLabel(cfg, item, updateType) {\n var _a, _b; // 防止 cfg.label = \"\" 的情况\n\n\n if (cfg.label || cfg.label === '') {\n var group = item.getContainer();\n var _c = (this.mergeStyle || this.getOptions({}, updateType) || {}).labelCfg,\n labelCfg = _c === void 0 ? {} : _c;\n var labelClassName_1 = this.itemType + CLS_LABEL_SUFFIX;\n var label = group['shapeMap'][labelClassName_1] || group.find(function (ele) {\n return ele.get('className') === labelClassName_1;\n });\n var labelBgClassname_1 = this.itemType + CLS_LABEL_BG_SUFFIX;\n var labelBg = group['shapeMap'][labelBgClassname_1] || group.find(function (ele) {\n return ele.get('className') === labelBgClassname_1;\n }); // 若传入的新配置中有 label,(用户没传入但原先有 label,label 也会有值)\n\n if (!label) {\n // 若原先不存在 label,则绘制一个新的 label\n var newLabel = this.drawLabel(cfg, group);\n newLabel.set('className', labelClassName_1);\n group['shapeMap'][labelClassName_1] = newLabel;\n } else {\n // 若原先存在 label,则更新样式。与 getLabelStyle 不同在于这里需要融合当前 label 的样式\n // 融合 style 以外的属性:position, offset, ...\n if (!updateType || updateType === 'bbox|label' || this.itemType === 'edge' && updateType !== 'style') {\n labelCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"])(labelCfg, cfg.labelCfg);\n } // 获取位置信息\n\n\n var calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group); // 取 nodeLabel,edgeLabel 的配置项\n\n var cfgStyle = (_a = cfg.labelCfg) === null || _a === void 0 ? void 0 : _a.style; // const cfgBgStyle = labelCfg.style?.background;\n // 需要融合当前\b label 的样式 label.attr()。不再需要全局/默认样式,因为已经应用在当前的 label 上\n\n var labelStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, calculateStyle), cfgStyle);\n\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate; // 计算 label 的旋转矩阵\n\n if (!isNaN(rotate) && rotate !== '') {\n // if G 4.x define the rotateAtStart, use it directly instead of using the following codes\n var rotateMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n rotateMatrix = transform(rotateMatrix, [['t', -labelStyle.x, -labelStyle.y], ['r', rotate], ['t', labelStyle.x, labelStyle.y]]);\n labelStyle.matrix = rotateMatrix;\n label.attr(labelStyle);\n } else {\n if (((_b = label.getMatrix()) === null || _b === void 0 ? void 0 : _b[4]) !== 1) {\n label.resetMatrix();\n }\n\n label.attr(labelStyle);\n }\n\n if (!labelBg) {\n if (labelStyle.background) {\n labelBg = this.drawLabelBg(cfg, group, label);\n labelBg.set('classname', labelBgClassname_1);\n group['shapeMap'][labelBgClassname_1] = labelBg;\n label.toFront();\n }\n } else if (labelStyle.background) {\n var calculateBgStyle = this.getLabelBgStyleByPosition(label, labelCfg);\n labelBg.attr(calculateBgStyle);\n } else {\n group.removeChild(labelBg);\n }\n }\n }\n },\n // update(cfg, item) // 默认不定义\n afterUpdate: function afterUpdate(cfg, item) {},\n\n /**\n * 设置节点的状态,主要是交互状态,业务状态请在 draw 方法中实现\n * 单图形的节点仅考虑 selected、active 状态,有其他状态需求的用户自己复写这个方法\n * @override\n * @param {String} name 状态名称\n * @param {String | Boolean} value 状态值\n * @param {G6.Item} item 节点\n */\n setState: function setState(name, value, item) {\n var _a, _b;\n\n var _c;\n\n var shape = item.get('keyShape');\n if (!shape || shape.destroyed) return;\n var type = item.getType();\n var stateName = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isBoolean\"])(value) ? name : \"\".concat(name, \":\").concat(value);\n var shapeStateStyle = this.getStateStyle(stateName, item);\n var itemStateStyle = item.getStateStyle(stateName); // const originStyle = item.getOriginStyle();\n // 不允许设置一个不存在的状态\n\n if (!itemStateStyle && !shapeStateStyle) {\n return;\n } // 要设置或取消的状态的样式\n // 当没有 state 状态时,默认使用 model.stateStyles 中的样式\n\n\n var styles = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, itemStateStyle || shapeStateStyle);\n var group = item.getContainer(); // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值。使用对象检索更快\n\n var keptAttrs = {\n x: 1,\n y: 1,\n cx: 1,\n cy: 1,\n matrix: 1\n };\n\n if (type === 'combo') {\n keptAttrs.r = 1;\n keptAttrs.width = 1;\n keptAttrs.height = 1;\n }\n\n if (value) {\n var _loop_2 = function _loop_2(key) {\n var _d;\n\n var style = styles[key];\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(style) && !ARROWS.includes(key)) {\n var subShape = ((_c = group['shapeMap']) === null || _c === void 0 ? void 0 : _c[key]) || group.find(function (element) {\n return element.get('name') === key;\n });\n subShape === null || subShape === void 0 ? void 0 : subShape.attr(style);\n } else {\n // 非纯对象,则认为是设置到 keyShape 上面的\n shape.attr((_d = {}, _d[key] = style, _d));\n }\n }; // style 为要设置的状态的样式\n\n\n for (var key in styles) {\n _loop_2(key);\n }\n } else {\n // 所有生效的 state 的样式\n var enableStatesStyle = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_4__[\"cloneBesidesImg\"])(item.getCurrentStatesStyle());\n var model = item.getModel(); // 原始样式\n\n var originStyle_1 = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, model.style, Object(_util_graphic__WEBPACK_IMPORTED_MODULE_4__[\"cloneBesidesImg\"])(item.getOriginStyle()));\n var keyShapeName_1 = shape.get('name'); // cloning shape.attr(), keys.forEach to avoid cloning the img attr, which leads to maximum clone heap #2383\n // const keyShapeStyles = clone(shape.attr())\n\n var shapeAttrs_1 = shape.attr();\n var keyShapeStyles_1 = {};\n Object.keys(shapeAttrs_1).forEach(function (key) {\n if (key === 'img') return;\n var attr = shapeAttrs_1[key];\n\n if (attr && _typeof(attr) === 'object') {\n keyShapeStyles_1[key] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(attr);\n } else {\n keyShapeStyles_1[key] = attr;\n }\n }); // 已有样式 - 要取消的状态的样式\n\n var filtetDisableStatesStyle = {};\n\n var _loop_3 = function _loop_3(p) {\n var style = styles[p];\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(style) && !ARROWS.includes(p)) {\n var subShape_1 = group['shapeMap'][p] || group.find(function (ele) {\n return ele.get('name') === p;\n });\n\n if (subShape_1) {\n var subShapeStyles_1 = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_4__[\"cloneBesidesImg\"])(subShape_1.attr());\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(style, function (v, key) {\n if (p === keyShapeName_1 && keyShapeStyles_1[key] && !keptAttrs[key]) {\n delete keyShapeStyles_1[key];\n var value_1 = originStyle_1[p][key] || SHAPES_DEFAULT_ATTRS[type][key];\n shape.attr(key, value_1);\n } else if (subShapeStyles_1[key] || subShapeStyles_1[key] === 0) {\n delete subShapeStyles_1[key];\n var value_2 = originStyle_1[p][key] || SHAPES_DEFAULT_ATTRS[type][key];\n subShape_1.attr(key, value_2);\n }\n });\n filtetDisableStatesStyle[p] = subShapeStyles_1;\n }\n } else {\n if (keyShapeStyles_1[p] && !keptAttrs[p]) {\n delete keyShapeStyles_1[p];\n var value_3 = originStyle_1[p] || (originStyle_1[keyShapeName_1] ? originStyle_1[keyShapeName_1][p] : undefined) || SHAPES_DEFAULT_ATTRS[type][p];\n shape.attr(p, value_3);\n }\n }\n }; // styles 为要取消的状态的样式\n\n\n for (var p in styles) {\n _loop_3(p);\n } // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值后,\n // 如果 keyShape 有 name 属性,则 filtetDisableStatesStyle 的格式为 { keyShapeName: {} }\n // 否则为普通对象\n\n\n if (!keyShapeName_1) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])(filtetDisableStatesStyle, keyShapeStyles_1);\n } else {\n filtetDisableStatesStyle[keyShapeName_1] = keyShapeStyles_1;\n }\n\n for (var key in enableStatesStyle) {\n if (keptAttrs[key]) continue;\n var enableStyle = enableStatesStyle[key];\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(enableStyle) || ARROWS.includes(key)) {\n // 把样式属性merge到keyShape中\n if (!keyShapeName_1) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])(originStyle_1, (_a = {}, _a[key] = enableStyle, _a));\n } else {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])(originStyle_1[keyShapeName_1], (_b = {}, _b[key] = enableStyle, _b));\n delete originStyle_1[key];\n }\n\n delete enableStatesStyle[key];\n }\n }\n\n var originstyles = {};\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"])(originstyles, originStyle_1, filtetDisableStatesStyle, enableStatesStyle);\n var keyShapeSetted = false;\n\n var _loop_4 = function _loop_4(originKey) {\n var _e, _f;\n\n var style = originstyles[originKey];\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(style) && !ARROWS.includes(originKey)) {\n var subShape = group['shapeMap'][originKey] || group.find(function (ele) {\n return ele.get('name') === originKey;\n });\n\n if (subShape) {\n // The text's position and matrix is not allowed to be affected by states\n if (subShape.get('type') === 'text' || subShape.get('labelRelated')) {\n delete style.x;\n delete style.y;\n delete style.matrix;\n }\n\n if (originKey === keyShapeName_1) {\n if (type === 'combo') {\n delete style.r;\n delete style.width;\n delete style.height;\n }\n\n keyShapeSetted = true;\n }\n\n subShape.attr(style);\n }\n } else if (!keyShapeSetted) {\n var value_4 = style || SHAPES_DEFAULT_ATTRS[type][originKey]; // 当更新 combo 状态时,当不存在 keyShapeName 时候,则认为是设置到 keyShape 上面的\n\n if (type === 'combo') {\n if (!keyShapeName_1) {\n shape.attr((_e = {}, _e[originKey] = value_4, _e));\n }\n } else {\n shape.attr((_f = {}, _f[originKey] = value_4, _f));\n }\n }\n };\n\n for (var originKey in originstyles) {\n _loop_4(originKey);\n }\n }\n },\n\n /**\n * 获取不同状态下的样式\n *\n * @param {string} name 状态名称\n * @param {Item} item Node或Edge的实例\n * @return {object} 样式\n */\n getStateStyle: function getStateStyle(name, item) {\n var model = item.getModel();\n var type = item.getType();\n\n var _a = this.getOptions(model),\n stateStyles = _a.stateStyles,\n _b = _a.style,\n style = _b === void 0 ? {} : _b;\n\n var modelStateStyle = model.stateStyles ? model.stateStyles[name] : stateStyles && stateStyles[name];\n\n if (type === 'combo') {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(modelStateStyle);\n }\n\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"mix\"])({}, style, modelStateStyle);\n },\n\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 锚点的数组,如果为 null,则没有锚点\n */\n getAnchorPoints: function getAnchorPoints(cfg) {\n var _a, _b;\n\n var anchorPoints = (cfg === null || cfg === void 0 ? void 0 : cfg.anchorPoints) || ((_a = this.getCustomConfig(cfg)) === null || _a === void 0 ? void 0 : _a.anchorPoints) || ((_b = this.options) === null || _b === void 0 ? void 0 : _b.anchorPoints);\n return anchorPoints;\n }\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/shapeBase.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! insert-css */ \"./node_modules/insert-css/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(insert_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\ntypeof document !== 'undefined' && insert_css__WEBPACK_IMPORTED_MODULE_3___default()(\"\\n .g6-annotation-container {\\n background-color: rgba(255, 255, 255, 0.3);\\n padding: 8px;\\n }\\n .g6-annotation-wrapper {\\n background-color: #fff;\\n box-shadow: 0 0 8px rgba(0, 0, 0, 0.85);\\n }\\n .g6-annotation-header-wapper {\\n height: fit-content;\\n width: 100%;\\n background-color: #5B8FF9;\\n display: inline-flex;\\n cursor: move;\\n }\\n .g6-annotation-title {\\n margin: 4px 40px 4px 8px;\\n cursor: text;\\n min-width: 32px;\\n }\\n .g6-annotation-collapse {\\n margin: 4px;\\n cursor: pointer;\\n }\\n .g6-annotation-expand {\\n margin: 4px;\\n cursor: pointer;\\n }\\n .g6-annotation-close {\\n margin: 4px 8px 4px 0;\\n cursor: pointer;\\n }\\n .g6-annotation-content {\\n padding: 8px;\\n width: fit-content;\\n cursor: text;\\n word-break: break-all;\\n min-width: 32px;\\n }\\n .g6-annotation-title-input-wrapper {\\n margin: 4px 40px 4px 8px;\\n }\\n .g6-annotation-content-input {\\n height: 100%;\\n word-break: break-all;\\n }\\n .g6-annotation-content-input-wrapper {\\n margin: 8px;\\n height: 100%;\\n }\\n\");\nvar CANVAS_ANNOTATION_ID = 'canvas-annotation';\nvar Annotation = /** @class */function (_super) {\n __extends(Annotation, _super);\n function Annotation(config) {\n return _super.call(this, config) || this;\n }\n Annotation.prototype.getDefaultCfgs = function () {\n return {\n trigger: 'click',\n editable: true,\n itemHighlightState: 'highlight',\n linkHighlightStyle: {\n shadowColor: '#5B8FF9',\n shadowBlur: 10\n },\n cardCfg: {\n minHeight: 60,\n width: 'fit-content',\n height: 'fit-content',\n collapseType: 'minimize',\n closeType: 'hide',\n borderRadius: 5,\n maxTitleLength: 20\n }\n };\n };\n // class-methods-use-this\n Annotation.prototype.getEvents = function () {\n var events = {\n 'viewportchange': 'updateLinks',\n 'afterlayout': 'updateLinks',\n 'aftergraphrefreshposition': 'updateLinks',\n 'afterupdateitem': 'updateLink',\n 'afterchangedata': 'onGraphDataChange',\n 'afteritemvisibilitychange': 'onGraphItemVisibilityChange'\n };\n switch (this.get('trigger')) {\n case 'click':\n events = __assign(__assign({}, events), {\n 'node:click': 'showAnnotation',\n 'edge:click': 'showAnnotation'\n });\n }\n return events;\n };\n Annotation.prototype.getDOMContent = function (cfg) {\n if (this.destroyed) return;\n var collapsed = cfg.collapsed,\n maxWidth = cfg.maxWidth,\n _a = cfg.title,\n title = _a === void 0 ? '' : _a,\n _b = cfg.content,\n content = _b === void 0 ? '' : _b,\n _c = cfg.borderRadius,\n r = _c === void 0 ? 5 : _c;\n var collapseExpandDOM = collapsed ? \"

+

\" : \"

-

\";\n var contentDOM = collapsed ? '' : \"

\".concat(content, \"

\");\n var closeDOM = \"

x

\";\n var borderRadius = collapsed ? \"\".concat(r, \"px\") : \"\".concat(r, \"px \").concat(r, \"px 0 0\");\n return \"
\\n \\n

\").concat(title, \"

\\n \").concat(collapseExpandDOM, \"\\n \").concat(closeDOM, \"\\n
\\n \").concat(contentDOM, \"\\n \");\n };\n Annotation.prototype.init = function () {\n var self = this;\n if (self.destroyed) return;\n var graph = self.get('graph');\n var graphCantainer = graph.getContainer();\n var container = self.get('container');\n var containerCfg = this.get('containerCfg');\n if (containerCfg) {\n container = this.createContainer();\n graphCantainer.appendChild(container);\n } else {\n container = graphCantainer;\n }\n this.set('container', container);\n // 绘制连接 annotation 和元素的连线的画布\n var graphContainerBBox = graphCantainer.getBoundingClientRect();\n var linkCanvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_4__[\"Canvas\"]({\n container: graphCantainer,\n width: graphContainerBBox.right - graphContainerBBox.left,\n height: graphContainerBBox.bottom - graphContainerBBox.top\n });\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(linkCanvas.get('el'), {\n position: 'absolute',\n top: 0,\n left: 0,\n pointerEvents: 'none'\n });\n // 需要传入 self,无法 removeEventListener,只能在内部判断 self 被销毁则不继续\n window.addEventListener('resize', Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"debounce\"])(function () {\n return self.resizeCanvas(self);\n }, 100));\n var linkGroup = linkCanvas.addGroup({\n id: 'annotation-link-group'\n });\n self.set('linkGroup', linkGroup);\n self.set('canvas', linkCanvas);\n if (!self.get('getTitle')) {\n self.set('getTitle', function (item) {\n var _a;\n var _b = ((_a = item === null || item === void 0 ? void 0 : item.getModel) === null || _a === void 0 ? void 0 : _a.call(item)) || {},\n label = _b.label,\n id = _b.id;\n return label || id || '-';\n });\n }\n if (!self.get('getContent')) {\n self.set('getContent', function (item) {\n var _a, _b;\n if (!item) return '-';\n var _c = ((_a = item.getModel) === null || _a === void 0 ? void 0 : _a.call(item)) || {},\n label = _c.label,\n id = _c.id;\n var type = (_b = item.getType) === null || _b === void 0 ? void 0 : _b.call(item);\n var suffix = type ? \"\".concat(type, \": \") : '';\n return \"\".concat(suffix).concat(label || id || '');\n });\n }\n // init with defaultData\n var defaultData = self.get('defaultData');\n if (defaultData) this.readData(defaultData);\n };\n Annotation.prototype.createContainer = function () {\n var _this = this;\n if (this.destroyed) return;\n var containerCfg = this.get('containerCfg');\n var graph = this.get('graph');\n var graphContainer = graph.getContainer();\n var _a = graphContainer.getBoundingClientRect(),\n gLeft = _a.left,\n gRight = _a.right,\n gTop = _a.top,\n gBottom = _a.bottom;\n var graphContainerHeight = gBottom - gTop;\n var graphContainerWidth = gRight - gLeft;\n var _b = containerCfg.position,\n position = _b === void 0 ? 'top' : _b,\n _c = containerCfg.offsetX,\n offsetX = _c === void 0 ? 0 : _c,\n _d = containerCfg.offsetY,\n offsetY = _d === void 0 ? 0 : _d,\n otherStyle = __rest(containerCfg, [\"position\", \"offsetX\", \"offsetY\"]);\n var _e = containerCfg.height,\n height = _e === void 0 ? 'fit-content' : _e,\n _f = containerCfg.width,\n width = _f === void 0 ? graph.getWidth() : _f;\n if (height === '100%') height = graphContainerHeight;\n if (width === '100%') width = graphContainerWidth;\n var maxHeight = 'unset',\n maxWidth = 'unset';\n var containerPosition = {};\n switch (position) {\n case 'right':\n maxHeight = \"\".concat(graphContainerHeight, \"px\");\n containerPosition = {\n top: 0,\n right: 0\n };\n containerPosition.right += gLeft + offsetX;\n containerPosition.top += gTop + offsetY;\n break;\n case 'bottom':\n maxWidth = \"\".concat(graphContainerWidth, \"px\");\n containerPosition = {\n bottom: 0,\n left: 0\n };\n containerPosition.left += gLeft + offsetX;\n containerPosition.bottom += gTop + offsetY;\n break;\n case 'top':\n maxWidth = \"\".concat(graphContainerWidth, \"px\");\n case 'left':\n maxHeight = \"\".concat(graphContainerHeight, \"px\");\n default:\n containerPosition = {\n top: 0,\n left: 0\n };\n containerPosition.left += gLeft + offsetX;\n containerPosition.top += gTop + offsetY;\n break;\n }\n Object.keys(containerPosition).forEach(function (key) {\n containerPosition[key] = \"\".concat(containerPosition[key], \"px\");\n });\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\"));\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(container, __assign(__assign({\n position: 'absolute',\n display: position === 'top' || position === 'bottom' ? 'inline-flex' : 'unset',\n width: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(width) ? \"\".concat(width, \"px\") : width,\n height: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(height) ? \"\".concat(height, \"px\") : height,\n maxHeight: maxHeight,\n maxWidth: maxWidth,\n overflow: 'scroll'\n }, containerPosition), otherStyle));\n graphContainer.appendChild(container);\n container.addEventListener('scroll', function (e) {\n _this.updateLinks();\n });\n return container;\n };\n Annotation.prototype.resizeCanvas = function (self) {\n // 仅在 resize 完成后进行调整\n clearTimeout(self.resizeTimer);\n self.resizeTimer = setTimeout(function () {\n if (!self || self.destroyed) return;\n var cBBox = self.get('container').getBoundingClientRect();\n var newWidth = cBBox.right - cBBox.left;\n var newHeight = cBBox.bottom - cBBox.top;\n self.get('canvas').changeSize(newWidth, newHeight);\n self.updateOutsideCards(self);\n }, 250);\n };\n /**\n * 更新超出视口范围的卡片位置\n * @param selfObj 当前 annotation 插件对象。外部调用不需要传入该参数\n */\n Annotation.prototype.updateOutsideCards = function (selfObj) {\n var self = selfObj || this;\n var cardInfoMap = self.get('cardInfoMap') || {};\n var graph = self.get('graph');\n var graphLeftTopCanvas = graph.getPointByCanvas(0, 0);\n var graphRightBottomCanvas = graph.getPointByCanvas(graph.getWidth(), graph.getHeight());\n var _a = graph.getClientByPoint(graphLeftTopCanvas.x, graphLeftTopCanvas.y),\n graphLeft = _a.x,\n graphTop = _a.y;\n var _b = graph.getClientByPoint(graphRightBottomCanvas.x, graphRightBottomCanvas.y),\n graphRight = _b.x,\n graphBottom = _b.y;\n Object.values(cardInfoMap).forEach(function (cardInfo) {\n var card = cardInfo.card;\n if (!card) return;\n var style = card.style;\n var left = px2Num(style.left);\n var top = px2Num(style.top);\n var _a = card.getBoundingClientRect(),\n width = _a.width,\n height = _a.height;\n var newLeft = left;\n var newTop = top;\n if (left + width > graphRight - graphLeft) {\n newLeft = graphRight - graphLeft - width;\n }\n if (left < 0) {\n newLeft = 0;\n }\n if (top + height > graphBottom - graphTop) {\n newTop = graphBottom - graphTop - height;\n }\n if (top < 0) {\n newTop = 0;\n }\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(card, {\n left: \"\".concat(newLeft, \"px\"),\n top: \"\".concat(newTop, \"px\")\n });\n });\n self.updateLinks();\n };\n Annotation.prototype.showAnnotation = function (evt) {\n if (this.destroyed) return;\n var item = evt.item;\n this.toggleAnnotation(item);\n };\n Annotation.prototype.hideCards = function () {\n var self = this;\n if (self.destroyed) return;\n var cardInfoMap = self.get('cardInfoMap') || {};\n Object.keys(cardInfoMap).forEach(function (itemId) {\n self.hideCard(itemId);\n });\n };\n Annotation.prototype.toggleAnnotation = function (item, cfg) {\n var _a, _b;\n if (cfg === void 0) {\n cfg = {};\n }\n var self = this;\n if (self.destroyed) return;\n var cardInfoMap = self.get('cardInfoMap') || {};\n var graph = self.get('graph');\n var container = self.get('container');\n var containerCfg = self.get('containerCfg');\n var _c = Object.assign({}, self.get('cardCfg') || {}, cfg),\n minHeight = _c.minHeight,\n minWidth = _c.minWidth,\n width = _c.width,\n height = _c.height,\n _d = _c.collapsed,\n collapsed = _d === void 0 ? false : _d,\n propsX = _c.x,\n propsY = _c.y,\n propsTitle = _c.title,\n propsContent = _c.content,\n maxTitleLength = _c.maxTitleLength,\n defaultBegin = _c.defaultBegin,\n otherCardCfg = __rest(_c, [\"minHeight\", \"minWidth\", \"width\", \"height\", \"collapsed\", \"x\", \"y\", \"title\", \"content\", \"maxTitleLength\", \"defaultBegin\"]);\n var linkGroup = self.get('linkGroup');\n var rows = this.get('rows') || [[]];\n var isCanvas = (_a = item.isCanvas) === null || _a === void 0 ? void 0 : _a.call(item);\n var itemId = isCanvas ? CANVAS_ANNOTATION_ID : item.getID();\n var _e = cardInfoMap[itemId] || {},\n card = _e.card,\n link = _e.link,\n x = _e.x,\n y = _e.y,\n title = _e.title,\n content = _e.content;\n var getTitle = this.get('getTitle');\n var getContent = this.get('getContent');\n var getContentPlaceholder = this.get('getContentPlaceholder') || function () {\n return '';\n };\n var getTitlePlaceHolder = this.get('getTitlePlaceHolder') || function () {\n return '';\n };\n var contentPlaceholder = getContentPlaceholder(item);\n var titlePlaceholder = getTitlePlaceHolder(item);\n var newCard = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(this.getDOMContent(__assign({\n itemId: itemId,\n collapsed: collapsed,\n title: ((_b = title || propsTitle || (getTitle === null || getTitle === void 0 ? void 0 : getTitle(item))) === null || _b === void 0 ? void 0 : _b.substr(0, maxTitleLength)) || titlePlaceholder,\n content: content || propsContent || (getContent === null || getContent === void 0 ? void 0 : getContent(item)) || contentPlaceholder\n }, otherCardCfg)));\n var minHeightPx = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(minHeight) ? \"\".concat(minHeight, \"px\") : minHeight;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(newCard, {\n minHeight: collapsed ? 'unset' : minHeightPx,\n minWidth: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(minWidth) ? \"\".concat(minWidth, \"px\") : minWidth,\n height: height,\n width: width\n });\n var exist = !!card;\n if (exist) {\n // 移除相应连线\n link === null || link === void 0 ? void 0 : link.remove(true);\n // 替换原来的卡片\n container.replaceChild(newCard, card);\n } else {\n container.appendChild(newCard);\n }\n var containerBBox;\n if (!containerCfg) {\n containerBBox = container.getBoundingClientRect() || {};\n if (propsX !== undefined && propsY !== undefined) {\n // 使用配置的位置\n x = propsX;\n y = propsY;\n } else if (!exist && !isCanvas) {\n // 第一次创建,且无 conatiner,初始化位置\n var containerTop = containerBBox.top;\n var _f = defaultBegin || {},\n beginLeft = _f.left,\n _g = _f.right,\n propsBeginRight = _g === void 0 ? 16 : _g,\n _h = _f.top,\n propsBeginTop = _h === void 0 ? 8 : _h,\n beginBottom = _f.bottom;\n var beginRight = propsBeginRight;\n var beginTop = propsBeginTop;\n if (!isNaN(beginLeft)) {\n beginRight = container.scrollWidth - beginLeft;\n }\n if (!isNaN(beginBottom)) {\n beginTop = container.scrollHeight - beginBottom;\n }\n var cardWidth = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(minWidth) ? minWidth : 100;\n x = container.scrollWidth - newCard.scrollWidth - (rows.length - 1) * cardWidth - beginRight;\n var currentRow = rows[rows.length - 1];\n var lastCardBBox = (currentRow[currentRow.length - 1] || {}).bbox;\n y = (lastCardBBox === null || lastCardBBox === void 0 ? void 0 : lastCardBBox.bottom) - containerTop || beginTop;\n }\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(newCard, {\n position: 'absolute',\n left: \"\".concat(x, \"px\"),\n top: \"\".concat(y, \"px\"),\n cusor: containerCfg ? 'unset' : 'move'\n });\n }\n this.bindListener(newCard, itemId);\n var cardBBox = newCard.getBoundingClientRect();\n if (!isCanvas) {\n // 创建相关连线\n var path = getPathItem2Card(item, cardBBox, graph, this.get('canvas'));\n var linkStyle = this.get('linkStyle');\n link = linkGroup.addShape('path', {\n attrs: __assign({\n lineWidth: 1,\n lineDash: [5, 5],\n stroke: '#ccc',\n path: path\n }, linkStyle)\n });\n }\n cardInfoMap[itemId] = __assign(__assign({}, cardInfoMap[itemId] || {}), {\n id: itemId,\n collapsed: collapsed,\n card: newCard,\n link: link,\n x: x,\n y: y,\n cardBBox: cardBBox,\n content: content || propsContent,\n title: title || propsTitle,\n contentPlaceholder: contentPlaceholder,\n titlePlaceholder: titlePlaceholder,\n isCanvas: isCanvas\n });\n self.set('cardInfoMap', cardInfoMap);\n if (containerCfg) {\n this.updateCardPositionsInConatainer();\n this.updateLinks();\n } else {\n var hasPropsPosition = !isNaN(propsX) && !isNaN(propsY);\n if (!exist && !isCanvas && !hasPropsPosition) {\n // 没有 container、新增 card 时,记录当前列中最下方位置,方便换行\n var _j = containerBBox.bottom,\n containerBottom = _j === void 0 ? 0 : _j,\n containerTop = containerBBox.top;\n rows[rows.length - 1].push({\n id: itemId,\n bbox: cardBBox\n });\n if (cardBBox.top > containerBottom - containerTop - cardBBox.height - 16) rows.push([]);\n this.set('rows', rows);\n }\n }\n this.updateCardSize(itemId);\n var onAnnotationChange = this.get('onAnnotationChange');\n onAnnotationChange === null || onAnnotationChange === void 0 ? void 0 : onAnnotationChange(cardInfoMap[itemId], exist ? 'update' : 'create');\n };\n Annotation.prototype.updateCardPositionsInConatainer = function () {\n if (this.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var container = this.get('container');\n var position = this.get('containerCfg').position;\n var containerWidth = container.getBoundingClientRect().width;\n var computeStyle = getComputedStyle(container);\n var sidePadding = px2Num(computeStyle['paddingLeft']) + px2Num(computeStyle['paddingRight']);\n containerWidth -= sidePadding;\n Object.values(cardInfoMap).forEach(function (_a) {\n var card = _a.card;\n var cardWidth = card.getBoundingClientRect().width;\n switch (position) {\n case 'right':\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(card, {\n marginLeft: containerWidth ? \"\".concat(containerWidth - cardWidth, \"px\") : '0px'\n });\n break;\n case 'top':\n case 'bottom':\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(card, {\n marginLeft: '8px'\n });\n default:\n break;\n }\n });\n };\n Annotation.prototype.handleExpandCollapseCard = function (id) {\n if (this.destroyed) return;\n var graph = this.get('graph');\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var collapsed = cardInfoMap[id].collapsed;\n var item = graph.findById(id);\n if (!item) return;\n var collapseType = this.get('cardCfg').collapseType;\n if (collapseType === 'hide' && !collapsed) {\n // collapse 行为被配置为隐藏\n this.hideCard(id);\n } else {\n this.toggleAnnotation(item, {\n collapsed: !collapsed\n });\n }\n cardInfoMap[id] = __assign(__assign({}, cardInfoMap[id]), {\n collapsed: !collapsed\n });\n };\n /**\n * 隐藏标注卡片,下次打开还保留隐藏前的配置,包括文本内容、位置等\n * @param id 卡片 id,即元素(节点/边)的 id\n * @returns\n */\n Annotation.prototype.hideCard = function (id) {\n if (this.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap || !cardInfoMap[id]) return;\n var _a = cardInfoMap[id],\n card = _a.card,\n link = _a.link;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(card, {\n display: 'none'\n });\n link === null || link === void 0 ? void 0 : link.hide();\n var onAnnotationChange = this.get('onAnnotationChange');\n onAnnotationChange(cardInfoMap[id], 'hide');\n };\n /**\n * 移除标注卡片,下一次生成时将被初始化\n * @param id 卡片 id,即元素(节点/边)的 id\n * @returns\n */\n Annotation.prototype.removeCard = function (id) {\n if (this.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var cardInfo = cardInfoMap[id];\n var card = cardInfo.card,\n link = cardInfo.link;\n var container = this.get('container');\n container.removeChild(card);\n link === null || link === void 0 ? void 0 : link.remove(true);\n delete cardInfoMap[id];\n var onAnnotationChange = this.get('onAnnotationChange');\n onAnnotationChange(cardInfo, 'remove');\n };\n Annotation.prototype.bindListener = function (card, itemId) {\n var _this = this;\n if (this.destroyed) return;\n card.addEventListener('mousemove', function (e) {\n // icon 的鼠标进入监听,方便外部加 tooltip\n var iconType;\n if (e.target.className === 'g6-annotation-collapse') {\n iconType = 'collapse';\n } else if (e.target.className === 'g6-annotation-expand') {\n iconType = 'expand';\n } else if (e.target.className === 'g6-annotation-close') {\n iconType = 'close';\n }\n if (iconType) {\n var _a = _this.get('cardCfg').onMouseEnterIcon,\n onMouseEnterIcon = _a === void 0 ? function () {} : _a;\n onMouseEnterIcon(e, itemId, iconType);\n }\n });\n card.addEventListener('mouseout', function (e) {\n // icon 的鼠标移出监听,方便外部加 tooltip\n var iconType;\n if (e.target.className === 'g6-annotation-collapse') {\n iconType = 'collapse';\n } else if (e.target.className === 'g6-annotation-expand') {\n iconType = 'expand';\n } else if (e.target.className === 'g6-annotation-close') {\n iconType = 'close';\n }\n if (iconType) {\n var _a = _this.get('cardCfg').onMouseLeaveIcon,\n onMouseLeaveIcon = _a === void 0 ? function () {} : _a;\n onMouseLeaveIcon(e, itemId, iconType);\n }\n });\n // mouseenter and mouseleave to highlight the corresponding items\n card.addEventListener('mouseenter', function (e) {\n var cardInfoMap = _this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var graph = _this.get('graph');\n var item = graph.findById(itemId);\n if (item) {\n var itemHighlightState = _this.get('itemHighlightState');\n graph.setItemState(item, itemHighlightState, true);\n }\n var link = cardInfoMap[itemId].link;\n if (link) {\n var linkHighlightStyle = _this.get('linkHighlightStyle') || {};\n link.attr(linkHighlightStyle);\n }\n });\n card.addEventListener('mouseleave', function (e) {\n var cardInfoMap = _this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var graph = _this.get('graph');\n var item = graph.findById(itemId);\n if (item) {\n var itemHighlightState = _this.get('itemHighlightState');\n graph.setItemState(item, itemHighlightState, false);\n }\n var link = cardInfoMap[itemId].link;\n if (link) {\n var linkHighlightStyle = _this.get('linkHighlightStyle') || {};\n Object.keys(linkHighlightStyle).forEach(function (key) {\n link.attr(key, undefined);\n link.attr(key, undefined);\n });\n var linkStyle = _this.get('linkStyle');\n link.attr(linkStyle);\n }\n });\n card.addEventListener('click', function (e) {\n var onClickIcon = (_this.get('cardCfg') || {}).onClickIcon;\n if (e.target.className === 'g6-annotation-collapse' || e.target.className === 'g6-annotation-expand') {\n // collapse & expand\n var collapseType = _this.get('cardCfg').collapseType;\n if (collapseType === 'hide') {\n _this.hideCard(itemId);\n } else {\n _this.handleExpandCollapseCard(itemId);\n }\n onClickIcon === null || onClickIcon === void 0 ? void 0 : onClickIcon(e, itemId, e.target.className === 'g6-annotation-collapse' ? 'collapse' : 'expand');\n } else if (e.target.className === 'g6-annotation-close') {\n // close\n var closeType = _this.get('cardCfg').closeType;\n if (closeType === 'remove') {\n _this.removeCard(itemId);\n } else {\n _this.hideCard(itemId);\n }\n onClickIcon === null || onClickIcon === void 0 ? void 0 : onClickIcon(e, itemId, 'close');\n }\n });\n // dblclick to edit the title and content text\n var editable = this.get('editable');\n if (editable) {\n card.addEventListener('dblclick', function (e) {\n var cardInfoMap = _this.get('cardInfoMap');\n var _a = (_this.get('cardCfg') || {}).maxTitleLength,\n maxTitleLength = _a === void 0 ? 20 : _a;\n if (!cardInfoMap) return;\n var target = e.target;\n var targetClass = target.className;\n if (targetClass !== 'g6-annotation-title' && targetClass !== 'g6-annotation-content') return;\n var _b = targetClass === 'g6-annotation-title' ? target.getBoundingClientRect() : target.parentNode.getBoundingClientRect(),\n width = _b.width,\n height = _b.height;\n var computeStyle = getComputedStyle(target);\n var inputTag = targetClass === 'g6-annotation-title' ? 'input' : 'textarea';\n var input = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"<\".concat(inputTag, \" class=\\\"\").concat(targetClass, \"-input\\\" type=\\\"textarea\\\" style=\\\"width:\").concat(width, \"px; height: \").concat(height, \"px; min-width: 16px;\\\"/>\"));\n var inputWrapper = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\"));\n inputWrapper.appendChild(input);\n target.parentNode.replaceChild(inputWrapper, target);\n var cardInfo = cardInfoMap[itemId];\n var contentPlaceholder = cardInfo.contentPlaceholder,\n titlePlaceholder = cardInfo.titlePlaceholder,\n content = cardInfo.content,\n title = cardInfo.title;\n var value = content;\n if (targetClass === 'g6-annotation-title') {\n input.name = 'title';\n input.maxLength = maxTitleLength;\n value = title;\n } else {\n input.name = 'content';\n }\n if (value) {\n input.innerHTML = target.innerHTML;\n input.value = target.innerHTML;\n } else {\n input.placeholder = targetClass === 'g6-annotation-title' ? titlePlaceholder : contentPlaceholder;\n }\n input.focus();\n input.addEventListener('blur', function (blurEvt) {\n if (input.value) {\n target.innerHTML = input.value;\n cardInfo[input.name || 'title'] = input.value;\n }\n inputWrapper.parentNode.replaceChild(target, inputWrapper);\n _this.updateCardSize(itemId);\n var onAnnotationChange = _this.get('onAnnotationChange');\n onAnnotationChange === null || onAnnotationChange === void 0 ? void 0 : onAnnotationChange(cardInfo, 'update');\n });\n });\n }\n var unmovableClasses = ['g6-annotation-title', 'g6-annotation-content', 'g6-annotation-title-input', 'g6-annotation-content-input'];\n card.draggable = true;\n card.addEventListener('dragstart', function (e) {\n var targetClass = e.target.className;\n if (unmovableClasses.includes(targetClass)) return;\n var style = card.style;\n _this.set('dragging', {\n card: card,\n x: e.clientX,\n y: e.clientY,\n left: px2Num(style.left),\n top: px2Num(style.top)\n });\n });\n card.addEventListener('drag', function (e) {\n e.preventDefault();\n var cardInfoMap = _this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var clientX = e.clientX,\n clientY = e.clientY;\n var dragging = _this.get('dragging');\n if (isNaN(clientX) || isNaN(clientY) || !dragging) return;\n var x = dragging.x,\n y = dragging.y,\n left = dragging.left,\n top = dragging.top,\n draggingCard = dragging.card;\n var dx = clientX - x;\n var dy = clientY - y;\n left += dx;\n top += dy;\n var graph = _this.get('graph');\n var graphLeftTopCanvas = graph.getPointByCanvas(0, 0);\n var graphRightBottomCanvas = graph.getPointByCanvas(graph.getWidth(), graph.getHeight());\n var _a = graph.getClientByPoint(graphLeftTopCanvas.x, graphLeftTopCanvas.y),\n graphLeft = _a.x,\n graphTop = _a.y;\n var _b = graph.getClientByPoint(graphRightBottomCanvas.x, graphRightBottomCanvas.y),\n graphRight = _b.x,\n graphBottom = _b.y;\n var cardBBox = draggingCard.getBoundingClientRect();\n var cardWidth = cardBBox.right - cardBBox.left;\n var cardHeight = cardBBox.bottom - cardBBox.top;\n if (left > graphRight - graphLeft - cardWidth && dx > 0 || left < 0 && dx < 0) left -= dx;\n if (top > graphBottom - graphTop - cardHeight && dy > 0 || top < 0 && dy < 0) top -= dy;\n // 更新卡片位置\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(draggingCard, {\n left: \"\".concat(left, \"px\"),\n top: \"\".concat(top, \"px\"),\n visibility: 'hidden'\n });\n x = clientX;\n y = clientY;\n // 更新连线位置\n var link = (cardInfoMap[itemId] || {}).link;\n if (link) {\n var item = graph.findById(itemId);\n link.attr('path', getPathItem2Card(item, cardBBox, graph, _this.get('canvas')));\n }\n _this.set('dragging', {\n x: x,\n y: y,\n left: left,\n top: top,\n card: draggingCard\n });\n });\n var dragendListener = function dragendListener(e) {\n var cardInfoMap = _this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var dragging = _this.get('dragging');\n if (dragging) {\n // = dragend\n var left = dragging.left,\n top_1 = dragging.top,\n draggingCard = dragging.card;\n cardInfoMap[itemId].x = left;\n cardInfoMap[itemId].y = top_1;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(draggingCard, {\n visibility: 'visible'\n });\n _this.set('dragging', false);\n // 移动过的卡片从 rows 中移除,避免影响后续卡片出生位置\n var rows = _this.get(\"rows\");\n rows === null || rows === void 0 ? void 0 : rows.forEach(function (rowItems) {\n for (var i = rowItems.length - 1; i >= 0; i--) {\n if (rowItems[i].id === itemId) rowItems.splice(i, 1);\n }\n });\n var onAnnotationChange = _this.get('onAnnotationChange');\n onAnnotationChange === null || onAnnotationChange === void 0 ? void 0 : onAnnotationChange(cardInfoMap[itemId], 'update');\n }\n };\n card.addEventListener('dragend', dragendListener);\n };\n Annotation.prototype.updateCardSize = function (id) {\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var card = cardInfoMap[id].card;\n var width = card.getBoundingClientRect().width;\n var title = card.getElementsByClassName('g6-annotation-title')[0];\n if (title) {\n var computeStyle = getComputedStyle(title);\n var sideMargin = px2Num(computeStyle['marginLeft']);\n var titleWidth = title.getBoundingClientRect().width;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(title, {\n marginRight: \"\".concat(width - sideMargin - 24 - 16 - titleWidth, \"px\")\n });\n }\n };\n Annotation.prototype.updateLink = function (_a) {\n var item = _a.item;\n if (!item) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var canvas = this.get('canvas');\n var graph = this.get('graph');\n var id = item.getID();\n var _b = cardInfoMap[id] || {},\n link = _b.link,\n card = _b.card;\n if (link) {\n var path = getPathItem2Card(item, card.getBoundingClientRect(), graph, canvas);\n link.attr('path', path);\n }\n };\n Annotation.prototype.updateLinks = function () {\n var _this = this;\n if (this.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var graph = this.get('graph');\n Object.values(cardInfoMap).forEach(function (cardInfo) {\n var id = cardInfo.id;\n var item = graph.findById(id);\n _this.updateLink({\n item: item\n });\n });\n };\n Annotation.prototype.onGraphDataChange = function () {\n var _this = this;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var graph = this.get('graph');\n Object.values(cardInfoMap).forEach(function (info) {\n var id = info.id,\n card = info.card,\n isCanvas = info.isCanvas;\n if (!card || isCanvas || card.style.display === 'none') return;\n var item = graph.findById(id);\n if (item && item.isVisible()) {\n _this.toggleAnnotation(item);\n } else {\n _this.hideCard(id);\n }\n });\n };\n Annotation.prototype.onGraphItemVisibilityChange = function (_a) {\n var item = _a.item,\n visible = _a.visible;\n if (!item || item.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var id = item.getID();\n if (!cardInfoMap[id]) return;\n if (!visible) this.hideCard(id);\n };\n Annotation.prototype.saveData = function (saveClosed) {\n if (saveClosed === void 0) {\n saveClosed = false;\n }\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var graph = this.get('graph');\n var getTitle = this.get('getTitle');\n var getContent = this.get('getContent');\n var data = [];\n Object.values(cardInfoMap).forEach(function (info) {\n var title = info.title,\n content = info.content,\n x = info.x,\n y = info.y,\n id = info.id,\n collapsed = info.collapsed,\n card = info.card;\n if (card && card.style.display === 'none' && !saveClosed) return;\n var item = graph.findById(id) || graph.get('canvas');\n data.push({\n id: id,\n x: x,\n y: y,\n collapsed: collapsed,\n title: title || (getTitle === null || getTitle === void 0 ? void 0 : getTitle(item)),\n content: content || (getContent === null || getContent === void 0 ? void 0 : getContent(item)),\n visible: card && card.style.display !== 'none'\n });\n });\n return data;\n };\n Annotation.prototype.readData = function (data) {\n var _this = this;\n var graph = this.get('graph');\n data.forEach(function (info) {\n var id = info.id,\n x = info.x,\n y = info.y,\n title = info.title,\n content = info.content,\n collapsed = info.collapsed,\n visible = info.visible;\n var item = graph.findById(id);\n if (!item && id === CANVAS_ANNOTATION_ID) {\n item = graph.get('canvas');\n }\n if (!item) {\n var cardInfoMap = _this.get('cardInfoMap') || {};\n cardInfoMap[id] = info;\n _this.set('cardInfoMap', cardInfoMap);\n return;\n }\n _this.toggleAnnotation(item, {\n x: x,\n y: y,\n title: title,\n content: content,\n collapsed: collapsed\n });\n if (!visible) _this.hideCard(id);\n });\n };\n /**\n * Clear the cards and links\n */\n Annotation.prototype.clear = function () {\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var container = this.get('container');\n Object.values(cardInfoMap).forEach(function (cardInfo) {\n var card = cardInfo.card,\n link = cardInfo.link;\n container.removeChild(card);\n link === null || link === void 0 ? void 0 : link.remove(true);\n });\n this.set('cardInfoMap', {});\n };\n /**\n * Destroy the component\n */\n Annotation.prototype.destroy = function () {\n var _a;\n this.clear();\n (_a = this.get('canvas')) === null || _a === void 0 ? void 0 : _a.destroy();\n var graph = this.get('graph');\n if (!graph || graph.destroyed) return;\n if (this.get('containerCfg')) {\n graph.getContainer().removeChild(this.get('container'));\n }\n this.destroyed = true;\n };\n return Annotation;\n}(_base__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Annotation);\nvar getPath = function getPath(startPoints, endPoints) {\n var startPoint,\n endPoint,\n posKeys,\n distance = Infinity;\n Object.keys(startPoints).forEach(function (skey) {\n var spos = startPoints[skey];\n Object.keys(endPoints).forEach(function (ekey) {\n var epos = endPoints[ekey];\n var xdist = spos.x - epos.x;\n var ydist = spos.y - epos.y;\n var dist = xdist * xdist + ydist * ydist;\n if (distance > dist) {\n distance = dist;\n startPoint = spos;\n endPoint = epos;\n posKeys = [skey, ekey];\n }\n });\n });\n var curveOffset = 20;\n var controlPoint = _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].getControlPoint(startPoint, endPoint, 0.5, curveOffset);\n return [['M', startPoint.x, startPoint.y], ['Q', controlPoint.x, controlPoint.y, endPoint.x, endPoint.y]];\n};\nvar getPathItem2Card = function getPathItem2Card(item, cardBBox, graph, annotationCanvas) {\n var _a;\n var itemLinkPoints;\n var itemType = item.getType();\n if (itemType === 'edge') {\n itemLinkPoints = [item.getKeyShape().getPoint(0.5)];\n } else {\n var _b = (_a = item.getKeyShape) === null || _a === void 0 ? void 0 : _a.call(item).getBBox(),\n minX = _b.minX,\n minY = _b.minY,\n maxX = _b.maxX,\n maxY = _b.maxY;\n var _c = item.getModel(),\n x = _c.x,\n y = _c.y;\n minX += x;\n minY += y;\n maxX += x;\n maxY += y;\n itemLinkPoints = {\n left: {\n x: minX,\n y: (minY + maxY) / 2\n },\n right: {\n x: maxX,\n y: (minY + maxY) / 2\n },\n top: {\n x: (minX + maxX) / 2,\n y: minY\n },\n bottom: {\n x: (minX + maxX) / 2,\n y: maxY\n }\n };\n }\n // 由 graph 所在 canvas 转换为 Client 坐标系,然后再由 annotation 所在 canvas 转换为绘制坐标系\n Object.keys(itemLinkPoints).forEach(function (key) {\n var _a = itemLinkPoints[key],\n x = _a.x,\n y = _a.y;\n var clientPos = graph.getClientByPoint(x, y);\n itemLinkPoints[key] = annotationCanvas.getPointByClient(clientPos.x, clientPos.y);\n });\n var _d = cardBBox.top,\n cardTop = _d === void 0 ? 0 : _d,\n _e = cardBBox.left,\n cardLeft = _e === void 0 ? 0 : _e,\n _f = cardBBox.right,\n cardRight = _f === void 0 ? 0 : _f,\n _g = cardBBox.bottom,\n cardBottom = _g === void 0 ? 0 : _g;\n var cardLinkPoints = {\n left: annotationCanvas.getPointByClient(cardLeft, (cardTop + cardBottom) / 2),\n right: annotationCanvas.getPointByClient(cardRight, (cardTop + cardBottom) / 2),\n top: annotationCanvas.getPointByClient((cardLeft + cardRight) / 2, cardTop),\n bottom: annotationCanvas.getPointByClient((cardLeft + cardRight) / 2, cardBottom)\n };\n return getPath(itemLinkPoints, cardLinkPoints);\n};\nvar px2Num = function px2Num(px) {\n return Number(px.replace(/\\s+|px/gi, \"\")) || 0;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/annotation/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/element/xml.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/element/xml.js ***! - \******************************************************/ -/*! exports provided: xmlDataRenderer, parseXML, getBBox, generateTarget, compareTwoTarget, createNodeFromXML */ +/***/ "./node_modules/@antv/g6-plugin/es/base.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/base.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"xmlDataRenderer\", function() { return xmlDataRenderer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseXML\", function() { return parseXML; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBox\", function() { return getBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"generateTarget\", function() { return generateTarget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compareTwoTarget\", function() { return compareTwoTarget; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createNodeFromXML\", function() { return createNodeFromXML; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * @fileOverview 从xml建立自定义Node,包含update\n * @author xuzhi.mxz@antfin.com\n */\n\n\n\n/**\n * 一种更宽松的JSON 解析,如果遇到不符合规范的字段会直接转为字符串\n * @param text json 内容\n */\n\nfunction looseJSONParse(text) {\n if (typeof text !== 'string') {\n return text;\n }\n\n var safeParse = function safeParse(str) {\n if (typeof str !== 'string') {\n return str;\n }\n\n try {\n return JSON.parse(str.trim());\n } catch (e) {\n return str.trim();\n }\n };\n\n var firstAttempt = safeParse(text);\n\n if (typeof firstAttempt !== 'string') {\n return firstAttempt;\n }\n\n var tail = function tail(arr) {\n return arr[arr.length - 1];\n };\n\n var str = text.trim();\n var objectStack = [];\n var syntaxStack = [];\n\n var isLastPair = function isLastPair() {\n var syntaxes = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n syntaxes[_i] = arguments[_i];\n }\n\n return syntaxes.some(function (syntax) {\n return tail(syntaxStack) === syntax;\n });\n };\n\n var getValueStore = function getValueStore() {\n return tail(objectStack);\n };\n\n var rst = null;\n var i = 0;\n var temp = '';\n\n while (i < str.length) {\n var nowChar = str[i];\n var isInString = isLastPair('\"', \"'\");\n\n if (!isInString && !nowChar.trim()) {\n i += 1;\n continue;\n }\n\n var isLastTranslate = str[i - 1] === '\\\\';\n var isInObject = isLastPair('}');\n var isInArray = isLastPair(']');\n var isWaitingValue = isLastPair(',');\n var tempArr = getValueStore();\n\n if (isInString) {\n if (tail(syntaxStack) === nowChar && !isLastTranslate) {\n syntaxStack.pop();\n var value = safeParse(temp);\n tempArr.push(value);\n rst = value;\n temp = '';\n } else {\n temp += nowChar;\n }\n } else if (isInArray && nowChar === ',') {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n } else if (isInObject && nowChar === ':') {\n syntaxStack.push(',');\n\n if (temp) {\n tempArr.push(temp);\n temp = '';\n }\n } else if (isWaitingValue && nowChar === ',') {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n\n syntaxStack.pop();\n } else if (nowChar === '}' && (isInObject || isWaitingValue)) {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n\n if (isWaitingValue) {\n syntaxStack.pop();\n }\n\n var obj = {};\n\n for (var c = 1; c < tempArr.length; c += 2) {\n obj[tempArr[c - 1]] = tempArr[c];\n }\n\n objectStack.pop();\n\n if (objectStack.length) {\n tail(objectStack).push(obj);\n }\n\n syntaxStack.pop();\n rst = obj;\n } else if (nowChar === ']' && isInArray) {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n\n objectStack.pop();\n\n if (objectStack.length) {\n tail(objectStack).push(tempArr);\n }\n\n syntaxStack.pop();\n rst = tempArr;\n } else if (nowChar === '{') {\n objectStack.push([]);\n syntaxStack.push('}');\n } else if (nowChar === '[') {\n objectStack.push([]);\n syntaxStack.push(']');\n } else if (nowChar === '\"') {\n syntaxStack.push('\"');\n } else if (nowChar === \"'\") {\n syntaxStack.push(\"'\");\n } else {\n temp += nowChar;\n }\n\n i += 1;\n }\n\n return rst || temp;\n}\n\nvar keyConvert = function keyConvert(str) {\n return str.split('-').reduce(function (a, b) {\n return a + b.charAt(0).toUpperCase() + b.slice(1);\n });\n};\n/**\n * 简单的一个{{}}模板渲染,不包含任何复杂语法\n * @param xml\n */\n\n\nvar xmlDataRenderer = function xmlDataRenderer(xml) {\n return function (data) {\n var len = xml.length;\n var arr = [];\n var i = 0;\n var tmp = '';\n\n while (i < len) {\n if (xml[i] === '{' && xml[i + 1] === '{') {\n arr.push(tmp);\n tmp = '';\n i += 2;\n } else if (xml[i] === '}' && xml[i + 1] === '}') {\n if (arr.length) {\n var last = arr.pop();\n tmp = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"get\"])(data, tmp, last.endsWith('=') ? \"\\\"{\".concat(tmp, \"}\\\"\") : tmp);\n arr.push(last + tmp);\n }\n\n i += 2;\n tmp = '';\n } else {\n tmp += xml[i];\n i += 1;\n }\n }\n\n arr.push(tmp);\n return arr.map(function (e, index) {\n return arr[index - 1] && arr[index - 1].endsWith('=') ? \"\\\"{\".concat(e, \"}\\\"\") : e;\n }).join('');\n };\n};\n/**\n * 解析XML,并转化为相应的JSON结构\n * @param xml xml解析后的节点\n */\n\nfunction parseXML(xml, cfg) {\n var attrs = {};\n var keys = xml.getAttributeNames && xml.getAttributeNames() || [];\n var children = xml.children && Array.from(xml.children).map(function (e) {\n return parseXML(e, cfg);\n });\n var rst = {};\n var tagName = xml.tagName ? xml.tagName.toLowerCase() : 'group';\n\n if (tagName === 'text') {\n attrs.text = xml.innerText;\n }\n\n rst.type = tagName;\n\n if (tagName === 'img') {\n rst.type = 'image';\n }\n\n Array.from(keys).forEach(function (k) {\n var key = keyConvert(k);\n var val = xml.getAttribute(k);\n\n try {\n if (key === 'style' || key === 'attrs') {\n var style = looseJSONParse(val);\n attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, attrs), style);\n } else {\n rst[key] = looseJSONParse(val);\n }\n } catch (e) {\n if (key === 'style') {\n throw e;\n }\n\n rst[key] = val;\n }\n });\n rst.attrs = attrs;\n\n if (cfg && cfg.style && rst.name && _typeof(cfg.style[rst.name]) === 'object') {\n rst.attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, rst.attrs), cfg.style[rst.name]);\n }\n\n if (cfg && cfg.style && rst.keyshape) {\n rst.attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, rst.attrs), cfg.style);\n }\n\n if (children.length) {\n rst.children = children;\n }\n\n return rst;\n}\n/**\n * 根据偏移量和内部节点最终的bounding box来得出该shape最终的bbox\n */\n\nfunction getBBox(node, offset, chilrenBBox) {\n var _a = node.attrs,\n attrs = _a === void 0 ? {} : _a;\n var bbox = {\n x: offset.x || 0,\n y: offset.y || 0,\n width: chilrenBBox.width || 0,\n height: chilrenBBox.height || 0\n };\n var shapeHeight, shapeWidth;\n\n switch (node.type) {\n case 'maker':\n case 'circle':\n if (attrs.r) {\n shapeWidth = 2 * attrs.r;\n shapeHeight = 2 * attrs.r;\n }\n\n break;\n\n case 'text':\n if (attrs.text) {\n shapeWidth = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_2__[\"getTextSize\"])(attrs.text, attrs.fontSize || 12)[0];\n shapeHeight = 16;\n bbox.y += shapeHeight;\n bbox.height = shapeHeight;\n bbox.width = shapeWidth;\n node.attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n fontSize: 12,\n fill: '#000'\n }, attrs);\n }\n\n break;\n\n default:\n if (attrs.width) {\n shapeWidth = attrs.width;\n }\n\n if (attrs.height) {\n shapeHeight = attrs.height;\n }\n\n }\n\n if (shapeHeight >= 0) {\n bbox.height = shapeHeight;\n }\n\n if (shapeWidth >= 0) {\n bbox.width = shapeWidth;\n }\n\n if (attrs.marginTop) {\n bbox.y += attrs.marginTop;\n }\n\n if (attrs.marginLeft) {\n bbox.x += attrs.marginLeft;\n }\n\n return bbox;\n}\n/**\n * 把从xml计算出的结构填上位置信息,补全attrs\n * @param target\n * @param lastOffset\n */\n\nfunction generateTarget(target, lastOffset) {\n var _a;\n\n if (lastOffset === void 0) {\n lastOffset = {\n x: 0,\n y: 0\n };\n }\n\n var defaultBbox = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n width: 0,\n height: 0\n }, lastOffset);\n\n if ((_a = target.children) === null || _a === void 0 ? void 0 : _a.length) {\n var _b = target.attrs,\n attrs = _b === void 0 ? {} : _b;\n var marginTop = attrs.marginTop;\n\n var offset = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, lastOffset);\n\n if (marginTop) {\n offset.y += marginTop;\n }\n\n for (var index = 0; index < target.children.length; index++) {\n target.children[index].attrs.key = \"\".concat(attrs.key || 'root', \" -\").concat(index, \" \");\n var node = generateTarget(target.children[index], offset);\n\n if (node.bbox) {\n var bbox = node.bbox;\n\n if (node.attrs.next === 'inline') {\n offset.x += node.bbox.width;\n } else {\n offset.y += node.bbox.height;\n }\n\n if (bbox.width + bbox.x > defaultBbox.width) {\n defaultBbox.width = bbox.width + bbox.x;\n }\n\n if (bbox.height + bbox.y > defaultBbox.height) {\n defaultBbox.height = bbox.height + bbox.y;\n }\n }\n }\n }\n\n target.bbox = getBBox(target, lastOffset, defaultBbox);\n target.attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, target.attrs), target.bbox);\n return target;\n}\n/**\n * 对比前后两个最终计算出来的node,并对比出最小改动,\n * 动作: 'add' 添加节点 | ’delete‘ 删除节点 | ’change‘ 改变节点attrs | 'restructure' 重构节点\n * @param nowTarget\n * @param formerTarget\n */\n\nfunction compareTwoTarget(nowTarget, formerTarget) {\n var _a, _b, _c, _d;\n\n var type = (nowTarget || {}).type;\n var key = ((formerTarget === null || formerTarget === void 0 ? void 0 : formerTarget.attrs) || {}).key;\n\n if (key && nowTarget) {\n nowTarget.attrs.key = key;\n }\n\n if (!nowTarget && formerTarget) {\n return {\n action: 'delete',\n val: formerTarget,\n type: type,\n key: key\n };\n }\n\n if (nowTarget && !formerTarget) {\n return {\n action: 'add',\n val: nowTarget,\n type: type\n };\n }\n\n if (!nowTarget && !formerTarget) {\n return {\n action: 'same',\n type: type\n };\n }\n\n var children = [];\n\n if (((_a = nowTarget.children) === null || _a === void 0 ? void 0 : _a.length) > 0 || ((_b = formerTarget.children) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n var length_1 = Math.max((_c = nowTarget.children) === null || _c === void 0 ? void 0 : _c.length, (_d = formerTarget.children) === null || _d === void 0 ? void 0 : _d.length);\n var formerChilren = formerTarget.children || [];\n var nowChilren = nowTarget.children || [];\n\n for (var index = 0; index < length_1; index += 1) {\n children.push(compareTwoTarget(nowChilren[index], formerChilren[index]));\n }\n }\n\n var formerKeys = Object.keys(formerTarget.attrs);\n var nowKeys = Object.keys(nowTarget.attrs);\n\n if (formerTarget.type !== nowTarget.type) {\n return {\n action: 'restructure',\n nowTarget: nowTarget,\n formerTarget: formerTarget,\n key: key,\n children: children\n };\n }\n\n if (formerKeys.filter(function (e) {\n return e !== 'children';\n }).some(function (e) {\n return nowTarget.attrs[e] !== formerTarget.attrs[e] || !nowKeys.includes(e);\n })) {\n return {\n action: 'change',\n val: nowTarget,\n children: children,\n type: type,\n key: key\n };\n }\n\n return {\n action: 'same',\n children: children,\n type: type,\n key: key\n };\n}\n/**\n * 根据xml或者返回xml的函数构建自定义节点的结构\n * @param gen\n */\n\nfunction createNodeFromXML(gen) {\n var structures = {};\n\n var compileXML = function compileXML(cfg) {\n var rawStr = typeof gen === 'function' ? gen(cfg) : gen;\n var target = xmlDataRenderer(rawStr)(cfg);\n var xmlParser = document.createElement('div');\n xmlParser.innerHTML = target;\n var xml = xmlParser.children[0];\n var result = generateTarget(parseXML(xml, cfg));\n xmlParser.remove();\n return result;\n };\n\n return {\n draw: function draw(cfg, group) {\n var resultTarget = compileXML(cfg);\n var keyshape = group;\n\n var renderTarget = function renderTarget(target) {\n var _a = target.attrs,\n attrs = _a === void 0 ? {} : _a,\n bbox = target.bbox,\n type = target.type,\n children = target.children,\n rest = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(target, [\"attrs\", \"bbox\", \"type\", \"children\"]);\n\n if (target.type !== 'group') {\n var shape = group.addShape(target.type, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n attrs: attrs,\n origin: {\n bbox: bbox,\n type: type,\n children: children\n }\n }, rest));\n\n if (target.keyshape) {\n keyshape = shape;\n }\n }\n\n if (target.children) {\n target.children.forEach(function (n) {\n return renderTarget(n);\n });\n }\n };\n\n renderTarget(resultTarget);\n structures[cfg.id] = [resultTarget];\n return keyshape;\n },\n update: function update(cfg, node) {\n if (!structures[cfg.id]) {\n structures[cfg.id] = [];\n }\n\n var container = node.getContainer();\n var children = container.get('children');\n var newTarget = compileXML(cfg);\n var lastTarget = structures[cfg.id].pop();\n var diffResult = compareTwoTarget(newTarget, lastTarget);\n\n var addShape = function addShape(shape) {\n var _a;\n\n if (shape.type !== 'group') {\n container.addShape(shape.type, {\n attrs: shape.attrs\n });\n }\n\n if ((_a = shape.children) === null || _a === void 0 ? void 0 : _a.length) {\n shape.children.map(function (e) {\n return addShape(e);\n });\n }\n };\n\n var delShape = function delShape(shape) {\n var _a;\n\n var targetShape = children.find(function (e) {\n return e.attrs.key === shape.attrs.key;\n });\n\n if (targetShape) {\n container.removeChild(targetShape);\n }\n\n if ((_a = shape.children) === null || _a === void 0 ? void 0 : _a.length) {\n shape.children.map(function (e) {\n return delShape(e);\n });\n }\n };\n\n var updateTarget = function updateTarget(target) {\n var key = target.key;\n\n if (target.type !== 'group') {\n var targetShape = children.find(function (e) {\n return e.attrs.key === key;\n });\n\n switch (target.action) {\n case 'change':\n if (targetShape) {\n var originAttr = target.val.keyshape ? node.getOriginStyle() : {};\n targetShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, originAttr), target.val.attrs));\n }\n\n break;\n\n case 'add':\n addShape(target.val);\n break;\n\n case 'delete':\n delShape(target.val);\n break;\n\n case 'restructure':\n delShape(target.formerTarget);\n addShape(target.nowTarget);\n break;\n\n default:\n break;\n }\n }\n\n if (target.children) {\n target.children.forEach(function (n) {\n return updateTarget(n);\n });\n }\n };\n\n updateTarget(diffResult);\n structures[cfg.id].push(newTarget);\n },\n getAnchorPoints: function getAnchorPoints() {\n return [[0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0]];\n }\n };\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/element/xml.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar PluginBase = /** @class */function () {\n /**\n * 插件基类的构造函数\n * @param cfgs 插件的配置项\n */\n function PluginBase(cfgs) {\n this._cfgs = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"deepMix\"])(this.getDefaultCfgs(), cfgs);\n this._events = {};\n this.destroyed = false;\n }\n /**\n * 获取默认的插件配置\n */\n PluginBase.prototype.getDefaultCfgs = function () {\n return {};\n };\n /**\n * 初始化插件\n * @param graph IGraph 实例\n */\n PluginBase.prototype.initPlugin = function (graph) {\n var self = this;\n self.set('graph', graph);\n var events = self.getEvents();\n var bindEvents = {};\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (v, k) {\n var event = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"wrapBehavior\"])(self, v);\n bindEvents[k] = event;\n graph.on(k, event);\n });\n this._events = bindEvents;\n this.init();\n };\n /**\n * 获取插件中的事件和事件处理方法,供子类实现\n */\n PluginBase.prototype.getEvents = function () {\n return {};\n };\n /**\n * 获取配置项中的某个值\n * @param key 键值\n */\n PluginBase.prototype.get = function (key) {\n var _a;\n return (_a = this._cfgs) === null || _a === void 0 ? void 0 : _a[key];\n };\n /**\n * 将指定的值存储到 cfgs 中\n * @param key 键值\n * @param val 设置的值\n */\n PluginBase.prototype.set = function (key, val) {\n this._cfgs[key] = val;\n };\n /**\n * 销毁方法,供子类复写\n */\n PluginBase.prototype.destroy = function () {};\n /**\n * 销毁插件\n */\n PluginBase.prototype.destroyPlugin = function () {\n this.destroy();\n var graph = this.get('graph');\n var events = this._events;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (v, k) {\n graph.off(k, v);\n });\n this._events = null;\n this._cfgs = null;\n this.destroyed = true;\n };\n return PluginBase;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (PluginBase);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/base.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/global.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/global.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/g6-plugin/es/bundling/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/bundling/index.js ***! + \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar subjectColor = 'rgb(95, 149, 255)';\nvar backColor = 'rgb(255, 255, 255)';\nvar textColor = 'rgb(0, 0, 0)';\nvar activeFill = 'rgb(247, 250, 255)';\nvar nodeMainFill = 'rgb(239, 244, 255)';\nvar comboFill = 'rgb(253, 253, 253)';\nvar disabledFill = 'rgb(250, 250, 250)';\nvar edgeMainStroke = 'rgb(224, 224, 224)';\nvar edgeInactiveStroke = 'rgb(234, 234, 234)';\nvar edgeDisablesStroke = 'rgb(245, 245, 245)';\nvar inactiveStroke = 'rgb(191, 213, 255)';\nvar highlightStroke = '#4572d9';\nvar highlightFill = 'rgb(223, 234, 255)';\nvar colorSet = {\n // for nodes\n mainStroke: subjectColor,\n mainFill: nodeMainFill,\n activeStroke: subjectColor,\n activeFill: activeFill,\n inactiveStroke: inactiveStroke,\n inactiveFill: activeFill,\n selectedStroke: subjectColor,\n selectedFill: backColor,\n highlightStroke: highlightStroke,\n highlightFill: highlightFill,\n disableStroke: edgeMainStroke,\n disableFill: disabledFill,\n // for edges\n edgeMainStroke: edgeMainStroke,\n edgeActiveStroke: subjectColor,\n edgeInactiveStroke: edgeInactiveStroke,\n edgeSelectedStroke: subjectColor,\n edgeHighlightStroke: subjectColor,\n edgeDisableStroke: edgeDisablesStroke,\n // for combos\n comboMainStroke: edgeMainStroke,\n comboMainFill: comboFill,\n comboActiveStroke: subjectColor,\n comboActiveFill: activeFill,\n comboInactiveStroke: edgeMainStroke,\n comboInactiveFill: comboFill,\n comboSelectedStroke: subjectColor,\n comboSelectedFill: comboFill,\n comboHighlightStroke: highlightStroke,\n comboHighlightFill: comboFill,\n comboDisableStroke: edgeInactiveStroke,\n comboDisableFill: disabledFill\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: '0.7.3',\n rootContainerClassName: 'root-container',\n nodeContainerClassName: 'node-container',\n edgeContainerClassName: 'edge-container',\n comboContainerClassName: 'combo-container',\n delegateContainerClassName: 'delegate-container',\n defaultLoopPosition: 'top',\n nodeLabel: {\n style: {\n fill: '#000',\n fontSize: 12,\n textAlign: 'center',\n textBaseline: 'middle'\n },\n offset: 4 // 节点的默认文本不居中时的偏移量\n\n },\n defaultNode: {\n type: 'circle',\n style: {\n lineWidth: 1,\n stroke: colorSet.mainStroke,\n fill: nodeMainFill\n },\n size: 20,\n color: colorSet.mainStroke,\n linkPoints: {\n size: 8,\n lineWidth: 1,\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke\n }\n },\n // 节点应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n nodeStateStyles: {\n active: {\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke,\n lineWidth: 2,\n shadowColor: colorSet.mainStroke,\n shadowBlur: 10\n },\n selected: {\n fill: colorSet.selectedFill,\n stroke: colorSet.selectedStroke,\n lineWidth: 4,\n shadowColor: colorSet.selectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n fill: colorSet.highlightFill,\n stroke: colorSet.highlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n fill: colorSet.inactiveFill,\n stroke: colorSet.inactiveStroke,\n lineWidth: 1\n },\n disable: {\n fill: colorSet.disableFill,\n stroke: colorSet.disableStroke,\n lineWidth: 1\n }\n },\n edgeLabel: {\n style: {\n fill: textColor,\n textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n }\n },\n defaultEdge: {\n type: 'line',\n size: 1,\n style: {\n stroke: colorSet.edgeMainStroke,\n lineAppendWidth: 2\n },\n color: colorSet.edgeMainStroke\n },\n // 边应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n edgeStateStyles: {\n active: {\n stroke: colorSet.edgeActiveStroke,\n lineWidth: 1\n },\n selected: {\n stroke: colorSet.edgeSelectedStroke,\n lineWidth: 2,\n shadowColor: colorSet.edgeSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.edgeHighlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.edgeInactiveStroke,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.edgeDisableStroke,\n lineWidth: 1\n }\n },\n comboLabel: {\n style: {\n fill: textColor,\n // textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n },\n refY: 10,\n refX: 10 // Combo 的默认文本不居中时的偏移量\n\n },\n defaultCombo: {\n type: 'circle',\n style: {\n fill: colorSet.comboMainFill,\n lineWidth: 1,\n stroke: colorSet.comboMainStroke,\n r: 5,\n width: 20,\n height: 10\n },\n size: [20, 5],\n color: colorSet.comboMainStroke,\n padding: [25, 20, 15, 20]\n },\n // combo 应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n comboStateStyles: {\n active: {\n stroke: colorSet.comboActiveStroke,\n lineWidth: 1,\n fill: colorSet.comboActiveFill\n },\n selected: {\n stroke: colorSet.comboSelectedStroke,\n lineWidth: 2,\n fill: colorSet.comboSelectedFill,\n shadowColor: colorSet.comboSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.comboHighlightStroke,\n lineWidth: 2,\n fill: colorSet.comboHighlightFill,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.comboInactiveStroke,\n fill: colorSet.comboInactiveFill,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.comboDisableStroke,\n fill: colorSet.comboDisableFill,\n lineWidth: 1\n }\n },\n delegateStyle: {\n fill: '#F3F9FF',\n fillOpacity: 0.5,\n stroke: '#1890FF',\n strokeOpacity: 0.9,\n lineDash: [5, 5]\n },\n windowFontFamily: typeof window !== 'undefined' && window.getComputedStyle && document.body ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif'\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/global.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nfunction getEucliDis(pointA, pointB, eps) {\n var vx = pointA.x - pointB.x;\n var vy = pointA.y - pointB.y;\n if (!eps || Math.abs(vx) > eps || Math.abs(vy) > eps) {\n return Math.sqrt(vx * vx + vy * vy);\n }\n return eps;\n}\nfunction getDotProduct(ei, ej) {\n return ei.x * ej.x + ei.y * ej.y;\n}\nfunction projectPointToEdge(p, e) {\n var k = (e.source.y - e.target.y) / (e.source.x - e.target.x);\n var x = (k * k * e.source.x + k * (p.y - e.source.y) + p.x) / (k * k + 1);\n var y = k * (x - e.source.x) + e.source.y;\n return {\n x: x,\n y: y\n };\n}\nvar Bundling = /** @class */function (_super) {\n __extends(Bundling, _super);\n function Bundling(config) {\n return _super.call(this, config) || this;\n }\n Bundling.prototype.getDefaultCfgs = function () {\n return {\n edgeBundles: [],\n edgePoints: [],\n K: 0.1,\n lambda: 0.1,\n divisions: 1,\n divRate: 2,\n cycles: 6,\n iterations: 90,\n iterRate: 0.6666667,\n bundleThreshold: 0.6,\n eps: 1e-6,\n onLayoutEnd: function onLayoutEnd() {},\n onTick: function onTick() {}\n };\n };\n Bundling.prototype.init = function () {\n var graph = this.get('graph');\n var onTick = this.get('onTick');\n var tick = function tick() {\n if (onTick) {\n onTick();\n }\n graph.refreshPositions();\n };\n this.set('tick', tick);\n };\n Bundling.prototype.bundling = function (data) {\n var self = this;\n self.set('data', data);\n // 如果正在布局,忽略布局请求\n if (self.isTicking()) {\n return;\n }\n var edges = data.edges || [];\n var nodes = data.nodes || [];\n var nodeIdMap = {};\n var error = false;\n nodes.forEach(function (node) {\n if (node.x === null || !node.y === null || node.x === undefined || !node.y === undefined) {\n error = true;\n }\n nodeIdMap[node.id] = node;\n });\n if (error) throw new Error('please layout the graph or assign x and y for nodes first');\n self.set('nodeIdMap', nodeIdMap);\n // subdivide each edges\n var divisions = self.get('divisions');\n var divRate = self.get('divRate');\n var edgePoints = self.divideEdges(divisions);\n self.set('edgePoints', edgePoints);\n // compute the bundles\n var edgeBundles = self.getEdgeBundles();\n self.set('edgeBundles', edgeBundles);\n // iterations\n var C = self.get('cycles');\n var iterations = self.get('iterations');\n var iterRate = self.get('iterRate');\n var lambda = self.get('lambda');\n for (var i = 0; i < C; i++) {\n var _loop_1 = function _loop_1(j) {\n var forces = [];\n edges.forEach(function (e, k) {\n if (e.source === e.target) return;\n var source = nodeIdMap[e.source];\n var target = nodeIdMap[e.target];\n forces[k] = self.getEdgeForces({\n source: source,\n target: target\n }, k, divisions, lambda);\n for (var p = 0; p < divisions + 1; p++) {\n edgePoints[k][p].x += forces[k][p].x;\n edgePoints[k][p].y += forces[k][p].y;\n }\n });\n };\n for (var j = 0; j < iterations; j++) {\n _loop_1(j);\n }\n // parameters for nex cycle\n lambda = lambda / 2;\n divisions *= divRate;\n iterations *= iterRate;\n edgePoints = self.divideEdges(divisions);\n self.set('edgePoints', edgePoints);\n }\n // change the edges according to edgePoints\n edges.forEach(function (e, i) {\n if (e.source === e.target) return;\n e.type = 'polyline';\n e.controlPoints = edgePoints[i].slice(1, edgePoints[i].length - 1);\n });\n var graph = self.get('graph');\n graph.refresh();\n };\n Bundling.prototype.updateBundling = function (cfg) {\n var self = this;\n var data = cfg.data;\n if (data) {\n self.set('data', data);\n }\n if (self.get('ticking')) {\n self.set('ticking', false);\n }\n Object.keys(cfg).forEach(function (key) {\n self.set(key, cfg[key]);\n });\n if (cfg.onTick) {\n var graph_1 = this.get('graph');\n self.set('tick', function () {\n cfg.onTick();\n graph_1.refresh();\n });\n }\n self.bundling(data);\n };\n Bundling.prototype.divideEdges = function (divisions) {\n var self = this;\n var edges = self.get('data').edges;\n var nodeIdMap = self.get('nodeIdMap');\n var edgePoints = self.get('edgePoints');\n if (!edgePoints || edgePoints === undefined) edgePoints = [];\n edges.forEach(function (edge, i) {\n var _a;\n if (!edgePoints[i] || edgePoints[i] === undefined) {\n edgePoints[i] = [];\n }\n var source = nodeIdMap[edge.source];\n var target = nodeIdMap[edge.target];\n if (divisions === 1) {\n edgePoints[i].push({\n x: source.x,\n y: source.y\n }); // source\n edgePoints[i].push({\n x: 0.5 * (source.x + target.x),\n y: 0.5 * (source.y + target.y)\n }); // mid\n edgePoints[i].push({\n x: target.x,\n y: target.y\n }); // target\n } else {\n var edgeLength = 0;\n if (!((_a = edgePoints[i]) === null || _a === void 0 ? void 0 : _a.length)) {\n // it is a straight line\n edgeLength = getEucliDis({\n x: source.x,\n y: source.y\n }, {\n x: target.x,\n y: target.y\n });\n } else {\n edgeLength = self.getEdgeLength(edgePoints[i]);\n }\n var divisionLength_1 = edgeLength / (divisions + 1);\n var currentDivisonLength_1 = divisionLength_1;\n var newEdgePoints_1 = [{\n x: source.x,\n y: source.y\n }]; // source\n edgePoints[i].forEach(function (ep, j) {\n if (j === 0) return;\n var oriDivisionLength = getEucliDis(ep, edgePoints[i][j - 1]);\n while (oriDivisionLength > currentDivisonLength_1) {\n var ratio = currentDivisonLength_1 / oriDivisionLength;\n var edgePoint = {\n x: edgePoints[i][j - 1].x,\n y: edgePoints[i][j - 1].y\n };\n edgePoint.x += ratio * (ep.x - edgePoints[i][j - 1].x);\n edgePoint.y += ratio * (ep.y - edgePoints[i][j - 1].y);\n newEdgePoints_1.push(edgePoint);\n oriDivisionLength -= currentDivisonLength_1;\n currentDivisonLength_1 = divisionLength_1;\n }\n currentDivisonLength_1 -= oriDivisionLength;\n });\n newEdgePoints_1.push({\n x: target.x,\n y: target.y\n }); // target\n edgePoints[i] = newEdgePoints_1;\n }\n });\n return edgePoints;\n };\n /**\n * 计算边的长度\n * @param points\n */\n Bundling.prototype.getEdgeLength = function (points) {\n var length = 0;\n points.forEach(function (p, i) {\n if (i === 0) return;\n length += getEucliDis(p, points[i - 1]);\n });\n return length;\n };\n Bundling.prototype.getEdgeBundles = function () {\n var self = this;\n var data = self.get('data');\n var edges = data.edges || [];\n var bundleThreshold = self.get('bundleThreshold');\n var nodeIdMap = self.get('nodeIdMap');\n var edgeBundles = self.get('edgeBundles');\n if (!edgeBundles) edgeBundles = [];\n edges.forEach(function (e, i) {\n if (!edgeBundles[i] || edgeBundles[i] === undefined) {\n edgeBundles[i] = [];\n }\n });\n edges.forEach(function (ei, i) {\n var iSource = nodeIdMap[ei.source];\n var iTarget = nodeIdMap[ei.target];\n edges.forEach(function (ej, j) {\n if (j <= i) return;\n var jSource = nodeIdMap[ej.source];\n var jTarget = nodeIdMap[ej.target];\n var score = self.getBundleScore({\n source: iSource,\n target: iTarget\n }, {\n source: jSource,\n target: jTarget\n });\n if (score >= bundleThreshold) {\n edgeBundles[i].push(j);\n edgeBundles[j].push(i);\n }\n });\n });\n return edgeBundles;\n };\n Bundling.prototype.getBundleScore = function (ei, ej) {\n var self = this;\n ei.vx = ei.target.x - ei.source.x;\n ei.vy = ei.target.y - ei.source.y;\n ej.vx = ej.target.x - ej.source.x;\n ej.vy = ej.target.y - ej.source.y;\n ei.length = getEucliDis({\n x: ei.source.x,\n y: ei.source.y\n }, {\n x: ei.target.x,\n y: ei.target.y\n });\n ej.length = getEucliDis({\n x: ej.source.x,\n y: ej.source.y\n }, {\n x: ej.target.x,\n y: ej.target.y\n });\n // angle score\n var aScore = self.getAngleScore(ei, ej);\n // scale score\n var sScore = self.getScaleScore(ei, ej);\n // position score\n var pScore = self.getPositionScore(ei, ej);\n // visibility socre\n var vScore = self.getVisibilityScore(ei, ej);\n return aScore * sScore * pScore * vScore;\n };\n Bundling.prototype.getAngleScore = function (ei, ej) {\n var dotProduct = getDotProduct({\n x: ei.vx,\n y: ei.vy\n }, {\n x: ej.vx,\n y: ej.vy\n });\n return dotProduct / (ei.length * ej.length);\n };\n Bundling.prototype.getScaleScore = function (ei, ej) {\n var aLength = (ei.length + ej.length) / 2;\n var score = 2 / (aLength / Math.min(ei.length, ej.length) + Math.max(ei.length, ej.length) / aLength);\n return score;\n };\n Bundling.prototype.getPositionScore = function (ei, ej) {\n var aLength = (ei.length + ej.length) / 2;\n var iMid = {\n x: (ei.source.x + ei.target.x) / 2,\n y: (ei.source.y + ei.target.y) / 2\n };\n var jMid = {\n x: (ej.source.x + ej.target.x) / 2,\n y: (ej.source.y + ej.target.y) / 2\n };\n var distance = getEucliDis(iMid, jMid);\n return aLength / (aLength + distance);\n };\n Bundling.prototype.getVisibilityScore = function (ei, ej) {\n var vij = this.getEdgeVisibility(ei, ej);\n var vji = this.getEdgeVisibility(ej, ei);\n return vij < vji ? vij : vji;\n };\n Bundling.prototype.getEdgeVisibility = function (ei, ej) {\n var ps = projectPointToEdge(ej.source, ei);\n var pt = projectPointToEdge(ej.target, ei);\n var pMid = {\n x: (ps.x + pt.x) / 2,\n y: (ps.y + pt.y) / 2\n };\n var iMid = {\n x: (ei.source.x + ei.target.x) / 2,\n y: (ei.source.y + ei.target.y) / 2\n };\n return Math.max(0, 1 - 2 * getEucliDis(pMid, iMid) / getEucliDis(ps, pt));\n };\n Bundling.prototype.getEdgeForces = function (e, eidx, divisions, lambda) {\n var self = this;\n var edgePoints = self.get('edgePoints');\n var K = self.get('K');\n var kp = K / (getEucliDis(e.source, e.target) * (divisions + 1));\n var edgePointForces = [{\n x: 0,\n y: 0\n }];\n for (var i = 1; i < divisions; i++) {\n var force = {\n x: 0,\n y: 0\n };\n var spring = self.getSpringForce({\n pre: edgePoints[eidx][i - 1],\n cur: edgePoints[eidx][i],\n next: edgePoints[eidx][i + 1]\n }, kp);\n var electrostatic = self.getElectrostaticForce(i, eidx);\n force.x = lambda * (spring.x + electrostatic.x);\n force.y = lambda * (spring.y + electrostatic.y);\n edgePointForces.push(force);\n }\n edgePointForces.push({\n x: 0,\n y: 0\n });\n return edgePointForces;\n };\n Bundling.prototype.getSpringForce = function (divisions, kp) {\n var x = divisions.pre.x + divisions.next.x - 2 * divisions.cur.x;\n var y = divisions.pre.y + divisions.next.y - 2 * divisions.cur.y;\n x *= kp;\n y *= kp;\n return {\n x: x,\n y: y\n };\n };\n Bundling.prototype.getElectrostaticForce = function (pidx, eidx) {\n var self = this;\n var eps = self.get('eps');\n var edgeBundles = self.get('edgeBundles');\n var edgePoints = self.get('edgePoints');\n var edgeBundle = edgeBundles[eidx];\n var resForce = {\n x: 0,\n y: 0\n };\n edgeBundle.forEach(function (eb) {\n var force = {\n x: edgePoints[eb][pidx].x - edgePoints[eidx][pidx].x,\n y: edgePoints[eb][pidx].y - edgePoints[eidx][pidx].y\n };\n if (Math.abs(force.x) > eps || Math.abs(force.y) > eps) {\n var length_1 = getEucliDis(edgePoints[eb][pidx], edgePoints[eidx][pidx]);\n var diff = 1 / length_1;\n resForce.x += force.x * diff;\n resForce.y += force.y * diff;\n }\n });\n return resForce;\n };\n Bundling.prototype.isTicking = function () {\n return this.get('ticking');\n };\n Bundling.prototype.getSimulation = function () {\n return this.get('forceSimulation');\n };\n Bundling.prototype.destroy = function () {\n if (this.get('ticking')) {\n this.getSimulation().stop();\n }\n _super.prototype.destroy.call(this);\n };\n return Bundling;\n}(_base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bundling);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/bundling/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/graph/controller/event.js": +/***/ "./node_modules/@antv/g6-plugin/es/edgeFilterLens/index.js": /*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/graph/controller/event.js ***! + !*** ./node_modules/@antv/g6-plugin/es/edgeFilterLens/index.js ***! \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar EventController =\n/** @class */\nfunction () {\n function EventController(graph) {\n this.graph = graph;\n this.destroyed = false;\n this.initEvents();\n }\n\n return EventController;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (EventController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/event.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\nvar distance = _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].distance;\nvar DELTA = 0.05;\nvar lensDelegateStyle = {\n stroke: '#000',\n strokeOpacity: 0.8,\n lineWidth: 2,\n fillOpacity: 1,\n fill: '#fff'\n};\nvar EdgeFilterLens = /** @class */function (_super) {\n __extends(EdgeFilterLens, _super);\n function EdgeFilterLens(config) {\n return _super.call(this, config) || this;\n }\n EdgeFilterLens.prototype.getDefaultCfgs = function () {\n return {\n type: 'both',\n trigger: 'mousemove',\n r: 60,\n delegateStyle: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(lensDelegateStyle),\n showLabel: 'edge',\n scaleRBy: 'wheel'\n };\n };\n // class-methods-use-this\n EdgeFilterLens.prototype.getEvents = function () {\n var events;\n switch (this.get('trigger')) {\n case 'click':\n events = {\n click: 'filter'\n };\n break;\n case 'drag':\n events = {\n click: 'createDelegate'\n };\n break;\n default:\n events = {\n mousemove: 'filter'\n };\n break;\n }\n return events;\n };\n EdgeFilterLens.prototype.init = function () {\n var self = this;\n var showLabel = self.get('showLabel');\n var showNodeLabel = showLabel === 'node' || showLabel === 'both';\n var showEdgeLabel = showLabel === 'edge' || showLabel === 'both';\n self.set('showNodeLabel', showNodeLabel);\n self.set('showEdgeLabel', showEdgeLabel);\n var shouldShow = self.get('shouldShow');\n if (!shouldShow) self.set('shouldShow', function () {\n return true;\n });\n };\n // Create the delegate when the trigger is drag\n EdgeFilterLens.prototype.createDelegate = function (e) {\n var self = this;\n var lensDelegate = self.get('delegate');\n if (!lensDelegate || lensDelegate.destroyed) {\n self.filter(e);\n lensDelegate = self.get('delegate');\n // drag to move the lens\n lensDelegate.on('dragstart', function (evt) {});\n lensDelegate.on('drag', function (evt) {\n self.filter(evt);\n });\n // 绑定调整范围(r)\n // 由于 drag 用于改变 lens 位置,因此在此模式下,drag 不能用于调整 r\n // scaling r\n if (this.get('scaleRBy') === 'wheel') {\n lensDelegate.on('mousewheel', function (evt) {\n self.scaleRByWheel(evt);\n });\n }\n }\n };\n /**\n * Scale the range by wheel\n * @param e mouse wheel event\n */\n EdgeFilterLens.prototype.scaleRByWheel = function (e) {\n var self = this;\n if (!e || !e.originalEvent) return;\n if (e.preventDefault) e.preventDefault();\n var graph = self.get('graph');\n var ratio;\n var lensDelegate = self.get('delegate');\n var lensCenter = lensDelegate ? {\n x: lensDelegate.attr('x'),\n y: lensDelegate.attr('y')\n } : undefined;\n var mousePos = lensCenter || graph.getPointByClient(e.clientX, e.clientY);\n if (e.originalEvent.wheelDelta < 0) {\n ratio = 1 - DELTA;\n } else {\n ratio = 1 / (1 - DELTA);\n }\n var maxR = self.get('maxR');\n var minR = self.get('minR');\n var r = self.get('r');\n if (r > (maxR || graph.get('height')) && ratio > 1 || r < (minR || graph.get('height') * 0.05) && ratio < 1) {\n ratio = 1;\n }\n r *= ratio;\n self.set('r', r);\n self.filter(e);\n };\n /**\n * Response function for mousemove, click, or drag to filter out the edges\n * @param e mouse event\n */\n EdgeFilterLens.prototype.filter = function (e) {\n var self = this;\n var graph = self.get('graph');\n var nodes = graph.getNodes();\n var hitNodesMap = {};\n var r = self.get('r');\n var type = self.get('type');\n var fCenter = {\n x: e.x,\n y: e.y\n };\n self.updateDelegate(fCenter, r);\n var shouldShow = self.get('shouldShow');\n var vShapes = self.get('vShapes');\n if (vShapes) {\n vShapes.forEach(function (shape) {\n shape.remove();\n shape.destroy();\n });\n }\n vShapes = [];\n nodes.forEach(function (node) {\n var model = node.getModel();\n var x = model.x,\n y = model.y;\n if (distance({\n x: x,\n y: y\n }, fCenter) < r) {\n hitNodesMap[model.id] = node;\n }\n });\n var edges = graph.getEdges();\n var hitEdges = [];\n edges.forEach(function (edge) {\n var model = edge.getModel();\n var sourceId = model.source;\n var targetId = model.target;\n if (shouldShow(model)) {\n if (type === 'only-source' || type === 'one') {\n if (hitNodesMap[sourceId] && !hitNodesMap[targetId]) hitEdges.push(edge);\n } else if (type === 'only-target' || type === 'one') {\n if (hitNodesMap[targetId] && !hitNodesMap[sourceId]) hitEdges.push(edge);\n } else if (type === 'both' && hitNodesMap[sourceId] && hitNodesMap[targetId]) {\n hitEdges.push(edge);\n }\n }\n });\n var showNodeLabel = self.get('showNodeLabel');\n var showEdgeLabel = self.get('showEdgelabel');\n // copy the shapes in hitEdges\n var group = graph.get('group');\n hitEdges.forEach(function (edge) {\n var shapes = edge.get('group').get('children');\n shapes.forEach(function (shape) {\n var shapeType = shape.get('type');\n var vShape = group.addShape(shapeType, {\n attrs: shape.attr()\n });\n vShapes.push(vShape);\n if (showNodeLabel && shapeType === 'text') {\n vShape.set('visible', true);\n }\n });\n });\n // copy the shape sof hitNodes\n Object.keys(hitNodesMap).forEach(function (key) {\n var node = hitNodesMap[key];\n var clonedGroup = node.get('group').clone();\n group.add(clonedGroup);\n vShapes.push(clonedGroup);\n if (showEdgeLabel) {\n var shapes = clonedGroup.get('children');\n for (var j = 0; j < shapes.length; j++) {\n var shape = shapes[j];\n if (shape.get('type') === 'text') {\n shape.set('visible', true);\n }\n }\n }\n });\n self.set('vShapes', vShapes);\n };\n /**\n * Adjust part of the parameters, including trigger, type, r, maxR, minR, shouldShow, showLabel, and scaleRBy\n * @param {EdgeFilterLensConfig} cfg\n */\n EdgeFilterLens.prototype.updateParams = function (cfg) {\n var self = this;\n var r = cfg.r,\n trigger = cfg.trigger,\n minR = cfg.minR,\n maxR = cfg.maxR,\n scaleRBy = cfg.scaleRBy,\n showLabel = cfg.showLabel,\n shouldShow = cfg.shouldShow;\n if (!isNaN(cfg.r)) {\n self.set('r', r);\n }\n if (!isNaN(maxR)) {\n self.set('maxR', maxR);\n }\n if (!isNaN(minR)) {\n self.set('minR', minR);\n }\n if (trigger === 'mousemove' || trigger === 'click') {\n self.set('trigger', trigger);\n }\n if (scaleRBy === 'wheel' || scaleRBy === 'unset') {\n self.set('scaleRBy', scaleRBy);\n self.get('delegate').remove();\n self.get('delegate').destroy();\n var dPercentText = self.get('dPercentText');\n if (dPercentText) {\n dPercentText.remove();\n dPercentText.destroy();\n }\n }\n if (showLabel === 'node' || showLabel === 'both') {\n self.set('showNodeLabel', true);\n }\n if (showLabel === 'edge' || showLabel === 'both') {\n self.set('showEdgeLabel', true);\n }\n if (shouldShow) {\n self.set('shouldShow', shouldShow);\n }\n };\n /**\n * Update the delegate shape of the lens\n * @param {Point} mCenter the center of the shape\n * @param {number} r the radius of the shape\n */\n EdgeFilterLens.prototype.updateDelegate = function (mCenter, r) {\n var self = this;\n var graph = self.get('graph');\n var lensDelegate = self.get('delegate');\n if (!lensDelegate || lensDelegate.destroyed) {\n // 拖动多个\n var parent_1 = graph.get('group');\n var attrs = self.get('delegateStyle') || lensDelegateStyle;\n // model上的x, y是相对于图形中心的,delegateShape是g实例,x,y是绝对坐标\n lensDelegate = parent_1.addShape('circle', {\n attrs: __assign({\n r: r,\n x: mCenter.x,\n y: mCenter.y\n }, attrs),\n name: 'lens-shape',\n draggable: true\n });\n if (this.get('trigger') !== 'drag') {\n // 调整范围 r 的监听\n if (this.get('scaleRBy') === 'wheel') {\n // 使用滚轮调整 r\n lensDelegate.on('mousewheel', function (evt) {\n self.scaleRByWheel(evt);\n });\n }\n }\n } else {\n lensDelegate.attr({\n x: mCenter.x,\n y: mCenter.y,\n r: r\n });\n }\n self.set('delegate', lensDelegate);\n };\n /**\n * Clear the filtering\n */\n EdgeFilterLens.prototype.clear = function () {\n var self = this;\n var vShapes = self.get('vShapes');\n if (vShapes) {\n vShapes.forEach(function (shape) {\n shape.remove();\n shape.destroy();\n });\n }\n vShapes = [];\n self.set('vShapes', vShapes);\n var lensDelegate = self.get('delegate');\n if (lensDelegate && !lensDelegate.destroyed) {\n lensDelegate.remove();\n lensDelegate.destroy();\n }\n };\n /**\n * Destroy the component\n */\n EdgeFilterLens.prototype.destroy = function () {\n this.clear();\n };\n return EdgeFilterLens;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (EdgeFilterLens);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/edgeFilterLens/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/graph/controller/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/graph/controller/index.js ***! - \*****************************************************************/ -/*! exports provided: ModeController, ViewController, ItemController, StateController */ +/***/ "./node_modules/@antv/g6-plugin/es/fisheye/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/fisheye/index.js ***! + \**********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mode__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mode */ \"./node_modules/@antv/g6-core/es/graph/controller/mode.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ModeController\", function() { return _mode__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _view__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./view */ \"./node_modules/@antv/g6-core/es/graph/controller/view.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ViewController\", function() { return _view__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./item */ \"./node_modules/@antv/g6-core/es/graph/controller/item.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ItemController\", function() { return _item__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _state__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./state */ \"./node_modules/@antv/g6-core/es/graph/controller/state.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"StateController\", function() { return _state__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\nvar DELTA = 0.05;\nvar lensDelegateStyle = {\n stroke: '#000',\n strokeOpacity: 0.8,\n lineWidth: 2,\n fillOpacity: 0.1,\n fill: '#ccc'\n};\nvar Fisheye = /** @class */function (_super) {\n __extends(Fisheye, _super);\n function Fisheye(config) {\n return _super.call(this, config) || this;\n }\n Fisheye.prototype.getDefaultCfgs = function () {\n return {\n trigger: 'mousemove',\n d: 1.5,\n r: 300,\n delegateStyle: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(lensDelegateStyle),\n showLabel: false,\n maxD: 5,\n minD: 0,\n scaleRBy: 'unset',\n scaleDBy: 'unset',\n showDPercent: true\n };\n };\n // class-methods-use-this\n Fisheye.prototype.getEvents = function () {\n var events;\n switch (this.get('trigger')) {\n case 'click':\n events = {\n click: 'magnify'\n };\n break;\n case 'drag':\n events = {\n click: 'createDelegate'\n };\n break;\n default:\n events = {\n mousemove: 'magnify'\n };\n break;\n }\n return events;\n };\n Fisheye.prototype.init = function () {\n var self = this;\n var r = self.get('r');\n self.set('cachedMagnifiedModels', []);\n self.set('cachedOriginPositions', {});\n self.set('r2', r * r);\n var d = self.get('d');\n self.set('molecularParam', (d + 1) * r);\n };\n // Create the delegate when the trigger is drag\n Fisheye.prototype.createDelegate = function (e) {\n var _this = this;\n var self = this;\n var lensDelegate = self.get('delegate');\n if (!lensDelegate || lensDelegate.destroyed) {\n self.magnify(e);\n lensDelegate = self.get('delegate');\n // drag to move the lens\n lensDelegate.on('dragstart', function (evt) {\n self.set('delegateCenterDiff', {\n x: lensDelegate.attr('x') - evt.x,\n y: lensDelegate.attr('y') - evt.y\n });\n });\n lensDelegate.on('drag', function (evt) {\n self.magnify(evt);\n });\n // 绑定调整范围(r)和缩放系数(d)的监听\n // 由于 drag 用于改变 lens 位置, 因此在此模式下, drag 不能用于调整 r 和 d\n // scaling d\n if (this.get('scaleDBy') === 'wheel') {\n lensDelegate.on('mousewheel', function (evt) {\n _this.scaleDByWheel(evt);\n });\n }\n // scaling r\n if (this.get('scaleRBy') === 'wheel') {\n lensDelegate.on('mousewheel', function (evt) {\n self.scaleRByWheel(evt);\n });\n }\n }\n };\n /**\n * Scale the range by wheel\n * @param e mouse wheel event\n */\n Fisheye.prototype.scaleRByWheel = function (e) {\n var self = this;\n if (!e || !e.originalEvent) return;\n if (e.preventDefault) e.preventDefault();\n var graph = self.get('graph');\n var ratio;\n var lensDelegate = self.get('delegate');\n var lensCenter = lensDelegate ? {\n x: lensDelegate.attr('x'),\n y: lensDelegate.attr('y')\n } : undefined;\n var mousePos = lensCenter || graph.getPointByClient(e.clientX, e.clientY);\n if (e.originalEvent.wheelDelta < 0) {\n ratio = 1 - DELTA;\n } else {\n ratio = 1 / (1 - DELTA);\n }\n var maxR = self.get('maxR');\n var minR = self.get('minR');\n var r = self.get('r');\n if (r > (maxR || graph.get('height')) && ratio > 1 || r < (minR || graph.get('height') * 0.05) && ratio < 1) {\n ratio = 1;\n }\n r *= ratio;\n self.set('r', r);\n self.set('r2', r * r);\n var d = self.get('d');\n self.set('molecularParam', (d + 1) * r);\n self.set('delegateCenterDiff', undefined);\n self.magnify(e, mousePos);\n };\n /**\n * Scale the range by dragging\n * @param e mouse event\n */\n Fisheye.prototype.scaleRByDrag = function (e) {\n var self = this;\n if (!e) return;\n var dragPrePos = self.get('dragPrePos');\n var graph = self.get('graph');\n var ratio;\n var mousePos = graph.getPointByClient(e.clientX, e.clientY);\n if (e.x - dragPrePos.x < 0) {\n ratio = 1 - DELTA;\n } else {\n ratio = 1 / (1 - DELTA);\n }\n var maxR = self.get('maxR');\n var minR = self.get('minR');\n var r = self.get('r');\n if (r > (maxR || graph.get('height')) && ratio > 1 || r < (minR || graph.get('height') * 0.05) && ratio < 1) {\n ratio = 1;\n }\n r *= ratio;\n self.set('r', r);\n self.set('r2', r * r);\n var d = self.get('d');\n self.set('molecularParam', (d + 1) * r);\n self.magnify(e, mousePos);\n self.set('dragPrePos', {\n x: e.x,\n y: e.y\n });\n };\n /**\n * Scale the magnifying factor by wheel\n * @param e mouse wheel event\n */\n Fisheye.prototype.scaleDByWheel = function (evt) {\n var self = this;\n if (!evt && !evt.originalEvent) return;\n if (evt.preventDefault) evt.preventDefault();\n var delta = 0;\n if (evt.originalEvent.wheelDelta < 0) {\n delta = -0.1;\n } else {\n delta = 0.1;\n }\n var d = self.get('d');\n var newD = d + delta;\n var maxD = self.get('maxD');\n var minD = self.get('minD');\n if (newD < maxD && newD > minD) {\n self.set('d', newD);\n var r = self.get('r');\n self.set('molecularParam', (newD + 1) * r);\n var lensDelegate = self.get('delegate');\n var lensCenter = lensDelegate ? {\n x: lensDelegate.attr('x'),\n y: lensDelegate.attr('y')\n } : undefined;\n self.set('delegateCenterDiff', undefined);\n self.magnify(evt, lensCenter);\n }\n };\n /**\n * Scale the magnifying factor by dragging\n * @param e mouse event\n */\n Fisheye.prototype.scaleDByDrag = function (e) {\n var self = this;\n var dragPrePos = self.get('dragPrePos');\n var delta = e.x - dragPrePos.x > 0 ? 0.1 : -0.1;\n var d = self.get('d');\n var newD = d + delta;\n var maxD = self.get('maxD');\n var minD = self.get('minD');\n if (newD < maxD && newD > minD) {\n self.set('d', newD);\n var r = self.get('r');\n self.set('molecularParam', (newD + 1) * r);\n self.magnify(e);\n }\n self.set('dragPrePos', {\n x: e.x,\n y: e.y\n });\n };\n /**\n * Response function for mousemove, click, or drag to magnify\n * @param e mouse event\n */\n Fisheye.prototype.magnify = function (e, mousePos) {\n var self = this;\n self.restoreCache();\n var graph = self.get('graph');\n var cachedMagnifiedModels = self.get('cachedMagnifiedModels');\n var cachedOriginPositions = self.get('cachedOriginPositions');\n var showLabel = self.get('showLabel');\n var r = self.get('r');\n var r2 = self.get('r2');\n var d = self.get('d');\n var molecularParam = self.get('molecularParam');\n var nodes = graph.getNodes();\n var nodeLength = nodes.length;\n var mCenter = mousePos ? {\n x: mousePos.x,\n y: mousePos.y\n } : {\n x: e.x,\n y: e.y\n };\n if (self.get('dragging') && (self.get('trigger') === 'mousemove' || self.get('trigger') === 'click')) {\n mCenter = self.get('cacheCenter');\n }\n var delegateCenterDiff = self.get('delegateCenterDiff');\n if (delegateCenterDiff) {\n mCenter.x += delegateCenterDiff.x;\n mCenter.y += delegateCenterDiff.y;\n }\n self.updateDelegate(mCenter, r);\n for (var i = 0; i < nodeLength; i++) {\n var model = nodes[i].getModel();\n var x = model.x,\n y = model.y;\n if (isNaN(x) || isNaN(y)) continue;\n // the square of the distance between the node and the magnified center\n var dist2 = (x - mCenter.x) * (x - mCenter.x) + (y - mCenter.y) * (y - mCenter.y);\n if (!isNaN(dist2) && dist2 < r2 && dist2 !== 0) {\n var dist = Math.sqrt(dist2);\n // (r * (d + 1) * (dist / r)) / (d * (dist / r) + 1);\n var magnifiedDist = molecularParam * dist / (d * dist + r);\n var cos = (x - mCenter.x) / dist;\n var sin = (y - mCenter.y) / dist;\n model.x = cos * magnifiedDist + mCenter.x;\n model.y = sin * magnifiedDist + mCenter.y;\n if (!cachedOriginPositions[model.id]) {\n cachedOriginPositions[model.id] = {\n x: x,\n y: y,\n texts: []\n };\n }\n cachedMagnifiedModels.push(model);\n if (showLabel && 2 * dist < r) {\n var node = nodes[i];\n var nodeGroup = node.getContainer();\n var shapes = nodeGroup.getChildren();\n var shapeLength = shapes.length;\n for (var j = 0; j < shapeLength; j++) {\n var shape = shapes[j];\n if (shape.get('type') === 'text') {\n cachedOriginPositions[model.id].texts.push({\n visible: shape.get('visible'),\n shape: shape\n });\n shape.set('visible', true);\n }\n }\n }\n }\n }\n graph.refreshPositions();\n };\n /**\n * Restore the cache nodes while magnifying\n */\n Fisheye.prototype.restoreCache = function () {\n var self = this;\n var cachedMagnifiedModels = self.get('cachedMagnifiedModels');\n var cachedOriginPositions = self.get('cachedOriginPositions');\n var cacheLength = cachedMagnifiedModels.length;\n for (var i = 0; i < cacheLength; i++) {\n var node = cachedMagnifiedModels[i];\n var id = node.id;\n var ori = cachedOriginPositions[id];\n node.x = ori.x;\n node.y = ori.y;\n var textLength = ori.texts.length;\n for (var j = 0; j < textLength; j++) {\n var text = ori.texts[j];\n text.shape.set('visible', text.visible);\n }\n }\n self.set('cachedMagnifiedModels', []);\n self.set('cachedOriginPositions', {});\n };\n /**\n * Adjust part of the parameters, including trigger, d, r, maxR, minR, maxD, minD, scaleRBy, and scaleDBy\n * @param {FisheyeConfig} cfg\n */\n Fisheye.prototype.updateParams = function (cfg) {\n var self = this;\n var r = cfg.r,\n d = cfg.d,\n trigger = cfg.trigger,\n minD = cfg.minD,\n maxD = cfg.maxD,\n minR = cfg.minR,\n maxR = cfg.maxR,\n scaleDBy = cfg.scaleDBy,\n scaleRBy = cfg.scaleRBy;\n if (!isNaN(cfg.r)) {\n self.set('r', r);\n self.set('r2', r * r);\n }\n if (!isNaN(d)) {\n self.set('d', d);\n }\n if (!isNaN(maxD)) {\n self.set('maxD', maxD);\n }\n if (!isNaN(minD)) {\n self.set('minD', minD);\n }\n if (!isNaN(maxR)) {\n self.set('maxR', maxR);\n }\n if (!isNaN(minR)) {\n self.set('minR', minR);\n }\n var nd = self.get('d');\n var nr = self.get('r');\n self.set('molecularParam', (nd + 1) * nr);\n if (trigger === 'mousemove' || trigger === 'click' || trigger === 'drag') {\n self.set('trigger', trigger);\n }\n if (scaleDBy === 'drag' || scaleDBy === 'wheel' || scaleDBy === 'unset') {\n self.set('scaleDBy', scaleDBy);\n self.get('delegate').remove();\n self.get('delegate').destroy();\n var dPercentText = self.get('dPercentText');\n if (dPercentText) {\n dPercentText.remove();\n dPercentText.destroy();\n }\n }\n if (scaleRBy === 'drag' || scaleRBy === 'wheel' || scaleRBy === 'unset') {\n self.set('scaleRBy', scaleRBy);\n self.get('delegate').remove();\n self.get('delegate').destroy();\n var dPercentText = self.get('dPercentText');\n if (dPercentText) {\n dPercentText.remove();\n dPercentText.destroy();\n }\n }\n };\n /**\n * Update the delegate shape of the lens\n * @param {Point} mCenter the center of the shape\n * @param {number} r the radius of the shape\n */\n Fisheye.prototype.updateDelegate = function (mCenter, r) {\n var _this = this;\n var self = this;\n var graph = self.get('graph');\n var lensDelegate = self.get('delegate');\n if (!lensDelegate || lensDelegate.destroyed) {\n // 拖动多个\n var parent_1 = graph.get('group');\n var attrs = self.get('delegateStyle') || lensDelegateStyle;\n // model上的x, y是相对于图形中心的, delegateShape是g实例, x,y是绝对坐标\n lensDelegate = parent_1.addShape('circle', {\n attrs: __assign({\n r: r / 1.5,\n x: mCenter.x,\n y: mCenter.y\n }, attrs),\n name: 'lens-shape',\n draggable: true\n });\n if (this.get('trigger') !== 'drag') {\n // 调整范围 r 的监听\n if (this.get('scaleRBy') === 'wheel') {\n // 使用滚轮调整 r\n lensDelegate.on('mousewheel', function (evt) {\n self.scaleRByWheel(evt);\n });\n } else if (this.get('scaleRBy') === 'drag') {\n // 使用拖拽调整 r\n lensDelegate.on('dragstart', function (e) {\n self.set('dragging', true);\n self.set('cacheCenter', {\n x: e.x,\n y: e.y\n });\n self.set('dragPrePos', {\n x: e.x,\n y: e.y\n });\n });\n lensDelegate.on('drag', function (evt) {\n self.scaleRByDrag(evt);\n });\n lensDelegate.on('dragend', function (e) {\n self.set('dragging', false);\n });\n }\n // 调整缩放系数 d 的监听\n if (this.get('scaleDBy') === 'wheel') {\n // 使用滚轮调整 d\n lensDelegate.on('mousewheel', function (evt) {\n _this.scaleDByWheel(evt);\n });\n } else if (this.get('scaleDBy') === 'drag') {\n // 使用拖拽调整 d\n lensDelegate.on('dragstart', function (evt) {\n self.set('dragging', true);\n self.set('cacheCenter', {\n x: evt.x,\n y: evt.y\n });\n self.set('dragPrePos', {\n x: evt.x,\n y: evt.y\n });\n });\n lensDelegate.on('drag', function (evt) {\n _this.scaleDByDrag(evt);\n });\n lensDelegate.on('dragend', function (evt) {\n self.set('dragging', false);\n });\n }\n }\n } else {\n lensDelegate.attr({\n x: mCenter.x,\n y: mCenter.y,\n r: r / 1.5\n });\n }\n // 绘制缩放系数百分比文本\n if (self.get('showDPercent')) {\n var percent = Math.round((self.get('d') - self.get('minD')) / (self.get('maxD') - self.get('minD')) * 100);\n var dPercentText = self.get('dPercentText');\n var textY = mCenter.y + r / 1.5 + 16;\n if (!dPercentText || dPercentText.destroyed) {\n var parent_2 = graph.get('group');\n dPercentText = parent_2.addShape('text', {\n attrs: {\n text: \"\".concat(percent, \"%\"),\n x: mCenter.x,\n y: textY,\n fill: '#aaa',\n stroke: '#fff',\n lineWidth: 1,\n fontSize: 12\n }\n });\n self.set('dPercentText', dPercentText);\n } else {\n dPercentText.attr({\n text: \"\".concat(percent, \"%\"),\n x: mCenter.x,\n y: textY\n });\n }\n }\n self.set('delegate', lensDelegate);\n };\n /**\n * Clear the fisheye lens\n */\n Fisheye.prototype.clear = function () {\n var graph = this.get('graph');\n this.restoreCache();\n graph.refreshPositions();\n var lensDelegate = this.get('delegate');\n if (lensDelegate && !lensDelegate.destroyed) {\n lensDelegate.remove();\n lensDelegate.destroy();\n }\n var dPercentText = this.get('dPercentText');\n if (dPercentText && !dPercentText.destroyed) {\n dPercentText.remove();\n dPercentText.destroy();\n }\n };\n /**\n * Destroy the component\n */\n Fisheye.prototype.destroy = function () {\n this.clear();\n };\n return Fisheye;\n}(_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Fisheye);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/fisheye/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/graph/controller/item.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/graph/controller/item.js ***! - \****************************************************************/ +/***/ "./node_modules/@antv/g6-plugin/es/grid/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/grid/index.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _item_edge__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../item/edge */ \"./node_modules/@antv/g6-core/es/item/edge.js\");\n/* harmony import */ var _item_node__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../item/node */ \"./node_modules/@antv/g6-core/es/item/node.js\");\n/* harmony import */ var _item_combo__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../item/combo */ \"./node_modules/@antv/g6-core/es/item/combo.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n\n\n\n\n\n\nvar NODE = 'node';\nvar EDGE = 'edge';\nvar VEDGE = 'vedge';\nvar COMBO = 'combo';\nvar CFG_PREFIX = 'default';\nvar MAPPER_SUFFIX = 'Mapper';\nvar STATE_SUFFIX = 'stateStyles';\n\nvar ItemController =\n/** @class */\nfunction () {\n function ItemController(graph) {\n var _this = this;\n\n this.edgeToBeUpdateMap = {};\n /**\n * 更新边限流,同时可以防止相同的边频繁重复更新\n * */\n\n this.throttleRefresh = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"throttle\"])(function (_) {\n var _a;\n\n var graph = _this.graph;\n if (!graph || graph.get('destroyed')) return;\n var edgeToBeUpdateMap = _this.edgeToBeUpdateMap;\n if (!edgeToBeUpdateMap || !((_a = Object.keys(edgeToBeUpdateMap)) === null || _a === void 0 ? void 0 : _a.length)) return;\n Object.keys(edgeToBeUpdateMap).forEach(function (eid) {\n var edge = edgeToBeUpdateMap[eid].edge;\n if (!edge || edge.destroyed) return;\n var source = edge.getSource();\n var target = edge.getTarget();\n if (!source || source.destroyed || !target || target.destroyed) return;\n edge.refresh(edgeToBeUpdateMap[eid].updateType);\n });\n _this.edgeToBeUpdateMap = {};\n }, 16, {\n trailing: true,\n leading: true\n });\n this.graph = graph;\n this.destroyed = false;\n }\n /**\n * 增加 Item 实例\n *\n * @param {ITEM_TYPE} type 实例类型,node 或 edge\n * @param {(NodeConfig & EdgeConfig)} model 数据模型\n * @returns {(Item)}\n * @memberof ItemController\n */\n\n\n ItemController.prototype.addItem = function (type, model) {\n var graph = this.graph;\n var vType = type === VEDGE ? EDGE : type;\n var parent = graph.get(\"\".concat(vType, \"Group\")) || graph.get('group');\n var upperType = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"upperFirst\"])(vType);\n var item = null; // 获取 this.get('styles') 中的值\n\n var styles = graph.get(vType + Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"upperFirst\"])(STATE_SUFFIX)) || {};\n var defaultModel = graph.get(CFG_PREFIX + upperType);\n\n if (model[STATE_SUFFIX]) {\n // 设置 this.get('styles') 中的值\n styles = model[STATE_SUFFIX];\n }\n\n if (defaultModel) {\n // 很多布局会直接修改原数据模型,所以不能用 merge 的形式,逐个写入原 model 中\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(defaultModel, function (val, cfg) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isObject\"])(val) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(val)) {\n model[cfg] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, val, model[cfg]);\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(val)) {\n model[cfg] = model[cfg] || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(defaultModel[cfg]);\n } else {\n model[cfg] = model[cfg] || defaultModel[cfg];\n }\n });\n }\n\n var mapper = graph.get(vType + MAPPER_SUFFIX);\n\n if (mapper) {\n var mappedModel_1 = mapper(model);\n\n if (mappedModel_1[STATE_SUFFIX]) {\n // 设置 this.get('styles') 中的值\n styles = mappedModel_1[STATE_SUFFIX];\n delete mappedModel_1[STATE_SUFFIX];\n } // 如果配置了 defaultEdge 或 defaultNode,则将默认配置的数据也合并进去\n\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(mappedModel_1, function (val, cfg) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isObject\"])(val) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(val)) {\n model[cfg] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, model[cfg], val);\n } else {\n model[cfg] = mappedModel_1[cfg] || model[cfg];\n }\n });\n }\n\n graph.emit('beforeadditem', {\n type: type,\n model: model\n });\n\n if (type === EDGE || type === VEDGE) {\n var source = void 0;\n var target = void 0;\n source = model.source; // eslint-disable-line prefer-destructuring\n\n target = model.target; // eslint-disable-line prefer-destructuring\n\n if (source && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(source)) {\n source = graph.findById(source);\n }\n\n if (target && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(target)) {\n target = graph.findById(target);\n }\n\n if (!source || !target) {\n console.warn(\"The source or target node of edge \".concat(model.id, \" does not exist!\"));\n return;\n }\n\n if (source.getType && source.getType() === 'combo') {\n model.isComboEdge = true; // graph.updateCombo(source as ICombo);\n }\n\n if (target.getType && target.getType() === 'combo') {\n model.isComboEdge = true; // graph.updateCombo(target as ICombo);\n }\n\n item = new _item_edge__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n model: model,\n source: source,\n target: target,\n styles: styles,\n linkCenter: graph.get('linkCenter'),\n group: parent.addGroup()\n });\n } else if (type === NODE) {\n item = new _item_node__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n model: model,\n styles: styles,\n group: parent.addGroup()\n });\n } else if (type === COMBO) {\n var children = model.children;\n var comboBBox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getComboBBox\"])(children, graph);\n var bboxX = void 0,\n bboxY = void 0;\n if (!isNaN(comboBBox.x)) bboxX = comboBBox.x;else if (isNaN(model.x)) bboxX = Math.random() * 100;\n if (!isNaN(comboBBox.y)) bboxY = comboBBox.y;else if (isNaN(model.y)) bboxY = Math.random() * 100;\n\n if (isNaN(model.x) || isNaN(model.y)) {\n model.x = bboxX;\n model.y = bboxY;\n } else {\n // if there is x y in model, place the combo according to it and move its succeed items. that means, the priority of the combo's position is higher than succeed items'\n var dx = model.x - bboxX;\n var dy = model.y - bboxY; // In the same time, adjust the children's positions\n\n this.updateComboSucceeds(model.id, dx, dy, children);\n }\n\n var comboGroup = parent.addGroup();\n comboGroup.setZIndex(model.depth);\n item = new _item_combo__WEBPACK_IMPORTED_MODULE_4__[\"default\"]({\n model: model,\n styles: styles,\n animate: false,\n bbox: model.collapsed ? Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getComboBBox\"])([], graph) : comboBBox,\n group: comboGroup\n });\n var comboModel_1 = item.getModel();\n (children || []).forEach(function (child) {\n var childItem = graph.findById(child.id);\n item.addChild(childItem);\n child.depth = comboModel_1.depth + 2;\n });\n }\n\n if (item) {\n graph.get(\"\".concat(type, \"s\")).push(item);\n graph.get('itemMap')[item.get('id')] = item;\n graph.emit('afteradditem', {\n item: item,\n model: model\n }); // eslint-disable-next-line consistent-return\n\n return item;\n }\n };\n /**\n * 更新节点或边\n *\n * @param {Item} item ID 或 实例\n * @param {(EdgeConfig | Partial)} cfg 数据模型\n * @returns\n * @memberof ItemController\n */\n\n\n ItemController.prototype.updateItem = function (item, cfg) {\n var _this = this;\n\n var _a, _b;\n\n var graph = this.graph;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n\n if (!item || item.destroyed) {\n return;\n } // 更新的 item 的类型\n\n\n var type = '';\n if (item.getType) type = item.getType();\n var mapper = graph.get(type + MAPPER_SUFFIX);\n var model = item.getModel();\n var oriX = model.x,\n oriY = model.y;\n var updateType = item.getUpdateType(cfg);\n\n if (mapper) {\n var result = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, model, cfg);\n var mappedModel = mapper(result); // 将 update 时候用户传入的参数与mapperModel做deepMix,以便复用之前设置的参数值\n\n var newModel = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, model, mappedModel, cfg);\n\n if (mappedModel[STATE_SUFFIX]) {\n item.set('styles', newModel[STATE_SUFFIX]);\n delete newModel[STATE_SUFFIX];\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(newModel, function (val, key) {\n cfg[key] = val;\n });\n } else {\n // merge update传进来的对象参数,model中没有的数据不做处理,对象和字符串值也不做处理,直接替换原来的\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(cfg, function (val, key) {\n if (model[key]) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isObject\"])(val) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(val)) {\n cfg[key] = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, model[key]), cfg[key]);\n }\n }\n });\n } // emit beforeupdateitem 事件\n\n\n graph.emit('beforeupdateitem', {\n item: item,\n cfg: cfg\n });\n\n if (type === EDGE) {\n // 若是边要更新source || target, 为了不影响示例内部model,并且重新计算startPoint和endPoint,手动设置\n if (cfg.source) {\n var source = cfg.source;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(source)) {\n source = graph.findById(source);\n }\n\n item.setSource(source);\n }\n\n if (cfg.target) {\n var target = cfg.target;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(target)) {\n target = graph.findById(target);\n }\n\n item.setTarget(target);\n }\n\n item.update(cfg);\n } else if (type === NODE) {\n item.update(cfg, updateType);\n var edges = item.getEdges();\n var refreshEdge = (updateType === null || updateType === void 0 ? void 0 : updateType.includes('bbox')) || updateType === 'move';\n\n if (updateType === 'move') {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges, function (edge) {\n _this.edgeToBeUpdateMap[edge.getID()] = {\n edge: edge,\n updateType: updateType\n };\n\n _this.throttleRefresh();\n });\n } else if (refreshEdge) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges, function (edge) {\n edge.refresh(updateType);\n });\n }\n } else if (type === COMBO) {\n item.update(cfg, updateType);\n\n if (!isNaN(cfg.x) || !isNaN(cfg.y)) {\n // if there is x y in model, place the combo according to it and move its succeed items. that means, the priority of the combo's position is higher than succeed items'\n var dx = cfg.x - oriX || 0;\n var dy = cfg.y - oriY || 0; // In the same time, adjust the children's positions\n\n this.updateComboSucceeds(model.id, dx, dy);\n }\n\n var edges_1 = item.getEdges();\n var refreshEdge = (updateType === null || updateType === void 0 ? void 0 : updateType.includes('bbox')) || updateType === 'move';\n\n if (refreshEdge && type === COMBO) {\n var shapeFactory = item.get('shapeFactory');\n var shapeType = model.type || 'circle';\n var comboAnimate = model.animate === undefined || cfg.animate === undefined ? (_b = (_a = shapeFactory[shapeType]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.animate : model.animate || cfg.animate;\n\n if (comboAnimate) {\n setTimeout(function () {\n if (!item || item.destroyed) return;\n var keyShape = item.getKeyShape();\n if (!keyShape || keyShape.destroyed) return;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges_1, function (edge) {\n if (edge && !edge.destroyed) edge.refresh();\n });\n }, 201);\n } else {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges_1, function (edge) {\n edge.refresh();\n });\n }\n }\n }\n\n graph.emit('afterupdateitem', {\n item: item,\n cfg: cfg\n });\n };\n /**\n * 根据 combo 的子元素更新 combo 的位置及大小\n *\n * @param {ICombo} combo ID 或 实例\n * @returns\n * @memberof ItemController\n */\n\n\n ItemController.prototype.updateCombo = function (combo, children, followCombo) {\n var _this = this;\n\n var _a, _b;\n\n var graph = this.graph;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(combo)) {\n combo = graph.findById(combo);\n }\n\n if (!combo || combo.destroyed) {\n return;\n }\n\n var model = combo.getModel();\n var comboBBox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getComboBBox\"])(children, graph, combo);\n var comboX = comboBBox.x,\n comboY = comboBBox.y;\n combo.set('bbox', comboBBox);\n var x = comboX,\n y = comboY;\n\n if (followCombo) {\n // position of combo model first\n x = isNaN(model.x) ? comboX : model.x;\n y = isNaN(model.y) ? comboY : model.y;\n } else {\n // position of succeed items first\n x = isNaN(comboX) ? model.x : comboX;\n y = isNaN(comboY) ? model.y : comboY;\n }\n\n combo.update({\n x: x,\n y: y\n });\n var shapeFactory = combo.get('shapeFactory');\n var shapeType = model.type || 'circle';\n var comboAnimate = model.animate === undefined ? (_b = (_a = shapeFactory[shapeType]) === null || _a === void 0 ? void 0 : _a.options) === null || _b === void 0 ? void 0 : _b.animate : model.animate;\n\n if (comboAnimate) {\n setTimeout(function () {\n if (!combo || combo.destroyed) return;\n var keyShape = combo.getKeyShape();\n if (!keyShape || keyShape.destroyed) return;\n combo.getShapeCfg(model); // 更新 combo 缓存的 size\n\n _this.updateComboEdges(combo);\n }, 201);\n } else {\n this.updateComboEdges(combo);\n }\n };\n\n ItemController.prototype.updateComboEdges = function (combo) {\n var combEdges = combo.getEdges() || [];\n\n for (var i = 0; i < combEdges.length; i++) {\n var edge = combEdges[i];\n\n if (edge && !edge.destroyed) {\n edge.refresh();\n }\n }\n };\n /**\n * 收起 combo,隐藏相关元素\n */\n\n\n ItemController.prototype.collapseCombo = function (combo, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n var graph = this.graph;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(combo)) {\n combo = graph.findById(combo);\n }\n\n var children = combo.getChildren();\n children.nodes.forEach(function (node) {\n graph.hideItem(node, stack);\n });\n children.combos.forEach(function (c) {\n graph.hideItem(c, stack);\n });\n };\n /**\n * 根据位置差量 dx dy,更新 comboId 后继元素的位置\n * */\n\n\n ItemController.prototype.updateComboSucceeds = function (comboId, dx, dy, children) {\n var _this = this;\n\n if (children === void 0) {\n children = [];\n }\n\n var graph = this.graph;\n if (!dx && !dy) return;\n var kids = children;\n\n if (!(kids === null || kids === void 0 ? void 0 : kids.length)) {\n var comboTrees = graph.get('comboTrees');\n comboTrees === null || comboTrees === void 0 ? void 0 : comboTrees.forEach(function (child) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTree\"])(child, function (subTree) {\n if (subTree.id === comboId) {\n kids = subTree.children;\n return false;\n }\n\n return true;\n });\n });\n }\n\n kids === null || kids === void 0 ? void 0 : kids.forEach(function (child) {\n var childItem = graph.findById(child.id);\n\n if (childItem) {\n var childModel = childItem.getModel();\n\n _this.updateItem(child.id, {\n x: (childModel.x || 0) + dx,\n y: (childModel.y || 0) + dy\n });\n }\n });\n };\n /**\n * 展开 combo,相关元素出现\n * 若子 combo 原先是收起状态,则保持它的收起状态\n */\n\n\n ItemController.prototype.expandCombo = function (combo, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n var graph = this.graph;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(combo)) {\n combo = graph.findById(combo);\n }\n\n var children = combo.getChildren();\n children.nodes.forEach(function (node) {\n graph.showItem(node, stack);\n });\n children.combos.forEach(function (c) {\n if (c.getModel().collapsed) {\n c.show();\n } else {\n graph.showItem(c, stack);\n }\n });\n };\n /**\n * 删除指定的节点或边\n *\n * @param {Item} item item ID 或实例\n * @returns {void}\n * @memberof ItemController\n */\n\n\n ItemController.prototype.removeItem = function (item) {\n var _this = this;\n\n var graph = this.graph;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n\n if (!item || item.destroyed) {\n return;\n }\n\n var itemModel = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(item.getModel());\n graph.emit('beforeremoveitem', {\n item: itemModel\n });\n var type = '';\n if (item.getType) type = item.getType();\n var items = graph.get(\"\".concat(type, \"s\"));\n var index = items.indexOf(item);\n if (index > -1) items.splice(index, 1);\n\n if (type === EDGE) {\n var vitems = graph.get(\"v\".concat(type, \"s\"));\n var vindex = vitems.indexOf(item);\n if (vindex > -1) vitems.splice(vindex, 1);\n }\n\n var itemId = item.get('id');\n var itemMap = graph.get('itemMap');\n delete itemMap[itemId];\n var comboTrees = graph.get('comboTrees');\n var id = item.get('id');\n\n if (type === NODE) {\n var comboId = item.getModel().comboId;\n\n if (comboTrees && comboId) {\n var brothers_1 = comboTrees;\n var found_1 = false; // the flag to terminate the forEach circulation\n // remove the node from the children array of its parent fromt he tree\n\n comboTrees.forEach(function (ctree) {\n if (found_1) return;\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTree\"])(ctree, function (combo) {\n if (combo.id === id && brothers_1) {\n var bidx = brothers_1.indexOf(combo);\n brothers_1.splice(bidx, 1);\n found_1 = true;\n return false; // terminate the traverse\n }\n\n brothers_1 = combo.children;\n return true;\n });\n });\n } // 若移除的是节点,需要将与之相连的边一同删除\n\n\n var edges = item.getEdges();\n\n for (var i = edges.length - 1; i >= 0; i--) {\n graph.removeItem(edges[i], false);\n }\n\n if (comboId) graph.updateCombo(comboId);\n } else if (type === COMBO) {\n var parentId = item.getModel().parentId;\n var comboInTree_1; // find the subtree rooted at the item to be removed\n\n var found_2 = false; // the flag to terminate the forEach circulation\n\n (comboTrees || []).forEach(function (ctree) {\n if (found_2) return;\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTree\"])(ctree, function (combo) {\n if (combo.id === id) {\n comboInTree_1 = combo;\n found_2 = true;\n return false; // terminate the traverse\n }\n\n return true;\n });\n });\n comboInTree_1.removed = true;\n\n if (comboInTree_1 && comboInTree_1.children) {\n comboInTree_1.children.forEach(function (child) {\n _this.removeItem(child.id);\n });\n } // 若移除的是 combo,需要将与之相连的边一同删除\n\n\n var edges = item.getEdges();\n\n for (var i = edges.length; i >= 0; i--) {\n graph.removeItem(edges[i], false);\n }\n\n if (parentId) graph.updateCombo(parentId);\n }\n\n item.destroy();\n graph.emit('afterremoveitem', {\n item: itemModel,\n type: type\n });\n };\n /**\n * 更新 item 状态\n *\n * @param {Item} item Item 实例\n * @param {string} state 状态名称\n * @param {boolean} value 是否启用状态或状态值\n * @returns {void}\n * @memberof ItemController\n */\n\n\n ItemController.prototype.setItemState = function (item, state, value) {\n var graph = this.graph;\n var stateName = state;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(value)) {\n stateName = \"\".concat(state, \":\").concat(value);\n } // 已经存在要设置的 state,或不存在 state 的样式为 undefined\n\n\n if (item.hasState(stateName) === value && value || // 当该状态已经存在且现在需要设置为 true 时,不需要继续。当该状态不存在,且设置为 false 时,需要继续\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(value) && item.hasState(stateName)) {\n // 当该状态 value 是字符串,且已经存在该状态,不需要继续\n return;\n }\n\n graph.emit('beforeitemstatechange', {\n item: item,\n state: stateName,\n enabled: value\n });\n item.setState(state, value);\n graph.autoPaint();\n graph.emit('afteritemstatechange', {\n item: item,\n state: stateName,\n enabled: value\n });\n };\n /**\n * 将指定状态的优先级提升为最高优先级\n * @param {Item} item 元素id或元素实例\n * @param state 状态名称\n */\n\n\n ItemController.prototype.priorityState = function (item, state) {\n var graph = this.graph;\n var currentItem = item;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n currentItem = graph.findById(item);\n } // 先取消已有的 state\n\n\n this.setItemState(currentItem, state, false); // 再设置state,则此时该优先级为最高\n\n this.setItemState(currentItem, state, true);\n };\n /**\n * 清除所有指定的状态\n *\n * @param {Item} item Item 实例\n * @param {string[]} states 状态名称集合\n * @memberof ItemController\n */\n\n\n ItemController.prototype.clearItemStates = function (item, states) {\n var graph = this.graph;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n\n graph.emit('beforeitemstatesclear', {\n item: item,\n states: states\n });\n item.clearStates(states);\n graph.emit('afteritemstatesclear', {\n item: item,\n states: states\n });\n };\n /**\n * 刷新指定的 Item\n *\n * @param {Item} item Item ID 或 实例\n * @memberof ItemController\n */\n\n\n ItemController.prototype.refreshItem = function (item) {\n var graph = this.graph;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n\n graph.emit('beforeitemrefresh', {\n item: item\n }); // 调用 Item 的 refresh 方法,实现刷新功能\n\n item.refresh();\n graph.emit('afteritemrefresh', {\n item: item\n });\n };\n /**\n * 根据 graph 上用 combos 数据生成的 comboTree 来增加所有 combos\n *\n * @param {ComboTree[]} comboTrees graph 上用 combos 数据生成的 comboTree\n * @param {ComboConfig[]} comboModels combos 数据\n * @memberof ItemController\n */\n\n\n ItemController.prototype.addCombos = function (comboTrees, comboModels) {\n var _this = this;\n\n var graph = this.graph;\n (comboTrees || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTreeUp\"])(ctree, function (child) {\n var comboModel;\n comboModels.forEach(function (model) {\n if (model.id === child.id) {\n model.children = child.children;\n model.depth = child.depth;\n comboModel = model;\n }\n });\n\n if (comboModel) {\n _this.addItem('combo', comboModel);\n }\n\n return true;\n });\n });\n var comboGroup = graph.get('comboGroup');\n if (comboGroup) comboGroup.sort();\n };\n /**\n * 改变Item的显示状态\n *\n * @param {Item} item Item ID 或 实例\n * @param {boolean} visible 是否显示\n * @memberof ItemController\n */\n\n\n ItemController.prototype.changeItemVisibility = function (item, visible) {\n var _this = this;\n\n var graph = this.graph;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = graph.findById(item);\n }\n\n if (!item) {\n console.warn('The item to be shown or hidden does not exist!');\n return;\n }\n\n graph.emit('beforeitemvisibilitychange', {\n item: item,\n visible: visible\n });\n item.changeVisibility(visible);\n\n if (item.getType && item.getType() === NODE) {\n var edges = item.getEdges();\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges, function (edge) {\n // 若隐藏节点,则将与之关联的边也隐藏\n // 若显示节点,则将与之关联的边也显示,但是需要判断边两端的节点都是可见的\n if (visible && !(edge.get('source').isVisible() && edge.get('target').isVisible())) {\n return;\n }\n\n _this.changeItemVisibility(edge, visible);\n });\n } else if (item.getType && item.getType() === COMBO) {\n var comboTrees = graph.get('comboTrees');\n var id_1 = item.get('id');\n var children_1 = [];\n var found_3 = false; // flag the terminate the forEach\n\n (comboTrees || []).forEach(function (ctree) {\n if (found_3) return;\n if (!ctree.children || ctree.children.length === 0) return;\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"traverseTree\"])(ctree, function (combo) {\n if (combo.id === id_1) {\n children_1 = combo.children;\n found_3 = true;\n return false; // terminate the traverse\n }\n\n return true;\n });\n });\n\n if (children_1 && (!visible || visible && !item.getModel().collapsed)) {\n children_1.forEach(function (child) {\n var childItem = graph.findById(child.id);\n\n _this.changeItemVisibility(childItem, visible);\n });\n }\n\n var edges = item.getEdges();\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(edges, function (edge) {\n // 若隐藏 combo,则将与 combo 本身关联的边也隐藏\n // 若显示 combo,则将与 combo 本身关联的边也显示,但是需要判断边两端的节点都是可见的\n if (visible && !(edge.get('source').isVisible() && edge.get('target').isVisible())) {\n return;\n }\n\n _this.changeItemVisibility(edge, visible);\n });\n }\n\n graph.emit('afteritemvisibilitychange', {\n item: item,\n visible: visible\n });\n return item;\n };\n\n ItemController.prototype.destroy = function () {\n this.graph = null;\n this.destroyed = true;\n };\n\n return ItemController;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ItemController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/item.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n// 网格背景图片\nvar GRID_PNG = 'url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)';\nvar Grid = /** @class */function (_super) {\n __extends(Grid, _super);\n function Grid(config) {\n return _super.call(this, config) || this;\n }\n Grid.prototype.getDefaultCfgs = function () {\n return {\n img: GRID_PNG,\n follow: true\n };\n };\n Grid.prototype.init = function () {\n var graph = this.get('graph');\n var graphContainer = graph.get('container');\n var canvas = graph.get('canvas').get('el');\n var img = this.get('img') || GRID_PNG;\n if (!img.includes('url(')) {\n img = \"url(\\\"\".concat(img, \"\\\")\");\n }\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\");\n var gridContainer = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n this.set('container', container);\n this.set('gridContainer', gridContainer);\n this.positionInit();\n container.appendChild(gridContainer);\n graphContainer.insertBefore(container, canvas);\n };\n /** 定位信息初始化 */\n Grid.prototype.positionInit = function () {\n var graph = this.get('graph');\n var minZoom = graph.get('minZoom');\n var width = graph.get('width');\n var height = graph.get('height');\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.get('container'), {\n width: \"\".concat(width, \"px\"),\n height: \"\".concat(height, \"px\")\n });\n // 网格 40*40 需保证 (gridContainerWidth / 2) % 40 = 0 才能让网格线对齐左上角 故 * 80\n var gridContainerWidth = width * 80 / minZoom;\n var gridContainerHeight = height * 80 / minZoom;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.get('gridContainer'), {\n width: \"\".concat(gridContainerWidth, \"px\"),\n height: \"\".concat(gridContainerHeight, \"px\"),\n left: \"-\".concat(gridContainerWidth / 2, \"px\"),\n top: \"-\".concat(gridContainerHeight / 2, \"px\")\n });\n };\n // class-methods-use-this\n Grid.prototype.getEvents = function () {\n return {\n viewportchange: 'updateGrid'\n };\n };\n /**\n * viewport change 事件的响应函数\n * @param param\n */\n Grid.prototype.updateGrid = function (param) {\n var gridContainer = this.get('gridContainer');\n var matrix = param.matrix;\n if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var isFollow = this.get('follow');\n var transform = \"matrix(\".concat(matrix[0], \", \").concat(matrix[1], \", \").concat(matrix[3], \", \").concat(matrix[4], \", \").concat(isFollow ? matrix[6] : '0', \", \").concat(isFollow ? matrix[7] : '0', \")\");\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(gridContainer, {\n transform: transform\n });\n };\n Grid.prototype.getContainer = function () {\n return this.get('container');\n };\n Grid.prototype.destroy = function () {\n var graph = this.get('graph');\n var graphContainer = graph.get('container');\n var container = this.get('container');\n graphContainer.removeChild(container);\n };\n return Grid;\n}(_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Grid);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/grid/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/graph/controller/layout.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/graph/controller/layout.js ***! - \******************************************************************/ +/***/ "./node_modules/@antv/g6-plugin/es/imageMinimap/index.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/imageMinimap/index.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n\n\n\n\nvar LayoutController =\n/** @class */\nfunction () {\n function LayoutController(graph) {\n this.graph = graph;\n this.layoutCfg = graph.get('layout') || {};\n this.layoutType = this.getLayoutType();\n this.layoutMethods = [];\n this.initLayout();\n } // eslint-disable-next-line class-methods-use-this\n\n\n LayoutController.prototype.initLayout = function () {// no data before rendering\n };\n\n LayoutController.prototype.getLayoutType = function () {\n return this.getLayoutCfgType(this.layoutCfg);\n };\n\n LayoutController.prototype.getLayoutCfgType = function (layoutCfg) {\n var type = layoutCfg.type; // type should be top priority\n\n if (type) {\n return type;\n }\n\n var pipes = layoutCfg.pipes;\n\n if (Array.isArray(pipes)) {\n return pipes.map(function (pipe) {\n return (pipe === null || pipe === void 0 ? void 0 : pipe.type) || '';\n });\n }\n\n return null;\n };\n\n LayoutController.prototype.isLayoutTypeSame = function (cfg) {\n var current = this.getLayoutCfgType(cfg);\n var preHasPipies = Array.isArray(this.layoutType);\n var currentHasPipes = Array.isArray(current); // already has pipes, and the new one is pipes\n\n if (preHasPipies && currentHasPipes) {\n return this.layoutType.every(function (type, index) {\n return type === current[index];\n });\n } // only one of the pre and current is pipes\n\n\n if (Array.isArray(current) || Array.isArray(this.layoutType)) {\n return false;\n } // both of the pre and current are not pipes\n\n\n return (cfg === null || cfg === void 0 ? void 0 : cfg.type) === this.layoutType;\n }; // 绘制\n\n\n LayoutController.prototype.refreshLayout = function () {\n var _a = this,\n graph = _a.graph,\n layoutType = _a.layoutType;\n\n if (!graph) return;\n\n if (graph.get('animate')) {\n graph.positionsAnimate(layoutType === 'comboCombined');\n } else {\n graph.refreshPositions(layoutType === 'comboCombined');\n }\n }; // 更换布局\n\n\n LayoutController.prototype.changeLayout = function (cfg) {\n var disableTriggerLayout = cfg.disableTriggerLayout,\n otherCfgs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(cfg, [\"disableTriggerLayout\"]);\n\n this.layoutCfg = otherCfgs;\n this.layoutType = otherCfgs.type || this.layoutType; // 不触发重新布局,仅更新参数\n\n if (disableTriggerLayout) return;\n this.layout();\n }; // 更换数据\n\n\n LayoutController.prototype.changeData = function (success) {\n this.layout(success);\n };\n\n LayoutController.prototype.destoryLayoutMethods = function () {\n var layoutMethods = this.layoutMethods;\n var destroyedLayoutTypes = [];\n layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.forEach(function (layoutMethod) {\n var _a;\n\n var layoutType = (_a = layoutMethod.getType) === null || _a === void 0 ? void 0 : _a.call(layoutMethod);\n if (layoutType) destroyedLayoutTypes.push(layoutType);\n layoutMethod.destroy();\n });\n this.layoutMethods = [];\n return destroyedLayoutTypes;\n }; // 销毁布局,不能使用 this.destroy,因为 controller 还需要被使用,只是把布局算法销毁\n\n\n LayoutController.prototype.destroyLayout = function () {\n var graph = this.graph;\n this.destoryLayoutMethods();\n graph.set('layout', undefined);\n this.layoutCfg = undefined;\n this.layoutType = undefined;\n this.layoutMethods = undefined;\n }; // 从 this.graph 获取数据\n\n\n LayoutController.prototype.setDataFromGraph = function () {\n var nodes = [];\n var hiddenNodes = [];\n var edges = [];\n var hiddenEdges = [];\n var comboEdges = [];\n var combos = [];\n var hiddenCombos = [];\n var nodeItems = this.graph.getNodes();\n var edgeItems = this.graph.getEdges();\n var comboItems = this.graph.getCombos();\n var nodeLength = nodeItems.length;\n\n for (var i = 0; i < nodeLength; i++) {\n var nodeItem = nodeItems[i];\n if (!nodeItem || nodeItem.destroyed) continue;\n var model = nodeItem.getModel();\n\n if (!nodeItem.isVisible()) {\n hiddenNodes.push(model);\n continue;\n }\n\n nodes.push(model);\n }\n\n var edgeLength = edgeItems.length;\n\n for (var i = 0; i < edgeLength; i++) {\n var edgeItem = edgeItems[i];\n if (!edgeItem || edgeItem.destroyed) continue;\n var model = edgeItem.getModel();\n\n if (!edgeItem.isVisible()) {\n hiddenEdges.push(model);\n continue;\n }\n\n if (!model.isComboEdge) edges.push(model);else comboEdges.push(model);\n }\n\n var comboLength = comboItems.length;\n\n for (var i = 0; i < comboLength; i++) {\n var comboItem = comboItems[i];\n if (comboItem.destroyed) continue;\n var model = comboItem.getModel();\n\n if (!comboItem.isVisible()) {\n hiddenCombos.push(model);\n continue;\n }\n\n combos.push(model);\n }\n\n return {\n nodes: nodes,\n hiddenNodes: hiddenNodes,\n edges: edges,\n hiddenEdges: hiddenEdges,\n combos: combos,\n hiddenCombos: hiddenCombos,\n comboEdges: comboEdges\n };\n }; // 重新布局\n\n\n LayoutController.prototype.relayout = function (reloadData) {\n var _this = this;\n\n var _a = this,\n graph = _a.graph,\n layoutMethods = _a.layoutMethods,\n layoutCfg = _a.layoutCfg;\n\n if (reloadData) {\n this.data = this.setDataFromGraph();\n var nodes = this.data.nodes;\n\n if (!nodes) {\n return false;\n }\n\n this.initPositions(layoutCfg.center, nodes);\n }\n\n graph.emit('beforelayout');\n var start = Promise.resolve();\n layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.forEach(function (layoutMethod, index) {\n var currentCfg = layoutCfg[index] || layoutCfg;\n start = start.then(function () {\n var _a;\n\n var relayoutPromise = _this.execLayoutMethod(currentCfg, index);\n\n if (index === layoutMethods.length - 1) {\n (_a = layoutCfg.onAllLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(layoutCfg);\n }\n\n return relayoutPromise;\n });\n });\n }; // 筛选参与布局的nodes和edges\n\n\n LayoutController.prototype.filterLayoutData = function (data, cfg) {\n var nodes = data.nodes,\n edges = data.edges,\n rest = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(data, [\"nodes\", \"edges\"]);\n\n if (!nodes) {\n return data;\n }\n\n var nodesFilter;\n var edegsFilter;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(cfg === null || cfg === void 0 ? void 0 : cfg.nodesFilter)) {\n nodesFilter = cfg.nodesFilter;\n } else {\n nodesFilter = function nodesFilter() {\n return true;\n };\n }\n\n var fNodes = nodes.filter(nodesFilter);\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(cfg === null || cfg === void 0 ? void 0 : cfg.edgesFilter)) {\n edegsFilter = cfg.edgesFilter;\n } else {\n var nodesMap_1 = fNodes.reduce(function (acc, cur) {\n acc[cur.id] = true;\n return acc;\n }, {});\n\n edegsFilter = function edegsFilter(edge) {\n return nodesMap_1[edge.source] && nodesMap_1[edge.target];\n };\n }\n\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n nodes: fNodes,\n edges: edges.filter(edegsFilter)\n }, rest);\n };\n\n LayoutController.prototype.getLayoutBBox = function (nodes) {\n var graph = this.graph;\n var graphGroupNodes = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"groupBy\"])(graph.getNodes(), function (n) {\n return n.getModel().layoutOrder;\n });\n var layoutNodes = Object.values(graphGroupNodes).map(function (value) {\n var bbox = Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"calculationItemsBBox\"])(value);\n bbox.size = [bbox.width, bbox.height];\n return bbox;\n });\n var groupNodes = Object.values(Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"groupBy\"])(nodes, 'layoutOrder'));\n return {\n groupNodes: groupNodes,\n layoutNodes: layoutNodes\n };\n }; // 控制布局动画\n // eslint-disable-next-line class-methods-use-this\n\n\n LayoutController.prototype.layoutAnimate = function () {}; // 将当前节点的平均中心移动到原点\n\n\n LayoutController.prototype.moveToZero = function () {\n var graph = this.graph;\n var data = graph.get('data');\n var nodes = data.nodes;\n\n if (nodes[0].x === undefined || nodes[0].x === null || Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(nodes[0].x)) {\n return;\n }\n\n var meanCenter = [0, 0];\n var nodeLength = nodes.length;\n\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n meanCenter[0] += node.x;\n meanCenter[1] += node.y;\n }\n\n meanCenter[0] /= nodes.length;\n meanCenter[1] /= nodes.length;\n\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n node.x -= meanCenter[0];\n node.y -= meanCenter[1];\n }\n }; // 初始化节点到 center 附近\n\n\n LayoutController.prototype.initPositions = function (center, nodes) {\n var _a;\n\n var graph = this.graph;\n\n if (!nodes) {\n return false;\n }\n\n var nodeLength = nodes ? nodes.length : 0;\n if (!nodeLength) return;\n var hasPreset = (_a = this.initWithPreset) === null || _a === void 0 ? void 0 : _a.call(this);\n if (hasPreset) return false;\n var width = graph.get('width') * 0.85;\n var height = graph.get('height') * 0.85;\n var horiNum = Math.ceil(Math.sqrt(nodeLength) * (width / height));\n var vertiNum = Math.ceil(nodeLength / horiNum);\n var horiGap = width / (horiNum - 1);\n var vertiGap = height / (vertiNum - 1);\n if (!isFinite(horiGap) || !horiGap) horiGap = 0;\n if (!isFinite(vertiGap) || !horiGap) vertiGap = 0;\n var beginX = center[0] - width / 2;\n var beginY = center[1] - height / 2;\n var allHavePos = true;\n\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n\n if (Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(+node.x)) {\n allHavePos = false;\n node.x = i % horiNum * horiGap + beginX;\n }\n\n if (Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(+node.y)) {\n allHavePos = false;\n node.y = Math.floor(i / horiNum) * vertiGap + beginY;\n }\n }\n\n return allHavePos;\n };\n\n LayoutController.prototype.destroy = function () {\n this.graph = null;\n this.destoryLayoutMethods();\n this.destroyed = true;\n };\n\n return LayoutController;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayoutController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/layout.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\n\nvar applyMatrix = _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].applyMatrix;\nfunction getImgNaturalDimension(img, callback) {\n var nWidth, nHeight;\n if (img.naturalWidth) {\n // 现代浏览器\n nWidth = img.naturalWidth;\n nHeight = img.naturalHeight;\n } else {\n // IE6/7/8\n var image_1 = new Image();\n image_1.src = img.src;\n image_1.onload = function () {\n if (callback) callback(image_1.width, image_1.height);\n };\n }\n return [nWidth, nHeight];\n}\nvar ImageMiniMap = /** @class */function (_super) {\n __extends(ImageMiniMap, _super);\n function ImageMiniMap(config) {\n return _super.call(this, config) || this;\n }\n ImageMiniMap.prototype.getDefaultCfgs = function () {\n return {\n container: null,\n className: 'g6-minimap',\n viewportClassName: 'g6-minimap-viewport',\n width: 200,\n delegateStyle: {\n fill: '#40a9ff',\n stroke: '#096dd9'\n },\n refresh: true\n };\n };\n ImageMiniMap.prototype.getEvents = function () {\n return {\n beforepaint: 'updateViewport',\n beforeanimate: 'disableRefresh',\n afteranimate: 'enableRefresh',\n viewportchange: 'disableOneRefresh'\n };\n };\n // 若是正在进行动画,不刷新缩略图\n ImageMiniMap.prototype.disableRefresh = function () {\n this.set('refresh', false);\n };\n ImageMiniMap.prototype.enableRefresh = function () {\n this.set('refresh', true);\n this.updateCanvas();\n };\n ImageMiniMap.prototype.disableOneRefresh = function () {\n this.set('viewportChange', true);\n };\n ImageMiniMap.prototype.initViewport = function () {\n var _this = this;\n var cfgs = this._cfgs;\n // cWidth and cHeight are the width and height of the minimap's container\n var graph = cfgs.graph;\n if (this.destroyed) return;\n var containerDOM = this.get('container');\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(containerDOM)) {\n containerDOM = document.getElementById(containerDOM);\n }\n var viewport = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\"));\n // 计算拖拽水平方向距离\n var x = 0;\n // 计算拖拽垂直方向距离\n var y = 0;\n // 是否在拖拽minimap的视口\n var dragging = false;\n // 缓存viewport当前对于画布的x\n var left = 0;\n // 缓存viewport当前对于画布的y\n var top = 0;\n // 缓存viewport当前宽度\n var width = 0;\n // 缓存viewport当前高度\n var height = 0;\n var ratio = 0;\n var zoom = 0;\n containerDOM.addEventListener('mousedown', function (e) {\n cfgs.refresh = false;\n if (e.target !== viewport) {\n return;\n }\n // 如果视口已经最大了,不需要拖拽\n var style = viewport.style;\n width = parseInt(style.width, 10);\n height = parseInt(style.height, 10);\n var cWidth = _this.get('width');\n var cHeight = _this.get('height');\n if (width > cWidth || height > cHeight) {\n return;\n }\n zoom = graph.getZoom();\n ratio = _this.get('ratio');\n dragging = true;\n x = e.clientX;\n y = e.clientY;\n }, false);\n containerDOM.addEventListener('mousemove', function (e) {\n if (!dragging || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(e.clientX) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(e.clientY)) {\n return;\n }\n var cWidth = _this.get('width');\n var cHeight = _this.get('height');\n var style = viewport.style;\n left = parseInt(style.left, 10);\n top = parseInt(style.top, 10);\n width = parseInt(style.width, 10);\n height = parseInt(style.height, 10);\n var dx = x - e.clientX;\n var dy = y - e.clientY;\n // 若视口移动到最左边或最右边了,仅移动到边界\n if (left - dx < 0) {\n dx = left;\n } else if (left - dx + width >= cWidth) {\n dx = 0;\n }\n // 若视口移动到最上或最下边了,仅移动到边界\n if (top - dy < 0) {\n dy = top;\n } else if (top - dy + height >= cHeight) {\n dy = 0;\n }\n left -= dx;\n top -= dy;\n // 先移动视口,避免移动到边上以后出现视口闪烁\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(viewport, {\n left: \"\".concat(left, \"px\"),\n top: \"\".concat(top, \"px\")\n });\n // graph 移动需要偏移量 dx/dy * 缩放比例才会得到正确的移动距离\n graph.translate(dx * zoom / ratio, dy * zoom / ratio);\n x = e.clientX;\n y = e.clientY;\n }, false);\n containerDOM.addEventListener('mouseleave', function () {\n dragging = false;\n cfgs.refresh = true;\n }, false);\n containerDOM.addEventListener('mouseup', function () {\n dragging = false;\n cfgs.refresh = true;\n }, false);\n this.set('viewport', viewport);\n containerDOM.appendChild(viewport);\n };\n /**\n * 更新 viewport 视图\n */\n ImageMiniMap.prototype.updateViewport = function () {\n if (this.destroyed) return;\n var ratio = this.get('ratio');\n var cWidth = this.get('width');\n var cHeight = this.get('height');\n var graph = this.get('graph');\n var graphWidth = graph.get('width');\n var graphHeight = graph.get('height');\n var aspectRatio = graphWidth / graphHeight;\n var graphGroup = graph.getGroup();\n // 主图的 bbox(矩阵变换相关的 bbox)\n var graphCanvasBBox = graphGroup.getCanvasBBox();\n // 扩展 graphBBox 到和 graphWidth / graphHeight 等比\n var graphCanvasBBoxMean = [(graphCanvasBBox.minX + graphCanvasBBox.maxX) / 2, (graphCanvasBBox.minY + graphCanvasBBox.maxY) / 2];\n var graphCanvasBBoxSize = [graphCanvasBBox.maxX - graphCanvasBBox.minX, graphCanvasBBox.maxY - graphCanvasBBox.minY];\n var expandedGraphCanvasBBox = {\n centerX: graphCanvasBBoxMean[0],\n centerY: graphCanvasBBoxMean[1],\n width: 0,\n height: 0,\n minX: 0,\n minY: 0\n };\n if (graphCanvasBBox[0] / graphCanvasBBox[1] > aspectRatio) {\n expandedGraphCanvasBBox.width = graphCanvasBBoxSize[0];\n expandedGraphCanvasBBox.height = expandedGraphCanvasBBox.width / aspectRatio;\n } else {\n expandedGraphCanvasBBox.height = graphCanvasBBoxSize[1];\n expandedGraphCanvasBBox.width = expandedGraphCanvasBBox.height * aspectRatio;\n }\n expandedGraphCanvasBBox.minX = graphCanvasBBoxMean[0] - expandedGraphCanvasBBox.width / 2;\n expandedGraphCanvasBBox.minY = graphCanvasBBoxMean[1] - expandedGraphCanvasBBox.height / 2;\n var graphMatrix = graphGroup.getMatrix();\n if (!graphMatrix) graphMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var invertGraphMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__[\"mat3\"].invert([1, 0, 0, 0, 1, 0, 0, 0, 1], graphMatrix);\n var minXY = applyMatrix({\n x: expandedGraphCanvasBBox.minX,\n y: expandedGraphCanvasBBox.minY\n }, invertGraphMatrix);\n // 扩展 graphBBox 后的 bbox 的左上角对应的 canvas container 坐标\n var topLeft = graph.getCanvasByPoint(minXY.x, minXY.y);\n var viewport = this.get('viewport');\n if (!viewport) {\n this.initViewport();\n }\n // Viewport 与 minimap container 的比例 = Graph container 与 expandedGraphBBox 比例\n var vpToMc = graphWidth / expandedGraphCanvasBBox.width;\n // viewport 宽高 = vpToMc * minimap container 宽高\n var width = vpToMc * cWidth;\n var height = vpToMc * cHeight;\n // vierport 左上角到 minimap container 的距离 / minimap container 宽高\n // = 主图 expandedBBox 左上角 canvas container 坐标距离 / expandedBBox 宽高\n var left = cWidth * -topLeft.x / expandedGraphCanvasBBox.width;\n var top = cHeight * -topLeft.y / expandedGraphCanvasBBox.height;\n var right = left + width;\n var bottom = top + height;\n if (left < 0) {\n width += left;\n left = 0;\n }\n if (right > cWidth) {\n width = width - (right - cWidth);\n }\n if (top < 0) {\n height += top;\n top = 0;\n }\n if (bottom > cHeight) {\n height = height - (bottom - cHeight);\n }\n // 缓存目前缩放比,在移动 minimap 视窗时就不用再计算大图的移动量\n this.set('ratio', ratio);\n var correctLeft = \"\".concat(left, \"px\");\n var correctTop = \"\".concat(top, \"px\");\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(viewport, {\n left: correctLeft,\n top: correctTop,\n width: \"\".concat(width, \"px\"),\n height: \"\".concat(height, \"px\")\n });\n };\n ImageMiniMap.prototype.init = function () {\n this.initContainer();\n };\n /**\n * 初始化 Minimap 的容器\n */\n ImageMiniMap.prototype.initContainer = function () {\n var self = this;\n var graph = self.get('graph');\n var graphWidth = graph.get('width');\n var graphHeight = graph.get('height');\n var aspectRatio = graphHeight / graphWidth;\n var className = self.get('className');\n var parentNode = self.get('container');\n // size of the minimap's container\n var cWidth = self.get('width');\n var cHeight = self.get('height');\n if (!cWidth && !cHeight) {\n cWidth = 200;\n }\n if (cWidth) {\n cHeight = aspectRatio * cWidth;\n self.set('height', cHeight);\n } else {\n cWidth = 1 / aspectRatio * cHeight;\n self.set('width', cWidth);\n }\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\"));\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(parentNode)) {\n parentNode = document.getElementById(parentNode);\n }\n if (parentNode) {\n parentNode.appendChild(container);\n } else {\n graph.get('container').appendChild(container);\n }\n self.set('container', container);\n var containerDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\");\n container.appendChild(containerDOM);\n var span = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"\");\n containerDOM.appendChild(span);\n self.set('containerDOM', containerDOM);\n self.set('containerSpan', span);\n var img = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"\\\"\\\"\"));\n self.set('imgDOM', img);\n self.updateImgSize();\n span.appendChild(img);\n self.updateCanvas();\n };\n ImageMiniMap.prototype.updateImgSize = function () {\n var self = this;\n var imgDOM = self.get('imgDOM');\n var cWidth = self.get('width');\n var cHeight = self.get('height');\n imgDOM.onload = function () {\n var naturalSize = getImgNaturalDimension(imgDOM);\n if (naturalSize[0] > naturalSize[1]) {\n imgDOM.width = cWidth;\n } else {\n imgDOM.height = cHeight;\n }\n };\n };\n ImageMiniMap.prototype.updateCanvas = function () {\n // 如果是在动画,则不刷新视图\n var isRefresh = this.get('refresh');\n if (!isRefresh) {\n return;\n }\n var graph = this.get('graph');\n if (graph.get('destroyed')) {\n return;\n }\n // 如果是视口变换,也不刷新视图,但是需要重置视口大小和位置\n if (this.get('viewportChange')) {\n this.set('viewportChange', false);\n this.updateViewport();\n }\n var cWidth = this.get('width');\n var graphBBox = graph.get('canvas').getCanvasBBox();\n var width = graphBBox.width;\n var ratio = cWidth / width;\n // // 更新minimap视口\n this.set('ratio', ratio);\n this.updateViewport();\n };\n /**\n * 获取minimap的窗口\n * @return {HTMLElement} 窗口的dom实例\n */\n ImageMiniMap.prototype.getViewport = function () {\n return this.get('viewport');\n };\n /**\n * 获取minimap的容器dom\n * @return {HTMLElement} dom\n */\n ImageMiniMap.prototype.getContainer = function () {\n return this.get('container');\n };\n ImageMiniMap.prototype.updateGraphImg = function (img) {\n var self = this;\n var oriImgDOM = self.get('imgDOM');\n oriImgDOM.remove();\n self.set('graphImg', img);\n var imgDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"\\\"\\\"\"));\n self.set('imgDOM', imgDOM);\n imgDOM.src = img;\n self.updateImgSize();\n var span = self.get('containerSpan');\n span.appendChild(imgDOM);\n self.updateCanvas();\n };\n ImageMiniMap.prototype.destroy = function () {\n var container = this.get('container');\n container.parentNode.removeChild(container);\n };\n return ImageMiniMap;\n}(_base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (ImageMiniMap);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/imageMinimap/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/graph/controller/mode.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/graph/controller/mode.js ***! - \****************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-plugin/es/index.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/index.js ***! + \**************************************************/ +/*! exports provided: PluginBase, Menu, Grid, Minimap, Bundling, ToolBar, Tooltip, Fisheye, TimeBar, ImageMinimap, EdgeFilterLens, SnapLine, Legend, Annotation, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _behavior_behavior__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../../behavior/behavior */ \"./node_modules/@antv/g6-core/es/behavior/behavior.js\");\n\n\n\nvar ModeController =\n/** @class */\nfunction () {\n function ModeController(graph) {\n this.graph = graph;\n this.destroyed = false;\n this.modes = graph.get('modes') || {\n default: []\n };\n this.formatModes();\n this.mode = graph.get('defaultMode') || 'default';\n this.currentBehaves = [];\n this.setMode(this.mode);\n }\n\n ModeController.prototype.formatModes = function () {\n var modes = this.modes;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(modes, function (mode) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(mode, function (behavior, i) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(behavior)) {\n mode[i] = {\n type: behavior\n };\n }\n });\n });\n };\n\n ModeController.prototype.setBehaviors = function (mode) {\n var graph = this.graph;\n var behaviors = this.modes[mode];\n var behaves = [];\n var behave;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(behaviors || [], function (behavior) {\n var BehaviorInstance = _behavior_behavior__WEBPACK_IMPORTED_MODULE_1__[\"default\"].getBehavior(behavior.type || behavior);\n\n if (!BehaviorInstance) {\n return;\n }\n\n behave = new BehaviorInstance(behavior);\n\n if (behave) {\n behave.bind(graph);\n behaves.push(behave);\n }\n });\n this.currentBehaves = behaves;\n };\n\n ModeController.mergeBehaviors = function (modeBehaviors, behaviors) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(behaviors, function (behavior) {\n if (modeBehaviors.indexOf(behavior) < 0) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(behavior)) {\n behavior = {\n type: behavior\n };\n }\n\n modeBehaviors.push(behavior);\n }\n });\n return modeBehaviors;\n };\n\n ModeController.filterBehaviors = function (modeBehaviors, behaviors) {\n var result = [];\n modeBehaviors.forEach(function (behavior) {\n var type = '';\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(behavior)) {\n type = behavior;\n } else {\n // eslint-disable-next-line prefer-destructuring\n type = behavior.type;\n }\n\n if (behaviors.indexOf(type) < 0) {\n result.push(behavior);\n }\n });\n return result;\n };\n\n ModeController.prototype.setMode = function (mode) {\n var _a = this,\n modes = _a.modes,\n graph = _a.graph;\n\n var current = mode;\n var behaviors = modes[current];\n\n if (!behaviors) {\n return;\n }\n\n graph.emit('beforemodechange', {\n mode: mode\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(this.currentBehaves, function (behave) {\n if (behave.delegate) behave.delegate.remove();\n behave.unbind(graph);\n });\n this.setBehaviors(current);\n graph.emit('aftermodechange', {\n mode: mode\n });\n this.mode = mode;\n };\n\n ModeController.prototype.getMode = function () {\n return this.mode;\n };\n /**\n * 动态增加或删除 Behavior\n *\n * @param {ModeType[]} behaviors\n * @param {(ModeType[] | ModeType)} modes\n * @param {boolean} isAdd\n * @returns {Mode}\n * @memberof Mode\n */\n\n\n ModeController.prototype.manipulateBehaviors = function (behaviors, modes, isAdd) {\n var _this = this;\n\n var behaves;\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(behaviors)) {\n behaves = [behaviors];\n } else {\n behaves = behaviors;\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(modes)) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(modes, function (mode) {\n if (!_this.modes[mode]) {\n if (isAdd) {\n _this.modes[mode] = behaves;\n }\n } else if (isAdd) {\n _this.modes[mode] = ModeController.mergeBehaviors(_this.modes[mode] || [], behaves);\n } else {\n _this.modes[mode] = ModeController.filterBehaviors(_this.modes[mode] || [], behaves);\n }\n });\n return this;\n }\n\n var currentMode = modes;\n\n if (!modes) {\n currentMode = this.mode; // isString(this.mode) ? this.mode : this.mode.type\n }\n\n if (!this.modes[currentMode]) {\n if (isAdd) {\n this.modes[currentMode] = behaves;\n }\n }\n\n if (isAdd) {\n this.modes[currentMode] = ModeController.mergeBehaviors(this.modes[currentMode] || [], behaves);\n } else {\n this.modes[currentMode] = ModeController.filterBehaviors(this.modes[currentMode] || [], behaves);\n }\n\n this.formatModes();\n this.setMode(this.mode);\n return this;\n };\n /**\n * 更新行为参数\n * @param {string | ModeOption | ModeType} behavior 需要更新的行为\n * @param {string | string[]} modes 指定的模式中的行为,不指定则为 default\n * @return {Graph} Graph\n */\n\n\n ModeController.prototype.updateBehavior = function (behavior, newCfg, mode) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(behavior)) {\n behavior = {\n type: behavior\n };\n }\n\n var behaviorSet = [];\n\n if (!mode || mode === this.mode || mode === 'default') {\n behaviorSet = this.currentBehaves;\n\n if (!behaviorSet || !behaviorSet.length) {\n console.warn('Update behavior failed! There is no behaviors in this mode on the graph.');\n return this;\n }\n\n var length_1 = behaviorSet.length;\n\n for (var i = 0; i < length_1; i++) {\n var behave = behaviorSet[i];\n\n if (behave.type === behavior.type) {\n behave.updateCfg(newCfg);\n return this;\n }\n\n if (i === length_1 - 1) console.warn('Update behavior failed! There is no such behavior in the mode');\n }\n } else {\n behaviorSet = this.modes[mode];\n\n if (!behaviorSet || !behaviorSet.length) {\n console.warn('Update behavior failed! There is no behaviors in this mode on the graph.');\n return this;\n }\n\n var length_2 = behaviorSet.length;\n\n for (var i = 0; i < length_2; i++) {\n var behave = behaviorSet[i];\n\n if (behave.type === behavior.type || behave === behavior.type) {\n if (behave === behavior.type) behave = {\n type: behave\n };\n Object.assign(behave, newCfg);\n behaviorSet[i] = behave;\n return this;\n }\n\n if (i === length_2 - 1) console.warn('Update behavior failed! There is no such behavior in the mode');\n }\n }\n\n return this;\n };\n\n ModeController.prototype.destroy = function () {\n this.graph = null;\n this.modes = null;\n this.currentBehaves = null;\n this.destroyed = true;\n };\n\n return ModeController;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ModeController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/mode.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grid */ \"./node_modules/@antv/g6-plugin/es/grid/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Grid\", function() { return _grid__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./menu */ \"./node_modules/@antv/g6-plugin/es/menu/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return _menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _minimap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./minimap */ \"./node_modules/@antv/g6-plugin/es/minimap/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Minimap\", function() { return _minimap__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _bundling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bundling */ \"./node_modules/@antv/g6-plugin/es/bundling/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Bundling\", function() { return _bundling__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _fisheye__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fisheye */ \"./node_modules/@antv/g6-plugin/es/fisheye/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Fisheye\", function() { return _fisheye__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _toolBar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./toolBar */ \"./node_modules/@antv/g6-plugin/es/toolBar/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ToolBar\", function() { return _toolBar__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tooltip */ \"./node_modules/@antv/g6-plugin/es/tooltip/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tooltip\", function() { return _tooltip__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _timeBar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./timeBar */ \"./node_modules/@antv/g6-plugin/es/timeBar/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TimeBar\", function() { return _timeBar__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _imageMinimap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./imageMinimap */ \"./node_modules/@antv/g6-plugin/es/imageMinimap/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ImageMinimap\", function() { return _imageMinimap__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _edgeFilterLens__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./edgeFilterLens */ \"./node_modules/@antv/g6-plugin/es/edgeFilterLens/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EdgeFilterLens\", function() { return _edgeFilterLens__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _snapline__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./snapline */ \"./node_modules/@antv/g6-plugin/es/snapline/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SnapLine\", function() { return _snapline__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PluginBase\", function() { return _base__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _legend__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./legend */ \"./node_modules/@antv/g6-plugin/es/legend/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Legend\", function() { return _legend__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _annotation__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./annotation */ \"./node_modules/@antv/g6-plugin/es/annotation/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Annotation\", function() { return _annotation__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar Plugin = {\n PluginBase: _base__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n Menu: _menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Grid: _grid__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n Minimap: _minimap__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Bundling: _bundling__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n ToolBar: _toolBar__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n Tooltip: _tooltip__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n Fisheye: _fisheye__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n TimeBar: _timeBar__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n ImageMinimap: _imageMinimap__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n EdgeFilterLens: _edgeFilterLens__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n SnapLine: _snapline__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n Legend: _legend__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n Annotation: _annotation__WEBPACK_IMPORTED_MODULE_13__[\"default\"]\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Plugin);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/graph/controller/state.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/graph/controller/state.js ***! - \*****************************************************************/ +/***/ "./node_modules/@antv/g6-plugin/es/legend/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/legend/index.js ***! + \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar timer = null;\n\nvar StateController =\n/** @class */\nfunction () {\n function StateController(graph) {\n this.graph = graph;\n /**\n * this.cachedStates = {\n * enabled: {\n * hover: [Node]\n * },\n * disabled: {}\n * }\n */\n\n this.cachedStates = {\n enabled: {},\n disabled: {}\n };\n this.destroyed = false;\n }\n /**\n * 检查 cache 的可用性\n *\n * @private\n * @param {Item} item\n * @param {string} state\n * @param {object} cache\n * @returns\n * @memberof State\n */\n\n\n StateController.checkCache = function (item, state, cache) {\n if (!cache[state]) {\n return;\n }\n\n var index = cache[state].indexOf(item);\n\n if (index >= 0) {\n cache[state].splice(index, 1);\n }\n };\n /**\n * 缓存 state\n *\n * @private\n * @param {Item} item Item 实例\n * @param {string} state 状态名称\n * @param {object} states\n * @memberof State\n */\n\n\n StateController.cacheState = function (item, state, states) {\n if (!states[state]) {\n states[state] = [];\n }\n\n states[state].push(item);\n };\n /**\n * 更新 Item 的状态\n *\n * @param {Item} item Item实例\n * @param {string} state 状态名称\n * @param {boolean} enabled 状态是否可用\n * @memberof State\n */\n\n\n StateController.prototype.updateState = function (item, state, enabled) {\n var _this = this;\n\n var checkCache = StateController.checkCache,\n cacheState = StateController.cacheState;\n\n if (item.destroyed) {\n return;\n }\n\n var cachedStates = this.cachedStates;\n var enabledStates = cachedStates.enabled;\n var disabledStates = cachedStates.disabled;\n\n if (enabled) {\n checkCache(item, state, disabledStates);\n cacheState(item, state, enabledStates);\n } else {\n checkCache(item, state, enabledStates);\n cacheState(item, state, disabledStates);\n }\n\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = setTimeout(function () {\n timer = null;\n\n _this.updateGraphStates();\n }, 16);\n };\n /**\n * 批量更新 states,兼容 updateState,支持更新一个 state\n *\n * @param {Item} item\n * @param {(string | string[])} states\n * @param {boolean} enabled\n * @memberof State\n */\n\n\n StateController.prototype.updateStates = function (item, states, enabled) {\n var _this = this;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(states)) {\n this.updateState(item, states, enabled);\n } else {\n states.forEach(function (state) {\n _this.updateState(item, state, enabled);\n });\n }\n };\n /**\n * 更新 states\n *\n * @memberof State\n */\n\n\n StateController.prototype.updateGraphStates = function () {\n var states = this.graph.get('states');\n var cachedStates = this.cachedStates;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(cachedStates.disabled, function (val, key) {\n if (states[key]) {\n states[key] = states[key].filter(function (item) {\n return val.indexOf(item) < 0 && !val.destroyed;\n });\n }\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(cachedStates.enabled, function (val, key) {\n if (!states[key]) {\n states[key] = val;\n } else {\n var map_1 = {};\n states[key].forEach(function (item) {\n if (!item.destroyed) {\n map_1[item.get('id')] = true;\n }\n });\n val.forEach(function (item) {\n if (!item.destroyed) {\n var id = item.get('id');\n\n if (!map_1[id]) {\n map_1[id] = true;\n states[key].push(item);\n }\n }\n });\n }\n });\n this.graph.emit('graphstatechange', {\n states: states\n });\n this.cachedStates = {\n enabled: {},\n disabled: {}\n };\n };\n\n StateController.prototype.destroy = function () {\n this.graph = null;\n this.cachedStates = null;\n\n if (timer) {\n clearTimeout(timer);\n }\n\n timer = null;\n this.destroyed = true;\n };\n\n return StateController;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (StateController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/state.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\nvar ALLOW_EVENTS = ['click', 'mouseenter'];\nvar Legend = /** @class */function (_super) {\n __extends(Legend, _super);\n function Legend(config) {\n return _super.call(this, config) || this;\n }\n Legend.prototype.getDefaultCfgs = function () {\n return {\n data: {},\n position: 'top',\n padding: 8,\n margin: 8,\n offsetX: 0,\n offsetY: 0,\n layout: 'horizontal',\n flipPage: false,\n containerStyle: {},\n align: undefined,\n horiSep: 8,\n vertiSep: 8,\n filter: {\n enable: false,\n trigger: 'click'\n }\n };\n };\n Legend.prototype.init = function () {\n this.formatArray('padding');\n this.formatArray('margin');\n var filter = this.get('filter') || {};\n var multiple = filter.multiple;\n if (multiple && filter.trigger === 'mouseenter') this.set('multiple', false);\n var align = this.get('align');\n if (!align) {\n var positions = this.get('position').split('-');\n if (positions.includes('left')) align = 'left';\n if (positions.includes('right')) align = 'right';else align = 'center';\n this.set('align', align);\n }\n var graph = this.get('graph');\n var graphContainer = graph.get('container');\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\");\n graphContainer.appendChild(container);\n this.set('container', container);\n var size = this.render();\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(container, this.getContainerPos(size));\n this.bindEvents();\n };\n Legend.prototype.getContainerPos = function (size) {\n if (size === void 0) {\n size = [0, 0];\n }\n var self = this;\n var graph = self.get('graph');\n var offsetX = this.get('offsetX');\n var offsetY = this.get('offsetY');\n var margin = this.get('margin');\n var positions = this.get('position').split('-');\n var posIdxMap = {\n 'top': 0,\n 'right': 1,\n 'bottom': 2,\n 'left': 3\n };\n var x = 0,\n y = 0;\n var containerCSS = {\n left: (graph.getWidth() - size[0]) / 2 + x,\n top: (graph.getHeight() - size[1]) / 2 + y\n };\n positions.forEach(function (pos) {\n var marginValue = margin[posIdxMap[pos]];\n var key = pos;\n switch (pos) {\n case 'top':\n marginValue += y;\n break;\n case 'left':\n marginValue += x;\n break;\n case 'bottom':\n marginValue = graph.getHeight() - size[1] - marginValue + y;\n key = 'top';\n break;\n default:\n marginValue = graph.getWidth() - size[0] - marginValue + x;\n key = 'left';\n break;\n }\n containerCSS[key] = marginValue;\n });\n containerCSS.top += offsetY + graph.getContainer().offsetTop;\n containerCSS.left += offsetX + graph.getContainer().offsetLeft;\n Object.keys(containerCSS).forEach(function (key) {\n containerCSS[key] = \"\".concat(containerCSS[key], \"px\");\n });\n return containerCSS;\n };\n // class-methods-use-this\n Legend.prototype.bindEvents = function () {\n var self = this;\n var filter = self.get('filter');\n if (!filter || !filter.enable) return;\n var trigger = filter.trigger || 'click';\n if (!ALLOW_EVENTS.includes(trigger)) {\n console.warn('Trigger for legend filterling must be \\'click\\' or \\'mouseenter\\', \\'click\\' will take effect by default.');\n trigger = 'click';\n }\n var lc = self.get('legendCanvas');\n if (trigger === 'mouseenter') {\n lc.on('node-container:mouseenter', function (e) {\n return self.filterData(e);\n });\n lc.on('node-container:mouseleave', function (e) {\n self.clearFilter();\n self.clearActiveLegend();\n });\n } else {\n lc.on('node-container:click', function (e) {\n return self.filterData(e);\n });\n lc.on('click', function (e) {\n if (e.target && e.target.isCanvas && e.target.isCanvas()) {\n self.clearFilter();\n self.clearActiveLegend();\n }\n });\n }\n };\n /**\n * 更新 legend 数据,开放给用户控制\n * @param param\n */\n Legend.prototype.changeData = function (data) {\n this.set('data', data);\n var size = this.render();\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.get('container'), this.getContainerPos(size));\n };\n Legend.prototype.activateLegend = function (shape) {\n var filter = this.get('filter');\n var multiple = filter === null || filter === void 0 ? void 0 : filter.multiple;\n if (!multiple) this.clearActiveLegend();\n var shapeGroup = shape.get('parent');\n // 若被高亮元素已经处于 active 状态,则取消它的 active 状态\n // 并根据目前是否有其他 active 状态的元素决定是否要设置为 inactive 状态\n if (shapeGroup.get('active')) {\n shapeGroup.set('active', false);\n if (this.findLegendItemsByState('active').length) shapeGroup.set('inactive', true);\n } else {\n shapeGroup.set('inactive', false);\n shapeGroup.set('active', true);\n }\n // 当目前有元素为 active 状态时,将非 active 的元素设置为 inactive\n if (this.findLegendItemsByState('active').length) {\n this.findLegendItemsByState('active', 'all', false).forEach(function (subGroup) {\n subGroup.set('inactive', true);\n });\n } else {\n this.clearActiveLegend();\n }\n // 设置样式\n var stateStyles = (filter === null || filter === void 0 ? void 0 : filter.legendStateStyles) || {};\n var legendInactive = (stateStyles === null || stateStyles === void 0 ? void 0 : stateStyles.inactive) || {\n opacity: 0.5,\n 'text-shape': {\n opacity: 0.5\n }\n };\n var legendTextInactive = legendInactive['text-shape'] || {};\n this.findLegendItemsByState('inactive').forEach(function (subGroup) {\n var _a = subGroup.get('children'),\n keyShape = _a[0],\n text = _a[1];\n keyShape.attr(__assign(__assign({}, keyShape.get('oriAttrs')), legendInactive));\n text.attr(__assign(__assign({}, text.get('oriAttrs')), legendTextInactive));\n });\n var legendActive = (stateStyles === null || stateStyles === void 0 ? void 0 : stateStyles.active) || {\n stroke: '#000',\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 'bold'\n }\n };\n var legendTextActive = legendActive['text-shape'] || {};\n this.findLegendItemsByState('active').forEach(function (subGroup) {\n var _a = subGroup.get('children'),\n keyShape = _a[0],\n text = _a[1];\n keyShape.attr(__assign(__assign({}, keyShape.get('oriAttrs')), legendActive));\n text.attr(__assign(__assign({}, text.get('oriAttrs')), legendTextActive));\n });\n };\n Legend.prototype.findLegendItemsByState = function (stateName, type, value) {\n if (type === void 0) {\n type = 'all';\n }\n if (value === void 0) {\n value = true;\n }\n var group = this.get('legendCanvas').find(function (e) {\n return e.get('name') === 'root';\n });\n var nodeGroup = group.find(function (e) {\n return e.get('name') === 'node-group';\n });\n var edgeGroup = group.find(function (e) {\n return e.get('name') === 'edge-group';\n });\n if (type === 'node') return nodeGroup.get('children').filter(function (g) {\n return !!g.get(stateName) === value;\n });\n if (type === 'edge') return edgeGroup.get('children').filter(function (g) {\n return !!g.get(stateName) === value;\n });\n return nodeGroup.get('children').filter(function (g) {\n return !!g.get(stateName) === value;\n }).concat(edgeGroup.get('children').filter(function (g) {\n return !!g.get(stateName) === value;\n }));\n };\n Legend.prototype.clearActiveLegend = function () {\n var lg = this.get('legendCanvas');\n var group = lg.find(function (e) {\n return e.get('name') === 'root';\n });\n var groups = [group.find(function (e) {\n return e.get('name') === 'node-group';\n }), group.find(function (e) {\n return e.get('name') === 'edge-group';\n })];\n groups.forEach(function (itemGroup) {\n itemGroup.get('children').forEach(function (subGroup) {\n subGroup.set('active', false);\n subGroup.set('inactive', false);\n var _a = subGroup.get('children'),\n keyShape = _a[0],\n text = _a[1];\n keyShape.attr(keyShape.get('oriAttrs'));\n text.attr(text.get('oriAttrs'));\n });\n });\n };\n /**\n * 高亮和置灰图例,并过滤主图元素\n * @param param\n */\n Legend.prototype.filterData = function (e) {\n var filter = this.get('filter');\n var filterFunctions = filter === null || filter === void 0 ? void 0 : filter.filterFunctions;\n if (!filter || !filterFunctions) return;\n var lc = this.get('legendCanvas');\n var graph = this.get('graph');\n var activeState = filter.graphActiveState || 'active';\n var inactiveState = filter.graphInactiveState || 'inactive';\n var multiple = filter.multiple;\n this.clearFilter();\n if (!multiple) this.clearActiveLegend();\n // 设置 legend 的高亮状态\n this.activateLegend(e.target);\n var group = lc.find(function (e) {\n return e.get('name') === 'root';\n });\n var nodeGroup = group.find(function (e) {\n return e.get('name') === 'node-group';\n });\n var edgeGroup = group.find(function (e) {\n return e.get('name') === 'edge-group';\n });\n var activeNodeLegend = nodeGroup.get('children').filter(function (e) {\n return e.get('active');\n });\n var activeEdgeLegend = edgeGroup.get('children').filter(function (e) {\n return e.get('active');\n });\n var activeCount = 0;\n var typeFuncs = ['getNodes', 'getEdges'];\n typeFuncs.forEach(function (typeFunc) {\n graph[typeFunc]().forEach(function (graphItem) {\n var active = false;\n var activeLegend = typeFunc === 'getNodes' ? activeNodeLegend : activeEdgeLegend;\n activeLegend.forEach(function (itemGroup) {\n var func = filterFunctions[itemGroup.get('id')];\n active = active || func(graphItem.getModel());\n });\n if (active) {\n graph.setItemState(graphItem, inactiveState, false);\n graph.setItemState(graphItem, activeState, true);\n activeCount++;\n } else {\n graph.setItemState(graphItem, activeState, false);\n graph.setItemState(graphItem, inactiveState, true);\n }\n });\n });\n if (!activeCount) typeFuncs.forEach(function (typeFunc) {\n graph[typeFunc]().forEach(function (graphItem) {\n graph.clearItemStates(graphItem, [inactiveState]);\n });\n });\n };\n /**\n * 清除主图相关状态\n * @param param\n */\n Legend.prototype.clearFilter = function () {\n // 清除 legend 的高亮状态\n var graph = this.get('graph');\n var filter = this.get('filter');\n if (!filter) return;\n var activeState = filter.graphActiveState || 'active';\n var inactiveState = filter.graphInactiveState || 'inactive';\n graph.getNodes().forEach(function (node) {\n graph.clearItemStates(node, [activeState, inactiveState]);\n });\n graph.getEdges().forEach(function (edge) {\n graph.clearItemStates(edge, [activeState, inactiveState]);\n });\n };\n /**\n * 渲染 legend 图\n * @param param\n */\n Legend.prototype.render = function () {\n var _this = this;\n this.processData();\n var lc = this.get('legendCanvas');\n if (!lc) {\n lc = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_4__[\"Canvas\"]({\n container: this.get('container'),\n width: 200,\n height: 200\n });\n } else {\n lc.clear();\n }\n var group = lc.addGroup({\n name: 'root'\n });\n var nodeGroup = group.addGroup({\n name: 'node-group'\n });\n var edgeGroup = group.addGroup({\n name: 'edge-group'\n });\n this.set('legendCanvas', lc);\n var itemsData = this.get('itemsData');\n var itemTypes = ['nodes', 'edges'];\n var itemGroup = [nodeGroup, edgeGroup];\n itemTypes.forEach(function (itemType, i) {\n itemsData[itemType].forEach(function (data) {\n var _a;\n var subGroup = itemGroup[i].addGroup({\n id: data.id,\n name: 'node-container'\n });\n var attrs;\n var shapeType = data.type;\n var _b = _this.getShapeSize(data),\n width = _b.width,\n height = _b.height,\n r = _b.r;\n var style = _this.getStyle(itemType.substr(0, 4), data);\n switch (data.type) {\n case 'circle':\n attrs = {\n r: r,\n x: 0,\n y: 0\n };\n break;\n case 'rect':\n attrs = {\n width: width,\n height: height,\n x: -width / 2,\n y: -height / 2\n };\n break;\n case 'ellipse':\n attrs = {\n rx: width,\n ry: height,\n x: 0,\n y: 0\n };\n shapeType = 'ellipse';\n break;\n case 'line':\n attrs = {\n x1: -width / 2,\n y1: 0,\n x2: width / 2,\n y2: 0\n };\n shapeType = 'line';\n break;\n case 'quadratic':\n attrs = {\n path: [['M', -width / 2, 0], ['Q', 0, width / 2, width / 2, 0]]\n };\n shapeType = 'path';\n break;\n case 'cubic':\n attrs = {\n path: [['M', -width / 2, 0], ['C', -width / 6, width / 2, width / 6, -width / 2, width / 2, 0]]\n };\n shapeType = 'path';\n break;\n case 'diamond':\n attrs = {\n path: [['M', 0, -height], ['L', width, 0], ['L', 0, height], ['L', -width, 0], ['Z']]\n };\n shapeType = 'path';\n break;\n case 'triangle':\n attrs = {\n path: [['M', -width, height], ['L', 0, -height], ['L', width, height], ['Z']]\n };\n shapeType = 'path';\n break;\n case 'star':\n attrs = {\n path: _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].getStarPath(r * 3, r * 1.2)\n };\n shapeType = 'path';\n break;\n default:\n attrs = {\n r: r,\n x: 0,\n y: 0\n };\n break;\n }\n var keyShape = subGroup.addShape(shapeType, {\n attrs: __assign(__assign({}, attrs), style),\n name: \"\".concat(data.type, \"-node-keyShape\"),\n oriAttrs: __assign({\n opacity: 1\n }, style)\n });\n if (data.label) {\n var keyShapeBBox = keyShape.getBBox();\n var labelStyle = ((_a = data.labelCfg) === null || _a === void 0 ? void 0 : _a.style) || {};\n var attrs_1 = __assign({\n textAlign: 'begin',\n fontSize: 12,\n textBaseline: 'middle',\n fill: '#000',\n opacity: 1,\n fontWeight: 'normal'\n }, labelStyle);\n subGroup.addShape('text', {\n attrs: __assign({\n x: keyShapeBBox.maxX + 4,\n y: 0,\n text: data.label\n }, attrs_1),\n className: 'legend-label',\n name: \"\".concat(data.type, \"-node-text\"),\n oriAttrs: attrs_1\n });\n }\n });\n });\n var padding = this.get('padding');\n var titleShape;\n var titleGroup = group.find(function (e) {\n return e.get('name') === 'title-container';\n });\n var titleGroupBBox = {\n height: 0,\n maxY: 0,\n width: 0\n };\n if (this.get('title')) {\n if (!titleGroup) {\n titleGroup = group.addGroup({\n name: 'title-container'\n });\n }\n var defaultTitleStyle = {\n fontSize: 20,\n fontFamily: 'Arial',\n fontWeight: 300,\n textBaseline: 'top',\n textAlign: 'center',\n fill: \"#000\",\n x: 0,\n y: padding[0]\n };\n var titleConfig = this.get('titleConfig') || {};\n var style = Object.assign(defaultTitleStyle, titleConfig.style || {});\n titleShape = titleGroup.addShape('text', {\n attrs: __assign({\n text: this.get('title')\n }, style)\n });\n titleGroupBBox = titleGroup.getCanvasBBox();\n titleGroup.setMatrix([1, 0, 0, 0, 1, 0, titleConfig.offsetX, titleConfig.offsetY, 1]);\n }\n this.layoutItems();\n var lcBBox = group.getCanvasBBox();\n var nodeGroupBBox = nodeGroup.getCanvasBBox();\n // 若有图形超过边界的情况,平移回来\n var nodeGroupBeginX = nodeGroupBBox.minX < 0 ? Math.abs(nodeGroupBBox.minX) + padding[3] : padding[3];\n var nodeGroupBeginY = titleGroupBBox.maxY < nodeGroupBBox.minY ? Math.abs(titleGroupBBox.maxY - nodeGroupBBox.minY) + padding[0] : titleGroupBBox.maxY + padding[0];\n var nodeGroupMatrix = [1, 0, 0, 0, 1, 0, nodeGroupBeginX, nodeGroupBeginY, 1];\n nodeGroup.setMatrix(nodeGroupMatrix);\n lcBBox = group.getCanvasBBox();\n var size = [lcBBox.minX + lcBBox.width + padding[1], lcBBox.minY + lcBBox.height + padding[2]];\n // 根据 size 和 titleConfig 调整 title 位置,再调整 nodeGroup 位置\n if (titleShape) {\n var titleConfig = __assign({\n position: 'center',\n offsetX: 0,\n offsetY: 0\n }, this.get('titleConfig'));\n titleGroupBBox = titleGroup.getCanvasBBox();\n var titleGroupMatrix = titleGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n if (titleConfig.position === 'center') {\n titleGroupMatrix[6] = size[0] / 2 + titleConfig.offsetX;\n } else if (titleConfig.position === 'right') {\n titleGroupMatrix[6] = size[0] - padding[3] + titleConfig.offsetX;\n titleShape.attr({\n textAlign: 'right'\n });\n } else {\n titleGroupMatrix[6] = padding[3] + titleConfig.offsetX;\n titleShape.attr({\n textAlign: 'left'\n });\n }\n titleGroup.setMatrix(titleGroupMatrix);\n titleGroupBBox = titleGroup.getCanvasBBox();\n // 若有图形超过边界的情况,平移回来\n nodeGroupBeginX = nodeGroupBBox.minX < 0 ? Math.abs(nodeGroupBBox.minX) + padding[3] : padding[3];\n nodeGroupBeginY = nodeGroupBBox.minY < titleGroupBBox.maxY ? Math.abs(titleGroupBBox.maxY - nodeGroupBBox.minY) + padding[0] : titleGroupBBox.maxY + padding[0];\n nodeGroupMatrix = [1, 0, 0, 0, 1, 0, nodeGroupBeginX, nodeGroupBeginY, 1];\n nodeGroup.setMatrix(nodeGroupMatrix);\n var edgeGroupMatrix_1 = [1, 0, 0, 0, 1, 0, nodeGroupBeginX, nodeGroupBeginY, 1];\n if (this.get('layout') === 'vertical') edgeGroupMatrix_1[6] += nodeGroupBBox.maxX + this.get('horiSep');else edgeGroupMatrix_1[7] += nodeGroupBBox.maxY + this.get('vertiSep');\n edgeGroup.setMatrix(edgeGroupMatrix_1);\n } else {\n // 没有 title,也需要平移 edgeGroup\n nodeGroupBBox = nodeGroup.getCanvasBBox();\n var edgeGroupMatrix_2 = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n if (this.get('layout') === 'vertical') edgeGroupMatrix_2[6] += nodeGroupMatrix[6] + nodeGroupBBox.maxX + this.get('horiSep');else edgeGroupMatrix_2[7] += nodeGroupMatrix[7] + nodeGroupBBox.maxY + this.get('vertiSep');\n edgeGroup.setMatrix(edgeGroupMatrix_2);\n }\n lcBBox = group.getCanvasBBox();\n nodeGroupBBox = nodeGroup.getCanvasBBox();\n nodeGroupMatrix = nodeGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var edgeGroupMatrix = edgeGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var edgeGroupBBox = edgeGroup.getCanvasBBox();\n size = [Math.max(nodeGroupBBox.width + nodeGroupMatrix[6], edgeGroupBBox.width + edgeGroupMatrix[6]) + padding[1], Math.max(nodeGroupBBox.height + nodeGroupMatrix[7], edgeGroupBBox.height + edgeGroupMatrix[7]) + padding[2]];\n lc.changeSize(size[0], size[1]);\n // 更新容器背景样式\n var containerStyle = this.get('containerStyle');\n var viewportMatrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var beginPos = _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].invertMatrix({\n x: 0,\n y: 0\n }, viewportMatrix);\n var backRect = group.addShape('rect', {\n attrs: __assign({\n x: beginPos.x + (containerStyle.lineWidth || 1),\n y: beginPos.y + (containerStyle.lineWidth || 1),\n width: size[0] - 2 * (containerStyle.lineWidth || 1),\n height: size[1] - 2 * (containerStyle.lineWidth || 1),\n fill: \"#f00\",\n stroke: '#000',\n lineWidth: 1,\n opacity: 0.5\n }, containerStyle),\n name: 'legend-back-rect',\n capture: false\n });\n backRect.toBack();\n return size;\n };\n Legend.prototype.layoutItems = function () {\n var lc = this.get('legendCanvas');\n var horiSep = this.get('horiSep');\n var vertiSep = this.get('vertiSep');\n var layout = this.get('layout');\n var align = this.get('align');\n var begin = [0, 0];\n var group = lc.find(function (e) {\n return e.get('name') === 'root';\n });\n var nodeGroup = group.find(function (e) {\n return e.get('name') === 'node-group';\n });\n var edgeGroup = group.find(function (e) {\n return e.get('name') === 'edge-group';\n });\n var nodeLegendSize = {\n min: 0,\n max: -Infinity\n };\n var rowMaxY = -Infinity;\n nodeGroup.get('children').forEach(function (cNodeGroup, i) {\n if (i === 0) nodeLegendSize.min = begin[0];\n var keyShape = cNodeGroup.get('children')[0];\n var bbox = cNodeGroup.getCanvasBBox();\n var _a = keyShape.getBBox(),\n keyShapeWidth = _a.width,\n keyShapeHeight = _a.height;\n var curHeight = 0,\n x = 0,\n y = 0;\n if (layout === 'vertical') {\n x = begin[1];\n y = begin[0] + keyShapeWidth / 2;\n begin[0] = y + bbox.height + vertiSep;\n curHeight = bbox.maxX + x + keyShapeWidth / 2;\n } else {\n x = begin[0] + keyShapeWidth / 2;\n y = begin[1];\n begin[0] = x + bbox.width + horiSep;\n curHeight = bbox.maxY + y + keyShapeHeight / 2;\n }\n if (begin[0] > nodeLegendSize.max) nodeLegendSize.max = begin[0];\n if (curHeight > rowMaxY) rowMaxY = curHeight;\n cNodeGroup.setMatrix([1, 0, 0, 0, 1, 0, x, y, 1]);\n });\n var nw = nodeLegendSize.max - nodeLegendSize.min;\n var edgeLegendSize = {\n min: 0,\n max: -Infinity\n };\n var nodeGroupBBox = nodeGroup.getCanvasBBox();\n begin[0] = 0;\n begin[1] = layout === 'vertical' ? nodeGroupBBox.maxX + horiSep : nodeGroupBBox.maxY + vertiSep;\n edgeGroup.get('children').forEach(function (subGroup, i) {\n if (i === 0) edgeLegendSize.min = begin[0];\n var keyShape = subGroup.get('children')[0];\n var bbox = subGroup.getCanvasBBox();\n var _a = keyShape.getBBox(),\n keyShapeWidth = _a.width,\n keyShapeHeight = _a.height;\n var x = 0,\n y = 0;\n if (layout === 'vertical') {\n x = begin[1];\n y = begin[0];\n begin[0] = y + bbox.height + vertiSep;\n subGroup.setMatrix([1, 0, 0, 0, 1, 0, 0, y + keyShapeHeight / 2, 1]);\n } else {\n x = begin[0];\n y = begin[1];\n begin[0] = x + bbox.width + horiSep;\n subGroup.setMatrix([1, 0, 0, 0, 1, 0, x + keyShapeWidth / 2, 0, 1]);\n }\n if (begin[0] > edgeLegendSize.max) edgeLegendSize.max = begin[0];\n });\n var ew = edgeLegendSize.max - edgeLegendSize.min;\n if (align && align !== '' && align !== 'left') {\n var widthDiff = nw - ew;\n var movement_1 = align === 'center' ? Math.abs(widthDiff) / 2 : Math.abs(widthDiff);\n var shouldAdjustGroup = widthDiff < 0 ? nodeGroup : edgeGroup;\n shouldAdjustGroup.get('children').forEach(function (subGroup) {\n var matrix = subGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n if (layout === 'vertical') matrix[7] += movement_1;else matrix[6] += movement_1;\n subGroup.setMatrix(matrix);\n });\n }\n };\n Legend.prototype.processData = function () {\n var data = this.get('data');\n var itemsData = {\n nodes: [],\n edges: []\n };\n if (data.nodes) {\n data.nodes.sort(function (a, b) {\n return a.order - b.order;\n });\n data.nodes.forEach(function (node) {\n var _a, _b, _c, _d, _e;\n var size = node.size || [((_a = node.style) === null || _a === void 0 ? void 0 : _a.width) || ((_b = node.style) === null || _b === void 0 ? void 0 : _b.r) || 8, ((_c = node.style) === null || _c === void 0 ? void 0 : _c.height) || ((_d = node.style) === null || _d === void 0 ? void 0 : _d.r) || 8];\n var labelStyle = ((_e = node.labelCfg) === null || _e === void 0 ? void 0 : _e.style) || {};\n itemsData.nodes.push({\n id: node.id || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"uniqueId\"])(),\n type: node.type || 'circle',\n style: __assign({}, node.style),\n order: node.order,\n label: node.label,\n itemType: 'node',\n size: size,\n labelCfg: {\n position: 'right',\n style: __assign({\n fontFamily: \"Arial\"\n }, labelStyle)\n }\n });\n });\n }\n if (data.edges) {\n data.edges.sort(function (a, b) {\n return a.order - b.order;\n });\n data.edges.forEach(function (edge) {\n var _a, _b;\n var type = edge.type || 'line';\n if (edge.type === 'cubic-horizontal') type = 'cubic';\n var labelStyle = ((_a = edge.labelCfg) === null || _a === void 0 ? void 0 : _a.style) || {};\n var size = edge.size || [((_b = edge.style) === null || _b === void 0 ? void 0 : _b.width) || 8, 1];\n itemsData.edges.push({\n id: edge.id || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"uniqueId\"])(),\n type: type,\n size: size,\n style: __assign({\n lineWidth: Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(size) ? size[1] : 1\n }, edge.style),\n order: edge.order,\n label: edge.label,\n itemType: 'edge',\n labelCfg: {\n position: 'right',\n style: __assign({\n fontFamily: \"Arial\"\n }, labelStyle)\n }\n });\n });\n }\n this.set('itemsData', itemsData);\n };\n Legend.prototype.getContainer = function () {\n return this.get('container');\n };\n Legend.prototype.formatArray = function (key) {\n var value = this.get(key);\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(value)) this.set(key, [value, value, value, value]);else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(value)) {\n switch (value.length) {\n case 0:\n this.set(key, [0, 0, 0, 0]);\n break;\n case 1:\n this.set(key, [value[0], value[0], value[0], value[0]]);\n break;\n case 2:\n this.set(key, [value[0], value[1], value[0], value[1]]);\n break;\n case 3:\n this.set(key, [value[0], value[1], value[2], value[1]]);\n break;\n default:\n break;\n }\n }\n return this.get(key);\n };\n Legend.prototype.getShapeSize = function (data) {\n var width, height, r;\n if (data.size) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(data.size)) {\n width = data.size[0];\n height = data.size[1] || data.size[0];\n r = data.size[0] / 2;\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(data.size)) {\n width = data.size;\n height = data.size;\n r = data.size / 2;\n }\n }\n if (data.style) {\n if (data.style.width) width = data.style.width;\n if (data.style.height) height = data.style.height;\n if (data.style.r) r = data.style.r;\n }\n if (!r) r = 5;\n if (!width) width = r;\n if (!height) height = r;\n return {\n width: width,\n height: height,\n r: r\n };\n };\n Legend.prototype.getStyle = function (type, data) {\n var defaultStyle = type === 'node' ? {\n fill: '#ccc',\n lineWidth: 0\n } : {\n stroke: '#000',\n lineWidth: 1\n };\n return __assign(__assign({}, defaultStyle), data.style || {});\n };\n Legend.prototype.destroy = function () {\n var lc = this.get('legendCanvas');\n lc === null || lc === void 0 ? void 0 : lc.destroy();\n var graph = this.get('graph');\n var graphContainer = graph.get('container');\n var container = this.get('container');\n graphContainer.removeChild(container);\n };\n return Legend;\n}(_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Legend);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/legend/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/graph/controller/view.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/graph/controller/view.js ***! - \****************************************************************/ +/***/ "./node_modules/@antv/g6-plugin/es/menu/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/menu/index.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../util/base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/matrix-util/lib/ext */ \"./node_modules/@antv/matrix-util/lib/ext.js\");\n/* harmony import */ var _antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4___default = /*#__PURE__*/__webpack_require__.n(_antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4__);\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n\n\n\n\n\n\n\nvar ViewController =\n/** @class */\nfunction () {\n function ViewController(graph) {\n this.destroyed = false;\n this.graph = graph;\n this.destroyed = false;\n } // get view center coordinate\n\n\n ViewController.prototype.getViewCenter = function () {\n var padding = this.getFormatPadding();\n var graph = this.graph;\n var width = this.graph.get('width');\n var height = graph.get('height');\n return {\n x: (width - padding[1] - padding[3]) / 2 + padding[3],\n y: (height - padding[0] - padding[2]) / 2 + padding[0]\n };\n };\n\n ViewController.prototype.fitCenter = function (animate, animateCfg) {\n var graph = this.graph;\n var group = graph.get('group');\n group.resetMatrix();\n var bbox = group.getCanvasBBox();\n if (bbox.width === 0 || bbox.height === 0) return;\n var viewCenter = this.getViewCenter();\n var groupCenter = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n };\n graph.translate(viewCenter.x - groupCenter.x, viewCenter.y - groupCenter.y, animate, animateCfg);\n };\n\n ViewController.prototype.animatedFitView = function (group, startMatrix, animateCfg, bbox, viewCenter, groupCenter, ratio, zoomToFit) {\n var graph = this.graph;\n animateCfg = animateCfg ? animateCfg : {\n duration: 500,\n easing: 'easeCubic'\n }; // start from the default matrix\n\n var matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1]; // Translate\n\n var vx = bbox.x + viewCenter.x - groupCenter.x - bbox.minX;\n var vy = bbox.y + viewCenter.y - groupCenter.y - bbox.minY;\n if (Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(vx) || Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(vy)) return;\n var translatedMatrix = Object(_antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4__[\"transform\"])(matrix, [['t', vx, vy]]);\n\n if (!zoomToFit) {\n // If zooming is not needed just animate the current translated matrix and return\n var animationConfig_1 = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getAnimateCfgWithCallback\"])({\n animateCfg: animateCfg,\n callback: function callback() {\n graph.emit('viewportchange', {\n action: 'translate',\n matrix: translatedMatrix\n });\n }\n });\n group.animate(function (ratio) {\n return {\n matrix: Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"lerpArray\"])(startMatrix, translatedMatrix, ratio)\n };\n }, animationConfig_1);\n return;\n } // Zoom\n\n\n var minZoom = graph.get('minZoom');\n var maxZoom = graph.get('maxZoom');\n var realRatio = ratio;\n\n if (minZoom && ratio < minZoom) {\n realRatio = minZoom;\n console.warn('fitview failed, ratio out of range, ratio: %f', ratio, 'graph minzoom has been used instead');\n } else if (maxZoom && ratio > maxZoom) {\n realRatio = maxZoom;\n console.warn('fitview failed, ratio out of range, ratio: %f', ratio, 'graph maxzoom has been used instead');\n }\n\n var zoomedMatrix = Object(_antv_matrix_util_lib_ext__WEBPACK_IMPORTED_MODULE_4__[\"transform\"])(translatedMatrix, [['t', -viewCenter.x, -viewCenter.y], ['s', realRatio, realRatio], ['t', viewCenter.x, viewCenter.y]]); // Animation\n\n var animationConfig = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_5__[\"getAnimateCfgWithCallback\"])({\n animateCfg: animateCfg,\n callback: function callback() {\n group.setMatrix(zoomedMatrix);\n graph.emit('viewportchange', {\n action: 'translate',\n matrix: translatedMatrix\n });\n graph.emit('viewportchange', {\n action: 'zoom',\n matrix: zoomedMatrix\n });\n }\n });\n group.stopAnimate();\n group.setMatrix(startMatrix);\n group.animate(function (ratio) {\n return {\n matrix: Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"lerpArray\"])(startMatrix, zoomedMatrix, ratio)\n };\n }, animationConfig);\n }; // fit view graph\n\n\n ViewController.prototype.fitView = function (animate, animateCfg) {\n var graph = this.graph;\n var padding = this.getFormatPadding();\n var width = graph.get('width');\n var height = graph.get('height');\n var group = graph.get('group');\n var startMatrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n group.resetMatrix();\n var bbox = group.getCanvasBBox();\n if (bbox.width === 0 || bbox.height === 0) return;\n var viewCenter = this.getViewCenter();\n var groupCenter = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n }; // Compute ratio\n\n var w = (width - padding[1] - padding[3]) / bbox.width;\n var h = (height - padding[0] - padding[2]) / bbox.height;\n var ratio = w;\n\n if (w > h) {\n ratio = h;\n }\n\n if (animate) {\n this.animatedFitView(group, startMatrix, animateCfg, bbox, viewCenter, groupCenter, ratio, true);\n } else {\n var dx = viewCenter.x - groupCenter.x;\n var dy = viewCenter.y - groupCenter.y;\n if (Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(dx) || Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"isNaN\"])(dy)) return;\n graph.translate(dx, dy);\n\n if (!graph.zoom(ratio, viewCenter)) {\n console.warn('zoom failed, ratio out of range, ratio: %f', ratio);\n }\n }\n }; // fit view graph by rule\n\n\n ViewController.prototype.fitViewByRules = function (rules, animate, animateCfg) {\n var _a = rules.onlyOutOfViewPort,\n onlyOutOfViewPort = _a === void 0 ? false : _a,\n _b = rules.direction,\n direction = _b === void 0 ? 'both' : _b,\n _c = rules.ratioRule,\n ratioRule = _c === void 0 ? 'min' : _c;\n var graph = this.graph;\n var padding = this.getFormatPadding();\n var width = graph.get('width');\n var height = graph.get('height');\n var group = graph.get('group');\n var startMatrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n group.resetMatrix();\n var bbox = group.getCanvasBBox();\n if (bbox.width === 0 || bbox.height === 0) return;\n var viewCenter = this.getViewCenter();\n var groupCenter = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n }; // Compute ratio\n\n var wRatio = (width - padding[1] - padding[3]) / bbox.width;\n var hRatio = (height - padding[0] - padding[2]) / bbox.height;\n var ratio;\n\n if (direction === 'x') {\n ratio = wRatio;\n } else if (direction === 'y') {\n ratio = hRatio;\n } else {\n // ratioRule\n ratio = ratioRule === 'max' ? Math.max(wRatio, hRatio) : Math.min(wRatio, hRatio);\n } // 如果设置了仅对超出视口宽高的场景进行fitview,则没超出的场景zoom取1\n\n\n if (onlyOutOfViewPort) {\n ratio = ratio < 1 ? ratio : 1;\n }\n\n if (animate) {\n this.animatedFitView(group, startMatrix, animateCfg, bbox, viewCenter, groupCenter, ratio, true);\n } else {\n var initZoomRatio = graph.getZoom();\n var endZoom = initZoomRatio * ratio;\n var minZoom = graph.get('minZoom'); // 如果zoom小于最小zoom, 则以最小zoom为准\n\n if (endZoom < minZoom) {\n endZoom = minZoom;\n console.warn('fitview failed, ratio out of range, ratio: %f', ratio, 'graph minzoom has been used instead');\n }\n\n graph.translate(viewCenter.x - groupCenter.x, viewCenter.y - groupCenter.y);\n graph.zoomTo(endZoom, viewCenter);\n }\n };\n\n ViewController.prototype.getFormatPadding = function () {\n var padding = this.graph.get('fitViewPadding');\n return Object(_util_base__WEBPACK_IMPORTED_MODULE_2__[\"formatPadding\"])(padding);\n };\n\n ViewController.prototype.focusPoint = function (point, animate, animateCfg) {\n var _this = this;\n\n var viewCenter = this.getViewCenter();\n var modelCenter = this.getPointByCanvas(viewCenter.x, viewCenter.y);\n var viewportMatrix = this.graph.get('group').getMatrix();\n if (!viewportMatrix) viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n if (animate) {\n var dx_1 = (modelCenter.x - point.x) * viewportMatrix[0];\n var dy_1 = (modelCenter.y - point.y) * viewportMatrix[4];\n var lastX_1 = 0;\n var lastY_1 = 0;\n var newX_1 = 0;\n var newY_1 = 0; // 动画每次平移一点,直到目标位置\n\n this.graph.get('canvas').animate(function (ratio) {\n newX_1 = dx_1 * ratio;\n newY_1 = dy_1 * ratio;\n\n _this.graph.translate(newX_1 - lastX_1, newY_1 - lastY_1);\n\n lastX_1 = newX_1;\n lastY_1 = newY_1;\n }, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, animateCfg));\n } else {\n this.graph.translate((modelCenter.x - point.x) * viewportMatrix[0], (modelCenter.y - point.y) * viewportMatrix[4]);\n }\n };\n /**\n * 将 Canvas 坐标转成视口坐标\n * @param canvasX canvas x 坐标\n * @param canvasY canvas y 坐标\n */\n\n\n ViewController.prototype.getPointByCanvas = function (canvasX, canvasY) {\n var viewportMatrix = this.graph.get('group').getMatrix();\n\n if (!viewportMatrix) {\n viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var point = Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"invertMatrix\"])({\n x: canvasX,\n y: canvasY\n }, viewportMatrix);\n return point;\n };\n /**\n * 将页面坐标转成视口坐标\n * @param clientX 页面 x 坐标\n * @param clientY 页面 y 坐标\n */\n\n\n ViewController.prototype.getPointByClient = function (clientX, clientY) {\n var canvas = this.graph.get('canvas');\n var canvasPoint = canvas.getPointByClient(clientX, clientY);\n return this.getPointByCanvas(canvasPoint.x, canvasPoint.y);\n };\n /**\n * 将视口坐标转成页面坐标\n * @param x 视口 x 坐标\n * @param y 视口 y 坐标\n */\n\n\n ViewController.prototype.getClientByPoint = function (x, y) {\n var canvas = this.graph.get('canvas');\n var canvasPoint = this.getCanvasByPoint(x, y);\n var point = canvas.getClientByPoint(canvasPoint.x, canvasPoint.y);\n return {\n x: point.x,\n y: point.y\n };\n };\n /**\n * 将视口坐标转成 Canvas 坐标\n * @param x 视口 x 坐标\n * @param y 视口 y 坐标\n */\n\n\n ViewController.prototype.getCanvasByPoint = function (x, y) {\n var viewportMatrix = this.graph.get('group').getMatrix();\n\n if (!viewportMatrix) {\n viewportMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n return Object(_util_math__WEBPACK_IMPORTED_MODULE_3__[\"applyMatrix\"])({\n x: x,\n y: y\n }, viewportMatrix);\n };\n /**\n * 将元素移动到画布中心\n * @param item Item 实例或 id\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n\n\n ViewController.prototype.focus = function (item, animate, animateCfg) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n item = this.graph.findById(item);\n }\n\n if (item) {\n var x = 0,\n y = 0;\n\n if (item.getType && item.getType() === 'edge') {\n var sourceMatrix = item.getSource().get('group').getMatrix();\n var targetMatrix = item.getTarget().get('group').getMatrix();\n\n if (sourceMatrix && targetMatrix) {\n x = (sourceMatrix[6] + targetMatrix[6]) / 2;\n y = (sourceMatrix[7] + targetMatrix[7]) / 2;\n } else if (sourceMatrix || targetMatrix) {\n x = sourceMatrix ? sourceMatrix[6] : targetMatrix[6];\n y = sourceMatrix ? sourceMatrix[7] : targetMatrix[7];\n }\n } else {\n var group = item.get('group');\n var matrix = group.getMatrix();\n if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n x = matrix[6];\n y = matrix[7];\n } // 用实际位置而不是model中的x,y,防止由于拖拽等的交互导致model的x,y并不是当前的x,y\n\n\n this.focusPoint({\n x: x,\n y: y\n }, animate, animateCfg);\n }\n };\n\n ViewController.prototype.focusItems = function (items, zoomToFit, animate, animateCfg) {\n if (!items.length) {\n return;\n }\n\n var graph = this.graph;\n var padding = this.getFormatPadding();\n var width = graph.get('width');\n var height = graph.get('height');\n var group = graph.get('group');\n var startMatrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n group.resetMatrix();\n var bbox = {\n x: 0,\n y: 0,\n minX: Number.MAX_SAFE_INTEGER,\n minY: Number.MAX_SAFE_INTEGER,\n maxX: Number.MIN_SAFE_INTEGER,\n maxY: Number.MIN_SAFE_INTEGER,\n width: 0,\n height: 0\n };\n\n for (var _i = 0, items_1 = items; _i < items_1.length; _i++) {\n var item = items_1[_i];\n var itemBBox = item.getBBox();\n\n if (itemBBox.minX < bbox.minX) {\n bbox.minX = itemBBox.minX;\n }\n\n if (itemBBox.minY < bbox.minY) {\n bbox.minY = itemBBox.minY;\n }\n\n if (itemBBox.maxX > bbox.maxX) {\n bbox.maxX = itemBBox.maxX;\n }\n\n if (itemBBox.maxY > bbox.maxY) {\n bbox.maxY = itemBBox.maxY;\n }\n }\n\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n if (bbox.width === 0 || bbox.height === 0) return;\n var viewCenter = this.getViewCenter();\n var groupCenter = {\n x: bbox.x + bbox.width / 2,\n y: bbox.y + bbox.height / 2\n }; // Compute ratio\n\n var w = (width - padding[1] - padding[3]) / bbox.width;\n var h = (height - padding[0] - padding[2]) / bbox.height;\n var ratio = w;\n\n if (w > h) {\n ratio = h;\n }\n\n if (animate) {\n this.animatedFitView(group, startMatrix, animateCfg, bbox, viewCenter, groupCenter, ratio, zoomToFit);\n } else {\n graph.translate(viewCenter.x - groupCenter.x, viewCenter.y - groupCenter.y);\n\n if (zoomToFit && !graph.zoom(ratio, viewCenter)) {\n console.warn('zoom failed, ratio out of range, ratio: %f', ratio);\n }\n }\n };\n /**\n * 改变 canvas 画布的宽度和高度\n * @param width canvas 宽度\n * @param height canvas 高度\n */\n\n\n ViewController.prototype.changeSize = function (width, height) {\n var graph = this.graph;\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(width) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(height)) {\n throw Error('invalid canvas width & height, please make sure width & height type is number');\n }\n\n graph.set({\n width: width,\n height: height\n });\n var canvas = graph.get('canvas');\n canvas.changeSize(width, height); // change the size of grid plugin if it exists on graph\n\n var plugins = graph.get('plugins');\n plugins.forEach(function (plugin) {\n if (plugin.get('gridContainer')) {\n // 网格定位信息初始化\n plugin.positionInit();\n }\n });\n };\n\n ViewController.prototype.destroy = function () {\n this.graph = null;\n this.destroyed = false;\n };\n\n return ViewController;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ViewController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/controller/view.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! insert-css */ \"./node_modules/insert-css/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(insert_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\ntypeof document !== 'undefined' && insert_css__WEBPACK_IMPORTED_MODULE_2___default()(\"\\n .g6-component-contextmenu {\\n border: 1px solid #e2e2e2;\\n border-radius: 4px;\\n font-size: 12px;\\n color: #545454;\\n background-color: rgba(255, 255, 255, 0.9);\\n padding: 10px 8px;\\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\\n }\\n .g6-contextmenu-ul {\\n padding: 0;\\n margin: 0;\\n list-style: none;\\n }\\n\\n\");\nvar Menu = /** @class */function (_super) {\n __extends(Menu, _super);\n function Menu(config) {\n return _super.call(this, config) || this;\n }\n Menu.prototype.getDefaultCfgs = function () {\n return {\n offsetX: 6,\n offsetY: 6,\n handleMenuClick: undefined,\n // 指定菜单内容,function(e) {...}\n getContent: function getContent(e) {\n return \"\\n
    \\n
  • \\u83DC\\u5355\\u98791
  • \\n
  • \\u83DC\\u5355\\u98792
  • \\n
\\n \";\n },\n shouldBegin: function shouldBegin(e) {\n return true;\n },\n // 菜单隐藏事件\n onHide: function onHide() {\n return true;\n },\n itemTypes: ['node', 'edge', 'combo'],\n trigger: 'contextmenu'\n };\n };\n // class-methods-use-this\n Menu.prototype.getEvents = function () {\n if (this.get('trigger') === 'click') {\n return {\n click: 'onMenuShow',\n touchend: 'onMenuShow'\n };\n }\n return {\n contextmenu: 'onMenuShow'\n };\n };\n Menu.prototype.init = function () {\n var className = this.get('className');\n var menu = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(menu, {\n top: '0px',\n position: 'absolute',\n visibility: 'hidden'\n });\n var container = this.get('container');\n if (!container) {\n container = this.get('graph').get('container');\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n container.appendChild(menu);\n this.set('menu', menu);\n };\n Menu.prototype.onMenuShow = function (e) {\n var self = this;\n e.preventDefault();\n var itemTypes = this.get('itemTypes');\n if (!e.item) {\n if (itemTypes.indexOf('canvas') === -1) {\n self.onMenuHide();\n return;\n }\n } else {\n if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) {\n self.onMenuHide();\n return;\n }\n }\n var shouldBegin = this.get('shouldBegin');\n if (!shouldBegin(e)) return;\n var menuDom = this.get('menu');\n var getContent = this.get('getContent');\n var graph = this.get('graph');\n var menu = getContent(e, graph);\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(menu)) {\n menuDom.innerHTML = menu;\n } else {\n menuDom.innerHTML = menu.outerHTML;\n }\n // 清除之前监听的事件\n this.removeMenuEventListener();\n var handleMenuClick = this.get('handleMenuClick');\n if (handleMenuClick) {\n var handleMenuClickWrapper = function handleMenuClickWrapper(evt) {\n handleMenuClick(evt.target, e.item, graph);\n };\n this.set('handleMenuClickWrapper', handleMenuClickWrapper);\n menuDom.addEventListener('click', handleMenuClickWrapper);\n }\n var width = graph.get('width');\n var height = graph.get('height');\n var bbox = menuDom.getBoundingClientRect();\n var offsetX = this.get('offsetX') || 0;\n var offsetY = this.get('offsetY') || 0;\n var graphTop = graph.getContainer().offsetTop;\n var graphLeft = graph.getContainer().offsetLeft;\n var x = e.canvasX + graphLeft + offsetX;\n var y = e.canvasY + graphTop + offsetY;\n // when the menu is (part of) out of the canvas\n if (x + bbox.width > width) {\n x = e.canvasX - bbox.width - offsetX + graphLeft;\n }\n if (y + bbox.height > height) {\n y = e.canvasY - bbox.height - offsetY + graphTop;\n }\n if (y < 0) {\n y = 0;\n }\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(menuDom, {\n top: \"\".concat(y, \"px\"),\n left: \"\".concat(x, \"px\"),\n visibility: 'visible'\n });\n // 左键单击会触发 body 上监听的 click 事件,导致菜单展示出来后又立即被隐藏了,需要过滤掉\n var triggeredByFirstClick = this.get('trigger') === 'click';\n var handler = function handler(evt) {\n if (triggeredByFirstClick) {\n triggeredByFirstClick = false;\n return;\n }\n self.onMenuHide();\n };\n // 如果在页面中其他任意地方进行click, 隐去菜单\n document.body.addEventListener('click', handler);\n this.set('handler', handler);\n };\n Menu.prototype.removeMenuEventListener = function () {\n var handleMenuClickWrapper = this.get('handleMenuClickWrapper');\n var handler = this.get('handler');\n if (handleMenuClickWrapper) {\n var menuDom = this.get('menu');\n menuDom.removeEventListener('click', handleMenuClickWrapper);\n this.set('handleMenuClickWrapper', null);\n }\n if (handler) {\n document.body.removeEventListener('click', handler);\n }\n };\n Menu.prototype.onMenuHide = function () {\n var menuDom = this.get('menu');\n if (menuDom) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(menuDom, {\n visibility: 'hidden'\n });\n }\n // 隐藏菜单后需要移除事件监听\n this.removeMenuEventListener();\n };\n Menu.prototype.destroy = function () {\n var menu = this.get('menu');\n this.removeMenuEventListener();\n if (menu) {\n var container = this.get('container');\n if (!container) {\n container = this.get('graph').get('container');\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n container.removeChild(menu);\n }\n };\n return Menu;\n}(_base__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Menu);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/menu/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/graph/graph.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/graph/graph.js ***! - \******************************************************/ +/***/ "./node_modules/@antv/g6-plugin/es/minimap/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/minimap/index.js ***! + \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_event_emitter__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/event-emitter */ \"./node_modules/@antv/event-emitter/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/algorithm */ \"./node_modules/@antv/algorithm/es/index.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _util_validation__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../util/validation */ \"./node_modules/@antv/g6-core/es/util/validation.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _controller__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./controller */ \"./node_modules/@antv/g6-core/es/graph/controller/index.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _item_hull__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ../item/hull */ \"./node_modules/@antv/g6-core/es/item/hull.js\");\n\n\n\n\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_2__[\"ext\"].transform;\nvar NODE = 'node';\n\nvar AbstractGraph =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(AbstractGraph, _super);\n\n function AbstractGraph(cfg) {\n var _this = _super.call(this) || this;\n /**\n * 根据 comboTree 结构整理 Combo 相关的图形绘制层级,包括 Combo 本身、节点、边\n * @param {GraphData} data 数据\n */\n\n\n _this.sortCombos = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"debounce\"])(function () {\n var comboSorted = _this.get('comboSorted');\n\n if (!_this || _this.destroyed || comboSorted) return;\n\n _this.set('comboSorted', true);\n\n var depthMap = [];\n var dataDepthMap = {};\n\n var comboTrees = _this.get('comboTrees');\n\n (comboTrees || []).forEach(function (cTree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(cTree, function (child) {\n if (depthMap[child.depth]) depthMap[child.depth].push(child.id);else depthMap[child.depth] = [child.id];\n dataDepthMap[child.id] = child.depth;\n return true;\n });\n });\n\n var edges = _this.getEdges().concat(_this.get('vedges'));\n\n (edges || []).forEach(function (edgeItem) {\n var edge = edgeItem.getModel();\n var sourceDepth = dataDepthMap[edge.source] || 0;\n var targetDepth = dataDepthMap[edge.target] || 0;\n var depth = Math.max(sourceDepth, targetDepth);\n if (depthMap[depth]) depthMap[depth].push(edge.id);else depthMap[depth] = [edge.id];\n });\n depthMap.forEach(function (array) {\n if (!array || !array.length) return;\n\n for (var i = array.length - 1; i >= 0; i--) {\n var item = _this.findById(array[i]);\n\n if (item) item.toFront();\n }\n });\n }, 500, false);\n _this.cfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"])(_this.getDefaultCfg(), cfg);\n\n _this.init();\n\n _this.animating = false;\n _this.destroyed = false; // 启用 stack 后,实例化 undoStack 和 redoStack\n\n if (_this.cfg.enabledStack) {\n // 实例化 undo 和 redo 栈\n _this.undoStack = new _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"Stack\"](_this.cfg.maxStep);\n _this.redoStack = new _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"Stack\"](_this.cfg.maxStep);\n }\n\n return _this;\n }\n\n AbstractGraph.prototype.init = function () {\n this.initCanvas(); // instance controller\n\n var viewController = new _controller__WEBPACK_IMPORTED_MODULE_8__[\"ViewController\"](this);\n var modeController = new _controller__WEBPACK_IMPORTED_MODULE_8__[\"ModeController\"](this);\n var itemController = new _controller__WEBPACK_IMPORTED_MODULE_8__[\"ItemController\"](this);\n var stateController = new _controller__WEBPACK_IMPORTED_MODULE_8__[\"StateController\"](this);\n this.set({\n viewController: viewController,\n modeController: modeController,\n itemController: itemController,\n stateController: stateController\n }); // 初始化布局机制\n\n this.initLayoutController(); // 初始化事件机制\n\n this.initEventController();\n this.initGroups();\n /** 初始化插件 */\n\n this.initPlugins();\n }; // 初始化所有 Group\n\n\n AbstractGraph.prototype.initGroups = function () {\n var canvas = this.get('canvas');\n if (!canvas) return;\n var el = canvas.get('el');\n var _a = (el || {}).id,\n id = _a === void 0 ? 'g6' : _a;\n var group = canvas.addGroup({\n id: \"\".concat(id, \"-root\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].rootContainerClassName\n });\n\n if (this.get('groupByTypes')) {\n var edgeGroup = group.addGroup({\n id: \"\".concat(id, \"-edge\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].edgeContainerClassName\n });\n var nodeGroup = group.addGroup({\n id: \"\".concat(id, \"-node\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].nodeContainerClassName\n });\n var comboGroup = group.addGroup({\n id: \"\".concat(id, \"-combo\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].comboContainerClassName\n }); // 用于存储自定义的群组\n\n comboGroup.toBack();\n this.set({\n nodeGroup: nodeGroup,\n edgeGroup: edgeGroup,\n comboGroup: comboGroup\n });\n }\n\n var delegateGroup = group.addGroup({\n id: \"\".concat(id, \"-delegate\"),\n className: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].delegateContainerClassName\n });\n this.set({\n delegateGroup: delegateGroup\n });\n this.set('group', group);\n }; // eslint-disable-next-line class-methods-use-this\n\n\n AbstractGraph.prototype.getDefaultCfg = function () {\n return {\n /**\n * Container could be dom object or dom id\n */\n container: undefined,\n\n /**\n * Canvas width\n * unit pixel if undefined force fit width\n */\n width: undefined,\n\n /**\n * Canvas height\n * unit pixel if undefined force fit height\n */\n height: undefined,\n\n /**\n * renderer canvas or svg\n * @type {string}\n */\n renderer: 'canvas',\n\n /**\n * control graph behaviors\n */\n modes: {},\n\n /**\n * 注册插件\n */\n plugins: [],\n\n /**\n * source data\n */\n data: {},\n\n /**\n * Fit view padding (client scale)\n */\n fitViewPadding: 10,\n\n /**\n * Minimum scale size\n */\n minZoom: 0.02,\n\n /**\n * Maxmum scale size\n */\n maxZoom: 10,\n\n /**\n * capture events\n */\n event: true,\n\n /**\n * group node & edges into different graphic groups\n */\n groupByTypes: true,\n\n /**\n * determine if it's a directed graph\n */\n directed: false,\n\n /**\n * when data or shape changed, should canvas draw automatically\n */\n autoPaint: true,\n\n /**\n * store all the node instances\n */\n nodes: [],\n\n /**\n * store all the edge instances\n */\n edges: [],\n\n /**\n * store all the combo instances\n */\n combos: [],\n\n /**\n * store all the edge instances which are virtual edges related to collapsed combo\n */\n vedges: [],\n\n /**\n * all the instances indexed by id\n */\n itemMap: {},\n\n /**\n * 边直接连接到节点的中心,不再考虑锚点\n */\n linkCenter: false,\n\n /**\n * 默认的节点配置,data 上定义的配置会覆盖这些配置。例如:\n * defaultNode: {\n * type: 'rect',\n * size: [60, 40],\n * style: {\n * //... 样式配置项\n * }\n * }\n * 若数据项为 { id: 'node', x: 100, y: 100 }\n * 实际创建的节点模型是 { id: 'node', x: 100, y: 100, type: 'rect', size: [60, 40] }\n * 若数据项为 { id: 'node', x: 100, y: 100, type: 'circle' }\n * 实际创建的节点模型是 { id: 'node', x: 100, y: 100, type: 'circle', size: [60, 40] }\n */\n defaultNode: {},\n\n /**\n * 默认边配置,data 上定义的配置会覆盖这些配置。用法同 defaultNode\n */\n defaultEdge: {},\n\n /**\n * 节点默认样式,也可以添加状态样式\n * 例如:\n * const graph = new G6.Graph({\n * nodeStateStyles: {\n * selected: { fill: '#ccc', stroke: '#666' },\n * active: { lineWidth: 2 }\n * },\n * ...\n * });\n *\n */\n nodeStateStyles: {},\n\n /**\n * 边默认样式,用法同nodeStateStyle\n */\n edgeStateStyles: {},\n\n /**\n * graph 状态\n */\n states: {},\n\n /**\n * 是否启用全局动画\n */\n animate: false,\n\n /**\n * 动画设置,仅在 animate 为 true 时有效\n */\n animateCfg: {\n /**\n * 帧回调函数,用于自定义节点运动路径,为空时线性运动\n */\n onFrame: undefined,\n\n /**\n * 动画时长(ms)\n */\n duration: 500,\n\n /**\n * 指定动画动效\n */\n easing: 'easeLinear'\n },\n callback: undefined,\n // 默认不启用 undo & redo 功能\n enabledStack: false,\n // 只有当 enabledStack 为 true 时才起作用\n maxStep: 10,\n // 存储图上的 tooltip dom,方便销毁\n tooltips: []\n };\n };\n /**\n * 将值设置到 this.cfg 变量上面\n * @param key 键 或 对象值\n * @param val 值\n */\n\n\n AbstractGraph.prototype.set = function (key, val) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(key)) {\n this.cfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, this.cfg), key);\n } else {\n this.cfg[key] = val;\n }\n\n if (key === 'enabledStack' && val && !this.undoStack && !this.redoStack) {\n this.undoStack = new _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"Stack\"](this.cfg.maxStep);\n this.redoStack = new _antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"Stack\"](this.cfg.maxStep);\n }\n\n return this;\n };\n /**\n * 获取 this.cfg 中的值\n * @param key 键\n */\n\n\n AbstractGraph.prototype.get = function (key) {\n var _a;\n\n return (_a = this.cfg) === null || _a === void 0 ? void 0 : _a[key];\n };\n /**\n * 获取 graph 的根图形分组\n * @return 根 group\n */\n\n\n AbstractGraph.prototype.getGroup = function () {\n return this.get('group');\n };\n /**\n * 获取 graph 的 DOM 容器\n * @return DOM 容器\n */\n\n\n AbstractGraph.prototype.getContainer = function () {\n return this.get('container');\n };\n /**\n * 获取 graph 的最小缩放比例\n * @return minZoom\n */\n\n\n AbstractGraph.prototype.getMinZoom = function () {\n return this.get('minZoom');\n };\n /**\n * 设置 graph 的最小缩放比例\n * @return minZoom\n */\n\n\n AbstractGraph.prototype.setMinZoom = function (ratio) {\n return this.set('minZoom', ratio);\n };\n /**\n * 获取 graph 的最大缩放比例\n * @param maxZoom\n */\n\n\n AbstractGraph.prototype.getMaxZoom = function () {\n return this.get('maxZoom');\n };\n /**\n * 设置 graph 的最大缩放比例\n * @param maxZoom\n */\n\n\n AbstractGraph.prototype.setMaxZoom = function (ratio) {\n return this.set('maxZoom', ratio);\n };\n /**\n * 获取 graph 的宽度\n * @return width\n */\n\n\n AbstractGraph.prototype.getWidth = function () {\n return this.get('width');\n };\n /**\n * 获取 graph 的高度\n * @return width\n */\n\n\n AbstractGraph.prototype.getHeight = function () {\n return this.get('height');\n };\n /**\n * 清理元素多个状态\n * @param {string|Item} item 元素id或元素实例\n * @param {string[]} states 状态\n */\n\n\n AbstractGraph.prototype.clearItemStates = function (item, states) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n item = this.findById(item);\n }\n\n var itemController = this.get('itemController');\n\n if (!states) {\n states = item.get('states');\n }\n\n itemController.clearItemStates(item, states);\n var stateController = this.get('stateController');\n stateController.updateStates(item, states, false);\n };\n /**\n * 设置各个节点样式,以及在各种状态下节点 keyShape 的样式。\n * 若是自定义节点切在各种状态下\n * graph.node(node => {\n * return {\n * type: 'rect',\n * label: node.id,\n * style: { fill: '#666' },\n * stateStyles: {\n * selected: { fill: 'blue' },\n * custom: { fill: 'green' }\n * }\n * }\n * });\n * @param {function} nodeFn 指定每个节点样式\n */\n\n\n AbstractGraph.prototype.node = function (nodeFn) {\n if (typeof nodeFn === 'function') {\n this.set('nodeMapper', nodeFn);\n }\n };\n /**\n * 设置各个边样式\n * @param {function} edgeFn 指定每个边的样式,用法同 node\n */\n\n\n AbstractGraph.prototype.edge = function (edgeFn) {\n if (typeof edgeFn === 'function') {\n this.set('edgeMapper', edgeFn);\n }\n };\n /**\n * 设置各个 combo 的配置\n * @param comboFn\n */\n\n\n AbstractGraph.prototype.combo = function (comboFn) {\n if (typeof comboFn === 'function') {\n this.set('comboMapper', comboFn);\n }\n };\n /**\n * 根据 ID 查询图元素实例\n * @param id 图元素 ID\n */\n\n\n AbstractGraph.prototype.findById = function (id) {\n return this.get('itemMap')[id];\n };\n /**\n * 根据对应规则查找单个元素\n * @param {ITEM_TYPE} type 元素类型(node | edge | group)\n * @param {(item: T, index: number) => T} fn 指定规则\n * @return {T} 元素实例\n */\n\n\n AbstractGraph.prototype.find = function (type, fn) {\n var result;\n var items = this.get(\"\".concat(type, \"s\")); // eslint-disable-next-line consistent-return\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(items, function (item, i) {\n if (fn(item, i)) {\n result = item;\n return result;\n }\n });\n return result;\n };\n /**\n * 查找所有满足规则的元素\n * @param {string} type 元素类型(node|edge)\n * @param {string} fn 指定规则\n * @return {array} 元素实例\n */\n\n\n AbstractGraph.prototype.findAll = function (type, fn) {\n var result = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(this.get(\"\".concat(type, \"s\")), function (item, i) {\n if (fn(item, i)) {\n result.push(item);\n }\n });\n return result;\n };\n /**\n * 查找所有处于指定状态的元素\n * @param {string} type 元素类型(node|edge)\n * @param {string} state 状态\n * @return {object} 元素实例\n */\n\n\n AbstractGraph.prototype.findAllByState = function (type, state, additionalFilter) {\n if (additionalFilter) {\n return this.findAll(type, function (item) {\n return item.hasState(state) && additionalFilter(item);\n });\n } else {\n return this.findAll(type, function (item) {\n return item.hasState(state);\n });\n }\n };\n /**\n * 平移画布\n * @param dx 水平方向位移\n * @param dy 垂直方向位移\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n\n\n AbstractGraph.prototype.translate = function (dx, dy, animate, animateCfg) {\n var _this = this;\n\n var group = this.get('group');\n var matrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(group.getMatrix());\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n if (animate) {\n var animateConfig = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"getAnimateCfgWithCallback\"])({\n animateCfg: animateCfg,\n callback: function callback() {\n return _this.emit('viewportchange', {\n action: 'translate',\n matrix: group.getMatrix()\n });\n }\n });\n Object(_util_math__WEBPACK_IMPORTED_MODULE_5__[\"move\"])(group, {\n x: group.getCanvasBBox().x + dx,\n y: group.getCanvasBBox().y + dy\n }, animate, animateConfig || {\n duration: 500,\n easing: 'easeCubic'\n });\n } else {\n matrix = transform(matrix, [['t', dx, dy]]);\n group.setMatrix(matrix);\n this.emit('viewportchange', {\n action: 'translate',\n matrix: matrix\n });\n this.autoPaint();\n }\n };\n /**\n * 平移画布到某点\n * @param {number} x 水平坐标\n * @param {number} y 垂直坐标\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n\n\n AbstractGraph.prototype.moveTo = function (x, y, animate, animateCfg) {\n var group = this.get('group');\n Object(_util_math__WEBPACK_IMPORTED_MODULE_5__[\"move\"])(group, {\n x: x,\n y: y\n }, animate, animateCfg || {\n duration: 500,\n easing: 'easeCubic'\n });\n this.emit('viewportchange', {\n action: 'move',\n matrix: group.getMatrix()\n });\n };\n /**\n * 调整视口适应视图\n * @param {object} padding 四周围边距\n * @param {FitViewRules} rules fitView的规则\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n\n\n AbstractGraph.prototype.fitView = function (padding, rules, animate, animateCfg) {\n if (padding) {\n this.set('fitViewPadding', padding);\n }\n\n var viewController = this.get('viewController');\n\n if (rules) {\n viewController.fitViewByRules(rules, animate, animateCfg);\n } else {\n viewController.fitView(animate, animateCfg);\n }\n\n this.autoPaint();\n };\n /**\n * 调整视口适应视图,不缩放,仅将图 bbox 中心对齐到画布中心\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n\n\n AbstractGraph.prototype.fitCenter = function (animate, animateCfg) {\n var viewController = this.get('viewController');\n viewController.fitCenter(animate, animateCfg);\n this.autoPaint();\n };\n /**\n * 新增行为\n * @param {string | ModeOption | ModeType[]} behaviors 添加的行为\n * @param {string | string[]} modes 添加到对应的模式\n * @return {Graph} Graph\n */\n\n\n AbstractGraph.prototype.addBehaviors = function (behaviors, modes) {\n var modeController = this.get('modeController');\n modeController.manipulateBehaviors(behaviors, modes, true);\n return this;\n };\n /**\n * 移除行为\n * @param {string | ModeOption | ModeType[]} behaviors 移除的行为\n * @param {string | string[]} modes 从指定的模式中移除\n * @return {Graph} Graph\n */\n\n\n AbstractGraph.prototype.removeBehaviors = function (behaviors, modes) {\n var modeController = this.get('modeController');\n modeController.manipulateBehaviors(behaviors, modes, false);\n return this;\n };\n /**\n * 更新行为参数\n * @param {string | ModeOption | ModeType} behavior 需要更新的行为\n * @param {string | string[]} modes 指定的模式中的行为,不指定则为 default\n * @return {Graph} Graph\n */\n\n\n AbstractGraph.prototype.updateBehavior = function (behavior, newCfg, mode) {\n var modeController = this.get('modeController');\n modeController.updateBehavior(behavior, newCfg, mode);\n return this;\n };\n /**\n * 伸缩窗口\n * @param ratio 伸缩比例\n * @param center 以center的x, y坐标为中心缩放\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n * @return {boolean} 缩放是否成功\n */\n\n\n AbstractGraph.prototype.zoom = function (ratio, center, animate, animateCfg) {\n var _this = this;\n\n var group = this.get('group');\n var matrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(group.getMatrix()) || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var minZoom = this.get('minZoom');\n var maxZoom = this.get('maxZoom');\n var currentZoom = this.getZoom() || 1;\n var targetZoom = currentZoom * ratio;\n var finalRatio = ratio;\n var failed = false;\n\n if (minZoom && targetZoom < minZoom) {\n finalRatio = minZoom / currentZoom;\n failed = true;\n } else if (maxZoom && targetZoom > maxZoom) {\n finalRatio = maxZoom / currentZoom;\n failed = true;\n }\n\n if (center) {\n matrix = transform(matrix, [['t', -center.x, -center.y], ['s', finalRatio, finalRatio], ['t', center.x, center.y]]);\n } else {\n matrix = transform(matrix, [['s', finalRatio, finalRatio]]);\n }\n\n if (animate) {\n // Clone the original matrix to perform the animation\n var aniMatrix_1 = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(group.getMatrix());\n\n if (!aniMatrix_1) {\n aniMatrix_1 = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var initialRatio_1 = aniMatrix_1[0];\n var targetRatio_1 = initialRatio_1 * finalRatio;\n var animateConfig = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"getAnimateCfgWithCallback\"])({\n animateCfg: animateCfg,\n callback: function callback() {\n return _this.emit('viewportchange', {\n action: 'zoom',\n matrix: group.getMatrix()\n });\n }\n });\n group.animate(function (ratio) {\n if (ratio === 1) {\n // Reuse the first transformation\n aniMatrix_1 = matrix;\n } else {\n var scale = Object(_util_math__WEBPACK_IMPORTED_MODULE_5__[\"lerp\"])(initialRatio_1, targetRatio_1, ratio) / aniMatrix_1[0];\n\n if (center) {\n aniMatrix_1 = transform(aniMatrix_1, [['t', -center.x, -center.y], ['s', scale, scale], ['t', center.x, center.y]]);\n } else {\n aniMatrix_1 = transform(aniMatrix_1, [['s', scale, scale]]);\n }\n }\n\n return {\n matrix: aniMatrix_1\n };\n }, animateConfig);\n } else {\n group.setMatrix(matrix);\n this.emit('viewportchange', {\n action: 'zoom',\n matrix: matrix\n });\n this.autoPaint();\n }\n\n return !failed;\n };\n /**\n * 伸缩视口到一固定比例\n * @param {number} toRatio 伸缩比例\n * @param {Point} center 以center的x, y坐标为中心缩放\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n * @return {boolean} 缩放是否成功\n */\n\n\n AbstractGraph.prototype.zoomTo = function (toRatio, center, animate, animateCfg) {\n var ratio = toRatio / this.getZoom();\n return this.zoom(ratio, center, animate, animateCfg);\n };\n /**\n * 将元素移动到视口中心\n * @param {Item} item 指定元素\n * @param {boolean} animate 是否带有动画地移动\n * @param {GraphAnimateConfig} animateCfg 若带有动画,动画的配置项\n */\n\n\n AbstractGraph.prototype.focusItem = function (item, animate, animateCfg) {\n var viewController = this.get('viewController');\n var isAnimate = false;\n if (animate) isAnimate = true;else if (animate === undefined) isAnimate = this.get('animate');\n var curAniamteCfg = {};\n if (animateCfg) curAniamteCfg = animateCfg;else if (animateCfg === undefined) curAniamteCfg = this.get('animateCfg');\n viewController.focus(item, isAnimate, curAniamteCfg);\n this.autoPaint();\n };\n /**\n * Focus on the passed items\n * @param {Item[]} items Items you want to focus on\n * @param {boolean} zoomToFit Wether to zoom on the passed items\n * @param {boolean} animate Wether to animate the transition\n * @param {GraphAnimateConfig} animateCfg Animation configuration\n */\n\n\n AbstractGraph.prototype.focusItems = function (items, zoomToFit, animate, animateCfg) {\n var viewController = this.get('viewController');\n viewController.focusItems(items, zoomToFit, animate, animateCfg);\n };\n /**\n * 自动重绘\n * @internal 仅供内部更新机制调用,外部根据需求调用 render 或 paint 接口\n */\n\n\n AbstractGraph.prototype.autoPaint = function () {\n if (this.get('autoPaint')) {\n this.paint();\n }\n };\n /**\n * 仅画布重新绘制\n */\n\n\n AbstractGraph.prototype.paint = function () {\n this.emit('beforepaint');\n this.get('canvas').draw();\n this.emit('afterpaint');\n };\n /**\n * 将屏幕坐标转换为视口坐标\n * @param {number} clientX 屏幕x坐标\n * @param {number} clientY 屏幕y坐标\n * @return {Point} 视口坐标\n */\n\n\n AbstractGraph.prototype.getPointByClient = function (clientX, clientY) {\n var viewController = this.get('viewController');\n return viewController.getPointByClient(clientX, clientY);\n };\n /**\n * 将绘制坐标转换为屏幕坐标\n * @param {number} x 绘制坐标 x\n * @param {number} y 绘制坐标 y\n * @return {Point} 绘制坐标\n */\n\n\n AbstractGraph.prototype.getClientByPoint = function (x, y) {\n var viewController = this.get('viewController');\n return viewController.getClientByPoint(x, y);\n };\n /**\n * 将画布坐标转换为绘制坐标\n * @param {number} canvasX 画布 x 坐标\n * @param {number} canvasY 画布 y 坐标\n * @return {object} 绘制坐标\n */\n\n\n AbstractGraph.prototype.getPointByCanvas = function (canvasX, canvasY) {\n var viewController = this.get('viewController');\n return viewController.getPointByCanvas(canvasX, canvasY);\n };\n /**\n * 将绘制坐标转换为画布坐标\n * @param {number} x 绘制坐标 x\n * @param {number} y 绘制坐标 y\n * @return {object} 画布坐标\n */\n\n\n AbstractGraph.prototype.getCanvasByPoint = function (x, y) {\n var viewController = this.get('viewController');\n return viewController.getCanvasByPoint(x, y);\n };\n /**\n * 获取图内容的中心绘制坐标\n * @return {object} 中心绘制坐标\n */\n\n\n AbstractGraph.prototype.getGraphCenterPoint = function () {\n var bbox = this.get('group').getCanvasBBox();\n return {\n x: (bbox.minX + bbox.maxX) / 2,\n y: (bbox.minY + bbox.maxY) / 2\n };\n };\n /**\n * 获取视口中心绘制坐标\n * @return {object} 视口中心绘制坐标\n */\n\n\n AbstractGraph.prototype.getViewPortCenterPoint = function () {\n return this.getPointByCanvas(this.get('width') / 2, this.get('height') / 2);\n };\n /**\n * 显示元素\n * @param {Item} item 指定元素\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n\n\n AbstractGraph.prototype.showItem = function (item, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n var itemController = this.get('itemController');\n var object = itemController.changeItemVisibility(item, true);\n\n if (stack && this.get('enabledStack')) {\n var id = object.getID();\n var type = object.getType();\n var before = {};\n var after = {};\n\n switch (type) {\n case 'node':\n before.nodes = [{\n id: id,\n visible: false\n }];\n after.nodes = [{\n id: id,\n visible: true\n }];\n break;\n\n case 'edge':\n before.nodes = [{\n id: id,\n visible: false\n }];\n after.edges = [{\n id: id,\n visible: true\n }];\n break;\n\n case 'combo':\n before.nodes = [{\n id: id,\n visible: false\n }];\n after.combos = [{\n id: id,\n visible: true\n }];\n break;\n\n default:\n break;\n }\n\n this.pushStack('visible', {\n before: before,\n after: after\n });\n }\n };\n /**\n * 隐藏元素\n * @param {Item} item 指定元素\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n\n\n AbstractGraph.prototype.hideItem = function (item, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n var itemController = this.get('itemController');\n var object = itemController.changeItemVisibility(item, false);\n\n if (stack && this.get('enabledStack')) {\n var id = object.getID();\n var type = object.getType();\n var before = {};\n var after = {};\n\n switch (type) {\n case 'node':\n before.nodes = [{\n id: id,\n visible: true\n }];\n after.nodes = [{\n id: id,\n visible: false\n }];\n break;\n\n case 'edge':\n before.nodes = [{\n id: id,\n visible: true\n }];\n after.edges = [{\n id: id,\n visible: false\n }];\n break;\n\n case 'combo':\n before.nodes = [{\n id: id,\n visible: true\n }];\n after.combos = [{\n id: id,\n visible: false\n }];\n break;\n\n default:\n break;\n }\n\n this.pushStack('visible', {\n before: before,\n after: after\n });\n }\n };\n /**\n * 刷新元素\n * @param {string|object} item 元素id或元素实例\n */\n\n\n AbstractGraph.prototype.refreshItem = function (item) {\n var itemController = this.get('itemController');\n itemController.refreshItem(item);\n };\n /**\n * 设置是否在更新/刷新后自动重绘\n * @param {boolean} auto 自动重绘\n */\n\n\n AbstractGraph.prototype.setAutoPaint = function (auto) {\n var self = this;\n self.set('autoPaint', auto);\n var canvas = self.get('canvas');\n canvas.set('autoDraw', auto);\n };\n /**\n * 删除元素\n * @param {Item} item 元素id或元素实例\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n\n\n AbstractGraph.prototype.remove = function (item, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n this.removeItem(item, stack);\n };\n /**\n * 删除元素\n * @param {Item} item 元素id或元素实例\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n\n\n AbstractGraph.prototype.removeItem = function (item, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n var nodeItem = item;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) nodeItem = this.findById(item);\n\n if (!nodeItem && Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n console.warn(\"The item \".concat(item, \" to be removed does not exist!\"));\n } else if (nodeItem) {\n var type = '';\n if (nodeItem.getType) type = nodeItem.getType(); // 将删除的元素入栈\n\n if (stack && this.get('enabledStack')) {\n var deletedModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, nodeItem.getModel()), {\n itemType: type\n });\n\n var before = {};\n\n switch (type) {\n case 'node':\n {\n before.nodes = [deletedModel];\n before.edges = [];\n var edges = nodeItem.getEdges();\n\n for (var i = edges.length - 1; i >= 0; i--) {\n before.edges.push(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, edges[i].getModel()), {\n itemType: 'edge'\n }));\n }\n\n break;\n }\n\n case 'edge':\n before.edges = [deletedModel];\n break;\n\n case 'combo':\n before.combos = [deletedModel];\n break;\n\n default:\n break;\n }\n\n this.pushStack('delete', {\n before: before,\n after: {}\n });\n }\n\n if (type === 'node') {\n var model = nodeItem.getModel(); // 如果删除的是节点,且该节点存在于某个 Combo 中,则需要先将 node 从 combo 中移除,否则删除节点后,操作 combo 会出错\n\n if (model.comboId) {\n this.updateComboTree(nodeItem, undefined, false);\n }\n }\n\n var itemController = this.get('itemController');\n itemController.removeItem(nodeItem);\n\n if (type === 'combo') {\n var newComboTrees = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"reconstructTree\"])(this.get('comboTrees'));\n this.set('comboTrees', newComboTrees);\n }\n }\n };\n\n AbstractGraph.prototype.innerAddItem = function (type, model, itemController) {\n // 添加节点、边或combo之前,先验证数据是否符合规范\n if (!Object(_util_validation__WEBPACK_IMPORTED_MODULE_6__[\"singleDataValidation\"])(type, model)) {\n return false;\n }\n\n if (model.id && this.findById(model.id)) {\n console.warn(\"This item exists already. Be sure the id %c\".concat(model.id, \"%c is unique.\"), 'font-size: 20px; color: red;', '');\n return;\n }\n\n var item;\n var comboTrees = this.get('comboTrees') || [];\n\n if (type === 'combo') {\n var itemMap_1 = this.get('itemMap');\n var foundParent_1 = false;\n comboTrees.forEach(function (ctree) {\n if (foundParent_1) return; // terminate the forEach after the tree containing the item is done\n\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n // find the parent\n if (model.parentId === child.id) {\n foundParent_1 = true;\n\n var newCombo = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n id: model.id,\n depth: child.depth + 2\n }, model);\n\n if (child.children) child.children.push(newCombo);else child.children = [newCombo];\n model.depth = newCombo.depth;\n item = itemController.addItem(type, model);\n }\n\n var childItem = itemMap_1[child.id]; // after the parent is found, update all the ancestors\n\n if (foundParent_1 && childItem && childItem.getType && childItem.getType() === 'combo') {\n itemController.updateCombo(childItem, child.children);\n }\n\n return true;\n });\n }); // if the parent is not found, add it to the root\n\n if (!foundParent_1) {\n var newCombo = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n id: model.id,\n depth: 0\n }, model);\n\n model.depth = newCombo.depth;\n comboTrees.push(newCombo);\n item = itemController.addItem(type, model);\n }\n\n this.set('comboTrees', comboTrees);\n\n if (model.collapsed) {\n this.collapseCombo(item, false);\n this.updateCombo(item);\n }\n } else if (type === 'node' && Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(model.comboId) && comboTrees) {\n var parentCombo = this.findById(model.comboId);\n\n if (parentCombo && parentCombo.getType && parentCombo.getType() !== 'combo') {\n console.warn(\"'\".concat(model.comboId, \"' is not a id of a combo in the graph, the node will be added without combo.\"));\n }\n\n item = itemController.addItem(type, model);\n var itemMap_2 = this.get('itemMap');\n var foundParent_2 = false,\n foundNode_1 = false;\n comboTrees.forEach(function (ctree) {\n if (foundNode_1 || foundParent_2) return; // terminate the forEach\n\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n if (child.id === model.id) {\n // if the item exists in the tree already, terminate\n foundNode_1 = true;\n return false;\n }\n\n if (model.comboId === child.id && !foundNode_1) {\n // found the parent, add the item to the children of its parent in the tree\n foundParent_2 = true;\n var cloneNode = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(model);\n cloneNode.itemType = 'node';\n if (child.children) child.children.push(cloneNode);else child.children = [cloneNode];\n cloneNode.depth = child.depth + 1;\n } // update the size of all the ancestors\n\n\n if (foundParent_2 && itemMap_2[child.id].getType && itemMap_2[child.id].getType() === 'combo') {\n itemController.updateCombo(itemMap_2[child.id], child.children);\n }\n\n return true;\n });\n });\n } else {\n item = itemController.addItem(type, model);\n }\n\n if (type === 'node' && model.comboId || type === 'combo' && model.parentId) {\n // add the combo to the parent's children array\n var parentCombo = this.findById(model.comboId || model.parentId);\n if (parentCombo && parentCombo.getType && parentCombo.getType() === 'combo') parentCombo.addChild(item);\n }\n\n return item;\n };\n /**\n * 新增元素\n * @param {ITEM_TYPE} type 元素类型(node | edge)\n * @param {ModelConfig} model 元素数据模型\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n * @param {boolean} sortCombo 本次操作是否需要更新 combo 层级顺序,内部参数,用户在外部使用 addItem 时始终时需要更新\n * @return {Item} 元素实例\n */\n\n\n AbstractGraph.prototype.addItem = function (type, model, stack, sortCombo) {\n if (stack === void 0) {\n stack = true;\n }\n\n if (sortCombo === void 0) {\n sortCombo = true;\n }\n\n var currentComboSorted = this.get('comboSorted');\n this.set('comboSorted', currentComboSorted && !sortCombo);\n var itemController = this.get('itemController');\n var item = this.innerAddItem(type, model, itemController);\n\n if (item === false || item === true) {\n return item;\n }\n\n var combos = this.get('combos');\n\n if (combos && combos.length > 0) {\n this.sortCombos();\n }\n\n this.autoPaint();\n\n if (stack && this.get('enabledStack')) {\n var addedModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, item.getModel()), {\n itemType: type\n });\n\n var after = {};\n\n switch (type) {\n case 'node':\n after.nodes = [addedModel];\n break;\n\n case 'edge':\n after.edges = [addedModel];\n break;\n\n case 'combo':\n after.combos = [addedModel];\n break;\n\n default:\n break;\n }\n\n this.pushStack('add', {\n before: {},\n after: after\n });\n }\n\n return item;\n };\n\n AbstractGraph.prototype.addItems = function (items, stack, sortCombo) {\n if (items === void 0) {\n items = [];\n }\n\n if (stack === void 0) {\n stack = true;\n }\n\n if (sortCombo === void 0) {\n sortCombo = true;\n }\n\n var currentComboSorted = this.get('comboSorted');\n this.set('comboSorted', currentComboSorted && !sortCombo);\n var itemController = this.get('itemController');\n var returnItems = []; // 1. add anything that is not an edge.\n // Add undefined as a placeholder for the next cycle. This way we return items matching the input order\n\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n\n if (item.type !== 'edge' && item.type !== 'vedge') {\n returnItems.push(this.innerAddItem(item.type, item.model, itemController));\n } else {\n returnItems.push(undefined);\n }\n } // 2. add all the edges\n\n\n for (var i = 0; i < items.length; i++) {\n var item = items[i];\n\n if (item.type === 'edge' || item.type === 'vedge') {\n returnItems[i] = this.innerAddItem(item.type, item.model, itemController);\n }\n }\n\n if (sortCombo) {\n var combos = this.get('combos');\n\n if (combos && combos.length > 0) {\n this.sortCombos();\n }\n }\n\n this.autoPaint();\n\n if (stack && this.get('enabledStack')) {\n var after = {\n nodes: [],\n edges: [],\n combos: []\n };\n\n for (var i = 0; i < items.length; i++) {\n var type = items[i].type;\n var returnItem = returnItems[i];\n\n if (!!returnItem && returnItem !== true) {\n var addedModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, returnItem.getModel()), {\n itemType: type\n });\n\n switch (type) {\n case 'node':\n after.nodes.push(addedModel);\n break;\n\n case 'edge':\n after.edges.push(addedModel);\n break;\n\n case 'combo':\n after.combos.push(addedModel);\n break;\n\n default:\n break;\n }\n }\n }\n\n this.pushStack('addItems', {\n before: {},\n after: after\n });\n }\n\n return returnItems;\n };\n /**\n * 新增元素\n * @param {ITEM_TYPE} type 元素类型(node | edge)\n * @param {ModelConfig} model 元素数据模型\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n * @param {boolean} sortCombo 本次操作是否需要更新 combo 层级顺序,内部参数,用户在外部使用 addItem 时始终时需要更新\n * @return {Item} 元素实例\n */\n\n\n AbstractGraph.prototype.add = function (type, model, stack, sortCombo) {\n if (stack === void 0) {\n stack = true;\n }\n\n if (sortCombo === void 0) {\n sortCombo = true;\n }\n\n return this.addItem(type, model, stack, sortCombo);\n };\n /**\n * 更新元素\n * @param {Item} item 元素id或元素实例\n * @param {Partial | EdgeConfig} cfg 需要更新的数据\n */\n\n\n AbstractGraph.prototype.updateItem = function (item, cfg, stack) {\n var _this = this;\n\n if (stack === void 0) {\n stack = true;\n }\n\n var itemController = this.get('itemController');\n var currentItem;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n currentItem = this.findById(item);\n } else {\n currentItem = item;\n }\n\n var UnupdateModel = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(currentItem.getModel());\n var type = '';\n if (currentItem.getType) type = currentItem.getType();\n\n var states = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], currentItem.getStates(), true);\n\n if (type === 'combo') {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n return _this.setItemState(currentItem, state, false);\n });\n }\n\n itemController.updateItem(currentItem, cfg);\n\n if (type === 'combo') {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n return _this.setItemState(currentItem, state, true);\n });\n }\n\n if (stack && this.get('enabledStack')) {\n var before = {\n nodes: [],\n edges: [],\n combos: []\n };\n var after = {\n nodes: [],\n edges: [],\n combos: []\n };\n\n var afterModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n id: UnupdateModel.id\n }, cfg);\n\n switch (type) {\n case 'node':\n before.nodes.push(UnupdateModel);\n after.nodes.push(afterModel);\n break;\n\n case 'edge':\n before.edges.push(UnupdateModel);\n after.edges.push(afterModel);\n break;\n\n case 'combo':\n before.combos.push(UnupdateModel);\n after.combos.push(afterModel);\n break;\n\n default:\n break;\n }\n\n if (type === 'node') {\n before.nodes.push(UnupdateModel);\n }\n\n this.pushStack('update', {\n before: before,\n after: after\n });\n }\n };\n /**\n * 更新元素\n * @param {Item} item 元素id或元素实例\n * @param {Partial | EdgeConfig} cfg 需要更新的数据\n * @param {boolean} stack 本次操作是否入栈,默认为 true\n */\n\n\n AbstractGraph.prototype.update = function (item, cfg, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n this.updateItem(item, cfg, stack);\n };\n /**\n * 设置元素状态\n * @param {Item} item 元素id或元素实例\n * @param {string} state 状态名称\n * @param {string | boolean} value 是否启用状态 或 状态值\n */\n\n\n AbstractGraph.prototype.setItemState = function (item, state, value) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n item = this.findById(item);\n }\n\n var itemController = this.get('itemController');\n itemController.setItemState(item, state, value);\n var stateController = this.get('stateController');\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(value)) {\n stateController.updateState(item, \"\".concat(state, \":\").concat(value), true);\n } else {\n stateController.updateState(item, state, value);\n }\n };\n /**\n * 将指定状态的优先级提升为最高优先级\n * @param {Item} item 元素id或元素实例\n * @param state 状态名称\n */\n\n\n AbstractGraph.prototype.priorityState = function (item, state) {\n var itemController = this.get('itemController');\n itemController.priorityState(item, state);\n };\n /**\n * 设置视图初始化数据\n * @param {GraphData} data 初始化数据\n */\n\n\n AbstractGraph.prototype.data = function (data) {\n Object(_util_validation__WEBPACK_IMPORTED_MODULE_6__[\"dataValidation\"])(data);\n this.set('data', data);\n };\n /**\n * 根据data接口的数据渲染视图\n */\n\n\n AbstractGraph.prototype.render = function () {\n var self = this;\n this.set('comboSorted', false);\n var data = this.get('data');\n\n if (this.get('enabledStack')) {\n // render 之前清空 redo 和 undo 栈\n this.clearStack();\n }\n\n if (!data) {\n throw new Error('data must be defined first');\n }\n\n var _a = data.nodes,\n nodes = _a === void 0 ? [] : _a,\n _b = data.edges,\n edges = _b === void 0 ? [] : _b,\n _c = data.combos,\n combos = _c === void 0 ? [] : _c;\n this.clear(true);\n this.emit('beforerender');\n self.addItems(nodes.map(function (node) {\n return {\n type: 'node',\n model: node\n };\n }), false, false); // process the data to tree structure\n\n if ((combos === null || combos === void 0 ? void 0 : combos.length) !== 0) {\n var comboTrees = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"plainCombosToTrees\"])(combos, nodes);\n this.set('comboTrees', comboTrees); // add combos\n\n self.addCombos(combos);\n }\n\n self.addItems(edges.map(function (edge) {\n return {\n type: 'edge',\n model: edge\n };\n }), false, false);\n var animate = self.get('animate');\n\n if (self.get('fitView') || self.get('fitCenter')) {\n self.set('animate', false);\n } // layout\n\n\n var layoutController = self.get('layoutController');\n\n if (layoutController) {\n layoutController.layout(success);\n if (this.destroyed) return;\n } else {\n success();\n } // 将在 onLayoutEnd 中被调用\n\n\n function success() {\n // 自底向上将 collapsed 的 combo 合起\n (self.get('comboTrees') || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n var item = self.findById(child.id);\n\n if (item.getType() === 'combo' && child.collapsed) {\n self.collapseCombo(child.id, false);\n self.updateCombo(item);\n }\n\n return true;\n });\n }); // fitView 与 fitCenter 共存时,fitView 优先,fitCenter 不再执行\n\n if (self.get('fitView')) {\n self.fitView();\n } else if (self.get('fitCenter')) {\n self.fitCenter();\n }\n\n self.autoPaint();\n self.emit('afterrender');\n\n if (self.get('fitView') || self.get('fitCenter')) {\n self.set('animate', animate);\n }\n\n setTimeout(function () {\n var _a;\n\n (_a = self.getCombos()) === null || _a === void 0 ? void 0 : _a.forEach(function (combo) {\n combo.set('animate', true);\n });\n }, 0);\n }\n\n if (!this.get('groupByTypes')) {\n if (combos && combos.length !== 0) {\n this.sortCombos();\n } else {\n // 为提升性能,选择数量少的进行操作\n if (data.nodes && data.edges && data.nodes.length < data.edges.length) {\n var nodesArr = this.getNodes(); // 遍历节点实例,将所有节点提前。\n\n nodesArr.forEach(function (node) {\n node.toFront();\n });\n } else {\n var edgesArr = this.getEdges(); // 遍历节点实例,将所有节点提前。\n\n edgesArr.forEach(function (edge) {\n edge.toBack();\n });\n }\n }\n }\n\n if (this.get('enabledStack')) {\n this.pushStack('render');\n }\n };\n /**\n * 接收数据进行渲染\n * @Param {Object} data 初始化数据\n */\n\n\n AbstractGraph.prototype.read = function (data) {\n this.data(data);\n this.render();\n }; // 比较item\n\n\n AbstractGraph.prototype.diffItems = function (type, items, models) {\n var self = this;\n var item;\n var itemMap = this.get('itemMap');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(models, function (model) {\n item = itemMap[model.id];\n\n if (item) {\n if (self.get('animate') && type === NODE) {\n var containerMatrix = item.getContainer().getMatrix();\n if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n item.set('originAttrs', {\n x: containerMatrix[6],\n y: containerMatrix[7]\n });\n }\n\n self.updateItem(item, model, false);\n } else {\n item = self.addItem(type, model, false);\n }\n\n if (item) items[\"\".concat(type, \"s\")].push(item);\n });\n };\n /**\n * 更改源数据,根据新数据重新渲染视图\n * @param {GraphData | TreeGraphData} data 源数据\n * @param {boolean} 是否入栈,默认为true\n * @return {object} this\n */\n\n\n AbstractGraph.prototype.changeData = function (propsData, stack) {\n var _this = this;\n\n var _a;\n\n if (stack === void 0) {\n stack = true;\n }\n\n var self = this;\n var data = propsData || self.get('data');\n\n if (!Object(_util_validation__WEBPACK_IMPORTED_MODULE_6__[\"dataValidation\"])(data)) {\n return this;\n }\n\n this.emit('beforechangedata');\n\n if (stack && this.get('enabledStack')) {\n this.pushStack('changedata', {\n before: self.save(),\n after: data\n });\n }\n\n this.set('comboSorted', false); // 删除 hulls\n\n this.removeHulls(); // 更改数据源后,取消所有状态\n\n this.getNodes().map(function (node) {\n return self.clearItemStates(node);\n });\n this.getEdges().map(function (edge) {\n return self.clearItemStates(edge);\n });\n var canvas = this.get('canvas');\n var localRefresh = canvas.get('localRefresh');\n canvas.set('localRefresh', false);\n\n if (!self.get('data')) {\n self.data(data);\n self.render();\n }\n\n var itemMap = this.get('itemMap');\n var items = {\n nodes: [],\n edges: []\n };\n var combosData = data.combos;\n\n if (combosData) {\n var comboTrees = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"plainCombosToTrees\"])(combosData, data.nodes);\n this.set('comboTrees', comboTrees);\n } else {\n this.set('comboTrees', []);\n }\n\n this.diffItems('node', items, data.nodes);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(itemMap, function (item, id) {\n itemMap[id].getModel().depth = 0;\n if (item.getType && item.getType() === 'edge') return;\n\n if (item.getType && item.getType() === 'combo') {\n delete itemMap[id];\n item.destroy();\n } else if (items.nodes.indexOf(item) < 0) {\n delete itemMap[id];\n self.remove(item, false);\n }\n }); // clear the destroyed combos here to avoid removing sub nodes before removing the parent combo\n\n var comboItems = this.getCombos();\n var combosLength = comboItems.length;\n\n for (var i = combosLength - 1; i >= 0; i--) {\n if (comboItems[i].destroyed) {\n comboItems.splice(i, 1);\n }\n } // process the data to tree structure\n\n\n if (combosData) {\n // add combos\n self.addCombos(combosData);\n\n if (!this.get('groupByTypes')) {\n this.sortCombos();\n }\n }\n\n this.diffItems('edge', items, data.edges);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(itemMap, function (item, id) {\n if (item.getType && (item.getType() === 'node' || item.getType() === 'combo')) return;\n\n if (items.edges.indexOf(item) < 0) {\n delete itemMap[id];\n self.remove(item, false);\n }\n }); // 自底向上将 collapsed 的 combo 合起\n\n (this.get('comboTrees') || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n var item = _this.findById(child.id);\n\n if (item.getType() === 'combo' && child.collapsed) {\n _this.collapseCombo(child.id, false);\n }\n\n return true;\n });\n });\n this.set({\n nodes: items.nodes,\n edges: items.edges\n });\n var layoutController = this.get('layoutController');\n\n if (layoutController) {\n layoutController.changeData(function () {\n setTimeout(function () {\n var _a;\n\n (_a = self.getCombos()) === null || _a === void 0 ? void 0 : _a.forEach(function (combo) {\n combo.set('animate', true);\n });\n }, 0);\n });\n\n if (self.get('animate') && !layoutController.getLayoutType()) {\n // 如果没有指定布局\n self.positionsAnimate();\n (_a = self.getCombos()) === null || _a === void 0 ? void 0 : _a.forEach(function (combo) {\n return combo.set('animate', true);\n });\n } else {\n self.autoPaint();\n }\n }\n\n setTimeout(function () {\n canvas.set('localRefresh', localRefresh);\n }, 16);\n this.emit('afterchangedata');\n return this;\n };\n /**\n * 私有方法,在 render 和 changeData 的时候批量添加数据中所有平铺的 combos\n * @param {ComboConfig[]} combos 平铺的 combos 数据\n */\n\n\n AbstractGraph.prototype.addCombos = function (combos) {\n var self = this;\n var comboTrees = self.get('comboTrees');\n var itemController = this.get('itemController');\n itemController.addCombos(comboTrees, combos);\n };\n /**\n * 根据已经存在的节点或 combo 创建新的 combo\n * @param combo combo ID 或 Combo 配置\n * @param children 添加到 Combo 中的元素,包括节点和 combo\n */\n\n\n AbstractGraph.prototype.createCombo = function (combo, children) {\n var _this = this;\n\n this.set('comboSorted', false); // step 1: 创建新的 Combo\n\n var comboId = '';\n var comboConfig;\n if (!combo) return;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n comboId = combo;\n comboConfig = {\n id: combo\n };\n } else {\n comboId = combo.id;\n\n if (!comboId) {\n console.warn('Create combo failed. Please assign a unique string id for the adding combo.');\n return;\n }\n\n comboConfig = combo;\n } // step2: 更新 children,根据类型添加 comboId 或 parentId\n\n\n var trees = children.map(function (elementId) {\n var item = _this.findById(elementId);\n\n var model = item.getModel();\n var type = '';\n if (item.getType) type = item.getType();\n var cItem = {\n id: item.getID(),\n itemType: type\n };\n\n if (type === 'combo') {\n cItem.parentId = comboId;\n model.parentId = comboId;\n } else if (type === 'node') {\n cItem.comboId = comboId;\n model.comboId = comboId;\n }\n\n return cItem;\n });\n comboConfig.children = trees; // step 3: 添加 Combo,addItem 时会将子将元素添加到 Combo 中\n\n this.addItem('combo', comboConfig, false);\n this.set('comboSorted', false); // step4: 更新 comboTrees 结构\n\n var comboTrees = this.get('comboTrees');\n (comboTrees || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n if (child.id === comboId) {\n child.itemType = 'combo';\n child.children = trees;\n return false;\n }\n\n return true;\n });\n });\n\n if (comboTrees) {\n this.sortCombos();\n }\n };\n /**\n * 解散 combo\n * @param {String | INode | ICombo} combo 需要被解散的 Combo item 或 id\n */\n\n\n AbstractGraph.prototype.uncombo = function (combo) {\n var _this = this;\n\n var _a;\n\n var self = this;\n var comboItem = combo;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n comboItem = this.findById(combo);\n }\n\n if (!comboItem || comboItem.getType && comboItem.getType() !== 'combo') {\n console.warn('The item is not a combo!');\n return;\n }\n\n var parentId = comboItem.getModel().parentId;\n var comboTrees = self.get('comboTrees');\n if (!comboTrees) comboTrees = [];\n var itemMap = this.get('itemMap');\n var comboId = comboItem.get('id');\n var treeToBeUncombo;\n var brothers = [];\n var comboItems = this.get('combos');\n var parentItem = this.findById(parentId);\n comboTrees.forEach(function (ctree) {\n if (treeToBeUncombo) return; // terminate the forEach\n\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (subtree) {\n var _a; // find the combo to be uncomboed, delete the combo from map and cache\n\n\n if (subtree.id === comboId) {\n treeToBeUncombo = subtree; // delete the related edges\n\n var edgeIds = comboItem.getEdges().map(function (edge) {\n return edge.getID();\n });\n edgeIds.forEach(function (edgeId) {\n _this.removeItem(edgeId, false);\n });\n var index = comboItems.indexOf(comboItem);\n comboItems.splice(index, 1);\n delete itemMap[comboId];\n comboItem.destroy();\n\n _this.emit('afterremoveitem', {\n item: comboItem,\n type: 'combo'\n });\n } // 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\n\n\n if (parentId && treeToBeUncombo && subtree.id === parentId) {\n parentItem.removeCombo(comboItem);\n brothers = subtree.children; // the combo's brothers\n // remove the combo from its brothers array\n\n var index = brothers.indexOf(treeToBeUncombo);\n\n if (index !== -1) {\n brothers.splice(index, 1);\n } // append the combo's children to the combo's brothers array\n\n\n (_a = treeToBeUncombo.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n var item = _this.findById(child.id);\n\n var childModel = item.getModel();\n\n if (item.getType && item.getType() === 'combo') {\n child.parentId = parentId;\n delete child.comboId;\n childModel.parentId = parentId; // update the parentId of the model\n\n delete childModel.comboId;\n } else if (item.getType && item.getType() === 'node') {\n child.comboId = parentId;\n childModel.comboId = parentId; // update the parentId of the model\n }\n\n parentItem.addChild(item);\n brothers.push(child);\n });\n return false;\n }\n\n return true;\n });\n }); // if the parentId is not found, remove the combo from the roots\n\n if (!parentId && treeToBeUncombo) {\n var index = comboTrees.indexOf(treeToBeUncombo);\n comboTrees.splice(index, 1); // modify the parentId of the children\n\n (_a = treeToBeUncombo.children) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n child.parentId = undefined;\n\n var childModel = _this.findById(child.id).getModel();\n\n delete childModel.parentId; // update the parentId of the model\n\n delete childModel.comboId; // update the comboId of the model\n\n if (child.itemType !== 'node') comboTrees.push(child);\n });\n }\n };\n /**\n * 根据 combo 位置更新内部节点位置 followCombo = true\n * 或根据内部元素的 bbox 更新所有 combos 的绘制,包括 combos 的位置和范围,followCombo = false\n */\n\n\n AbstractGraph.prototype.updateCombos = function (followCombo) {\n var _this = this;\n\n if (followCombo === void 0) {\n followCombo = false;\n }\n\n var self = this;\n var comboTrees = this.get('comboTrees');\n var itemController = self.get('itemController');\n var itemMap = self.get('itemMap');\n (comboTrees || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n var _a;\n\n if (!child) {\n return true;\n }\n\n var childItem = itemMap[child.id];\n\n if (((_a = childItem === null || childItem === void 0 ? void 0 : childItem.getType) === null || _a === void 0 ? void 0 : _a.call(childItem)) === 'combo') {\n // 更新具体的 Combo 之前先清除所有的已有状态,以免将 state 中的样式更新为 Combo 的样式\n var states = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], childItem.getStates(), true);\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n return _this.setItemState(childItem, state, false);\n }); // 更新具体的 Combo\n\n itemController.updateCombo(childItem, child.children, followCombo); // 更新 Combo 后,还原已有的状态\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n return _this.setItemState(childItem, state, true);\n });\n }\n\n return true;\n });\n });\n self.sortCombos();\n };\n /**\n * 根据节点的 bbox 更新 combo 及其祖先 combos 的绘制,包括 combos 的位置和范围\n * @param {String | ICombo} combo 需要被更新的 Combo 或 id,若指定,则该 Combo 及所有祖先 Combod 都会被更新\n */\n\n\n AbstractGraph.prototype.updateCombo = function (combo) {\n var _this = this;\n\n var self = this;\n var comboItem = combo;\n var comboId;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n comboItem = this.findById(combo);\n }\n\n if (!comboItem || comboItem.getType && comboItem.getType() !== 'combo') {\n console.warn('The item to be updated is not a combo!');\n return;\n }\n\n comboId = comboItem.get('id');\n var comboTrees = this.get('comboTrees');\n var itemController = self.get('itemController');\n var itemMap = self.get('itemMap');\n (comboTrees || []).forEach(function (ctree) {\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTreeUp\"])(ctree, function (child) {\n if (!child) {\n return true;\n }\n\n var childItem = itemMap[child.id];\n\n if (comboId === child.id && childItem && childItem.getType && childItem.getType() === 'combo') {\n // 更新具体的 Combo 之前先清除所有的已有状态,以免将 state 中的样式更新为 Combo 的样式\n var states = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], childItem.getStates(), true); // || !item.getStateStyle(stateName)\n\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n if (childItem.getStateStyle(state)) {\n _this.setItemState(childItem, state, false);\n }\n }); // 更新具体的 Combo\n\n itemController.updateCombo(childItem, child.children); // 更新 Combo 后,还原已有的状态\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(states, function (state) {\n if (childItem.getStateStyle(state)) {\n _this.setItemState(childItem, state, true);\n }\n });\n if (comboId) comboId = child.parentId;\n }\n\n return true;\n });\n });\n };\n /**\n * 更新树结构,例如移动子树等\n * @param {String | INode | ICombo} item 需要被更新的 Combo 或 节点 id\n * @param {string | undefined} parentId 新的父 combo id,undefined 代表没有父 combo\n */\n\n\n AbstractGraph.prototype.updateComboTree = function (item, parentId, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n var self = this;\n this.set('comboSorted', false);\n var uItem;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(item)) {\n uItem = self.findById(item);\n } else {\n uItem = item;\n }\n\n var model = uItem.getModel();\n var oldParentId = model.comboId || model.parentId;\n var type = '';\n if (uItem.getType) type = uItem.getType(); // 若 item 是 Combo,且 parentId 是其子孙 combo 的 id,则警告并终止\n\n if (parentId && type === 'combo') {\n var comboTrees = this.get('comboTrees');\n var valid_1 = true;\n var itemSubTree_1;\n (comboTrees || []).forEach(function (ctree) {\n if (itemSubTree_1) return;\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(ctree, function (subTree) {\n if (itemSubTree_1) return; // 找到从 item 开始的子树\n\n if (subTree.id === uItem.getID()) {\n itemSubTree_1 = subTree;\n }\n\n return true;\n });\n }); // 在以 item 为根的子树中寻找与 parentId 相同的后继元素\n\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(itemSubTree_1, function (subTree) {\n if (subTree.id === parentId) {\n valid_1 = false;\n return false;\n }\n\n return true;\n }); // parentId 是 item 的一个后继元素,不能进行更新\n\n if (!valid_1) {\n console.warn('Failed to update the combo tree! The parentId points to a descendant of the combo!');\n return;\n }\n }\n\n if (stack && this.get('enabledStack')) {\n var beforeData = {},\n afterData = {};\n\n if (type === 'combo') {\n beforeData.combos = [{\n id: model.id,\n parentId: model.parentId\n }];\n afterData.combos = [{\n id: model.id,\n parentId: parentId\n }];\n } else if (type === 'node') {\n beforeData.nodes = [{\n id: model.id,\n parentId: model.comboId\n }];\n afterData.nodes = [{\n id: model.id,\n parentId: parentId\n }];\n }\n\n this.pushStack('updateComboTree', {\n before: beforeData,\n after: afterData\n });\n } // 当 combo 存在 parentId 或 comboId 时,才将其移除\n\n\n if (model.parentId || model.comboId) {\n var combo = this.findById(model.parentId || model.comboId);\n\n if (combo) {\n combo.removeChild(uItem);\n }\n }\n\n if (type === 'combo') {\n model.parentId = parentId;\n } else if (type === 'node') {\n model.comboId = parentId;\n } // 只有当移入到指定 combo 时才添加\n\n\n if (parentId) {\n var parentCombo = this.findById(parentId);\n\n if (parentCombo) {\n // 将元素添加到 parentCombo 中\n parentCombo.addChild(uItem);\n }\n } // 如果原先有父亲 combo,则从原父 combo 的子元素数组中删除\n\n\n if (oldParentId) {\n var parentCombo = this.findById(oldParentId);\n\n if (parentCombo) {\n // 将元素从 parentCombo 中移除\n parentCombo.removeChild(uItem);\n }\n }\n\n var newComboTrees = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"reconstructTree\"])(this.get('comboTrees'), model.id, parentId);\n this.set('comboTrees', newComboTrees);\n this.updateCombos();\n };\n /**\n * 导出图数据\n * @return {object} data\n */\n\n\n AbstractGraph.prototype.save = function () {\n var nodes = [];\n var edges = [];\n var combos = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(this.get('nodes'), function (node) {\n nodes.push(node.getModel());\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(this.get('edges'), function (edge) {\n edges.push(edge.getModel());\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(this.get('combos'), function (combo) {\n combos.push(combo.getModel());\n });\n return {\n nodes: nodes,\n edges: edges,\n combos: combos\n };\n };\n /**\n * 改变画布大小\n * @param {number} width 画布宽度\n * @param {number} height 画布高度\n * @return {object} this\n */\n\n\n AbstractGraph.prototype.changeSize = function (width, height) {\n var viewController = this.get('viewController');\n viewController.changeSize(width, height);\n return this;\n };\n /**\n * 当源数据在外部发生变更时,根据新数据刷新视图。但是不刷新节点位置\n */\n\n\n AbstractGraph.prototype.refresh = function () {\n var self = this;\n self.emit('beforegraphrefresh');\n\n if (self.get('animate')) {\n self.positionsAnimate();\n } else {\n var nodes = self.get('nodes');\n var edges = self.get('edges');\n var vedges = self.get('edges');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(nodes, function (node) {\n node.refresh();\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(edges, function (edge) {\n edge.refresh();\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(vedges, function (vedge) {\n vedge.refresh();\n });\n }\n\n self.emit('aftergraphrefresh');\n self.autoPaint();\n };\n /**\n * 获取当前图中所有节点的item实例\n * @return {INode} item数组\n */\n\n\n AbstractGraph.prototype.getNodes = function () {\n return this.get('nodes');\n };\n /**\n * 获取当前图中所有边的item实例\n * @return {IEdge} item数组\n */\n\n\n AbstractGraph.prototype.getEdges = function () {\n return this.get('edges');\n };\n /**\n * 获取图中所有的 combo 实例\n */\n\n\n AbstractGraph.prototype.getCombos = function () {\n return this.get('combos');\n };\n /**\n * 获取指定 Combo 中所有的节点\n * @param comboId combo ID\n */\n\n\n AbstractGraph.prototype.getComboChildren = function (combo) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n combo = this.findById(combo);\n }\n\n if (!combo || combo.getType && combo.getType() !== 'combo') {\n console.warn('The combo does not exist!');\n return;\n }\n\n return combo.getChildren();\n };\n /**\n * 根据 graph 上的 animateCfg 进行视图中节点位置动画接口\n */\n\n\n AbstractGraph.prototype.positionsAnimate = function (referComboModel) {\n var self = this;\n self.emit('beforeanimate');\n var animateCfg = self.get('animateCfg');\n var onFrame = animateCfg.onFrame;\n var nodes = referComboModel ? self.getNodes().concat(self.getCombos()) : self.getNodes();\n var toNodes = nodes.map(function (node) {\n var model = node.getModel();\n return {\n id: model.id,\n x: model.x,\n y: model.y\n };\n });\n self.stopAnimate();\n var canvas = self.get('canvas');\n self.animating = true;\n canvas.animate(function (ratio) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(toNodes, function (data) {\n var node = self.findById(data.id);\n\n if (!node || node.destroyed) {\n return;\n }\n\n var originAttrs = node.get('originAttrs');\n var model = node.get('model');\n var containerMatrix = node.getContainer().getMatrix();\n\n if (originAttrs === undefined || originAttrs === null) {\n // 变换前存在位置,设置到 originAttrs 上。否则标记 0 表示变换前不存在位置,不需要计算动画\n if (containerMatrix) {\n originAttrs = {\n x: containerMatrix[6],\n y: containerMatrix[7]\n };\n }\n\n node.set('originAttrs', originAttrs || 0);\n }\n\n if (onFrame) {\n var attrs = onFrame(node, ratio, data, originAttrs || {\n x: 0,\n y: 0\n });\n node.set('model', Object.assign(model, attrs));\n } else if (originAttrs) {\n // 变换前存在位置,进行动画\n model.x = originAttrs.x + (data.x - originAttrs.x) * ratio;\n model.y = originAttrs.y + (data.y - originAttrs.y) * ratio;\n } else {\n // 若在变换前不存在位置信息,则直接放到最终位置上\n model.x = data.x;\n model.y = data.y;\n }\n });\n self.refreshPositions(referComboModel);\n }, {\n duration: animateCfg.duration,\n easing: animateCfg.easing,\n callback: function callback() {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(nodes, function (node) {\n node.set('originAttrs', null);\n });\n\n if (animateCfg.callback) {\n animateCfg.callback();\n }\n\n self.emit('afteranimate');\n self.animating = false;\n }\n });\n };\n /**\n * 当节点位置在外部发生改变时,刷新所有节点位置,重计算边\n */\n\n\n AbstractGraph.prototype.refreshPositions = function (referComboModel) {\n var self = this;\n self.emit('beforegraphrefreshposition');\n var nodes = self.get('nodes');\n var edges = self.get('edges');\n var vedges = self.get('vedges');\n var combos = self.get('combos');\n var model;\n var updatedNodes = {};\n\n var updateItems = function updateItems(items) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(items, function (item) {\n model = item.getModel();\n var originAttrs = item.get('originAttrs');\n\n if (originAttrs && model.x === originAttrs.x && model.y === originAttrs.y) {\n return;\n }\n\n var changed = item.updatePosition({\n x: model.x,\n y: model.y\n });\n updatedNodes[model.id] = changed;\n if (model.comboId) updatedNodes[model.comboId] = updatedNodes[model.comboId] || changed;\n });\n };\n\n updateItems(nodes);\n\n if (combos && combos.length !== 0) {\n if (referComboModel) {\n updateItems(combos);\n self.updateCombos();\n } else {\n self.updateCombos();\n }\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(edges, function (edge) {\n var sourceModel = edge.getSource().getModel();\n var target = edge.getTarget(); // 避免 target 是纯对象的情况下调用 getModel 方法\n // 拖动生成边的时候 target 会是纯对象\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"])(target)) {\n var targetModel = target.getModel();\n\n if (updatedNodes[sourceModel.id] || updatedNodes[targetModel.id] || edge.getModel().isComboEdge) {\n edge.refresh();\n }\n }\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"each\"])(vedges, function (vedge) {\n vedge.refresh();\n });\n self.emit('aftergraphrefreshposition');\n self.autoPaint();\n };\n\n AbstractGraph.prototype.stopAnimate = function () {\n if (this.isAnimating()) {\n this.get('canvas').stopAnimate();\n }\n };\n\n AbstractGraph.prototype.isAnimating = function () {\n return this.animating;\n };\n /**\n * 获取当前视口伸缩比例\n * @return {number} 比例\n */\n\n\n AbstractGraph.prototype.getZoom = function () {\n var matrix = this.get('group').getMatrix();\n return matrix ? matrix[0] : 1;\n };\n /**\n * 获取当前的行为模式\n * @return {string} 当前行为模式\n */\n\n\n AbstractGraph.prototype.getCurrentMode = function () {\n var modeController = this.get('modeController');\n return modeController.getMode();\n };\n /**\n * 切换行为模式\n * @param {string} mode 指定模式\n * @return {object} this\n */\n\n\n AbstractGraph.prototype.setMode = function (mode) {\n var modeController = this.get('modeController');\n modeController.setMode(mode);\n return this;\n };\n /**\n * 清除画布元素\n * @return {object} this\n */\n\n\n AbstractGraph.prototype.clear = function (avoidEmit) {\n var _a;\n\n if (avoidEmit === void 0) {\n avoidEmit = false;\n }\n\n (_a = this.get('canvas')) === null || _a === void 0 ? void 0 : _a.clear();\n this.initGroups(); // 清空画布时同时清除数据\n\n this.set({\n itemMap: {},\n nodes: [],\n edges: [],\n vedges: [],\n groups: [],\n combos: [],\n comboTrees: []\n });\n if (!avoidEmit) this.emit('afterrender');\n return this;\n };\n /**\n * 更换布局配置项\n * @param {object} cfg 新布局配置项\n * @param {'center' | 'begin'} align 对齐方式,可选中心(center)对齐到对齐点,或左上角(begin)对齐到对齐点\n * @param {IPoint} alignPoint 画布上的对齐点,为 Canvas 坐标系(Canvas DOM)\n * 若 cfg 含有 type 字段或为 String 类型,且与现有布局方法不同,则更换布局\n * 若 cfg 不包括 type ,则保持原有布局方法,仅更新布局配置项\n */\n\n\n AbstractGraph.prototype.updateLayout = function (cfg, align, alignPoint, stack) {\n var _this = this;\n\n if (cfg === void 0) {\n cfg = {};\n }\n\n if (stack === void 0) {\n stack = true;\n }\n\n var layoutController = this.get('layoutController');\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(cfg)) {\n cfg = {\n type: cfg\n };\n } // align the graph after layout\n\n\n if (align) {\n var toPoint_1 = alignPoint;\n\n if (!toPoint_1) {\n if (align === 'begin') toPoint_1 = {\n x: 0,\n y: 0\n };else toPoint_1 = {\n x: this.getWidth() / 2,\n y: this.getHeight() / 2\n };\n } // translate to point coordinate system\n\n\n toPoint_1 = this.getPointByCanvas(toPoint_1.x, toPoint_1.y);\n var forceTypes = ['force', 'gForce', 'fruchterman', 'force2']; // if it is force layout, only center takes effect, and assign center force\n\n if (forceTypes.includes(cfg.type) || !cfg.type && forceTypes.includes(layoutController === null || layoutController === void 0 ? void 0 : layoutController.layoutType)) {\n cfg.center = [toPoint_1.x, toPoint_1.y];\n } else {\n this.once('afterlayout', function (e) {\n var matrix = _this.getGroup().getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n toPoint_1.x = toPoint_1.x * matrix[0] + matrix[6];\n toPoint_1.y = toPoint_1.y * matrix[0] + matrix[7];\n\n var _a = _this.getGroup().getCanvasBBox(),\n minX = _a.minX,\n maxX = _a.maxX,\n minY = _a.minY,\n maxY = _a.maxY;\n\n var bboxPoint = {\n x: (minX + maxX) / 2,\n y: (minY + maxY) / 2\n };\n\n if (align === 'begin') {\n bboxPoint.x = minX;\n bboxPoint.y = minY;\n }\n\n _this.translate(toPoint_1.x - bboxPoint.x, toPoint_1.y - bboxPoint.y);\n });\n }\n }\n\n var oriLayoutCfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, this.get('layout'));\n\n var layoutCfg = {};\n Object.assign(layoutCfg, oriLayoutCfg, cfg);\n if (cfg.pipes && !cfg.type) delete layoutCfg.type;else if (!cfg.pipes && layoutCfg.type) delete layoutCfg.pipes;\n this.set('layout', layoutCfg);\n if (!layoutController) return;\n\n if (layoutController.isLayoutTypeSame(layoutCfg) && layoutCfg.gpuEnabled === oriLayoutCfg.gpuEnabled) {\n // no type or same type, or switch the gpu and cpu, update layout\n layoutController.updateLayoutCfg(layoutCfg);\n } else {\n // has different type, change layout\n layoutController.changeLayout(layoutCfg);\n }\n\n if (stack && this.get('enabledStack')) {\n this.pushStack('layout', {\n before: oriLayoutCfg,\n after: layoutCfg\n });\n }\n };\n /**\n * 销毁布局,changeData 时不会再使用原来的布局方法对新数据进行布局\n */\n\n\n AbstractGraph.prototype.destroyLayout = function () {\n var layoutController = this.get('layoutController');\n layoutController === null || layoutController === void 0 ? void 0 : layoutController.destroyLayout();\n };\n /**\n * 重新以当前示例中配置的属性进行一次布局\n */\n\n\n AbstractGraph.prototype.layout = function () {\n var _a;\n\n var layoutController = this.get('layoutController');\n var layoutCfg = this.get('layout');\n if (!layoutCfg || !layoutController) return;\n\n if (layoutCfg.workerEnabled) {\n // 如果使用web worker布局\n layoutController.layout();\n return;\n }\n\n if ((_a = layoutController.layoutMethods) === null || _a === void 0 ? void 0 : _a.length) {\n layoutController.relayout(true);\n } else {\n layoutController.layout();\n }\n };\n /**\n * 收起指定的 combo\n * @param {string | ICombo} combo combo ID 或 combo item\n */\n\n\n AbstractGraph.prototype.collapseCombo = function (combo, stack) {\n var _this = this;\n\n if (stack === void 0) {\n stack = true;\n }\n\n if (this.destroyed) return;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n combo = this.findById(combo);\n }\n\n if (!combo) {\n console.warn('The combo to be collapsed does not exist!');\n return;\n }\n\n this.emit('beforecollapseexpandcombo', {\n action: 'expand',\n item: combo\n });\n var comboModel = combo.getModel();\n var itemController = this.get('itemController');\n itemController.collapseCombo(combo, stack);\n comboModel.collapsed = true; // add virtual edges\n\n var edges = this.getEdges().concat(this.get('vedges')); // find all the descendant nodes and combos\n\n var cNodesCombos = [];\n var comboTrees = this.get('comboTrees');\n var found = false;\n (comboTrees || []).forEach(function (ctree) {\n if (found) return; // if the combo is found, terminate the forEach\n\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(ctree, function (subTree) {\n // if the combo is found and it is traversing the other branches, terminate\n if (found && subTree.depth <= comboModel.depth) return false; // if the combo is found\n\n if (comboModel.id === subTree.id) found = true;\n\n if (found) {\n // if the combo is found, concat the descendant nodes and combos\n var item = _this.findById(subTree.id);\n\n if (item && item.getType && item.getType() === 'combo') {\n cNodesCombos = cNodesCombos.concat(item.getNodes());\n cNodesCombos = cNodesCombos.concat(item.getCombos());\n }\n }\n\n return true;\n });\n });\n var addedVEdgeMap = {};\n edges.forEach(function (edge) {\n var _a = edge.getModel(),\n isVEdge = _a.isVEdge,\n _b = _a.size,\n size = _b === void 0 ? 1 : _b;\n\n if (edge.isVisible() && !isVEdge) return;\n var source = edge.getSource();\n var target = edge.getTarget();\n var otherEnd = null;\n var otherEndIsSource;\n\n if (source.getModel().id === comboModel.id || cNodesCombos.includes(source) && !cNodesCombos.includes(target)) {\n // source is the current combo, or descent node/combo is the source but not the target)\n otherEnd = target;\n otherEndIsSource = false;\n } else if (target.getModel().id === comboModel.id || !cNodesCombos.includes(source) && cNodesCombos.includes(target)) {\n // target is the current combo, or descent node/combo is the target but not the source)\n otherEnd = source;\n otherEndIsSource = true;\n }\n\n if (otherEnd) {\n if (isVEdge) {\n _this.removeItem(edge, false);\n\n return;\n }\n\n var otherEndModel = otherEnd.getModel();\n\n while (!otherEnd.isVisible()) {\n var otherEndPId = otherEndModel.parentId,\n otherEndCId = otherEndModel.comboId;\n var otherEndParentId = otherEndPId || otherEndCId;\n otherEnd = _this.findById(otherEndParentId);\n if (!otherEnd || !otherEndParentId) return; // all the ancestors are hidden, then ignore the edge\n\n otherEndModel = otherEnd.getModel();\n }\n\n var otherEndId = otherEndModel.id;\n var vEdgeInfo = otherEndIsSource ? {\n source: otherEndId,\n target: comboModel.id,\n size: size,\n isVEdge: true\n } : {\n source: comboModel.id,\n target: otherEndId,\n size: size,\n isVEdge: true\n };\n var key = \"\".concat(vEdgeInfo.source, \"-\").concat(vEdgeInfo.target);\n\n if (addedVEdgeMap[key]) {\n addedVEdgeMap[key].size += size;\n return;\n }\n\n addedVEdgeMap[key] = vEdgeInfo;\n }\n }); // update the width of the virtual edges, which is the sum of merged actual edges\n // be attention that the actual edges with same endpoints but different directions will be represented by two different virtual edges\n\n this.addItems(Object.values(addedVEdgeMap).map(function (edgeInfo) {\n return {\n type: 'vedge',\n model: edgeInfo\n };\n }), false);\n this.emit('aftercollapseexpandcombo', {\n action: 'collapse',\n item: combo\n });\n };\n /**\n * 展开指定的 combo\n * @param {string | ICombo} combo combo ID 或 combo item\n */\n\n\n AbstractGraph.prototype.expandCombo = function (combo, stack) {\n var _this = this;\n\n if (stack === void 0) {\n stack = true;\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n combo = this.findById(combo);\n }\n\n if (!combo || combo.getType && combo.getType() !== 'combo') {\n console.warn('The combo to be collapsed does not exist!');\n return;\n }\n\n this.emit('beforecollapseexpandcombo', {\n action: 'expand',\n item: combo\n });\n var comboModel = combo.getModel();\n var itemController = this.get('itemController');\n itemController.expandCombo(combo, stack);\n comboModel.collapsed = false; // add virtual edges\n\n var edges = this.getEdges().concat(this.get('vedges')); // find all the descendant nodes and combos\n\n var cNodesCombos = [];\n var comboTrees = this.get('comboTrees');\n var found = false;\n (comboTrees || []).forEach(function (ctree) {\n if (found) return; // if the combo is found, terminate\n\n Object(_util_graphic__WEBPACK_IMPORTED_MODULE_9__[\"traverseTree\"])(ctree, function (subTree) {\n // if the combo is found and it is traversing the other branches, terminate\n if (found && subTree.depth <= comboModel.depth) return false;\n if (comboModel.id === subTree.id) found = true;\n\n if (found) {\n var item = _this.findById(subTree.id);\n\n if (item && item.getType && item.getType() === 'combo') {\n cNodesCombos = cNodesCombos.concat(item.getNodes());\n cNodesCombos = cNodesCombos.concat(item.getCombos());\n }\n }\n\n return true;\n });\n });\n var addedVEdgeMap = {};\n edges.forEach(function (edge) {\n if (edge.isVisible() && !edge.getModel().isVEdge) return;\n var source = edge.getSource();\n var target = edge.getTarget();\n var sourceId = source.get('id');\n var targetId = target.get('id');\n var otherEnd = null;\n var otherEndIsSource;\n\n if (sourceId === comboModel.id || cNodesCombos.includes(source) && !cNodesCombos.includes(target)) {\n // the source is in the combo, the target is not\n otherEnd = target;\n otherEndIsSource = false;\n } else if (targetId === comboModel.id || !cNodesCombos.includes(source) && cNodesCombos.includes(target)) {\n // the target is in the combo, the source is not\n otherEnd = source;\n otherEndIsSource = true;\n } else if (cNodesCombos.includes(source) && cNodesCombos.includes(target)) {\n // both source and target are in the combo, if the target and source are both visible, show the edge\n if (source.isVisible() && target.isVisible()) {\n edge.show();\n }\n }\n\n if (otherEnd) {\n var _a = edge.getModel(),\n isVEdge = _a.isVEdge,\n _b = _a.size,\n size = _b === void 0 ? 1 : _b; // ignore the virtual edges\n\n\n if (isVEdge) {\n _this.removeItem(edge, false);\n\n return;\n }\n\n var otherEndModel = otherEnd.getModel(); // find the nearest visible ancestor\n\n while (!otherEnd.isVisible()) {\n var otherEndPId = otherEndModel.parentId,\n otherEndCId = otherEndModel.comboId;\n var otherEndParentId = otherEndPId || otherEndCId;\n otherEnd = _this.findById(otherEndParentId);\n\n if (!otherEnd || !otherEndParentId) {\n return; // if all the ancestors of the oppsite are all hidden, ignore the edge\n }\n\n otherEndModel = otherEnd.getModel();\n }\n\n var otherEndId = otherEndModel.id;\n var selfEnd = otherEndIsSource ? target : source;\n var selfEndModel = selfEnd.getModel(); // find the nearest visible ancestor\n\n while (!selfEnd.isVisible()) {\n var selfEndPId = selfEndModel.parentId,\n selfEndCId = selfEndModel.comboId;\n var selfEndParentId = selfEndPId || selfEndCId;\n selfEnd = _this.findById(selfEndParentId);\n\n if (!selfEnd || !selfEndParentId) {\n return; // if all the ancestors of the oppsite are all hidden, ignore the edge\n }\n\n if (selfEndModel.comboId === comboModel.id || selfEndModel.parentId === comboModel.id) {\n break; // if the next ancestor is the combo, break the while\n }\n\n selfEndModel = selfEnd.getModel();\n }\n\n var selfEndId = selfEndModel.id;\n\n if (otherEndId) {\n var vEdgeInfo = otherEndIsSource ? {\n source: otherEndId,\n target: selfEndId,\n isVEdge: true,\n size: size\n } : {\n source: selfEndId,\n target: otherEndId,\n isVEdge: true,\n size: size\n };\n var vedgeId = \"\".concat(vEdgeInfo.source, \"-\").concat(vEdgeInfo.target); // update the width of the virtual edges, which is the sum of merged actual edges\n // be attention that the actual edges with same endpoints but different directions will be represented by two different virtual edges\n\n if (addedVEdgeMap[vedgeId]) {\n addedVEdgeMap[vedgeId].size += size;\n return;\n }\n\n addedVEdgeMap[vedgeId] = vEdgeInfo;\n }\n }\n });\n this.addItems(Object.values(addedVEdgeMap).map(function (edgeInfo) {\n return {\n type: 'vedge',\n model: edgeInfo\n };\n }), false);\n this.emit('aftercollapseexpandcombo', {\n action: 'expand',\n item: combo\n });\n };\n\n AbstractGraph.prototype.collapseExpandCombo = function (combo, stack) {\n if (stack === void 0) {\n stack = true;\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(combo)) {\n combo = this.findById(combo);\n }\n\n if (!combo || combo.getType && combo.getType() !== 'combo') return;\n var comboModel = combo.getModel(); // if one ancestor combo of the combo is collapsed, it should not be collapsed or expanded\n\n var parentItem = this.findById(comboModel.parentId);\n\n while (parentItem) {\n var parentModel = parentItem.getModel();\n\n if (parentModel.collapsed) {\n console.warn(\"Fail to expand the combo since it's ancestor combo is collapsed.\");\n parentItem = undefined;\n return;\n }\n\n parentItem = this.findById(parentModel.parentId);\n }\n\n var collapsed = comboModel.collapsed; // 该群组已经处于收起状态,需要展开\n\n if (collapsed) {\n this.expandCombo(combo, stack);\n } else {\n this.collapseCombo(combo, stack);\n }\n\n this.updateCombo(combo);\n };\n /**\n * 获取节点所有的邻居节点\n *\n * @param {(string | INode)} node 节点 ID 或实例\n * @returns {INode[]}\n * @memberof IAbstractGraph\n */\n\n\n AbstractGraph.prototype.getNeighbors = function (node, type) {\n var item = node;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(node)) {\n item = this.findById(node);\n }\n\n return item.getNeighbors(type);\n };\n /**\n * 获取 node 的度数\n *\n * @param {(string | INode)} node 节点 ID 或实例\n * @param {('in' | 'out' | 'total' | 'all' | undefined)} 度数类型,in 入度,out 出度,total 总度数,all 返回三种类型度数的对象\n * @returns {Number | Object} 该节点的度数\n * @memberof IAbstractGraph\n */\n\n\n AbstractGraph.prototype.getNodeDegree = function (node, type, refresh) {\n if (type === void 0) {\n type = undefined;\n }\n\n if (refresh === void 0) {\n refresh = false;\n }\n\n var item = node;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(node)) {\n item = this.findById(node);\n }\n\n var degrees = this.get('degrees');\n\n if (!degrees || refresh) {\n degrees = Object(_antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"getDegree\"])(this.save());\n this.set('degrees', degrees);\n }\n\n var nodeDegrees = degrees[item.getID()];\n var res = 0; // 如果是通过 addItem 后面新增加的节点,此时它的所有度数都为 0\n\n if (!nodeDegrees) {\n return 0;\n }\n\n switch (type) {\n case 'in':\n res = nodeDegrees.inDegree;\n break;\n\n case 'out':\n res = nodeDegrees.outDegree;\n break;\n\n case 'all':\n res = nodeDegrees;\n break;\n\n default:\n res = nodeDegrees.degree;\n break;\n }\n\n return res;\n };\n\n AbstractGraph.prototype.getUndoStack = function () {\n return this.undoStack;\n };\n\n AbstractGraph.prototype.getRedoStack = function () {\n return this.redoStack;\n };\n /**\n * 获取 undo 和 redo 栈的数据\n */\n\n\n AbstractGraph.prototype.getStackData = function () {\n if (!this.get('enabledStack')) {\n return null;\n }\n\n return {\n undoStack: this.undoStack.toArray(),\n redoStack: this.redoStack.toArray()\n };\n };\n /**\n * 清空 undo stack & redo stack\n */\n\n\n AbstractGraph.prototype.clearStack = function () {\n if (this.get('enabledStack')) {\n this.undoStack.clear();\n this.redoStack.clear();\n }\n };\n /**\n * 将操作类型和操作数据入栈\n * @param action 操作类型\n * @param data 入栈的数据\n * @param stackType 栈的类型\n */\n\n\n AbstractGraph.prototype.pushStack = function (action, data, stackType) {\n if (action === void 0) {\n action = 'update';\n }\n\n if (stackType === void 0) {\n stackType = 'undo';\n }\n\n if (!this.get('enabledStack')) {\n console.warn('请先启用 undo & redo 功能,在实例化 Graph 时候配置 enabledStack: true !');\n return;\n }\n\n var stackData = data ? Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(data) : {\n before: {},\n after: Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"clone\"])(this.save())\n };\n\n if (stackType === 'redo') {\n this.redoStack.push({\n action: action,\n data: stackData\n });\n } else {\n this.undoStack.push({\n action: action,\n data: stackData\n });\n }\n\n this.emit('stackchange', {\n undoStack: this.undoStack,\n redoStack: this.redoStack\n });\n };\n /**\n * 获取邻接矩阵\n *\n * @param {boolean} cache 是否使用缓存的\n * @param {boolean} directed 是否是有向图,默认取 graph.directed\n * @returns {Matrix} 邻接矩阵\n * @memberof IAbstractGraph\n */\n\n\n AbstractGraph.prototype.getAdjMatrix = function (cache, directed) {\n if (cache === void 0) {\n cache = true;\n }\n\n if (directed === undefined) directed = this.get('directed');\n var currentAdjMatrix = this.get('adjMatrix');\n\n if (!currentAdjMatrix || !cache) {\n currentAdjMatrix = Object(_antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"getAdjMatrix\"])(this.save(), directed);\n this.set('adjMatrix', currentAdjMatrix);\n }\n\n return currentAdjMatrix;\n };\n /**\n * 获取最短路径矩阵\n *\n * @param {boolean} cache 是否使用缓存的\n * @param {boolean} directed 是否是有向图,默认取 graph.directed\n * @returns {Matrix} 最短路径矩阵\n * @memberof IAbstractGraph\n */\n\n\n AbstractGraph.prototype.getShortestPathMatrix = function (cache, directed) {\n if (cache === void 0) {\n cache = true;\n }\n\n if (directed === undefined) directed = this.get('directed');\n var currentAdjMatrix = this.get('adjMatrix');\n var currentShourtestPathMatrix = this.get('shortestPathMatrix');\n\n if (!currentAdjMatrix || !cache) {\n currentAdjMatrix = Object(_antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"getAdjMatrix\"])(this.save(), directed);\n this.set('adjMatrix', currentAdjMatrix);\n }\n\n if (!currentShourtestPathMatrix || !cache) {\n currentShourtestPathMatrix = Object(_antv_algorithm__WEBPACK_IMPORTED_MODULE_4__[\"floydWarshall\"])(this.save(), directed);\n this.set('shortestPathMatrix', currentShourtestPathMatrix);\n }\n\n return currentShourtestPathMatrix;\n };\n /**\n * 重新定义监听函数,复写参数类型\n */\n\n\n AbstractGraph.prototype.on = function (eventName, callback, once) {\n return _super.prototype.on.call(this, eventName, callback, once);\n };\n /**\n * 销毁画布\n */\n\n\n AbstractGraph.prototype.destroy = function () {\n var _a, _b, _c, _d, _e;\n\n this.clear(); // 清空栈数据\n\n this.clearStack();\n (_a = this.get('itemController')) === null || _a === void 0 ? void 0 : _a.destroy();\n (_b = this.get('modeController')) === null || _b === void 0 ? void 0 : _b.destroy();\n (_c = this.get('viewController')) === null || _c === void 0 ? void 0 : _c.destroy();\n (_d = this.get('stateController')) === null || _d === void 0 ? void 0 : _d.destroy();\n (_e = this.get('canvas')) === null || _e === void 0 ? void 0 : _e.destroy();\n this.cfg = null;\n this.destroyed = true;\n this.redoStack = null;\n this.undoStack = null;\n };\n /**\n * 创建凸包或凹包轮廓\n * @param cfg HullCfg 轮廓配置项\n */\n\n\n AbstractGraph.prototype.createHull = function (cfg) {\n if (!cfg.members || cfg.members.length < 1) {\n console.warn('Create hull failed! The members is empty.');\n return;\n }\n\n var parent = this.get('hullGroup');\n var hullMap = this.get('hullMap');\n\n if (!hullMap) {\n hullMap = {};\n this.set('hullMap', hullMap);\n }\n\n if (!parent || parent.get('destroyed')) {\n parent = this.get('group').addGroup({\n id: 'hullGroup'\n });\n parent.toBack();\n this.set('hullGroup', parent);\n }\n\n if (hullMap[cfg.id]) {\n console.warn('Existed hull id.');\n return hullMap[cfg.id];\n }\n\n var group = parent.addGroup({\n id: \"\".concat(cfg.id, \"-container\")\n });\n var hull = new _item_hull__WEBPACK_IMPORTED_MODULE_10__[\"default\"](this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, cfg), {\n group: group\n }));\n var hullId = hull.id;\n hullMap[hullId] = hull;\n return hull;\n };\n /**\n * 获取当前 graph 中存在的包裹轮廓\n * @return {[key: string]: Hull} Hull 的 map,hullId 对应的 hull 实例\n */\n\n\n AbstractGraph.prototype.getHulls = function () {\n return this.get('hullMap');\n };\n /**\n * 根据 hullId 获取对应的 hull\n * @return Hull\n */\n\n\n AbstractGraph.prototype.getHullById = function (hullId) {\n return this.get('hullMap')[hullId];\n };\n\n AbstractGraph.prototype.removeHull = function (hull) {\n var _a;\n\n var hullInstance;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(hull)) {\n hullInstance = this.getHullById(hull);\n } else {\n hullInstance = hull;\n }\n\n (_a = this.get('hullMap')) === null || _a === void 0 ? true : delete _a[hullInstance.id];\n hullInstance.destroy();\n };\n\n AbstractGraph.prototype.removeHulls = function () {\n var hulls = this.getHulls();\n if (!hulls || !Object.keys(hulls).length) return;\n Object.keys(hulls).forEach(function (key) {\n var hull = hulls[key];\n hull.destroy();\n });\n this.set('hullMap', {});\n };\n\n return AbstractGraph;\n}(_antv_event_emitter__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (AbstractGraph);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/graph/graph.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\n/* harmony import */ var _antv_g_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-svg */ \"./node_modules/@antv/g-svg/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\n\nvar max = Math.max;\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__[\"ext\"].transform;\nvar DEFAULT_MODE = 'default';\nvar KEYSHAPE_MODE = 'keyShape';\nvar DELEGATE_MODE = 'delegate';\nvar SVG = 'svg';\nvar MiniMap = /** @class */function (_super) {\n __extends(MiniMap, _super);\n function MiniMap(config) {\n var _this = _super.call(this, config) || this;\n /**\n * 主图更新的监听函数,使用 debounce 减少渲染频率\n * e.g. 拖拽节点只会在松手后的 100ms 后执行 updateCanvas\n * e.g. render 时大量 addItem 也只会执行一次 updateCanvas\n */\n _this.handleUpdateCanvas = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"debounce\"])(function (event) {\n var self = _this;\n if (self.destroyed) return;\n self.updateCanvas();\n }, 100, false);\n return _this;\n }\n MiniMap.prototype.getDefaultCfgs = function () {\n return {\n container: null,\n className: 'g6-minimap',\n viewportClassName: 'g6-minimap-viewport',\n // Minimap 中默认展示和主图一样的内容,KeyShape 只展示节点和边的 key shape 部分,delegate表示展示自定义的rect,用户可自定义样式\n type: 'default',\n padding: 50,\n size: [200, 120],\n delegateStyle: {\n fill: '#40a9ff',\n stroke: '#096dd9'\n },\n refresh: true,\n hideEdge: false\n };\n };\n MiniMap.prototype.getEvents = function () {\n return {\n beforepaint: 'updateViewport',\n beforeanimate: 'disableRefresh',\n afteranimate: 'enableRefresh',\n viewportchange: 'disableOneRefresh'\n };\n };\n // 若是正在进行动画,不刷新缩略图\n MiniMap.prototype.disableRefresh = function () {\n this.set('refresh', false);\n };\n MiniMap.prototype.enableRefresh = function () {\n this.set('refresh', true);\n this.updateCanvas();\n };\n MiniMap.prototype.disableOneRefresh = function () {\n this.set('viewportChange', true);\n };\n MiniMap.prototype.initViewport = function () {\n var _this = this;\n var cfgs = this._cfgs;\n var size = cfgs.size,\n graph = cfgs.graph;\n if (this.destroyed) return;\n var canvas = this.get('canvas');\n var containerDOM = canvas.get('container');\n var isFireFox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1;\n var isSafari = navigator.userAgent.toLowerCase().indexOf('safari') > -1;\n var viewport = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"createDom\"])(\"\\n \"));\n // 计算拖拽水平方向距离\n var x = 0;\n // 计算拖拽垂直方向距离\n var y = 0;\n // 是否在拖拽minimap的视口\n var dragging = false;\n // 缓存viewport当前对于画布的x\n var left = 0;\n // 缓存viewport当前对于画布的y\n var top = 0;\n // 缓存viewport当前宽度\n var width = 0;\n // 缓存viewport当前高度\n var height = 0;\n var ratio = 0;\n var zoom = 0;\n var dragstartevent = isSafari || isFireFox ? 'mousedown' : 'dragstart';\n viewport.addEventListener(dragstartevent, function (e) {\n var _a, _b;\n if (e.dataTransfer) {\n var img = new Image();\n img.src = \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E\";\n (_b = (_a = e.dataTransfer).setDragImage) === null || _b === void 0 ? void 0 : _b.call(_a, img, 0, 0);\n try {\n e.dataTransfer.setData('text/html', 'view-port-minimap');\n } catch (_c) {\n // support IE\n e.dataTransfer.setData('text', 'view-port-minimap');\n }\n }\n cfgs.refresh = false;\n if (e.target !== viewport) {\n return;\n }\n // 如果视口已经最大了,不需要拖拽\n var style = viewport.style;\n left = parseInt(style.left, 10);\n top = parseInt(style.top, 10);\n width = parseInt(style.width, 10);\n height = parseInt(style.height, 10);\n if (width > size[0] || height > size[1]) {\n return;\n }\n zoom = graph.getZoom();\n ratio = _this.get('ratio');\n dragging = true;\n x = e.clientX;\n y = e.clientY;\n }, false);\n var dragListener = function dragListener(e) {\n if (!dragging || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNil\"])(e.clientX) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNil\"])(e.clientY)) {\n return;\n }\n var dx = x - e.clientX;\n var dy = y - e.clientY;\n // 若视口移动到最左边或最右边了,仅移动到边界\n if (left - dx < 0 || left - dx + width >= size[0]) {\n dx = 0;\n }\n // 若视口移动到最上或最下边了,仅移动到边界\n if (top - dy < 0 || top - dy + height >= size[1]) {\n dy = 0;\n }\n left -= dx;\n top -= dy;\n // 先移动视口,避免移动到边上以后出现视口闪烁\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"modifyCSS\"])(viewport, {\n left: \"\".concat(left, \"px\"),\n top: \"\".concat(top, \"px\")\n });\n // graph 移动需要偏移量 dx/dy * 缩放比例才会得到正确的移动距离\n graph.translate(dx * zoom / ratio, dy * zoom / ratio);\n x = e.clientX;\n y = e.clientY;\n };\n if (!isSafari && !isFireFox) {\n viewport.addEventListener('drag', dragListener, false);\n }\n var dragendListener = function dragendListener() {\n dragging = false;\n cfgs.refresh = true;\n };\n var dragendevent = isSafari || isFireFox ? 'mouseup' : 'dragend';\n viewport.addEventListener(dragendevent, dragendListener, false);\n containerDOM.addEventListener('mouseleave', dragendListener);\n containerDOM.addEventListener('mouseup', dragendListener);\n if (isSafari || isFireFox) {\n containerDOM.addEventListener('mousemove', dragListener, false);\n }\n this.set('viewport', viewport);\n containerDOM.appendChild(viewport);\n };\n /**\n * 更新 viewport 视图\n */\n MiniMap.prototype.updateViewport = function () {\n if (this.destroyed) return;\n var ratio = this.get('ratio');\n var totaldx = this.get('totaldx');\n var totaldy = this.get('totaldy');\n var graph = this.get('graph');\n var size = this.get('size');\n var graphCanvasEl = graph.get('canvas').get('el');\n var graphWidth = graph.get('width') || graphCanvasEl.scrollWidth || 500;\n var graphHeight = graph.get('height') || graphCanvasEl.scrollHeight || 500;\n var topLeft = graph.getPointByCanvas(0, 0);\n var bottomRight = graph.getPointByCanvas(graphWidth, graphHeight);\n var viewport = this.get('viewport');\n if (!viewport) {\n this.initViewport();\n }\n // viewport宽高,左上角点的计算\n var width = (bottomRight.x - topLeft.x) * ratio;\n var height = (bottomRight.y - topLeft.y) * ratio;\n var left = topLeft.x * ratio + totaldx;\n var top = topLeft.y * ratio + totaldy;\n var right = left + width;\n var bottom = top + height;\n if (left < 0) {\n width += left;\n left = 0;\n }\n if (right > size[0]) {\n width = width - (right - size[0]);\n }\n if (top < 0) {\n height += top;\n top = 0;\n }\n if (bottom > size[1]) {\n height = height - (bottom - size[1]);\n }\n // 缓存目前缩放比,在移动 minimap 视窗时就不用再计算大图的移动量\n this.set('ratio', ratio);\n var correctLeft = \"\".concat(left, \"px\");\n var correctTop = \"\".concat(top, \"px\");\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"modifyCSS\"])(viewport, {\n left: correctLeft,\n top: correctTop,\n width: \"\".concat(width, \"px\"),\n height: \"\".concat(height, \"px\")\n });\n };\n /**\n * 将主图上的图形完全复制到小图\n */\n MiniMap.prototype.updateGraphShapes = function () {\n var graph = this._cfgs.graph;\n var canvas = this.get('canvas');\n var graphGroup = graph.get('group');\n if (graphGroup.destroyed) return;\n canvas.clear();\n var clonedGroup;\n if (this.get('hideEdge')) {\n clonedGroup = canvas.addGroup();\n graphGroup.get('children').forEach(function (group) {\n if (group.get('id').includes('-edge')) return;\n clonedGroup.add(group.clone());\n });\n } else {\n clonedGroup = graphGroup.clone();\n clonedGroup.resetMatrix();\n canvas.add(clonedGroup);\n }\n // 当 renderer 是 svg,由于渲染引擎的 bug,这里需要将 visible 为 false 的元素手动隐藏\n var renderer = graph.get('renderer');\n if (renderer === SVG) {\n // 递归更新子元素\n this.updateVisible(clonedGroup);\n }\n };\n // svg 在 canvas.add(clonedGroup) 之后会出现 visible 为 false 的元素被展示出来,需要递归更新\n MiniMap.prototype.updateVisible = function (ele) {\n var _this = this;\n if (!ele.isGroup() && !ele.get('visible')) {\n ele.hide();\n } else {\n var children = ele.get('children');\n if (!children || !children.length) return;\n children.forEach(function (child) {\n if (!child.get('visible')) child.hide();\n _this.updateVisible(child);\n });\n }\n };\n // 仅在 minimap 上绘制 keyShape\n // FIXME 如果用户自定义绘制了其他内容,minimap上就无法画出\n MiniMap.prototype.updateKeyShapes = function () {\n var _this = this;\n var graph = this._cfgs.graph;\n var canvas = this.get('canvas');\n var group = canvas.get('children')[0] || canvas.addGroup();\n if (!this.get('hideEdge')) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(graph.getEdges(), function (edge) {\n _this.updateOneEdgeKeyShape(edge, group);\n });\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(graph.getNodes(), function (node) {\n _this.updateOneNodeKeyShape(node, group);\n });\n var combos = graph.getCombos();\n if (combos && combos.length) {\n var comboGroup_1 = group.find(function (e) {\n return e.get('name') === 'comboGroup';\n }) || group.addGroup({\n name: 'comboGroup'\n });\n setTimeout(function () {\n if (_this.destroyed) return;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(combos, function (combo) {\n _this.updateOneComboKeyShape(combo, comboGroup_1);\n });\n comboGroup_1 === null || comboGroup_1 === void 0 ? void 0 : comboGroup_1.sort();\n comboGroup_1 === null || comboGroup_1 === void 0 ? void 0 : comboGroup_1.toBack();\n _this.updateCanvas();\n }, 250);\n }\n this.clearDestroyedShapes();\n };\n /**\n * 增加/更新单个元素的 keyShape\n * @param item ICombo 实例\n */\n MiniMap.prototype.updateOneComboKeyShape = function (item, comboGroup) {\n if (this.destroyed) return;\n var itemMap = this.get('itemMap') || {};\n // 差量更新 minimap 上的一个节点,对应主图的 item\n var mappedItem = itemMap[item.get('id')];\n var bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox\n var cKeyShape = item.get('keyShape').clone();\n var keyShapeStyle = cKeyShape.attr();\n var attrs = {\n x: bbox.centerX,\n y: bbox.centerY\n };\n if (!mappedItem) {\n mappedItem = cKeyShape;\n comboGroup.add(mappedItem);\n } else {\n attrs = Object.assign(keyShapeStyle, attrs);\n }\n var shapeType = mappedItem.get('type');\n if (shapeType === 'rect' || shapeType === 'image') {\n attrs.x = bbox.minX;\n attrs.y = bbox.minY;\n }\n mappedItem.attr(attrs);\n if (!item.isVisible()) mappedItem.hide();else mappedItem.show();\n mappedItem.exist = true;\n var zIndex = item.getModel().depth;\n if (!isNaN(zIndex)) mappedItem.set('zIndex', zIndex);\n itemMap[item.get('id')] = mappedItem;\n this.set('itemMap', itemMap);\n };\n /**\n * 增加/更新单个元素的 keyShape\n * @param item INode 实例\n */\n MiniMap.prototype.updateOneNodeKeyShape = function (item, group) {\n var itemMap = this.get('itemMap') || {};\n // 差量更新 minimap 上的一个节点,对应主图的 item\n var mappedItem = itemMap[item.get('id')];\n var bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox\n var cKeyShape = item.get('keyShape').clone();\n var keyShapeStyle = cKeyShape.attr();\n var attrs = {\n x: bbox.centerX,\n y: bbox.centerY\n };\n if (!mappedItem) {\n mappedItem = cKeyShape;\n group.add(mappedItem);\n } else {\n attrs = Object.assign(keyShapeStyle, attrs);\n mappedItem.toFront();\n }\n var shapeType = mappedItem.get('type');\n if (shapeType === 'rect' || shapeType === 'image') {\n attrs.x = bbox.minX;\n attrs.y = bbox.minY;\n }\n mappedItem.attr(attrs);\n if (!item.isVisible()) mappedItem.hide();else mappedItem.show();\n mappedItem.exist = true;\n var zIndex = item.getModel().depth;\n if (!isNaN(zIndex)) mappedItem.set('zIndex', zIndex);\n itemMap[item.get('id')] = mappedItem;\n this.set('itemMap', itemMap);\n };\n /**\n * Minimap 中展示自定义的rect,支持用户自定义样式和节点大小\n */\n MiniMap.prototype.updateDelegateShapes = function () {\n var _this = this;\n var graph = this._cfgs.graph;\n var canvas = this.get('canvas');\n var group = canvas.get('children')[0] || canvas.addGroup();\n // 差量更新 minimap 上的节点和边\n if (!this.get('hideEdge')) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(graph.getEdges(), function (edge) {\n _this.updateOneEdgeKeyShape(edge, group);\n });\n }\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(graph.getNodes(), function (node) {\n _this.updateOneNodeDelegateShape(node, group);\n });\n var combos = graph.getCombos();\n if (combos && combos.length) {\n var comboGroup_2 = group.find(function (e) {\n return e.get('name') === 'comboGroup';\n }) || group.addGroup({\n name: 'comboGroup'\n });\n setTimeout(function () {\n if (_this.destroyed) return;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(combos, function (combo) {\n _this.updateOneComboKeyShape(combo, comboGroup_2);\n });\n comboGroup_2 === null || comboGroup_2 === void 0 ? void 0 : comboGroup_2.sort();\n comboGroup_2 === null || comboGroup_2 === void 0 ? void 0 : comboGroup_2.toBack();\n _this.updateCanvas();\n }, 250);\n }\n this.clearDestroyedShapes();\n };\n MiniMap.prototype.clearDestroyedShapes = function () {\n var itemMap = this.get('itemMap') || {};\n var keys = Object.keys(itemMap);\n if (!keys || keys.length === 0) return;\n for (var i = keys.length - 1; i >= 0; i--) {\n var shape = itemMap[keys[i]];\n var exist = shape.exist;\n shape.exist = false;\n if (!exist) {\n shape.remove();\n delete itemMap[keys[i]];\n }\n }\n };\n /**\n * 设置只显示 edge 的 keyShape\n * @param item IEdge 实例\n */\n MiniMap.prototype.updateOneEdgeKeyShape = function (item, group) {\n var itemMap = this.get('itemMap') || {};\n // 差量更新 minimap 上的一个节点,对应主图的 item\n var mappedItem = itemMap[item.get('id')];\n if (mappedItem) {\n var path = item.get('keyShape').attr('path');\n mappedItem.attr('path', path);\n } else {\n mappedItem = item.get('keyShape').clone();\n group.add(mappedItem);\n }\n if (!item.isVisible()) mappedItem.hide();else mappedItem.show();\n mappedItem.exist = true;\n itemMap[item.get('id')] = mappedItem;\n this.set('itemMap', itemMap);\n };\n /**\n * Minimap 中展示自定义的 rect,支持用户自定义样式和节点大小\n * 增加/更新单个元素\n * @param item INode 实例\n */\n MiniMap.prototype.updateOneNodeDelegateShape = function (item, group) {\n var delegateStyle = this.get('delegateStyle');\n var itemMap = this.get('itemMap') || {};\n // 差量更新 minimap 上的一个节点,对应主图的 item\n var mappedItem = itemMap[item.get('id')];\n var bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox\n if (mappedItem) {\n var attrs = {\n x: bbox.minX,\n y: bbox.minY,\n width: bbox.width,\n height: bbox.height\n };\n mappedItem.attr(attrs);\n mappedItem.toFront();\n } else {\n mappedItem = group.addShape('rect', {\n attrs: __assign({\n x: bbox.minX,\n y: bbox.minY,\n width: bbox.width,\n height: bbox.height\n }, delegateStyle),\n name: 'minimap-node-shape'\n });\n }\n if (!item.isVisible()) mappedItem.hide();else mappedItem.show();\n mappedItem.exist = true;\n itemMap[item.get('id')] = mappedItem;\n this.set('itemMap', itemMap);\n };\n MiniMap.prototype.init = function () {\n this.initContainer();\n this.get('graph').on('afterupdateitem', this.handleUpdateCanvas);\n this.get('graph').on('afteritemstatechange', this.handleUpdateCanvas);\n this.get('graph').on('afteradditem', this.handleUpdateCanvas);\n this.get('graph').on('afterremoveitem', this.handleUpdateCanvas);\n this.get('graph').on('afterrender', this.handleUpdateCanvas);\n this.get('graph').on('afterlayout', this.handleUpdateCanvas);\n };\n /**\n * 初始化 Minimap 的容器\n */\n MiniMap.prototype.initContainer = function () {\n var self = this;\n var graph = self.get('graph');\n var size = self.get('size');\n var className = self.get('className');\n var parentNode = self.get('container');\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"createDom\"])(\"
\"));\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isString\"])(parentNode)) {\n parentNode = document.getElementById(parentNode);\n }\n if (parentNode) {\n parentNode.appendChild(container);\n } else {\n graph.get('container').appendChild(container);\n }\n self.set('container', container);\n var containerDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"createDom\"])('
');\n container.appendChild(containerDOM);\n containerDOM.addEventListener('dragenter', function (e) {\n e.preventDefault();\n });\n containerDOM.addEventListener('dragover', function (e) {\n e.preventDefault();\n });\n var canvas;\n var renderer = graph.get('renderer');\n if (renderer === SVG) {\n canvas = new _antv_g_svg__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"]({\n container: containerDOM,\n width: size[0],\n height: size[1]\n });\n } else {\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_0__[\"Canvas\"]({\n container: containerDOM,\n width: size[0],\n height: size[1]\n });\n }\n self.set('canvas', canvas);\n self.updateCanvas();\n };\n MiniMap.prototype.updateCanvas = function () {\n if (this.destroyed) return;\n // 如果是在动画,则不刷新视图\n var isRefresh = this.get('refresh');\n if (!isRefresh) {\n return;\n }\n var graph = this.get('graph');\n if (graph.get('destroyed')) {\n return;\n }\n // 如果是视口变换,也不刷新视图,但是需要重置视口大小和位置\n if (this.get('viewportChange')) {\n this.set('viewportChange', false);\n this.updateViewport();\n }\n var size = this.get('size'); // 用户定义的 minimap size\n var canvas = this.get('canvas'); // minimap 的 canvas\n var type = this.get('type'); // minimap 的类型\n var padding = this.get('padding'); // 用户额定义的 minimap 的 padding\n if (canvas.destroyed) {\n return;\n }\n switch (type) {\n case DEFAULT_MODE:\n this.updateGraphShapes();\n break;\n case KEYSHAPE_MODE:\n this.updateKeyShapes();\n break;\n case DELEGATE_MODE:\n // 得到的节点直接带有 x 和 y,每个节点不存在父 group,即每个节点位置不由父 group 控制\n this.updateDelegateShapes();\n break;\n default:\n break;\n }\n var group = canvas.get('children')[0];\n if (!group) return;\n group.resetMatrix();\n // 该 bbox 是准确的,不计算 matrix 的包围盒\n var bbox = group.getCanvasBBox();\n var graphBBox = graph.get('canvas').getCanvasBBox(); // 主图的 bbox\n var graphZoom = graph.getZoom() || 1;\n var width = graphBBox.width / graphZoom;\n var height = graphBBox.height / graphZoom;\n if (Number.isFinite(bbox.width)) {\n // 刷新后bbox可能会变,需要重置画布矩阵以缩放到合适的大小\n width = max(bbox.width, width);\n height = max(bbox.height, height);\n }\n width += 2 * padding;\n height += 2 * padding;\n var ratio = Math.min(size[0] / width, size[1] / height);\n var matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var minX = 0;\n var minY = 0;\n // 平移到左上角\n if (Number.isFinite(bbox.minX)) {\n minX = -bbox.minX;\n }\n if (Number.isFinite(bbox.minY)) {\n minY = -bbox.minY;\n }\n // 缩放到适合视口后, 平移到画布中心\n var dx = (size[0] - (width - 2 * padding) * ratio) / 2;\n var dy = (size[1] - (height - 2 * padding) * ratio) / 2;\n matrix = transform(matrix, [['t', minX, minY], ['s', ratio, ratio], ['t', dx, dy] // 移动到画布中心\n ]);\n\n group.setMatrix(matrix);\n // 更新minimap视口\n this.set('ratio', ratio);\n this.set('totaldx', dx + minX * ratio);\n this.set('totaldy', dy + minY * ratio);\n this.set('dx', dx);\n this.set('dy', dy);\n this.updateViewport();\n };\n /**\n * 获取minimap的画布\n * @return {GCanvas} G的canvas实例\n */\n MiniMap.prototype.getCanvas = function () {\n return this.get('canvas');\n };\n /**\n * 获取minimap的窗口\n * @return {HTMLElement} 窗口的dom实例\n */\n MiniMap.prototype.getViewport = function () {\n return this.get('viewport');\n };\n /**\n * 获取minimap的容器dom\n * @return {HTMLElement} dom\n */\n MiniMap.prototype.getContainer = function () {\n return this.get('container');\n };\n MiniMap.prototype.destroy = function () {\n var _a;\n (_a = this.get('canvas')) === null || _a === void 0 ? void 0 : _a.destroy();\n var container = this.get('container');\n if (container === null || container === void 0 ? void 0 : container.parentNode) container.parentNode.removeChild(container);\n };\n return MiniMap;\n}(_base__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (MiniMap);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/minimap/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/index.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/index.js ***! - \************************************************/ -/*! exports provided: G6GraphEvent, Arrow, Shape, Node, Edge, Combo, Hull, Marker, registerNode, registerCombo, AbstractGraph, Util, registerEdge, registerBehavior, AbstractLayout, AbstractEvent, BaseGlobal, default */ +/***/ "./node_modules/@antv/g6-plugin/es/snapline/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/snapline/index.js ***! + \***********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerNode\", function() { return registerNode; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerCombo\", function() { return registerCombo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerEdge\", function() { return registerEdge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerBehavior\", function() { return registerBehavior; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BaseGlobal\", function() { return BaseGlobal; });\n/* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./behavior */ \"./node_modules/@antv/g6-core/es/behavior/index.js\");\n/* harmony import */ var _graph_graph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./graph/graph */ \"./node_modules/@antv/g6-core/es/graph/graph.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGraph\", function() { return _graph_graph__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./element */ \"./node_modules/@antv/g6-core/es/element/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Arrow\", function() { return _element__WEBPACK_IMPORTED_MODULE_2__[\"Arrow\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Marker\", function() { return _element__WEBPACK_IMPORTED_MODULE_2__[\"Marker\"]; });\n\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/g6-core/es/util/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Util\", function() { return _util__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _graph_controller_layout__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./graph/controller/layout */ \"./node_modules/@antv/g6-core/es/graph/controller/layout.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractLayout\", function() { return _graph_controller_layout__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _graph_controller_event__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./graph/controller/event */ \"./node_modules/@antv/g6-core/es/graph/controller/event.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractEvent\", function() { return _graph_controller_event__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _item_node__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./item/node */ \"./node_modules/@antv/g6-core/es/item/node.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return _item_node__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _item_edge__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./item/edge */ \"./node_modules/@antv/g6-core/es/item/edge.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Edge\", function() { return _item_edge__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _item_hull__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./item/hull */ \"./node_modules/@antv/g6-core/es/item/hull.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Hull\", function() { return _item_hull__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _item_combo__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./item/combo */ \"./node_modules/@antv/g6-core/es/item/combo.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Combo\", function() { return _item_combo__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/g6-core/es/types/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _types__WEBPACK_IMPORTED_MODULE_11__[\"G6GraphEvent\"]; });\n\n\n\n\n\n // 用于 PC 和 Mobile 端分别实现 layout 和 updateLayoutCfg 方法\n\n\n\n\n\n\n\nvar registerNode = _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerNode;\nvar registerEdge = _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerEdge;\nvar registerCombo = _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerCombo;\nvar registerBehavior = _behavior__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerBehavior;\nvar BaseGlobal = _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].version,\n AbstractGraph: _graph_graph__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n BaseGlobal: BaseGlobal,\n Util: _util__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n Shape: _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Node: _item_node__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n Edge: _item_edge__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n Combo: _item_combo__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n Hull: _item_hull__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n registerNode: _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerNode,\n registerEdge: _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerEdge,\n registerCombo: _element__WEBPACK_IMPORTED_MODULE_2__[\"default\"].registerCombo,\n registerBehavior: _behavior__WEBPACK_IMPORTED_MODULE_0__[\"default\"].registerBehavior,\n Arrow: _element__WEBPACK_IMPORTED_MODULE_2__[\"Arrow\"],\n Marker: _element__WEBPACK_IMPORTED_MODULE_2__[\"Marker\"],\n AbstractLayout: _graph_controller_layout__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n AbstractEvent: _graph_controller_event__WEBPACK_IMPORTED_MODULE_6__[\"default\"]\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\nvar pointLineDistance = _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].pointLineDistance;\n// 对齐线样式\nvar alignLineStyle = {\n stroke: '#FA8C16',\n lineWidth: 1\n};\nvar SnapLine = /** @class */function (_super) {\n __extends(SnapLine, _super);\n function SnapLine(props) {\n return _super.call(this, props) || this;\n }\n SnapLine.prototype.getDefaultCfgs = function () {\n return {\n line: alignLineStyle,\n /**\n * item align type\n * @type {String|True|False}\n */\n itemAlignType: 'center',\n /**\n * tolerance to item force align\n * @type {String|True|False}\n */\n tolerance: 5,\n horizontalLines: {},\n verticalLines: {},\n alignLines: []\n };\n };\n SnapLine.prototype.init = function () {};\n // class-methods-use-this\n SnapLine.prototype.getEvents = function () {\n return {\n 'node:dragstart': 'onDragStart',\n 'node:drag': 'onDrag',\n 'node:dragend': 'onDragEnd'\n };\n };\n SnapLine.prototype.onDragStart = function () {\n this.initBoxLine();\n };\n SnapLine.prototype.onDrag = function (e) {\n var item = e.item;\n // 计算辅助线位置,拖动过程中更新辅助线\n var delegateShape = item.get('delegateShape') || item;\n var bbox = delegateShape.getBBox();\n var model = item.getModel();\n var dx = model.x - bbox.x;\n var dy = model.y - bbox.y;\n this.show({\n x: bbox.minX + dx,\n y: bbox.minY + dy\n }, {\n width: bbox.width,\n height: bbox.height\n });\n };\n SnapLine.prototype.onDragEnd = function () {\n // 拖动结束时候删除辅助线\n this.destory();\n };\n /**\n * 每次开始拖动之前,计算出所有节点在水平和垂直方向上,左中右三条中线,并缓存起来\n *\n * @param {object} item Node节点\n * @memberof AlignLine\n */\n SnapLine.prototype.initBoxLine = function () {\n var _a = this._cfgs,\n horizontalLines = _a.horizontalLines,\n verticalLines = _a.verticalLines,\n itemAlignType = _a.itemAlignType;\n var graph = this.get('graph');\n var nodes = graph.getNodes();\n nodes.forEach(function (item) {\n var bbox = item.getBBox();\n var nodeId = item.get('id');\n // 设置水平方向辅助线\n if (itemAlignType === true || itemAlignType === 'horizontal') {\n // tltr: top left top right\n // lcrc: left center right center\n // blbr: bottom left bottom right\n horizontalLines[\"\".concat(nodeId, \"tltr\")] = [bbox.minX, bbox.minY, bbox.maxX, bbox.minY, item];\n horizontalLines[\"\".concat(nodeId, \"lcrc\")] = [bbox.minX, bbox.centerY, bbox.maxX, bbox.centerY, item];\n horizontalLines[\"\".concat(nodeId, \"blbr\")] = [bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY, item];\n } else if (itemAlignType === 'center') {\n horizontalLines[\"\".concat(nodeId, \"lcrc\")] = [bbox.minX, bbox.centerY, bbox.maxX, bbox.centerY, item];\n }\n // 设置垂直方向辅助线\n if (itemAlignType === true || itemAlignType === 'vertical') {\n // tlbl: top left bottom left\n // tcbc: top center bottom center\n // trbr: top right bottom right\n verticalLines[\"\".concat(nodeId, \"tlbl\")] = [bbox.minX, bbox.minY, bbox.minX, bbox.maxY, item];\n verticalLines[\"\".concat(nodeId, \"tcbc\")] = [bbox.centerX, bbox.minY, bbox.centerX, bbox.maxY, item];\n verticalLines[\"\".concat(nodeId, \"trbr\")] = [bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY, item];\n } else if (itemAlignType === 'center') {\n verticalLines[\"\".concat(nodeId, \"tcbc\")] = [bbox.centerX, bbox.minY, bbox.centerX, bbox.maxY, item];\n }\n });\n };\n /**\n * 显示AlignLine\n *\n * @param {object} point 起始点\n * @param {object} bbox BBox\n * @returns\n * @memberof AlignLine\n */\n SnapLine.prototype.show = function (point, bbox) {\n var originPoint = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"mix\"])({}, point);\n this.itemAlign(point, bbox, originPoint);\n return point;\n };\n /**\n * 拖动拖出中添加辅助线\n *\n * @param {object} point 起始点\n * @param {object} bbox 代理形状的bbox\n * @param {object} originPoint 原始点,同point\n * @memberof AlignLine\n */\n SnapLine.prototype.itemAlign = function (point, bbox, originPoint) {\n var _this = this;\n var _a = this._cfgs,\n horizontalLines = _a.horizontalLines,\n verticalLines = _a.verticalLines,\n tolerance = _a.tolerance;\n var tc = {\n x: originPoint.x + bbox.width / 2,\n y: originPoint.y\n };\n var cc = {\n x: originPoint.x + bbox.width / 2,\n y: originPoint.y + bbox.height / 2\n };\n var bc = {\n x: originPoint.x + bbox.width / 2,\n y: originPoint.y + bbox.height\n };\n var lc = {\n x: originPoint.x,\n y: originPoint.y + bbox.height / 2\n };\n var rc = {\n x: originPoint.x + bbox.width,\n y: originPoint.y + bbox.height / 2\n };\n var horizontalDis = [];\n var verticalDis = [];\n var alignCfg = null;\n this.clearAlignLine();\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(horizontalLines, function (line) {\n if (line[4].isVisible) {\n horizontalDis.push(_this.getLineDisObject(line, tc));\n horizontalDis.push(_this.getLineDisObject(line, cc));\n horizontalDis.push(_this.getLineDisObject(line, bc));\n }\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(verticalLines, function (line) {\n if (line[4].isVisible) {\n verticalDis.push(_this.getLineDisObject(line, lc));\n verticalDis.push(_this.getLineDisObject(line, cc));\n verticalDis.push(_this.getLineDisObject(line, rc));\n }\n });\n horizontalDis.sort(function (a, b) {\n return a.dis - b.dis;\n });\n verticalDis.sort(function (a, b) {\n return a.dis - b.dis;\n });\n if (horizontalDis.length !== 0 && horizontalDis[0].dis < tolerance) {\n point.y = horizontalDis[0].line[1] - horizontalDis[0].point.y + originPoint.y;\n alignCfg = {\n type: 'item',\n horizontals: [horizontalDis[0]]\n };\n for (var i = 1; i < 3; i++) {\n if (horizontalDis[0].dis === horizontalDis[i].dis) {\n alignCfg.horizontals.push(horizontalDis[i]);\n }\n }\n }\n if (verticalDis.length !== 0 && verticalDis[0].dis < tolerance) {\n point.x = verticalDis[0].line[0] - verticalDis[0].point.x + originPoint.x;\n if (!alignCfg) {\n alignCfg = {\n type: 'item',\n verticals: [verticalDis[0]]\n };\n } else {\n alignCfg.verticals = [verticalDis[0]];\n }\n for (var i = 1; i < 3; i++) {\n if (verticalDis[0].dis === verticalDis[i].dis) {\n alignCfg.verticals.push(verticalDis[i]);\n }\n }\n }\n if (alignCfg) {\n alignCfg.bbox = bbox;\n this.addAlignLine(alignCfg);\n }\n };\n /**\n * 根据配置项添加辅助线\n *\n * @param {object} cfg\n * @memberof AlignLine\n */\n SnapLine.prototype.addAlignLine = function (cfg) {\n var bbox = cfg.bbox,\n type = cfg.type,\n horizontals = cfg.horizontals,\n verticals = cfg.verticals;\n var _a = this._cfgs,\n lineStyle = _a.line,\n alignLines = _a.alignLines;\n var graph = this.get('graph');\n var group = graph.get('group');\n if (type === 'item') {\n if (horizontals) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(horizontals, function (horizontal) {\n var refLine = horizontal.line,\n refPoint = horizontal.point;\n var lineCenterX = (refLine[0] + refLine[2]) / 2;\n var x1;\n var x2;\n if (refPoint.x < lineCenterX) {\n x1 = refPoint.x - bbox.width / 2;\n x2 = Math.max(refLine[0], refLine[2]);\n } else {\n x1 = refPoint.x + bbox.width / 2;\n x2 = Math.min(refLine[0], refLine[2]);\n }\n var lineAttrs = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"mix\"])({\n x1: x1,\n y1: refLine[1],\n x2: x2,\n y2: refLine[1]\n }, lineStyle);\n var line = group.addShape('line', {\n attrs: lineAttrs,\n capture: false\n });\n alignLines.push(line);\n });\n }\n if (verticals) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(verticals, function (vertical) {\n var refLine = vertical.line,\n refPoint = vertical.point;\n var lineCenterY = (refLine[1] + refLine[3]) / 2;\n var y1;\n var y2;\n if (refPoint.y < lineCenterY) {\n y1 = refPoint.y - bbox.height / 2;\n y2 = Math.max(refLine[1], refLine[3]);\n } else {\n y1 = refPoint.y + bbox.height / 2;\n y2 = Math.min(refLine[1], refLine[3]);\n }\n var lineAtts = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"mix\"])({\n x1: refLine[0],\n y1: y1,\n x2: refLine[0],\n y2: y2\n }, lineStyle);\n var line = group.addShape('line', {\n attrs: lineAtts,\n capture: false\n });\n alignLines.push(line);\n });\n }\n }\n };\n /**\n * 获取点到线的距离\n *\n * @param {array} line [x1, y1, x2, y2] 线的四个点\n * @param {object} point 点的x和y坐标点 {x, y}\n * @returns\n * @memberof AlignLine\n */\n SnapLine.prototype.getLineDisObject = function (line, point) {\n return {\n line: line,\n point: point,\n dis: pointLineDistance(line, point)\n };\n };\n SnapLine.prototype.getContainer = function () {\n return this.get('container');\n };\n /**\n * 拖动过程中,清楚上次绘制的线\n *\n * @memberof AlignLine\n */\n SnapLine.prototype.clearAlignLine = function () {\n var alignLines = this._cfgs.alignLines;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(alignLines, function (line) {\n line.remove();\n });\n alignLines.length = 0;\n };\n /**\n * 拖动结束时候,情况缓存的节点的辅助线,同时删除绘制的线\n *\n * @memberof AlignLine\n */\n SnapLine.prototype.destory = function () {\n var _a = this._cfgs,\n horizontalLines = _a.horizontalLines,\n verticalLines = _a.verticalLines;\n var graph = this.get('graph');\n var nodes = graph.getNodes();\n nodes.forEach(function (node) {\n var itemId = node.get('id');\n delete horizontalLines[\"\".concat(itemId, \"tltr\")];\n delete horizontalLines[\"\".concat(itemId, \"lcrc\")];\n delete horizontalLines[\"\".concat(itemId, \"blbr\")];\n delete verticalLines[\"\".concat(itemId, \"tlbl\")];\n delete verticalLines[\"\".concat(itemId, \"tcbc\")];\n delete verticalLines[\"\".concat(itemId, \"trbr\")];\n });\n this.clearAlignLine();\n };\n return SnapLine;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (SnapLine);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/snapline/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/interface/behavior.js": +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/constant.js": /*!*************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/interface/behavior.js ***! + !*** ./node_modules/@antv/g6-plugin/es/timeBar/constant.js ***! \*************************************************************/ -/*! exports provided: G6GraphEvent */ +/*! exports provided: TIMELINE_START, TIMELINE_END, VALUE_CHANGE, TIMEBAR_CONFIG_CHANGE, PLAY_PAUSE_BTN, NEXT_STEP_BTN, PRE_STEP_BTN */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TIMELINE_START\", function() { return TIMELINE_START; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TIMELINE_END\", function() { return TIMELINE_END; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VALUE_CHANGE\", function() { return VALUE_CHANGE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TIMEBAR_CONFIG_CHANGE\", function() { return TIMEBAR_CONFIG_CHANGE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PLAY_PAUSE_BTN\", function() { return PLAY_PAUSE_BTN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NEXT_STEP_BTN\", function() { return NEXT_STEP_BTN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PRE_STEP_BTN\", function() { return PRE_STEP_BTN; });\nvar TIMELINE_START = 'timebarstartplay';\nvar TIMELINE_END = 'timebarendplay';\nvar VALUE_CHANGE = 'valuechange';\nvar TIMEBAR_CONFIG_CHANGE = 'timebarConfigChanged';\nvar PLAY_PAUSE_BTN = 'playPauseBtn';\nvar NEXT_STEP_BTN = 'nextStepBtn';\nvar PRE_STEP_BTN = 'preStepBtn';\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/constant.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js ***! + \******************************************************************/ +/*! exports provided: TIME_TYPE, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return G6GraphEvent; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n\n\n\nvar G6GraphEvent =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(G6GraphEvent, _super);\n\n function G6GraphEvent(type, event) {\n var _this = _super.call(this, type, event) || this;\n\n _this.item = event.item;\n _this.canvasX = event.canvasX;\n _this.canvasY = event.canvasY;\n _this.wheelDelta = event.wheelDelta;\n _this.detail = event.detail;\n return _this;\n }\n\n return G6GraphEvent;\n}(_antv_g_base__WEBPACK_IMPORTED_MODULE_1__[\"Event\"]);\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/behavior.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TIME_TYPE\", function() { return TIME_TYPE; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _timeButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timeButton */ \"./node_modules/@antv/g6-plugin/es/timeBar/timeButton.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__[\"ext\"].transform;\nvar DEFAULT_RECT_FILL = '#aaa';\nvar DEFAULT_RECT_STROKE = 'green';\nvar DEFAULT_PLAYBTN_STYLE = {\n fill: '#aaa',\n fillOpacity: 0.35,\n stroke: '#aaa'\n};\nvar DEFAULT_PREBTN_STYLE = {\n fill: '#fff'\n};\nvar DEFAULT_NEXTBTN_STYLE = {\n fill: 'green'\n};\nvar DEFAULT_SPEED_CONTROLLER_STYLE = {\n pointer: {\n fill: '#aaa',\n lineWidth: 0\n },\n scroller: {\n stroke: '#aaa',\n fill: '#aaa',\n lineWidth: 1,\n lineAppendWidth: 5,\n cursor: 'pointer'\n },\n text: {\n fill: '#aaa',\n textBaseline: 'top'\n }\n};\nvar DEFAULT_TIMETYPE_CONTROLLER_STYLE = {\n check: {\n stroke: 'green',\n lineWidth: 3\n },\n box: {\n fill: '#fff',\n stroke: '#aaa',\n lineWidth: 2,\n radius: 3,\n width: 12,\n height: 12\n },\n text: {\n fill: '#aaa',\n fontSize: 12,\n textBaseline: 'top'\n }\n};\nvar DEFAULT_CONTROLLER_CONFIG = {\n speed: 1,\n loop: false,\n fill: '#fff',\n stroke: '#fff',\n hideTimeTypeController: false,\n preBtnStyle: {\n fill: '#aaa',\n stroke: '#aaa'\n },\n nextBtnStyle: {\n fill: '#aaa',\n stroke: '#aaa'\n },\n playBtnStyle: {\n fill: '#aaa',\n stroke: '#aaa',\n fillOpacity: 0.05\n },\n speedControllerStyle: DEFAULT_SPEED_CONTROLLER_STYLE,\n timeTypeControllerStyle: DEFAULT_TIMETYPE_CONTROLLER_STYLE\n};\nvar SPEED_CONTROLLER_OFFSET = 110;\nvar TOGGLE_MODEL_OFFSET = 50;\nvar TIME_TYPE = {\n SINGLE: 'single',\n RANGE: 'range'\n};\nvar ControllerBtn = /** @class */function () {\n function ControllerBtn(cfg) {\n this.controllerCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"deepMix\"])({}, DEFAULT_CONTROLLER_CONFIG, cfg);\n this.group = cfg.group;\n this.controllerGroup = this.group.addGroup({\n name: 'controller-group'\n });\n this.speedAxisY = [];\n this.currentSpeed = this.controllerCfg.speed;\n this.currentType = this.controllerCfg.defaultTimeType || TIME_TYPE.RANGE;\n this.fontFamily = cfg.fontFamily || 'Arial, sans-serif';\n this.init();\n }\n ControllerBtn.prototype.init = function () {\n this.renderPlayButton();\n };\n /** 获取播放键 marker path */\n ControllerBtn.prototype.getNextMarkerPath = function (x, y, len) {\n return [['M', x, y - len], ['L', x + len, y], ['L', x, y + len], ['Z', x, y - len], ['M', x, y], ['L', x - len, y - len], ['L', x - len, y + len], ['Z']];\n };\n ControllerBtn.prototype.getPreMarkerPath = function (x, y, len) {\n return [['M', x, y - len], ['L', x - len, y], ['L', x, y + len], ['L', x, y - len], ['M', x, y], ['L', x + len, y - len], ['L', x + len, y + len], ['Z']];\n };\n ControllerBtn.prototype.renderPlayButton = function () {\n var controllerCfg = this.controllerCfg;\n var width = controllerCfg.width,\n height = controllerCfg.height,\n x = controllerCfg.x,\n y = controllerCfg.y,\n hideTimeTypeController = controllerCfg.hideTimeTypeController,\n _a = controllerCfg.fill,\n fill = _a === void 0 ? DEFAULT_RECT_FILL : _a,\n _b = controllerCfg.stroke,\n stroke = _b === void 0 ? DEFAULT_RECT_STROKE : _b,\n _c = controllerCfg.containerStyle,\n containerStyle = _c === void 0 ? {} : _c;\n var playBtnStyle = __assign(__assign({}, DEFAULT_PLAYBTN_STYLE), controllerCfg.playBtnStyle || {});\n var preBtnStyle = __assign(__assign({}, DEFAULT_PREBTN_STYLE), controllerCfg.preBtnStyle || {});\n var nextBtnStyle = __assign(__assign({}, DEFAULT_NEXTBTN_STYLE), controllerCfg.nextBtnStyle || {});\n var r = height / 2 - 5;\n var realY = y + 10;\n // 绘制最外层的矩形包围框\n var container = this.controllerGroup.addShape('rect', {\n attrs: __assign({\n x: x,\n y: realY,\n width: width,\n height: height,\n stroke: stroke,\n fill: fill\n }, containerStyle),\n name: 'container-rect'\n });\n if (this.playButton) {\n this.playButton.update({\n x: width / 2,\n y: realY,\n r: r\n });\n } else {\n this.playButton = new _timeButton__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n group: this.controllerGroup,\n x: width / 2,\n y: realY + r + 5,\n r: r,\n isPlay: this.isPlay,\n style: playBtnStyle\n });\n }\n // 后退按钮\n var prePaddingX = preBtnStyle.offsetX || 0;\n var prePaddingY = preBtnStyle.offsetY || 0;\n var preR = (preBtnStyle.scale || 1) * r;\n this.controllerGroup.addShape('path', {\n attrs: __assign({\n path: this.getPreMarkerPath(width / 2 - 5 * r + prePaddingX, realY + r + 5 + prePaddingY, preR * 0.5)\n }, preBtnStyle),\n name: _constant__WEBPACK_IMPORTED_MODULE_3__[\"PRE_STEP_BTN\"]\n });\n // 前进按钮\n var nxtPaddingX = nextBtnStyle.offsetX || 0;\n var nxtPaddingY = nextBtnStyle.offsetY || 0;\n var nxtR = (nextBtnStyle.scale || 1) * r;\n this.controllerGroup.addShape('path', {\n attrs: __assign({\n path: this.getNextMarkerPath(width / 2 + 5 * r + nxtPaddingX, realY + r + 5 + nxtPaddingY, nxtR * 0.5)\n }, nextBtnStyle),\n name: _constant__WEBPACK_IMPORTED_MODULE_3__[\"NEXT_STEP_BTN\"]\n });\n container.toBack();\n // 调节speed的按钮\n this.renderSpeedBtn();\n if (!hideTimeTypeController) {\n this.renderToggleTime();\n }\n this.bindEvent();\n // 根据配置的 scale、offsetX,offsetY 缩放和移动控制栏\n var _d = this.controllerCfg.scale,\n scale = _d === void 0 ? 1 : _d;\n var currentBBox = this.controllerGroup.getCanvasBBox();\n var centerX = (currentBBox.maxX + currentBBox.minX) / 2;\n var centerY = (currentBBox.maxY + currentBBox.minY) / 2;\n var matrix = transform([1, 0, 0, 0, 1, 0, 0, 0, 1], [['t', -centerX, -centerY], ['s', scale, scale], ['t', centerX, centerY]]);\n this.controllerGroup.setMatrix(matrix);\n };\n ControllerBtn.prototype.renderSpeedBtn = function () {\n var _a = this.controllerCfg,\n y = _a.y,\n width = _a.width,\n hideTimeTypeController = _a.hideTimeTypeController;\n var speedControllerStyle = __assign(__assign({}, DEFAULT_SPEED_CONTROLLER_STYLE), this.controllerCfg.speedControllerStyle || {});\n var _b = speedControllerStyle.scroller,\n scroller = _b === void 0 ? {} : _b,\n _c = speedControllerStyle.text,\n text = _c === void 0 ? {} : _c,\n _d = speedControllerStyle.pointer,\n pointer = _d === void 0 ? {} : _d,\n _e = speedControllerStyle.scale,\n scale = _e === void 0 ? 1 : _e,\n _f = speedControllerStyle.offsetX,\n offsetX = _f === void 0 ? 0 : _f,\n _g = speedControllerStyle.offsetY,\n offsetY = _g === void 0 ? 0 : _g;\n var speedGroup = this.controllerGroup.addGroup({\n name: 'speed-group'\n });\n this.speedGroup = speedGroup;\n var speedNum = [];\n var maxSpeed = 5;\n this.speedAxisY = [19, 22, 26, 32, 39];\n // 增加speed刻度\n for (var i = 0; i < 5; i++) {\n var axisY = y + this.speedAxisY[i];\n // 灰色刻度\n var startX = width - (!hideTimeTypeController ? SPEED_CONTROLLER_OFFSET : TOGGLE_MODEL_OFFSET);\n speedGroup.addShape('line', {\n attrs: __assign({\n x1: startX,\n x2: startX + 15,\n y1: axisY,\n y2: axisY\n }, scroller),\n speed: maxSpeed,\n name: 'speed-rect'\n });\n this.speedAxisY[i] = axisY;\n speedNum.push(maxSpeed);\n maxSpeed = maxSpeed - 1;\n }\n // 速度文本\n this.speedText = speedGroup.addShape('text', {\n attrs: __assign({\n x: width - (!hideTimeTypeController ? SPEED_CONTROLLER_OFFSET : TOGGLE_MODEL_OFFSET) + 20,\n y: this.speedAxisY[0] + 4,\n text: \"1.0X\",\n fontFamily: this.fontFamily || 'Arial, sans-serif'\n }, text),\n name: 'speed-text'\n });\n this.speedPoint = speedGroup.addShape('path', {\n attrs: __assign({\n path: this.getPointerPath(width - (!hideTimeTypeController ? SPEED_CONTROLLER_OFFSET : TOGGLE_MODEL_OFFSET), 0),\n matrix: [1, 0, 0, 0, 1, 0, 0, this.speedAxisY[4], 1]\n }, pointer),\n name: 'speed-pointer'\n });\n // 根据配置在 speedControllerStyle 中的 scale offsetX offsetY 缩放和移动速度控制器\n var currentBBox = this.speedGroup.getCanvasBBox();\n var centerX = (currentBBox.maxX + currentBBox.minX) / 2;\n var centerY = (currentBBox.maxY + currentBBox.minY) / 2;\n var matrix = this.speedGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n matrix = transform(matrix, [['t', -centerX, -centerY], ['s', scale, scale], ['t', centerX + offsetX * scale, centerY + offsetY * scale]]);\n this.speedGroup.setMatrix(matrix);\n };\n ControllerBtn.prototype.getPointerPath = function (x, y) {\n return [['M', x, y], ['L', x - 10, y - 4], ['L', x - 10, y + 4], ['Z']];\n };\n ControllerBtn.prototype.renderToggleTime = function () {\n var _a, _b;\n var _c = this.controllerCfg,\n width = _c.width,\n defaultTimeType = _c.defaultTimeType;\n var timeTypeControllerStyle = __assign(__assign({}, DEFAULT_TIMETYPE_CONTROLLER_STYLE), this.controllerCfg.timeTypeControllerStyle || {});\n var _d = timeTypeControllerStyle.scale,\n scale = _d === void 0 ? 1 : _d,\n _e = timeTypeControllerStyle.offsetX,\n offsetX = _e === void 0 ? 0 : _e,\n _f = timeTypeControllerStyle.offsetY,\n offsetY = _f === void 0 ? 0 : _f,\n _g = timeTypeControllerStyle.box,\n box = _g === void 0 ? {} : _g,\n _h = timeTypeControllerStyle.check,\n check = _h === void 0 ? {} : _h,\n _j = timeTypeControllerStyle.text,\n text = _j === void 0 ? {} : _j;\n this.toggleGroup = this.controllerGroup.addGroup({\n name: 'toggle-group'\n });\n var isChecked = defaultTimeType === TIME_TYPE.SINGLE;\n this.toggleGroup.addShape('rect', {\n attrs: __assign({\n x: width - TOGGLE_MODEL_OFFSET,\n y: this.speedAxisY[0] + 3.5\n }, box),\n isChecked: isChecked,\n name: 'toggle-model'\n });\n this.checkedIcon = this.toggleGroup.addShape('path', {\n attrs: __assign({\n path: [['M', width - TOGGLE_MODEL_OFFSET + 3, this.speedAxisY[1] + 6], ['L', width - TOGGLE_MODEL_OFFSET + 7, this.speedAxisY[1] + 10], ['L', width - TOGGLE_MODEL_OFFSET + 12, this.speedAxisY[1] + 4]]\n }, check),\n capture: false,\n name: 'check-icon'\n });\n if (!isChecked) this.checkedIcon.hide();\n this.checkedText = this.toggleGroup.addShape('text', {\n attrs: __assign({\n text: isChecked ? ((_a = this.controllerCfg) === null || _a === void 0 ? void 0 : _a.timeRangeControllerText) || '时间范围' : ((_b = this.controllerCfg) === null || _b === void 0 ? void 0 : _b.timePointControllerText) || '单一时间',\n x: width - TOGGLE_MODEL_OFFSET + 15,\n y: this.speedAxisY[0] + 4,\n fontFamily: typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif'\n }, text),\n name: 'checked-text'\n });\n // 根据配置在 timeTypeControllerStyle 中的 scale offsetX offsetY 缩放和移动速度控制器\n var currentBBox = this.toggleGroup.getCanvasBBox();\n var centerX = (currentBBox.maxX + currentBBox.minX) / 2;\n var centerY = (currentBBox.maxY + currentBBox.minY) / 2;\n var matrix = this.toggleGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n matrix = transform(matrix, [['t', -centerX, -centerY], ['s', scale, scale], ['t', centerX + offsetX * scale, centerY + offsetY * scale]]);\n this.toggleGroup.setMatrix(matrix);\n };\n ControllerBtn.prototype.bindEvent = function () {\n var _this = this;\n this.speedGroup.on('speed-rect:click', function (evt) {\n var currentPointerY = evt.target.attr('y1');\n var pointerMatrix = _this.speedPoint.attr('matrix');\n var currentYIdx = _this.speedAxisY.indexOf(pointerMatrix[7] || 0);\n var targetYIdx = _this.speedAxisY.indexOf(currentPointerY);\n var yDiff = _this.speedAxisY[targetYIdx] - _this.speedAxisY[currentYIdx];\n pointerMatrix = transform(pointerMatrix, [['t', 0, yDiff]]);\n _this.speedPoint.setMatrix(pointerMatrix);\n _this.currentSpeed = _this.speedAxisY.length - targetYIdx;\n _this.speedText.attr('text', \"\".concat(_this.currentSpeed, \".0X\"));\n _this.group.emit(_constant__WEBPACK_IMPORTED_MODULE_3__[\"TIMEBAR_CONFIG_CHANGE\"], {\n speed: _this.currentSpeed,\n type: _this.currentType\n });\n });\n this.speedGroup.on('mousewheel', function (evt) {\n evt.preventDefault();\n var pointerMatrix = _this.speedPoint.attr('matrix') || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var currentPointerY = pointerMatrix[7];\n var currentYIdx = _this.speedAxisY.indexOf(currentPointerY);\n if (currentYIdx === -1) {\n // 找到最近的一个 y\n var minDist_1 = Infinity;\n _this.speedAxisY.forEach(function (y, idx) {\n var dist = Math.abs(y - currentPointerY);\n if (minDist_1 > dist) {\n minDist_1 = dist;\n currentYIdx = idx;\n }\n });\n }\n if (evt.originalEvent.deltaY > 0) currentYIdx = Math.max(0, currentYIdx - 1);else currentYIdx = Math.min(_this.speedAxisY.length - 1, currentYIdx + 1);\n var yDiff = _this.speedAxisY[currentYIdx] - currentPointerY;\n pointerMatrix = transform(pointerMatrix, [['t', 0, yDiff]]);\n _this.speedPoint.setMatrix(pointerMatrix);\n _this.currentSpeed = _this.speedAxisY.length - currentYIdx;\n _this.speedText.attr('text', \"\".concat(_this.currentSpeed, \".0X\"));\n _this.group.emit(_constant__WEBPACK_IMPORTED_MODULE_3__[\"TIMEBAR_CONFIG_CHANGE\"], {\n speed: _this.currentSpeed,\n type: _this.currentType\n });\n });\n if (this.toggleGroup) {\n this.toggleGroup.on('toggle-model:click', function (evt) {\n var _a, _b;\n var isChecked = evt.target.get('isChecked');\n if (!isChecked) {\n _this.checkedIcon.show();\n _this.checkedText.attr('text', ((_a = _this.controllerCfg) === null || _a === void 0 ? void 0 : _a.timeRangeControllerText) || '时间范围');\n _this.currentType = TIME_TYPE.SINGLE;\n } else {\n _this.checkedIcon.hide();\n _this.checkedText.attr('text', ((_b = _this.controllerCfg) === null || _b === void 0 ? void 0 : _b.timePointControllerText) || '单一时间');\n _this.currentType = TIME_TYPE.RANGE;\n }\n evt.target.set('isChecked', !isChecked);\n _this.group.emit(_constant__WEBPACK_IMPORTED_MODULE_3__[\"TIMEBAR_CONFIG_CHANGE\"], {\n type: _this.currentType,\n speed: _this.currentSpeed\n });\n });\n }\n };\n ControllerBtn.prototype.destroy = function () {\n this.speedGroup.off('speed-rect:click');\n if (this.toggleGroup) {\n this.toggleGroup.off('toggle-model:click');\n this.toggleGroup.destroy();\n }\n this.speedGroup.destroy();\n };\n return ControllerBtn;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (ControllerBtn);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/interface/graph.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/interface/graph.js ***! - \**********************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/handler.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/timeBar/handler.js ***! + \************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/graph.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\nvar DEFAULT_STYLE = {\n fill: '#1890ff',\n stroke: '#1890ff',\n type: 'trend',\n radius: 2,\n opacity: 1,\n cursor: 'ew-resize',\n // 高亮的颜色\n highLightFill: '#0050b3'\n};\nvar SIMPLE_DEFAULT_STYLE = {\n fill: '#fff',\n stroke: '#1890ff',\n radius: 2,\n opacity: 1,\n cursor: 'ew-resize',\n // 高亮的颜色\n highLightFill: '#0050b3'\n};\nvar Handler = /** @class */function () {\n function Handler(cfg) {\n var group = cfg.group,\n name = cfg.name,\n type = cfg.type,\n _a = cfg.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfg.y,\n y = _b === void 0 ? 0 : _b,\n _c = cfg.width,\n width = _c === void 0 ? 2 : _c,\n _d = cfg.height,\n height = _d === void 0 ? 24 : _d,\n _e = cfg.style,\n style = _e === void 0 ? {} : _e;\n this.group = group;\n this.name = name;\n this.handleType = type;\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n if (type === 'trend') {\n this.style = __assign(__assign({}, DEFAULT_STYLE), style);\n } else if (type === 'simple') {\n this.style = __assign(__assign({}, SIMPLE_DEFAULT_STYLE), style);\n }\n this.renderHandle();\n }\n /**\n * 设置位置 x\n * @param x\n */\n Handler.prototype.setX = function (x) {\n this.setXY(x, undefined);\n };\n /**\n * 设置位置 y\n * @param y\n */\n Handler.prototype.setY = function (y) {\n this.setXY(undefined, y);\n };\n Handler.prototype.setXY = function (x, y) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(x)) {\n this.x = x;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(y)) {\n this.y = y;\n }\n this.updateXY();\n };\n /**\n * 初始化组件\n * @private\n */\n Handler.prototype.renderHandle = function () {\n var _a = this,\n width = _a.width,\n height = _a.height,\n style = _a.style,\n name = _a.name;\n var fill = style.fill,\n stroke = style.stroke,\n radius = style.radius,\n opacity = style.opacity,\n cursor = style.cursor;\n this.handleGroup = this.group.addGroup();\n // 趋势图时的 handle\n if (this.handleType === 'trend') {\n // 垂直线\n this.verticalLine = this.handleGroup.addShape('rect', {\n attrs: {\n x: 0,\n y: 0,\n width: width,\n height: height,\n fill: fill,\n stroke: stroke,\n radius: radius,\n opacity: opacity,\n cursor: cursor\n },\n name: \"\".concat(name, \"-handler\")\n });\n this.topCircle = this.handleGroup.addShape('circle', {\n attrs: {\n x: width / 2,\n y: 0,\n r: 2 * width,\n fill: fill,\n stroke: stroke,\n radius: radius,\n opacity: opacity,\n cursor: cursor,\n lineAppendWidth: 12\n },\n name: \"\".concat(name, \"-handler\")\n });\n this.bottomCircle = this.handleGroup.addShape('circle', {\n attrs: {\n x: width / 2,\n y: height,\n r: 2 * width,\n fill: fill,\n stroke: stroke,\n radius: radius,\n opacity: opacity,\n cursor: cursor\n },\n name: \"\".concat(name, \"-handler\")\n });\n } else if (this.handleType === 'simple') {\n this.topCircle = this.handleGroup.addShape('circle', {\n attrs: {\n x: width / 2,\n y: height / 2,\n r: 2 * width,\n fill: fill,\n stroke: stroke,\n radius: radius,\n opacity: opacity,\n cursor: cursor,\n lineWidth: 2\n },\n name: \"\".concat(name, \"-handler\")\n });\n }\n // 移动到对应的位置\n this.updateXY();\n if (this.handleType === 'trend') {\n this.bindTrendEvents();\n } else if (this.handleType === 'simple') {\n this.bindSimpleEvents();\n }\n };\n Handler.prototype.bindSimpleEvents = function () {\n var _this = this;\n var name = this.name;\n this.handleGroup.on(\"\".concat(name, \"-handler:mouseenter\"), function () {\n var highLightFill = _this.style.highLightFill;\n _this.topCircle.attr('fill', highLightFill);\n });\n this.handleGroup.on(\"\".concat(name, \"-handler:mouseleave\"), function () {\n var fill = _this.style.fill;\n _this.topCircle.attr('fill', fill);\n });\n };\n Handler.prototype.bindTrendEvents = function () {\n var _this = this;\n var name = this.name;\n this.handleGroup.on(\"\".concat(name, \"-handler:mouseenter\"), function () {\n var highLightFill = _this.style.highLightFill;\n _this.verticalLine.attr('fill', highLightFill);\n _this.topCircle.attr('fill', highLightFill);\n _this.bottomCircle.attr('fill', highLightFill);\n });\n this.handleGroup.on(\"\".concat(name, \"-handler:mouseleave\"), function () {\n var fill = _this.style.fill;\n _this.verticalLine.attr('fill', fill);\n _this.topCircle.attr('fill', fill);\n _this.bottomCircle.attr('fill', fill);\n });\n };\n Handler.prototype.show = function () {\n this.handleGroup.show();\n };\n Handler.prototype.hide = function () {\n this.handleGroup.hide();\n };\n Handler.prototype.updateXY = function () {\n this.handleGroup.setMatrix([1, 0, 0, 0, 1, 0, this.x, this.y, 1]);\n };\n return Handler;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Handler);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/handler.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/interface/index.js": +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/index.js": /*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/interface/index.js ***! + !*** ./node_modules/@antv/g6-plugin/es/timeBar/index.js ***! \**********************************************************/ -/*! exports provided: G6GraphEvent */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./graph */ \"./node_modules/@antv/g6-core/es/interface/graph.js\");\n/* empty/unused harmony star reexport *//* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./behavior */ \"./node_modules/@antv/g6-core/es/interface/behavior.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _behavior__WEBPACK_IMPORTED_MODULE_1__[\"G6GraphEvent\"]; });\n\n/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./item */ \"./node_modules/@antv/g6-core/es/interface/item.js\");\n/* empty/unused harmony star reexport *//* harmony import */ var _shape__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./shape */ \"./node_modules/@antv/g6-core/es/interface/shape.js\");\n/* empty/unused harmony star reexport */\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\n/* harmony import */ var _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-svg */ \"./node_modules/@antv/g-svg/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\n/* harmony import */ var _timeBarSlice__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./timeBarSlice */ \"./node_modules/@antv/g6-plugin/es/timeBar/timeBarSlice.js\");\n/* harmony import */ var _trendTimeBar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./trendTimeBar */ \"./node_modules/@antv/g6-plugin/es/timeBar/trendTimeBar.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n/**\n * 基于 G 的时间轴组件\n */\n\n\n\n\n\n\n\n\n// simple 版本默认高度\nvar DEFAULT_SIMPLE_HEIGHT = 4;\n// trend 版本默认高度\nvar DEFAULT_TREND_HEIGHT = 26;\nvar TimeBar = /** @class */function (_super) {\n __extends(TimeBar, _super);\n function TimeBar(config) {\n var _this = _super.call(this, config) || this;\n _this.afterrenderListener = function (e) {\n return _this.filterData({});\n };\n _this.valueChangeListener = Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"throttle\"])(function (e) {\n return _this.filterData(e);\n },\n // 不可简写,否则 filterData 中 this 指针不对\n 200, {\n trailing: true,\n leading: true\n });\n _this.changeData = function (e) {\n var graph = _this.get('graph');\n _this.cacheGraphData = graph.get('data');\n _this.filterData({});\n };\n return _this;\n }\n TimeBar.prototype.getDefaultCfgs = function () {\n return {\n container: null,\n className: 'g6-component-timebar',\n padding: 10,\n type: 'trend',\n trend: {\n data: [],\n isArea: false,\n smooth: true\n },\n controllerCfg: {\n speed: 1,\n loop: false\n },\n slider: {\n start: 0.1,\n end: 0.9,\n minText: 'min',\n maxText: 'max'\n },\n tick: {\n start: 0.1,\n end: 0.9,\n data: []\n },\n textStyle: {},\n filterEdge: false,\n filterItemTypes: ['node'],\n containerCSS: {},\n putInGraphContainer: true\n };\n };\n /**\n * 初始化 TimeBar 的容器\n */\n TimeBar.prototype.initContainer = function () {\n var graph = this.get('graph');\n var _a = this._cfgs,\n width = _a.width,\n height = _a.height,\n putInGraphContainer = _a.putInGraphContainer;\n var className = this.get('className') || 'g6-component-timebar';\n var container = this.get('container');\n var timeBarContainer;\n if (!container) {\n timeBarContainer = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(timeBarContainer, {\n position: 'relative'\n });\n } else {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n timeBarContainer = container;\n }\n if (putInGraphContainer) {\n var graphContainer = this.get('graph').get('container');\n graphContainer.appendChild(timeBarContainer);\n }\n this.set('timeBarContainer', timeBarContainer);\n var canvas;\n var renderer = graph.get('renderer');\n if (renderer === 'SVG') {\n canvas = new _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__[\"Canvas\"]({\n container: timeBarContainer,\n width: width,\n height: height\n });\n } else {\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"]({\n container: timeBarContainer,\n width: width,\n height: height\n });\n }\n // 根据传入的参数修改容器 CSS 样式\n if (this.get('containerCSS')) Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(timeBarContainer, this.get('containerCSS'));\n this.set('canvas', canvas);\n };\n TimeBar.prototype.init = function () {\n this.initContainer();\n var canvas = this.get('canvas');\n var timeBarGroup = canvas.addGroup({\n name: 'timebar-group'\n });\n this.set('timeBarGroup', timeBarGroup);\n this.renderTrend();\n this.initEvent();\n var fontFamily = typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif';\n this.set('fontFamily', fontFamily);\n };\n /**\n * 触发时间轴播放\n */\n TimeBar.prototype.play = function () {\n this.togglePlay(true);\n };\n /**\n * 触发时间轴暂停\n */\n TimeBar.prototype.pause = function () {\n this.togglePlay(false);\n };\n /**\n * 时间轴播放状态(播放/暂停)的切换\n */\n TimeBar.prototype.togglePlay = function (play) {\n var timebar = this.get('timebar');\n if (!timebar) return;\n timebar.isPlay = !!play;\n timebar.changePlayStatus();\n };\n TimeBar.prototype.renderTrend = function () {\n var _this = this;\n var _a = this._cfgs,\n width = _a.width,\n x = _a.x,\n y = _a.y,\n padding = _a.padding,\n type = _a.type,\n trend = _a.trend,\n slider = _a.slider,\n controllerCfg = _a.controllerCfg,\n textStyle = _a.textStyle,\n tick = _a.tick,\n backgroundStyle = _a.backgroundStyle,\n foregroundStyle = _a.foregroundStyle;\n var data = trend.data,\n other = __rest(trend, [\"data\"]);\n var realWidth = width - 2 * padding;\n var defaultHeight = type === 'trend' ? DEFAULT_TREND_HEIGHT : DEFAULT_SIMPLE_HEIGHT;\n var graph = this.get('graph');\n var group = this.get('timeBarGroup');\n var canvas = this.get('canvas');\n var timebar = null;\n if (type === 'trend' || type === 'simple') {\n var getValue_1 = this.get('getValue');\n timebar = new _trendTimeBar__WEBPACK_IMPORTED_MODULE_7__[\"default\"](__assign(__assign({\n graph: graph,\n canvas: canvas,\n group: group,\n type: type,\n x: x + padding,\n y: type === 'trend' ? y + padding : y + padding + 15,\n width: realWidth,\n height: defaultHeight,\n padding: padding,\n backgroundStyle: backgroundStyle,\n foregroundStyle: foregroundStyle,\n trendCfg: __assign(__assign({}, other), {\n data: data.map(function (d) {\n return (getValue_1 === null || getValue_1 === void 0 ? void 0 : getValue_1(d)) || d.value;\n })\n })\n }, slider), {\n tick: {\n ticks: data,\n tickLabelFormatter: tick.tickLabelFormatter,\n tickLabelStyle: tick.tickLabelStyle,\n tickLineStyle: tick.tickLineStyle\n },\n handlerStyle: __assign(__assign({}, slider.handlerStyle), {\n height: slider.height || defaultHeight\n }),\n controllerCfg: controllerCfg,\n textStyle: textStyle\n }));\n } else if (type === 'tick') {\n // 刻度时间轴\n timebar = new _timeBarSlice__WEBPACK_IMPORTED_MODULE_6__[\"default\"](__assign({\n graph: graph,\n canvas: canvas,\n group: group,\n x: x + padding,\n y: y + padding,\n width: width,\n height: 42,\n padding: 2,\n controllerCfg: controllerCfg\n }, tick));\n }\n // 鼠标按下左/右滑块或范围条后在任意地方释放,都触发暂停播放\n var handleMouseUp = function handleMouseUp() {\n var timebarInstance = _this.get('timebar');\n timebarInstance.draggingHandler = false;\n if (timebarInstance.isPlay) {\n timebarInstance.isPlay = false;\n timebarInstance.currentHandler = timebarInstance.maxHandlerShape;\n timebarInstance.changePlayStatus();\n }\n document.removeEventListener('mouseup', handleMouseUp);\n };\n canvas.on('mousedown', function (e) {\n if (e.target.get('name') === 'maxHandlerShape-handler' || e.target.get('name') === 'minHandlerShape-handler' || e.target === timebar.foregroundShape) {\n document.addEventListener('mouseup', handleMouseUp);\n }\n });\n this.set('timebar', timebar);\n };\n TimeBar.prototype.filterData = function (evt) {\n var _a;\n var value = evt.value;\n if (!value) {\n value = [];\n var type_1 = this._cfgs.type;\n if (!type_1 || type_1 === 'trend' || type_1 === 'simple') {\n value[0] = this._cfgs.slider.start;\n value[1] = this._cfgs.slider.end;\n } else if (type_1 === 'tick') {\n value[0] = this._cfgs.tick.start;\n value[1] = this._cfgs.tick.end;\n }\n }\n var trendData = null;\n var type = this._cfgs.type;\n if (type === 'trend' || type === 'simple') {\n trendData = this._cfgs.trend.data;\n } else if (type === 'tick') {\n trendData = this._cfgs.tick.data;\n }\n if (!trendData || trendData.length === 0) {\n console.warn('请配置 TimeBar 组件的数据');\n return;\n }\n var rangeChange = this.get('rangeChange');\n var graph = this.get('graph');\n var min = Math.round(trendData.length * value[0]);\n var max = Math.round(trendData.length * value[1]);\n max = max >= trendData.length ? trendData.length - 1 : max;\n min = min >= trendData.length ? trendData.length - 1 : min;\n var tickLabelFormatter = (_a = this._cfgs.tick) === null || _a === void 0 ? void 0 : _a.tickLabelFormatter;\n var minText = tickLabelFormatter ? tickLabelFormatter(trendData[min]) : trendData[min].date;\n var maxText = tickLabelFormatter ? tickLabelFormatter(trendData[max]) : trendData[max].date;\n if (type !== 'tick') {\n var timebar = this.get('timebar');\n timebar.setText(minText, maxText);\n }\n if (rangeChange) {\n rangeChange(graph, minText, maxText);\n } else {\n // 自动过滤数据,并渲染 graph\n if (!this.cacheGraphData || this.cacheGraphData.nodes && this.cacheGraphData.nodes.length === 0) {\n this.cacheGraphData = graph.get('data'); // graph.save() as GraphData;\n }\n\n var filterItemTypes = this.get('filterItemTypes');\n var changeData = this.get('changeData');\n // 过滤不在 min 和 max 范围内的节点\n var getDate_1 = this.get('getDate');\n var shouldIgnore_1 = this.get('shouldIgnore');\n var minDate_1 = trendData[min].date,\n maxDate_1 = trendData[max].date;\n if (changeData || changeData === undefined) {\n var originNodes = this.cacheGraphData.nodes;\n var originEdges = this.cacheGraphData.edges;\n var currentNodeExistMap_1 = {};\n var currentEdgeExistMap_1 = {};\n graph.getNodes().forEach(function (node) {\n return currentNodeExistMap_1[node.getID()] = true;\n });\n graph.getEdges().forEach(function (edge) {\n return currentEdgeExistMap_1[edge.getID()] = true;\n });\n if (filterItemTypes.includes('node')) {\n originNodes === null || originNodes === void 0 ? void 0 : originNodes.forEach(function (node) {\n var date = +((getDate_1 === null || getDate_1 === void 0 ? void 0 : getDate_1(node)) || node.date);\n var hitRange = date >= minDate_1 && date <= maxDate_1 || (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('node', node, {\n min: minDate_1,\n max: maxDate_1\n }));\n var exist = currentNodeExistMap_1[node.id];\n if (exist && !hitRange) {\n graph.removeItem(node.id);\n currentNodeExistMap_1[node.id] = false;\n } else if (!exist && hitRange) {\n graph.addItem('node', node);\n currentNodeExistMap_1[node.id] = true;\n }\n });\n // 过滤 source 或 target 不在 min 和 max 范围内的边\n originEdges === null || originEdges === void 0 ? void 0 : originEdges.forEach(function (edge) {\n var shouldShow = currentNodeExistMap_1[edge.source] && currentNodeExistMap_1[edge.target] || (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('edge', edge, {\n min: minDate_1,\n max: maxDate_1\n }));\n var exist = !!graph.findById(edge.id);\n if (exist && !shouldShow) {\n graph.removeItem(edge.id);\n currentEdgeExistMap_1[edge.id] = false;\n } else if (!exist && shouldShow) {\n graph.addItem('edge', edge);\n currentEdgeExistMap_1[edge.id] = true;\n } else if (!exist) {\n currentEdgeExistMap_1[edge.id] = false;\n }\n });\n }\n if (this.get('filterEdge') || filterItemTypes.includes('edge')) {\n originEdges === null || originEdges === void 0 ? void 0 : originEdges.filter(function (edge) {\n var date = +((getDate_1 === null || getDate_1 === void 0 ? void 0 : getDate_1(edge)) || edge.date);\n var hitRange = date >= minDate_1 && date <= maxDate_1 || (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('edge', edge, {\n min: minDate_1,\n max: maxDate_1\n }));\n var endsExist = currentNodeExistMap_1[edge.source] && currentNodeExistMap_1[edge.target];\n var shouldShow = hitRange && endsExist;\n var exist = currentEdgeExistMap_1[edge.id];\n if (exist && !shouldShow) {\n currentEdgeExistMap_1[edge.id] = false;\n graph.removeItem(edge.id);\n } else if (!exist && shouldShow) {\n currentEdgeExistMap_1[edge.id] = true;\n graph.addItem('edge', edge);\n }\n });\n }\n } else {\n if (filterItemTypes.includes('node')) {\n graph.getNodes().forEach(function (node) {\n var model = node.getModel();\n if (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('node', model, {\n min: minDate_1,\n max: maxDate_1\n })) return;\n var date = +((getDate_1 === null || getDate_1 === void 0 ? void 0 : getDate_1(model)) || model.date);\n if (date < minDate_1 || date > maxDate_1) {\n graph.hideItem(node);\n } else {\n graph.showItem(node);\n }\n });\n }\n if (this.get('filterEdge') || filterItemTypes.includes('edge')) {\n graph.getEdges().forEach(function (edge) {\n var model = edge.getModel();\n if (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('edge', model, {\n min: trendData[min].date,\n max: trendData[max].date\n })) return;\n var date = +((getDate_1 === null || getDate_1 === void 0 ? void 0 : getDate_1(model)) || model.date);\n if (date < trendData[min].date || date > trendData[max].date) {\n graph.hideItem(edge);\n } else {\n var sourceVisible = edge.getSource().isVisible();\n var targetVisible = edge.getTarget().isVisible();\n if (sourceVisible && targetVisible) graph.showItem(edge);\n }\n });\n }\n }\n }\n };\n TimeBar.prototype.initEvent = function () {\n var graph = this.get('graph');\n // 图数据变化,更新时间轴的原始数据\n graph.on('afterchangedata', this.changeData);\n // 图渲染,触发时间轴筛选\n graph.on('afterrender', this.afterrenderListener);\n // 时间轴的值发生改变的事件,触发筛选\n graph.on(_constant__WEBPACK_IMPORTED_MODULE_5__[\"VALUE_CHANGE\"], this.valueChangeListener);\n };\n TimeBar.prototype.destroy = function () {\n var graph = this.get('graph');\n graph.off('afterchangedata', this.changeData);\n graph.off('afterrender', this.afterrenderListener);\n graph.off(_constant__WEBPACK_IMPORTED_MODULE_5__[\"VALUE_CHANGE\"], this.valueChangeListener);\n var timebar = this.get('timebar');\n if (timebar && timebar.destory) {\n timebar.destory();\n }\n _super.prototype.destroy.call(this);\n var timeBarContainer = this.get('timeBarContainer');\n if (timeBarContainer) {\n var container = this.get('container');\n if (!container) {\n container = this.get('graph').get('container');\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_3__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n if (container === timeBarContainer) {\n container = container.parentElement;\n }\n container.removeChild(timeBarContainer);\n }\n };\n return TimeBar;\n}(_base__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (TimeBar);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/interface/item.js": +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/path.js": /*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/interface/item.js ***! + !*** ./node_modules/@antv/g6-plugin/es/timeBar/path.js ***! \*********************************************************/ -/*! no exports provided */ +/*! exports provided: getLinePath, getSmoothLinePath, dataToPath, dataToRectPath, getAreaLineY, linePathToAreaPath, getRectPoints, getRectPath */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/item.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLinePath\", function() { return getLinePath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSmoothLinePath\", function() { return getSmoothLinePath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataToPath\", function() { return dataToPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataToRectPath\", function() { return dataToRectPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAreaLineY\", function() { return getAreaLineY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"linePathToAreaPath\", function() { return linePathToAreaPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRectPoints\", function() { return getRectPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRectPath\", function() { return getRectPath; });\n/* harmony import */ var _antv_path_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/path-util */ \"./node_modules/@antv/path-util/esm/index.js\");\n/* harmony import */ var _antv_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/scale */ \"./node_modules/@antv/scale/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar __spreadArray = undefined && undefined.__spreadArray || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n/**\n * 点数组转 path\n * @param points\n */\nfunction pointsToPath(points) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(points, function (p, idx) {\n var command = idx === 0 ? 'M' : 'L';\n var x = p[0],\n y = p[1];\n return [command, x, y];\n });\n}\n/**\n * 将点连接成路径 path\n * @param points\n */\nfunction getLinePath(points) {\n return pointsToPath(points);\n}\n/**\n * 将点连成平滑的曲线\n * @param points\n */\nfunction getSmoothLinePath(points) {\n if (points.length <= 2) {\n // 两点以内直接绘制成路径\n return getLinePath(points);\n }\n var data = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(points, function (p) {\n // 当前点和上一个点一样的时候,忽略掉\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isEqual\"])(p, data.slice(data.length - 2))) {\n data.push(p[0], p[1]);\n }\n });\n var path = _antv_path_util__WEBPACK_IMPORTED_MODULE_0__[\"catmullRom2Bezier\"](data, false);\n var _a = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"head\"])(points),\n x = _a[0],\n y = _a[1];\n path.unshift(['M', x, y]);\n return path;\n}\n/**\n * 将数据转成 path,利用 scale 的归一化能力\n * @param data\n * @param width\n * @param height\n * @param smooth\n */\nfunction dataToPath(data, width, height, smooth) {\n if (smooth === void 0) {\n smooth = true;\n }\n // 利用 scale 来获取 y 上的映射\n var y = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Linear\"]({\n values: data\n });\n var x = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Category\"]({\n values: Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(data, function (v, idx) {\n return idx;\n })\n });\n var points = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(data, function (v, idx) {\n return [x.scale(idx) * width, height - y.scale(v) * height];\n });\n return smooth ? getSmoothLinePath(points) : getLinePath(points);\n}\nfunction dataToRectPath(data, width, height, barWidth) {\n if (barWidth === void 0) {\n barWidth = 5;\n }\n // 利用 scale 来获取 y 上的映射\n var y = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Linear\"]({\n values: data\n });\n var x = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Category\"]({\n values: Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(data, function (v, idx) {\n return idx;\n })\n });\n var points = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(data, function (v, idx) {\n return [x.scale(idx) * width, height - y.scale(v) * height];\n });\n var rectPoints = [];\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n var param = {\n x: point[0],\n y: point[1],\n y0: height,\n size: barWidth\n };\n var rectPoint = getRectPoints(param);\n rectPoints.push.apply(rectPoints, rectPoint);\n }\n return getRectPath(rectPoints);\n}\n/**\n * 获得 area 面积的横向连接线的 px 位置\n * @param data\n * @param width\n * @param height\n */\nfunction getAreaLineY(data, height) {\n var y = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Linear\"]({\n values: data\n });\n var lineY = Math.max(0, y.min);\n return height - y.scale(lineY) * height;\n}\n/**\n * 线 path 转 area path\n * @param path\n * @param width\n * @param height\n */\nfunction linePathToAreaPath(path, width, height, data) {\n var areaPath = __spreadArray([], path, true);\n var lineYPx = getAreaLineY(data, height);\n areaPath.push(['L', width, lineYPx]);\n areaPath.push(['L', 0, lineYPx]);\n areaPath.push(['Z']);\n return areaPath;\n}\n/**\n * @ignore\n * 根据数据点生成矩形的四个关键点\n * @param pointInfo 数据点信息\n * @returns rect points 返回矩形四个顶点信息\n */\nfunction getRectPoints(pointInfo) {\n var x = pointInfo.x,\n y = pointInfo.y,\n y0 = pointInfo.y0,\n size = pointInfo.size;\n // 有 4 种情况,\n // 1. x, y 都不是数组\n // 2. y是数组,x不是\n // 3. x是数组,y不是\n // 4. x, y 都是数组\n var yMin;\n var yMax;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(y)) {\n yMin = y[0], yMax = y[1];\n } else {\n yMin = y0;\n yMax = y;\n }\n var xMin;\n var xMax;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(x)) {\n xMin = x[0], xMax = x[1];\n } else {\n xMin = x - size / 2;\n xMax = x + size / 2;\n }\n var points = [{\n x: xMin,\n y: yMin\n }, {\n x: xMin,\n y: yMax\n }];\n // 矩形的四个关键点,结构如下(左下角顺时针连接)\n // 1 ---- 2\n // | |\n // 0 ---- 3\n points.push({\n x: xMax,\n y: yMax\n }, {\n x: xMax,\n y: yMin\n });\n return points;\n}\n/**\n * @ignore\n * 根据矩形关键点绘制 path\n * @param points 关键点数组\n * @param isClosed path 是否需要闭合\n * @returns 返回矩形的 path\n */\nfunction getRectPath(points, isClosed) {\n if (isClosed === void 0) {\n isClosed = true;\n }\n var path = [];\n var firstPoint = points[0];\n path.push(['M', firstPoint.x, firstPoint.y]);\n for (var i = 1, len = points.length; i < len; i++) {\n path.push(['L', points[i].x, points[i].y]);\n }\n // 对于 shape=\"line\" path 不应该闭合,否则会造成 lineCap 绘图属性失效\n if (isClosed) {\n path.push(['L', firstPoint.x, firstPoint.y]); // 需要闭合\n path.push(['z']);\n }\n return path;\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/path.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/interface/shape.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/interface/shape.js ***! - \**********************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/timeBarSlice.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/timeBar/timeBarSlice.js ***! + \*****************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/interface/shape.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _timeBarTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timeBarTooltip */ \"./node_modules/@antv/g6-plugin/es/timeBar/timeBarTooltip.js\");\n/* harmony import */ var _controllerBtn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controllerBtn */ \"./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n/**\n * 基于 G 的刻度时间轴组件\n */\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"ext\"].transform;\nvar DEFAULT_SELECTEDTICK_STYLE = {\n fill: '#5B8FF9'\n};\nvar DEFAULT_UNSELECTEDTICK_STYLE = {\n fill: '#e6e8e9'\n};\nvar TimeBarSlice = /** @class */function () {\n function TimeBarSlice(cfgs) {\n this.frameCount = 0;\n this.fontFamily = 'Arial, sans-serif';\n var graph = cfgs.graph,\n canvas = cfgs.canvas,\n group = cfgs.group,\n width = cfgs.width,\n height = cfgs.height,\n padding = cfgs.padding,\n data = cfgs.data,\n start = cfgs.start,\n end = cfgs.end,\n _a = cfgs.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfgs.y,\n y = _b === void 0 ? 0 : _b,\n tickLabelFormatter = cfgs.tickLabelFormatter,\n _c = cfgs.selectedTickStyle,\n selectedTickStyle = _c === void 0 ? DEFAULT_SELECTEDTICK_STYLE : _c,\n _d = cfgs.unselectedTickStyle,\n unselectedTickStyle = _d === void 0 ? DEFAULT_UNSELECTEDTICK_STYLE : _d,\n tooltipBackgroundColor = cfgs.tooltipBackgroundColor,\n tooltipFomatter = cfgs.tooltipFomatter,\n tickLabelStyle = cfgs.tickLabelStyle,\n _e = cfgs.controllerCfg,\n controllerCfg = _e === void 0 ? {\n speed: 1\n } : _e;\n this.graph = graph;\n this.group = group;\n this.sliceGroup = group.addGroup({\n name: 'slice-group'\n });\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this.padding = padding;\n this.data = data;\n this.start = start;\n this.end = end;\n this.tickLabelFormatter = tickLabelFormatter;\n this.tickLabelStyle = tickLabelStyle || {};\n this.selectedTickStyle = selectedTickStyle;\n this.unselectedTickStyle = unselectedTickStyle;\n this.controllerCfg = controllerCfg;\n this.currentSpeed = controllerCfg.speed || 1;\n this.x = x;\n this.y = y;\n this.tooltipBackgroundColor = tooltipBackgroundColor;\n this.tooltipFomatter = tooltipFomatter;\n // 初始化 fontFamily,如果有浏览器,取 body 上的字体,防止文字更新时局部渲染造成的重影\n this.fontFamily = typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif';\n this.renderSlices();\n this.initEvent();\n }\n TimeBarSlice.prototype.renderSlices = function () {\n var _this = this;\n var _a = this,\n width = _a.width,\n height = _a.height,\n padding = _a.padding,\n data = _a.data,\n start = _a.start,\n end = _a.end,\n tickLabelFormatter = _a.tickLabelFormatter,\n selectedTickStyle = _a.selectedTickStyle,\n unselectedTickStyle = _a.unselectedTickStyle,\n tickLabelStyle = _a.tickLabelStyle;\n var realWidth = width - 2 * padding;\n var fontSize = 10;\n var labelLineHeight = 4;\n var labelAreaHeight = 3 * padding + labelLineHeight + fontSize;\n var ticksAreaHeight = height - labelAreaHeight - 2 * padding;\n var gap = 2;\n var ticksLength = data.length;\n var tickWidth = (realWidth - gap * (ticksLength - 1)) / ticksLength;\n this.tickWidth = tickWidth;\n var sliceGroup = this.sliceGroup;\n var tickRects = [];\n var labels = [];\n var startTickId = Math.round(ticksLength * start);\n var endTickId = Math.round(ticksLength * end);\n this.startTickRectId = startTickId;\n this.endTickRectId = endTickId;\n var rotate = tickLabelStyle.rotate;\n delete tickLabelStyle.rotate;\n data.forEach(function (d, i) {\n // draw the tick rects\n var selected = i >= startTickId && i <= endTickId;\n var tickStyle = selected ? selectedTickStyle : unselectedTickStyle;\n var rect = sliceGroup.addShape('rect', {\n attrs: __assign({\n x: padding + i * (tickWidth + gap),\n y: padding,\n width: tickWidth,\n height: ticksAreaHeight\n }, tickStyle),\n draggable: true,\n name: \"tick-rect-\".concat(i)\n });\n // draw the pick tick rects\n var pickRect = sliceGroup.addShape('rect', {\n attrs: {\n x: padding + i * tickWidth + gap * (2 * i - 1) / 2,\n y: padding,\n width: i === 0 || i === ticksLength - 1 ? tickWidth + gap / 2 : tickWidth + gap,\n height: ticksAreaHeight,\n fill: '#fff',\n opacity: 0\n },\n draggable: true,\n name: \"pick-rect-\".concat(i)\n });\n pickRect.toFront();\n var rectBBox = rect.getBBox();\n var centerX = (rectBBox.minX + rectBBox.maxX) / 2;\n tickRects.push({\n rect: rect,\n pickRect: pickRect,\n value: d.date,\n x: centerX,\n y: rectBBox.minY\n });\n var label;\n if (tickLabelFormatter) {\n label = tickLabelFormatter(d);\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(label) && label) {\n // return true\n label = d.date;\n }\n } else if (i % Math.round(ticksLength / 10) === 0) {\n label = d.date;\n }\n if (label) {\n labels.push(label);\n // draw tick lines\n var lineStartY = rectBBox.maxY + padding * 2;\n sliceGroup.addShape('line', {\n attrs: {\n stroke: '#BFBFBF',\n x1: centerX,\n y1: lineStartY,\n x2: centerX,\n y2: lineStartY + labelLineHeight\n },\n name: 'tick-line'\n });\n var labelStartY = lineStartY + labelLineHeight + padding;\n var text = sliceGroup.addShape('text', {\n attrs: __assign({\n fill: '#8c8c8c',\n stroke: '#fff',\n lineWidth: 1,\n x: centerX,\n y: labelStartY,\n textAlign: 'center',\n text: label,\n textBaseline: 'top',\n fontSize: 10,\n fontFamily: _this.fontFamily || 'Arial, sans-serif'\n }, tickLabelStyle),\n capture: false,\n name: 'tick-label'\n });\n var textBBox = text.getBBox();\n if (textBBox.maxX > width) {\n text.attr('textAlign', 'right');\n } else if (textBBox.minX < 0) {\n text.attr('textAlign', 'left');\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(rotate) && labels.length !== 10) {\n var matrix = transform([1, 0, 0, 0, 1, 0, 0, 0, 1], [['t', -centerX, -labelStartY], ['r', rotate], ['t', centerX - 5, labelStartY + 2]]);\n text.attr({\n textAlign: 'left',\n matrix: matrix\n });\n }\n if (labels.length === 1) {\n text.attr({\n textAlign: 'left'\n });\n } else if (labels.length === 10) {\n text.attr({\n textAlign: 'right'\n });\n }\n // draw tick labels\n }\n });\n\n this.tickRects = tickRects;\n // 渲染播放、快进和后退的控制按钮\n var group = this.group;\n this.currentSpeed = 1;\n this.controllerBtnGroup = new _controllerBtn__WEBPACK_IMPORTED_MODULE_3__[\"default\"](__assign({\n group: group,\n x: this.x,\n y: this.y + height + 5,\n width: width,\n height: 40,\n hideTimeTypeController: true,\n speed: this.currentSpeed,\n fontFamily: this.fontFamily || 'Arial, sans-serif'\n }, this.controllerCfg));\n };\n TimeBarSlice.prototype.initEvent = function () {\n var _this = this;\n var sliceGroup = this.sliceGroup;\n sliceGroup.on('click', function (e) {\n var targetRect = e.target;\n if (targetRect.get('type') !== 'rect' || !targetRect.get('name')) return;\n var id = parseInt(targetRect.get('name').split('-')[2], 10);\n if (!isNaN(id)) {\n var tickRects_1 = _this.tickRects;\n // cancel the selected ticks\n var unselectedTickStyle_1 = _this.unselectedTickStyle;\n tickRects_1.forEach(function (tickRect) {\n tickRect.rect.attr(unselectedTickStyle_1);\n });\n var selectedTickStyle = _this.selectedTickStyle;\n tickRects_1[id].rect.attr(selectedTickStyle);\n _this.startTickRectId = id;\n _this.endTickRectId = id;\n var ticksLength = tickRects_1.length;\n var start = id / ticksLength;\n _this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, start]\n });\n }\n });\n sliceGroup.on('dragstart', function (e) {\n var tickRects = _this.tickRects;\n // cancel the selected ticks\n var unselectedTickStyle = _this.unselectedTickStyle;\n tickRects.forEach(function (tickRect) {\n tickRect.rect.attr(unselectedTickStyle);\n });\n var targetRect = e.target;\n var id = parseInt(targetRect.get('name').split('-')[2], 10);\n var selectedTickStyle = _this.selectedTickStyle;\n tickRects[id].rect.attr(selectedTickStyle);\n _this.startTickRectId = id;\n var ticksLength = tickRects.length;\n var start = id / ticksLength;\n _this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, start]\n });\n _this.dragging = true;\n });\n sliceGroup.on('dragover', function (e) {\n if (!_this.dragging) return;\n if (e.target.get('type') !== 'rect') return;\n var id = parseInt(e.target.get('name').split('-')[2], 10);\n var startTickRectId = _this.startTickRectId;\n var tickRects = _this.tickRects;\n var selectedTickStyle = _this.selectedTickStyle;\n var unselectedTickStyle = _this.unselectedTickStyle;\n for (var i = 0; i < tickRects.length; i++) {\n var style = i >= startTickRectId && i <= id ? selectedTickStyle : unselectedTickStyle;\n tickRects[i].rect.attr(style);\n }\n var ticksLength = tickRects.length;\n _this.endTickRectId = id;\n var start = startTickRectId / ticksLength;\n var end = id / ticksLength;\n _this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, end]\n });\n });\n sliceGroup.on('drop', function (e) {\n if (!_this.dragging) return;\n _this.dragging = false;\n if (e.target.get('type') !== 'rect') return;\n var startTickRectId = _this.startTickRectId;\n var id = parseInt(e.target.get('name').split('-')[2], 10);\n if (id < startTickRectId) return;\n var selectedTickStyle = _this.selectedTickStyle;\n var tickRects = _this.tickRects;\n tickRects[id].rect.attr(selectedTickStyle);\n _this.endTickRectId = id;\n var ticksLength = tickRects.length;\n var start = startTickRectId / ticksLength;\n var end = id / ticksLength;\n _this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, end]\n });\n });\n // tooltip\n var _a = this,\n tooltipBackgroundColor = _a.tooltipBackgroundColor,\n tooltipFomatter = _a.tooltipFomatter,\n canvas = _a.canvas;\n var tooltip = new _timeBarTooltip__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n container: canvas.get('container'),\n backgroundColor: tooltipBackgroundColor\n });\n var tickRects = this.tickRects;\n tickRects.forEach(function (tickRect) {\n var pickRect = tickRect.pickRect;\n pickRect.on('mouseenter', function (e) {\n var rect = e.target;\n if (rect.get('type') !== 'rect') return;\n var id = parseInt(rect.get('name').split('-')[2], 10);\n var clientPoint = canvas.getClientByPoint(tickRects[id].x, tickRects[id].y);\n tooltip.show({\n x: tickRects[id].x,\n y: tickRects[id].y,\n clientX: clientPoint.x,\n clientY: clientPoint.y,\n text: tooltipFomatter ? tooltipFomatter(tickRects[id].value) : tickRects[id].value\n });\n });\n pickRect.on('mouseleave', function (e) {\n tooltip.hide();\n });\n });\n // play controller events\n var group = this.group;\n // 播放区按钮控制\n /** 播放/暂停事件 */\n group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"PLAY_PAUSE_BTN\"], \":click\"), function () {\n _this.isPlay = !_this.isPlay;\n _this.changePlayStatus();\n });\n // 处理前进一步的事件\n group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"NEXT_STEP_BTN\"], \":click\"), function () {\n _this.updateStartEnd(1);\n });\n // 处理后退一步的事件\n group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"PRE_STEP_BTN\"], \":click\"), function () {\n _this.updateStartEnd(-1);\n });\n group.on(_constant__WEBPACK_IMPORTED_MODULE_4__[\"TIMEBAR_CONFIG_CHANGE\"], function (_a) {\n var type = _a.type,\n speed = _a.speed;\n _this.currentSpeed = speed;\n });\n };\n TimeBarSlice.prototype.changePlayStatus = function (isSync) {\n if (isSync === void 0) {\n isSync = true;\n }\n this.controllerBtnGroup.playButton.update({\n isPlay: this.isPlay\n });\n if (this.isPlay) {\n // 开始播放\n this.playHandler = this.startPlay();\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"TIMELINE_START\"], null);\n } else {\n // 结束播放\n if (this.playHandler) {\n if (typeof window !== 'undefined') window.cancelAnimationFrame(this.playHandler);\n if (isSync) {\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"TIMELINE_END\"], null);\n }\n }\n }\n };\n TimeBarSlice.prototype.startPlay = function () {\n var _this = this;\n return typeof window !== 'undefined' ? window.requestAnimationFrame(function () {\n var speed = _this.currentSpeed;\n // 一分钟刷新一次\n if (_this.frameCount % (60 / speed) === 0) {\n _this.frameCount = 0;\n _this.updateStartEnd(1);\n }\n _this.frameCount++;\n if (_this.isPlay) {\n _this.playHandler = _this.startPlay();\n }\n }) : undefined;\n };\n TimeBarSlice.prototype.updateStartEnd = function (sign) {\n var self = this;\n var tickRects = this.tickRects;\n var ticksLength = tickRects.length;\n var unselectedTickStyle = this.unselectedTickStyle;\n var selectedTickStyle = this.selectedTickStyle;\n var previousEndTickRectId = self.endTickRectId;\n if (sign > 0) {\n self.endTickRectId++;\n } else {\n tickRects[self.endTickRectId].rect.attr(unselectedTickStyle);\n self.endTickRectId--;\n }\n // 若此时 start 与 end 不同,范围前进/后退/播放\n if (previousEndTickRectId !== self.startTickRectId) {\n if (self.endTickRectId < self.startTickRectId) {\n self.startTickRectId = self.endTickRectId;\n }\n } else {\n // 否则是单帧的前进/后退/播放\n for (var i = self.startTickRectId; i <= self.endTickRectId - 1; i++) {\n tickRects[i].rect.attr(unselectedTickStyle);\n }\n self.startTickRectId = self.endTickRectId;\n }\n if (tickRects[self.endTickRectId]) {\n tickRects[self.endTickRectId].rect.attr(selectedTickStyle);\n var start = self.startTickRectId / ticksLength;\n var end = self.endTickRectId / ticksLength;\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, end]\n });\n }\n };\n TimeBarSlice.prototype.destory = function () {\n var group = this.sliceGroup;\n group.off('click');\n group.off('dragstart');\n group.off('dragover');\n group.off('drop');\n this.tickRects.forEach(function (tickRect) {\n var pickRect = tickRect.pickRect;\n pickRect.off('mouseenter');\n pickRect.off('mouseleave');\n });\n this.tickRects.length = 0;\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"PLAY_PAUSE_BTN\"], \":click\"));\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"NEXT_STEP_BTN\"], \":click\"));\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"PRE_STEP_BTN\"], \":click\"));\n group.off(_constant__WEBPACK_IMPORTED_MODULE_4__[\"TIMEBAR_CONFIG_CHANGE\"]);\n this.sliceGroup.destroy();\n };\n return TimeBarSlice;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (TimeBarSlice);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/timeBarSlice.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/item/combo.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/item/combo.js ***! - \*****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/timeBarTooltip.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/timeBar/timeBarTooltip.js ***! + \*******************************************************************/ +/*! exports provided: BACKGROUND_STYLE, ARROW_STYLE, TEXT_STYLE, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _node__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./node */ \"./node_modules/@antv/g6-core/es/item/node.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n\n\nvar CACHE_BBOX = 'bboxCache';\nvar CACHE_CANVAS_BBOX = 'bboxCanvasCache';\nvar CACHE_SIZE = 'sizeCache';\nvar CACHE_ANCHOR_POINTS = 'anchorPointsCache';\n\nvar Combo =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Combo, _super);\n\n function Combo() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n Combo.prototype.getDefaultCfg = function () {\n return {\n type: 'combo',\n nodes: [],\n edges: [],\n combos: []\n };\n };\n\n Combo.prototype.getShapeCfg = function (model) {\n var styles = this.get('styles');\n var bbox = this.get('bbox');\n\n if (styles && bbox) {\n // merge graph的item样式与数据模型中的样式\n var newModel = model;\n var size = {\n r: Math.hypot(bbox.height, bbox.width) / 2 || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.size[0] / 2,\n width: bbox.width || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.size[0],\n height: bbox.height || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.size[1]\n };\n newModel.style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), model.style), size);\n var padding = model.padding || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultCombo.padding;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"isNumber\"])(padding)) {\n size.r += padding;\n size.width += padding * 2;\n size.height += padding * 2;\n } else {\n size.r += padding[0];\n size.width += padding[1] + padding[3] || padding[1] * 2;\n size.height += padding[0] + padding[2] || padding[0] * 2;\n }\n\n this.set(CACHE_SIZE, size);\n return newModel;\n }\n\n return model;\n };\n /**\n * 根据 keyshape 计算包围盒\n */\n\n\n Combo.prototype.calculateCanvasBBox = function () {\n if (this.destroyed) return;\n var keyShape = this.get('keyShape');\n var group = this.get('group'); // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n\n var bbox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_3__[\"getBBox\"])(keyShape, group);\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n var cacheSize = this.get(CACHE_SIZE);\n var cacheBBox = this.get(CACHE_BBOX) || {};\n var oriX = cacheBBox.x;\n var oriY = cacheBBox.x;\n\n if (cacheSize) {\n cacheSize.width = Math.max(cacheSize.width, bbox.width);\n cacheSize.height = Math.max(cacheSize.height, bbox.height);\n var type = keyShape.get('type');\n\n if (type === 'circle') {\n bbox.width = cacheSize.r * 2;\n bbox.height = cacheSize.r * 2;\n } else {\n bbox.width = cacheSize.width;\n bbox.height = cacheSize.height;\n }\n\n bbox.minX = bbox.centerX - bbox.width / 2;\n bbox.minY = bbox.centerY - bbox.height / 2;\n bbox.maxX = bbox.centerX + bbox.width / 2;\n bbox.maxY = bbox.centerY + bbox.height / 2;\n } else {\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n }\n\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n if (bbox.x !== oriX || bbox.y !== oriY) this.set(CACHE_ANCHOR_POINTS, null);\n return bbox;\n };\n /**\n * 获取 Combo 中所有的子元素,包括 Combo、Node 及 Edge\n */\n\n\n Combo.prototype.getChildren = function () {\n var self = this;\n return {\n nodes: self.getNodes(),\n combos: self.getCombos()\n };\n };\n /**\n * 获取 Combo 中所有子节点\n */\n\n\n Combo.prototype.getNodes = function () {\n var self = this;\n return self.get('nodes');\n };\n /**\n * 获取 Combo 中所有子 combo\n */\n\n\n Combo.prototype.getCombos = function () {\n var self = this;\n return self.get('combos');\n };\n /**\n * 向 Combo 中增加子 combo 或 node\n * @param item Combo 或节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n\n\n Combo.prototype.addChild = function (item) {\n var self = this;\n var itemType = item.getType();\n\n switch (itemType) {\n case 'node':\n self.addNode(item);\n break;\n\n case 'combo':\n self.addCombo(item);\n break;\n\n default:\n console.warn('Only node or combo items are allowed to be added into a combo');\n return false;\n }\n\n return true;\n };\n /**\n * 向 Combo 中增加 combo\n * @param combo Combo 实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n\n\n Combo.prototype.addCombo = function (combo) {\n var self = this;\n self.get('combos').push(combo);\n return true;\n };\n /**\n * 向 Combo 中添加节点\n * @param node 节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n\n\n Combo.prototype.addNode = function (node) {\n var self = this;\n self.get('nodes').push(node);\n return true;\n };\n /**\n * 向 Combo 中增加子 combo 或 node\n * @param item Combo 或节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n\n\n Combo.prototype.removeChild = function (item) {\n var self = this;\n var itemType = item.getType();\n\n switch (itemType) {\n case 'node':\n self.removeNode(item);\n break;\n\n case 'combo':\n self.removeCombo(item);\n break;\n\n default:\n console.warn('Only node or combo items are allowed to be added into a combo');\n return false;\n }\n\n return true;\n };\n /**\n * 从 Combo 中移除指定的 combo\n * @param combo Combo 实例\n * @return boolean 移除成功返回 true,否则返回 false\n */\n\n\n Combo.prototype.removeCombo = function (combo) {\n if (!combo) return;\n var combos = this.getCombos();\n var index = combos.indexOf(combo);\n\n if (index > -1) {\n combos.splice(index, 1);\n return true;\n }\n\n return false;\n };\n /**\n * 向 Combo 中移除指定的节点\n * @param node 节点实例\n * @return boolean 移除成功返回 true,否则返回 false\n */\n\n\n Combo.prototype.removeNode = function (node) {\n if (!node) return;\n var nodes = this.getNodes();\n var index = nodes.indexOf(node);\n\n if (index > -1) {\n nodes.splice(index, 1);\n return true;\n }\n\n return false;\n };\n\n Combo.prototype.getUpdateType = function (cfg) {\n return undefined;\n };\n /**\n * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n\n\n Combo.prototype.getBBox = function () {\n this.set(CACHE_CANVAS_BBOX, null);\n var bbox = this.calculateCanvasBBox();\n return bbox;\n };\n\n Combo.prototype.clearCache = function () {\n this.set(CACHE_BBOX, null); // 清理缓存的 bbox\n\n this.set(CACHE_CANVAS_BBOX, null);\n this.set(CACHE_ANCHOR_POINTS, null);\n };\n\n Combo.prototype.destroy = function () {\n if (!this.destroyed) {\n var animate = this.get('animate');\n var group = this.get('group');\n\n if (animate) {\n group.stopAnimate();\n }\n\n group['shapeMap'] = {};\n this.clearCache();\n this.set(CACHE_SIZE, null);\n this.set('bbox', null);\n group.remove();\n this._cfg = null;\n this.destroyed = true;\n }\n };\n\n return Combo;\n}(_node__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Combo);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/combo.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BACKGROUND_STYLE\", function() { return BACKGROUND_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ARROW_STYLE\", function() { return ARROW_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TEXT_STYLE\", function() { return TEXT_STYLE; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n\n\nvar BACKGROUND_STYLE = {\n opacity: 0.5,\n fill: '#000'\n};\nvar ARROW_STYLE = {\n opacity: 0.5,\n fill: '#000',\n r: 5\n};\nvar TEXT_STYLE = {\n fill: '#fff',\n fontSize: 12\n};\n/**\n * 缩略趋势图\n */\nvar TimeBarTooltip = /** @class */function () {\n function TimeBarTooltip(cfg) {\n var _a = cfg.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfg.y,\n y = _b === void 0 ? 0 : _b,\n container = cfg.container,\n text = cfg.text,\n _c = cfg.padding,\n padding = _c === void 0 ? [4, 4, 4, 4] : _c,\n _d = cfg.className,\n className = _d === void 0 ? 'g6-component-timebar-tooltip' : _d,\n _e = cfg.backgroundColor,\n backgroundColor = _e === void 0 ? '#000' : _e,\n _f = cfg.textColor,\n textColor = _f === void 0 ? '#fff' : _f,\n _g = cfg.opacity,\n opacity = _g === void 0 ? 0.8 : _g,\n _h = cfg.fontSize,\n fontSize = _h === void 0 ? 12 : _h;\n this.container = container;\n this.className = className;\n this.backgroundColor = backgroundColor;\n this.textColor = textColor;\n this.x = x;\n this.y = y;\n this.text = text;\n this.padding = padding;\n this.opacity = opacity;\n this.fontSize = fontSize;\n this.render();\n }\n /**\n * 首次渲染\n * @private\n */\n TimeBarTooltip.prototype.render = function () {\n var self = this;\n var className = self.className,\n x = self.x,\n y = self.y,\n backgroundColor = self.backgroundColor,\n textColor = self.textColor,\n text = self.text,\n padding = self.padding,\n opacity = self.opacity,\n fontSize = self.fontSize;\n var parentNode = self.container;\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"createDom\"])(\"
\"));\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(parentNode)) {\n parentNode = document.getElementById(parentNode);\n }\n parentNode.appendChild(container);\n self.parentHeight = parentNode.offsetHeight;\n self.parentWidth = parentNode.offsetWidth;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(container, {\n visibility: 'hidden',\n top: 0,\n left: 0\n });\n var background = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"createDom\"])(\"\\n
\"));\n background.innerHTML = text;\n container.appendChild(background);\n self.backgroundDOM = background;\n var arrow = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"createDom\"])(\"
\"));\n container.appendChild(arrow);\n self.arrowDOM = arrow;\n self.container = container;\n };\n TimeBarTooltip.prototype.show = function (cfg) {\n var self = this;\n var text = cfg.text,\n x = cfg.x,\n y = cfg.y,\n clientX = cfg.clientX,\n clientY = cfg.clientY;\n self.backgroundDOM.innerHTML = text;\n var backgroundWidth = self.backgroundDOM.offsetWidth;\n var backgroundHeight = self.backgroundDOM.offsetHeight;\n var arrowWidth = self.arrowDOM.offsetWidth;\n var arrowHeight = self.arrowDOM.offsetHeight;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.container, {\n top: \"\".concat(-backgroundHeight - arrowHeight, \"px\"),\n left: \"\".concat(x, \"px\"),\n visibility: 'visible'\n });\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.backgroundDOM, {\n marginLeft: \"\".concat(-backgroundWidth / 2, \"px\")\n });\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.arrowDOM, {\n marginLeft: \"\".concat(-arrowWidth / 2, \"px\"),\n top: \"\".concat(backgroundHeight, \"px\")\n });\n var left = x - backgroundWidth / 2;\n var right = x + backgroundWidth / 2;\n if (left < 0) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.backgroundDOM, {\n marginLeft: \"\".concat(-backgroundWidth / 2 - left, \"px\")\n });\n } else if (right > self.parentWidth) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.backgroundDOM, {\n marginLeft: \"\".concat(-backgroundWidth / 2 - right + self.parentWidth + 12, \"px\")\n });\n }\n };\n TimeBarTooltip.prototype.hide = function () {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(this.container, {\n top: 0,\n left: 0,\n visibility: 'hidden'\n });\n };\n return TimeBarTooltip;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (TimeBarTooltip);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/timeBarTooltip.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/item/edge.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/item/edge.js ***! - \****************************************************/ +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/timeButton.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/timeBar/timeButton.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./item */ \"./node_modules/@antv/g6-core/es/item/item.js\");\n\n\n\nvar END_MAP = {\n source: 'start',\n target: 'end'\n};\nvar ITEM_NAME_SUFFIX = 'Node'; // 端点的后缀,如 sourceNode, targetNode\n\nvar POINT_NAME_SUFFIX = 'Point'; // 起点或者结束点的后缀,如 startPoint, endPoint\n\nvar ANCHOR_NAME_SUFFIX = 'Anchor';\n\nvar Edge =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Edge, _super);\n\n function Edge() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n Edge.prototype.getDefaultCfg = function () {\n return {\n type: 'edge',\n sourceNode: null,\n targetNode: null,\n startPoint: null,\n endPoint: null,\n linkCenter: false\n };\n };\n\n Edge.prototype.setEnd = function (name, value) {\n var pointName = END_MAP[name] + POINT_NAME_SUFFIX;\n var itemName = name + ITEM_NAME_SUFFIX;\n var preItem = this.get(itemName);\n\n if (preItem && !preItem.destroyed) {\n // 如果之前存在节点,则移除掉边\n preItem.removeEdge(this);\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(value)) {\n // 如果设置成具体的点,则清理节点\n this.set(pointName, value);\n this.set(itemName, null);\n } else if (value) {\n value.addEdge(this);\n this.set(itemName, value);\n this.set(pointName, null);\n }\n };\n /**\n * 获取连接点的坐标\n * @param name source | target\n * @param model 边的数据模型\n * @param controlPoints 控制点\n */\n\n\n Edge.prototype.getLinkPoint = function (name, model, controlPoints) {\n var pointName = END_MAP[name] + POINT_NAME_SUFFIX;\n var itemName = name + ITEM_NAME_SUFFIX;\n var point = this.get(pointName);\n\n if (!point) {\n var item = this.get(itemName);\n var anchorName = name + ANCHOR_NAME_SUFFIX;\n var prePoint = this.getPrePoint(name, controlPoints);\n var anchorIndex = model[anchorName];\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(anchorIndex)) {\n // 如果有锚点,则使用锚点索引获取连接点\n point = item.getLinkPointByAnchor(anchorIndex);\n } // 如果锚点没有对应的点或者没有锚点,则直接计算连接点\n\n\n point = point || item.getLinkPoint(prePoint);\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(point.index)) {\n this.set(\"\".concat(name, \"AnchorIndex\"), point.index);\n }\n }\n\n return point;\n };\n /**\n * 获取同端点进行连接的点,计算交汇点\n * @param name\n * @param controlPoints\n */\n\n\n Edge.prototype.getPrePoint = function (name, controlPoints) {\n if (controlPoints && controlPoints.length) {\n var index = name === 'source' ? 0 : controlPoints.length - 1;\n return controlPoints[index];\n }\n\n var oppositeName = name === 'source' ? 'target' : 'source'; // 取另一个节点的位置\n\n return this.getEndPoint(oppositeName);\n };\n /**\n * 获取端点的位置\n * @param name\n */\n\n\n Edge.prototype.getEndPoint = function (name) {\n var itemName = name + ITEM_NAME_SUFFIX;\n var pointName = END_MAP[name] + POINT_NAME_SUFFIX;\n var item = this.get(itemName); // 如果有端点,直接使用 model\n\n if (item) {\n return item.get('model');\n } // 否则直接使用点\n\n\n return this.get(pointName);\n };\n /**\n * 通过端点的中心获取控制点\n * @param model\n */\n\n\n Edge.prototype.getControlPointsByCenter = function (model) {\n var sourcePoint = this.getEndPoint('source');\n var targetPoint = this.getEndPoint('target');\n var shapeFactory = this.get('shapeFactory');\n var type = model.type;\n return shapeFactory.getControlPoints(type, {\n startPoint: sourcePoint,\n endPoint: targetPoint\n });\n };\n\n Edge.prototype.getEndCenter = function (name) {\n var itemName = name + ITEM_NAME_SUFFIX;\n var pointName = END_MAP[name] + POINT_NAME_SUFFIX;\n var item = this.get(itemName); // 如果有端点,直接使用 model\n\n if (item) {\n var bbox = item.getBBox();\n return {\n x: bbox.centerX,\n y: bbox.centerY\n };\n } // 否则直接使用点\n\n\n return this.get(pointName);\n };\n\n Edge.prototype.init = function () {\n _super.prototype.init.call(this); // 初始化两个端点\n\n\n this.setSource(this.get('source'));\n this.setTarget(this.get('target'));\n };\n\n Edge.prototype.getShapeCfg = function (model, updateType) {\n var self = this;\n var linkCenter = self.get('linkCenter'); // 如果连接到中心,忽视锚点、忽视控制点\n\n var cfg = (updateType === null || updateType === void 0 ? void 0 : updateType.includes('move')) ? model : _super.prototype.getShapeCfg.call(this, model);\n\n if (linkCenter) {\n cfg.startPoint = self.getEndCenter('source');\n cfg.endPoint = self.getEndCenter('target');\n } else {\n var controlPoints = cfg.controlPoints || self.getControlPointsByCenter(cfg);\n cfg.startPoint = self.getLinkPoint('source', model, controlPoints);\n cfg.endPoint = self.getLinkPoint('target', model, controlPoints);\n }\n\n cfg.sourceNode = self.get('sourceNode');\n cfg.targetNode = self.get('targetNode');\n return cfg;\n };\n /**\n * 获取边的数据模型\n */\n\n\n Edge.prototype.getModel = function () {\n var out = this.get('model');\n var sourceItem = this.get(\"source\".concat(ITEM_NAME_SUFFIX));\n var targetItem = this.get(\"target\".concat(ITEM_NAME_SUFFIX));\n\n if (sourceItem) {\n delete out[\"source\".concat(ITEM_NAME_SUFFIX)];\n } else {\n out.source = this.get(\"start\".concat(POINT_NAME_SUFFIX));\n }\n\n if (targetItem) {\n delete out[\"target\".concat(ITEM_NAME_SUFFIX)];\n } else {\n out.target = this.get(\"end\".concat(POINT_NAME_SUFFIX));\n }\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(out.source) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(out.source)) {\n out.source = out.source.getID();\n }\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(out.target) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(out.target)) {\n out.target = out.target.getID();\n }\n\n return out;\n };\n\n Edge.prototype.setSource = function (source) {\n this.setEnd('source', source);\n this.set('source', source);\n };\n\n Edge.prototype.setTarget = function (target) {\n this.setEnd('target', target);\n this.set('target', target);\n };\n\n Edge.prototype.getSource = function () {\n return this.get('source');\n };\n\n Edge.prototype.getTarget = function () {\n return this.get('target');\n };\n\n Edge.prototype.updatePosition = function () {\n return false;\n };\n /**\n * 边不需要重计算容器位置,直接重新计算 path 位置\n * @param {object} cfg 待更新数据\n */\n\n\n Edge.prototype.update = function (cfg, updateType) {\n if (updateType === void 0) {\n updateType = undefined;\n }\n\n var model = this.get('model');\n var oriVisible = model.visible;\n var cfgVisible = cfg.visible;\n if (oriVisible !== cfgVisible && cfgVisible !== undefined) this.changeVisibility(cfgVisible);\n var styles = this.get('styles');\n\n if (cfg.stateStyles) {\n // 更新 item 时更新 this.get('styles') 中的值\n var stateStyles = cfg.stateStyles;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(styles, stateStyles);\n delete cfg.stateStyles;\n }\n\n Object.assign(model, cfg);\n this.updateShape(updateType);\n this.afterUpdate();\n this.clearCache();\n };\n\n Edge.prototype.destroy = function () {\n var sourceItem = this.get(\"source\".concat(ITEM_NAME_SUFFIX));\n var targetItem = this.get(\"target\".concat(ITEM_NAME_SUFFIX));\n\n if (sourceItem && !sourceItem.destroyed) {\n sourceItem.removeEdge(this);\n }\n\n if (targetItem && !targetItem.destroyed) {\n targetItem.removeEdge(this);\n }\n\n _super.prototype.destroy.call(this);\n };\n\n return Edge;\n}(_item__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Edge);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/edge.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\n/**\n * 基于 G 的按钮组件\n */\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\nvar Button = /** @class */function () {\n function Button(cfg) {\n this.config = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"deepMix\"])({}, cfg);\n this.init();\n }\n Button.prototype.update = function (cfg) {\n this.config = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"deepMix\"])({}, this.config, cfg);\n this.updateElement();\n this.renderMarker();\n };\n Button.prototype.init = function () {\n this.initElement();\n this.renderMarker();\n };\n Button.prototype.initElement = function () {\n var _a = this.config,\n group = _a.group,\n style = _a.style;\n var _b = style.scale,\n scale = _b === void 0 ? 1 : _b,\n _c = style.offsetX,\n offsetX = _c === void 0 ? 0 : _c,\n _d = style.offsetY,\n offsetY = _d === void 0 ? 0 : _d;\n var x = this.config.x + offsetX;\n var y = this.config.y + offsetY;\n var buttonGroup = group.addGroup({\n name: _constant__WEBPACK_IMPORTED_MODULE_1__[\"PLAY_PAUSE_BTN\"]\n });\n this.startMarkerGroup = buttonGroup.addGroup({\n name: _constant__WEBPACK_IMPORTED_MODULE_1__[\"PLAY_PAUSE_BTN\"]\n });\n this.circle = group.addShape('circle', {\n attrs: __assign({\n x: x,\n y: y,\n r: this.config.r * scale\n }, style),\n name: _constant__WEBPACK_IMPORTED_MODULE_1__[\"PLAY_PAUSE_BTN\"]\n });\n this.startMarker = this.startMarkerGroup.addShape('path', {\n attrs: {\n path: this.getStartMarkerPath(x, y, scale),\n fill: style.stroke || '#aaa'\n },\n name: 'start-marker'\n });\n this.pauseMarkerGroup = buttonGroup.addGroup({\n name: _constant__WEBPACK_IMPORTED_MODULE_1__[\"PLAY_PAUSE_BTN\"]\n });\n var width = 0.25 * this.config.r * scale;\n var height = 0.5 * this.config.r * Math.sqrt(3) * scale;\n this.pauseLeftMarker = this.pauseMarkerGroup.addShape('rect', {\n attrs: {\n x: x - 0.375 * this.config.r * scale,\n y: y - height / 2,\n width: width,\n height: height,\n fill: style.stroke || '#aaa',\n lineWidth: 0\n }\n });\n this.pauseRightMarker = this.pauseMarkerGroup.addShape('rect', {\n attrs: {\n x: x + 1 / 8 * this.config.r * scale,\n y: y - height / 2,\n width: width,\n height: height,\n fill: style.stroke || '#aaa',\n lineWidth: 0\n }\n });\n };\n Button.prototype.updateElement = function () {\n var _a = this.config.style,\n _b = _a.scale,\n scale = _b === void 0 ? 1 : _b,\n _c = _a.offsetX,\n offsetX = _c === void 0 ? 0 : _c,\n _d = _a.offsetY,\n offsetY = _d === void 0 ? 0 : _d;\n var x = this.config.x + offsetX;\n var y = this.config.y + offsetY;\n this.circle.attr('x', x);\n this.circle.attr('y', y);\n this.circle.attr('r', this.config.r * scale);\n this.startMarker.attr('path', this.getStartMarkerPath(x, y, scale));\n var width = 0.25 * this.config.r * scale;\n var height = 0.5 * this.config.r * Math.sqrt(3) * scale;\n this.pauseLeftMarker.attr('x', x - (1 / 4 + 1 / 8) * this.config.r * scale);\n this.pauseLeftMarker.attr('y', y - height / 2);\n this.pauseLeftMarker.attr('width', width);\n this.pauseLeftMarker.attr('height', height);\n this.pauseRightMarker.attr('x', x + 1 / 8 * this.config.r * scale);\n this.pauseRightMarker.attr('y', y - height / 2);\n this.pauseRightMarker.attr('width', width);\n this.pauseRightMarker.attr('height', height);\n };\n Button.prototype.renderMarker = function () {\n if (this.config.isPlay) {\n this.startMarkerGroup.hide();\n this.pauseMarkerGroup.show();\n } else {\n this.startMarkerGroup.show();\n this.pauseMarkerGroup.hide();\n }\n };\n /** 获取播放键 marker path */\n Button.prototype.getStartMarkerPath = function (x, y, scale) {\n var sideLength = 0.5 * this.config.r * Math.sqrt(3) * scale;\n return [['M', x - sideLength / Math.sqrt(3) / 2, y - sideLength / 2], ['L', x + sideLength / Math.sqrt(3), y], ['L', x - sideLength / Math.sqrt(3) / 2, y + sideLength / 2]];\n };\n return Button;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Button);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/timeButton.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/item/hull.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/item/hull.js ***! - \****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/trend.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/timeBar/trend.js ***! + \**********************************************************/ +/*! exports provided: LINE_STYLE, AREA_STYLE, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_path_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/path-util */ \"./node_modules/@antv/path-util/esm/index.js\");\n/* harmony import */ var _util_path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/path */ \"./node_modules/@antv/g6-core/es/util/path.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _element_hull_convexHull__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../element/hull/convexHull */ \"./node_modules/@antv/g6-core/es/element/hull/convexHull.js\");\n/* harmony import */ var _element_hull_bubbleset__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../element/hull/bubbleset */ \"./node_modules/@antv/g6-core/es/element/hull/bubbleset.js\");\n\n\n\n\n\n\n\n/**\n * 用于包裹内部的成员的轮廓。\n * convex hull(凸包):http://geomalgorithms.com/a10-_hull-1.html#Monotone%20Chain\n * bubble: 使用 bubbleset算法,refer: http://vialab.science.uoit.ca/wp-content/papercite-data/pdf/col2009c.pdf\n * 通过配置 padding 可以调节包裹轮廓对节点的松紧程度\n */\n\nvar Hull =\n/** @class */\nfunction () {\n function Hull(graph, cfg) {\n this.cfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])(this.getDefaultCfg(), cfg);\n this.graph = graph;\n this.id = this.cfg.id;\n this.group = this.cfg.group;\n this.members = this.cfg.members.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? graph.findById(item) : item;\n });\n this.nonMembers = this.cfg.nonMembers.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? graph.findById(item) : item;\n });\n this.setPadding();\n this.setType();\n this.path = this.calcPath(this.members, this.nonMembers);\n this.render();\n }\n\n Hull.prototype.getDefaultCfg = function () {\n return {\n id: 'g6-hull',\n type: 'round-convex',\n members: [],\n nonMembers: [],\n style: {\n fill: 'lightblue',\n stroke: 'blue',\n opacity: 0.2\n },\n padding: 10\n };\n };\n\n Hull.prototype.setPadding = function () {\n var nodeSize = this.members.length && this.members[0].getKeyShape().getCanvasBBox().width / 2;\n this.padding = this.cfg.padding > 0 ? this.cfg.padding + nodeSize : 10 + nodeSize;\n this.cfg.bubbleCfg = {\n nodeR0: this.padding - nodeSize,\n nodeR1: this.padding - nodeSize,\n morphBuffer: this.padding - nodeSize\n };\n };\n\n Hull.prototype.setType = function () {\n this.type = this.cfg.type;\n\n if (this.members.length < 3) {\n this.type = 'round-convex';\n }\n\n if (this.type !== 'round-convex' && this.type !== 'smooth-convex' && this.type !== 'bubble') {\n console.warn('The hull type should be either round-convex, smooth-convex or bubble, round-convex is used by default.');\n this.type = 'round-convex';\n }\n };\n\n Hull.prototype.calcPath = function (members, nonMembers) {\n var contour, path, hull;\n\n switch (this.type) {\n case 'round-convex':\n contour = Object(_element_hull_convexHull__WEBPACK_IMPORTED_MODULE_5__[\"genConvexHull\"])(members);\n hull = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"roundedHull\"])(contour.map(function (p) {\n return [p.x, p.y];\n }), this.padding);\n path = Object(_antv_path_util__WEBPACK_IMPORTED_MODULE_2__[\"parsePathString\"])(hull);\n break;\n\n case 'smooth-convex':\n contour = Object(_element_hull_convexHull__WEBPACK_IMPORTED_MODULE_5__[\"genConvexHull\"])(members);\n\n if (contour.length === 2) {\n hull = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"roundedHull\"])(contour.map(function (p) {\n return [p.x, p.y];\n }), this.padding);\n path = Object(_antv_path_util__WEBPACK_IMPORTED_MODULE_2__[\"parsePathString\"])(hull);\n } else if (contour.length > 2) {\n hull = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"paddedHull\"])(contour.map(function (p) {\n return [p.x, p.y];\n }), this.padding);\n path = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"getClosedSpline\"])(hull);\n }\n\n break;\n\n case 'bubble':\n contour = Object(_element_hull_bubbleset__WEBPACK_IMPORTED_MODULE_6__[\"genBubbleSet\"])(members, nonMembers, this.cfg.bubbleCfg);\n path = contour.length >= 2 && Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"getClosedSpline\"])(contour);\n break;\n\n default:\n }\n\n return path;\n };\n\n Hull.prototype.render = function () {\n this.group.addShape('path', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: this.path\n }, this.cfg.style),\n id: this.id,\n name: this.cfg.id,\n capture: false\n });\n this.group.toBack();\n };\n /**\n * 增加hull的成员,同时如果该成员原先在nonMembers中,则从nonMembers中去掉\n * @param item 节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n\n\n Hull.prototype.addMember = function (item) {\n if (!item) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) item = this.graph.findById(item);\n this.members.push(item);\n var index = this.nonMembers.indexOf(item);\n\n if (index > -1) {\n this.nonMembers.splice(index, 1);\n }\n\n this.updateData(this.members, this.nonMembers);\n return true;\n };\n /**\n * 增加hull需要排除的节点,同时如果该成员原先在members中,则从members中去掉\n * @param item 节点实例\n * @return boolean 添加成功返回 true,否则返回 false\n */\n\n\n Hull.prototype.addNonMember = function (item) {\n if (!item) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) item = this.graph.findById(item);\n this.nonMembers.push(item);\n var index = this.members.indexOf(item);\n\n if (index > -1) {\n this.members.splice(index, 1);\n }\n\n this.updateData(this.members, this.nonMembers);\n return true;\n };\n /**\n * 移除hull中的成员\n * @param node 节点实例\n * @return boolean 移除成功返回 true,否则返回 false\n */\n\n\n Hull.prototype.removeMember = function (item) {\n if (!item) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) item = this.graph.findById(item);\n var index = this.members.indexOf(item);\n\n if (index > -1) {\n this.members.splice(index, 1);\n this.updateData(this.members, this.nonMembers);\n return true;\n }\n\n return false;\n };\n /**\n * @param node 节点实例\n * @return boolean 移除成功返回 true,否则返回 false\n */\n\n\n Hull.prototype.removeNonMember = function (item) {\n if (!item) return;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) item = this.graph.findById(item);\n var index = this.nonMembers.indexOf(item);\n\n if (index > -1) {\n this.nonMembers.splice(index, 1);\n this.updateData(this.members, this.nonMembers);\n return true;\n }\n\n return false;\n };\n\n Hull.prototype.updateData = function (members, nonMembers) {\n var _this = this;\n\n this.group.findById(this.id).remove();\n if (members) this.members = members.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? _this.graph.findById(item) : item;\n });\n if (nonMembers) this.nonMembers = nonMembers.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? _this.graph.findById(item) : item;\n });\n this.path = this.calcPath(this.members, this.nonMembers);\n this.render();\n };\n\n Hull.prototype.updateStyle = function (cfg) {\n var path = this.group.findById(this.id);\n path.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, cfg));\n };\n /**\n * 更新 hull\n * @param cfg hull 配置项\n */\n\n\n Hull.prototype.updateCfg = function (cfg) {\n var _this = this;\n\n this.cfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])(this.cfg, cfg);\n this.id = this.cfg.id;\n this.group = this.cfg.group;\n\n if (cfg.members) {\n this.members = this.cfg.members.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? _this.graph.findById(item) : item;\n });\n }\n\n if (cfg.nonMembers) {\n this.nonMembers = this.cfg.nonMembers.map(function (item) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item) ? _this.graph.findById(item) : item;\n });\n } // TODO padding 设置太大,会影响到 contain 结果\n\n\n this.setPadding();\n this.setType();\n this.path = this.calcPath(this.members, this.nonMembers);\n this.render();\n };\n /**\n * 判断是否在hull内部\n * @param item\n */\n\n\n Hull.prototype.contain = function (item) {\n var _this = this;\n\n var nodeItem;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(item)) {\n nodeItem = this.graph.findById(item);\n } else {\n nodeItem = item;\n }\n\n var shapePoints;\n var shape = nodeItem.getKeyShape();\n\n if (nodeItem.get('type') === 'path') {\n shapePoints = Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"pathToPoints\"])(shape.attr('path'));\n } else {\n var shapeBBox = shape.getCanvasBBox();\n shapePoints = [[shapeBBox.minX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.maxY], [shapeBBox.minX, shapeBBox.maxY]];\n }\n\n shapePoints = shapePoints.map(function (canvasPoint) {\n var point = _this.graph.getPointByCanvas(canvasPoint[0], canvasPoint[1]);\n\n return [point.x, point.y];\n });\n return Object(_util_math__WEBPACK_IMPORTED_MODULE_4__[\"isPolygonsIntersect\"])(shapePoints, Object(_util_path__WEBPACK_IMPORTED_MODULE_3__[\"pathToPoints\"])(this.path));\n };\n\n Hull.prototype.destroy = function () {\n this.group.remove();\n this.cfg = null;\n };\n\n return Hull;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Hull);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/hull.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LINE_STYLE\", function() { return LINE_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AREA_STYLE\", function() { return AREA_STYLE; });\n/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path */ \"./node_modules/@antv/g6-plugin/es/timeBar/path.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\nvar LINE_STYLE = {\n stroke: '#C5C5C5',\n strokeOpacity: 0.85\n};\nvar AREA_STYLE = {\n fill: '#CACED4',\n opacity: 0.85\n};\n/**\n * 缩略趋势图\n */\nvar Trend = /** @class */function () {\n function Trend(cfg) {\n var _a = cfg.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfg.y,\n y = _b === void 0 ? 0 : _b,\n _c = cfg.width,\n width = _c === void 0 ? 200 : _c,\n _d = cfg.height,\n height = _d === void 0 ? 26 : _d,\n _e = cfg.smooth,\n smooth = _e === void 0 ? true : _e,\n _f = cfg.isArea,\n isArea = _f === void 0 ? false : _f,\n _g = cfg.data,\n data = _g === void 0 ? [] : _g,\n lineStyle = cfg.lineStyle,\n areaStyle = cfg.areaStyle,\n group = cfg.group,\n _h = cfg.interval,\n interval = _h === void 0 ? null : _h;\n this.group = group;\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.data = data;\n this.smooth = smooth;\n this.isArea = isArea;\n this.lineStyle = Object.assign({}, LINE_STYLE, lineStyle);\n this.areaStyle = Object.assign({}, AREA_STYLE, areaStyle);\n this.intervalConfig = interval;\n this.renderLine();\n }\n /**\n * 构造\n * @private\n */\n Trend.prototype.renderLine = function () {\n var _a = this,\n x = _a.x,\n y = _a.y,\n width = _a.width,\n height = _a.height,\n barWidth = _a.barWidth,\n data = _a.data,\n smooth = _a.smooth,\n isArea = _a.isArea,\n lineStyle = _a.lineStyle,\n areaStyle = _a.areaStyle;\n var trendGroup = this.group.addGroup({\n name: 'trend-group'\n });\n if (data) {\n var path = Object(_path__WEBPACK_IMPORTED_MODULE_0__[\"dataToPath\"])(data, width, height, smooth);\n // 线\n trendGroup.addShape('path', {\n attrs: __assign({\n path: path\n }, lineStyle),\n name: 'trend-line'\n });\n // 在 line 的基础上,绘制面积图\n if (isArea) {\n var areaPath = Object(_path__WEBPACK_IMPORTED_MODULE_0__[\"linePathToAreaPath\"])(path, width, height, data);\n trendGroup.addShape('path', {\n attrs: __assign({\n path: areaPath\n }, areaStyle),\n name: 'trend-area'\n });\n }\n }\n // 绘制柱状图📊\n if (this.intervalConfig) {\n trendGroup.addShape('path', {\n attrs: __assign({\n path: Object(_path__WEBPACK_IMPORTED_MODULE_0__[\"dataToRectPath\"])(this.intervalConfig.data, width, height, this.intervalConfig.style.barWidth)\n }, this.intervalConfig.style),\n name: 'trend-interval'\n });\n }\n // 统一移动到对应的位置\n trendGroup.move(x, y);\n };\n Trend.prototype.destory = function () {\n this.group.destroy();\n };\n return Trend;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (Trend);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/trend.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/item/item.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/item/item.js ***! - \****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/g6-plugin/es/timeBar/trendTimeBar.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/timeBar/trendTimeBar.js ***! + \*****************************************************************/ +/*! exports provided: BACKGROUND_STYLE, FOREGROUND_STYLE, DEFAULT_HANDLER_WIDTH, HANDLER_STYLE, TEXT_STYLE, TICK_LABEL_STYLE, TICK_LINE_STYLE, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _element_shape__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../element/shape */ \"./node_modules/@antv/g6-core/es/element/shape.js\");\n/* harmony import */ var _util_graphic__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _util_base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../util/base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n\n\n\n\n\n\nvar CACHE_BBOX = 'bboxCache';\nvar CACHE_CANVAS_BBOX = 'bboxCanvasCache';\nvar ARROWS = ['startArrow', 'endArrow'];\n\nvar ItemBase =\n/** @class */\nfunction () {\n function ItemBase(cfg) {\n this._cfg = {};\n this.destroyed = false;\n var defaultCfg = {\n /**\n * id\n * @type {string}\n */\n id: undefined,\n\n /**\n * 类型\n * @type {string}\n */\n type: 'item',\n\n /**\n * data model\n * @type {object}\n */\n model: {},\n\n /**\n * g group\n * @type {G.Group}\n */\n group: undefined,\n\n /**\n * is open animate\n * @type {boolean}\n */\n animate: false,\n\n /**\n * visible - not group visible\n * @type {boolean}\n */\n visible: true,\n\n /**\n * locked - lock node\n * @type {boolean}\n */\n locked: false,\n\n /**\n * capture event\n * @type {boolean}\n */\n event: true,\n\n /**\n * key shape to calculate item's bbox\n * @type object\n */\n keyShape: undefined,\n\n /**\n * item's states, such as selected or active\n * @type Array\n */\n states: []\n };\n this._cfg = Object.assign(defaultCfg, this.getDefaultCfg(), cfg);\n var model = this.get('model');\n var id = model.id;\n var itemType = this.get('type');\n\n if (typeof id === 'undefined') {\n id = Object(_util_base__WEBPACK_IMPORTED_MODULE_5__[\"uniqueId\"])(itemType);\n } else if (typeof id !== 'string') {\n id = String(id);\n }\n\n this.get('model').id = id;\n this.set('id', id);\n var group = cfg.group;\n\n if (group) {\n group.set('item', this);\n group.set('id', id);\n }\n\n this.init();\n this.draw();\n var shapeType = model.shape || model.type || (itemType === 'edge' ? 'line' : 'circle');\n var shapeFactory = this.get('shapeFactory');\n\n if (shapeFactory && shapeFactory[shapeType]) {\n var options = shapeFactory[shapeType].options; // merge the stateStyles from item and shape\n\n if (options && options.stateStyles) {\n var styles = this.get('styles') || model.stateStyles;\n styles = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, options.stateStyles, styles);\n this.set('styles', styles);\n }\n }\n }\n /**\n * 根据 keyshape 计算包围盒\n */\n\n\n ItemBase.prototype.calculateBBox = function () {\n var keyShape = this.get('keyShape');\n var group = this.get('group'); // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n\n var bbox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_3__[\"getBBox\"])(keyShape, group);\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n return bbox;\n };\n /**\n * 根据 keyshape 计算包围盒\n */\n\n\n ItemBase.prototype.calculateCanvasBBox = function () {\n var keyShape = this.get('keyShape');\n var group = this.get('group'); // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n\n var bbox = Object(_util_graphic__WEBPACK_IMPORTED_MODULE_3__[\"getBBox\"])(keyShape, group);\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n return bbox;\n };\n /**\n * draw shape\n */\n\n\n ItemBase.prototype.drawInner = function () {\n var self = this;\n var shapeFactory = self.get('shapeFactory');\n var group = self.get('group');\n var model = self.get('model');\n group.clear();\n var visible = model.visible;\n if (visible !== undefined && !visible) self.changeVisibility(visible);\n\n if (!shapeFactory) {\n return;\n }\n\n self.updatePosition(model);\n var cfg = self.getShapeCfg(model); // 可能会附加额外信息\n\n var shapeType = cfg.type;\n var keyShape = shapeFactory.draw(shapeType, cfg, group);\n\n if (keyShape) {\n self.set('keyShape', keyShape);\n keyShape.set('isKeyShape', true);\n keyShape.set('draggable', true);\n }\n\n this.setOriginStyle(); // 防止由于用户外部修改 model 中的 shape 导致 shape 不更新\n\n this.set('currentShape', shapeType);\n this.restoreStates(shapeFactory, shapeType);\n };\n /**\n * 设置图元素原始样式\n * @param keyShape 图元素 keyShape\n * @param group Group 容器\n */\n\n\n ItemBase.prototype.setOriginStyle = function () {\n var group = this.get('group');\n var children = group.get('children');\n var keyShape = this.getKeyShape();\n var self = this;\n var keyShapeName = keyShape.get('name');\n\n if (!this.get('originStyle')) {\n // 第一次 set originStyle,直接拿首次渲染所有图形的 attrs\n var originStyles = {};\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var shapeType = child.get('type');\n var name_1 = child.get('name');\n\n if (name_1 && name_1 !== keyShapeName) {\n originStyles[name_1] = shapeType !== 'image' ? Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(child.attr()) : self.getShapeStyleByName(name_1); // The text's position and matrix is not allowed to be affected by states\n\n if (shapeType === 'text' && originStyles[name_1]) {\n delete originStyles[name_1].x;\n delete originStyles[name_1].y;\n delete originStyles[name_1].matrix;\n }\n } else {\n var keyShapeStyle = self.getShapeStyleByName(); // 可优化,需要去除 child.attr 中其他 shape 名的对象\n\n delete keyShapeStyle.path;\n delete keyShapeStyle.matrix;\n\n if (!keyShapeName) {\n Object.assign(originStyles, keyShapeStyle);\n } else {\n // 若 keyShape 有 name 且 !name,这个图形不是 keyShape,给这个图形一个 name\n if (!name_1) {\n var shapeName = Object(_util_base__WEBPACK_IMPORTED_MODULE_5__[\"uniqueId\"])('shape');\n child.set('name', shapeName);\n group['shapeMap'][shapeName] = child;\n originStyles[shapeName] = shapeType !== 'image' ? Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(child.attr()) : self.getShapeStyleByName(name_1);\n } else {\n originStyles[keyShapeName] = keyShapeStyle;\n }\n }\n }\n }\n\n self.set('originStyle', originStyles);\n } else {\n // 第二次 set originStyles,需要找到不是 stateStyles 的样式,更新到 originStyles 中\n // 上一次设置的 originStyle,是初始的 shape attrs\n var styles_1 = this.get('originStyle'); // let styles: ShapeStyle = {};\n\n if (keyShapeName && !styles_1[keyShapeName]) styles_1[keyShapeName] = {}; // 获取当前状态样式\n\n var currentStatesStyle_1 = this.getCurrentStatesStyle();\n\n var _loop_1 = function _loop_1(i) {\n var child = children[i];\n var name_2 = child.get('name');\n var shapeAttrs = child.attr();\n\n if (name_2 && name_2 !== keyShapeName) {\n // 有 name 的非 keyShape 图形\n var shapeStateStyle_1 = currentStatesStyle_1[name_2];\n if (!styles_1[name_2]) styles_1[name_2] = {};\n\n if (shapeStateStyle_1) {\n Object.keys(shapeAttrs).forEach(function (key) {\n var value = shapeAttrs[key];\n if (value !== shapeStateStyle_1[key]) styles_1[name_2][key] = value;\n });\n } else {\n styles_1[name_2] = child.get('type') !== 'image' ? Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(shapeAttrs) : self.getShapeStyleByName(name_2);\n }\n } else {\n var shapeAttrs_1 = child.attr();\n var keyShapeStateStyles_1 = {};\n Object.keys(currentStatesStyle_1).forEach(function (styleKey) {\n var subStyle = currentStatesStyle_1[styleKey];\n\n if (styleKey === keyShapeName || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(subStyle)) {\n keyShapeStateStyles_1[styleKey] = subStyle;\n }\n });\n Object.keys(shapeAttrs_1).forEach(function (key) {\n var value = shapeAttrs_1[key]; // 如果是对象且不是 arrow,则是其他 shape 的样式\n // if (isPlainObject(value) && ARROWS.indexOf(name) === -1) return;\n\n if (keyShapeStateStyles_1[key] !== value) {\n if (keyShapeName) styles_1[keyShapeName][key] = value;else styles_1[key] = value;\n }\n });\n }\n }; // 遍历当前所有图形的 attrs,找到不是 stateStyles 的样式更新到 originStyles 中\n\n\n for (var i = 0; i < children.length; i++) {\n _loop_1(i);\n }\n\n delete styles_1.path;\n delete styles_1.matrix;\n delete styles_1.x;\n delete styles_1.y;\n\n if (styles_1[keyShapeName]) {\n delete styles_1[keyShapeName].x;\n delete styles_1[keyShapeName].y;\n delete styles_1[keyShapeName].matrix;\n delete styles_1[keyShapeName].path;\n }\n\n self.set('originStyle', styles_1);\n }\n };\n /**\n * restore shape states\n * @param shapeFactory\n * @param shapeType\n */\n\n\n ItemBase.prototype.restoreStates = function (shapeFactory, shapeType) {\n var self = this;\n var states = self.get('states');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(states, function (state) {\n shapeFactory.setState(shapeType, state, true, self);\n });\n };\n\n ItemBase.prototype.init = function () {\n var shapeFactory = _element_shape__WEBPACK_IMPORTED_MODULE_2__[\"default\"].getFactory(this.get('type'));\n this.set('shapeFactory', shapeFactory);\n };\n /**\n * 获取属性\n * @internal 仅内部类使用\n * @param {String} key 属性名\n * @return {object | string | number} 属性值\n */\n\n\n ItemBase.prototype.get = function (key) {\n return this._cfg[key];\n };\n /**\n * 设置属性\n * @internal 仅内部类使用\n * @param {String|Object} key 属性名,也可以是对象\n * @param {object | string | number} val 属性值\n */\n\n\n ItemBase.prototype.set = function (key, val) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isPlainObject\"])(key)) {\n this._cfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, this._cfg), key);\n } else {\n this._cfg[key] = val;\n }\n };\n\n ItemBase.prototype.getDefaultCfg = function () {\n return {};\n };\n /**\n * 更新/刷新等操作后,清除 cache\n */\n\n\n ItemBase.prototype.clearCache = function () {\n this.set(CACHE_BBOX, null);\n this.set(CACHE_CANVAS_BBOX, null);\n };\n /**\n * 渲染前的逻辑,提供给子类复写\n */\n\n\n ItemBase.prototype.beforeDraw = function () {};\n /**\n * 渲染后的逻辑,提供给子类复写\n */\n\n\n ItemBase.prototype.afterDraw = function () {};\n /**\n * 更新后做一些工作\n */\n\n\n ItemBase.prototype.afterUpdate = function () {};\n /**\n * draw shape\n */\n\n\n ItemBase.prototype.draw = function () {\n this.beforeDraw();\n this.drawInner();\n this.afterDraw();\n };\n\n ItemBase.prototype.getShapeStyleByName = function (name) {\n var group = this.get('group');\n var currentShape;\n\n if (name) {\n currentShape = group['shapeMap'][name]; // group.find((element) => element.get('name') === name) as IShapeBase;\n } else {\n currentShape = this.getKeyShape();\n }\n\n if (currentShape) {\n var styles_2 = {};\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(currentShape.attr(), function (val, key) {\n // 修改 img 通过 updateItem 实现\n if (key !== 'img' || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(val)) {\n styles_2[key] = val;\n }\n });\n return styles_2;\n }\n\n return {};\n };\n\n ItemBase.prototype.getShapeCfg = function (model, updateType) {\n var styles = this.get('styles');\n\n if (styles) {\n // merge graph的item样式与数据模型中的样式\n var newModel = model;\n newModel.style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), model.style);\n return newModel;\n }\n\n return model;\n };\n /**\n * 获取指定状态的样式,去除了全局样式\n * @param state 状态名称\n */\n\n\n ItemBase.prototype.getStateStyle = function (state) {\n var styles = this.get('styles');\n var stateStyle = styles && styles[state];\n return stateStyle;\n };\n /**\n * get keyshape style\n */\n\n\n ItemBase.prototype.getOriginStyle = function () {\n return this.get('originStyle');\n };\n\n ItemBase.prototype.getCurrentStatesStyle = function () {\n var self = this;\n var styles = {};\n var states = self.getStates();\n\n if (!states || !states.length) {\n return this.get('originStyle');\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(self.getStates(), function (state) {\n styles = Object.assign(styles, self.getStateStyle(state));\n });\n return styles;\n };\n /**\n * 更改元素状态, visible 不属于这个范畴\n * @internal 仅提供内部类 graph 使用\n * @param {String} state 状态名\n * @param {Boolean} value 节点状态值\n */\n\n\n ItemBase.prototype.setState = function (state, value) {\n var states = this.get('states');\n var shapeFactory = this.get('shapeFactory');\n var stateName = state;\n var filterStateName = state;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(value)) {\n stateName = \"\".concat(state, \":\").concat(value);\n filterStateName = \"\".concat(state, \":\");\n }\n\n var newStates = states;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isBoolean\"])(value)) {\n var index = states.indexOf(filterStateName);\n\n if (value) {\n if (index > -1) {\n return;\n }\n\n states.push(stateName);\n } else if (index > -1) {\n states.splice(index, 1);\n }\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(value)) {\n // 过滤掉 states 中 filterStateName 相关的状态\n var filterStates = states.filter(function (name) {\n return name.includes(filterStateName);\n });\n\n if (filterStates.length > 0) {\n this.clearStates(filterStates);\n }\n\n newStates = newStates.filter(function (name) {\n return !name.includes(filterStateName);\n });\n newStates.push(stateName);\n this.set('states', newStates);\n }\n\n if (shapeFactory) {\n var model = this.get('model');\n var type = model.type; // 调用 shape/shape.ts 中的 setState\n\n shapeFactory.setState(type, state, value, this);\n }\n };\n /**\n * 清除指定的状态,如果参数为空,则不做任务处理\n * @param states 状态名称\n */\n\n\n ItemBase.prototype.clearStates = function (states) {\n var self = this;\n var originStates = self.getStates();\n var shapeFactory = self.get('shapeFactory');\n var model = self.get('model');\n var shape = model.type;\n\n if (!states) {\n states = originStates;\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(states)) {\n states = [states];\n }\n\n var newStates = originStates.filter(function (state) {\n return states.indexOf(state) === -1;\n });\n self.set('states', newStates);\n states.forEach(function (state) {\n shapeFactory.setState(shape, state, false, self);\n });\n };\n /**\n * 节点的图形容器\n * @return {G.Group} 图形容器\n */\n\n\n ItemBase.prototype.getContainer = function () {\n return this.get('group');\n };\n /**\n * 节点的关键形状,用于计算节点大小,连线截距等\n * @return {IShapeBase} 关键形状\n */\n\n\n ItemBase.prototype.getKeyShape = function () {\n return this.get('keyShape');\n };\n /**\n * 节点数据模型\n * @return {Object} 数据模型\n */\n\n\n ItemBase.prototype.getModel = function () {\n return this.get('model');\n };\n /**\n * 节点类型\n * @return {string} 节点的类型\n */\n\n\n ItemBase.prototype.getType = function () {\n return this.get('type');\n };\n /**\n * 获取 Item 的ID\n */\n\n\n ItemBase.prototype.getID = function () {\n return this.get('id');\n };\n /**\n * 是否是 Item 对象,悬空边情况下进行判定\n */\n\n\n ItemBase.prototype.isItem = function () {\n return true;\n };\n /**\n * 获取当前元素的所有状态\n * @return {Array} 元素的所有状态\n */\n\n\n ItemBase.prototype.getStates = function () {\n return this.get('states');\n };\n /**\n * 当前元素是否处于某状态\n * @param {String} state 状态名\n * @return {Boolean} 是否处于某状态\n */\n\n\n ItemBase.prototype.hasState = function (state) {\n var states = this.getStates();\n return states.indexOf(state) >= 0;\n };\n /**\n * 刷新一般用于处理几种情况\n * 1. item model 在外部被改变\n * 2. 边的节点位置发生改变,需要重新计算边\n *\n * 因为数据从外部被修改无法判断一些属性是否被修改,直接走位置和 shape 的更新\n */\n\n\n ItemBase.prototype.refresh = function (updateType) {\n var model = this.get('model'); // 更新元素位置\n\n this.updatePosition(model); // 更新元素内容,样式\n\n this.updateShape(updateType); // 做一些更新之后的操作\n\n this.afterUpdate(); // 清除缓存\n\n this.clearCache();\n };\n\n ItemBase.prototype.getUpdateType = function (cfg) {\n return undefined;\n };\n /**\n * 将更新应用到 model 上,刷新属性\n * @internal 仅提供给 Graph 使用,外部直接调用 graph.update 接口\n * @param {Object} cfg 配置项,可以是增量信息\n */\n\n\n ItemBase.prototype.update = function (cfg, updateType) {\n if (updateType === void 0) {\n updateType = undefined;\n }\n\n var model = this.get('model'); // 仅仅移动位置时,既不更新,也不重绘\n\n if (updateType === 'move') {\n this.updatePosition(cfg);\n } else {\n var oriVisible = model.visible;\n var cfgVisible = cfg.visible;\n if (oriVisible !== cfgVisible && cfgVisible !== undefined) this.changeVisibility(cfgVisible);\n var originPosition = {\n x: model.x,\n y: model.y\n };\n cfg.x = isNaN(+cfg.x) ? model.x : +cfg.x;\n cfg.y = isNaN(+cfg.y) ? model.y : +cfg.y;\n var styles = this.get('styles');\n\n if (cfg.stateStyles) {\n // 更新 item 时更新 this.get('styles') 中的值\n var stateStyles = cfg.stateStyles;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(styles, stateStyles);\n delete cfg.stateStyles;\n } // 直接将更新合到原数据模型上,可以保证用户在外部修改源数据然后刷新时的样式符合期待。\n\n\n Object.assign(model, cfg); // 如果 x,y 有变化,先重置位置\n\n if (originPosition.x !== cfg.x || originPosition.y !== cfg.y) {\n this.updatePosition(cfg);\n }\n\n this.updateShape(updateType);\n }\n\n this.afterUpdate();\n this.clearCache();\n };\n /**\n * 更新元素内容,样式\n */\n\n\n ItemBase.prototype.updateShape = function (updateType) {\n var shapeFactory = this.get('shapeFactory');\n var model = this.get('model');\n var shape = model.type; // 判定是否允许更新\n // 1. 注册的节点允许更新(即有继承的/复写的 update 方法,即 update 方法没有被复写为 undefined)\n // 2. 更新后的 shape 等于原先的 shape\n\n if (shapeFactory.shouldUpdate(shape) && shape === this.get('currentShape')) {\n var updateCfg = this.getShapeCfg(model, updateType);\n shapeFactory.baseUpdate(shape, updateCfg, this, updateType); // 更新完以后重新设置原始样式\n\n if (updateType !== 'move') this.setOriginStyle();\n } else {\n // 如果不满足上面两种状态,重新绘制\n this.draw();\n } // 更新后重置节点状态\n\n\n this.restoreStates(shapeFactory, shape);\n };\n /**\n * 更新位置,避免整体重绘\n * @param {object} cfg 待更新数据\n */\n\n\n ItemBase.prototype.updatePosition = function (cfg) {\n var model = this.get('model');\n var x = isNaN(+cfg.x) ? +model.x : +cfg.x;\n var y = isNaN(+cfg.y) ? +model.y : +cfg.y;\n var group = this.get('group');\n\n if (isNaN(x) || isNaN(y)) {\n return false;\n }\n\n model.x = x;\n model.y = y;\n var matrix = group.getMatrix();\n if (matrix && matrix[6] === x && matrix[7] === y) return false;\n group.resetMatrix(); // G 4.0 element 中移除了矩阵相关方法,详见https://www.yuque.com/antv/blog/kxzk9g#4rMMV\n\n Object(_util_math__WEBPACK_IMPORTED_MODULE_4__[\"translate\"])(group, {\n x: x,\n y: y\n });\n this.clearCache(); // 位置更新后需要清除缓存\n\n return true;\n };\n /**\n * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n\n\n ItemBase.prototype.getBBox = function () {\n // 计算 bbox 开销有些大,缓存\n var bbox = this.get(CACHE_BBOX);\n\n if (!bbox) {\n bbox = this.calculateBBox();\n this.set(CACHE_BBOX, bbox);\n }\n\n return bbox;\n };\n /**\n * 获取 item 相对于画布的包围盒,会将从顶层到当前元素的 matrix 都计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n\n\n ItemBase.prototype.getCanvasBBox = function () {\n // 计算 bbox 开销大,缓存\n var bbox = this.get(CACHE_CANVAS_BBOX);\n\n if (!bbox) {\n bbox = this.calculateCanvasBBox();\n this.set(CACHE_CANVAS_BBOX, bbox);\n }\n\n return bbox;\n };\n /**\n * 将元素放到最前面\n */\n\n\n ItemBase.prototype.toFront = function () {\n var group = this.get('group');\n group.toFront();\n };\n /**\n * 将元素放到最后面\n */\n\n\n ItemBase.prototype.toBack = function () {\n var group = this.get('group');\n group.toBack();\n };\n /**\n * 显示元素\n */\n\n\n ItemBase.prototype.show = function () {\n this.changeVisibility(true);\n };\n /**\n * 隐藏元素\n */\n\n\n ItemBase.prototype.hide = function () {\n this.changeVisibility(false);\n };\n /**\n * 更改是否显示\n * @param {Boolean} visible 是否显示\n */\n\n\n ItemBase.prototype.changeVisibility = function (visible) {\n var group = this.get('group');\n\n if (visible) {\n group.show();\n } else {\n group.hide();\n }\n\n this.set('visible', visible);\n };\n /**\n * 元素是否可见\n * @return {Boolean} 返回该元素是否可见\n */\n\n\n ItemBase.prototype.isVisible = function () {\n return this.get('visible');\n };\n /**\n * 是否拾取及出发该元素的交互事件\n * @param {Boolean} enable 标识位\n */\n\n\n ItemBase.prototype.enableCapture = function (enable) {\n var group = this.get('group');\n\n if (group) {\n group.set('capture', enable);\n }\n };\n\n ItemBase.prototype.destroy = function () {\n if (!this.destroyed) {\n var animate = this.get('animate');\n var group = this.get('group');\n\n if (animate) {\n group.stopAnimate();\n }\n\n group['shapeMap'] = {};\n this.clearCache();\n group.remove();\n this._cfg = null;\n this.destroyed = true;\n }\n };\n\n return ItemBase;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ItemBase);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/item.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BACKGROUND_STYLE\", function() { return BACKGROUND_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FOREGROUND_STYLE\", function() { return FOREGROUND_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_HANDLER_WIDTH\", function() { return DEFAULT_HANDLER_WIDTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HANDLER_STYLE\", function() { return HANDLER_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TEXT_STYLE\", function() { return TEXT_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TICK_LABEL_STYLE\", function() { return TICK_LABEL_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TICK_LINE_STYLE\", function() { return TICK_LINE_STYLE; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _trend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./trend */ \"./node_modules/@antv/g6-plugin/es/timeBar/trend.js\");\n/* harmony import */ var _handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./handler */ \"./node_modules/@antv/g6-plugin/es/timeBar/handler.js\");\n/* harmony import */ var _controllerBtn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./controllerBtn */ \"./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__[\"ext\"].transform;\n/**\n * 一些默认的样式配置\n */\nvar BACKGROUND_STYLE = {\n fill: '#416180',\n opacity: 0.05\n};\nvar SIMPLE_BACKGROUND_STYLE = {\n fill: '#416180',\n opacity: 0.15,\n radius: 5\n};\nvar FOREGROUND_STYLE = {\n fill: '#5B8FF9',\n opacity: 0.3,\n cursor: 'grab'\n};\nvar DEFAULT_HANDLER_WIDTH = 2;\nvar HANDLER_STYLE = {\n width: DEFAULT_HANDLER_WIDTH,\n height: 24\n};\nvar TEXT_STYLE = {\n textBaseline: 'middle',\n fill: '#000',\n opacity: 0.45\n};\nvar TICK_LABEL_STYLE = {\n textAlign: 'center',\n textBaseline: 'top',\n fill: '#607889',\n opacity: 0.35\n};\nvar TICK_LINE_STYLE = {\n lineWidth: 1,\n stroke: '#ccc'\n};\nvar TrendTimeBar = /** @class */function () {\n function TrendTimeBar(cfg) {\n var _this = this;\n this.prevX = 0;\n this.onMouseDown = function (handler) {\n return function (e) {\n // 1. 记录点击的滑块\n _this.currentHandler = handler;\n var event = e.originalEvent;\n // 2. 存储当前点击位置\n event.stopPropagation();\n event.preventDefault();\n // 兼容移动端获取数据\n _this.prevX = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(event, 'touches.0.pageX', event.pageX);\n // 3. 开始滑动的时候,绑定 move 和 up 事件\n var containerDOM = _this.canvas.get('container');\n containerDOM.addEventListener('mousemove', _this.onMouseMove);\n containerDOM.addEventListener('mouseup', _this.onMouseUp);\n containerDOM.addEventListener('mouseleave', _this.onMouseUp);\n // 移动端事件\n containerDOM.addEventListener('touchmove', _this.onMouseMove);\n containerDOM.addEventListener('touchend', _this.onMouseUp);\n containerDOM.addEventListener('touchcancel', _this.onMouseUp);\n };\n };\n this.onMouseMove = function (e) {\n // 滑动过程中,计算偏移,更新滑块,然后 emit 数据出去\n e.stopPropagation();\n e.preventDefault();\n var x = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(e, 'touches.0.pageX', e.pageX);\n // 横向的 slider 只处理 x\n var offsetX = x - _this.prevX;\n var offsetXRange = _this.adjustOffsetRange(offsetX / _this.width);\n // 更新 start end range 范围\n _this.updateStartEnd(offsetXRange);\n // 更新 ui\n _this.updateUI();\n _this.prevX = x;\n };\n this.onMouseUp = function () {\n // 结束之后,取消绑定的事件\n if (_this.currentHandler) {\n _this.currentHandler = undefined;\n }\n var containerDOM = _this.canvas.get('container');\n if (containerDOM) {\n containerDOM.removeEventListener('mousemove', _this.onMouseMove);\n containerDOM.removeEventListener('mouseup', _this.onMouseUp);\n // 防止滑动到 canvas 外部之后,状态丢失\n containerDOM.removeEventListener('mouseleave', _this.onMouseUp);\n // 移动端事件\n containerDOM.removeEventListener('touchmove', _this.onMouseMove);\n containerDOM.removeEventListener('touchend', _this.onMouseUp);\n containerDOM.removeEventListener('touchcancel', _this.onMouseUp);\n }\n };\n var _a = cfg.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfg.y,\n y = _b === void 0 ? 0 : _b,\n _c = cfg.width,\n width = _c === void 0 ? 100 : _c,\n height = cfg.height,\n _d = cfg.padding,\n padding = _d === void 0 ? 10 : _d,\n trendCfg = cfg.trendCfg,\n _e = cfg.controllerCfg,\n controllerCfg = _e === void 0 ? {\n speed: 1\n } : _e,\n _f = cfg.backgroundStyle,\n backgroundStyle = _f === void 0 ? {} : _f,\n _g = cfg.foregroundStyle,\n foregroundStyle = _g === void 0 ? {} : _g,\n _h = cfg.handlerStyle,\n handlerStyle = _h === void 0 ? {} : _h,\n _j = cfg.textStyle,\n textStyle = _j === void 0 ? {} : _j,\n // 缩略轴的初始位置\n _k = cfg.start,\n // 缩略轴的初始位置\n start = _k === void 0 ? 0 : _k,\n _l = cfg.end,\n end = _l === void 0 ? 1 : _l,\n _m = cfg.minText,\n minText = _m === void 0 ? '' : _m,\n _o = cfg.maxText,\n maxText = _o === void 0 ? '' : _o,\n group = cfg.group,\n graph = cfg.graph,\n canvas = cfg.canvas,\n _p = cfg.tick,\n tick = _p === void 0 ? {\n tickLabelStyle: {},\n tickLineStyle: {},\n tickLabelFormatter: function tickLabelFormatter(d) {\n return d;\n },\n ticks: []\n } : _p,\n type = cfg.type;\n this.graph = graph;\n this.canvas = canvas;\n this.group = group;\n this.timeBarType = type;\n // position size\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.padding = padding;\n this.ticks = tick.ticks;\n this.trendCfg = trendCfg;\n this.controllerCfg = controllerCfg;\n this.currentSpeed = controllerCfg.speed || 1;\n this.tickLabelFormatter = tick.tickLabelFormatter;\n // style\n if (type === 'trend') {\n this.backgroundStyle = __assign(__assign({}, BACKGROUND_STYLE), backgroundStyle);\n } else if (type === 'simple') {\n this.backgroundStyle = __assign(__assign({}, SIMPLE_BACKGROUND_STYLE), backgroundStyle);\n }\n this.foregroundStyle = __assign(__assign({}, FOREGROUND_STYLE), foregroundStyle);\n this.handlerStyle = __assign(__assign({}, HANDLER_STYLE), handlerStyle);\n this.textStyle = __assign(__assign({}, TEXT_STYLE), textStyle);\n this.tickLabelStyle = __assign(__assign({}, TICK_LABEL_STYLE), tick.tickLabelStyle);\n this.tickLineStyle = __assign(__assign({}, TICK_LINE_STYLE), tick.tickLineStyle);\n this.currentMode = controllerCfg.defaultTimeType || _controllerBtn__WEBPACK_IMPORTED_MODULE_4__[\"TIME_TYPE\"].RANGE;\n // 初始信息\n this.start = start;\n this.end = end;\n this.minText = minText;\n this.maxText = maxText;\n // 初始化 fontFamily,如果有浏览器,取 body 上的字体,防止文字更新时局部渲染造成的重影\n this.fontFamily = typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif';\n this.renderSlider();\n }\n /**\n * 更新配置\n * @param cfg\n */\n TrendTimeBar.prototype.update = function (cfg) {\n var x = cfg.x,\n y = cfg.y,\n width = cfg.width,\n height = cfg.height,\n minText = cfg.minText,\n maxText = cfg.maxText,\n start = cfg.start,\n end = cfg.end;\n // start、end 只能是 0~1 范围\n this.start = Math.min(1, Math.max(start, 0));\n this.end = Math.min(1, Math.max(end, 0));\n // 如果传了则更新,没有传则不更新\n // @ts-ignore\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"assign\"])(this, {\n x: x,\n y: y,\n width: width,\n height: height,\n minText: minText,\n maxText: maxText\n });\n // 更新 ui,不自动绘制\n this.updateUI();\n };\n TrendTimeBar.prototype.setText = function (minText, maxText) {\n this.minTextShape.attr('text', minText);\n this.maxTextShape.attr('text', maxText);\n };\n /**\n * 初始化组件结构\n * @private\n */\n TrendTimeBar.prototype.renderSlider = function () {\n var _this = this;\n var _a = this,\n width = _a.width,\n height = _a.height,\n timeBarType = _a.timeBarType;\n // 趋势图数据\n if (timeBarType === 'trend' && Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"size\"])(Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.trendCfg, 'data'))) {\n var trendComponent = new _trend__WEBPACK_IMPORTED_MODULE_2__[\"default\"](__assign(__assign({\n x: this.x,\n y: this.y,\n width: width,\n height: height\n }, this.trendCfg), {\n group: this.group\n }));\n this.trendComponent = trendComponent;\n }\n var sliderGroup = this.group.addGroup({\n name: 'slider-group'\n });\n // 1. 背景\n sliderGroup.addShape('rect', {\n attrs: __assign({\n x: 0,\n y: 0,\n width: width,\n height: height\n }, this.backgroundStyle),\n name: 'background'\n });\n var textGroup = this.group.addGroup();\n // 2. 左右文字\n if (timeBarType === 'trend') {\n this.minTextShape = textGroup.addShape('text', {\n attrs: __assign({\n x: 0,\n y: height / 2 + this.y,\n textAlign: 'right',\n text: this.minText,\n silent: false,\n fontFamily: this.fontFamily || 'Arial, sans-serif',\n stroke: '#fff',\n lineWidth: 5\n }, this.textStyle),\n capture: false,\n name: 'min-text-shape'\n });\n this.maxTextShape = textGroup.addShape('text', {\n attrs: __assign({\n y: height / 2 + this.y,\n textAlign: 'left',\n text: this.maxText,\n silent: false,\n fontFamily: this.fontFamily || 'Arial, sans-serif',\n stroke: '#fff',\n lineWidth: 5\n }, this.textStyle),\n capture: false,\n name: 'max-text-shape'\n });\n } else {\n this.minTextShape = textGroup.addShape('text', {\n attrs: __assign({\n x: 0,\n y: this.y - 10,\n textAlign: 'center',\n text: this.minText,\n silent: false,\n fontFamily: this.fontFamily || 'Arial, sans-serif',\n stroke: '#fff',\n lineWidth: 5\n }, this.textStyle),\n capture: false,\n name: 'min-text-shape'\n });\n this.maxTextShape = textGroup.addShape('text', {\n attrs: __assign({\n y: this.y - 10,\n textAlign: 'center',\n text: this.maxText,\n silent: false,\n fontFamily: this.fontFamily || 'Arial, sans-serif',\n stroke: '#fff',\n lineWidth: 5\n }, this.textStyle),\n capture: false,\n name: 'max-text-shape'\n });\n }\n // 3. 前景 选中背景框\n this.foregroundShape = this.group.addGroup().addShape('rect', {\n attrs: __assign({\n x: 0,\n y: this.y,\n height: height\n }, this.foregroundStyle),\n name: 'foreground-shape'\n });\n this.foregroundShape.on('mousedown', function (e) {\n e.target.attr('cursor', 'grabbing');\n });\n this.foregroundShape.on('mouseup', function (e) {\n e.target.attr('cursor', _this.foregroundStyle.cursor || 'grab');\n });\n // 滑块相关的大小信息\n var handlerWidth = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.handlerStyle, 'width', 2);\n var handlerHeight = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.handlerStyle, 'height', 24);\n var minHandleGroup = this.group.addGroup({\n name: 'minHandlerShape'\n });\n // 4. 左右滑块\n this.minHandlerShape = new _handler__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n name: 'minHandlerShape',\n group: minHandleGroup,\n type: timeBarType,\n x: this.x,\n y: this.y,\n width: handlerWidth,\n height: handlerHeight,\n style: this.handlerStyle\n });\n var maxHandleGroup = this.group.addGroup({\n name: 'maxHandlerShape'\n });\n this.maxHandlerShape = new _handler__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n name: 'maxHandlerShape',\n group: maxHandleGroup,\n type: timeBarType,\n x: this.x,\n y: this.y,\n width: handlerWidth,\n height: handlerHeight,\n style: this.handlerStyle\n });\n // 缩略图下面的时间刻度\n var tickData = this.ticks;\n var interval = width / (tickData.length - 1);\n this.tickPosList = [];\n if (this.textList && this.textList.length) {\n this.textList.forEach(function (text) {\n text.destroy();\n });\n }\n var lastX = -Infinity;\n var rotate = this.tickLabelStyle.rotate;\n delete this.tickLabelStyle.rotate;\n this.textList = tickData.map(function (data, index) {\n _this.tickPosList.push(_this.x + index * interval);\n var label;\n if (_this.tickLabelFormatter) {\n label = _this.tickLabelFormatter(data);\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(label) && label) {\n // return true\n label = data.date;\n }\n } else {\n label = data.date;\n }\n // 文本刻度\n var textX = _this.x + index * interval,\n textY = _this.y + height + 5;\n var text = _this.group.addShape('text', {\n attrs: __assign({\n x: textX,\n y: textY,\n text: label,\n fontFamily: _this.fontFamily || 'Arial, sans-serif'\n }, _this.tickLabelStyle),\n name: 'tick-label'\n });\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(rotate) && index !== tickData.length - 1) {\n var matrix = transform([1, 0, 0, 0, 1, 0, 0, 0, 1], [['t', -textX, -textY], ['r', rotate], ['t', textX - 5, textY + 2]]);\n text.attr({\n textAlign: 'left',\n matrix: matrix\n });\n }\n if (index === 0) {\n text.attr({\n textAlign: 'left'\n });\n } else if (index !== tickData.length - 1) {\n text.attr({\n textAlign: 'right'\n });\n }\n // 文本刻度上面的竖线\n var line = _this.group.addShape('line', {\n attrs: __assign({\n x1: _this.x + index * interval,\n y1: _this.y + height + 2,\n x2: _this.x + index * interval,\n y2: _this.y + height + 6\n }, _this.tickLineStyle),\n name: 'tick-line'\n });\n line.toBack();\n var bbox = text.getBBox();\n // 抽样,标签与标签间距不小于 10\n if (bbox.minX > lastX) {\n text.show();\n line.show();\n lastX = bbox.minX + bbox.width + 10;\n } else {\n text.hide();\n line.hide();\n }\n return text;\n });\n // 渲染播放、快进和后退的控制按钮\n this.controllerBtnGroup = new _controllerBtn__WEBPACK_IMPORTED_MODULE_4__[\"default\"](__assign({\n group: this.group,\n x: this.x,\n y: this.y + height + 25,\n width: width,\n height: 35\n }, this.controllerCfg));\n // 初始化 minText 和 maxText,方便计算它们的 bbox\n this.updateStartEnd(0);\n // 根据 start end 更新 ui 的位置信息\n this.updateUI();\n // 移动到对应的位置\n sliderGroup.move(this.x, this.y);\n // 绑定事件鼠标事件\n this.bindEvents();\n if (this.currentMode === _controllerBtn__WEBPACK_IMPORTED_MODULE_4__[\"TIME_TYPE\"].SINGLE) {\n this.minHandlerShape.hide();\n this.foregroundShape.hide();\n this.minTextShape.hide();\n }\n };\n /**\n * 绑定事件:\n * - 点击\n * - 滑动\n * - 拖拽\n * - 滚动\n * @private\n */\n TrendTimeBar.prototype.bindEvents = function () {\n var _this = this;\n // 1. 左滑块的滑动\n var minHandleShapeGroup = this.group.find(function (group) {\n return group.get('name') === 'minHandlerShape';\n });\n if (minHandleShapeGroup) {\n minHandleShapeGroup.on('minHandlerShape-handler:mousedown', this.onMouseDown(this.minHandlerShape));\n minHandleShapeGroup.on('minHandlerShape-handler:touchstart', this.onMouseDown(this.minHandlerShape));\n }\n var maxHandleShapeGroup = this.group.find(function (group) {\n return group.get('name') === 'maxHandlerShape';\n });\n // 2. 右滑块的滑动\n if (maxHandleShapeGroup) {\n maxHandleShapeGroup.on('maxHandlerShape-handler:mousedown', this.onMouseDown(this.maxHandlerShape));\n maxHandleShapeGroup.on('maxHandlerShape-handler:touchstart', this.onMouseDown(this.maxHandlerShape));\n }\n // 3. 前景选中区域\n this.foregroundShape.on('mousedown', this.onMouseDown(this.foregroundShape));\n this.foregroundShape.on('touchstart', this.onMouseDown(this.foregroundShape));\n // 播放区按钮控制\n /** 播放/暂停事件 */\n this.group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"PLAY_PAUSE_BTN\"], \":click\"), function () {\n _this.isPlay = !_this.isPlay;\n _this.currentHandler = _this.maxHandlerShape;\n _this.changePlayStatus();\n });\n // 处理前进一步的事件\n this.group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"NEXT_STEP_BTN\"], \":click\"), function () {\n _this.currentHandler = _this.maxHandlerShape;\n _this.updateStartEnd(0.01);\n _this.updateUI();\n });\n // 处理后退一步的事件\n this.group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"PRE_STEP_BTN\"], \":click\"), function () {\n _this.currentHandler = _this.maxHandlerShape;\n _this.updateStartEnd(-0.01);\n _this.updateUI();\n });\n this.group.on(_constant__WEBPACK_IMPORTED_MODULE_5__[\"TIMEBAR_CONFIG_CHANGE\"], function (_a) {\n var type = _a.type,\n speed = _a.speed;\n _this.currentSpeed = speed;\n _this.currentMode = type;\n if (type === _controllerBtn__WEBPACK_IMPORTED_MODULE_4__[\"TIME_TYPE\"].SINGLE) {\n _this.minHandlerShape.hide();\n _this.foregroundShape.hide();\n _this.minTextShape.hide();\n } else if (type === _controllerBtn__WEBPACK_IMPORTED_MODULE_4__[\"TIME_TYPE\"].RANGE) {\n _this.minHandlerShape.show();\n _this.foregroundShape.show();\n _this.minTextShape.show();\n }\n });\n };\n /** 输入当前圆点位置,输出离哪个 tick 的位置最近 */\n TrendTimeBar.prototype.adjustTickIndex = function (timeSelectX) {\n for (var i = 0; i < this.tickPosList.length - 1; i++) {\n if (this.tickPosList[i] <= timeSelectX && timeSelectX <= this.tickPosList[i + 1]) {\n return Math.abs(this.tickPosList[i] - timeSelectX) < Math.abs(timeSelectX - this.tickPosList[i + 1]) ? i : i + 1;\n }\n }\n return 0;\n };\n /**\n * 调整 offsetRange,因为一些范围的限制\n * @param offsetRange\n */\n TrendTimeBar.prototype.adjustOffsetRange = function (offsetRange) {\n // 针对不同的滑动组件,处理的方式不同\n switch (this.currentHandler) {\n case this.minHandlerShape:\n {\n var min = 0 - this.start;\n var max = 1 - this.start;\n return Math.min(max, Math.max(min, offsetRange));\n }\n case this.maxHandlerShape:\n {\n var min = 0 - this.end;\n var max = 1 - this.end;\n return Math.min(max, Math.max(min, offsetRange));\n }\n case this.foregroundShape:\n {\n var min = 0 - this.start;\n var max = 1 - this.end;\n return Math.min(max, Math.max(min, offsetRange));\n }\n default:\n return 0;\n }\n };\n /**\n * 更新起始、结束的控制块位置、文本、范围值(原始值)\n * @param offsetRange\n */\n TrendTimeBar.prototype.updateStartEnd = function (offsetRange) {\n var minData = this.ticks[this.adjustTickIndex(this.start * this.width)];\n var maxData = this.ticks[this.adjustTickIndex(this.end * this.width)];\n if (!this.currentHandler) {\n this.minText = this.tickLabelFormatter ? this.tickLabelFormatter(minData) : minData === null || minData === void 0 ? void 0 : minData.date;\n this.maxText = this.tickLabelFormatter ? this.tickLabelFormatter(maxData) : maxData === null || maxData === void 0 ? void 0 : maxData.date;\n return;\n }\n // 操作不同的组件,反馈不一样\n switch (this.currentHandler) {\n case this.minHandlerShape:\n // 拖动最小滑块时使用当前最大值设置最大值的文本,以便恢复到默认值\n this.maxText = this.maxTextShape.attr('text');\n this.start += offsetRange;\n this.minText = this.tickLabelFormatter ? this.tickLabelFormatter(minData) : minData.date;\n break;\n case this.maxHandlerShape:\n // 拖动最大滑块时使用当前最小值设置最小值的文本,以便恢复到默认值\n this.minText = this.minTextShape.attr('text');\n this.end += offsetRange;\n this.maxText = this.tickLabelFormatter ? this.tickLabelFormatter(maxData) : maxData.date;\n break;\n case this.foregroundShape:\n this.start += offsetRange;\n this.end += offsetRange;\n this.minText = this.tickLabelFormatter ? this.tickLabelFormatter(minData) : minData.date;\n this.maxText = this.tickLabelFormatter ? this.tickLabelFormatter(maxData) : maxData.date;\n break;\n default:\n break;\n }\n };\n /**\n * 根据移动的比例来更新 ui,更新范围(0-1 范围的比例值)\n * @private\n */\n TrendTimeBar.prototype.updateUI = function () {\n var _this = this;\n if (this.start < 0) {\n this.start = 0;\n }\n if (this.start > 1) {\n this.start = 1;\n }\n if (this.end > 1) {\n this.end = 1;\n }\n if (this.end < 0) {\n this.end = 0;\n }\n var min = this.x + this.start * this.width;\n var max = this.x + this.end * this.width;\n // 1. foreground\n this.foregroundShape.attr('x', min);\n this.foregroundShape.attr('width', max - min);\n // 滑块相关的大小信息\n var handlerWidth = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.handlerStyle, 'width', DEFAULT_HANDLER_WIDTH);\n // 设置文本\n this.setText(this.minText, this.maxText);\n var _a = this.dodgeText([min, max]),\n minAttrs = _a[0],\n maxAttrs = _a[1];\n // 2. 左侧滑块和文字位置\n this.minHandlerShape.setX(min - handlerWidth / 2);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(minAttrs, function (v, k) {\n return _this.minTextShape.attr(k, v);\n });\n // 3. 右侧滑块和文字位置\n this.maxHandlerShape.setX(max - handlerWidth / 2);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(maxAttrs, function (v, k) {\n return _this.maxTextShape.attr(k, v);\n });\n if (this.currentMode === _controllerBtn__WEBPACK_IMPORTED_MODULE_4__[\"TIME_TYPE\"].RANGE) {\n // 因为存储的 start、end 可能不一定是按大小存储的,所以排序一下,对外是 end >= start\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_5__[\"VALUE_CHANGE\"], {\n value: [this.start, this.end].sort()\n });\n } else if (this.currentMode === _controllerBtn__WEBPACK_IMPORTED_MODULE_4__[\"TIME_TYPE\"].SINGLE) {\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_5__[\"VALUE_CHANGE\"], {\n value: [this.end, this.end]\n });\n }\n };\n /**\n * 调整 text 的位置,自动躲避\n * 根据位置,调整返回新的位置\n * @param range\n */\n TrendTimeBar.prototype.dodgeText = function (range) {\n var _a, _b;\n var TEXTPADDING = 2;\n var handlerWidth = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.handlerStyle, 'width', DEFAULT_HANDLER_WIDTH);\n var minTextShape = this.minTextShape;\n var maxTextShape = this.maxTextShape;\n var min = range[0],\n max = range[1];\n var sorted = false;\n // 如果交换了位置,则对应的 min max 也交换\n if (min > max) {\n _a = [max, min], min = _a[0], max = _a[1];\n _b = [maxTextShape, minTextShape], minTextShape = _b[0], maxTextShape = _b[1];\n sorted = true;\n }\n // 避让规则,优先显示在两侧,只有显示不下的时候,才显示在中间\n var minBBox = minTextShape.getBBox();\n var maxBBox = maxTextShape.getBBox();\n var minAttrs = null;\n var maxAttrs = null;\n if (this.timeBarType === 'trend') {\n minAttrs = min - minBBox.width < this.x + TEXTPADDING ? {\n x: min + handlerWidth / 2 + TEXTPADDING,\n textAlign: 'left'\n } : {\n x: min - handlerWidth / 2 - TEXTPADDING,\n textAlign: 'right'\n };\n maxAttrs = max + maxBBox.width > this.x + this.width ? {\n x: max - handlerWidth / 2 - TEXTPADDING,\n textAlign: 'right'\n } : {\n x: max + handlerWidth / 2 + TEXTPADDING,\n textAlign: 'left'\n };\n } else if (this.timeBarType === 'simple') {\n minAttrs = minTextShape.attr('x') > minBBox.width // 左边滑块文本位置小于其宽度代表文字超过左边届\n ? {\n x: min,\n textAlign: 'center'\n } : {\n x: min,\n textAlign: 'left'\n };\n maxAttrs = maxTextShape.attr('x') > this.width - maxBBox.width // 有边滑块文本位置大于宽度代表文字超过右边界\n ? {\n x: max,\n textAlign: 'right'\n } : {\n x: max,\n textAlign: 'center'\n };\n }\n return !sorted ? [minAttrs, maxAttrs] : [maxAttrs, minAttrs];\n };\n TrendTimeBar.prototype.startPlay = function () {\n var _this = this;\n return typeof window !== 'undefined' ? window.requestAnimationFrame(function () {\n var _a = _this,\n ticks = _a.ticks,\n width = _a.width;\n var speed = _this.currentSpeed;\n var tickInterval = width / ticks.length;\n var offsetX = tickInterval / ((10 - speed) * 1000 / 60);\n var offsetXRange = _this.adjustOffsetRange(offsetX / _this.width);\n _this.updateStartEnd(offsetXRange);\n _this.updateUI();\n if (_this.isPlay) {\n _this.playHandler = _this.startPlay();\n }\n }) : undefined;\n };\n TrendTimeBar.prototype.changePlayStatus = function (isSync) {\n if (isSync === void 0) {\n isSync = true;\n }\n this.controllerBtnGroup.playButton.update({\n isPlay: this.isPlay\n });\n if (this.isPlay) {\n // 开始播放\n this.playHandler = this.startPlay();\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_5__[\"TIMELINE_START\"], null);\n } else {\n // 结束播放\n if (this.playHandler) {\n if (typeof window !== 'undefined') window.cancelAnimationFrame(this.playHandler);\n if (isSync) {\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_5__[\"TIMELINE_END\"], null);\n }\n }\n }\n };\n TrendTimeBar.prototype.destory = function () {\n this.graph.off(_constant__WEBPACK_IMPORTED_MODULE_5__[\"VALUE_CHANGE\"], function () {});\n var group = this.group;\n var minHandleShapeGroup = group.find(function (g) {\n return g.get('name') === 'minHandlerShape';\n });\n if (minHandleShapeGroup) {\n minHandleShapeGroup.off('minHandlerShape-handler:mousedown');\n minHandleShapeGroup.off('minHandlerShape-handler:touchstart');\n minHandleShapeGroup.destroy();\n }\n var maxHandleShapeGroup = group.find(function (g) {\n return g.get('name') === 'maxHandlerShape';\n });\n // 2. 右滑块的滑动\n if (maxHandleShapeGroup) {\n maxHandleShapeGroup.off('maxHandlerShape-handler:mousedown');\n maxHandleShapeGroup.off('maxHandlerShape-handler:touchstart');\n maxHandleShapeGroup.destroy();\n }\n // 3. 前景选中区域\n this.foregroundShape.off('mousedown');\n this.foregroundShape.off('touchstart');\n this.foregroundShape.destroy();\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"PLAY_PAUSE_BTN\"], \":click\"));\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"NEXT_STEP_BTN\"], \":click\"));\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"PRE_STEP_BTN\"], \":click\"));\n group.off(_constant__WEBPACK_IMPORTED_MODULE_5__[\"TIMEBAR_CONFIG_CHANGE\"]);\n group.destroy();\n if (this.trendComponent) {\n this.trendComponent.destory();\n }\n };\n return TrendTimeBar;\n}();\n/* harmony default export */ __webpack_exports__[\"default\"] = (TrendTimeBar);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/trendTimeBar.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/item/node.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/item/node.js ***! - \****************************************************/ +/***/ "./node_modules/@antv/g6-plugin/es/toolBar/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/toolBar/index.js ***! + \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _item__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./item */ \"./node_modules/@antv/g6-core/es/item/item.js\");\n\n\n\n\nvar CACHE_ANCHOR_POINTS = 'anchorPointsCache';\nvar CACHE_BBOX = 'bboxCache';\n\nvar Node =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Node, _super);\n\n function Node() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n\n Node.prototype.getNearestPoint = function (points, curPoint) {\n var index = 0;\n var nearestPoint = points[0];\n var minDistance = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"distance\"])(points[0], curPoint);\n\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n var dis = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"distance\"])(point, curPoint);\n\n if (dis < minDistance) {\n nearestPoint = point;\n minDistance = dis;\n index = i;\n }\n }\n\n nearestPoint.anchorIndex = index;\n return nearestPoint;\n };\n\n Node.prototype.getDefaultCfg = function () {\n return {\n type: 'node',\n edges: []\n };\n };\n /**\n * 获取从节点关联的所有边\n */\n\n\n Node.prototype.getEdges = function () {\n return this.get('edges');\n };\n /**\n * 获取所有的入边\n */\n\n\n Node.prototype.getInEdges = function () {\n var self = this;\n return this.get('edges').filter(function (edge) {\n return edge.get('target') === self;\n });\n };\n /**\n * 获取所有的出边\n */\n\n\n Node.prototype.getOutEdges = function () {\n var self = this;\n return this.get('edges').filter(function (edge) {\n return edge.get('source') === self;\n });\n };\n /**\n * 获取节点的邻居节点\n *\n * @returns {INode[]}\n * @memberof Node\n */\n\n\n Node.prototype.getNeighbors = function (type) {\n var _this = this;\n\n var edges = this.get('edges');\n\n if (type === 'target') {\n // 当前节点为 source,它所指向的目标节点\n var neighhborsConverter_1 = function neighhborsConverter_1(edge) {\n return edge.getSource() === _this;\n };\n\n return edges.filter(neighhborsConverter_1).map(function (edge) {\n return edge.getTarget();\n });\n }\n\n if (type === 'source') {\n // 当前节点为 target,它所指向的源节点\n var neighhborsConverter_2 = function neighhborsConverter_2(edge) {\n return edge.getTarget() === _this;\n };\n\n return edges.filter(neighhborsConverter_2).map(function (edge) {\n return edge.getSource();\n });\n } // 若未指定 type ,则返回所有邻居\n\n\n var neighhborsConverter = function neighhborsConverter(edge) {\n return edge.getSource() === _this ? edge.getTarget() : edge.getSource();\n };\n\n return edges.map(neighhborsConverter);\n };\n /**\n * 根据锚点的索引获取连接点\n * @param {Number} index 索引\n */\n\n\n Node.prototype.getLinkPointByAnchor = function (index) {\n var anchorPoints = this.getAnchorPoints();\n return anchorPoints[index];\n };\n /**\n * 获取连接点\n * @param point\n */\n\n\n Node.prototype.getLinkPoint = function (point) {\n var keyShape = this.get('keyShape');\n var type = keyShape.get('type');\n var itemType = this.get('type');\n var centerX;\n var centerY;\n var bbox = this.getBBox();\n\n if (itemType === 'combo') {\n centerX = bbox.centerX || (bbox.maxX + bbox.minX) / 2;\n centerY = bbox.centerY || (bbox.maxY + bbox.minY) / 2;\n } else {\n centerX = bbox.centerX;\n centerY = bbox.centerY;\n }\n\n var anchorPoints = this.getAnchorPoints();\n var intersectPoint;\n\n switch (type) {\n case 'circle':\n intersectPoint = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"getCircleIntersectByPoint\"])({\n x: centerX,\n y: centerY,\n r: bbox.width / 2\n }, point);\n break;\n\n case 'ellipse':\n intersectPoint = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"getEllipseIntersectByPoint\"])({\n x: centerX,\n y: centerY,\n rx: bbox.width / 2,\n ry: bbox.height / 2\n }, point);\n break;\n\n default:\n intersectPoint = Object(_util_math__WEBPACK_IMPORTED_MODULE_2__[\"getRectIntersectByPoint\"])(bbox, point);\n }\n\n var linkPoint = intersectPoint; // 如果存在锚点,则使用交点计算最近的锚点\n\n if (anchorPoints.length) {\n if (!linkPoint) {\n // 如果计算不出交点\n linkPoint = point;\n }\n\n linkPoint = this.getNearestPoint(anchorPoints, linkPoint);\n }\n\n if (!linkPoint) {\n // 如果最终依然没法找到锚点和连接点,直接返回中心点\n linkPoint = {\n x: centerX,\n y: centerY\n };\n }\n\n return linkPoint;\n };\n /**\n * 获取锚点的定义\n * @return {array} anchorPoints\n */\n\n\n Node.prototype.getAnchorPoints = function () {\n var anchorPoints = this.get(CACHE_ANCHOR_POINTS);\n\n if (!anchorPoints) {\n anchorPoints = [];\n var shapeFactory = this.get('shapeFactory');\n var bbox_1 = this.getBBox();\n var model = this.get('model');\n var shapeCfg = this.getShapeCfg(model);\n var type = model.type;\n var points = shapeFactory.getAnchorPoints(type, shapeCfg) || [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points, function (pointArr, index) {\n var point = {\n x: bbox_1.minX + pointArr[0] * bbox_1.width,\n y: bbox_1.minY + pointArr[1] * bbox_1.height,\n anchorIndex: index\n };\n anchorPoints.push(point);\n });\n this.set(CACHE_ANCHOR_POINTS, anchorPoints);\n }\n\n return anchorPoints;\n };\n /**\n * add edge\n * @param edge Edge instance\n */\n\n\n Node.prototype.addEdge = function (edge) {\n this.get('edges').push(edge);\n };\n /**\n * 锁定节点\n */\n\n\n Node.prototype.lock = function () {\n this.set('locked', true);\n };\n /**\n * 解锁锁定的节点\n */\n\n\n Node.prototype.unlock = function () {\n this.set('locked', false);\n };\n\n Node.prototype.hasLocked = function () {\n return this.get('locked');\n };\n /**\n * 移除边\n * @param {Edge} edge 边\n */\n\n\n Node.prototype.removeEdge = function (edge) {\n var edges = this.getEdges();\n var index = edges.indexOf(edge);\n if (index > -1) edges.splice(index, 1);\n };\n\n Node.prototype.clearCache = function () {\n this.set(CACHE_BBOX, null); // 清理缓存的 bbox\n\n this.set(CACHE_ANCHOR_POINTS, null);\n };\n /**\n * 判断更新的种类,move 表示仅移动,bbox 表示大小有变化,style 表示仅与大小无关的参数变化\n * @param cfg 节点数据模型\n */\n\n\n Node.prototype.getUpdateType = function (cfg) {\n var _a, _b, _c, _d, _e;\n\n if (!cfg) return undefined;\n var existX = !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(cfg.x);\n var existY = !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(cfg.y);\n var keys = Object.keys(cfg); // 仅有一个字段,包含 x 或者 包含 y\n // 两个字段,同时有 x,同时有 y\n\n if (keys.length === 1 && (existX || existY) || keys.length === 2 && existX && existY) return 'move';\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.x) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(cfg.y) || cfg.type || cfg.anchorPoints || cfg.size || (cfg === null || cfg === void 0 ? void 0 : cfg.style) && (((_a = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _a === void 0 ? void 0 : _a.r) || ((_b = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _b === void 0 ? void 0 : _b.width) || ((_c = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _c === void 0 ? void 0 : _c.height) || ((_d = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _d === void 0 ? void 0 : _d.rx) || ((_e = cfg === null || cfg === void 0 ? void 0 : cfg.style) === null || _e === void 0 ? void 0 : _e.ry))) return 'bbox|label';\n var updateLabel = keys.includes('label') || keys.includes('labelCfg');\n return updateLabel ? 'style|label' : 'style';\n };\n\n return Node;\n}(_item__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Node);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/item/node.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! insert-css */ \"./node_modules/insert-css/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(insert_css__WEBPACK_IMPORTED_MODULE_3__);\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\nvar DELTA = 0.05;\ntypeof document !== 'undefined' && insert_css__WEBPACK_IMPORTED_MODULE_3___default()(\"\\n .g6-component-toolbar {\\n position: absolute;\\n list-style-type: none;\\n padding: 6px;\\n left: 0px;\\n top: 0px;\\n background-color: rgba(255, 255, 255, 0.9);\\n border: 1px solid #e2e2e2;\\n border-radius: 4px;\\n font-size: 12px;\\n color: #545454;\\n margin: 0;\\n }\\n .g6-component-toolbar li {\\n float: left;\\n text-align: center;\\n width: 35px;\\n height: 24px;\\n cursor: pointer;\\n\\t\\tlist-style-type:none;\\n list-style: none;\\n margin-left: 0px;\\n }\\n .g6-component-toolbar li .icon {\\n opacity: 0.7;\\n }\\n .g6-component-toolbar li .icon:hover {\\n opacity: 1;\\n }\\n\");\nvar getEventPath = function getEventPath(evt) {\n if (!evt) {\n return [];\n }\n if (evt.composedPath) {\n return evt.composedPath();\n }\n var path = [];\n var el = evt.target;\n while (el) {\n path.push(el);\n if (el.tagName === 'HTML') {\n path.push(document, window);\n return path;\n }\n el = el.parentElement;\n }\n return path;\n};\nvar ToolBar = /** @class */function (_super) {\n __extends(ToolBar, _super);\n function ToolBar(config) {\n return _super.call(this, config) || this;\n }\n ToolBar.prototype.getDefaultCfgs = function () {\n return {\n handleClick: undefined,\n // 指定菜单内容,function(e) {...}\n getContent: function getContent(graph) {\n return \"\\n
    \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
\\n \";\n },\n zoomSensitivity: 2\n };\n };\n ToolBar.prototype.init = function () {\n var _this = this;\n var graph = this.get('graph');\n var getContent = this.get('getContent');\n var toolBar = getContent(graph);\n var toolBarDOM = toolBar;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(toolBar)) {\n toolBarDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(toolBar);\n }\n var className = this.get('className');\n toolBarDOM.setAttribute('class', className || 'g6-component-toolbar');\n var container = this.get('container');\n if (!container) {\n container = this.get('graph').get('container');\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n container.appendChild(toolBarDOM);\n this.set('toolBar', toolBarDOM);\n var handleClick = this.get('handleClick');\n toolBarDOM.addEventListener('click', function (evt) {\n var current = getEventPath(evt).filter(function (p) {\n return p.nodeName === 'LI';\n });\n if (current.length === 0) {\n return;\n }\n var code = current[0].getAttribute('code');\n if (!code) {\n return;\n }\n if (handleClick) {\n handleClick(code, graph);\n } else {\n _this.handleDefaultOperator(code);\n }\n });\n var pos = this.get('position');\n if (pos) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(toolBarDOM, {\n top: \"\".concat(pos.y, \"px\"),\n left: \"\".concat(pos.x, \"px\")\n });\n }\n this.bindUndoRedo();\n };\n ToolBar.prototype.bindUndoRedo = function () {\n var graph = this.get('graph');\n var undoDom = document.querySelector('.g6-component-toolbar li[code=\"undo\"]');\n var undoDomIcon = document.querySelector('.g6-component-toolbar li[code=\"undo\"] svg');\n var redoDom = document.querySelector('.g6-component-toolbar li[code=\"redo\"]');\n var redoDomIcon = document.querySelector('.g6-component-toolbar li[code=\"redo\"] svg');\n if (!undoDom || !undoDomIcon || !redoDom || !redoDomIcon) {\n return;\n }\n // initialy disabled redo and undo icons\n undoDom.setAttribute('style', 'cursor: not-allowed');\n undoDomIcon.setAttribute('style', 'opacity: 0.4');\n redoDom.setAttribute('style', 'cursor: not-allowed');\n redoDomIcon.setAttribute('style', 'opacity: 0.4');\n graph.on('stackchange', function (evt) {\n var undoStack = evt.undoStack,\n redoStack = evt.redoStack;\n var undoStackLen = undoStack.length;\n var redoStackLen = redoStack.length;\n // undo 不可用\n if (undoStackLen === 0) {\n undoDom.setAttribute('style', 'cursor: not-allowed');\n undoDomIcon.setAttribute('style', 'opacity: 0.4');\n } else {\n undoDom.removeAttribute('style');\n undoDomIcon.removeAttribute('style');\n }\n // redo 不可用\n if (redoStackLen === 0) {\n redoDom.setAttribute('style', 'cursor: not-allowed');\n redoDomIcon.setAttribute('style', 'opacity: 0.4');\n } else {\n redoDom.removeAttribute('style');\n redoDomIcon.removeAttribute('style');\n }\n });\n };\n /**\n * undo 操作\n */\n ToolBar.prototype.undo = function () {\n var graph = this.get('graph');\n var undoStack = graph.getUndoStack();\n if (!undoStack || undoStack.length === 0) {\n return;\n }\n var currentData = undoStack.pop();\n if (currentData) {\n var action = currentData.action;\n graph.pushStack(action, Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(currentData.data), 'redo');\n var data_1 = currentData.data.before;\n if (action === 'add') {\n data_1 = currentData.data.after;\n }\n if (!data_1) return;\n switch (action) {\n case 'visible':\n {\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n var item = graph.findById(model.id);\n if (model.visible) {\n graph.showItem(item, false);\n } else {\n graph.hideItem(item, false);\n }\n });\n });\n break;\n }\n case 'render':\n case 'update':\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n var item = graph.findById(model.id);\n delete model.id;\n graph.updateItem(item, model, false);\n if (item.getType() === 'combo') graph.updateCombo(item);\n });\n });\n break;\n case 'changedata':\n graph.changeData(data_1, false);\n break;\n case 'delete':\n {\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n var itemType = model.itemType;\n delete model.itemType;\n graph.addItem(itemType, model, false);\n });\n });\n break;\n }\n case 'add':\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n graph.removeItem(model.id, false);\n });\n });\n break;\n case 'updateComboTree':\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n graph.updateComboTree(model.id, model.parentId, false);\n });\n });\n break;\n case 'createCombo':\n var afterCombos = currentData.data.after.combos;\n var createdCombo = afterCombos[afterCombos.length - 1];\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n graph.updateComboTree(model.id, model.parentId, false);\n });\n });\n graph.removeItem(createdCombo.id, false);\n break;\n case 'uncombo':\n var targetCombo_1 = data_1.combos[data_1.combos.length - 1];\n var childrenIds = data_1.nodes.concat(data_1.combos).map(function (child) {\n return child.id;\n }).filter(function (id) {\n return id !== targetCombo_1.id;\n });\n graph.createCombo(targetCombo_1, childrenIds, false);\n break;\n case 'layout':\n graph.updateLayout(data_1, undefined, undefined, false);\n break;\n default:\n }\n }\n };\n /**\n * redo 操作\n */\n ToolBar.prototype.redo = function () {\n var graph = this.get('graph');\n var redoStack = graph.getRedoStack();\n if (!redoStack || redoStack.length === 0) {\n return;\n }\n var currentData = redoStack.pop();\n if (currentData) {\n var action = currentData.action;\n var data_2 = currentData.data.after;\n graph.pushStack(action, Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(currentData.data));\n if (action === 'delete') {\n data_2 = currentData.data.before;\n }\n if (!data_2) return;\n switch (action) {\n case 'visible':\n {\n Object.keys(data_2).forEach(function (key) {\n var array = data_2[key];\n if (!array) return;\n array.forEach(function (model) {\n var item = graph.findById(model.id);\n if (model.visible) {\n graph.showItem(item, false);\n } else {\n graph.hideItem(item, false);\n }\n });\n });\n break;\n }\n case 'render':\n case 'update':\n Object.keys(data_2).forEach(function (key) {\n var array = data_2[key];\n if (!array) return;\n array.forEach(function (model) {\n var item = graph.findById(model.id);\n delete model.id;\n graph.updateItem(item, model, false);\n if (item.getType() === 'combo') graph.updateCombo(item);\n });\n });\n break;\n case 'changedata':\n graph.changeData(data_2, false);\n break;\n case 'delete':\n if (data_2.edges) {\n data_2.edges.forEach(function (model) {\n graph.removeItem(model.id, false);\n });\n }\n if (data_2.nodes) {\n data_2.nodes.forEach(function (model) {\n graph.removeItem(model.id, false);\n });\n }\n if (data_2.combos) {\n data_2.combos.forEach(function (model) {\n graph.removeItem(model.id, false);\n });\n }\n break;\n case 'add':\n {\n Object.keys(data_2).forEach(function (key) {\n var array = data_2[key];\n if (!array) return;\n array.forEach(function (model) {\n var itemType = model.itemType;\n delete model.itemType;\n graph.addItem(itemType, model, false);\n });\n });\n break;\n }\n case 'updateComboTree':\n Object.keys(data_2).forEach(function (key) {\n var array = data_2[key];\n if (!array) return;\n array.forEach(function (model) {\n graph.updateComboTree(model.id, model.parentId, false);\n });\n });\n break;\n case 'createCombo':\n var createdCombo = data_2.combos[data_2.combos.length - 1];\n graph.createCombo(createdCombo, createdCombo.children.map(function (child) {\n return child.id;\n }), false);\n break;\n case 'uncombo':\n var beforeCombos = currentData.data.before.combos;\n var targertCombo = beforeCombos[beforeCombos.length - 1];\n graph.uncombo(targertCombo.id, false);\n break;\n case 'layout':\n graph.updateLayout(data_2, undefined, undefined, false);\n break;\n default:\n }\n }\n };\n /**\n * zoomOut 操作\n */\n ToolBar.prototype.zoomOut = function () {\n var graph = this.get('graph');\n var currentZoom = graph.getZoom();\n var ratioOut = 1 / (1 - DELTA * this.get('zoomSensitivity'));\n var maxZoom = this.get('maxZoom') || graph.get('maxZoom');\n if (ratioOut * currentZoom > maxZoom) {\n return;\n }\n graph.zoomTo(currentZoom * ratioOut);\n };\n /**\n * zoomIn 操作\n */\n ToolBar.prototype.zoomIn = function () {\n var graph = this.get('graph');\n var currentZoom = graph.getZoom();\n var ratioIn = 1 - DELTA * this.get('zoomSensitivity');\n var minZoom = this.get('minZoom') || graph.get('minZoom');\n if (ratioIn * currentZoom < minZoom) {\n return;\n }\n graph.zoomTo(currentZoom * ratioIn);\n };\n /**\n * realZoom 操作\n */\n ToolBar.prototype.realZoom = function () {\n var graph = this.get('graph');\n graph.zoomTo(1);\n };\n /**\n * autoZoom 操作\n */\n ToolBar.prototype.autoZoom = function () {\n var graph = this.get('graph');\n graph.fitView([20, 20]);\n };\n /**\n * 根据 Toolbar 上不同类型对图进行操作\n * @param code 操作类型编码\n * @param graph Graph 实例\n */\n ToolBar.prototype.handleDefaultOperator = function (code) {\n switch (code) {\n case 'redo':\n this.redo();\n break;\n case 'undo':\n this.undo();\n break;\n case 'zoomOut':\n this.zoomOut();\n break;\n case 'zoomIn':\n this.zoomIn();\n break;\n case 'realZoom':\n this.realZoom();\n break;\n case 'autoZoom':\n this.autoZoom();\n break;\n default:\n }\n };\n ToolBar.prototype.destroy = function () {\n var toolBar = this.get('toolBar');\n if (toolBar) {\n var container = this.get('container');\n if (!container) {\n container = this.get('graph').get('container');\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n container.removeChild(toolBar);\n }\n var handleClick = this.get('handleClick');\n if (handleClick) {\n toolBar.removeEventListener('click', handleClick);\n }\n };\n return ToolBar;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (ToolBar);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/toolBar/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/types/index.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/types/index.js ***! - \******************************************************/ -/*! exports provided: G6GraphEvent */ +/***/ "./node_modules/@antv/g6-plugin/es/tooltip/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/g6-plugin/es/tooltip/index.js ***! + \**********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _interface__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../interface */ \"./node_modules/@antv/g6-core/es/interface/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _interface__WEBPACK_IMPORTED_MODULE_0__[\"G6GraphEvent\"]; });\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/types/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! insert-css */ \"./node_modules/insert-css/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(insert_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return _extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n _extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\ntypeof document !== 'undefined' && insert_css__WEBPACK_IMPORTED_MODULE_2___default()(\"\\n .g6-component-tooltip {\\n border: 1px solid #e2e2e2;\\n border-radius: 4px;\\n font-size: 12px;\\n color: #545454;\\n background-color: rgba(255, 255, 255, 0.9);\\n padding: 10px 8px;\\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\\n }\\n .tooltip-type {\\n padding: 0;\\n margin: 0;\\n }\\n .tooltip-id {\\n color: #531dab;\\n }\\n\");\nvar Tooltip = /** @class */function (_super) {\n __extends(Tooltip, _super);\n function Tooltip(config) {\n return _super.call(this, config) || this;\n }\n Tooltip.prototype.getDefaultCfgs = function () {\n return {\n offsetX: 6,\n offsetY: 6,\n // 指定菜单内容,function(e) {...}\n getContent: function getContent(e) {\n return \"\\n

\\u7C7B\\u578B\\uFF1A\".concat(e.item.getType(), \"

\\n ID\\uFF1A\").concat(e.item.getID(), \"\\n \");\n },\n shouldBegin: function shouldBegin(e) {\n return true;\n },\n itemTypes: ['node', 'edge', 'combo'],\n trigger: 'mouseenter',\n fixToNode: undefined\n };\n };\n // class-methods-use-this\n Tooltip.prototype.getEvents = function () {\n if (this.get('trigger') === 'click') {\n return {\n 'node:click': 'onClick',\n 'edge:click': 'onClick',\n 'combo:click': 'onClick',\n 'canvas:click': 'onMouseLeave',\n afterremoveitem: 'onMouseLeave',\n contextmenu: 'onMouseLeave',\n drag: 'onMouseLeave'\n };\n }\n return {\n 'node:mouseenter': 'onMouseEnter',\n 'node:mouseleave': 'onMouseLeave',\n 'node:mousemove': 'onMouseMove',\n 'edge:mouseenter': 'onMouseEnter',\n 'edge:mouseleave': 'onMouseLeave',\n 'edge:mousemove': 'onMouseMove',\n 'combo:mouseenter': 'onMouseEnter',\n 'combo:mouseleave': 'onMouseLeave',\n 'combo:mousemove': 'onMouseMove',\n afterremoveitem: 'onMouseLeave',\n contextmenu: 'onMouseLeave',\n 'node:drag': 'onMouseLeave'\n };\n };\n Tooltip.prototype.init = function () {\n var self = this;\n var className = self.get('className') || 'g6-component-tooltip';\n var tooltip = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n var container = self.get('container');\n if (!container) {\n container = self.get('graph').get('container');\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n position: 'absolute',\n visibility: 'hidden',\n display: 'none'\n });\n container.appendChild(tooltip);\n if (self.get('trigger') !== 'click') {\n tooltip.addEventListener('mouseenter', function (e) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n visibility: 'visible',\n display: 'unset'\n });\n });\n tooltip.addEventListener('mouseleave', function (e) {\n self.hideTooltip();\n });\n }\n self.set('tooltip', tooltip);\n };\n Tooltip.prototype.onClick = function (e) {\n var itemTypes = this.get('itemTypes');\n if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return;\n var item = e.item;\n var graph = this.get('graph');\n // 若与上一次同一 item,隐藏该 tooltip\n if (this.currentTarget === item) {\n this.currentTarget = null;\n this.hideTooltip();\n graph.emit('tooltipchange', {\n item: e.item,\n action: 'hide'\n });\n } else {\n this.currentTarget = item;\n this.showTooltip(e);\n graph.emit('tooltipchange', {\n item: e.item,\n action: 'show'\n });\n }\n };\n Tooltip.prototype.onMouseEnter = function (e) {\n var itemTypes = this.get('itemTypes');\n if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return;\n var item = e.item;\n var graph = this.get('graph');\n this.currentTarget = item;\n this.showTooltip(e);\n graph.emit('tooltipchange', {\n item: e.item,\n action: 'show'\n });\n };\n Tooltip.prototype.onMouseMove = function (e) {\n var itemTypes = this.get('itemTypes');\n if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return;\n if (!this.currentTarget || e.item !== this.currentTarget) {\n return;\n }\n this.showTooltip(e);\n };\n Tooltip.prototype.onMouseLeave = function () {\n this.hideTooltip();\n var graph = this.get('graph');\n graph.emit('tooltipchange', {\n item: this.currentTarget,\n action: 'hide'\n });\n this.currentTarget = null;\n };\n Tooltip.prototype.clearContainer = function () {\n var container = this.get('tooltip');\n if (container) {\n container.innerHTML = '';\n }\n };\n Tooltip.prototype.showTooltip = function (e) {\n if (!e.item) {\n return;\n }\n var itemTypes = this.get('itemTypes');\n if (e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return;\n var container = this.get('tooltip');\n var getContent = this.get('getContent');\n var tooltip = getContent(e);\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(tooltip)) {\n container.innerHTML = tooltip;\n } else {\n this.clearContainer();\n container.appendChild(tooltip);\n }\n this.updatePosition(e);\n };\n Tooltip.prototype.hideTooltip = function () {\n var tooltip = this.get('tooltip');\n if (tooltip) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n visibility: 'hidden',\n display: 'none'\n });\n }\n };\n Tooltip.prototype.updatePosition = function (e) {\n var shouldBegin = this.get('shouldBegin');\n var tooltip = this.get('tooltip');\n if (!shouldBegin(e)) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n visibility: 'hidden',\n display: 'none'\n });\n return;\n }\n var graph = this.get('graph');\n var width = graph.get('width');\n var height = graph.get('height');\n var offsetX = this.get('offsetX') || 0;\n var offsetY = this.get('offsetY') || 0;\n var point = graph.getPointByClient(e.clientX, e.clientY);\n var fixToNode = this.get('fixToNode');\n var item = e.item;\n if (item.getType && item.getType() === 'node' && fixToNode && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(fixToNode) && fixToNode.length >= 2) {\n var itemBBox = item.getBBox();\n point = {\n x: itemBBox.minX + itemBBox.width * fixToNode[0],\n y: itemBBox.minY + itemBBox.height * fixToNode[1]\n };\n }\n var _a = graph.getCanvasByPoint(point.x, point.y),\n x = _a.x,\n y = _a.y;\n var graphContainer = graph.getContainer();\n var res = {\n x: x + graphContainer.offsetLeft + offsetX,\n y: y + graphContainer.offsetTop + offsetY\n };\n // 先修改为 visible 方可正确计算 bbox\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n visibility: 'visible',\n display: 'unset'\n });\n var bbox = tooltip.getBoundingClientRect();\n if (x + bbox.width + offsetX > width) {\n res.x -= bbox.width + offsetX;\n }\n if (y + bbox.height + offsetY > height) {\n res.y -= bbox.height + offsetY;\n if (res.y < 0) {\n res.y = 0;\n }\n }\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n left: \"\".concat(res.x, \"px\"),\n top: \"\".concat(res.y, \"px\")\n });\n };\n Tooltip.prototype.hide = function () {\n this.onMouseLeave();\n };\n Tooltip.prototype.destroy = function () {\n var tooltip = this.get('tooltip');\n if (tooltip) {\n var container = this.get('container');\n if (!container) {\n container = this.get('graph').get('container');\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n container.removeChild(tooltip);\n }\n };\n return Tooltip;\n}(_base__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tooltip);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/tooltip/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/util/base.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/util/base.js ***! - \****************************************************/ -/*! exports provided: uniqueId, formatPadding, cloneEvent, isViewportChanged, isNaN, calculationItemsBBox, processParallelEdges */ +/***/ "./node_modules/@antv/g6/es/index.js": +/*!*******************************************!*\ + !*** ./node_modules/@antv/g6/es/index.js ***! + \*******************************************/ +/*! exports provided: G6GraphEvent, Node, Edge, Combo, Hull, registerNode, registerCombo, AbstractGraph, registerEdge, registerBehavior, AbstractLayout, AbstractEvent, BaseGlobal, Graph, TreeGraph, Util, Layout, TreeLayout, registerLayout, Global, Minimap, Grid, Bundling, Menu, Fisheye, Algorithm, ToolBar, Tooltip, TimeBar, ImageMinimap, EdgeFilterLens, SnapLine, Legend, Annotation, Arrow, Marker, Shape, default, version */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return uniqueId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"formatPadding\", function() { return formatPadding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cloneEvent\", function() { return cloneEvent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isViewportChanged\", function() { return isViewportChanged; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNaN\", function() { return isNaN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"calculationItemsBBox\", function() { return calculationItemsBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"processParallelEdges\", function() { return processParallelEdges; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _interface_behavior__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../interface/behavior */ \"./node_modules/@antv/g6-core/es/interface/behavior.js\");\n\n\nvar uniqueId = function uniqueId(type) {\n return \"\".concat(type, \"-\").concat(Math.random()).concat(Date.now());\n};\n/**\n * turn padding into [top, right, bottom, right]\n * @param {Number|Array} padding input padding\n * @return {array} output\n */\n\nvar formatPadding = function formatPadding(padding) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(padding)) {\n switch (padding.length) {\n case 4:\n return padding;\n\n case 3:\n padding.push(padding[1]);\n return padding;\n\n case 2:\n return padding.concat(padding);\n\n case 1:\n return [padding[0], padding[0], padding[0], padding[0]];\n\n default:\n return [0, 0, 0, 0];\n }\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(padding)) {\n return [padding, padding, padding, padding];\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(padding)) {\n var intPadding = parseInt(padding, 10);\n return [intPadding, intPadding, intPadding, intPadding];\n }\n\n return [0, 0, 0, 0];\n};\n/**\n * clone event\n * @param e\n */\n\nvar cloneEvent = function cloneEvent(e) {\n var event = new _interface_behavior__WEBPACK_IMPORTED_MODULE_1__[\"G6GraphEvent\"](e.type, e);\n event.clientX = e.clientX;\n event.clientY = e.clientY;\n event.x = e.x;\n event.y = e.y;\n event.target = e.target;\n event.currentTarget = e.currentTarget;\n event.bubbles = true;\n event.item = e.item;\n return event;\n};\n/**\n * 判断 viewport 是否改变,通过和单位矩阵对比\n * @param matrix Viewport 的 Matrix\n */\n\nvar isViewportChanged = function isViewportChanged(matrix) {\n // matrix 为 null, 则说明没有变化\n if (!matrix) {\n return false;\n }\n\n var MATRIX_LEN = 9;\n var ORIGIN_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n for (var i = 0; i < MATRIX_LEN; i++) {\n if (matrix[i] !== ORIGIN_MATRIX[i]) {\n return true;\n }\n }\n\n return false;\n};\nvar isNaN = function isNaN(input) {\n return Number.isNaN(Number(input));\n};\n/**\n * 计算一组 Item 的 BBox\n * @param items 选中的一组Item,可以是 node 或 combo\n */\n\nvar calculationItemsBBox = function calculationItemsBBox(items) {\n var minx = Infinity;\n var maxx = -Infinity;\n var miny = Infinity;\n var maxy = -Infinity; // 获取已节点的所有最大最小x y值\n\n for (var i = 0; i < items.length; i++) {\n var element = items[i];\n var bbox = element.getBBox();\n var minX = bbox.minX,\n minY = bbox.minY,\n maxX = bbox.maxX,\n maxY = bbox.maxY;\n\n if (minX < minx) {\n minx = minX;\n }\n\n if (minY < miny) {\n miny = minY;\n }\n\n if (maxX > maxx) {\n maxx = maxX;\n }\n\n if (maxY > maxy) {\n maxy = maxY;\n }\n }\n\n var x = Math.floor(minx);\n var y = Math.floor(miny);\n var width = Math.ceil(maxx) - Math.floor(minx);\n var height = Math.ceil(maxy) - Math.floor(miny);\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n minX: minx,\n minY: miny,\n maxX: maxx,\n maxY: maxy\n };\n};\n/**\n * 若 edges 中存在两端点相同的边,使用 quadratic 边并自动计算 curveOffset 使它们不相互重叠\n * 文档: https://g6.antv.vision/en/docs/api/Util\n * @param edges 边数据集合\n * @param offsetDiff 相邻两边的 offset 之差\n * @param multiEdgeType\n * @param singleEdgeType\n * @param loopEdgeType\n */\n\nvar processParallelEdges = function processParallelEdges(edges, offsetDiff, multiEdgeType, singleEdgeType, loopEdgeType) {\n if (offsetDiff === void 0) {\n offsetDiff = 15;\n }\n\n if (multiEdgeType === void 0) {\n multiEdgeType = 'quadratic';\n }\n\n if (singleEdgeType === void 0) {\n singleEdgeType = undefined;\n }\n\n if (loopEdgeType === void 0) {\n loopEdgeType = undefined;\n }\n\n var len = edges.length;\n var cod = offsetDiff * 2;\n var loopPosition = ['top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left'];\n var edgeMap = {};\n var tags = [];\n var reverses = {};\n\n for (var i = 0; i < len; i++) {\n var edge = edges[i];\n var source = edge.source,\n target = edge.target;\n var sourceTarget = \"\".concat(source, \"-\").concat(target);\n if (tags[i]) continue;\n\n if (!edgeMap[sourceTarget]) {\n edgeMap[sourceTarget] = [];\n }\n\n tags[i] = true;\n edgeMap[sourceTarget].push(edge);\n\n for (var j = 0; j < len; j++) {\n if (i === j) continue;\n var sedge = edges[j];\n var src = sedge.source;\n var dst = sedge.target; // 两个节点之间共同的边\n // 第一条的source = 第二条的target\n // 第一条的target = 第二条的source\n\n if (!tags[j]) {\n if (source === dst && target === src) {\n edgeMap[sourceTarget].push(sedge);\n tags[j] = true;\n reverses[\"\".concat(src, \"|\").concat(dst, \"|\").concat(edgeMap[sourceTarget].length - 1)] = true;\n } else if (source === src && target === dst) {\n edgeMap[sourceTarget].push(sedge);\n tags[j] = true;\n }\n }\n }\n }\n\n for (var key in edgeMap) {\n var arcEdges = edgeMap[key];\n var length_1 = arcEdges.length;\n\n for (var k = 0; k < length_1; k++) {\n var current = arcEdges[k];\n\n if (current.source === current.target) {\n if (loopEdgeType) current.type = loopEdgeType; // 超过8条自环边,则需要重新处理\n\n current.loopCfg = {\n position: loopPosition[k % 8],\n dist: Math.floor(k / 8) * 20 + 50\n };\n continue;\n }\n\n if (length_1 === 1 && singleEdgeType && current.source !== current.target) {\n current.type = singleEdgeType;\n continue;\n }\n\n current.type = multiEdgeType;\n var sign = (k % 2 === 0 ? 1 : -1) * (reverses[\"\".concat(current.source, \"|\").concat(current.target, \"|\").concat(k)] ? -1 : 1);\n\n if (length_1 % 2 === 1) {\n current.curveOffset = sign * Math.ceil(k / 2) * cod;\n } else {\n current.curveOffset = sign * (Math.floor(k / 2) * cod + offsetDiff);\n }\n }\n }\n\n return edges;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/base.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony import */ var _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-pc */ \"./node_modules/@antv/g6-pc/es/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"G6GraphEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Node\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Edge\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Edge\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Combo\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Combo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Hull\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Hull\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerNode\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerNode\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerCombo\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerCombo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGraph\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"AbstractGraph\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerEdge\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerEdge\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerBehavior\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerBehavior\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractLayout\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"AbstractLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractEvent\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"AbstractEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BaseGlobal\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"BaseGlobal\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Graph\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Graph\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeGraph\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"TreeGraph\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Util\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Util\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Layout\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Layout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeLayout\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"TreeLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerLayout\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Global\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Global\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Minimap\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Minimap\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Grid\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Grid\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Bundling\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Bundling\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Menu\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Fisheye\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Fisheye\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Algorithm\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Algorithm\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ToolBar\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"ToolBar\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tooltip\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Tooltip\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TimeBar\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"TimeBar\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ImageMinimap\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"ImageMinimap\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EdgeFilterLens\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"EdgeFilterLens\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SnapLine\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"SnapLine\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Legend\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Legend\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Annotation\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Annotation\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Arrow\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Arrow\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Marker\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Marker\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Shape\"]; });\n\n\n_antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].version = '4.8.23';\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\nvar version = '4.8.23';\n\n//# sourceURL=webpack:///./node_modules/@antv/g6/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/util/color.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/util/color.js ***! - \*****************************************************/ -/*! exports provided: defaultSubjectColors */ +/***/ "./node_modules/@antv/graphlib/es/Graph/enum.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/Graph/enum.js ***! + \******************************************************/ +/*! exports provided: GraphEnum */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultSubjectColors\", function() { return defaultSubjectColors; });\nvar defaultSubjectColors = ['#5F95FF', '#61DDAA', '#65789B', '#F6BD16', '#7262FD', '#78D3F8', '#9661BC', '#F6903D', '#008685', '#F08BB4'];\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/color.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GraphEnum\", function() { return GraphEnum; });\nvar GraphEnum;\n\n(function (GraphEnum) {\n GraphEnum[\"DEFAULT_EDGE_NAME\"] = \"\\0\";\n GraphEnum[\"GRAPH_NODE\"] = \"\\0\";\n GraphEnum[\"EDGE_KEY_DELIM\"] = \"\\x01\";\n})(GraphEnum || (GraphEnum = {}));\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/Graph/enum.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/util/graphic.js": +/***/ "./node_modules/@antv/graphlib/es/Graph/event.js": /*!*******************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/util/graphic.js ***! + !*** ./node_modules/@antv/graphlib/es/Graph/event.js ***! \*******************************************************/ -/*! exports provided: getBBox, getLoopCfgs, getLabelPosition, traverseTree, traverseTreeUp, getLetterWidth, getTextSize, truncateLabelByLength, plainCombosToTrees, reconstructTree, getComboBBox, shouldRefreshEdge, cloneBesidesImg, getAnimateCfgWithCallback */ +/*! exports provided: GraphWithEvent */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBox\", function() { return getBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLoopCfgs\", function() { return getLoopCfgs; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLabelPosition\", function() { return getLabelPosition; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseTree\", function() { return traverseTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"traverseTreeUp\", function() { return traverseTreeUp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLetterWidth\", function() { return getLetterWidth; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTextSize\", function() { return getTextSize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"truncateLabelByLength\", function() { return truncateLabelByLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"plainCombosToTrees\", function() { return plainCombosToTrees; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reconstructTree\", function() { return reconstructTree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getComboBBox\", function() { return getComboBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"shouldRefreshEdge\", function() { return shouldRefreshEdge; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cloneBesidesImg\", function() { return cloneBesidesImg; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAnimateCfgWithCallback\", function() { return getAnimateCfgWithCallback; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/es/global.js\");\n/* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _letterAspectRatio__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./letterAspectRatio */ \"./node_modules/@antv/g6-core/es/util/letterAspectRatio.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n\n\n\nvar PI = Math.PI,\n sin = Math.sin,\n cos = Math.cos; // 一共支持8个方向的自环,每个环占的角度是45度,在计算时再二分,为22.5度\n\nvar SELF_LINK_SIN = sin(PI / 8);\nvar SELF_LINK_COS = cos(PI / 8);\nvar getBBox = function getBBox(element, group) {\n var bbox = element.getBBox();\n var leftTop = {\n x: bbox.minX,\n y: bbox.minY\n };\n var rightBottom = {\n x: bbox.maxX,\n y: bbox.maxY\n }; // 根据父元素变换矩阵\n\n if (group) {\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n leftTop = Object(_math__WEBPACK_IMPORTED_MODULE_3__[\"applyMatrix\"])(leftTop, matrix);\n rightBottom = Object(_math__WEBPACK_IMPORTED_MODULE_3__[\"applyMatrix\"])(rightBottom, matrix);\n }\n\n var lx = leftTop.x,\n ly = leftTop.y;\n var rx = rightBottom.x,\n ry = rightBottom.y;\n return {\n x: lx,\n y: ly,\n minX: lx,\n minY: ly,\n maxX: rx,\n maxY: ry,\n width: rx - lx,\n height: ry - ly\n };\n};\n/**\n * get loop edge config\n * @param cfg edge config\n */\n\nvar getLoopCfgs = function getLoopCfgs(cfg) {\n var item = cfg.sourceNode || cfg.targetNode;\n var container = item.get('group');\n var containerMatrix = container.getMatrix();\n if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var keyShape = item.getKeyShape();\n var bbox = keyShape.getBBox();\n var loopCfg = cfg.loopCfg || {}; // 距离keyShape边的最高距离\n\n var dist = loopCfg.dist || Math.max(bbox.width, bbox.height) * 2; // 自环边与keyShape的相对位置关系\n\n var position = loopCfg.position || _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].defaultLoopPosition; // 中心取group上真实位置\n\n var center = [containerMatrix[6], containerMatrix[7]];\n var startPoint = [cfg.startPoint.x, cfg.startPoint.y];\n var endPoint = [cfg.endPoint.x, cfg.endPoint.y];\n var rstart = bbox.height / 2;\n var rend = bbox.height / 2;\n var sinDeltaStart = rstart * SELF_LINK_SIN;\n var cosDeltaStart = rstart * SELF_LINK_COS;\n var sinDeltaEnd = rend * SELF_LINK_SIN;\n var cosDeltaEnd = rend * SELF_LINK_COS; // 如果定义了锚点的,直接用锚点坐标,否则,根据自环的 cfg 计算\n\n if (startPoint[0] === endPoint[0] && startPoint[1] === endPoint[1]) {\n switch (position) {\n case 'top':\n startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd];\n break;\n\n case 'top-right':\n rstart = bbox.height / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + cosDeltaEnd, center[1] - sinDeltaEnd];\n break;\n\n case 'right':\n rstart = bbox.width / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + cosDeltaStart, center[1] - sinDeltaStart];\n endPoint = [center[0] + cosDeltaEnd, center[1] + sinDeltaEnd];\n break;\n\n case 'bottom-right':\n rstart = bbox.width / 2;\n rend = bbox.height / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + cosDeltaStart, center[1] + sinDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] + cosDeltaEnd];\n break;\n\n case 'bottom':\n rstart = bbox.height / 2;\n rend = bbox.height / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + sinDeltaStart, center[1] + cosDeltaStart];\n endPoint = [center[0] - sinDeltaEnd, center[1] + cosDeltaEnd];\n break;\n\n case 'bottom-left':\n rstart = bbox.height / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - sinDeltaStart, center[1] + cosDeltaStart];\n endPoint = [center[0] - cosDeltaEnd, center[1] + sinDeltaEnd];\n break;\n\n case 'left':\n rstart = bbox.width / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - cosDeltaStart, center[1] + sinDeltaStart];\n endPoint = [center[0] - cosDeltaEnd, center[1] - sinDeltaEnd];\n break;\n\n case 'top-left':\n rstart = bbox.width / 2;\n rend = bbox.height / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - cosDeltaStart, center[1] - sinDeltaStart];\n endPoint = [center[0] - sinDeltaEnd, center[1] - cosDeltaEnd];\n break;\n\n default:\n rstart = bbox.width / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd];\n } // 如果逆时针画,交换起点和终点\n\n\n if (loopCfg.clockwise === false) {\n var swap = [startPoint[0], startPoint[1]];\n startPoint = [endPoint[0], endPoint[1]];\n endPoint = [swap[0], swap[1]];\n }\n }\n\n var startVec = [startPoint[0] - center[0], startPoint[1] - center[1]];\n var scaleRateStart = (rstart + dist) / rstart;\n var scaleRateEnd = (rend + dist) / rend;\n\n if (loopCfg.clockwise === false) {\n scaleRateStart = (rend + dist) / rend;\n scaleRateEnd = (rstart + dist) / rstart;\n }\n\n var startExtendVec = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__[\"vec2\"].scale([0, 0], startVec, scaleRateStart);\n var controlPoint1 = [center[0] + startExtendVec[0], center[1] + startExtendVec[1]];\n var endVec = [endPoint[0] - center[0], endPoint[1] - center[1]];\n var endExtendVec = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__[\"vec2\"].scale([0, 0], endVec, scaleRateEnd);\n var controlPoint2 = [center[0] + endExtendVec[0], center[1] + endExtendVec[1]];\n cfg.startPoint = {\n x: startPoint[0],\n y: startPoint[1]\n };\n cfg.endPoint = {\n x: endPoint[0],\n y: endPoint[1]\n };\n cfg.controlPoints = [{\n x: controlPoint1[0],\n y: controlPoint1[1]\n }, {\n x: controlPoint2[0],\n y: controlPoint2[1]\n }];\n return cfg;\n};\n/**\n * 根据 label 所在线条的位置百分比,计算 label 坐标\n * @param {object} pathShape G 的 path 实例,一般是 Edge 实例的 keyShape\n * @param {number} percent 范围 0 - 1 的线条百分比\n * @param {number} refX x 轴正方向为基准的 label 偏移\n * @param {number} refY y 轴正方向为基准的 label 偏移\n * @param {boolean} rotate 是否根据线条斜率旋转文本\n * @return {object} 文本的 x, y, 文本的旋转角度\n */\n\nvar getLabelPosition = function getLabelPosition(pathShape, percent, refX, refY, rotate) {\n var TAN_OFFSET = 0.0001;\n var vector = [];\n var point = pathShape === null || pathShape === void 0 ? void 0 : pathShape.getPoint(percent);\n\n if (!point) {\n return {\n x: 0,\n y: 0,\n angle: 0\n };\n } // 头尾最可能,放在最前面,使用 g path 上封装的方法\n\n\n if (percent < TAN_OFFSET) {\n vector = pathShape.getStartTangent().reverse();\n } else if (percent > 1 - TAN_OFFSET) {\n vector = pathShape.getEndTangent();\n } else {\n // 否则取指定位置的点,与少量偏移的点,做微分向量\n var offsetPoint = pathShape === null || pathShape === void 0 ? void 0 : pathShape.getPoint(percent + TAN_OFFSET);\n vector.push([point.x, point.y]);\n vector.push([offsetPoint.x, offsetPoint.y]);\n }\n\n var rad = Math.atan2(vector[1][1] - vector[0][1], vector[1][0] - vector[0][0]);\n\n if (rad < 0) {\n rad += PI * 2;\n }\n\n if (refX) {\n point.x += cos(rad) * refX;\n point.y += sin(rad) * refX;\n }\n\n if (refY) {\n // 默认方向是 x 轴正方向,法线是 求出角度 - 90°\n var normal = rad - PI / 2; // 若法线角度在 y 轴负方向,切到正方向,保证 refY 相对于 y 轴正方向\n\n if (rad > 1 / 2 * PI && rad < 3 * 1 / 2 * PI) {\n normal -= PI;\n }\n\n point.x += cos(normal) * refY;\n point.y += sin(normal) * refY;\n }\n\n var result = {\n x: point.x,\n y: point.y,\n angle: rad\n };\n\n if (rotate) {\n if (rad > 0.5 * PI && rad < 1.5 * PI) {\n rad -= PI;\n }\n\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n rotate: rad\n }, result);\n }\n\n return result;\n};\n/**\n * depth first traverse, from root to leaves, children in inverse order\n * if the fn returns false, terminate the traverse\n */\n\nvar traverse = function traverse(data, fn) {\n if (fn(data) === false) {\n return false;\n }\n\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverse(data.children[i], fn)) return false;\n }\n }\n\n return true;\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\n\n\nvar traverseUp = function traverseUp(data, fn) {\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverseUp(data.children[i], fn)) return;\n }\n }\n\n if (fn(data) === false) {\n return false;\n }\n\n return true;\n};\n/**\n * depth first traverse, from root to leaves, children in inverse order\n * if the fn returns false, terminate the traverse\n */\n\n\nvar traverseTree = function traverseTree(data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n\n traverse(data, fn);\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\n\nvar traverseTreeUp = function traverseTreeUp(data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n\n traverseUp(data, fn);\n};\n/**\n *\n * @param letter the letter\n * @param fontSize\n * @return the letter's width\n */\n\nvar getLetterWidth = function getLetterWidth(letter, fontSize) {\n return fontSize * (_letterAspectRatio__WEBPACK_IMPORTED_MODULE_4__[\"default\"][letter] || 1);\n};\n/**\n *\n * @param text the text\n * @param fontSize\n * @return the text's size\n */\n\nvar getTextSize = function getTextSize(text, fontSize) {\n var width = 0;\n var pattern = new RegExp(\"[\\u4E00-\\u9FA5]+\");\n text.split('').forEach(function (letter) {\n if (pattern.test(letter)) {\n // 中文字符\n width += fontSize;\n } else {\n width += getLetterWidth(letter, fontSize);\n }\n });\n return [width, fontSize];\n};\nvar truncateLabelByLength = function truncateLabelByLength(text, length) {\n if (typeof length !== 'number' || length <= 0 || length >= text.length) {\n return text;\n }\n\n return text.substring(0, length) + '...';\n};\n/**\n * construct the trees from combos data\n * @param array the combos array\n * @param nodes the nodes array\n * @return the tree\n */\n\nvar plainCombosToTrees = function plainCombosToTrees(array, nodes) {\n var result = [];\n var addedMap = {};\n var modelMap = {};\n array.forEach(function (d) {\n modelMap[d.id] = d;\n });\n array.forEach(function (d, i) {\n var cd = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"clone\"])(d);\n cd.itemType = 'combo';\n cd.children = undefined;\n\n if (cd.parentId === cd.id) {\n console.warn(\"The parentId for combo \".concat(cd.id, \" can not be the same as the combo's id\"));\n delete cd.parentId;\n } else if (cd.parentId && !modelMap[cd.parentId]) {\n console.warn(\"The parent combo for combo \".concat(cd.id, \" does not exist!\"));\n delete cd.parentId;\n }\n\n var mappedObj = addedMap[cd.id];\n\n if (mappedObj) {\n cd.children = mappedObj.children;\n addedMap[cd.id] = cd;\n mappedObj = cd;\n\n if (!mappedObj.parentId) {\n result.push(mappedObj);\n return;\n }\n\n var mappedParent = addedMap[mappedObj.parentId];\n\n if (mappedParent) {\n if (mappedParent.children) mappedParent.children.push(cd);else mappedParent.children = [cd];\n } else {\n var parent_1 = {\n id: mappedObj.parentId,\n children: [mappedObj]\n };\n addedMap[mappedObj.parentId] = parent_1;\n addedMap[cd.id] = cd;\n }\n\n return;\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isString\"])(d.parentId)) {\n var parent_2 = addedMap[d.parentId];\n\n if (parent_2) {\n if (parent_2.children) parent_2.children.push(cd);else parent_2.children = [cd];\n addedMap[cd.id] = cd;\n } else {\n var pa = {\n id: d.parentId,\n children: [cd]\n };\n addedMap[pa.id] = pa;\n addedMap[cd.id] = cd;\n }\n } else {\n result.push(cd);\n addedMap[cd.id] = cd;\n }\n }); // proccess the nodes\n\n var nodeMap = {};\n (nodes || []).forEach(function (node) {\n nodeMap[node.id] = node;\n var combo = addedMap[node.comboId];\n\n if (combo) {\n var cnode = {\n id: node.id,\n comboId: node.comboId\n };\n if (combo.children) combo.children.push(cnode);else combo.children = [cnode];\n cnode.itemType = 'node';\n addedMap[node.id] = cnode;\n }\n }); // assign the depth for each element\n\n var maxDepth = 0;\n result.forEach(function (tree) {\n tree.depth = maxDepth + 10;\n traverse(tree, function (child) {\n var parent;\n var itemType = addedMap[child.id].itemType;\n\n if (itemType === 'node') {\n parent = addedMap[child.comboId];\n } else {\n parent = addedMap[child.parentId];\n }\n\n if (parent) {\n if (itemType === 'node') child.depth = maxDepth + 1;else child.depth = maxDepth + 10;\n } else {\n child.depth = maxDepth + 10;\n }\n\n if (maxDepth < child.depth) maxDepth = child.depth;\n var oriNodeModel = nodeMap[child.id];\n\n if (oriNodeModel) {\n oriNodeModel.depth = child.depth;\n }\n\n return true;\n });\n });\n return result;\n};\nvar reconstructTree = function reconstructTree(trees, subtreeId, newParentId) {\n var _a;\n\n var brothers = trees;\n var subtree;\n var comboChildsMap = {\n root: {\n children: trees\n }\n };\n var foundSubTree = false;\n var oldParentId = 'root';\n (trees || []).forEach(function (tree) {\n if (foundSubTree) return;\n\n if (tree.id === subtreeId) {\n subtree = tree;\n\n if (tree.itemType === 'combo') {\n subtree.parentId = newParentId;\n } else {\n subtree.comboId = newParentId;\n }\n\n foundSubTree = true;\n return;\n }\n\n traverseTree(tree, function (child) {\n var _a;\n\n comboChildsMap[child.id] = {\n children: (child === null || child === void 0 ? void 0 : child.children) || []\n }; // store the old parent id to delete the subtree from the old parent's children in next recursion\n\n brothers = (_a = comboChildsMap[child.parentId || child.comboId || 'root']) === null || _a === void 0 ? void 0 : _a.children;\n\n if (child && (child.removed || subtreeId === child.id) && brothers) {\n oldParentId = child.parentId || child.comboId || 'root';\n subtree = child; // re-assign the parentId or comboId for the moved subtree\n\n if (child.itemType === 'combo') {\n subtree.parentId = newParentId;\n } else {\n subtree.comboId = newParentId;\n }\n\n foundSubTree = true;\n return false;\n }\n\n return true;\n });\n });\n brothers = (_a = comboChildsMap[oldParentId]) === null || _a === void 0 ? void 0 : _a.children;\n var index = brothers ? brothers.indexOf(subtree) : -1;\n if (index > -1) brothers.splice(index, 1); // 如果遍历完整棵树还没有找到,说明之前就不在树中\n\n if (!foundSubTree) {\n subtree = {\n id: subtreeId,\n itemType: 'node',\n comboId: newParentId\n };\n comboChildsMap[subtreeId] = {\n children: undefined\n };\n } // append to new parent\n\n\n if (subtreeId) {\n var found_1 = false; // newParentId is undefined means the subtree will have no parent\n\n if (newParentId) {\n var newParentDepth_1 = 0;\n (trees || []).forEach(function (tree) {\n if (found_1) return; // terminate\n\n traverseTree(tree, function (child) {\n // append subtree to the new parent ans assign the depth to the subtree\n if (newParentId === child.id) {\n found_1 = true;\n if (child.children) child.children.push(subtree);else child.children = [subtree];\n newParentDepth_1 = child.depth;\n if (subtree.itemType === 'node') subtree.depth = newParentDepth_1 + 2;else subtree.depth = newParentDepth_1 + 1;\n return false; // terminate\n }\n\n return true;\n });\n });\n } else if ((!newParentId || !found_1) && subtree.itemType !== 'node') {\n // if the newParentId is undefined or it is not found in the tree, add the subTree to the root\n trees.push(subtree);\n } // update the depth of the subtree and its children from the subtree\n\n\n var currentDepth_1 = subtree.depth;\n traverseTree(subtree, function (child) {\n if (child.itemType === 'node') currentDepth_1 += 2;else currentDepth_1 += 1;\n child.depth = currentDepth_1;\n return true;\n });\n }\n\n return trees;\n};\nvar getComboBBox = function getComboBBox(children, graph, combo) {\n var comboBBox = {\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity,\n x: undefined,\n y: undefined,\n width: undefined,\n height: undefined,\n centerX: undefined,\n centerY: undefined\n };\n\n if (!children || children.length === 0) {\n var comboModel = combo === null || combo === void 0 ? void 0 : combo.getModel();\n\n var _a = comboModel || {},\n x = _a.x,\n y = _a.y;\n\n return {\n minX: x,\n minY: y,\n maxX: x,\n maxY: y,\n x: x,\n y: y,\n width: undefined,\n height: undefined\n };\n }\n\n children.forEach(function (child) {\n var childItem = graph.findById(child.id);\n if (!childItem || !childItem.isVisible()) return; // ignore hidden children\n\n childItem.set('bboxCanvasCache', undefined);\n var childBBox = childItem.getCanvasBBox();\n if (childBBox.x && comboBBox.minX > childBBox.minX) comboBBox.minX = childBBox.minX;\n if (childBBox.y && comboBBox.minY > childBBox.minY) comboBBox.minY = childBBox.minY;\n if (childBBox.x && comboBBox.maxX < childBBox.maxX) comboBBox.maxX = childBBox.maxX;\n if (childBBox.y && comboBBox.maxY < childBBox.maxY) comboBBox.maxY = childBBox.maxY;\n });\n comboBBox.x = (comboBBox.minX + comboBBox.maxX) / 2;\n comboBBox.y = (comboBBox.minY + comboBBox.maxY) / 2;\n comboBBox.width = comboBBox.maxX - comboBBox.minX;\n comboBBox.height = comboBBox.maxY - comboBBox.minY;\n comboBBox.centerX = (comboBBox.minX + comboBBox.maxX) / 2;\n comboBBox.centerY = (comboBBox.minY + comboBBox.maxY) / 2;\n Object.keys(comboBBox).forEach(function (key) {\n if (comboBBox[key] === Infinity || comboBBox[key] === -Infinity) {\n comboBBox[key] = undefined;\n }\n });\n return comboBBox;\n};\nvar shouldRefreshEdge = function shouldRefreshEdge(cfg) {\n var refreshEdge = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(cfg.x) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(cfg.y) || cfg.type || cfg.anchorPoints || cfg.size;\n if (cfg.style) refreshEdge = refreshEdge || Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(cfg.style.r) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(cfg.style.width) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(cfg.style.height) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(cfg.style.rx) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isNumber\"])(cfg.style.ry);\n return refreshEdge;\n};\nvar cloneBesidesImg = function cloneBesidesImg(obj) {\n var clonedObj = {};\n Object.keys(obj).forEach(function (key1) {\n var obj2 = obj[key1];\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isObject\"])(obj2) && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isArray\"])(obj2)) {\n var clonedObj2_1 = {};\n Object.keys(obj2).forEach(function (key2) {\n var v = obj2[key2];\n if (key2 === 'img' && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"isString\"])(v)) return;\n clonedObj2_1[key2] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"clone\"])(v);\n });\n clonedObj[key1] = clonedObj2_1;\n } else {\n clonedObj[key1] = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"clone\"])(obj2);\n }\n });\n return clonedObj;\n};\nvar getAnimateCfgWithCallback = function getAnimateCfgWithCallback(_a) {\n var animateCfg = _a.animateCfg,\n callback = _a.callback;\n var animateConfig;\n\n if (!animateCfg) {\n animateConfig = {\n duration: 500,\n callback: callback\n };\n } else {\n animateConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_5__[\"clone\"])(animateCfg);\n\n if (animateCfg.callback) {\n var animateCfgCallback_1 = animateCfg.callback;\n\n animateConfig.callback = function () {\n callback();\n animateCfgCallback_1();\n };\n } else {\n animateConfig.callback = callback;\n }\n }\n\n return animateConfig;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/graphic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GraphWithEvent\", function() { return GraphWithEvent; });\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! . */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\nvar GraphWithEvent = /*#__PURE__*/function (_Graph) {\n _inherits(GraphWithEvent, _Graph);\n\n var _super = _createSuper(GraphWithEvent);\n\n function GraphWithEvent() {\n var _this;\n\n _classCallCheck(this, GraphWithEvent);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.eventPool = {};\n return _this;\n }\n\n _createClass(GraphWithEvent, [{\n key: \"appendEvent\",\n value:\n /**\n * @description Add an event listener.\n * @description.zh-CN 添加事件监听器。\n */\n function appendEvent(type, callback) {\n if (!this.eventPool[type]) {\n this.eventPool[type] = [];\n }\n\n this.eventPool[type].push(callback);\n }\n /**\n * @description remove an event listener.\n * @description.zh-CN 移除事件监听器。\n */\n\n }, {\n key: \"removeEvent\",\n value: function removeEvent(type, callback) {\n if (!this.eventPool[type]) {\n return;\n }\n\n var index = this.eventPool[type].indexOf(callback);\n\n if (index > -1) {\n this.eventPool[type].splice(index, 1);\n }\n }\n /**\n * @description trigger an event.\n * @description.zh-CN 触发事件。\n */\n\n }, {\n key: \"emitEvent\",\n value: function emitEvent(type) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n if (!this.eventPool[type]) {\n return;\n }\n\n this.eventPool[type].forEach(function (callback) {\n callback.apply(void 0, args);\n });\n }\n }, {\n key: \"setNode\",\n value: function setNode(node, value) {\n _get(_getPrototypeOf(GraphWithEvent.prototype), \"setNode\", this).call(this, node, value);\n\n this.emitEvent('nodeAdd', node, value);\n return this;\n }\n }, {\n key: \"removeNode\",\n value: function removeNode(node) {\n _get(_getPrototypeOf(GraphWithEvent.prototype), \"removeNode\", this).call(this, node);\n\n this.emitEvent('nodeRemove', node);\n return this;\n }\n }, {\n key: \"setEdge\",\n value: function setEdge(v_, w_, value, name) {\n _get(_getPrototypeOf(GraphWithEvent.prototype), \"setEdge\", this).call(this, v_, w_, value, name);\n\n this.emitEvent('edgeAdd', v_, w_, value, name);\n return this;\n }\n }, {\n key: \"removeEdge\",\n value: function removeEdge(v_, w_, name) {\n _get(_getPrototypeOf(GraphWithEvent.prototype), \"removeEdge\", this).call(this, v_, w_, name);\n\n this.emitEvent('edgeRemove', v_, w_, name);\n return this;\n }\n }]);\n\n return GraphWithEvent;\n}(___WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/Graph/event.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/util/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/util/index.js ***! - \*****************************************************/ +/***/ "./node_modules/@antv/graphlib/es/Graph/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/Graph/index.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./math */ \"./node_modules/@antv/g6-core/es/util/math.js\");\n/* harmony import */ var _graphic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path */ \"./node_modules/@antv/g6-core/es/util/path.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/g6-core/es/util/base.js\");\n/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./color */ \"./node_modules/@antv/g6-core/es/util/color.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_6__[\"ext\"].transform;\n\nvar Util = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _base__WEBPACK_IMPORTED_MODULE_4__), _graphic__WEBPACK_IMPORTED_MODULE_2__), _path__WEBPACK_IMPORTED_MODULE_3__), _math__WEBPACK_IMPORTED_MODULE_1__), _color__WEBPACK_IMPORTED_MODULE_5__), {\n transform: transform,\n mat3: _antv_matrix_util__WEBPACK_IMPORTED_MODULE_6__[\"mat3\"]\n});\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Util);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Graph; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/graphlib/es/util.js\");\n/* harmony import */ var _enum__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enum */ \"./node_modules/@antv/graphlib/es/Graph/enum.js\");\n/* harmony import */ var _toJSON__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toJSON */ \"./node_modules/@antv/graphlib/es/Graph/toJSON.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n\n\n\n\nvar defaultOption = {\n compound: false,\n multigraph: false,\n directed: true\n};\n\nvar Graph = /*#__PURE__*/function () {\n // Graph option or basic props\n\n /**\n * @description Label for this graph itself\n * @description.zh-CN 图本身的标签(label)\n * @default undefined\n */\n\n /**\n * @description Number of nodes in the graph\n * @description.zh-CN 节点的数量\n * @default 0\n */\n\n /**\n * @description Number of edges in the graph\n * @description.zh-CN 节点的数量\n * @default 0\n */\n\n /**\n * @description return node label with its id\n * @description.zh-CN 返回节点的默认的标签\n */\n\n /**\n * @description return edge label with its id\n * @description.zh-CN 返回边的默认的标签\n */\n function Graph() {\n var _this = this;\n\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Graph);\n\n this.directed = true;\n this.multigraph = false;\n this.compound = false;\n this.GRAPH_NODE = _enum__WEBPACK_IMPORTED_MODULE_1__[\"GraphEnum\"].GRAPH_NODE;\n this.label = void 0;\n this.nodeCountNum = 0;\n this.edgeCountNum = 0;\n\n this.defaultNodeLabelFn = function () {\n return undefined;\n };\n\n this.defaultEdgeLabelFn = function () {\n return undefined;\n };\n\n this.parentMap = void 0;\n this.childrenMap = void 0;\n this.nodesLabelMap = new Map();\n this.inEdgesMap = new Map();\n this.outEdgesMap = new Map();\n this.predecessorsMap = new Map();\n this.successorsMap = new Map();\n this.edgesMap = new Map();\n this.edgesLabelsMap = new Map();\n\n this.isDirected = function () {\n return _this.directed;\n };\n\n this.isMultigraph = function () {\n return _this.multigraph;\n };\n\n this.isCompound = function () {\n return _this.compound;\n };\n\n this.setGraph = function (label) {\n _this.label = label;\n return _this;\n };\n\n this.graph = function () {\n return _this.label;\n };\n\n this.setDefaultNodeLabel = function (newDefault) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(newDefault)) {\n _this.defaultNodeLabelFn = newDefault;\n } else {\n _this.defaultNodeLabelFn = function () {\n return newDefault;\n };\n }\n\n return _this;\n };\n\n this.nodeCount = function () {\n return _this.nodeCountNum;\n };\n\n this.node = function (n) {\n return _this.nodesLabelMap.get(n);\n };\n\n this.nodes = function () {\n return Array.from(_this.nodesLabelMap.keys());\n };\n\n this.sources = function () {\n return _this.nodes().filter(function (n) {\n var _this$inEdgesMap$get;\n\n return !((_this$inEdgesMap$get = _this.inEdgesMap.get(n)) === null || _this$inEdgesMap$get === void 0 ? void 0 : _this$inEdgesMap$get.size);\n });\n };\n\n this.sinks = function () {\n return _this.nodes().filter(function (n) {\n var _this$outEdgesMap$get;\n\n return !((_this$outEdgesMap$get = _this.outEdgesMap.get(n)) === null || _this$outEdgesMap$get === void 0 ? void 0 : _this$outEdgesMap$get.size);\n });\n };\n\n this.setNodes = function (nodes, value) {\n nodes.map(function (node) {\n return _this.setNode(node, value);\n });\n return _this;\n };\n\n this.hasNode = function (node) {\n return _this.nodesLabelMap.has(node);\n };\n\n this.checkCompound = function () {\n if (!_this.isCompound()) {\n throw new Error('Cannot construct parent-children relations in a non-compound graph');\n }\n };\n\n this.parent = function (node) {\n if (_this.isCompound()) {\n var _this$parentMap;\n\n var parent = (_this$parentMap = _this.parentMap) === null || _this$parentMap === void 0 ? void 0 : _this$parentMap.get(node);\n\n if (parent !== _this.GRAPH_NODE) {\n return parent;\n }\n }\n };\n\n this.removeFromParentsChildList = function (node) {\n var targetParent = _this.parentMap.get(node);\n\n _this.childrenMap.get(targetParent).delete(node);\n };\n\n this.setParent = function (node, parent) {\n var _this$parentMap2, _this$childrenMap;\n\n _this.checkCompound();\n\n var realParent = parent === undefined ? _this.GRAPH_NODE : parent;\n\n var checkNode = _this.parent(realParent);\n\n while (checkNode) {\n if (node === checkNode) {\n throw new Error('Setting ' + parent + ' as parent of ' + node + ' would create a cycle');\n }\n\n checkNode = _this.parent(checkNode);\n }\n\n if (parent) {\n _this.setNode(parent);\n }\n\n _this.setNode(node);\n\n _this.removeFromParentsChildList(node);\n\n (_this$parentMap2 = _this.parentMap) === null || _this$parentMap2 === void 0 ? void 0 : _this$parentMap2.set(node, realParent);\n\n var realParentChilren = _this.childrenMap.get(realParent);\n\n realParentChilren.set(node, true);\n (_this$childrenMap = _this.childrenMap) === null || _this$childrenMap === void 0 ? void 0 : _this$childrenMap.set(realParent, realParentChilren);\n return _this;\n };\n\n this.children = function (node) {\n var targetNode = node === undefined ? _this.GRAPH_NODE : node;\n\n if (_this.isCompound()) {\n var _this$childrenMap2;\n\n var target = (_this$childrenMap2 = _this.childrenMap) === null || _this$childrenMap2 === void 0 ? void 0 : _this$childrenMap2.get(targetNode);\n\n if (target) {\n return Array.from(target.keys());\n }\n\n return undefined;\n }\n\n if (targetNode === _this.GRAPH_NODE) {\n return _this.nodes();\n }\n\n if (node && _this.hasNode(node)) {\n return [];\n }\n };\n\n this.predecessors = function (node) {\n var preds = _this.predecessorsMap.get(node);\n\n return preds ? Array.from(preds.keys()) : undefined;\n };\n\n this.successors = function (node) {\n var succs = _this.successorsMap.get(node);\n\n return succs ? Array.from(succs.keys()) : undefined;\n };\n\n this.neighbors = function (node) {\n var _this$predecessors;\n\n if (!_this.hasNode(node)) {\n return undefined;\n }\n\n return Array.from(new Set((_this$predecessors = _this.predecessors(node)) === null || _this$predecessors === void 0 ? void 0 : _this$predecessors.concat(_this.successors(node))));\n };\n\n this.isLeaf = function (node) {\n var _this$neighbors;\n\n if (_this.isDirected()) {\n var _this$successors;\n\n return !((_this$successors = _this.successors(node)) === null || _this$successors === void 0 ? void 0 : _this$successors.length);\n }\n\n return !((_this$neighbors = _this.neighbors(node)) === null || _this$neighbors === void 0 ? void 0 : _this$neighbors.length);\n };\n\n this.filterNodes = function (filter) {\n var directed = _this.directed,\n multigraph = _this.multigraph,\n compound = _this.compound;\n var copyGraph = new Graph({\n directed: directed,\n multigraph: multigraph,\n compound: compound\n });\n copyGraph.setGraph(_this.graph());\n\n _this.nodes().forEach(function (n) {\n if (filter(n)) {\n copyGraph.setNode(n, _this.node(n));\n }\n });\n\n _this.edges().forEach(function (edgeObj) {\n if (copyGraph.hasNode(edgeObj.v) && copyGraph.hasNode(edgeObj.w)) {\n copyGraph.setEdgeObj(edgeObj, _this.edge(edgeObj));\n }\n });\n\n if (compound) {\n var findParent = function findParent(node) {\n var parent = _this.parent(node);\n\n while (parent !== undefined && !copyGraph.hasNode(parent)) {\n parent = _this.parent(parent);\n }\n\n return parent;\n };\n\n copyGraph.nodes().forEach(function (node) {\n copyGraph.setParent(node, findParent(node));\n });\n }\n\n return copyGraph;\n };\n\n this.setDefaultEdgeLabel = function (newDefault) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(newDefault)) {\n _this.defaultEdgeLabelFn = newDefault;\n } else {\n _this.defaultEdgeLabelFn = function () {\n return newDefault;\n };\n }\n\n return _this;\n };\n\n this.edgeCount = function () {\n return _this.edgeCountNum;\n };\n\n this.setEdgeObj = function (edgeObj, value) {\n return _this.setEdge(edgeObj.v, edgeObj.w, value, edgeObj.name);\n };\n\n this.setPath = function (edges, value) {\n edges.reduce(function (v, w) {\n _this.setEdge(v, w, value);\n\n return w;\n });\n return _this;\n };\n\n this.edgeFromArgs = function (v, w, name) {\n return _this.edge({\n v: v,\n w: w,\n name: name\n });\n };\n\n this.edge = function (edgeObj) {\n return _this.edgesLabelsMap.get(Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeObjToId\"])(_this.isDirected(), edgeObj));\n };\n\n this.hasEdge = function (v, w, name) {\n return _this.edgesLabelsMap.has(Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeObjToId\"])(_this.isDirected(), {\n v: v,\n w: w,\n name: name\n }));\n };\n\n this.removeEdgeObj = function (_ref) {\n var v = _ref.v,\n w = _ref.w,\n name = _ref.name;\n return _this.removeEdge(v, w, name);\n };\n\n this.edges = function () {\n return Array.from(_this.edgesMap.values());\n };\n\n this.inEdges = function (v, u) {\n var inV = _this.inEdgesMap.get(v);\n\n if (inV) {\n return Array.from(inV.values()).filter(function (e) {\n return !u || e.v === u;\n });\n }\n\n return undefined;\n };\n\n this.outEdges = function (w, u) {\n var outW = _this.outEdgesMap.get(w);\n\n if (outW) {\n return Array.from(outW.values()).filter(function (e) {\n return !u || e.w === u;\n });\n }\n\n return undefined;\n };\n\n this.nodeEdges = function (v, w) {\n var _this$inEdges;\n\n if (!_this.hasNode(v)) {\n return undefined;\n }\n\n return (_this$inEdges = _this.inEdges(v, w)) === null || _this$inEdges === void 0 ? void 0 : _this$inEdges.concat(_this.outEdges(v, w));\n };\n\n this.toJSON = function () {\n return Object(_toJSON__WEBPACK_IMPORTED_MODULE_2__[\"write\"])(_this);\n };\n\n this.nodeInDegree = function (node) {\n var inEdges = _this.inEdgesMap.get(node);\n\n if (inEdges) {\n return inEdges.size;\n }\n\n return 0;\n };\n\n this.nodeOutDegree = function (node) {\n var outEdges = _this.outEdgesMap.get(node);\n\n if (outEdges) {\n return outEdges.size;\n }\n\n return 0;\n };\n\n this.nodeDegree = function (node) {\n return _this.nodeInDegree(node) + _this.nodeOutDegree(node);\n };\n\n this.source = function (edge) {\n return edge.v;\n };\n\n this.target = function (edge) {\n return edge.w;\n };\n\n var resultOptions = _objectSpread(_objectSpread({}, defaultOption), options);\n\n this.compound = resultOptions.compound;\n this.directed = resultOptions.directed;\n this.multigraph = resultOptions.multigraph;\n\n if (this.compound) {\n this.parentMap = new Map();\n this.childrenMap = new Map();\n }\n } // Map for graph\n\n /**\n * @description Map for parent relationship\n * @description.zh-CN 父子关系的映射\n */\n\n\n _createClass(Graph, [{\n key: \"setNode\",\n value:\n /**\n * @description Set Node label in graph if node not in graph then create it\n * @description.zh-CN 设置节点的label,如果这个节点不在图中,则在图中创建这个节点\n * @param node\n * @param value\n * @returns\n */\n function setNode(node, value) {\n var nodesLabelMap = this.nodesLabelMap,\n defaultNodeLabelFn = this.defaultNodeLabelFn,\n isCompound = this.isCompound,\n parentMap = this.parentMap,\n childrenMap = this.childrenMap,\n inEdgesMap = this.inEdgesMap,\n outEdgesMap = this.outEdgesMap,\n predecessorsMap = this.predecessorsMap,\n successorsMap = this.successorsMap; // 如果节点不在图中,则创建节点\n\n if (nodesLabelMap.has(node)) {\n if (value !== undefined) {\n nodesLabelMap.set(node, value);\n }\n\n return this;\n }\n\n nodesLabelMap.set(node, value || defaultNodeLabelFn(node)); // 如果是复合图,则创建节点的子节点\n\n if (isCompound()) {\n var _childrenMap$get;\n\n parentMap === null || parentMap === void 0 ? void 0 : parentMap.set(node, this.GRAPH_NODE);\n childrenMap === null || childrenMap === void 0 ? void 0 : childrenMap.set(node, new Map());\n\n if (!(childrenMap === null || childrenMap === void 0 ? void 0 : childrenMap.has(this.GRAPH_NODE))) {\n childrenMap === null || childrenMap === void 0 ? void 0 : childrenMap.set(this.GRAPH_NODE, new Map());\n }\n\n childrenMap === null || childrenMap === void 0 ? void 0 : (_childrenMap$get = childrenMap.get(this.GRAPH_NODE)) === null || _childrenMap$get === void 0 ? void 0 : _childrenMap$get.set(node, true);\n }\n\n [inEdgesMap, outEdgesMap, predecessorsMap, successorsMap].forEach(function (map) {\n return map.set(node, new Map());\n });\n this.nodeCountNum += 1;\n return this;\n }\n /**\n * @description Set nodes or add nodes in batch\n * @description.zh-CN 批量设置或者创建节点\n * @param nodes\n * @param value\n * @returns\n */\n\n }, {\n key: \"removeNode\",\n value:\n /**\n * @description Remove node from graph\n * @description.zh-CN 将节点从图中移除\n * @param node\n * @returns\n */\n function removeNode(node) {\n var _this2 = this;\n\n if (this.hasNode(node)) {\n var cleanEdge = function cleanEdge(edgeObj) {\n _this2.removeEdge(edgeObj.v, edgeObj.w, edgeObj.name);\n };\n\n var inEdgesMap = this.inEdgesMap,\n outEdgesMap = this.outEdgesMap,\n predecessorsMap = this.predecessorsMap,\n successorsMap = this.successorsMap,\n nodesLabelMap = this.nodesLabelMap;\n\n if (this.isCompound()) {\n var _this$parentMap3, _this$children, _this$childrenMap3;\n\n this.removeFromParentsChildList(node);\n (_this$parentMap3 = this.parentMap) === null || _this$parentMap3 === void 0 ? void 0 : _this$parentMap3.delete(node);\n (_this$children = this.children(node)) === null || _this$children === void 0 ? void 0 : _this$children.forEach(function (n) {\n return _this2.setParent(n);\n });\n (_this$childrenMap3 = this.childrenMap) === null || _this$childrenMap3 === void 0 ? void 0 : _this$childrenMap3.delete(node);\n }\n\n var inE = inEdgesMap.get(node);\n var outE = outEdgesMap.get(node);\n Array.from(inE.values()).forEach(function (edge) {\n return cleanEdge(edge);\n });\n Array.from(outE.values()).forEach(function (edge) {\n return cleanEdge(edge);\n });\n nodesLabelMap.delete(node);\n inEdgesMap.delete(node);\n outEdgesMap.delete(node);\n predecessorsMap.delete(node);\n successorsMap.delete(node);\n this.nodeCountNum -= 1;\n }\n\n return this;\n }\n /**\n * @description Set function that generate default label for edge, if param is non-function value then default label will always be this value;\n * @description.zh-CN 设置默认获取边Label的方法,如果传入不是函数的,那么默认label 的值只会是传入值\n * @param newDefault\n * @returns\n */\n\n }, {\n key: \"setEdge\",\n value:\n /**\n * @description set edge value, if nodes or edges not exsit then add to graph\n * @description.zh-CN 设置边的属性,如果边或节点不存在,那么将他们加入这个图\n * @param v\n * @param w\n * @param value\n * @param name\n * @returns\n */\n function setEdge(v_, w_, value, name) {\n var _this$inEdgesMap$get2, _this$outEdgesMap$get2;\n\n var edgeObj = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeArgsToObj\"])(this.isDirected(), v_, w_, name);\n var edgeId = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeObjToId\"])(this.isDirected(), edgeObj);\n var v = edgeObj.v,\n w = edgeObj.w;\n\n if (this.edgesLabelsMap.has(edgeId)) {\n this.edgesLabelsMap.set(edgeId, value);\n return this;\n }\n\n if (name !== undefined && !this.isMultigraph()) {\n throw new Error('Cannot set a named edge when isMultigraph = false');\n }\n\n this.setNode(v);\n this.setNode(w);\n this.edgesLabelsMap.set(edgeId, value || this.defaultEdgeLabelFn(v, w, name));\n Object.freeze(edgeObj);\n this.edgesMap.set(edgeId, edgeObj);\n var preds = this.predecessorsMap.get(w);\n var succs = this.successorsMap.get(v);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"incrementOrInitEntry\"])(preds, v);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"incrementOrInitEntry\"])(succs, w);\n (_this$inEdgesMap$get2 = this.inEdgesMap.get(w)) === null || _this$inEdgesMap$get2 === void 0 ? void 0 : _this$inEdgesMap$get2.set(edgeId, edgeObj);\n (_this$outEdgesMap$get2 = this.outEdgesMap.get(v)) === null || _this$outEdgesMap$get2 === void 0 ? void 0 : _this$outEdgesMap$get2.set(edgeId, edgeObj);\n this.edgeCountNum += 1;\n return this;\n }\n }, {\n key: \"removeEdge\",\n value:\n /**\n * @description remove a specific edge\n * @description.zh-CN 删除一条边\n * @param v\n * @param w\n * @param name\n * @returns\n */\n function removeEdge(v_, w_, name) {\n var edgeId = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeArgsToId\"])(this.isDirected(), v_, w_, name);\n var edgeObj = this.edgesMap.get(edgeId);\n\n if (edgeObj) {\n var _edgeArgsToObj = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeArgsToObj\"])(this.isDirected(), v_, w_, name),\n v = _edgeArgsToObj.v,\n w = _edgeArgsToObj.w;\n\n this.edgesLabelsMap.delete(edgeId);\n this.edgesMap.delete(edgeId);\n var preds = this.predecessorsMap.get(w);\n var succs = this.successorsMap.get(v);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"decrementOrRemoveEntry\"])(preds, v);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"decrementOrRemoveEntry\"])(succs, w);\n this.inEdgesMap.get(w).delete(edgeId);\n this.outEdgesMap.get(v).delete(edgeId);\n this.edgeCountNum -= 1;\n }\n\n return this;\n }\n /**\n * @description remove a specific edge by edge object\n * @description.zh-CN 删除一条边\n */\n\n }]);\n\n return Graph;\n}();\n\nGraph.fromJSON = _toJSON__WEBPACK_IMPORTED_MODULE_2__[\"read\"];\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/Graph/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/util/letterAspectRatio.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/util/letterAspectRatio.js ***! - \*****************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/graphlib/es/Graph/toJSON.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/Graph/toJSON.js ***! + \********************************************************/ +/*! exports provided: write, read */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n ' ': 0.3329986572265625,\n a: 0.5589996337890625,\n A: 0.6569992065429687,\n b: 0.58599853515625,\n B: 0.6769989013671875,\n c: 0.5469985961914062,\n C: 0.7279998779296875,\n d: 0.58599853515625,\n D: 0.705999755859375,\n e: 0.554998779296875,\n E: 0.63699951171875,\n f: 0.37299957275390627,\n F: 0.5769989013671875,\n g: 0.5909988403320312,\n G: 0.7479995727539063,\n h: 0.555999755859375,\n H: 0.7199996948242188,\n i: 0.255999755859375,\n I: 0.23699951171875,\n j: 0.26699981689453123,\n J: 0.5169998168945312,\n k: 0.5289993286132812,\n K: 0.6899993896484375,\n l: 0.23499908447265624,\n L: 0.5879989624023437,\n m: 0.854998779296875,\n M: 0.8819992065429687,\n n: 0.5589996337890625,\n N: 0.7189987182617188,\n o: 0.58599853515625,\n O: 0.7669998168945312,\n p: 0.58599853515625,\n P: 0.6419998168945312,\n q: 0.58599853515625,\n Q: 0.7669998168945312,\n r: 0.3649993896484375,\n R: 0.6759994506835938,\n s: 0.504998779296875,\n S: 0.6319992065429687,\n t: 0.354998779296875,\n T: 0.6189987182617187,\n u: 0.5599990844726562,\n U: 0.7139999389648437,\n v: 0.48199920654296874,\n V: 0.6389999389648438,\n w: 0.754998779296875,\n W: 0.929998779296875,\n x: 0.5089996337890625,\n X: 0.63699951171875,\n y: 0.4959991455078125,\n Y: 0.66199951171875,\n z: 0.48699951171875,\n Z: 0.6239990234375,\n '0': 0.6,\n '1': 0.40099945068359377,\n '2': 0.6,\n '3': 0.6,\n '4': 0.6,\n '5': 0.6,\n '6': 0.6,\n '7': 0.5469985961914062,\n '8': 0.6,\n '9': 0.6,\n '[': 0.3329986572265625,\n ']': 0.3329986572265625,\n ',': 0.26399993896484375,\n '.': 0.26399993896484375,\n ';': 0.26399993896484375,\n ':': 0.26399993896484375,\n '{': 0.3329986572265625,\n '}': 0.3329986572265625,\n '\\\\': 0.5,\n '|': 0.19499969482421875,\n '=': 0.604998779296875,\n '+': 0.604998779296875,\n '-': 0.604998779296875,\n _: 0.5,\n '`': 0.3329986572265625,\n ' ~': 0.8329986572265625,\n '!': 0.3329986572265625,\n '@': 0.8579986572265625,\n '#': 0.6,\n $: 0.6,\n '%': 0.9699996948242188,\n '^': 0.517999267578125,\n '&': 0.7259994506835937,\n '*': 0.505999755859375,\n '(': 0.3329986572265625,\n ')': 0.3329986572265625,\n '<': 0.604998779296875,\n '>': 0.604998779296875,\n '/': 0.5,\n '?': 0.53699951171875\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/letterAspectRatio.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"write\", function() { return write; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"read\", function() { return read; });\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! . */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\n\n/**\n * @description Convert a graph's node to JSON.\n * @description.zh-CN 转换图的节点为 JSON。\n * @param graph\n * @returns\n */\n\nvar nodeToJSON = function nodeToJSON(graph) {\n return graph.nodes().map(function (n) {\n var value = graph.node(n);\n var parent = graph.parent(n);\n var node = {\n id: n,\n value: value,\n parent: parent\n };\n\n if (node.value === undefined) {\n delete node.value;\n }\n\n if (node.parent === undefined) {\n delete node.parent;\n }\n\n return node;\n });\n};\n/**\n * @description Convert all graph's edges to JSON.\n * @description.zh-CN 转换图的所有边为 JSON。\n * @param graph\n * @returns\n */\n\n\nvar edgeToJSON = function edgeToJSON(graph) {\n return graph.edges().map(function (edge) {\n var value = graph.edge(edge);\n var e = {\n v: edge.v,\n w: edge.w,\n value: value,\n name: edge.name\n };\n\n if (e.name === undefined) {\n delete e.name;\n }\n\n if (e.value === undefined) {\n delete e.value;\n }\n\n return e;\n });\n};\n/**\n * @description Convert a graph to JSON.\n * @description.zh-CN 转换图为 JSON。\n * @param graph\n * @returns\n */\n\n\nvar write = function write(graph) {\n var json = {\n options: {\n directed: graph.isDirected(),\n multigraph: graph.isMultigraph(),\n compound: graph.isCompound()\n },\n nodes: nodeToJSON(graph),\n edges: edgeToJSON(graph),\n value: graph.graph()\n };\n\n if (json.value === undefined) {\n delete json.value;\n }\n\n return json;\n};\n/**\n * @description read a graph from JSON.\n * @description.zh-CN 从 JSON 读取图。\n * @param json\n * @returns\n */\n\nvar read = function read(json) {\n var graph = new ___WEBPACK_IMPORTED_MODULE_0__[\"default\"](json.options);\n\n if (json.value !== undefined) {\n graph.setGraph(json.value);\n }\n\n json.nodes.forEach(function (entry) {\n graph.setNode(entry.id, entry.value);\n\n if (entry.parent) {\n graph.setParent(entry.id, entry.parent);\n }\n });\n json.edges.forEach(function (entry) {\n graph.setEdge(entry.v, entry.w, entry.value, entry.name);\n });\n return graph;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/Graph/toJSON.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/util/math.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/util/math.js ***! - \****************************************************/ -/*! exports provided: compare, getLineIntersect, getRectIntersectByPoint, getCircleIntersectByPoint, getEllipseIntersectByPoint, applyMatrix, invertMatrix, getCircleCenterByPoints, distance, scaleMatrix, floydWarshall, getAdjMatrix, translate, move, scale, rotate, getDegree, isPointInPolygon, intersectBBox, isPolygonsIntersect, Line, getBBoxBoundLine, itemIntersectByLine, fractionToLine, getPointsCenter, squareDist, pointLineSquareDist, isPointsOverlap, pointRectSquareDist, pointLineDistance, lerp, lerpArray */ +/***/ "./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js ***! + \*************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"compare\", function() { return compare; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLineIntersect\", function() { return getLineIntersect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRectIntersectByPoint\", function() { return getRectIntersectByPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCircleIntersectByPoint\", function() { return getCircleIntersectByPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getEllipseIntersectByPoint\", function() { return getEllipseIntersectByPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"applyMatrix\", function() { return applyMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invertMatrix\", function() { return invertMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getCircleCenterByPoints\", function() { return getCircleCenterByPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleMatrix\", function() { return scaleMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floydWarshall\", function() { return floydWarshall; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAdjMatrix\", function() { return getAdjMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"move\", function() { return move; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDegree\", function() { return getDegree; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPointInPolygon\", function() { return isPointInPolygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"intersectBBox\", function() { return intersectBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPolygonsIntersect\", function() { return isPolygonsIntersect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Line\", function() { return Line; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxBoundLine\", function() { return getBBoxBoundLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"itemIntersectByLine\", function() { return itemIntersectByLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fractionToLine\", function() { return fractionToLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPointsCenter\", function() { return getPointsCenter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squareDist\", function() { return squareDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointLineSquareDist\", function() { return pointLineSquareDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPointsOverlap\", function() { return isPointsOverlap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointRectSquareDist\", function() { return pointRectSquareDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointLineDistance\", function() { return pointLineDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerpArray\", function() { return lerpArray; });\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"ext\"].transform;\n/**\n * 对比对象,用于对象数组排序\n * @param {string} attributeName 排序依据的字段名称\n * @param {number} min 最小值\n * @param {number} max 最大值\n * @return {boolean} bool 布尔\n */\n\nvar compare = function compare(attributeName) {\n return function (m, n) {\n return m[attributeName] - n[attributeName];\n };\n};\n/**\n * 是否在区间内\n * @param {number} value 值\n * @param {number} min 最小值\n * @param {number} max 最大值\n * @return {boolean} bool 布尔\n */\n\nvar isBetween = function isBetween(value, min, max) {\n return value >= min && value <= max;\n};\n/**\n * 获取两条线段的交点\n * @param {Point} p0 第一条线段起点\n * @param {Point} p1 第一条线段终点\n * @param {Point} p2 第二条线段起点\n * @param {Point} p3 第二条线段终点\n * @return {Point} 交点\n */\n\n\nvar getLineIntersect = function getLineIntersect(p0, p1, p2, p3) {\n var tolerance = 0.0001;\n var E = {\n x: p2.x - p0.x,\n y: p2.y - p0.y\n };\n var D0 = {\n x: p1.x - p0.x,\n y: p1.y - p0.y\n };\n var D1 = {\n x: p3.x - p2.x,\n y: p3.y - p2.y\n };\n var kross = D0.x * D1.y - D0.y * D1.x;\n var sqrKross = kross * kross;\n var invertKross = 1 / kross;\n var sqrLen0 = D0.x * D0.x + D0.y * D0.y;\n var sqrLen1 = D1.x * D1.x + D1.y * D1.y;\n\n if (sqrKross > tolerance * sqrLen0 * sqrLen1) {\n var s = (E.x * D1.y - E.y * D1.x) * invertKross;\n var t = (E.x * D0.y - E.y * D0.x) * invertKross;\n if (!isBetween(s, 0, 1) || !isBetween(t, 0, 1)) return null;\n return {\n x: p0.x + s * D0.x,\n y: p0.y + s * D0.y\n };\n }\n\n return null;\n};\n/**\n * point and rectangular intersection point\n * @param {IRect} rect rect\n * @param {Point} point point\n * @return {PointPoint} rst;\n */\n\nvar getRectIntersectByPoint = function getRectIntersectByPoint(rect, point) {\n var x = rect.x,\n y = rect.y,\n width = rect.width,\n height = rect.height;\n var cx = x + width / 2;\n var cy = y + height / 2;\n var points = [];\n var center = {\n x: cx,\n y: cy\n };\n points.push({\n x: x,\n y: y\n });\n points.push({\n x: x + width,\n y: y\n });\n points.push({\n x: x + width,\n y: y + height\n });\n points.push({\n x: x,\n y: y + height\n });\n points.push({\n x: x,\n y: y\n });\n var rst = null;\n\n for (var i = 1; i < points.length; i++) {\n rst = getLineIntersect(points[i - 1], points[i], center, point);\n\n if (rst) {\n break;\n }\n }\n\n return rst;\n};\n/**\n * get point and circle inIntersect\n * @param {ICircle} circle 圆点,x,y,r\n * @param {Point} point 点 x,y\n * @return {Point} applied point\n */\n\nvar getCircleIntersectByPoint = function getCircleIntersectByPoint(circle, point) {\n var cx = circle.x,\n cy = circle.y,\n r = circle.r;\n var x = point.x,\n y = point.y;\n var dx = x - cx;\n var dy = y - cy;\n\n if (dx * dx + dy * dy < r * r) {\n return null;\n }\n\n var angle = Math.atan(dy / dx);\n return {\n x: cx + Math.abs(r * Math.cos(angle)) * Math.sign(dx),\n y: cy + Math.abs(r * Math.sin(angle)) * Math.sign(dy)\n };\n};\n/**\n * get point and ellipse inIntersect\n * @param {Object} ellipse 椭圆 x,y,rx,ry\n * @param {Object} point 点 x,y\n * @return {object} applied point\n */\n\nvar getEllipseIntersectByPoint = function getEllipseIntersectByPoint(ellipse, point) {\n var a = ellipse.rx;\n var b = ellipse.ry;\n var cx = ellipse.x;\n var cy = ellipse.y;\n var dx = point.x - cx;\n var dy = point.y - cy; // 直接通过 x,y 求夹角,求出来的范围是 -PI, PI\n\n var angle = Math.atan2(dy / b, dx / a);\n\n if (angle < 0) {\n angle += 2 * Math.PI; // 转换到 0,2PI\n }\n\n return {\n x: cx + a * Math.cos(angle),\n y: cy + b * Math.sin(angle)\n };\n};\n/**\n * coordinate matrix transformation\n * @param {number} point coordinate\n * @param {Matrix} matrix matrix\n * @param {number} tag could be 0 or 1\n * @return {Point} transformed point\n */\n\nvar applyMatrix = function applyMatrix(point, matrix, tag) {\n if (tag === void 0) {\n tag = 1;\n }\n\n var vector = [point.x, point.y, tag];\n\n if (!matrix || isNaN(matrix[0])) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat3(vector, vector, matrix);\n return {\n x: vector[0],\n y: vector[1]\n };\n};\n/**\n * coordinate matrix invert transformation\n * @param {number} point coordinate\n * @param {number} matrix matrix\n * @param {number} tag could be 0 or 1\n * @return {object} transformed point\n */\n\nvar invertMatrix = function invertMatrix(point, matrix, tag) {\n if (tag === void 0) {\n tag = 1;\n }\n\n if (!matrix || isNaN(matrix[0])) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var inversedMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].invert([1, 0, 0, 0, 1, 0, 0, 0, 1], matrix);\n\n if (!inversedMatrix) {\n inversedMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var vector = [point.x, point.y, tag];\n _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"].transformMat3(vector, vector, inversedMatrix);\n return {\n x: vector[0],\n y: vector[1]\n };\n};\n/**\n *\n * @param p1 First coordinate\n * @param p2 second coordinate\n * @param p3 three coordinate\n */\n\nvar getCircleCenterByPoints = function getCircleCenterByPoints(p1, p2, p3) {\n var a = p1.x - p2.x;\n var b = p1.y - p2.y;\n var c = p1.x - p3.x;\n var d = p1.y - p3.y;\n var e = (p1.x * p1.x - p2.x * p2.x - p2.y * p2.y + p1.y * p1.y) / 2;\n var f = (p1.x * p1.x - p3.x * p3.x - p3.y * p3.y + p1.y * p1.y) / 2;\n var denominator = b * c - a * d;\n return {\n x: -(d * e - b * f) / denominator,\n y: -(a * f - c * e) / denominator\n };\n};\n/**\n * get distance by two points\n * @param p1 first point\n * @param p2 second point\n */\n\nvar distance = function distance(p1, p2) {\n var vx = p1.x - p2.x;\n var vy = p1.y - p2.y;\n return Math.sqrt(vx * vx + vy * vy);\n};\n/**\n * scale matrix\n * @param matrix [ [], [], [] ]\n * @param ratio\n */\n\nvar scaleMatrix = function scaleMatrix(matrix, ratio) {\n var result = [];\n matrix.forEach(function (row) {\n var newRow = [];\n row.forEach(function (v) {\n newRow.push(v * ratio);\n });\n result.push(newRow);\n });\n return result;\n};\n/**\n * Floyd Warshall algorithm for shortest path distances matrix\n * @param {array} adjMatrix adjacency matrix\n * @return {array} distances shortest path distances matrix\n */\n\nvar floydWarshall = function floydWarshall(adjMatrix) {\n // initialize\n var dist = [];\n var size = adjMatrix.length;\n\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n } else if (adjMatrix[i][j] === 0 || !adjMatrix[i][j]) {\n dist[i][j] = Infinity;\n } else {\n dist[i][j] = adjMatrix[i][j];\n }\n }\n } // floyd\n\n\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n\n return dist;\n};\n/**\n * get adjacency matrix\n * @param data graph data\n * @param directed whether it's a directed graph\n */\n\nvar getAdjMatrix = function getAdjMatrix(data, directed) {\n var nodes = data.nodes,\n edges = data.edges;\n var matrix = []; // map node with index in data.nodes\n\n var nodeMap = {};\n\n if (!nodes) {\n throw new Error('invalid nodes data!');\n }\n\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n\n if (edges) {\n edges.forEach(function (e) {\n var source = e.source,\n target = e.target;\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n matrix[sIndex][tIndex] = 1;\n\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n\n return matrix;\n};\n/**\n * 平移group\n * @param group Group 实例\n * @param vec 移动向量\n */\n\nvar translate = function translate(group, vec) {\n group.translate(vec.x, vec.y);\n};\n/**\n * 移动到指定坐标点\n * @param group Group 实例\n * @param point 移动到的坐标点\n */\n\nvar move = function move(group, point, animate, animateCfg) {\n if (animateCfg === void 0) {\n animateCfg = {\n duration: 500\n };\n }\n\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var bbox = group.getCanvasBBox();\n var vx = point.x - bbox.minX;\n var vy = point.y - bbox.minY;\n\n if (animate) {\n var dx_1 = vx * matrix[0];\n var dy_1 = vy * matrix[4];\n var lastX_1 = 0;\n var lastY_1 = 0;\n var newX_1 = 0;\n var newY_1 = 0;\n group.animate(function (ratio) {\n newX_1 = dx_1 * ratio;\n newY_1 = dy_1 * ratio;\n matrix = transform(matrix, [['t', newX_1 - lastX_1, newY_1 - lastY_1]]);\n lastX_1 = newX_1;\n lastY_1 = newY_1;\n return {\n matrix: matrix\n };\n }, animateCfg);\n } else {\n var movedMatrix = transform(matrix, [['t', vx, vy]]);\n group.setMatrix(movedMatrix);\n }\n};\n/**\n * 缩放 group\n * @param group Group 实例\n * @param point 在x 和 y 方向上的缩放比例\n */\n\nvar scale = function scale(group, ratio) {\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var scaleXY = ratio;\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(ratio)) {\n scaleXY = [ratio, ratio];\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(ratio) && ratio.length === 1) {\n scaleXY = [ratio[0], ratio[0]];\n }\n\n matrix = transform(matrix, [['s', scaleXY[0], scaleXY[1]]]);\n group.setMatrix(matrix);\n};\n/**\n *\n * @param group Group 实例\n * @param ratio 选择角度\n */\n\nvar rotate = function rotate(group, angle) {\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n matrix = transform(matrix, [['r', angle]]);\n group.setMatrix(matrix);\n};\nvar getDegree = function getDegree(n, nodeIdxMap, edges) {\n var degrees = [];\n\n for (var i = 0; i < n; i++) {\n degrees[i] = 0;\n }\n\n edges.forEach(function (e) {\n if (e.source) {\n degrees[nodeIdxMap[e.source]] += 1;\n }\n\n if (e.target) {\n degrees[nodeIdxMap[e.target]] += 1;\n }\n });\n return degrees;\n}; // 判断点Q是否在p1和p2的线段上\n\nfunction onSegment(p1, p2, q) {\n 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])) {\n return true;\n }\n\n return false;\n}\n/**\n * 判断点P在多边形内-射线法. Borrow from https://github.com/antvis/util/blob/master/packages/path-util/src/point-in-polygon.ts\n * @param points\n * @param x\n * @param y\n */\n\n\nvar isPointInPolygon = function isPointInPolygon(points, x, y) {\n var isHit = false;\n var n = points.length; // 判断两个double在eps精度下的大小关系\n\n var tolerance = 1e-6;\n\n function dcmp(xValue) {\n if (Math.abs(xValue) < tolerance) {\n return 0;\n }\n\n return xValue < 0 ? -1 : 1;\n }\n\n if (n <= 2) {\n // svg 中点小于 3 个时,不显示,也无法被拾取\n return false;\n }\n\n for (var i = 0; i < n; i++) {\n var p1 = points[i];\n var p2 = points[(i + 1) % n];\n\n if (onSegment(p1, p2, [x, y])) {\n // 点在多边形一条边上\n return true;\n } // 前一个判断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) {\n isHit = !isHit;\n }\n }\n\n return isHit;\n}; // 判断两个BBox是否相交\n\nvar intersectBBox = function intersectBBox(box1, box2) {\n return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);\n};\n\nvar lineIntersectPolygon = function lineIntersectPolygon(lines, line) {\n var isIntersect = false;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(lines, function (l) {\n if (getLineIntersect(l.from, l.to, line.from, line.to)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n};\n/**\n * 判断两个polygon是否相交。\n * borrow from @antv/path-util\n * @param points1 polygon1的顶点数组\n * @param points2 polygon2的顶点数组\n */\n\n\nvar isPolygonsIntersect = function isPolygonsIntersect(points1, points2) {\n var getBBox = function getBBox(points) {\n var xArr = points.map(function (p) {\n return p[0];\n });\n var yArr = points.map(function (p) {\n return p[1];\n });\n return {\n minX: Math.min.apply(null, xArr),\n maxX: Math.max.apply(null, xArr),\n minY: Math.min.apply(null, yArr),\n maxY: Math.max.apply(null, yArr)\n };\n };\n\n var parseToLines = function parseToLines(points) {\n var lines = [];\n var count = points.length;\n\n for (var i = 0; i < count - 1; i++) {\n var point = points[i];\n var next = points[i + 1];\n lines.push({\n from: {\n x: point[0],\n y: point[1]\n },\n to: {\n x: next[0],\n y: next[1]\n }\n });\n }\n\n if (lines.length > 1) {\n var first = points[0];\n var last = points[count - 1];\n lines.push({\n from: {\n x: last[0],\n y: last[1]\n },\n to: {\n x: first[0],\n y: first[1]\n }\n });\n }\n\n return lines;\n }; // 空数组,或者一个点返回 false\n\n\n if (points1.length < 2 || points2.length < 2) {\n return false;\n }\n\n var bbox1 = getBBox(points1);\n var bbox2 = getBBox(points2); // 判定包围盒是否相交,比判定点是否在多边形内要快的多,可以筛选掉大多数情况\n\n if (!intersectBBox(bbox1, bbox2)) {\n return false;\n }\n\n var isIn = false; // 判定点是否在多边形内部,一旦有一个点在另一个多边形内,则返回\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points2, function (point) {\n if (isPointInPolygon(points1, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n\n if (isIn) {\n return true;\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points1, function (point) {\n if (isPointInPolygon(points2, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n\n if (isIn) {\n return true;\n }\n\n var lines1 = parseToLines(points1);\n var lines2 = parseToLines(points2);\n var isIntersect = false;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(lines2, function (line) {\n if (lineIntersectPolygon(lines1, line)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n};\n\nvar Line =\n/** @class */\nfunction () {\n function Line(x1, y1, x2, y2) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n }\n\n Line.prototype.getBBox = function () {\n var minX = Math.min(this.x1, this.x2);\n var minY = Math.min(this.y1, this.y2);\n var maxX = Math.max(this.x1, this.x2);\n var maxY = Math.max(this.y1, this.y2);\n var res = {\n x: minX,\n y: minY,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n width: maxX - minX,\n height: maxY - minY\n };\n return res;\n };\n\n return Line;\n}();\n\n\nvar getBBoxBoundLine = function getBBoxBoundLine(bbox, direction) {\n var bounds = {\n top: [bbox.minX, bbox.minY, bbox.maxX, bbox.minY],\n left: [bbox.minX, bbox.minY, bbox.minX, bbox.maxY],\n bottom: [bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY],\n right: [bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY]\n };\n return bounds[direction];\n};\n/**\n * 计算两条线段相交时,相交点对第一条线段上的分割比例\n */\n\nvar fractionAlongLineA = function fractionAlongLineA(la, lb) {\n var uaT = (lb.x2 - lb.x1) * (la.y1 - lb.y1) - (lb.y2 - lb.y1) * (la.x1 - lb.x1);\n var ubT = (la.x2 - la.x1) * (la.y1 - lb.y1) - (la.y2 - la.y1) * (la.x1 - lb.x1);\n var uB = (lb.y2 - lb.y1) * (la.x2 - la.x1) - (lb.x2 - lb.x1) * (la.y2 - la.y1);\n\n if (uB) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return ua;\n }\n }\n\n return Number.POSITIVE_INFINITY;\n};\n\nvar itemIntersectByLine = function itemIntersectByLine(item, line) {\n var directions = ['top', 'left', 'bottom', 'right'];\n var bbox = item.getBBox();\n var countIntersections = 0;\n var intersections = [];\n\n for (var i = 0; i < 4; i++) {\n var _a = getBBoxBoundLine(bbox, directions[i]),\n x1 = _a[0],\n y1 = _a[1],\n x2 = _a[2],\n y2 = _a[3];\n\n intersections[i] = getLineIntersect({\n x: line.x1,\n y: line.y1\n }, {\n x: line.x2,\n y: line.y2\n }, {\n x: x1,\n y: y1\n }, {\n x: x2,\n y: y2\n });\n\n if (intersections[i]) {\n countIntersections += 1;\n }\n }\n\n return [intersections, countIntersections];\n};\nvar fractionToLine = function fractionToLine(item, line) {\n var directions = ['top', 'left', 'bottom', 'right'];\n var bbox = item.getBBox();\n var minDistance = Number.POSITIVE_INFINITY;\n var countIntersections = 0;\n\n for (var i = 0; i < 4; i++) {\n var _a = getBBoxBoundLine(bbox, directions[i]),\n x1 = _a[0],\n y1 = _a[1],\n x2 = _a[2],\n y2 = _a[3];\n\n var testDistance = fractionAlongLineA(line, new Line(x1, y1, x2, y2));\n testDistance = Math.abs(testDistance - 0.5);\n\n if (testDistance >= 0 && testDistance <= 1) {\n countIntersections += 1;\n minDistance = testDistance < minDistance ? testDistance : minDistance;\n }\n }\n\n if (countIntersections === 0) return -1;\n return minDistance;\n};\nvar getPointsCenter = function getPointsCenter(points) {\n var centerX = 0;\n var centerY = 0;\n\n if (points.length > 0) {\n for (var _i = 0, points_1 = points; _i < points_1.length; _i++) {\n var point = points_1[_i];\n centerX += point.x;\n centerY += point.y;\n }\n\n centerX /= points.length;\n centerY /= points.length;\n }\n\n return {\n x: centerX,\n y: centerY\n };\n};\nvar squareDist = function squareDist(a, b) {\n return Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2);\n};\nvar pointLineSquareDist = function pointLineSquareDist(point, line) {\n var x1 = line.x1;\n var y1 = line.y1;\n var x2 = line.x2 - x1;\n var y2 = line.y2 - y1;\n var px = point.x - x1;\n var py = point.y - y1;\n var dotprod = px * x2 + py * y2;\n var projlenSq;\n\n if (dotprod <= 0) {\n projlenSq = 0;\n } else {\n px = x2 - px;\n py = y2 - py;\n dotprod = px * x2 + py * y2;\n\n if (dotprod <= 0) {\n projlenSq = 0;\n } else {\n projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2);\n }\n }\n\n var lenSq = px * px + py * py - projlenSq;\n\n if (lenSq < 0) {\n lenSq = 0;\n }\n\n return lenSq;\n};\nvar isPointsOverlap = function isPointsOverlap(p1, p2, e) {\n if (e === void 0) {\n e = 1e-3;\n }\n\n return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2) < Math.pow(e, 2);\n};\n/**\n * 点到矩形的距离的平方:矩形内部点视作距离为0,外部的点若投影落在矩形边上则为点到矩形边的最近的垂直距离,否则为点到矩形顶点的距离,\n * @param point IPoint\n * @param rect IRect\n */\n\nvar pointRectSquareDist = function pointRectSquareDist(point, rect) {\n var isLeft = point.x < rect.x;\n var isRight = point.x > rect.x + rect.width;\n var isTop = point.y > rect.y + rect.height;\n var isBottom = point.y < rect.y;\n var isPointOutside = isLeft || isRight || isTop || isBottom;\n\n if (!isPointOutside) {\n return 0;\n }\n\n if (isTop && !isLeft && !isRight) {\n return Math.pow(rect.y + rect.height - point.y, 2);\n }\n\n if (isBottom && !isLeft && !isRight) {\n return Math.pow(point.y - rect.y, 2);\n }\n\n if (isLeft && !isTop && !isBottom) {\n return Math.pow(rect.x - point.x, 2);\n }\n\n if (isRight && !isTop && !isBottom) {\n return Math.pow(rect.x + rect.width - point.x, 2);\n }\n\n var dx = Math.min(Math.abs(rect.x - point.x), Math.abs(rect.x + rect.width - point.x));\n var dy = Math.min(Math.abs(rect.y - point.y), Math.abs(rect.y + rect.height - point.y));\n return dx * dx + dy * dy;\n};\n/**\n * point to line distance\n * @param {array} line 线的四个顶点 [x1, y1, x2, y2]\n * @param {object} point 坐标点 {x, y}\n * @return {Number|NaN} distance\n */\n\nvar pointLineDistance = function pointLineDistance(line, point) {\n var x1 = line[0],\n y1 = line[1],\n x2 = line[2],\n y2 = line[3];\n var x = point.x,\n y = point.y;\n var d = [x2 - x1, y2 - y1];\n\n if (_antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].exactEquals(d, [0, 0])) {\n return NaN;\n }\n\n var u = [-d[1], d[0]]; // @ts-ignore\n\n _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize(u, u);\n var a = [x - x1, y - y1]; // @ts-ignore\n\n return Math.abs(_antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].dot(a, u));\n};\n/**\n * Linearly interpolate between start and end, where alpha is the percent distance along the line.\n * alpha = 0 will be start, and alpha = 1 will be end.\n * @param {number} start\n * @param {number} end\n * @param {number} alpha interpolation factor, typically in the closed interval [0, 1]\n * @returns {number}\n */\n\nvar lerp = function lerp(start, end, alpha) {\n return start + (end - start) * alpha;\n};\n/**\n * Linearly interpolate between start and end arrays, where alpha is the percent distance along the line.\n * alpha = 0 will be start, and alpha = 1 will be end.\n * @param {number[]} start\n * @param {number[]} end\n * @param {number} alpha interpolation factor, typically in the closed interval [0, 1]\n * @returns {number[]}\n */\n\nvar lerpArray = function lerpArray(start, end, alpha) {\n var len = Math.min(start.length, end.length);\n var out = new Array(len);\n\n for (var i = 0; i < len; i++) {\n out[i] = lerp(start[i], end[i], alpha);\n }\n\n return out;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/math.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return PriorityQueue; });\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// A PriorityQueue is a queue that can be sorted by priority.\nvar PriorityQueue = /*#__PURE__*/_createClass(function PriorityQueue() {\n var _this = this;\n\n _classCallCheck(this, PriorityQueue);\n\n this.arr = [];\n this.keyIndice = new Map();\n\n this.size = function () {\n return _this.arr.length;\n };\n\n this.keys = function () {\n return _this.arr.map(function (e) {\n return e.key;\n });\n };\n\n this.has = function (key) {\n return _this.keyIndice.has(key);\n };\n\n this.priority = function (key) {\n var index = _this.keyIndice.get(key);\n\n if (index !== undefined) {\n return _this.arr[index].priority;\n }\n };\n\n this.swap = function (i, j) {\n var arr = _this.arr,\n keyIndice = _this.keyIndice;\n var _ref = [arr[i], arr[j]],\n originI = _ref[0],\n originJ = _ref[1];\n arr[i] = originJ;\n arr[j] = originI;\n keyIndice.set(originI.key, j);\n keyIndice.set(originJ.key, i);\n };\n\n this.innerDecrease = function (index) {\n var arr = _this.arr;\n var priority = arr[index].priority;\n var parent;\n var i = index;\n\n while (i !== 0) {\n var _arr$parent;\n\n parent = i >> 1;\n\n if (((_arr$parent = arr[parent]) === null || _arr$parent === void 0 ? void 0 : _arr$parent.priority) < priority) {\n break;\n }\n\n _this.swap(i, parent);\n\n i = parent;\n }\n };\n\n this.heapify = function (i) {\n var arr = _this.arr;\n var l = i << 1;\n var r = l + 1;\n var largest = i;\n\n if (l < arr.length) {\n largest = arr[l].priority < arr[largest].priority ? l : largest;\n\n if (r < arr.length) {\n largest = arr[r].priority < arr[largest].priority ? r : largest;\n }\n\n if (largest !== i) {\n _this.swap(i, largest);\n\n _this.heapify(largest);\n }\n }\n };\n\n this.min = function () {\n if (_this.size() === 0) {\n throw new Error('Queue underflow');\n }\n\n return _this.arr[0].key;\n };\n\n this.add = function (key, priority) {\n var keyIndice = _this.keyIndice,\n arr = _this.arr; // if the key is already in the queue, update the priority\n\n if (!keyIndice.has(key)) {\n var index = arr.length;\n keyIndice.set(key, index);\n arr.push({\n key: key,\n priority: priority\n });\n\n _this.innerDecrease(index);\n\n return true;\n }\n\n return false;\n };\n\n this.removeMin = function () {\n _this.swap(0, _this.arr.length - 1);\n\n var min = _this.arr.pop();\n\n _this.keyIndice.delete(min.key);\n\n _this.heapify(0);\n\n return min.key;\n };\n\n this.decrease = function (key, priority) {\n if (!_this.has(key)) {\n throw new Error(\"There's no key named \".concat(key));\n } // there must be an index\n\n\n var index = _this.keyIndice.get(key);\n\n if (priority > _this.arr[index].priority) {\n throw new Error(\"New priority is greater than current priority.Key: \".concat(key, \" Old: + \").concat(_this.arr[index].priority, \" New: \").concat(priority));\n }\n\n _this.arr[index].priority = priority;\n\n _this.innerDecrease(index);\n };\n});\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/util/path.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/util/path.js ***! - \****************************************************/ -/*! exports provided: getSpline, getControlPoint, pointsToPolygon, pathToPoints, getClosedSpline, roundedHull, paddedHull */ +/***/ "./node_modules/@antv/graphlib/es/algorithm/components.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/components.js ***! + \****************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSpline\", function() { return getSpline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getControlPoint\", function() { return getControlPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pointsToPolygon\", function() { return pointsToPolygon; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pathToPoints\", function() { return pathToPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getClosedSpline\", function() { return getClosedSpline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"roundedHull\", function() { return roundedHull; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"paddedHull\", function() { return paddedHull; });\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_path_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/path-util */ \"./node_modules/@antv/path-util/esm/index.js\");\n\n\n/**\n * 替换字符串中的字段\n * @param {String} str 模版字符串\n * @param {Object} o json data\n */\n\nvar substitute = function substitute(str, o) {\n if (!str || !o) {\n return str;\n }\n\n return str.replace(/\\\\?\\{([^{}]+)\\}/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.slice(1);\n }\n\n var res = o[name];\n if (res === 0) res = '0';\n return res || '';\n });\n};\n/**\n * 给定坐标获取三次贝塞尔曲线的 M 及 C 值\n * @param points coordinate set\n */\n\n\nvar getSpline = function getSpline(points) {\n var data = [];\n\n if (points.length < 2) {\n throw new Error(\"point length must largn than 2, now it's \".concat(points.length));\n }\n\n for (var _i = 0, points_1 = points; _i < points_1.length; _i++) {\n var point = points_1[_i];\n var x = point.x,\n y = point.y;\n data.push(x);\n data.push(y);\n }\n\n var spliePath = Object(_antv_path_util__WEBPACK_IMPORTED_MODULE_1__[\"catmullRom2Bezier\"])(data);\n spliePath.unshift(['M', points[0].x, points[0].y]);\n return spliePath;\n};\n/**\n * 根据起始点、相对位置、偏移量计算控制点\n * @param {IPoint} startPoint 起始点,包含 x,y\n * @param {IPoint} endPoint 结束点, 包含 x,y\n * @param {Number} percent 相对位置,范围 0-1\n * @param {Number} offset 偏移量\n * @return {IPoint} 控制点,包含 x,y\n */\n\nvar getControlPoint = function getControlPoint(startPoint, endPoint, percent, offset) {\n if (percent === void 0) {\n percent = 0;\n }\n\n if (offset === void 0) {\n offset = 0;\n }\n\n var point = {\n x: (1 - percent) * startPoint.x + percent * endPoint.x,\n y: (1 - percent) * startPoint.y + percent * endPoint.y\n };\n var tangent = [0, 0];\n _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize(tangent, [endPoint.x - startPoint.x, endPoint.y - startPoint.y]);\n\n if (!tangent || !tangent[0] && !tangent[1]) {\n tangent = [0, 0];\n }\n\n var perpendicular = [-tangent[1] * offset, tangent[0] * offset]; // 垂直向量\n\n point.x += perpendicular[0];\n point.y += perpendicular[1];\n return point;\n};\n/**\n * 点集转化为Path多边形\n * @param {Array} points 点集\n * @param {Boolen} z 是否封闭\n * @return {Array} Path\n */\n\nvar pointsToPolygon = function pointsToPolygon(points, z) {\n var length = points.length;\n\n if (!length) {\n return '';\n }\n\n var path = '';\n var str = '';\n\n for (var i = 0; i < length; i++) {\n var item = points[i];\n\n if (i === 0) {\n str = 'M{x} {y}';\n } else {\n str = 'L{x} {y}';\n }\n\n path += substitute(str, item);\n }\n\n if (z) {\n path += 'Z';\n }\n\n return path;\n};\nvar pathToPoints = function pathToPoints(path) {\n var points = [];\n path.forEach(function (seg) {\n var command = seg[0];\n\n if (command !== 'A') {\n for (var i = 1; i < seg.length; i = i + 2) {\n points.push([seg[i], seg[i + 1]]);\n }\n } else {\n var length_1 = seg.length;\n points.push([seg[length_1 - 2], seg[length_1 - 1]]);\n }\n });\n return points;\n};\n/**\n * 生成平滑的闭合曲线\n * @param points\n */\n\nvar getClosedSpline = function getClosedSpline(points) {\n if (points.length < 2) {\n throw new Error(\"point length must largn than 2, now it's \".concat(points.length));\n }\n\n var first = points[0];\n var second = points[1];\n var last = points[points.length - 1];\n var lastSecond = points[points.length - 2];\n points.unshift(last);\n points.unshift(lastSecond);\n points.push(first);\n points.push(second);\n var closedPath = [];\n\n for (var i = 1; i < points.length - 2; i += 1) {\n var x0 = points[i - 1].x;\n var y0 = points[i - 1].y;\n var x1 = points[i].x;\n var y1 = points[i].y;\n var x2 = points[i + 1].x;\n var y2 = points[i + 1].y;\n var x3 = i !== points.length - 2 ? points[i + 2].x : x2;\n var y3 = i !== points.length - 2 ? points[i + 2].y : y2;\n var cp1x = x1 + (x2 - x0) / 6;\n var cp1y = y1 + (y2 - y0) / 6;\n var cp2x = x2 - (x3 - x1) / 6;\n var cp2y = y2 - (y3 - y1) / 6;\n closedPath.push(['C', cp1x, cp1y, cp2x, cp2y, x2, y2]);\n }\n\n closedPath.unshift(['M', last.x, last.y]);\n return closedPath;\n};\n\nvar vecScaleTo = function vecScaleTo(v, length) {\n // Vector with direction of v with specified length\n return _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize([0, 0], v), length);\n};\n\nvar unitNormal = function unitNormal(p0, p1) {\n // Returns the unit normal to the line segment from p0 to p1.\n var n = [p0[1] - p1[1], p1[0] - p0[0]];\n var nLength = Math.sqrt(n[0] * n[0] + n[1] * n[1]);\n\n if (nLength === 0) {\n throw new Error('p0 should not be equal to p1');\n }\n\n return [n[0] / nLength, n[1] / nLength];\n};\n\nvar vecFrom = function vecFrom(p0, p1) {\n // Vector from p0 to p1\n return [p1[0] - p0[0], p1[1] - p0[1]];\n};\n/**\n * 传入的节点作为多边形顶点,生成有圆角的多边形\n * @param polyPoints 多边形顶点\n * @param padding 在原多边形基础上增加最终轮廓和原多边形的空白间隔\n */\n\n\nfunction roundedHull(polyPoints, padding) {\n // The rounded hull path around a single point\n var roundedHull1 = function roundedHull1(points) {\n var p1 = [points[0][0], points[0][1] - padding];\n var p2 = [points[0][0], points[0][1] + padding];\n return \"M \".concat(p1, \" A \").concat(padding, \",\").concat(padding, \",0,0,0,\").concat(p2, \" A \").concat(padding, \",\").concat(padding, \",0,0,0,\").concat(p1);\n }; // The rounded hull path around two points\n\n\n var roundedHull2 = function roundedHull2(points) {\n var offsetVector = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], unitNormal(points[0], points[1]), padding);\n var invOffsetVector = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], offsetVector, -1);\n var p0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[0], offsetVector);\n var p1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[1], offsetVector);\n var p2 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[1], invOffsetVector);\n var p3 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[0], invOffsetVector);\n return \"M \".concat(p0, \" L \").concat(p1, \" A \").concat([padding, padding, '0,0,0', p2].join(','), \" L \").concat(p3, \" A \").concat([padding, padding, '0,0,0', p0].join(','));\n }; // 特殊情况处理:节点数小于等于2\n\n\n if (!polyPoints || polyPoints.length < 1) return '';\n if (polyPoints.length === 1) return roundedHull1(polyPoints);\n if (polyPoints.length === 2) return roundedHull2(polyPoints);\n var segments = new Array(polyPoints.length); // Calculate each offset (outwards) segment of the convex hull.\n\n for (var segmentIndex = 0; segmentIndex < segments.length; ++segmentIndex) {\n var p0 = segmentIndex === 0 ? polyPoints[polyPoints.length - 1] : polyPoints[segmentIndex - 1];\n var p1 = polyPoints[segmentIndex]; // Compute the offset vector for the line segment, with length = padding.\n\n var offset = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], unitNormal(p0, p1), padding);\n segments[segmentIndex] = [_antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], p0, offset), _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], p1, offset)];\n }\n\n var arcData = \"A \".concat([padding, padding, '0,0,0,'].join(','));\n segments = segments.map(function (segment, index) {\n var pathFragment = '';\n\n if (index === 0) {\n pathFragment = \"M \".concat(segments[segments.length - 1][1], \" \");\n }\n\n pathFragment += \"\".concat(arcData + segment[0], \" L \").concat(segment[1]);\n return pathFragment;\n });\n return segments.join(' ');\n}\n/**\n * 传入的节点作为多边形顶点,生成平滑的闭合多边形\n * @param polyPoints\n * @param padding\n */\n\nfunction paddedHull(polyPoints, padding) {\n var pointCount = polyPoints.length;\n\n var smoothHull1 = function smoothHull1(points) {\n // Returns the path for a circular hull around a single point.\n var p1 = [points[0][0], points[0][1] - padding];\n var p2 = [points[0][0], points[0][1] + padding];\n return \"M \".concat(p1, \" A \").concat([padding, padding, '0,0,0', p2].join(','), \" A \").concat([padding, padding, '0,0,0', p1].join(','));\n }; // Returns the path for a rounded hull around two points.\n\n\n var smoothHull2 = function smoothHull2(points) {\n var v = vecFrom(points[0], points[1]);\n var extensionVec = vecScaleTo(v, padding);\n var extension0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[0], _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], extensionVec, -1));\n var extension1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], points[1], extensionVec);\n var tangentHalfLength = 1.2 * padding;\n var controlDelta = vecScaleTo(_antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize([0, 0], v), tangentHalfLength);\n var invControlDelta = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], controlDelta, -1);\n var control0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], extension0, invControlDelta);\n var control1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], extension1, invControlDelta);\n var control3 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], extension0, controlDelta); // return [\n // ['M', extension0[0], extension0[1]],\n // ['C', control0, control1, extension1],\n // ['S', control3, extension0],\n // 'Z',\n // ];\n\n return \"M \".concat(extension0, \" C \").concat([control0, control1, extension1].join(','), \" S \").concat([control3, extension0].join(','), \" Z\");\n }; // Handle special cases\n\n\n if (!polyPoints || pointCount < 1) return '';\n if (pointCount === 1) return smoothHull1(polyPoints);\n if (pointCount === 2) return smoothHull2(polyPoints);\n var hullPoints = polyPoints.map(function (point, index) {\n var pNext = polyPoints[(index + 1) % pointCount];\n return {\n p: point,\n v: _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize([0, 0], vecFrom(point, pNext))\n };\n }); // Compute the expanded hull points, and the nearest prior control point for each.\n\n for (var i = 0; i < hullPoints.length; ++i) {\n var priorIndex = i > 0 ? i - 1 : pointCount - 1;\n var extensionVec = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].normalize([0, 0], _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], hullPoints[priorIndex].v, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], hullPoints[i].v, -1)));\n hullPoints[i].p = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], hullPoints[i].p, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], extensionVec, padding));\n }\n\n return hullPoints.map(function (obj) {\n var point = obj.p;\n return {\n x: point[0],\n y: point[1]\n };\n });\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/path.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar components = function components(graph) {\n var visited = new Set();\n var resultComponents = [];\n var nodes = graph.nodes();\n nodes.forEach(function (n) {\n var componentsArr = [];\n var waitingList = [n];\n\n while (waitingList.length > 0) {\n var node = waitingList.pop();\n\n if (!visited.has(node)) {\n var _graph$successors, _graph$predecessors;\n\n visited.add(node);\n componentsArr.push(node);\n (_graph$successors = graph.successors(node)) === null || _graph$successors === void 0 ? void 0 : _graph$successors.forEach(function (n) {\n return waitingList.push(n);\n });\n (_graph$predecessors = graph.predecessors(node)) === null || _graph$predecessors === void 0 ? void 0 : _graph$predecessors.forEach(function (n) {\n return waitingList.push(n);\n });\n }\n }\n\n if (componentsArr.length) {\n resultComponents.push(componentsArr);\n }\n });\n return resultComponents;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (components);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/components.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/es/util/validation.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-core/es/util/validation.js ***! - \**********************************************************/ -/*! exports provided: dataValidation, singleDataValidation */ +/***/ "./node_modules/@antv/graphlib/es/algorithm/dfs.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/dfs.js ***! + \*********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataValidation\", function() { return dataValidation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"singleDataValidation\", function() { return singleDataValidation; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _graphic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./graphic */ \"./node_modules/@antv/g6-core/es/util/graphic.js\");\n\n\n\n/**\n * 验证关系图或树图数据的合法性,必须符合以下规则才会渲染图:\n * 1. 必须传入数据\n * 2. 节点的 ID 必须为字符串,暂不支持数字类型,如果支持数字类型,会出现类似 123 与 '123' 是否相等的问题\n * 3. 边的 source 和 target 值必须在节点 ID 中存在\n * @param data 关系图或树图数据\n * @return boolean 全部验证通过返回 true,否则返回 false\n */\n\nvar dataValidation = function dataValidation(data) {\n // 1. 必须传入数据\n if (!data) {\n console.error('G6 Error Tips: the data must be defined');\n return false;\n } // 2. 节点的 ID 必须为字符串或数字类型\n\n\n var nodes = data.nodes,\n edges = data.edges,\n _a = data.combos,\n combos = _a === void 0 ? [] : _a;\n\n if (!nodes && !edges) {\n var validated_1 = true; // 不存在 nodes 和 edges,则说明是 TreeGraphData,按 TreeGraphData 规则验证\n\n Object(_graphic__WEBPACK_IMPORTED_MODULE_2__[\"traverseTree\"])(data, function (param) {\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(param.id)) {\n validated_1 = false;\n return false;\n }\n\n return true;\n });\n return validated_1;\n }\n\n var nonNode = (nodes || []).find(function (node) {\n return !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(node.id);\n });\n\n if (nonNode) {\n console.warn(\"G6 Warning Tips: missing 'id' property, or %c\".concat(nonNode.id, \"%c is not a string.\"), 'font-size: 20px; color: red;', '');\n return false;\n } // 3. 边的 source 和 target 必须存在于节点 或 Combo中\n\n\n var nodeIds = (nodes || []).map(function (node) {\n return node.id;\n });\n var comboIds = combos === null || combos === void 0 ? void 0 : combos.map(function (combo) {\n return combo.id;\n });\n\n var ids = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], nodeIds, true), comboIds, true);\n\n var nonEdges = (edges || []).find(function (edge) {\n return !ids.includes(edge.source) || !ids.includes(edge.target);\n });\n\n if (nonEdges) {\n console.warn(\"G6 Warning Tips: The source %c\".concat(nonEdges.source, \"%c or the target %c\").concat(nonEdges.target, \"%c of the edge do not exist in the nodes or combos.\"), 'font-size: 20px; color: red;', '', 'font-size: 20px; color: red;', '');\n return false;\n }\n\n return true;\n};\n/**\n * 验证添加节点、边或从combo时的数据\n * @param type 节点、边或从combo\n * @param data 添加的单条数据\n * @return boolean 全部验证通过返回 true,否则返回 false\n */\n\nvar singleDataValidation = function singleDataValidation(type, data) {\n if (type === 'node' || type === 'combo') {\n // 必须有 id 字段,且id必须为字符串类型\n if (data.id && !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(data.id)) {\n console.warn(\"G6 Warning Tips: missing 'id' property, or the 'id' %c\".concat(data.id, \"%c is not a string.\"), 'font-size: 20px; color: red;', '');\n return false;\n }\n } else if (type === 'edge') {\n // 必须有 source 和 target 字段\n if (!data.source || !data.target) {\n console.warn(\"G6 Warning Tips: missing 'source' or 'target' for the edge.\");\n return false;\n }\n }\n\n return true;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/es/util/validation.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @description DFS traversal.\n * @description.zh-CN DFS 遍历。\n */\nvar doDFS = function doDFS(graph, node, postorder, visited, navigator, result) {\n if (!visited.includes(node)) {\n visited.push(node);\n\n if (!postorder) {\n result.push(node);\n }\n\n navigator(node).forEach(function (n) {\n return doDFS(graph, n, postorder, visited, navigator, result);\n });\n\n if (postorder) {\n result.push(node);\n }\n }\n};\n/**\n * @description DFS traversal.\n * @description.zh-CN DFS 遍历。\n */\n\n\nvar dfs = function dfs(graph, node, order) {\n var nodes = Array.isArray(node) ? node : [node];\n\n var navigator = function navigator(n) {\n return graph.isDirected() ? graph.successors(n) : graph.neighbors(n);\n };\n\n var results = [];\n var visited = [];\n nodes.forEach(function (node) {\n if (!graph.hasNode(node)) {\n throw new Error('Graph does not have node: ' + node);\n } else {\n doDFS(graph, node, order === 'post', visited, navigator, results);\n }\n });\n return results;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dfs);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/dfs.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/element/shape.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/element/shape.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/dijkstra-all.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/dijkstra-all.js ***! + \******************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = exports.ShapeFactoryBase = void 0;\n\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _xml = __webpack_require__(/*! ./xml */ \"./node_modules/@antv/g6-core/lib/element/xml.js\");\n\nvar cache = {}; // ucfirst 开销过大,进行缓存\n// 首字母大写\n\nfunction ucfirst(str) {\n if (!cache[str]) {\n cache[str] = (0, _util.upperFirst)(str);\n }\n\n return cache[str];\n}\n/**\n * 工厂方法的基类\n * @type Shape.FactoryBase\n */\n\n\nvar ShapeFactoryBase = {\n /**\n * 默认的形状,当没有指定/匹配 shapeType 时,使用默认的\n * @type {String}\n */\n defaultShapeType: 'defaultType',\n\n /**\n * 形状的 className,用于搜索\n * @type {String}\n */\n className: null,\n\n /**\n * 获取绘制 Shape 的工具类,无状态\n * @param {String} type 类型\n * @return {Shape} 工具类\n */\n getShape: function getShape(type) {\n var self = this;\n var shape = self[type] || self[self.defaultShapeType] || self['simple-circle'];\n return shape;\n },\n\n /**\n * 绘制图形\n * @param {String} type 类型\n * @param {Object} cfg 配置项\n * @param {G.Group} group 图形的分组\n * @return {IShape} 图形对象\n */\n draw: function draw(type, cfg, group) {\n var shape = this.getShape(type);\n group['shapeMap'] = {};\n var rst = shape.draw(cfg, group);\n\n if (shape.afterDraw) {\n shape.afterDraw(cfg, group, rst);\n }\n\n return rst;\n },\n\n /**\n * 更新\n * @param {String} type 类型\n * @param {Object} cfg 配置项\n * @param {G6.Item} item 节点、边、分组等\n */\n baseUpdate: function baseUpdate(type, cfg, item, updateType) {\n var _a, _b;\n\n var shape = this.getShape(type); // 防止没定义 update 函数\n\n if (shape.update) {\n // shape.mergeStyle = updateType === 'move' || updateType === 'bbox' ? {} : shape.getOptions?.(cfg);\n shape.mergeStyle = (_a = shape.getOptions) === null || _a === void 0 ? void 0 : _a.call(shape, cfg, updateType);\n (_b = shape.update) === null || _b === void 0 ? void 0 : _b.call(shape, cfg, item, updateType);\n }\n\n if (shape.afterUpdate) {\n shape.afterUpdate(cfg, item);\n }\n },\n\n /**\n * 设置状态\n * @param {String} type 类型\n * @param {String} name 状态名\n * @param {String | Boolean} value 状态值\n * @param {G6.Item} item 节点、边、分组等\n */\n setState: function setState(type, name, value, item) {\n var shape = this.getShape(type); // 调用 shape/shapeBase.ts 中的 setState 方法\n\n shape.setState(name, value, item);\n },\n\n /**\n * 是否允许更新,不重新绘制图形\n * @param {String} type 类型\n * @return {Boolean} 是否允许使用更新\n */\n shouldUpdate: function shouldUpdate(type) {\n var shape = this.getShape(type);\n return !!shape.update;\n },\n getControlPoints: function getControlPoints(type, cfg) {\n var shape = this.getShape(type);\n return shape.getControlPoints(cfg);\n },\n\n /**\n * 获取控制点\n * @param {String} type 节点、边类型\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getAnchorPoints: function getAnchorPoints(type, cfg) {\n var shape = this.getShape(type);\n return shape.getAnchorPoints(cfg);\n }\n};\n/**\n * 元素的框架\n */\n\nexports.ShapeFactoryBase = ShapeFactoryBase;\nvar ShapeFramework = {\n // 默认样式及配置\n options: {},\n\n /**\n * 绘制\n */\n draw: function draw(cfg, group) {\n return this.drawShape(cfg, group);\n },\n\n /**\n * 绘制\n */\n drawShape: function\n /* cfg, group */\n drawShape() {},\n\n /**\n * 绘制完成后的操作,便于用户继承现有的节点、边\n */\n afterDraw: function\n /* cfg, group */\n afterDraw() {},\n // update(cfg, item) // 默认不定义\n afterUpdate: function\n /* cfg, item */\n afterUpdate() {},\n\n /**\n * 设置节点、边状态\n */\n setState: function\n /* name, value, item */\n setState() {},\n\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getAnchorPoints: function getAnchorPoints(cfg) {\n var defaultAnchorPoints = this.options.anchorPoints;\n var anchorPoints = cfg.anchorPoints || defaultAnchorPoints;\n return anchorPoints;\n }\n /* 如果没定义 update 方法,每次都调用 draw 方法\n update(cfg, item) {\n }\n */\n\n};\n\nvar Shape =\n/** @class */\nfunction () {\n function Shape() {}\n\n Shape.registerFactory = function (factoryType, cfg) {\n var className = ucfirst(factoryType);\n var factoryBase = ShapeFactoryBase;\n var shapeFactory = (0, _tslib.__assign)((0, _tslib.__assign)({}, factoryBase), cfg);\n Shape[className] = shapeFactory;\n shapeFactory.className = className;\n return shapeFactory;\n };\n\n Shape.getFactory = function (factoryType) {\n var className = ucfirst(factoryType);\n return Shape[className];\n };\n\n Shape.registerNode = function (shapeType, nodeDefinition, extendShapeType) {\n var shapeFactory = Shape.Node;\n var shapeObj;\n\n if (typeof nodeDefinition === 'string' || typeof nodeDefinition === 'function') {\n var autoNodeDefinition = (0, _xml.createNodeFromXML)(nodeDefinition);\n shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)({}, shapeFactory.getShape('single-node')), autoNodeDefinition);\n } else if (nodeDefinition.jsx) {\n var jsx = nodeDefinition.jsx;\n var autoNodeDefinition = (0, _xml.createNodeFromXML)(jsx);\n shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, shapeFactory.getShape('single-node')), autoNodeDefinition), nodeDefinition);\n } else {\n shapeFactory.getShape(extendShapeType);\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)({}, extendShape), nodeDefinition);\n }\n\n shapeObj.type = shapeType;\n shapeObj.itemType = 'node';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n\n Shape.registerEdge = function (shapeType, edgeDefinition, extendShapeType) {\n var shapeFactory = Shape.Edge;\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n var shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)({}, extendShape), edgeDefinition);\n shapeObj.type = shapeType;\n shapeObj.itemType = 'edge';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n\n Shape.registerCombo = function (shapeType, comboDefinition, extendShapeType) {\n var shapeFactory = Shape.Combo;\n var extendShape = extendShapeType ? shapeFactory.getShape(extendShapeType) : ShapeFramework;\n var shapeObj = (0, _tslib.__assign)((0, _tslib.__assign)({}, extendShape), comboDefinition);\n shapeObj.type = shapeType;\n shapeObj.itemType = 'combo';\n shapeFactory[shapeType] = shapeObj;\n return shapeObj;\n };\n\n return Shape;\n}();\n\nvar _default = Shape; // 注册 Node 的工厂方法\n\nexports.default = _default;\nShape.registerFactory('node', {\n defaultShapeType: 'circle'\n}); // 注册 Edge 的工厂方法\n\nShape.registerFactory('edge', {\n defaultShapeType: 'line'\n}); // 注册 Combo 的工厂方法\n\nShape.registerFactory('combo', {\n defaultShapeType: 'circle'\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/element/shape.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dijkstra__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/graphlib/es/algorithm/dijkstra.js\");\n\n\nvar dijkstraAll = function dijkstraAll(graph, weightFn, edgeFn) {\n var map = {};\n graph.nodes().forEach(function (node) {\n map[String(node)] = Object(_dijkstra__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph, node, weightFn, edgeFn);\n return map;\n });\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dijkstraAll);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/dijkstra-all.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/element/shapeBase.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/element/shapeBase.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/dijkstra.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/dijkstra.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.shapeBase = exports.CLS_LABEL_BG_SUFFIX = void 0;\n\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n\nvar _global = _interopRequireDefault(__webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/lib/global.js\"));\n\nvar _matrixUtil = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _graphic = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/lib/util/graphic.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nvar transform = _matrixUtil.ext.transform;\nvar CLS_SHAPE_SUFFIX = '-shape';\nvar CLS_LABEL_SUFFIX = '-label';\nvar ARROWS = ['startArrow', 'endArrow'];\nvar SHAPE_DEFAULT_ATTRS = {\n lineWidth: 1,\n stroke: undefined,\n fill: undefined,\n lineAppendWidth: 1,\n opacity: undefined,\n strokeOpacity: undefined,\n fillOpacity: undefined,\n x: 0,\n y: 0,\n r: 10,\n width: 20,\n height: 20,\n shadowColor: undefined,\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\nvar PATH_SHAPE_DEFAULT_ATTRS = {\n lineWidth: 1,\n stroke: '#000',\n lineDash: undefined,\n startArrow: false,\n endArrow: false,\n opacity: undefined,\n strokeOpacity: undefined,\n fillOpacity: undefined,\n shadowColor: undefined,\n shadowBlur: 0,\n shadowOffsetX: 0,\n shadowOffsetY: 0\n};\nvar SHAPES_DEFAULT_ATTRS = {\n edge: PATH_SHAPE_DEFAULT_ATTRS,\n node: SHAPE_DEFAULT_ATTRS,\n combo: SHAPE_DEFAULT_ATTRS\n};\nvar CLS_LABEL_BG_SUFFIX = '-label-bg'; // 单个 shape 带有一个 label,共用这段代码\n\nexports.CLS_LABEL_BG_SUFFIX = CLS_LABEL_BG_SUFFIX;\nvar shapeBase = {\n // 默认样式及配置\n options: {\n labelCfg: {\n style: {\n fontFamily: _global.default.windowFontFamily\n }\n },\n descriptionCfg: {\n style: {\n fontFamily: _global.default.windowFontFamily\n }\n }\n },\n itemType: '',\n\n /**\n * 形状的类型,例如 circle,ellipse,polyline...\n */\n type: '',\n getCustomConfig: function getCustomConfig(cfg) {\n return {};\n },\n getOptions: function getOptions(cfg, updateType) {\n if (updateType === 'move' || (updateType === null || updateType === void 0 ? void 0 : updateType.includes('bbox'))) {\n return {};\n }\n\n return (0, _util.deepMix)({}, this.options, this.getCustomConfig(cfg) || {}, cfg);\n },\n\n /**\n * 绘制节点/边,包含文本\n * @override\n * @param {Object} cfg 节点的配置项\n * @param {G.Group} group 节点的容器\n * @return {IShape} 绘制的图形\n */\n draw: function draw(cfg, group) {\n group['shapeMap'] = {};\n this.mergeStyle = this.getOptions(cfg);\n var shape = this.drawShape(cfg, group);\n shape.set('className', this.itemType + CLS_SHAPE_SUFFIX);\n group['shapeMap'][this.itemType + CLS_SHAPE_SUFFIX] = shape;\n\n if (cfg.label) {\n var label = this.drawLabel(cfg, group);\n label.set('className', this.itemType + CLS_LABEL_SUFFIX);\n group['shapeMap'][this.itemType + CLS_LABEL_SUFFIX] = label;\n }\n\n return shape;\n },\n\n /**\n * 绘制完成后的操作,便于用户继承现有的节点、边\n * @param cfg\n * @param group\n * @param keyShape\n */\n afterDraw: function afterDraw(cfg, group, keyShape) {},\n drawShape: function drawShape(cfg, group) {\n return null;\n },\n drawLabel: function drawLabel(cfg, group) {\n var defaultLabelCfg = (this.mergeStyle || this.getOptions(cfg) || {}).labelCfg; // image的情况下有可能为null\n\n var labelCfg = defaultLabelCfg || {};\n var labelStyle = this.getLabelStyle(cfg, labelCfg, group);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate;\n var label = group.addShape('text', {\n attrs: labelStyle,\n draggable: true,\n className: 'text-shape',\n name: 'text-shape',\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n\n if (!isNaN(rotate) && rotate !== '') {\n var labelBBox = label.getBBox();\n var labelMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n if (labelStyle.rotateCenter) {\n switch (labelStyle.rotateCenter) {\n case 'center':\n labelMatrix = transform(labelMatrix, [['t', -labelBBox.width / 2, -labelBBox.height / 2], ['r', rotate], ['t', labelBBox.width / 2, labelBBox.height / 2]]);\n break;\n\n case 'lefttop':\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y], ['r', rotate], ['t', labelStyle.x, labelStyle.y]]);\n break;\n\n case 'leftcenter':\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y - labelBBox.height / 2], ['r', rotate], ['t', labelStyle.x, labelStyle.y + labelBBox.height / 2]]);\n break;\n\n default:\n labelMatrix = transform(labelMatrix, [['t', -labelBBox.width / 2, -labelBBox.height / 2], ['r', rotate], ['t', labelBBox.width / 2, labelBBox.height / 2]]);\n break;\n }\n } else {\n labelMatrix = transform(labelMatrix, [['t', -labelStyle.x, -labelStyle.y - labelBBox.height / 2], ['r', rotate], ['t', labelStyle.x, labelStyle.y + labelBBox.height / 2]]);\n }\n\n label.setMatrix(labelMatrix);\n }\n\n if (labelStyle.background) {\n var rect = this.drawLabelBg(cfg, group, label);\n var labelBgClassname = this.itemType + CLS_LABEL_BG_SUFFIX;\n rect.set('classname', labelBgClassname);\n group['shapeMap'][labelBgClassname] = rect;\n label.toFront();\n }\n\n return label;\n },\n drawLabelBg: function drawLabelBg(cfg, group, label) {\n var defaultLabelCfg = this.options.labelCfg;\n var labelCfg = (0, _util.mix)({}, defaultLabelCfg, cfg.labelCfg);\n var style = this.getLabelBgStyleByPosition(label, labelCfg);\n var rect = group.addShape('rect', {\n name: 'text-bg-shape',\n attrs: style,\n labelRelated: true\n });\n group['shapeMap']['text-bg-shape'] = rect;\n return rect;\n },\n getLabelStyleByPosition: function getLabelStyleByPosition(cfg, labelCfg, group) {\n return {\n text: cfg.label\n };\n },\n getLabelBgStyleByPosition: function getLabelBgStyleByPosition(label, labelCfg) {\n return {};\n },\n\n /**\n * 获取文本的配置项\n * @param cfg 节点的配置项\n * @param labelCfg 文本的配置项\n * @param group 父容器,label 的定位可能与图形相关\n */\n getLabelStyle: function getLabelStyle(cfg, labelCfg, group) {\n var calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group);\n var attrName = \"\".concat(this.itemType, \"Label\"); // 取 nodeLabel,edgeLabel 的配置项\n\n var defaultStyle = _global.default[attrName] ? _global.default[attrName].style : null;\n return (0, _tslib.__assign)((0, _tslib.__assign)((0, _tslib.__assign)({}, defaultStyle), calculateStyle), labelCfg.style);\n },\n\n /**\n * 获取图形的配置项\n * @param cfg\n */\n getShapeStyle: function getShapeStyle(cfg) {\n return cfg.style;\n },\n\n /**\n * 更新节点,包含文本\n * @override\n * @param {Object} cfg 节点/边的配置项\n * @param {G6.Item} item 节点/边\n */\n update: function update(cfg, item, updateType) {\n this.updateShapeStyle(cfg, item, updateType);\n this.updateLabel(cfg, item, updateType);\n },\n updateShapeStyle: function updateShapeStyle(cfg, item, updateType) {\n var _a;\n\n var group = item.getContainer();\n var shape = item.getKeyShape();\n var shapeStyle = (0, _util.mix)({}, shape.attr(), cfg.style);\n\n var _loop_1 = function _loop_1(key) {\n var _b;\n\n var style = shapeStyle[key];\n\n if ((0, _util.isPlainObject)(style)) {\n // 更新图元素样式,支持更新子元素\n var subShape = ((_a = group['shapeMap']) === null || _a === void 0 ? void 0 : _a[key]) || group.find(function (element) {\n return element.get('name') === key;\n });\n subShape === null || subShape === void 0 ? void 0 : subShape.attr(style);\n } else {\n shape.attr((_b = {}, _b[key] = style, _b));\n }\n };\n\n for (var key in shapeStyle) {\n _loop_1(key);\n }\n },\n updateLabel: function updateLabel(cfg, item, updateType) {\n var _a, _b; // 防止 cfg.label = \"\" 的情况\n\n\n if (cfg.label || cfg.label === '') {\n var group = item.getContainer();\n var _c = (this.mergeStyle || this.getOptions({}, updateType) || {}).labelCfg,\n labelCfg = _c === void 0 ? {} : _c;\n var labelClassName_1 = this.itemType + CLS_LABEL_SUFFIX;\n var label = group['shapeMap'][labelClassName_1] || group.find(function (ele) {\n return ele.get('className') === labelClassName_1;\n });\n var labelBgClassname_1 = this.itemType + CLS_LABEL_BG_SUFFIX;\n var labelBg = group['shapeMap'][labelBgClassname_1] || group.find(function (ele) {\n return ele.get('className') === labelBgClassname_1;\n }); // 若传入的新配置中有 label,(用户没传入但原先有 label,label 也会有值)\n\n if (!label) {\n // 若原先不存在 label,则绘制一个新的 label\n var newLabel = this.drawLabel(cfg, group);\n newLabel.set('className', labelClassName_1);\n group['shapeMap'][labelClassName_1] = newLabel;\n } else {\n // 若原先存在 label,则更新样式。与 getLabelStyle 不同在于这里需要融合当前 label 的样式\n // 融合 style 以外的属性:position, offset, ...\n if (!updateType || updateType === 'bbox|label' || this.itemType === 'edge' && updateType !== 'style') {\n labelCfg = (0, _util.deepMix)(labelCfg, cfg.labelCfg);\n } // 获取位置信息\n\n\n var calculateStyle = this.getLabelStyleByPosition(cfg, labelCfg, group); // 取 nodeLabel,edgeLabel 的配置项\n\n var cfgStyle = (_a = cfg.labelCfg) === null || _a === void 0 ? void 0 : _a.style; // const cfgBgStyle = labelCfg.style?.background;\n // 需要融合当前\b label 的样式 label.attr()。不再需要全局/默认样式,因为已经应用在当前的 label 上\n\n var labelStyle = (0, _tslib.__assign)((0, _tslib.__assign)({}, calculateStyle), cfgStyle);\n var rotate = labelStyle.rotate;\n delete labelStyle.rotate; // 计算 label 的旋转矩阵\n\n if (!isNaN(rotate) && rotate !== '') {\n // if G 4.x define the rotateAtStart, use it directly instead of using the following codes\n var rotateMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n rotateMatrix = transform(rotateMatrix, [['t', -labelStyle.x, -labelStyle.y], ['r', rotate], ['t', labelStyle.x, labelStyle.y]]);\n labelStyle.matrix = rotateMatrix;\n label.attr(labelStyle);\n } else {\n if (((_b = label.getMatrix()) === null || _b === void 0 ? void 0 : _b[4]) !== 1) {\n label.resetMatrix();\n }\n\n label.attr(labelStyle);\n }\n\n if (!labelBg) {\n if (labelStyle.background) {\n labelBg = this.drawLabelBg(cfg, group, label);\n labelBg.set('classname', labelBgClassname_1);\n group['shapeMap'][labelBgClassname_1] = labelBg;\n label.toFront();\n }\n } else if (labelStyle.background) {\n var calculateBgStyle = this.getLabelBgStyleByPosition(label, labelCfg);\n labelBg.attr(calculateBgStyle);\n } else {\n group.removeChild(labelBg);\n }\n }\n }\n },\n // update(cfg, item) // 默认不定义\n afterUpdate: function afterUpdate(cfg, item) {},\n\n /**\n * 设置节点的状态,主要是交互状态,业务状态请在 draw 方法中实现\n * 单图形的节点仅考虑 selected、active 状态,有其他状态需求的用户自己复写这个方法\n * @override\n * @param {String} name 状态名称\n * @param {String | Boolean} value 状态值\n * @param {G6.Item} item 节点\n */\n setState: function setState(name, value, item) {\n var _a, _b;\n\n var _c;\n\n var shape = item.get('keyShape');\n if (!shape || shape.destroyed) return;\n var type = item.getType();\n var stateName = (0, _util.isBoolean)(value) ? name : \"\".concat(name, \":\").concat(value);\n var shapeStateStyle = this.getStateStyle(stateName, item);\n var itemStateStyle = item.getStateStyle(stateName); // const originStyle = item.getOriginStyle();\n // 不允许设置一个不存在的状态\n\n if (!itemStateStyle && !shapeStateStyle) {\n return;\n } // 要设置或取消的状态的样式\n // 当没有 state 状态时,默认使用 model.stateStyles 中的样式\n\n\n var styles = (0, _util.mix)({}, itemStateStyle || shapeStateStyle);\n var group = item.getContainer(); // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值。使用对象检索更快\n\n var keptAttrs = {\n x: 1,\n y: 1,\n cx: 1,\n cy: 1,\n matrix: 1\n };\n\n if (type === 'combo') {\n keptAttrs.r = 1;\n keptAttrs.width = 1;\n keptAttrs.height = 1;\n }\n\n if (value) {\n var _loop_2 = function _loop_2(key) {\n var _d;\n\n var style = styles[key];\n\n if ((0, _util.isPlainObject)(style) && !ARROWS.includes(key)) {\n var subShape = ((_c = group['shapeMap']) === null || _c === void 0 ? void 0 : _c[key]) || group.find(function (element) {\n return element.get('name') === key;\n });\n subShape === null || subShape === void 0 ? void 0 : subShape.attr(style);\n } else {\n // 非纯对象,则认为是设置到 keyShape 上面的\n shape.attr((_d = {}, _d[key] = style, _d));\n }\n }; // style 为要设置的状态的样式\n\n\n for (var key in styles) {\n _loop_2(key);\n }\n } else {\n // 所有生效的 state 的样式\n var enableStatesStyle = (0, _graphic.cloneBesidesImg)(item.getCurrentStatesStyle());\n var model = item.getModel(); // 原始样式\n\n var originStyle_1 = (0, _util.mix)({}, model.style, (0, _graphic.cloneBesidesImg)(item.getOriginStyle()));\n var keyShapeName_1 = shape.get('name'); // cloning shape.attr(), keys.forEach to avoid cloning the img attr, which leads to maximum clone heap #2383\n // const keyShapeStyles = clone(shape.attr())\n\n var shapeAttrs_1 = shape.attr();\n var keyShapeStyles_1 = {};\n Object.keys(shapeAttrs_1).forEach(function (key) {\n if (key === 'img') return;\n var attr = shapeAttrs_1[key];\n\n if (attr && _typeof(attr) === 'object') {\n keyShapeStyles_1[key] = (0, _util.clone)(attr);\n } else {\n keyShapeStyles_1[key] = attr;\n }\n }); // 已有样式 - 要取消的状态的样式\n\n var filtetDisableStatesStyle = {};\n\n var _loop_3 = function _loop_3(p) {\n var style = styles[p];\n\n if ((0, _util.isPlainObject)(style) && !ARROWS.includes(p)) {\n var subShape_1 = group['shapeMap'][p] || group.find(function (ele) {\n return ele.get('name') === p;\n });\n\n if (subShape_1) {\n var subShapeStyles_1 = (0, _graphic.cloneBesidesImg)(subShape_1.attr());\n (0, _util.each)(style, function (v, key) {\n if (p === keyShapeName_1 && keyShapeStyles_1[key] && !keptAttrs[key]) {\n delete keyShapeStyles_1[key];\n var value_1 = originStyle_1[p][key] || SHAPES_DEFAULT_ATTRS[type][key];\n shape.attr(key, value_1);\n } else if (subShapeStyles_1[key] || subShapeStyles_1[key] === 0) {\n delete subShapeStyles_1[key];\n var value_2 = originStyle_1[p][key] || SHAPES_DEFAULT_ATTRS[type][key];\n subShape_1.attr(key, value_2);\n }\n });\n filtetDisableStatesStyle[p] = subShapeStyles_1;\n }\n } else {\n if (keyShapeStyles_1[p] && !keptAttrs[p]) {\n delete keyShapeStyles_1[p];\n var value_3 = originStyle_1[p] || (originStyle_1[keyShapeName_1] ? originStyle_1[keyShapeName_1][p] : undefined) || SHAPES_DEFAULT_ATTRS[type][p];\n shape.attr(p, value_3);\n }\n }\n }; // styles 为要取消的状态的样式\n\n\n for (var p in styles) {\n _loop_3(p);\n } // 从图元素现有的样式中删除本次要取消的 states 中存在的属性值后,\n // 如果 keyShape 有 name 属性,则 filtetDisableStatesStyle 的格式为 { keyShapeName: {} }\n // 否则为普通对象\n\n\n if (!keyShapeName_1) {\n (0, _util.mix)(filtetDisableStatesStyle, keyShapeStyles_1);\n } else {\n filtetDisableStatesStyle[keyShapeName_1] = keyShapeStyles_1;\n }\n\n for (var key in enableStatesStyle) {\n if (keptAttrs[key]) continue;\n var enableStyle = enableStatesStyle[key];\n\n if (!(0, _util.isPlainObject)(enableStyle) || ARROWS.includes(key)) {\n // 把样式属性merge到keyShape中\n if (!keyShapeName_1) {\n (0, _util.mix)(originStyle_1, (_a = {}, _a[key] = enableStyle, _a));\n } else {\n (0, _util.mix)(originStyle_1[keyShapeName_1], (_b = {}, _b[key] = enableStyle, _b));\n delete originStyle_1[key];\n }\n\n delete enableStatesStyle[key];\n }\n }\n\n var originstyles = {};\n (0, _util.deepMix)(originstyles, originStyle_1, filtetDisableStatesStyle, enableStatesStyle);\n var keyShapeSetted = false;\n\n var _loop_4 = function _loop_4(originKey) {\n var _e, _f;\n\n var style = originstyles[originKey];\n\n if ((0, _util.isPlainObject)(style) && !ARROWS.includes(originKey)) {\n var subShape = group['shapeMap'][originKey] || group.find(function (ele) {\n return ele.get('name') === originKey;\n });\n\n if (subShape) {\n // The text's position and matrix is not allowed to be affected by states\n if (subShape.get('type') === 'text' || subShape.get('labelRelated')) {\n delete style.x;\n delete style.y;\n delete style.matrix;\n }\n\n if (originKey === keyShapeName_1) {\n if (type === 'combo') {\n delete style.r;\n delete style.width;\n delete style.height;\n }\n\n keyShapeSetted = true;\n }\n\n subShape.attr(style);\n }\n } else if (!keyShapeSetted) {\n var value_4 = style || SHAPES_DEFAULT_ATTRS[type][originKey]; // 当更新 combo 状态时,当不存在 keyShapeName 时候,则认为是设置到 keyShape 上面的\n\n if (type === 'combo') {\n if (!keyShapeName_1) {\n shape.attr((_e = {}, _e[originKey] = value_4, _e));\n }\n } else {\n shape.attr((_f = {}, _f[originKey] = value_4, _f));\n }\n }\n };\n\n for (var originKey in originstyles) {\n _loop_4(originKey);\n }\n }\n },\n\n /**\n * 获取不同状态下的样式\n *\n * @param {string} name 状态名称\n * @param {Item} item Node或Edge的实例\n * @return {object} 样式\n */\n getStateStyle: function getStateStyle(name, item) {\n var model = item.getModel();\n var type = item.getType();\n\n var _a = this.getOptions(model),\n stateStyles = _a.stateStyles,\n _b = _a.style,\n style = _b === void 0 ? {} : _b;\n\n var modelStateStyle = model.stateStyles ? model.stateStyles[name] : stateStyles && stateStyles[name];\n\n if (type === 'combo') {\n return (0, _util.clone)(modelStateStyle);\n }\n\n return (0, _util.mix)({}, style, modelStateStyle);\n },\n\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 控制点的数组,如果为 null,则没有控制点\n */\n getControlPoints: function getControlPoints(cfg) {\n return cfg.controlPoints;\n },\n\n /**\n * 获取控制点\n * @param {Object} cfg 节点、边的配置项\n * @return {Array|null} 锚点的数组,如果为 null,则没有锚点\n */\n getAnchorPoints: function getAnchorPoints(cfg) {\n var _a, _b;\n\n var anchorPoints = (cfg === null || cfg === void 0 ? void 0 : cfg.anchorPoints) || ((_a = this.getCustomConfig(cfg)) === null || _a === void 0 ? void 0 : _a.anchorPoints) || ((_b = this.options) === null || _b === void 0 ? void 0 : _b.anchorPoints);\n return anchorPoints;\n }\n};\nexports.shapeBase = shapeBase;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/element/shapeBase.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _PriorityQueue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PriorityQueue */ \"./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\nvar DEFAULT_WEIGHT_FUNC = function DEFAULT_WEIGHT_FUNC() {\n return 1;\n};\n/**\n * @description Dijkstra's algorithm for single-source shortest paths.\n * @description https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm\n * @description.zh-CN Dijkstra 算法用于单源最短路径。\n */\n\n\nvar dijkstra = function dijkstra(graph, source, weightFn, edgeFn) {\n return runDijkstra(graph, source, weightFn || DEFAULT_WEIGHT_FUNC, edgeFn || function (v) {\n return graph.outEdges(v);\n });\n};\n/**\n * @description Dijkstra's algorithm for single-source shortest paths.\n * @description https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm\n * @description.zh-CN Dijkstra 算法用于单源最短路径。\n */\n\n\nvar runDijkstra = function runDijkstra(graph, source, weightFn, edgeFn) {\n var results = new Map();\n var pq = new _PriorityQueue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n var v;\n var vEntry;\n\n var updateNeighbors = function updateNeighbors(edge) {\n var w = edge.v !== v ? edge.v : edge.w;\n var wEntry = results.get(w);\n var weight = weightFn(edge);\n var distance = vEntry.distance + weight;\n\n if (weight < 0) {\n throw new Error('dijkstra does not allow negative edge weights. ' + 'Bad edge: ' + edge + ' Weight: ' + weight);\n } // If there is already a shorter path to w, ignore this edge.\n\n\n if (distance < wEntry.distance) {\n wEntry.distance = distance;\n wEntry.predecessor = v;\n pq.decrease(w, distance);\n }\n };\n\n graph.nodes().forEach(function (v) {\n var distance = v === source ? 0 : Number.POSITIVE_INFINITY;\n results.set(v, {\n distance: distance\n });\n pq.add(v, distance);\n });\n\n while (pq.size() > 0) {\n v = pq.removeMin();\n vEntry = results.get(v);\n\n if (vEntry && vEntry.distance === Number.POSITIVE_INFINITY) {\n break;\n }\n\n edgeFn(v).forEach(updateNeighbors);\n }\n\n var obj = {};\n Array.from(results.entries()).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n node = _ref2[0],\n e = _ref2[1];\n\n obj[String(node)] = e;\n return obj;\n });\n return obj;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dijkstra);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/dijkstra.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/element/xml.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/element/xml.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/find-cycles.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/find-cycles.js ***! + \*****************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.compareTwoTarget = compareTwoTarget;\nexports.createNodeFromXML = createNodeFromXML;\nexports.generateTarget = generateTarget;\nexports.getBBox = getBBox;\nexports.parseXML = parseXML;\nexports.xmlDataRenderer = void 0;\n\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _graphic = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/lib/util/graphic.js\");\n\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n/**\n * 一种更宽松的JSON 解析,如果遇到不符合规范的字段会直接转为字符串\n * @param text json 内容\n */\nfunction looseJSONParse(text) {\n if (typeof text !== 'string') {\n return text;\n }\n\n var safeParse = function safeParse(str) {\n if (typeof str !== 'string') {\n return str;\n }\n\n try {\n return JSON.parse(str.trim());\n } catch (e) {\n return str.trim();\n }\n };\n\n var firstAttempt = safeParse(text);\n\n if (typeof firstAttempt !== 'string') {\n return firstAttempt;\n }\n\n var tail = function tail(arr) {\n return arr[arr.length - 1];\n };\n\n var str = text.trim();\n var objectStack = [];\n var syntaxStack = [];\n\n var isLastPair = function isLastPair() {\n var syntaxes = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n syntaxes[_i] = arguments[_i];\n }\n\n return syntaxes.some(function (syntax) {\n return tail(syntaxStack) === syntax;\n });\n };\n\n var getValueStore = function getValueStore() {\n return tail(objectStack);\n };\n\n var rst = null;\n var i = 0;\n var temp = '';\n\n while (i < str.length) {\n var nowChar = str[i];\n var isInString = isLastPair('\"', \"'\");\n\n if (!isInString && !nowChar.trim()) {\n i += 1;\n continue;\n }\n\n var isLastTranslate = str[i - 1] === '\\\\';\n var isInObject = isLastPair('}');\n var isInArray = isLastPair(']');\n var isWaitingValue = isLastPair(',');\n var tempArr = getValueStore();\n\n if (isInString) {\n if (tail(syntaxStack) === nowChar && !isLastTranslate) {\n syntaxStack.pop();\n var value = safeParse(temp);\n tempArr.push(value);\n rst = value;\n temp = '';\n } else {\n temp += nowChar;\n }\n } else if (isInArray && nowChar === ',') {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n } else if (isInObject && nowChar === ':') {\n syntaxStack.push(',');\n\n if (temp) {\n tempArr.push(temp);\n temp = '';\n }\n } else if (isWaitingValue && nowChar === ',') {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n\n syntaxStack.pop();\n } else if (nowChar === '}' && (isInObject || isWaitingValue)) {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n\n if (isWaitingValue) {\n syntaxStack.pop();\n }\n\n var obj = {};\n\n for (var c = 1; c < tempArr.length; c += 2) {\n obj[tempArr[c - 1]] = tempArr[c];\n }\n\n objectStack.pop();\n\n if (objectStack.length) {\n tail(objectStack).push(obj);\n }\n\n syntaxStack.pop();\n rst = obj;\n } else if (nowChar === ']' && isInArray) {\n if (temp) {\n tempArr.push(safeParse(temp));\n temp = '';\n }\n\n objectStack.pop();\n\n if (objectStack.length) {\n tail(objectStack).push(tempArr);\n }\n\n syntaxStack.pop();\n rst = tempArr;\n } else if (nowChar === '{') {\n objectStack.push([]);\n syntaxStack.push('}');\n } else if (nowChar === '[') {\n objectStack.push([]);\n syntaxStack.push(']');\n } else if (nowChar === '\"') {\n syntaxStack.push('\"');\n } else if (nowChar === \"'\") {\n syntaxStack.push(\"'\");\n } else {\n temp += nowChar;\n }\n\n i += 1;\n }\n\n return rst || temp;\n}\n\nvar keyConvert = function keyConvert(str) {\n return str.split('-').reduce(function (a, b) {\n return a + b.charAt(0).toUpperCase() + b.slice(1);\n });\n};\n/**\n * 简单的一个{{}}模板渲染,不包含任何复杂语法\n * @param xml\n */\n\n\nvar xmlDataRenderer = function xmlDataRenderer(xml) {\n return function (data) {\n var len = xml.length;\n var arr = [];\n var i = 0;\n var tmp = '';\n\n while (i < len) {\n if (xml[i] === '{' && xml[i + 1] === '{') {\n arr.push(tmp);\n tmp = '';\n i += 2;\n } else if (xml[i] === '}' && xml[i + 1] === '}') {\n if (arr.length) {\n var last = arr.pop();\n tmp = (0, _util.get)(data, tmp, last.endsWith('=') ? \"\\\"{\".concat(tmp, \"}\\\"\") : tmp);\n arr.push(last + tmp);\n }\n\n i += 2;\n tmp = '';\n } else {\n tmp += xml[i];\n i += 1;\n }\n }\n\n arr.push(tmp);\n return arr.map(function (e, index) {\n return arr[index - 1] && arr[index - 1].endsWith('=') ? \"\\\"{\".concat(e, \"}\\\"\") : e;\n }).join('');\n };\n};\n/**\n * 解析XML,并转化为相应的JSON结构\n * @param xml xml解析后的节点\n */\n\n\nexports.xmlDataRenderer = xmlDataRenderer;\n\nfunction parseXML(xml, cfg) {\n var attrs = {};\n var keys = xml.getAttributeNames && xml.getAttributeNames() || [];\n var children = xml.children && Array.from(xml.children).map(function (e) {\n return parseXML(e, cfg);\n });\n var rst = {};\n var tagName = xml.tagName ? xml.tagName.toLowerCase() : 'group';\n\n if (tagName === 'text') {\n attrs.text = xml.innerText;\n }\n\n rst.type = tagName;\n\n if (tagName === 'img') {\n rst.type = 'image';\n }\n\n Array.from(keys).forEach(function (k) {\n var key = keyConvert(k);\n var val = xml.getAttribute(k);\n\n try {\n if (key === 'style' || key === 'attrs') {\n var style = looseJSONParse(val);\n attrs = (0, _tslib.__assign)((0, _tslib.__assign)({}, attrs), style);\n } else {\n rst[key] = looseJSONParse(val);\n }\n } catch (e) {\n if (key === 'style') {\n throw e;\n }\n\n rst[key] = val;\n }\n });\n rst.attrs = attrs;\n\n if (cfg && cfg.style && rst.name && _typeof(cfg.style[rst.name]) === 'object') {\n rst.attrs = (0, _tslib.__assign)((0, _tslib.__assign)({}, rst.attrs), cfg.style[rst.name]);\n }\n\n if (cfg && cfg.style && rst.keyshape) {\n rst.attrs = (0, _tslib.__assign)((0, _tslib.__assign)({}, rst.attrs), cfg.style);\n }\n\n if (children.length) {\n rst.children = children;\n }\n\n return rst;\n}\n/**\n * 根据偏移量和内部节点最终的bounding box来得出该shape最终的bbox\n */\n\n\nfunction getBBox(node, offset, chilrenBBox) {\n var _a = node.attrs,\n attrs = _a === void 0 ? {} : _a;\n var bbox = {\n x: offset.x || 0,\n y: offset.y || 0,\n width: chilrenBBox.width || 0,\n height: chilrenBBox.height || 0\n };\n var shapeHeight, shapeWidth;\n\n switch (node.type) {\n case 'maker':\n case 'circle':\n if (attrs.r) {\n shapeWidth = 2 * attrs.r;\n shapeHeight = 2 * attrs.r;\n }\n\n break;\n\n case 'text':\n if (attrs.text) {\n shapeWidth = (0, _graphic.getTextSize)(attrs.text, attrs.fontSize || 12)[0];\n shapeHeight = 16;\n bbox.y += shapeHeight;\n bbox.height = shapeHeight;\n bbox.width = shapeWidth;\n node.attrs = (0, _tslib.__assign)({\n fontSize: 12,\n fill: '#000'\n }, attrs);\n }\n\n break;\n\n default:\n if (attrs.width) {\n shapeWidth = attrs.width;\n }\n\n if (attrs.height) {\n shapeHeight = attrs.height;\n }\n\n }\n\n if (shapeHeight >= 0) {\n bbox.height = shapeHeight;\n }\n\n if (shapeWidth >= 0) {\n bbox.width = shapeWidth;\n }\n\n if (attrs.marginTop) {\n bbox.y += attrs.marginTop;\n }\n\n if (attrs.marginLeft) {\n bbox.x += attrs.marginLeft;\n }\n\n return bbox;\n}\n/**\n * 把从xml计算出的结构填上位置信息,补全attrs\n * @param target\n * @param lastOffset\n */\n\n\nfunction generateTarget(target, lastOffset) {\n var _a;\n\n if (lastOffset === void 0) {\n lastOffset = {\n x: 0,\n y: 0\n };\n }\n\n var defaultBbox = (0, _tslib.__assign)({\n x: 0,\n y: 0,\n width: 0,\n height: 0\n }, lastOffset);\n\n if ((_a = target.children) === null || _a === void 0 ? void 0 : _a.length) {\n var _b = target.attrs,\n attrs = _b === void 0 ? {} : _b;\n var marginTop = attrs.marginTop;\n var offset = (0, _tslib.__assign)({}, lastOffset);\n\n if (marginTop) {\n offset.y += marginTop;\n }\n\n for (var index = 0; index < target.children.length; index++) {\n target.children[index].attrs.key = \"\".concat(attrs.key || 'root', \" -\").concat(index, \" \");\n var node = generateTarget(target.children[index], offset);\n\n if (node.bbox) {\n var bbox = node.bbox;\n\n if (node.attrs.next === 'inline') {\n offset.x += node.bbox.width;\n } else {\n offset.y += node.bbox.height;\n }\n\n if (bbox.width + bbox.x > defaultBbox.width) {\n defaultBbox.width = bbox.width + bbox.x;\n }\n\n if (bbox.height + bbox.y > defaultBbox.height) {\n defaultBbox.height = bbox.height + bbox.y;\n }\n }\n }\n }\n\n target.bbox = getBBox(target, lastOffset, defaultBbox);\n target.attrs = (0, _tslib.__assign)((0, _tslib.__assign)({}, target.attrs), target.bbox);\n return target;\n}\n/**\n * 对比前后两个最终计算出来的node,并对比出最小改动,\n * 动作: 'add' 添加节点 | ’delete‘ 删除节点 | ’change‘ 改变节点attrs | 'restructure' 重构节点\n * @param nowTarget\n * @param formerTarget\n */\n\n\nfunction compareTwoTarget(nowTarget, formerTarget) {\n var _a, _b, _c, _d;\n\n var type = (nowTarget || {}).type;\n var key = ((formerTarget === null || formerTarget === void 0 ? void 0 : formerTarget.attrs) || {}).key;\n\n if (key && nowTarget) {\n nowTarget.attrs.key = key;\n }\n\n if (!nowTarget && formerTarget) {\n return {\n action: 'delete',\n val: formerTarget,\n type: type,\n key: key\n };\n }\n\n if (nowTarget && !formerTarget) {\n return {\n action: 'add',\n val: nowTarget,\n type: type\n };\n }\n\n if (!nowTarget && !formerTarget) {\n return {\n action: 'same',\n type: type\n };\n }\n\n var children = [];\n\n if (((_a = nowTarget.children) === null || _a === void 0 ? void 0 : _a.length) > 0 || ((_b = formerTarget.children) === null || _b === void 0 ? void 0 : _b.length) > 0) {\n var length_1 = Math.max((_c = nowTarget.children) === null || _c === void 0 ? void 0 : _c.length, (_d = formerTarget.children) === null || _d === void 0 ? void 0 : _d.length);\n var formerChilren = formerTarget.children || [];\n var nowChilren = nowTarget.children || [];\n\n for (var index = 0; index < length_1; index += 1) {\n children.push(compareTwoTarget(nowChilren[index], formerChilren[index]));\n }\n }\n\n var formerKeys = Object.keys(formerTarget.attrs);\n var nowKeys = Object.keys(nowTarget.attrs);\n\n if (formerTarget.type !== nowTarget.type) {\n return {\n action: 'restructure',\n nowTarget: nowTarget,\n formerTarget: formerTarget,\n key: key,\n children: children\n };\n }\n\n if (formerKeys.filter(function (e) {\n return e !== 'children';\n }).some(function (e) {\n return nowTarget.attrs[e] !== formerTarget.attrs[e] || !nowKeys.includes(e);\n })) {\n return {\n action: 'change',\n val: nowTarget,\n children: children,\n type: type,\n key: key\n };\n }\n\n return {\n action: 'same',\n children: children,\n type: type,\n key: key\n };\n}\n/**\n * 根据xml或者返回xml的函数构建自定义节点的结构\n * @param gen\n */\n\n\nfunction createNodeFromXML(gen) {\n var structures = {};\n\n var compileXML = function compileXML(cfg) {\n var rawStr = typeof gen === 'function' ? gen(cfg) : gen;\n var target = xmlDataRenderer(rawStr)(cfg);\n var xmlParser = document.createElement('div');\n xmlParser.innerHTML = target;\n var xml = xmlParser.children[0];\n var result = generateTarget(parseXML(xml, cfg));\n xmlParser.remove();\n return result;\n };\n\n return {\n draw: function draw(cfg, group) {\n var resultTarget = compileXML(cfg);\n var keyshape = group;\n\n var renderTarget = function renderTarget(target) {\n var _a = target.attrs,\n attrs = _a === void 0 ? {} : _a,\n bbox = target.bbox,\n type = target.type,\n children = target.children,\n rest = (0, _tslib.__rest)(target, [\"attrs\", \"bbox\", \"type\", \"children\"]);\n\n if (target.type !== 'group') {\n var shape = group.addShape(target.type, (0, _tslib.__assign)({\n attrs: attrs,\n origin: {\n bbox: bbox,\n type: type,\n children: children\n }\n }, rest));\n\n if (target.keyshape) {\n keyshape = shape;\n }\n }\n\n if (target.children) {\n target.children.forEach(function (n) {\n return renderTarget(n);\n });\n }\n };\n\n renderTarget(resultTarget);\n structures[cfg.id] = [resultTarget];\n return keyshape;\n },\n update: function update(cfg, node) {\n if (!structures[cfg.id]) {\n structures[cfg.id] = [];\n }\n\n var container = node.getContainer();\n var children = container.get('children');\n var newTarget = compileXML(cfg);\n var lastTarget = structures[cfg.id].pop();\n var diffResult = compareTwoTarget(newTarget, lastTarget);\n\n var addShape = function addShape(shape) {\n var _a;\n\n if (shape.type !== 'group') {\n container.addShape(shape.type, {\n attrs: shape.attrs\n });\n }\n\n if ((_a = shape.children) === null || _a === void 0 ? void 0 : _a.length) {\n shape.children.map(function (e) {\n return addShape(e);\n });\n }\n };\n\n var delShape = function delShape(shape) {\n var _a;\n\n var targetShape = children.find(function (e) {\n return e.attrs.key === shape.attrs.key;\n });\n\n if (targetShape) {\n container.removeChild(targetShape);\n }\n\n if ((_a = shape.children) === null || _a === void 0 ? void 0 : _a.length) {\n shape.children.map(function (e) {\n return delShape(e);\n });\n }\n };\n\n var updateTarget = function updateTarget(target) {\n var key = target.key;\n\n if (target.type !== 'group') {\n var targetShape = children.find(function (e) {\n return e.attrs.key === key;\n });\n\n switch (target.action) {\n case 'change':\n if (targetShape) {\n var originAttr = target.val.keyshape ? node.getOriginStyle() : {};\n targetShape.attr((0, _tslib.__assign)((0, _tslib.__assign)({}, originAttr), target.val.attrs));\n }\n\n break;\n\n case 'add':\n addShape(target.val);\n break;\n\n case 'delete':\n delShape(target.val);\n break;\n\n case 'restructure':\n delShape(target.formerTarget);\n addShape(target.nowTarget);\n break;\n\n default:\n break;\n }\n }\n\n if (target.children) {\n target.children.forEach(function (n) {\n return updateTarget(n);\n });\n }\n };\n\n updateTarget(diffResult);\n structures[cfg.id].push(newTarget);\n },\n getAnchorPoints: function getAnchorPoints() {\n return [[0, 0.5], [1, 0.5], [0.5, 1], [0.5, 0]];\n }\n };\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/element/xml.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _tarjan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tarjan */ \"./node_modules/@antv/graphlib/es/algorithm/tarjan.js\");\n\n\nvar findCycles = function findCycles(graph) {\n return Object(_tarjan__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph).filter(function (cmpt) {\n return cmpt.length > 1 || cmpt.length === 1 && graph.hasEdge(cmpt[0], cmpt[0]);\n });\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (findCycles);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/find-cycles.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/global.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/global.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/floyd-warshall.js": +/*!********************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/floyd-warshall.js ***! + \********************************************************************/ +/*! exports provided: floydWarshall, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar subjectColor = 'rgb(95, 149, 255)';\nvar backColor = 'rgb(255, 255, 255)';\nvar textColor = 'rgb(0, 0, 0)';\nvar activeFill = 'rgb(247, 250, 255)';\nvar nodeMainFill = 'rgb(239, 244, 255)';\nvar comboFill = 'rgb(253, 253, 253)';\nvar disabledFill = 'rgb(250, 250, 250)';\nvar edgeMainStroke = 'rgb(224, 224, 224)';\nvar edgeInactiveStroke = 'rgb(234, 234, 234)';\nvar edgeDisablesStroke = 'rgb(245, 245, 245)';\nvar inactiveStroke = 'rgb(191, 213, 255)';\nvar highlightStroke = '#4572d9';\nvar highlightFill = 'rgb(223, 234, 255)';\nvar colorSet = {\n // for nodes\n mainStroke: subjectColor,\n mainFill: nodeMainFill,\n activeStroke: subjectColor,\n activeFill: activeFill,\n inactiveStroke: inactiveStroke,\n inactiveFill: activeFill,\n selectedStroke: subjectColor,\n selectedFill: backColor,\n highlightStroke: highlightStroke,\n highlightFill: highlightFill,\n disableStroke: edgeMainStroke,\n disableFill: disabledFill,\n // for edges\n edgeMainStroke: edgeMainStroke,\n edgeActiveStroke: subjectColor,\n edgeInactiveStroke: edgeInactiveStroke,\n edgeSelectedStroke: subjectColor,\n edgeHighlightStroke: subjectColor,\n edgeDisableStroke: edgeDisablesStroke,\n // for combos\n comboMainStroke: edgeMainStroke,\n comboMainFill: comboFill,\n comboActiveStroke: subjectColor,\n comboActiveFill: activeFill,\n comboInactiveStroke: edgeMainStroke,\n comboInactiveFill: comboFill,\n comboSelectedStroke: subjectColor,\n comboSelectedFill: comboFill,\n comboHighlightStroke: highlightStroke,\n comboHighlightFill: comboFill,\n comboDisableStroke: edgeInactiveStroke,\n comboDisableFill: disabledFill\n};\nvar _default = {\n version: '0.7.3',\n rootContainerClassName: 'root-container',\n nodeContainerClassName: 'node-container',\n edgeContainerClassName: 'edge-container',\n comboContainerClassName: 'combo-container',\n delegateContainerClassName: 'delegate-container',\n defaultLoopPosition: 'top',\n nodeLabel: {\n style: {\n fill: '#000',\n fontSize: 12,\n textAlign: 'center',\n textBaseline: 'middle'\n },\n offset: 4 // 节点的默认文本不居中时的偏移量\n\n },\n defaultNode: {\n type: 'circle',\n style: {\n lineWidth: 1,\n stroke: colorSet.mainStroke,\n fill: nodeMainFill\n },\n size: 20,\n color: colorSet.mainStroke,\n linkPoints: {\n size: 8,\n lineWidth: 1,\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke\n }\n },\n // 节点应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n nodeStateStyles: {\n active: {\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke,\n lineWidth: 2,\n shadowColor: colorSet.mainStroke,\n shadowBlur: 10\n },\n selected: {\n fill: colorSet.selectedFill,\n stroke: colorSet.selectedStroke,\n lineWidth: 4,\n shadowColor: colorSet.selectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n fill: colorSet.highlightFill,\n stroke: colorSet.highlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n fill: colorSet.inactiveFill,\n stroke: colorSet.inactiveStroke,\n lineWidth: 1\n },\n disable: {\n fill: colorSet.disableFill,\n stroke: colorSet.disableStroke,\n lineWidth: 1\n }\n },\n edgeLabel: {\n style: {\n fill: textColor,\n textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n }\n },\n defaultEdge: {\n type: 'line',\n size: 1,\n style: {\n stroke: colorSet.edgeMainStroke,\n lineAppendWidth: 2\n },\n color: colorSet.edgeMainStroke\n },\n // 边应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n edgeStateStyles: {\n active: {\n stroke: colorSet.edgeActiveStroke,\n lineWidth: 1\n },\n selected: {\n stroke: colorSet.edgeSelectedStroke,\n lineWidth: 2,\n shadowColor: colorSet.edgeSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.edgeHighlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.edgeInactiveStroke,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.edgeDisableStroke,\n lineWidth: 1\n }\n },\n comboLabel: {\n style: {\n fill: textColor,\n // textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n },\n refY: 10,\n refX: 10 // Combo 的默认文本不居中时的偏移量\n\n },\n defaultCombo: {\n type: 'circle',\n style: {\n fill: colorSet.comboMainFill,\n lineWidth: 1,\n stroke: colorSet.comboMainStroke,\n r: 5,\n width: 20,\n height: 10\n },\n size: [20, 5],\n color: colorSet.comboMainStroke,\n padding: [25, 20, 15, 20]\n },\n // combo 应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n comboStateStyles: {\n active: {\n stroke: colorSet.comboActiveStroke,\n lineWidth: 1,\n fill: colorSet.comboActiveFill\n },\n selected: {\n stroke: colorSet.comboSelectedStroke,\n lineWidth: 2,\n fill: colorSet.comboSelectedFill,\n shadowColor: colorSet.comboSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.comboHighlightStroke,\n lineWidth: 2,\n fill: colorSet.comboHighlightFill,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.comboInactiveStroke,\n fill: colorSet.comboInactiveFill,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.comboDisableStroke,\n fill: colorSet.comboDisableFill,\n lineWidth: 1\n }\n },\n delegateStyle: {\n fill: '#F3F9FF',\n fillOpacity: 0.5,\n stroke: '#1890FF',\n strokeOpacity: 0.9,\n lineDash: [5, 5]\n },\n windowFontFamily: typeof window !== 'undefined' && window.getComputedStyle && document.body ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif'\n};\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/global.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floydWarshall\", function() { return floydWarshall; });\nvar DEFAULT_WEIGHT_FUNC = function DEFAULT_WEIGHT_FUNC() {\n return 1;\n};\n\nfunction floydWarshall(graph, weightFn, edgeFn) {\n return runFloydWarshall(graph, weightFn || DEFAULT_WEIGHT_FUNC, edgeFn || function (v) {\n return graph.outEdges(v);\n });\n}\n\nfunction runFloydWarshall(graph, weightFn, edgeFn) {\n var results = {};\n var nodes = graph.nodes();\n nodes.forEach(function (node) {\n var v = String(node);\n results[v] = {};\n results[v][v] = {\n distance: 0\n };\n nodes.forEach(function (w) {\n if (node !== w) {\n results[v][String(w)] = {\n distance: Number.POSITIVE_INFINITY\n };\n }\n });\n edgeFn(node).forEach(function (edge) {\n var w = edge.v === node ? edge.w : edge.v;\n var d = weightFn(edge);\n results[v][String(w)] = {\n distance: d,\n predecessor: node\n };\n });\n });\n nodes.forEach(function (nodek) {\n var k = String(nodek);\n var rowK = results[k];\n nodes.forEach(function (nodei) {\n var i = String(nodei);\n var rowI = results[i];\n nodes.forEach(function (nodej) {\n var j = String(nodej);\n var ik = rowI[k];\n var kj = rowK[j];\n var ij = rowI[j];\n var altDistance = ik.distance + kj.distance;\n\n if (altDistance < ij.distance) {\n ij.distance = altDistance;\n ij.predecessor = kj.predecessor;\n }\n });\n });\n });\n return results;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (floydWarshall);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/floyd-warshall.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/interface/behavior.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/interface/behavior.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/index.js ***! + \***********************************************************/ +/*! exports provided: components, dfs, dijkstra, dijkstraAll, findCycles, tarjan, isAcyclic, postorder, preorder, prim, topsort, floydWarshall */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.G6GraphEvent = void 0;\n\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n\nvar _gBase = __webpack_require__(/*! @antv/g-base */ \"./node_modules/@antv/g-base/esm/index.js\");\n\nvar G6GraphEvent =\n/** @class */\nfunction (_super) {\n (0, _tslib.__extends)(G6GraphEvent, _super);\n\n function G6GraphEvent(type, event) {\n var _this = _super.call(this, type, event) || this;\n\n _this.item = event.item;\n _this.canvasX = event.canvasX;\n _this.canvasY = event.canvasY;\n _this.wheelDelta = event.wheelDelta;\n _this.detail = event.detail;\n return _this;\n }\n\n return G6GraphEvent;\n}(_gBase.Event);\n\nexports.G6GraphEvent = G6GraphEvent;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/interface/behavior.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _prim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./prim */ \"./node_modules/@antv/graphlib/es/algorithm/prim.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"prim\", function() { return _prim__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components */ \"./node_modules/@antv/graphlib/es/algorithm/components.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"components\", function() { return _components__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _dfs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dfs */ \"./node_modules/@antv/graphlib/es/algorithm/dfs.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"dfs\", function() { return _dfs__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _dijkstra__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/graphlib/es/algorithm/dijkstra.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"dijkstra\", function() { return _dijkstra__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _dijkstra_all__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dijkstra-all */ \"./node_modules/@antv/graphlib/es/algorithm/dijkstra-all.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"dijkstraAll\", function() { return _dijkstra_all__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _find_cycles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find-cycles */ \"./node_modules/@antv/graphlib/es/algorithm/find-cycles.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"findCycles\", function() { return _find_cycles__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _is_acyclic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./is-acyclic */ \"./node_modules/@antv/graphlib/es/algorithm/is-acyclic.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isAcyclic\", function() { return _is_acyclic__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _postorder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./postorder */ \"./node_modules/@antv/graphlib/es/algorithm/postorder.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"postorder\", function() { return _postorder__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _preorder__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./preorder */ \"./node_modules/@antv/graphlib/es/algorithm/preorder.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"preorder\", function() { return _preorder__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _tarjan__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./tarjan */ \"./node_modules/@antv/graphlib/es/algorithm/tarjan.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"tarjan\", function() { return _tarjan__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _topsort__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./topsort */ \"./node_modules/@antv/graphlib/es/algorithm/topsort.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"topsort\", function() { return _topsort__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _floyd_warshall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./floyd-warshall */ \"./node_modules/@antv/graphlib/es/algorithm/floyd-warshall.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"floydWarshall\", function() { return _floyd_warshall__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/item/item.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/item/item.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/is-acyclic.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/is-acyclic.js ***! + \****************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\n\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _shape = _interopRequireDefault(__webpack_require__(/*! ../element/shape */ \"./node_modules/@antv/g6-core/lib/element/shape.js\"));\n\nvar _graphic = __webpack_require__(/*! ../util/graphic */ \"./node_modules/@antv/g6-core/lib/util/graphic.js\");\n\nvar _math = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/g6-core/lib/util/math.js\");\n\nvar _base = __webpack_require__(/*! ../util/base */ \"./node_modules/@antv/g6-core/lib/util/base.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar CACHE_BBOX = 'bboxCache';\nvar CACHE_CANVAS_BBOX = 'bboxCanvasCache';\nvar ARROWS = ['startArrow', 'endArrow'];\n\nvar ItemBase =\n/** @class */\nfunction () {\n function ItemBase(cfg) {\n this._cfg = {};\n this.destroyed = false;\n var defaultCfg = {\n /**\n * id\n * @type {string}\n */\n id: undefined,\n\n /**\n * 类型\n * @type {string}\n */\n type: 'item',\n\n /**\n * data model\n * @type {object}\n */\n model: {},\n\n /**\n * g group\n * @type {G.Group}\n */\n group: undefined,\n\n /**\n * is open animate\n * @type {boolean}\n */\n animate: false,\n\n /**\n * visible - not group visible\n * @type {boolean}\n */\n visible: true,\n\n /**\n * locked - lock node\n * @type {boolean}\n */\n locked: false,\n\n /**\n * capture event\n * @type {boolean}\n */\n event: true,\n\n /**\n * key shape to calculate item's bbox\n * @type object\n */\n keyShape: undefined,\n\n /**\n * item's states, such as selected or active\n * @type Array\n */\n states: []\n };\n this._cfg = Object.assign(defaultCfg, this.getDefaultCfg(), cfg);\n var model = this.get('model');\n var id = model.id;\n var itemType = this.get('type');\n\n if (typeof id === 'undefined') {\n id = (0, _base.uniqueId)(itemType);\n } else if (typeof id !== 'string') {\n id = String(id);\n }\n\n this.get('model').id = id;\n this.set('id', id);\n var group = cfg.group;\n\n if (group) {\n group.set('item', this);\n group.set('id', id);\n }\n\n this.init();\n this.draw();\n var shapeType = model.shape || model.type || (itemType === 'edge' ? 'line' : 'circle');\n var shapeFactory = this.get('shapeFactory');\n\n if (shapeFactory && shapeFactory[shapeType]) {\n var options = shapeFactory[shapeType].options; // merge the stateStyles from item and shape\n\n if (options && options.stateStyles) {\n var styles = this.get('styles') || model.stateStyles;\n styles = (0, _util.deepMix)({}, options.stateStyles, styles);\n this.set('styles', styles);\n }\n }\n }\n /**\n * 根据 keyshape 计算包围盒\n */\n\n\n ItemBase.prototype.calculateBBox = function () {\n var keyShape = this.get('keyShape');\n var group = this.get('group'); // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n\n var bbox = (0, _graphic.getBBox)(keyShape, group);\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n return bbox;\n };\n /**\n * 根据 keyshape 计算包围盒\n */\n\n\n ItemBase.prototype.calculateCanvasBBox = function () {\n var keyShape = this.get('keyShape');\n var group = this.get('group'); // 因为 group 可能会移动,所以必须通过父元素计算才能计算出正确的包围盒\n\n var bbox = (0, _graphic.getBBox)(keyShape, group);\n bbox.x = bbox.minX;\n bbox.y = bbox.minY;\n bbox.width = bbox.maxX - bbox.minX;\n bbox.height = bbox.maxY - bbox.minY;\n bbox.centerX = (bbox.minX + bbox.maxX) / 2;\n bbox.centerY = (bbox.minY + bbox.maxY) / 2;\n return bbox;\n };\n /**\n * draw shape\n */\n\n\n ItemBase.prototype.drawInner = function () {\n var self = this;\n var shapeFactory = self.get('shapeFactory');\n var group = self.get('group');\n var model = self.get('model');\n group.clear();\n var visible = model.visible;\n if (visible !== undefined && !visible) self.changeVisibility(visible);\n\n if (!shapeFactory) {\n return;\n }\n\n self.updatePosition(model);\n var cfg = self.getShapeCfg(model); // 可能会附加额外信息\n\n var shapeType = cfg.type;\n var keyShape = shapeFactory.draw(shapeType, cfg, group);\n\n if (keyShape) {\n self.set('keyShape', keyShape);\n keyShape.set('isKeyShape', true);\n keyShape.set('draggable', true);\n }\n\n this.setOriginStyle(); // 防止由于用户外部修改 model 中的 shape 导致 shape 不更新\n\n this.set('currentShape', shapeType);\n this.restoreStates(shapeFactory, shapeType);\n };\n /**\n * 设置图元素原始样式\n * @param keyShape 图元素 keyShape\n * @param group Group 容器\n */\n\n\n ItemBase.prototype.setOriginStyle = function () {\n var group = this.get('group');\n var children = group.get('children');\n var keyShape = this.getKeyShape();\n var self = this;\n var keyShapeName = keyShape.get('name');\n\n if (!this.get('originStyle')) {\n // 第一次 set originStyle,直接拿首次渲染所有图形的 attrs\n var originStyles = {};\n\n for (var i = 0; i < children.length; i++) {\n var child = children[i];\n var shapeType = child.get('type');\n var name_1 = child.get('name');\n\n if (name_1 && name_1 !== keyShapeName) {\n originStyles[name_1] = shapeType !== 'image' ? (0, _util.clone)(child.attr()) : self.getShapeStyleByName(name_1); // The text's position and matrix is not allowed to be affected by states\n\n if (shapeType === 'text' && originStyles[name_1]) {\n delete originStyles[name_1].x;\n delete originStyles[name_1].y;\n delete originStyles[name_1].matrix;\n }\n } else {\n var keyShapeStyle = self.getShapeStyleByName(); // 可优化,需要去除 child.attr 中其他 shape 名的对象\n\n delete keyShapeStyle.path;\n delete keyShapeStyle.matrix;\n\n if (!keyShapeName) {\n Object.assign(originStyles, keyShapeStyle);\n } else {\n // 若 keyShape 有 name 且 !name,这个图形不是 keyShape,给这个图形一个 name\n if (!name_1) {\n var shapeName = (0, _base.uniqueId)('shape');\n child.set('name', shapeName);\n group['shapeMap'][shapeName] = child;\n originStyles[shapeName] = shapeType !== 'image' ? (0, _util.clone)(child.attr()) : self.getShapeStyleByName(name_1);\n } else {\n originStyles[keyShapeName] = keyShapeStyle;\n }\n }\n }\n }\n\n self.set('originStyle', originStyles);\n } else {\n // 第二次 set originStyles,需要找到不是 stateStyles 的样式,更新到 originStyles 中\n // 上一次设置的 originStyle,是初始的 shape attrs\n var styles_1 = this.get('originStyle'); // let styles: ShapeStyle = {};\n\n if (keyShapeName && !styles_1[keyShapeName]) styles_1[keyShapeName] = {}; // 获取当前状态样式\n\n var currentStatesStyle_1 = this.getCurrentStatesStyle();\n\n var _loop_1 = function _loop_1(i) {\n var child = children[i];\n var name_2 = child.get('name');\n var shapeAttrs = child.attr();\n\n if (name_2 && name_2 !== keyShapeName) {\n // 有 name 的非 keyShape 图形\n var shapeStateStyle_1 = currentStatesStyle_1[name_2];\n if (!styles_1[name_2]) styles_1[name_2] = {};\n\n if (shapeStateStyle_1) {\n Object.keys(shapeAttrs).forEach(function (key) {\n var value = shapeAttrs[key];\n if (value !== shapeStateStyle_1[key]) styles_1[name_2][key] = value;\n });\n } else {\n styles_1[name_2] = child.get('type') !== 'image' ? (0, _util.clone)(shapeAttrs) : self.getShapeStyleByName(name_2);\n }\n } else {\n var shapeAttrs_1 = child.attr();\n var keyShapeStateStyles_1 = {};\n Object.keys(currentStatesStyle_1).forEach(function (styleKey) {\n var subStyle = currentStatesStyle_1[styleKey];\n\n if (styleKey === keyShapeName || !(0, _util.isPlainObject)(subStyle)) {\n keyShapeStateStyles_1[styleKey] = subStyle;\n }\n });\n Object.keys(shapeAttrs_1).forEach(function (key) {\n var value = shapeAttrs_1[key]; // 如果是对象且不是 arrow,则是其他 shape 的样式\n // if (isPlainObject(value) && ARROWS.indexOf(name) === -1) return;\n\n if (keyShapeStateStyles_1[key] !== value) {\n if (keyShapeName) styles_1[keyShapeName][key] = value;else styles_1[key] = value;\n }\n });\n }\n }; // 遍历当前所有图形的 attrs,找到不是 stateStyles 的样式更新到 originStyles 中\n\n\n for (var i = 0; i < children.length; i++) {\n _loop_1(i);\n }\n\n delete styles_1.path;\n delete styles_1.matrix;\n delete styles_1.x;\n delete styles_1.y;\n\n if (styles_1[keyShapeName]) {\n delete styles_1[keyShapeName].x;\n delete styles_1[keyShapeName].y;\n delete styles_1[keyShapeName].matrix;\n delete styles_1[keyShapeName].path;\n }\n\n self.set('originStyle', styles_1);\n }\n };\n /**\n * restore shape states\n * @param shapeFactory\n * @param shapeType\n */\n\n\n ItemBase.prototype.restoreStates = function (shapeFactory, shapeType) {\n var self = this;\n var states = self.get('states');\n (0, _util.each)(states, function (state) {\n shapeFactory.setState(shapeType, state, true, self);\n });\n };\n\n ItemBase.prototype.init = function () {\n var shapeFactory = _shape.default.getFactory(this.get('type'));\n\n this.set('shapeFactory', shapeFactory);\n };\n /**\n * 获取属性\n * @internal 仅内部类使用\n * @param {String} key 属性名\n * @return {object | string | number} 属性值\n */\n\n\n ItemBase.prototype.get = function (key) {\n return this._cfg[key];\n };\n /**\n * 设置属性\n * @internal 仅内部类使用\n * @param {String|Object} key 属性名,也可以是对象\n * @param {object | string | number} val 属性值\n */\n\n\n ItemBase.prototype.set = function (key, val) {\n if ((0, _util.isPlainObject)(key)) {\n this._cfg = (0, _tslib.__assign)((0, _tslib.__assign)({}, this._cfg), key);\n } else {\n this._cfg[key] = val;\n }\n };\n\n ItemBase.prototype.getDefaultCfg = function () {\n return {};\n };\n /**\n * 更新/刷新等操作后,清除 cache\n */\n\n\n ItemBase.prototype.clearCache = function () {\n this.set(CACHE_BBOX, null);\n this.set(CACHE_CANVAS_BBOX, null);\n };\n /**\n * 渲染前的逻辑,提供给子类复写\n */\n\n\n ItemBase.prototype.beforeDraw = function () {};\n /**\n * 渲染后的逻辑,提供给子类复写\n */\n\n\n ItemBase.prototype.afterDraw = function () {};\n /**\n * 更新后做一些工作\n */\n\n\n ItemBase.prototype.afterUpdate = function () {};\n /**\n * draw shape\n */\n\n\n ItemBase.prototype.draw = function () {\n this.beforeDraw();\n this.drawInner();\n this.afterDraw();\n };\n\n ItemBase.prototype.getShapeStyleByName = function (name) {\n var group = this.get('group');\n var currentShape;\n\n if (name) {\n currentShape = group['shapeMap'][name]; // group.find((element) => element.get('name') === name) as IShapeBase;\n } else {\n currentShape = this.getKeyShape();\n }\n\n if (currentShape) {\n var styles_2 = {};\n (0, _util.each)(currentShape.attr(), function (val, key) {\n // 修改 img 通过 updateItem 实现\n if (key !== 'img' || (0, _util.isString)(val)) {\n styles_2[key] = val;\n }\n });\n return styles_2;\n }\n\n return {};\n };\n\n ItemBase.prototype.getShapeCfg = function (model, updateType) {\n var styles = this.get('styles');\n\n if (styles) {\n // merge graph的item样式与数据模型中的样式\n var newModel = model;\n newModel.style = (0, _tslib.__assign)((0, _tslib.__assign)({}, styles), model.style);\n return newModel;\n }\n\n return model;\n };\n /**\n * 获取指定状态的样式,去除了全局样式\n * @param state 状态名称\n */\n\n\n ItemBase.prototype.getStateStyle = function (state) {\n var styles = this.get('styles');\n var stateStyle = styles && styles[state];\n return stateStyle;\n };\n /**\n * get keyshape style\n */\n\n\n ItemBase.prototype.getOriginStyle = function () {\n return this.get('originStyle');\n };\n\n ItemBase.prototype.getCurrentStatesStyle = function () {\n var self = this;\n var styles = {};\n var states = self.getStates();\n\n if (!states || !states.length) {\n return this.get('originStyle');\n }\n\n (0, _util.each)(self.getStates(), function (state) {\n styles = Object.assign(styles, self.getStateStyle(state));\n });\n return styles;\n };\n /**\n * 更改元素状态, visible 不属于这个范畴\n * @internal 仅提供内部类 graph 使用\n * @param {String} state 状态名\n * @param {Boolean} value 节点状态值\n */\n\n\n ItemBase.prototype.setState = function (state, value) {\n var states = this.get('states');\n var shapeFactory = this.get('shapeFactory');\n var stateName = state;\n var filterStateName = state;\n\n if ((0, _util.isString)(value)) {\n stateName = \"\".concat(state, \":\").concat(value);\n filterStateName = \"\".concat(state, \":\");\n }\n\n var newStates = states;\n\n if ((0, _util.isBoolean)(value)) {\n var index = states.indexOf(filterStateName);\n\n if (value) {\n if (index > -1) {\n return;\n }\n\n states.push(stateName);\n } else if (index > -1) {\n states.splice(index, 1);\n }\n } else if ((0, _util.isString)(value)) {\n // 过滤掉 states 中 filterStateName 相关的状态\n var filterStates = states.filter(function (name) {\n return name.includes(filterStateName);\n });\n\n if (filterStates.length > 0) {\n this.clearStates(filterStates);\n }\n\n newStates = newStates.filter(function (name) {\n return !name.includes(filterStateName);\n });\n newStates.push(stateName);\n this.set('states', newStates);\n }\n\n if (shapeFactory) {\n var model = this.get('model');\n var type = model.type; // 调用 shape/shape.ts 中的 setState\n\n shapeFactory.setState(type, state, value, this);\n }\n };\n /**\n * 清除指定的状态,如果参数为空,则不做任务处理\n * @param states 状态名称\n */\n\n\n ItemBase.prototype.clearStates = function (states) {\n var self = this;\n var originStates = self.getStates();\n var shapeFactory = self.get('shapeFactory');\n var model = self.get('model');\n var shape = model.type;\n\n if (!states) {\n states = originStates;\n }\n\n if ((0, _util.isString)(states)) {\n states = [states];\n }\n\n var newStates = originStates.filter(function (state) {\n return states.indexOf(state) === -1;\n });\n self.set('states', newStates);\n states.forEach(function (state) {\n shapeFactory.setState(shape, state, false, self);\n });\n };\n /**\n * 节点的图形容器\n * @return {G.Group} 图形容器\n */\n\n\n ItemBase.prototype.getContainer = function () {\n return this.get('group');\n };\n /**\n * 节点的关键形状,用于计算节点大小,连线截距等\n * @return {IShapeBase} 关键形状\n */\n\n\n ItemBase.prototype.getKeyShape = function () {\n return this.get('keyShape');\n };\n /**\n * 节点数据模型\n * @return {Object} 数据模型\n */\n\n\n ItemBase.prototype.getModel = function () {\n return this.get('model');\n };\n /**\n * 节点类型\n * @return {string} 节点的类型\n */\n\n\n ItemBase.prototype.getType = function () {\n return this.get('type');\n };\n /**\n * 获取 Item 的ID\n */\n\n\n ItemBase.prototype.getID = function () {\n return this.get('id');\n };\n /**\n * 是否是 Item 对象,悬空边情况下进行判定\n */\n\n\n ItemBase.prototype.isItem = function () {\n return true;\n };\n /**\n * 获取当前元素的所有状态\n * @return {Array} 元素的所有状态\n */\n\n\n ItemBase.prototype.getStates = function () {\n return this.get('states');\n };\n /**\n * 当前元素是否处于某状态\n * @param {String} state 状态名\n * @return {Boolean} 是否处于某状态\n */\n\n\n ItemBase.prototype.hasState = function (state) {\n var states = this.getStates();\n return states.indexOf(state) >= 0;\n };\n /**\n * 刷新一般用于处理几种情况\n * 1. item model 在外部被改变\n * 2. 边的节点位置发生改变,需要重新计算边\n *\n * 因为数据从外部被修改无法判断一些属性是否被修改,直接走位置和 shape 的更新\n */\n\n\n ItemBase.prototype.refresh = function (updateType) {\n var model = this.get('model'); // 更新元素位置\n\n this.updatePosition(model); // 更新元素内容,样式\n\n this.updateShape(updateType); // 做一些更新之后的操作\n\n this.afterUpdate(); // 清除缓存\n\n this.clearCache();\n };\n\n ItemBase.prototype.getUpdateType = function (cfg) {\n return undefined;\n };\n /**\n * 将更新应用到 model 上,刷新属性\n * @internal 仅提供给 Graph 使用,外部直接调用 graph.update 接口\n * @param {Object} cfg 配置项,可以是增量信息\n */\n\n\n ItemBase.prototype.update = function (cfg, updateType) {\n if (updateType === void 0) {\n updateType = undefined;\n }\n\n var model = this.get('model'); // 仅仅移动位置时,既不更新,也不重绘\n\n if (updateType === 'move') {\n this.updatePosition(cfg);\n } else {\n var oriVisible = model.visible;\n var cfgVisible = cfg.visible;\n if (oriVisible !== cfgVisible && cfgVisible !== undefined) this.changeVisibility(cfgVisible);\n var originPosition = {\n x: model.x,\n y: model.y\n };\n cfg.x = isNaN(+cfg.x) ? model.x : +cfg.x;\n cfg.y = isNaN(+cfg.y) ? model.y : +cfg.y;\n var styles = this.get('styles');\n\n if (cfg.stateStyles) {\n // 更新 item 时更新 this.get('styles') 中的值\n var stateStyles = cfg.stateStyles;\n (0, _util.mix)(styles, stateStyles);\n delete cfg.stateStyles;\n } // 直接将更新合到原数据模型上,可以保证用户在外部修改源数据然后刷新时的样式符合期待。\n\n\n Object.assign(model, cfg); // 如果 x,y 有变化,先重置位置\n\n if (originPosition.x !== cfg.x || originPosition.y !== cfg.y) {\n this.updatePosition(cfg);\n }\n\n this.updateShape(updateType);\n }\n\n this.afterUpdate();\n this.clearCache();\n };\n /**\n * 更新元素内容,样式\n */\n\n\n ItemBase.prototype.updateShape = function (updateType) {\n var shapeFactory = this.get('shapeFactory');\n var model = this.get('model');\n var shape = model.type; // 判定是否允许更新\n // 1. 注册的节点允许更新(即有继承的/复写的 update 方法,即 update 方法没有被复写为 undefined)\n // 2. 更新后的 shape 等于原先的 shape\n\n if (shapeFactory.shouldUpdate(shape) && shape === this.get('currentShape')) {\n var updateCfg = this.getShapeCfg(model, updateType);\n shapeFactory.baseUpdate(shape, updateCfg, this, updateType); // 更新完以后重新设置原始样式\n\n if (updateType !== 'move') this.setOriginStyle();\n } else {\n // 如果不满足上面两种状态,重新绘制\n this.draw();\n } // 更新后重置节点状态\n\n\n this.restoreStates(shapeFactory, shape);\n };\n /**\n * 更新位置,避免整体重绘\n * @param {object} cfg 待更新数据\n */\n\n\n ItemBase.prototype.updatePosition = function (cfg) {\n var model = this.get('model');\n var x = isNaN(+cfg.x) ? +model.x : +cfg.x;\n var y = isNaN(+cfg.y) ? +model.y : +cfg.y;\n var group = this.get('group');\n\n if (isNaN(x) || isNaN(y)) {\n return false;\n }\n\n model.x = x;\n model.y = y;\n var matrix = group.getMatrix();\n if (matrix && matrix[6] === x && matrix[7] === y) return false;\n group.resetMatrix(); // G 4.0 element 中移除了矩阵相关方法,详见https://www.yuque.com/antv/blog/kxzk9g#4rMMV\n\n (0, _math.translate)(group, {\n x: x,\n y: y\n });\n this.clearCache(); // 位置更新后需要清除缓存\n\n return true;\n };\n /**\n * 获取 item 的包围盒,这个包围盒是相对于 item 自己,不会将 matrix 计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n\n\n ItemBase.prototype.getBBox = function () {\n // 计算 bbox 开销有些大,缓存\n var bbox = this.get(CACHE_BBOX);\n\n if (!bbox) {\n bbox = this.calculateBBox();\n this.set(CACHE_BBOX, bbox);\n }\n\n return bbox;\n };\n /**\n * 获取 item 相对于画布的包围盒,会将从顶层到当前元素的 matrix 都计算在内\n * @return {Object} 包含 x,y,width,height, centerX, centerY\n */\n\n\n ItemBase.prototype.getCanvasBBox = function () {\n // 计算 bbox 开销大,缓存\n var bbox = this.get(CACHE_CANVAS_BBOX);\n\n if (!bbox) {\n bbox = this.calculateCanvasBBox();\n this.set(CACHE_CANVAS_BBOX, bbox);\n }\n\n return bbox;\n };\n /**\n * 将元素放到最前面\n */\n\n\n ItemBase.prototype.toFront = function () {\n var group = this.get('group');\n group.toFront();\n };\n /**\n * 将元素放到最后面\n */\n\n\n ItemBase.prototype.toBack = function () {\n var group = this.get('group');\n group.toBack();\n };\n /**\n * 显示元素\n */\n\n\n ItemBase.prototype.show = function () {\n this.changeVisibility(true);\n };\n /**\n * 隐藏元素\n */\n\n\n ItemBase.prototype.hide = function () {\n this.changeVisibility(false);\n };\n /**\n * 更改是否显示\n * @param {Boolean} visible 是否显示\n */\n\n\n ItemBase.prototype.changeVisibility = function (visible) {\n var group = this.get('group');\n\n if (visible) {\n group.show();\n } else {\n group.hide();\n }\n\n this.set('visible', visible);\n };\n /**\n * 元素是否可见\n * @return {Boolean} 返回该元素是否可见\n */\n\n\n ItemBase.prototype.isVisible = function () {\n return this.get('visible');\n };\n /**\n * 是否拾取及出发该元素的交互事件\n * @param {Boolean} enable 标识位\n */\n\n\n ItemBase.prototype.enableCapture = function (enable) {\n var group = this.get('group');\n\n if (group) {\n group.set('capture', enable);\n }\n };\n\n ItemBase.prototype.destroy = function () {\n if (!this.destroyed) {\n var animate = this.get('animate');\n var group = this.get('group');\n\n if (animate) {\n group.stopAnimate();\n }\n\n group['shapeMap'] = {};\n this.clearCache();\n group.remove();\n this._cfg = null;\n this.destroyed = true;\n }\n };\n\n return ItemBase;\n}();\n\nvar _default = ItemBase;\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/item/item.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _topsort__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./topsort */ \"./node_modules/@antv/graphlib/es/algorithm/topsort.js\");\n\n\nvar isAcyclic = function isAcyclic(graph) {\n try {\n Object(_topsort__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph);\n } catch (e) {\n if (e instanceof _topsort__WEBPACK_IMPORTED_MODULE_0__[\"CycleException\"]) {\n return false;\n }\n\n throw e;\n }\n\n return true;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (isAcyclic);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/is-acyclic.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/util/base.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/util/base.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/postorder.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/postorder.js ***! + \***************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.uniqueId = exports.processParallelEdges = exports.isViewportChanged = exports.isNaN = exports.formatPadding = exports.cloneEvent = exports.calculationItemsBBox = void 0;\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar _behavior = __webpack_require__(/*! ../interface/behavior */ \"./node_modules/@antv/g6-core/lib/interface/behavior.js\");\n\nvar uniqueId = function uniqueId(type) {\n return \"\".concat(type, \"-\").concat(Math.random()).concat(Date.now());\n};\n/**\n * turn padding into [top, right, bottom, right]\n * @param {Number|Array} padding input padding\n * @return {array} output\n */\n\n\nexports.uniqueId = uniqueId;\n\nvar formatPadding = function formatPadding(padding) {\n if ((0, _util.isArray)(padding)) {\n switch (padding.length) {\n case 4:\n return padding;\n\n case 3:\n padding.push(padding[1]);\n return padding;\n\n case 2:\n return padding.concat(padding);\n\n case 1:\n return [padding[0], padding[0], padding[0], padding[0]];\n\n default:\n return [0, 0, 0, 0];\n }\n }\n\n if ((0, _util.isNumber)(padding)) {\n return [padding, padding, padding, padding];\n } else if ((0, _util.isString)(padding)) {\n var intPadding = parseInt(padding, 10);\n return [intPadding, intPadding, intPadding, intPadding];\n }\n\n return [0, 0, 0, 0];\n};\n/**\n * clone event\n * @param e\n */\n\n\nexports.formatPadding = formatPadding;\n\nvar cloneEvent = function cloneEvent(e) {\n var event = new _behavior.G6GraphEvent(e.type, e);\n event.clientX = e.clientX;\n event.clientY = e.clientY;\n event.x = e.x;\n event.y = e.y;\n event.target = e.target;\n event.currentTarget = e.currentTarget;\n event.bubbles = true;\n event.item = e.item;\n return event;\n};\n/**\n * 判断 viewport 是否改变,通过和单位矩阵对比\n * @param matrix Viewport 的 Matrix\n */\n\n\nexports.cloneEvent = cloneEvent;\n\nvar isViewportChanged = function isViewportChanged(matrix) {\n // matrix 为 null, 则说明没有变化\n if (!matrix) {\n return false;\n }\n\n var MATRIX_LEN = 9;\n var ORIGIN_MATRIX = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n for (var i = 0; i < MATRIX_LEN; i++) {\n if (matrix[i] !== ORIGIN_MATRIX[i]) {\n return true;\n }\n }\n\n return false;\n};\n\nexports.isViewportChanged = isViewportChanged;\n\nvar isNaN = function isNaN(input) {\n return Number.isNaN(Number(input));\n};\n/**\n * 计算一组 Item 的 BBox\n * @param items 选中的一组Item,可以是 node 或 combo\n */\n\n\nexports.isNaN = isNaN;\n\nvar calculationItemsBBox = function calculationItemsBBox(items) {\n var minx = Infinity;\n var maxx = -Infinity;\n var miny = Infinity;\n var maxy = -Infinity; // 获取已节点的所有最大最小x y值\n\n for (var i = 0; i < items.length; i++) {\n var element = items[i];\n var bbox = element.getBBox();\n var minX = bbox.minX,\n minY = bbox.minY,\n maxX = bbox.maxX,\n maxY = bbox.maxY;\n\n if (minX < minx) {\n minx = minX;\n }\n\n if (minY < miny) {\n miny = minY;\n }\n\n if (maxX > maxx) {\n maxx = maxX;\n }\n\n if (maxY > maxy) {\n maxy = maxY;\n }\n }\n\n var x = Math.floor(minx);\n var y = Math.floor(miny);\n var width = Math.ceil(maxx) - Math.floor(minx);\n var height = Math.ceil(maxy) - Math.floor(miny);\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n minX: minx,\n minY: miny,\n maxX: maxx,\n maxY: maxy\n };\n};\n/**\n * 若 edges 中存在两端点相同的边,使用 quadratic 边并自动计算 curveOffset 使它们不相互重叠\n * 文档: https://g6.antv.vision/en/docs/api/Util\n * @param edges 边数据集合\n * @param offsetDiff 相邻两边的 offset 之差\n * @param multiEdgeType\n * @param singleEdgeType\n * @param loopEdgeType\n */\n\n\nexports.calculationItemsBBox = calculationItemsBBox;\n\nvar processParallelEdges = function processParallelEdges(edges, offsetDiff, multiEdgeType, singleEdgeType, loopEdgeType) {\n if (offsetDiff === void 0) {\n offsetDiff = 15;\n }\n\n if (multiEdgeType === void 0) {\n multiEdgeType = 'quadratic';\n }\n\n if (singleEdgeType === void 0) {\n singleEdgeType = undefined;\n }\n\n if (loopEdgeType === void 0) {\n loopEdgeType = undefined;\n }\n\n var len = edges.length;\n var cod = offsetDiff * 2;\n var loopPosition = ['top', 'top-right', 'right', 'bottom-right', 'bottom', 'bottom-left', 'left', 'top-left'];\n var edgeMap = {};\n var tags = [];\n var reverses = {};\n\n for (var i = 0; i < len; i++) {\n var edge = edges[i];\n var source = edge.source,\n target = edge.target;\n var sourceTarget = \"\".concat(source, \"-\").concat(target);\n if (tags[i]) continue;\n\n if (!edgeMap[sourceTarget]) {\n edgeMap[sourceTarget] = [];\n }\n\n tags[i] = true;\n edgeMap[sourceTarget].push(edge);\n\n for (var j = 0; j < len; j++) {\n if (i === j) continue;\n var sedge = edges[j];\n var src = sedge.source;\n var dst = sedge.target; // 两个节点之间共同的边\n // 第一条的source = 第二条的target\n // 第一条的target = 第二条的source\n\n if (!tags[j]) {\n if (source === dst && target === src) {\n edgeMap[sourceTarget].push(sedge);\n tags[j] = true;\n reverses[\"\".concat(src, \"|\").concat(dst, \"|\").concat(edgeMap[sourceTarget].length - 1)] = true;\n } else if (source === src && target === dst) {\n edgeMap[sourceTarget].push(sedge);\n tags[j] = true;\n }\n }\n }\n }\n\n for (var key in edgeMap) {\n var arcEdges = edgeMap[key];\n var length_1 = arcEdges.length;\n\n for (var k = 0; k < length_1; k++) {\n var current = arcEdges[k];\n\n if (current.source === current.target) {\n if (loopEdgeType) current.type = loopEdgeType; // 超过8条自环边,则需要重新处理\n\n current.loopCfg = {\n position: loopPosition[k % 8],\n dist: Math.floor(k / 8) * 20 + 50\n };\n continue;\n }\n\n if (length_1 === 1 && singleEdgeType && current.source !== current.target) {\n current.type = singleEdgeType;\n continue;\n }\n\n current.type = multiEdgeType;\n var sign = (k % 2 === 0 ? 1 : -1) * (reverses[\"\".concat(current.source, \"|\").concat(current.target, \"|\").concat(k)] ? -1 : 1);\n\n if (length_1 % 2 === 1) {\n current.curveOffset = sign * Math.ceil(k / 2) * cod;\n } else {\n current.curveOffset = sign * (Math.floor(k / 2) * cod + offsetDiff);\n }\n }\n }\n\n return edges;\n};\n\nexports.processParallelEdges = processParallelEdges;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/util/base.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dfs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs */ \"./node_modules/@antv/graphlib/es/algorithm/dfs.js\");\n\n\nvar postorder = function postorder(graph, nodes) {\n return Object(_dfs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph, nodes, 'post');\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (postorder);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/postorder.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/util/graphic.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/util/graphic.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/preorder.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/preorder.js ***! + \**************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.truncateLabelByLength = exports.traverseTreeUp = exports.traverseTree = exports.shouldRefreshEdge = exports.reconstructTree = exports.plainCombosToTrees = exports.getTextSize = exports.getLoopCfgs = exports.getLetterWidth = exports.getLabelPosition = exports.getComboBBox = exports.getBBox = exports.getAnimateCfgWithCallback = exports.cloneBesidesImg = void 0;\n\nvar _tslib = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n\nvar _matrixUtil = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n\nvar _global = _interopRequireDefault(__webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-core/lib/global.js\"));\n\nvar _math = __webpack_require__(/*! ./math */ \"./node_modules/@antv/g6-core/lib/util/math.js\");\n\nvar _letterAspectRatio = _interopRequireDefault(__webpack_require__(/*! ./letterAspectRatio */ \"./node_modules/@antv/g6-core/lib/util/letterAspectRatio.js\"));\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nfunction _interopRequireDefault(obj) { return obj && obj.__esModule ? obj : { default: obj }; }\n\nvar PI = Math.PI,\n sin = Math.sin,\n cos = Math.cos; // 一共支持8个方向的自环,每个环占的角度是45度,在计算时再二分,为22.5度\n\nvar SELF_LINK_SIN = sin(PI / 8);\nvar SELF_LINK_COS = cos(PI / 8);\n\nvar getBBox = function getBBox(element, group) {\n var bbox = element.getBBox();\n var leftTop = {\n x: bbox.minX,\n y: bbox.minY\n };\n var rightBottom = {\n x: bbox.maxX,\n y: bbox.maxY\n }; // 根据父元素变换矩阵\n\n if (group) {\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n leftTop = (0, _math.applyMatrix)(leftTop, matrix);\n rightBottom = (0, _math.applyMatrix)(rightBottom, matrix);\n }\n\n var lx = leftTop.x,\n ly = leftTop.y;\n var rx = rightBottom.x,\n ry = rightBottom.y;\n return {\n x: lx,\n y: ly,\n minX: lx,\n minY: ly,\n maxX: rx,\n maxY: ry,\n width: rx - lx,\n height: ry - ly\n };\n};\n/**\n * get loop edge config\n * @param cfg edge config\n */\n\n\nexports.getBBox = getBBox;\n\nvar getLoopCfgs = function getLoopCfgs(cfg) {\n var item = cfg.sourceNode || cfg.targetNode;\n var container = item.get('group');\n var containerMatrix = container.getMatrix();\n if (!containerMatrix) containerMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var keyShape = item.getKeyShape();\n var bbox = keyShape.getBBox();\n var loopCfg = cfg.loopCfg || {}; // 距离keyShape边的最高距离\n\n var dist = loopCfg.dist || Math.max(bbox.width, bbox.height) * 2; // 自环边与keyShape的相对位置关系\n\n var position = loopCfg.position || _global.default.defaultLoopPosition; // 中心取group上真实位置\n\n var center = [containerMatrix[6], containerMatrix[7]];\n var startPoint = [cfg.startPoint.x, cfg.startPoint.y];\n var endPoint = [cfg.endPoint.x, cfg.endPoint.y];\n var rstart = bbox.height / 2;\n var rend = bbox.height / 2;\n var sinDeltaStart = rstart * SELF_LINK_SIN;\n var cosDeltaStart = rstart * SELF_LINK_COS;\n var sinDeltaEnd = rend * SELF_LINK_SIN;\n var cosDeltaEnd = rend * SELF_LINK_COS; // 如果定义了锚点的,直接用锚点坐标,否则,根据自环的 cfg 计算\n\n if (startPoint[0] === endPoint[0] && startPoint[1] === endPoint[1]) {\n switch (position) {\n case 'top':\n startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd];\n break;\n\n case 'top-right':\n rstart = bbox.height / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + cosDeltaEnd, center[1] - sinDeltaEnd];\n break;\n\n case 'right':\n rstart = bbox.width / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + cosDeltaStart, center[1] - sinDeltaStart];\n endPoint = [center[0] + cosDeltaEnd, center[1] + sinDeltaEnd];\n break;\n\n case 'bottom-right':\n rstart = bbox.width / 2;\n rend = bbox.height / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + cosDeltaStart, center[1] + sinDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] + cosDeltaEnd];\n break;\n\n case 'bottom':\n rstart = bbox.height / 2;\n rend = bbox.height / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] + sinDeltaStart, center[1] + cosDeltaStart];\n endPoint = [center[0] - sinDeltaEnd, center[1] + cosDeltaEnd];\n break;\n\n case 'bottom-left':\n rstart = bbox.height / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - sinDeltaStart, center[1] + cosDeltaStart];\n endPoint = [center[0] - cosDeltaEnd, center[1] + sinDeltaEnd];\n break;\n\n case 'left':\n rstart = bbox.width / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - cosDeltaStart, center[1] + sinDeltaStart];\n endPoint = [center[0] - cosDeltaEnd, center[1] - sinDeltaEnd];\n break;\n\n case 'top-left':\n rstart = bbox.width / 2;\n rend = bbox.height / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - cosDeltaStart, center[1] - sinDeltaStart];\n endPoint = [center[0] - sinDeltaEnd, center[1] - cosDeltaEnd];\n break;\n\n default:\n rstart = bbox.width / 2;\n rend = bbox.width / 2;\n sinDeltaStart = rstart * SELF_LINK_SIN;\n cosDeltaStart = rstart * SELF_LINK_COS;\n sinDeltaEnd = rend * SELF_LINK_SIN;\n cosDeltaEnd = rend * SELF_LINK_COS;\n startPoint = [center[0] - sinDeltaStart, center[1] - cosDeltaStart];\n endPoint = [center[0] + sinDeltaEnd, center[1] - cosDeltaEnd];\n } // 如果逆时针画,交换起点和终点\n\n\n if (loopCfg.clockwise === false) {\n var swap = [startPoint[0], startPoint[1]];\n startPoint = [endPoint[0], endPoint[1]];\n endPoint = [swap[0], swap[1]];\n }\n }\n\n var startVec = [startPoint[0] - center[0], startPoint[1] - center[1]];\n var scaleRateStart = (rstart + dist) / rstart;\n var scaleRateEnd = (rend + dist) / rend;\n\n if (loopCfg.clockwise === false) {\n scaleRateStart = (rend + dist) / rend;\n scaleRateEnd = (rstart + dist) / rstart;\n }\n\n var startExtendVec = _matrixUtil.vec2.scale([0, 0], startVec, scaleRateStart);\n\n var controlPoint1 = [center[0] + startExtendVec[0], center[1] + startExtendVec[1]];\n var endVec = [endPoint[0] - center[0], endPoint[1] - center[1]];\n\n var endExtendVec = _matrixUtil.vec2.scale([0, 0], endVec, scaleRateEnd);\n\n var controlPoint2 = [center[0] + endExtendVec[0], center[1] + endExtendVec[1]];\n cfg.startPoint = {\n x: startPoint[0],\n y: startPoint[1]\n };\n cfg.endPoint = {\n x: endPoint[0],\n y: endPoint[1]\n };\n cfg.controlPoints = [{\n x: controlPoint1[0],\n y: controlPoint1[1]\n }, {\n x: controlPoint2[0],\n y: controlPoint2[1]\n }];\n return cfg;\n};\n/**\n * 根据 label 所在线条的位置百分比,计算 label 坐标\n * @param {object} pathShape G 的 path 实例,一般是 Edge 实例的 keyShape\n * @param {number} percent 范围 0 - 1 的线条百分比\n * @param {number} refX x 轴正方向为基准的 label 偏移\n * @param {number} refY y 轴正方向为基准的 label 偏移\n * @param {boolean} rotate 是否根据线条斜率旋转文本\n * @return {object} 文本的 x, y, 文本的旋转角度\n */\n\n\nexports.getLoopCfgs = getLoopCfgs;\n\nvar getLabelPosition = function getLabelPosition(pathShape, percent, refX, refY, rotate) {\n var TAN_OFFSET = 0.0001;\n var vector = [];\n var point = pathShape === null || pathShape === void 0 ? void 0 : pathShape.getPoint(percent);\n\n if (!point) {\n return {\n x: 0,\n y: 0,\n angle: 0\n };\n } // 头尾最可能,放在最前面,使用 g path 上封装的方法\n\n\n if (percent < TAN_OFFSET) {\n vector = pathShape.getStartTangent().reverse();\n } else if (percent > 1 - TAN_OFFSET) {\n vector = pathShape.getEndTangent();\n } else {\n // 否则取指定位置的点,与少量偏移的点,做微分向量\n var offsetPoint = pathShape === null || pathShape === void 0 ? void 0 : pathShape.getPoint(percent + TAN_OFFSET);\n vector.push([point.x, point.y]);\n vector.push([offsetPoint.x, offsetPoint.y]);\n }\n\n var rad = Math.atan2(vector[1][1] - vector[0][1], vector[1][0] - vector[0][0]);\n\n if (rad < 0) {\n rad += PI * 2;\n }\n\n if (refX) {\n point.x += cos(rad) * refX;\n point.y += sin(rad) * refX;\n }\n\n if (refY) {\n // 默认方向是 x 轴正方向,法线是 求出角度 - 90°\n var normal = rad - PI / 2; // 若法线角度在 y 轴负方向,切到正方向,保证 refY 相对于 y 轴正方向\n\n if (rad > 1 / 2 * PI && rad < 3 * 1 / 2 * PI) {\n normal -= PI;\n }\n\n point.x += cos(normal) * refY;\n point.y += sin(normal) * refY;\n }\n\n var result = {\n x: point.x,\n y: point.y,\n angle: rad\n };\n\n if (rotate) {\n if (rad > 0.5 * PI && rad < 1.5 * PI) {\n rad -= PI;\n }\n\n return (0, _tslib.__assign)({\n rotate: rad\n }, result);\n }\n\n return result;\n};\n/**\n * depth first traverse, from root to leaves, children in inverse order\n * if the fn returns false, terminate the traverse\n */\n\n\nexports.getLabelPosition = getLabelPosition;\n\nvar traverse = function traverse(data, fn) {\n if (fn(data) === false) {\n return false;\n }\n\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverse(data.children[i], fn)) return false;\n }\n }\n\n return true;\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\n\n\nvar traverseUp = function traverseUp(data, fn) {\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverseUp(data.children[i], fn)) return;\n }\n }\n\n if (fn(data) === false) {\n return false;\n }\n\n return true;\n};\n/**\n * depth first traverse, from root to leaves, children in inverse order\n * if the fn returns false, terminate the traverse\n */\n\n\nvar traverseTree = function traverseTree(data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n\n traverse(data, fn);\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\n\n\nexports.traverseTree = traverseTree;\n\nvar traverseTreeUp = function traverseTreeUp(data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n\n traverseUp(data, fn);\n};\n/**\n *\n * @param letter the letter\n * @param fontSize\n * @return the letter's width\n */\n\n\nexports.traverseTreeUp = traverseTreeUp;\n\nvar getLetterWidth = function getLetterWidth(letter, fontSize) {\n return fontSize * (_letterAspectRatio.default[letter] || 1);\n};\n/**\n *\n * @param text the text\n * @param fontSize\n * @return the text's size\n */\n\n\nexports.getLetterWidth = getLetterWidth;\n\nvar getTextSize = function getTextSize(text, fontSize) {\n var width = 0;\n var pattern = new RegExp(\"[\\u4E00-\\u9FA5]+\");\n text.split('').forEach(function (letter) {\n if (pattern.test(letter)) {\n // 中文字符\n width += fontSize;\n } else {\n width += getLetterWidth(letter, fontSize);\n }\n });\n return [width, fontSize];\n};\n\nexports.getTextSize = getTextSize;\n\nvar truncateLabelByLength = function truncateLabelByLength(text, length) {\n if (typeof length !== 'number' || length <= 0 || length >= text.length) {\n return text;\n }\n\n return text.substring(0, length) + '...';\n};\n/**\n * construct the trees from combos data\n * @param array the combos array\n * @param nodes the nodes array\n * @return the tree\n */\n\n\nexports.truncateLabelByLength = truncateLabelByLength;\n\nvar plainCombosToTrees = function plainCombosToTrees(array, nodes) {\n var result = [];\n var addedMap = {};\n var modelMap = {};\n array.forEach(function (d) {\n modelMap[d.id] = d;\n });\n array.forEach(function (d, i) {\n var cd = (0, _util.clone)(d);\n cd.itemType = 'combo';\n cd.children = undefined;\n\n if (cd.parentId === cd.id) {\n console.warn(\"The parentId for combo \".concat(cd.id, \" can not be the same as the combo's id\"));\n delete cd.parentId;\n } else if (cd.parentId && !modelMap[cd.parentId]) {\n console.warn(\"The parent combo for combo \".concat(cd.id, \" does not exist!\"));\n delete cd.parentId;\n }\n\n var mappedObj = addedMap[cd.id];\n\n if (mappedObj) {\n cd.children = mappedObj.children;\n addedMap[cd.id] = cd;\n mappedObj = cd;\n\n if (!mappedObj.parentId) {\n result.push(mappedObj);\n return;\n }\n\n var mappedParent = addedMap[mappedObj.parentId];\n\n if (mappedParent) {\n if (mappedParent.children) mappedParent.children.push(cd);else mappedParent.children = [cd];\n } else {\n var parent_1 = {\n id: mappedObj.parentId,\n children: [mappedObj]\n };\n addedMap[mappedObj.parentId] = parent_1;\n addedMap[cd.id] = cd;\n }\n\n return;\n }\n\n if ((0, _util.isString)(d.parentId)) {\n var parent_2 = addedMap[d.parentId];\n\n if (parent_2) {\n if (parent_2.children) parent_2.children.push(cd);else parent_2.children = [cd];\n addedMap[cd.id] = cd;\n } else {\n var pa = {\n id: d.parentId,\n children: [cd]\n };\n addedMap[pa.id] = pa;\n addedMap[cd.id] = cd;\n }\n } else {\n result.push(cd);\n addedMap[cd.id] = cd;\n }\n }); // proccess the nodes\n\n var nodeMap = {};\n (nodes || []).forEach(function (node) {\n nodeMap[node.id] = node;\n var combo = addedMap[node.comboId];\n\n if (combo) {\n var cnode = {\n id: node.id,\n comboId: node.comboId\n };\n if (combo.children) combo.children.push(cnode);else combo.children = [cnode];\n cnode.itemType = 'node';\n addedMap[node.id] = cnode;\n }\n }); // assign the depth for each element\n\n var maxDepth = 0;\n result.forEach(function (tree) {\n tree.depth = maxDepth + 10;\n traverse(tree, function (child) {\n var parent;\n var itemType = addedMap[child.id].itemType;\n\n if (itemType === 'node') {\n parent = addedMap[child.comboId];\n } else {\n parent = addedMap[child.parentId];\n }\n\n if (parent) {\n if (itemType === 'node') child.depth = maxDepth + 1;else child.depth = maxDepth + 10;\n } else {\n child.depth = maxDepth + 10;\n }\n\n if (maxDepth < child.depth) maxDepth = child.depth;\n var oriNodeModel = nodeMap[child.id];\n\n if (oriNodeModel) {\n oriNodeModel.depth = child.depth;\n }\n\n return true;\n });\n });\n return result;\n};\n\nexports.plainCombosToTrees = plainCombosToTrees;\n\nvar reconstructTree = function reconstructTree(trees, subtreeId, newParentId) {\n var _a;\n\n var brothers = trees;\n var subtree;\n var comboChildsMap = {\n root: {\n children: trees\n }\n };\n var foundSubTree = false;\n var oldParentId = 'root';\n (trees || []).forEach(function (tree) {\n if (foundSubTree) return;\n\n if (tree.id === subtreeId) {\n subtree = tree;\n\n if (tree.itemType === 'combo') {\n subtree.parentId = newParentId;\n } else {\n subtree.comboId = newParentId;\n }\n\n foundSubTree = true;\n return;\n }\n\n traverseTree(tree, function (child) {\n var _a;\n\n comboChildsMap[child.id] = {\n children: (child === null || child === void 0 ? void 0 : child.children) || []\n }; // store the old parent id to delete the subtree from the old parent's children in next recursion\n\n brothers = (_a = comboChildsMap[child.parentId || child.comboId || 'root']) === null || _a === void 0 ? void 0 : _a.children;\n\n if (child && (child.removed || subtreeId === child.id) && brothers) {\n oldParentId = child.parentId || child.comboId || 'root';\n subtree = child; // re-assign the parentId or comboId for the moved subtree\n\n if (child.itemType === 'combo') {\n subtree.parentId = newParentId;\n } else {\n subtree.comboId = newParentId;\n }\n\n foundSubTree = true;\n return false;\n }\n\n return true;\n });\n });\n brothers = (_a = comboChildsMap[oldParentId]) === null || _a === void 0 ? void 0 : _a.children;\n var index = brothers ? brothers.indexOf(subtree) : -1;\n if (index > -1) brothers.splice(index, 1); // 如果遍历完整棵树还没有找到,说明之前就不在树中\n\n if (!foundSubTree) {\n subtree = {\n id: subtreeId,\n itemType: 'node',\n comboId: newParentId\n };\n comboChildsMap[subtreeId] = {\n children: undefined\n };\n } // append to new parent\n\n\n if (subtreeId) {\n var found_1 = false; // newParentId is undefined means the subtree will have no parent\n\n if (newParentId) {\n var newParentDepth_1 = 0;\n (trees || []).forEach(function (tree) {\n if (found_1) return; // terminate\n\n traverseTree(tree, function (child) {\n // append subtree to the new parent ans assign the depth to the subtree\n if (newParentId === child.id) {\n found_1 = true;\n if (child.children) child.children.push(subtree);else child.children = [subtree];\n newParentDepth_1 = child.depth;\n if (subtree.itemType === 'node') subtree.depth = newParentDepth_1 + 2;else subtree.depth = newParentDepth_1 + 1;\n return false; // terminate\n }\n\n return true;\n });\n });\n } else if ((!newParentId || !found_1) && subtree.itemType !== 'node') {\n // if the newParentId is undefined or it is not found in the tree, add the subTree to the root\n trees.push(subtree);\n } // update the depth of the subtree and its children from the subtree\n\n\n var currentDepth_1 = subtree.depth;\n traverseTree(subtree, function (child) {\n if (child.itemType === 'node') currentDepth_1 += 2;else currentDepth_1 += 1;\n child.depth = currentDepth_1;\n return true;\n });\n }\n\n return trees;\n};\n\nexports.reconstructTree = reconstructTree;\n\nvar getComboBBox = function getComboBBox(children, graph, combo) {\n var comboBBox = {\n minX: Infinity,\n minY: Infinity,\n maxX: -Infinity,\n maxY: -Infinity,\n x: undefined,\n y: undefined,\n width: undefined,\n height: undefined,\n centerX: undefined,\n centerY: undefined\n };\n\n if (!children || children.length === 0) {\n var comboModel = combo === null || combo === void 0 ? void 0 : combo.getModel();\n\n var _a = comboModel || {},\n x = _a.x,\n y = _a.y;\n\n return {\n minX: x,\n minY: y,\n maxX: x,\n maxY: y,\n x: x,\n y: y,\n width: undefined,\n height: undefined\n };\n }\n\n children.forEach(function (child) {\n var childItem = graph.findById(child.id);\n if (!childItem || !childItem.isVisible()) return; // ignore hidden children\n\n childItem.set('bboxCanvasCache', undefined);\n var childBBox = childItem.getCanvasBBox();\n if (childBBox.x && comboBBox.minX > childBBox.minX) comboBBox.minX = childBBox.minX;\n if (childBBox.y && comboBBox.minY > childBBox.minY) comboBBox.minY = childBBox.minY;\n if (childBBox.x && comboBBox.maxX < childBBox.maxX) comboBBox.maxX = childBBox.maxX;\n if (childBBox.y && comboBBox.maxY < childBBox.maxY) comboBBox.maxY = childBBox.maxY;\n });\n comboBBox.x = (comboBBox.minX + comboBBox.maxX) / 2;\n comboBBox.y = (comboBBox.minY + comboBBox.maxY) / 2;\n comboBBox.width = comboBBox.maxX - comboBBox.minX;\n comboBBox.height = comboBBox.maxY - comboBBox.minY;\n comboBBox.centerX = (comboBBox.minX + comboBBox.maxX) / 2;\n comboBBox.centerY = (comboBBox.minY + comboBBox.maxY) / 2;\n Object.keys(comboBBox).forEach(function (key) {\n if (comboBBox[key] === Infinity || comboBBox[key] === -Infinity) {\n comboBBox[key] = undefined;\n }\n });\n return comboBBox;\n};\n\nexports.getComboBBox = getComboBBox;\n\nvar shouldRefreshEdge = function shouldRefreshEdge(cfg) {\n var refreshEdge = (0, _util.isNumber)(cfg.x) || (0, _util.isNumber)(cfg.y) || cfg.type || cfg.anchorPoints || cfg.size;\n if (cfg.style) refreshEdge = refreshEdge || (0, _util.isNumber)(cfg.style.r) || (0, _util.isNumber)(cfg.style.width) || (0, _util.isNumber)(cfg.style.height) || (0, _util.isNumber)(cfg.style.rx) || (0, _util.isNumber)(cfg.style.ry);\n return refreshEdge;\n};\n\nexports.shouldRefreshEdge = shouldRefreshEdge;\n\nvar cloneBesidesImg = function cloneBesidesImg(obj) {\n var clonedObj = {};\n Object.keys(obj).forEach(function (key1) {\n var obj2 = obj[key1];\n\n if ((0, _util.isObject)(obj2) && !(0, _util.isArray)(obj2)) {\n var clonedObj2_1 = {};\n Object.keys(obj2).forEach(function (key2) {\n var v = obj2[key2];\n if (key2 === 'img' && !(0, _util.isString)(v)) return;\n clonedObj2_1[key2] = (0, _util.clone)(v);\n });\n clonedObj[key1] = clonedObj2_1;\n } else {\n clonedObj[key1] = (0, _util.clone)(obj2);\n }\n });\n return clonedObj;\n};\n\nexports.cloneBesidesImg = cloneBesidesImg;\n\nvar getAnimateCfgWithCallback = function getAnimateCfgWithCallback(_a) {\n var animateCfg = _a.animateCfg,\n callback = _a.callback;\n var animateConfig;\n\n if (!animateCfg) {\n animateConfig = {\n duration: 500,\n callback: callback\n };\n } else {\n animateConfig = (0, _util.clone)(animateCfg);\n\n if (animateCfg.callback) {\n var animateCfgCallback_1 = animateCfg.callback;\n\n animateConfig.callback = function () {\n callback();\n animateCfgCallback_1();\n };\n } else {\n animateConfig.callback = callback;\n }\n }\n\n return animateConfig;\n};\n\nexports.getAnimateCfgWithCallback = getAnimateCfgWithCallback;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/util/graphic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dfs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs */ \"./node_modules/@antv/graphlib/es/algorithm/dfs.js\");\n\n\nvar preorder = function preorder(graph, nodes) {\n return Object(_dfs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph, nodes, 'pre');\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (preorder);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/preorder.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/util/letterAspectRatio.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/util/letterAspectRatio.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/prim.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/prim.js ***! + \**********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.default = void 0;\nvar _default = {\n ' ': 0.3329986572265625,\n a: 0.5589996337890625,\n A: 0.6569992065429687,\n b: 0.58599853515625,\n B: 0.6769989013671875,\n c: 0.5469985961914062,\n C: 0.7279998779296875,\n d: 0.58599853515625,\n D: 0.705999755859375,\n e: 0.554998779296875,\n E: 0.63699951171875,\n f: 0.37299957275390627,\n F: 0.5769989013671875,\n g: 0.5909988403320312,\n G: 0.7479995727539063,\n h: 0.555999755859375,\n H: 0.7199996948242188,\n i: 0.255999755859375,\n I: 0.23699951171875,\n j: 0.26699981689453123,\n J: 0.5169998168945312,\n k: 0.5289993286132812,\n K: 0.6899993896484375,\n l: 0.23499908447265624,\n L: 0.5879989624023437,\n m: 0.854998779296875,\n M: 0.8819992065429687,\n n: 0.5589996337890625,\n N: 0.7189987182617188,\n o: 0.58599853515625,\n O: 0.7669998168945312,\n p: 0.58599853515625,\n P: 0.6419998168945312,\n q: 0.58599853515625,\n Q: 0.7669998168945312,\n r: 0.3649993896484375,\n R: 0.6759994506835938,\n s: 0.504998779296875,\n S: 0.6319992065429687,\n t: 0.354998779296875,\n T: 0.6189987182617187,\n u: 0.5599990844726562,\n U: 0.7139999389648437,\n v: 0.48199920654296874,\n V: 0.6389999389648438,\n w: 0.754998779296875,\n W: 0.929998779296875,\n x: 0.5089996337890625,\n X: 0.63699951171875,\n y: 0.4959991455078125,\n Y: 0.66199951171875,\n z: 0.48699951171875,\n Z: 0.6239990234375,\n '0': 0.6,\n '1': 0.40099945068359377,\n '2': 0.6,\n '3': 0.6,\n '4': 0.6,\n '5': 0.6,\n '6': 0.6,\n '7': 0.5469985961914062,\n '8': 0.6,\n '9': 0.6,\n '[': 0.3329986572265625,\n ']': 0.3329986572265625,\n ',': 0.26399993896484375,\n '.': 0.26399993896484375,\n ';': 0.26399993896484375,\n ':': 0.26399993896484375,\n '{': 0.3329986572265625,\n '}': 0.3329986572265625,\n '\\\\': 0.5,\n '|': 0.19499969482421875,\n '=': 0.604998779296875,\n '+': 0.604998779296875,\n '-': 0.604998779296875,\n _: 0.5,\n '`': 0.3329986572265625,\n ' ~': 0.8329986572265625,\n '!': 0.3329986572265625,\n '@': 0.8579986572265625,\n '#': 0.6,\n $: 0.6,\n '%': 0.9699996948242188,\n '^': 0.517999267578125,\n '&': 0.7259994506835937,\n '*': 0.505999755859375,\n '(': 0.3329986572265625,\n ')': 0.3329986572265625,\n '<': 0.604998779296875,\n '>': 0.604998779296875,\n '/': 0.5,\n '?': 0.53699951171875\n};\nexports.default = _default;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/util/letterAspectRatio.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Graph */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\n/* harmony import */ var _PriorityQueue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PriorityQueue */ \"./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js\");\n\n\n\nvar prim = function prim(graph, weightFn) {\n var result = new _Graph__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n var parents = new Map();\n var pq = new _PriorityQueue__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n var v;\n\n function updateNeighbors(edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var pri = pq.priority(w);\n\n if (pri !== undefined) {\n var edgeWeight = weightFn(edge);\n\n if (edgeWeight < pri) {\n parents.set(w, v);\n pq.decrease(w, edgeWeight);\n }\n }\n }\n\n if (graph.nodeCount() === 0) {\n return result;\n }\n\n graph.nodes().forEach(function (node) {\n pq.add(node, Number.POSITIVE_INFINITY);\n result.setNode(node);\n }); // Start from an arbitrary node\n\n pq.decrease(graph.nodes()[0], 0);\n var init = false;\n\n while (pq.size() > 0) {\n var _graph$nodeEdges;\n\n v = pq.removeMin();\n\n if (parents.has(v)) {\n result.setEdge(v, parents.get(v));\n } else if (init) {\n throw new Error('Input graph is not connected: ' + graph.graph());\n } else {\n init = true;\n }\n\n (_graph$nodeEdges = graph.nodeEdges(v)) === null || _graph$nodeEdges === void 0 ? void 0 : _graph$nodeEdges.forEach(updateNeighbors);\n }\n\n return result;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (prim);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/prim.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-core/lib/util/math.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/g6-core/lib/util/math.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/graphlib/es/algorithm/tarjan.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/tarjan.js ***! + \************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nObject.defineProperty(exports, \"__esModule\", {\n value: true\n});\nexports.translate = exports.squareDist = exports.scaleMatrix = exports.scale = exports.rotate = exports.pointRectSquareDist = exports.pointLineSquareDist = exports.pointLineDistance = exports.move = exports.lerpArray = exports.lerp = exports.itemIntersectByLine = exports.isPolygonsIntersect = exports.isPointsOverlap = exports.isPointInPolygon = exports.invertMatrix = exports.intersectBBox = exports.getRectIntersectByPoint = exports.getPointsCenter = exports.getLineIntersect = exports.getEllipseIntersectByPoint = exports.getDegree = exports.getCircleIntersectByPoint = exports.getCircleCenterByPoints = exports.getBBoxBoundLine = exports.getAdjMatrix = exports.fractionToLine = exports.floydWarshall = exports.distance = exports.compare = exports.applyMatrix = exports.Line = void 0;\n\nvar _matrixUtil = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n\nvar _util = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar transform = _matrixUtil.ext.transform;\n/**\n * 对比对象,用于对象数组排序\n * @param {string} attributeName 排序依据的字段名称\n * @param {number} min 最小值\n * @param {number} max 最大值\n * @return {boolean} bool 布尔\n */\n\nvar compare = function compare(attributeName) {\n return function (m, n) {\n return m[attributeName] - n[attributeName];\n };\n};\n/**\n * 是否在区间内\n * @param {number} value 值\n * @param {number} min 最小值\n * @param {number} max 最大值\n * @return {boolean} bool 布尔\n */\n\n\nexports.compare = compare;\n\nvar isBetween = function isBetween(value, min, max) {\n return value >= min && value <= max;\n};\n/**\n * 获取两条线段的交点\n * @param {Point} p0 第一条线段起点\n * @param {Point} p1 第一条线段终点\n * @param {Point} p2 第二条线段起点\n * @param {Point} p3 第二条线段终点\n * @return {Point} 交点\n */\n\n\nvar getLineIntersect = function getLineIntersect(p0, p1, p2, p3) {\n var tolerance = 0.0001;\n var E = {\n x: p2.x - p0.x,\n y: p2.y - p0.y\n };\n var D0 = {\n x: p1.x - p0.x,\n y: p1.y - p0.y\n };\n var D1 = {\n x: p3.x - p2.x,\n y: p3.y - p2.y\n };\n var kross = D0.x * D1.y - D0.y * D1.x;\n var sqrKross = kross * kross;\n var invertKross = 1 / kross;\n var sqrLen0 = D0.x * D0.x + D0.y * D0.y;\n var sqrLen1 = D1.x * D1.x + D1.y * D1.y;\n\n if (sqrKross > tolerance * sqrLen0 * sqrLen1) {\n var s = (E.x * D1.y - E.y * D1.x) * invertKross;\n var t = (E.x * D0.y - E.y * D0.x) * invertKross;\n if (!isBetween(s, 0, 1) || !isBetween(t, 0, 1)) return null;\n return {\n x: p0.x + s * D0.x,\n y: p0.y + s * D0.y\n };\n }\n\n return null;\n};\n/**\n * point and rectangular intersection point\n * @param {IRect} rect rect\n * @param {Point} point point\n * @return {PointPoint} rst;\n */\n\n\nexports.getLineIntersect = getLineIntersect;\n\nvar getRectIntersectByPoint = function getRectIntersectByPoint(rect, point) {\n var x = rect.x,\n y = rect.y,\n width = rect.width,\n height = rect.height;\n var cx = x + width / 2;\n var cy = y + height / 2;\n var points = [];\n var center = {\n x: cx,\n y: cy\n };\n points.push({\n x: x,\n y: y\n });\n points.push({\n x: x + width,\n y: y\n });\n points.push({\n x: x + width,\n y: y + height\n });\n points.push({\n x: x,\n y: y + height\n });\n points.push({\n x: x,\n y: y\n });\n var rst = null;\n\n for (var i = 1; i < points.length; i++) {\n rst = getLineIntersect(points[i - 1], points[i], center, point);\n\n if (rst) {\n break;\n }\n }\n\n return rst;\n};\n/**\n * get point and circle inIntersect\n * @param {ICircle} circle 圆点,x,y,r\n * @param {Point} point 点 x,y\n * @return {Point} applied point\n */\n\n\nexports.getRectIntersectByPoint = getRectIntersectByPoint;\n\nvar getCircleIntersectByPoint = function getCircleIntersectByPoint(circle, point) {\n var cx = circle.x,\n cy = circle.y,\n r = circle.r;\n var x = point.x,\n y = point.y;\n var dx = x - cx;\n var dy = y - cy;\n\n if (dx * dx + dy * dy < r * r) {\n return null;\n }\n\n var angle = Math.atan(dy / dx);\n return {\n x: cx + Math.abs(r * Math.cos(angle)) * Math.sign(dx),\n y: cy + Math.abs(r * Math.sin(angle)) * Math.sign(dy)\n };\n};\n/**\n * get point and ellipse inIntersect\n * @param {Object} ellipse 椭圆 x,y,rx,ry\n * @param {Object} point 点 x,y\n * @return {object} applied point\n */\n\n\nexports.getCircleIntersectByPoint = getCircleIntersectByPoint;\n\nvar getEllipseIntersectByPoint = function getEllipseIntersectByPoint(ellipse, point) {\n var a = ellipse.rx;\n var b = ellipse.ry;\n var cx = ellipse.x;\n var cy = ellipse.y;\n var dx = point.x - cx;\n var dy = point.y - cy; // 直接通过 x,y 求夹角,求出来的范围是 -PI, PI\n\n var angle = Math.atan2(dy / b, dx / a);\n\n if (angle < 0) {\n angle += 2 * Math.PI; // 转换到 0,2PI\n }\n\n return {\n x: cx + a * Math.cos(angle),\n y: cy + b * Math.sin(angle)\n };\n};\n/**\n * coordinate matrix transformation\n * @param {number} point coordinate\n * @param {Matrix} matrix matrix\n * @param {number} tag could be 0 or 1\n * @return {Point} transformed point\n */\n\n\nexports.getEllipseIntersectByPoint = getEllipseIntersectByPoint;\n\nvar applyMatrix = function applyMatrix(point, matrix, tag) {\n if (tag === void 0) {\n tag = 1;\n }\n\n var vector = [point.x, point.y, tag];\n\n if (!matrix || isNaN(matrix[0])) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n _matrixUtil.vec3.transformMat3(vector, vector, matrix);\n\n return {\n x: vector[0],\n y: vector[1]\n };\n};\n/**\n * coordinate matrix invert transformation\n * @param {number} point coordinate\n * @param {number} matrix matrix\n * @param {number} tag could be 0 or 1\n * @return {object} transformed point\n */\n\n\nexports.applyMatrix = applyMatrix;\n\nvar invertMatrix = function invertMatrix(point, matrix, tag) {\n if (tag === void 0) {\n tag = 1;\n }\n\n if (!matrix || isNaN(matrix[0])) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var inversedMatrix = _matrixUtil.mat3.invert([1, 0, 0, 0, 1, 0, 0, 0, 1], matrix);\n\n if (!inversedMatrix) {\n inversedMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var vector = [point.x, point.y, tag];\n\n _matrixUtil.vec3.transformMat3(vector, vector, inversedMatrix);\n\n return {\n x: vector[0],\n y: vector[1]\n };\n};\n/**\n *\n * @param p1 First coordinate\n * @param p2 second coordinate\n * @param p3 three coordinate\n */\n\n\nexports.invertMatrix = invertMatrix;\n\nvar getCircleCenterByPoints = function getCircleCenterByPoints(p1, p2, p3) {\n var a = p1.x - p2.x;\n var b = p1.y - p2.y;\n var c = p1.x - p3.x;\n var d = p1.y - p3.y;\n var e = (p1.x * p1.x - p2.x * p2.x - p2.y * p2.y + p1.y * p1.y) / 2;\n var f = (p1.x * p1.x - p3.x * p3.x - p3.y * p3.y + p1.y * p1.y) / 2;\n var denominator = b * c - a * d;\n return {\n x: -(d * e - b * f) / denominator,\n y: -(a * f - c * e) / denominator\n };\n};\n/**\n * get distance by two points\n * @param p1 first point\n * @param p2 second point\n */\n\n\nexports.getCircleCenterByPoints = getCircleCenterByPoints;\n\nvar distance = function distance(p1, p2) {\n var vx = p1.x - p2.x;\n var vy = p1.y - p2.y;\n return Math.sqrt(vx * vx + vy * vy);\n};\n/**\n * scale matrix\n * @param matrix [ [], [], [] ]\n * @param ratio\n */\n\n\nexports.distance = distance;\n\nvar scaleMatrix = function scaleMatrix(matrix, ratio) {\n var result = [];\n matrix.forEach(function (row) {\n var newRow = [];\n row.forEach(function (v) {\n newRow.push(v * ratio);\n });\n result.push(newRow);\n });\n return result;\n};\n/**\n * Floyd Warshall algorithm for shortest path distances matrix\n * @param {array} adjMatrix adjacency matrix\n * @return {array} distances shortest path distances matrix\n */\n\n\nexports.scaleMatrix = scaleMatrix;\n\nvar floydWarshall = function floydWarshall(adjMatrix) {\n // initialize\n var dist = [];\n var size = adjMatrix.length;\n\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n } else if (adjMatrix[i][j] === 0 || !adjMatrix[i][j]) {\n dist[i][j] = Infinity;\n } else {\n dist[i][j] = adjMatrix[i][j];\n }\n }\n } // floyd\n\n\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n\n return dist;\n};\n/**\n * get adjacency matrix\n * @param data graph data\n * @param directed whether it's a directed graph\n */\n\n\nexports.floydWarshall = floydWarshall;\n\nvar getAdjMatrix = function getAdjMatrix(data, directed) {\n var nodes = data.nodes,\n edges = data.edges;\n var matrix = []; // map node with index in data.nodes\n\n var nodeMap = {};\n\n if (!nodes) {\n throw new Error('invalid nodes data!');\n }\n\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n\n if (edges) {\n edges.forEach(function (e) {\n var source = e.source,\n target = e.target;\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n matrix[sIndex][tIndex] = 1;\n\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n\n return matrix;\n};\n/**\n * 平移group\n * @param group Group 实例\n * @param vec 移动向量\n */\n\n\nexports.getAdjMatrix = getAdjMatrix;\n\nvar translate = function translate(group, vec) {\n group.translate(vec.x, vec.y);\n};\n/**\n * 移动到指定坐标点\n * @param group Group 实例\n * @param point 移动到的坐标点\n */\n\n\nexports.translate = translate;\n\nvar move = function move(group, point, animate, animateCfg) {\n if (animateCfg === void 0) {\n animateCfg = {\n duration: 500\n };\n }\n\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var bbox = group.getCanvasBBox();\n var vx = point.x - bbox.minX;\n var vy = point.y - bbox.minY;\n\n if (animate) {\n var dx_1 = vx * matrix[0];\n var dy_1 = vy * matrix[4];\n var lastX_1 = 0;\n var lastY_1 = 0;\n var newX_1 = 0;\n var newY_1 = 0;\n group.animate(function (ratio) {\n newX_1 = dx_1 * ratio;\n newY_1 = dy_1 * ratio;\n matrix = transform(matrix, [['t', newX_1 - lastX_1, newY_1 - lastY_1]]);\n lastX_1 = newX_1;\n lastY_1 = newY_1;\n return {\n matrix: matrix\n };\n }, animateCfg);\n } else {\n var movedMatrix = transform(matrix, [['t', vx, vy]]);\n group.setMatrix(movedMatrix);\n }\n};\n/**\n * 缩放 group\n * @param group Group 实例\n * @param point 在x 和 y 方向上的缩放比例\n */\n\n\nexports.move = move;\n\nvar scale = function scale(group, ratio) {\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n var scaleXY = ratio;\n\n if (!(0, _util.isArray)(ratio)) {\n scaleXY = [ratio, ratio];\n }\n\n if ((0, _util.isArray)(ratio) && ratio.length === 1) {\n scaleXY = [ratio[0], ratio[0]];\n }\n\n matrix = transform(matrix, [['s', scaleXY[0], scaleXY[1]]]);\n group.setMatrix(matrix);\n};\n/**\n *\n * @param group Group 实例\n * @param ratio 选择角度\n */\n\n\nexports.scale = scale;\n\nvar rotate = function rotate(group, angle) {\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n matrix = transform(matrix, [['r', angle]]);\n group.setMatrix(matrix);\n};\n\nexports.rotate = rotate;\n\nvar getDegree = function getDegree(n, nodeIdxMap, edges) {\n var degrees = [];\n\n for (var i = 0; i < n; i++) {\n degrees[i] = 0;\n }\n\n edges.forEach(function (e) {\n if (e.source) {\n degrees[nodeIdxMap[e.source]] += 1;\n }\n\n if (e.target) {\n degrees[nodeIdxMap[e.target]] += 1;\n }\n });\n return degrees;\n}; // 判断点Q是否在p1和p2的线段上\n\n\nexports.getDegree = getDegree;\n\nfunction onSegment(p1, p2, q) {\n 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])) {\n return true;\n }\n\n return false;\n}\n/**\n * 判断点P在多边形内-射线法. Borrow from https://github.com/antvis/util/blob/master/packages/path-util/src/point-in-polygon.ts\n * @param points\n * @param x\n * @param y\n */\n\n\nvar isPointInPolygon = function isPointInPolygon(points, x, y) {\n var isHit = false;\n var n = points.length; // 判断两个double在eps精度下的大小关系\n\n var tolerance = 1e-6;\n\n function dcmp(xValue) {\n if (Math.abs(xValue) < tolerance) {\n return 0;\n }\n\n return xValue < 0 ? -1 : 1;\n }\n\n if (n <= 2) {\n // svg 中点小于 3 个时,不显示,也无法被拾取\n return false;\n }\n\n for (var i = 0; i < n; i++) {\n var p1 = points[i];\n var p2 = points[(i + 1) % n];\n\n if (onSegment(p1, p2, [x, y])) {\n // 点在多边形一条边上\n return true;\n } // 前一个判断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) {\n isHit = !isHit;\n }\n }\n\n return isHit;\n}; // 判断两个BBox是否相交\n\n\nexports.isPointInPolygon = isPointInPolygon;\n\nvar intersectBBox = function intersectBBox(box1, box2) {\n return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);\n};\n\nexports.intersectBBox = intersectBBox;\n\nvar lineIntersectPolygon = function lineIntersectPolygon(lines, line) {\n var isIntersect = false;\n (0, _util.each)(lines, function (l) {\n if (getLineIntersect(l.from, l.to, line.from, line.to)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n};\n/**\n * 判断两个polygon是否相交。\n * borrow from @antv/path-util\n * @param points1 polygon1的顶点数组\n * @param points2 polygon2的顶点数组\n */\n\n\nvar isPolygonsIntersect = function isPolygonsIntersect(points1, points2) {\n var getBBox = function getBBox(points) {\n var xArr = points.map(function (p) {\n return p[0];\n });\n var yArr = points.map(function (p) {\n return p[1];\n });\n return {\n minX: Math.min.apply(null, xArr),\n maxX: Math.max.apply(null, xArr),\n minY: Math.min.apply(null, yArr),\n maxY: Math.max.apply(null, yArr)\n };\n };\n\n var parseToLines = function parseToLines(points) {\n var lines = [];\n var count = points.length;\n\n for (var i = 0; i < count - 1; i++) {\n var point = points[i];\n var next = points[i + 1];\n lines.push({\n from: {\n x: point[0],\n y: point[1]\n },\n to: {\n x: next[0],\n y: next[1]\n }\n });\n }\n\n if (lines.length > 1) {\n var first = points[0];\n var last = points[count - 1];\n lines.push({\n from: {\n x: last[0],\n y: last[1]\n },\n to: {\n x: first[0],\n y: first[1]\n }\n });\n }\n\n return lines;\n }; // 空数组,或者一个点返回 false\n\n\n if (points1.length < 2 || points2.length < 2) {\n return false;\n }\n\n var bbox1 = getBBox(points1);\n var bbox2 = getBBox(points2); // 判定包围盒是否相交,比判定点是否在多边形内要快的多,可以筛选掉大多数情况\n\n if (!intersectBBox(bbox1, bbox2)) {\n return false;\n }\n\n var isIn = false; // 判定点是否在多边形内部,一旦有一个点在另一个多边形内,则返回\n\n (0, _util.each)(points2, function (point) {\n if (isPointInPolygon(points1, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n\n if (isIn) {\n return true;\n }\n\n (0, _util.each)(points1, function (point) {\n if (isPointInPolygon(points2, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n\n if (isIn) {\n return true;\n }\n\n var lines1 = parseToLines(points1);\n var lines2 = parseToLines(points2);\n var isIntersect = false;\n (0, _util.each)(lines2, function (line) {\n if (lineIntersectPolygon(lines1, line)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n};\n\nexports.isPolygonsIntersect = isPolygonsIntersect;\n\nvar Line =\n/** @class */\nfunction () {\n function Line(x1, y1, x2, y2) {\n this.x1 = x1;\n this.y1 = y1;\n this.x2 = x2;\n this.y2 = y2;\n }\n\n Line.prototype.getBBox = function () {\n var minX = Math.min(this.x1, this.x2);\n var minY = Math.min(this.y1, this.y2);\n var maxX = Math.max(this.x1, this.x2);\n var maxY = Math.max(this.y1, this.y2);\n var res = {\n x: minX,\n y: minY,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n width: maxX - minX,\n height: maxY - minY\n };\n return res;\n };\n\n return Line;\n}();\n\nexports.Line = Line;\n\nvar getBBoxBoundLine = function getBBoxBoundLine(bbox, direction) {\n var bounds = {\n top: [bbox.minX, bbox.minY, bbox.maxX, bbox.minY],\n left: [bbox.minX, bbox.minY, bbox.minX, bbox.maxY],\n bottom: [bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY],\n right: [bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY]\n };\n return bounds[direction];\n};\n/**\n * 计算两条线段相交时,相交点对第一条线段上的分割比例\n */\n\n\nexports.getBBoxBoundLine = getBBoxBoundLine;\n\nvar fractionAlongLineA = function fractionAlongLineA(la, lb) {\n var uaT = (lb.x2 - lb.x1) * (la.y1 - lb.y1) - (lb.y2 - lb.y1) * (la.x1 - lb.x1);\n var ubT = (la.x2 - la.x1) * (la.y1 - lb.y1) - (la.y2 - la.y1) * (la.x1 - lb.x1);\n var uB = (lb.y2 - lb.y1) * (la.x2 - la.x1) - (lb.x2 - lb.x1) * (la.y2 - la.y1);\n\n if (uB) {\n var ua = uaT / uB;\n var ub = ubT / uB;\n\n if (ua >= 0 && ua <= 1 && ub >= 0 && ub <= 1) {\n return ua;\n }\n }\n\n return Number.POSITIVE_INFINITY;\n};\n\nvar itemIntersectByLine = function itemIntersectByLine(item, line) {\n var directions = ['top', 'left', 'bottom', 'right'];\n var bbox = item.getBBox();\n var countIntersections = 0;\n var intersections = [];\n\n for (var i = 0; i < 4; i++) {\n var _a = getBBoxBoundLine(bbox, directions[i]),\n x1 = _a[0],\n y1 = _a[1],\n x2 = _a[2],\n y2 = _a[3];\n\n intersections[i] = getLineIntersect({\n x: line.x1,\n y: line.y1\n }, {\n x: line.x2,\n y: line.y2\n }, {\n x: x1,\n y: y1\n }, {\n x: x2,\n y: y2\n });\n\n if (intersections[i]) {\n countIntersections += 1;\n }\n }\n\n return [intersections, countIntersections];\n};\n\nexports.itemIntersectByLine = itemIntersectByLine;\n\nvar fractionToLine = function fractionToLine(item, line) {\n var directions = ['top', 'left', 'bottom', 'right'];\n var bbox = item.getBBox();\n var minDistance = Number.POSITIVE_INFINITY;\n var countIntersections = 0;\n\n for (var i = 0; i < 4; i++) {\n var _a = getBBoxBoundLine(bbox, directions[i]),\n x1 = _a[0],\n y1 = _a[1],\n x2 = _a[2],\n y2 = _a[3];\n\n var testDistance = fractionAlongLineA(line, new Line(x1, y1, x2, y2));\n testDistance = Math.abs(testDistance - 0.5);\n\n if (testDistance >= 0 && testDistance <= 1) {\n countIntersections += 1;\n minDistance = testDistance < minDistance ? testDistance : minDistance;\n }\n }\n\n if (countIntersections === 0) return -1;\n return minDistance;\n};\n\nexports.fractionToLine = fractionToLine;\n\nvar getPointsCenter = function getPointsCenter(points) {\n var centerX = 0;\n var centerY = 0;\n\n if (points.length > 0) {\n for (var _i = 0, points_1 = points; _i < points_1.length; _i++) {\n var point = points_1[_i];\n centerX += point.x;\n centerY += point.y;\n }\n\n centerX /= points.length;\n centerY /= points.length;\n }\n\n return {\n x: centerX,\n y: centerY\n };\n};\n\nexports.getPointsCenter = getPointsCenter;\n\nvar squareDist = function squareDist(a, b) {\n return Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2);\n};\n\nexports.squareDist = squareDist;\n\nvar pointLineSquareDist = function pointLineSquareDist(point, line) {\n var x1 = line.x1;\n var y1 = line.y1;\n var x2 = line.x2 - x1;\n var y2 = line.y2 - y1;\n var px = point.x - x1;\n var py = point.y - y1;\n var dotprod = px * x2 + py * y2;\n var projlenSq;\n\n if (dotprod <= 0) {\n projlenSq = 0;\n } else {\n px = x2 - px;\n py = y2 - py;\n dotprod = px * x2 + py * y2;\n\n if (dotprod <= 0) {\n projlenSq = 0;\n } else {\n projlenSq = dotprod * dotprod / (x2 * x2 + y2 * y2);\n }\n }\n\n var lenSq = px * px + py * py - projlenSq;\n\n if (lenSq < 0) {\n lenSq = 0;\n }\n\n return lenSq;\n};\n\nexports.pointLineSquareDist = pointLineSquareDist;\n\nvar isPointsOverlap = function isPointsOverlap(p1, p2, e) {\n if (e === void 0) {\n e = 1e-3;\n }\n\n return Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2) < Math.pow(e, 2);\n};\n/**\n * 点到矩形的距离的平方:矩形内部点视作距离为0,外部的点若投影落在矩形边上则为点到矩形边的最近的垂直距离,否则为点到矩形顶点的距离,\n * @param point IPoint\n * @param rect IRect\n */\n\n\nexports.isPointsOverlap = isPointsOverlap;\n\nvar pointRectSquareDist = function pointRectSquareDist(point, rect) {\n var isLeft = point.x < rect.x;\n var isRight = point.x > rect.x + rect.width;\n var isTop = point.y > rect.y + rect.height;\n var isBottom = point.y < rect.y;\n var isPointOutside = isLeft || isRight || isTop || isBottom;\n\n if (!isPointOutside) {\n return 0;\n }\n\n if (isTop && !isLeft && !isRight) {\n return Math.pow(rect.y + rect.height - point.y, 2);\n }\n\n if (isBottom && !isLeft && !isRight) {\n return Math.pow(point.y - rect.y, 2);\n }\n\n if (isLeft && !isTop && !isBottom) {\n return Math.pow(rect.x - point.x, 2);\n }\n\n if (isRight && !isTop && !isBottom) {\n return Math.pow(rect.x + rect.width - point.x, 2);\n }\n\n var dx = Math.min(Math.abs(rect.x - point.x), Math.abs(rect.x + rect.width - point.x));\n var dy = Math.min(Math.abs(rect.y - point.y), Math.abs(rect.y + rect.height - point.y));\n return dx * dx + dy * dy;\n};\n/**\n * point to line distance\n * @param {array} line 线的四个顶点 [x1, y1, x2, y2]\n * @param {object} point 坐标点 {x, y}\n * @return {Number|NaN} distance\n */\n\n\nexports.pointRectSquareDist = pointRectSquareDist;\n\nvar pointLineDistance = function pointLineDistance(line, point) {\n var x1 = line[0],\n y1 = line[1],\n x2 = line[2],\n y2 = line[3];\n var x = point.x,\n y = point.y;\n var d = [x2 - x1, y2 - y1];\n\n if (_matrixUtil.vec2.exactEquals(d, [0, 0])) {\n return NaN;\n }\n\n var u = [-d[1], d[0]]; // @ts-ignore\n\n _matrixUtil.vec2.normalize(u, u);\n\n var a = [x - x1, y - y1]; // @ts-ignore\n\n return Math.abs(_matrixUtil.vec2.dot(a, u));\n};\n/**\n * Linearly interpolate between start and end, where alpha is the percent distance along the line.\n * alpha = 0 will be start, and alpha = 1 will be end.\n * @param {number} start\n * @param {number} end\n * @param {number} alpha interpolation factor, typically in the closed interval [0, 1]\n * @returns {number}\n */\n\n\nexports.pointLineDistance = pointLineDistance;\n\nvar lerp = function lerp(start, end, alpha) {\n return start + (end - start) * alpha;\n};\n/**\n * Linearly interpolate between start and end arrays, where alpha is the percent distance along the line.\n * alpha = 0 will be start, and alpha = 1 will be end.\n * @param {number[]} start\n * @param {number[]} end\n * @param {number} alpha interpolation factor, typically in the closed interval [0, 1]\n * @returns {number[]}\n */\n\n\nexports.lerp = lerp;\n\nvar lerpArray = function lerpArray(start, end, alpha) {\n var len = Math.min(start.length, end.length);\n var out = new Array(len);\n\n for (var i = 0; i < len; i++) {\n out[i] = lerp(start[i], end[i], alpha);\n }\n\n return out;\n};\n\nexports.lerpArray = lerpArray;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-core/lib/util/math.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @description Tarjan's algorithm for finding the strongly connected components of a graph.\n * @description https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm\n * @description.zh-CN Tarjan 算法用于找到图的强连通子图。\n * @param graph\n * @returns\n */\nvar tarjan = function tarjan(graph) {\n var index = 0;\n var stack = [];\n var visited = new Map(); // node id -> { onStack, lowlink, index }\n\n var results = [];\n\n function dfs(v) {\n var _graph$successors;\n\n var entry = {\n onStack: true,\n lowlink: index,\n index: index\n };\n visited.set(v, entry);\n index += 1;\n stack.push(v);\n (_graph$successors = graph.successors(v)) === null || _graph$successors === void 0 ? void 0 : _graph$successors.forEach(function (w) {\n var _visited$get;\n\n // 如果 w 没有被访问过,则继续访问 w\n if (!visited.has(w)) {\n dfs(w);\n var wEntry = visited.get(w);\n entry.lowlink = Math.min(entry.lowlink, wEntry.lowlink); // 如果 w 在栈顶,则说明 w 和 v 不是强连通的\n } else if ((_visited$get = visited.get(w)) === null || _visited$get === void 0 ? void 0 : _visited$get.onStack) {\n var _wEntry = visited.get(w); // 如果 w 在栈中,则说明 w 在当前访问的路径上\n\n\n entry.lowlink = Math.min(entry.lowlink, _wEntry.index);\n }\n }); // 如果 v 的 lowlink 不等于 v 的 index,则说明 v 和 v 的 lowlink 不是强连通的\n\n if (entry.lowlink === entry.index) {\n var cmpt = [];\n var w;\n\n do {\n // 将 w 出栈,并将 w 的所有邻接点加入强连通子图\n w = stack.pop();\n var wEntry = visited.get(w);\n wEntry.onStack = false;\n cmpt.push(w);\n } while (v !== w);\n\n results.push(cmpt);\n }\n }\n\n graph.nodes().forEach(function (v) {\n if (!visited.has(v)) {\n dfs(v);\n }\n });\n return results;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (tarjan);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/tarjan.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/edges/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/edges/index.js ***! - \*********************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/graphlib/es/algorithm/topsort.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/algorithm/topsort.js ***! + \*************************************************************/ +/*! exports provided: CycleException, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _polyline__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./polyline */ \"./node_modules/@antv/g6-element/es/edges/polyline.js\");\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/edges/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CycleException\", function() { return CycleException; });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar CycleException = /*#__PURE__*/function (_Error) {\n _inherits(CycleException, _Error);\n\n var _super = _createSuper(CycleException);\n\n function CycleException() {\n _classCallCheck(this, CycleException);\n\n return _super.apply(this, arguments);\n }\n\n return _createClass(CycleException);\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nfunction topsort(graph) {\n var visited = new Set();\n var stack = new Set();\n var results = [];\n\n function visit(node) {\n if (stack.has(node)) {\n throw new CycleException();\n }\n\n if (!visited.has(node)) {\n var _graph$predecessors;\n\n stack.add(node);\n visited.add(node);\n (_graph$predecessors = graph.predecessors(node)) === null || _graph$predecessors === void 0 ? void 0 : _graph$predecessors.forEach(visit);\n stack.delete(node);\n results.push(node);\n }\n }\n\n graph.sinks().forEach(visit);\n\n if (visited.size !== graph.nodeCount()) {\n throw new CycleException();\n }\n\n return results;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (topsort);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/topsort.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/edges/polyline-util.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/edges/polyline-util.js ***! - \*****************************************************************/ -/*! exports provided: getBBoxFromPoint, getBBoxFromPoints, isBBoxesOverlapping, filterConnectPoints, simplifyPolyline, getSimplePolyline, getExpandedBBox, isHorizontalPort, getExpandedBBoxPoint, mergeBBox, getPointsFromBBox, isPointOutsideBBox, getBBoxXCrossPoints, getBBoxYCrossPoints, getBBoxCrossPointsByPoint, distance, _costByPoints, heuristicCostEstimate, reconstructPath, removeFrom, isSegmentsIntersected, isSegmentCrossingBBox, getNeighborPoints, pathFinder, isBending, getBorderRadiusPoints, getPathWithBorderRadiusByPolyline, getPolylinePoints */ +/***/ "./node_modules/@antv/graphlib/es/comparision/complement.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/comparision/complement.js ***! + \******************************************************************/ +/*! exports provided: isGraphComplement */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxFromPoint\", function() { return getBBoxFromPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxFromPoints\", function() { return getBBoxFromPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBBoxesOverlapping\", function() { return isBBoxesOverlapping; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"filterConnectPoints\", function() { return filterConnectPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"simplifyPolyline\", function() { return simplifyPolyline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSimplePolyline\", function() { return getSimplePolyline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getExpandedBBox\", function() { return getExpandedBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isHorizontalPort\", function() { return isHorizontalPort; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getExpandedBBoxPoint\", function() { return getExpandedBBoxPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeBBox\", function() { return mergeBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPointsFromBBox\", function() { return getPointsFromBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPointOutsideBBox\", function() { return isPointOutsideBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxXCrossPoints\", function() { return getBBoxXCrossPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxYCrossPoints\", function() { return getBBoxYCrossPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBBoxCrossPointsByPoint\", function() { return getBBoxCrossPointsByPoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"_costByPoints\", function() { return _costByPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"heuristicCostEstimate\", function() { return heuristicCostEstimate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reconstructPath\", function() { return reconstructPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeFrom\", function() { return removeFrom; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSegmentsIntersected\", function() { return isSegmentsIntersected; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSegmentCrossingBBox\", function() { return isSegmentCrossingBBox; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNeighborPoints\", function() { return getNeighborPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pathFinder\", function() { return pathFinder; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isBending\", function() { return isBending; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getBorderRadiusPoints\", function() { return getBorderRadiusPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPathWithBorderRadiusByPolyline\", function() { return getPathWithBorderRadiusByPolyline; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPolylinePoints\", function() { return getPolylinePoints; });\nvar getBBoxFromPoint = function getBBoxFromPoint(point) {\n var x = point.x,\n y = point.y;\n return {\n x: x,\n y: y,\n centerX: x,\n centerY: y,\n minX: x,\n minY: y,\n maxX: x,\n maxY: y,\n height: 0,\n width: 0\n };\n};\nvar getBBoxFromPoints = function getBBoxFromPoints(points) {\n if (points === void 0) {\n points = [];\n }\n\n var xs = [];\n var ys = [];\n points.forEach(function (p) {\n xs.push(p.x);\n ys.push(p.y);\n });\n var minX = Math.min.apply(Math, xs);\n var maxX = Math.max.apply(Math, xs);\n var minY = Math.min.apply(Math, ys);\n var maxY = Math.max.apply(Math, ys);\n return {\n centerX: (minX + maxX) / 2,\n centerY: (minY + maxY) / 2,\n maxX: maxX,\n maxY: maxY,\n minX: minX,\n minY: minY,\n height: maxY - minY,\n width: maxX - minX\n };\n};\nvar isBBoxesOverlapping = function isBBoxesOverlapping(b1, b2) {\n return Math.abs(b1.centerX - b2.centerX) * 2 < b1.width + b2.width && Math.abs(b1.centerY - b2.centerY) * 2 < b1.height + b2.height;\n};\nvar filterConnectPoints = function filterConnectPoints(points) {\n // pre-process: remove duplicated points\n var result = [];\n var pointsMap = {};\n var pointsLength = points.length;\n\n for (var i = pointsLength - 1; i >= 0; i--) {\n var p = points[i];\n p.id = \"\".concat(p.x, \"|||\").concat(p.y);\n pointsMap[p.id] = p;\n result.push(p);\n }\n\n return result;\n};\nvar simplifyPolyline = function simplifyPolyline(points) {\n return filterConnectPoints(points);\n};\nvar getSimplePolyline = function getSimplePolyline(sPoint, tPoint) {\n return [sPoint, {\n x: sPoint.x,\n y: tPoint.y\n }, tPoint];\n};\nvar getExpandedBBox = function getExpandedBBox(bbox, offset) {\n if (bbox.width || bbox.height) {\n return {\n centerX: bbox.centerX,\n centerY: bbox.centerY,\n minX: bbox.minX - offset,\n minY: bbox.minY - offset,\n maxX: bbox.maxX + offset,\n maxY: bbox.maxY + offset,\n height: bbox.height + 2 * offset,\n width: bbox.width + 2 * offset\n };\n } // when it is a point\n\n\n return bbox;\n};\nvar isHorizontalPort = function isHorizontalPort(port, bbox) {\n var dx = Math.abs(port.x - bbox.centerX);\n var dy = Math.abs(port.y - bbox.centerY);\n if (dx === 0 && dy === 0) return 0;\n return dx / bbox.width > dy / bbox.height;\n};\nvar getExpandedBBoxPoint = function getExpandedBBoxPoint(bbox, // 将原来节点 bbox 扩展了 offset 后的 bbox,且被 gridSize 格式化\npoint, // 被 gridSize 格式化后的位置(anchorPoint)\nanotherPoint) {\n var isHorizontal = isHorizontalPort(point, bbox);\n\n if (isHorizontal === 0) {\n // 说明锚点是节点中心,linkCenter: true。需要根据两个节点的相对关系决定方向\n var x = bbox.centerX;\n var y = bbox.centerY;\n\n if (anotherPoint.y < point.y) {\n // 另一端在左上/右上方时,总是从上方走\n y = bbox.minY;\n } else if (anotherPoint.x > point.x) {\n // 另一端在右下方,往右边走\n x = bbox.maxX;\n } else if (anotherPoint.x < point.x) {\n // 另一端在左下方,往左边走\n x = bbox.minX;\n } else if (anotherPoint.x === point.x) {\n // 另一段在正下方,往下走\n y = bbox.maxY;\n }\n\n return {\n x: x,\n y: y\n };\n }\n\n if (isHorizontal) {\n return {\n x: point.x > bbox.centerX ? bbox.maxX : bbox.minX,\n y: point.y\n };\n }\n\n return {\n x: point.x,\n y: point.y > bbox.centerY ? bbox.maxY : bbox.minY\n };\n};\n/**\n *\n * @param b1\n * @param b2\n */\n\nvar mergeBBox = function mergeBBox(b1, b2) {\n var minX = Math.min(b1.minX, b2.minX);\n var minY = Math.min(b1.minY, b2.minY);\n var maxX = Math.max(b1.maxX, b2.maxX);\n var maxY = Math.max(b1.maxY, b2.maxY);\n return {\n centerX: (minX + maxX) / 2,\n centerY: (minY + maxY) / 2,\n minX: minX,\n minY: minY,\n maxX: maxX,\n maxY: maxY,\n height: maxY - minY,\n width: maxX - minX\n };\n};\nvar getPointsFromBBox = function getPointsFromBBox(bbox) {\n // anticlockwise\n // const { minX, minY, maxX, maxY } = bbox;\n return [{\n x: bbox.minX,\n y: bbox.minY\n }, {\n x: bbox.maxX,\n y: bbox.minY\n }, {\n x: bbox.maxX,\n y: bbox.maxY\n }, {\n x: bbox.minX,\n y: bbox.maxY\n }];\n};\nvar isPointOutsideBBox = function isPointOutsideBBox(point, bbox) {\n var x = point.x,\n y = point.y;\n return x < bbox.minX || x > bbox.maxX || y < bbox.minY || y > bbox.maxY;\n};\nvar getBBoxXCrossPoints = function getBBoxXCrossPoints(bbox, x) {\n if (x < bbox.minX || x > bbox.maxX) {\n return [];\n }\n\n return [{\n x: x,\n y: bbox.minY\n }, {\n x: x,\n y: bbox.maxY\n }];\n};\nvar getBBoxYCrossPoints = function getBBoxYCrossPoints(bbox, y) {\n if (y < bbox.minY || y > bbox.maxY) {\n return [];\n }\n\n return [{\n x: bbox.minX,\n y: y\n }, {\n x: bbox.maxX,\n y: y\n }];\n};\nvar getBBoxCrossPointsByPoint = function getBBoxCrossPointsByPoint(bbox, point) {\n return getBBoxXCrossPoints(bbox, point.x).concat(getBBoxYCrossPoints(bbox, point.y));\n};\n/**\n * 曼哈顿距离\n */\n\nvar distance = function distance(p1, p2) {\n return Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y);\n};\n/**\n * 如果 points 中的一个节点 x 与 p 相等,则消耗 -2。y 同\n * 即优先选择和 points 在同一水平线 / 垂直线上的点\n */\n// eslint-disable-next-line @typescript-eslint/naming-convention\n\nvar _costByPoints = function _costByPoints(p, points) {\n var offset = -2;\n var result = 0;\n points.forEach(function (point) {\n if (point) {\n if (p.x === point.x) {\n result += offset;\n }\n\n if (p.y === point.y) {\n result += offset;\n }\n }\n });\n return result;\n};\n/**\n * ps 经过 p 到 pt 的距离,减去其他路过节点造成的消耗\n */\n\nvar heuristicCostEstimate = function heuristicCostEstimate(p, ps, pt, source, target) {\n return distance(p, ps) + distance(p, pt) + _costByPoints(p, [ps, pt, source, target]);\n};\nvar reconstructPath = function reconstructPath(pathPoints, pointById, cameFrom, currentId, iterator) {\n if (iterator === void 0) {\n iterator = 0;\n }\n\n pathPoints.unshift(pointById[currentId]);\n\n if (cameFrom[currentId] && cameFrom[currentId] !== currentId && iterator <= 100) {\n reconstructPath(pathPoints, pointById, cameFrom, cameFrom[currentId], iterator + 1);\n }\n};\n/**\n * 从 arr 中删去 item\n */\n\nvar removeFrom = function removeFrom(arr, item) {\n var index = arr.indexOf(item);\n\n if (index > -1) {\n arr.splice(index, 1);\n }\n};\nvar isSegmentsIntersected = function isSegmentsIntersected(p0, p1, p2, p3) {\n var v1x = p2.x - p0.x;\n var v1y = p2.y - p0.y;\n var v2x = p3.x - p0.x;\n var v2y = p3.y - p0.y;\n var v3x = p2.x - p1.x;\n var v3y = p2.y - p1.y;\n var v4x = p3.x - p1.x;\n var v4y = p3.y - p1.y;\n var pd1 = v1x * v2y - v1y * v2x;\n var pd2 = v3x * v4y - v3y * v4x;\n var pd3 = v1x * v3y - v1y * v3x;\n var pd4 = v2x * v4y - v2y * v4x;\n return pd1 * pd2 <= 0 && pd3 * pd4 <= 0;\n};\nvar isSegmentCrossingBBox = function isSegmentCrossingBBox(p1, p2, bbox) {\n if (bbox.width || bbox.height) {\n var _a = getPointsFromBBox(bbox),\n pa = _a[0],\n pb = _a[1],\n pc = _a[2],\n pd = _a[3];\n\n return isSegmentsIntersected(p1, p2, pa, pb) || isSegmentsIntersected(p1, p2, pa, pd) || isSegmentsIntersected(p1, p2, pb, pc) || isSegmentsIntersected(p1, p2, pc, pd);\n }\n\n return false;\n};\n/**\n * 在 points 中找到满足 x 或 y 和 point 的 x 或 y 相等,且与 point 连线不经过 bbox1 与 bbox2 的点\n */\n\nvar getNeighborPoints = function getNeighborPoints(points, point, bbox1, bbox2) {\n var neighbors = [];\n points.forEach(function (p) {\n if (p === point) return;\n\n if (p.x === point.x || p.y === point.y) {\n if (isSegmentCrossingBBox(p, point, bbox1) || isSegmentCrossingBBox(p, point, bbox2)) return;\n neighbors.push(p);\n }\n });\n return filterConnectPoints(neighbors);\n};\nvar pathFinder = function pathFinder(points, start, goal, sBBox, tBBox, os, ot) {\n // A-Star Algorithm\n var closedSet = [];\n var openSet = [start];\n var cameFrom = {};\n var gScore = {}; // all default values are Infinity\n\n var fScore = {}; // all default values are Infinity\n\n gScore[start.id] = 0;\n fScore[start.id] = heuristicCostEstimate(start, goal, start);\n var pointById = {};\n points.forEach(function (p) {\n pointById[p.id] = p;\n });\n var current, lowestFScore;\n\n while (openSet.length) {\n current = undefined;\n lowestFScore = Infinity; // 找到 openSet 中 fScore 最小的点\n\n openSet.forEach(function (p) {\n if (fScore[p.id] <= lowestFScore) {\n lowestFScore = fScore[p.id];\n current = p;\n }\n }); // 若 openSet 中 fScore 最小的点就是终点\n\n if (current === goal) {\n // ending condition\n var pathPoints = [];\n reconstructPath(pathPoints, pointById, cameFrom, goal.id);\n return pathPoints;\n }\n\n removeFrom(openSet, current);\n closedSet.push(current);\n getNeighborPoints(points, current, sBBox, tBBox).forEach(function (neighbor) {\n if (closedSet.indexOf(neighbor) !== -1) {\n return;\n }\n\n if (openSet.indexOf(neighbor) === -1) {\n openSet.push(neighbor);\n }\n\n var tentativeGScore = fScore[current.id] + distance(current, neighbor); // + distance(neighbor, goal);\n\n if (gScore[neighbor.id] && tentativeGScore >= gScore[neighbor.id]) {\n return;\n }\n\n cameFrom[neighbor.id] = current.id;\n gScore[neighbor.id] = tentativeGScore;\n fScore[neighbor.id] = gScore[neighbor.id] + heuristicCostEstimate(neighbor, goal, start, os, ot);\n });\n } // throw new Error('Cannot find path');\n\n\n return [start, goal];\n};\nvar isBending = function isBending(p0, p1, p2) {\n return !(p0.x === p1.x && p1.x === p2.x || p0.y === p1.y && p1.y === p2.y);\n};\nvar getBorderRadiusPoints = function getBorderRadiusPoints(p0, p1, p2, r) {\n var d0 = distance(p0, p1);\n var d1 = distance(p2, p1);\n\n if (d0 < r) {\n r = d0;\n }\n\n if (d1 < r) {\n r = d1;\n }\n\n var ps = {\n x: p1.x - r / d0 * (p1.x - p0.x),\n y: p1.y - r / d0 * (p1.y - p0.y)\n };\n var pt = {\n x: p1.x - r / d1 * (p1.x - p2.x),\n y: p1.y - r / d1 * (p1.y - p2.y)\n };\n return [ps, pt];\n};\nvar getPathWithBorderRadiusByPolyline = function getPathWithBorderRadiusByPolyline(points, borderRadius) {\n var pathSegments = [];\n var startPoint = points[0];\n pathSegments.push(\"M\".concat(startPoint.x, \" \").concat(startPoint.y));\n points.forEach(function (p, i) {\n var p1 = points[i + 1];\n var p2 = points[i + 2];\n\n if (p1 && p2) {\n if (isBending(p, p1, p2)) {\n var _a = getBorderRadiusPoints(p, p1, p2, borderRadius),\n ps = _a[0],\n pt = _a[1];\n\n pathSegments.push(\"L\".concat(ps.x, \" \").concat(ps.y));\n pathSegments.push(\"Q\".concat(p1.x, \" \").concat(p1.y, \" \").concat(pt.x, \" \").concat(pt.y));\n pathSegments.push(\"L\".concat(pt.x, \" \").concat(pt.y));\n } else {\n pathSegments.push(\"L\".concat(p1.x, \" \").concat(p1.y));\n }\n } else if (p1) {\n pathSegments.push(\"L\".concat(p1.x, \" \").concat(p1.y));\n }\n });\n return pathSegments.join('');\n};\nvar getPolylinePoints = function getPolylinePoints(start, end, sNode, tNode, offset) {\n var sBBox, tBBox;\n\n if (!sNode || !sNode.getType()) {\n sBBox = getBBoxFromPoint(start);\n } else if (sNode.getType() === 'combo') {\n var sKeyShapeBBox = sNode.getKeyShape().getBBox();\n\n if (sKeyShapeBBox) {\n var _a = sNode.getModel(),\n sx = _a.x,\n sy = _a.y;\n\n sBBox = {\n x: sx,\n y: sy,\n width: sKeyShapeBBox.width,\n height: sKeyShapeBBox.height,\n minX: sKeyShapeBBox.minX + sx,\n maxX: sKeyShapeBBox.maxX + sx,\n minY: sKeyShapeBBox.minY + sy,\n maxY: sKeyShapeBBox.maxY + sy\n };\n sBBox.centerX = (sBBox.minX + sBBox.maxX) / 2;\n sBBox.centerY = (sBBox.minY + sBBox.maxY) / 2;\n } else {\n sBBox = getBBoxFromPoint(start);\n }\n } else {\n sBBox = sNode && sNode.getBBox();\n }\n\n if (!tNode || !tNode.getType()) {\n tBBox = getBBoxFromPoint(end);\n } else if (tNode.getType() === 'combo') {\n var tKeyShapeBBox = tNode.getKeyShape().getBBox();\n\n if (tKeyShapeBBox) {\n var _b = tNode.getModel(),\n tx = _b.x,\n ty = _b.y;\n\n tBBox = {\n x: tx,\n y: ty,\n width: tKeyShapeBBox.width,\n height: tKeyShapeBBox.height,\n minX: tKeyShapeBBox.minX + tx,\n maxX: tKeyShapeBBox.maxX + tx,\n minY: tKeyShapeBBox.minY + ty,\n maxY: tKeyShapeBBox.maxY + ty\n };\n tBBox.centerX = (tBBox.minX + tBBox.maxX) / 2;\n tBBox.centerY = (tBBox.minY + tBBox.maxY) / 2;\n } else {\n tBBox = getBBoxFromPoint(end);\n }\n } else {\n tBBox = tNode && tNode.getBBox();\n } // if (isBBoxesOverlapping(sBBox, tBBox)) {\n // // source and target nodes are overlapping\n // return simplifyPolyline(getSimplePolyline(start, end));\n // }\n\n\n var sxBBox = getExpandedBBox(sBBox, offset);\n var txBBox = getExpandedBBox(tBBox, offset); // if (isBBoxesOverlapping(sxBBox, txBBox)) {\n // // the expanded bounding boxes of source and target nodes are overlapping\n // return simplifyPolyline(getSimplePolyline(start, end));\n // }\n\n var sPoint = getExpandedBBoxPoint(sxBBox, start, end);\n var tPoint = getExpandedBBoxPoint(txBBox, end, start);\n var lineBBox = getBBoxFromPoints([sPoint, tPoint]);\n var sMixBBox = mergeBBox(sxBBox, lineBBox);\n var tMixBBox = mergeBBox(txBBox, lineBBox);\n var connectPoints = [];\n connectPoints = connectPoints.concat(getPointsFromBBox(sMixBBox)).concat(getPointsFromBBox(tMixBBox));\n var centerPoint = {\n x: (start.x + end.x) / 2,\n y: (start.y + end.y) / 2\n };\n [lineBBox, sMixBBox, tMixBBox].forEach(function (bbox) {\n connectPoints = connectPoints.concat(getBBoxCrossPointsByPoint(bbox, centerPoint).filter(function (p) {\n return isPointOutsideBBox(p, sxBBox) && isPointOutsideBBox(p, txBBox);\n }));\n });\n [{\n x: sPoint.x,\n y: tPoint.y\n }, {\n x: tPoint.x,\n y: sPoint.y\n }].forEach(function (p) {\n // impossible!!\n if (isPointOutsideBBox(p, sxBBox) && isPointOutsideBBox(p, txBBox) // &&\n // isPointInsideBBox(p, sMixBBox) && isPointInsideBBox(p, tMixBBox)\n ) {\n connectPoints.push(p);\n }\n });\n connectPoints.unshift(sPoint);\n connectPoints.push(tPoint); // filter out dulplicated points in connectPoints\n\n connectPoints = filterConnectPoints(connectPoints); // , sxBBox, txBBox, outerBBox\n\n var pathPoints = pathFinder(connectPoints, sPoint, tPoint, sBBox, tBBox, start, end);\n pathPoints.unshift(start);\n pathPoints.push(end);\n return simplifyPolyline(pathPoints);\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/edges/polyline-util.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraphComplement\", function() { return isGraphComplement; });\n/* harmony import */ var _essence__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../essence */ \"./node_modules/@antv/graphlib/es/essence/index.js\");\n/* harmony import */ var _contain__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contain */ \"./node_modules/@antv/graphlib/es/comparision/contain.js\");\n\n\n/**\n * @description Check if one graph is the complement of another graph.\n * @description.zh-CN 检查一个图是否是另一个图的补图。\n */\n\nvar isGraphComplement = function isGraphComplement(originGraph, targetGraph) {\n if (!Object(_essence__WEBPACK_IMPORTED_MODULE_0__[\"isSimpleGraph\"])(originGraph) || !Object(_essence__WEBPACK_IMPORTED_MODULE_0__[\"isSimpleGraph\"])(targetGraph)) {\n return false;\n }\n\n if (!Object(_contain__WEBPACK_IMPORTED_MODULE_1__[\"containAllSameNodes\"])(originGraph, targetGraph)) {\n return false;\n }\n\n if (Object(_contain__WEBPACK_IMPORTED_MODULE_1__[\"containSameEdges\"])(originGraph, targetGraph)) {\n return false;\n }\n\n var nodeCount = originGraph.nodeCount();\n return originGraph.edgeCount() + targetGraph.edgeCount() === nodeCount * (nodeCount - 1) / 2;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/comparision/complement.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/edges/polyline.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/edges/polyline.js ***! - \************************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/graphlib/es/comparision/contain.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/comparision/contain.js ***! + \***************************************************************/ +/*! exports provided: containSameNodes, containSameEdges, getSameNodes, getSameEdges, isGraphOptionSame, containAllSameNodes, containAllSameEdges, isGraphSame, isGraphContainsAnother */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _polyline_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./polyline-util */ \"./node_modules/@antv/g6-element/es/edges/polyline-util.js\");\n/* harmony import */ var _router__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./router */ \"./node_modules/@antv/g6-element/es/edges/router.js\");\n\n\n\n\n // 折线\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"registerEdge\"])('polyline', {\n options: {\n color: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.color,\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.size,\n style: {\n radius: 0,\n offset: 15,\n x: 0,\n y: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.style.stroke,\n lineAppendWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.style.lineAppendWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].edgeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].edgeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].windowFontFamily\n }\n },\n routeCfg: {\n obstacles: [],\n maxAllowedDirectionChange: Math.PI,\n maximumLoops: 500,\n gridSize: 10 // 指定精度\n\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].edgeStateStyles)\n },\n shapeType: 'polyline',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var shapeStyle = this.getShapeStyle(cfg);\n if (shapeStyle.radius === 0) delete shapeStyle.radius;\n var keyShape = group.addShape('path', {\n className: 'edge-shape',\n name: 'edge-shape',\n attrs: shapeStyle\n });\n group['shapeMap']['edge-shape'] = keyShape;\n return keyShape;\n },\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = this.options.style;\n var strokeStyle = {\n stroke: cfg.color\n };\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle, cfg.style);\n cfg = this.getPathPoints(cfg);\n this.radius = style.radius;\n this.offset = style.offset;\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var controlPoints = this.getControlPoints(cfg);\n var points = [startPoint]; // 添加起始点\n // 添加控制点\n\n if (controlPoints) {\n points = points.concat(controlPoints);\n } // 添加结束点\n\n\n points.push(endPoint);\n var source = cfg.sourceNode;\n var target = cfg.targetNode;\n var radius = style.radius;\n var defaultRouteCfg = this.options.routeCfg;\n var routeCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultRouteCfg, cfg.routeCfg);\n routeCfg.offset = style.offset;\n var path = this.getPath(points, source, target, radius, routeCfg);\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(path) && path.length <= 1 || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(path) && path.indexOf('L') === -1) {\n path = 'M0 0, L0 0';\n }\n\n if (isNaN(startPoint.x) || isNaN(startPoint.y) || isNaN(endPoint.x) || isNaN(endPoint.y)) {\n path = 'M0 0, L0 0';\n }\n\n var attrs = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultEdge.style, style, {\n lineWidth: cfg.size,\n path: path\n });\n return attrs;\n },\n updateShapeStyle: function updateShapeStyle(cfg, item) {\n var group = item.getContainer();\n if (!item.isVisible()) return;\n var strokeStyle = {\n stroke: cfg.color\n };\n var shape = group['shapeMap']['edge-shape'] || group.find(function (element) {\n return element.get('className') === 'edge-shape';\n }) || item.getKeyShape();\n var size = cfg.size;\n cfg = this.getPathPoints(cfg);\n var startPoint = cfg.startPoint,\n endPoint = cfg.endPoint;\n var controlPoints = this.getControlPoints(cfg); // || cfg.controlPoints;\n\n var points = [startPoint]; // 添加起始点\n // 添加控制点\n\n if (controlPoints) {\n points = points.concat(controlPoints);\n } // 添加结束点\n\n\n points.push(endPoint);\n var currentAttr = shape.attr();\n var previousStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, strokeStyle, currentAttr, cfg.style);\n var source = cfg.sourceNode;\n var target = cfg.targetNode;\n var radius = previousStyle.radius;\n var defaultRouteCfg = this.options.routeCfg;\n var routeCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultRouteCfg, cfg.routeCfg);\n routeCfg.offset = previousStyle.offset;\n var path = this.getPath(points, source, target, radius, routeCfg);\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(path) && path.length <= 1 || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(path) && path.indexOf('L') === -1) {\n path = 'M0 0, L0 0';\n }\n\n if (isNaN(startPoint.x) || isNaN(startPoint.y) || isNaN(endPoint.x) || isNaN(endPoint.y)) {\n path = 'M0 0, L0 0';\n }\n\n if (currentAttr.endArrow && previousStyle.endArrow === false) {\n cfg.style.endArrow = {\n path: ''\n };\n }\n\n if (currentAttr.startArrow && previousStyle.startArrow === false) {\n cfg.style.startArrow = {\n path: ''\n };\n }\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(strokeStyle, shape.attr(), {\n lineWidth: size,\n path: path\n }, cfg.style);\n\n if (shape) {\n shape.attr(style);\n }\n },\n getPath: function getPath(points, source, target, radius, routeCfg) {\n var offset = routeCfg.offset,\n simple = routeCfg.simple; // 指定了控制点\n\n if (!offset || points.length > 2) {\n if (radius) {\n return Object(_polyline_util__WEBPACK_IMPORTED_MODULE_3__[\"getPathWithBorderRadiusByPolyline\"])(points, radius);\n }\n\n var pathArray_1 = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(points, function (point, index) {\n if (index === 0) {\n pathArray_1.push(['M', point.x, point.y]);\n } else {\n pathArray_1.push(['L', point.x, point.y]);\n }\n });\n return pathArray_1;\n } // 未指定控制点\n\n\n var polylinePoints = simple ? Object(_polyline_util__WEBPACK_IMPORTED_MODULE_3__[\"getPolylinePoints\"])(points[points.length - 1], points[0], target, source, offset) : Object(_router__WEBPACK_IMPORTED_MODULE_4__[\"pathFinder\"])(points[0], points[points.length - 1], source, target, routeCfg);\n if (!polylinePoints || !polylinePoints.length) return 'M0 0, L0 0';\n\n if (radius) {\n var res_1 = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_3__[\"getPathWithBorderRadiusByPolyline\"])(polylinePoints, radius);\n return res_1;\n }\n\n var res = _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"Util\"].pointsToPolygon(polylinePoints);\n return res;\n }\n}, 'single-edge');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/edges/polyline.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containSameNodes\", function() { return containSameNodes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containSameEdges\", function() { return containSameEdges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSameNodes\", function() { return getSameNodes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSameEdges\", function() { return getSameEdges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraphOptionSame\", function() { return isGraphOptionSame; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containAllSameNodes\", function() { return containAllSameNodes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containAllSameEdges\", function() { return containAllSameEdges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraphSame\", function() { return isGraphSame; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraphContainsAnother\", function() { return isGraphContainsAnother; });\n/**\n * @file Functions that used to find similar element between two graph\n * @file.zh-CN 在两个图中查找相似元素的函数\n */\n\n/**\n * @description Check if two graphs are contains the same nodes.\n * @description.zh-CN 检查两个图是否包含相同的节点。\n */\nvar containSameNodes = function containSameNodes(aGraph, bGraph) {\n var aNodes = aGraph.nodes();\n\n for (var i = 0; i < aNodes.length; i++) {\n var aNode = aNodes[i];\n\n if (bGraph.hasNode(aNode)) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * @description Check if two graphs are contains the same edges.\n * @description.zh-CN 检查两个图是否包含相同的边。\n */\n\nvar containSameEdges = function containSameEdges(aGraph, bGraph) {\n var aEdges = aGraph.edges();\n\n for (var i = 0; i < aEdges.length; i++) {\n var aEdge = aEdges[i];\n\n if (bGraph.hasEdge(aEdge.v, aEdge.w, aEdge.name)) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * @description get same nodes in two graphs.\n * @description.zh-CN 获取两个图中相同的节点。\n */\n\nvar getSameNodes = function getSameNodes(aGraph, bGraph) {\n var aNodes = aGraph.nodes();\n var sameNodes = aNodes.filter(function (aNode) {\n return bGraph.hasNode(aNode);\n });\n return sameNodes;\n};\n/**\n * @description get same edges in two graphs.\n * @description.zh-CN 获取两个图中相同的边。\n */\n\nvar getSameEdges = function getSameEdges(aGraph, bGraph) {\n var aEdges = aGraph.edges();\n var sameEdges = aEdges.filter(function (aEdge) {\n return bGraph.hasEdge(aEdge.v, aEdge.w, aEdge.name);\n });\n return sameEdges;\n};\n/**\n * @description Check if two graphs'option are the same.\n * @description.zh-CN 检查两个图的选项是否相同。\n */\n\nvar isGraphOptionSame = function isGraphOptionSame(aGraph, bGraph) {\n return aGraph.isCompound() === bGraph.isCompound() && aGraph.isDirected() === bGraph.isDirected() && aGraph.isMultigraph() === bGraph.isMultigraph();\n};\n/**\n * @description Check if a graph contains all nodes in another graph.\n * @description.zh-CN 检查一个图是否包含另一个图的所有节点。\n */\n\nvar containAllSameNodes = function containAllSameNodes(aGraph, bGraph) {\n var sameNodes = getSameNodes(aGraph, bGraph);\n return sameNodes.length === aGraph.nodes().length;\n};\n/**\n * @description Check if a graph contains all edges in another graph.\n * @description.zh-CN 检查一个图是否包含另一个图的所有边。\n */\n\nvar containAllSameEdges = function containAllSameEdges(aGraph, bGraph) {\n var sameEdges = getSameEdges(aGraph, bGraph);\n return sameEdges.length === aGraph.edges().length;\n};\n/**\n * @description Check if two graphs are the same.\n * @description.zh-CN 检查两个图是否相同。\n */\n\nvar isGraphSame = function isGraphSame(aGraph, bGraph) {\n return isGraphOptionSame(aGraph, bGraph) && aGraph.nodeCount() === bGraph.nodeCount() && containAllSameNodes(aGraph, bGraph) && aGraph.edgeCount() === bGraph.edgeCount() && containAllSameEdges(aGraph, bGraph);\n};\n/**\n * @description Check if one graph is the subgraph of another graph.\n * @description.zh-CN 检查一个图是否是另一个图的子图。\n */\n\nvar isGraphContainsAnother = function isGraphContainsAnother(originGraph, targetGraph) {\n return containAllSameNodes(originGraph, targetGraph) && containAllSameEdges(originGraph, targetGraph);\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/comparision/contain.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/edges/router.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/edges/router.js ***! - \**********************************************************/ -/*! exports provided: octolinearCfg, pathFinder */ +/***/ "./node_modules/@antv/graphlib/es/comparision/index.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/comparision/index.js ***! + \*************************************************************/ +/*! exports provided: containAllSameEdges, containAllSameNodes, containSameEdges, containSameNodes, isGraphComplement, isGraphOptionSame, getSameEdges, getSameNodes, isGraphSame, isGraphContainsAnother */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"octolinearCfg\", function() { return octolinearCfg; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pathFinder\", function() { return pathFinder; });\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _polyline_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./polyline-util */ \"./node_modules/@antv/g6-element/es/edges/polyline-util.js\");\n/**\n * 通过配置不同的 costFunc, distFunc, constraints 可以得到不同效果的 router\n * generalRouter: 不限制搜索时的移动方向,避开障碍即可\n * orthogonal: 线必须沿着竖直或水平方向(4个方向)\n * octolinearRouter: 线沿着竖直、水平、对角线方向(8个方向)\n */\n\n\n\n\nvar manhattanDist = function manhattanDist(p1, p2) {\n return Math.abs(p1.x - p2.x) + Math.abs(p1.y - p2.y);\n};\n\nvar eucliDist = function eucliDist(p1, p2) {\n return Math.sqrt(Math.pow(p1.x - p2.x, 2) + Math.pow(p1.y - p2.y, 2));\n};\n\nvar straightPath = function straightPath(start, end) {\n // console.warn('fallbackRoute: straight path');\n return [start, end];\n};\n\nvar simplePolyline = function simplePolyline(start, end, startNode, endNode, cfg) {\n return Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"simplifyPolyline\"])(Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"getPolylinePoints\"])(start, end, startNode, endNode, cfg.offset));\n}; // getPolylinePoints\n\n\nvar defaultCfg = {\n offset: 20,\n maxAllowedDirectionChange: Math.PI / 2,\n maximumLoops: 2000,\n gridSize: 10,\n directions: [{\n stepX: 1,\n stepY: 0\n }, {\n stepX: -1,\n stepY: 0\n }, {\n stepX: 0,\n stepY: 1\n }, {\n stepX: 0,\n stepY: -1\n } // top\n ],\n\n get penalties() {\n return {\n 0: 0,\n 45: this.gridSize / 2,\n 90: this.gridSize / 2\n };\n },\n\n distFunc: manhattanDist,\n fallbackRoute: simplePolyline\n};\nvar octolinearCfg = {\n maxAllowedDirectionChange: Math.PI / 4,\n // 8 个方向: 上下左右 + 45度斜线方向\n directions: [{\n stepX: 1,\n stepY: 0\n }, {\n stepX: 1,\n stepY: 1\n }, {\n stepX: 0,\n stepY: 1\n }, {\n stepX: -1,\n stepY: 1\n }, {\n stepX: -1,\n stepY: 0\n }, {\n stepX: -1,\n stepY: -1\n }, {\n stepX: 0,\n stepY: -1\n }, {\n stepX: 1,\n stepY: -1\n }],\n distFunc: eucliDist,\n fallbackRoute: straightPath\n};\n\nvar pos2GridIx = function pos2GridIx(pos, gridSize) {\n var gridIx = Math.round(Math.abs(pos / gridSize));\n var sign = pos < 0 ? -1 : 1;\n return gridIx < 0 ? 0 : sign * gridIx;\n};\n\nvar getObstacleMap = function getObstacleMap(items, gridSize, offset) {\n var map = {};\n items.forEach(function (item) {\n // create-edge 时,当边类型为 polyline 时 endNode 为 null\n if (!item) return;\n var bbox = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"getExpandedBBox\"])(item.getBBox(), offset);\n\n for (var x = pos2GridIx(bbox.minX, gridSize); x <= pos2GridIx(bbox.maxX, gridSize); x += 1) {\n for (var y = pos2GridIx(bbox.minY, gridSize); y <= pos2GridIx(bbox.maxY, gridSize); y += 1) {\n map[\"\".concat(x, \"|||\").concat(y)] = true;\n }\n }\n });\n return map;\n};\n/**\n * 方向角:计算从 p1 到 p2 的射线与水平线形成的夹角度数(顺时针从右侧0°转到该射线的角度)\n * @param p1 PolyPoint\n * @param p2 PolyPoint\n */\n\n\nvar getDirectionAngle = function getDirectionAngle(p1, p2) {\n var deltaX = p2.x - p1.x;\n var deltaY = p2.y - p1.y;\n\n if (deltaX || deltaY) {\n return Math.atan2(deltaY, deltaX);\n }\n\n return 0;\n};\n/**\n * 方向角的改变,取小于180度角\n * @param angle1\n * @param angle2\n */\n\n\nvar getAngleDiff = function getAngleDiff(angle1, angle2) {\n var directionChange = Math.abs(angle1 - angle2);\n return directionChange > Math.PI ? 2 * Math.PI - directionChange : directionChange; // return directionChange > 180 ? 360 - directionChange : directionChange;\n}; // Path finder //\n\n\nvar estimateCost = function estimateCost(from, endPoints, distFunc) {\n var min = Infinity;\n\n for (var i = 0, len = endPoints.length; i < len; i++) {\n var cost = distFunc(from, endPoints[i]);\n\n if (cost < min) {\n min = cost;\n }\n }\n\n return min;\n}; // 计算考虑 offset 后的 BBox 上的连接点\n\n\nvar getBoxPoints = function getBoxPoints(point, // 被 gridSize 格式化后的位置(anchorPoint)\noriPoint, // 未被 gridSize 格式化的位置(anchorPoint)\nnode, // 原始节点,用于获取 bbox\nanotherPoint, // 另一端被 gridSize 格式化后的位置\ncfg) {\n var points = []; // create-edge 生成边的过程中,endNode 为 null\n\n if (!node) {\n return [point];\n }\n\n var directions = cfg.directions,\n offset = cfg.offset;\n var bbox = node.getBBox();\n var isInside = oriPoint.x > bbox.minX && oriPoint.x < bbox.maxX && oriPoint.y > bbox.minY && oriPoint.y < bbox.maxY;\n var expandBBox = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"getExpandedBBox\"])(bbox, offset);\n\n for (var i in expandBBox) {\n expandBBox[i] = pos2GridIx(expandBBox[i], cfg.gridSize);\n }\n\n if (isInside) {\n // 如果 anchorPoint 在节点内部,允许第一段线穿过节点\n for (var _i = 0, directions_1 = directions; _i < directions_1.length; _i++) {\n var dir = directions_1[_i];\n var bounds = [[{\n x: expandBBox.minX,\n y: expandBBox.minY\n }, {\n x: expandBBox.maxX,\n y: expandBBox.minY\n }], [{\n x: expandBBox.minX,\n y: expandBBox.minY\n }, {\n x: expandBBox.minX,\n y: expandBBox.maxY\n }], [{\n x: expandBBox.maxX,\n y: expandBBox.minY\n }, {\n x: expandBBox.maxX,\n y: expandBBox.maxY\n }], [{\n x: expandBBox.minX,\n y: expandBBox.maxY\n }, {\n x: expandBBox.maxX,\n y: expandBBox.maxY\n }]];\n\n for (var i = 0; i < 4; i++) {\n var boundLine = bounds[i];\n var insterctP_1 = _antv_g6_core__WEBPACK_IMPORTED_MODULE_0__[\"Util\"].getLineIntersect(point, {\n x: point.x + dir.stepX * expandBBox.width,\n y: point.y + dir.stepY * expandBBox.height\n }, boundLine[0], boundLine[1]);\n\n if (insterctP_1 && !Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"isSegmentCrossingBBox\"])(point, insterctP_1, bbox)) {\n insterctP_1.id = \"\".concat(insterctP_1.x, \"|||\").concat(insterctP_1.y);\n points.push(insterctP_1);\n }\n }\n }\n\n return points;\n } // 如果 anchorPoint 在节点上,只有一个可选方向\n\n\n var insterctP = Object(_polyline_util__WEBPACK_IMPORTED_MODULE_2__[\"getExpandedBBoxPoint\"])(expandBBox, point, anotherPoint);\n insterctP.id = \"\".concat(insterctP.x, \"|||\").concat(insterctP.y);\n return [insterctP];\n};\n\nvar getDirectionChange = function getDirectionChange(current, neighbor, cameFrom, scaleStartPoint) {\n var directionAngle = getDirectionAngle(current, neighbor);\n\n if (!cameFrom[current.id]) {\n var startAngle = getDirectionAngle(scaleStartPoint, current);\n return getAngleDiff(startAngle, directionAngle);\n }\n\n var prevDirectionAngle = getDirectionAngle({\n x: cameFrom[current.id].x,\n y: cameFrom[current.id].y\n }, current);\n return getAngleDiff(prevDirectionAngle, directionAngle);\n};\n\nvar getControlPoints = function getControlPoints(current, cameFrom, scaleStartPoint, endPoint, startPoint, scaleEndPoint, gridSize) {\n var controlPoints = [endPoint];\n var currentId = current.id;\n var currentX = current.x;\n var currentY = current.y;\n var lastPoint = {\n x: currentX,\n y: currentY,\n id: currentId\n };\n\n if (getDirectionChange(lastPoint, scaleEndPoint, cameFrom, scaleStartPoint)) {\n // if (scaleEndPoint.x === endPoint.x && scaleEndPoint.y === endPoint.y)\n // controlPoints.unshift({\n // x: endPoint.x,\n // y: endPoint.y\n // })\n // else\n // controlPoints.unshift({\n // x: lastPoint.x * gridSize,\n // y: lastPoint.y * gridSize,\n // });\n controlPoints.unshift({\n x: scaleEndPoint.x === endPoint.x ? endPoint.x : lastPoint.x * gridSize,\n y: scaleEndPoint.y === endPoint.y ? endPoint.y : lastPoint.y * gridSize\n });\n }\n\n while (cameFrom[currentId] && cameFrom[currentId].id !== currentId) {\n var point = {\n x: currentX,\n y: currentY,\n id: currentId\n };\n var preId = cameFrom[currentId].id;\n var preX = cameFrom[currentId].x;\n var preY = cameFrom[currentId].y;\n var prePoint = {\n x: preX,\n y: preY,\n id: preId\n };\n var directionChange = getDirectionChange(prePoint, point, cameFrom, scaleStartPoint);\n\n if (directionChange) {\n // if (prePoint.x === point.x && prePoint.y === point.y)\n // controlPoints.unshift({\n // x: controlPoints[0].x,\n // y: controlPoints[0].y\n // })\n // else\n // controlPoints.unshift({\n // x: prePoint.x * gridSize,\n // y: prePoint.y * gridSize,\n // });\n controlPoints.unshift({\n x: prePoint.x === point.x ? controlPoints[0].x : prePoint.x * gridSize,\n y: prePoint.y === point.y ? controlPoints[0].y : prePoint.y * gridSize\n });\n }\n\n currentId = preId;\n currentX = preX;\n currentY = preY;\n } // 和startNode对齐\n\n\n var firstPoint = {\n x: currentX,\n y: currentY,\n id: currentId\n }; // if (firstPoint.x === scaleStartPoint.x && firstPoint.y === scaleStartPoint.y) {\n // controlPoints[0].x = startPoint.x;\n // controlPoints[0].y = startPoint.y;\n // }\n\n controlPoints[0].x = firstPoint.x === scaleStartPoint.x ? startPoint.x : controlPoints[0].x;\n controlPoints[0].y = firstPoint.y === scaleStartPoint.y ? startPoint.y : controlPoints[0].y;\n controlPoints.unshift(startPoint);\n return controlPoints;\n};\n\nvar pathFinder = function pathFinder(startPoint, endPoint, startNode, endNode, routerCfg) {\n if (isNaN(startPoint.x) || isNaN(endPoint.x)) return [];\n var cfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])(defaultCfg, routerCfg);\n cfg.obstacles = cfg.obstacles || [];\n var gridSize = cfg.gridSize;\n var map = getObstacleMap(cfg.obstacles.concat([startNode, endNode]), gridSize, cfg.offset);\n var scaleStartPoint = {\n x: pos2GridIx(startPoint.x, gridSize),\n y: pos2GridIx(startPoint.y, gridSize)\n };\n var scaleEndPoint = {\n x: pos2GridIx(endPoint.x, gridSize),\n y: pos2GridIx(endPoint.y, gridSize)\n };\n startPoint.id = \"\".concat(scaleStartPoint.x, \"|||\").concat(scaleStartPoint.y);\n endPoint.id = \"\".concat(scaleEndPoint.x, \"|||\").concat(scaleEndPoint.y);\n var startPoints = getBoxPoints(scaleStartPoint, startPoint, startNode, scaleEndPoint, cfg);\n var endPoints = getBoxPoints(scaleEndPoint, endPoint, endNode, scaleStartPoint, cfg);\n startPoints.forEach(function (point) {\n delete map[point.id];\n });\n endPoints.forEach(function (point) {\n delete map[point.id];\n });\n var openSet = {};\n var closedSet = {};\n var cameFrom = {}; // 从起点到当前点已产生的 cost, default: Infinity\n\n var gScore = {}; // 起点经过当前点到达终点预估的 cost, default: Infinity\n\n var fScore = {}; // initialize\n\n for (var i = 0; i < startPoints.length; i++) {\n var firstStep = startPoints[i];\n openSet[firstStep.id] = firstStep; // cameFrom[firstStep.id] = startPoint.id;\n\n gScore[firstStep.id] = 0;\n fScore[firstStep.id] = estimateCost(firstStep, endPoints, cfg.distFunc);\n }\n\n var remainLoops = cfg.maximumLoops;\n var penalties = cfg.penalties;\n var current, curCost, direction, neighbor, neighborCost, costFromStart, directionChange;\n\n while (Object.keys(openSet).length > 0 && remainLoops > 0) {\n current = undefined;\n curCost = Infinity; // 找到 openSet 中 fScore 最小的点\n\n Object.keys(openSet).forEach(function (key) {\n var id = openSet[key].id;\n\n if (fScore[id] <= curCost) {\n curCost = fScore[id];\n current = openSet[id];\n }\n });\n if (!current) break; // 如果 fScore 最小的点就是终点\n\n if (endPoints.findIndex(function (point) {\n return point.x === current.x && point.y === current.y;\n }) > -1) {\n return getControlPoints(current, cameFrom, scaleStartPoint, endPoint, startPoint, scaleEndPoint, gridSize);\n }\n\n delete openSet[current.id];\n closedSet[current.id] = true; // 获取符合条件的下一步的候选连接点\n // 沿候选方向走一步\n\n for (var i = 0; i < cfg.directions.length; i++) {\n direction = cfg.directions[i];\n neighbor = {\n x: current.x + direction.stepX,\n y: current.y + direction.stepY,\n id: \"\".concat(Math.round(current.x) + direction.stepX, \"|||\").concat(Math.round(current.y) + direction.stepY)\n };\n if (closedSet[neighbor.id]) continue;\n directionChange = getDirectionChange(current, neighbor, cameFrom, scaleStartPoint);\n if (directionChange > cfg.maxAllowedDirectionChange) continue;\n if (map[neighbor.id]) continue; // 如果交叉则跳过\n // 将候选点加入 openSet, 并计算每个候选点的 cost\n\n if (!openSet[neighbor.id]) {\n openSet[neighbor.id] = neighbor;\n }\n\n neighborCost = cfg.distFunc(current, neighbor) + (isNaN(penalties[directionChange]) ? gridSize : penalties[directionChange]);\n costFromStart = gScore[current.id] + neighborCost;\n\n if (gScore[neighbor.id] && costFromStart >= gScore[neighbor.id]) {\n continue;\n }\n\n cameFrom[neighbor.id] = current;\n gScore[neighbor.id] = costFromStart;\n fScore[neighbor.id] = costFromStart + estimateCost(neighbor, endPoints, cfg.distFunc);\n }\n\n remainLoops -= 1;\n }\n\n return cfg.fallbackRoute(startPoint, endPoint, startNode, endNode, cfg);\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/edges/router.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _contain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contain */ \"./node_modules/@antv/graphlib/es/comparision/contain.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"containAllSameEdges\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"containAllSameEdges\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"containAllSameNodes\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"containAllSameNodes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"containSameEdges\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"containSameEdges\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"containSameNodes\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"containSameNodes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isGraphOptionSame\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"isGraphOptionSame\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getSameEdges\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"getSameEdges\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getSameNodes\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"getSameNodes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isGraphSame\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"isGraphSame\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isGraphContainsAnother\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"isGraphContainsAnother\"]; });\n\n/* harmony import */ var _complement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./complement */ \"./node_modules/@antv/graphlib/es/comparision/complement.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isGraphComplement\", function() { return _complement__WEBPACK_IMPORTED_MODULE_1__[\"isGraphComplement\"]; });\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/comparision/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/index.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/index.js ***! - \***************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/graphlib/es/essence/index.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/essence/index.js ***! + \*********************************************************/ +/*! exports provided: isGraph, isSimpleGraph, isNullGraph, hasSelfLoop */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _nodes__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./nodes */ \"./node_modules/@antv/g6-element/es/nodes/index.js\");\n/* harmony import */ var _edges__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./edges */ \"./node_modules/@antv/g6-element/es/edges/index.js\");\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraph\", function() { return isGraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSimpleGraph\", function() { return isSimpleGraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNullGraph\", function() { return isNullGraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hasSelfLoop\", function() { return hasSelfLoop; });\n/* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Graph */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n/**\n * @file To get graph essencial information.\n * @file.zh-CN 获取图的基本信息\n * @module essence\n */\n\n/**\n * @description Check if the object is a graph.\n * @description.zh-CN 检查对象是否为图。\n */\n\nfunction isGraph(obj) {\n return obj instanceof _Graph__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n}\n/**\n * @description Check if the graph is a simple graph.\n * @description.zh-CN 检查图是否为简单图。\n */\n\nfunction isSimpleGraph(graph) {\n if (graph.isMultigraph()) {\n return false;\n }\n\n var edges = graph.edges();\n var edgeStack = new Map();\n\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n\n if (edge.v === edge.w) {\n return false;\n }\n\n var _sort = [edge.v, edge.w].sort(),\n _sort2 = _slicedToArray(_sort, 2),\n v = _sort2[0],\n w = _sort2[1];\n\n var key = \"\".concat(v, \"-\").concat(w);\n\n if (edgeStack.has(key)) {\n return false;\n }\n\n edgeStack.set(key, true);\n }\n\n return true;\n}\n/**\n * @description Check if the graph is a null graph.\n * @description.zh-CN 检查图是否为空图。\n */\n\nfunction isNullGraph(graph) {\n return graph.nodes().length === 0;\n}\n/**\n * @description Check if the graph contains Self loops.\n * @description.zh-CN 检查图是否包含自环。\n */\n\nfunction hasSelfLoop(graph) {\n var edges = graph.edges();\n\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n\n if (edge.v === edge.w) {\n return true;\n }\n }\n\n return false;\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/essence/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/circle.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/circle.js ***! - \**********************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/graphlib/es/generate/compelement.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/generate/compelement.js ***! + \****************************************************************/ +/*! exports provided: getGraphComplement */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n // 带有图标的圆,可用于拓扑图中\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('circle', {\n // 自定义节点时的配置\n options: {\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.size,\n style: {\n x: 0,\n y: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'circle',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n defaultIcon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var icon = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"deepMix\"])({}, defaultIcon, cfg.icon);\n var name = \"\".concat(this.type, \"-keyShape\");\n var keyShape = group.addShape('circle', {\n attrs: style,\n className: name,\n name: name,\n draggable: true\n });\n group['shapeMap'][name] = keyShape;\n var width = icon.width,\n height = icon.height,\n show = icon.show,\n text = icon.text;\n\n if (show) {\n var iconName = \"\".concat(this.type, \"-icon\");\n\n if (text) {\n group['shapeMap'][iconName] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: iconName,\n name: iconName,\n draggable: true\n });\n } else {\n group['shapeMap'][iconName] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2\n }, icon),\n className: iconName,\n name: iconName,\n draggable: true\n });\n }\n }\n\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var linkPoints = (this.mergeStyle || this.getOptions(cfg)).linkPoints;\n if (!linkPoints) return;\n\n var _a = linkPoints || {},\n top = _a.top,\n left = _a.left,\n right = _a.right,\n bottom = _a.bottom,\n markSize = _a.size,\n markR = _a.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(_a, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n\n var size = this.getSize(cfg);\n var r = size[0] / 2;\n\n if (left) {\n // left circle\n var name_1 = 'link-point-left';\n group['shapeMap'][name_1] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -r,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: name_1,\n name: name_1,\n isAnchorPoint: true\n });\n }\n\n if (right) {\n // right circle\n var name_2 = 'link-point-right';\n group['shapeMap'][name_2] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: r,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: name_2,\n name: name_2,\n isAnchorPoint: true\n });\n }\n\n if (top) {\n // top circle\n var name_3 = 'link-point-top';\n group['shapeMap'][name_3] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -r,\n r: markSize / 2 || markR || 5\n }),\n className: name_3,\n name: name_3,\n isAnchorPoint: true\n });\n }\n\n if (bottom) {\n // bottom circle\n var name_4 = 'link-point-bottom';\n group['shapeMap'][name_4] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: r,\n r: markSize / 2 || markR || 5\n }),\n className: name_4,\n name: name_4,\n isAnchorPoint: true\n });\n }\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"deepMix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var r = size[0] / 2;\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n r: r\n }, style);\n\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer();\n var size = this.getSize(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n // const strokeStyle = {\n // stroke: cfg.color,\n // r: size[0] / 2,\n // };\n // // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n // const keyShape = item.get('keyShape');\n // TODO: performance\n // const style = deepMix({}, keyShape.attr(), strokeStyle, cfg.style);\n // const style = deepMix({}, keyShape.attr(), cfg.style);\n\n var style = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, cfg.style);\n\n if (cfg.style.stroke === undefined && cfg.color) {\n style.stroke = cfg.color;\n }\n\n if (cfg.style.r === undefined && !isNaN(size[0])) {\n style.r = size[0] / 2;\n }\n\n this.updateShape(cfg, item, style, true, updateType); // (this as any).updateShape(cfg, item, style, true, updateType);\n\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/circle.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getGraphComplement\", function() { return getGraphComplement; });\n/* harmony import */ var _essence__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../essence */ \"./node_modules/@antv/graphlib/es/essence/index.js\");\n/* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Graph */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\n\n\n/**\n * @description Get the graph's complement\n * @description.zh-CN 获取图的补图\n */\n\nvar getGraphComplement = function getGraphComplement(originGraph) {\n if (!Object(_essence__WEBPACK_IMPORTED_MODULE_0__[\"isSimpleGraph\"])(originGraph)) {\n return null;\n }\n\n var nodeCount = originGraph.nodeCount();\n var complementGraph = new _Graph__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n compound: originGraph.isCompound(),\n directed: originGraph.isDirected(),\n multigraph: originGraph.isMultigraph()\n });\n var nodes = originGraph.nodes();\n\n for (var i = 0; i < nodeCount; i++) {\n var nodei = nodes[i];\n complementGraph.setNode(nodei, originGraph.node(nodei));\n\n for (var j = i + 1; j < nodeCount; j++) {\n var nodej = nodes[j];\n\n if (!originGraph.hasEdge(nodei, nodej)) {\n complementGraph.setEdge(nodei, nodej);\n }\n }\n }\n\n return complementGraph;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/generate/compelement.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/diamond.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/diamond.js ***! - \***********************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/graphlib/es/generate/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/generate/index.js ***! + \**********************************************************/ +/*! exports provided: getGraphComplement */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n // 菱形shape\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('diamond', {\n // 自定义节点时的配置\n options: {\n size: [80, 80],\n style: {\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'diamond',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n icon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('path', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var w = icon.width,\n h = icon.height,\n show = icon.show,\n text = icon.text;\n\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -w / 2,\n y: -h / 2\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n\n if (left) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n\n if (right) {\n // right circle\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n\n if (top) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n\n if (bottom) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n },\n getPath: function getPath(cfg) {\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n var path = [['M', 0, -height / 2], ['L', width / 2, 0], ['L', 0, height / 2], ['L', -width / 2, 0], ['Z'] // 封闭\n ];\n return path;\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, strokeStyle);\n var path = this.getPath(cfg);\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: path\n }, style);\n\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n\n var defaultStyle = this.getOptions({}).style;\n var path = this.getPath(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n\n var strokeStyle = {\n stroke: cfg.color,\n path: path\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/diamond.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _compelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compelement */ \"./node_modules/@antv/graphlib/es/generate/compelement.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getGraphComplement\", function() { return _compelement__WEBPACK_IMPORTED_MODULE_0__[\"getGraphComplement\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/generate/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/donut.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/donut.js ***! - \*********************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/graphlib/es/index.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/index.js ***! + \*************************************************/ +/*! exports provided: Graph, GraphWithEvent, algorithm, comparision, essence, generate */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\nvar defaultSubjectColors = _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].defaultSubjectColors; // 饼图节点\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('donut', {\n // 自定义节点时的配置\n options: {\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.size,\n style: {\n x: 0,\n y: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'circle',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n defaultIcon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var icon = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"deepMix\"])({}, defaultIcon, cfg.icon);\n var keyShape = group.addShape('circle', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n draggable: true,\n name: \"\".concat(this.type, \"-keyShape\")\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var width = icon.width,\n height = icon.height,\n show = icon.show,\n text = icon.text;\n\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n\n var donutR = keyShape.attr('r');\n var innerR = 0.6 * donutR; // 甜甜圈的内环半径\n\n var arcR = (donutR + innerR) / 2; // 内环半径与外环半径的平均值\n\n var _b = cfg,\n _c = _b.donutAttrs,\n donutAttrs = _c === void 0 ? {} : _c,\n _d = _b.donutColorMap,\n donutColorMap = _d === void 0 ? {} : _d;\n var attrNum = Object.keys(donutAttrs).length;\n\n if (donutAttrs && attrNum > 1) {\n var attrs_1 = [];\n var totalValue_1 = 0;\n Object.keys(donutAttrs).forEach(function (name) {\n var value = donutAttrs[name] || 0;\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(value)) return;\n attrs_1.push({\n key: name,\n value: value,\n color: donutColorMap[name]\n });\n totalValue_1 += value;\n });\n\n if (totalValue_1) {\n var lineWidth_1 = donutR - innerR;\n\n if (attrNum === 1) {\n group['shapeMap']['fan-shape-0'] = group.addShape('circle', {\n attrs: {\n r: arcR,\n x: 0,\n y: 0,\n stroke: attrs_1[0].color || defaultSubjectColors[0],\n lineWidth: lineWidth_1\n },\n name: \"fan-shape-0\",\n draggable: true\n });\n return;\n }\n\n var arcBegin_1 = [arcR, 0];\n var beginAngle_1 = 0;\n attrs_1.forEach(function (attr, i) {\n var percent = attr.value / totalValue_1;\n if (percent < 0.001) return;\n if (percent > 0.999) percent = 1;\n\n if (percent === 1) {\n group['shapeMap'][\"fan-shape-\".concat(i)] = group.addShape('circle', {\n attrs: {\n r: arcR,\n x: 0,\n y: 0,\n stroke: attr.color || defaultSubjectColors[i % defaultSubjectColors.length],\n lineWidth: lineWidth_1\n },\n name: \"fan-shape-\".concat(i),\n draggable: true\n });\n return;\n }\n\n attr.percent = percent;\n attr.angle = percent * Math.PI * 2;\n attr.beginAgnle = beginAngle_1;\n beginAngle_1 += attr.angle;\n attr.endAngle = beginAngle_1;\n attr.arcBegin = arcBegin_1;\n attr.arcEnd = [arcR * Math.cos(attr.endAngle), -arcR * Math.sin(attr.endAngle)];\n var isBig = attr.angle > Math.PI ? 1 : 0;\n var 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]]];\n group['shapeMap'][\"fan-shape-\".concat(i)] = group.addShape('path', {\n attrs: {\n path: path,\n lineWidth: lineWidth_1,\n stroke: attr.color || defaultSubjectColors[i % defaultSubjectColors.length]\n },\n name: \"fan-shape-\".concat(i),\n draggable: true\n });\n arcBegin_1 = attr.arcEnd;\n });\n }\n }\n\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n update: undefined\n}, 'circle');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/donut.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Graph */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Graph\", function() { return _Graph__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _Graph_event__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Graph/event */ \"./node_modules/@antv/graphlib/es/Graph/event.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GraphWithEvent\", function() { return _Graph_event__WEBPACK_IMPORTED_MODULE_1__[\"GraphWithEvent\"]; });\n\n/* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./algorithm */ \"./node_modules/@antv/graphlib/es/algorithm/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"algorithm\", function() { return _algorithm__WEBPACK_IMPORTED_MODULE_2__; });\n/* harmony import */ var _comparision__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./comparision */ \"./node_modules/@antv/graphlib/es/comparision/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"comparision\", function() { return _comparision__WEBPACK_IMPORTED_MODULE_3__; });\n/* harmony import */ var _essence__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./essence */ \"./node_modules/@antv/graphlib/es/essence/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"essence\", function() { return _essence__WEBPACK_IMPORTED_MODULE_4__; });\n/* harmony import */ var _generate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./generate */ \"./node_modules/@antv/graphlib/es/generate/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"generate\", function() { return _generate__WEBPACK_IMPORTED_MODULE_5__; });\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/ellipse.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/ellipse.js ***! - \***********************************************************/ -/*! no exports provided */ +/***/ "./node_modules/@antv/graphlib/es/util.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/graphlib/es/util.js ***! + \************************************************/ +/*! exports provided: incrementOrInitEntry, decrementOrRemoveEntry, edgeArgsToId, edgeArgsToObj, edgeObjToId, isFunction */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\n/**\n * 基本的椭圆,可以添加文本,默认文本居中\n */\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('ellipse', {\n // 自定义节点时的配置\n options: {\n size: [80, 40],\n style: {\n x: 0,\n y: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'ellipse',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n icon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('ellipse', {\n attrs: style,\n className: 'ellipse-keyShape',\n name: 'ellipse-keyShape',\n draggable: true\n });\n group['shapeMap']['ellipse-keyShape'] = keyShape;\n var width = icon.width,\n height = icon.height,\n show = icon.show,\n text = icon.text;\n\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n\n var size = this.getSize(cfg);\n var rx = size[0] / 2;\n var ry = size[1] / 2;\n\n if (left) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -rx,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n\n if (right) {\n // right circle\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: rx,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n\n if (top) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -ry,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n\n if (bottom) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: ry,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var rx = size[0] / 2;\n var ry = size[1] / 2;\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n rx: rx,\n ry: ry\n }, style);\n\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n\n var defaultStyle = this.getOptions({}).style;\n var size = this.getSize(cfg);\n var strokeStyle = {\n stroke: cfg.color,\n rx: size[0] / 2,\n ry: size[1] / 2\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/ellipse.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"incrementOrInitEntry\", function() { return incrementOrInitEntry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decrementOrRemoveEntry\", function() { return decrementOrRemoveEntry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"edgeArgsToId\", function() { return edgeArgsToId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"edgeArgsToObj\", function() { return edgeArgsToObj; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"edgeObjToId\", function() { return edgeObjToId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFunction\", function() { return isFunction; });\n/* harmony import */ var _Graph_enum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Graph/enum */ \"./node_modules/@antv/graphlib/es/Graph/enum.js\");\n\n/**\n * @description add one to key's value in map\n * @description.zh-CN 在 map 中 key 的值加 1\n * @param map\n * @param key\n */\n\nfunction incrementOrInitEntry(map, key) {\n var val = map.get(key) || 0;\n map.set(key, val + 1);\n}\n/**\n * @description minus one from key's value in map, is value is 0, delete the key\n * @description.zh-CN 在 map 中 key 的值减 1,如果值为 0,则删除 key\n */\n\nfunction decrementOrRemoveEntry(map, key) {\n var val = map.get(key);\n\n if (val !== undefined) {\n val = val - 1;\n\n if (val > 0) {\n map.set(key, val);\n } else {\n map.delete(key);\n }\n }\n}\n/**\n * @description convert edge to string id\n * @description.zh-CN 转换边为字符串 id\n */\n\nfunction edgeArgsToId(isDirected, v_, w_, name) {\n var v = String(v_);\n var w = String(w_);\n\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n\n return v + _Graph_enum__WEBPACK_IMPORTED_MODULE_0__[\"GraphEnum\"].EDGE_KEY_DELIM + w + _Graph_enum__WEBPACK_IMPORTED_MODULE_0__[\"GraphEnum\"].EDGE_KEY_DELIM + (name === undefined ? _Graph_enum__WEBPACK_IMPORTED_MODULE_0__[\"GraphEnum\"].DEFAULT_EDGE_NAME : name);\n}\n/**\n * @description convert edge arguments to edge object\n * @description.zh-CN 转换边参数为边对象\n */\n\nfunction edgeArgsToObj(isDirected, v, w, name) {\n var strV = String(v);\n var strW = String(w);\n var edgeObj = {\n v: v,\n w: w\n };\n\n if (!isDirected && strV > strW) {\n var tmp = edgeObj.v;\n edgeObj.v = edgeObj.w;\n edgeObj.w = tmp;\n }\n\n if (name !== undefined) {\n edgeObj.name = name;\n }\n\n return edgeObj;\n}\n/**\n * @description convert edge object to string id\n * @description.zh-CN 转换边对象为字符串 id\n */\n\nfunction edgeObjToId(isDirected, edgeObj) {\n return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);\n}\nfunction isFunction(obj) {\n return typeof obj === 'function';\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/util.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/index.js": +/***/ "./node_modules/@antv/hierarchy/build/hierarchy.js": /*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/index.js ***! + !*** ./node_modules/@antv/hierarchy/build/hierarchy.js ***! \*********************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _circle__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./circle */ \"./node_modules/@antv/g6-element/es/nodes/circle.js\");\n/* harmony import */ var _rect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect */ \"./node_modules/@antv/g6-element/es/nodes/rect.js\");\n/* harmony import */ var _ellipse__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./ellipse */ \"./node_modules/@antv/g6-element/es/nodes/ellipse.js\");\n/* harmony import */ var _diamond__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./diamond */ \"./node_modules/@antv/g6-element/es/nodes/diamond.js\");\n/* harmony import */ var _triangle__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./triangle */ \"./node_modules/@antv/g6-element/es/nodes/triangle.js\");\n/* harmony import */ var _modelRect__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./modelRect */ \"./node_modules/@antv/g6-element/es/nodes/modelRect.js\");\n/* harmony import */ var _star__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./star */ \"./node_modules/@antv/g6-element/es/nodes/star.js\");\n/* harmony import */ var _donut__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./donut */ \"./node_modules/@antv/g6-element/es/nodes/donut.js\");\n\n\n\n\n\n\n\n // import './image';\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/index.js?"); +eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse {}\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 36);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n return Array.isArray ? Array.isArray(value) : Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Array');\n});\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar isArrayLike = function (value) {\n /**\n * isArrayLike([1, 2, 3]) => true\n * isArrayLike(document.body.children) => true\n * isArrayLike('abc') => true\n * isArrayLike(Function) => false\n */\n return value !== null && typeof value !== 'function' && isFinite(value.length);\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isArrayLike);\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n/**\n * 是否为函数\n * @param {*} fn 对象\n * @return {Boolean} 是否函数\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Function');\n});\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar toString = {}.toString;\nvar isType = function (value, type) {\n return toString.call(value) === '[object ' + type + ']';\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isType);\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (str) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(str, 'String');\n});\n\n/***/ }),\n/* 5 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n/**\n * 判断是否数字\n * @return {Boolean} 是否数字\n */\n\nvar isNumber = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Number');\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isNumber);\n\n/***/ }),\n/* 6 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _require = __webpack_require__(38),\n mix = _require.mix;\n\n/**\n * Get average height or height for node's position calculation, according to align.\n * @param {*} preNode previous node\n * @param {*} node current node, whose position is going to be calculated\n * @param {'center' | undefined} align 'center' means nodes align at the center, other value means align at the left-top\n * @param {string} heightField field name for height value on preNode and node\n * @return {number} the height for calculation\n */\nfunction getHeight(preNode, node, align, heightField) {\n if (heightField === void 0) {\n heightField = 'height';\n }\n return align === 'center' ? (preNode[heightField] + node[heightField]) / 2 : preNode.height;\n}\nmodule.exports = {\n assign: mix,\n getHeight: getHeight\n};\n\n/***/ }),\n/* 7 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// isFinite,\nvar isNil = function (value) {\n /**\n * isNil(null) => true\n * isNil() => true\n */\n return value === null || value === undefined;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isNil);\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_object__ = __webpack_require__(12);\n\n\nfunction each(elements, func) {\n if (!elements) {\n return;\n }\n var rst;\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(elements)) {\n for (var i = 0, len = elements.length; i < len; i++) {\n rst = func(elements[i], i);\n if (rst === false) {\n break;\n }\n }\n } else if (Object(__WEBPACK_IMPORTED_MODULE_1__is_object__[\"a\" /* default */])(elements)) {\n for (var k in elements) {\n if (elements.hasOwnProperty(k)) {\n rst = func(elements[k], k);\n if (rst === false) {\n break;\n }\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (each);\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(7);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(value)) return '';\n return value.toString();\n});\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object_like__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_type__ = __webpack_require__(3);\n\n\nvar isPlainObject = function (value) {\n /**\n * isObjectLike(new Foo) => false\n * isObjectLike([1, 2, 3]) => false\n * isObjectLike({ x: 0, y: 0 }) => true\n * isObjectLike(Object.create(null)) => true\n */\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__[\"a\" /* default */])(value) || !Object(__WEBPACK_IMPORTED_MODULE_1__is_type__[\"a\" /* default */])(value, 'Object')) {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n var proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isPlainObject);\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar hierarchy = __webpack_require__(18);\nvar Layout = /*#__PURE__*/function () {\n function Layout(root, options) {\n if (options === void 0) {\n options = {};\n }\n var me = this;\n me.options = options;\n me.rootNode = hierarchy(root, options);\n }\n var _proto = Layout.prototype;\n _proto.execute = function execute() {\n throw new Error('please override this method');\n };\n return Layout;\n}();\nmodule.exports = Layout;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n /**\n * isObject({}) => true\n * isObject([1, 2, 3]) => true\n * isObject(Function) => true\n * isObject(null) => false\n */\n var type = typeof value;\n return value !== null && type === 'object' || type === 'function';\n});\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nvar contains = function (arr, value) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return false;\n }\n return arr.indexOf(value) > -1;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (contains);\n\n/***/ }),\n/* 14 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar isObjectLike = function (value) {\n /**\n * isObjectLike({}) => true\n * isObjectLike([1, 2, 3]) => true\n * isObjectLike(Function) => false\n * isObjectLike(null) => false\n */\n return typeof value === 'object' && value !== null;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isObjectLike);\n\n/***/ }),\n/* 15 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(2);\n\n\n// @ts-ignore\nvar values = Object.values ? function (obj) {\n return Object.values(obj);\n} : function (obj) {\n var result = [];\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(obj, function (value, key) {\n if (!(Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(obj) && key === 'prototype')) {\n result.push(value);\n }\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (values);\n\n/***/ }),\n/* 16 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = mix;\n// FIXME: Mutable param should be forbidden in static lang.\nfunction _mix(dist, obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {\n dist[key] = obj[key];\n }\n }\n}\nfunction mix(dist, src1, src2, src3) {\n if (src1) _mix(dist, src1);\n if (src2) _mix(dist, src2);\n if (src3) _mix(dist, src3);\n return dist;\n}\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar separateTree = __webpack_require__(35);\nvar VALID_DIRECTIONS = ['LR',\n// left to right\n'RL',\n// right to left\n'TB',\n// top to bottom\n'BT',\n// bottom to top\n'H',\n// horizontal\n'V' // vertical\n];\n\nvar HORIZONTAL_DIRECTIONS = ['LR', 'RL', 'H'];\nvar isHorizontal = function isHorizontal(direction) {\n return HORIZONTAL_DIRECTIONS.indexOf(direction) > -1;\n};\nvar DEFAULT_DIRECTION = VALID_DIRECTIONS[0];\nmodule.exports = function (root, options, layoutAlgrithm) {\n var direction = options.direction || DEFAULT_DIRECTION;\n options.isHorizontal = isHorizontal(direction);\n if (direction && VALID_DIRECTIONS.indexOf(direction) === -1) {\n throw new TypeError(\"Invalid direction: \" + direction);\n }\n if (direction === VALID_DIRECTIONS[0]) {\n // LR\n layoutAlgrithm(root, options);\n } else if (direction === VALID_DIRECTIONS[1]) {\n // RL\n layoutAlgrithm(root, options);\n root.right2left();\n } else if (direction === VALID_DIRECTIONS[2]) {\n // TB\n layoutAlgrithm(root, options);\n } else if (direction === VALID_DIRECTIONS[3]) {\n // BT\n layoutAlgrithm(root, options);\n root.bottom2top();\n } else if (direction === VALID_DIRECTIONS[4] || direction === VALID_DIRECTIONS[5]) {\n // H or V\n // separate into left and right trees\n var _separateTree = separateTree(root, options),\n left = _separateTree.left,\n right = _separateTree.right;\n // do layout for left and right trees\n layoutAlgrithm(left, options);\n layoutAlgrithm(right, options);\n options.isHorizontal ? left.right2left() : left.bottom2top();\n // combine left and right trees\n right.translate(left.x - right.x, left.y - right.y);\n // translate root\n root.x = left.x;\n root.y = right.y;\n var bb = root.getBoundingBox();\n if (options.isHorizontal) {\n if (bb.top < 0) {\n root.translate(0, -bb.top);\n }\n } else {\n if (bb.left < 0) {\n root.translate(-bb.left, 0);\n }\n }\n }\n // fixed root position, default value is true\n var fixedRoot = options.fixedRoot;\n if (fixedRoot === undefined) fixedRoot = true;\n if (fixedRoot) {\n root.translate(-(root.x + root.width / 2 + root.hgap), -(root.y + root.height / 2 + root.vgap));\n }\n return root;\n};\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* eslint-disable no-cond-assign */\nvar util = __webpack_require__(6);\nvar PEM = 18;\nvar DEFAULT_HEIGHT = PEM * 2;\nvar DEFAULT_GAP = PEM;\nvar DEFAULT_OPTIONS = {\n getId: function getId(d) {\n return d.id || d.name;\n },\n getPreH: function getPreH(d) {\n return d.preH || 0;\n },\n getPreV: function getPreV(d) {\n return d.preV || 0;\n },\n getHGap: function getHGap(d) {\n return d.hgap || DEFAULT_GAP;\n },\n getVGap: function getVGap(d) {\n return d.vgap || DEFAULT_GAP;\n },\n getChildren: function getChildren(d) {\n return d.children;\n },\n getHeight: function getHeight(d) {\n return d.height || DEFAULT_HEIGHT;\n },\n getWidth: function getWidth(d) {\n var label = d.label || ' ';\n return d.width || label.split('').length * PEM; // FIXME DO NOT get width like this\n }\n};\n\nfunction Node(data, options) {\n var me = this;\n me.vgap = me.hgap = 0;\n if (data instanceof Node) return data;\n me.data = data;\n /*\n * Gaps: filling space between nodes\n * (x, y) ----------------------\n * | vgap |\n * | -------------------- h\n * | h | | e\n * | g | | i\n * | a | | g\n * | p | | h\n * | --------------------- t\n * | |\n * -----------width------------\n */\n var hgap = options.getHGap(data);\n var vgap = options.getVGap(data);\n me.preH = options.getPreH(data);\n me.preV = options.getPreV(data);\n me.width = options.getWidth(data);\n me.height = options.getHeight(data);\n me.width += me.preH;\n me.height += me.preV;\n me.id = options.getId(data);\n me.x = me.y = 0;\n me.depth = 0;\n if (!me.children) {\n me.children = [];\n }\n me.addGap(hgap, vgap);\n return me;\n}\nutil.assign(Node.prototype, {\n isRoot: function isRoot() {\n return this.depth === 0;\n },\n isLeaf: function isLeaf() {\n return this.children.length === 0;\n },\n addGap: function addGap(hgap, vgap) {\n var me = this;\n me.hgap += hgap;\n me.vgap += vgap;\n me.width += 2 * hgap;\n me.height += 2 * vgap;\n },\n eachNode: function eachNode(callback) {\n // Depth First traverse\n var me = this;\n var nodes = [me];\n var current;\n while (current = nodes.shift()) {\n callback(current);\n nodes = current.children.concat(nodes);\n }\n },\n DFTraverse: function DFTraverse(callback) {\n // Depth First traverse\n this.eachNode(callback);\n },\n BFTraverse: function BFTraverse(callback) {\n // Breadth First traverse\n var me = this;\n var nodes = [me];\n var current;\n while (current = nodes.shift()) {\n callback(current);\n nodes = nodes.concat(current.children);\n }\n },\n getBoundingBox: function getBoundingBox() {\n // BBox for just one tree node\n var bb = {\n left: Number.MAX_VALUE,\n top: Number.MAX_VALUE,\n width: 0,\n height: 0\n };\n this.eachNode(function (node) {\n bb.left = Math.min(bb.left, node.x);\n bb.top = Math.min(bb.top, node.y);\n bb.width = Math.max(bb.width, node.x + node.width);\n bb.height = Math.max(bb.height, node.y + node.height);\n });\n return bb;\n },\n // translate\n translate: function translate(tx, ty) {\n if (tx === void 0) {\n tx = 0;\n }\n if (ty === void 0) {\n ty = 0;\n }\n this.eachNode(function (node) {\n node.x += tx;\n node.y += ty;\n node.x += node.preH;\n node.y += node.preV;\n });\n },\n right2left: function right2left() {\n var me = this;\n var bb = me.getBoundingBox();\n me.eachNode(function (node) {\n node.x = node.x - (node.x - bb.left) * 2 - node.width;\n // node.x = - node.x;\n });\n\n me.translate(bb.width, 0);\n },\n bottom2top: function bottom2top() {\n var me = this;\n var bb = me.getBoundingBox();\n me.eachNode(function (node) {\n node.y = node.y - (node.y - bb.top) * 2 - node.height;\n // node.y = - node.y;\n });\n\n me.translate(0, bb.height);\n }\n});\nfunction hierarchy(data, options, isolated) {\n if (options === void 0) {\n options = {};\n }\n options = util.assign({}, DEFAULT_OPTIONS, options);\n var root = new Node(data, options);\n var nodes = [root];\n var node;\n if (!isolated && !data.collapsed) {\n while (node = nodes.shift()) {\n if (!node.data.collapsed) {\n var children = options.getChildren(node.data);\n var length = children ? children.length : 0;\n node.children = new Array(length);\n if (children && length) {\n for (var i = 0; i < length; i++) {\n var child = new Node(children[i], options);\n node.children[i] = child;\n nodes.push(child);\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n }\n }\n return root;\n}\nmodule.exports = hierarchy;\n\n/***/ }),\n/* 19 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nvar filter = function (arr, func) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n if (func(value, index)) {\n result.push(value);\n }\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (filter);\n\n/***/ }),\n/* 20 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(7);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys__ = __webpack_require__(21);\n\n\nfunction isMatch(obj, attrs) {\n var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys__[\"a\" /* default */])(attrs);\n var length = _keys.length;\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(obj)) return !length;\n for (var i = 0; i < length; i += 1) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) {\n return false;\n }\n }\n return true;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (isMatch);\n\n/***/ }),\n/* 21 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(2);\n\n\nvar keys = Object.keys ? function (obj) {\n return Object.keys(obj);\n} : function (obj) {\n var result = [];\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(obj, function (value, key) {\n if (!(Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(obj) && key === 'prototype')) {\n result.push(key);\n }\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (keys);\n\n/***/ }),\n/* 22 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the maximum value.\n * @example\n *\n * max([1, 2]);\n * // => 2\n *\n * max([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * max(data);\n * // => 1250010\n * // Math.max(...data) will encounter \"Maximum call stack size exceeded\" error\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (arr) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.max(prev, curr);\n }, arr[0]);\n});\n\n/***/ }),\n/* 23 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the minimum value.\n * @example\n *\n * min([1, 2]);\n * // => 1\n *\n * min([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * min(data);\n * // => 1250010\n * // Math.min(...data) will encounter \"Maximum call stack size exceeded\" error\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (arr) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.min(prev, curr);\n }, arr[0]);\n});\n\n/***/ }),\n/* 24 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nvar splice = Array.prototype.splice;\nvar pullAt = function pullAt(arr, indexes) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return [];\n }\n var length = arr ? indexes.length : 0;\n var last = length - 1;\n while (length--) {\n var previous = void 0;\n var index = indexes[length];\n if (length === last || index !== previous) {\n previous = index;\n splice.call(arr, index, 1);\n }\n }\n return arr;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (pullAt);\n\n/***/ }),\n/* 25 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_plain_object__ = __webpack_require__(10);\n\n\n\nvar reduce = function (arr, fn, init) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__[\"a\" /* default */])(arr) && !Object(__WEBPACK_IMPORTED_MODULE_2__is_plain_object__[\"a\" /* default */])(arr)) {\n return arr;\n }\n var result = init;\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(arr, function (data, i) {\n result = fn(result, data, i);\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (reduce);\n\n/***/ }),\n/* 26 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = uniq;\nfunction uniq(arr, cache) {\n if (cache === void 0) {\n cache = new Map();\n }\n var r = [];\n if (Array.isArray(arr)) {\n for (var i = 0, len = arr.length; i < len; i++) {\n var item = arr[i];\n // 加一个 cache,提升性能\n if (!cache.has(item)) {\n r.push(item);\n cache.set(item, true);\n }\n }\n }\n return r;\n}\n\n/***/ }),\n/* 27 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = groupToMap;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_by__ = __webpack_require__(28);\n\n\n\n/**\n * 将数据分组成 map\n * @param data\n * @param condition\n */\nfunction groupToMap(data, condition) {\n if (!condition) {\n return {\n 0: data\n };\n }\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(condition)) {\n // 如果是字符串,则按照 a*b 风格成数组\n var paramscondition_1 = Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(condition) ? condition : condition.replace(/\\s+/g, '').split('*');\n condition = function (row) {\n var unique = '_'; // 避免出现数字作为Key的情况,会进行按照数字的排序\n // 根据字段列表的值,拼接成 key\n for (var i = 0, l = paramscondition_1.length; i < l; i++) {\n unique += row[paramscondition_1[i]] && row[paramscondition_1[i]].toString();\n }\n return unique;\n };\n }\n return Object(__WEBPACK_IMPORTED_MODULE_2__group_by__[\"a\" /* default */])(data, condition);\n}\n\n/***/ }),\n/* 28 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(2);\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction groupBy(data, condition) {\n if (!condition || !Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(data)) {\n return {};\n }\n var result = {};\n // 兼容方法和 字符串的写法\n var predicate = Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(condition) ? condition : function (item) {\n return item[condition];\n };\n var key;\n for (var i = 0; i < data.length; i++) {\n var item = data[i];\n key = predicate(item);\n if (hasOwnProperty.call(result, key)) {\n result[key].push(item);\n } else {\n result[key] = [item];\n }\n }\n return result;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (groupBy);\n\n/***/ }),\n/* 29 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, key) {\n return obj.hasOwnProperty(key);\n});\n\n/***/ }),\n/* 30 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar toString = {}.toString;\nvar getType = function (value) {\n return toString.call(value).replace(/^\\[object /, '').replace(/]$/, '');\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (getType);\n\n/***/ }),\n/* 31 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar objectProto = Object.prototype;\nvar isPrototype = function (value) {\n var Ctor = value && value.constructor;\n var proto = typeof Ctor === 'function' && Ctor.prototype || objectProto;\n return value === proto;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isPrototype);\n\n/***/ }),\n/* 32 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(2);\n\n/**\n * _.memoize(calColor);\n * _.memoize(calColor, (...args) => args[0]);\n * @param f\n * @param resolver\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (f, resolver) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_function__[\"a\" /* default */])(f)) {\n throw new TypeError('Expected a function');\n }\n var memoized = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key\n var key = resolver ? resolver.apply(this, args) : args[0];\n var cache = memoized.cache;\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = f.apply(this, args);\n // 缓存起来\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n});\n\n/***/ }),\n/* 33 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object_like__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_string__ = __webpack_require__(4);\n\n\n\nvar isEqual = function (value, other) {\n if (value === other) {\n return true;\n }\n if (!value || !other) {\n return false;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_2__is_string__[\"a\" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_2__is_string__[\"a\" /* default */])(other)) {\n return false;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(other)) {\n if (value.length !== other.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < value.length; i++) {\n rst = isEqual(value[i], other[i]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__[\"a\" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__[\"a\" /* default */])(other)) {\n var valueKeys = Object.keys(value);\n var otherKeys = Object.keys(other);\n if (valueKeys.length !== otherKeys.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < valueKeys.length; i++) {\n rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n return false;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isEqual);\n\n/***/ }),\n/* 34 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0_tslib__ = __webpack_require__(116);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values__ = __webpack_require__(15);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__memoize__ = __webpack_require__(32);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_string__ = __webpack_require__(4);\n\n\n\n\nvar ctx;\n/**\n * 计算文本的宽度\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (Object(__WEBPACK_IMPORTED_MODULE_2__memoize__[\"a\" /* default */])(function (text, font) {\n if (font === void 0) {\n font = {};\n }\n var fontSize = font.fontSize,\n fontFamily = font.fontFamily,\n fontWeight = font.fontWeight,\n fontStyle = font.fontStyle,\n fontVariant = font.fontVariant;\n if (!ctx) {\n ctx = document.createElement('canvas').getContext('2d');\n }\n ctx.font = [fontStyle, fontVariant, fontWeight, fontSize + \"px\", fontFamily].join(' ');\n return ctx.measureText(Object(__WEBPACK_IMPORTED_MODULE_3__is_string__[\"a\" /* default */])(text) ? text : '').width;\n}, function (text, font) {\n if (font === void 0) {\n font = {};\n }\n return Object(__WEBPACK_IMPORTED_MODULE_0_tslib__[\"a\" /* __spreadArrays */])([text], Object(__WEBPACK_IMPORTED_MODULE_1__values__[\"a\" /* default */])(font)).join('');\n}));\n\n/***/ }),\n/* 35 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar hierarchy = __webpack_require__(18);\nmodule.exports = function (root, options) {\n // separate into left and right trees\n var left = hierarchy(root.data, options, true); // root only\n var right = hierarchy(root.data, options, true); // root only\n // automatically\n var treeSize = root.children.length;\n var rightTreeSize = Math.round(treeSize / 2);\n // separate left and right tree by meta data\n var getSide = options.getSide || function (child, index) {\n if (index < rightTreeSize) {\n return 'right';\n }\n return 'left';\n };\n for (var i = 0; i < treeSize; i++) {\n var child = root.children[i];\n var side = getSide(child, i);\n if (side === 'right') {\n right.children.push(child);\n } else {\n left.children.push(child);\n }\n }\n left.eachNode(function (node) {\n if (!node.isRoot()) {\n node.side = 'left';\n }\n });\n right.eachNode(function (node) {\n if (!node.isRoot()) {\n node.side = 'right';\n }\n });\n return {\n left: left,\n right: right\n };\n};\n\n/***/ }),\n/* 36 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar hierarchy = {\n compactBox: __webpack_require__(37),\n dendrogram: __webpack_require__(120),\n indented: __webpack_require__(122),\n mindmap: __webpack_require__(124)\n};\nmodule.exports = hierarchy;\n\n/***/ }),\n/* 37 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar TreeLayout = __webpack_require__(11);\nvar nonLayeredTidyTree = __webpack_require__(119);\nvar doTreeLayout = __webpack_require__(17);\nvar util = __webpack_require__(6);\nvar CompactBoxTreeLayout = /*#__PURE__*/function (_TreeLayout) {\n _inheritsLoose(CompactBoxTreeLayout, _TreeLayout);\n function CompactBoxTreeLayout() {\n return _TreeLayout.apply(this, arguments) || this;\n }\n var _proto = CompactBoxTreeLayout.prototype;\n _proto.execute = function execute() {\n var me = this;\n return doTreeLayout(me.rootNode, me.options, nonLayeredTidyTree);\n };\n return CompactBoxTreeLayout;\n}(TreeLayout);\nvar DEFAULT_OPTIONS = {};\nfunction compactBoxLayout(root, options) {\n options = util.assign({}, DEFAULT_OPTIONS, options);\n return new CompactBoxTreeLayout(root, options).execute();\n}\nmodule.exports = compactBoxLayout;\n\n/***/ }),\n/* 38 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__contains__ = __webpack_require__(13);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"contains\", function() { return __WEBPACK_IMPORTED_MODULE_0__contains__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"includes\", function() { return __WEBPACK_IMPORTED_MODULE_0__contains__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference__ = __webpack_require__(39);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"difference\", function() { return __WEBPACK_IMPORTED_MODULE_1__difference__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__find__ = __webpack_require__(40);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"find\", function() { return __WEBPACK_IMPORTED_MODULE_2__find__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__find_index__ = __webpack_require__(41);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"findIndex\", function() { return __WEBPACK_IMPORTED_MODULE_3__find_index__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__first_value__ = __webpack_require__(42);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"firstValue\", function() { return __WEBPACK_IMPORTED_MODULE_4__first_value__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten__ = __webpack_require__(43);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"flatten\", function() { return __WEBPACK_IMPORTED_MODULE_5__flatten__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__flatten_deep__ = __webpack_require__(44);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenDeep\", function() { return __WEBPACK_IMPORTED_MODULE_6__flatten_deep__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__get_range__ = __webpack_require__(45);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"getRange\", function() { return __WEBPACK_IMPORTED_MODULE_7__get_range__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__pull__ = __webpack_require__(46);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"pull\", function() { return __WEBPACK_IMPORTED_MODULE_8__pull__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__pull_at__ = __webpack_require__(24);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"pullAt\", function() { return __WEBPACK_IMPORTED_MODULE_9__pull_at__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__reduce__ = __webpack_require__(25);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"reduce\", function() { return __WEBPACK_IMPORTED_MODULE_10__reduce__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__remove__ = __webpack_require__(47);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return __WEBPACK_IMPORTED_MODULE_11__remove__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__sort_by__ = __webpack_require__(48);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"sortBy\", function() { return __WEBPACK_IMPORTED_MODULE_12__sort_by__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__union__ = __webpack_require__(49);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"union\", function() { return __WEBPACK_IMPORTED_MODULE_13__union__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__uniq__ = __webpack_require__(26);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"uniq\", function() { return __WEBPACK_IMPORTED_MODULE_14__uniq__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__values_of_key__ = __webpack_require__(50);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"valuesOfKey\", function() { return __WEBPACK_IMPORTED_MODULE_15__values_of_key__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__head__ = __webpack_require__(51);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"head\", function() { return __WEBPACK_IMPORTED_MODULE_16__head__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__last__ = __webpack_require__(52);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"last\", function() { return __WEBPACK_IMPORTED_MODULE_17__last__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__starts_with__ = __webpack_require__(53);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"startsWith\", function() { return __WEBPACK_IMPORTED_MODULE_18__starts_with__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__ends_with__ = __webpack_require__(54);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"endsWith\", function() { return __WEBPACK_IMPORTED_MODULE_19__ends_with__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__filter__ = __webpack_require__(19);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return __WEBPACK_IMPORTED_MODULE_20__filter__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__every__ = __webpack_require__(55);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"every\", function() { return __WEBPACK_IMPORTED_MODULE_21__every__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__some__ = __webpack_require__(56);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"some\", function() { return __WEBPACK_IMPORTED_MODULE_22__some__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__group__ = __webpack_require__(57);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"group\", function() { return __WEBPACK_IMPORTED_MODULE_23__group__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__group_by__ = __webpack_require__(28);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"groupBy\", function() { return __WEBPACK_IMPORTED_MODULE_24__group_by__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__group_to_map__ = __webpack_require__(27);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"groupToMap\", function() { return __WEBPACK_IMPORTED_MODULE_25__group_to_map__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__get_wrap_behavior__ = __webpack_require__(58);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"getWrapBehavior\", function() { return __WEBPACK_IMPORTED_MODULE_26__get_wrap_behavior__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__wrap_behavior__ = __webpack_require__(59);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"wrapBehavior\", function() { return __WEBPACK_IMPORTED_MODULE_27__wrap_behavior__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__number2color__ = __webpack_require__(60);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"number2color\", function() { return __WEBPACK_IMPORTED_MODULE_28__number2color__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__parse_radius__ = __webpack_require__(61);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"parseRadius\", function() { return __WEBPACK_IMPORTED_MODULE_29__parse_radius__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__clamp__ = __webpack_require__(62);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"clamp\", function() { return __WEBPACK_IMPORTED_MODULE_30__clamp__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__fixed_base__ = __webpack_require__(63);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"fixedBase\", function() { return __WEBPACK_IMPORTED_MODULE_31__fixed_base__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__is_decimal__ = __webpack_require__(64);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isDecimal\", function() { return __WEBPACK_IMPORTED_MODULE_32__is_decimal__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__is_even__ = __webpack_require__(65);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isEven\", function() { return __WEBPACK_IMPORTED_MODULE_33__is_even__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__is_integer__ = __webpack_require__(66);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isInteger\", function() { return __WEBPACK_IMPORTED_MODULE_34__is_integer__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__is_negative__ = __webpack_require__(67);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNegative\", function() { return __WEBPACK_IMPORTED_MODULE_35__is_negative__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__is_number_equal__ = __webpack_require__(68);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumberEqual\", function() { return __WEBPACK_IMPORTED_MODULE_36__is_number_equal__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__is_odd__ = __webpack_require__(69);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isOdd\", function() { return __WEBPACK_IMPORTED_MODULE_37__is_odd__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__is_positive__ = __webpack_require__(70);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isPositive\", function() { return __WEBPACK_IMPORTED_MODULE_38__is_positive__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__max__ = __webpack_require__(22);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return __WEBPACK_IMPORTED_MODULE_39__max__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__max_by__ = __webpack_require__(71);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"maxBy\", function() { return __WEBPACK_IMPORTED_MODULE_40__max_by__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__min__ = __webpack_require__(23);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return __WEBPACK_IMPORTED_MODULE_41__min__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__min_by__ = __webpack_require__(72);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"minBy\", function() { return __WEBPACK_IMPORTED_MODULE_42__min_by__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__mod__ = __webpack_require__(73);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"mod\", function() { return __WEBPACK_IMPORTED_MODULE_43__mod__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__to_degree__ = __webpack_require__(74);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toDegree\", function() { return __WEBPACK_IMPORTED_MODULE_44__to_degree__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__to_integer__ = __webpack_require__(75);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toInteger\", function() { return __WEBPACK_IMPORTED_MODULE_45__to_integer__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__to_radian__ = __webpack_require__(76);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return __WEBPACK_IMPORTED_MODULE_46__to_radian__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__for_in__ = __webpack_require__(77);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"forIn\", function() { return __WEBPACK_IMPORTED_MODULE_47__for_in__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__has__ = __webpack_require__(29);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return __WEBPACK_IMPORTED_MODULE_48__has__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__has_key__ = __webpack_require__(78);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"hasKey\", function() { return __WEBPACK_IMPORTED_MODULE_49__has_key__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__has_value__ = __webpack_require__(79);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"hasValue\", function() { return __WEBPACK_IMPORTED_MODULE_50__has_value__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__keys__ = __webpack_require__(21);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return __WEBPACK_IMPORTED_MODULE_51__keys__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__is_match__ = __webpack_require__(20);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isMatch\", function() { return __WEBPACK_IMPORTED_MODULE_52__is_match__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__values__ = __webpack_require__(15);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return __WEBPACK_IMPORTED_MODULE_53__values__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__lower_case__ = __webpack_require__(80);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"lowerCase\", function() { return __WEBPACK_IMPORTED_MODULE_54__lower_case__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__lower_first__ = __webpack_require__(81);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"lowerFirst\", function() { return __WEBPACK_IMPORTED_MODULE_55__lower_first__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__substitute__ = __webpack_require__(82);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"substitute\", function() { return __WEBPACK_IMPORTED_MODULE_56__substitute__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__upper_case__ = __webpack_require__(83);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"upperCase\", function() { return __WEBPACK_IMPORTED_MODULE_57__upper_case__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__upper_first__ = __webpack_require__(84);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"upperFirst\", function() { return __WEBPACK_IMPORTED_MODULE_58__upper_first__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__get_type__ = __webpack_require__(30);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return __WEBPACK_IMPORTED_MODULE_59__get_type__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__is_arguments__ = __webpack_require__(85);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isArguments\", function() { return __WEBPACK_IMPORTED_MODULE_60__is_arguments__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__is_array__ = __webpack_require__(0);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isArray\", function() { return __WEBPACK_IMPORTED_MODULE_61__is_array__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__is_array_like__ = __webpack_require__(1);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isArrayLike\", function() { return __WEBPACK_IMPORTED_MODULE_62__is_array_like__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__is_boolean__ = __webpack_require__(86);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoolean\", function() { return __WEBPACK_IMPORTED_MODULE_63__is_boolean__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__is_date__ = __webpack_require__(87);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isDate\", function() { return __WEBPACK_IMPORTED_MODULE_64__is_date__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__is_error__ = __webpack_require__(88);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isError\", function() { return __WEBPACK_IMPORTED_MODULE_65__is_error__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__is_function__ = __webpack_require__(2);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isFunction\", function() { return __WEBPACK_IMPORTED_MODULE_66__is_function__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__is_finite__ = __webpack_require__(89);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isFinite\", function() { return __WEBPACK_IMPORTED_MODULE_67__is_finite__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__is_nil__ = __webpack_require__(7);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNil\", function() { return __WEBPACK_IMPORTED_MODULE_68__is_nil__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__is_null__ = __webpack_require__(90);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNull\", function() { return __WEBPACK_IMPORTED_MODULE_69__is_null__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__is_number__ = __webpack_require__(5);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return __WEBPACK_IMPORTED_MODULE_70__is_number__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__is_object__ = __webpack_require__(12);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return __WEBPACK_IMPORTED_MODULE_71__is_object__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__is_object_like__ = __webpack_require__(14);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isObjectLike\", function() { return __WEBPACK_IMPORTED_MODULE_72__is_object_like__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__is_plain_object__ = __webpack_require__(10);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlainObject\", function() { return __WEBPACK_IMPORTED_MODULE_73__is_plain_object__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__is_prototype__ = __webpack_require__(31);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isPrototype\", function() { return __WEBPACK_IMPORTED_MODULE_74__is_prototype__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__is_reg_exp__ = __webpack_require__(91);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isRegExp\", function() { return __WEBPACK_IMPORTED_MODULE_75__is_reg_exp__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__is_string__ = __webpack_require__(4);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isString\", function() { return __WEBPACK_IMPORTED_MODULE_76__is_string__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__is_type__ = __webpack_require__(3);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isType\", function() { return __WEBPACK_IMPORTED_MODULE_77__is_type__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__is_undefined__ = __webpack_require__(92);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isUndefined\", function() { return __WEBPACK_IMPORTED_MODULE_78__is_undefined__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__is_element__ = __webpack_require__(93);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isElement\", function() { return __WEBPACK_IMPORTED_MODULE_79__is_element__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__request_animation_frame__ = __webpack_require__(94);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"requestAnimationFrame\", function() { return __WEBPACK_IMPORTED_MODULE_80__request_animation_frame__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__clear_animation_frame__ = __webpack_require__(95);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"clearAnimationFrame\", function() { return __WEBPACK_IMPORTED_MODULE_81__clear_animation_frame__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__augment__ = __webpack_require__(96);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"augment\", function() { return __WEBPACK_IMPORTED_MODULE_82__augment__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__clone__ = __webpack_require__(97);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return __WEBPACK_IMPORTED_MODULE_83__clone__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__debounce__ = __webpack_require__(98);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return __WEBPACK_IMPORTED_MODULE_84__debounce__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__memoize__ = __webpack_require__(32);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"memoize\", function() { return __WEBPACK_IMPORTED_MODULE_85__memoize__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__deep_mix__ = __webpack_require__(99);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"deepMix\", function() { return __WEBPACK_IMPORTED_MODULE_86__deep_mix__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__each__ = __webpack_require__(8);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"each\", function() { return __WEBPACK_IMPORTED_MODULE_87__each__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__extend__ = __webpack_require__(100);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return __WEBPACK_IMPORTED_MODULE_88__extend__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__index_of__ = __webpack_require__(101);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"indexOf\", function() { return __WEBPACK_IMPORTED_MODULE_89__index_of__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__is_empty__ = __webpack_require__(102);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isEmpty\", function() { return __WEBPACK_IMPORTED_MODULE_90__is_empty__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__is_equal__ = __webpack_require__(33);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isEqual\", function() { return __WEBPACK_IMPORTED_MODULE_91__is_equal__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__is_equal_with__ = __webpack_require__(103);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isEqualWith\", function() { return __WEBPACK_IMPORTED_MODULE_92__is_equal_with__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__map__ = __webpack_require__(104);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return __WEBPACK_IMPORTED_MODULE_93__map__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__map_values__ = __webpack_require__(105);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"mapValues\", function() { return __WEBPACK_IMPORTED_MODULE_94__map_values__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__mix__ = __webpack_require__(16);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"mix\", function() { return __WEBPACK_IMPORTED_MODULE_95__mix__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"assign\", function() { return __WEBPACK_IMPORTED_MODULE_95__mix__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__get__ = __webpack_require__(106);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return __WEBPACK_IMPORTED_MODULE_96__get__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__set__ = __webpack_require__(107);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return __WEBPACK_IMPORTED_MODULE_97__set__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__pick__ = __webpack_require__(108);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"pick\", function() { return __WEBPACK_IMPORTED_MODULE_98__pick__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__omit__ = __webpack_require__(109);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"omit\", function() { return __WEBPACK_IMPORTED_MODULE_99__omit__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__throttle__ = __webpack_require__(110);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return __WEBPACK_IMPORTED_MODULE_100__throttle__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__to_array__ = __webpack_require__(111);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toArray\", function() { return __WEBPACK_IMPORTED_MODULE_101__to_array__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__to_string__ = __webpack_require__(9);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toString\", function() { return __WEBPACK_IMPORTED_MODULE_102__to_string__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__unique_id__ = __webpack_require__(112);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return __WEBPACK_IMPORTED_MODULE_103__unique_id__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__noop__ = __webpack_require__(113);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"noop\", function() { return __WEBPACK_IMPORTED_MODULE_104__noop__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_105__identity__ = __webpack_require__(114);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return __WEBPACK_IMPORTED_MODULE_105__identity__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_106__size__ = __webpack_require__(115);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"size\", function() { return __WEBPACK_IMPORTED_MODULE_106__size__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_107__measure_text_width__ = __webpack_require__(34);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"measureTextWidth\", function() { return __WEBPACK_IMPORTED_MODULE_107__measure_text_width__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_108__get_ellipsis_text__ = __webpack_require__(117);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"getEllipsisText\", function() { return __WEBPACK_IMPORTED_MODULE_108__get_ellipsis_text__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_109__cache__ = __webpack_require__(118);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Cache\", function() { return __WEBPACK_IMPORTED_MODULE_109__cache__[\"a\"]; });\n// array\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// event\n\n\n// format\n\n\n// math\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// object\n\n\n\n\n\n\n\n// string\n\n\n\n\n\n// type\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// other\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// text\n\n\n// 不知道为什么,需要把这个 export,不然 ts 会报类型错误\n\n\n/***/ }),\n/* 39 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains__ = __webpack_require__(13);\n\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to inspect.\n * @param {Array} values The values to exclude.\n * @return {Array} Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3]); // => [1]\n */\nvar difference = function (arr, values) {\n if (values === void 0) {\n values = [];\n }\n return Object(__WEBPACK_IMPORTED_MODULE_0__filter__[\"a\" /* default */])(arr, function (value) {\n return !Object(__WEBPACK_IMPORTED_MODULE_1__contains__[\"a\" /* default */])(values, value);\n });\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (difference);\n\n/***/ }),\n/* 40 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_match__ = __webpack_require__(20);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_plain_object__ = __webpack_require__(10);\n\n\n\n\nfunction find(arr, predicate) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_2__is_array__[\"a\" /* default */])(arr)) return null;\n var _predicate;\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_function__[\"a\" /* default */])(predicate)) {\n _predicate = predicate;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_3__is_plain_object__[\"a\" /* default */])(predicate)) {\n _predicate = function (a) {\n return Object(__WEBPACK_IMPORTED_MODULE_1__is_match__[\"a\" /* default */])(a, predicate);\n };\n }\n if (_predicate) {\n for (var i = 0; i < arr.length; i += 1) {\n if (_predicate(arr[i])) {\n return arr[i];\n }\n }\n }\n return null;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (find);\n\n/***/ }),\n/* 41 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nfunction findIndex(arr, predicate, fromIndex) {\n if (fromIndex === void 0) {\n fromIndex = 0;\n }\n for (var i = fromIndex; i < arr.length; i++) {\n if (predicate(arr[i], i)) {\n // 找到终止循环\n return i;\n }\n }\n return -1;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (findIndex);\n\n/***/ }),\n/* 42 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(7);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);\n\n\nvar firstValue = function (data, name) {\n var rst = null;\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(value)) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array__[\"a\" /* default */])(value)) {\n rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云\n } else {\n rst = value;\n }\n break;\n }\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (firstValue);\n\n/***/ }),\n/* 43 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]\n */\nvar flatten = function (arr) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr)) {\n return [];\n }\n var rst = [];\n for (var i = 0; i < arr.length; i++) {\n rst = rst.concat(arr[i]);\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (flatten);\n\n/***/ }),\n/* 44 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @param {Array} result The array to return.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]\n */\nvar flattenDeep = function (arr, result) {\n if (result === void 0) {\n result = [];\n }\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr)) {\n result.push(arr);\n } else {\n for (var i = 0; i < arr.length; i += 1) {\n flattenDeep(arr[i], result);\n }\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (flattenDeep);\n\n/***/ }),\n/* 45 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__max__ = __webpack_require__(22);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__min__ = __webpack_require__(23);\n\n\n\nvar getRange = function (values) {\n // 存在 NaN 时,min,max 判定会出问题\n var filterValues = values.filter(function (v) {\n return !isNaN(v);\n });\n if (!filterValues.length) {\n // 如果没有数值则直接返回0\n return {\n min: 0,\n max: 0\n };\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(values[0])) {\n var tmp = [];\n for (var i = 0; i < values.length; i++) {\n tmp = tmp.concat(values[i]);\n }\n filterValues = tmp;\n }\n var max = Object(__WEBPACK_IMPORTED_MODULE_1__max__[\"a\" /* default */])(filterValues);\n var min = Object(__WEBPACK_IMPORTED_MODULE_2__min__[\"a\" /* default */])(filterValues);\n return {\n min: min,\n max: max\n };\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (getRange);\n\n/***/ }),\n/* 46 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar arrPrototype = Array.prototype;\nvar splice = arrPrototype.splice;\nvar indexOf = arrPrototype.indexOf;\nvar pull = function (arr) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n var fromIndex = -1;\n while ((fromIndex = indexOf.call(arr, value)) > -1) {\n splice.call(arr, fromIndex, 1);\n }\n }\n return arr;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (pull);\n\n/***/ }),\n/* 47 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pull_at__ = __webpack_require__(24);\n\n\nvar remove = function (arr, predicate) {\n /**\n * const arr = [1, 2, 3, 4]\n * const evens = remove(arr, n => n % 2 == 0)\n * console.log(arr) // => [1, 3]\n * console.log(evens) // => [2, 4]\n */\n var result = [];\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return result;\n }\n var i = -1;\n var indexes = [];\n var length = arr.length;\n while (++i < length) {\n var value = arr[i];\n if (predicate(value, i, arr)) {\n result.push(value);\n indexes.push(i);\n }\n }\n Object(__WEBPACK_IMPORTED_MODULE_1__pull_at__[\"a\" /* default */])(arr, indexes);\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (remove);\n\n/***/ }),\n/* 48 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(2);\n\n\n\nfunction sortBy(arr, key) {\n var comparer;\n if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__[\"a\" /* default */])(key)) {\n comparer = function (a, b) {\n return key(a) - key(b);\n };\n } else {\n var keys_1 = [];\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_string__[\"a\" /* default */])(key)) {\n keys_1.push(key);\n } else if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(key)) {\n keys_1 = key;\n }\n comparer = function (a, b) {\n for (var i = 0; i < keys_1.length; i += 1) {\n var prop = keys_1[i];\n if (a[prop] > b[prop]) {\n return 1;\n }\n if (a[prop] < b[prop]) {\n return -1;\n }\n }\n return 0;\n };\n }\n arr.sort(comparer);\n return arr;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (sortBy);\n\n/***/ }),\n/* 49 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__uniq__ = __webpack_require__(26);\n\nvar union = function () {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n return Object(__WEBPACK_IMPORTED_MODULE_0__uniq__[\"a\" /* default */])([].concat.apply([], sources));\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (union);\n\n/***/ }),\n/* 50 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_nil__ = __webpack_require__(7);\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (data, name) {\n var rst = [];\n var tmpMap = {};\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_nil__[\"a\" /* default */])(value)) {\n // flatten\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(value)) {\n value = [value];\n }\n for (var j = 0; j < value.length; j++) {\n var val = value[j];\n // unique\n if (!tmpMap[val]) {\n rst.push(val);\n tmpMap[val] = true;\n }\n }\n }\n }\n return rst;\n});\n\n/***/ }),\n/* 51 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = head;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nfunction head(o) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(o)) {\n return o[0];\n }\n return undefined;\n}\n\n/***/ }),\n/* 52 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = last;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nfunction last(o) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(o)) {\n var arr = o;\n return arr[arr.length - 1];\n }\n return undefined;\n}\n\n/***/ }),\n/* 53 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(4);\n\n\nfunction startsWith(arr, e) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__is_string__[\"a\" /* default */])(arr) ? arr[0] === e : false;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (startsWith);\n\n/***/ }),\n/* 54 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(4);\n\n\nfunction endsWith(arr, e) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__is_string__[\"a\" /* default */])(arr) ? arr[arr.length - 1] === e : false;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (endsWith);\n\n/***/ }),\n/* 55 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 只要有一个不满足条件就返回 false\n * @param arr\n * @param func\n */\nvar every = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (!func(arr[i], i)) return false;\n }\n return true;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (every);\n\n/***/ }),\n/* 56 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 只要有一个满足条件就返回 true\n * @param arr\n * @param func\n */\nvar some = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (func(arr[i], i)) return true;\n }\n return false;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (some);\n\n/***/ }),\n/* 57 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_to_map__ = __webpack_require__(27);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (data, condition) {\n if (!condition) {\n // 没有条件,则自身改成数组\n return [data];\n }\n var groups = Object(__WEBPACK_IMPORTED_MODULE_0__group_to_map__[\"a\" /* default */])(data, condition);\n var array = [];\n for (var i in groups) {\n array.push(groups[i]);\n }\n return array;\n});\n\n/***/ }),\n/* 58 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 获取封装的事件\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction getWrapBehavior(obj, action) {\n return obj['_wrap_' + action];\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (getWrapBehavior);\n\n/***/ }),\n/* 59 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 封装事件,便于使用上下文this,和便于解除事件时使用\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction wrapBehavior(obj, action) {\n if (obj['_wrap_' + action]) {\n return obj['_wrap_' + action];\n }\n var method = function (e) {\n obj[action](e);\n };\n obj['_wrap_' + action] = method;\n return method;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (wrapBehavior);\n\n/***/ }),\n/* 60 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar numColorCache = {};\nfunction numberToColor(num) {\n // 增加缓存\n var color = numColorCache[num];\n if (!color) {\n var str = num.toString(16);\n for (var i = str.length; i < 6; i++) {\n str = '0' + str;\n }\n color = '#' + str;\n numColorCache[num] = color;\n }\n return color;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (numberToColor);\n\n/***/ }),\n/* 61 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\nfunction parseRadius(radius) {\n var r1 = 0,\n r2 = 0,\n r3 = 0,\n r4 = 0;\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(radius)) {\n if (radius.length === 1) {\n r1 = r2 = r3 = r4 = radius[0];\n } else if (radius.length === 2) {\n r1 = r3 = radius[0];\n r2 = r4 = radius[1];\n } else if (radius.length === 3) {\n r1 = radius[0];\n r2 = r4 = radius[1];\n r3 = radius[2];\n } else {\n r1 = radius[0];\n r2 = radius[1];\n r3 = radius[2];\n r4 = radius[3];\n }\n } else {\n r1 = r2 = r3 = r4 = radius;\n }\n return {\n r1: r1,\n r2: r2,\n r3: r3,\n r4: r4\n };\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (parseRadius);\n\n/***/ }),\n/* 62 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar clamp = function (a, min, max) {\n if (a < min) {\n return min;\n } else if (a > max) {\n return max;\n }\n return a;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (clamp);\n\n/***/ }),\n/* 63 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar fixedBase = function (v, base) {\n var str = base.toString();\n var index = str.indexOf('.');\n if (index === -1) {\n return Math.round(v);\n }\n var length = str.substr(index + 1).length;\n if (length > 20) {\n length = 20;\n }\n return parseFloat(v.toFixed(length));\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (fixedBase);\n\n/***/ }),\n/* 64 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\nvar isDecimal = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num % 1 !== 0;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isDecimal);\n\n/***/ }),\n/* 65 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\nvar isEven = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num % 2 === 0;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isEven);\n\n/***/ }),\n/* 66 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\nvar isInteger = Number.isInteger ? Number.isInteger : function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num % 1 === 0;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isInteger);\n\n/***/ }),\n/* 67 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\nvar isNegative = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num < 0;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isNegative);\n\n/***/ }),\n/* 68 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = isNumberEqual;\nvar PRECISION = 0.00001; // numbers less than this is considered as 0\nfunction isNumberEqual(a, b, precision) {\n if (precision === void 0) {\n precision = PRECISION;\n }\n return Math.abs(a - b) < precision;\n}\n;\n\n/***/ }),\n/* 69 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\nvar isOdd = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num % 2 !== 0;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isOdd);\n\n/***/ }),\n/* 70 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\nvar isPositive = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num > 0;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isPositive);\n\n/***/ }),\n/* 71 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(2);\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (arr, fn) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr)) {\n return undefined;\n }\n var maxItem;\n var max = -Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(fn) ? fn(item) : item[fn];\n if (v > max) {\n maxItem = item;\n max = v;\n }\n }\n return maxItem;\n});\n\n/***/ }),\n/* 72 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(2);\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (arr, fn) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr)) {\n return undefined;\n }\n var minItem;\n var min = Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(fn) ? fn(item) : item[fn];\n if (v < min) {\n minItem = item;\n min = v;\n }\n }\n return minItem;\n});\n\n/***/ }),\n/* 73 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar mod = function (n, m) {\n return (n % m + m) % m;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (mod);\n\n/***/ }),\n/* 74 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar DEGREE = 180 / Math.PI;\nvar toDegree = function (radian) {\n return DEGREE * radian;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (toDegree);\n\n/***/ }),\n/* 75 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (parseInt);\n\n/***/ }),\n/* 76 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar RADIAN = Math.PI / 180;\nvar toRadian = function (degree) {\n return RADIAN * degree;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (toRadian);\n\n/***/ }),\n/* 77 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(8);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */]);\n\n/***/ }),\n/* 78 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has__ = __webpack_require__(29);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0__has__[\"a\" /* default */]);\n\n/***/ }),\n/* 79 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__contains__ = __webpack_require__(13);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values__ = __webpack_require__(15);\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__contains__[\"a\" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_1__values__[\"a\" /* default */])(obj), value);\n});\n\n/***/ }),\n/* 80 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(9);\n\nvar lowerCase = function (str) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__to_string__[\"a\" /* default */])(str).toLowerCase();\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (lowerCase);\n\n/***/ }),\n/* 81 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(9);\n\nvar lowerFirst = function (value) {\n var str = Object(__WEBPACK_IMPORTED_MODULE_0__to_string__[\"a\" /* default */])(value);\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (lowerFirst);\n\n/***/ }),\n/* 82 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nfunction substitute(str, o) {\n if (!str || !o) {\n return str;\n }\n return str.replace(/\\\\?\\{([^{}]+)\\}/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.slice(1);\n }\n return o[name] === undefined ? '' : o[name];\n });\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (substitute);\n\n/***/ }),\n/* 83 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(9);\n\nvar upperCase = function (str) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__to_string__[\"a\" /* default */])(str).toUpperCase();\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (upperCase);\n\n/***/ }),\n/* 84 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(9);\n\nvar upperFirst = function (value) {\n var str = Object(__WEBPACK_IMPORTED_MODULE_0__to_string__[\"a\" /* default */])(value);\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (upperFirst);\n\n/***/ }),\n/* 85 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isArguments = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Arguments');\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isArguments);\n\n/***/ }),\n/* 86 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n/**\n * 是否是布尔类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isBoolean = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Boolean');\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isBoolean);\n\n/***/ }),\n/* 87 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n\nvar isDate = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Date');\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isDate);\n\n/***/ }),\n/* 88 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isError = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Error');\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isError);\n\n/***/ }),\n/* 89 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n/**\n * 判断是否为有限数\n * @return {Boolean}\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(value) && isFinite(value);\n});\n\n/***/ }),\n/* 90 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar isNull = function (value) {\n return value === null;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isNull);\n\n/***/ }),\n/* 91 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(3);\n\nvar isRegExp = function (str) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(str, 'RegExp');\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isRegExp);\n\n/***/ }),\n/* 92 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar isUndefined = function (value) {\n return value === undefined;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isUndefined);\n\n/***/ }),\n/* 93 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 判断是否HTML元素\n * @return {Boolean} 是否HTML元素\n */\nvar isElement = function (o) {\n return o instanceof Element || o instanceof HTMLDocument;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isElement);\n\n/***/ }),\n/* 94 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = requestAnimationFrame;\nfunction requestAnimationFrame(fn) {\n var method = window.requestAnimationFrame || window.webkitRequestAnimationFrame ||\n // @ts-ignore\n window.mozRequestAnimationFrame ||\n // @ts-ignore\n window.msRequestAnimationFrame || function (f) {\n return setTimeout(f, 16);\n };\n return method(fn);\n}\n;\n\n/***/ }),\n/* 95 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = cancelAnimationFrame;\nfunction cancelAnimationFrame(handler) {\n var method = window.cancelAnimationFrame || window.webkitCancelAnimationFrame ||\n // @ts-ignore\n window.mozCancelAnimationFrame ||\n // @ts-ignore\n window.msCancelAnimationFrame || clearTimeout;\n method(handler);\n}\n;\n\n/***/ }),\n/* 96 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mix__ = __webpack_require__(16);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(2);\n\n\nvar augment = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var c = args[0];\n for (var i = 1; i < args.length; i++) {\n var obj = args[i];\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(obj)) {\n obj = obj.prototype;\n }\n Object(__WEBPACK_IMPORTED_MODULE_0__mix__[\"a\" /* default */])(c.prototype, obj);\n }\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (augment);\n\n/***/ }),\n/* 97 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\nvar clone = function (obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n var rst;\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(obj)) {\n rst = [];\n for (var i = 0, l = obj.length; i < l; i++) {\n if (typeof obj[i] === 'object' && obj[i] != null) {\n rst[i] = clone(obj[i]);\n } else {\n rst[i] = obj[i];\n }\n }\n } else {\n rst = {};\n for (var k in obj) {\n if (typeof obj[k] === 'object' && obj[k] != null) {\n rst[k] = clone(obj[k]);\n } else {\n rst[k] = obj[k];\n }\n }\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (clone);\n\n/***/ }),\n/* 98 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nfunction debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (debounce);\n\n/***/ }),\n/* 99 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_plain_object__ = __webpack_require__(10);\n\n\nvar MAX_MIX_LEVEL = 5;\nfunction _deepMix(dist, src, level, maxLevel) {\n level = level || 0;\n maxLevel = maxLevel || MAX_MIX_LEVEL;\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n var value = src[key];\n if (value !== null && Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__[\"a\" /* default */])(value)) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__[\"a\" /* default */])(dist[key])) {\n dist[key] = {};\n }\n if (level < maxLevel) {\n _deepMix(dist[key], value, level + 1, maxLevel);\n } else {\n dist[key] = src[key];\n }\n } else if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(value)) {\n dist[key] = [];\n dist[key] = dist[key].concat(value);\n } else if (value !== undefined) {\n dist[key] = value;\n }\n }\n }\n}\n// todo 重写\nvar deepMix = function (rst) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < args.length; i += 1) {\n _deepMix(rst, args[i]);\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (deepMix);\n\n/***/ }),\n/* 100 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mix__ = __webpack_require__(16);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(2);\n\n\nvar extend = function (subclass, superclass, overrides, staticOverrides) {\n // 如果只提供父类构造函数,则自动生成子类构造函数\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(superclass)) {\n overrides = superclass;\n superclass = subclass;\n subclass = function () {};\n }\n var create = Object.create ? function (proto, c) {\n return Object.create(proto, {\n constructor: {\n value: c\n }\n });\n } : function (proto, c) {\n function Tmp() {}\n Tmp.prototype = proto;\n var o = new Tmp();\n o.constructor = c;\n return o;\n };\n var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype\n subclass.prototype = Object(__WEBPACK_IMPORTED_MODULE_0__mix__[\"a\" /* default */])(superObj, subclass.prototype); // 指定子类的prototype\n subclass.superclass = create(superclass.prototype, superclass);\n Object(__WEBPACK_IMPORTED_MODULE_0__mix__[\"a\" /* default */])(superObj, overrides);\n Object(__WEBPACK_IMPORTED_MODULE_0__mix__[\"a\" /* default */])(subclass, staticOverrides);\n return subclass;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (extend);\n\n/***/ }),\n/* 101 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nvar indexOf = function (arr, obj) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return -1;\n }\n var m = Array.prototype.indexOf;\n if (m) {\n return m.call(arr, obj);\n }\n var index = -1;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === obj) {\n index = i;\n break;\n }\n }\n return index;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (indexOf);\n\n/***/ }),\n/* 102 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(7);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get_type__ = __webpack_require__(30);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_prototype__ = __webpack_require__(31);\n\n\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction isEmpty(value) {\n /**\n * isEmpty(null) => true\n * isEmpty() => true\n * isEmpty(true) => true\n * isEmpty(1) => true\n * isEmpty([1, 2, 3]) => false\n * isEmpty('abc') => false\n * isEmpty({ a: 1 }) => false\n */\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(value)) {\n return true;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(value)) {\n return !value.length;\n }\n var type = Object(__WEBPACK_IMPORTED_MODULE_2__get_type__[\"a\" /* default */])(value);\n if (type === 'Map' || type === 'Set') {\n return !value.size;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_3__is_prototype__[\"a\" /* default */])(value)) {\n return !Object.keys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n/* harmony default export */ __webpack_exports__[\"a\"] = (isEmpty);\n\n/***/ }),\n/* 103 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_equal__ = __webpack_require__(33);\n\n\n/**\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [fn] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * isEqualWith(array, other, customizer); // => true\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value, other, fn) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_function__[\"a\" /* default */])(fn)) {\n return Object(__WEBPACK_IMPORTED_MODULE_1__is_equal__[\"a\" /* default */])(value, other);\n }\n return !!fn(value, other);\n});\n\n/***/ }),\n/* 104 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nvar map = function (arr, func) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n // @ts-ignore\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n result.push(func(value, index));\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (map);\n\n/***/ }),\n/* 105 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(7);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_object__ = __webpack_require__(12);\n\n\nvar identity = function (v) {\n return v;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (object, func) {\n if (func === void 0) {\n func = identity;\n }\n var r = {};\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_object__[\"a\" /* default */])(object) && !Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(object)) {\n Object.keys(object).forEach(function (key) {\n // @ts-ignore\n r[key] = func(object[key], key);\n });\n }\n return r;\n});\n\n/***/ }),\n/* 106 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_string__ = __webpack_require__(4);\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param key\n * @param defaultValue\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, key, defaultValue) {\n var p = 0;\n var keyArr = Object(__WEBPACK_IMPORTED_MODULE_0__is_string__[\"a\" /* default */])(key) ? key.split('.') : key;\n while (obj && p < keyArr.length) {\n obj = obj[keyArr[p++]];\n }\n return obj === undefined || p < keyArr.length ? defaultValue : obj;\n});\n\n/***/ }),\n/* 107 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_number__ = __webpack_require__(5);\n\n\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param path\n * @param value\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, path, value) {\n var o = obj;\n var keyArr = Object(__WEBPACK_IMPORTED_MODULE_1__is_string__[\"a\" /* default */])(path) ? path.split('.') : path;\n keyArr.forEach(function (key, idx) {\n // 不是最后一个\n if (idx < keyArr.length - 1) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_object__[\"a\" /* default */])(o[key])) {\n o[key] = Object(__WEBPACK_IMPORTED_MODULE_2__is_number__[\"a\" /* default */])(keyArr[idx + 1]) ? [] : {};\n }\n o = o[key];\n } else {\n o[key] = value;\n }\n });\n return obj;\n});\n\n/***/ }),\n/* 108 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_plain_object__ = __webpack_require__(10);\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (object, keys) {\n if (object === null || !Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__[\"a\" /* default */])(object)) {\n return {};\n }\n var result = {};\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(keys, function (key) {\n if (hasOwnProperty.call(object, key)) {\n result[key] = object[key];\n }\n });\n return result;\n});\n\n/***/ }),\n/* 109 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__reduce__ = __webpack_require__(25);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, keys) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__reduce__[\"a\" /* default */])(obj, function (r, curr, key) {\n if (!keys.includes(key)) {\n r[key] = curr;\n }\n return r;\n }, {});\n});\n\n/***/ }),\n/* 110 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n var later = function () {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n var throttled = function () {\n var now = Date.now();\n if (!previous && options.leading === false) previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n throttled.cancel = function () {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n return throttled;\n});\n\n/***/ }),\n/* 111 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(value) ? Array.prototype.slice.call(value) : [];\n});\n\n/***/ }),\n/* 112 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar map = {};\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (prefix) {\n prefix = prefix || 'g';\n if (!map[prefix]) {\n map[prefix] = 1;\n } else {\n map[prefix] += 1;\n }\n return prefix + map[prefix];\n});\n\n/***/ }),\n/* 113 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function () {});\n\n/***/ }),\n/* 114 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (v) {\n return v;\n});\n\n/***/ }),\n/* 115 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = size;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(7);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);\n\n\nfunction size(o) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(o)) {\n return 0;\n }\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(o)) {\n return o.length;\n }\n return Object.keys(o).length;\n}\n\n/***/ }),\n/* 116 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* unused harmony export __extends */\n/* unused harmony export __assign */\n/* unused harmony export __rest */\n/* unused harmony export __decorate */\n/* unused harmony export __param */\n/* unused harmony export __esDecorate */\n/* unused harmony export __runInitializers */\n/* unused harmony export __propKey */\n/* unused harmony export __setFunctionName */\n/* unused harmony export __metadata */\n/* unused harmony export __awaiter */\n/* unused harmony export __generator */\n/* unused harmony export __createBinding */\n/* unused harmony export __exportStar */\n/* unused harmony export __values */\n/* unused harmony export __read */\n/* unused harmony export __spread */\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = __spreadArrays;\n/* unused harmony export __spreadArray */\n/* unused harmony export __await */\n/* unused harmony export __asyncGenerator */\n/* unused harmony export __asyncDelegator */\n/* unused harmony export __asyncValues */\n/* unused harmony export __makeTemplateObject */\n/* unused harmony export __importStar */\n/* unused harmony export __importDefault */\n/* unused harmony export __classPrivateFieldGet */\n/* unused harmony export __classPrivateFieldSet */\n/* unused harmony export __classPrivateFieldIn */\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\n/* global Reflect, Promise */\n\nvar extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n };\n return extendStatics(d, b);\n};\nfunction __extends(d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() {\n this.constructor = d;\n }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n}\nvar __assign = function () {\n __assign = Object.assign || function __assign(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nfunction __rest(s, e) {\n var t = {};\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n}\nfunction __decorate(decorators, target, key, desc) {\n var c = arguments.length,\n r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc,\n d;\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\n return c > 3 && r && Object.defineProperty(target, key, r), r;\n}\nfunction __param(paramIndex, decorator) {\n return function (target, key) {\n decorator(target, key, paramIndex);\n };\n}\nfunction __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\n function accept(f) {\n if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\");\n return f;\n }\n var kind = contextIn.kind,\n key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\n var _,\n done = false;\n for (var i = decorators.length - 1; i >= 0; i--) {\n var context = {};\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\n context.addInitializer = function (f) {\n if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\");\n extraInitializers.push(accept(f || null));\n };\n var result = (0, decorators[i])(kind === \"accessor\" ? {\n get: descriptor.get,\n set: descriptor.set\n } : descriptor[key], context);\n if (kind === \"accessor\") {\n if (result === void 0) continue;\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\n if (_ = accept(result.get)) descriptor.get = _;\n if (_ = accept(result.set)) descriptor.set = _;\n if (_ = accept(result.init)) initializers.push(_);\n } else if (_ = accept(result)) {\n if (kind === \"field\") initializers.push(_);else descriptor[key] = _;\n }\n }\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\n done = true;\n}\n;\nfunction __runInitializers(thisArg, initializers, value) {\n var useValue = arguments.length > 2;\n for (var i = 0; i < initializers.length; i++) {\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\n }\n return useValue ? value : void 0;\n}\n;\nfunction __propKey(x) {\n return typeof x === \"symbol\" ? x : \"\".concat(x);\n}\n;\nfunction __setFunctionName(f, name, prefix) {\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\n return Object.defineProperty(f, \"name\", {\n configurable: true,\n value: prefix ? \"\".concat(prefix, \" \", name) : name\n });\n}\n;\nfunction __metadata(metadataKey, metadataValue) {\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\n}\nfunction __awaiter(thisArg, _arguments, P, generator) {\n function adopt(value) {\n return value instanceof P ? value : new P(function (resolve) {\n resolve(value);\n });\n }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) {\n try {\n step(generator.next(value));\n } catch (e) {\n reject(e);\n }\n }\n function rejected(value) {\n try {\n step(generator[\"throw\"](value));\n } catch (e) {\n reject(e);\n }\n }\n function step(result) {\n result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected);\n }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n}\nfunction __generator(thisArg, body) {\n var _ = {\n label: 0,\n sent: function () {\n if (t[0] & 1) throw t[1];\n return t[1];\n },\n trys: [],\n ops: []\n },\n f,\n y,\n t,\n g;\n return g = {\n next: verb(0),\n \"throw\": verb(1),\n \"return\": verb(2)\n }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function () {\n return this;\n }), g;\n function verb(n) {\n return function (v) {\n return step([n, v]);\n };\n }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0:\n case 1:\n t = op;\n break;\n case 4:\n _.label++;\n return {\n value: op[1],\n done: false\n };\n case 5:\n _.label++;\n y = op[1];\n op = [0];\n continue;\n case 7:\n op = _.ops.pop();\n _.trys.pop();\n continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) {\n _ = 0;\n continue;\n }\n if (op[0] === 3 && (!t || op[1] > t[0] && op[1] < t[3])) {\n _.label = op[1];\n break;\n }\n if (op[0] === 6 && _.label < t[1]) {\n _.label = t[1];\n t = op;\n break;\n }\n if (t && _.label < t[2]) {\n _.label = t[2];\n _.ops.push(op);\n break;\n }\n if (t[2]) _.ops.pop();\n _.trys.pop();\n continue;\n }\n op = body.call(thisArg, _);\n } catch (e) {\n op = [6, e];\n y = 0;\n } finally {\n f = t = 0;\n }\n if (op[0] & 5) throw op[1];\n return {\n value: op[0] ? op[1] : void 0,\n done: true\n };\n }\n}\nvar __createBinding = Object.create ? function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = {\n enumerable: true,\n get: function () {\n return m[k];\n }\n };\n }\n Object.defineProperty(o, k2, desc);\n} : function (o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n};\nfunction __exportStar(m, o) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\n}\nfunction __values(o) {\n var s = typeof Symbol === \"function\" && Symbol.iterator,\n m = s && o[s],\n i = 0;\n if (m) return m.call(o);\n if (o && typeof o.length === \"number\") return {\n next: function () {\n if (o && i >= o.length) o = void 0;\n return {\n value: o && o[i++],\n done: !o\n };\n }\n };\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\n}\nfunction __read(o, n) {\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\n if (!m) return o;\n var i = m.call(o),\n r,\n ar = [],\n e;\n try {\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\n } catch (error) {\n e = {\n error: error\n };\n } finally {\n try {\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\n } finally {\n if (e) throw e.error;\n }\n }\n return ar;\n}\n\n/** @deprecated */\nfunction __spread() {\n for (var ar = [], i = 0; i < arguments.length; i++) ar = ar.concat(__read(arguments[i]));\n return ar;\n}\n\n/** @deprecated */\nfunction __spreadArrays() {\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\n for (var r = Array(s), k = 0, i = 0; i < il; i++) for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++) r[k] = a[j];\n return r;\n}\nfunction __spreadArray(to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n}\nfunction __await(v) {\n return this instanceof __await ? (this.v = v, this) : new __await(v);\n}\nfunction __asyncGenerator(thisArg, _arguments, generator) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var g = generator.apply(thisArg, _arguments || []),\n i,\n q = [];\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i;\n function verb(n) {\n if (g[n]) i[n] = function (v) {\n return new Promise(function (a, b) {\n q.push([n, v, a, b]) > 1 || resume(n, v);\n });\n };\n }\n function resume(n, v) {\n try {\n step(g[n](v));\n } catch (e) {\n settle(q[0][3], e);\n }\n }\n function step(r) {\n r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r);\n }\n function fulfill(value) {\n resume(\"next\", value);\n }\n function reject(value) {\n resume(\"throw\", value);\n }\n function settle(f, v) {\n if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]);\n }\n}\nfunction __asyncDelegator(o) {\n var i, p;\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) {\n throw e;\n }), verb(\"return\"), i[Symbol.iterator] = function () {\n return this;\n }, i;\n function verb(n, f) {\n i[n] = o[n] ? function (v) {\n return (p = !p) ? {\n value: __await(o[n](v)),\n done: false\n } : f ? f(v) : v;\n } : f;\n }\n}\nfunction __asyncValues(o) {\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\n var m = o[Symbol.asyncIterator],\n i;\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () {\n return this;\n }, i);\n function verb(n) {\n i[n] = o[n] && function (v) {\n return new Promise(function (resolve, reject) {\n v = o[n](v), settle(resolve, reject, v.done, v.value);\n });\n };\n }\n function settle(resolve, reject, d, v) {\n Promise.resolve(v).then(function (v) {\n resolve({\n value: v,\n done: d\n });\n }, reject);\n }\n}\nfunction __makeTemplateObject(cooked, raw) {\n if (Object.defineProperty) {\n Object.defineProperty(cooked, \"raw\", {\n value: raw\n });\n } else {\n cooked.raw = raw;\n }\n return cooked;\n}\n;\nvar __setModuleDefault = Object.create ? function (o, v) {\n Object.defineProperty(o, \"default\", {\n enumerable: true,\n value: v\n });\n} : function (o, v) {\n o[\"default\"] = v;\n};\nfunction __importStar(mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n}\nfunction __importDefault(mod) {\n return mod && mod.__esModule ? mod : {\n default: mod\n };\n}\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\n}\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\n return kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value), value;\n}\nfunction __classPrivateFieldIn(state, receiver) {\n if (receiver === null || typeof receiver !== \"object\" && typeof receiver !== \"function\") throw new TypeError(\"Cannot use 'in' operator on non-object\");\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\n}\n\n/***/ }),\n/* 117 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_string__ = __webpack_require__(4);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__to_string__ = __webpack_require__(9);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__measure_text_width__ = __webpack_require__(34);\n\n\n\n/**\n * 获取文本的 ... 文本。\n * 算法(减少每次 measureText 的长度,measureText 的性能跟字符串时间相关):\n * 1. 先通过 STEP 逐步计算,找到最后一个小于 maxWidth 的字符串\n * 2. 然后对最后这个字符串二分计算\n * @param text 需要计算的文本, 由于历史原因 除了支持string,还支持空值,number和数组等\n * @param maxWidth 最大宽度\n * @param font 字体\n * @param str 要替换的文本\n */\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (text, maxWidth, font, str) {\n if (str === void 0) {\n str = '...';\n }\n var STEP = 16; // 每次 16,调参工程师\n var PLACEHOLDER_WIDTH = Object(__WEBPACK_IMPORTED_MODULE_2__measure_text_width__[\"a\" /* default */])(str, font);\n var leftText = !Object(__WEBPACK_IMPORTED_MODULE_0__is_string__[\"a\" /* default */])(text) ? Object(__WEBPACK_IMPORTED_MODULE_1__to_string__[\"a\" /* default */])(text) : text;\n var leftWidth = maxWidth;\n var r = []; // 最终的分段字符串\n var currentText;\n var currentWidth;\n if (Object(__WEBPACK_IMPORTED_MODULE_2__measure_text_width__[\"a\" /* default */])(text, font) <= maxWidth) {\n return text;\n }\n // 首先通过 step 计算,找出最大的未超出长度的\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // 更新字符串\n currentText = leftText.substr(0, STEP);\n // 计算宽度\n currentWidth = Object(__WEBPACK_IMPORTED_MODULE_2__measure_text_width__[\"a\" /* default */])(currentText, font);\n // 超出剩余宽度,则停止\n if (currentWidth + PLACEHOLDER_WIDTH > leftWidth) {\n if (currentWidth > leftWidth) {\n break;\n }\n }\n r.push(currentText);\n // 没有超出,则计算剩余宽度\n leftWidth -= currentWidth;\n leftText = leftText.substr(STEP);\n // 字符串整体没有超出\n if (!leftText) {\n return r.join('');\n }\n }\n // 最下的最后一个 STEP,使用 1 递增(用二分效果更高)\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // 更新字符串\n currentText = leftText.substr(0, 1);\n // 计算宽度\n currentWidth = Object(__WEBPACK_IMPORTED_MODULE_2__measure_text_width__[\"a\" /* default */])(currentText, font);\n // 超出剩余宽度,则停止\n if (currentWidth + PLACEHOLDER_WIDTH > leftWidth) {\n break;\n }\n r.push(currentText);\n // 没有超出,则计算剩余宽度\n leftWidth -= currentWidth;\n leftText = leftText.substr(1);\n if (!leftText) {\n return r.join('');\n }\n }\n return \"\" + r.join('') + str;\n});\n\n/***/ }),\n/* 118 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * k-v 存储\n */\nvar default_1 = /** @class */function () {\n function default_1() {\n this.map = {};\n }\n default_1.prototype.has = function (key) {\n return this.map[key] !== undefined;\n };\n default_1.prototype.get = function (key, def) {\n var v = this.map[key];\n return v === undefined ? def : v;\n };\n default_1.prototype.set = function (key, value) {\n this.map[key] = value;\n };\n default_1.prototype.clear = function () {\n this.map = {};\n };\n default_1.prototype.delete = function (key) {\n delete this.map[key];\n };\n default_1.prototype.size = function () {\n return Object.keys(this.map).length;\n };\n return default_1;\n}();\n/* harmony default export */ __webpack_exports__[\"a\"] = (default_1);\n\n/***/ }),\n/* 119 */\n/***/ (function(module, exports) {\n\n// wrap tree node\nfunction WrappedTree(w, h, y, c) {\n if (c === void 0) {\n c = [];\n }\n var me = this;\n // size\n me.w = w || 0;\n me.h = h || 0;\n\n // position\n me.y = y || 0;\n me.x = 0;\n\n // children\n me.c = c || [];\n me.cs = c.length;\n\n // modified\n me.prelim = 0;\n me.mod = 0;\n me.shift = 0;\n me.change = 0;\n\n // left/right tree\n me.tl = null;\n me.tr = null;\n\n // extreme left/right tree\n me.el = null;\n me.er = null;\n\n // modified left/right tree\n me.msel = 0;\n me.mser = 0;\n}\nWrappedTree.fromNode = function (root, isHorizontal) {\n if (!root) return null;\n var children = [];\n root.children.forEach(function (child) {\n children.push(WrappedTree.fromNode(child, isHorizontal));\n });\n if (isHorizontal) return new WrappedTree(root.height, root.width, root.x, children);\n return new WrappedTree(root.width, root.height, root.y, children);\n};\n\n// node utils\nfunction moveRight(node, move, isHorizontal) {\n if (isHorizontal) {\n node.y += move;\n } else {\n node.x += move;\n }\n node.children.forEach(function (child) {\n moveRight(child, move, isHorizontal);\n });\n}\nfunction getMin(node, isHorizontal) {\n var res = isHorizontal ? node.y : node.x;\n node.children.forEach(function (child) {\n res = Math.min(getMin(child, isHorizontal), res);\n });\n return res;\n}\nfunction normalize(node, isHorizontal) {\n var min = getMin(node, isHorizontal);\n moveRight(node, -min, isHorizontal);\n}\nfunction convertBack(converted /* WrappedTree */, root /* TreeNode */, isHorizontal) {\n if (isHorizontal) {\n root.y = converted.x;\n } else {\n root.x = converted.x;\n }\n converted.c.forEach(function (child, i) {\n convertBack(child, root.children[i], isHorizontal);\n });\n}\nfunction layer(node, isHorizontal, d) {\n if (d === void 0) {\n d = 0;\n }\n if (isHorizontal) {\n node.x = d;\n d += node.width;\n } else {\n node.y = d;\n d += node.height;\n }\n node.children.forEach(function (child) {\n layer(child, isHorizontal, d);\n });\n}\nmodule.exports = function (root, options) {\n if (options === void 0) {\n options = {};\n }\n var isHorizontal = options.isHorizontal;\n function firstWalk(t) {\n if (t.cs === 0) {\n setExtremes(t);\n return;\n }\n firstWalk(t.c[0]);\n var ih = updateIYL(bottom(t.c[0].el), 0, null);\n for (var i = 1; i < t.cs; ++i) {\n firstWalk(t.c[i]);\n var min = bottom(t.c[i].er);\n separate(t, i, ih);\n ih = updateIYL(min, i, ih);\n }\n positionRoot(t);\n setExtremes(t);\n }\n function setExtremes(t) {\n if (t.cs === 0) {\n t.el = t;\n t.er = t;\n t.msel = t.mser = 0;\n } else {\n t.el = t.c[0].el;\n t.msel = t.c[0].msel;\n t.er = t.c[t.cs - 1].er;\n t.mser = t.c[t.cs - 1].mser;\n }\n }\n function separate(t, i, ih) {\n var sr = t.c[i - 1];\n var mssr = sr.mod;\n var cl = t.c[i];\n var mscl = cl.mod;\n while (sr !== null && cl !== null) {\n if (bottom(sr) > ih.low) ih = ih.nxt;\n var dist = mssr + sr.prelim + sr.w - (mscl + cl.prelim);\n if (dist > 0) {\n mscl += dist;\n moveSubtree(t, i, ih.index, dist);\n }\n var sy = bottom(sr);\n var cy = bottom(cl);\n if (sy <= cy) {\n sr = nextRightContour(sr);\n if (sr !== null) mssr += sr.mod;\n }\n if (sy >= cy) {\n cl = nextLeftContour(cl);\n if (cl !== null) mscl += cl.mod;\n }\n }\n if (!sr && !!cl) {\n setLeftThread(t, i, cl, mscl);\n } else if (!!sr && !cl) {\n setRightThread(t, i, sr, mssr);\n }\n }\n function moveSubtree(t, i, si, dist) {\n t.c[i].mod += dist;\n t.c[i].msel += dist;\n t.c[i].mser += dist;\n distributeExtra(t, i, si, dist);\n }\n function nextLeftContour(t) {\n return t.cs === 0 ? t.tl : t.c[0];\n }\n function nextRightContour(t) {\n return t.cs === 0 ? t.tr : t.c[t.cs - 1];\n }\n function bottom(t) {\n return t.y + t.h;\n }\n function setLeftThread(t, i, cl, modsumcl) {\n var li = t.c[0].el;\n li.tl = cl;\n var diff = modsumcl - cl.mod - t.c[0].msel;\n li.mod += diff;\n li.prelim -= diff;\n t.c[0].el = t.c[i].el;\n t.c[0].msel = t.c[i].msel;\n }\n function setRightThread(t, i, sr, modsumsr) {\n var ri = t.c[i].er;\n ri.tr = sr;\n var diff = modsumsr - sr.mod - t.c[i].mser;\n ri.mod += diff;\n ri.prelim -= diff;\n t.c[i].er = t.c[i - 1].er;\n t.c[i].mser = t.c[i - 1].mser;\n }\n function positionRoot(t) {\n 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 }\n function secondWalk(t, modsum) {\n modsum += t.mod;\n t.x = t.prelim + modsum;\n addChildSpacing(t);\n for (var i = 0; i < t.cs; i++) {\n secondWalk(t.c[i], modsum);\n }\n }\n function distributeExtra(t, i, si, dist) {\n if (si !== i - 1) {\n var nr = i - si;\n t.c[si + 1].shift += dist / nr;\n t.c[i].shift -= dist / nr;\n t.c[i].change -= dist - dist / nr;\n }\n }\n function addChildSpacing(t) {\n var d = 0;\n var modsumdelta = 0;\n for (var i = 0; i < t.cs; i++) {\n d += t.c[i].shift;\n modsumdelta += d + t.c[i].change;\n t.c[i].mod += modsumdelta;\n }\n }\n function updateIYL(low, index, ih) {\n while (ih !== null && low >= ih.low) {\n ih = ih.nxt;\n }\n return {\n low: low,\n index: index,\n nxt: ih\n };\n }\n\n // do layout\n layer(root, isHorizontal);\n var wt = WrappedTree.fromNode(root, isHorizontal);\n firstWalk(wt);\n secondWalk(wt, 0);\n convertBack(wt, root, isHorizontal);\n normalize(root, isHorizontal);\n return root;\n};\n\n/***/ }),\n/* 120 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar TreeLayout = __webpack_require__(11);\nvar dendrogram = __webpack_require__(121);\nvar doTreeLayout = __webpack_require__(17);\nvar util = __webpack_require__(6);\nvar DendrogramLayout = /*#__PURE__*/function (_TreeLayout) {\n _inheritsLoose(DendrogramLayout, _TreeLayout);\n function DendrogramLayout() {\n return _TreeLayout.apply(this, arguments) || this;\n }\n var _proto = DendrogramLayout.prototype;\n _proto.execute = function execute() {\n var me = this;\n me.rootNode.width = 0;\n return doTreeLayout(me.rootNode, me.options, dendrogram);\n };\n return DendrogramLayout;\n}(TreeLayout);\nvar DEFAULT_OPTIONS = {};\nfunction dendrogramLayout(root, options) {\n options = util.assign({}, DEFAULT_OPTIONS, options);\n return new DendrogramLayout(root, options).execute();\n}\nmodule.exports = dendrogramLayout;\n\n/***/ }),\n/* 121 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// wrap tree node\n// TODO considering size\nvar util = __webpack_require__(6);\nfunction WrappedTree(height, children) {\n if (height === void 0) {\n height = 0;\n }\n if (children === void 0) {\n children = [];\n }\n var me = this;\n me.x = me.y = 0;\n me.leftChild = me.rightChild = null;\n me.height = 0;\n me.children = children;\n}\nvar DEFAULT_OPTIONS = {\n isHorizontal: true,\n nodeSep: 20,\n nodeSize: 20,\n rankSep: 200,\n subTreeSep: 10\n};\nfunction convertBack(converted /* WrappedTree */, root /* TreeNode */, isHorizontal) {\n if (isHorizontal) {\n root.x = converted.x;\n root.y = converted.y;\n } else {\n root.x = converted.y;\n root.y = converted.x;\n }\n converted.children.forEach(function (child, i) {\n convertBack(child, root.children[i], isHorizontal);\n });\n}\nmodule.exports = function (root, options) {\n if (options === void 0) {\n options = {};\n }\n options = util.assign({}, DEFAULT_OPTIONS, options);\n var maxDepth = 0;\n function wrappedTreeFromNode(n) {\n if (!n) return null;\n n.width = 0;\n if (n.depth && n.depth > maxDepth) {\n maxDepth = n.depth; // get the max depth\n }\n\n var children = n.children;\n var childrenCount = children.length;\n var t = new WrappedTree(n.height, []);\n children.forEach(function (child, i) {\n var childWT = wrappedTreeFromNode(child);\n t.children.push(childWT);\n if (i === 0) {\n // t.leftChild = childWT.leftChild ? childWT.leftChild : childWT\n t.leftChild = childWT;\n }\n if (i === childrenCount - 1) {\n // t.rightChild = childWT.rightChild ? childWT.rightChild : childWT\n t.rightChild = childWT;\n }\n });\n t.originNode = n;\n t.isLeaf = n.isLeaf();\n return t;\n }\n function getDrawingDepth(t) {\n if (t.isLeaf || t.children.length === 0) {\n t.drawingDepth = maxDepth;\n } else {\n var depths = t.children.map(function (child) {\n return getDrawingDepth(child);\n });\n var minChildDepth = Math.min.apply(null, depths);\n t.drawingDepth = minChildDepth - 1;\n }\n return t.drawingDepth;\n }\n var prevLeaf;\n function position(t) {\n t.x = t.drawingDepth * options.rankSep;\n if (t.isLeaf) {\n t.y = 0;\n if (prevLeaf) {\n t.y = prevLeaf.y + prevLeaf.height + options.nodeSep;\n if (t.originNode.parent !== prevLeaf.originNode.parent) {\n t.y += options.subTreeSep;\n }\n }\n prevLeaf = t;\n } else {\n t.children.forEach(function (child) {\n position(child);\n });\n t.y = (t.leftChild.y + t.rightChild.y) / 2;\n }\n }\n\n // wrap node\n var wt = wrappedTreeFromNode(root);\n // get depth for drawing\n getDrawingDepth(wt);\n // get position\n position(wt);\n // get x, y\n convertBack(wt, root, options.isHorizontal);\n return root;\n};\n\n/***/ }),\n/* 122 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar TreeLayout = __webpack_require__(11);\nvar indentedTree = __webpack_require__(123);\nvar separateTree = __webpack_require__(35);\nvar util = __webpack_require__(6);\nvar VALID_DIRECTIONS = ['LR',\n// left to right\n'RL',\n// right to left\n'H' // horizontal\n];\n\nvar DEFAULT_DIRECTION = VALID_DIRECTIONS[0];\nvar IndentedLayout = /*#__PURE__*/function (_TreeLayout) {\n _inheritsLoose(IndentedLayout, _TreeLayout);\n function IndentedLayout() {\n return _TreeLayout.apply(this, arguments) || this;\n }\n var _proto = IndentedLayout.prototype;\n _proto.execute = function execute() {\n var me = this;\n var options = me.options;\n var root = me.rootNode;\n options.isHorizontal = true;\n // default indent 20 and sink first children;\n var _options$indent = options.indent,\n indent = _options$indent === void 0 ? 20 : _options$indent,\n _options$dropCap = options.dropCap,\n dropCap = _options$dropCap === void 0 ? true : _options$dropCap,\n _options$direction = options.direction,\n direction = _options$direction === void 0 ? DEFAULT_DIRECTION : _options$direction,\n align = options.align;\n if (direction && VALID_DIRECTIONS.indexOf(direction) === -1) {\n throw new TypeError(\"Invalid direction: \" + direction);\n }\n if (direction === VALID_DIRECTIONS[0]) {\n // LR\n indentedTree(root, indent, dropCap, align);\n } else if (direction === VALID_DIRECTIONS[1]) {\n // RL\n indentedTree(root, indent, dropCap, align);\n root.right2left();\n } else if (direction === VALID_DIRECTIONS[2]) {\n // H\n // separate into left and right trees\n var _separateTree = separateTree(root, options),\n left = _separateTree.left,\n right = _separateTree.right;\n indentedTree(left, indent, dropCap, align);\n left.right2left();\n indentedTree(right, indent, dropCap, align);\n var bbox = left.getBoundingBox();\n right.translate(bbox.width, 0);\n root.x = right.x - root.width / 2;\n }\n return root;\n };\n return IndentedLayout;\n}(TreeLayout);\nvar DEFAULT_OPTIONS = {};\nfunction indentedLayout(root, options) {\n options = util.assign({}, DEFAULT_OPTIONS, options);\n return new IndentedLayout(root, options).execute();\n}\nmodule.exports = indentedLayout;\n\n/***/ }),\n/* 123 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar util = __webpack_require__(6);\nfunction positionNode(node, previousNode, indent, dropCap, align) {\n // caculate the node's horizontal offset DX, dx's type might be number or function\n var displacementX = typeof indent === \"function\" ? indent(node) : indent * node.depth;\n if (!dropCap) {\n try {\n if (node.id === node.parent.children[0].id) {\n node.x += displacementX;\n node.y = previousNode ? previousNode.y : 0;\n return;\n }\n } catch (e) {\n // skip to normal when a node has no parent\n }\n }\n node.x += displacementX;\n if (previousNode) {\n node.y = previousNode.y + util.getHeight(previousNode, node, align);\n if (previousNode.parent && node.parent.id !== previousNode.parent.id) {\n // previous node has different parent\n var prevParent = previousNode.parent;\n var preY = prevParent.y + util.getHeight(prevParent, node, align);\n node.y = preY > node.y ? preY : node.y;\n }\n } else {\n node.y = 0;\n }\n return;\n}\nmodule.exports = function (root, indent, dropCap, align) {\n var previousNode = null;\n root.eachNode(function (node) {\n positionNode(node, previousNode, indent, dropCap, align);\n previousNode = node;\n });\n};\n\n/***/ }),\n/* 124 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; _setPrototypeOf(subClass, superClass); }\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\nvar TreeLayout = __webpack_require__(11);\nvar mindmap = __webpack_require__(125);\nvar doTreeLayout = __webpack_require__(17);\nvar util = __webpack_require__(6);\nvar MindmapLayout = /*#__PURE__*/function (_TreeLayout) {\n _inheritsLoose(MindmapLayout, _TreeLayout);\n function MindmapLayout() {\n return _TreeLayout.apply(this, arguments) || this;\n }\n var _proto = MindmapLayout.prototype;\n _proto.execute = function execute() {\n var me = this;\n return doTreeLayout(me.rootNode, me.options, mindmap);\n };\n return MindmapLayout;\n}(TreeLayout);\nvar DEFAULT_OPTIONS = {};\nfunction mindmapLayout(root, options) {\n options = util.assign({}, DEFAULT_OPTIONS, options);\n return new MindmapLayout(root, options).execute();\n}\nmodule.exports = mindmapLayout;\n\n/***/ }),\n/* 125 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar util = __webpack_require__(6);\nfunction secondWalk(node, options) {\n var totalHeight = 0;\n if (!node.children.length) {\n totalHeight = node.height;\n } else {\n node.children.forEach(function (c) {\n totalHeight += secondWalk(c, options);\n });\n }\n node._subTreeSep = options.getSubTreeSep(node.data);\n node.totalHeight = Math.max(node.height, totalHeight) + 2 * node._subTreeSep;\n return node.totalHeight;\n}\nfunction thirdWalk(node) {\n var children = node.children;\n var len = children.length;\n if (len) {\n children.forEach(function (c) {\n thirdWalk(c);\n });\n var first = children[0];\n var last = children[len - 1];\n var childrenHeight = last.y - first.y + last.height;\n var childrenTotalHeight = 0;\n children.forEach(function (child) {\n childrenTotalHeight += child.totalHeight;\n });\n if (childrenHeight > node.height) {\n // 当子节点总高度大于父节点高度\n node.y = first.y + childrenHeight / 2 - node.height / 2;\n } else if (children.length !== 1 || node.height > childrenTotalHeight) {\n // 多于一个子节点或者父节点大于所有子节点的总高度\n var offset = node.y + (node.height - childrenHeight) / 2 - first.y;\n children.forEach(function (c) {\n c.translate(0, offset);\n });\n } else {\n // 只有一个子节点\n node.y = (first.y + first.height / 2 + last.y + last.height / 2) / 2 - node.height / 2;\n }\n }\n}\nvar DEFAULT_OPTIONS = {\n getSubTreeSep: function getSubTreeSep() {\n return 0;\n }\n};\nmodule.exports = function (root, options) {\n if (options === void 0) {\n options = {};\n }\n options = util.assign({}, DEFAULT_OPTIONS, options);\n root.parent = {\n x: 0,\n width: 0,\n height: 0,\n y: 0\n };\n // first walk\n root.BFTraverse(function (node) {\n node.x = node.parent.x + node.parent.width; // simply get x\n });\n\n root.parent = null;\n // second walk\n secondWalk(root, options); // assign sub tree totalHeight\n // adjusting\n // separating nodes\n root.startY = 0;\n root.y = root.totalHeight / 2 - root.height / 2;\n root.eachNode(function (node) {\n var children = node.children;\n var len = children.length;\n if (len) {\n var first = children[0];\n first.startY = node.startY + node._subTreeSep;\n if (len === 1) {\n first.y = node.y + node.height / 2 - first.height / 2;\n } else {\n first.y = first.startY + first.totalHeight / 2 - first.height / 2;\n for (var i = 1; i < len; i++) {\n var c = children[i];\n c.startY = children[i - 1].startY + children[i - 1].totalHeight;\n c.y = c.startY + c.totalHeight / 2 - c.height / 2;\n }\n }\n }\n });\n\n // third walk\n thirdWalk(root);\n};\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=hierarchy.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/hierarchy/build/hierarchy.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/modelRect.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/modelRect.js ***! - \*************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/index.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/layout/lib/index.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n\n\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"registerNode\"])('modelRect', {\n // 自定义节点时的配置\n options: {\n size: [185, 70],\n style: {\n radius: 5,\n stroke: '#69c0ff',\n fill: '#ffffff',\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.style.lineWidth,\n fillOpacity: 1\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: '#595959',\n fontSize: 14,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].windowFontFamily\n },\n offset: 30 // 距离左侧的 offset,没有设置 y 轴上移动的配置\n\n },\n descriptionCfg: {\n style: {\n fontSize: 12,\n fill: '#bfbfbf',\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].windowFontFamily\n },\n paddingTop: 0\n },\n preRect: {\n show: true,\n width: 4,\n fill: '#40a9ff',\n radius: 2\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: 10,\n lineWidth: 1,\n fill: '#72CC4A',\n stroke: '#72CC4A'\n },\n // 节点中icon配置\n logoIcon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: true,\n x: 0,\n y: 0,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/basement_prod/4f81893c-1806-4de4-aff3-9a6b266bc8a2.svg',\n width: 16,\n height: 16,\n // 用于调整图标的左右位置\n offset: 0\n },\n // 节点中表示状态的icon配置\n stateIcon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: true,\n x: 0,\n y: 0,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/basement_prod/300a2523-67e0-4cbf-9d4a-67c077b40395.svg',\n width: 16,\n height: 16,\n // 用于调整图标的左右位置\n offset: -5\n },\n // 连接点,默认为左右\n // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }]\n anchorPoints: [[0, 0.5], [1, 0.5]]\n },\n shapeType: 'modelRect',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).preRect,\n preRect = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n var keyShape = group.addShape('rect', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n\n var preRectShow = preRect.show,\n preRectStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(preRect, [\"show\"]);\n\n if (preRectShow) {\n group['shapeMap']['pre-rect'] = group.addShape('rect', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n height: height\n }, preRectStyle),\n className: 'pre-rect',\n name: 'pre-rect',\n draggable: true\n });\n }\n\n this.drawLogoIcon(cfg, group);\n this.drawStateIcon(cfg, group);\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n\n /**\n * 绘制模型矩形左边的logo图标\n * @param {Object} cfg 数据配置项\n * @param {Group} group Group实例\n */\n drawLogoIcon: function drawLogoIcon(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).logoIcon,\n logoIcon = _a === void 0 ? {} : _a;\n var size = this.getSize(cfg);\n var width = size[0];\n\n if (logoIcon.show) {\n var w = logoIcon.width,\n h = logoIcon.height,\n x = logoIcon.x,\n y = logoIcon.y,\n offset = logoIcon.offset,\n text = logoIcon.text,\n logoIconStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(logoIcon, [\"width\", \"height\", \"x\", \"y\", \"offset\", \"text\"]);\n\n if (text) {\n group['shapeMap']['rect-logo-icon'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, logoIconStyle),\n className: 'rect-logo-icon',\n name: 'rect-logo-icon',\n draggable: true\n });\n } else {\n group['shapeMap']['rect-logo-icon'] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, logoIconStyle), {\n x: x || -width / 2 + w + offset,\n y: y || -h / 2,\n width: w,\n height: h\n }),\n className: 'rect-logo-icon',\n name: 'rect-logo-icon',\n draggable: true\n });\n }\n }\n },\n\n /**\n * 绘制模型矩形右边的状态图标\n * @param {Object} cfg 数据配置项\n * @param {Group} group Group实例\n */\n drawStateIcon: function drawStateIcon(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).stateIcon,\n stateIcon = _a === void 0 ? {} : _a;\n var size = this.getSize(cfg);\n var width = size[0];\n\n if (stateIcon.show) {\n var w = stateIcon.width,\n h = stateIcon.height,\n x = stateIcon.x,\n y = stateIcon.y,\n offset = stateIcon.offset,\n text = stateIcon.text,\n iconStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(stateIcon, [\"width\", \"height\", \"x\", \"y\", \"offset\", \"text\"]);\n\n if (text) {\n group['shapeMap']['rect-state-icon'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, iconStyle),\n className: 'rect-state-icon',\n name: 'rect-state-icon',\n draggable: true\n });\n } else {\n group['shapeMap']['rect-state-icon'] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, iconStyle), {\n x: x || width / 2 - w + offset,\n y: y || -h / 2,\n width: w,\n height: h\n }),\n className: 'rect-state-icon',\n name: 'rect-state-icon',\n draggable: true\n });\n }\n }\n },\n\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n\n if (left) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n\n if (right) {\n // right circle\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n\n if (top) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n\n if (bottom) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n },\n drawLabel: function drawLabel(cfg, group) {\n var _a = this.getOptions(cfg),\n _b = _a.labelCfg,\n labelCfg = _b === void 0 ? {} : _b,\n _c = _a.logoIcon,\n logoIcon = _c === void 0 ? {} : _c,\n _d = _a.descriptionCfg,\n descriptionCfg = _d === void 0 ? {} : _d;\n\n var size = this.getSize(cfg);\n var width = size[0];\n var label = null;\n var show = logoIcon.show,\n w = logoIcon.width;\n var offsetX = -width / 2 + labelCfg.offset;\n\n if (show) {\n offsetX = -width / 2 + w + labelCfg.offset;\n }\n\n var fontStyle = labelCfg.style;\n var descriptionStyle = descriptionCfg.style,\n descriptionPaddingTop = descriptionCfg.paddingTop;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(cfg.description)) {\n label = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, fontStyle), {\n x: offsetX,\n y: -5,\n text: cfg.label\n }),\n className: 'text-shape',\n name: 'text-shape',\n draggable: true,\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n group['shapeMap']['rect-description'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, descriptionStyle), {\n x: offsetX,\n y: 17 + (descriptionPaddingTop || 0),\n text: cfg.description\n }),\n className: 'rect-description',\n name: 'rect-description',\n draggable: true,\n labelRelated: true\n });\n } else {\n label = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, fontStyle), {\n x: offsetX,\n y: 7,\n text: cfg.label\n }),\n className: 'text-shape',\n name: 'text-shape',\n draggable: true,\n labelRelated: true\n });\n group['shapeMap']['text-shape'] = label;\n }\n\n return label;\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var width = style.width || size[0];\n var height = style.height || size[1];\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height\n }, style);\n\n return styles;\n },\n update: function update(cfg, item) {\n var _a = this.mergeStyle || this.getOptions(cfg),\n _b = _a.style,\n style = _b === void 0 ? {} : _b,\n _c = _a.labelCfg,\n labelCfg = _c === void 0 ? {} : _c,\n _d = _a.descriptionCfg,\n descriptionCfg = _d === void 0 ? {} : _d;\n\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n var keyShape = item.get('keyShape');\n keyShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, style), {\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height\n }));\n var group = item.getContainer();\n var logoIconShape = group['shapeMap']['rect-logo-icon'] || group.find(function (element) {\n return element.get('className') === 'rect-logo-icon';\n });\n var currentLogoIconAttr = logoIconShape ? logoIconShape.attr() : {};\n var logoIcon = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, currentLogoIconAttr, cfg.logoIcon);\n var w = logoIcon.width;\n\n if (w === undefined) {\n w = this.options.logoIcon.width;\n }\n\n var show = cfg.logoIcon ? cfg.logoIcon.show : undefined;\n var offset = labelCfg.offset;\n var offsetX = -width / 2 + w + offset;\n\n if (!show && show !== undefined) {\n offsetX = -width / 2 + offset;\n }\n\n var label = group['shapeMap']['node-label'] || group.find(function (element) {\n return element.get('className') === 'node-label';\n });\n var description = group['shapeMap']['rect-description'] || group.find(function (element) {\n return element.get('className') === 'rect-description';\n });\n\n if (cfg.label) {\n if (!label) {\n group['shapeMap']['node-label'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, labelCfg.style), {\n x: offsetX,\n y: cfg.description ? -5 : 7,\n text: cfg.label\n }),\n className: 'node-label',\n name: 'node-label',\n draggable: true,\n labelRelated: true\n });\n } else {\n var cfgStyle = cfg.labelCfg ? cfg.labelCfg.style : {};\n var labelStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, label.attr(), cfgStyle);\n if (cfg.label) labelStyle.text = cfg.label;\n labelStyle.x = offsetX;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(cfg.description)) labelStyle.y = -5;\n\n if (description) {\n description.resetMatrix();\n description.attr({\n x: offsetX\n });\n }\n\n label.resetMatrix();\n label.attr(labelStyle);\n }\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(cfg.description)) {\n var paddingTop = descriptionCfg.paddingTop;\n\n if (!description) {\n group['shapeMap']['rect-description'] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, descriptionCfg.style), {\n x: offsetX,\n y: 17 + (paddingTop || 0),\n text: cfg.description\n }),\n className: 'rect-description',\n name: 'rect-description',\n draggable: true,\n labelRelated: true\n });\n } else {\n var cfgStyle = cfg.descriptionCfg ? cfg.descriptionCfg.style : {};\n var descriptionStyle = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, description.attr(), cfgStyle);\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(cfg.description)) descriptionStyle.text = cfg.description;\n descriptionStyle.x = offsetX;\n description.resetMatrix();\n description.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, descriptionStyle), {\n y: 17 + (paddingTop || 0)\n }));\n }\n }\n\n var preRectShape = group['shapeMap']['pre-rect'] || group.find(function (element) {\n return element.get('className') === 'pre-rect';\n });\n\n if (preRectShape && !preRectShape.destroyed) {\n var preRect = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, preRectShape.attr(), cfg.preRect);\n preRectShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, preRect), {\n x: -width / 2,\n y: -height / 2,\n height: height\n }));\n }\n\n if (logoIconShape && !logoIconShape.destroyed) {\n if (!show && show !== undefined) {\n logoIconShape.remove();\n delete group['shapeMap']['pre-rect'];\n } else {\n var logoW = logoIcon.width,\n h = logoIcon.height,\n x = logoIcon.x,\n y = logoIcon.y,\n logoOffset = logoIcon.offset,\n logoIconStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(logoIcon, [\"width\", \"height\", \"x\", \"y\", \"offset\"]);\n\n logoIconShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, logoIconStyle), {\n x: x || -width / 2 + logoW + logoOffset,\n y: y || -h / 2,\n width: logoW,\n height: h\n }));\n }\n } else if (show) {\n this.drawLogoIcon(cfg, group);\n }\n\n var stateIconShape = group['shapeMap']['rect-state-icon'] || group.find(function (element) {\n return element.get('className') === 'rect-state-icon';\n });\n var currentStateIconAttr = stateIconShape ? stateIconShape.attr() : {};\n var stateIcon = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, currentStateIconAttr, cfg.stateIcon);\n\n if (stateIconShape) {\n if (!stateIcon.show && stateIcon.show !== undefined) {\n stateIconShape.remove();\n delete group['shapeMap']['rect-state-icon'];\n }\n\n var stateW = stateIcon.width,\n h = stateIcon.height,\n x = stateIcon.x,\n y = stateIcon.y,\n stateOffset = stateIcon.offset,\n stateIconStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(stateIcon, [\"width\", \"height\", \"x\", \"y\", \"offset\"]);\n\n stateIconShape.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, stateIconStyle), {\n x: x || width / 2 - stateW + stateOffset,\n y: y || -h / 2,\n width: stateW,\n height: h\n }));\n } else if (stateIcon.show) {\n this.drawStateIcon(cfg, group);\n }\n\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/modelRect.js?"); +eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getLayoutByName = exports.unRegisterLayout = exports.registerLayout = void 0;\nvar registy_1 = __webpack_require__(/*! ./registy */ \"./node_modules/@antv/layout/lib/registy/index.js\");\nObject.defineProperty(exports, \"registerLayout\", { enumerable: true, get: function () { return registy_1.registerLayout; } });\nObject.defineProperty(exports, \"unRegisterLayout\", { enumerable: true, get: function () { return registy_1.unRegisterLayout; } });\nObject.defineProperty(exports, \"getLayoutByName\", { enumerable: true, get: function () { return registy_1.getLayoutByName; } });\n// layout, layout types file, worker\n__exportStar(__webpack_require__(/*! ./layout */ \"./node_modules/@antv/layout/lib/layout/index.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/rect.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/rect.js ***! - \********************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/base.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/base.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n\n\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"registerNode\"])('rect', {\n // 自定义节点时的配置\n options: {\n size: [100, 30],\n style: {\n radius: 0,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n // 文本样式配置\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n // 连接点,默认为左右\n // anchorPoints: [{ x: 0, y: 0.5 }, { x: 1, y: 0.5 }]\n anchorPoints: [[0, 0.5], [1, 0.5]],\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_2__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'rect',\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('rect', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n\n var size = this.getSize(cfg);\n var width = size[0];\n var height = size[1];\n\n if (left) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: -width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n\n if (right) {\n // right circle\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: width / 2,\n y: 0,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n\n if (top) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: -height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n\n if (bottom) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: 0,\n y: height / 2,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, strokeStyle);\n var size = this.getSize(cfg);\n var width = style.width || size[0];\n var height = style.height || size[1];\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -width / 2,\n y: -height / 2,\n width: width,\n height: height\n }, style);\n\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n\n var defaultStyle = this.getOptions({}).style;\n var size = this.getSize(cfg);\n var keyShape = item.get('keyShape');\n\n if (!cfg.size) {\n size[0] = keyShape.attr('width') || defaultStyle.width;\n size[1] = keyShape.attr('height') || defaultStyle.height;\n } // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n\n\n var strokeStyle = {\n stroke: cfg.color,\n x: -size[0] / 2,\n y: -size[1] / 2,\n width: size[0],\n height: size[1]\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, false, updateType);\n this.updateLinkPoints(cfg, group);\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/rect.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Base = void 0;\nvar Base = /** @class */ (function () {\n function Base() {\n this.nodes = [];\n this.edges = [];\n this.combos = [];\n this.comboEdges = [];\n this.hiddenNodes = [];\n this.hiddenEdges = [];\n this.hiddenCombos = [];\n // temp edges e.g. the edge generated for releated collapsed combo\n this.vedges = [];\n this.positions = [];\n this.destroyed = false;\n this.onLayoutEnd = function () { };\n }\n Base.prototype.layout = function (data) {\n this.init(data);\n return this.execute(true);\n };\n Base.prototype.init = function (data) {\n this.nodes = data.nodes || [];\n this.edges = data.edges || [];\n this.combos = data.combos || [];\n this.comboEdges = data.comboEdges || [];\n this.hiddenNodes = data.hiddenNodes || [];\n this.hiddenEdges = data.hiddenEdges || [];\n this.hiddenCombos = data.hiddenCombos || [];\n this.vedges = data.vedges || [];\n };\n Base.prototype.execute = function (reloadData) { };\n Base.prototype.executeWithWorker = function () { };\n Base.prototype.getDefaultCfg = function () {\n return {};\n };\n Base.prototype.updateCfg = function (cfg) {\n if (cfg) {\n Object.assign(this, cfg);\n }\n };\n Base.prototype.getType = function () {\n return 'base';\n };\n Base.prototype.destroy = function () {\n this.nodes = null;\n this.edges = null;\n this.combos = null;\n this.positions = null;\n this.destroyed = true;\n };\n return Base;\n}());\nexports.Base = Base;\n//# sourceMappingURL=base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/base.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/star.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/star.js ***! - \********************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/circular.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/circular.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n // 五角星shape\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('star', {\n // 自定义节点时的配置\n options: {\n size: 60,\n style: {\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize,\n fontFamily: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].windowFontFamily\n }\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'star',\n // 文本位置\n labelPosition: 'center',\n drawShape: function drawShape(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).icon,\n icon = _a === void 0 ? {} : _a;\n var style = this.getShapeStyle(cfg);\n var keyShape = group.addShape('path', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var w = icon.width,\n h = icon.height,\n show = icon.show,\n text = icon.text;\n\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: -w / 2,\n y: -h / 2\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = (this.mergeStyle || this.getOptions(cfg)).linkPoints,\n linkPoints = _a === void 0 ? {} : _a;\n\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n leftBottom = linkPoints.leftBottom,\n rightBottom = linkPoints.rightBottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"leftBottom\", \"rightBottom\", \"size\", \"r\"]);\n\n var size = this.getSize(cfg);\n var outerR = size[0];\n\n if (right) {\n // right circle\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 0) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 0) / 180 * Math.PI) * outerR;\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right'\n });\n }\n\n if (top) {\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 1) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 1) / 180 * Math.PI) * outerR; // top circle\n\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top'\n });\n }\n\n if (left) {\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 2) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 2) / 180 * Math.PI) * outerR; // left circle\n\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left'\n });\n }\n\n if (leftBottom) {\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 3) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 3) / 180 * Math.PI) * outerR; // left bottom circle\n\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left-bottom',\n name: 'link-point-left-bottom'\n });\n }\n\n if (rightBottom) {\n // up down left right 四个方向的坐标均不相同\n var x1 = Math.cos((18 + 72 * 4) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * 4) / 180 * Math.PI) * outerR; // left bottom circle\n\n group['shapeMap']['link-point-right-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: x1,\n y: -y1,\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right-bottom',\n name: 'link-point-right-bottom'\n });\n }\n },\n getPath: function getPath(cfg) {\n var size = this.getSize(cfg);\n var outerR = size[0];\n var defaultInnerR = outerR * 3 / 8;\n var innerR = cfg.innerR || defaultInnerR;\n var path = [];\n\n for (var i = 0; i < 5; i++) {\n var x1 = Math.cos((18 + 72 * i) / 180 * Math.PI) * outerR;\n var y1 = Math.sin((18 + 72 * i) / 180 * Math.PI) * outerR;\n var x2 = Math.cos((54 + 72 * i) / 180 * Math.PI) * innerR;\n var y2 = Math.sin((54 + 72 * i) / 180 * Math.PI) * innerR;\n\n if (i === 0) {\n path.push(['M', x1, -y1]);\n } else {\n path.push(['L', x1, -y1]);\n }\n\n path.push(['L', x2, -y2]);\n }\n\n path.push(['Z']);\n return path;\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖原来默认的 stroke 属性。但 cfg 中但 stroke 属性优先级更高\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, strokeStyle);\n var path = this.getPath(cfg);\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: path\n }, style);\n\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n\n var defaultStyle = this.getOptions({}).style;\n var path = this.getPath(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n\n var strokeStyle = {\n stroke: cfg.color,\n path: path\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n },\n\n /**\n * 更新linkPoints\n * @param {Object} cfg 节点数据配置项\n * @param {Group} group Item所在的group\n */\n updateLinkPoints: function updateLinkPoints(cfg, group) {\n var defaultLinkPoints = this.getOptions({}).linkPoints;\n var markLeft = group['shapeMap']['link-point-left'] || group.find(function (element) {\n return element.get('className') === 'link-point-left';\n });\n var markRight = group['shapeMap']['link-point-right'] || group.find(function (element) {\n return element.get('className') === 'link-point-right';\n });\n var markTop = group['shapeMap']['link-point-top'] || group.find(function (element) {\n return element.get('className') === 'link-point-top';\n });\n var markLeftBottom = group['shapeMap']['link-point-left-bottom'] || group.find(function (element) {\n return element.get('className') === 'link-point-left-bottom';\n });\n var markRightBottom = group['shapeMap']['link-point-left-bottom'] || group.find(function (element) {\n return element.get('className') === 'link-point-right-bottom';\n });\n var currentLinkPoints = defaultLinkPoints;\n var existLinkPoint = markLeft || markRight || markTop || markLeftBottom || markRightBottom;\n\n if (existLinkPoint) {\n currentLinkPoints = existLinkPoint.attr();\n }\n\n var linkPoints = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, currentLinkPoints, cfg.linkPoints);\n var markFill = linkPoints.fill,\n markStroke = linkPoints.stroke,\n borderWidth = linkPoints.lineWidth;\n var markSize = linkPoints.size / 2;\n if (!markSize) markSize = linkPoints.r;\n\n var _a = cfg.linkPoints ? cfg.linkPoints : {\n left: undefined,\n right: undefined,\n top: undefined,\n leftBottom: undefined,\n rightBottom: undefined\n },\n left = _a.left,\n right = _a.right,\n top = _a.top,\n leftBottom = _a.leftBottom,\n rightBottom = _a.rightBottom;\n\n var size = this.getSize(cfg);\n var outerR = size[0];\n var styles = {\n r: markSize,\n fill: markFill,\n stroke: markStroke,\n lineWidth: borderWidth\n };\n var x = Math.cos((18 + 72 * 0) / 180 * Math.PI) * outerR;\n var y = Math.sin((18 + 72 * 0) / 180 * Math.PI) * outerR;\n\n if (markRight) {\n if (!right && right !== undefined) {\n markRight.remove();\n delete group['shapeMap']['link-point-right'];\n } else {\n markRight.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (right) {\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n\n x = Math.cos((18 + 72 * 1) / 180 * Math.PI) * outerR;\n y = Math.sin((18 + 72 * 1) / 180 * Math.PI) * outerR;\n\n if (markTop) {\n if (!top && top !== undefined) {\n markTop.remove();\n delete group['shapeMap']['link-point-top'];\n } else {\n markTop.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (top) {\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n\n x = Math.cos((18 + 72 * 2) / 180 * Math.PI) * outerR;\n y = Math.sin((18 + 72 * 2) / 180 * Math.PI) * outerR;\n\n if (markLeft) {\n if (!left && left !== undefined) {\n markLeft.remove();\n delete group['shapeMap']['link-point-left'];\n } else {\n markLeft.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (left) {\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n\n x = Math.cos((18 + 72 * 3) / 180 * Math.PI) * outerR;\n y = Math.sin((18 + 72 * 3) / 180 * Math.PI) * outerR;\n\n if (markLeftBottom) {\n if (!leftBottom && leftBottom !== undefined) {\n markLeftBottom.remove();\n delete group['shapeMap']['link-point-left-bottom'];\n } else {\n markLeftBottom.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (leftBottom) {\n group['shapeMap']['link-point-left-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-left-bottom',\n name: 'link-point-left-bottom',\n isAnchorPoint: true\n });\n }\n\n x = Math.cos((18 + 72 * 4) / 180 * Math.PI) * outerR;\n y = Math.sin((18 + 72 * 4) / 180 * Math.PI) * outerR;\n\n if (markRightBottom) {\n if (!rightBottom && rightBottom !== undefined) {\n markRightBottom.remove();\n delete group['shapeMap']['link-point-right-bottom'];\n } else {\n markRightBottom.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }));\n }\n } else if (rightBottom) {\n group['shapeMap']['link-point-right-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: x,\n y: -y\n }),\n className: 'link-point-right-bottom',\n name: 'link-point-right-bottom',\n isAnchorPoint: true\n });\n }\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/star.js?"); +eval("\n/**\n * @fileOverview random layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CircularLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nfunction initHierarchy(nodes, edges, nodeMap, directed) {\n nodes.forEach(function (_, i) {\n nodes[i].children = [];\n nodes[i].parent = [];\n });\n if (directed) {\n edges.forEach(function (e) {\n var source = (0, util_1.getEdgeTerminal)(e, 'source');\n var target = (0, util_1.getEdgeTerminal)(e, 'target');\n var sourceIdx = 0;\n if (source) {\n sourceIdx = nodeMap[source];\n }\n var targetIdx = 0;\n if (target) {\n targetIdx = nodeMap[target];\n }\n var child = nodes[sourceIdx].children;\n var parent = nodes[targetIdx].parent;\n child.push(nodes[targetIdx].id);\n parent.push(nodes[sourceIdx].id);\n });\n }\n else {\n edges.forEach(function (e) {\n var source = (0, util_1.getEdgeTerminal)(e, 'source');\n var target = (0, util_1.getEdgeTerminal)(e, 'target');\n var sourceIdx = 0;\n if (source) {\n sourceIdx = nodeMap[source];\n }\n var targetIdx = 0;\n if (target) {\n targetIdx = nodeMap[target];\n }\n var sourceChildren = nodes[sourceIdx].children;\n var targetChildren = nodes[targetIdx].children;\n sourceChildren.push(nodes[targetIdx].id);\n targetChildren.push(nodes[sourceIdx].id);\n });\n }\n}\nfunction connect(a, b, edges) {\n var m = edges.length;\n for (var i = 0; i < m; i++) {\n var source = (0, util_1.getEdgeTerminal)(edges[i], 'source');\n var target = (0, util_1.getEdgeTerminal)(edges[i], 'target');\n if ((a.id === source && b.id === target) ||\n (b.id === source && a.id === target)) {\n return true;\n }\n }\n return false;\n}\nfunction compareDegree(a, b) {\n var aDegree = a.degree;\n var bDegree = b.degree;\n if (aDegree < bDegree) {\n return -1;\n }\n if (aDegree > bDegree) {\n return 1;\n }\n return 0;\n}\n/**\n * 圆形布局\n */\nvar CircularLayout = /** @class */ (function (_super) {\n __extends(CircularLayout, _super);\n function CircularLayout(options) {\n var _this = _super.call(this) || this;\n /** 固定半径,若设置了 radius,则 startRadius 与 endRadius 不起效 */\n _this.radius = null;\n /** 节点大小,配合 nodeSpacing,一起用于计算 radius。若不配置,节点大小默认为 30 */\n _this.nodeSize = undefined;\n /** 起始半径 */\n _this.startRadius = null;\n /** 终止半径 */\n _this.endRadius = null;\n /** 起始角度 */\n _this.startAngle = 0;\n /** 终止角度 */\n _this.endAngle = 2 * Math.PI;\n /** 是否顺时针 */\n _this.clockwise = true;\n /** 节点在环上分成段数(几个段将均匀分布),在 endRadius - startRadius != 0 时生效 */\n _this.divisions = 1;\n /** 节点在环上排序的依据,可选: 'topology', 'degree', 'null' */\n _this.ordering = null;\n /** how many 2*pi from first to last nodes */\n _this.angleRatio = 1;\n _this.nodes = [];\n _this.edges = [];\n _this.nodeMap = {};\n _this.degrees = [];\n _this.width = 300;\n _this.height = 300;\n _this.updateCfg(options);\n return _this;\n }\n CircularLayout.prototype.getDefaultCfg = function () {\n return {\n radius: null,\n startRadius: null,\n endRadius: null,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n clockwise: true,\n divisions: 1,\n ordering: null,\n angleRatio: 1\n };\n };\n /**\n * 执行布局\n */\n CircularLayout.prototype.execute = function () {\n var _a;\n var self = this;\n var nodes = self.nodes;\n var edges = self.edges;\n var n = nodes.length;\n if (n === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (n === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n var radius = self.radius, startRadius = self.startRadius, endRadius = self.endRadius;\n var divisions = self.divisions, startAngle = self.startAngle, endAngle = self.endAngle, angleRatio = self.angleRatio, ordering = self.ordering, clockwise = self.clockwise, paramNodeSpacing = self.nodeSpacing, paramNodeSize = self.nodeSize;\n var angleStep = (endAngle - startAngle) / n;\n // layout\n var nodeMap = {};\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n var degrees = (0, util_1.getDegree)(nodes.length, nodeMap, edges);\n self.degrees = degrees;\n if (paramNodeSpacing) {\n var nodeSpacing_1 = (0, util_1.getFuncByUnknownType)(10, paramNodeSpacing);\n var nodeSize_1 = (0, util_1.getFuncByUnknownType)(10, paramNodeSize);\n var maxNodeSize_1 = -Infinity;\n nodes.forEach(function (node) {\n var nSize = nodeSize_1(node);\n if (maxNodeSize_1 < nSize)\n maxNodeSize_1 = nSize;\n });\n var length_1 = 0;\n nodes.forEach(function (node, i) {\n if (i === 0)\n length_1 += (maxNodeSize_1 || 10);\n else\n length_1 += (nodeSpacing_1(node) || 0) + (maxNodeSize_1 || 10);\n });\n radius = length_1 / (2 * Math.PI);\n }\n else if (!radius && !startRadius && !endRadius) {\n radius = self.height > self.width ? self.width / 2 : self.height / 2;\n }\n else if (!startRadius && endRadius) {\n startRadius = endRadius;\n }\n else if (startRadius && !endRadius) {\n endRadius = startRadius;\n }\n var astep = angleStep * angleRatio;\n var layoutNodes = [];\n if (ordering === \"topology\") {\n // layout according to the topology\n layoutNodes = self.topologyOrdering();\n }\n else if (ordering === \"topology-directed\") {\n // layout according to the topology\n layoutNodes = self.topologyOrdering(true);\n }\n else if (ordering === \"degree\") {\n // layout according to the descent order of degrees\n layoutNodes = self.degreeOrdering();\n }\n else {\n // layout according to the original order in the data.nodes\n layoutNodes = nodes;\n }\n var divN = Math.ceil(n / divisions); // node number in each division\n for (var i = 0; i < n; ++i) {\n var r = radius;\n if (!r && startRadius !== null && endRadius !== null) {\n r = startRadius + (i * (endRadius - startRadius)) / (n - 1);\n }\n if (!r) {\n r = 10 + (i * 100) / (n - 1);\n }\n var angle = startAngle +\n (i % divN) * astep +\n ((2 * Math.PI) / divisions) * Math.floor(i / divN);\n if (!clockwise) {\n angle =\n endAngle -\n (i % divN) * astep -\n ((2 * Math.PI) / divisions) * Math.floor(i / divN);\n }\n layoutNodes[i].x = center[0] + Math.cos(angle) * r;\n layoutNodes[i].y = center[1] + Math.sin(angle) * r;\n layoutNodes[i].weight = degrees[i].all;\n }\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n return {\n nodes: layoutNodes,\n edges: this.edges\n };\n };\n /**\n * 根据节点的拓扑结构排序\n * @return {array} orderedNodes 排序后的结果\n */\n CircularLayout.prototype.topologyOrdering = function (directed) {\n if (directed === void 0) { directed = false; }\n var self = this;\n var degrees = self.degrees;\n var edges = self.edges;\n var nodes = self.nodes;\n var cnodes = (0, util_1.clone)(nodes);\n var nodeMap = self.nodeMap;\n var orderedCNodes = [cnodes[0]];\n var resNodes = [nodes[0]];\n var pickFlags = [];\n var n = nodes.length;\n pickFlags[0] = true;\n initHierarchy(cnodes, edges, nodeMap, directed);\n var k = 0;\n cnodes.forEach(function (cnode, i) {\n if (i !== 0) {\n if ((i === n - 1 ||\n degrees[i].all !== degrees[i + 1].all ||\n connect(orderedCNodes[k], cnode, edges)) &&\n !pickFlags[i]) {\n orderedCNodes.push(cnode);\n resNodes.push(nodes[nodeMap[cnode.id]]);\n pickFlags[i] = true;\n k++;\n }\n else {\n var children = orderedCNodes[k].children;\n var foundChild = false;\n for (var j = 0; j < children.length; j++) {\n var childIdx = nodeMap[children[j]];\n if (degrees[childIdx].all === degrees[i].all && !pickFlags[childIdx]) {\n orderedCNodes.push(cnodes[childIdx]);\n resNodes.push(nodes[nodeMap[cnodes[childIdx].id]]);\n pickFlags[childIdx] = true;\n foundChild = true;\n break;\n }\n }\n var ii = 0;\n while (!foundChild) {\n if (!pickFlags[ii]) {\n orderedCNodes.push(cnodes[ii]);\n resNodes.push(nodes[nodeMap[cnodes[ii].id]]);\n pickFlags[ii] = true;\n foundChild = true;\n }\n ii++;\n if (ii === n) {\n break;\n }\n }\n }\n }\n });\n return resNodes;\n };\n /**\n * 根据节点度数大小排序\n * @return {array} orderedNodes 排序后的结果\n */\n CircularLayout.prototype.degreeOrdering = function () {\n var self = this;\n var nodes = self.nodes;\n var orderedNodes = [];\n var degrees = self.degrees;\n nodes.forEach(function (node, i) {\n node.degree = degrees[i].all;\n orderedNodes.push(node);\n });\n orderedNodes.sort(compareDegree);\n return orderedNodes;\n };\n CircularLayout.prototype.getType = function () {\n return \"circular\";\n };\n return CircularLayout;\n}(base_1.Base));\nexports.CircularLayout = CircularLayout;\n//# sourceMappingURL=circular.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/circular.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-element/es/nodes/triangle.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g6-element/es/nodes/triangle.js ***! - \************************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/comboCombined.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/comboCombined.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n // 三角形\n\nObject(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"])('triangle', {\n // 自定义节点时的配置\n options: {\n size: 40,\n direction: 'up',\n style: {\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.stroke,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.fill,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.style.lineWidth\n },\n labelCfg: {\n style: {\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fill,\n fontSize: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeLabel.style.fontSize\n },\n offset: 15\n },\n // 节点上左右上下四个方向上的链接circle配置\n linkPoints: {\n top: false,\n right: false,\n bottom: false,\n left: false,\n // circle的大小\n size: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.size,\n lineWidth: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.lineWidth,\n fill: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.fill,\n stroke: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].defaultNode.linkPoints.stroke\n },\n // 节点中icon配置\n icon: {\n // 是否显示icon,值为 false 则不渲染icon\n show: false,\n // icon的地址,字符串类型\n img: 'https://gw.alipayobjects.com/zos/bmw-prod/5d015065-8505-4e7a-baec-976f81e3c41d.svg',\n width: 20,\n height: 20,\n offset: 6\n },\n stateStyles: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"].nodeStateStyles)\n },\n shapeType: 'triangle',\n // 文本位置\n labelPosition: 'bottom',\n drawShape: function drawShape(cfg, group) {\n var _a = this.mergeStyle || this.getOptions(cfg),\n _b = _a.icon,\n icon = _b === void 0 ? {} : _b,\n defaultDirection = _a.direction;\n\n var style = this.getShapeStyle(cfg);\n var direction = cfg.direction || defaultDirection;\n var keyShape = group.addShape('path', {\n attrs: style,\n className: \"\".concat(this.type, \"-keyShape\"),\n name: \"\".concat(this.type, \"-keyShape\"),\n draggable: true\n });\n group['shapeMap'][\"\".concat(this.type, \"-keyShape\")] = keyShape;\n var w = icon.width,\n h = icon.height,\n show = icon.show,\n offset = icon.offset,\n text = icon.text;\n\n if (show) {\n if (text) {\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('text', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: 0,\n y: 0,\n fontSize: 12,\n fill: '#000',\n stroke: '#000',\n textBaseline: 'middle',\n textAlign: 'center'\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n } else {\n var iconW = -w / 2;\n var iconH = -h / 2;\n\n if (direction === 'up' || direction === 'down') {\n iconH += offset;\n }\n\n if (direction === 'left' || direction === 'right') {\n iconW += offset;\n }\n\n group['shapeMap'][\"\".concat(this.type, \"-icon\")] = group.addShape('image', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n x: iconW,\n y: iconH\n }, icon),\n className: \"\".concat(this.type, \"-icon\"),\n name: \"\".concat(this.type, \"-icon\"),\n draggable: true\n });\n }\n }\n\n this.drawLinkPoints(cfg, group);\n return keyShape;\n },\n\n /**\n * 绘制节点上的LinkPoints\n * @param {Object} cfg data数据配置项\n * @param {Group} group Group实例\n */\n drawLinkPoints: function drawLinkPoints(cfg, group) {\n var _a = this.mergeStyle || this.getOptions(cfg),\n _b = _a.linkPoints,\n linkPoints = _b === void 0 ? {} : _b,\n defaultDirection = _a.direction;\n\n var direction = cfg.direction || defaultDirection;\n\n var top = linkPoints.top,\n left = linkPoints.left,\n right = linkPoints.right,\n bottom = linkPoints.bottom,\n markSize = linkPoints.size,\n markR = linkPoints.r,\n markStyle = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(linkPoints, [\"top\", \"left\", \"right\", \"bottom\", \"size\", \"r\"]);\n\n var size = this.getSize(cfg);\n var len = size[0];\n\n if (left) {\n // up down left right 四个方向的坐标均不相同\n var leftPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n\n if (direction === 'up') {\n leftPos = [-r, diffY];\n } else if (direction === 'down') {\n leftPos = [-r, -diffY];\n } else if (direction === 'left') {\n leftPos = [-r, r - diffY];\n }\n\n if (leftPos) {\n // left circle\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: leftPos[0],\n y: leftPos[1],\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-left',\n name: 'link-point-left'\n });\n }\n }\n\n if (right) {\n // right circle\n // up down left right 四个方向的坐标均不相同\n var rightPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n\n if (direction === 'up') {\n rightPos = [r, diffY];\n } else if (direction === 'down') {\n rightPos = [r, -diffY];\n } else if (direction === 'right') {\n rightPos = [r, r - diffY];\n }\n\n if (rightPos) {\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: rightPos[0],\n y: rightPos[1],\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-right',\n name: 'link-point-right'\n });\n }\n }\n\n if (top) {\n // up down left right 四个方向的坐标均不相同\n var topPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n\n if (direction === 'up') {\n topPos = [r - diffY, -diffY];\n } else if (direction === 'left') {\n topPos = [r, -diffY];\n } else if (direction === 'right') {\n topPos = [-r, -diffY];\n }\n\n if (topPos) {\n // top circle\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: topPos[0],\n y: topPos[1],\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-top',\n name: 'link-point-top'\n });\n }\n }\n\n if (bottom) {\n // up down left right 四个方向的坐标均不相同\n var bottomPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n\n if (direction === 'down') {\n bottomPos = [-r + diffY, diffY];\n } else if (direction === 'left') {\n bottomPos = [r, diffY];\n } else if (direction === 'right') {\n bottomPos = [-r, diffY];\n }\n\n if (bottomPos) {\n // bottom circle\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, markStyle), {\n x: bottomPos[0],\n y: bottomPos[1],\n r: markSize / 2 || markR || 5\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom'\n });\n }\n }\n },\n getPath: function getPath(cfg) {\n var defaultDirection = (this.mergeStyle || this.getOptions(cfg)).direction;\n var direction = cfg.direction || defaultDirection;\n var size = this.getSize(cfg);\n var len = size[0];\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n var path = [['M', -r, diffY], ['L', 0, -diffY], ['L', r, diffY], ['Z'] // 封闭\n ];\n\n if (direction === 'down') {\n path = [['M', -r, -diffY], ['L', r, -diffY], ['L', 0, diffY], ['Z'] // 封闭\n ];\n } else if (direction === 'left') {\n path = [['M', -r, r - diffY], ['L', r, -r], ['L', r, r], ['Z'] // 封闭\n ];\n } else if (direction === 'right') {\n path = [['M', r, r - diffY], ['L', -r, r], ['L', -r, -r], ['Z'] // 封闭\n ];\n }\n\n return path;\n },\n\n /**\n * 获取节点的样式,供基于该节点自定义时使用\n * @param {Object} cfg 节点数据模型\n * @return {Object} 节点的样式\n */\n getShapeStyle: function getShapeStyle(cfg) {\n var defaultStyle = (this.mergeStyle || this.getOptions(cfg)).style;\n var strokeStyle = {\n stroke: cfg.color\n }; // 如果设置了color,则覆盖默认的stroke属性\n\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, strokeStyle);\n var path = this.getPath(cfg);\n\n var styles = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: path\n }, style);\n\n return styles;\n },\n update: function update(cfg, item, updateType) {\n var group = item.getContainer(); // 这里不传 cfg 参数是因为 cfg.style 需要最后覆盖样式\n\n var defaultStyle = this.getOptions({}).style;\n var path = this.getPath(cfg); // 下面这些属性需要覆盖默认样式与目前样式,但若在 cfg 中有指定则应该被 cfg 的相应配置覆盖。\n\n var strokeStyle = {\n stroke: cfg.color,\n path: path\n }; // 与 getShapeStyle 不同在于,update 时需要获取到当前的 style 进行融合。即新传入的配置项中没有涉及的属性,保留当前的配置。\n\n var keyShape = item.get('keyShape');\n var style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, defaultStyle, keyShape.attr(), strokeStyle);\n style = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])(style, cfg.style);\n this.updateShape(cfg, item, style, true, updateType);\n this.updateLinkPoints(cfg, group);\n },\n\n /**\n * 更新linkPoints\n * @param {Object} cfg 节点数据配置项\n * @param {Group} group Item所在的group\n */\n updateLinkPoints: function updateLinkPoints(cfg, group) {\n var _a = this.getOptions({}),\n defaultLinkPoints = _a.linkPoints,\n defaultDirection = _a.direction;\n\n var direction = cfg.direction || defaultDirection;\n var markLeft = group['shapeMap']['link-point-left'] || group.find(function (element) {\n return element.get('className') === 'link-point-left';\n });\n var markRight = group['shapeMap']['link-point-right'] || group.find(function (element) {\n return element.get('className') === 'link-point-right';\n });\n var markTop = group['shapeMap']['link-point-top'] || group.find(function (element) {\n return element.get('className') === 'link-point-top';\n });\n var markBottom = group['shapeMap']['link-point-bottom'] || group.find(function (element) {\n return element.get('className') === 'link-point-bottom';\n });\n var currentLinkPoints = defaultLinkPoints;\n var existLinkPoint = markLeft || markRight || markTop || markBottom;\n\n if (existLinkPoint) {\n currentLinkPoints = existLinkPoint.attr();\n }\n\n var linkPoints = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"mix\"])({}, currentLinkPoints, cfg.linkPoints);\n var markFill = linkPoints.fill,\n markStroke = linkPoints.stroke,\n borderWidth = linkPoints.lineWidth;\n var markSize = linkPoints.size / 2;\n if (!markSize) markSize = linkPoints.r;\n\n var _b = cfg.linkPoints ? cfg.linkPoints : {\n left: undefined,\n right: undefined,\n top: undefined,\n bottom: undefined\n },\n left = _b.left,\n right = _b.right,\n top = _b.top,\n bottom = _b.bottom;\n\n var size = this.getSize(cfg);\n var len = size[0];\n var styles = {\n r: markSize,\n fill: markFill,\n stroke: markStroke,\n lineWidth: borderWidth\n };\n var leftPos = null;\n var diffY = len * Math.sin(1 / 3 * Math.PI);\n var r = len * Math.sin(1 / 3 * Math.PI);\n\n if (direction === 'up') {\n leftPos = [-r, diffY];\n } else if (direction === 'down') {\n leftPos = [-r, -diffY];\n } else if (direction === 'left') {\n leftPos = [-r, r - diffY];\n }\n\n if (leftPos) {\n if (markLeft) {\n if (!left && left !== undefined) {\n markLeft.remove();\n delete group['shapeMap']['link-point-left'];\n } else {\n markLeft.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: leftPos[0],\n y: leftPos[1]\n }));\n }\n } else if (left) {\n group['shapeMap']['link-point-left'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: leftPos[0],\n y: leftPos[1]\n }),\n className: 'link-point-left',\n name: 'link-point-left',\n isAnchorPoint: true\n });\n }\n }\n\n var rightPos = null;\n\n if (direction === 'up') {\n rightPos = [r, diffY];\n } else if (direction === 'down') {\n rightPos = [r, -diffY];\n } else if (direction === 'right') {\n rightPos = [r, r - diffY];\n }\n\n if (rightPos) {\n if (markRight) {\n if (!right && right !== undefined) {\n markRight.remove();\n delete group['shapeMap']['link-point-right'];\n } else {\n markRight.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: rightPos[0],\n y: rightPos[1]\n }));\n }\n } else if (right) {\n group['shapeMap']['link-point-right'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: rightPos[0],\n y: rightPos[1]\n }),\n className: 'link-point-right',\n name: 'link-point-right',\n isAnchorPoint: true\n });\n }\n }\n\n var topPos = null;\n\n if (direction === 'up') {\n topPos = [r - diffY, -diffY];\n } else if (direction === 'left') {\n topPos = [r, -diffY];\n } else if (direction === 'right') {\n topPos = [-r, -diffY];\n }\n\n if (topPos) {\n if (markTop) {\n if (!top && top !== undefined) {\n markTop.remove();\n delete group['shapeMap']['link-point-top'];\n } else {\n // top circle\n markTop.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: topPos[0],\n y: topPos[1]\n }));\n }\n } else if (top) {\n group['shapeMap']['link-point-top'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: topPos[0],\n y: topPos[1]\n }),\n className: 'link-point-top',\n name: 'link-point-top',\n isAnchorPoint: true\n });\n }\n }\n\n var bottomPos = null;\n\n if (direction === 'down') {\n bottomPos = [-r + diffY, diffY];\n } else if (direction === 'left') {\n bottomPos = [r, diffY];\n } else if (direction === 'right') {\n bottomPos = [-r, diffY];\n }\n\n if (bottomPos) {\n if (markBottom) {\n if (!bottom && bottom !== undefined) {\n markBottom.remove();\n delete group['shapeMap']['link-point-bottom'];\n } else {\n markBottom.attr(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: bottomPos[0],\n y: bottomPos[1]\n }));\n }\n } else if (bottom) {\n group['shapeMap']['link-point-bottom'] = group.addShape('circle', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, styles), {\n x: bottomPos[0],\n y: bottomPos[1]\n }),\n className: 'link-point-bottom',\n name: 'link-point-bottom',\n isAnchorPoint: true\n });\n }\n }\n }\n}, 'single-node');\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-element/es/nodes/triangle.js?"); +eval("\n/**\n * @fileOverview Combo force layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ComboCombinedLayout = void 0;\nvar constants_1 = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/layout/lib/layout/constants.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar _1 = __webpack_require__(/*! . */ \"./node_modules/@antv/layout/lib/layout/index.js\");\n/**\n * combined two layouts (inner and outer) for graph with combos\n */\nvar ComboCombinedLayout = /** @class */ (function (_super) {\n __extends(ComboCombinedLayout, _super);\n function ComboCombinedLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 内部计算参数 */\n _this.nodes = [];\n _this.edges = [];\n _this.combos = [];\n _this.comboEdges = [];\n /** Combo 内部的 padding */\n _this.comboPadding = 10;\n _this.comboTrees = [];\n _this.updateCfg(options);\n return _this;\n }\n ComboCombinedLayout.prototype.getDefaultCfg = function () {\n return {};\n };\n /**\n * 执行布局\n */\n ComboCombinedLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var center = self.center;\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n self.initVals();\n // layout\n self.run();\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n };\n ComboCombinedLayout.prototype.run = function () {\n var _a;\n var self = this;\n var nodes = self.nodes, edges = self.edges, combos = self.combos, comboEdges = self.comboEdges, center = self.center;\n var nodeMap = {};\n nodes.forEach(function (node) {\n nodeMap[node.id] = node;\n });\n var comboMap = {};\n combos.forEach(function (combo) {\n comboMap[combo.id] = combo;\n });\n var innerGraphs = self.getInnerGraphs(nodeMap);\n // 每个 innerGraph 作为一个节点,带有大小,参与 force 计算\n var outerNodeIds = [];\n var outerNodes = [];\n var nodeAncestorIdMap = {};\n var allHaveNoPosition = true;\n this.comboTrees.forEach(function (cTree) {\n var innerNode = innerGraphs[cTree.id];\n if (!innerNode) {\n return;\n }\n // 代表 combo 的节点\n var oNode = __assign(__assign({}, cTree), { x: innerNode.x || comboMap[cTree.id].x, y: innerNode.y || comboMap[cTree.id].y, fx: innerNode.fx || comboMap[cTree.id].fx, fy: innerNode.fy || comboMap[cTree.id].fy, mass: innerNode.mass || comboMap[cTree.id].mass, size: innerNode.size });\n outerNodes.push(oNode);\n if (!isNaN(oNode.x) &&\n oNode.x !== 0 &&\n !isNaN(oNode.y) &&\n oNode.y !== 0) {\n allHaveNoPosition = false;\n }\n else {\n oNode.x = Math.random() * 100;\n oNode.y = Math.random() * 100;\n }\n outerNodeIds.push(cTree.id);\n (0, util_1.traverseTreeUp)(cTree, function (child) {\n if (child.id !== cTree.id)\n nodeAncestorIdMap[child.id] = cTree.id;\n return true;\n });\n });\n nodes.forEach(function (node) {\n if (node.comboId && comboMap[node.comboId])\n return;\n // 代表节点的节点\n var oNode = __assign({}, node);\n outerNodes.push(oNode);\n if (!isNaN(oNode.x) &&\n oNode.x !== 0 &&\n !isNaN(oNode.y) &&\n oNode.y !== 0) {\n allHaveNoPosition = false;\n }\n else {\n oNode.x = Math.random() * 100;\n oNode.y = Math.random() * 100;\n }\n outerNodeIds.push(node.id);\n });\n var outerEdges = [];\n edges.concat(comboEdges).forEach(function (edge) {\n var sourceAncestorId = nodeAncestorIdMap[edge.source] || edge.source;\n var targetAncestorId = nodeAncestorIdMap[edge.target] || edge.target;\n // 若两个点的祖先都在力导图的节点中,且是不同的节点,创建一条链接两个祖先的边到力导图的边中\n if (sourceAncestorId !== targetAncestorId &&\n outerNodeIds.includes(sourceAncestorId) &&\n outerNodeIds.includes(targetAncestorId)) {\n outerEdges.push({\n source: sourceAncestorId,\n target: targetAncestorId,\n });\n }\n });\n // 若有需要最外层的 combo 或节点,则对最外层执行力导向\n if (outerNodes === null || outerNodes === void 0 ? void 0 : outerNodes.length) {\n if (outerNodes.length === 1) {\n outerNodes[0].x = center[0];\n outerNodes[0].y = center[1];\n }\n else {\n var outerData = {\n nodes: outerNodes,\n edges: outerEdges,\n };\n // 需要使用一个同步的布局\n // @ts-ignore\n var outerLayout = this.outerLayout ||\n new _1.GForceLayout({\n gravity: 1,\n factor: 4,\n linkDistance: function (edge, source, target) {\n var _a, _b;\n var nodeSize = ((((_a = source.size) === null || _a === void 0 ? void 0 : _a[0]) || 30) + (((_b = target.size) === null || _b === void 0 ? void 0 : _b[0]) || 30)) / 2;\n return Math.min(nodeSize * 1.5, 700);\n },\n });\n var outerLayoutType = (_a = outerLayout.getType) === null || _a === void 0 ? void 0 : _a.call(outerLayout);\n outerLayout.updateCfg({\n center: center,\n kg: 5,\n preventOverlap: true,\n animate: false,\n });\n // 若所有 outerNodes 都没有位置,且 outerLayout 是力导家族的布局,则先执行 preset mds 或 grid\n if (allHaveNoPosition && constants_1.FORCE_LAYOUT_TYPE_MAP[outerLayoutType]) {\n var outerLayoutPreset = outerNodes.length < 100 ? new _1.MDSLayout() : new _1.GridLayout();\n outerLayoutPreset.layout(outerData);\n }\n outerLayout.layout(outerData);\n }\n // 根据外部布局结果,平移 innerGraphs 中的节点(第一层)\n outerNodes.forEach(function (outerNode) {\n var innerGraph = innerGraphs[outerNode.id];\n if (!innerGraph) {\n var node = nodeMap[outerNode.id];\n if (node) {\n node.x = outerNode.x;\n node.y = outerNode.y;\n }\n return;\n }\n innerGraph.visited = true;\n innerGraph.x = outerNode.x;\n innerGraph.y = outerNode.y;\n innerGraph.nodes.forEach(function (node) {\n node.x += outerNode.x;\n node.y += outerNode.y;\n });\n });\n }\n // 至上而下遍历树处理下面各层节点位置\n var innerGraphIds = Object.keys(innerGraphs);\n var _loop_1 = function (i) {\n var id = innerGraphIds[i];\n var innerGraph = innerGraphs[id];\n if (!innerGraph)\n return \"continue\";\n innerGraph.nodes.forEach(function (node) {\n if (!innerGraph.visited) {\n node.x += innerGraph.x || 0;\n node.y += innerGraph.y || 0;\n }\n if (nodeMap[node.id]) {\n nodeMap[node.id].x = node.x;\n nodeMap[node.id].y = node.y;\n }\n });\n if (comboMap[id]) {\n comboMap[id].x = innerGraph.x;\n comboMap[id].y = innerGraph.y;\n }\n };\n for (var i = innerGraphIds.length - 1; i >= 0; i--) {\n _loop_1(i);\n }\n return { nodes: nodes, edges: edges, combos: combos, comboEdges: comboEdges };\n };\n ComboCombinedLayout.prototype.getInnerGraphs = function (nodeMap) {\n var self = this;\n var comboTrees = self.comboTrees, nodeSize = self.nodeSize, edges = self.edges, comboPadding = self.comboPadding, spacing = self.spacing;\n var innerGraphs = {};\n // @ts-ignore\n var innerGraphLayout = this.innerLayout ||\n new _1.ConcentricLayout({ type: 'concentric', sortBy: 'id' });\n innerGraphLayout.center = [0, 0];\n innerGraphLayout.preventOverlap = true;\n innerGraphLayout.nodeSpacing = spacing;\n (comboTrees || []).forEach(function (ctree) {\n (0, util_1.traverseTreeUp)(ctree, function (treeNode) {\n var _a;\n // @ts-ignore\n var padding = (comboPadding === null || comboPadding === void 0 ? void 0 : comboPadding(treeNode)) || 10; // 返回的最大值\n if ((0, util_1.isArray)(padding))\n padding = Math.max.apply(Math, padding);\n if (!((_a = treeNode.children) === null || _a === void 0 ? void 0 : _a.length)) {\n // 空 combo\n if (treeNode.itemType === 'combo') {\n var treeNodeSize = padding\n ? [padding * 2, padding * 2]\n : [30, 30];\n innerGraphs[treeNode.id] = {\n id: treeNode.id,\n nodes: [],\n size: treeNodeSize,\n };\n }\n }\n else {\n // 非空 combo\n var innerGraphNodes = treeNode.children.map(function (child) {\n if (child.itemType === 'combo')\n return innerGraphs[child.id];\n var oriNode = nodeMap[child.id] || {};\n return __assign(__assign({}, oriNode), child);\n });\n var innerGraphNodeIds_1 = innerGraphNodes.map(function (node) { return node.id; });\n var innerGraphData = {\n nodes: innerGraphNodes,\n edges: edges.filter(function (edge) {\n return innerGraphNodeIds_1.includes(edge.source) &&\n innerGraphNodeIds_1.includes(edge.target);\n }),\n };\n var minNodeSize_1 = Infinity;\n innerGraphNodes.forEach(function (node) {\n var _a;\n // @ts-ignore\n if (!node.size)\n node.size = ((_a = innerGraphs[node.id]) === null || _a === void 0 ? void 0 : _a.size) ||\n (nodeSize === null || nodeSize === void 0 ? void 0 : nodeSize(node)) || [30, 30];\n if ((0, util_1.isNumber)(node.size))\n node.size = [node.size, node.size];\n if (minNodeSize_1 > node.size[0])\n minNodeSize_1 = node.size[0];\n if (minNodeSize_1 > node.size[1])\n minNodeSize_1 = node.size[1];\n });\n // 根据节点数量、spacing,调整布局参数\n innerGraphLayout.layout(innerGraphData);\n var _b = (0, util_1.getLayoutBBox)(innerGraphNodes), minX = _b.minX, minY = _b.minY, maxX = _b.maxX, maxY = _b.maxY;\n // move the innerGraph to [0, 0],for later controled by parent layout\n var center_1 = { x: (maxX + minX) / 2, y: (maxY + minY) / 2 };\n innerGraphData.nodes.forEach(function (node) {\n node.x -= center_1.x;\n node.y -= center_1.y;\n });\n var innerGraphWidth = Math.max(maxX - minX, minNodeSize_1) + padding * 2;\n var innerGraphHeight = Math.max(maxY - minY, minNodeSize_1) + padding * 2;\n innerGraphs[treeNode.id] = {\n id: treeNode.id,\n nodes: innerGraphNodes,\n size: [innerGraphWidth, innerGraphHeight],\n };\n }\n return true;\n });\n });\n return innerGraphs;\n };\n ComboCombinedLayout.prototype.initVals = function () {\n var self = this;\n var nodeSize = self.nodeSize;\n var spacing = self.spacing;\n var nodeSizeFunc;\n var spacingFunc;\n // nodeSpacing to function\n if ((0, util_1.isNumber)(spacing)) {\n spacingFunc = function () { return spacing; };\n }\n else if ((0, util_1.isFunction)(spacing)) {\n spacingFunc = spacing;\n }\n else {\n spacingFunc = function () { return 0; };\n }\n this.spacing = spacingFunc;\n // nodeSize to function\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n var spacing = spacingFunc(d);\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return (res + spacing) / 2;\n }\n if ((0, util_1.isObject)(d.size)) {\n var res = d.size.width > d.size.height ? d.size.width : d.size.height;\n return (res + spacing) / 2;\n }\n return (d.size + spacing) / 2;\n }\n return 10 + spacing / 2;\n };\n }\n else if ((0, util_1.isFunction)(nodeSize)) {\n nodeSizeFunc = function (d) {\n var size = nodeSize(d);\n var spacing = spacingFunc(d);\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return (res + spacing) / 2;\n }\n return ((size || 10) + spacing) / 2;\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n var larger = nodeSize[0] > nodeSize[1] ? nodeSize[0] : nodeSize[1];\n var radius_1 = larger / 2;\n nodeSizeFunc = function (d) { return radius_1 + spacingFunc(d) / 2; };\n }\n else {\n // number type\n var radius_2 = nodeSize / 2;\n nodeSizeFunc = function (d) { return radius_2 + spacingFunc(d) / 2; };\n }\n this.nodeSize = nodeSizeFunc;\n // comboPadding to function\n var comboPadding = self.comboPadding;\n var comboPaddingFunc;\n if ((0, util_1.isNumber)(comboPadding)) {\n comboPaddingFunc = function () { return comboPadding; };\n }\n else if ((0, util_1.isArray)(comboPadding)) {\n comboPaddingFunc = function () { return Math.max.apply(null, comboPadding); };\n }\n else if ((0, util_1.isFunction)(comboPadding)) {\n comboPaddingFunc = comboPadding;\n }\n else {\n // null type\n comboPaddingFunc = function () { return 0; };\n }\n this.comboPadding = comboPaddingFunc;\n };\n ComboCombinedLayout.prototype.getType = function () {\n return 'comboCombined';\n };\n return ComboCombinedLayout;\n}(base_1.Base));\nexports.ComboCombinedLayout = ComboCombinedLayout;\n//# sourceMappingURL=comboCombined.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/comboCombined.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/activate-relations.js": -/*!********************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/activate-relations.js ***! - \********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/comboForce.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/comboForce.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n // 可选 mouseenter || click\n // 选择 click 会监听 touch,mouseenter 不会监听\n trigger: 'mouseenter',\n activeState: 'active',\n inactiveState: 'inactive',\n resetSelected: false,\n shouldUpdate: function shouldUpdate() {\n return true;\n }\n };\n },\n getEvents: function getEvents() {\n if (this.get('trigger') === 'mouseenter') {\n return {\n 'node:mouseenter': 'setAllItemStates',\n 'combo:mouseenter': 'setAllItemStates',\n 'node:mouseleave': 'clearActiveState',\n 'combo:mouseleave': 'clearActiveState'\n };\n }\n\n return {\n 'node:click': 'setAllItemStates',\n 'combo:click': 'setAllItemStates',\n 'canvas:click': 'clearActiveState',\n 'node:touchstart': 'setOnTouchStart',\n 'combo:touchstart': 'setOnTouchStart',\n 'canvas:touchstart': 'clearOnTouchStart'\n };\n },\n setOnTouchStart: function setOnTouchStart(e) {\n var self = this;\n\n try {\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n\n if (event1 && event2) {\n return;\n }\n\n e.preventDefault();\n } catch (e) {\n console.warn('Touch original event not exist!');\n }\n\n self.setAllItemStates(e);\n },\n clearOnTouchStart: function clearOnTouchStart(e) {\n var self = this;\n\n try {\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n\n if (event1 && event2) {\n return;\n }\n\n e.preventDefault();\n } catch (e) {\n console.warn('Touch original event not exist!');\n }\n\n self.clearActiveState(e);\n },\n setAllItemStates: function setAllItemStates(e) {\n var item = e.item;\n var graph = this.graph;\n this.item = item;\n\n if (!this.shouldUpdate(e.item, {\n event: e,\n action: 'activate'\n })) {\n return;\n }\n\n var self = this;\n var activeState = this.activeState;\n var inactiveState = this.inactiveState;\n var nodes = graph.getNodes();\n var combos = graph.getCombos();\n var edges = graph.getEdges();\n var vEdges = graph.get('vedges');\n var nodeLength = nodes.length;\n var comboLength = combos.length;\n var edgeLength = edges.length;\n var vEdgeLength = vEdges.length;\n\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n var hasSelected = node.hasState('selected');\n\n if (self.resetSelected) {\n if (hasSelected) {\n graph.setItemState(node, 'selected', false);\n }\n }\n\n graph.setItemState(node, activeState, false);\n\n if (inactiveState) {\n graph.setItemState(node, inactiveState, true);\n }\n }\n\n for (var i = 0; i < comboLength; i++) {\n var combo = combos[i];\n var hasSelected = combo.hasState('selected');\n\n if (self.resetSelected) {\n if (hasSelected) {\n graph.setItemState(combo, 'selected', false);\n }\n }\n\n graph.setItemState(combo, activeState, false);\n\n if (inactiveState) {\n graph.setItemState(combo, inactiveState, true);\n }\n }\n\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n graph.setItemState(edge, activeState, false);\n\n if (inactiveState) {\n graph.setItemState(edge, inactiveState, true);\n }\n }\n\n for (var i = 0; i < vEdgeLength; i++) {\n var vEdge = vEdges[i];\n graph.setItemState(vEdge, activeState, false);\n\n if (inactiveState) {\n graph.setItemState(vEdge, inactiveState, true);\n }\n }\n\n if (inactiveState) {\n graph.setItemState(item, inactiveState, false);\n }\n\n graph.setItemState(item, activeState, true);\n var rEdges = item.getEdges();\n var rEdgeLegnth = rEdges.length;\n\n for (var i = 0; i < rEdgeLegnth; i++) {\n var edge = rEdges[i];\n var otherEnd = void 0;\n\n if (edge.getSource() === item) {\n otherEnd = edge.getTarget();\n } else {\n otherEnd = edge.getSource();\n }\n\n if (inactiveState) {\n graph.setItemState(otherEnd, inactiveState, false);\n }\n\n graph.setItemState(otherEnd, activeState, true);\n graph.setItemState(edge, inactiveState, false);\n graph.setItemState(edge, activeState, true);\n edge.toFront();\n }\n\n graph.emit('afteractivaterelations', {\n item: e.item,\n action: 'activate'\n });\n },\n clearActiveState: function clearActiveState(e) {\n var self = this;\n var graph = self.get('graph');\n\n if (!self.shouldUpdate(e.item, {\n event: e,\n action: 'deactivate'\n })) {\n return;\n }\n\n var activeState = this.activeState;\n var inactiveState = this.inactiveState;\n var autoPaint = graph.get('autoPaint');\n graph.setAutoPaint(false);\n var nodes = graph.getNodes() || [];\n var combos = graph.getCombos() || [];\n var edges = graph.getEdges() || [];\n var vEdges = graph.get('vedges') || [];\n var nodeLength = nodes.length;\n var comboLength = combos.length;\n var edgeLength = edges.length;\n var vEdgeLength = vEdges.length;\n\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n graph.clearItemStates(node, [activeState, inactiveState]);\n }\n\n for (var i = 0; i < comboLength; i++) {\n var combo = combos[i];\n graph.clearItemStates(combo, [activeState, inactiveState]);\n }\n\n for (var i = 0; i < edgeLength; i++) {\n var edge = edges[i];\n graph.clearItemStates(edge, [activeState, inactiveState, 'deactivate']);\n }\n\n for (var i = 0; i < vEdgeLength; i++) {\n var vEdge = vEdges[i];\n graph.clearItemStates(vEdge, [activeState, inactiveState, 'deactivate']);\n }\n\n graph.paint();\n graph.setAutoPaint(autoPaint);\n graph.emit('afteractivaterelations', {\n item: e.item || self.get('item'),\n action: 'deactivate'\n });\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/activate-relations.js?"); +eval("\n/**\n * @fileOverview Combo force layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ComboForceLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\n/**\n * force layout for graph with combos\n */\nvar ComboForceLayout = /** @class */ (function (_super) {\n __extends(ComboForceLayout, _super);\n function ComboForceLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 100;\n /** 重力大小,影响图的紧凑程度 */\n _this.gravity = 10;\n /** 群组中心力大小 */\n _this.comboGravity = 10;\n /** 默认边长度 */\n _this.linkDistance = 10;\n /** 每次迭代位移的衰减相关参数 */\n _this.alpha = 1;\n _this.alphaMin = 0.001;\n _this.alphaDecay = 1 - Math.pow(_this.alphaMin, (1 / 300));\n _this.alphaTarget = 0;\n /** 节点运动速度衰减参数 */\n _this.velocityDecay = 0.6;\n /** 边引力大小 */\n _this.edgeStrength = 0.6;\n /** 节点引力大小 */\n _this.nodeStrength = 30;\n /** 是否开启防止重叠 */\n _this.preventOverlap = false;\n /** 是否开启节点之间的防止重叠 */\n _this.preventNodeOverlap = false;\n /** 是否开启 Combo 之间的防止重叠 */\n _this.preventComboOverlap = false;\n /** 防止重叠的碰撞力大小 */\n _this.collideStrength = undefined;\n /** 防止重叠的碰撞力大小 */\n _this.nodeCollideStrength = 0.5;\n /** 防止重叠的碰撞力大小 */\n _this.comboCollideStrength = 0.5;\n /** Combo 最小间距,防止重叠时的间隙 */\n _this.comboSpacing = 20;\n /** Combo 内部的 padding */\n _this.comboPadding = 10;\n /** 优化计算斥力的速度,两节点间距超过 optimizeRangeFactor * width 则不再计算斥力和重叠斥力 */\n _this.optimizeRangeFactor = 1;\n /** 每次迭代的回调函数 */\n _this.onTick = function () { };\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n /** 根据边两端节点层级差距的调整引力系数的因子,取值范围 [0, 1]。层级差距越大,引力越小 */\n _this.depthAttractiveForceScale = 1;\n /** 根据边两端节点层级差距的调整斥力系数的因子,取值范围 [1, Infinity]。层级差距越大,斥力越大 */\n _this.depthRepulsiveForceScale = 2;\n /** 内部计算参数 */\n _this.nodes = [];\n _this.edges = [];\n _this.combos = [];\n _this.comboTrees = [];\n _this.width = 300;\n _this.height = 300;\n _this.bias = [];\n _this.nodeMap = {};\n _this.oriComboMap = {};\n _this.indexMap = {};\n _this.comboMap = {};\n _this.previousLayouted = false;\n _this.updateCfg(options);\n return _this;\n }\n ComboForceLayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 100,\n center: [0, 0],\n gravity: 10,\n speed: 1,\n comboGravity: 30,\n preventOverlap: false,\n preventComboOverlap: true,\n preventNodeOverlap: true,\n nodeSpacing: undefined,\n collideStrength: undefined,\n nodeCollideStrength: 0.5,\n comboCollideStrength: 0.5,\n comboSpacing: 20,\n comboPadding: 10,\n edgeStrength: 0.6,\n nodeStrength: 30,\n linkDistance: 10\n };\n };\n /**\n * 执行布局\n */\n ComboForceLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var center = self.center;\n self.comboTree = {\n id: \"comboTreeRoot\",\n depth: -1,\n children: self.comboTrees\n };\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n self.initVals();\n // layout\n self.run();\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n };\n ComboForceLayout.prototype.run = function () {\n var self = this;\n var nodes = self.nodes;\n var maxIteration = self.previousLayouted\n ? self.maxIteration / 5\n : self.maxIteration;\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n var center = self.center;\n var velocityDecay = self.velocityDecay;\n // init the positions to make the nodes with same combo gather around the combo\n var comboMap = self.comboMap;\n if (!self.previousLayouted)\n self.initPos(comboMap);\n var _loop_1 = function (i) {\n var displacements = [];\n nodes.forEach(function (_, j) {\n displacements[j] = { x: 0, y: 0 };\n });\n self.applyCalculate(displacements);\n // gravity for combos\n self.applyComboCenterForce(displacements);\n // move\n nodes.forEach(function (n, j) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n n.x += displacements[j].x * velocityDecay;\n n.y += displacements[j].y * velocityDecay;\n });\n self.alpha += (self.alphaTarget - self.alpha) * self.alphaDecay;\n self.onTick();\n };\n // iterate\n for (var i = 0; i < maxIteration; i++) {\n _loop_1(i);\n }\n // move to center\n var meanCenter = [0, 0];\n nodes.forEach(function (n) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n meanCenter[0] += n.x;\n meanCenter[1] += n.y;\n });\n meanCenter[0] /= nodes.length;\n meanCenter[1] /= nodes.length;\n var centerOffset = [center[0] - meanCenter[0], center[1] - meanCenter[1]];\n nodes.forEach(function (n, j) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n n.x += centerOffset[0];\n n.y += centerOffset[1];\n });\n // arrange the empty combo\n self.combos.forEach(function (combo) {\n var mapped = comboMap[combo.id];\n if (mapped && mapped.empty) {\n combo.x = mapped.cx || combo.x;\n combo.y = mapped.cy || combo.y;\n }\n });\n self.previousLayouted = true;\n };\n ComboForceLayout.prototype.initVals = function () {\n var self = this;\n var edges = self.edges;\n var nodes = self.nodes;\n var combos = self.combos;\n var count = {};\n var nodeMap = {};\n var indexMap = {};\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = node;\n indexMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.indexMap = indexMap;\n var oriComboMap = {};\n combos.forEach(function (combo) {\n oriComboMap[combo.id] = combo;\n });\n self.oriComboMap = oriComboMap;\n self.comboMap = self.getComboMap();\n var preventOverlap = self.preventOverlap;\n self.preventComboOverlap = self.preventComboOverlap || preventOverlap;\n self.preventNodeOverlap = self.preventNodeOverlap || preventOverlap;\n var collideStrength = self.collideStrength;\n if (collideStrength) {\n self.comboCollideStrength = collideStrength;\n self.nodeCollideStrength = collideStrength;\n }\n self.comboCollideStrength = self.comboCollideStrength\n ? self.comboCollideStrength\n : 0;\n self.nodeCollideStrength = self.nodeCollideStrength\n ? self.nodeCollideStrength\n : 0;\n // get edge bias\n for (var i = 0; i < edges.length; ++i) {\n var source = (0, util_1.getEdgeTerminal)(edges[i], 'source');\n var target = (0, util_1.getEdgeTerminal)(edges[i], 'target');\n if (count[source])\n count[source]++;\n else\n count[source] = 1;\n if (count[target])\n count[target]++;\n else\n count[target] = 1;\n }\n var bias = [];\n for (var i = 0; i < edges.length; ++i) {\n var source = (0, util_1.getEdgeTerminal)(edges[i], 'source');\n var target = (0, util_1.getEdgeTerminal)(edges[i], 'target');\n bias[i] = count[source] / (count[source] + count[target]);\n }\n this.bias = bias;\n var nodeSize = self.nodeSize;\n var nodeSpacing = self.nodeSpacing;\n var nodeSizeFunc;\n var nodeSpacingFunc;\n // nodeSpacing to function\n if ((0, util_1.isNumber)(nodeSpacing)) {\n nodeSpacingFunc = function () { return nodeSpacing; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing)) {\n nodeSpacingFunc = nodeSpacing;\n }\n else {\n nodeSpacingFunc = function () { return 0; };\n }\n this.nodeSpacing = nodeSpacingFunc;\n // nodeSize to function\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return res / 2;\n }\n if ((0, util_1.isObject)(d.size)) {\n var res = d.size.width > d.size.height ? d.size.width : d.size.height;\n return res / 2;\n }\n return d.size / 2;\n }\n return 10;\n };\n }\n else if ((0, util_1.isFunction)(nodeSize)) {\n nodeSizeFunc = function (d) {\n return nodeSize(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n var larger = nodeSize[0] > nodeSize[1] ? nodeSize[0] : nodeSize[1];\n var radius_1 = larger / 2;\n nodeSizeFunc = function (d) { return radius_1; };\n }\n else {\n // number type\n var radius_2 = nodeSize / 2;\n nodeSizeFunc = function (d) { return radius_2; };\n }\n this.nodeSize = nodeSizeFunc;\n // comboSpacing to function\n var comboSpacing = self.comboSpacing;\n var comboSpacingFunc;\n if ((0, util_1.isNumber)(comboSpacing)) {\n comboSpacingFunc = function () { return comboSpacing; };\n }\n else if ((0, util_1.isFunction)(comboSpacing)) {\n comboSpacingFunc = comboSpacing;\n }\n else {\n // null type\n comboSpacingFunc = function () { return 0; };\n }\n this.comboSpacing = comboSpacingFunc;\n // comboPadding to function\n var comboPadding = self.comboPadding;\n var comboPaddingFunc;\n if ((0, util_1.isNumber)(comboPadding)) {\n comboPaddingFunc = function () { return comboPadding; };\n }\n else if ((0, util_1.isArray)(comboPadding)) {\n comboPaddingFunc = function () { return Math.max.apply(null, comboPadding); };\n }\n else if ((0, util_1.isFunction)(comboPadding)) {\n comboPaddingFunc = comboPadding;\n }\n else {\n // null type\n comboPaddingFunc = function () { return 0; };\n }\n this.comboPadding = comboPaddingFunc;\n // linkDistance to function\n var linkDistance = this.linkDistance;\n var linkDistanceFunc;\n if (!linkDistance) {\n linkDistance = 10;\n }\n if ((0, util_1.isNumber)(linkDistance)) {\n linkDistanceFunc = function (d) {\n return linkDistance;\n };\n }\n else {\n linkDistanceFunc = linkDistance;\n }\n this.linkDistance = linkDistanceFunc;\n // linkStrength to function\n var edgeStrength = this.edgeStrength;\n var edgeStrengthFunc;\n if (!edgeStrength) {\n edgeStrength = 1;\n }\n if ((0, util_1.isNumber)(edgeStrength)) {\n edgeStrengthFunc = function (d) {\n return edgeStrength;\n };\n }\n else {\n edgeStrengthFunc = edgeStrength;\n }\n this.edgeStrength = edgeStrengthFunc;\n // nodeStrength to function\n var nodeStrength = this.nodeStrength;\n var nodeStrengthFunc;\n if (!nodeStrength) {\n nodeStrength = 30;\n }\n if ((0, util_1.isNumber)(nodeStrength)) {\n nodeStrengthFunc = function (d) {\n return nodeStrength;\n };\n }\n else {\n nodeStrengthFunc = nodeStrength;\n }\n this.nodeStrength = nodeStrengthFunc;\n };\n ComboForceLayout.prototype.initPos = function (comboMap) {\n var self = this;\n var nodes = self.nodes;\n nodes.forEach(function (node, i) {\n var comboId = node.comboId;\n var combo = comboMap[comboId];\n if (comboId && combo) {\n node.x = combo.cx + 100 / (i + 1);\n node.y = combo.cy + 100 / (i + 1);\n }\n else {\n node.x = 100 / (i + 1);\n node.y = 100 / (i + 1);\n }\n });\n };\n ComboForceLayout.prototype.getComboMap = function () {\n var self = this;\n var nodeMap = self.nodeMap;\n var comboTrees = self.comboTrees;\n var oriComboMap = self.oriComboMap;\n var comboMap = {};\n (comboTrees || []).forEach(function (ctree) {\n var treeChildren = [];\n (0, util_1.traverseTreeUp)(ctree, function (treeNode) {\n if (treeNode.itemType === \"node\")\n return true; // skip it\n if (!oriComboMap[treeNode.id])\n return true; // means it is hidden, skip it\n if (comboMap[treeNode.id] === undefined) {\n var combo = {\n id: treeNode.id,\n name: treeNode.id,\n cx: 0,\n cy: 0,\n count: 0,\n depth: self.oriComboMap[treeNode.id].depth || 0,\n children: []\n };\n comboMap[treeNode.id] = combo;\n }\n var children = treeNode.children;\n if (children) {\n children.forEach(function (child) {\n if (!comboMap[child.id] && !nodeMap[child.id])\n return true; // means it is hidden\n treeChildren.push(child);\n });\n }\n var c = comboMap[treeNode.id];\n c.cx = 0;\n c.cy = 0;\n if (treeChildren.length === 0) {\n c.empty = true;\n var oriCombo = oriComboMap[treeNode.id];\n c.cx = oriCombo.x;\n c.cy = oriCombo.y;\n }\n treeChildren.forEach(function (child) {\n c.count++;\n if (child.itemType !== \"node\") {\n var childCombo = comboMap[child.id];\n if ((0, util_1.isNumber)(childCombo.cx))\n c.cx += childCombo.cx;\n if ((0, util_1.isNumber)(childCombo.cy))\n c.cy += childCombo.cy;\n return;\n }\n var node = nodeMap[child.id];\n // means the node is hidden, skip it\n if (!node)\n return;\n if ((0, util_1.isNumber)(node.x)) {\n c.cx += node.x;\n }\n if ((0, util_1.isNumber)(node.y)) {\n c.cy += node.y;\n }\n });\n c.cx /= (c.count || 1);\n c.cy /= (c.count || 1);\n c.children = treeChildren;\n return true;\n });\n });\n return comboMap;\n };\n ComboForceLayout.prototype.applyComboCenterForce = function (displacements) {\n var self = this;\n var gravity = self.gravity;\n var comboGravity = self.comboGravity || gravity;\n var alpha = this.alpha;\n var comboTrees = self.comboTrees;\n var indexMap = self.indexMap;\n var nodeMap = self.nodeMap;\n var comboMap = self.comboMap;\n (comboTrees || []).forEach(function (ctree) {\n (0, util_1.traverseTreeUp)(ctree, function (treeNode) {\n if (treeNode.itemType === \"node\")\n return true; // skip it\n var combo = comboMap[treeNode.id];\n // means the combo is hidden, skip it\n if (!combo)\n return true;\n var c = comboMap[treeNode.id];\n // higher depth the combo, larger the gravity\n var gravityScale = ((c.depth + 1) / 10) * 0.5;\n // apply combo center force for all the descend nodes in this combo\n // and update the center position and count for this combo\n var comboX = c.cx;\n var comboY = c.cy;\n c.cx = 0;\n c.cy = 0;\n c.children.forEach(function (child) {\n if (child.itemType !== \"node\") {\n var childCombo = comboMap[child.id];\n if (childCombo && (0, util_1.isNumber)(childCombo.cx))\n c.cx += childCombo.cx;\n if (childCombo && (0, util_1.isNumber)(childCombo.cy))\n c.cy += childCombo.cy;\n return;\n }\n var node = nodeMap[child.id];\n var vecX = (node.x - comboX) || 0.005;\n var vecY = (node.y - comboY) || 0.005;\n var l = Math.sqrt(vecX * vecX + vecY * vecY);\n var childIdx = indexMap[node.id];\n var params = ((comboGravity * alpha) / l) * gravityScale;\n displacements[childIdx].x -= vecX * params;\n displacements[childIdx].y -= vecY * params;\n if ((0, util_1.isNumber)(node.x))\n c.cx += node.x;\n if ((0, util_1.isNumber)(node.y))\n c.cy += node.y;\n });\n c.cx /= (c.count || 1);\n c.cy /= (c.count || 1);\n return true;\n });\n });\n };\n ComboForceLayout.prototype.applyCalculate = function (displacements) {\n var self = this;\n var comboMap = self.comboMap;\n var nodes = self.nodes;\n // store the vx, vy, and distance to reduce dulplicate calculation\n var vecMap = {};\n nodes.forEach(function (v, i) {\n nodes.forEach(function (u, j) {\n if (i < j)\n return;\n var vx = (v.x - u.x) || 0.005;\n var vy = (v.y - u.y) || 0.005;\n var vl2 = vx * vx + vy * vy;\n var vl = Math.sqrt(vl2);\n if (vl2 < 1)\n vl2 = vl;\n vecMap[\"\".concat(v.id, \"-\").concat(u.id)] = { vx: vx, vy: vy, vl2: vl2, vl: vl };\n vecMap[\"\".concat(u.id, \"-\").concat(v.id)] = { vl2: vl2, vl: vl, vx: -vx, vy: -vy };\n });\n });\n // get the sizes of the combos\n self.updateComboSizes(comboMap);\n self.calRepulsive(displacements, vecMap);\n self.calAttractive(displacements, vecMap);\n var preventComboOverlap = self.preventComboOverlap;\n if (preventComboOverlap)\n self.comboNonOverlapping(displacements, comboMap);\n };\n /**\n * Update the sizes of the combos according to their children\n * Used for combos nonoverlap, but not re-render the combo shapes\n */\n ComboForceLayout.prototype.updateComboSizes = function (comboMap) {\n var self = this;\n var comboTrees = self.comboTrees;\n var nodeMap = self.nodeMap;\n var nodeSize = self.nodeSize;\n var comboSpacing = self.comboSpacing;\n var comboPadding = self.comboPadding;\n (comboTrees || []).forEach(function (ctree) {\n var treeChildren = [];\n (0, util_1.traverseTreeUp)(ctree, function (treeNode) {\n if (treeNode.itemType === \"node\")\n return true; // skip it\n var c = comboMap[treeNode.id];\n // means the combo is hidden, skip it\n if (!c)\n return false;\n var children = treeNode.children;\n if (children) {\n children.forEach(function (child) {\n // means the combo is hidden.\n if (!comboMap[child.id] && !nodeMap[child.id])\n return;\n treeChildren.push(child);\n });\n }\n c.minX = Infinity;\n c.minY = Infinity;\n c.maxX = -Infinity;\n c.maxY = -Infinity;\n treeChildren.forEach(function (child) {\n if (child.itemType !== \"node\")\n return true; // skip it\n var node = nodeMap[child.id];\n if (!node)\n return true; // means it is hidden\n var r = nodeSize(node);\n var nodeMinX = node.x - r;\n var nodeMinY = node.y - r;\n var nodeMaxX = node.x + r;\n var nodeMaxY = node.y + r;\n if (c.minX > nodeMinX)\n c.minX = nodeMinX;\n if (c.minY > nodeMinY)\n c.minY = nodeMinY;\n if (c.maxX < nodeMaxX)\n c.maxX = nodeMaxX;\n if (c.maxY < nodeMaxY)\n c.maxY = nodeMaxY;\n });\n var minSize = self.oriComboMap[treeNode.id].size || 10;\n if ((0, util_1.isArray)(minSize))\n minSize = minSize[0];\n var maxLength = Math.max(c.maxX - c.minX, c.maxY - c.minY, minSize);\n c.r = maxLength / 2 + comboSpacing(c) / 2 + comboPadding(c);\n return true;\n });\n });\n };\n /**\n * prevent the overlappings among combos\n */\n ComboForceLayout.prototype.comboNonOverlapping = function (displacements, comboMap) {\n var self = this;\n var comboTree = self.comboTree;\n var comboCollideStrength = self.comboCollideStrength;\n var indexMap = self.indexMap;\n var nodeMap = self.nodeMap;\n (0, util_1.traverseTreeUp)(comboTree, function (treeNode) {\n if (!comboMap[treeNode.id] &&\n !nodeMap[treeNode.id] &&\n treeNode.id !== \"comboTreeRoot\") {\n return false;\n } // means it is hidden\n var children = treeNode.children;\n // 同个子树下的子 combo 间两两对比\n if (children && children.length > 1) {\n children.forEach(function (v, i) {\n if (v.itemType === \"node\")\n return false; // skip it\n var cv = comboMap[v.id];\n if (!cv)\n return; // means it is hidden, skip it\n children.forEach(function (u, j) {\n if (i <= j)\n return false;\n if (u.itemType === \"node\")\n return false; // skip it\n var cu = comboMap[u.id];\n if (!cu)\n return false; // means it is hidden, skip it\n var vx = (cv.cx - cu.cx) || 0.005;\n var vy = (cv.cy - cu.cy) || 0.005;\n var l = vx * vx + vy * vy;\n var rv = cv.r || 1;\n var ru = cu.r || 1;\n var r = rv + ru;\n var ru2 = ru * ru;\n var rv2 = rv * rv;\n // overlapping\n if (l < r * r) {\n var vnodes = v.children;\n if (!vnodes || vnodes.length === 0)\n return false; // skip it\n var unodes_1 = u.children;\n if (!unodes_1 || unodes_1.length === 0)\n return false; // skip it\n var sqrtl = Math.sqrt(l);\n var ll = ((r - sqrtl) / sqrtl) * comboCollideStrength;\n var xl_1 = vx * ll;\n var yl_1 = vy * ll;\n var rratio_1 = ru2 / (rv2 + ru2);\n var irratio_1 = 1 - rratio_1;\n // 两兄弟 combo 的子节点上施加斥力\n vnodes.forEach(function (vn) {\n if (vn.itemType !== \"node\")\n return false; // skip it\n if (!nodeMap[vn.id])\n return; // means it is hidden, skip it\n var vindex = indexMap[vn.id];\n unodes_1.forEach(function (un) {\n if (un.itemType !== \"node\")\n return false;\n if (!nodeMap[un.id])\n return false; // means it is hidden, skip it\n var uindex = indexMap[un.id];\n displacements[vindex].x += xl_1 * rratio_1;\n displacements[vindex].y += yl_1 * rratio_1;\n displacements[uindex].x -= xl_1 * irratio_1;\n displacements[uindex].y -= yl_1 * irratio_1;\n });\n });\n }\n });\n });\n }\n return true;\n });\n };\n /**\n * Calculate the repulsive force between each node pair\n * @param displacements The array stores the displacements for nodes\n * @param vecMap The map stores vector between each node pair\n */\n ComboForceLayout.prototype.calRepulsive = function (displacements, vecMap) {\n var self = this;\n var nodes = self.nodes;\n var max = self.width * self.optimizeRangeFactor;\n var nodeStrength = self.nodeStrength;\n var alpha = self.alpha;\n var nodeCollideStrength = self.nodeCollideStrength;\n var preventNodeOverlap = self.preventNodeOverlap;\n var nodeSizeFunc = self.nodeSize;\n var nodeSpacingFunc = self.nodeSpacing;\n var scale = self.depthRepulsiveForceScale;\n var center = self.center;\n nodes.forEach(function (v, i) {\n if (!v.x || !v.y)\n return;\n // center gravity\n if (center) {\n var gravity = self.gravity;\n var vecX = (v.x - center[0]) || 0.005;\n var vecY = (v.y - center[1]) || 0.005;\n var l = Math.sqrt(vecX * vecX + vecY * vecY);\n displacements[i].x -= (vecX * gravity * alpha) / l;\n displacements[i].y -= (vecY * gravity * alpha) / l;\n }\n nodes.forEach(function (u, j) {\n if (i === j) {\n return;\n }\n if (!u.x || !u.y)\n return;\n var _a = vecMap[\"\".concat(v.id, \"-\").concat(u.id)], vl2 = _a.vl2, vl = _a.vl;\n if (vl > max)\n return;\n var _b = vecMap[\"\".concat(v.id, \"-\").concat(u.id)], vx = _b.vx, vy = _b.vy;\n var depthDiff = Math.log(Math.abs(u.depth - v.depth) / 10) + 1 || 1;\n depthDiff = depthDiff < 1 ? 1 : depthDiff;\n if (u.comboId !== v.comboId)\n depthDiff += 1;\n var depthParam = depthDiff ? Math.pow(scale, depthDiff) : 1;\n var params = ((nodeStrength(u) * alpha) / vl2) * depthParam;\n displacements[i].x += vx * params;\n displacements[i].y += vy * params;\n // prevent node overlappings\n if (i < j && preventNodeOverlap) {\n var ri = (nodeSizeFunc(v) + nodeSpacingFunc(v)) || 1;\n var rj = (nodeSizeFunc(u) + nodeSpacingFunc(u)) || 1;\n var r = ri + rj;\n if (vl2 < r * r) {\n var ll = ((r - vl) / vl) * nodeCollideStrength;\n var rj2 = rj * rj;\n var rratio = rj2 / (ri * ri + rj2);\n var xl = vx * ll;\n var yl = vy * ll;\n displacements[i].x += xl * rratio;\n displacements[i].y += yl * rratio;\n rratio = 1 - rratio;\n displacements[j].x -= xl * rratio;\n displacements[j].y -= yl * rratio;\n }\n }\n });\n });\n };\n /**\n * Calculate the attractive force between the node pair with edge\n * @param displacements The array stores the displacements for nodes\n * @param vecMap The map stores vector between each node pair\n */\n ComboForceLayout.prototype.calAttractive = function (displacements, vecMap) {\n var self = this;\n var edges = self.edges;\n var linkDistance = self.linkDistance;\n var alpha = self.alpha;\n var edgeStrength = self.edgeStrength;\n var bias = self.bias;\n var scale = self.depthAttractiveForceScale;\n edges.forEach(function (e, i) {\n var source = (0, util_1.getEdgeTerminal)(e, 'source');\n var target = (0, util_1.getEdgeTerminal)(e, 'target');\n if (!source || !target || source === target)\n return;\n var uIndex = self.indexMap[source];\n var vIndex = self.indexMap[target];\n var u = self.nodeMap[source];\n var v = self.nodeMap[target];\n if (!u || !v)\n return;\n var depthDiff = u.depth === v.depth ? 0 : Math.log(Math.abs(u.depth - v.depth) / 10);\n if (u.comboId === v.comboId) {\n depthDiff = depthDiff / 2;\n }\n var depthParam = depthDiff ? Math.pow(scale, depthDiff) : 1;\n if (u.comboId !== v.comboId && depthParam === 1) {\n depthParam = scale / 2;\n }\n else if (u.comboId === v.comboId) {\n depthParam = 2;\n }\n if (!(0, util_1.isNumber)(v.x) || !(0, util_1.isNumber)(u.x) || !(0, util_1.isNumber)(v.y) || !(0, util_1.isNumber)(u.y)) {\n return;\n }\n var _a = vecMap[\"\".concat(target, \"-\").concat(source)], vl = _a.vl, vx = _a.vx, vy = _a.vy;\n var l = ((vl - linkDistance(e)) / vl) * alpha * edgeStrength(e) * depthParam;\n var vecX = vx * l;\n var vecY = vy * l;\n var b = bias[i];\n displacements[vIndex].x -= vecX * b;\n displacements[vIndex].y -= vecY * b;\n displacements[uIndex].x += vecX * (1 - b);\n displacements[uIndex].y += vecY * (1 - b);\n });\n };\n ComboForceLayout.prototype.getType = function () {\n return \"comboForce\";\n };\n return ComboForceLayout;\n}(base_1.Base));\nexports.ComboForceLayout = ComboForceLayout;\n//# sourceMappingURL=comboForce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/comboForce.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/brush-select.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/brush-select.js ***! - \**************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/concentric.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/concentric.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar min = Math.min,\n max = Math.max,\n abs = Math.abs;\nvar DEFAULT_TRIGGER = 'shift';\nvar ALLOW_EVENTS = ['drag', 'shift', 'ctrl', 'alt', 'control'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n brushStyle: {\n fill: '#EEF6FF',\n fillOpacity: 0.4,\n stroke: '#DDEEFE',\n lineWidth: 1\n },\n onSelect: function onSelect() {},\n onDeselect: function onDeselect() {},\n selectedState: 'selected',\n trigger: DEFAULT_TRIGGER,\n includeEdges: true,\n selectedEdges: [],\n selectedNodes: []\n };\n },\n getEvents: function getEvents() {\n // 检测输入是否合法\n if (!(ALLOW_EVENTS.indexOf(this.trigger.toLowerCase()) > -1)) {\n this.trigger = DEFAULT_TRIGGER;\n console.warn(\"Behavior brush-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'\");\n }\n\n if (this.trigger === 'drag') {\n return {\n 'dragstart': 'onMouseDown',\n 'drag': 'onMouseMove',\n 'dragend': 'onMouseUp',\n 'canvas:click': 'clearStates'\n };\n }\n\n return {\n 'dragstart': 'onMouseDown',\n 'drag': 'onMouseMove',\n 'dragend': 'onMouseUp',\n 'canvas:click': 'clearStates',\n 'keyup': 'onKeyUp',\n 'keydown': 'onKeyDown'\n };\n },\n onMouseDown: function onMouseDown(e) {\n // 按在node上面拖动时候不应该是框选\n var item = e.item;\n var brush = this.brush;\n\n if (item) {\n return;\n }\n\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n\n if (this.selectedNodes && this.selectedNodes.length !== 0) {\n this.clearStates();\n }\n\n if (!brush) {\n brush = this.createBrush();\n }\n\n this.originPoint = {\n x: e.canvasX,\n y: e.canvasY\n };\n brush.attr({\n width: 0,\n height: 0\n });\n brush.show();\n this.dragging = true;\n },\n onMouseMove: function onMouseMove(e) {\n if (!this.dragging) {\n return;\n }\n\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n\n this.updateBrush(e);\n },\n onMouseUp: function onMouseUp(e) {\n var graph = this.graph; // TODO: 触发了 canvas:click 导致 clearStates\n\n if (!this.brush && !this.dragging) {\n return;\n }\n\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n\n this.brush.remove(true); // remove and destroy\n\n this.brush = null;\n this.getSelectedNodes(e);\n this.dragging = false;\n },\n clearStates: function clearStates() {\n var _a = this,\n graph = _a.graph,\n selectedState = _a.selectedState;\n\n var nodes = graph.findAllByState('node', selectedState);\n var edges = graph.findAllByState('edge', selectedState);\n nodes.forEach(function (node) {\n return graph.setItemState(node, selectedState, false);\n });\n edges.forEach(function (edge) {\n return graph.setItemState(edge, selectedState, false);\n });\n this.selectedNodes = [];\n this.selectedEdges = [];\n\n if (this.onDeselect) {\n this.onDeselect(this.selectedNodes, this.selectedEdges);\n }\n\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: [],\n edges: []\n },\n select: false\n });\n },\n getSelectedNodes: function getSelectedNodes(e) {\n var _this = this;\n\n var _a = this,\n graph = _a.graph,\n originPoint = _a.originPoint,\n shouldUpdate = _a.shouldUpdate;\n\n var state = this.selectedState;\n var p1 = {\n x: e.x,\n y: e.y\n };\n var p2 = graph.getPointByCanvas(originPoint.x, originPoint.y);\n var left = min(p1.x, p2.x);\n var right = max(p1.x, p2.x);\n var top = min(p1.y, p2.y);\n var bottom = max(p1.y, p2.y);\n var selectedNodes = [];\n var selectedIds = [];\n graph.getNodes().forEach(function (node) {\n if (!node.isVisible()) return; // 隐藏节点不能被选中\n\n var bbox = node.getBBox();\n\n if (bbox.centerX >= left && bbox.centerX <= right && bbox.centerY >= top && bbox.centerY <= bottom) {\n if (shouldUpdate(node, 'select')) {\n selectedNodes.push(node);\n var model = node.getModel();\n selectedIds.push(model.id);\n graph.setItemState(node, state, true);\n }\n }\n });\n var selectedEdges = [];\n\n if (this.includeEdges) {\n // 选中边,边的source和target都在选中的节点中时才选中\n selectedNodes.forEach(function (node) {\n var edges = node.getOutEdges();\n edges.forEach(function (edge) {\n if (!edge.isVisible()) return; // 隐藏边不能够被选中\n\n var model = edge.getModel();\n var source = model.source,\n target = model.target;\n\n if (selectedIds.includes(source) && selectedIds.includes(target) && shouldUpdate(edge, 'select')) {\n selectedEdges.push(edge);\n graph.setItemState(edge, _this.selectedState, true);\n }\n });\n });\n }\n\n this.selectedEdges = selectedEdges;\n this.selectedNodes = selectedNodes;\n\n if (this.onSelect) {\n this.onSelect(selectedNodes, selectedEdges);\n }\n\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges\n },\n select: true\n });\n },\n createBrush: function createBrush() {\n var self = this;\n var brush = self.graph.get('canvas').addShape('rect', {\n attrs: self.brushStyle,\n capture: false,\n name: 'brush-shape'\n });\n this.brush = brush;\n this.delegate = brush;\n return brush;\n },\n updateBrush: function updateBrush(e) {\n var originPoint = this.originPoint;\n this.brush.attr({\n width: abs(e.canvasX - originPoint.x),\n height: abs(e.canvasY - originPoint.y),\n x: min(e.canvasX, originPoint.x),\n y: min(e.canvasY, originPoint.y)\n });\n },\n onKeyDown: function onKeyDown(e) {\n var code = e.key;\n\n if (!code) {\n return;\n }\n\n var triggerLowerCase = this.trigger.toLowerCase();\n var codeLowerCase = code.toLowerCase(); // 按住 control 键时,允许用户设置 trigger 为 ctrl\n\n if (codeLowerCase === triggerLowerCase || codeLowerCase === 'control' && triggerLowerCase === 'ctrl' || codeLowerCase === 'ctrl' && triggerLowerCase === 'control') {\n this.keydown = true;\n } else {\n this.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n if (this.brush) {\n // 清除所有选中状态后,设置拖得动状态为false,并清除框选的brush\n this.brush.remove(true);\n this.brush = null;\n this.dragging = false;\n }\n\n this.keydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/brush-select.js?"); +eval("\n/**\n * @fileOverview concentric layout\n * @author shiwu.wyy@antfin.com\n * this algorithm refers to - https://github.com/cytoscape/cytoscape.js/\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConcentricLayout = void 0;\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\n/**\n * 同心圆布局\n */\nvar ConcentricLayout = /** @class */ (function (_super) {\n __extends(ConcentricLayout, _super);\n function ConcentricLayout(options) {\n var _this = _super.call(this) || this;\n _this.nodeSize = 30;\n /** min spacing between outside of nodes (used for radius adjustment) */\n _this.minNodeSpacing = 10;\n /** same as minNodeSpacing. min spacing between outside of nodes (used for radius adjustment) */\n _this.nodeSpacing = 10;\n /** prevents node overlap, may overflow boundingBox if not enough space */\n _this.preventOverlap = false;\n /** whether levels have an equal radial distance betwen them, may cause bounding box overflow */\n _this.equidistant = false;\n /** where nodes start in radians */\n _this.startAngle = (3 / 2) * Math.PI;\n /** whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) */\n _this.clockwise = true;\n /** 根据 sortBy 指定的属性进行排布,数值高的放在中心,如果是 sortBy 则会计算节点度数,度数最高的放在中心 */\n _this.sortBy = \"degree\";\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n ConcentricLayout.prototype.getDefaultCfg = function () {\n return {\n nodeSize: 30,\n minNodeSpacing: 10,\n nodeSpacing: 10,\n preventOverlap: false,\n sweep: undefined,\n equidistant: false,\n startAngle: (3 / 2) * Math.PI,\n clockwise: true,\n maxLevelDiff: undefined,\n sortBy: \"degree\"\n };\n };\n /**\n * 执行布局\n */\n ConcentricLayout.prototype.execute = function () {\n var _a, _b;\n var self = this;\n var nodes = self.nodes, edges = self.edges;\n var n = nodes.length;\n if (n === 0) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (n === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n (_b = self.onLayoutEnd) === null || _b === void 0 ? void 0 : _b.call(self);\n return;\n }\n var nodeSize = self.nodeSize, nodeSpacing = self.nodeSpacing;\n var layoutNodes = [];\n var maxNodeSize;\n var maxNodeSpacing = 0;\n if ((0, util_1.isArray)(nodeSize)) {\n maxNodeSize = Math.max(nodeSize[0], nodeSize[1]);\n }\n else {\n maxNodeSize = nodeSize;\n }\n if ((0, util_1.isArray)(nodeSpacing)) {\n maxNodeSpacing = Math.max(nodeSpacing[0], nodeSpacing[1]);\n }\n else if ((0, util_1.isNumber)(nodeSpacing)) {\n maxNodeSpacing = nodeSpacing;\n }\n nodes.forEach(function (node) {\n layoutNodes.push(node);\n var nodeSize = maxNodeSize;\n if ((0, util_1.isArray)(node.size)) {\n nodeSize = Math.max(node.size[0], node.size[1]);\n }\n else if ((0, util_1.isNumber)(node.size)) {\n nodeSize = node.size;\n }\n else if ((0, util_1.isObject)(node.size)) {\n nodeSize = Math.max(node.size.width, node.size.height);\n }\n maxNodeSize = Math.max(maxNodeSize, nodeSize);\n if ((0, util_1.isFunction)(nodeSpacing)) {\n maxNodeSpacing = Math.max(nodeSpacing(node), maxNodeSpacing);\n }\n });\n self.clockwise =\n self.counterclockwise !== undefined\n ? !self.counterclockwise\n : self.clockwise;\n // layout\n var nodeMap = {};\n var indexMap = {};\n layoutNodes.forEach(function (node, i) {\n nodeMap[node.id] = node;\n indexMap[node.id] = i;\n });\n // get the node degrees\n if (self.sortBy === \"degree\" ||\n !(0, util_1.isString)(self.sortBy) ||\n layoutNodes[0][self.sortBy] === undefined) {\n self.sortBy = \"degree\";\n if (!(0, util_1.isNumber)(nodes[0].degree)) {\n var values_1 = (0, util_1.getDegree)(nodes.length, indexMap, edges);\n layoutNodes.forEach(function (node, i) {\n node.degree = values_1[i].all;\n });\n }\n }\n // sort nodes by value\n layoutNodes.sort(function (n1, n2) {\n return n2[self.sortBy] - n1[self.sortBy];\n });\n self.maxValueNode = layoutNodes[0];\n self.maxLevelDiff =\n self.maxLevelDiff || self.maxValueNode[self.sortBy] / 4;\n // put the values into levels\n var levels = [[]];\n var currentLevel = levels[0];\n layoutNodes.forEach(function (node) {\n if (currentLevel.length > 0) {\n var diff = Math.abs(currentLevel[0][self.sortBy] - node[self.sortBy]);\n if (self.maxLevelDiff && diff >= self.maxLevelDiff) {\n currentLevel = [];\n levels.push(currentLevel);\n }\n }\n currentLevel.push(node);\n });\n // create positions for levels\n var minDist = maxNodeSize + (maxNodeSpacing || self.minNodeSpacing); // min dist between nodes\n if (!self.preventOverlap) {\n // then strictly constrain to bb\n var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1;\n var maxR = Math.min(self.width, self.height) / 2 - minDist;\n var rStep = maxR / (levels.length + (firstLvlHasMulti ? 1 : 0));\n minDist = Math.min(minDist, rStep);\n }\n // find the metrics for each level\n var r = 0;\n levels.forEach(function (level) {\n var sweep = self.sweep;\n if (sweep === undefined) {\n sweep = 2 * Math.PI - (2 * Math.PI) / level.length;\n }\n var dTheta = (level.dTheta = sweep / Math.max(1, level.length - 1));\n // calculate the radius\n if (level.length > 1 && self.preventOverlap) {\n // but only if more than one node (can't overlap)\n var dcos = Math.cos(dTheta) - Math.cos(0);\n var dsin = Math.sin(dTheta) - Math.sin(0);\n var rMin = Math.sqrt((minDist * minDist) / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping\n r = Math.max(rMin, r);\n }\n level.r = r;\n r += minDist;\n });\n if (self.equidistant) {\n var rDeltaMax_1 = 0;\n var rr_1 = 0;\n for (var i = 0; i < levels.length; i++) {\n var level = levels[i];\n var rDelta = level.r - rr_1;\n rDeltaMax_1 = Math.max(rDeltaMax_1, rDelta);\n }\n rr_1 = 0;\n levels.forEach(function (level, i) {\n if (i === 0) {\n rr_1 = level.r;\n }\n level.r = rr_1;\n rr_1 += rDeltaMax_1;\n });\n }\n // calculate the node positions\n levels.forEach(function (level) {\n var dTheta = level.dTheta;\n var rr = level.r;\n level.forEach(function (node, j) {\n var theta = self.startAngle + (self.clockwise ? 1 : -1) * dTheta * j;\n node.x = center[0] + rr * Math.cos(theta);\n node.y = center[1] + rr * Math.sin(theta);\n });\n });\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n };\n ConcentricLayout.prototype.getType = function () {\n return \"concentric\";\n };\n return ConcentricLayout;\n}(base_1.Base));\nexports.ConcentricLayout = ConcentricLayout;\n//# sourceMappingURL=concentric.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/concentric.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/click-select.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/click-select.js ***! - \**************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/constants.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/constants.js ***! + \***********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar DEFAULT_TRIGGER = 'shift';\nvar ALLOW_EVENTS = ['shift', 'ctrl', 'alt', 'control'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n multiple: true,\n trigger: DEFAULT_TRIGGER,\n selectedState: 'selected',\n selectNode: true,\n selectEdge: false,\n selectCombo: true\n };\n },\n getEvents: function getEvents() {\n var self = this; // 检测输入是否合法\n\n if (!(ALLOW_EVENTS.indexOf(self.trigger.toLowerCase()) > -1)) {\n self.trigger = DEFAULT_TRIGGER; // eslint-disable-next-line no-console\n\n console.warn(\"Behavior click-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'\");\n }\n\n if (!self.multiple) {\n return {\n 'node:click': 'onClick',\n 'combo:click': 'onClick',\n 'edge:click': 'onClick',\n 'canvas:click': 'onCanvasClick'\n };\n }\n\n return {\n 'node:click': 'onClick',\n 'combo:click': 'onClick',\n 'edge:click': 'onClick',\n 'canvas:click': 'onCanvasClick',\n keyup: 'onKeyUp',\n keydown: 'onKeyDown'\n };\n },\n onClick: function onClick(evt) {\n var self = this;\n var item = evt.item;\n\n if (!item || item.destroyed) {\n return;\n }\n\n var type = item.getType();\n var graph = self.graph,\n keydown = self.keydown,\n multiple = self.multiple,\n shouldUpdate = self.shouldUpdate,\n shouldBegin = self.shouldBegin;\n\n if (!shouldBegin.call(self, evt)) {\n return;\n } // allow to select multiple nodes but did not press a key || do not allow the select multiple nodes\n\n\n if (!keydown || !multiple) {\n var selected = graph.findAllByState('node', self.selectedState).concat(graph.findAllByState('edge', self.selectedState)).concat(graph.findAllByState('combo', self.selectedState));\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(selected, function (selectedItem) {\n if (selectedItem !== item) {\n graph.setItemState(selectedItem, self.selectedState, false);\n }\n });\n } // check if the item could be selected, given the current cfg\n\n\n var itemSelectable = function () {\n switch (type) {\n case 'node':\n return self.selectNode;\n\n case 'edge':\n return self.selectEdge;\n\n case 'combo':\n return self.selectCombo;\n\n default:\n return false;\n }\n }();\n\n if (!itemSelectable) {\n var selectedNodes = graph.findAllByState('node', self.selectedState);\n var selectedEdges = graph.findAllByState('edge', self.selectedState);\n var selectedCombos = graph.findAllByState('combo', self.selectedState);\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges,\n combos: selectedCombos\n },\n select: false\n });\n return;\n }\n\n if (item.hasState(self.selectedState)) {\n if (shouldUpdate.call(self, evt)) {\n graph.setItemState(item, self.selectedState, false);\n }\n\n var selectedNodes = graph.findAllByState('node', self.selectedState);\n var selectedEdges = graph.findAllByState('edge', self.selectedState);\n var selectedCombos = graph.findAllByState('combo', self.selectedState);\n graph.emit('nodeselectchange', {\n target: item,\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges,\n combos: selectedCombos\n },\n select: false\n });\n } else {\n if (shouldUpdate.call(self, evt)) {\n graph.setItemState(item, self.selectedState, true);\n }\n\n var selectedNodes = graph.findAllByState('node', self.selectedState);\n var selectedEdges = graph.findAllByState('edge', self.selectedState);\n var selectedCombos = graph.findAllByState('combo', self.selectedState);\n graph.emit('nodeselectchange', {\n target: item,\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges,\n combos: selectedCombos\n },\n select: true\n });\n }\n },\n onCanvasClick: function onCanvasClick(evt) {\n var _this = this;\n\n var _a = this,\n graph = _a.graph,\n shouldBegin = _a.shouldBegin;\n\n if (!shouldBegin.call(this, evt)) {\n return;\n }\n\n var selected = graph.findAllByState('node', this.selectedState);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(selected, function (node) {\n graph.setItemState(node, _this.selectedState, false);\n });\n var selectedEdges = graph.findAllByState('edge', this.selectedState);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(selectedEdges, function (edge) {\n graph.setItemState(edge, _this.selectedState, false);\n });\n var selectedCombos = graph.findAllByState('combo', this.selectedState);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(selectedCombos, function (combo) {\n graph.setItemState(combo, _this.selectedState, false);\n });\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: [],\n edges: [],\n combos: []\n },\n select: false\n });\n },\n onKeyDown: function onKeyDown(e) {\n var self = this;\n var code = e.key;\n\n if (!code) {\n return;\n }\n\n if (code.toLowerCase() === this.trigger.toLowerCase() || code.toLowerCase() === 'control') {\n self.keydown = true;\n } else {\n self.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n var self = this;\n self.keydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/click-select.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FORCE_LAYOUT_TYPE_MAP = exports.LAYOUT_MESSAGE = void 0;\n/** layout message type */\nexports.LAYOUT_MESSAGE = {\n // run layout\n RUN: \"LAYOUT_RUN\",\n // layout ended with success\n END: \"LAYOUT_END\",\n // layout error\n ERROR: \"LAYOUT_ERROR\",\n // layout tick, used in force directed layout\n TICK: \"LAYOUT_TICK\",\n GPURUN: \"GPU_LAYOUT_RUN\",\n GPUEND: \"GPU_LAYOUT_END\"\n};\nexports.FORCE_LAYOUT_TYPE_MAP = {\n 'gForce': true,\n 'force2': true,\n 'fruchterman': true,\n 'forceAtlas2': true,\n 'force': true,\n 'graphin-force': true,\n};\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/constants.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/collapse-expand-combo.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/collapse-expand-combo.js ***! - \***********************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/*\n * @Author: Shiwu\n * @Description: 收起和展开 Combo\n */\nvar DEFAULT_TRIGGER = 'dblclick';\nvar ALLOW_EVENTS = ['click', 'dblclick'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n trigger: DEFAULT_TRIGGER,\n relayout: true\n };\n },\n getEvents: function getEvents() {\n var _a;\n\n var trigger; // 检测输入是否合法\n\n if (ALLOW_EVENTS.includes(this.trigger)) {\n trigger = this.trigger;\n } else {\n trigger = DEFAULT_TRIGGER; // eslint-disable-next-line no-console\n\n console.warn(\"Behavior collapse-expand-group 的 trigger 参数不合法,请输入 'click' 或 'dblclick'\");\n }\n\n return _a = {}, _a[\"combo:\".concat(trigger)] = 'onComboClick', _a;\n },\n onComboClick: function onComboClick(evt) {\n var item = evt.item;\n\n var _a = this,\n graph = _a.graph,\n relayout = _a.relayout;\n\n if (!item || item.destroyed || item.getType() !== 'combo') return;\n var model = item.getModel();\n var comboId = model.id;\n\n if (!comboId) {\n return;\n }\n\n graph.collapseExpandCombo(comboId);\n if (relayout && graph.get('layout')) graph.layout();else graph.refreshPositions();\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/collapse-expand-combo.js?"); +eval("\n/**\n * @fileOverview dagre layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DagreLayout = void 0;\nvar index_1 = __importDefault(__webpack_require__(/*! ./dagre/index */ \"./node_modules/@antv/layout/lib/layout/dagre/index.js\"));\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar graph_1 = __webpack_require__(/*! ./dagre/graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\n/**\n * 层次布局\n */\nvar DagreLayout = /** @class */ (function (_super) {\n __extends(DagreLayout, _super);\n function DagreLayout(options) {\n var _this = _super.call(this) || this;\n /** layout 方向, 可选 TB, BT, LR, RL */\n _this.rankdir = 'TB';\n /** 节点水平间距(px) */\n _this.nodesep = 50;\n /** 每一层节点之间间距 */\n _this.ranksep = 50;\n /** 是否保留布局连线的控制点 */\n _this.controlPoints = false;\n /** 每层节点是否根据节点数据中的 comboId 进行排序,以防止同层 combo 重叠 */\n _this.sortByCombo = false;\n /** 是否保留每条边上的dummy node */\n _this.edgeLabelSpace = true;\n /** 是否基于 dagre 进行辐射布局,若是,第一层节点将被放置在最内环上,其余层依次向外辐射 */\n _this.radial = false;\n _this.nodes = [];\n _this.edges = [];\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.layoutNode = function (nodeId) {\n var self = _this;\n var nodes = self.nodes;\n var node = nodes.find(function (node) { return node.id === nodeId; });\n if (node) {\n var layout = node.layout !== false;\n return layout;\n }\n return true;\n };\n _this.updateCfg(options);\n return _this;\n }\n DagreLayout.prototype.getDefaultCfg = function () {\n return {\n rankdir: 'TB',\n align: undefined,\n nodeSize: undefined,\n nodesepFunc: undefined,\n ranksepFunc: undefined,\n nodesep: 50,\n ranksep: 50,\n controlPoints: false,\n radial: false,\n focusNode: null, // radial 为 true 时生效,关注的节点\n };\n };\n /**\n * 执行布局\n */\n DagreLayout.prototype.execute = function () {\n var _this = this;\n var _a, _b, _c, _d;\n var self = this;\n var nodes = self.nodes, nodeSize = self.nodeSize, rankdir = self.rankdir, combos = self.combos, begin = self.begin, radial = self.radial, _e = self.comboEdges, comboEdges = _e === void 0 ? [] : _e, _f = self.vedges, vedges = _f === void 0 ? [] : _f;\n if (!nodes)\n return;\n var edges = self.edges || [];\n var g = new graph_1.Graph({\n multigraph: true,\n compound: true,\n });\n // collect the nodes in their combo, to create virtual edges for comboEdges\n self.nodeMap = {};\n var nodeComboMap = {};\n nodes.forEach(function (node) {\n self.nodeMap[node.id] = node;\n if (!node.comboId)\n return;\n nodeComboMap[node.comboId] = nodeComboMap[node.comboId] || [];\n nodeComboMap[node.comboId].push(node.id);\n });\n var sortedNodes = [];\n var visitedMap = {};\n if ((_a = self.nodeOrder) === null || _a === void 0 ? void 0 : _a.length) {\n self.nodeOrder.forEach(function (id) {\n visitedMap[id] = true;\n sortedNodes.push(self.nodeMap[id]);\n });\n nodes.forEach(function (node) {\n if (!visitedMap[node.id])\n sortedNodes.push(node);\n });\n }\n else {\n sortedNodes = nodes;\n }\n var nodeSizeFunc;\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return d.size;\n }\n if ((0, util_1.isObject)(d.size)) {\n return [d.size.width || 40, d.size.height || 40];\n }\n return [d.size, d.size];\n }\n return [40, 40];\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function () { return nodeSize; };\n }\n else {\n nodeSizeFunc = function () { return [nodeSize, nodeSize]; };\n }\n var ranksepfunc = (0, util_1.getFunc)(self.ranksep, 50, self.ranksepFunc);\n var nodesepfunc = (0, util_1.getFunc)(self.nodesep, 50, self.nodesepFunc);\n var horisep = nodesepfunc;\n var vertisep = ranksepfunc;\n if (rankdir === 'LR' || rankdir === 'RL') {\n horisep = ranksepfunc;\n vertisep = nodesepfunc;\n }\n g.setDefaultEdgeLabel(function () { return ({}); });\n g.setGraph(self);\n var comboMap = {};\n if (this.sortByCombo && combos) {\n combos.forEach(function (combo) {\n comboMap[combo.id] = combo;\n // regard the collapsed combo as a node\n if (combo.collapsed) {\n var size = nodeSizeFunc(combo);\n var verti = vertisep(combo);\n var hori = horisep(combo);\n var width = size[0] + 2 * hori;\n var height = size[1] + 2 * verti;\n g.setNode(combo.id, { width: width, height: height });\n }\n if (!combo.parentId)\n return;\n if (!comboMap[combo.parentId]) {\n g.setNode(combo.parentId, {});\n }\n g.setParent(combo.id, combo.parentId);\n });\n }\n sortedNodes\n .filter(function (node) { return node.layout !== false; })\n .forEach(function (node) {\n var size = nodeSizeFunc(node);\n var verti = vertisep(node);\n var hori = horisep(node);\n var width = size[0] + 2 * hori;\n var height = size[1] + 2 * verti;\n var layer = node.layer;\n if ((0, util_1.isNumber)(layer)) {\n // 如果有layer属性,加入到node的label中\n g.setNode(node.id, { width: width, height: height, layer: layer });\n }\n else {\n g.setNode(node.id, { width: width, height: height });\n }\n if (_this.sortByCombo && node.comboId) {\n if (!comboMap[node.comboId]) {\n comboMap[node.comboId] = { id: node.comboId };\n g.setNode(node.comboId, {});\n }\n g.setParent(node.id, node.comboId);\n }\n });\n edges.forEach(function (edge) {\n // dagrejs Wiki https://github.com/dagrejs/dagre/wiki#configuring-the-layout\n var source = (0, util_1.getEdgeTerminal)(edge, 'source');\n var target = (0, util_1.getEdgeTerminal)(edge, 'target');\n if (_this.layoutNode(source) && _this.layoutNode(target)) {\n g.setEdge(source, target, {\n weight: edge.weight || 1,\n });\n }\n });\n // create virtual edges from node to node for comboEdges\n (_b = comboEdges === null || comboEdges === void 0 ? void 0 : comboEdges.concat(vedges || [])) === null || _b === void 0 ? void 0 : _b.forEach(function (comboEdge) {\n var _a, _b;\n var source = comboEdge.source, target = comboEdge.target;\n var sources = ((_a = comboMap[source]) === null || _a === void 0 ? void 0 : _a.collapsed)\n ? [source]\n : nodeComboMap[source] || [source];\n var targets = ((_b = comboMap[target]) === null || _b === void 0 ? void 0 : _b.collapsed)\n ? [target]\n : nodeComboMap[target] || [target];\n sources.forEach(function (s) {\n targets.forEach(function (t) {\n g.setEdge(s, t, {\n weight: comboEdge.weight || 1,\n });\n });\n });\n });\n // 考虑增量图中的原始图\n var prevGraph = undefined;\n if ((_c = self.preset) === null || _c === void 0 ? void 0 : _c.nodes) {\n prevGraph = new graph_1.Graph({\n multigraph: true,\n compound: true,\n });\n self.preset.nodes.forEach(function (node) {\n prevGraph === null || prevGraph === void 0 ? void 0 : prevGraph.setNode(node.id, node);\n });\n }\n index_1.default.layout(g, {\n prevGraph: prevGraph,\n edgeLabelSpace: self.edgeLabelSpace,\n keepNodeOrder: Boolean(!!self.nodeOrder),\n nodeOrder: self.nodeOrder,\n });\n var dBegin = [0, 0];\n if (begin) {\n var minX_1 = Infinity;\n var minY_1 = Infinity;\n g.nodes().forEach(function (node) {\n var coord = g.node(node);\n if (minX_1 > coord.x)\n minX_1 = coord.x;\n if (minY_1 > coord.y)\n minY_1 = coord.y;\n });\n g.edges().forEach(function (edge) {\n var _a;\n var coord = g.edge(edge);\n (_a = coord.points) === null || _a === void 0 ? void 0 : _a.forEach(function (point) {\n if (minX_1 > point.x)\n minX_1 = point.x;\n if (minY_1 > point.y)\n minY_1 = point.y;\n });\n });\n dBegin[0] = begin[0] - minX_1;\n dBegin[1] = begin[1] - minY_1;\n }\n var isHorizontal = rankdir === 'LR' || rankdir === 'RL';\n // 变形为辐射\n if (radial) {\n var _g = this, focusNode = _g.focusNode, ranksep = _g.ranksep, getRadialPos_1 = _g.getRadialPos;\n var focusId = (0, util_1.isString)(focusNode) ? focusNode : focusNode === null || focusNode === void 0 ? void 0 : focusNode.id;\n var focusLayer_1 = focusId ? (_d = g.node(focusId)) === null || _d === void 0 ? void 0 : _d._rank : 0;\n var layers_1 = [];\n var dim_1 = isHorizontal ? 'y' : 'x';\n var sizeDim_1 = isHorizontal ? 'height' : 'width';\n // 找到整个图作为环的坐标维度(dim)的最大、最小值,考虑节点宽度\n var min_1 = Infinity;\n var max_1 = -Infinity;\n g.nodes().forEach(function (node) {\n var coord = g.node(node);\n if (!self.nodeMap[node])\n return;\n var currentNodesep = nodesepfunc(self.nodeMap[node]);\n if (focusLayer_1 === 0) {\n if (!layers_1[coord._rank]) {\n layers_1[coord._rank] = {\n nodes: [],\n totalWidth: 0,\n maxSize: -Infinity,\n };\n }\n layers_1[coord._rank].nodes.push(node);\n layers_1[coord._rank].totalWidth += currentNodesep * 2 + coord[sizeDim_1];\n if (layers_1[coord._rank].maxSize < Math.max(coord.width, coord.height)) {\n layers_1[coord._rank].maxSize = Math.max(coord.width, coord.height);\n }\n }\n else {\n var diffLayer = coord._rank - focusLayer_1;\n if (diffLayer === 0) {\n if (!layers_1[diffLayer]) {\n layers_1[diffLayer] = {\n nodes: [],\n totalWidth: 0,\n maxSize: -Infinity,\n };\n }\n layers_1[diffLayer].nodes.push(node);\n layers_1[diffLayer].totalWidth += currentNodesep * 2 + coord[sizeDim_1];\n if (layers_1[diffLayer].maxSize < Math.max(coord.width, coord.height)) {\n layers_1[diffLayer].maxSize = Math.max(coord.width, coord.height);\n }\n }\n else {\n var diffLayerAbs = Math.abs(diffLayer);\n if (!layers_1[diffLayerAbs]) {\n layers_1[diffLayerAbs] = {\n left: [],\n right: [],\n totalWidth: 0,\n maxSize: -Infinity,\n };\n }\n layers_1[diffLayerAbs].totalWidth +=\n currentNodesep * 2 + coord[sizeDim_1];\n if (layers_1[diffLayerAbs].maxSize < Math.max(coord.width, coord.height)) {\n layers_1[diffLayerAbs].maxSize = Math.max(coord.width, coord.height);\n }\n if (diffLayer < 0) {\n layers_1[diffLayerAbs].left.push(node);\n }\n else {\n layers_1[diffLayerAbs].right.push(node);\n }\n }\n }\n var leftPos = coord[dim_1] - coord[sizeDim_1] / 2 - currentNodesep;\n var rightPos = coord[dim_1] + coord[sizeDim_1] / 2 + currentNodesep;\n if (leftPos < min_1)\n min_1 = leftPos;\n if (rightPos > max_1)\n max_1 = rightPos;\n });\n // const padding = (max - min) * 0.1; // TODO\n // \b初始化为第一圈的半径,后面根据每层 ranksep 叠加\n var radius_1 = ranksep || 50; // TODO;\n var radiusMap_1 = {};\n // 扩大最大最小值范围,以便为环上留出接缝处的空隙\n var rangeLength_1 = (max_1 - min_1) / 0.9;\n var range_1 = [\n (min_1 + max_1 - rangeLength_1) * 0.5,\n (min_1 + max_1 + rangeLength_1) * 0.5,\n ];\n // 根据半径、分布比例,计算节点在环上的位置,并返回该组节点中最大的 ranksep 值\n var processNodes_1 = function (layerNodes, radius, propsMaxRanksep, arcRange) {\n if (propsMaxRanksep === void 0) { propsMaxRanksep = -Infinity; }\n if (arcRange === void 0) { arcRange = [0, 1]; }\n var maxRanksep = propsMaxRanksep;\n layerNodes.forEach(function (node) {\n var coord = g.node(node);\n radiusMap_1[node] = radius;\n // 获取变形为 radial 后的直角坐标系坐标\n var _a = getRadialPos_1(coord[dim_1], range_1, rangeLength_1, radius, arcRange), newX = _a.x, newY = _a.y;\n // 将新坐标写入源数据\n if (!self.nodeMap[node])\n return;\n self.nodeMap[node].x = newX + dBegin[0];\n self.nodeMap[node].y = newY + dBegin[1];\n // @ts-ignore: pass layer order to data for increment layout use\n self.nodeMap[node]._order = coord._order;\n // 找到本层最大的一个 ranksep,作为下一层与本层的间隙,叠加到下一层的半径上\n var currentNodeRanksep = ranksepfunc(self.nodeMap[node]);\n if (maxRanksep < currentNodeRanksep)\n maxRanksep = currentNodeRanksep;\n });\n return maxRanksep;\n };\n var isFirstLevel_1 = true;\n var lastLayerMaxNodeSize_1 = 0;\n layers_1.forEach(function (layerNodes) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (!((_a = layerNodes === null || layerNodes === void 0 ? void 0 : layerNodes.nodes) === null || _a === void 0 ? void 0 : _a.length) &&\n !((_b = layerNodes === null || layerNodes === void 0 ? void 0 : layerNodes.left) === null || _b === void 0 ? void 0 : _b.length) &&\n !((_c = layerNodes === null || layerNodes === void 0 ? void 0 : layerNodes.right) === null || _c === void 0 ? void 0 : _c.length)) {\n return;\n }\n // 第一层只有一个节点,直接放在圆心,初始半径设定为 0\n if (isFirstLevel_1 && layerNodes.nodes.length === 1) {\n // 将新坐标写入源数据\n var nodeId = layerNodes.nodes[0];\n if (!self.nodeMap[nodeId])\n return;\n self.nodeMap[nodeId].x = dBegin[0];\n self.nodeMap[nodeId].y = dBegin[1];\n radiusMap_1[layerNodes.nodes[0]] = 0;\n radius_1 = ranksepfunc(self.nodeMap[nodeId]);\n isFirstLevel_1 = false;\n return;\n }\n // 为接缝留出空隙,半径也需要扩大\n radius_1 = Math.max(radius_1, layerNodes.totalWidth / (2 * Math.PI)); // / 0.9;\n var maxRanksep = -Infinity;\n if (focusLayer_1 === 0 || ((_d = layerNodes.nodes) === null || _d === void 0 ? void 0 : _d.length)) {\n maxRanksep = processNodes_1(layerNodes.nodes, radius_1, maxRanksep, [0, 1]); // 0.8\n }\n else {\n var leftRatio = ((_e = layerNodes.left) === null || _e === void 0 ? void 0 : _e.length) /\n (((_f = layerNodes.left) === null || _f === void 0 ? void 0 : _f.length) + ((_g = layerNodes.right) === null || _g === void 0 ? void 0 : _g.length));\n maxRanksep = processNodes_1(layerNodes.left, radius_1, maxRanksep, [\n 0,\n leftRatio,\n ]); // 接缝留出 0.05 的缝隙\n maxRanksep = processNodes_1(layerNodes.right, radius_1, maxRanksep, [\n leftRatio + 0.05,\n 1,\n ]); // 接缝留出 0.05 的缝隙\n }\n radius_1 += maxRanksep;\n isFirstLevel_1 = false;\n lastLayerMaxNodeSize_1 - layerNodes.maxSize;\n });\n g.edges().forEach(function (edge) {\n var _a, _b, _c;\n var coord = g.edge(edge);\n var i = edges.findIndex(function (it) {\n var source = (0, util_1.getEdgeTerminal)(it, 'source');\n var target = (0, util_1.getEdgeTerminal)(it, 'target');\n return source === edge.v && target === edge.w;\n });\n if (i <= -1)\n return;\n if (self.edgeLabelSpace &&\n self.controlPoints &&\n edges[i].type !== 'loop') {\n var otherDim_1 = dim_1 === 'x' ? 'y' : 'x';\n var controlPoints = (_a = coord === null || coord === void 0 ? void 0 : coord.points) === null || _a === void 0 ? void 0 : _a.slice(1, coord.points.length - 1);\n var newControlPoints_1 = [];\n var sourceOtherDimValue_1 = (_b = g.node(edge.v)) === null || _b === void 0 ? void 0 : _b[otherDim_1];\n var otherDimDist_1 = sourceOtherDimValue_1 - ((_c = g.node(edge.w)) === null || _c === void 0 ? void 0 : _c[otherDim_1]);\n var sourceRadius_1 = radiusMap_1[edge.v];\n var radiusDist_1 = sourceRadius_1 - radiusMap_1[edge.w];\n controlPoints === null || controlPoints === void 0 ? void 0 : controlPoints.forEach(function (point) {\n // 根据该边的起点、终点半径,及起点、终点、控制点位置关系,确定该控制点的半径\n var cRadius = ((point[otherDim_1] - sourceOtherDimValue_1) / otherDimDist_1) *\n radiusDist_1 +\n sourceRadius_1;\n // 获取变形为 radial 后的直角坐标系坐标\n var newPos = getRadialPos_1(point[dim_1], range_1, rangeLength_1, cRadius);\n newControlPoints_1.push({\n x: newPos.x + dBegin[0],\n y: newPos.y + dBegin[1],\n });\n });\n edges[i].controlPoints = newControlPoints_1;\n }\n });\n }\n else {\n var layerCoords_1 = new Set();\n var isInvert = rankdir === 'BT' || rankdir === 'RL';\n var layerCoordSort = isInvert\n ? function (a, b) { return b - a; }\n : function (a, b) { return a - b; };\n g.nodes().forEach(function (node) {\n var coord = g.node(node);\n if (!coord)\n return;\n var ndata = _this.nodeMap[node];\n if (!ndata) {\n ndata = combos === null || combos === void 0 ? void 0 : combos.find(function (it) { return it.id === node; });\n }\n if (!ndata)\n return;\n ndata.x = coord.x + dBegin[0];\n ndata.y = coord.y + dBegin[1];\n // @ts-ignore: pass layer order to data for increment layout use\n ndata._order = coord._order;\n layerCoords_1.add(isHorizontal ? ndata.x : ndata.y);\n });\n var layerCoordsArr_1 = Array.from(layerCoords_1).sort(layerCoordSort);\n // pre-define the isHorizontal related functions to avoid redundant calc in interations\n var isDifferentLayer_1 = isHorizontal\n ? function (point1, point2) { return point1.x !== point2.x; }\n : function (point1, point2) { return point1.y !== point2.y; };\n var filterControlPointsOutOfBoundary_1 = isHorizontal\n ? function (ps, point1, point2) {\n var max = Math.max(point1.y, point2.y);\n var min = Math.min(point1.y, point2.y);\n return ps.filter(function (point) { return point.y <= max && point.y >= min; });\n }\n : function (ps, point1, point2) {\n var max = Math.max(point1.x, point2.x);\n var min = Math.min(point1.x, point2.x);\n return ps.filter(function (point) { return point.x <= max && point.x >= min; });\n };\n g.edges().forEach(function (edge) {\n var _a;\n var coord = g.edge(edge);\n var i = edges.findIndex(function (it) {\n var source = (0, util_1.getEdgeTerminal)(it, 'source');\n var target = (0, util_1.getEdgeTerminal)(it, 'target');\n return source === edge.v && target === edge.w;\n });\n if (i <= -1)\n return;\n if (self.edgeLabelSpace &&\n self.controlPoints &&\n edges[i].type !== 'loop') {\n (_a = coord === null || coord === void 0 ? void 0 : coord.points) === null || _a === void 0 ? void 0 : _a.forEach(function (point) {\n point.x += dBegin[0];\n point.y += dBegin[1];\n });\n var sourceNode = self.nodeMap[edge.v];\n var targetNode = self.nodeMap[edge.w];\n edges[i].controlPoints = getControlPoints(coord === null || coord === void 0 ? void 0 : coord.points, sourceNode, targetNode, layerCoordsArr_1, isHorizontal, isDifferentLayer_1, filterControlPointsOutOfBoundary_1);\n }\n });\n }\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges,\n };\n };\n DagreLayout.prototype.getRadialPos = function (dimValue, range, rangeLength, radius, arcRange) {\n if (arcRange === void 0) { arcRange = [0, 1]; }\n // dimRatio 占圆弧的比例\n var dimRatio = (dimValue - range[0]) / rangeLength;\n // 再进一步归一化到指定的范围上\n dimRatio = dimRatio * (arcRange[1] - arcRange[0]) + arcRange[0];\n // 使用最终归一化后的范围计算角度\n var angle = dimRatio * 2 * Math.PI; // 弧度\n // 将极坐标系转换为直角坐标系\n return {\n x: Math.cos(angle) * radius,\n y: Math.sin(angle) * radius,\n };\n };\n DagreLayout.prototype.getType = function () {\n return 'dagre';\n };\n return DagreLayout;\n}(base_1.Base));\nexports.DagreLayout = DagreLayout;\n/**\n * Format controlPoints to avoid polylines crossing nodes\n * @param points\n * @param sourceNode\n * @param targetNode\n * @param layerCoordsArr\n * @param isHorizontal\n * @returns\n */\nvar getControlPoints = function (points, sourceNode, targetNode, layerCoordsArr, isHorizontal, isDifferentLayer, filterControlPointsOutOfBoundary) {\n var controlPoints = (points === null || points === void 0 ? void 0 : points.slice(1, points.length - 1)) || []; // 去掉头尾\n // 酌情增加控制点,使折线不穿过跨层的节点\n if (sourceNode && targetNode) {\n var sourceX = sourceNode.x, sourceY = sourceNode.y;\n var targetX = targetNode.x, targetY = targetNode.y;\n if (isHorizontal) {\n sourceX = sourceNode.y;\n sourceY = sourceNode.x;\n targetX = targetNode.y;\n targetY = targetNode.x;\n }\n // 为跨层级的边增加第一个控制点。忽略垂直的/横向的边。\n // 新控制点 = {\n // x: 终点x,\n // y: (起点y + 下一层y) / 2, #下一层y可能不等于终点y\n // }\n if (targetY !== sourceY && sourceX !== targetX) {\n var sourceLayer = layerCoordsArr.indexOf(sourceY);\n var sourceNextLayerCoord = layerCoordsArr[sourceLayer + 1];\n if (sourceNextLayerCoord) {\n var firstControlPoint = controlPoints[0];\n var insertStartControlPoint = isHorizontal\n ? {\n x: (sourceY + sourceNextLayerCoord) / 2,\n y: (firstControlPoint === null || firstControlPoint === void 0 ? void 0 : firstControlPoint.y) || targetX,\n }\n : {\n x: (firstControlPoint === null || firstControlPoint === void 0 ? void 0 : firstControlPoint.x) || targetX,\n y: (sourceY + sourceNextLayerCoord) / 2,\n };\n // 当新增的控制点不存在(!=当前第一个控制点)时添加\n if (!firstControlPoint ||\n isDifferentLayer(firstControlPoint, insertStartControlPoint)) {\n controlPoints.unshift(insertStartControlPoint);\n }\n }\n var targetLayer = layerCoordsArr.indexOf(targetY);\n var layerDiff = Math.abs(targetLayer - sourceLayer);\n if (layerDiff === 1) {\n controlPoints = filterControlPointsOutOfBoundary(controlPoints, sourceNode, targetNode);\n // one controlPoint at least\n if (!controlPoints.length) {\n controlPoints.push(isHorizontal\n ? {\n x: (sourceY + targetY) / 2,\n y: sourceX,\n }\n : {\n x: sourceX,\n y: (sourceY + targetY) / 2,\n });\n }\n }\n else if (layerDiff > 1) {\n var targetLastLayerCoord = layerCoordsArr[targetLayer - 1];\n if (targetLastLayerCoord) {\n var lastControlPoints = controlPoints[controlPoints.length - 1];\n var insertEndControlPoint = isHorizontal\n ? {\n x: (targetY + targetLastLayerCoord) / 2,\n y: (lastControlPoints === null || lastControlPoints === void 0 ? void 0 : lastControlPoints.y) || targetX,\n }\n : {\n x: (lastControlPoints === null || lastControlPoints === void 0 ? void 0 : lastControlPoints.x) || sourceX,\n y: (targetY + targetLastLayerCoord) / 2,\n };\n // 当新增的控制点不存在(!=当前最后一个控制点)时添加\n if (!lastControlPoints ||\n isDifferentLayer(lastControlPoints, insertEndControlPoint)) {\n controlPoints.push(insertEndControlPoint);\n }\n }\n }\n }\n }\n return controlPoints;\n};\n//# sourceMappingURL=dagre.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/collapse-expand.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/collapse-expand.js ***! - \*****************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/graph.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/graph.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar DEFAULT_TRIGGER = 'click';\nvar ALLOW_EVENTS = ['click', 'dblclick'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n /**\n * 发生收缩/扩展变化时的回调\n */\n trigger: DEFAULT_TRIGGER,\n onChange: function onChange() {}\n };\n },\n getEvents: function getEvents() {\n var _a;\n\n var trigger; // 检测输入是否合法\n\n if (ALLOW_EVENTS.includes(this.trigger)) {\n trigger = this.trigger;\n } else {\n trigger = DEFAULT_TRIGGER; // eslint-disable-next-line no-console\n\n console.warn(\"Behavior collapse-expand 的 trigger 参数不合法,请输入 'click' 或 'dblclick'\");\n }\n\n return _a = {}, _a[\"node:\".concat(trigger)] = 'onNodeClick', // 支持移动端事件\n _a.touchstart = 'onNodeClick', _a;\n },\n onNodeClick: function onNodeClick(e) {\n var item = e.item;\n if (!item) return; // 如果节点进行过更新,model 会进行 merge,直接改 model 就不能改布局,所以需要去改源数据\n\n var sourceData = this.graph.findDataById(item.get('id'));\n\n if (!sourceData) {\n return;\n }\n\n var children = sourceData.children; // 叶子节点的收缩和展开没有意义\n\n if (!children || children.length === 0) {\n return;\n }\n\n var collapsed = !sourceData.collapsed;\n\n if (!this.shouldBegin(e, collapsed)) {\n return;\n }\n\n sourceData.collapsed = collapsed;\n item.getModel().collapsed = collapsed;\n this.graph.emit('itemcollapsed', {\n item: e.item,\n collapsed: collapsed\n });\n\n if (!this.shouldUpdate(e, collapsed)) {\n return;\n }\n\n this.onChange(item, collapsed);\n this.graph.layout();\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/collapse-expand.js?"); +eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Graph = void 0;\nvar graphlib_1 = __webpack_require__(/*! @antv/graphlib */ \"./node_modules/@antv/graphlib/es/index.js\");\nvar Graph = /** @class */ (function (_super) {\n __extends(Graph, _super);\n function Graph() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return Graph;\n}(graphlib_1.Graph));\nexports.Graph = Graph;\n//# sourceMappingURL=graph.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/graph.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/create-edge.js": +/***/ "./node_modules/@antv/layout/lib/layout/dagre/index.js": /*!*************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/create-edge.js ***! + !*** ./node_modules/@antv/layout/lib/layout/dagre/index.js ***! \*************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\nvar DEFAULT_TRIGGER = 'click';\nvar ALLOW_EVENTS = ['click', 'drag'];\nvar DEFAULT_KEY = undefined;\nvar ALLOW_KEYS = ['shift', 'ctrl', 'control', 'alt', 'meta', undefined];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n trigger: DEFAULT_TRIGGER,\n key: DEFAULT_KEY,\n edgeConfig: {},\n getEdgeConfig: undefined\n };\n },\n getEvents: function getEvents() {\n var self = this; // 检测输入是否合法\n\n if (!(ALLOW_EVENTS.indexOf(self.trigger.toLowerCase()) > -1)) {\n self.trigger = DEFAULT_TRIGGER; // eslint-disable-next-line no-console\n\n console.warn(\"Behavior create-edge 的 trigger 参数不合法,请输入 'click','drag'\");\n }\n\n if (self.key && ALLOW_KEYS.indexOf(self.key.toLowerCase()) === -1) {\n self.trigger = DEFAULT_KEY; // eslint-disable-next-line no-console\n\n console.warn(\"Behavior create-edge 的 key 参数不合法,请输入 'shift','ctrl','alt','control',或 undefined\");\n }\n\n var events;\n\n if (self.trigger === 'drag') {\n events = {\n 'node:dragstart': 'onClick',\n 'combo:dragstart': 'onClick',\n drag: 'updateEndPoint',\n 'node:drop': 'onClick',\n 'combo:drop': 'onClick',\n dragend: 'onDragEnd'\n };\n } else if (self.trigger === 'click') {\n events = {\n 'node:click': 'onClick',\n mousemove: 'updateEndPoint',\n 'edge:click': 'cancelCreating',\n 'canvas:click': 'cancelCreating',\n 'combo:click': 'onClick'\n };\n }\n\n if (self.key) {\n events.keydown = 'onKeyDown';\n events.keyup = 'onKeyUp';\n }\n\n return events;\n },\n onDragEnd: function onDragEnd(ev) {\n var self = this;\n if (self.key && !self.keydown) return;\n var item = ev.item;\n if (!item || item.getID() === self.source || item.getType() !== 'node') self.cancelCreating({\n item: self.edge,\n x: ev.x,\n y: ev.y\n });\n },\n // 如果边的起点没有指定,则根据起点创建新边;如果起点已经指定而终点未指定,则指定终点\n onClick: function onClick(ev) {\n var self = this;\n if (self.key && !self.keydown) return;\n var node = ev.item;\n var graph = self.graph;\n var model = node.getModel();\n var getEdgeConfig = self.getEdgeConfig; // 如果起点已经指定而终点未指定,则指定终点\n\n if (self.addingEdge && self.edge) {\n if (!self.shouldEnd.call(self, ev)) return;\n var edgeConfig = void 0;\n\n if (getEdgeConfig && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(getEdgeConfig)) {\n edgeConfig = getEdgeConfig({\n source: self.source,\n target: model.id\n });\n } else {\n edgeConfig = self.edgeConfig;\n }\n\n var updateCfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n target: model.id\n }, edgeConfig);\n\n if (self.source === model.id) {\n updateCfg.type = 'loop';\n }\n\n graph.emit('beforecreateedge', {});\n graph.updateItem(self.edge, updateCfg, false);\n\n if (graph.get('enabledStack')) {\n var addedModel = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, self.edge.getModel()), {\n itemType: 'edge'\n });\n\n var after = {};\n after.edges = [addedModel];\n graph.pushStack('add', {\n before: {},\n after: after\n });\n }\n\n graph.emit('aftercreateedge', {\n edge: self.edge\n }); // 暂时将该边的 capture 恢复为 true\n\n self.edge.getKeyShape().set('capture', true);\n self.edge = null;\n self.addingEdge = false;\n } else {\n // 如果边的起点没有指定,则根据起点创建新边\n if (!self.shouldBegin.call(self, ev)) return; // 获取自定义 edge 配置\n\n var edgeConfig = void 0;\n\n if (getEdgeConfig && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isFunction\"])(getEdgeConfig)) {\n edgeConfig = getEdgeConfig({\n source: model.id,\n target: model.id\n });\n } else {\n edgeConfig = self.edgeConfig;\n }\n\n self.edge = graph.addItem('edge', Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n source: model.id,\n target: model.id\n }, edgeConfig), false);\n self.source = model.id;\n self.addingEdge = true; // 暂时将该边的 capture 设置为 false,这样可以拾取到后面的元素\n\n self.edge.getKeyShape().set('capture', false);\n }\n },\n // 边的起点已经确定,边的末端跟随鼠标移动\n updateEndPoint: function updateEndPoint(ev) {\n var self = this;\n if (self.key && !self.keydown) return;\n if (self.edge && self.edge.destroyed) self.cancelCreating({\n item: self.edge\n });\n var point = {\n x: ev.x,\n y: ev.y\n }; // 若此时 source 节点已经被移除,结束添加边\n\n if (!self.graph.findById(self.source)) {\n self.addingEdge = false;\n return;\n }\n\n if (self.addingEdge && self.edge) {\n // 更新边的终点为鼠标位置\n self.graph.updateItem(self.edge, {\n target: point\n }, false);\n }\n },\n // 取消增加边,删除该边;或指定终点\n cancelCreating: function cancelCreating(ev) {\n var _a, _b;\n\n var self = this;\n if (self.key && !self.keydown) return;\n var graph = self.graph;\n var currentEdge = ev.item;\n\n if (self.addingEdge && (self.edge === currentEdge || ((_b = (_a = ev.target) === null || _a === void 0 ? void 0 : _a.isCanvas) === null || _b === void 0 ? void 0 : _b.call(_a)))) {\n if (self.edge && !self.edge.destroyed) graph.removeItem(self.edge, false);\n self.edge = null;\n self.addingEdge = false;\n return;\n }\n },\n onKeyDown: function onKeyDown(e) {\n var self = this;\n var code = e.key;\n\n if (!code) {\n return;\n }\n\n if (code.toLowerCase() === self.key.toLowerCase()) {\n self.keydown = true;\n } else {\n self.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n var self = this;\n\n if (self.addingEdge && self.edge) {\n // 清除正在增加的边\n self.graph.removeItem(self.edge, false);\n self.addingEdge = false;\n self.edge = null;\n }\n\n this.keydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/create-edge.js?"); +eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\nCopyright (c) 2012-2014 Chris Pettitt\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\nvar layout_1 = __importDefault(__webpack_require__(/*! ./src/layout */ \"./node_modules/@antv/layout/lib/layout/dagre/src/layout.js\"));\nvar util_1 = __webpack_require__(/*! ./src/util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nexports.default = {\n layout: layout_1.default,\n util: {\n time: util_1.time,\n notime: util_1.notime\n },\n};\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/drag-canvas.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/drag-canvas.js ***! - \*************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/acyclic.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/acyclic.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n\nvar cloneEvent = _util__WEBPACK_IMPORTED_MODULE_0__[\"default\"].cloneEvent,\n isNaN = _util__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isNaN;\nvar abs = Math.abs;\nvar DRAG_OFFSET = 10;\nvar ALLOW_EVENTS = ['shift', 'ctrl', 'alt', 'control'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n direction: 'both',\n enableOptimize: false,\n // drag-canvas 可拖动的扩展范围,默认为 0,即最多可以拖动一屏的位置\n // 当设置的值大于 0 时,即拖动可以超过一屏\n // 当设置的值小于 0 时,相当于缩小了可拖动范围\n // 具体实例可参考:https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*IFfoS67_HssAAAAAAAAAAAAAARQnAQ\n scalableRange: 0,\n allowDragOnItem: false\n };\n },\n getEvents: function getEvents() {\n return {\n 'dragstart': 'onMouseDown',\n 'drag': 'onMouseMove',\n 'dragend': 'onMouseUp',\n 'canvas:click': 'onMouseUp',\n 'keyup': 'onKeyUp',\n 'focus': 'onKeyUp',\n 'keydown': 'onKeyDown',\n 'touchstart': 'onTouchStart',\n 'touchmove': 'onTouchMove',\n 'touchend': 'onMouseUp'\n };\n },\n updateViewport: function updateViewport(e) {\n var origin = this.origin;\n var clientX = +e.clientX;\n var clientY = +e.clientY;\n\n if (isNaN(clientX) || isNaN(clientY)) {\n return;\n }\n\n var dx = clientX - origin.x;\n var dy = clientY - origin.y;\n\n if (this.get('direction') === 'x') {\n dy = 0;\n } else if (this.get('direction') === 'y') {\n dx = 0;\n }\n\n this.origin = {\n x: clientX,\n y: clientY\n };\n var width = this.graph.get('width');\n var height = this.graph.get('height');\n var graphCanvasBBox = this.graph.get('canvas').getCanvasBBox();\n var expandWidth = this.scalableRange;\n var expandHeight = this.scalableRange; // 若 scalableRange 是 0~1 的小数,则作为比例考虑\n\n if (expandWidth < 1 && expandWidth > -1) {\n expandWidth = width * expandWidth;\n expandHeight = height * expandHeight;\n }\n\n if (graphCanvasBBox.minX <= width + expandWidth && graphCanvasBBox.minX + dx > width + expandWidth || graphCanvasBBox.maxX + expandWidth >= 0 && graphCanvasBBox.maxX + expandWidth + dx < 0) {\n dx = 0;\n }\n\n if (graphCanvasBBox.minY <= height + expandHeight && graphCanvasBBox.minY + dy > height + expandHeight || graphCanvasBBox.maxY + expandHeight >= 0 && graphCanvasBBox.maxY + expandHeight + dy < 0) {\n dy = 0;\n }\n\n this.graph.translate(dx, dy);\n },\n onTouchStart: function onTouchStart(e) {\n var self = this;\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1]; // 如果是双指操作,不允许拖拽画布\n\n if (event1 && event2) {\n return;\n }\n\n e.preventDefault();\n self.onMouseDown(e);\n },\n onMouseDown: function onMouseDown(e) {\n var self = this;\n var event = e.originalEvent; // TODO: 'name' doesn't exist on `IG6GraphEvent`, we should consider typing it so users get autocomplete and other benefits\n\n if (event && e.name !== 'touchstart' && event.button !== 0) {\n return;\n }\n\n if (e.name !== 'touchstart' && typeof window !== 'undefined' && window.event && !window.event.buttons && !window.event.button) {\n return;\n }\n\n if (!this.shouldBegin.call(this, e)) {\n return;\n }\n\n if (self.keydown) return;\n var target = e.target;\n var targetIsCanvas = target && target.isCanvas && target.isCanvas();\n if (!this.allowDragOnItem && !targetIsCanvas) return;\n self.origin = {\n x: e.clientX,\n y: e.clientY\n };\n self.dragging = false;\n\n if (this.enableOptimize) {\n // 拖动 canvas 过程中隐藏所有的边及label\n var graph = this.graph;\n var edges = graph.getEdges();\n\n for (var i = 0, len = edges.length; i < len; i++) {\n var shapes = edges[i].get('group').get('children');\n if (!shapes) continue;\n shapes.forEach(function (shape) {\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n });\n }\n\n var nodes = graph.getNodes();\n\n for (var j = 0, nodeLen = nodes.length; j < nodeLen; j++) {\n var container = nodes[j].getContainer();\n var children = container.get('children');\n\n for (var _i = 0, children_1 = children; _i < children_1.length; _i++) {\n var child = children_1[_i];\n var isKeyShape = child.get('isKeyShape');\n\n if (!isKeyShape) {\n child.set('ori-visibility', child.get('ori-visibility') || child.get('visible'));\n child.hide();\n }\n }\n }\n }\n },\n onTouchMove: function onTouchMove(e) {\n var self = this;\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1]; // 如果是双指操作,不允许拖拽画布,结束拖拽\n\n if (event1 && event2) {\n this.onMouseUp(e);\n return;\n }\n\n e.preventDefault();\n self.onMouseMove(e);\n },\n onMouseMove: function onMouseMove(e) {\n var graph = this.graph;\n if (this.keydown) return;\n var target = e.target;\n var targetIsCanvas = target && target.isCanvas && target.isCanvas();\n if (!this.allowDragOnItem && !targetIsCanvas) return;\n e = cloneEvent(e);\n\n if (!this.origin) {\n return;\n }\n\n if (!this.dragging) {\n if (abs(this.origin.x - e.clientX) + abs(this.origin.y - e.clientY) < DRAG_OFFSET) {\n return;\n }\n\n if (this.shouldBegin.call(this, e)) {\n e.type = 'dragstart';\n graph.emit('canvas:dragstart', e);\n this.originPosition = {\n x: e.clientX,\n y: e.clientY\n };\n this.dragging = true;\n }\n } else {\n e.type = 'drag';\n graph.emit('canvas:drag', e);\n }\n\n if (this.shouldUpdate.call(this, e)) {\n this.updateViewport(e);\n }\n },\n onMouseUp: function onMouseUp(e) {\n var _a, _b;\n\n var graph = this.graph;\n if (this.keydown) return;\n var currentZoom = graph.getZoom();\n var modeController = graph.get('modeController');\n var zoomCanvas = (_b = (_a = modeController === null || modeController === void 0 ? void 0 : modeController.modes[modeController.mode]) === null || _a === void 0 ? void 0 : _a.filter(function (behavior) {\n return behavior.type === 'zoom-canvas';\n })) === null || _b === void 0 ? void 0 : _b[0];\n var optimizeZoom = zoomCanvas ? zoomCanvas.optimizeZoom || 0.1 : 0;\n\n if (this.enableOptimize) {\n // 拖动结束后显示所有的边\n var edges = graph.getEdges();\n\n for (var i = 0, len = edges.length; i < len; i++) {\n var shapes = edges[i].get('group').get('children');\n if (!shapes) continue;\n shapes.forEach(function (shape) {\n var oriVis = shape.get('ori-visibility');\n shape.set('ori-visibility', undefined);\n if (oriVis) shape.show();\n });\n }\n\n if (currentZoom > optimizeZoom) {\n var nodes = graph.getNodes();\n\n for (var j = 0, nodeLen = nodes.length; j < nodeLen; j++) {\n var container = nodes[j].getContainer();\n var children = container.get('children');\n\n for (var _i = 0, children_2 = children; _i < children_2.length; _i++) {\n var child = children_2[_i];\n var isKeyShape = child.get('isKeyShape');\n\n if (!isKeyShape) {\n var oriVis = child.get('ori-visibility');\n child.set('ori-visibility', undefined);\n if (oriVis) child.show();\n }\n }\n }\n }\n }\n\n if (!this.dragging) {\n this.origin = null;\n return;\n }\n\n e = cloneEvent(e);\n\n if (this.shouldEnd.call(this, e)) {\n this.updateViewport(e);\n }\n\n e.type = 'dragend';\n e.dx = e.clientX - this.originPosition.x;\n e.dy = e.clientY - this.originPosition.y;\n graph.emit('canvas:dragend', e);\n this.endDrag();\n },\n endDrag: function endDrag() {\n this.origin = null;\n this.dragging = false;\n this.dragbegin = false;\n },\n onKeyDown: function onKeyDown(e) {\n var self = this;\n var code = e.key;\n\n if (!code) {\n return;\n }\n\n if (ALLOW_EVENTS.indexOf(code.toLowerCase()) > -1) {\n self.keydown = true;\n } else {\n self.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n this.keydown = false;\n this.origin = null;\n this.dragging = false;\n this.dragbegin = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/drag-canvas.js?"); +eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar greedy_fas_1 = __importDefault(__webpack_require__(/*! ./greedy-fas */ \"./node_modules/@antv/layout/lib/layout/dagre/src/greedy-fas.js\"));\nvar run = function (g) {\n var weightFn = function (g) {\n return function (e) { var _a; return ((_a = g.edge(e)) === null || _a === void 0 ? void 0 : _a.weight) || 1; };\n };\n var fas = g.graph().acyclicer === \"greedy\" ? (0, greedy_fas_1.default)(g, weightFn(g)) : dfsFAS(g);\n fas === null || fas === void 0 ? void 0 : fas.forEach(function (e) {\n var label = g.edge(e);\n g.removeEdgeObj(e);\n label.forwardName = e.name;\n label.reversed = true;\n g.setEdge(e.w, e.v, label, \"rev-\".concat(Math.random()));\n });\n};\nvar dfsFAS = function (g) {\n var fas = [];\n var stack = {};\n var visited = {};\n var dfs = function (v) {\n var _a;\n if (visited[v]) {\n return;\n }\n visited[v] = true;\n stack[v] = true;\n (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n if (stack[e.w]) {\n fas.push(e);\n }\n else {\n dfs(e.w);\n }\n });\n delete stack[v];\n };\n g.nodes().forEach(dfs);\n return fas;\n};\nvar undo = function (g) {\n g.edges().forEach(function (e) {\n var label = g.edge(e);\n if (label.reversed) {\n g.removeEdgeObj(e);\n var forwardName = label.forwardName;\n delete label.reversed;\n delete label.forwardName;\n g.setEdge(e.w, e.v, label, forwardName);\n }\n });\n};\nexports.default = { run: run, undo: undo };\n//# sourceMappingURL=acyclic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/acyclic.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/drag-combo.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/drag-combo.js ***! - \************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/add-border-segments.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/add-border-segments.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-pc/es/global.js\");\n\n/*\n * @Author: moyee\n * @LastEditors: moyee\n * @Description: 拖动 Combo\n */\n\n\n\n\nvar calculationItemsBBox = _util__WEBPACK_IMPORTED_MODULE_2__[\"default\"].calculationItemsBBox;\n/**\n * 遍历拖动的 Combo 下的所有 Combo\n * @param data 拖动的 Combo\n * @param fn\n */\n\nvar traverseCombo = function traverseCombo(data, fn) {\n if (fn(data) === false) {\n return;\n }\n\n if (data) {\n var combos = data.get('combos');\n\n if (combos.length === 0) {\n return false;\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(combos, function (child) {\n traverseCombo(child, fn);\n });\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n enableDelegate: false,\n delegateStyle: {},\n // 拖动节点过程中是否只改变 Combo 的大小,而不改变其结构\n onlyChangeComboSize: false,\n // 拖动过程中目标 combo 状态样式\n activeState: '',\n selectedState: 'selected',\n enableStack: true\n };\n },\n getEvents: function getEvents() {\n return {\n 'combo:dragstart': 'onDragStart',\n 'combo:drag': 'onDrag',\n 'combo:dragend': 'onDragEnd',\n 'combo:drop': 'onDrop',\n 'node:drop': 'onNodeDrop',\n 'combo:dragenter': 'onDragEnter',\n 'combo:dragleave': 'onDragLeave'\n };\n },\n validationCombo: function validationCombo(evt) {\n var item = evt.item;\n\n if (!item || item.destroyed) {\n return false;\n }\n\n if (!this.shouldUpdate.call(this, evt)) {\n return false;\n }\n\n var type = item.getType();\n\n if (type !== 'combo') {\n return false;\n }\n\n return true;\n },\n onDragStart: function onDragStart(evt) {\n var _this = this;\n\n var graph = this.graph;\n var item = evt.item;\n this.currentShouldEnd = true;\n if (!this.validationCombo(evt)) return;\n this.targets = []; // 获取所有选中的 Combo\n\n var combos = graph.findAllByState('combo', this.selectedState);\n var currentCombo = item.get('id');\n var dragCombos = combos.filter(function (combo) {\n var comboId = combo.get('id');\n return currentCombo === comboId;\n });\n\n if (dragCombos.length === 0) {\n this.targets.push(item);\n } else {\n this.targets = combos;\n }\n\n var beforeDragItems = [];\n this.targets.forEach(function (t) {\n var _a = t.getModel(),\n x = _a.x,\n y = _a.y,\n id = _a.id;\n\n beforeDragItems.push({\n x: x,\n y: y,\n id: id\n });\n });\n this.set('beforeDragItems', beforeDragItems);\n\n if (this.activeState) {\n this.targets.map(function (combo) {\n var model = combo.getModel();\n\n if (model.parentId) {\n var parentCombo = graph.findById(model.parentId);\n\n if (parentCombo) {\n graph.setItemState(parentCombo, _this.activeState, true);\n }\n }\n });\n }\n\n this.point = {};\n this.originPoint = {};\n this.origin = {\n x: evt.x,\n y: evt.y\n };\n this.currentItemChildCombos = [];\n traverseCombo(item, function (param) {\n if (param.destroyed) {\n return false;\n }\n\n var model = param.getModel();\n\n _this.currentItemChildCombos.push(model.id);\n\n return true;\n });\n },\n onDrag: function onDrag(evt) {\n var _this = this;\n\n if (!this.origin) {\n return;\n }\n\n if (!this.validationCombo(evt)) return;\n\n if (this.enableDelegate) {\n this.updateDelegate(evt);\n } else {\n if (this.activeState) {\n var graph_1 = this.graph;\n var item = evt.item;\n var model_1 = item.getModel(); // 拖动过程中实时计算距离\n\n var combos = graph_1.getCombos();\n var sourceBBox = item.getBBox();\n var centerX_1 = sourceBBox.centerX,\n centerY_1 = sourceBBox.centerY,\n width_1 = sourceBBox.width; // 参与计算的 Combo,需要排除掉:\n // 1、拖动 combo 自己\n // 2、拖动 combo 的 parent\n // 3、拖动 Combo 的 children\n\n var calcCombos = combos.filter(function (combo) {\n var cmodel = combo.getModel(); // 被拖动的是最外层的 Combo,无 parent,排除自身和子元素\n\n if (!model_1.parentId) {\n return cmodel.id !== model_1.id && !_this.currentItemChildCombos.includes(cmodel.id);\n }\n\n return cmodel.id !== model_1.id && !_this.currentItemChildCombos.includes(cmodel.id);\n });\n calcCombos.map(function (combo) {\n var _a = combo.getBBox(),\n cx = _a.centerX,\n cy = _a.centerY,\n w = _a.width; // 拖动的 combo 和要进入的 combo 之间的距离\n\n\n var disX = centerX_1 - cx;\n var disY = centerY_1 - cy; // 圆心距离\n\n var distance = 2 * Math.sqrt(disX * disX + disY * disY);\n\n if (width_1 + w - distance > 0.8 * width_1) {\n graph_1.setItemState(combo, _this.activeState, true);\n } else {\n graph_1.setItemState(combo, _this.activeState, false);\n }\n });\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(this.targets, function (item) {\n _this.updateCombo(item, evt);\n });\n }\n },\n updatePositions: function updatePositions(evt, restore) {\n var _this = this; // 当启用 delegate 时,拖动结束时需要更新 combo\n\n\n if (this.enableDelegate || restore) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(this.targets, function (item) {\n _this.updateCombo(item, evt, restore);\n });\n }\n },\n onDrop: function onDrop(evt) {\n var _this = this; // 被放下的目标 combo\n\n\n var item = evt.item;\n this.currentShouldEnd = this.shouldEnd.call(this, evt, item);\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.currentShouldEnd || !item || !this.targets || item.destroyed) return;\n var graph = this.graph;\n var targetModel = item.getModel();\n this.targets.map(function (combo) {\n var model = combo.getModel();\n\n if (model.parentId !== targetModel.id) {\n if (_this.activeState) {\n graph.setItemState(item, _this.activeState, false);\n } // 将 Combo 放置到某个 Combo 上面时,只有当 onlyChangeComboSize 为 false 时候才更新 Combo 结构\n\n\n if (!_this.onlyChangeComboSize) {\n graph.updateComboTree(combo, targetModel.id, false);\n } else {\n graph.updateCombo(combo);\n }\n } else {\n graph.updateCombo(item);\n }\n });\n this.end(item, evt); // 如果已经拖放下了,则不需要再通过距离判断了\n\n this.endComparison = true;\n },\n onNodeDrop: function onNodeDrop(evt) {\n var _this = this;\n\n if (!this.targets || this.targets.length === 0) return;\n var graph = this.graph;\n var item = evt.item;\n var comboId = item.getModel().comboId;\n var newParentCombo = comboId ? graph.findById(comboId) : undefined;\n this.currentShouldEnd = this.shouldEnd.call(this, evt, newParentCombo);\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.currentShouldEnd) return;\n var droppedCombo; // 如果被放置的的节点有 comboId,且这个 comboId 与正在被拖拽的 combo 的父 id 不相同,则更新父亲为 comboId\n\n if (comboId) {\n if (this.activeState) {\n var combo = graph.findById(comboId);\n graph.setItemState(combo, this.activeState, false);\n }\n\n this.targets.map(function (combo) {\n if (!_this.onlyChangeComboSize) {\n if (comboId !== combo.getID()) {\n droppedCombo = graph.findById(comboId);\n if (comboId !== combo.getModel().parentId) graph.updateComboTree(combo, comboId, false);\n }\n } else {\n graph.updateCombo(combo);\n }\n });\n } else {\n // 如果被放置的节点没有 comboId,且正在被拖拽的 combo 有父 id,则更新父亲为 undefined\n this.targets.map(function (combo) {\n if (!_this.onlyChangeComboSize) {\n var model = combo.getModel();\n\n if (model.comboId) {\n graph.updateComboTree(combo, undefined, false);\n }\n } else {\n graph.updateCombo(combo);\n }\n });\n } // 如果已经拖放下了,则不需要再通过距离判断了\n\n\n this.endComparison = true;\n this.end(droppedCombo, evt);\n },\n onDragEnter: function onDragEnter(evt) {\n if (!this.origin) {\n return;\n }\n\n if (!this.validationCombo(evt)) return;\n var item = evt.item;\n var graph = this.graph;\n\n if (this.activeState) {\n graph.setItemState(item, this.activeState, true);\n }\n },\n onDragLeave: function onDragLeave(evt) {\n if (!this.origin) {\n return;\n }\n\n if (!this.validationCombo(evt)) return;\n var item = evt.item;\n var graph = this.graph;\n\n if (this.activeState) {\n graph.setItemState(item, this.activeState, false);\n }\n },\n onDragEnd: function onDragEnd(evt) {\n if (!this.targets || this.targets.length === 0) return;\n var item = evt.item;\n\n if (this.currentShouldEnd) {\n this.updatePositions(evt);\n }\n\n var parentCombo = this.getParentCombo(item.getModel().parentId);\n var graph = this.graph;\n\n if (parentCombo && this.activeState) {\n graph.setItemState(parentCombo, this.activeState, false);\n }\n\n this.end(undefined, evt);\n },\n end: function end(comboDropedOn, evt) {\n var _this = this;\n\n if (!this.origin) return;\n var graph = this.graph; // 删除delegate shape\n\n if (this.delegateShape) {\n var delegateGroup = graph.get('delegateGroup');\n delegateGroup.clear();\n this.delegateShape = null;\n }\n\n if (comboDropedOn && this.activeState) {\n graph.setItemState(comboDropedOn, this.activeState, false);\n } // 若没有被放置的 combo,则是被放置在画布上\n\n\n if (!comboDropedOn) {\n var stack_1 = graph.get('enabledStack') && this.enableStack;\n var stackData_1 = {\n before: {\n nodes: [],\n edges: [],\n combos: [].concat(this.get('beforeDragItems'))\n },\n after: {\n nodes: [],\n edges: [],\n combos: []\n }\n };\n this.targets.map(function (combo) {\n // 将 Combo 放置到某个 Combo 上面时,只有当 onlyChangeComboSize 为 false 时候才更新 Combo 结构\n if (!_this.onlyChangeComboSize) {\n graph.updateComboTree(combo, undefined, stack_1);\n } else {\n graph.updateCombo(combo);\n\n var _a = combo.getModel(),\n x = _a.x,\n y = _a.y,\n id = _a.id;\n\n stackData_1.after.combos.push({\n x: x,\n y: y,\n id: id\n });\n graph.pushStack('update', stackData_1);\n }\n });\n }\n\n this.point = [];\n this.origin = null;\n this.originPoint = null;\n this.targets.length = 0;\n },\n\n /**\n * 遍历 comboTree,分别更新 node 和 combo\n * @param data\n * @param fn\n */\n traverse: function traverse(data, fn, edgesToBeUpdate) {\n var _this = this;\n\n if (edgesToBeUpdate === void 0) {\n edgesToBeUpdate = {};\n }\n\n if (fn(data, edgesToBeUpdate) === false) {\n return;\n }\n\n if (data) {\n var combos = data.get('combos');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(combos, function (child) {\n _this.traverse(child, fn, edgesToBeUpdate);\n });\n var nodes = data.get('nodes');\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(nodes, function (child) {\n _this.traverse(child, fn, edgesToBeUpdate);\n });\n }\n },\n updateCombo: function updateCombo(item, evt, restore) {\n this.updateSingleItem(item, evt, restore);\n var edgesToBeUpdate = {};\n this.traverse(item, function (paramItem, paramEdgesMap) {\n if (paramItem.destroyed) {\n return false;\n }\n\n paramItem.getEdges().forEach(function (edge) {\n return paramEdgesMap[edge.getID()] = edge;\n });\n return true;\n }, edgesToBeUpdate);\n Object.values(edgesToBeUpdate).forEach(function (edge) {\n return edge.refresh();\n });\n },\n\n /**\n *\n * @param item 当前正在拖动的元素\n * @param evt\n */\n updateSingleItem: function updateSingleItem(item, evt, restore) {\n var origin = this.origin;\n var graph = this.graph;\n var model = item.getModel();\n var itemId = item.get('id');\n\n if (!this.point[itemId]) {\n this.point[itemId] = {\n x: model.x,\n y: model.y\n };\n }\n\n var x = evt.x - origin.x + this.point[itemId].x;\n var y = evt.y - origin.y + this.point[itemId].y;\n\n if (restore) {\n x += origin.x - evt.x;\n y += origin.y - evt.y;\n }\n\n graph.updateItem(item, {\n x: x,\n y: y\n }, false); // item.getEdges()?.forEach(edge => edge.refresh());\n },\n\n /**\n * 根据 ID 获取父 Combo\n * @param parentId 父 Combo ID\n */\n getParentCombo: function getParentCombo(parentId) {\n var graph = this.graph;\n\n if (!parentId) {\n return undefined;\n }\n\n var parentCombo = graph.findById(parentId);\n\n if (!parentCombo) {\n return undefined;\n }\n\n return parentCombo;\n },\n updateDelegate: function updateDelegate(evt) {\n var graph = this.graph; // 当没有 delegate shape 时创建\n\n if (!this.delegateShape) {\n var delegateGroup = graph.get('delegateGroup');\n var bbox = null;\n\n if (this.targets.length > 1) {\n bbox = calculationItemsBBox(this.targets);\n } else {\n bbox = this.targets[0].getBBox();\n }\n\n var x = bbox.x,\n y = bbox.y,\n width = bbox.width,\n height = bbox.height,\n minX = bbox.minX,\n minY = bbox.minY;\n this.originPoint = {\n x: x,\n y: y,\n width: width,\n height: height,\n minX: minX,\n minY: minY\n };\n\n var attrs = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _global__WEBPACK_IMPORTED_MODULE_3__[\"default\"].delegateStyle), this.delegateStyle);\n\n this.delegateShape = delegateGroup.addShape('rect', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n width: bbox.width,\n height: bbox.height,\n x: bbox.x,\n y: bbox.y\n }, attrs),\n name: 'combo-delegate-shape'\n });\n this.delegateShape.set('capture', false);\n this.delegate = this.delegateShape;\n } else {\n var clientX = evt.x - this.origin.x + this.originPoint.minX;\n var clientY = evt.y - this.origin.y + this.originPoint.minY;\n this.delegateShape.attr({\n x: clientX,\n y: clientY\n });\n }\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/drag-combo.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar addBorderSegments = function (g) {\n var _a;\n var dfs = function (v) {\n var children = g.children(v);\n var node = g.node(v);\n if (children === null || children === void 0 ? void 0 : children.length) {\n children.forEach(function (child) { return dfs(child); });\n }\n if (node.hasOwnProperty(\"minRank\")) {\n node.borderLeft = [];\n node.borderRight = [];\n for (var rank = node.minRank, maxRank = node.maxRank + 1; rank < maxRank; rank += 1) {\n addBorderNode(g, \"borderLeft\", \"_bl\", v, node, rank);\n addBorderNode(g, \"borderRight\", \"_br\", v, node, rank);\n }\n }\n };\n (_a = g.children()) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { return dfs(child); });\n};\nvar addBorderNode = function (g, prop, prefix, sg, sgNode, rank) {\n var label = { rank: rank, borderType: prop, width: 0, height: 0 };\n var prev = sgNode[prop][rank - 1];\n var curr = (0, util_1.addDummyNode)(g, \"border\", label, prefix);\n sgNode[prop][rank] = curr;\n g.setParent(curr, sg);\n if (prev) {\n g.setEdge(prev, curr, { weight: 1 });\n }\n};\nexports.default = addBorderSegments;\n//# sourceMappingURL=add-border-segments.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/add-border-segments.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/drag-node.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/drag-node.js ***! - \***********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/coordinate-system.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/coordinate-system.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-pc/es/global.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n updateEdge: true,\n delegateStyle: {},\n // 是否开启delegate\n enableDelegate: false,\n // 拖动节点过程中是否只改变 Combo 的大小,而不改变其结构\n onlyChangeComboSize: false,\n // 拖动过程中目标 combo 状态样式\n comboActiveState: '',\n selectedState: 'selected',\n enableOptimize: false,\n enableDebounce: false,\n enableStack: true\n };\n },\n getEvents: function getEvents() {\n return {\n 'node:dragstart': 'onDragStart',\n 'node:drag': 'onDrag',\n 'node:dragend': 'onDragEnd',\n 'combo:dragenter': 'onDragEnter',\n 'combo:dragleave': 'onDragLeave',\n 'combo:drop': 'onDropCombo',\n 'node:drop': 'onDropNode',\n 'canvas:drop': 'onDropCanvas',\n 'touchstart': 'onTouchStart',\n 'touchmove': 'onTouchMove',\n 'touchend': 'onDragEnd'\n };\n },\n validationCombo: function validationCombo(item) {\n if (!this.origin || !item || item.destroyed) {\n return false;\n }\n\n var type = item.getType();\n\n if (type !== 'combo') {\n return false;\n }\n\n return true;\n },\n onTouchStart: function onTouchStart(e) {\n if (!e.item) return;\n var self = this;\n\n try {\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n\n if (event1 && event2) {\n return;\n }\n\n e.preventDefault();\n } catch (e) {\n console.warn('Touch original event not exist!');\n }\n\n self.onDragStart(e);\n },\n onTouchMove: function onTouchMove(e) {\n var self = this;\n\n try {\n var touches = e.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n\n if (event1 && event2) {\n self.onDragEnd(e);\n return;\n }\n\n e.preventDefault();\n } catch (e) {\n console.warn('Touch original event not exist!');\n }\n\n self.onDrag(e);\n },\n\n /**\n * 开始拖动节点\n * @param evt\n */\n onDragStart: function onDragStart(evt) {\n var _this = this;\n\n this.currentShouldEnd = true;\n\n if (!this.shouldBegin.call(this, evt)) {\n return;\n }\n\n var item = evt.item;\n\n if (!item || item.destroyed || item.hasLocked()) {\n return;\n } // 拖动时,设置拖动元素的 capture 为false,则不拾取拖动的元素\n\n\n var group = item.getContainer();\n group.set('capture', false);\n if (!this.cachedCaptureItems) this.cachedCaptureItems = [];\n this.cachedCaptureItems.push(item); // 如果拖动的target 是linkPoints / anchorPoints 则不允许拖动\n\n var target = evt.target;\n\n if (target) {\n var isAnchorPoint = target.get('isAnchorPoint');\n\n if (isAnchorPoint) {\n return;\n }\n }\n\n var graph = this.graph;\n this.targets = []; // 将节点拖入到指定的 Combo\n\n this.targetCombo = null; // 获取所有选中的元素\n\n var nodes = graph.findAllByState('node', this.selectedState);\n var currentNodeId = item.get('id'); // 当前拖动的节点是否是选中的节点\n\n var dragNodes = nodes.filter(function (node) {\n var nodeId = node.get('id');\n return currentNodeId === nodeId;\n }); // 只拖动当前节点\n\n if (dragNodes.length === 0) {\n this.targets.push(item);\n } else if (nodes.length > 1) {\n // 拖动多个节点\n nodes.forEach(function (node) {\n var locked = node.hasLocked();\n\n if (!locked) {\n _this.targets.push(node);\n }\n });\n } else {\n this.targets.push(item);\n }\n\n var beforeDragNodes = [];\n this.targets.forEach(function (t) {\n var _a = t.getModel(),\n x = _a.x,\n y = _a.y,\n id = _a.id;\n\n beforeDragNodes.push({\n x: x,\n y: y,\n id: id\n });\n });\n this.set('beforeDragNodes', beforeDragNodes);\n this.hidenEdge = {};\n\n if (this.get('updateEdge') && this.enableOptimize && !this.enableDelegate) {\n this.targets.forEach(function (node) {\n var edges = node.getEdges();\n edges.forEach(function (edge) {\n if (!edge.isVisible()) return;\n _this.hidenEdge[edge.getID()] = true;\n edge.hide();\n });\n });\n }\n\n this.origin = {\n x: evt.x,\n y: evt.y\n };\n this.point = {};\n this.originPoint = {};\n },\n\n /**\n * 持续拖动节点\n * @param evt\n */\n onDrag: function onDrag(evt) {\n var _this = this;\n\n if (!this.origin) {\n return;\n }\n\n if (!this.shouldUpdate.call(this, evt)) {\n return;\n }\n\n if (this.get('enableDelegate')) {\n this.updateDelegate(evt);\n } else {\n if (this.enableDebounce) this.debounceUpdate({\n targets: this.targets,\n graph: this.graph,\n point: this.point,\n origin: this.origin,\n evt: evt,\n updateEdge: this.get('updateEdge')\n });else this.targets.map(function (target) {\n _this.update(target, evt);\n });\n }\n },\n\n /**\n * 拖动结束,设置拖动元素capture为true,更新元素位置,如果是拖动涉及到 combo,则更新 combo 结构\n * @param evt\n */\n onDragEnd: function onDragEnd(evt) {\n var _this = this;\n\n var _a;\n\n if (!this.origin) {\n return;\n } // 拖动结束后,设置拖动元素 group 的 capture 为 true,允许拾取拖动元素\n\n\n (_a = this.cachedCaptureItems) === null || _a === void 0 ? void 0 : _a.forEach(function (item) {\n var group = item.getContainer();\n group.set('capture', true);\n });\n this.cachedCaptureItems = [];\n\n if (this.delegateRect) {\n this.delegateRect.remove();\n this.delegateRect = null;\n }\n\n if (this.get('updateEdge') && this.enableOptimize && !this.enableDelegate) {\n this.targets.forEach(function (node) {\n var edges = node.getEdges();\n edges.forEach(function (edge) {\n if (_this.hidenEdge[edge.getID()]) edge.show();\n edge.refresh();\n });\n });\n }\n\n this.hidenEdge = {};\n var graph = this.graph; // 拖动结束后,入栈\n\n if (graph.get('enabledStack') && this.enableStack) {\n var stackData_1 = {\n before: {\n nodes: [],\n edges: [],\n combos: []\n },\n after: {\n nodes: [],\n edges: [],\n combos: []\n }\n };\n this.get('beforeDragNodes').forEach(function (model) {\n stackData_1.before.nodes.push(model);\n });\n this.targets.forEach(function (target) {\n var _a = target.getModel(),\n x = _a.x,\n y = _a.y,\n id = _a.id;\n\n stackData_1.after.nodes.push({\n x: x,\n y: y,\n id: id\n });\n });\n graph.pushStack('update', Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(stackData_1));\n } // 拖动结束后emit事件,将当前操作的节点抛出去,目标节点为null\n\n\n graph.emit('dragnodeend', {\n items: this.targets,\n targetItem: null\n });\n this.point = {};\n this.origin = null;\n this.originPoint = {};\n this.targets.length = 0;\n this.targetCombo = null;\n },\n\n /**\n * 拖动过程中将节点放置到 combo 上\n * @param evt\n */\n onDropCombo: function onDropCombo(evt) {\n var item = evt.item;\n this.currentShouldEnd = this.shouldEnd.call(this, evt, item); // 若不允许结束,则将节点位置设置回初识位置。后面的逻辑仍需要执行\n\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.currentShouldEnd || !this.validationCombo(item)) return;\n var graph = this.graph;\n\n if (this.comboActiveState) {\n graph.setItemState(item, this.comboActiveState, false);\n }\n\n this.targetCombo = item; // 拖动结束后是动态改变 Combo 大小还是将节点从 Combo 中删除\n\n if (this.onlyChangeComboSize) {\n // 拖动节点结束后,动态改变 Combo 的大小\n graph.updateCombos();\n } else {\n var targetComboModel_1 = item.getModel();\n this.targets.map(function (node) {\n var nodeModel = node.getModel();\n\n if (nodeModel.comboId !== targetComboModel_1.id) {\n graph.updateComboTree(node, targetComboModel_1.id);\n }\n });\n graph.updateCombo(item);\n } // 将节点拖动到 combo 上面,emit事件抛出当前操作的节点及目标 combo\n\n\n graph.emit('dragnodeend', {\n items: this.targets,\n targetItem: this.targetCombo\n });\n },\n onDropCanvas: function onDropCanvas(evt) {\n var graph = this.graph;\n this.currentShouldEnd = this.shouldEnd.call(this, evt, undefined); // 若不允许结束,则将节点位置设置回初识位置。后面的逻辑仍需要执行\n\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.targets || this.targets.length === 0 || !this.currentShouldEnd) return;\n\n if (this.onlyChangeComboSize) {\n // 拖动节点结束后,动态改变 Combo 的大小\n graph.updateCombos();\n } else {\n this.targets.map(function (node) {\n // 拖动的节点有 comboId,即是从其他 combo 中拖出时才处理\n var model = node.getModel();\n\n if (model.comboId) {\n graph.updateComboTree(node);\n }\n });\n }\n },\n\n /**\n * 拖动放置到某个 combo 中的子 node 上\n * @param evt\n */\n onDropNode: function onDropNode(evt) {\n if (!this.targets || this.targets.length === 0) return;\n var self = this;\n var item = evt.item;\n var graph = self.graph;\n var comboId = item.getModel().comboId;\n var newParentCombo = comboId ? graph.findById(comboId) : undefined;\n this.currentShouldEnd = this.shouldEnd.call(this, evt, newParentCombo); // 若不允许结束,则将节点位置设置回初识位置。后面的逻辑仍需要执行\n\n this.updatePositions(evt, !this.currentShouldEnd);\n if (!this.currentShouldEnd) return;\n\n if (this.onlyChangeComboSize) {\n graph.updateCombos();\n } else if (comboId) {\n var combo = graph.findById(comboId);\n\n if (self.comboActiveState) {\n graph.setItemState(combo, self.comboActiveState, false);\n }\n\n this.targets.map(function (node) {\n var nodeModel = node.getModel();\n\n if (comboId !== nodeModel.comboId) {\n graph.updateComboTree(node, comboId);\n }\n });\n graph.updateCombo(combo);\n } else {\n this.targets.map(function (node) {\n var model = node.getModel();\n\n if (model.comboId) {\n graph.updateComboTree(node);\n }\n });\n } // 将节点拖动到另外个节点上面,emit 事件抛出当前操作的节点及目标节点\n\n\n graph.emit('dragnodeend', {\n items: this.targets,\n targetItem: item\n });\n },\n\n /**\n * 将节点拖入到 Combo 中\n * @param evt\n */\n onDragEnter: function onDragEnter(evt) {\n var item = evt.item;\n if (!this.validationCombo(item)) return;\n var graph = this.graph;\n\n if (this.comboActiveState) {\n graph.setItemState(item, this.comboActiveState, true);\n }\n },\n\n /**\n * 将节点从 Combo 中拖出\n * @param evt\n */\n onDragLeave: function onDragLeave(evt) {\n var item = evt.item;\n if (!this.validationCombo(item)) return;\n var graph = this.graph;\n\n if (this.comboActiveState) {\n graph.setItemState(item, this.comboActiveState, false);\n }\n },\n updatePositions: function updatePositions(evt, restore) {\n var _this = this;\n\n if (!this.targets || this.targets.length === 0) return; // 当开启 delegate 时,拖动结束后需要更新所有已选中节点的位置\n\n if (this.get('enableDelegate')) {\n if (this.enableDebounce) this.debounceUpdate({\n targets: this.targets,\n graph: this.graph,\n point: this.point,\n origin: this.origin,\n evt: evt,\n updateEdge: this.get('updateEdge'),\n updateFunc: this.update\n });else if (!restore) this.targets.map(function (node) {\n return _this.update(node, evt);\n });\n } else this.targets.map(function (node) {\n return _this.update(node, evt, restore);\n });\n },\n\n /**\n * 更新节点\n * @param item 拖动的节点实例\n * @param evt\n */\n update: function update(item, evt, restore) {\n var origin = this.origin;\n var model = item.get('model');\n var nodeId = item.get('id');\n\n if (!this.point[nodeId]) {\n this.point[nodeId] = {\n x: model.x || 0,\n y: model.y || 0\n };\n }\n\n var x = evt.x - origin.x + this.point[nodeId].x;\n var y = evt.y - origin.y + this.point[nodeId].y;\n\n if (restore) {\n x += origin.x - evt.x;\n y += origin.y - evt.y;\n }\n\n var pos = {\n x: x,\n y: y\n };\n\n if (this.get('updateEdge')) {\n this.graph.updateItem(item, pos, false);\n } else {\n item.updatePosition(pos);\n }\n },\n\n /**\n * 限流更新节点\n * @param item 拖动的节点实例\n * @param evt\n */\n debounceUpdate: Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"debounce\"])(function (event) {\n var targets = event.targets,\n graph = event.graph,\n point = event.point,\n origin = event.origin,\n evt = event.evt,\n updateEdge = event.updateEdge,\n updateFunc = event.updateFunc;\n targets.map(function (item) {\n var model = item.get('model');\n var nodeId = item.get('id');\n\n if (!point[nodeId]) {\n point[nodeId] = {\n x: model.x || 0,\n y: model.y || 0\n };\n }\n\n var x = evt.x - origin.x + point[nodeId].x;\n var y = evt.y - origin.y + point[nodeId].y;\n var pos = {\n x: x,\n y: y\n };\n\n if (updateEdge) {\n graph.updateItem(item, pos, false);\n } else {\n item.updatePosition(pos);\n }\n });\n }, 50, true),\n\n /**\n * 更新拖动元素时的delegate\n * @param {Event} e 事件句柄\n * @param {number} x 拖动单个元素时候的x坐标\n * @param {number} y 拖动单个元素时候的y坐标\n */\n updateDelegate: function updateDelegate(e) {\n var graph = this.graph;\n\n if (!this.delegateRect) {\n // 拖动多个\n var parent_1 = graph.get('group');\n var attrs = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"deepMix\"])({}, _global__WEBPACK_IMPORTED_MODULE_2__[\"default\"].delegateStyle, this.delegateStyle);\n\n var _a = this.calculationGroupPosition(e),\n cx = _a.x,\n cy = _a.y,\n width = _a.width,\n height = _a.height,\n minX = _a.minX,\n minY = _a.minY;\n\n this.originPoint = {\n x: cx,\n y: cy,\n width: width,\n height: height,\n minX: minX,\n minY: minY\n }; // model上的x, y是相对于图形中心的,delegateShape是g实例,x,y是绝对坐标\n\n this.delegateRect = parent_1.addShape('rect', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n width: width,\n height: height,\n x: cx,\n y: cy\n }, attrs),\n name: 'rect-delegate-shape'\n });\n this.delegate = this.delegateRect;\n this.delegateRect.set('capture', false);\n } else {\n var clientX = e.x - this.origin.x + this.originPoint.minX;\n var clientY = e.y - this.origin.y + this.originPoint.minY;\n this.delegateRect.attr({\n x: clientX,\n y: clientY\n });\n }\n },\n\n /**\n * 计算delegate位置,包括左上角左边及宽度和高度\n * @memberof ItemGroup\n * @return {object} 计算出来的delegate坐标信息及宽高\n */\n calculationGroupPosition: function calculationGroupPosition(evt) {\n var nodes = this.targets;\n\n if (nodes.length === 0) {\n nodes.push(evt.item);\n }\n\n var minx = Infinity;\n var maxx = -Infinity;\n var miny = Infinity;\n var maxy = -Infinity; // 获取已节点的所有最大最小x y值\n\n for (var i = 0; i < nodes.length; i++) {\n var element = nodes[i];\n var bbox = element.getBBox();\n var minX = bbox.minX,\n minY = bbox.minY,\n maxX = bbox.maxX,\n maxY = bbox.maxY;\n\n if (minX < minx) {\n minx = minX;\n }\n\n if (minY < miny) {\n miny = minY;\n }\n\n if (maxX > maxx) {\n maxx = maxX;\n }\n\n if (maxY > maxy) {\n maxy = maxY;\n }\n }\n\n var x = Math.floor(minx);\n var y = Math.floor(miny);\n var width = Math.ceil(maxx) - Math.floor(minx);\n var height = Math.ceil(maxy) - Math.floor(miny);\n return {\n x: x,\n y: y,\n width: width,\n height: height,\n minX: minx,\n minY: miny\n };\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/drag-node.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar adjust = function (g) {\n var _a;\n var rankDir = (_a = g.graph().rankdir) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n if (rankDir === \"lr\" || rankDir === \"rl\") {\n swapWidthHeight(g);\n }\n};\nvar undo = function (g) {\n var _a;\n var rankDir = (_a = g.graph().rankdir) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n if (rankDir === \"bt\" || rankDir === \"rl\") {\n reverseY(g);\n }\n if (rankDir === \"lr\" || rankDir === \"rl\") {\n swapXY(g);\n swapWidthHeight(g);\n }\n};\nvar swapWidthHeight = function (g) {\n g.nodes().forEach(function (v) {\n swapWidthHeightOne(g.node(v));\n });\n g.edges().forEach(function (e) {\n swapWidthHeightOne(g.edge(e));\n });\n};\nvar swapWidthHeightOne = function (attrs) {\n var w = attrs.width;\n attrs.width = attrs.height;\n attrs.height = w;\n};\nvar reverseY = function (g) {\n g.nodes().forEach(function (v) {\n reverseYOne(g.node(v));\n });\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n (_a = edge.points) === null || _a === void 0 ? void 0 : _a.forEach(function (point) { return reverseYOne(point); });\n if (edge.hasOwnProperty(\"y\")) {\n reverseYOne(edge);\n }\n });\n};\nvar reverseYOne = function (attrs) {\n if (attrs === null || attrs === void 0 ? void 0 : attrs.y) {\n attrs.y = -attrs.y;\n }\n};\nvar swapXY = function (g) {\n g.nodes().forEach(function (v) {\n swapXYOne(g.node(v));\n });\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n (_a = edge.points) === null || _a === void 0 ? void 0 : _a.forEach(function (point) { return swapXYOne(point); });\n if (edge.hasOwnProperty(\"x\")) {\n swapXYOne(edge);\n }\n });\n};\nvar swapXYOne = function (attrs) {\n var x = attrs.x;\n attrs.x = attrs.y;\n attrs.y = x;\n};\nexports.default = { adjust: adjust, undo: undo };\n//# sourceMappingURL=coordinate-system.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/coordinate-system.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/edge-tooltip.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/edge-tooltip.js ***! - \**************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/data/list.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/data/list.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _tooltip_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tooltip-base */ \"./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n getDefaultCfg: function getDefaultCfg() {\n return {\n item: 'edge',\n offset: 12,\n formatText: function formatText(model) {\n return \"source: \".concat(model.source, \" target: \").concat(model.target);\n }\n };\n },\n getEvents: function getEvents() {\n return {\n 'edge:mouseenter': 'onMouseEnter',\n 'edge:mouseleave': 'onMouseLeave',\n 'edge:mousemove': 'onMouseMove',\n afterremoveitem: 'onMouseLeave'\n };\n }\n}, _tooltip_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/edge-tooltip.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar filterOutLinks = function (k, v) {\n if (k !== \"next\" && k !== \"prev\") {\n return v;\n }\n};\nvar unlink = function (entry) {\n entry.prev.next = entry.next;\n entry.next.prev = entry.prev;\n delete entry.next;\n delete entry.prev;\n};\nvar List = /** @class */ (function () {\n function List() {\n var shortcut = {};\n shortcut.prev = shortcut;\n shortcut.next = shortcut.prev;\n this.shortcut = shortcut;\n }\n List.prototype.dequeue = function () {\n var shortcut = this.shortcut;\n var entry = shortcut.prev;\n if (entry && entry !== shortcut) {\n unlink(entry);\n return entry;\n }\n };\n List.prototype.enqueue = function (entry) {\n var shortcut = this.shortcut;\n if (entry.prev && entry.next) {\n unlink(entry);\n }\n entry.next = shortcut.next;\n shortcut.next.prev = entry;\n shortcut.next = entry;\n entry.prev = shortcut;\n };\n List.prototype.toString = function () {\n var strs = [];\n var sentinel = this.shortcut;\n var curr = sentinel.prev;\n while (curr !== sentinel) {\n strs.push(JSON.stringify(curr, filterOutLinks));\n curr = curr === null || curr === void 0 ? void 0 : curr.prev;\n }\n return \"[\".concat(strs.join(\", \"), \"]\");\n };\n return List;\n}());\nexports.default = List;\n//# sourceMappingURL=list.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/data/list.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/index.js ***! - \*******************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/greedy-fas.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/greedy-fas.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _drag_canvas__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./drag-canvas */ \"./node_modules/@antv/g6-pc/es/behavior/drag-canvas.js\");\n/* harmony import */ var _drag_node__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./drag-node */ \"./node_modules/@antv/g6-pc/es/behavior/drag-node.js\");\n/* harmony import */ var _activate_relations__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./activate-relations */ \"./node_modules/@antv/g6-pc/es/behavior/activate-relations.js\");\n/* harmony import */ var _brush_select__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./brush-select */ \"./node_modules/@antv/g6-pc/es/behavior/brush-select.js\");\n/* harmony import */ var _click_select__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./click-select */ \"./node_modules/@antv/g6-pc/es/behavior/click-select.js\");\n/* harmony import */ var _zoom_canvas__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./zoom-canvas */ \"./node_modules/@antv/g6-pc/es/behavior/zoom-canvas.js\");\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./tooltip */ \"./node_modules/@antv/g6-pc/es/behavior/tooltip.js\");\n/* harmony import */ var _edge_tooltip__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./edge-tooltip */ \"./node_modules/@antv/g6-pc/es/behavior/edge-tooltip.js\");\n/* harmony import */ var _collapse_expand__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./collapse-expand */ \"./node_modules/@antv/g6-pc/es/behavior/collapse-expand.js\");\n/* harmony import */ var _drag_combo__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./drag-combo */ \"./node_modules/@antv/g6-pc/es/behavior/drag-combo.js\");\n/* harmony import */ var _collapse_expand_combo__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./collapse-expand-combo */ \"./node_modules/@antv/g6-pc/es/behavior/collapse-expand-combo.js\");\n/* harmony import */ var _lasso_select__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./lasso-select */ \"./node_modules/@antv/g6-pc/es/behavior/lasso-select.js\");\n/* harmony import */ var _create_edge__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./create-edge */ \"./node_modules/@antv/g6-pc/es/behavior/create-edge.js\");\n/* harmony import */ var _shortcuts_call__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./shortcuts-call */ \"./node_modules/@antv/g6-pc/es/behavior/shortcuts-call.js\");\n/* harmony import */ var _scroll_canvas__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./scroll-canvas */ \"./node_modules/@antv/g6-pc/es/behavior/scroll-canvas.js\");\n\n // import Behavior from './behavior';\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar behaviors = {\n 'drag-canvas': _drag_canvas__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n 'zoom-canvas': _zoom_canvas__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n 'drag-node': _drag_node__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n 'activate-relations': _activate_relations__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n 'brush-select': _brush_select__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n 'click-select': _click_select__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n 'lasso-select': _lasso_select__WEBPACK_IMPORTED_MODULE_13__[\"default\"],\n tooltip: _tooltip__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n 'edge-tooltip': _edge_tooltip__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n 'collapse-expand': _collapse_expand__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n 'drag-combo': _drag_combo__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n 'collapse-expand-combo': _collapse_expand_combo__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n 'create-edge': _create_edge__WEBPACK_IMPORTED_MODULE_14__[\"default\"],\n 'shortcuts-call': _shortcuts_call__WEBPACK_IMPORTED_MODULE_15__[\"default\"],\n 'scroll-canvas': _scroll_canvas__WEBPACK_IMPORTED_MODULE_16__[\"default\"]\n};\nObject(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(behaviors, function (behavior, type) {\n Object(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerBehavior\"])(type, behavior);\n}); // export default Behavior;\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/index.js?"); +eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar list_1 = __importDefault(__webpack_require__(/*! ./data/list */ \"./node_modules/@antv/layout/lib/layout/dagre/src/data/list.js\"));\nvar graphlib_1 = __webpack_require__(/*! @antv/graphlib */ \"./node_modules/@antv/graphlib/es/index.js\");\nvar List = /** @class */ (function (_super) {\n __extends(List, _super);\n function List() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return List;\n}(list_1.default));\nvar StateGraph = /** @class */ (function (_super) {\n __extends(StateGraph, _super);\n function StateGraph() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return StateGraph;\n}(graphlib_1.Graph));\n/*\n * A greedy heuristic for finding a feedback arc set for a graph. A feedback\n * arc set is a set of edges that can be removed to make a graph acyclic.\n * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, \"A fast and\n * effective heuristic for the feedback arc set problem.\" This implementation\n * adjusts that from the paper to allow for weighted edges.\n */\nvar DEFAULT_WEIGHT_FN = function () { return 1; };\nvar greedyFAS = function (g, weightFn) {\n var _a;\n if (g.nodeCount() <= 1)\n return [];\n var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN);\n var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx);\n return (_a = results.map(function (e) { return g.outEdges(e.v, e.w); })) === null || _a === void 0 ? void 0 : _a.flat();\n};\nvar doGreedyFAS = function (g, buckets, zeroIdx) {\n var results = [];\n var sources = buckets[buckets.length - 1];\n var sinks = buckets[0];\n var entry;\n while (g.nodeCount()) {\n while ((entry = sinks.dequeue())) {\n removeNode(g, buckets, zeroIdx, entry);\n }\n while ((entry = sources.dequeue())) {\n removeNode(g, buckets, zeroIdx, entry);\n }\n if (g.nodeCount()) {\n for (var i = buckets.length - 2; i > 0; --i) {\n entry = buckets[i].dequeue();\n if (entry) {\n results = results.concat(removeNode(g, buckets, zeroIdx, entry, true));\n break;\n }\n }\n }\n }\n return results;\n};\nvar removeNode = function (g, buckets, zeroIdx, entry, collectPredecessors) {\n var _a, _b;\n var results = [];\n (_a = g.inEdges(entry.v)) === null || _a === void 0 ? void 0 : _a.forEach(function (edge) {\n var weight = g.edge(edge);\n var uEntry = g.node(edge.v);\n if (collectPredecessors) {\n // this result not really care about in or out\n results.push({ v: edge.v, w: edge.w, in: 0, out: 0 });\n }\n if (uEntry.out === undefined)\n uEntry.out = 0;\n uEntry.out -= weight;\n assignBucket(buckets, zeroIdx, uEntry);\n });\n (_b = g.outEdges(entry.v)) === null || _b === void 0 ? void 0 : _b.forEach(function (edge) {\n var weight = g.edge(edge);\n var w = edge.w;\n var wEntry = g.node(w);\n if (wEntry.in === undefined)\n wEntry.in = 0;\n wEntry.in -= weight;\n assignBucket(buckets, zeroIdx, wEntry);\n });\n g.removeNode(entry.v);\n return collectPredecessors ? results : undefined;\n};\nvar buildState = function (g, weightFn) {\n var fasGraph = new StateGraph();\n var maxIn = 0;\n var maxOut = 0;\n g.nodes().forEach(function (v) {\n fasGraph.setNode(v, { v: v, in: 0, out: 0 });\n });\n // Aggregate weights on nodes, but also sum the weights across multi-edges\n // into a single edge for the fasGraph.\n g.edges().forEach(function (e) {\n var prevWeight = fasGraph.edge(e) || 0;\n var weight = (weightFn === null || weightFn === void 0 ? void 0 : weightFn(e)) || 1;\n var edgeWeight = prevWeight + weight;\n fasGraph.setEdge(e.v, e.w, edgeWeight);\n maxOut = Math.max(maxOut, (fasGraph.node(e.v).out += weight));\n maxIn = Math.max(maxIn, (fasGraph.node(e.w).in += weight));\n });\n var buckets = [];\n var rangeMax = maxOut + maxIn + 3;\n for (var i = 0; i < rangeMax; i++) {\n buckets.push(new List());\n }\n var zeroIdx = maxIn + 1;\n fasGraph.nodes().forEach(function (v) {\n assignBucket(buckets, zeroIdx, fasGraph.node(v));\n });\n return { buckets: buckets, zeroIdx: zeroIdx, graph: fasGraph };\n};\nvar assignBucket = function (buckets, zeroIdx, entry) {\n if (!entry.out) {\n buckets[0].enqueue(entry);\n }\n else if (!entry[\"in\"]) {\n buckets[buckets.length - 1].enqueue(entry);\n }\n else {\n buckets[entry.out - entry[\"in\"] + zeroIdx].enqueue(entry);\n }\n};\nexports.default = greedyFAS;\n//# sourceMappingURL=greedy-fas.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/greedy-fas.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/lasso-select.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/lasso-select.js ***! - \**************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/layout.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/layout.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n\n\nvar isPolygonsIntersect = _util__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isPolygonsIntersect,\n pathToPoints = _util__WEBPACK_IMPORTED_MODULE_1__[\"default\"].pathToPoints;\nvar DEFAULT_TRIGGER = 'shift';\nvar ALLOW_EVENTS = ['drag', 'shift', 'ctrl', 'alt', 'control'];\n\nvar isItemIntersecPolygon = function isItemIntersecPolygon(item, polyPoints) {\n var shapePoints;\n var shape = item.getKeyShape();\n\n if (item.get('type') === 'path') {\n shapePoints = pathToPoints(shape.attr('path'));\n } else {\n var shapeBBox = shape.getCanvasBBox();\n shapePoints = [[shapeBBox.minX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.minY], [shapeBBox.maxX, shapeBBox.maxY], [shapeBBox.minX, shapeBBox.maxY]];\n }\n\n return isPolygonsIntersect(polyPoints, shapePoints);\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n delegateStyle: {\n fill: '#EEF6FF',\n fillOpacity: 0.4,\n stroke: '#DDEEFE',\n lineWidth: 1\n },\n onSelect: function onSelect() {},\n onDeselect: function onDeselect() {},\n shouldDeselect: undefined,\n selectedState: 'selected',\n trigger: DEFAULT_TRIGGER,\n includeEdges: true,\n selectedEdges: [],\n selectedNodes: [] // multiple: false,\n\n };\n },\n getEvents: function getEvents() {\n // 检测输入是否合法\n if (!(ALLOW_EVENTS.indexOf(this.trigger.toLowerCase()) > -1)) {\n this.trigger = DEFAULT_TRIGGER;\n console.warn(\"Behavior lasso-select 的 trigger 参数不合法,请输入 'drag'、'shift'、'ctrl' 或 'alt'\");\n }\n\n if (this.trigger === 'drag') {\n return {\n dragstart: 'onDragStart',\n drag: 'onDragMove',\n dragend: 'onDragEnd',\n 'canvas:click': 'clearStates'\n };\n }\n\n return {\n dragstart: 'onDragStart',\n drag: 'onDragMove',\n dragend: 'onDragEnd',\n keyup: 'onKeyUp',\n keydown: 'onKeyDown',\n 'canvas:click': 'clearStates'\n };\n },\n onDragStart: function onDragStart(e) {\n var lasso = this.lasso;\n var item = e.item; // 排除在节点上拖动\n\n if (item) {\n return;\n }\n\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n\n if (this.selectedNodes && this.selectedNodes.length !== 0) {\n this.clearStates('dragstart');\n }\n\n if (!lasso) {\n lasso = this.createLasso();\n }\n\n this.dragging = true;\n this.originPoint = {\n x: e.x,\n y: e.y\n };\n this.points.push(this.originPoint);\n lasso.show();\n },\n onDragMove: function onDragMove(e) {\n if (!this.dragging) {\n return;\n }\n\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n\n this.points.push({\n x: e.x,\n y: e.y\n });\n this.updateLasso(e);\n },\n onDragEnd: function onDragEnd(e) {\n if (!this.lasso && !this.dragging) {\n return;\n }\n\n if (this.trigger !== 'drag' && !this.keydown) {\n return;\n }\n\n this.points.push(this.originPoint);\n this.getSelectedItems();\n this.lasso.remove(true);\n this.lasso = null;\n this.points = [];\n this.dragging = false;\n },\n getLassoPath: function getLassoPath() {\n var points = this.points;\n var path = [];\n\n if (points.length) {\n points.forEach(function (point, index) {\n if (index === 0) {\n path.push(['M', point.x, point.y]);\n } else {\n path.push(['L', point.x, point.y]);\n }\n });\n path.push(['L', points[0].x, points[0].y]);\n }\n\n return path;\n },\n clearStates: function clearStates(action) {\n if (action === void 0) {\n action = 'canvas:click';\n }\n\n var _a = this,\n graph = _a.graph,\n selectedState = _a.selectedState,\n shouldDeselect = _a.shouldDeselect;\n\n var nodes = graph.findAllByState('node', selectedState);\n var edges = graph.findAllByState('edge', selectedState);\n\n if (!shouldDeselect || shouldDeselect({\n action: action,\n nodes: nodes,\n edges: edges\n })) {\n nodes.forEach(function (node) {\n return graph.setItemState(node, selectedState, false);\n });\n edges.forEach(function (edge) {\n return graph.setItemState(edge, selectedState, false);\n });\n }\n\n if (this.onDeselect) {\n this.onDeselect(this.selectedNodes, this.selectedEdges);\n }\n\n this.selectedNodes = [];\n this.selectedEdges = [];\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: [],\n edges: []\n },\n select: false\n });\n },\n getSelectedItems: function getSelectedItems() {\n var _this = this;\n\n var _a = this,\n graph = _a.graph,\n shouldUpdate = _a.shouldUpdate;\n\n var lassoContour = this.points.map(function (point) {\n return [graph.getCanvasByPoint(point.x, point.y).x, graph.getCanvasByPoint(point.x, point.y).y];\n });\n var state = this.selectedState;\n var selectedNodes = [];\n var selectedIds = [];\n graph.getNodes().forEach(function (node) {\n if (!node.isVisible()) return; // 隐藏节点不能被选中\n\n if (isItemIntersecPolygon(node, lassoContour)) {\n if (shouldUpdate(node, 'select')) {\n selectedNodes.push(node);\n var model = node.getModel();\n selectedIds.push(model.id);\n graph.setItemState(node, state, true);\n }\n }\n });\n var selectedEdges = [];\n\n if (this.includeEdges) {\n // 选中边,边的source和target都在选中的节点中时才选中\n selectedNodes.forEach(function (node) {\n var edges = node.getOutEdges();\n edges.forEach(function (edge) {\n if (!edge.isVisible()) return; // 隐藏边不能够被选中\n\n var model = edge.getModel();\n var source = model.source,\n target = model.target;\n\n if (selectedIds.includes(source) && selectedIds.includes(target) && shouldUpdate(edge, 'select')) {\n selectedEdges.push(edge);\n graph.setItemState(edge, _this.selectedState, true);\n }\n });\n });\n }\n\n this.selectedEdges = selectedEdges;\n this.selectedNodes = selectedNodes;\n\n if (this.onSelect) {\n this.onSelect(selectedNodes, selectedEdges);\n }\n\n graph.emit('nodeselectchange', {\n selectedItems: {\n nodes: selectedNodes,\n edges: selectedEdges\n },\n select: true\n });\n },\n createLasso: function createLasso() {\n var self = this;\n var lasso = self.graph.get('delegateGroup').addShape('path', {\n attrs: Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n path: []\n }, self.delegateStyle),\n capture: false,\n name: 'lasso-shape'\n });\n this.lasso = lasso;\n this.delegate = lasso;\n this.points = [];\n return lasso;\n },\n updateLasso: function updateLasso(e) {\n var self = this;\n this.lasso.attr({\n path: self.getLassoPath()\n });\n },\n onKeyDown: function onKeyDown(e) {\n var code = e.key;\n\n if (!code) {\n return;\n } // if (this.selectedNodes && this.selectedNodes.length !== 0) {\n // this.clearStates();\n // }\n\n\n if (code.toLowerCase() === this.trigger.toLowerCase()) {\n this.keydown = true;\n } else {\n this.keydown = false;\n }\n },\n onKeyUp: function onKeyUp() {\n if (this.lasso) {\n // 清除所有选中状态后,设置拖得动状态为false,并清除框选的lasso\n this.lasso.remove(true);\n this.lasso = null;\n this.points = [];\n this.dragging = false;\n }\n\n this.keydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/lasso-select.js?"); +eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar acyclic_1 = __importDefault(__webpack_require__(/*! ./acyclic */ \"./node_modules/@antv/layout/lib/layout/dagre/src/acyclic.js\"));\nvar normalize_1 = __importDefault(__webpack_require__(/*! ./normalize */ \"./node_modules/@antv/layout/lib/layout/dagre/src/normalize.js\"));\nvar rank_1 = __importDefault(__webpack_require__(/*! ./rank */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/index.js\"));\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar parent_dummy_chains_1 = __importDefault(__webpack_require__(/*! ./parent-dummy-chains */ \"./node_modules/@antv/layout/lib/layout/dagre/src/parent-dummy-chains.js\"));\nvar nesting_graph_1 = __importDefault(__webpack_require__(/*! ./nesting-graph */ \"./node_modules/@antv/layout/lib/layout/dagre/src/nesting-graph.js\"));\nvar add_border_segments_1 = __importDefault(__webpack_require__(/*! ./add-border-segments */ \"./node_modules/@antv/layout/lib/layout/dagre/src/add-border-segments.js\"));\nvar coordinate_system_1 = __importDefault(__webpack_require__(/*! ./coordinate-system */ \"./node_modules/@antv/layout/lib/layout/dagre/src/coordinate-system.js\"));\nvar order_1 = __importDefault(__webpack_require__(/*! ./order */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/index.js\"));\nvar position_1 = __importDefault(__webpack_require__(/*! ./position */ \"./node_modules/@antv/layout/lib/layout/dagre/src/position/index.js\"));\nvar init_data_order_1 = __importDefault(__webpack_require__(/*! ./order/init-data-order */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/init-data-order.js\"));\nvar graph_1 = __webpack_require__(/*! ../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\nvar layout = function (g, opts) {\n var time = opts && opts.debugTiming ? util_1.time : util_1.notime;\n time(\"layout\", function () {\n // 如果在原图基础上修改,继承原图的order结果\n if (opts && !opts.keepNodeOrder && opts.prevGraph) {\n time(\" inheritOrder\", function () {\n inheritOrder(g, opts.prevGraph);\n });\n }\n var layoutGraph = time(\" buildLayoutGraph\", function () {\n return buildLayoutGraph(g);\n });\n // 控制是否为边的label留位置(这会影响是否在边中间添加dummy node)\n if (!(opts && opts.edgeLabelSpace === false)) {\n time(\" makeSpaceForEdgeLabels\", function () {\n makeSpaceForEdgeLabels(layoutGraph);\n });\n }\n // TODO: 暂时处理层级设置不正确时的异常报错,提示设置正确的层级\n try {\n time(\" runLayout\", function () {\n runLayout(layoutGraph, time, opts);\n });\n }\n catch (e) {\n if (e.message ===\n \"Not possible to find intersection inside of the rectangle\") {\n console.error(\"The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\\n\", e);\n return;\n }\n throw e;\n }\n time(\" updateInputGraph\", function () {\n updateInputGraph(g, layoutGraph);\n });\n });\n};\nvar runLayout = function (g, time, opts) {\n time(\" removeSelfEdges\", function () {\n removeSelfEdges(g);\n });\n time(\" acyclic\", function () {\n acyclic_1.default.run(g);\n });\n time(\" nestingGraph.run\", function () {\n nesting_graph_1.default.run(g);\n });\n time(\" rank\", function () {\n (0, rank_1.default)((0, util_1.asNonCompoundGraph)(g));\n });\n time(\" injectEdgeLabelProxies\", function () {\n injectEdgeLabelProxies(g);\n });\n time(\" removeEmptyRanks\", function () {\n (0, util_1.removeEmptyRanks)(g);\n });\n time(\" nestingGraph.cleanup\", function () {\n nesting_graph_1.default.cleanup(g);\n });\n time(\" normalizeRanks\", function () {\n (0, util_1.normalizeRanks)(g);\n });\n time(\" assignRankMinMax\", function () {\n assignRankMinMax(g);\n });\n time(\" removeEdgeLabelProxies\", function () {\n removeEdgeLabelProxies(g);\n });\n time(\" normalize.run\", function () {\n normalize_1.default.run(g);\n });\n time(\" parentDummyChains\", function () {\n (0, parent_dummy_chains_1.default)(g);\n });\n time(\" addBorderSegments\", function () {\n (0, add_border_segments_1.default)(g);\n });\n if (opts && opts.keepNodeOrder) {\n time(\" initDataOrder\", function () {\n (0, init_data_order_1.default)(g, opts.nodeOrder);\n });\n }\n time(\" order\", function () {\n (0, order_1.default)(g, opts === null || opts === void 0 ? void 0 : opts.keepNodeOrder);\n });\n time(\" insertSelfEdges\", function () {\n insertSelfEdges(g);\n });\n time(\" adjustCoordinateSystem\", function () {\n coordinate_system_1.default.adjust(g);\n });\n time(\" position\", function () {\n (0, position_1.default)(g);\n });\n time(\" positionSelfEdges\", function () {\n positionSelfEdges(g);\n });\n time(\" removeBorderNodes\", function () {\n removeBorderNodes(g);\n });\n time(\" normalize.undo\", function () {\n normalize_1.default.undo(g);\n });\n time(\" fixupEdgeLabelCoords\", function () {\n fixupEdgeLabelCoords(g);\n });\n time(\" undoCoordinateSystem\", function () {\n coordinate_system_1.default.undo(g);\n });\n time(\" translateGraph\", function () {\n translateGraph(g);\n });\n time(\" assignNodeIntersects\", function () {\n assignNodeIntersects(g);\n });\n time(\" reversePoints\", function () {\n reversePointsForReversedEdges(g);\n });\n time(\" acyclic.undo\", function () {\n acyclic_1.default.undo(g);\n });\n};\n/**\n * 继承上一个布局中的order,防止翻转\n * TODO: 暂时没有考虑涉及层级变动的布局,只保证原来布局层级和相对顺序不变\n */\nvar inheritOrder = function (currG, prevG) {\n currG.nodes().forEach(function (n) {\n var node = currG.node(n);\n var prevNode = prevG.node(n);\n if (prevNode !== undefined) {\n node.fixorder = prevNode._order;\n delete prevNode._order;\n }\n else {\n delete node.fixorder;\n }\n });\n};\n/*\n * Copies final layout information from the layout graph back to the input\n * graph. This process only copies whitelisted attributes from the layout graph\n * to the input graph, so it serves as a good place to determine what\n * attributes can influence layout.\n */\nvar updateInputGraph = function (inputGraph, layoutGraph) {\n inputGraph.nodes().forEach(function (v) {\n var _a;\n var inputLabel = inputGraph.node(v);\n if (inputLabel) {\n var layoutLabel = layoutGraph.node(v);\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n inputLabel._order = layoutLabel.order;\n inputLabel._rank = layoutLabel.rank;\n if ((_a = layoutGraph.children(v)) === null || _a === void 0 ? void 0 : _a.length) {\n inputLabel.width = layoutLabel.width;\n inputLabel.height = layoutLabel.height;\n }\n }\n });\n inputGraph.edges().forEach(function (e) {\n var inputLabel = inputGraph.edge(e);\n var layoutLabel = layoutGraph.edge(e);\n inputLabel.points = layoutLabel ? layoutLabel.points : [];\n if (layoutLabel && layoutLabel.hasOwnProperty(\"x\")) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n }\n });\n inputGraph.graph().width = layoutGraph.graph().width;\n inputGraph.graph().height = layoutGraph.graph().height;\n};\nvar graphNumAttrs = [\"nodesep\", \"edgesep\", \"ranksep\", \"marginx\", \"marginy\"];\nvar graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: \"tb\" };\nvar graphAttrs = [\"acyclicer\", \"ranker\", \"rankdir\", \"align\"];\nvar nodeNumAttrs = [\"width\", \"height\", \"layer\", \"fixorder\"]; // 需要传入layer, fixOrder作为参数参考\nvar nodeDefaults = { width: 0, height: 0 };\nvar edgeNumAttrs = [\"minlen\", \"weight\", \"width\", \"height\", \"labeloffset\"];\nvar edgeDefaults = {\n minlen: 1,\n weight: 1,\n width: 0,\n height: 0,\n labeloffset: 10,\n labelpos: \"r\",\n};\nvar edgeAttrs = [\"labelpos\"];\n/*\n * Constructs a new graph from the input graph, which can be used for layout.\n * This process copies only whitelisted attributes from the input graph to the\n * layout graph. Thus this function serves as a good place to determine what\n * attributes can influence layout.\n */\nvar buildLayoutGraph = function (inputGraph) {\n var g = new graph_1.Graph({ multigraph: true, compound: true });\n var graph = canonicalize(inputGraph.graph());\n var pickedProperties = {};\n graphAttrs === null || graphAttrs === void 0 ? void 0 : graphAttrs.forEach(function (key) {\n if (graph[key] !== undefined)\n pickedProperties[key] = graph[key];\n });\n g.setGraph(Object.assign({}, graphDefaults, selectNumberAttrs(graph, graphNumAttrs), pickedProperties));\n inputGraph.nodes().forEach(function (v) {\n var node = canonicalize(inputGraph.node(v));\n var defaultNode = __assign(__assign({}, nodeDefaults), node);\n var defaultAttrs = selectNumberAttrs(defaultNode, nodeNumAttrs);\n g.setNode(v, defaultAttrs);\n g.setParent(v, inputGraph.parent(v));\n });\n inputGraph.edges().forEach(function (e) {\n var edge = canonicalize(inputGraph.edge(e));\n var pickedProperties = {};\n edgeAttrs === null || edgeAttrs === void 0 ? void 0 : edgeAttrs.forEach(function (key) {\n if (edge[key] !== undefined)\n pickedProperties[key] = edge[key];\n });\n g.setEdgeObj(e, Object.assign({}, edgeDefaults, selectNumberAttrs(edge, edgeNumAttrs), pickedProperties));\n });\n return g;\n};\n/*\n * This idea comes from the Gansner paper: to account for edge labels in our\n * layout we split each rank in half by doubling minlen and halving ranksep.\n * Then we can place labels at these mid-points between nodes.\n *\n * We also add some minimal padding to the width to push the label for the edge\n * away from the edge itself a bit.\n */\nvar makeSpaceForEdgeLabels = function (g) {\n var graph = g.graph();\n if (!graph.ranksep)\n graph.ranksep = 0;\n graph.ranksep /= 2;\n g.nodes().forEach(function (n) {\n var node = g.node(n);\n if (!isNaN(node.layer)) {\n if (!node.layer)\n node.layer = 0;\n }\n });\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n edge.minlen *= 2;\n if (((_a = edge.labelpos) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== \"c\") {\n if (graph.rankdir === \"TB\" || graph.rankdir === \"BT\") {\n edge.width += edge.labeloffset;\n }\n else {\n edge.height += edge.labeloffset;\n }\n }\n });\n};\n/*\n * Creates temporary dummy nodes that capture the rank in which each edge's\n * label is going to, if it has one of non-zero width and height. We do this\n * so that we can safely remove empty ranks while preserving balance for the\n * label's position.\n */\nvar injectEdgeLabelProxies = function (g) {\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (edge.width && edge.height) {\n var v = g.node(e.v);\n var w = g.node(e.w);\n var label = {\n e: e,\n rank: (w.rank - v.rank) / 2 + v.rank,\n };\n (0, util_1.addDummyNode)(g, \"edge-proxy\", label, \"_ep\");\n }\n });\n};\nvar assignRankMinMax = function (g) {\n var maxRank = 0;\n g.nodes().forEach(function (v) {\n var _a, _b;\n var node = g.node(v);\n if (node.borderTop) {\n node.minRank = (_a = g.node(node.borderTop)) === null || _a === void 0 ? void 0 : _a.rank;\n node.maxRank = (_b = g.node(node.borderBottom)) === null || _b === void 0 ? void 0 : _b.rank;\n maxRank = Math.max(maxRank, node.maxRank || -Infinity);\n }\n });\n g.graph().maxRank = maxRank;\n};\nvar removeEdgeLabelProxies = function (g) {\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (node.dummy === \"edge-proxy\") {\n g.edge(node.e).labelRank = node.rank;\n g.removeNode(v);\n }\n });\n};\nvar translateGraph = function (g) {\n var minX;\n var maxX = 0;\n var minY;\n var maxY = 0;\n var graphLabel = g.graph();\n var marginX = graphLabel.marginx || 0;\n var marginY = graphLabel.marginy || 0;\n var getExtremes = function (attrs) {\n if (!attrs)\n return;\n var x = attrs.x;\n var y = attrs.y;\n var w = attrs.width;\n var h = attrs.height;\n if (!isNaN(x) && !isNaN(w)) {\n if (minX === undefined) {\n minX = x - w / 2;\n }\n minX = Math.min(minX, x - w / 2);\n maxX = Math.max(maxX, x + w / 2);\n }\n if (!isNaN(y) && !isNaN(h)) {\n if (minY === undefined) {\n minY = y - h / 2;\n }\n minY = Math.min(minY, y - h / 2);\n maxY = Math.max(maxY, y + h / 2);\n }\n };\n g.nodes().forEach(function (v) {\n getExtremes(g.node(v));\n });\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (edge === null || edge === void 0 ? void 0 : edge.hasOwnProperty(\"x\")) {\n getExtremes(edge);\n }\n });\n minX -= marginX;\n minY -= marginY;\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (node) {\n node.x -= minX;\n node.y -= minY;\n }\n });\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n (_a = edge.points) === null || _a === void 0 ? void 0 : _a.forEach(function (p) {\n p.x -= minX;\n p.y -= minY;\n });\n if (edge.hasOwnProperty(\"x\")) {\n edge.x -= minX;\n }\n if (edge.hasOwnProperty(\"y\")) {\n edge.y -= minY;\n }\n });\n graphLabel.width = maxX - minX + marginX;\n graphLabel.height = maxY - minY + marginY;\n};\nvar assignNodeIntersects = function (g) {\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n var nodeV = g.node(e.v);\n var nodeW = g.node(e.w);\n var p1;\n var p2;\n if (!edge.points) {\n edge.points = [];\n p1 = nodeW;\n p2 = nodeV;\n }\n else {\n p1 = edge.points[0];\n p2 = edge.points[edge.points.length - 1];\n }\n edge.points.unshift((0, util_1.intersectRect)(nodeV, p1));\n edge.points.push((0, util_1.intersectRect)(nodeW, p2));\n });\n};\nvar fixupEdgeLabelCoords = function (g) {\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (edge === null || edge === void 0 ? void 0 : edge.hasOwnProperty(\"x\")) {\n if (edge.labelpos === \"l\" || edge.labelpos === \"r\") {\n edge.width -= edge.labeloffset;\n }\n switch (edge.labelpos) {\n case \"l\":\n edge.x -= edge.width / 2 + edge.labeloffset;\n break;\n case \"r\":\n edge.x += edge.width / 2 + edge.labeloffset;\n break;\n }\n }\n });\n};\nvar reversePointsForReversedEdges = function (g) {\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n if (edge.reversed) {\n (_a = edge.points) === null || _a === void 0 ? void 0 : _a.reverse();\n }\n });\n};\nvar removeBorderNodes = function (g) {\n g.nodes().forEach(function (v) {\n var _a, _b, _c;\n if ((_a = g.children(v)) === null || _a === void 0 ? void 0 : _a.length) {\n var node = g.node(v);\n var t = g.node(node.borderTop);\n var b = g.node(node.borderBottom);\n var l = g.node(node.borderLeft[((_b = node.borderLeft) === null || _b === void 0 ? void 0 : _b.length) - 1]);\n var r = g.node(node.borderRight[((_c = node.borderRight) === null || _c === void 0 ? void 0 : _c.length) - 1]);\n node.width = Math.abs((r === null || r === void 0 ? void 0 : r.x) - (l === null || l === void 0 ? void 0 : l.x)) || 10;\n node.height = Math.abs((b === null || b === void 0 ? void 0 : b.y) - (t === null || t === void 0 ? void 0 : t.y)) || 10;\n node.x = ((l === null || l === void 0 ? void 0 : l.x) || 0) + node.width / 2;\n node.y = ((t === null || t === void 0 ? void 0 : t.y) || 0) + node.height / 2;\n }\n });\n g.nodes().forEach(function (v) {\n var _a;\n if (((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.dummy) === \"border\") {\n g.removeNode(v);\n }\n });\n};\nvar removeSelfEdges = function (g) {\n g.edges().forEach(function (e) {\n if (e.v === e.w) {\n var node = g.node(e.v);\n if (!node.selfEdges) {\n node.selfEdges = [];\n }\n node.selfEdges.push({ e: e, label: g.edge(e) });\n g.removeEdgeObj(e);\n }\n });\n};\nvar insertSelfEdges = function (g) {\n var layers = (0, util_1.buildLayerMatrix)(g);\n layers === null || layers === void 0 ? void 0 : layers.forEach(function (layer) {\n var orderShift = 0;\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v, i) {\n var _a;\n var node = g.node(v);\n node.order = i + orderShift;\n (_a = node.selfEdges) === null || _a === void 0 ? void 0 : _a.forEach(function (selfEdge) {\n (0, util_1.addDummyNode)(g, \"selfedge\", {\n width: selfEdge.label.width,\n height: selfEdge.label.height,\n rank: node.rank,\n order: i + ++orderShift,\n e: selfEdge.e,\n label: selfEdge.label,\n }, \"_se\");\n });\n delete node.selfEdges;\n });\n });\n};\nvar positionSelfEdges = function (g) {\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (node.dummy === \"selfedge\") {\n var selfNode = g.node(node.e.v);\n var x = selfNode.x + selfNode.width / 2;\n var y = selfNode.y;\n var dx = node.x - x;\n var dy = selfNode.height / 2;\n g.setEdgeObj(node.e, node.label);\n g.removeNode(v);\n node.label.points = [\n { x: x + (2 * dx) / 3, y: y - dy },\n { x: x + (5 * dx) / 6, y: y - dy },\n { y: y, x: x + dx },\n { x: x + (5 * dx) / 6, y: y + dy },\n { x: x + (2 * dx) / 3, y: y + dy },\n ];\n node.label.x = node.x;\n node.label.y = node.y;\n }\n });\n};\nvar selectNumberAttrs = function (obj, attrs) {\n var pickedProperties = {};\n attrs === null || attrs === void 0 ? void 0 : attrs.forEach(function (key) {\n if (obj[key] === undefined)\n return;\n pickedProperties[key] = (+obj[key]);\n });\n return pickedProperties;\n};\nvar canonicalize = function (attrs) {\n if (attrs === void 0) { attrs = {}; }\n var newAttrs = {};\n Object.keys(attrs).forEach(function (k) {\n newAttrs[k.toLowerCase()] = attrs[k];\n });\n return newAttrs;\n};\nexports.default = layout;\n//# sourceMappingURL=layout.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/layout.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/scroll-canvas.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/scroll-canvas.js ***! - \***************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/nesting-graph.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/nesting-graph.js ***! + \*************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar ALLOW_EVENTS = ['shift', 'ctrl', 'alt', 'control', 'meta'];\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n direction: 'both',\n enableOptimize: false,\n zoomKey: 'ctrl',\n // scroll-canvas 可滚动的扩展范围,默认为 0,即最多可以滚动一屏的位置\n // 当设置的值大于 0 时,即滚动可以超过一屏\n // 当设置的值小于 0 时,相当于缩小了可滚动范围\n // 具体实例可参考:https://gw.alipayobjects.com/mdn/rms_f8c6a0/afts/img/A*IFfoS67_HssAAAAAAAAAAAAAARQnAQ\n scalableRange: 0\n };\n },\n getEvents: function getEvents() {\n if (!this.zoomKey || ALLOW_EVENTS.indexOf(this.zoomKey) === -1) this.zoomKey = 'ctrl';\n return {\n wheel: 'onWheel'\n };\n },\n onWheel: function onWheel(ev) {\n var _this = this;\n\n var graph = this.graph;\n var zoomKeys = Array.isArray(this.zoomKey) ? [].concat(this.zoomKey) : [this.zoomKey];\n if (zoomKeys.includes('control')) zoomKeys.push('ctrl');\n var keyDown = zoomKeys.some(function (ele) {\n return ev[\"\".concat(ele, \"Key\")];\n });\n\n if (keyDown) {\n var canvas = graph.get('canvas');\n var point = canvas.getPointByClient(ev.clientX, ev.clientY);\n var ratio = graph.getZoom();\n\n if (ev.wheelDelta > 0) {\n ratio = ratio + ratio * 0.05;\n } else {\n ratio = ratio - ratio * 0.05;\n }\n\n graph.zoomTo(ratio, {\n x: point.x,\n y: point.y\n });\n } else {\n var dx = ev.deltaX || ev.movementX;\n var dy = ev.deltaY || ev.movementY;\n if (!dy && navigator.userAgent.indexOf('Firefox') > -1) dy = -ev.wheelDelta * 125 / 3;\n var width = this.graph.get('width');\n var height = this.graph.get('height');\n var graphCanvasBBox = this.graph.get('canvas').getCanvasBBox();\n var expandWidth = this.scalableRange;\n var expandHeight = this.scalableRange; // 若 scalableRange 是 0~1 的小数,则作为比例考虑\n\n if (expandWidth < 1 && expandWidth > -1) {\n expandWidth = width * expandWidth;\n expandHeight = height * expandHeight;\n }\n\n var minX = graphCanvasBBox.minX,\n maxX = graphCanvasBBox.maxX,\n minY = graphCanvasBBox.minY,\n maxY = graphCanvasBBox.maxY;\n\n if (dx > 0) {\n if (maxX < -expandWidth) {\n dx = 0;\n } else if (maxX - dx < -expandWidth) {\n dx = maxX + expandWidth;\n }\n } else if (dx < 0) {\n if (minX > width + expandWidth) {\n dx = 0;\n } else if (minX - dx > width + expandWidth) {\n dx = minX - (width + expandWidth);\n }\n }\n\n if (dy > 0) {\n if (maxY < -expandHeight) {\n dy = 0;\n } else if (maxY - dy < -expandHeight) {\n dy = maxY + expandHeight;\n }\n } else if (dy < 0) {\n if (minY > height + expandHeight) {\n dy = 0;\n } else if (minY - dy > height + expandHeight) {\n dy = minY - (height + expandHeight);\n }\n }\n\n if (this.get('direction') === 'x') {\n dy = 0;\n } else if (this.get('direction') === 'y') {\n dx = 0;\n }\n\n graph.translate(-dx, -dy);\n }\n\n ev.preventDefault(); // hide the shapes when the zoom ratio is smaller than optimizeZoom\n // hide the shapes when zoomming\n\n var enableOptimize = this.get('enableOptimize');\n\n if (enableOptimize) {\n var optimizeZoom_1 = this.get('optimizeZoom');\n var optimized = this.get('optimized');\n var nodes_1 = graph.getNodes();\n var edges_1 = graph.getEdges();\n var nodesLength_1 = nodes_1.length;\n var edgesLength_1 = edges_1.length; // hiding\n\n if (!optimized) {\n for (var n = 0; n < nodesLength_1; n++) {\n var node = nodes_1[n];\n\n if (!node.destroyed) {\n var children = node.get('group').get('children');\n var childrenLength = children.length;\n\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n\n if (!shape.destoryed && !shape.get('isKeyShape')) {\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n }\n }\n }\n }\n\n for (var edgeIndex = 0; edgeIndex < edgesLength_1; edgeIndex++) {\n var edge = edges_1[edgeIndex];\n var children = edge.get('group').get('children');\n var childrenLength = children.length;\n\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n }\n }\n\n this.set('optimized', true);\n } // showing after 100ms\n\n\n clearTimeout(this.get('timeout'));\n var timeout = setTimeout(function () {\n var currentZoom = graph.getZoom();\n\n var curOptimized = _this.get('optimized');\n\n if (curOptimized) {\n _this.set('optimized', false);\n\n for (var n = 0; n < nodesLength_1; n++) {\n var node = nodes_1[n];\n var children = node.get('group').get('children');\n var childrenLength = children.length;\n\n if (currentZoom < optimizeZoom_1) {\n var keyShape = node.getKeyShape();\n var oriVis = keyShape.get('ori-visibility');\n if (oriVis) keyShape.show();\n } else {\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n var oriVis = shape.get('ori-visibility');\n\n if (!shape.get('visible') && oriVis) {\n if (oriVis) shape.show();\n }\n }\n }\n }\n\n for (var edgeIndex = 0; edgeIndex < edgesLength_1; edgeIndex++) {\n var edge = edges_1[edgeIndex];\n var children = edge.get('group').get('children');\n var childrenLength = children.length;\n\n if (currentZoom < optimizeZoom_1) {\n var keyShape = edge.getKeyShape();\n var oriVis = keyShape.get('ori-visibility');\n if (oriVis) keyShape.show();\n } else {\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n\n if (!shape.get('visible')) {\n var oriVis = shape.get('ori-visibility');\n if (oriVis) shape.show();\n }\n }\n }\n }\n }\n }, 100);\n this.set('timeout', timeout);\n }\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/scroll-canvas.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\n/*\n * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs,\n * adds appropriate edges to ensure that all cluster nodes are placed between\n * these boundries, and ensures that the graph is connected.\n *\n * In addition we ensure, through the use of the minlen property, that nodes\n * and subgraph border nodes to not end up on the same rank.\n *\n * Preconditions:\n *\n * 1. Input graph is a DAG\n * 2. Nodes in the input graph has a minlen attribute\n *\n * Postconditions:\n *\n * 1. Input graph is connected.\n * 2. Dummy nodes are added for the tops and bottoms of subgraphs.\n * 3. The minlen attribute for nodes is adjusted to ensure nodes do not\n * get placed on the same rank as subgraph border nodes.\n *\n * The nesting graph idea comes from Sander, \"Layout of Compound Directed\n * Graphs.\"\n */\nvar run = function (g) {\n var _a;\n var root = (0, util_1.addDummyNode)(g, \"root\", {}, \"_root\");\n var depths = treeDepths(g);\n var maxDepth = Math.max.apply(Math, Object.values(depths));\n if (Math.abs(maxDepth) === Infinity) {\n maxDepth = 1;\n }\n var height = maxDepth - 1; // Note: depths is an Object not an array\n var nodeSep = 2 * height + 1;\n g.graph().nestingRoot = root;\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n g.edges().forEach(function (e) {\n g.edge(e).minlen *= nodeSep;\n });\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n // Create border nodes and link them up\n (_a = g.children()) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n};\nvar dfs = function (g, root, nodeSep, weight, height, depths, v) {\n var children = g.children(v);\n if (!(children === null || children === void 0 ? void 0 : children.length)) {\n if (v !== root) {\n g.setEdge(root, v, { weight: 0, minlen: nodeSep });\n }\n return;\n }\n var top = (0, util_1.addBorderNode)(g, \"_bt\");\n var bottom = (0, util_1.addBorderNode)(g, \"_bb\");\n var label = g.node(v);\n g.setParent(top, v);\n label.borderTop = top;\n g.setParent(bottom, v);\n label.borderBottom = bottom;\n children === null || children === void 0 ? void 0 : children.forEach(function (child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n var childNode = g.node(child);\n var childTop = childNode.borderTop ? childNode.borderTop : child;\n var childBottom = childNode.borderBottom ? childNode.borderBottom : child;\n var thisWeight = childNode.borderTop ? weight : 2 * weight;\n var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1;\n g.setEdge(top, childTop, {\n minlen: minlen,\n weight: thisWeight,\n nestingEdge: true,\n });\n g.setEdge(childBottom, bottom, {\n minlen: minlen,\n weight: thisWeight,\n nestingEdge: true,\n });\n });\n if (!g.parent(v)) {\n g.setEdge(root, top, { weight: 0, minlen: height + depths[v] });\n }\n};\nvar treeDepths = function (g) {\n var _a;\n var depths = {};\n var dfs = function (v, depth) {\n var children = g.children(v);\n children === null || children === void 0 ? void 0 : children.forEach(function (child) { return dfs(child, depth + 1); });\n depths[v] = depth;\n };\n (_a = g.children()) === null || _a === void 0 ? void 0 : _a.forEach(function (v) { return dfs(v, 1); });\n return depths;\n};\nvar sumWeights = function (g) {\n var result = 0;\n g.edges().forEach(function (e) {\n result += g.edge(e).weight;\n });\n return result;\n};\nvar cleanup = function (g) {\n var graphLabel = g.graph();\n graphLabel.nestingRoot && g.removeNode(graphLabel.nestingRoot);\n delete graphLabel.nestingRoot;\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (edge.nestingEdge) {\n g.removeEdgeObj(e);\n }\n });\n};\nexports.default = { run: run, cleanup: cleanup };\n//# sourceMappingURL=nesting-graph.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/nesting-graph.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/shortcuts-call.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/shortcuts-call.js ***! - \****************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/normalize.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/normalize.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar DEFAULT_TRIGGER = 'ctrl';\nvar ALLOW_EVENTS = ['shift', 'ctrl', 'alt', 'control'];\nvar DEFAULT_COMBINED_KEY = '1';\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n trigger: DEFAULT_TRIGGER,\n combinedKey: DEFAULT_COMBINED_KEY,\n functionName: 'fitView',\n functionParams: []\n };\n },\n getEvents: function getEvents() {\n // 检测输入是否合法\n if (!(ALLOW_EVENTS.indexOf(this.trigger.toLowerCase()) > -1)) {\n this.trigger = DEFAULT_TRIGGER;\n console.warn(\"Behavior shortcuts-fit-view \\u7684 trigger \\u53C2\\u6570 '\".concat(this.trigger, \"' \\u4E0D\\u5408\\u6CD5\\uFF0C\\u8BF7\\u8F93\\u5165 'drag'\\u3001'shift'\\u3001'ctrl' \\u6216 'alt'\"));\n }\n\n if (this.combinedKey === this.trigger) {\n this.combinedKey = undefined;\n }\n\n return {\n keyup: 'onKeyUp',\n keydown: 'onKeyDown'\n };\n },\n onKeyDown: function onKeyDown(e) {\n var code = e.key;\n\n if (!code) {\n return;\n }\n\n var triggerLowerCase = this.trigger.toLowerCase();\n var codeLowerCase = code.toLowerCase(); // 按住 control 键时,允许用户设置 trigger 为 ctrl\n\n if (!this.triggerKeydown) {\n if (codeLowerCase === triggerLowerCase || codeLowerCase === 'control' && triggerLowerCase === 'ctrl' || codeLowerCase === 'ctrl' && triggerLowerCase === 'control') {\n this.triggerKeydown = true;\n } else {\n this.triggerKeydown = false;\n }\n }\n\n var graph = this.graph;\n\n if (!graph[this.functionName]) {\n console.warn(\"Behavior shortcuts-fit-view \\u7684 functionName \\u53C2\\u6570 '\".concat(this.functionName, \"' \\u4E0D\\u5408\\u6CD5\\uFF0C\\u5B83\\u4E0D\\u662F Graph \\u7684\\u4E00\\u4E2A\\u51FD\\u6570\\u540D\"));\n return {};\n } // 未配置 combinedKey,直接 fitView\n\n\n if (this.triggerKeydown && !this.combinedKey) {\n if (this.functionParams && this.functionParams.length) graph[this.functionName].apply(graph, this.functionParams);else graph[this.functionName]();\n return;\n }\n\n var combinedKeyLowerCase = this.combinedKey.toLowerCase();\n\n if (this.triggerKeydown) {\n if (codeLowerCase === combinedKeyLowerCase || codeLowerCase === 'control' && combinedKeyLowerCase === 'ctrl' || codeLowerCase === 'ctrl' && combinedKeyLowerCase === 'control') {\n if (this.functionParams && this.functionParams.length) graph[this.functionName].apply(graph, this.functionParams);else graph[this.functionName]();\n }\n }\n },\n onKeyUp: function onKeyUp() {\n if (this.brush) {\n // 清除所有选中状态后,设置拖得动状态为false,并清除框选的brush\n this.brush.remove(true);\n this.brush = null;\n this.dragging = false;\n }\n\n this.triggerKeydown = false;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/shortcuts-call.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\n/*\n * Breaks any long edges in the graph into short segments that span 1 layer\n * each. This operation is undoable with the denormalize function.\n *\n * Pre-conditions:\n *\n * 1. The input graph is a DAG.\n * 2. Each node in the graph has a \"rank\" property.\n *\n * Post-condition:\n *\n * 1. All edges in the graph have a length of 1.\n * 2. Dummy nodes are added where edges have been split into segments.\n * 3. The graph is augmented with a \"dummyChains\" attribute which contains\n * the first dummy in each chain of dummy nodes produced.\n */\nvar run = function (g) {\n g.graph().dummyChains = [];\n g.edges().forEach(function (edge) { return normalizeEdge(g, edge); });\n};\nvar normalizeEdge = function (g, e) {\n var v = e.v;\n var vRank = g.node(v).rank;\n var w = e.w;\n var wRank = g.node(w).rank;\n var name = e.name;\n var edgeLabel = g.edge(e);\n var labelRank = edgeLabel.labelRank;\n if (wRank === vRank + 1)\n return;\n g.removeEdgeObj(e);\n var graph = g.graph();\n var dummy;\n var attrs;\n var i;\n for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) {\n edgeLabel.points = [];\n attrs = {\n edgeLabel: edgeLabel,\n width: 0,\n height: 0,\n edgeObj: e,\n rank: vRank,\n };\n dummy = (0, util_1.addDummyNode)(g, \"edge\", attrs, \"_d\");\n if (vRank === labelRank) {\n attrs.width = edgeLabel.width;\n attrs.height = edgeLabel.height;\n attrs.dummy = \"edge-label\";\n attrs.labelpos = edgeLabel.labelpos;\n }\n g.setEdge(v, dummy, { weight: edgeLabel.weight }, name);\n if (i === 0) {\n if (!graph.dummyChains)\n graph.dummyChains = [];\n graph.dummyChains.push(dummy);\n }\n v = dummy;\n }\n g.setEdge(v, w, { weight: edgeLabel.weight }, name);\n};\nvar undo = function (g) {\n var _a;\n (_a = g.graph().dummyChains) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {\n var node = g.node(v);\n var origLabel = node.edgeLabel;\n var w;\n if (node.edgeObj) {\n g.setEdgeObj(node.edgeObj, origLabel);\n }\n var currentV = v;\n while (node.dummy) {\n w = g.successors(currentV)[0];\n g.removeNode(currentV);\n origLabel.points.push({ x: node.x, y: node.y });\n if (node.dummy === \"edge-label\") {\n origLabel.x = node.x;\n origLabel.y = node.y;\n origLabel.width = node.width;\n origLabel.height = node.height;\n }\n currentV = w;\n node = g.node(currentV);\n }\n });\n};\nexports.default = { run: run, undo: undo };\n//# sourceMappingURL=normalize.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/normalize.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js ***! - \**************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/add-subgraph-constraints.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/add-subgraph-constraints.js ***! + \******************************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n onMouseEnter: function onMouseEnter(e) {\n var item = e.item;\n this.currentTarget = item;\n this.showTooltip(e);\n this.graph.emit('tooltipchange', {\n item: e.item,\n action: 'show'\n });\n },\n onMouseMove: function onMouseMove(e) {\n if (!this.shouldUpdate(e)) {\n this.hideTooltip();\n return;\n }\n\n if (!this.currentTarget || e.item !== this.currentTarget) {\n return;\n }\n\n this.updatePosition(e);\n },\n onMouseLeave: function onMouseLeave(e) {\n if (!this.shouldEnd(e)) {\n return;\n }\n\n this.hideTooltip();\n this.graph.emit('tooltipchange', {\n item: this.currentTarget,\n action: 'hide'\n });\n this.currentTarget = null;\n },\n showTooltip: function showTooltip(e) {\n var container = this.container;\n\n if (!e.item || e.item.destroyed) {\n return;\n }\n\n if (!container) {\n container = this.createTooltip(this.graph.get('canvas'));\n this.container = container;\n }\n\n var text = this.formatText(e.item.get('model'), e);\n container.innerHTML = text;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.container, {\n visibility: 'visible'\n });\n this.updatePosition(e);\n },\n hideTooltip: function hideTooltip() {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.container, {\n visibility: 'hidden'\n });\n },\n updatePosition: function updatePosition(e) {\n var shouldBegin = this.get('shouldBegin');\n\n var _a = this,\n width = _a.width,\n height = _a.height,\n container = _a.container,\n graph = _a.graph;\n\n if (!shouldBegin(e)) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(container, {\n visibility: 'hidden'\n });\n return;\n }\n\n var point = graph.getPointByClient(e.clientX, e.clientY);\n\n var _b = graph.getCanvasByPoint(point.x, point.y),\n x = _b.x,\n y = _b.y;\n\n var bbox = container.getBoundingClientRect();\n\n if (x > width / 2) {\n x -= bbox.width;\n } else {\n x += this.offset;\n }\n\n if (y > height / 2) {\n y -= bbox.height;\n } else {\n y += this.offset;\n }\n\n var left = \"\".concat(x, \"px\");\n var top = \"\".concat(y, \"px\");\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.container, {\n left: left,\n top: top,\n visibility: 'visible'\n });\n },\n createTooltip: function createTooltip(canvas) {\n var el = canvas.get('el');\n el.style.position = 'relative';\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n el.parentNode.appendChild(container);\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(container, {\n position: 'absolute',\n visibility: 'visible'\n });\n this.width = canvas.get('width');\n this.height = canvas.get('height');\n this.container = container;\n this.graph.get('tooltips').push(container);\n return container;\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar addSubgraphConstraints = function (g, cg, vs) {\n var prev = {};\n var rootPrev;\n vs === null || vs === void 0 ? void 0 : vs.forEach(function (v) {\n var child = g.parent(v);\n var parent;\n var prevChild;\n while (child) {\n parent = g.parent(child);\n if (parent) {\n prevChild = prev[parent];\n prev[parent] = child;\n }\n else {\n prevChild = rootPrev;\n rootPrev = child;\n }\n if (prevChild && prevChild !== child) {\n cg.setEdge(prevChild, child);\n return;\n }\n child = parent;\n }\n });\n};\nexports.default = addSubgraphConstraints;\n//# sourceMappingURL=add-subgraph-constraints.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/add-subgraph-constraints.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/tooltip.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/tooltip.js ***! - \*********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/barycenter.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/barycenter.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _tooltip_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tooltip-base */ \"./node_modules/@antv/g6-pc/es/behavior/tooltip-base.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({\n getDefaultCfg: function getDefaultCfg() {\n return {\n item: 'node',\n offset: 12,\n formatText: function formatText(model) {\n return model.label;\n }\n };\n },\n getEvents: function getEvents() {\n return {\n 'node:mouseenter': 'onMouseEnter',\n 'node:mouseleave': 'onMouseLeave',\n 'node:mousemove': 'onMouseMove',\n afterremoveitem: 'onMouseLeave'\n };\n }\n}, _tooltip_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/tooltip.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar barycenter = function (g, movable) {\n return movable.map(function (v) {\n var inV = g.inEdges(v);\n if (!(inV === null || inV === void 0 ? void 0 : inV.length)) {\n return { v: v };\n }\n {\n var result_1 = { sum: 0, weight: 0 };\n inV === null || inV === void 0 ? void 0 : inV.forEach(function (e) {\n var edge = g.edge(e);\n var nodeU = g.node(e.v);\n result_1.sum += (edge.weight * nodeU.order);\n result_1.weight += edge.weight;\n });\n return {\n v: v,\n barycenter: result_1.sum / result_1.weight,\n weight: result_1.weight\n };\n }\n });\n};\nexports.default = barycenter;\n//# sourceMappingURL=barycenter.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/barycenter.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/behavior/zoom-canvas.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/behavior/zoom-canvas.js ***! - \*************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/build-layer-graph.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/build-layer-graph.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"ext\"].transform;\nvar DELTA = 0.05;\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n getDefaultCfg: function getDefaultCfg() {\n return {\n sensitivity: 2,\n minZoom: undefined,\n maxZoom: undefined,\n enableOptimize: false,\n optimizeZoom: 0.1,\n fixSelectedItems: {\n fixAll: false,\n fixLineWidth: false,\n fixLabel: false,\n fixState: 'selected'\n },\n animate: false,\n animateCfg: {\n duration: 500\n }\n };\n },\n getEvents: function getEvents() {\n var fixSelectedItems = this.fixSelectedItems;\n if (!fixSelectedItems.fixState) fixSelectedItems.fixState = 'selected';\n\n if (fixSelectedItems.fixAll) {\n fixSelectedItems.fixLineWidth = true;\n fixSelectedItems.fixLabel = true;\n }\n\n return {\n wheel: 'onWheel',\n touchstart: 'onTouchStart',\n touchmove: 'onTouchMove',\n touchend: 'onTouchEnd'\n };\n },\n onTouchStart: function onTouchStart(evt) {\n var touches = evt.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n evt.preventDefault(); // 如果不是缩放事件则禁止继续执行\n\n if (!event2) {\n return;\n }\n\n if (this.shouldBegin && !this.shouldBegin.call(this, evt)) {\n return;\n } // 第一个触摸点位置\n\n\n this.startPoint = {\n pageX: event1.pageX,\n pageY: event1.pageY\n };\n this.moveable = true;\n\n if (event2) {\n this.endPoint = {\n pageX: event2.pageX,\n pageY: event2.pageY\n };\n }\n\n this.originScale = this.graph.getZoom() || this.currentScale || 1;\n },\n onTouchMove: function onTouchMove(evt) {\n if (!this.moveable) {\n return;\n }\n\n evt.preventDefault();\n var touches = evt.originalEvent.touches;\n var event1 = touches[0];\n var event2 = touches[1];\n\n if (!event2) {\n return;\n }\n\n if (!this.endPoint) {\n this.endPoint = {\n pageX: event2.pageX,\n pageY: event2.pageY\n };\n } // 获取坐标之间的距离\n\n\n var getDistance = function getDistance(start, end) {\n return Math.hypot(end.x - start.x, end.y - start.y);\n }; // 双指缩放比例\n\n\n var scale = getDistance({\n x: event1.pageX,\n y: event1.pageY\n }, {\n x: event2.pageX,\n y: event2.pageY\n }) / getDistance({\n x: this.startPoint.pageX,\n y: this.startPoint.pageY\n }, {\n x: this.endPoint.pageX,\n y: this.endPoint.pageY\n }); // 应用到画布上的缩放比例\n\n var zoom = this.originScale * scale; // 缓存当前的缩放比例\n\n this.currentScale = zoom;\n var minZoom = this.get('minZoom') || this.graph.get('minZoom');\n var maxZoom = this.get('maxZoom') || this.graph.get('maxZoom');\n\n if (zoom > maxZoom || zoom < minZoom) {\n return;\n }\n\n var animate = this.get('animate');\n var animateCfg = this.get('animateCfg');\n var canvas = this.graph.get('canvas');\n var point = canvas.getPointByClient(evt.clientX, evt.clientY);\n this.graph.zoomTo(zoom, {\n x: point.x,\n y: point.y\n }, animate, animateCfg);\n this.graph.emit('wheelzoom', evt);\n },\n onTouchEnd: function onTouchEnd() {\n this.moveable = false;\n this.endPoint = null;\n },\n onWheel: function onWheel(e) {\n var _this = this;\n\n var _a = this,\n graph = _a.graph,\n fixSelectedItems = _a.fixSelectedItems;\n\n if (this.shouldBegin && !this.shouldBegin.call(this, e)) {\n return;\n }\n\n if (!this.shouldUpdate.call(this, e)) {\n return;\n }\n\n e.preventDefault();\n var canvas = graph.get('canvas');\n var point = canvas.getPointByClient(e.clientX, e.clientY);\n var sensitivity = this.get('sensitivity');\n var graphZoom = graph.getZoom();\n var ratio = graphZoom;\n var zoom = graphZoom; // 兼容IE、Firefox及Chrome\n\n if (e.wheelDelta < 0) {\n ratio = 1 - DELTA * sensitivity;\n } else {\n ratio = 1 / (1 - DELTA * sensitivity);\n }\n\n zoom = graphZoom * ratio;\n var minZoom = this.get('minZoom') || graph.get('minZoom');\n var maxZoom = this.get('maxZoom') || graph.get('maxZoom');\n\n if (zoom > maxZoom) {\n zoom = maxZoom;\n } else if (zoom < minZoom) {\n zoom = minZoom;\n } // hide the shapes when the zoom ratio is smaller than optimizeZoom\n // hide the shapes when zoomming\n\n\n var enableOptimize = this.get('enableOptimize');\n\n if (enableOptimize) {\n var optimizeZoom_1 = this.get('optimizeZoom');\n var optimized = this.get('optimized');\n var nodes_1 = graph.getNodes();\n var edges_1 = graph.getEdges();\n var nodesLength_1 = nodes_1.length;\n var edgesLength_1 = edges_1.length; // hiding\n\n if (!optimized) {\n for (var n = 0; n < nodesLength_1; n++) {\n var node = nodes_1[n];\n\n if (!node.destroyed) {\n var children = node.get('group').get('children');\n var childrenLength = children.length;\n\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n\n if (!shape.destoryed && !shape.get('isKeyShape')) {\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n }\n }\n }\n }\n\n for (var edgeIndex = 0; edgeIndex < edgesLength_1; edgeIndex++) {\n var edge = edges_1[edgeIndex];\n var children = edge.get('group').get('children');\n var childrenLength = children.length;\n\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n shape.set('ori-visibility', shape.get('ori-visibility') || shape.get('visible'));\n shape.hide();\n }\n }\n\n this.set('optimized', true);\n } // showing after 100ms\n\n\n clearTimeout(this.get('timeout'));\n var timeout = setTimeout(function () {\n var currentZoom = graph.getZoom();\n\n var curOptimized = _this.get('optimized');\n\n if (curOptimized) {\n _this.set('optimized', false);\n\n for (var n = 0; n < nodesLength_1; n++) {\n var node = nodes_1[n];\n var children = node.get('group').get('children');\n var childrenLength = children.length;\n\n if (currentZoom < optimizeZoom_1) {\n var keyShape = node.getKeyShape();\n var oriVis = keyShape.get('ori-visibility');\n keyShape.set('ori-visibility', undefined);\n if (oriVis) keyShape.show();\n } else {\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n var oriVis = shape.get('ori-visibility');\n shape.set('ori-visibility', undefined);\n\n if (!shape.get('visible') && oriVis) {\n if (oriVis) shape.show();\n }\n }\n }\n }\n\n for (var edgeIndex = 0; edgeIndex < edgesLength_1; edgeIndex++) {\n var edge = edges_1[edgeIndex];\n var children = edge.get('group').get('children');\n var childrenLength = children.length;\n\n if (currentZoom < optimizeZoom_1) {\n var keyShape = edge.getKeyShape();\n var oriVis = keyShape.get('ori-visibility');\n keyShape.set('ori-visibility', undefined);\n if (oriVis) keyShape.show();\n } else {\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n\n if (!shape.get('visible')) {\n var oriVis = shape.get('ori-visibility');\n shape.set('ori-visibility', undefined);\n if (oriVis) shape.show();\n }\n }\n }\n }\n }\n }, 100);\n this.set('timeout', timeout);\n } // fix the items when zooming\n\n\n if (graphZoom <= 1) {\n var fixNodes = void 0,\n fixEdges = void 0;\n\n if (fixSelectedItems.fixAll || fixSelectedItems.fixLineWidth || fixSelectedItems.fixLabel) {\n fixNodes = graph.findAllByState('node', fixSelectedItems.fixState);\n fixEdges = graph.findAllByState('edge', fixSelectedItems.fixState);\n var scale = graphZoom / zoom;\n var fixNodesLength = fixNodes.length;\n\n for (var fn = 0; fn < fixNodesLength; fn++) {\n var node = fixNodes[fn];\n var group = node.getContainer();\n var nodeModel = node.getModel();\n var originStyle = node.getOriginStyle();\n var itemStateStyle = node.getStateStyle(fixSelectedItems.fixState);\n var shapeStateStyle = node.get('shapeFactory').getShape(nodeModel.type).getStateStyle(fixSelectedItems.fixState, node)[fixSelectedItems.fixState];\n\n if (fixSelectedItems.fixAll) {\n if (zoom <= 1) {\n var groupMatrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(group.getMatrix());\n if (!groupMatrix) groupMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n var _b = node.getModel(),\n x = _b.x,\n y = _b.y;\n\n groupMatrix = transform(groupMatrix, [['t', -x, -y], ['s', scale, scale], ['t', x, y]]);\n group.setMatrix(groupMatrix);\n }\n } else {\n var children = group.get('children');\n var childrenLength = children.length;\n\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n var fontSize = void 0,\n lineWidth = void 0;\n\n if (fixSelectedItems.fixLabel) {\n var shapeType = shape.get('type');\n\n if (shapeType === 'text') {\n fontSize = shape.attr('fontSize') || 12;\n var itemStyle = itemStateStyle[shape.get('name')];\n var shapeStyle = shapeStateStyle[shape.get('name')];\n var itemFontSize = itemStyle ? itemStyle.fontSize : 12;\n var shapeFontSize = shapeStyle ? shapeStyle.fontSize : 12;\n var oriFontSize = itemFontSize || shapeFontSize || 12;\n if (zoom <= 1) shape.attr('fontSize', oriFontSize / zoom); // * graphZoom / zoom\n\n if (lineWidth) break;\n }\n }\n\n if (fixSelectedItems.fixLineWidth) {\n if (shape.get('isKeyShape')) {\n lineWidth = shape.attr('lineWidth') || 0;\n var oriLineWidth = itemStateStyle.lineWidth || shapeStateStyle.lineWidth || originStyle.lineWidth || 0;\n if (zoom <= 1) shape.attr('lineWidth', oriLineWidth / zoom); // * graphZoom / zoom\n\n if (fontSize) break;\n }\n }\n }\n }\n }\n\n var fixEdgesLength = fixEdges.length;\n\n for (var fe = 0; fe < fixEdgesLength; fe++) {\n var edge = fixEdges[fe];\n var group = edge.getContainer();\n var children = group.get('children');\n var nodeModel = edge.getModel();\n var itemStateStyle = edge.getStateStyle(fixSelectedItems.fixState);\n var shapeStateStyle = edge.get('shapeFactory').getShape(nodeModel.type).getStateStyle(fixSelectedItems.fixState, edge)[fixSelectedItems.fixState];\n var childrenLength = children.length;\n\n for (var c = 0; c < childrenLength; c++) {\n var shape = children[c];\n var fontSize = void 0,\n lineWidth = void 0;\n\n if (fixSelectedItems.fixLabel || fixSelectedItems.fixAll) {\n var shapeType = shape.get('type');\n\n if (shapeType === 'text') {\n fontSize = shape.attr('fontSize') || 12;\n var itemStyle = itemStateStyle[shape.get('name')];\n var shapeStyle = shapeStateStyle[shape.get('name')];\n var itemFontSize = itemStyle ? itemStyle.fontSize : 12;\n var shapeFontSize = shapeStyle ? shapeStyle.fontSize : 12;\n var oriFontSize = itemFontSize || shapeFontSize || 12;\n if (zoom <= 1) shape.attr('fontSize', oriFontSize / zoom);\n if (lineWidth) break;\n }\n }\n\n if (fixSelectedItems.fixLineWidth || fixSelectedItems.fixAll) {\n if (shape.get('isKeyShape')) {\n lineWidth = shape.attr('lineWidth') || 0;\n var oriLineWidth = itemStateStyle.lineWidth || shapeStateStyle.lineWidth || 1;\n if (zoom <= 1) shape.attr('lineWidth', oriLineWidth / zoom);\n if (fontSize) break;\n }\n }\n }\n }\n }\n }\n\n var animate = this.get('animate');\n var animateCfg = this.get('animateCfg');\n graph.zoomTo(zoom, {\n x: point.x,\n y: point.y\n }, animate, animateCfg);\n graph.emit('wheelzoom', e);\n }\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/behavior/zoom-canvas.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar graph_1 = __webpack_require__(/*! ../../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\n/*\n * Constructs a graph that can be used to sort a layer of nodes. The graph will\n * contain all base and subgraph nodes from the request layer in their original\n * hierarchy and any edges that are incident on these nodes and are of the type\n * requested by the \"relationship\" parameter.\n *\n * Nodes from the requested rank that do not have parents are assigned a root\n * node in the output graph, which is set in the root graph attribute. This\n * makes it easy to walk the hierarchy of movable nodes during ordering.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG\n * 2. Base nodes in the input graph have a rank attribute\n * 3. Subgraph nodes in the input graph has minRank and maxRank attributes\n * 4. Edges have an assigned weight\n *\n * Post-conditions:\n *\n * 1. Output graph has all nodes in the movable rank with preserved\n * hierarchy.\n * 2. Root nodes in the movable layer are made children of the node\n * indicated by the root attribute of the graph.\n * 3. Non-movable nodes incident on movable nodes, selected by the\n * relationship parameter, are included in the graph (without hierarchy).\n * 4. Edges incident on movable nodes, selected by the relationship\n * parameter, are added to the output graph.\n * 5. The weights for copied edges are aggregated as need, since the output\n * graph is not a multi-graph.\n */\nvar buildLayerGraph = function (g, rank, relationship) {\n var root = createRootNode(g);\n var result = new graph_1.Graph({ compound: true })\n .setGraph({ root: root })\n .setDefaultNodeLabel(function (v) {\n return g.node(v);\n });\n g.nodes().forEach(function (v) {\n var _a;\n var node = g.node(v);\n var parent = g.parent(v);\n if (node.rank === rank ||\n (node.minRank <= rank && rank <= node.maxRank)) {\n result.setNode(v);\n result.setParent(v, parent || root);\n // This assumes we have only short edges!\n (_a = g[relationship](v)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var u = e.v === v ? e.w : e.v;\n var edge = result.edgeFromArgs(u, v);\n var weight = edge !== undefined ? edge.weight : 0;\n result.setEdge(u, v, { weight: g.edge(e).weight + weight });\n });\n if (node.hasOwnProperty(\"minRank\")) {\n result.setNode(v, {\n borderLeft: node.borderLeft[rank],\n borderRight: node.borderRight[rank],\n });\n }\n }\n });\n return result;\n};\nvar createRootNode = function (g) {\n var v;\n while (g.hasNode((v = \"_root\".concat(Math.random()))))\n ;\n return v;\n};\nexports.default = buildLayerGraph;\n//# sourceMappingURL=build-layer-graph.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/build-layer-graph.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/element/index.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/element/index.js ***! - \******************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/cross-count.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/cross-count.js ***! + \*****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_g6_element__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-element */ \"./node_modules/@antv/g6-element/es/index.js\");\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/element/index.js?"); +eval("\n/*\n * A function that takes a layering (an array of layers, each with an array of\n * ordererd nodes) and a graph and returns a weighted crossing count.\n *\n * Pre-conditions:\n *\n * 1. Input graph must be simple (not a multigraph), directed, and include\n * only simple edges.\n * 2. Edges in the input graph must have assigned weights.\n *\n * Post-conditions:\n *\n * 1. The graph and layering matrix are left unchanged.\n *\n * This algorithm is derived from Barth, et al., \"Bilayer Cross Counting.\"\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar twoLayerCrossCount = function (g, northLayer, southLayer) {\n // Sort all of the edges between the north and south layers by their position\n // in the north layer and then the south. Map these edges to the position of\n // their head in the south layer.\n var southPos = (0, util_1.zipObject)(southLayer, southLayer.map(function (v, i) { return i; }));\n var unflat = northLayer.map(function (v) {\n var _a;\n var unsort = (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.map(function (e) {\n return { pos: southPos[e.w] || 0, weight: g.edge(e).weight };\n });\n return unsort === null || unsort === void 0 ? void 0 : unsort.sort(function (a, b) { return a.pos - b.pos; });\n });\n var southEntries = unflat.flat().filter(function (entry) { return entry !== undefined; });\n // Build the accumulator tree\n var firstIndex = 1;\n while (firstIndex < southLayer.length)\n firstIndex <<= 1;\n var treeSize = 2 * firstIndex - 1;\n firstIndex -= 1;\n var tree = Array(treeSize).fill(0, 0, treeSize);\n // Calculate the weighted crossings\n var cc = 0;\n southEntries === null || southEntries === void 0 ? void 0 : southEntries.forEach(function (entry) {\n if (entry) {\n var index = entry.pos + firstIndex;\n tree[index] += entry.weight;\n var weightSum = 0;\n while (index > 0) {\n if (index % 2) {\n weightSum += tree[index + 1];\n }\n index = (index - 1) >> 1;\n tree[index] += entry.weight;\n }\n cc += entry.weight * weightSum;\n }\n });\n return cc;\n};\nvar crossCount = function (g, layering) {\n var cc = 0;\n for (var i = 1; i < (layering === null || layering === void 0 ? void 0 : layering.length); i += 1) {\n cc += twoLayerCrossCount(g, layering[i - 1], layering[i]);\n }\n return cc;\n};\nexports.default = crossCount;\n//# sourceMappingURL=cross-count.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/cross-count.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/global.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/global.js ***! - \***********************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/index.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/index.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _util_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util/color */ \"./node_modules/@antv/g6-pc/es/util/color.js\");\n\nvar subjectColor = 'rgb(95, 149, 255)';\nvar backColor = 'rgb(255, 255, 255)';\nvar textColor = 'rgb(0, 0, 0)';\nvar colorSet = Object(_util_color__WEBPACK_IMPORTED_MODULE_0__[\"getColorsWithSubjectColor\"])(subjectColor, backColor);\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: '0.7.3',\n rootContainerClassName: 'root-container',\n nodeContainerClassName: 'node-container',\n edgeContainerClassName: 'edge-container',\n comboContainerClassName: 'combo-container',\n delegateContainerClassName: 'delegate-container',\n defaultLoopPosition: 'top',\n nodeLabel: {\n style: {\n fill: '#000',\n fontSize: 12,\n textAlign: 'center',\n textBaseline: 'middle'\n },\n offset: 4 // 节点的默认文本不居中时的偏移量\n\n },\n defaultNode: {\n type: 'circle',\n style: {\n lineWidth: 1,\n stroke: colorSet.mainStroke,\n fill: colorSet.mainFill\n },\n size: 20,\n color: colorSet.mainStroke,\n linkPoints: {\n size: 8,\n lineWidth: 1,\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke\n }\n },\n // 节点应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n nodeStateStyles: {\n active: {\n fill: colorSet.activeFill,\n stroke: colorSet.activeStroke,\n lineWidth: 2,\n shadowColor: colorSet.mainStroke,\n shadowBlur: 10\n },\n selected: {\n fill: colorSet.selectedFill,\n stroke: colorSet.selectedStroke,\n lineWidth: 4,\n shadowColor: colorSet.selectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n fill: colorSet.highlightFill,\n stroke: colorSet.highlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n fill: colorSet.inactiveFill,\n stroke: colorSet.inactiveStroke,\n lineWidth: 1\n },\n disable: {\n fill: colorSet.disableFill,\n stroke: colorSet.disableStroke,\n lineWidth: 1\n }\n },\n edgeLabel: {\n style: {\n fill: textColor,\n textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n }\n },\n defaultEdge: {\n type: 'line',\n size: 1,\n style: {\n stroke: colorSet.edgeMainStroke,\n lineAppendWidth: 2\n },\n color: colorSet.edgeMainStroke\n },\n // 边应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n edgeStateStyles: {\n active: {\n stroke: colorSet.edgeActiveStroke,\n lineWidth: 1\n },\n selected: {\n stroke: colorSet.edgeSelectedStroke,\n lineWidth: 2,\n shadowColor: colorSet.edgeSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.edgeHighlightStroke,\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.edgeInactiveStroke,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.edgeDisableStroke,\n lineWidth: 1\n }\n },\n comboLabel: {\n style: {\n fill: textColor,\n // textAlign: 'center',\n textBaseline: 'middle',\n fontSize: 12\n },\n refY: 10,\n refX: 10 // Combo 的默认文本不居中时的偏移量\n\n },\n defaultCombo: {\n type: 'circle',\n style: {\n fill: colorSet.comboMainFill,\n lineWidth: 1,\n stroke: colorSet.comboMainStroke,\n r: 5,\n width: 20,\n height: 10\n },\n size: [20, 5],\n color: colorSet.comboMainStroke,\n padding: [25, 20, 15, 20]\n },\n // combo 应用状态后的样式,默认仅提供 active、selected、highlight、inactive、disable,用户可以自己扩展\n comboStateStyles: {\n active: {\n stroke: colorSet.comboActiveStroke,\n lineWidth: 1,\n fill: colorSet.comboActiveFill\n },\n selected: {\n stroke: colorSet.comboSelectedStroke,\n lineWidth: 2,\n fill: colorSet.comboSelectedFill,\n shadowColor: colorSet.comboSelectedStroke,\n shadowBlur: 10,\n 'text-shape': {\n fontWeight: 500\n }\n },\n highlight: {\n stroke: colorSet.comboHighlightStroke,\n lineWidth: 2,\n fill: colorSet.comboHighlightFill,\n 'text-shape': {\n fontWeight: 500\n }\n },\n inactive: {\n stroke: colorSet.comboInactiveStroke,\n fill: colorSet.comboInactiveFill,\n lineWidth: 1\n },\n disable: {\n stroke: colorSet.comboDisableStroke,\n fill: colorSet.comboDisableFill,\n lineWidth: 1\n }\n },\n delegateStyle: {\n fill: '#F3F9FF',\n fillOpacity: 0.5,\n stroke: '#1890FF',\n strokeOpacity: 0.9,\n lineDash: [5, 5]\n },\n // 文本水印默认配置\n textWaterMarkerConfig: {\n width: 150,\n height: 100,\n compatible: false,\n text: {\n x: 0,\n y: 60,\n lineHeight: 20,\n rotate: 20,\n fontSize: 14,\n fontFamily: 'Microsoft YaHei',\n fill: 'rgba(0, 0, 0, 0.1)',\n baseline: 'Middle'\n }\n },\n imageWaterMarkerConfig: {\n width: 150,\n height: 130,\n compatible: false,\n image: {\n x: 0,\n y: 0,\n width: 30,\n height: 20,\n rotate: 0\n }\n },\n waterMarkerImage: 'https://gw.alipayobjects.com/os/s/prod/antv/assets/image/logo-with-text-73b8a.svg'\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/global.js?"); +eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar init_order_1 = __importDefault(__webpack_require__(/*! ./init-order */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/init-order.js\"));\nvar cross_count_1 = __importDefault(__webpack_require__(/*! ./cross-count */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/cross-count.js\"));\nvar build_layer_graph_1 = __importDefault(__webpack_require__(/*! ./build-layer-graph */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/build-layer-graph.js\"));\nvar add_subgraph_constraints_1 = __importDefault(__webpack_require__(/*! ./add-subgraph-constraints */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/add-subgraph-constraints.js\"));\nvar sort_subgraph_1 = __importDefault(__webpack_require__(/*! ./sort-subgraph */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/sort-subgraph.js\"));\nvar util_1 = __webpack_require__(/*! ../../../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar graph_1 = __webpack_require__(/*! ../../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\nvar util_2 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\n/*\n * Applies heuristics to minimize edge crossings in the graph and sets the best\n * order solution as an order attribute on each node.\n *\n * Pre-conditions:\n *\n * 1. Graph must be DAG\n * 2. Graph nodes must be objects with a \"rank\" attribute\n * 3. Graph edges must have the \"weight\" attribute\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have an \"order\" attribute based on the results of the\n * algorithm.\n */\nvar order = function (g, keepNodeOrder) {\n var mxRank = (0, util_2.maxRank)(g);\n var range1 = [];\n var range2 = [];\n for (var i = 1; i < mxRank + 1; i++)\n range1.push(i);\n for (var i = mxRank - 1; i > -1; i--)\n range2.push(i);\n var downLayerGraphs = buildLayerGraphs(g, range1, \"inEdges\");\n var upLayerGraphs = buildLayerGraphs(g, range2, \"outEdges\");\n var layering = (0, init_order_1.default)(g);\n assignOrder(g, layering);\n var bestCC = Number.POSITIVE_INFINITY;\n var best;\n for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {\n sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2, false, keepNodeOrder);\n layering = (0, util_2.buildLayerMatrix)(g);\n var cc = (0, cross_count_1.default)(g, layering);\n if (cc < bestCC) {\n lastBest = 0;\n best = (0, util_1.clone)(layering);\n bestCC = cc;\n }\n }\n // consider use previous result, maybe somewhat reduendant\n layering = (0, init_order_1.default)(g);\n assignOrder(g, layering);\n for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {\n sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2, true, keepNodeOrder);\n layering = (0, util_2.buildLayerMatrix)(g);\n var cc = (0, cross_count_1.default)(g, layering);\n if (cc < bestCC) {\n lastBest = 0;\n best = (0, util_1.clone)(layering);\n bestCC = cc;\n }\n }\n assignOrder(g, best);\n};\nvar buildLayerGraphs = function (g, ranks, relationship) {\n return ranks.map(function (rank) {\n return (0, build_layer_graph_1.default)(g, rank, relationship);\n });\n};\nvar sweepLayerGraphs = function (layerGraphs, biasRight, usePrev, keepNodeOrder) {\n var cg = new graph_1.Graph();\n layerGraphs === null || layerGraphs === void 0 ? void 0 : layerGraphs.forEach(function (lg) {\n var _a;\n var root = lg.graph().root;\n var sorted = (0, sort_subgraph_1.default)(lg, root, cg, biasRight, usePrev, keepNodeOrder);\n for (var i = 0; i < ((_a = sorted.vs) === null || _a === void 0 ? void 0 : _a.length) || 0; i++) {\n var lnode = lg.node(sorted.vs[i]);\n if (lnode) {\n lnode.order = i;\n }\n }\n (0, add_subgraph_constraints_1.default)(lg, cg, sorted.vs);\n });\n};\nvar assignOrder = function (g, layering) {\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v, i) {\n g.node(v).order = i;\n });\n });\n};\nexports.default = order;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/graph/controller/event.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/graph/controller/event.js ***! - \***************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/init-data-order.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/init-data-order.js ***! + \*********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n\n\n\n\nvar cloneEvent = _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].cloneEvent,\n isViewportChanged = _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].isViewportChanged;\n\nvar EventController =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(EventController, _super);\n\n function EventController(graph) {\n var _this = _super.call(this, graph) || this;\n\n _this.extendEvents = [];\n _this.dragging = false;\n _this.preItem = null;\n _this.graph = graph;\n _this.destroyed = false;\n\n _this.initEvents();\n\n return _this;\n } // 初始化 G6 中的事件\n\n\n EventController.prototype.initEvents = function () {\n var _a = this,\n graph = _a.graph,\n _b = _a.extendEvents,\n extendEvents = _b === void 0 ? [] : _b;\n\n var canvas = graph.get('canvas'); // canvas.set('draggable', true);\n\n var el = canvas.get('el');\n var canvasHandler = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"wrapBehavior\"])(this, 'onCanvasEvents');\n var originHandler = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"wrapBehavior\"])(this, 'onExtendEvents');\n var wheelHandler = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"wrapBehavior\"])(this, 'onWheelEvent'); // each(EVENTS, event => {\n // canvas.off(event).on(event, canvasHandler);\n // });\n\n canvas.off('*').on('*', canvasHandler);\n this.canvasHandler = canvasHandler;\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(el, 'DOMMouseScroll', wheelHandler));\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(el, 'mousewheel', wheelHandler));\n\n if (typeof window !== 'undefined') {\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(window, 'keydown', originHandler));\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(window, 'keyup', originHandler));\n extendEvents.push(Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"addEventListener\"])(window, 'focus', originHandler));\n }\n }; // 获取 shape 的 item 对象\n\n\n EventController.getItemRoot = function (shape) {\n while (shape && !shape.get('item')) {\n shape = shape.get('parent');\n }\n\n return shape;\n };\n /**\n * 处理 canvas 事件\n * @param evt 事件句柄\n */\n\n\n EventController.prototype.onCanvasEvents = function (evt) {\n var graph = this.graph;\n var canvas = graph.get('canvas');\n var target = evt.target;\n var eventType = evt.type;\n /**\n * (clientX, clientY): 相对于页面的坐标;\n * (canvasX, canvasY): 相对于 左上角的坐标;\n * (x, y): 相对于整个画布的坐标, 与 model 的 x, y 是同一维度的。\n */\n\n evt.canvasX = evt.x;\n evt.canvasY = evt.y;\n var point = {\n x: evt.canvasX,\n y: evt.canvasY\n };\n var group = graph.get('group');\n var matrix = group.getMatrix();\n\n if (!matrix) {\n matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n }\n\n if (isViewportChanged(matrix)) {\n point = graph.getPointByClient(evt.clientX, evt.clientY);\n }\n\n evt.x = point.x;\n evt.y = point.y;\n evt.currentTarget = graph;\n\n if (target === canvas) {\n if (eventType === 'mousemove' || eventType === 'mouseleave') {\n this.handleMouseMove(evt, 'canvas');\n }\n\n evt.target = canvas;\n evt.item = null;\n graph.emit(eventType, evt);\n graph.emit(\"canvas:\".concat(eventType), evt);\n return;\n }\n\n var itemShape = EventController.getItemRoot(target);\n\n if (!itemShape) {\n graph.emit(eventType, evt);\n return;\n }\n\n var item = itemShape.get('item');\n\n if (item.destroyed) {\n return;\n }\n\n var type = item.getType(); // 事件target是触发事件的Shape实例,item是触发事件的item实例\n\n evt.target = target;\n evt.item = item;\n\n if (evt.canvasX === evt.x && evt.canvasY === evt.y) {\n var canvasPoint = graph.getCanvasByPoint(evt.x, evt.y);\n evt.canvasX = canvasPoint.x;\n evt.canvasY = canvasPoint.y;\n } // emit('click', evt);\n\n\n graph.emit(eventType, evt);\n if (evt.name && !evt.name.includes(':')) graph.emit(\"\".concat(type, \":\").concat(eventType), evt); // emit('node:click', evt)\n else graph.emit(evt.name, evt); // emit('text-shape:click', evt)\n\n if (eventType === 'dragstart') {\n this.dragging = true;\n }\n\n if (eventType === 'dragend') {\n this.dragging = false;\n }\n\n if (eventType === 'mousemove') {\n this.handleMouseMove(evt, type);\n }\n };\n /**\n * 处理扩展事件\n * @param evt 事件句柄\n */\n\n\n EventController.prototype.onExtendEvents = function (evt) {\n this.graph.emit(evt.type, evt);\n };\n /**\n * 处理滚轮事件\n * @param evt 事件句柄\n */\n\n\n EventController.prototype.onWheelEvent = function (evt) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNil\"])(evt.wheelDelta)) {\n evt.wheelDelta = -evt.detail;\n }\n\n this.graph.emit('wheel', evt);\n };\n /**\n * 处理鼠标移动的事件\n * @param evt 事件句柄\n * @param type item 类型\n */\n\n\n EventController.prototype.handleMouseMove = function (evt, type) {\n var _a = this,\n graph = _a.graph,\n preItem = _a.preItem;\n\n var canvas = graph.get('canvas');\n var item = evt.target === canvas ? null : evt.item;\n evt = cloneEvent(evt); // 从前一个item直接移动到当前item,触发前一个item的leave事件\n\n if (preItem && preItem !== item && !preItem.destroyed) {\n evt.item = preItem;\n this.emitCustomEvent(preItem.getType(), 'mouseleave', evt);\n\n if (this.dragging) {\n this.emitCustomEvent(preItem.getType(), 'dragleave', evt);\n }\n } // 从一个item或canvas移动到当前item,触发当前item的enter事件\n\n\n if (item && preItem !== item) {\n evt.item = item;\n this.emitCustomEvent(type, 'mouseenter', evt);\n\n if (this.dragging) {\n this.emitCustomEvent(type, 'dragenter', evt);\n }\n }\n\n this.preItem = item;\n };\n /**\n * 在 graph 上面 emit 事件\n * @param itemType item 类型\n * @param eventType 事件类型\n * @param evt 事件句柄\n */\n\n\n EventController.prototype.emitCustomEvent = function (itemType, eventType, evt) {\n evt.type = eventType;\n this.graph.emit(\"\".concat(itemType, \":\").concat(eventType), evt);\n };\n\n EventController.prototype.destroy = function () {\n var _a = this,\n graph = _a.graph,\n canvasHandler = _a.canvasHandler,\n extendEvents = _a.extendEvents;\n\n var canvas = graph.get('canvas'); // each(EVENTS, event => {\n // canvas.off(event, canvasHandler);\n // });\n\n canvas.off('*', canvasHandler);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(extendEvents, function (event) {\n event.remove();\n });\n this.dragging = false;\n this.preItem = null;\n this.extendEvents.length = 0;\n this.canvasHandler = null;\n this.destroyed = true;\n };\n\n return EventController;\n}(_antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"AbstractEvent\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (EventController);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/controller/event.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * 按照数据中的结果设置fixorder\n */\nvar initDataOrder = function (g, nodeOrder) {\n var simpleNodes = g.nodes().filter(function (v) {\n var _a;\n return !((_a = g.children(v)) === null || _a === void 0 ? void 0 : _a.length);\n });\n var ranks = simpleNodes.map(function (v) { return g.node(v).rank; });\n var maxRank = Math.max.apply(Math, ranks);\n var layers = [];\n for (var i = 0; i < maxRank + 1; i++) {\n layers[i] = [];\n }\n nodeOrder === null || nodeOrder === void 0 ? void 0 : nodeOrder.forEach(function (n) {\n var node = g.node(n);\n // 只考虑原有节点,dummy节点需要按照后续算法排出\n if (!node || (node === null || node === void 0 ? void 0 : node.dummy)) {\n return;\n }\n if (!isNaN(node.rank)) {\n node.fixorder = layers[node.rank].length; // 设置fixorder为当层的顺序\n layers[node.rank].push(n);\n }\n });\n};\nexports.default = initDataOrder;\n//# sourceMappingURL=init-data-order.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/init-data-order.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/graph/controller/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/graph/controller/index.js ***! - \***************************************************************/ -/*! exports provided: EventController, LayoutController */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/init-order.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/init-order.js ***! + \****************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _event__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./event */ \"./node_modules/@antv/g6-pc/es/graph/controller/event.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EventController\", function() { return _event__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/g6-pc/es/graph/controller/layout.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LayoutController\", function() { return _layout__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/controller/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/index.js\");\n/*\n * Assigns an initial order value for each node by performing a DFS search\n * starting from nodes in the first rank. Nodes are assigned an order in their\n * rank as they are first visited.\n *\n * This approach comes from Gansner, et al., \"A Technique for Drawing Directed\n * Graphs.\"\n *\n * Returns a layering matrix with an array per layer and each layer sorted by\n * the order of its nodes.\n */\nvar initOrder = function (g) {\n var visited = {};\n var simpleNodes = g.nodes().filter(function (v) {\n var _a;\n return !((_a = g.children(v)) === null || _a === void 0 ? void 0 : _a.length);\n });\n var nodeRanks = simpleNodes.map(function (v) { return g.node(v).rank; });\n var maxRank = (0, util_1.max)(nodeRanks);\n var layers = [];\n for (var i = 0; i < maxRank + 1; i++) {\n layers.push([]);\n }\n var dfs = function (v) {\n var _a;\n if (visited.hasOwnProperty(v))\n return;\n visited[v] = true;\n var node = g.node(v);\n if (!isNaN(node.rank)) {\n layers[node.rank].push(v);\n }\n (_a = g.successors(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { return dfs(child); });\n };\n var orderedVs = simpleNodes.sort(function (a, b) { return g.node(a).rank - g.node(b).rank; });\n // const orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v)!.rank; });\n // 有fixOrder的,直接排序好放进去\n var beforeSort = orderedVs.filter(function (n) {\n return g.node(n).fixorder !== undefined;\n });\n var fixOrderNodes = beforeSort.sort(function (a, b) { return g.node(a).fixorder - g.node(b).fixorder; });\n fixOrderNodes === null || fixOrderNodes === void 0 ? void 0 : fixOrderNodes.forEach(function (n) {\n if (!isNaN(g.node(n).rank)) {\n layers[g.node(n).rank].push(n);\n }\n visited[n] = true;\n });\n orderedVs === null || orderedVs === void 0 ? void 0 : orderedVs.forEach(dfs);\n return layers;\n};\nexports.default = initOrder;\n//# sourceMappingURL=init-order.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/init-order.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/graph/controller/layout.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/graph/controller/layout.js ***! - \****************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/resolve-conflicts.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/resolve-conflicts.js ***! + \***********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../layout */ \"./node_modules/@antv/g6-pc/es/layout/index.js\");\n/* harmony import */ var _layout_worker_layout_worker__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../../layout/worker/layout.worker */ \"./node_modules/@antv/g6-pc/es/layout/worker/layout.worker.js\");\n/* harmony import */ var _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../../layout/worker/layoutConst */ \"./node_modules/@antv/g6-pc/es/layout/worker/layoutConst.js\");\n/* harmony import */ var _util_gpu__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../../util/gpu */ \"./node_modules/@antv/g6-pc/es/util/gpu.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\n\n\n\n\n\n\n // eslint-disable-next-line @typescript-eslint/no-implied-eval\n\nvar mockRaf = function mockRaf(cb) {\n return setTimeout(cb, 16);\n};\n\nvar mockCaf = function mockCaf(reqId) {\n return clearTimeout(reqId);\n};\n\nvar helper = {\n // pollyfill\n requestAnimationFrame: function requestAnimationFrame(callback) {\n var fn = typeof window !== 'undefined' ? window.requestAnimationFrame || window.webkitRequestAnimationFrame || mockRaf : mockRaf;\n return fn(callback);\n },\n cancelAnimationFrame: function cancelAnimationFrame(requestId) {\n var fn = typeof window !== 'undefined' ? window.cancelAnimationFrame || window.webkitCancelAnimationFrame || mockCaf : mockCaf;\n return fn(requestId);\n }\n};\nvar GPU_LAYOUT_NAMES = ['fruchterman', 'gForce'];\nvar LAYOUT_PIPES_ADJUST_NAMES = ['force', 'grid', 'circular'];\n\nvar LayoutController =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(LayoutController, _super); // the configurations of the layout\n // private layoutCfg: any; // LayoutOptions\n // the type name of the layout\n // private layoutType: string;\n // private data: GraphData;\n // private layoutMethods: typeof Layout;\n\n\n function LayoutController(graph) {\n var _this = _super.call(this, graph) || this;\n\n _this.graph = graph;\n _this.layoutCfg = graph.get('layout') || {};\n _this.layoutType = _this.getLayoutType();\n _this.worker = null;\n _this.workerData = {};\n\n _this.initLayout();\n\n return _this;\n } // eslint-disable-next-line class-methods-use-this\n\n\n LayoutController.prototype.initLayout = function () {// no data before rendering\n }; // get layout worker and create one if not exists\n\n\n LayoutController.prototype.getWorker = function () {\n if (this.worker) {\n return this.worker;\n }\n\n if (typeof Worker === 'undefined') {\n // 如果当前浏览器不支持 web worker,则不使用 web worker\n console.warn('Web worker is not supported in current browser.');\n this.worker = null;\n } else {\n this.worker = Object(_layout_worker_layout_worker__WEBPACK_IMPORTED_MODULE_3__[\"LayoutWorker\"])(this.layoutCfg.workerScriptURL);\n }\n\n return this.worker;\n }; // stop layout worker\n\n\n LayoutController.prototype.stopWorker = function () {\n var workerData = this.workerData;\n\n if (!this.worker) {\n return;\n }\n\n this.worker.terminate();\n this.worker = null; // 重新开始新的布局之前,先取消之前布局的requestAnimationFrame。\n\n if (workerData.requestId) {\n helper.cancelAnimationFrame(workerData.requestId);\n workerData.requestId = null;\n }\n\n if (workerData.requestId2) {\n helper.cancelAnimationFrame(workerData.requestId2);\n workerData.requestId2 = null;\n }\n };\n\n LayoutController.prototype.execLayoutMethod = function (layoutCfg, order) {\n var _this = this;\n\n return new Promise(function (reslove, reject) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n var graph, layoutType, isForce, onTick_1, animate_1, isDefaultAnimateLayout_1, tick, enableTick, layoutMethod, onTick_2, tick, layoutData;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n graph = this.graph;\n if (!graph || graph.get('destroyed')) return [2\n /*return*/\n ];\n layoutType = layoutCfg.type; // 每个布局方法都需要注册\n\n layoutCfg.onLayoutEnd = function () {\n graph.emit('aftersublayout', {\n type: layoutType\n });\n reslove();\n }; // 若用户指定开启 gpu,且当前浏览器支持 webgl,且该算法存在 GPU 版本(目前仅支持 fruchterman 和 gForce),使用 gpu 版本的布局\n\n\n if (layoutType && this.isGPU) {\n if (!this.hasGPUVersion(layoutType)) {\n console.warn(\"The '\".concat(layoutType, \"' layout does not support GPU calculation for now, it will run in CPU.\"));\n } else {\n layoutType = \"\".concat(layoutType, \"-gpu\");\n }\n }\n\n isForce = layoutType === 'force' || layoutType === 'g6force' || layoutType === 'gForce' || layoutType === 'force2';\n\n if (isForce) {\n onTick_1 = layoutCfg.onTick, animate_1 = layoutCfg.animate;\n isDefaultAnimateLayout_1 = animate_1 === undefined && (layoutType === 'force' || layoutType === 'force2');\n\n tick = function tick() {\n if (onTick_1) {\n onTick_1();\n }\n\n if (animate_1 || isDefaultAnimateLayout_1) graph.refreshPositions();\n };\n\n layoutCfg.tick = tick;\n } else if (layoutType === 'comboForce' || layoutType === 'comboCombined') {\n layoutCfg.comboTrees = graph.get('comboTrees');\n }\n\n enableTick = false;\n\n try {\n layoutMethod = new _layout__WEBPACK_IMPORTED_MODULE_2__[\"Layout\"][layoutType](layoutCfg);\n\n if (this.layoutMethods[order]) {\n this.layoutMethods[order].destroy();\n }\n\n this.layoutMethods[order] = layoutMethod;\n } catch (e) {\n console.warn(\"The layout method: '\".concat(layoutType, \"' does not exist! Please specify it first.\"));\n reject();\n } // 是否需要迭代的方式完成布局。这里是来自布局对象的实例属性,是由布局的定义者在布局类定义的。\n\n\n enableTick = layoutMethod.enableTick;\n\n if (enableTick) {\n onTick_2 = layoutCfg.onTick;\n\n tick = function tick() {\n if (onTick_2) {\n onTick_2();\n }\n\n graph.refreshPositions();\n };\n\n layoutMethod.tick = tick;\n }\n\n layoutData = this.filterLayoutData(this.data, layoutCfg);\n addLayoutOrder(layoutData, order);\n layoutMethod.init(layoutData); // 若存在节点没有位置信息,且没有设置 layout,在 initPositions 中 random 给出了所有节点的位置,不需要再次执行 random 布局\n // 所有节点都有位置信息,且指定了 layout,则执行布局(代表不是第一次进行布局)\n\n graph.emit('beforesublayout', {\n type: layoutType\n });\n return [4\n /*yield*/\n , layoutMethod.execute()];\n\n case 1:\n _a.sent();\n\n if (layoutMethod.isCustomLayout && layoutCfg.onLayoutEnd) layoutCfg.onLayoutEnd();\n return [2\n /*return*/\n ];\n }\n });\n });\n });\n };\n\n LayoutController.prototype.updateLayoutMethod = function (layoutMethod, layoutCfg) {\n var _this = this;\n\n return new Promise(function (reslove, reject) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n var graph, layoutType, layoutData;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n graph = this.graph;\n layoutType = layoutCfg === null || layoutCfg === void 0 ? void 0 : layoutCfg.type; // 每个布局方法都需要注册\n\n layoutCfg.onLayoutEnd = function () {\n graph.emit('aftersublayout', {\n type: layoutType\n });\n reslove();\n };\n\n layoutData = this.filterLayoutData(this.data, layoutCfg);\n layoutMethod.init(layoutData);\n layoutMethod.updateCfg(layoutCfg);\n graph.emit('beforesublayout', {\n type: layoutType\n });\n return [4\n /*yield*/\n , layoutMethod.execute()];\n\n case 1:\n _a.sent();\n\n if (layoutMethod.isCustomLayout && layoutCfg.onLayoutEnd) layoutCfg.onLayoutEnd();\n return [2\n /*return*/\n ];\n }\n });\n });\n });\n };\n /**\n * @param {function} success callback\n * @return {boolean} 是否使用web worker布局\n */\n\n\n LayoutController.prototype.layout = function (success) {\n var _this = this;\n\n var graph = this.graph;\n this.data = this.setDataFromGraph();\n var _a = this.data,\n nodes = _a.nodes,\n hiddenNodes = _a.hiddenNodes;\n\n if (!nodes) {\n return false;\n }\n\n var width = graph.get('width');\n var height = graph.get('height');\n var layoutCfg = {};\n Object.assign(layoutCfg, {\n width: width,\n height: height,\n center: [width / 2, height / 2]\n }, this.layoutCfg);\n this.layoutCfg = layoutCfg;\n var layoutType = layoutCfg.type;\n var preLayoutTypes = this.destoryLayoutMethods();\n graph.emit('beforelayout'); // 增量情况下(上一次的布局与当前布局一致),使用 treakInit\n\n if ((preLayoutTypes === null || preLayoutTypes === void 0 ? void 0 : preLayoutTypes.length) && layoutType && (preLayoutTypes === null || preLayoutTypes === void 0 ? void 0 : preLayoutTypes.length) === 1 && preLayoutTypes[0] === layoutType) {\n this.tweakInit();\n } else {\n // 初始化位置,若配置了 preset,则使用 preset 的参数生成布局作为预布局,否则使用 grid\n this.initPositions(layoutCfg.center, nodes);\n } // init hidden nodes\n\n\n this.initPositions(layoutCfg.center, hiddenNodes); // 防止用户直接用 -gpu 结尾指定布局\n\n if (layoutType && layoutType.split('-')[1] === 'gpu') {\n layoutType = layoutType.split('-')[0];\n layoutCfg.gpuEnabled = true;\n } // 若用户指定开启 gpu,且当前浏览器支持 webgl,且该算法存在 GPU 版本(目前仅支持 fruchterman 和 gForce),使用 gpu 版本的布局\n\n\n var enableGPU = false;\n\n if (layoutCfg.gpuEnabled) {\n enableGPU = true; // 打开下面语句将会导致 webworker 报找不到 window\n\n if (!Object(_util_gpu__WEBPACK_IMPORTED_MODULE_5__[\"gpuDetector\"])().webgl) {\n console.warn(\"Your browser does not support webGL or GPGPU. The layout will run in CPU.\");\n enableGPU = false;\n }\n }\n\n this.isGPU = enableGPU; // 在 onAllLayoutEnd 中执行用户自定义 onLayoutEnd,触发 afterlayout、更新节点位置、fitView/fitCenter、触发 afterrender\n\n var onLayoutEnd = layoutCfg.onLayoutEnd,\n layoutEndFormatted = layoutCfg.layoutEndFormatted,\n adjust = layoutCfg.adjust;\n\n if (!layoutEndFormatted) {\n layoutCfg.layoutEndFormatted = true;\n\n layoutCfg.onAllLayoutEnd = function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n // 执行用户自定义 onLayoutEnd\n if (onLayoutEnd) {\n onLayoutEnd(nodes);\n } // 更新节点位置\n\n\n this.refreshLayout();\n if (!(adjust && layoutCfg.pipes)) return [3\n /*break*/\n , 2];\n return [4\n /*yield*/\n , this.adjustPipesBox(this.data, adjust)];\n\n case 1:\n _a.sent();\n\n this.refreshLayout();\n _a.label = 2;\n\n case 2:\n // 触发 afterlayout\n graph.emit('afterlayout');\n return [2\n /*return*/\n ];\n }\n });\n });\n };\n }\n\n this.stopWorker();\n\n if (layoutCfg.workerEnabled && this.layoutWithWorker(this.data, success)) {\n // 如果启用布局web worker并且浏览器支持web worker,用web worker布局。否则回退到不用web worker布局。\n return true;\n }\n\n var start = Promise.resolve();\n var hasLayout = false;\n\n if (layoutCfg.type) {\n hasLayout = true;\n start = start.then(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4\n /*yield*/\n , this.execLayoutMethod(layoutCfg, 0)];\n\n case 1:\n return [2\n /*return*/\n , _a.sent()];\n }\n });\n });\n });\n } else if (layoutCfg.pipes) {\n hasLayout = true;\n layoutCfg.pipes.forEach(function (cfg, index) {\n start = start.then(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4\n /*yield*/\n , this.execLayoutMethod(cfg, index)];\n\n case 1:\n return [2\n /*return*/\n , _a.sent()];\n }\n });\n });\n });\n });\n }\n\n if (hasLayout) {\n // 最后统一在外部调用onAllLayoutEnd\n start.then(function () {\n if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd(); // 在执行 execute 后立即执行 success,且在 timeBar 中有 throttle,可以防止 timeBar 监听 afterrender 进行 changeData 后 layout,从而死循环\n // 对于 force 一类布局完成后的 fitView 需要用户自己在 onLayoutEnd 中配置\n\n if (success) success();\n }).catch(function (error) {\n console.warn('graph layout failed,', error);\n });\n } else {\n // 无布局配置\n graph.refreshPositions();\n success === null || success === void 0 ? void 0 : success();\n }\n\n return false;\n };\n /**\n * 增量数据初始化位置\n */\n\n\n LayoutController.prototype.tweakInit = function () {\n var _a = this,\n data = _a.data,\n graph = _a.graph;\n\n var nodes = data.nodes,\n edges = data.edges;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length)) return;\n var positionMap = {};\n nodes.forEach(function (node) {\n var x = node.x,\n y = node.y;\n\n if (!isNaN(x) && !isNaN(y)) {\n positionMap[node.id] = {\n x: x,\n y: y\n }; // 有位置信息,则是原有节点,增加 mass\n\n node.mass = node.mass || 2;\n }\n });\n edges.forEach(function (edge) {\n var source = edge.source,\n target = edge.target;\n var sourcePosition = positionMap[source];\n var targetPosition = positionMap[target];\n\n if (!sourcePosition && targetPosition) {\n positionMap[source] = {\n x: targetPosition.x + (Math.random() - 0.5) * 80,\n y: targetPosition.y + (Math.random() - 0.5) * 80\n };\n } else if (!targetPosition && sourcePosition) {\n positionMap[target] = {\n x: sourcePosition.x + (Math.random() - 0.5) * 80,\n y: sourcePosition.y + (Math.random() - 0.5) * 80\n };\n }\n });\n var width = graph.get('width');\n var height = graph.get('height');\n nodes.forEach(function (node) {\n var position = positionMap[node.id] || {\n x: width / 2 + (Math.random() - 0.5) * 20,\n y: height / 2 + (Math.random() - 0.5) * 20\n };\n node.x = position.x;\n node.y = position.y;\n });\n };\n\n LayoutController.prototype.initWithPreset = function () {\n var _a = this,\n layoutCfg = _a.layoutCfg,\n data = _a.data;\n\n var preset = layoutCfg.preset;\n if (!(preset === null || preset === void 0 ? void 0 : preset.type) || !_layout__WEBPACK_IMPORTED_MODULE_2__[\"Layout\"][preset === null || preset === void 0 ? void 0 : preset.type]) return false;\n var presetLayout = new _layout__WEBPACK_IMPORTED_MODULE_2__[\"Layout\"][preset === null || preset === void 0 ? void 0 : preset.type](preset);\n presetLayout.layout(data);\n delete layoutCfg.preset;\n return true;\n };\n /**\n * layout with web worker\n * @param {object} data graph data\n * @return {boolean} 是否支持web worker\n */\n\n\n LayoutController.prototype.layoutWithWorker = function (data, success) {\n var _this = this;\n\n var _a = this,\n layoutCfg = _a.layoutCfg,\n graph = _a.graph;\n\n var worker = this.getWorker(); // 每次worker message event handler调用之间的共享数据,会被修改。\n\n var workerData = this.workerData;\n\n if (!worker) {\n return false;\n }\n\n workerData.requestId = null;\n workerData.requestId2 = null;\n workerData.currentTick = null;\n workerData.currentTickData = null;\n graph.emit('beforelayout');\n var start = Promise.resolve();\n var hasLayout = false;\n\n if (layoutCfg.type) {\n hasLayout = true;\n start = start.then(function () {\n return _this.runWebworker(worker, data, layoutCfg);\n });\n } else if (layoutCfg.pipes) {\n hasLayout = true;\n\n var _loop_1 = function _loop_1(cfg) {\n start = start.then(function () {\n return _this.runWebworker(worker, data, cfg);\n });\n };\n\n for (var _i = 0, _b = layoutCfg.pipes; _i < _b.length; _i++) {\n var cfg = _b[_i];\n\n _loop_1(cfg);\n }\n }\n\n if (hasLayout) {\n // 最后统一在外部调用onAllLayoutEnd\n start.then(function () {\n if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd();\n success === null || success === void 0 ? void 0 : success();\n }).catch(function (error) {\n console.error('layout failed', error);\n });\n }\n\n return true;\n };\n\n LayoutController.prototype.runWebworker = function (worker, allData, layoutCfg) {\n var _this = this;\n\n var isGPU = this.isGPU;\n var data = this.filterLayoutData(allData, layoutCfg);\n var nodes = data.nodes,\n edges = data.edges;\n var offScreenCanvas = document.createElement('canvas');\n var gpuWorkerAbility = isGPU && typeof window !== 'undefined' && // eslint-disable-next-line @typescript-eslint/dot-notation\n window.navigator && !navigator[\"gpu\"] && // WebGPU 还不支持 OffscreenCanvas\n 'OffscreenCanvas' in window && 'transferControlToOffscreen' in offScreenCanvas; // NOTE: postMessage的message参数里面不能包含函数,否则postMessage会报错,\n // 例如:'function could not be cloned'。\n // 详情参考:https://developer.mozilla.org/en-US/docs/Web/API/Web_Workers_API/Structured_clone_algorithm\n // 所以这里需要把过滤layoutCfg里的函数字段过滤掉。\n\n var filteredLayoutCfg = filterObject(layoutCfg, function (value) {\n return typeof value !== 'function';\n });\n\n if (!gpuWorkerAbility) {\n worker.postMessage({\n type: _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].RUN,\n nodes: nodes,\n edges: edges,\n layoutCfg: filteredLayoutCfg\n });\n } else {\n var offscreen = offScreenCanvas.transferControlToOffscreen(); // filteredLayoutCfg.canvas = offscreen;\n\n filteredLayoutCfg.type = \"\".concat(filteredLayoutCfg.type, \"-gpu\");\n worker.postMessage({\n type: _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].GPURUN,\n nodes: nodes,\n edges: edges,\n layoutCfg: filteredLayoutCfg,\n canvas: offscreen\n }, [offscreen]);\n }\n\n return new Promise(function (reslove, reject) {\n worker.onmessage = function (event) {\n _this.handleWorkerMessage(reslove, reject, event, data, layoutCfg);\n };\n });\n }; // success callback will be called when updating graph positions for the first time.\n\n\n LayoutController.prototype.handleWorkerMessage = function (reslove, reject, event, data, layoutCfg) {\n var _a = this,\n graph = _a.graph,\n workerData = _a.workerData;\n\n var eventData = event.data;\n var type = eventData.type;\n\n var onTick = function onTick() {\n if (layoutCfg.onTick) {\n layoutCfg.onTick();\n }\n };\n\n switch (type) {\n case _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].TICK:\n workerData.currentTick = eventData.currentTick;\n workerData.currentTickData = eventData;\n\n if (!workerData.requestId) {\n workerData.requestId = helper.requestAnimationFrame(function requestId() {\n updateLayoutPosition(data, eventData);\n graph.refreshPositions();\n onTick();\n\n if (eventData.currentTick === eventData.totalTicks) {\n // 如果是最后一次tick\n reslove();\n } else if (workerData.currentTick === eventData.totalTicks) {\n // 注意这里workerData.currentTick可能已经不再是前面赋值时候的值了,\n // 因为在requestAnimationFrame等待时间里,可能产生新的tick。\n // 如果当前tick不是最后一次tick,并且所有的tick消息都已发出来了,那么需要用最后一次tick的数据再刷新一次。\n workerData.requestId2 = helper.requestAnimationFrame(function requestId2() {\n updateLayoutPosition(data, workerData.currentTickData);\n graph.refreshPositions();\n workerData.requestId2 = null;\n onTick();\n reslove();\n });\n }\n\n workerData.requestId = null;\n });\n }\n\n break;\n\n case _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].END:\n // 如果没有tick消息(非力导布局)\n if (workerData.currentTick == null) {\n updateLayoutPosition(data, eventData);\n reslove();\n }\n\n break;\n\n case _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].GPUEND:\n // 如果没有tick消息(非力导布局)\n if (workerData.currentTick == null) {\n updateGPUWorkerLayoutPosition(data, eventData);\n reslove();\n }\n\n break;\n\n case _layout_worker_layoutConst__WEBPACK_IMPORTED_MODULE_4__[\"LAYOUT_MESSAGE\"].ERROR:\n console.warn('Web-Worker layout error!', eventData.message);\n reject();\n break;\n\n default:\n reject();\n break;\n }\n }; // 更新布局参数\n\n\n LayoutController.prototype.updateLayoutCfg = function (cfg) {\n var _this = this;\n\n var _a = this,\n graph = _a.graph,\n layoutMethods = _a.layoutMethods; // disableTriggerLayout 不触发重新布局,仅更新参数\n\n\n var disableTriggerLayout = cfg.disableTriggerLayout,\n otherCfg = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__rest\"])(cfg, [\"disableTriggerLayout\"]);\n\n var layoutCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_6__[\"mix\"])({}, this.layoutCfg, otherCfg);\n this.layoutCfg = layoutCfg; // disableTriggerLayout 不触发重新布局,仅更新参数\n\n if (disableTriggerLayout) {\n return;\n }\n\n if (!(layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.length)) {\n this.layout();\n return;\n }\n\n this.data = this.setDataFromGraph();\n this.stopWorker();\n\n if (otherCfg.workerEnabled && this.layoutWithWorker(this.data, null)) {\n // 如果启用布局web worker并且浏览器支持web worker,用web worker布局。否则回退到不用web worker布局。\n return;\n }\n\n graph.emit('beforelayout');\n var start = Promise.resolve();\n var hasLayout = false;\n\n if ((layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.length) === 1) {\n hasLayout = true;\n start = start.then(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4\n /*yield*/\n , this.updateLayoutMethod(layoutMethods[0], layoutCfg)];\n\n case 1:\n return [2\n /*return*/\n , _a.sent()];\n }\n });\n });\n });\n } else if (layoutMethods === null || layoutMethods === void 0 ? void 0 : layoutMethods.length) {\n hasLayout = true;\n layoutMethods.forEach(function (layoutMethod, index) {\n var currentCfg = layoutCfg.pipes[index];\n start = start.then(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n return [4\n /*yield*/\n , this.updateLayoutMethod(layoutMethod, currentCfg)];\n\n case 1:\n return [2\n /*return*/\n , _a.sent()];\n }\n });\n });\n });\n });\n }\n\n if (hasLayout) {\n start.then(function () {\n if (layoutCfg.onAllLayoutEnd) layoutCfg.onAllLayoutEnd();\n }).catch(function (error) {\n console.warn('layout failed', error);\n });\n }\n };\n\n LayoutController.prototype.adjustPipesBox = function (data, adjust) {\n var _this = this;\n\n return new Promise(function (resolve) {\n var nodes = data.nodes;\n\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length)) {\n resolve();\n }\n\n if (!LAYOUT_PIPES_ADJUST_NAMES.includes(adjust)) {\n console.warn(\"The adjust type \".concat(adjust, \" is not supported yet, please assign it with 'force', 'grid', or 'circular'.\"));\n resolve();\n }\n\n var layoutCfg = {\n center: _this.layoutCfg.center,\n nodeSize: function nodeSize(d) {\n return Math.max(d.height, d.width);\n },\n preventOverlap: true,\n onLayoutEnd: function onLayoutEnd() {}\n }; // 计算出大单元\n\n var _a = _this.getLayoutBBox(nodes),\n groupNodes = _a.groupNodes,\n layoutNodes = _a.layoutNodes;\n\n var preNodes = Object(_antv_util__WEBPACK_IMPORTED_MODULE_6__[\"clone\"])(layoutNodes); // 根据大单元坐标的变化,调整这里面每个小单元nodes\n\n layoutCfg.onLayoutEnd = function () {\n layoutNodes === null || layoutNodes === void 0 ? void 0 : layoutNodes.forEach(function (ele, index) {\n var _a, _b, _c;\n\n var dx = ele.x - ((_a = preNodes[index]) === null || _a === void 0 ? void 0 : _a.x);\n var dy = ele.y - ((_b = preNodes[index]) === null || _b === void 0 ? void 0 : _b.y);\n (_c = groupNodes[index]) === null || _c === void 0 ? void 0 : _c.forEach(function (n) {\n n.x += dx;\n n.y += dy;\n });\n });\n resolve();\n };\n\n var layoutMethod = new _layout__WEBPACK_IMPORTED_MODULE_2__[\"Layout\"][adjust](layoutCfg);\n layoutMethod.layout({\n nodes: layoutNodes\n });\n });\n };\n\n LayoutController.prototype.hasGPUVersion = function (layoutName) {\n return GPU_LAYOUT_NAMES.includes(layoutName);\n };\n\n LayoutController.prototype.destroy = function () {\n this.destoryLayoutMethods();\n var worker = this.worker;\n\n if (worker) {\n worker.terminate();\n this.worker = null;\n }\n\n this.destroyed = true;\n this.graph.set('layout', undefined);\n this.layoutCfg = undefined;\n this.layoutType = undefined;\n this.layoutMethods = undefined;\n this.graph = null;\n };\n\n return LayoutController;\n}(_antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"AbstractLayout\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (LayoutController);\n\nfunction updateLayoutPosition(data, layoutData) {\n var nodes = data.nodes;\n var layoutNodes = layoutData.nodes;\n var nodeLength = nodes.length;\n\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n node.x = layoutNodes[i].x;\n node.y = layoutNodes[i].y;\n }\n}\n\nfunction filterObject(collection, callback) {\n var result = {};\n\n if (collection && _typeof(collection) === 'object') {\n Object.keys(collection).forEach(function (key) {\n if (collection.hasOwnProperty(key) && callback(collection[key])) {\n result[key] = collection[key];\n }\n });\n return result;\n }\n\n return collection;\n}\n\nfunction updateGPUWorkerLayoutPosition(data, layoutData) {\n var nodes = data.nodes;\n var vertexEdgeData = layoutData.vertexEdgeData;\n var nodeLength = nodes.length;\n\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n var x = vertexEdgeData[4 * i];\n var y = vertexEdgeData[4 * i + 1];\n node.x = x;\n node.y = y;\n }\n}\n\nfunction addLayoutOrder(data, order) {\n var _a;\n\n if (!((_a = data === null || data === void 0 ? void 0 : data.nodes) === null || _a === void 0 ? void 0 : _a.length)) {\n return;\n }\n\n var nodes = data.nodes;\n nodes.forEach(function (node) {\n node.layoutOrder = order;\n });\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/controller/layout.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar resolveConflicts = function (entries, cg) {\n var _a, _b, _c;\n var mappedEntries = {};\n entries === null || entries === void 0 ? void 0 : entries.forEach(function (entry, i) {\n mappedEntries[entry.v] = {\n i: i,\n indegree: 0,\n in: [],\n out: [],\n vs: [entry.v],\n };\n var tmp = mappedEntries[entry.v];\n if (entry.barycenter !== undefined) {\n tmp.barycenter = entry.barycenter;\n tmp.weight = entry.weight;\n }\n });\n (_a = cg.edges()) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var entryV = mappedEntries[e.v];\n var entryW = mappedEntries[e.w];\n if (entryV !== undefined && entryW !== undefined) {\n entryW.indegree++;\n entryV.out.push(mappedEntries[e.w]);\n }\n });\n var sourceSet = (_c = (_b = Object.values(mappedEntries)).filter) === null || _c === void 0 ? void 0 : _c.call(_b, function (entry) { return !entry.indegree; });\n return doResolveConflicts(sourceSet);\n};\nvar doResolveConflicts = function (sourceSet) {\n var _a, _b;\n var entries = [];\n var handleIn = function (vEntry) {\n return function (uEntry) {\n if (uEntry.merged)\n return;\n if (uEntry.barycenter === undefined ||\n vEntry.barycenter === undefined ||\n uEntry.barycenter >= vEntry.barycenter) {\n mergeEntries(vEntry, uEntry);\n }\n };\n };\n var handleOut = function (vEntry) {\n return function (wEntry) {\n wEntry[\"in\"].push(vEntry);\n if (--wEntry.indegree === 0) {\n sourceSet.push(wEntry);\n }\n };\n };\n var _loop_1 = function () {\n var entry = sourceSet.pop();\n entries.push(entry);\n (_a = entry[\"in\"].reverse()) === null || _a === void 0 ? void 0 : _a.forEach(function (e) { return handleIn(entry)(e); });\n (_b = entry.out) === null || _b === void 0 ? void 0 : _b.forEach(function (e) { return handleOut(entry)(e); });\n };\n while (sourceSet === null || sourceSet === void 0 ? void 0 : sourceSet.length) {\n _loop_1();\n }\n var filtered = entries.filter(function (entry) { return !entry.merged; });\n var keys = [\n \"vs\",\n \"i\",\n \"barycenter\",\n \"weight\",\n ];\n return filtered.map(function (entry) {\n var picked = {};\n keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {\n if (entry[key] === undefined)\n return;\n picked[key] = entry[key];\n });\n return picked;\n });\n};\nvar mergeEntries = function (target, source) {\n var _a;\n var sum = 0;\n var weight = 0;\n if (target.weight) {\n sum += target.barycenter * target.weight;\n weight += target.weight;\n }\n if (source.weight) {\n sum += source.barycenter * source.weight;\n weight += source.weight;\n }\n target.vs = (_a = source.vs) === null || _a === void 0 ? void 0 : _a.concat(target.vs);\n target.barycenter = sum / weight;\n target.weight = weight;\n target.i = Math.min(source.i, target.i);\n source.merged = true;\n};\nexports.default = resolveConflicts;\n//# sourceMappingURL=resolve-conflicts.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/resolve-conflicts.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/graph/graph.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/graph/graph.js ***! - \****************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/sort-subgraph.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/sort-subgraph.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\n/* harmony import */ var _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/g-svg */ \"./node_modules/@antv/g-svg/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ../global */ \"./node_modules/@antv/g6-pc/es/global.js\");\n/* harmony import */ var _controller__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./controller */ \"./node_modules/@antv/g6-pc/es/graph/controller/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n\n\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_3__[\"ext\"].transform;\nvar SVG = 'svg';\n\nvar Graph =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Graph, _super);\n\n function Graph(cfg) {\n var _this = _super.call(this, cfg) || this;\n\n var defaultNode = _this.get('defaultNode');\n\n if (!defaultNode) {\n _this.set('defaultNode', {\n type: 'circle'\n });\n }\n\n if (!defaultNode.type) {\n defaultNode.type = 'circle';\n\n _this.set('defaultNode', defaultNode);\n }\n\n _this.destroyed = false;\n return _this;\n }\n\n Graph.prototype.initLayoutController = function () {\n var layoutController = new _controller__WEBPACK_IMPORTED_MODULE_7__[\"LayoutController\"](this);\n this.set({\n layoutController: layoutController\n });\n };\n\n Graph.prototype.initEventController = function () {\n var eventController = new _controller__WEBPACK_IMPORTED_MODULE_7__[\"EventController\"](this);\n this.set({\n eventController: eventController\n });\n };\n\n Graph.prototype.initCanvas = function () {\n var container = this.get('container');\n\n if (typeof container === 'string') {\n container = document.getElementById(container);\n this.set('container', container);\n }\n\n if (!container) {\n throw new Error('invalid container');\n }\n\n var clientWidth = container.clientWidth,\n clientHeight = container.clientHeight;\n var width = this.get('width') || clientWidth;\n var height = this.get('height') || clientHeight;\n\n if (!this.get('width') && !this.get('height')) {\n this.set('width', clientWidth);\n this.set('height', clientHeight);\n }\n\n var renderer = this.get('renderer');\n var canvas;\n\n if (renderer === SVG) {\n canvas = new _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__[\"Canvas\"]({\n container: container,\n width: width,\n height: height\n });\n } else {\n var canvasCfg = {\n container: container,\n width: width,\n height: height\n };\n var pixelRatio = this.get('pixelRatio');\n\n if (pixelRatio) {\n canvasCfg.pixelRatio = pixelRatio;\n }\n\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasCfg);\n }\n\n this.set('canvas', canvas);\n };\n\n Graph.prototype.initPlugins = function () {\n var self = this;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"each\"])(self.get('plugins'), function (plugin) {\n if (!plugin.destroyed && plugin.initPlugin) {\n plugin.initPlugin(self);\n }\n });\n };\n /**\n * 增加图片下载水印功能\n */\n\n\n Graph.prototype.downloadImageWatermark = function (watermarker, context, width, height) {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(this, void 0, void 0, function () {\n var watermarkStr, watermarkbase64, img;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n watermarkStr = watermarker.style.backgroundImage;\n watermarkbase64 = watermarkStr.slice(5, watermarkStr.length - 2);\n img = new Image();\n img.src = watermarkbase64;\n return [4\n /*yield*/\n , new Promise(function (resolve) {\n img.onload = function () {\n var pat = context.createPattern(img, \"repeat\");\n context.rect(0, 0, width, height);\n context.fillStyle = pat;\n context.fill();\n resolve('');\n };\n })];\n\n case 1:\n _a.sent();\n\n return [2\n /*return*/\n ];\n }\n });\n });\n };\n /**\n * 用于生成图片 (异步callback)\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {string} backgroundColor 图片背景色\n * @return {string} 图片 dataURL\n */\n\n\n Graph.prototype.asyncToDataUrl = function (type, backgroundColor, callback, widths, heights, vCanvasEl) {\n var _this = this;\n\n var watermarker = document.querySelector('.g6-graph-watermarker');\n var canvas = this.get('canvas');\n var renderer = canvas.getRenderer();\n var canvasDom = vCanvasEl || canvas.get('el');\n var dataURL = '';\n if (!type) type = 'image/png';\n setTimeout(function () {\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__awaiter\"])(_this, void 0, void 0, function () {\n var cloneNode, svgDocType, svgDoc, svgData, imageData, context, width, height, compositeOperation, pixelRatio;\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__generator\"])(this, function (_a) {\n switch (_a.label) {\n case 0:\n if (!(renderer === 'svg')) return [3\n /*break*/\n , 1];\n cloneNode = canvasDom.cloneNode(true);\n svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');\n svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);\n svgDoc.replaceChild(cloneNode, svgDoc.documentElement);\n svgData = new XMLSerializer().serializeToString(svgDoc);\n dataURL = \"data:image/svg+xml;charset=utf8,\".concat(encodeURIComponent(svgData));\n return [3\n /*break*/\n , 4];\n\n case 1:\n imageData = void 0;\n context = canvasDom.getContext('2d');\n width = widths || this.get('width');\n height = heights || this.get('height');\n compositeOperation = void 0;\n if (!watermarker) return [3\n /*break*/\n , 3];\n return [4\n /*yield*/\n , this.downloadImageWatermark(watermarker, context, width, height)];\n\n case 2:\n _a.sent();\n\n _a.label = 3;\n\n case 3:\n if (backgroundColor) {\n pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;\n\n try {\n imageData = context.getImageData(0, 0, width * pixelRatio, height * pixelRatio);\n compositeOperation = context.globalCompositeOperation;\n context.globalCompositeOperation = 'destination-over';\n context.fillStyle = backgroundColor;\n context.fillRect(0, 0, width, height);\n } catch (error) {\n console.error('Download image failed. Out of memory at ImageData creation');\n }\n }\n\n dataURL = canvasDom.toDataURL(type);\n\n if (backgroundColor) {\n context.clearRect(0, 0, width, height);\n context.putImageData(imageData, 0, 0);\n context.globalCompositeOperation = compositeOperation;\n }\n\n _a.label = 4;\n\n case 4:\n if (callback) callback(dataURL);\n return [2\n /*return*/\n ];\n }\n });\n });\n }, 16);\n };\n /**\n * 返回可见区域的图的 dataUrl,用于生成图片\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {string} backgroundColor 图片背景色\n * @return {string} 图片 dataURL\n */\n\n\n Graph.prototype.toDataURL = function (type, backgroundColor) {\n var canvas = this.get('canvas');\n var renderer = canvas.getRenderer();\n var canvasDom = canvas.get('el');\n if (!type) type = 'image/png';\n var dataURL = '';\n\n if (renderer === 'svg') {\n var cloneNode = canvasDom.cloneNode(true);\n var svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');\n var svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);\n svgDoc.replaceChild(cloneNode, svgDoc.documentElement);\n var svgData = new XMLSerializer().serializeToString(svgDoc);\n dataURL = \"data:image/svg+xml;charset=utf8,\".concat(encodeURIComponent(svgData));\n } else {\n var imageData = void 0;\n var context = canvasDom.getContext('2d');\n var width = Math.max(this.get('width'), 500);\n var height = Math.max(this.get('height'), 500);\n var compositeOperation = void 0;\n\n if (backgroundColor) {\n var pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio || 1 : 1;\n\n try {\n imageData = context.getImageData(0, 0, width * pixelRatio, height * pixelRatio);\n compositeOperation = context.globalCompositeOperation;\n context.globalCompositeOperation = 'destination-over';\n context.fillStyle = backgroundColor;\n context.fillRect(0, 0, width, height);\n } catch (error) {\n console.error('Download image failed. Out of memory at ImageData creation');\n }\n }\n\n dataURL = canvasDom.toDataURL(type);\n\n if (backgroundColor) {\n context.clearRect(0, 0, width, height);\n context.putImageData(imageData, 0, 0);\n context.globalCompositeOperation = compositeOperation;\n }\n }\n\n return dataURL;\n };\n /**\n * 返回整个图(包括超出可见区域的部分)的 dataUrl,用于生成图片\n * @param {Function} callback 异步生成 dataUrl 完成后的回调函数,在这里处理生成的 dataUrl 字符串\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {Object} imageConfig 图片配置项,包括背景色和上下左右的 padding\n */\n\n\n Graph.prototype.toFullDataURL = function (callback, type, imageConfig) {\n var bbox = this.get('group').getCanvasBBox();\n var height = bbox.height;\n var width = bbox.width;\n var renderer = this.get('renderer');\n var vContainerDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_8__[\"createDom\"])('
');\n var backgroundColor = imageConfig ? imageConfig.backgroundColor : undefined;\n var padding = imageConfig ? imageConfig.padding : undefined;\n if (!padding) padding = [0, 0, 0, 0];else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var vHeight = height + padding[0] + padding[2];\n var vWidth = width + padding[1] + padding[3];\n var canvasOptions = {\n container: vContainerDOM,\n height: vHeight,\n width: vWidth,\n quickHit: true\n };\n var vCanvas = renderer === 'svg' ? new _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__[\"Canvas\"](canvasOptions) : new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasOptions);\n var group = this.get('group');\n var vGroup = group.clone();\n var matrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"clone\"])(vGroup.getMatrix());\n if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var centerX = (bbox.maxX + bbox.minX) / 2;\n var centerY = (bbox.maxY + bbox.minY) / 2;\n matrix = transform(matrix, [['t', -centerX, -centerY], ['t', width / 2 + padding[3], height / 2 + padding[0]]]);\n vGroup.resetMatrix();\n vGroup.setMatrix(matrix);\n vCanvas.add(vGroup);\n var vCanvasEl = vCanvas.get('el');\n var dataURL = '';\n if (!type) type = 'image/png';\n setTimeout(function () {\n if (renderer === 'svg') {\n var cloneNode = vCanvasEl.cloneNode(true);\n var svgDocType = document.implementation.createDocumentType('svg', '-//W3C//DTD SVG 1.1//EN', 'http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd');\n var svgDoc = document.implementation.createDocument('http://www.w3.org/2000/svg', 'svg', svgDocType);\n svgDoc.replaceChild(cloneNode, svgDoc.documentElement);\n var svgData = new XMLSerializer().serializeToString(svgDoc);\n dataURL = \"data:image/svg+xml;charset=utf8,\".concat(encodeURIComponent(svgData));\n } else {\n var imageData = void 0;\n var context = vCanvasEl.getContext('2d');\n var compositeOperation = void 0;\n\n if (backgroundColor) {\n var pixelRatio = typeof window !== 'undefined' ? window.devicePixelRatio : 1;\n\n try {\n imageData = context.getImageData(0, 0, vWidth * pixelRatio, vHeight * pixelRatio);\n compositeOperation = context.globalCompositeOperation;\n context.globalCompositeOperation = 'destination-over';\n context.fillStyle = backgroundColor;\n context.fillRect(0, 0, vWidth, vHeight);\n } catch (error) {\n console.error('Download image failed. Out of memory at ImageData creation');\n }\n }\n\n dataURL = vCanvasEl.toDataURL(type);\n\n if (backgroundColor) {\n context.clearRect(0, 0, vWidth, vHeight);\n context.putImageData(imageData, 0, 0);\n context.globalCompositeOperation = compositeOperation;\n }\n }\n\n if (callback) callback(dataURL);\n }, 16);\n };\n /**\n * 导出包含全图的图片\n * @param {String} name 图片的名称\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {Object} imageConfig 图片配置项,包括背景色和上下左右的 padding\n */\n\n\n Graph.prototype.downloadFullImage = function (name, type, imageConfig) {\n var _this = this;\n\n var bbox = this.get('group').getCanvasBBox();\n var height = bbox.height;\n var width = bbox.width;\n var renderer = this.get('renderer');\n var vContainerDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_8__[\"createDom\"])('
');\n var watermarker = document.querySelector('.g6-graph-watermarker');\n var backgroundColor = imageConfig ? imageConfig.backgroundColor : undefined;\n var padding = imageConfig ? imageConfig.padding : undefined;\n if (!padding) padding = [0, 0, 0, 0];else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"isNumber\"])(padding)) padding = [padding, padding, padding, padding];\n var vHeight = height + padding[0] + padding[2];\n var vWidth = width + padding[1] + padding[3];\n\n if (watermarker) {\n var _a = this.get('graphWaterMarker').cfg || {},\n wmWidth = _a.width,\n wmHeight = _a.height;\n\n vHeight = Math.ceil(vHeight / wmHeight) * wmHeight;\n vWidth = Math.ceil(vWidth / wmWidth) * wmWidth;\n }\n\n var canvasOptions = {\n container: vContainerDOM,\n height: vHeight,\n width: vWidth\n };\n var vCanvas = renderer === 'svg' ? new _antv_g_svg__WEBPACK_IMPORTED_MODULE_2__[\"Canvas\"](canvasOptions) : new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasOptions);\n var group = this.get('group');\n var vGroup = group.clone();\n var matrix = Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"clone\"])(vGroup.getMatrix());\n if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var centerX = (bbox.maxX + bbox.minX) / 2;\n var centerY = (bbox.maxY + bbox.minY) / 2;\n matrix = transform(matrix, [['t', -centerX, -centerY], ['t', width / 2 + padding[3], height / 2 + padding[0]]]);\n vGroup.resetMatrix();\n vGroup.setMatrix(matrix);\n vCanvas.add(vGroup);\n var vCanvasEl = vCanvas.get('el');\n if (!type) type = 'image/png';\n this.asyncToDataUrl(type, backgroundColor, function (dataURL) {\n var link = document.createElement('a');\n var fileName = (name || 'graph') + (renderer === 'svg' ? '.svg' : \".\".concat(type.split('/')[1]));\n\n _this.dataURLToImage(dataURL, renderer, link, fileName);\n\n var e = document.createEvent('MouseEvents');\n e.initEvent('click', false, false);\n link.dispatchEvent(e);\n }, vWidth, vHeight, vCanvasEl);\n };\n /**\n * 画布导出图片,图片仅包含画布可见区域部分内容\n * @param {String} name 图片的名称\n * @param {String} type 图片类型,可选值:\"image/png\" | \"image/jpeg\" | \"image/webp\" | \"image/bmp\"\n * @param {string} backgroundColor 图片背景色\n */\n\n\n Graph.prototype.downloadImage = function (name, type, backgroundColor) {\n var _this = this;\n\n var self = this;\n self.stopAnimate();\n var canvas = self.get('canvas');\n var renderer = canvas.getRenderer();\n if (!type) type = 'image/png';\n var fileName = (name || 'graph') + (renderer === 'svg' ? '.svg' : type.split('/')[1]);\n var link = document.createElement('a');\n self.asyncToDataUrl(type, backgroundColor, function (dataURL) {\n _this.dataURLToImage(dataURL, renderer, link, fileName);\n\n var e = document.createEvent('MouseEvents');\n e.initEvent('click', false, false);\n link.dispatchEvent(e);\n });\n };\n\n Graph.prototype.dataURLToImage = function (dataURL, renderer, link, fileName) {\n if (!dataURL || dataURL === 'data:') {\n console.error('Download image failed. The graph is too large or there is invalid attribute values in graph items');\n return;\n }\n\n if (typeof window !== 'undefined') {\n if (window.Blob && window.URL && renderer !== 'svg') {\n var arr = dataURL.split(',');\n var mime = '';\n\n if (arr && arr.length > 0) {\n var match = arr[0].match(/:(.*?);/); // eslint-disable-next-line prefer-destructuring\n\n if (match && match.length >= 2) mime = match[1];\n }\n\n var bstr = atob(arr[1]);\n var n = bstr.length;\n var u8arr = new Uint8Array(n);\n\n while (n--) {\n u8arr[n] = bstr.charCodeAt(n);\n }\n\n var blobObj_1 = new Blob([u8arr], {\n type: mime\n });\n\n if (window.navigator.msSaveBlob) {\n window.navigator.msSaveBlob(blobObj_1, fileName);\n } else {\n link.addEventListener('click', function () {\n link.download = fileName;\n link.href = window.URL.createObjectURL(blobObj_1);\n });\n }\n } else {\n link.addEventListener('click', function () {\n link.download = fileName;\n link.href = dataURL;\n });\n }\n }\n };\n /**\n * 添加插件\n * @param {object} plugin 插件实例\n */\n\n\n Graph.prototype.addPlugin = function (plugin) {\n var self = this;\n\n if (plugin.destroyed) {\n return;\n }\n\n self.get('plugins').push(plugin);\n plugin.initPlugin(self);\n };\n /**\n * 添加插件\n * @param {object} plugin 插件实例\n */\n\n\n Graph.prototype.removePlugin = function (plugin) {\n var plugins = this.get('plugins');\n var index = plugins.indexOf(plugin);\n\n if (index >= 0) {\n plugin.destroyPlugin();\n plugins.splice(index, 1);\n }\n };\n /**\n * 设置图片水印\n * @param {string} imgURL 图片水印的url地址\n * @param {WaterMarkerConfig} config 文本水印的配置项\n */\n\n\n Graph.prototype.setImageWaterMarker = function (imgURL, config) {\n if (imgURL === void 0) {\n imgURL = _global__WEBPACK_IMPORTED_MODULE_6__[\"default\"].waterMarkerImage;\n }\n\n var container = this.get('container');\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n var canvas = this.get('graphWaterMarker');\n var waterMarkerConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"deepMix\"])({}, _global__WEBPACK_IMPORTED_MODULE_6__[\"default\"].imageWaterMarkerConfig, config);\n var width = waterMarkerConfig.width,\n height = waterMarkerConfig.height,\n compatible = waterMarkerConfig.compatible,\n image = waterMarkerConfig.image;\n\n if (!canvas) {\n var canvasCfg = {\n container: container,\n width: width,\n height: height,\n capture: false\n };\n var pixelRatio = this.get('pixelRatio');\n\n if (pixelRatio) {\n canvasCfg.pixelRatio = pixelRatio;\n }\n\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasCfg);\n this.set('graphWaterMarker', canvas);\n }\n\n canvas.get('el').style.display = 'none';\n var ctx = canvas.get('context');\n var rotate = image.rotate,\n x = image.x,\n y = image.y; // 旋转20度\n\n ctx.rotate(-rotate * Math.PI / 180);\n var img = new Image();\n img.crossOrigin = 'anonymous';\n img.src = imgURL;\n\n img.onload = function () {\n ctx.drawImage(img, x, y, image.width, image.height); // 恢复旋转角度\n\n ctx.rotate(rotate * Math.PI / 180); // 默认按照现代浏览器处理\n\n if (!compatible) {\n var box = document.querySelector('.g6-graph-watermarker');\n\n if (!box) {\n box = document.createElement('div');\n box.className = 'g6-graph-watermarker';\n }\n\n box.className = 'g6-graph-watermarker';\n\n if (!canvas.destroyed) {\n box.style.cssText = \"background-image: url(\".concat(canvas.get('el').toDataURL('image/png'), \");background-repeat:repeat;position:absolute;top:0;bottom:0;left:0;right:0;pointer-events:none;z-index:-1;\");\n container.appendChild(box);\n }\n } else {\n // 当需要兼容不支持 pointer-events属性的浏览器时,将 compatible 设置为 true\n container.style.cssText = \"background-image: url(\".concat(canvas.get('el').toDataURL('image/png'), \");background-repeat:repeat;\");\n }\n };\n };\n /**\n * 设置文本水印\n * @param {string[]} texts 水印的文本内容\n * @param {WaterMarkerConfig} config 文本水印的配置项\n */\n\n\n Graph.prototype.setTextWaterMarker = function (texts, config) {\n var container = this.get('container');\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n if (!container.style.position) {\n container.style.position = 'relative';\n }\n\n var canvas = this.get('graphWaterMarker');\n var waterMarkerConfig = Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"deepMix\"])({}, _global__WEBPACK_IMPORTED_MODULE_6__[\"default\"].textWaterMarkerConfig, config);\n var width = waterMarkerConfig.width,\n height = waterMarkerConfig.height,\n compatible = waterMarkerConfig.compatible,\n text = waterMarkerConfig.text;\n\n if (!canvas) {\n var canvasCfg = {\n container: container,\n width: width,\n height: height,\n capture: false\n };\n var pixelRatio = this.get('pixelRatio');\n\n if (pixelRatio) {\n canvasCfg.pixelRatio = pixelRatio;\n }\n\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"](canvasCfg);\n this.set('graphWaterMarker', canvas);\n }\n\n canvas.get('el').style.display = 'none';\n var ctx = canvas.get('context');\n var rotate = text.rotate,\n fill = text.fill,\n fontFamily = text.fontFamily,\n fontSize = text.fontSize,\n baseline = text.baseline,\n x = text.x,\n y = text.y,\n lineHeight = text.lineHeight; // 旋转20度\n\n ctx.rotate(-rotate * Math.PI / 180); // 设置文字样式\n\n ctx.font = \"\".concat(fontSize, \"px \").concat(fontFamily); // 设置文字颜色\n\n ctx.fillStyle = fill;\n ctx.textBaseline = baseline;\n\n for (var i = texts.length - 1; i >= 0; i--) {\n // 将文字绘制到画布\n ctx.fillText(texts[i], x, y + i * lineHeight);\n } // 恢复旋转角度\n\n\n ctx.rotate(rotate * Math.PI / 180); // 默认按照现代浏览器处理\n\n if (!compatible) {\n var box = document.querySelector('.g6-graph-watermarker');\n\n if (!box) {\n box = document.createElement('div');\n box.className = 'g6-graph-watermarker';\n }\n\n box.style.cssText = \"background-image: url(\".concat(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;\");\n container.appendChild(box);\n } else {\n // 当需要兼容不支持 pointer-events属性的浏览器时,将 compatible 设置为 true\n container.style.cssText = \"background-image: url(\".concat(canvas.get('el').toDataURL('image/png'), \");background-repeat:repeat;\");\n }\n };\n /**\n * 销毁画布\n */\n\n\n Graph.prototype.destroy = function () {\n var _a, _b, _c, _d;\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_4__[\"each\"])(this.get('plugins'), function (plugin) {\n plugin.destroyPlugin();\n }); // destroy tooltip doms, removed when upgrade G6 4.0\n\n var tooltipDOMs = this.get('tooltips');\n\n if (tooltipDOMs) {\n for (var i = 0; i < tooltipDOMs.length; i++) {\n var container = tooltipDOMs[i];\n if (!container) continue;\n var parent_1 = container.parentElement;\n if (!parent_1) continue;\n parent_1.removeChild(container);\n }\n }\n\n (_a = this.get('eventController')) === null || _a === void 0 ? void 0 : _a.destroy();\n (_b = this.get('layoutController')) === null || _b === void 0 ? void 0 : _b.destroy(); // this.get('eventController').destroy();\n // this.get('itemController').destroy();\n // this.get('modeController').destroy();\n // this.get('viewController').destroy();\n // this.get('stateController').destroy();\n // this.get('canvas').destroy();\n\n (_c = this.get('graphWaterMarker')) === null || _c === void 0 ? void 0 : _c.destroy();\n (_d = document.querySelector('.g6-graph-watermarker')) === null || _d === void 0 ? void 0 : _d.remove();\n\n _super.prototype.destroy.call(this);\n };\n\n return Graph;\n}(_antv_g6_core__WEBPACK_IMPORTED_MODULE_5__[\"AbstractGraph\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Graph);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/graph.js?"); +eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar barycenter_1 = __importDefault(__webpack_require__(/*! ./barycenter */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/barycenter.js\"));\nvar resolve_conflicts_1 = __importDefault(__webpack_require__(/*! ./resolve-conflicts */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/resolve-conflicts.js\"));\nvar sort_1 = __importDefault(__webpack_require__(/*! ./sort */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/sort.js\"));\nvar sortSubgraph = function (g, v, cg, biasRight, usePrev, keepNodeOrder) {\n var _a, _b, _c, _d;\n var movable = g.children(v);\n // fixorder的点不参与排序(这个方案不合适,只排了新增节点,和原来的分离)\n var node = g.node(v);\n var bl = node ? node.borderLeft : undefined;\n var br = node ? node.borderRight : undefined;\n var subgraphs = {};\n if (bl) {\n movable = movable === null || movable === void 0 ? void 0 : movable.filter(function (w) {\n return w !== bl && w !== br;\n });\n }\n var barycenters = (0, barycenter_1.default)(g, movable || []);\n barycenters === null || barycenters === void 0 ? void 0 : barycenters.forEach(function (entry) {\n var _a;\n if ((_a = g.children(entry.v)) === null || _a === void 0 ? void 0 : _a.length) {\n var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight, keepNodeOrder);\n subgraphs[entry.v] = subgraphResult;\n if (subgraphResult.hasOwnProperty(\"barycenter\")) {\n mergeBarycenters(entry, subgraphResult);\n }\n }\n });\n var entries = (0, resolve_conflicts_1.default)(barycenters, cg);\n expandSubgraphs(entries, subgraphs);\n // 添加fixorder信息到entries里边\n // TODO: 不考虑复合情况,只用第一个点的fixorder信息,后续考虑更完备的实现\n (_a = entries\n .filter(function (e) { return e.vs.length > 0; })) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var node = g.node(e.vs[0]);\n if (node) {\n e.fixorder = node.fixorder;\n e.order = node.order;\n }\n });\n var result = (0, sort_1.default)(entries, biasRight, usePrev, keepNodeOrder);\n if (bl) {\n result.vs = [bl, result.vs, br].flat();\n if ((_b = g.predecessors(bl)) === null || _b === void 0 ? void 0 : _b.length) {\n var blPred = g.node(((_c = g.predecessors(bl)) === null || _c === void 0 ? void 0 : _c[0]) || \"\");\n var brPred = g.node(((_d = g.predecessors(br)) === null || _d === void 0 ? void 0 : _d[0]) || \"\");\n if (!result.hasOwnProperty(\"barycenter\")) {\n result.barycenter = 0;\n result.weight = 0;\n }\n result.barycenter =\n (result.barycenter * result.weight +\n blPred.order +\n brPred.order) /\n (result.weight + 2);\n result.weight += 2;\n }\n }\n return result;\n};\nvar expandSubgraphs = function (entries, subgraphs) {\n entries === null || entries === void 0 ? void 0 : entries.forEach(function (entry) {\n var _a;\n var vss = (_a = entry.vs) === null || _a === void 0 ? void 0 : _a.map(function (v) {\n if (subgraphs[v]) {\n return subgraphs[v].vs;\n }\n return v;\n });\n entry.vs = vss.flat();\n });\n};\nvar mergeBarycenters = function (target, other) {\n if (target.barycenter !== undefined) {\n target.barycenter =\n (target.barycenter * target.weight + other.barycenter * other.weight) /\n (target.weight + other.weight);\n target.weight += other.weight;\n }\n else {\n target.barycenter = other.barycenter;\n target.weight = other.weight;\n }\n};\nexports.default = sortSubgraph;\n//# sourceMappingURL=sort-subgraph.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/sort-subgraph.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/graph/tree-graph.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/graph/tree-graph.js ***! - \*********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/sort.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/sort.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_hierarchy__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/hierarchy */ \"./node_modules/@antv/hierarchy/build/hierarchy.js\");\n/* harmony import */ var _antv_hierarchy__WEBPACK_IMPORTED_MODULE_1___default = /*#__PURE__*/__webpack_require__.n(_antv_hierarchy__WEBPACK_IMPORTED_MODULE_1__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n/* harmony import */ var _graph__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./graph */ \"./node_modules/@antv/g6-pc/es/graph/graph.js\");\n\n\n\n\n\nvar radialLayout = _util__WEBPACK_IMPORTED_MODULE_3__[\"default\"].radialLayout,\n traverseTree = _util__WEBPACK_IMPORTED_MODULE_3__[\"default\"].traverseTree;\n\nvar TreeGraph =\n/** @class */\nfunction (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(TreeGraph, _super);\n\n function TreeGraph(cfg) {\n var _this = _super.call(this, cfg) || this;\n\n _this.layoutAnimating = false; // 用于缓存动画结束后需要删除的节点\n\n _this.set('removeList', []);\n\n _this.set('layoutMethod', _this.getLayout());\n\n return _this;\n }\n /**\n * 通过 Layout 配置获取布局配置\n */\n\n\n TreeGraph.prototype.getLayout = function () {\n var layout = this.get('layout');\n\n if (!layout) {\n return null;\n }\n\n if (typeof layout === 'function') {\n return layout;\n }\n\n if (!layout.type) {\n layout.type = 'dendrogram';\n }\n\n if (!layout.direction) {\n layout.direction = 'TB';\n }\n\n if (layout.radial) {\n return function (data) {\n var layoutData = _antv_hierarchy__WEBPACK_IMPORTED_MODULE_1___default.a[layout.type](data, layout);\n radialLayout(layoutData);\n return layoutData;\n };\n }\n\n return function (data) {\n return _antv_hierarchy__WEBPACK_IMPORTED_MODULE_1___default.a[layout.type](data, layout);\n };\n };\n /**\n * 返回指定节点在树图数据中的索引\n * @param children 树图数据\n * @param child 树图中某一个 Item 的数据\n */\n\n\n TreeGraph.indexOfChild = function (children, id) {\n var index = -1; // eslint-disable-next-line consistent-return\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(children, function (former, i) {\n if (id === former.id) {\n index = i;\n return false;\n }\n });\n return index;\n };\n\n TreeGraph.prototype.getDefaultCfg = function () {\n var cfg = _super.prototype.getDefaultCfg.call(this); // 树图默认打开动画\n\n\n cfg.animate = true;\n return cfg;\n };\n /**\n * 向🌲树中添加数据\n * @param treeData 树图数据\n * @param parent 父节点实例\n * @param animate 是否开启动画\n */\n\n\n TreeGraph.prototype.innerAddChild = function (treeData, parent, animate) {\n var self = this;\n var model = treeData.data;\n\n if (model) {\n // model 中应存储真实的数据,特别是真实的 children\n model.x = treeData.x;\n model.y = treeData.y;\n model.depth = treeData.depth;\n }\n\n var node = self.addItem('node', model, false);\n\n if (parent) {\n node.set('parent', parent);\n\n if (animate) {\n var origin_1 = parent.get('originAttrs');\n\n if (origin_1) {\n node.set('originAttrs', origin_1);\n } else {\n var parentModel = parent.getModel();\n node.set('originAttrs', {\n x: parentModel.x,\n y: parentModel.y\n });\n }\n }\n\n var childrenList = parent.get('children');\n\n if (!childrenList) {\n parent.set('children', [node]);\n } else {\n childrenList.push(node);\n }\n\n self.addItem('edge', {\n source: parent.get('id'),\n target: node.get('id'),\n id: \"\".concat(parent.get('id'), \":\").concat(node.get('id'))\n }, false);\n } // 渲染到视图上应参考布局的children, 避免多绘制了收起的节点\n\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(treeData.children || [], function (child) {\n self.innerAddChild(child, node, animate);\n });\n self.emit('afteraddchild', {\n item: node,\n parent: parent\n });\n return node;\n };\n /**\n * 将数据上的变更转换到视图上\n * @param data\n * @param parent\n * @param animate\n */\n\n\n TreeGraph.prototype.innerUpdateChild = function (data, parent, animate) {\n var self = this;\n var current = self.findById(data.id); // 若子树不存在,整体添加即可\n\n if (!current) {\n self.innerAddChild(data, parent, animate);\n return;\n } // 更新新节点下所有子节点\n\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(data.children || [], function (child) {\n self.innerUpdateChild(child, current, animate);\n }); // 用现在节点的children实例来删除移除的子节点\n\n var children = current.get('children');\n\n if (children) {\n var len = children.length;\n\n if (len > 0) {\n for (var i = children.length - 1; i >= 0; i--) {\n var child = children[i].getModel();\n\n if (TreeGraph.indexOfChild(data.children || [], child.id) === -1) {\n self.innerRemoveChild(child.id, {\n x: data.x,\n y: data.y\n }, animate); // 更新父节点下缓存的子节点 item 实例列表\n\n children.splice(i, 1);\n }\n }\n }\n }\n\n var oriX;\n var oriY;\n\n if (current.get('originAttrs')) {\n oriX = current.get('originAttrs').x;\n oriY = current.get('originAttrs').y;\n }\n\n var model = current.getModel();\n\n if (animate) {\n // 如果有动画,先缓存节点运动再更新节点\n current.set('originAttrs', {\n x: model.x,\n y: model.y\n });\n }\n\n current.set('model', data.data);\n\n if (oriX !== data.x || oriY !== data.y) {\n current.updatePosition({\n x: data.x,\n y: data.y\n });\n }\n };\n /**\n * 删除子节点Item对象\n * @param id\n * @param to\n * @param animate\n */\n\n\n TreeGraph.prototype.innerRemoveChild = function (id, to, animate) {\n var self = this;\n var node = self.findById(id);\n\n if (!node) {\n return;\n }\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(node.get('children'), function (child) {\n self.innerRemoveChild(child.getModel().id, to, animate);\n });\n\n if (animate) {\n var model = node.getModel();\n node.set('to', to);\n node.set('originAttrs', {\n x: model.x,\n y: model.y\n });\n self.get('removeList').push(node);\n } else {\n self.removeItem(node, false);\n }\n };\n /**\n * 更新数据模型,差量更新并重新渲染\n * @param {object} data 数据模型\n */\n\n\n TreeGraph.prototype.changeData = function (data) {\n var self = this; // 更改数据源后,取消所有状态\n\n this.getNodes().map(function (node) {\n return self.clearItemStates(node);\n });\n this.getEdges().map(function (edge) {\n return self.clearItemStates(edge);\n });\n\n if (data) {\n self.data(data);\n self.render();\n } else {\n self.layout(this.get('fitView'));\n }\n };\n /**\n * 已更名为 updateLayout,为保持兼容暂且保留。\n * 更改并应用树布局算法\n * @param {object} layout 布局算法\n */\n\n\n TreeGraph.prototype.changeLayout = function (layout) {\n // eslint-disable-next-line no-console\n console.warn('Please call updateLayout instead of changeLayout. changeLayout will be discarded soon');\n var self = this;\n self.updateLayout(layout);\n };\n /**\n * 更改并应用树布局算法\n * @param {object} layout 布局算法\n */\n\n\n TreeGraph.prototype.updateLayout = function (layout) {\n var self = this;\n\n if (!layout) {\n // eslint-disable-next-line no-console\n console.warn('layout cannot be null');\n return;\n }\n\n self.set('layout', layout);\n self.set('layoutMethod', self.getLayout());\n self.layout();\n };\n /**\n * 已更名为 layout,为保持兼容暂且保留。\n * 根据目前的 data 刷新布局,更新到画布上。用于变更数据之后刷新视图。\n * @param {boolean} fitView 更新布局时是否需要适应窗口\n */\n\n\n TreeGraph.prototype.refreshLayout = function (fitView) {\n // eslint-disable-next-line no-console\n console.warn('Please call layout instead of refreshLayout. refreshLayout will be discarded soon');\n var self = this;\n self.layout(fitView);\n };\n /**\n * 根据目前的 data 刷新布局,更新到画布上。用于变更数据之后刷新视图。\n * @param {boolean} fitView 更新布局时是否需要适应窗口\n */\n\n\n TreeGraph.prototype.layout = function (fitView) {\n var self = this;\n var data = self.get('data');\n var layoutMethod = self.get('layoutMethod');\n var layoutData = layoutMethod ? layoutMethod(data, self.get('layout')) : data;\n var animate = self.get('animate');\n self.emit('beforerefreshlayout', {\n data: data,\n layoutData: layoutData\n });\n self.emit('beforelayout');\n self.innerUpdateChild(layoutData, undefined, animate);\n\n if (fitView) {\n var viewController = self.get('viewController');\n viewController.fitView();\n }\n\n if (!animate) {\n // 如果没有动画,目前仅更新了节点的位置,刷新一下边的样式\n self.refresh();\n self.paint();\n } else {\n self.layoutAnimate(layoutData);\n }\n\n self.emit('afterrefreshlayout', {\n data: data,\n layoutData: layoutData\n });\n self.emit('afterlayout');\n };\n /**\n * 添加子树到对应 id 的节点\n * @param {TreeGraphData} data 子树数据模型\n * @param {string} parent 子树的父节点id\n */\n\n\n TreeGraph.prototype.addChild = function (data, parent) {\n var self = this;\n self.emit('beforeaddchild', {\n model: data,\n parent: parent\n }); // 将数据添加到源数据中,走changeData方法\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isString\"])(parent)) {\n parent = parent.get('id');\n }\n\n var parentData = self.findDataById(parent);\n\n if (parentData) {\n if (!parentData.children) {\n parentData.children = [];\n }\n\n parentData.children.push(data);\n self.changeData();\n }\n };\n /**\n * 更新某个节点下的所有子节点\n * @param {TreeGraphData[]} data 子树数据模型集合\n * @param {string} parent 子树的父节点id\n */\n\n\n TreeGraph.prototype.updateChildren = function (data, parentId) {\n var self = this; // 如果没有父节点或找不到该节点,是全量的更新,直接重置data\n\n if (!parentId || !self.findById(parentId)) {\n console.warn(\"Update children failed! There is no node with id '\".concat(parentId, \"'\"));\n return;\n }\n\n var parentModel = self.findDataById(parentId);\n parentModel.children = data;\n self.changeData();\n };\n /**\n * 更新源数据,差量更新子树\n * @param {TreeGraphData} data 子树数据模型\n * @param {string} parentId 子树的父节点id\n */\n\n\n TreeGraph.prototype.updateChild = function (data, parentId) {\n var self = this; // 如果没有父节点或找不到该节点,是全量的更新,直接重置data\n\n if (!parentId || !self.findById(parentId)) {\n self.changeData(data);\n return;\n }\n\n var parentModel = self.findDataById(parentId);\n var current = self.findById(data.id);\n\n if (!parentModel.children) {\n // 当 current 不存在时,children 为空数组\n parentModel.children = [];\n } // 如果不存在该节点,则添加\n\n\n if (!current) {\n parentModel.children.push(data);\n } else {\n var index = TreeGraph.indexOfChild(parentModel.children, data.id);\n parentModel.children[index] = data;\n }\n\n self.changeData();\n };\n /**\n * 删除子树\n * @param {string} id 子树根节点id\n */\n\n\n TreeGraph.prototype.removeChild = function (id) {\n var self = this;\n var node = self.findById(id);\n\n if (!node) {\n return;\n }\n\n var parent = node.get('parent');\n\n if (parent && !parent.destroyed) {\n var parentNode = self.findDataById(parent.get('id'));\n var siblings = parentNode && parentNode.children || [];\n var model = node.getModel();\n var index = TreeGraph.indexOfChild(siblings, model.id);\n siblings.splice(index, 1);\n }\n\n self.changeData();\n };\n /**\n * 根据id获取对应的源数据\n * @param {string} id 元素id\n * @param {TreeGraphData | undefined} parent 从哪个节点开始寻找,为空时从根节点开始查找\n * @return {TreeGraphData} 对应源数据\n */\n\n\n TreeGraph.prototype.findDataById = function (id, parent) {\n var self = this;\n\n if (!parent) {\n parent = self.get('data');\n }\n\n if (id === parent.id) {\n return parent;\n }\n\n var result = null; // eslint-disable-next-line consistent-return\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(parent.children || [], function (child) {\n if (child.id === id) {\n result = child;\n return false;\n }\n\n result = self.findDataById(id, child);\n\n if (result) {\n return false;\n }\n });\n return result;\n };\n /**\n * 布局动画接口,用于数据更新时做节点位置更新的动画\n * @param {TreeGraphData} data 更新的数据\n * @param {function} onFrame 定义节点位置更新时如何移动\n */\n\n\n TreeGraph.prototype.layoutAnimate = function (data, onFrame) {\n var self = this;\n var animateCfg = this.get('animateCfg');\n self.emit('beforeanimate', {\n data: data\n }); // 如果边中没有指定锚点,但是本身有锚点控制,在动画过程中保持锚点不变\n\n self.getEdges().forEach(function (edge) {\n var model = edge.get('model');\n\n if (!model.sourceAnchor) {\n model.sourceAnchor = edge.get('sourceAnchorIndex');\n }\n });\n this.get('canvas').animate(function (ratio) {\n traverseTree(data, function (child) {\n var node = self.findById(child.id); // 只有当存在node的时候才执行\n\n if (node) {\n var origin_2 = node.get('originAttrs');\n var model = node.get('model');\n\n if (!origin_2) {\n origin_2 = {\n x: model.x,\n y: model.y\n };\n node.set('originAttrs', origin_2);\n }\n\n if (onFrame) {\n var attrs = onFrame(node, ratio, origin_2, data);\n node.set('model', Object.assign(model, attrs));\n } else {\n model.x = origin_2.x + (child.x - origin_2.x) * ratio;\n model.y = origin_2.y + (child.y - origin_2.y) * ratio;\n }\n }\n\n return true;\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(self.get('removeList'), function (node) {\n var model = node.getModel();\n var from = node.get('originAttrs');\n var to = node.get('to');\n model.x = from.x + (to.x - from.x) * ratio;\n model.y = from.y + (to.y - from.y) * ratio;\n });\n self.refreshPositions();\n }, {\n duration: animateCfg.duration,\n easing: animateCfg.ease,\n callback: function callback() {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(self.getNodes(), function (node) {\n node.set('originAttrs', null);\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(self.get('removeList'), function (node) {\n self.removeItem(node);\n });\n self.set('removeList', []);\n\n if (animateCfg.callback) {\n animateCfg.callback();\n }\n\n self.emit('afteranimate', {\n data: data\n });\n },\n delay: animateCfg.delay\n });\n };\n /**\n * 立即停止布局动画\n */\n\n\n TreeGraph.prototype.stopLayoutAnimate = function () {\n this.get('canvas').stopAnimate();\n this.emit('layoutanimateend', {\n data: this.get('data')\n });\n this.layoutAnimating = false;\n };\n /**\n * 是否在布局动画\n * @return {boolean} 是否有布局动画\n */\n\n\n TreeGraph.prototype.isLayoutAnimating = function () {\n return this.layoutAnimating;\n };\n /**\n * 根据data接口的数据渲染视图\n */\n\n\n TreeGraph.prototype.render = function () {\n var self = this;\n var data = self.get('data');\n\n if (!data || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isObject\"])(data) || !Object.keys(data).length) {\n throw new Error('data must be defined first');\n }\n\n self.clear();\n self.emit('beforerender');\n self.layout(this.get('fitView'));\n self.emit('afterrender');\n };\n /**\n * 导出图数据\n * @return {object} data\n */\n\n\n TreeGraph.prototype.save = function () {\n return this.get('data');\n };\n\n return TreeGraph;\n}(_graph__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TreeGraph);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/graph/tree-graph.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar sort = function (entries, biasRight, usePrev, keepNodeOrder) {\n var parts = (0, util_1.partition)(entries, function (entry) {\n var hasFixOrder = entry.hasOwnProperty(\"fixorder\") && !isNaN(entry.fixorder);\n if (keepNodeOrder)\n return !hasFixOrder && entry.hasOwnProperty(\"barycenter\");\n // NOTE: 有fixorder的也可以排\n return hasFixOrder || entry.hasOwnProperty(\"barycenter\");\n });\n var sortable = parts.lhs;\n var unsortable = parts.rhs.sort(function (a, b) { return -a.i - (-b.i); });\n var vs = [];\n var sum = 0;\n var weight = 0;\n var vsIndex = 0;\n sortable === null || sortable === void 0 ? void 0 : sortable.sort(compareWithBias(!!biasRight, !!usePrev));\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n sortable === null || sortable === void 0 ? void 0 : sortable.forEach(function (entry) {\n var _a;\n vsIndex += (_a = entry.vs) === null || _a === void 0 ? void 0 : _a.length;\n vs.push(entry.vs);\n sum += entry.barycenter * entry.weight;\n weight += entry.weight;\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n });\n var result = { vs: vs.flat() };\n if (weight) {\n result.barycenter = sum / weight;\n result.weight = weight;\n }\n return result;\n};\nvar consumeUnsortable = function (vs, unsortable, index) {\n var iindex = index;\n var last;\n while (unsortable.length && (last = unsortable[unsortable.length - 1]).i <= iindex) {\n unsortable.pop();\n vs === null || vs === void 0 ? void 0 : vs.push(last.vs);\n iindex++;\n }\n return iindex;\n};\n/**\n * 配置是否考虑使用之前的布局结果\n */\nvar compareWithBias = function (bias, usePrev) {\n return function (entryV, entryW) {\n // 排序的时候先判断fixorder,不行再判断重心\n if (entryV.fixorder !== undefined && entryW.fixorder !== undefined) {\n return entryV.fixorder - entryW.fixorder;\n }\n if (entryV.barycenter < entryW.barycenter) {\n return -1;\n }\n if (entryV.barycenter > entryW.barycenter) {\n return 1;\n }\n // 重心相同,考虑之前排好的顺序\n if (usePrev && entryV.order !== undefined && entryW.order !== undefined) {\n if (entryV.order < entryW.order) {\n return -1;\n }\n if (entryV.order > entryW.order) {\n return 1;\n }\n }\n return !bias ? entryV.i - entryW.i : entryW.i - entryV.i;\n };\n};\nexports.default = sort;\n//# sourceMappingURL=sort.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/sort.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/index.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/index.js ***! - \**********************************************/ -/*! exports provided: G6GraphEvent, Node, Edge, Combo, Hull, registerNode, registerCombo, AbstractGraph, registerEdge, registerBehavior, AbstractLayout, AbstractEvent, BaseGlobal, Graph, TreeGraph, Util, Layout, TreeLayout, registerLayout, Global, Minimap, Grid, Bundling, Menu, Fisheye, Algorithm, ToolBar, Tooltip, TimeBar, ImageMinimap, EdgeFilterLens, SnapLine, Legend, Annotation, Arrow, Marker, Shape, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/parent-dummy-chains.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/parent-dummy-chains.js ***! + \*******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Minimap\", function() { return Minimap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Grid\", function() { return Grid; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Bundling\", function() { return Bundling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return Menu; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Fisheye\", function() { return Fisheye; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Algorithm\", function() { return Algorithm; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ToolBar\", function() { return ToolBar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Tooltip\", function() { return Tooltip; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TimeBar\", function() { return TimeBar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ImageMinimap\", function() { return ImageMinimap; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EdgeFilterLens\", function() { return EdgeFilterLens; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SnapLine\", function() { return SnapLine; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Legend\", function() { return Legend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Annotation\", function() { return Annotation; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Arrow\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Arrow\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Marker\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Marker\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Shape\"]; });\n\n/* harmony import */ var _antv_algorithm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/algorithm */ \"./node_modules/@antv/algorithm/es/index.js\");\n/* harmony import */ var _antv_algorithm_lib_asyncIndex__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/algorithm/lib/asyncIndex */ \"./node_modules/@antv/algorithm/lib/asyncIndex.js\");\n/* harmony import */ var _antv_algorithm_lib_asyncIndex__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(_antv_algorithm_lib_asyncIndex__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _graph_graph__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./graph/graph */ \"./node_modules/@antv/g6-pc/es/graph/graph.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Graph\", function() { return _graph_graph__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _graph_tree_graph__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./graph/tree-graph */ \"./node_modules/@antv/g6-pc/es/graph/tree-graph.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeGraph\", function() { return _graph_tree_graph__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/g6-pc/es/layout/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Layout\", function() { return _layout__WEBPACK_IMPORTED_MODULE_6__[\"Layout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeLayout\", function() { return _layout__WEBPACK_IMPORTED_MODULE_6__[\"TreeLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerLayout\", function() { return _layout__WEBPACK_IMPORTED_MODULE_6__[\"registerLayout\"]; });\n\n/* harmony import */ var _global__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./global */ \"./node_modules/@antv/g6-pc/es/global.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Global\", function() { return _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Util\", function() { return _util__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _plugin__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./plugin */ \"./node_modules/@antv/g6-pc/es/plugin/index.js\");\n/* harmony import */ var _element__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./element */ \"./node_modules/@antv/g6-pc/es/element/index.js\");\n/* harmony import */ var _behavior__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./behavior */ \"./node_modules/@antv/g6-pc/es/behavior/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"G6GraphEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Node\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Edge\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Edge\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Combo\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Combo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Hull\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Hull\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerNode\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerCombo\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerCombo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGraph\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"AbstractGraph\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerEdge\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerEdge\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerBehavior\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerBehavior\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractLayout\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"AbstractLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractEvent\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"AbstractEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BaseGlobal\", function() { return _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"BaseGlobal\"]; });\n\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/g6-pc/es/types/index.js\");\n/* empty/unused harmony star reexport *//* harmony import */ var _interface_graph__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./interface/graph */ \"./node_modules/@antv/g6-pc/es/interface/graph.js\");\n/* empty/unused harmony star reexport */\n\n\n\n\n\n\n\n\n\n\n\n\nvar Algorithm = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_algorithm__WEBPACK_IMPORTED_MODULE_2__), _antv_algorithm_lib_asyncIndex__WEBPACK_IMPORTED_MODULE_3__);\n\nvar Grid = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Grid;\nvar Minimap = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Minimap;\nvar Bundling = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Bundling;\nvar Menu = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Menu;\nvar Fisheye = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Fisheye;\nvar ToolBar = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].ToolBar;\nvar Tooltip = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Tooltip;\nvar TimeBar = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].TimeBar;\nvar ImageMinimap = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].ImageMinimap;\nvar EdgeFilterLens = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].EdgeFilterLens;\nvar SnapLine = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].SnapLine;\nvar Legend = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Legend;\nvar Annotation = _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Annotation;\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n version: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"].version,\n Graph: _graph_graph__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n TreeGraph: _graph_tree_graph__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n Util: _util__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n Layout: _layout__WEBPACK_IMPORTED_MODULE_6__[\"Layout\"],\n TreeLayout: _layout__WEBPACK_IMPORTED_MODULE_6__[\"TreeLayout\"],\n registerLayout: _layout__WEBPACK_IMPORTED_MODULE_6__[\"registerLayout\"],\n Global: _global__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n registerBehavior: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerBehavior\"],\n registerCombo: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerCombo\"],\n registerEdge: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerEdge\"],\n registerNode: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"registerNode\"],\n Minimap: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Minimap,\n Grid: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Grid,\n Bundling: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Bundling,\n Menu: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Menu,\n ToolBar: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].ToolBar,\n Tooltip: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Tooltip,\n Legend: _plugin__WEBPACK_IMPORTED_MODULE_9__[\"default\"].Legend,\n TimeBar: TimeBar,\n SnapLine: SnapLine,\n Fisheye: Fisheye,\n ImageMinimap: ImageMinimap,\n EdgeFilterLens: EdgeFilterLens,\n Annotation: Annotation,\n Algorithm: Algorithm,\n Arrow: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Arrow\"],\n Marker: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Marker\"],\n Shape: _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Shape\"]\n});\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// deep first search with both order low for pre, lim for post\nvar dfsBothOrder = function (g) {\n var _a;\n var result = {};\n var lim = 0;\n var dfs = function (v) {\n var _a;\n var low = lim;\n (_a = g.children(v)) === null || _a === void 0 ? void 0 : _a.forEach(dfs);\n result[v] = { low: low, lim: lim++ };\n };\n (_a = g.children()) === null || _a === void 0 ? void 0 : _a.forEach(dfs);\n return result;\n};\n// Find a path from v to w through the lowest common ancestor (LCA). Return the\n// full path and the LCA.\nvar findPath = function (g, postorderNums, v, w) {\n var vPath = [];\n var wPath = [];\n var low = Math.min(postorderNums[v].low, postorderNums[w].low);\n var lim = Math.max(postorderNums[v].lim, postorderNums[w].lim);\n var parent;\n var lca;\n // Traverse up from v to find the LCA\n parent = v;\n do {\n parent = g.parent(parent);\n vPath.push(parent);\n } while (parent &&\n (postorderNums[parent].low > low || lim > postorderNums[parent].lim));\n lca = parent;\n // Traverse from w to LCA\n parent = w;\n while (parent && parent !== lca) {\n wPath.push(parent);\n parent = g.parent(parent);\n }\n return { lca: lca, path: vPath.concat(wPath.reverse()) };\n};\nvar parentDummyChains = function (g) {\n var _a;\n var postorderNums = dfsBothOrder(g);\n (_a = g.graph().dummyChains) === null || _a === void 0 ? void 0 : _a.forEach(function (startV) {\n var _a, _b;\n var v = startV;\n var node = g.node(v);\n var edgeObj = node.edgeObj;\n if (!edgeObj)\n return;\n var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w);\n var path = pathData.path;\n var lca = pathData.lca;\n var pathIdx = 0;\n var pathV = path[pathIdx];\n var ascending = true;\n while (v !== edgeObj.w) {\n node = g.node(v);\n if (ascending) {\n while (pathV !== lca && ((_a = g.node(pathV)) === null || _a === void 0 ? void 0 : _a.maxRank) < node.rank) {\n pathIdx++;\n pathV = path[pathIdx];\n }\n if (pathV === lca) {\n ascending = false;\n }\n }\n if (!ascending) {\n while (pathIdx < path.length - 1 &&\n ((_b = g.node(path[pathIdx + 1])) === null || _b === void 0 ? void 0 : _b.minRank) <=\n node.rank) {\n pathIdx++;\n }\n pathV = path[pathIdx];\n }\n g.setParent(v, pathV);\n v = g.successors(v)[0];\n }\n });\n};\nexports.default = parentDummyChains;\n//# sourceMappingURL=parent-dummy-chains.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/parent-dummy-chains.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/interface/graph.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/interface/graph.js ***! - \********************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/position/bk.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/position/bk.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/interface/graph.js?"); +eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.width = exports.sep = exports.positionX = exports.balance = exports.alignCoordinates = exports.findSmallestWidthAlignment = exports.buildBlockGraph = exports.horizontalCompaction = exports.verticalAlignment = exports.hasConflict = exports.addConflict = exports.findOtherInnerSegmentNode = exports.findType2Conflicts = exports.findType1Conflicts = void 0;\n/*\n * This module provides coordinate assignment based on Brandes and Köpf, \"Fast\n * and Simple Horizontal Coordinate Assignment.\"\n */\nvar graphlib_1 = __webpack_require__(/*! @antv/graphlib */ \"./node_modules/@antv/graphlib/es/index.js\");\nvar util_1 = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/index.js\");\nvar util_2 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar BlockGraph = /** @class */ (function (_super) {\n __extends(BlockGraph, _super);\n function BlockGraph() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return BlockGraph;\n}(graphlib_1.Graph));\nvar findType1Conflicts = function (g, layering) {\n var conflicts = {};\n var visitLayer = function (prevLayer, layer) {\n // last visited node in the previous layer that is incident on an inner\n // segment.\n var k0 = 0;\n // Tracks the last node in this layer scanned for crossings with a type-1\n // segment.\n var scanPos = 0;\n var prevLayerLength = prevLayer.length;\n var lastNode = layer === null || layer === void 0 ? void 0 : layer[(layer === null || layer === void 0 ? void 0 : layer.length) - 1];\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v, i) {\n var _a;\n var w = (0, exports.findOtherInnerSegmentNode)(g, v);\n var k1 = w ? g.node(w).order : prevLayerLength;\n if (w || v === lastNode) {\n (_a = layer.slice(scanPos, i + 1)) === null || _a === void 0 ? void 0 : _a.forEach(function (scanNode) {\n var _a;\n (_a = g.predecessors(scanNode)) === null || _a === void 0 ? void 0 : _a.forEach(function (u) {\n var _a;\n var uLabel = g.node(u);\n var uPos = uLabel.order;\n if ((uPos < k0 || k1 < uPos) &&\n !(uLabel.dummy && ((_a = g.node(scanNode)) === null || _a === void 0 ? void 0 : _a.dummy))) {\n (0, exports.addConflict)(conflicts, u, scanNode);\n }\n });\n });\n scanPos = i + 1;\n k0 = k1;\n }\n });\n return layer;\n };\n if (layering === null || layering === void 0 ? void 0 : layering.length) {\n layering.reduce(visitLayer);\n }\n return conflicts;\n};\nexports.findType1Conflicts = findType1Conflicts;\nvar findType2Conflicts = function (g, layering) {\n var conflicts = {};\n function scan(south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {\n var _a, _b;\n var v;\n for (var i = southPos; i < southEnd; i++) {\n v = south[i];\n if ((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.dummy) {\n (_b = g.predecessors(v)) === null || _b === void 0 ? void 0 : _b.forEach(function (u) {\n var uNode = g.node(u);\n if (uNode.dummy &&\n (uNode.order < prevNorthBorder ||\n uNode.order > nextNorthBorder)) {\n (0, exports.addConflict)(conflicts, u, v);\n }\n });\n }\n }\n }\n ;\n function getScannedKey(params) {\n // south数组可能很大,不适合做key\n return JSON.stringify(params.slice(1));\n }\n function scanIfNeeded(params, scanCache) {\n var cacheKey = getScannedKey(params);\n if (scanCache.get(cacheKey))\n return;\n scan.apply(void 0, params);\n scanCache.set(cacheKey, true);\n }\n var visitLayer = function (north, south) {\n var prevNorthPos = -1;\n var nextNorthPos;\n var southPos = 0;\n var scanned = new Map();\n south === null || south === void 0 ? void 0 : south.forEach(function (v, southLookahead) {\n var _a;\n if (((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.dummy) === \"border\") {\n var predecessors = g.predecessors(v) || [];\n if (predecessors.length) {\n nextNorthPos = g.node(predecessors[0]).order;\n scanIfNeeded([south, southPos, southLookahead, prevNorthPos, nextNorthPos], scanned);\n southPos = southLookahead;\n prevNorthPos = nextNorthPos;\n }\n }\n scanIfNeeded([south, southPos, south.length, nextNorthPos, north.length], scanned);\n });\n return south;\n };\n if (layering === null || layering === void 0 ? void 0 : layering.length) {\n layering.reduce(visitLayer);\n }\n return conflicts;\n};\nexports.findType2Conflicts = findType2Conflicts;\nvar findOtherInnerSegmentNode = function (g, v) {\n var _a, _b;\n if ((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.dummy) {\n return (_b = g.predecessors(v)) === null || _b === void 0 ? void 0 : _b.find(function (u) { return g.node(u).dummy; });\n }\n};\nexports.findOtherInnerSegmentNode = findOtherInnerSegmentNode;\nvar addConflict = function (conflicts, v, w) {\n var vv = v;\n var ww = w;\n if (vv > ww) {\n var tmp = vv;\n vv = ww;\n ww = tmp;\n }\n var conflictsV = conflicts[vv];\n if (!conflictsV) {\n conflicts[vv] = conflictsV = {};\n }\n conflictsV[ww] = true;\n};\nexports.addConflict = addConflict;\nvar hasConflict = function (conflicts, v, w) {\n var vv = v;\n var ww = w;\n if (vv > ww) {\n var tmp = v;\n vv = ww;\n ww = tmp;\n }\n return !!conflicts[vv];\n};\nexports.hasConflict = hasConflict;\n/*\n * Try to align nodes into vertical \"blocks\" where possible. This algorithm\n * attempts to align a node with one of its median neighbors. If the edge\n * connecting a neighbor is a type-1 conflict then we ignore that possibility.\n * If a previous node has already formed a block with a node after the node\n * we're trying to form a block with, we also ignore that possibility - our\n * blocks would be split in that scenario.\n */\nvar verticalAlignment = function (g, layering, conflicts, neighborFn) {\n var root = {};\n var align = {};\n var pos = {};\n // We cache the position here based on the layering because the graph and\n // layering may be out of sync. The layering matrix is manipulated to\n // generate different extreme alignments.\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v, order) {\n root[v] = v;\n align[v] = v;\n pos[v] = order;\n });\n });\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n var prevIdx = -1;\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v) {\n var ws = neighborFn(v);\n if (ws.length) {\n ws = ws.sort(function (a, b) { return pos[a] - pos[b]; });\n var mp = (ws.length - 1) / 2;\n for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {\n var w = ws[i];\n if (align[v] === v &&\n prevIdx < pos[w] &&\n !(0, exports.hasConflict)(conflicts, v, w)) {\n align[w] = v;\n align[v] = root[v] = root[w];\n prevIdx = pos[w];\n }\n }\n }\n });\n });\n return { root: root, align: align };\n};\nexports.verticalAlignment = verticalAlignment;\nvar horizontalCompaction = function (g, layering, root, align, reverseSep) {\n var _a;\n // This portion of the algorithm differs from BK due to a number of problems.\n // Instead of their algorithm we construct a new block graph and do two\n // sweeps. The first sweep places blocks with the smallest possible\n // coordinates. The second sweep removes unused space by moving blocks to the\n // greatest coordinates without violating separation.\n var xs = {};\n var blockG = (0, exports.buildBlockGraph)(g, layering, root, reverseSep);\n var borderType = reverseSep ? \"borderLeft\" : \"borderRight\";\n var iterate = function (setXsFunc, nextNodesFunc) {\n var stack = blockG.nodes();\n var elem = stack.pop();\n var visited = {};\n while (elem) {\n if (visited[elem]) {\n setXsFunc(elem);\n }\n else {\n visited[elem] = true;\n stack.push(elem);\n stack = stack.concat(nextNodesFunc(elem));\n }\n elem = stack.pop();\n }\n };\n // First pass, assign smallest coordinates\n var pass1 = function (elem) {\n xs[elem] = (blockG.inEdges(elem) || []).reduce(function (acc, e) {\n return Math.max(acc, (xs[e.v] || 0) + blockG.edge(e));\n }, 0);\n };\n // Second pass, assign greatest coordinates\n var pass2 = function (elem) {\n var min = (blockG.outEdges(elem) || []).reduce(function (acc, e) {\n return Math.min(acc, (xs[e.w] || 0) - blockG.edge(e));\n }, Number.POSITIVE_INFINITY);\n var node = g.node(elem);\n if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {\n xs[elem] = Math.max(xs[elem], min);\n }\n };\n iterate(pass1, blockG.predecessors.bind(blockG));\n iterate(pass2, blockG.successors.bind(blockG));\n // Assign x coordinates to all nodes\n (_a = Object.values(align)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {\n xs[v] = xs[root[v]];\n });\n return xs;\n};\nexports.horizontalCompaction = horizontalCompaction;\nvar buildBlockGraph = function (g, layering, root, reverseSep) {\n var blockGraph = new BlockGraph();\n var graphLabel = g.graph();\n var sepFn = (0, exports.sep)(graphLabel.nodesep, graphLabel.edgesep, reverseSep);\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n var u;\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v) {\n var vRoot = root[v];\n blockGraph.setNode(vRoot);\n if (u) {\n var uRoot = root[u];\n var prevMax = blockGraph.edgeFromArgs(uRoot, vRoot);\n blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));\n }\n u = v;\n });\n });\n return blockGraph;\n};\nexports.buildBlockGraph = buildBlockGraph;\n/*\n * Returns the alignment that has the smallest width of the given alignments.\n */\nvar findSmallestWidthAlignment = function (g, xss) {\n return (0, util_2.minBy)(Object.values(xss), function (xs) {\n var _a;\n var max = Number.NEGATIVE_INFINITY;\n var min = Number.POSITIVE_INFINITY;\n (_a = Object.keys(xs)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {\n var x = xs[v];\n var halfWidth = (0, exports.width)(g, v) / 2;\n max = Math.max(x + halfWidth, max);\n min = Math.min(x - halfWidth, min);\n });\n return max - min;\n });\n};\nexports.findSmallestWidthAlignment = findSmallestWidthAlignment;\n/*\n * Align the coordinates of each of the layout alignments such that\n * left-biased alignments have their minimum coordinate at the same point as\n * the minimum coordinate of the smallest width alignment and right-biased\n * alignments have their maximum coordinate at the same point as the maximum\n * coordinate of the smallest width alignment.\n */\nfunction alignCoordinates(xss, alignTo) {\n var alignToVals = Object.values(alignTo);\n var alignToMin = (0, util_1.min)(alignToVals);\n var alignToMax = (0, util_1.max)(alignToVals);\n [\"u\", \"d\"].forEach(function (vert) {\n [\"l\", \"r\"].forEach(function (horiz) {\n var alignment = vert + horiz;\n var xs = xss[alignment];\n var delta;\n if (xs === alignTo)\n return;\n var xsVals = Object.values(xs);\n delta =\n horiz === \"l\"\n ? alignToMin - (0, util_1.min)(xsVals)\n : alignToMax - (0, util_1.max)(xsVals);\n if (delta) {\n xss[alignment] = {};\n Object.keys(xs).forEach(function (key) {\n xss[alignment][key] = xs[key] + delta;\n });\n }\n });\n });\n}\nexports.alignCoordinates = alignCoordinates;\nvar balance = function (xss, align) {\n var result = {};\n Object.keys(xss.ul).forEach(function (key) {\n if (align) {\n result[key] = xss[align.toLowerCase()][key];\n }\n else {\n var values = Object.values(xss).map(function (x) { return x[key]; });\n result[key] = (values[0] + values[1]) / 2; // (ur + ul) / 2\n }\n });\n return result;\n};\nexports.balance = balance;\nvar positionX = function (g) {\n var layering = (0, util_2.buildLayerMatrix)(g);\n var conflicts = Object.assign((0, exports.findType1Conflicts)(g, layering), (0, exports.findType2Conflicts)(g, layering));\n var xss = {};\n var adjustedLayering;\n [\"u\", \"d\"].forEach(function (vert) {\n adjustedLayering =\n vert === \"u\" ? layering : Object.values(layering).reverse();\n [\"l\", \"r\"].forEach(function (horiz) {\n if (horiz === \"r\") {\n adjustedLayering = adjustedLayering.map(function (inner) {\n return Object.values(inner).reverse();\n });\n }\n var neighborFn = (vert === \"u\" ? g.predecessors : g.successors).bind(g);\n var align = (0, exports.verticalAlignment)(g, adjustedLayering, conflicts, neighborFn);\n var xs = (0, exports.horizontalCompaction)(g, adjustedLayering, align.root, align.align, horiz === \"r\");\n if (horiz === \"r\") {\n Object.keys(xs).forEach(function (key) {\n xs[key] = -xs[key];\n });\n }\n xss[vert + horiz] = xs;\n });\n });\n var smallestWidth = (0, exports.findSmallestWidthAlignment)(g, xss);\n alignCoordinates(xss, smallestWidth);\n return (0, exports.balance)(xss, g.graph().align);\n};\nexports.positionX = positionX;\nvar sep = function (nodeSep, edgeSep, reverseSep) {\n return function (g, v, w) {\n var vLabel = g.node(v);\n var wLabel = g.node(w);\n var sum = 0;\n var delta;\n sum += vLabel.width / 2;\n if (vLabel.hasOwnProperty(\"labelpos\")) {\n switch ((vLabel.labelpos || \"\").toLowerCase()) {\n case \"l\":\n delta = -vLabel.width / 2;\n break;\n case \"r\":\n delta = vLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += wLabel.width / 2;\n if (wLabel.labelpos) {\n switch ((wLabel.labelpos || \"\").toLowerCase()) {\n case \"l\":\n delta = wLabel.width / 2;\n break;\n case \"r\":\n delta = -wLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n return sum;\n };\n};\nexports.sep = sep;\nvar width = function (g, v) { return g.node(v).width || 0; };\nexports.width = width;\n//# sourceMappingURL=bk.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/position/bk.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/layout/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/layout/index.js ***! - \*****************************************************/ -/*! exports provided: TreeLayout, Layout, registerLayout */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/position/index.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/position/index.js ***! + \**************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerLayout\", function() { return registerLayout; });\n/* harmony import */ var _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/layout/lib */ \"./node_modules/@antv/layout/lib/index.js\");\n/* harmony import */ var _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Layout\", function() { return _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"Layouts\"]; });\n\n/* harmony import */ var _tree_layout__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tree-layout */ \"./node_modules/@antv/g6-pc/es/layout/tree-layout.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeLayout\", function() { return _tree_layout__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n\n\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('grid', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"GridLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('random', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"RandomLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('force', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ForceLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('circular', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"CircularLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('dagre', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"DagreLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('dagreCompound', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"DagreCompoundLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('radial', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"RadialLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('concentric', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ConcentricLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('mds', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"MDSLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('fruchterman', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"FruchtermanLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('fruchterman-gpu', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"FruchtermanGPULayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('gForce', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"GForceLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('force2', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"Force2Layout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('gForce-gpu', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"GForceGPULayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('comboForce', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ComboForceLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('comboCombined', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ComboCombinedLayout\"]);\nObject(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])('forceAtlas2', _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"ForceAtlas2Layout\"]);\n\nvar registerLayout = function registerLayout(name, layoutOverride) {\n layoutOverride.isCustomLayout = true;\n _antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"Layouts\"][name] = Object(_antv_layout_lib__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"])(name, layoutOverride);\n};\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/index.js?"); +eval("\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar bk_1 = __webpack_require__(/*! ./bk */ \"./node_modules/@antv/layout/lib/layout/dagre/src/position/bk.js\");\nvar positionY = function (g) {\n var layering = (0, util_1.buildLayerMatrix)(g);\n var rankSep = g.graph().ranksep;\n var prevY = 0;\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n var heights = layer.map(function (v) { return g.node(v).height; });\n var maxHeight = Math.max.apply(Math, __spreadArray(__spreadArray([], heights, false), [0], false));\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v) {\n g.node(v).y = prevY + maxHeight / 2;\n });\n prevY += maxHeight + rankSep;\n });\n};\nvar positionX = function (g) {\n var layering = (0, util_1.buildLayerMatrix)(g);\n var conflicts = Object.assign((0, bk_1.findType1Conflicts)(g, layering), (0, bk_1.findType2Conflicts)(g, layering));\n var xss = {};\n var adjustedLayering = [];\n [\"u\", \"d\"].forEach(function (vert) {\n adjustedLayering =\n vert === \"u\" ? layering : Object.values(layering).reverse();\n [\"l\", \"r\"].forEach(function (horiz) {\n if (horiz === \"r\") {\n adjustedLayering = adjustedLayering.map(function (inner) {\n return Object.values(inner).reverse();\n });\n }\n var neighborFn = (vert === \"u\" ? g.predecessors : g.successors).bind(g);\n var align = (0, bk_1.verticalAlignment)(g, adjustedLayering, conflicts, neighborFn);\n var xs = (0, bk_1.horizontalCompaction)(g, adjustedLayering, align.root, align.align, horiz === \"r\");\n if (horiz === \"r\") {\n Object.keys(xs).forEach(function (xsKey) { return (xs[xsKey] = -xs[xsKey]); });\n }\n xss[vert + horiz] = xs;\n });\n });\n var smallestWidth = (0, bk_1.findSmallestWidthAlignment)(g, xss);\n smallestWidth && (0, bk_1.alignCoordinates)(xss, smallestWidth);\n return (0, bk_1.balance)(xss, g.graph().align);\n};\nvar position = function (g) {\n var _a;\n var ng = (0, util_1.asNonCompoundGraph)(g);\n positionY(ng);\n var xs = positionX(ng);\n (_a = Object.keys(xs)) === null || _a === void 0 ? void 0 : _a.forEach(function (key) {\n ng.node(key).x = xs[key];\n });\n};\nexports.default = position;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/position/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/layout/tree-layout.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/layout/tree-layout.js ***! - \***********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_hierarchy__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/hierarchy */ \"./node_modules/@antv/hierarchy/build/hierarchy.js\");\n/* harmony import */ var _antv_hierarchy__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_antv_hierarchy__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/g6-pc/es/util/index.js\");\n\n\nvar radialLayout = _util__WEBPACK_IMPORTED_MODULE_1__[\"default\"].radialLayout;\n\nvar TreeLayout =\n/** @class */\nfunction () {\n function TreeLayout(cfg) {\n this.type = cfg.type;\n this.radial = cfg.radial;\n this.config = cfg;\n }\n\n TreeLayout.prototype.init = function (data) {\n var _this = this;\n\n this.data = data;\n\n if (this.radial) {\n this.layoutMethod = function (data) {\n var layoutData = _antv_hierarchy__WEBPACK_IMPORTED_MODULE_0___default.a[_this.type](data, _this.config);\n\n radialLayout(layoutData);\n return layoutData;\n };\n\n return;\n }\n\n this.layoutMethod = function (data) {\n return _antv_hierarchy__WEBPACK_IMPORTED_MODULE_0___default.a[_this.type](data, _this.config);\n };\n };\n\n TreeLayout.prototype.execute = function () {\n return this.layoutMethod(this.data, this.config);\n };\n\n TreeLayout.prototype.layout = function (data) {\n this.init(data);\n return this.execute();\n };\n\n return TreeLayout;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TreeLayout);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/tree-layout.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.feasibleTreeWithLayer = exports.feasibleTree = void 0;\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js\");\nvar util_2 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar graph_1 = __webpack_require__(/*! ../../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\n/*\n * Constructs a spanning tree with tight edges and adjusted the input node's\n * ranks to achieve this. A tight edge is one that is has a length that matches\n * its \"minlen\" attribute.\n *\n * The basic structure for this function is derived from Gansner, et al., \"A\n * Technique for Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a DAG.\n * 2. Graph must be connected.\n * 3. Graph must have at least one node.\n * 5. Graph nodes must have been previously assigned a \"rank\" property that\n * respects the \"minlen\" property of incident edges.\n * 6. Graph edges must have a \"minlen\" property.\n *\n * Post-conditions:\n *\n * - Graph nodes will have their rank adjusted to ensure that all edges are\n * tight.\n *\n * Returns a tree (undirected graph) that is constructed using only \"tight\"\n * edges.\n */\nvar feasibleTree = function (g) {\n var t = new graph_1.Graph({ directed: false });\n // Choose arbitrary node from which to start our tree\n var start = g.nodes()[0];\n var size = g.nodeCount();\n t.setNode(start, {});\n var edge;\n var delta;\n while (tightTree(t, g) < size) {\n edge = findMinSlackEdge(t, g);\n delta = t.hasNode(edge.v) ? (0, util_1.slack)(g, edge) : -(0, util_1.slack)(g, edge);\n shiftRanks(t, g, delta);\n }\n return t;\n};\nexports.feasibleTree = feasibleTree;\n/*\n * Finds a maximal tree of tight edges and returns the number of nodes in the\n * tree.\n */\nvar tightTree = function (t, g) {\n var dfs = function (v) {\n g.nodeEdges(v).forEach(function (e) {\n var edgeV = e.v;\n var w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !(0, util_1.slack)(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n };\n t.nodes().forEach(dfs);\n return t.nodeCount();\n};\n/*\n * Constructs a spanning tree with tight edges and adjusted the input node's\n * ranks to achieve this. A tight edge is one that is has a length that matches\n * its \"minlen\" attribute.\n *\n * The basic structure for this function is derived from Gansner, et al., \"A\n * Technique for Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a DAG.\n * 2. Graph must be connected.\n * 3. Graph must have at least one node.\n * 5. Graph nodes must have been previously assigned a \"rank\" property that\n * respects the \"minlen\" property of incident edges.\n * 6. Graph edges must have a \"minlen\" property.\n *\n * Post-conditions:\n *\n * - Graph nodes will have their rank adjusted to ensure that all edges are\n * tight.\n *\n * Returns a tree (undirected graph) that is constructed using only \"tight\"\n * edges.\n */\nvar feasibleTreeWithLayer = function (g) {\n var t = new graph_1.Graph({ directed: false });\n // Choose arbitrary node from which to start our tree\n var start = g.nodes()[0];\n var size = g.nodes().filter(function (n) { return !!g.node(n); }).length;\n t.setNode(start, {});\n var edge;\n var delta;\n while (tightTreeWithLayer(t, g) < size) {\n edge = findMinSlackEdge(t, g);\n delta = t.hasNode(edge.v) ? (0, util_1.slack)(g, edge) : -(0, util_1.slack)(g, edge);\n shiftRanks(t, g, delta);\n }\n return t;\n};\nexports.feasibleTreeWithLayer = feasibleTreeWithLayer;\n/*\n * Finds a maximal tree of tight edges and returns the number of nodes in the\n * tree.\n */\nvar tightTreeWithLayer = function (t, g) {\n var dfs = function (v) {\n var _a;\n (_a = g.nodeEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var edgeV = e.v;\n var w = (v === edgeV) ? e.w : edgeV;\n // 对于指定layer的,直接加入tight-tree,不参与调整\n if (!t.hasNode(w) && (g.node(w).layer !== undefined || !(0, util_1.slack)(g, e))) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n };\n t.nodes().forEach(dfs);\n return t.nodeCount();\n};\n/*\n * Finds the edge with the smallest slack that is incident on tree and returns\n * it.\n */\nvar findMinSlackEdge = function (t, g) {\n return (0, util_2.minBy)(g.edges(), function (e) {\n if (t.hasNode(e.v) !== t.hasNode(e.w)) {\n return (0, util_1.slack)(g, e);\n }\n return Infinity;\n });\n};\nvar shiftRanks = function (t, g, delta) {\n t.nodes().forEach(function (v) {\n if (!g.node(v).rank)\n g.node(v).rank = 0;\n g.node(v).rank += delta;\n });\n};\nexports.default = {\n feasibleTree: feasibleTree,\n feasibleTreeWithLayer: feasibleTreeWithLayer\n};\n//# sourceMappingURL=feasible-tree.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/layout/worker/layout.worker.js": -/*!********************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/layout/worker/layout.worker.js ***! - \********************************************************************/ -/*! exports provided: LayoutWorker */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/rank/index.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/rank/index.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LayoutWorker\", function() { return LayoutWorker; });\n/* harmony import */ var _work__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./work */ \"./node_modules/@antv/g6-pc/es/layout/worker/work.js\");\n\nvar LayoutWorker = function LayoutWorker(workerScriptURL) {\n if (workerScriptURL === void 0) {\n workerScriptURL = 'https://unpkg.com/@antv/layout@latest/dist/layout.min.js';\n }\n\n function workerCode() {\n var LAYOUT_MESSAGE = {\n // run layout\n RUN: 'LAYOUT_RUN',\n // layout ended with success\n END: 'LAYOUT_END',\n // layout error\n ERROR: 'LAYOUT_ERROR',\n // layout tick, used in force directed layout\n TICK: 'LAYOUT_TICK',\n GPURUN: 'GPU_LAYOUT_RUN',\n GPUEND: 'GPU_LAYOUT_END'\n }; // @ts-ignore\n\n layout.registerLayout('grid', layout.GridLayout); // @ts-ignore\n\n layout.registerLayout('random', layout.RandomLayout); // @ts-ignore\n\n layout.registerLayout('force', layout.ForceLayout); // @ts-ignore\n\n layout.registerLayout('circular', layout.CircularLayout); // @ts-ignore\n\n layout.registerLayout('dagre', layout.DagreLayout); // @ts-ignore\n\n layout.registerLayout('dagreCompound', layout.DagreCompoundLayout); // @ts-ignore\n\n layout.registerLayout('radial', layout.RadialLayout); // @ts-ignore\n\n layout.registerLayout('concentric', layout.ConcentricLayout); // @ts-ignore\n\n layout.registerLayout('mds', layout.MDSLayout); // @ts-ignore\n\n layout.registerLayout('fruchterman', layout.FruchtermanLayout); // @ts-ignore\n\n layout.registerLayout('fruchterman-gpu', layout.FruchtermanGPULayout); // @ts-ignore\n\n layout.registerLayout('gForce', layout.GForceLayout); // @ts-ignore\n\n layout.registerLayout('gForce-gpu', layout.GForceGPULayout); // @ts-ignore\n\n layout.registerLayout('comboForce', layout.ComboForceLayout); // @ts-ignore\n\n layout.registerLayout('comboCombined', layout.ComboCombinedLayout); // @ts-ignore\n\n layout.registerLayout('forceAtlas2', layout.ForceAtlas2Layout);\n\n function isLayoutMessage(event) {\n var type = event.data.type;\n return type === LAYOUT_MESSAGE.RUN || type === LAYOUT_MESSAGE.GPURUN;\n }\n\n function handleLayoutMessage(event) {\n var _this = this;\n\n var type = event.data.type;\n\n switch (type) {\n case LAYOUT_MESSAGE.RUN:\n {\n var _a = event.data,\n nodes_1 = _a.nodes,\n edges = _a.edges,\n _b = _a.layoutCfg,\n layoutCfg = _b === void 0 ? {} : _b;\n var layoutType = layoutCfg.type; // @ts-ignore\n\n var LayoutClass = layout.getLayoutByName(layoutType);\n\n if (!LayoutClass) {\n this.postMessage({\n type: LAYOUT_MESSAGE.ERROR,\n message: \"layout \".concat(layoutType, \" not found\")\n });\n break;\n } // eslint-disable-next-line prefer-const\n\n\n var layoutMethod_1;\n\n layoutCfg.onLayoutEnd = function () {\n _this.postMessage({\n type: LAYOUT_MESSAGE.END,\n nodes: nodes_1\n });\n\n layoutMethod_1 === null || layoutMethod_1 === void 0 ? void 0 : layoutMethod_1.destroy();\n };\n\n layoutMethod_1 = new LayoutClass(layoutCfg);\n layoutMethod_1.init({\n nodes: nodes_1,\n edges: edges\n });\n layoutMethod_1.execute();\n break;\n }\n\n case LAYOUT_MESSAGE.GPURUN:\n {\n var _c = event.data,\n nodes = _c.nodes,\n edges = _c.edges,\n _d = _c.layoutCfg,\n layoutCfg = _d === void 0 ? {} : _d,\n canvas = _c.canvas;\n var layoutType = layoutCfg.type; // @ts-ignore\n\n var LayoutClass = layout.getLayoutByName(layoutType);\n\n if (!LayoutClass) {\n this.postMessage({\n type: LAYOUT_MESSAGE.ERROR,\n message: \"layout \".concat(layoutType, \" not found\")\n });\n break;\n }\n\n if (layoutType.split('-')[1] !== 'gpu') {\n this.postMessage({\n type: LAYOUT_MESSAGE.ERROR,\n message: \"layout \".concat(layoutType, \" does not support GPU\")\n });\n break;\n }\n\n var layoutMethod = new LayoutClass(layoutCfg);\n layoutMethod.init({\n nodes: nodes,\n edges: edges\n });\n layoutMethod.executeWithWorker(canvas, this);\n break;\n }\n\n default:\n break;\n }\n }\n\n onmessage = function onmessage(event) {\n if (isLayoutMessage(event)) {\n handleLayoutMessage(event);\n }\n };\n }\n\n var layoutWorker = new _work__WEBPACK_IMPORTED_MODULE_0__[\"default\"](workerCode, workerScriptURL);\n return layoutWorker;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/worker/layout.worker.js?"); +eval("\n// \"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// var rankUtil = require(\"./util\");\n// var longestPath = rankUtil.longestPathWithLayer;\n// var feasibleTree = require(\"./feasible-tree\").feasibleTreeWithLayer;\n// var networkSimplex = require(\"./network-simplex\");\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js\");\nvar feasible_tree_1 = __webpack_require__(/*! ./feasible-tree */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js\");\nvar network_simplex_1 = __importDefault(__webpack_require__(/*! ./network-simplex */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/network-simplex.js\"));\n/*\n * Assigns a rank to each node in the input graph that respects the \"minlen\"\n * constraint specified on edges between nodes.\n *\n * This basic structure is derived from Gansner, et al., \"A Technique for\n * Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a connected DAG\n * 2. Graph nodes must be objects\n * 3. Graph edges must have \"weight\" and \"minlen\" attributes\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have a \"rank\" attribute based on the results of the\n * algorithm. Ranks can start at any index (including negative), we'll\n * fix them up later.\n */\nvar rank = function (g) {\n switch (g.graph().ranker) {\n case \"network-simplex\":\n networkSimplexRanker(g);\n break;\n case \"tight-tree\":\n tightTreeRanker(g);\n break;\n case \"longest-path\":\n longestPathRanker(g);\n break;\n // default: networkSimplexRanker(g);\n default: tightTreeRanker(g);\n }\n};\n// A fast and simple ranker, but results are far from optimal.\nvar longestPathRanker = util_1.longestPath;\nvar tightTreeRanker = function (g) {\n (0, util_1.longestPathWithLayer)(g);\n (0, feasible_tree_1.feasibleTreeWithLayer)(g);\n};\nvar networkSimplexRanker = function (g) {\n (0, network_simplex_1.default)(g);\n};\nexports.default = rank;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/rank/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/layout/worker/layoutConst.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/layout/worker/layoutConst.js ***! - \******************************************************************/ -/*! exports provided: LAYOUT_MESSAGE */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/rank/network-simplex.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/rank/network-simplex.js ***! + \********************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LAYOUT_MESSAGE\", function() { return LAYOUT_MESSAGE; });\n/**\n * @fileoverview constants for layout\n * @author changzhe.zb@antfin.com\n */\n\n/** layout message type */\nvar LAYOUT_MESSAGE = {\n // run layout\n RUN: 'LAYOUT_RUN',\n // layout ended with success\n END: 'LAYOUT_END',\n // layout error\n ERROR: 'LAYOUT_ERROR',\n // layout tick, used in force directed layout\n TICK: 'LAYOUT_TICK',\n GPURUN: 'GPU_LAYOUT_RUN',\n GPUEND: 'GPU_LAYOUT_END'\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/worker/layoutConst.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.exchangeEdges = exports.enterEdge = exports.leaveEdge = exports.initLowLimValues = exports.calcCutValue = exports.initCutValues = void 0;\nvar feasible_tree_1 = __webpack_require__(/*! ./feasible-tree */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js\");\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js\");\nvar util_2 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar graphlib_1 = __webpack_require__(/*! @antv/graphlib */ \"./node_modules/@antv/graphlib/es/index.js\");\nvar preorder = graphlib_1.algorithm.preorder, postorder = graphlib_1.algorithm.postorder;\n/*\n * The network simplex algorithm assigns ranks to each node in the input graph\n * and iteratively improves the ranking to reduce the length of edges.\n *\n * Preconditions:\n *\n * 1. The input graph must be a DAG.\n * 2. All nodes in the graph must have an object value.\n * 3. All edges in the graph must have \"minlen\" and \"weight\" attributes.\n *\n * Postconditions:\n *\n * 1. All nodes in the graph will have an assigned \"rank\" attribute that has\n * been optimized by the network simplex algorithm. Ranks start at 0.\n *\n *\n * A rough sketch of the algorithm is as follows:\n *\n * 1. Assign initial ranks to each node. We use the longest path algorithm,\n * which assigns ranks to the lowest position possible. In general this\n * leads to very wide bottom ranks and unnecessarily long edges.\n * 2. Construct a feasible tight tree. A tight tree is one such that all\n * edges in the tree have no slack (difference between length of edge\n * and minlen for the edge). This by itself greatly improves the assigned\n * rankings by shorting edges.\n * 3. Iteratively find edges that have negative cut values. Generally a\n * negative cut value indicates that the edge could be removed and a new\n * tree edge could be added to produce a more compact graph.\n *\n * Much of the algorithms here are derived from Gansner, et al., \"A Technique\n * for Drawing Directed Graphs.\" The structure of the file roughly follows the\n * structure of the overall algorithm.\n */\nvar networkSimplex = function (og) {\n var g = (0, util_2.simplify)(og);\n (0, util_1.longestPath)(g);\n var t = (0, feasible_tree_1.feasibleTree)(g);\n (0, exports.initLowLimValues)(t);\n (0, exports.initCutValues)(t, g);\n var e;\n var f;\n while ((e = (0, exports.leaveEdge)(t))) {\n f = (0, exports.enterEdge)(t, g, e);\n (0, exports.exchangeEdges)(t, g, e, f);\n }\n};\n/*\n * Initializes cut values for all edges in the tree.\n */\nvar initCutValues = function (t, g) {\n var vs = postorder(t, t.nodes());\n vs = vs === null || vs === void 0 ? void 0 : vs.slice(0, (vs === null || vs === void 0 ? void 0 : vs.length) - 1);\n vs === null || vs === void 0 ? void 0 : vs.forEach(function (v) {\n assignCutValue(t, g, v);\n });\n};\nexports.initCutValues = initCutValues;\nvar assignCutValue = function (t, g, child) {\n var childLab = t.node(child);\n var parent = childLab.parent;\n t.edgeFromArgs(child, parent).cutvalue = (0, exports.calcCutValue)(t, g, child);\n};\n/*\n * Given the tight tree, its graph, and a child in the graph calculate and\n * return the cut value for the edge between the child and its parent.\n */\nvar calcCutValue = function (t, g, child) {\n var _a;\n var childLab = t.node(child);\n var parent = childLab.parent;\n // True if the child is on the tail end of the edge in the directed graph\n var childIsTail = true;\n // The graph's view of the tree edge we're inspecting\n var graphEdge = g.edgeFromArgs(child, parent);\n // The accumulated cut value for the edge between this node and its parent\n var cutValue = 0;\n if (!graphEdge) {\n childIsTail = false;\n graphEdge = g.edgeFromArgs(parent, child);\n }\n cutValue = graphEdge.weight;\n (_a = g.nodeEdges(child)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var isOutEdge = e.v === child;\n var other = isOutEdge ? e.w : e.v;\n if (other !== parent) {\n var pointsToHead = isOutEdge === childIsTail;\n var otherWeight = g.edge(e).weight;\n cutValue += pointsToHead ? otherWeight : -otherWeight;\n if (isTreeEdge(t, child, other)) {\n var otherCutValue = t.edgeFromArgs(child, other).cutvalue;\n cutValue += pointsToHead ? -otherCutValue : otherCutValue;\n }\n }\n });\n return cutValue;\n};\nexports.calcCutValue = calcCutValue;\nvar initLowLimValues = function (tree, root) {\n if (root === void 0) { root = tree.nodes()[0]; }\n dfsAssignLowLim(tree, {}, 1, root);\n};\nexports.initLowLimValues = initLowLimValues;\nvar dfsAssignLowLim = function (tree, visited, nextLim, v, parent) {\n var _a;\n var low = nextLim;\n var useNextLim = nextLim;\n var label = tree.node(v);\n visited[v] = true;\n (_a = tree.neighbors(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (w) {\n if (!visited[w]) {\n useNextLim = dfsAssignLowLim(tree, visited, useNextLim, w, v);\n }\n });\n label.low = low;\n label.lim = useNextLim++;\n if (parent) {\n label.parent = parent;\n }\n else {\n // TODO should be able to remove this when we incrementally update low lim\n delete label.parent;\n }\n return useNextLim;\n};\nvar leaveEdge = function (tree) {\n return tree.edges().find(function (e) {\n return tree.edge(e).cutvalue < 0;\n });\n};\nexports.leaveEdge = leaveEdge;\nvar enterEdge = function (t, g, edge) {\n var v = edge.v;\n var w = edge.w;\n // For the rest of this function we assume that v is the tail and w is the\n // head, so if we don't have this edge in the graph we should flip it to\n // match the correct orientation.\n if (!g.hasEdge(v, w)) {\n v = edge.w;\n w = edge.v;\n }\n var vLabel = t.node(v);\n var wLabel = t.node(w);\n var tailLabel = vLabel;\n var flip = false;\n // If the root is in the tail of the edge then we need to flip the logic that\n // checks for the head and tail nodes in the candidates function below.\n if (vLabel.lim > wLabel.lim) {\n tailLabel = wLabel;\n flip = true;\n }\n var candidates = g.edges().filter(function (edge) {\n return flip === isDescendant(t, t.node(edge.v), tailLabel) &&\n flip !== isDescendant(t, t.node(edge.w), tailLabel);\n });\n return (0, util_2.minBy)(candidates, function (edge) { return (0, util_1.slack)(g, edge); });\n};\nexports.enterEdge = enterEdge;\nvar exchangeEdges = function (t, g, e, f) {\n var v = e.v;\n var w = e.w;\n t.removeEdge(v, w);\n t.setEdge(f.v, f.w, {});\n (0, exports.initLowLimValues)(t);\n (0, exports.initCutValues)(t, g);\n updateRanks(t, g);\n};\nexports.exchangeEdges = exchangeEdges;\nvar updateRanks = function (t, g) {\n var root = t.nodes().find(function (v) { var _a; return !((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.parent); });\n var vs = preorder(t, root);\n vs = vs === null || vs === void 0 ? void 0 : vs.slice(1);\n vs === null || vs === void 0 ? void 0 : vs.forEach(function (v) {\n var parent = t.node(v).parent;\n var edge = g.edgeFromArgs(v, parent);\n var flipped = false;\n if (!edge) {\n edge = g.edgeFromArgs(parent, v);\n flipped = true;\n }\n g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen);\n });\n};\n/*\n * Returns true if the edge is in the tree.\n */\nvar isTreeEdge = function (tree, u, v) {\n return tree.hasEdge(u, v);\n};\n/*\n * Returns true if the specified node is descendant of the root node per the\n * assigned low and lim attributes in the tree.\n */\nvar isDescendant = function (tree, vLabel, rootLabel) {\n return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;\n};\nexports.default = networkSimplex;\n//# sourceMappingURL=network-simplex.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/rank/network-simplex.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/layout/worker/work.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/layout/worker/work.js ***! - \***********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js ***! + \*********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar WebWorker =\n/** @class */\nfunction () {\n function WebWorker(worker, workerScirptURL) {\n var code = worker.toString();\n var blob = new Blob([\"importScripts('\".concat(workerScirptURL, \"');(\").concat(code, \")()\")], {\n type: 'text/javascript'\n });\n return new Worker(URL.createObjectURL(blob));\n }\n\n return WebWorker;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (WebWorker);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/layout/worker/work.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.slack = exports.longestPathWithLayer = exports.longestPath = void 0;\n/*\n * Initializes ranks for the input graph using the longest path algorithm. This\n * algorithm scales well and is fast in practice, it yields rather poor\n * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom\n * ranks wide and leaving edges longer than necessary. However, due to its\n * speed, this algorithm is good for getting an initial ranking that can be fed\n * into other algorithms.\n *\n * This algorithm does not normalize layers because it will be used by other\n * algorithms in most cases. If using this algorithm directly, be sure to\n * run normalize at the end.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG.\n * 2. Input graph node labels can be assigned properties.\n *\n * Post-conditions:\n *\n * 1. Each node will be assign an (unnormalized) \"rank\" property.\n */\nvar longestPath = function (g) {\n var _a;\n var visited = {};\n var dfs = function (v) {\n var _a;\n var label = g.node(v);\n if (!label)\n return 0;\n if (visited[v]) {\n return label.rank;\n }\n visited[v] = true;\n var rank;\n (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (edgeObj) {\n var wRank = dfs(edgeObj.w);\n var minLen = g.edge(edgeObj).minlen;\n var r = wRank - minLen;\n if (r) {\n if (rank === undefined || r < rank) {\n rank = r;\n }\n }\n });\n if (!rank) {\n rank = 0;\n }\n label.rank = rank;\n return rank;\n };\n (_a = g.sources()) === null || _a === void 0 ? void 0 : _a.forEach(function (source) { return dfs(source); });\n};\nexports.longestPath = longestPath;\nvar longestPathWithLayer = function (g) {\n var _a;\n // 用longest path,找出最深的点\n var visited = {};\n var minRank;\n var dfs = function (v) {\n var _a;\n var label = g.node(v);\n if (!label)\n return 0;\n if (visited[v]) {\n return label.rank;\n }\n visited[v] = true;\n var rank;\n (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (edgeObj) {\n var wRank = dfs(edgeObj.w);\n var minLen = g.edge(edgeObj).minlen;\n var r = wRank - minLen;\n if (r) {\n if (rank === undefined || r < rank) {\n rank = r;\n }\n }\n });\n if (!rank) {\n rank = 0;\n }\n if (minRank === undefined || rank < minRank) {\n minRank = rank;\n }\n label.rank = rank;\n return rank;\n };\n (_a = g.sources()) === null || _a === void 0 ? void 0 : _a.forEach(function (source) {\n if (g.node(source))\n dfs(source);\n });\n if (minRank === undefined) {\n minRank = 0;\n }\n // minRank += 1; // NOTE: 最小的层级是dummy root,+1\n // forward一遍,赋值层级\n var forwardVisited = {};\n var dfsForward = function (v, nextRank) {\n var _a;\n var label = g.node(v);\n var currRank = (!isNaN(label.layer) ? label.layer : nextRank);\n // 没有指定,取最大值\n if (label.rank === undefined || label.rank < currRank) {\n label.rank = currRank;\n }\n if (forwardVisited[v])\n return;\n forwardVisited[v] = true;\n // DFS遍历子节点\n (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.map(function (e) {\n dfsForward(e.w, currRank + g.edge(e).minlen);\n });\n };\n // 指定层级的,更新下游\n g.nodes().forEach(function (n) {\n var label = g.node(n);\n if (!label)\n return;\n if (!isNaN(label.layer)) {\n dfsForward(n, label.layer); // 默认的dummy root所在层的rank是-1\n }\n else {\n label.rank -= minRank;\n }\n });\n};\nexports.longestPathWithLayer = longestPathWithLayer;\n/*\n * Returns the amount of slack for the given edge. The slack is defined as the\n * difference between the length of the edge and its minimum length.\n */\nvar slack = function (g, e) {\n return (g.node(e.w).rank -\n g.node(e.v).rank -\n g.edge(e).minlen);\n};\nexports.slack = slack;\nexports.default = {\n longestPath: longestPath,\n longestPathWithLayer: longestPathWithLayer,\n slack: slack,\n};\n//# sourceMappingURL=util.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/plugin/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/plugin/index.js ***! - \*****************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/util.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagre/src/util.js ***! + \****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_g6_plugin__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-plugin */ \"./node_modules/@antv/g6-plugin/es/index.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_antv_g6_plugin__WEBPACK_IMPORTED_MODULE_0__[\"default\"]); // export default {};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/plugin/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.minBy = exports.notime = exports.time = exports.partition = exports.maxRank = exports.addBorderNode = exports.removeEmptyRanks = exports.normalizeRanks = exports.buildLayerMatrix = exports.intersectRect = exports.predecessorWeights = exports.successorWeights = exports.zipObject = exports.asNonCompoundGraph = exports.simplify = exports.addDummyNode = void 0;\nvar util_1 = __webpack_require__(/*! ../../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar graph_1 = __webpack_require__(/*! ../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\nvar safeSort = function (valueA, valueB) {\n return Number(valueA) - Number(valueB);\n};\n/*\n * Adds a dummy node to the graph and return v.\n */\nvar addDummyNode = function (g, type, attrs, name) {\n var v;\n do {\n v = \"\".concat(name).concat(Math.random());\n } while (g.hasNode(v));\n attrs.dummy = type;\n g.setNode(v, attrs);\n return v;\n};\nexports.addDummyNode = addDummyNode;\n/*\n * Returns a new graph with only simple edges. Handles aggregation of data\n * associated with multi-edges.\n */\nvar simplify = function (g) {\n var simplified = new graph_1.Graph().setGraph(g.graph());\n g.nodes().forEach(function (v) { simplified.setNode(v, g.node(v)); });\n g.edges().forEach(function (e) {\n var simpleLabel = simplified.edgeFromArgs(e.v, e.w) || { weight: 0, minlen: 1 };\n var label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n};\nexports.simplify = simplify;\nvar asNonCompoundGraph = function (g) {\n var simplified = new graph_1.Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph());\n g.nodes().forEach(function (node) {\n var _a;\n if (!((_a = g.children(node)) === null || _a === void 0 ? void 0 : _a.length)) {\n simplified.setNode(node, g.node(node));\n }\n });\n g.edges().forEach(function (edge) {\n simplified.setEdgeObj(edge, g.edge(edge));\n });\n return simplified;\n};\nexports.asNonCompoundGraph = asNonCompoundGraph;\nvar zipObject = function (keys, values) {\n return keys === null || keys === void 0 ? void 0 : keys.reduce(function (obj, key, i) {\n obj[key] = values[i];\n return obj;\n }, {});\n};\nexports.zipObject = zipObject;\nvar successorWeights = function (g) {\n var weightsMap = {};\n g.nodes().forEach(function (node) {\n var _a;\n var sucs = {};\n (_a = g.outEdges(node)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var _a;\n sucs[e.w] = (sucs[e.w] || 0) + (((_a = g.edge(e)) === null || _a === void 0 ? void 0 : _a.weight) || 0);\n });\n weightsMap[node] = sucs;\n });\n return weightsMap;\n};\nexports.successorWeights = successorWeights;\nvar predecessorWeights = function (g) {\n var nodes = g.nodes();\n var weightMap = nodes.map(function (v) {\n var _a;\n var preds = {};\n (_a = g.inEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight;\n });\n return preds;\n });\n return (0, exports.zipObject)(nodes, weightMap);\n};\nexports.predecessorWeights = predecessorWeights;\n/*\n * Finds where a line starting at point ({x, y}) would intersect a rectangle\n * ({x, y, width, height}) if it were pointing at the rectangle's center.\n */\nvar intersectRect = function (rect, point) {\n var x = Number(rect.x);\n var y = Number(rect.y);\n // Rectangle intersection algorithm from:\n // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes\n var dx = Number(point.x) - x;\n var dy = Number(point.y) - y;\n var w = Number(rect.width) / 2;\n var h = Number(rect.height) / 2;\n if (!dx && !dy) {\n // completely overlapped directly, then return points its self\n return { x: 0, y: 0 };\n }\n var sx;\n var sy;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = (h * dx) / dy;\n sy = h;\n }\n else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = (w * dy) / dx;\n }\n return { x: x + sx, y: y + sy };\n};\nexports.intersectRect = intersectRect;\n/*\n * Given a DAG with each node assigned \"rank\" and \"order\" properties, this\n * const will produce a matrix with the ids of each node.\n */\nvar buildLayerMatrix = function (g) {\n var layeringNodes = [];\n var rankMax = (0, exports.maxRank)(g) + 1;\n for (var i = 0; i < rankMax; i++) {\n layeringNodes.push([]);\n }\n // const layering = _.map(_.range(maxRank(g) + 1), function() { return []; });\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (!node)\n return;\n var rank = node.rank;\n if (rank !== undefined && layeringNodes[rank]) {\n layeringNodes[rank].push(v);\n }\n });\n for (var i = 0; i < rankMax; i++) {\n layeringNodes[i] = layeringNodes[i].sort(function (va, vb) { var _a, _b; return safeSort((_a = g.node(va)) === null || _a === void 0 ? void 0 : _a.order, (_b = g.node(vb)) === null || _b === void 0 ? void 0 : _b.order); });\n }\n return layeringNodes;\n};\nexports.buildLayerMatrix = buildLayerMatrix;\n/*\n * Adjusts the ranks for all nodes in the graph such that all nodes v have\n * rank(v) >= 0 and at least one node w has rank(w) = 0.\n */\nvar normalizeRanks = function (g) {\n var nodeRanks = g\n .nodes()\n .filter(function (v) { var _a; return ((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.rank) !== undefined; })\n .map(function (v) { return g.node(v).rank; });\n var min = Math.min.apply(Math, nodeRanks);\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (node.hasOwnProperty(\"rank\") && min !== Infinity) {\n node.rank -= min;\n }\n });\n};\nexports.normalizeRanks = normalizeRanks;\nvar removeEmptyRanks = function (g) {\n // Ranks may not start at 0, so we need to offset them\n var nodes = g.nodes();\n var nodeRanks = nodes\n .filter(function (v) { var _a; return ((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.rank) !== undefined; })\n .map(function (v) { return g.node(v).rank; });\n var offset = Math.min.apply(Math, nodeRanks);\n var layers = [];\n nodes.forEach(function (v) {\n var _a;\n var rank = (((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.rank) || 0) - offset;\n if (!layers[rank]) {\n layers[rank] = [];\n }\n layers[rank].push(v);\n });\n var delta = 0;\n var nodeRankFactor = g.graph().nodeRankFactor || 0;\n for (var i = 0; i < layers.length; i++) {\n var vs = layers[i];\n if (vs === undefined) {\n if (i % nodeRankFactor !== 0) {\n delta -= 1;\n }\n }\n else if (delta) {\n vs === null || vs === void 0 ? void 0 : vs.forEach(function (v) {\n var node = g.node(v);\n if (node) {\n node.rank = node.rank || 0;\n node.rank += delta;\n }\n });\n }\n }\n};\nexports.removeEmptyRanks = removeEmptyRanks;\nvar addBorderNode = function (g, prefix, rank, order) {\n var node = {\n width: 0,\n height: 0\n };\n if ((0, util_1.isNumber)(rank) && (0, util_1.isNumber)(order)) {\n node.rank = rank;\n node.order = order;\n }\n return (0, exports.addDummyNode)(g, \"border\", node, prefix);\n};\nexports.addBorderNode = addBorderNode;\nvar maxRank = function (g) {\n var maxRank;\n g.nodes().forEach(function (v) {\n var _a;\n var rank = (_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.rank;\n if (rank !== undefined) {\n if (maxRank === undefined || rank > maxRank) {\n maxRank = rank;\n }\n }\n });\n if (!maxRank) {\n maxRank = 0;\n }\n return maxRank;\n};\nexports.maxRank = maxRank;\n/*\n * Partition a collection into two groups: `lhs` and `rhs`. If the supplied\n * const returns true for an entry it goes into `lhs`. Otherwise it goes\n * into `rhs.\n */\nvar partition = function (collection, fn) {\n var result = { lhs: [], rhs: [] };\n collection === null || collection === void 0 ? void 0 : collection.forEach(function (value) {\n if (fn(value)) {\n result.lhs.push(value);\n }\n else {\n result.rhs.push(value);\n }\n });\n return result;\n};\nexports.partition = partition;\n/*\n * Returns a new const that wraps `fn` with a timer. The wrapper logs the\n * time it takes to execute the function.\n */\nvar time = function (name, fn) {\n var start = Date.now();\n try {\n return fn();\n }\n finally {\n console.log(\"\".concat(name, \" time: \").concat(Date.now() - start, \"ms\"));\n }\n};\nexports.time = time;\nvar notime = function (name, fn) {\n return fn();\n};\nexports.notime = notime;\nvar minBy = function (array, func) {\n return array.reduce(function (a, b) {\n var valA = func(a);\n var valB = func(b);\n return valA > valB ? b : a;\n });\n};\nexports.minBy = minBy;\n//# sourceMappingURL=util.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/util.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/types/index.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/types/index.js ***! - \****************************************************/ -/*! no exports provided */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/dagreCompound.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/dagreCompound.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/types/index.js?"); +eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DagreCompoundLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar dagre_compound_1 = __webpack_require__(/*! dagre-compound */ \"./node_modules/dagre-compound/dist/dagre-compound.es5.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar DagreCompoundLayout = /** @class */ (function (_super) {\n __extends(DagreCompoundLayout, _super);\n function DagreCompoundLayout(options) {\n var _this = _super.call(this) || this;\n /** layout 方向, 可选 TB, BT, LR, RL */\n _this.rankdir = 'TB';\n /** 节点水平间距(px) */\n _this.nodesep = 50;\n /** 边水平间距(px) */\n _this.edgesep = 5;\n /** 每一层节点之间间距 */\n _this.ranksep = 50;\n /** 是否保留布局连线的控制点 */\n _this.controlPoints = true;\n /** 是否保留使用布局计算的锚点 */\n _this.anchorPoint = true;\n _this.nodes = [];\n _this.edges = [];\n _this.combos = [];\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n DagreCompoundLayout.prototype.getDefaultCfg = function () {\n return {\n rankdir: 'TB',\n align: undefined,\n begin: undefined,\n nodeSize: undefined,\n nodesep: 50,\n ranksep: 50,\n controlPoints: true,\n anchorPoint: true // 是否使用布局计算的锚点\n };\n };\n DagreCompoundLayout.prototype.init = function (data) {\n var hiddenNodes = data.hiddenNodes || []; // 被隐藏的节点\n var hiddenEdges = data.hiddenEdges || []; // 被隐藏的边\n var hiddenCombos = data.hiddenCombos || []; // 赋值 hiddenCombos\n // 确保此次排序按照用户输入顺序\n this.nodes = this.getDataByOrder((data.nodes || []).concat(hiddenNodes));\n this.edges = this.getDataByOrder((data.edges || []).concat(hiddenEdges));\n this.combos = (data.combos || []).concat(hiddenCombos.map(function (hc) { return (__assign(__assign({}, hc), { collapsed: true })); }));\n };\n DagreCompoundLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes, edges = self.edges;\n if (!nodes)\n return;\n var _a = self.getLayoutConfig(), graphDef = _a.graphDef, graphOption = _a.graphOption, graphSettings = _a.graphSettings;\n var renderInfo = (0, dagre_compound_1.buildGraph)(graphDef, graphOption, graphSettings);\n var flattenedRenderInfo = (0, dagre_compound_1.flatGraph)(renderInfo, true); // 打平数据进行遍历\n this.updatePosition(flattenedRenderInfo);\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n };\n /**\n * combo 模式下查找节点完整路径\n * @param nodeId\n * @private\n */\n DagreCompoundLayout.prototype.getNodePath = function (nodeId) {\n var self = this;\n var nodes = self.nodes, combos = self.combos;\n var targetNode = nodes.find(function (n) { return n.id === nodeId; });\n var findPath = function (comboId, fullPath) {\n if (fullPath === void 0) { fullPath = []; }\n var combo = combos.find(function (c) { return c.id === comboId; });\n if (combo) {\n fullPath.unshift(comboId);\n if (combo.parentId) {\n return findPath(combo.parentId, fullPath);\n }\n return fullPath;\n }\n return fullPath;\n };\n if (targetNode && targetNode.comboId) {\n return findPath(targetNode.comboId, [nodeId]);\n }\n return [nodeId];\n };\n /** 准备 dagre-compound 布局参数 */\n DagreCompoundLayout.prototype.getLayoutConfig = function () {\n var _a, _b, _c;\n var self = this;\n var nodes = self.nodes, edges = self.edges, combos = self.combos, nodeSize = self.nodeSize, rankdir = self.rankdir, align = self.align, edgesep = self.edgesep, nodesep = self.nodesep, ranksep = self.ranksep, settings = self.settings;\n var compound = (combos || []).reduce(function (pre, cur) {\n var matchedNodes = nodes.filter(function (n) { return n.comboId === cur.id; }).map(function (n) { return n.id; });\n var matchedCombos = (combos || []).filter(function (n) { return n.parentId === cur.id; }).map(function (n) { return n.id; });\n if (matchedNodes.length || matchedCombos.length) {\n pre[cur.id] = __spreadArray(__spreadArray([], matchedNodes, true), matchedCombos, true);\n }\n return pre;\n }, {});\n /** 计算 nodeSize */\n var nodeSizeFunc;\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d && d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return d.size;\n }\n if ((0, util_1.isObject)(d.size)) {\n return [d.size.width || 40, d.size.height || 40];\n }\n return [d.size, d.size];\n }\n return [40, 40];\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function () { return nodeSize; };\n }\n else {\n nodeSizeFunc = function () { return [nodeSize, nodeSize]; };\n }\n /** 计算 comboSize */\n var comboSizeFunc = function (d) {\n if (d && d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return d.size;\n }\n return [d.size, d.size];\n }\n return [80, 40];\n };\n // 接受 defaultCombo 设置的 size\n var _d = comboSizeFunc(combos === null || combos === void 0 ? void 0 : combos[0]), metaWidth = _d[0], metaHeight = _d[1];\n // 初始化 padding\n var subSceneMeta = (_b = (_a = self.graphSettings) === null || _a === void 0 ? void 0 : _a.subScene) === null || _b === void 0 ? void 0 : _b.meta;\n var _e = ((_c = combos.find(function (c) { return !c.collapsed; })) === null || _c === void 0 ? void 0 : _c.padding) || [20, 20, 20, 20], paddingTop = _e[0], paddingRight = _e[1], paddingBottom = _e[2], paddingLeft = _e[3];\n var graphDef = {\n compound: compound,\n nodes: __spreadArray([], (nodes || []).map(function (n) {\n var size = nodeSizeFunc(n);\n var width = size[0];\n var height = size[1];\n return __assign(__assign({}, n), { width: width, height: height });\n }), true),\n edges: __spreadArray([], (edges || []).map(function (e) { return (__assign(__assign({}, e), { v: e.source, w: e.target })); }), true)\n };\n // 需要展开的节点\n var graphOption = {\n expanded: (combos || []).filter(function (c) { return !c.collapsed; }).map(function (c) { return c.id; })\n };\n // dagre-compound 布局参数\n var graphMetaConfig = {\n graph: {\n meta: {\n align: align,\n rankDir: rankdir,\n nodeSep: nodesep,\n edgeSep: edgesep,\n rankSep: ranksep\n }\n },\n subScene: {\n meta: {\n paddingTop: paddingTop || (subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingTop) || 20,\n paddingRight: paddingRight || (subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingRight) || 20,\n paddingBottom: paddingBottom || (subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingBottom) || 20,\n paddingLeft: paddingLeft || (subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingLeft) || 20,\n labelHeight: 0\n }\n },\n nodeSize: {\n meta: {\n width: metaWidth,\n height: metaHeight\n }\n }\n };\n // 合并用户输入的内容\n var graphSettings = (0, dagre_compound_1.mergeConfig)(settings, __assign({}, (0, dagre_compound_1.mergeConfig)(graphMetaConfig, dagre_compound_1.LAYOUT_CONFIG)));\n self.graphSettings = graphSettings;\n return {\n graphDef: graphDef,\n graphOption: graphOption,\n graphSettings: graphSettings\n };\n };\n /** 更新节点与边位置 */\n DagreCompoundLayout.prototype.updatePosition = function (flattenedGraph) {\n var nodes = flattenedGraph.nodes, edges = flattenedGraph.edges;\n this.updateNodePosition(nodes, edges);\n this.updateEdgePosition(nodes, edges);\n };\n DagreCompoundLayout.prototype.getBegin = function (flattenedNodes, flattenedEdges) {\n var self = this;\n var begin = self.begin;\n var dBegin = [0, 0];\n if (begin) {\n var minX_1 = Infinity;\n var minY_1 = Infinity;\n flattenedNodes.forEach(function (node) {\n if (minX_1 > node.x)\n minX_1 = node.x;\n if (minY_1 > node.y)\n minY_1 = node.y;\n });\n flattenedEdges.forEach(function (edge) {\n edge.points.forEach(function (point) {\n if (minX_1 > point.x)\n minX_1 = point.x;\n if (minY_1 > point.y)\n minY_1 = point.y;\n });\n });\n dBegin[0] = begin[0] - minX_1;\n dBegin[1] = begin[1] - minY_1;\n }\n return dBegin;\n };\n DagreCompoundLayout.prototype.updateNodePosition = function (flattenedNodes, flattenedEdges) {\n var self = this;\n var combos = self.combos, nodes = self.nodes, edges = self.edges, anchorPoint = self.anchorPoint, graphSettings = self.graphSettings;\n var dBegin = this.getBegin(flattenedNodes, flattenedEdges);\n flattenedNodes.forEach(function (node) {\n var _a;\n var x = node.x, y = node.y, id = node.id, type = node.type, coreBox = node.coreBox;\n if (type === dagre_compound_1.HierarchyNodeType.META && id !== dagre_compound_1.ROOT_NAME) {\n var i = combos.findIndex(function (item) { return item.id === id; });\n var subSceneMeta = (_a = graphSettings === null || graphSettings === void 0 ? void 0 : graphSettings.subScene) === null || _a === void 0 ? void 0 : _a.meta;\n // 将布局生成的 combo 位置暂存至 offsetX offsetY\n combos[i].offsetX = x + dBegin[0];\n combos[i].offsetY = y + dBegin[1];\n combos[i].fixSize = [coreBox.width, coreBox.height];\n combos[i].fixCollapseSize = [coreBox.width, coreBox.height];\n // 如果设置了收起时隐藏 padding,则手动优化 combo padding 信息,展开的话则恢复\n if (!node.expanded) {\n combos[i].padding = [0, 0, 0, 0];\n }\n else {\n combos[i].padding = [\n subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingTop,\n subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingRight,\n subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingBottom,\n subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingLeft\n ];\n }\n }\n else if (type === dagre_compound_1.HierarchyNodeType.OP) {\n var i = nodes.findIndex(function (item) { return item.id === id; });\n nodes[i].x = x + dBegin[0];\n nodes[i].y = y + dBegin[1];\n if (anchorPoint) {\n var anchorPoints_1 = [];\n var outEdges = flattenedEdges.filter(function (e) { return e.v === id; });\n var inEdges = flattenedEdges.filter(function (e) { return e.w === id; });\n // 指定出边锚点,锚点中心点为 [0.5, 0.5]\n if (outEdges.length > 0) {\n outEdges.forEach(function (outEdge) {\n var firstPoint = outEdge.points[0];\n var anchorPointX = (firstPoint.x - x) / node.width + 0.5;\n var anchorPointY = (firstPoint.y - y) / node.height + 0.5;\n anchorPoints_1.push([anchorPointX, anchorPointY]);\n // 出边对应 source 边锚点\n outEdge.baseEdgeList.forEach(function (baseEdge) {\n var edge = edges.find(function (e) { return e.source === baseEdge.v && e.target === baseEdge.w; });\n if (edge) {\n edge.sourceAnchor = anchorPoints_1.length - 1;\n }\n });\n });\n }\n // 指定入边锚点\n if (inEdges.length > 0) {\n inEdges.forEach(function (inEdge) {\n var lastPoint = inEdge.points[inEdge.points.length - 1];\n var anchorPointX = (lastPoint.x - x) / node.width + 0.5;\n var anchorPointY = (lastPoint.y - y) / node.height + 0.5;\n anchorPoints_1.push([anchorPointX, anchorPointY]);\n // 出边对应 source 锚点\n inEdge.baseEdgeList.forEach(function (baseEdge) {\n var edge = edges.find(function (e) { return e.source === baseEdge.v && e.target === baseEdge.w; });\n if (edge) {\n edge.targetAnchor = anchorPoints_1.length - 1;\n }\n });\n });\n }\n nodes[i].anchorPoints = anchorPoints_1.length > 0 ? anchorPoints_1 : nodes[i].anchorPoints || [];\n }\n }\n });\n };\n DagreCompoundLayout.prototype.updateEdgePosition = function (flattenedNodes, flattenedEdges) {\n var self = this;\n var combos = self.combos, edges = self.edges, controlPoints = self.controlPoints;\n var dBegin = this.getBegin(flattenedNodes, flattenedEdges);\n if (controlPoints) {\n combos.forEach(function (combo) {\n combo.inEdges = [];\n combo.outEdges = [];\n });\n edges.forEach(function (sourceEdge) {\n var _a, _b, _c, _d;\n var sourceNode = flattenedNodes.find(function (v) { return v.id === sourceEdge.source; });\n var targetNode = flattenedNodes.find(function (v) { return v.id === sourceEdge.target; });\n // Combo 收起状态,dagre-compound 不会渲染该节点,边需要使用到 group 的边作为补充\n var points = [];\n var sortedEdges = [];\n if (sourceNode && targetNode) {\n sortedEdges = (0, dagre_compound_1.getEdges)(sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.id, targetNode === null || targetNode === void 0 ? void 0 : targetNode.id, flattenedNodes);\n }\n else if (!sourceNode || !targetNode) {\n /** 存在收起节点时,需要重新计算边的 controlPoints,确保线正常 */\n // 情况1:目标节点被收起了,向上寻找该节点最近一个存在的父节点\n var sourceNodePath = self.getNodePath(sourceEdge.source);\n var targetNodePath = self.getNodePath(sourceEdge.target);\n var lastExistingSource_1 = sourceNodePath\n .reverse()\n .slice(!sourceNode ? 1 : 0)\n .find(function (parentId) { return flattenedNodes.find(function (fNode) { return fNode.id === parentId; }); });\n var lastExistingTarget_1 = targetNodePath\n .reverse()\n .slice(!targetNode ? 1 : 0)\n .find(function (parentId) { return flattenedNodes.find(function (fNode) { return fNode.id === parentId; }); });\n sourceNode = flattenedNodes.find(function (v) { return v.id === lastExistingSource_1; });\n targetNode = flattenedNodes.find(function (v) { return v.id === lastExistingTarget_1; });\n sortedEdges = (0, dagre_compound_1.getEdges)(sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.id, targetNode === null || targetNode === void 0 ? void 0 : targetNode.id, flattenedNodes, { v: sourceEdge.source, w: sourceEdge.target });\n }\n points = sortedEdges.reduce(function (pre, cur) {\n return __spreadArray(__spreadArray([], pre, true), cur.points.map(function (p) {\n return __assign(__assign({}, p), { x: p.x + dBegin[0], y: p.y + dBegin[1] });\n }), true);\n }, []);\n // 取消首尾节点\n points = points.slice(1, -1);\n sourceEdge.controlPoints = points;\n if ((targetNode === null || targetNode === void 0 ? void 0 : targetNode.type) === dagre_compound_1.NodeType.META) {\n // combo 节点控制点\n var i = combos.findIndex(function (item) { return item.id === (targetNode === null || targetNode === void 0 ? void 0 : targetNode.id); });\n if (!combos[i] || ((_a = combos[i].inEdges) === null || _a === void 0 ? void 0 : _a.some(function (inEdge) { return inEdge.source === sourceNode.id && inEdge.target === targetNode.id; }))) {\n return;\n }\n (_b = combos[i].inEdges) === null || _b === void 0 ? void 0 : _b.push({\n source: sourceNode.id,\n target: targetNode.id,\n controlPoints: points\n });\n }\n if ((sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.type) === dagre_compound_1.NodeType.META) {\n var i = combos.findIndex(function (item) { return item.id === (sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.id); });\n if (!combos[i] || ((_c = combos[i].outEdges) === null || _c === void 0 ? void 0 : _c.some(function (oedge) { return oedge.source === sourceNode.id && oedge.target === targetNode.id; }))) {\n return;\n }\n (_d = combos[i].outEdges) === null || _d === void 0 ? void 0 : _d.push({\n source: sourceNode.id,\n target: targetNode.id,\n controlPoints: points\n });\n }\n });\n }\n };\n DagreCompoundLayout.prototype.getType = function () {\n return 'dagreCompound';\n };\n /**\n * 确保布局使用的数据与用户输入数据顺序一致\n * 通过 layoutOrder 排序 节点 与 边\n * @param list\n * @private\n */\n DagreCompoundLayout.prototype.getDataByOrder = function (list) {\n if (list.every(function (n) { return n.layoutOrder !== undefined; })) {\n // 所有数据均设置过索引,表示仅布局,数据未变化,无需处理\n }\n else {\n // 首次布局或动态添加删减节点时重新赋值\n list.forEach(function (n, i) {\n n.layoutOrder = i;\n });\n }\n // 按照 layoutOrder 排序\n return list.sort(function (pre, cur) { return pre.layoutOrder - cur.layoutOrder; });\n };\n return DagreCompoundLayout;\n}(base_1.Base));\nexports.DagreCompoundLayout = DagreCompoundLayout;\n//# sourceMappingURL=dagreCompound.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagreCompound.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/util/color.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/util/color.js ***! - \***************************************************/ -/*! exports provided: mixColor, getColorsWithSubjectColor, getColorSetsBySubjectColors */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/er/core.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/er/core.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mixColor\", function() { return mixColor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getColorsWithSubjectColor\", function() { return getColorsWithSubjectColor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getColorSetsBySubjectColors\", function() { return getColorSetsBySubjectColors; });\n/* harmony import */ var color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! color */ \"./node_modules/color/index.js\");\n/* harmony import */ var color__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(color__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony import */ var _ant_design_colors__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @ant-design/colors */ \"./node_modules/@ant-design/colors/dist/index.esm.js\");\n\n\n/**\n * get the mix color of backColor and frontColor with alpah\n * @param backColor background color\n * @param frontColor foreground color\n * @param frontAlpha the opacity of foreground color\n */\n\nvar mixColor = function mixColor(backColor, frontColor, frontAlpha) {\n var bc = color__WEBPACK_IMPORTED_MODULE_0___default()(backColor);\n var fc = color__WEBPACK_IMPORTED_MODULE_0___default()(frontColor);\n return color__WEBPACK_IMPORTED_MODULE_0___default()([(1 - frontAlpha) * bc.red() + frontAlpha * fc.red(), (1 - frontAlpha) * bc.green() + frontAlpha * fc.green(), (1 - frontAlpha) * bc.blue() + frontAlpha * fc.blue()]).rgb();\n};\n\nvar getColorsWithDefaultTheme = function getColorsWithDefaultTheme(subjectColor, backColor, disableColor) {\n if (backColor === void 0) {\n backColor = '#fff';\n }\n\n if (disableColor === void 0) {\n disableColor = 'rgb(150, 150, 150)';\n }\n\n var subjectColor005 = mixColor(backColor, subjectColor, 0.05).rgb().toString();\n var subjectColor01 = mixColor(backColor, subjectColor, 0.1).rgb().toString();\n var subjectColor02 = mixColor(backColor, subjectColor, 0.2).rgb().toString();\n var subjectColor04 = mixColor(backColor, subjectColor, 0.4).rgb().toString();\n var disableColor002 = mixColor(backColor, disableColor, 0.02).rgb().toString();\n var disableColor005 = mixColor(backColor, disableColor, 0.05).rgb().toString();\n var disableColor01 = mixColor(backColor, disableColor, 0.1).rgb().toString();\n var disableColor02 = mixColor(backColor, disableColor, 0.2).rgb().toString();\n var disableColor03 = mixColor(backColor, disableColor, 0.3).rgb().toString();\n var paletteFromSubject = Object(_ant_design_colors__WEBPACK_IMPORTED_MODULE_1__[\"generate\"])(subjectColor, {\n theme: 'default',\n backgroundColor: backColor\n });\n var subjectHex = color__WEBPACK_IMPORTED_MODULE_0___default()(subjectColor).hex().toLowerCase();\n var subjectIdx = paletteFromSubject.indexOf(subjectHex);\n var deeperSubject = subjectColor;\n\n if (subjectIdx !== -1) {\n deeperSubject = paletteFromSubject[subjectIdx + 1];\n }\n\n return {\n // for nodes\n mainStroke: subjectColor,\n mainFill: subjectColor01,\n activeStroke: subjectColor,\n activeFill: subjectColor005,\n inactiveStroke: subjectColor04,\n inactiveFill: subjectColor005,\n selectedStroke: subjectColor,\n selectedFill: backColor,\n highlightStroke: deeperSubject,\n highlightFill: subjectColor02,\n disableStroke: disableColor03,\n disableFill: disableColor005,\n // for edges\n edgeMainStroke: disableColor03,\n edgeActiveStroke: subjectColor,\n edgeInactiveStroke: disableColor02,\n edgeSelectedStroke: subjectColor,\n edgeHighlightStroke: subjectColor,\n edgeDisableStroke: disableColor01,\n // for combos\n comboMainStroke: disableColor03,\n comboMainFill: disableColor002,\n comboActiveStroke: subjectColor,\n comboActiveFill: subjectColor005,\n comboInactiveStroke: disableColor03,\n comboInactiveFill: disableColor002,\n comboSelectedStroke: subjectColor,\n comboSelectedFill: disableColor002,\n comboHighlightStroke: deeperSubject,\n comboHighlightFill: disableColor002,\n comboDisableStroke: disableColor02,\n comboDisableFill: disableColor005\n };\n};\n\nvar getColorsWithDarkTheme = function getColorsWithDarkTheme(subjectColor, backColor, disableColor) {\n if (backColor === void 0) {\n backColor = '#fff';\n }\n\n if (disableColor === void 0) {\n disableColor = '#777';\n }\n\n var subjectColor02 = mixColor(backColor, subjectColor, 0.2).rgb().toString();\n var subjectColor03 = mixColor(backColor, subjectColor, 0.3).rgb().toString();\n var subjectColor06 = mixColor(backColor, subjectColor, 0.6).rgb().toString();\n var subjectColor08 = mixColor(backColor, subjectColor, 0.8).rgb().toString();\n var disableColor02 = mixColor(backColor, disableColor, 0.2).rgb().toString();\n var disableColor025 = mixColor(backColor, disableColor, 0.25).rgb().toString();\n var disableColor03 = mixColor(backColor, disableColor, 0.3).rgb().toString();\n var disableColor04 = mixColor(backColor, disableColor, 0.4).rgb().toString();\n var disableColor05 = mixColor(backColor, disableColor, 0.5).rgb().toString();\n var paletteFromSubject = Object(_ant_design_colors__WEBPACK_IMPORTED_MODULE_1__[\"generate\"])(subjectColor, {\n theme: 'dark',\n backgroundColor: backColor\n });\n var subjectHex = color__WEBPACK_IMPORTED_MODULE_0___default()(subjectColor).hex().toLowerCase();\n var subjectIdx = paletteFromSubject.indexOf(subjectHex);\n var deeperSubject = subjectColor;\n\n if (subjectIdx !== -1) {\n deeperSubject = paletteFromSubject[subjectIdx + 1];\n }\n\n return {\n // for nodes\n mainStroke: subjectColor08,\n mainFill: subjectColor02,\n activeStroke: subjectColor,\n activeFill: subjectColor03,\n inactiveStroke: subjectColor08,\n inactiveFill: subjectColor02,\n selectedStroke: subjectColor,\n selectedFill: subjectColor02,\n highlightStroke: subjectColor,\n highlightFill: subjectColor06,\n disableStroke: disableColor05,\n disableFill: disableColor025,\n // for edges\n edgeMainStroke: disableColor,\n edgeActiveStroke: subjectColor,\n edgeInactiveStroke: disableColor,\n edgeSelectedStroke: subjectColor,\n edgeHighlightStroke: subjectColor,\n edgeDisableStroke: disableColor03,\n // for combos\n comboMainStroke: disableColor04,\n comboMainFill: disableColor025,\n comboActiveStroke: subjectColor,\n comboActiveFill: disableColor02,\n comboInactiveStroke: disableColor04,\n comboInactiveFill: disableColor025,\n comboSelectedStroke: subjectColor,\n comboSelectedFill: disableColor02,\n comboHighlightStroke: deeperSubject,\n comboHighlightFill: disableColor025,\n comboDisableStroke: disableColor04,\n comboDisableFill: disableColor02\n };\n};\n/**\n * get the set of colors according to the subject color and background color\n * @param subjectColor the subject color\n * @param backColor background color\n * @param disableColor the color for disable state\n */\n\n\nvar getColorsWithSubjectColor = function getColorsWithSubjectColor(subjectColor, backColor, theme, disableColor) {\n if (backColor === void 0) {\n backColor = '#fff';\n }\n\n if (theme === void 0) {\n theme = 'default';\n }\n\n if (disableColor === void 0) {\n disableColor = 'rgb(150, 150, 150)';\n }\n\n if (theme === 'default') return getColorsWithDefaultTheme(subjectColor, backColor, 'rgb(150, 150, 150)');\n return getColorsWithDarkTheme(subjectColor, backColor, '#777');\n};\nvar getColorSetsBySubjectColors = function getColorSetsBySubjectColors(subjectColors, backColor, theme, disableColor) {\n if (backColor === void 0) {\n backColor = '#fff';\n }\n\n if (theme === void 0) {\n theme = 'default';\n }\n\n if (disableColor === void 0) {\n disableColor = 'rgb(150, 150, 150)';\n }\n\n var sets = [];\n subjectColors.forEach(function (sColor) {\n sets.push(getColorsWithSubjectColor(sColor, backColor, theme, disableColor));\n });\n return sets;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/color.js?"); +eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar d3Force = __importStar(__webpack_require__(/*! d3-force */ \"./node_modules/@antv/layout/node_modules/d3-force/src/index.js\"));\nvar forceGrid_1 = __importDefault(__webpack_require__(/*! ./forceGrid */ \"./node_modules/@antv/layout/lib/layout/er/forceGrid.js\"));\nvar mysqlWorkbench_1 = __importDefault(__webpack_require__(/*! ./mysqlWorkbench */ \"./node_modules/@antv/layout/lib/layout/er/mysqlWorkbench.js\"));\nvar dagre_1 = __webpack_require__(/*! ../dagre */ \"./node_modules/@antv/layout/lib/layout/dagre.js\");\nfunction layout(data, options) {\n var nodes = data.nodes, edges = data.edges;\n var width = options.width;\n var height = options.height;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return Promise.resolve();\n // 筛选非叶子节点,做Dagre布局\n var noLeafNodes = [];\n nodes.forEach(function (node) {\n var relateEdges = edges.filter(function (edge) {\n return edge.source === node.id || edge.target === node.id;\n });\n if (relateEdges.length > 1) {\n var temp = __assign({}, node);\n delete temp.size;\n noLeafNodes.push(temp);\n }\n });\n var noLeafEdge = [];\n edges.forEach(function (edge) {\n var sourceNode = noLeafNodes.find(function (node) { return node.id === edge.source; });\n var targetNode = noLeafNodes.find(function (node) { return node.id === edge.target; });\n if (sourceNode && targetNode) {\n noLeafEdge.push(edge);\n }\n });\n var graphLayout = new dagre_1.DagreLayout({\n type: 'dagre',\n ranksep: options.nodeMinGap,\n nodesep: options.nodeMinGap,\n });\n var nodesTmp = graphLayout.layout({\n nodes: noLeafNodes,\n edges: noLeafEdge,\n }).nodes;\n // 布局后,坐标同步\n nodes.forEach(function (n) {\n var found = (nodesTmp || []).find(function (temp) { return temp.id === n.id; });\n n.x = (found === null || found === void 0 ? void 0 : found.x) || width / 2;\n n.y = (found === null || found === void 0 ? void 0 : found.y) || height / 2;\n });\n var copyNodes = JSON.parse(JSON.stringify(nodes));\n var copyEdges = JSON.parse(JSON.stringify(edges));\n var simulation = d3Force.forceSimulation().nodes(copyNodes)\n .force(\"link\", d3Force.forceLink(copyEdges).id(function (d) { return d.id; }).distance(function (d) {\n var edgeInfo = noLeafEdge.find(function (edge) { return edge.source === d.source && edge.target === d.target; });\n if (edgeInfo) {\n return 30;\n }\n return 20;\n }))\n .force(\"charge\", d3Force.forceManyBody())\n .force(\"center\", d3Force.forceCenter(width / 2, height / 2))\n .force(\"x\", d3Force.forceX(width / 2))\n .force(\"y\", d3Force.forceY(height / 2))\n .alpha(0.3)\n .alphaDecay(0.08)\n .alphaMin(0.001);\n var layoutPromise = new Promise(function (resolve) {\n simulation.on('end', function () {\n // 坐标信息同步到nodes,edges中\n nodes.forEach(function (node) {\n var nodeInfo = copyNodes.find(function (item) { return item.id === node.id; });\n if (nodeInfo) {\n node.x = nodeInfo.x;\n node.y = nodeInfo.y;\n }\n });\n var minX = Math.min.apply(Math, nodes.map(function (node) { return node.x; }));\n var maxX = Math.max.apply(Math, nodes.map(function (node) { return node.x; }));\n var minY = Math.min.apply(Math, nodes.map(function (node) { return node.y; }));\n var maxY = Math.max.apply(Math, nodes.map(function (node) { return node.y; }));\n var scalex = width / (maxX - minX);\n var scaley = height / (maxY - minY);\n nodes.forEach(function (node) {\n if (node.x !== undefined && scalex < 1) {\n node.x = (node.x - minX) * scalex;\n }\n if (node.y !== undefined && scaley < 1) {\n node.y = (node.y - minY) * scaley;\n }\n });\n // 这一步就执行缩小空间。且不考虑节点size\n nodes.forEach(function (node) {\n node.sizeTemp = node.size;\n node.size = [10, 10];\n });\n (0, mysqlWorkbench_1.default)(nodes, edges);\n nodes.forEach(function (node) {\n node.size = node.sizeTemp || [];\n delete node.sizeTemp;\n });\n // 进行网格对齐+节点大小扩增\n (0, forceGrid_1.default)({\n nodes: nodes,\n edges: edges,\n }, options);\n resolve();\n });\n });\n return layoutPromise;\n}\nexports.default = layout;\n//# sourceMappingURL=core.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/core.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/util/gpu.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/util/gpu.js ***! - \*************************************************/ -/*! exports provided: gpuDetector */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/er/forceGrid.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/er/forceGrid.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gpuDetector\", function() { return gpuDetector; });\n/**\n * 调用 gpuDetector.webgl 判断当前浏览器是否支持 webgl。(支持 gpgpu 的浏览器一定也支持 webgl)\n */\nvar gpuDetector = function gpuDetector() {\n if (typeof window === 'undefined' || typeof document === 'undefined') return {};\n return {\n canvas: !!window.CanvasRenderingContext2D,\n webgl: function () {\n try {\n var canvas = document.createElement('canvas');\n return !!(window.WebGLRenderingContext && (canvas.getContext('webgl') || canvas.getContext('experimental-webgl')));\n } catch (e) {\n return false;\n }\n }(),\n workers: !!window.Worker,\n fileapi: window.File && window.FileReader && window.FileList && window.Blob,\n getWebGLErrorMessage: function getWebGLErrorMessage() {\n var element = document.createElement('div');\n element.id = 'webgl-error-message';\n element.style.fontFamily = 'monospace';\n element.style.fontSize = '13px';\n element.style.fontWeight = 'normal';\n element.style.textAlign = 'center';\n element.style.background = '#fff';\n element.style.color = '#000';\n element.style.padding = '1.5em';\n element.style.width = '400px';\n element.style.margin = '5em auto 0';\n\n if (!this.webgl) {\n element.innerHTML = window.WebGLRenderingContext ? ['Your graphics card does not seem to support WebGL.
', 'Find out how to get it here.'].join('\\n') : ['Your browser does not seem to support WebGL.
', 'Find out how to get it here.'].join('\\n');\n }\n\n return element;\n },\n addGetWebGLMessage: function addGetWebGLMessage(parameters) {\n parameters = parameters || {};\n var parent = parameters.parent !== undefined ? parameters.parent : document.body;\n var id = parameters.id !== undefined ? parameters.id : 'oldie';\n var element = gpuDetector().getWebGLErrorMessage();\n element.id = id;\n parent.appendChild(element);\n }\n };\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/gpu.js?"); +eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar grid_1 = __importDefault(__webpack_require__(/*! ./grid */ \"./node_modules/@antv/layout/lib/layout/er/grid.js\"));\nfunction layout(data, options) {\n if (!data.nodes || data.nodes.length === 0)\n return data;\n var width = options.width;\n var height = options.height;\n var nodeMinGap = options.nodeMinGap;\n // 2. 网格布局\n var CELL_W = 10000;\n var CELL_H = 10000;\n data.nodes.forEach(function (node) {\n var nodeWidth = node.size[0] || 50;\n var nodeHeight = node.size[1] || 50;\n CELL_W = Math.min(nodeWidth, CELL_W);\n CELL_H = Math.min(nodeHeight, CELL_H);\n });\n var grid = new grid_1.default();\n grid.init(width, height, {\n CELL_H: CELL_H,\n CELL_W: CELL_W,\n });\n data.nodes.forEach(function (d) {\n var gridpoint = grid.occupyNearest(d);\n if (gridpoint) {\n gridpoint.node = {\n id: d.id,\n size: d.size,\n };\n d.x = gridpoint.x;\n d.y = gridpoint.y;\n d.dx = gridpoint.dx;\n d.dy = gridpoint.dy;\n }\n });\n // 加入节点size\n for (var i = 0; i < data.nodes.length; i++) {\n // 节点宽度大于网格宽度,则往当前网格的右边插入列\n var node = data.nodes[i];\n var result = grid.findGridByNodeId(node.id);\n if (!result)\n throw new Error(\"can not find node cell\");\n var column = result.column, row = result.row;\n if ((node.size[0] + nodeMinGap) > CELL_W) {\n var addGridSize = Math.ceil((node.size[0] + nodeMinGap) / CELL_W) - 1;\n var realAdd = addGridSize;\n // 优化,假设同一列,不同行存在两个size为2的节点,遍历到第一个节点的时候,会往右插入两列,遍历到第二个节点,又往右插入。就会导致多余的网格\n for (var j = 0; j < addGridSize; j++) {\n var hasColumn = grid.additionColumn.indexOf(column + j + 1) > -1;\n if (hasColumn && !grid.cells[column + j + 1][row].node) {\n realAdd--;\n }\n else {\n break;\n }\n }\n grid.insertColumn(column, realAdd);\n }\n // 节点高度大于网格宽度,则往当前网格的下边插入行\n if ((node.size[1] + nodeMinGap) > CELL_H) {\n var addGridSize = Math.ceil((node.size[1] + nodeMinGap) / CELL_H) - 1;\n var realAdd = addGridSize;\n for (var j = 0; j < addGridSize; j++) {\n var hasColumn = grid.additionRow.indexOf(row + j + 1) > -1;\n if (hasColumn && !grid.cells[column][row + j + 1].node) {\n realAdd--;\n }\n else {\n break;\n }\n }\n grid.insertRow(row, realAdd);\n }\n }\n // 同步节点坐标\n for (var i = 0; i < grid.columnNum; i++) {\n var _loop_1 = function (j) {\n var cell = grid.cells[i][j];\n if (cell.node) {\n var node = data.nodes.find(function (node) { var _a; return node.id === ((_a = cell === null || cell === void 0 ? void 0 : cell.node) === null || _a === void 0 ? void 0 : _a.id); });\n if (node) {\n node.x = cell.x + node.size[0] / 2;\n node.y = cell.y + node.size[1] / 2;\n }\n }\n };\n for (var j = 0; j < grid.rowNum; j++) {\n _loop_1(j);\n }\n }\n}\nexports.default = layout;\n//# sourceMappingURL=forceGrid.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/forceGrid.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/util/index.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/util/index.js ***! - \***************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/er/grid.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/er/grid.js ***! + \*********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color */ \"./node_modules/@antv/g6-pc/es/util/color.js\");\n/* harmony import */ var _layout__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/g6-pc/es/util/layout.js\");\n/* harmony import */ var _gpu__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./gpu */ \"./node_modules/@antv/g6-pc/es/util/gpu.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n\n\n\n\n\n\nvar G6Util = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _antv_g6_core__WEBPACK_IMPORTED_MODULE_4__[\"Util\"]), _color__WEBPACK_IMPORTED_MODULE_1__), _layout__WEBPACK_IMPORTED_MODULE_2__), _gpu__WEBPACK_IMPORTED_MODULE_3__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (G6Util);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/index.js?"); +eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Grid = /** @class */ (function () {\n function Grid() {\n this.cells = [];\n this.columnNum = 0;\n this.rowNum = 0;\n this.additionColumn = [];\n this.additionRow = [];\n }\n Grid.prototype.init = function (width, height, gridSize) {\n this.cells = [];\n this.CELL_W = gridSize.CELL_W || Grid.DEFAULT_CELL_W;\n this.CELL_H = gridSize.CELL_H || Grid.DEFAULT_CELL_H;\n this.columnNum = Math.ceil(width / this.CELL_W);\n this.rowNum = Math.ceil(height / this.CELL_H);\n Grid.MIN_DIST = Math.pow(width, 2) + Math.pow(height, 2);\n for (var i = 0; i < this.columnNum; i++) {\n var tmp = [];\n for (var j = 0; j < this.rowNum; j++) {\n var cell = {\n dx: i,\n dy: j,\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: false\n };\n tmp.push(cell);\n }\n this.cells.push(tmp);\n }\n };\n Grid.prototype.findGridByNodeId = function (nodeId) {\n var _a, _b;\n for (var i = 0; i < this.columnNum; i++) {\n for (var j = 0; j < this.rowNum; j++) {\n if (this.cells[i][j].node) {\n if (((_b = (_a = this.cells[i][j]) === null || _a === void 0 ? void 0 : _a.node) === null || _b === void 0 ? void 0 : _b.id) === nodeId) {\n return { column: i, row: j };\n }\n }\n }\n }\n return null;\n };\n Grid.prototype.sqdist = function (a, b) {\n return Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2);\n };\n Grid.prototype.occupyNearest = function (p) {\n var minDist = Grid.MIN_DIST;\n var d;\n var candidate = null;\n for (var i = 0; i < this.columnNum; i++) {\n for (var j = 0; j < this.rowNum; j++) {\n if (!this.cells[i][j].occupied && (d = this.sqdist(p, this.cells[i][j])) < minDist) {\n minDist = d;\n candidate = this.cells[i][j];\n }\n }\n }\n if (candidate) {\n candidate.occupied = true;\n }\n return candidate;\n };\n Grid.prototype.insertColumn = function (columnIndex, length) {\n if (length <= 0)\n return;\n // 插入空列\n for (var i = 0; i < length; i++) {\n this.cells[i + this.columnNum] = [];\n for (var j = 0; j < this.rowNum; j++) {\n this.cells[i + this.columnNum][j] = {\n dx: i,\n dy: j,\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: false,\n node: null,\n };\n }\n }\n // 交换数据\n for (var i = (this.columnNum - 1); i > columnIndex; i--) {\n for (var j = 0; j < this.rowNum; j++) {\n this.cells[i + length][j] = __assign(__assign({}, this.cells[i][j]), { x: (i + length) * this.CELL_W, y: j * this.CELL_H });\n this.cells[i][j] = {\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: true,\n node: null,\n };\n }\n }\n // 已有行列的处理\n for (var j = 0; j < this.additionColumn.length; j++) {\n if (this.additionColumn[j] >= columnIndex) {\n this.additionColumn[j] += length;\n }\n }\n // 记录新增的行列\n for (var i = 0; i < length; i++) {\n this.additionColumn.push(columnIndex + i + 1);\n }\n this.columnNum += length;\n };\n Grid.prototype.insertRow = function (rowIndex, length) {\n if (length <= 0)\n return;\n // 插入空行\n for (var j = 0; j < length; j++) {\n for (var i = 0; i < this.columnNum; i++) {\n this.cells[i][j + this.rowNum] = {\n dx: i,\n dy: j,\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: false,\n node: null,\n };\n }\n }\n // 交换数据\n for (var i = 0; i < this.columnNum; i++) {\n for (var j = (this.rowNum - 1); j > rowIndex; j--) {\n this.cells[i][j + length] = __assign(__assign({}, this.cells[i][j]), { dx: i, dy: j + length, x: i * this.CELL_W, y: (j + length) * this.CELL_H });\n this.cells[i][j] = {\n dx: i,\n dy: j,\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: false,\n node: null,\n };\n }\n }\n // 已有行列的处理\n for (var j = 0; j < this.additionRow.length; j++) {\n if (this.additionRow[j] >= rowIndex) {\n this.additionRow[j] += length;\n }\n }\n // 记录新增的行列\n for (var i = 0; i < length; i++) {\n this.additionRow.push(rowIndex + i + 1);\n }\n this.rowNum += length;\n };\n Grid.prototype.getNodes = function () {\n var nodes = [];\n for (var i = 0; i < this.columnNum; i++) {\n for (var j = 0; j < this.rowNum; j++) {\n if (this.cells[i][j].node) {\n nodes.push(this.cells[i][j]);\n }\n }\n }\n return nodes;\n };\n Grid.MIN_DIST = 50;\n Grid.DEFAULT_CELL_W = 80;\n Grid.DEFAULT_CELL_H = 80;\n return Grid;\n}());\nexports.default = Grid;\n//# sourceMappingURL=grid.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/grid.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-pc/es/util/layout.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/g6-pc/es/util/layout.js ***! - \****************************************************/ -/*! exports provided: proccessToFunc, buildTextureData, buildTextureDataWithOneEdgeAttr, buildTextureDataWithTwoEdgeAttr, attributesToTextureData, arrayToTextureData, radialLayout */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/er/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/er/index.js ***! + \**********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"proccessToFunc\", function() { return proccessToFunc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildTextureData\", function() { return buildTextureData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildTextureDataWithOneEdgeAttr\", function() { return buildTextureDataWithOneEdgeAttr; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildTextureDataWithTwoEdgeAttr\", function() { return buildTextureDataWithTwoEdgeAttr; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"attributesToTextureData\", function() { return attributesToTextureData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arrayToTextureData\", function() { return arrayToTextureData; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"radialLayout\", function() { return radialLayout; });\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\nvar traverseTree = _antv_g6_core__WEBPACK_IMPORTED_MODULE_0__[\"Util\"].traverseTree;\n/**\n * 将 number | Function 类型的参数转换为 return number 的 Function\n * @param {number | Function} value 需要被转换的值\n * @param {number} defaultV 返回函数的默认返回值\n * @return {Function} 转换后的函数\n */\n\nvar proccessToFunc = function proccessToFunc(value, defaultV) {\n var func;\n\n if (!value) {\n func = function func(d) {\n return defaultV || 1;\n };\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value)) {\n func = function func(d) {\n return value;\n };\n } else {\n func = value;\n }\n\n return func;\n};\n/**\n * 将节点和边数据转换为 GPU 可读的数组。并返回 maxEdgePerVetex,每个节点上最多的边数\n * @param {NodeConfig[]} nodes 需要被转换的值\n * @param {EdgeConfig[]} edges 返回函数的默认返回值\n * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n */\n\nvar buildTextureData = function buildTextureData(nodes, edges) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]);\n nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]);\n }\n\n var maxEdgePerVetex = 0;\n\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i];\n var len = dests.length;\n dataArray[i * 4 + 2] = offset;\n dataArray[i * 4 + 3] = dests.length;\n maxEdgePerVetex = Math.max(maxEdgePerVetex, dests.length);\n\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n }\n\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n\n return {\n array: new Float32Array(dataArray),\n maxEdgePerVetex: maxEdgePerVetex\n };\n};\n/**\n * 将节点和边数据转换为 GPU 可读的数组,每条边带有一个属性。并返回 maxEdgePerVetex,每个节点上最多的边数\n * @param {NodeConfig[]} nodes 节点数组\n * @param {EdgeConfig[]} edges 边数组\n * @param {Function} attrs 读取边属性的函数\n * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n */\n\nvar buildTextureDataWithOneEdgeAttr = function buildTextureDataWithOneEdgeAttr(nodes, edges, attrs) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]);\n nodeDict[mapIdPos[e.source]].push(attrs(e)); // 理想边长,后续可以改成每条边不同\n\n nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]);\n nodeDict[mapIdPos[e.target]].push(attrs(e)); // 理想边长,后续可以改成每条边不同\n }\n\n var maxEdgePerVetex = 0;\n\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长……\n\n var len = dests.length;\n dataArray[i * 4 + 2] = offset;\n dataArray[i * 4 + 3] = len / 2; // 第四位存储与该节点相关的所有节点个数\n\n maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 2);\n\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n } // 不是 4 的倍数,填充 0\n\n\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n\n return {\n array: new Float32Array(dataArray),\n maxEdgePerVetex: maxEdgePerVetex\n };\n};\n/**\n * 将节点和边数据转换为 GPU 可读的数组,每条边带有一个以上属性。并返回 maxEdgePerVetex,每个节点上最多的边数\n * @param {NodeConfig[]} nodes 节点数组\n * @param {EdgeConfig[]} edges 边数组\n * @param {Function} attrs 读取边属性的函数\n * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n */\n\nvar buildTextureDataWithTwoEdgeAttr = function buildTextureDataWithTwoEdgeAttr(nodes, edges, attrs1, attrs2) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]);\n nodeDict[mapIdPos[e.source]].push(attrs1(e));\n nodeDict[mapIdPos[e.source]].push(attrs2(e));\n nodeDict[mapIdPos[e.source]].push(0);\n nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]);\n nodeDict[mapIdPos[e.target]].push(attrs1(e));\n nodeDict[mapIdPos[e.target]].push(attrs2(e));\n nodeDict[mapIdPos[e.target]].push(0);\n }\n\n var maxEdgePerVetex = 0;\n\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长……\n\n var len = dests.length; // dataArray[i * 4 + 2] = offset;\n // dataArray[i * 4 + 3] = len / 4; // 第四位存储与该节点相关的所有节点个数\n // pack offset & length into float32: offset 20bit, length 12bit\n\n dataArray[i * 4 + 2] = offset + 1048576 * len / 4;\n dataArray[i * 4 + 3] = 0; // 第四位存储与上一次的距离差值\n\n maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 4);\n\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n } // 不是 4 的倍数,填充 0\n\n\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n\n return {\n array: new Float32Array(dataArray),\n maxEdgePerVetex: maxEdgePerVetex\n };\n};\n/**\n * transform the extended attributes of nodes or edges to a texture array\n * @param {string[]} attributeNames attributes' name to be read from items and put into output array\n * @param {ModelConfig[]} items the items to be read\n * @return {Float32Array} the attributes' value array to be read by GPU\n */\n\nvar attributesToTextureData = function attributesToTextureData(attributeNames, items) {\n var dataArray = [];\n var attributeNum = attributeNames.length;\n var attributteStringMap = {};\n items.forEach(function (item) {\n attributeNames.forEach(function (name, i) {\n if (attributteStringMap[item[name]] === undefined) {\n attributteStringMap[item[name]] = Object.keys(attributteStringMap).length;\n }\n\n dataArray.push(attributteStringMap[item[name]]); // insure each node's attributes take inter number of grids\n\n if (i === attributeNum - 1) {\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n }\n });\n });\n return {\n array: new Float32Array(dataArray),\n count: Object.keys(attributteStringMap).length\n };\n};\n/**\n * transform the number array format of extended attributes of nodes or edges to a texture array\n * @param {string[]} attributeNames attributes' name to be read from items and put into output array\n * @return {Float32Array} the attributes' value array to be read by GPU\n */\n\nvar arrayToTextureData = function arrayToTextureData(valueArrays) {\n var dataArray = [];\n var attributeNum = valueArrays.length;\n var itemNum = valueArrays[0].length;\n\n var _loop_1 = function _loop_1(j) {\n valueArrays.forEach(function (valueArray, i) {\n dataArray.push(valueArray[j]); // insure each node's attributes take inter number of grids\n\n if (i === attributeNum - 1) {\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n }\n });\n };\n\n for (var j = 0; j < itemNum; j++) {\n _loop_1(j);\n }\n\n return new Float32Array(dataArray);\n};\n/**\n *\n * @param data Tree graph data\n * @param layout\n */\n\nvar radialLayout = function radialLayout(data, layout) {\n // 布局方式有 H / V / LR / RL / TB / BT\n var VERTICAL_LAYOUTS = ['V', 'TB', 'BT'];\n var min = {\n x: Infinity,\n y: Infinity\n };\n var max = {\n x: -Infinity,\n y: -Infinity\n }; // 默认布局是垂直布局TB,此时x对应rad,y对应r\n\n var rScale = 'x';\n var radScale = 'y';\n\n if (layout && VERTICAL_LAYOUTS.indexOf(layout) >= 0) {\n // 若是水平布局,y对应rad,x对应r\n radScale = 'x';\n rScale = 'y';\n }\n\n var count = 0;\n traverseTree(data, function (node) {\n count++;\n\n if (node.x > max.x) {\n max.x = node.x;\n }\n\n if (node.x < min.x) {\n min.x = node.x;\n }\n\n if (node.y > max.y) {\n max.y = node.y;\n }\n\n if (node.y < min.y) {\n min.y = node.y;\n }\n\n return true;\n });\n var avgRad = Math.PI * 2 / count;\n var radDiff = max[radScale] - min[radScale];\n\n if (radDiff === 0) {\n return data;\n }\n\n traverseTree(data, function (node) {\n var radial = (node[radScale] - min[radScale]) / radDiff * (Math.PI * 2 - avgRad) + avgRad;\n var r = Math.abs(rScale === 'x' ? node.x - data.x : node.y - data.y);\n node.x = r * Math.cos(radial);\n node.y = r * Math.sin(radial);\n return true;\n });\n return data;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-pc/es/util/layout.js?"); +eval("\n/**\n * @fileOverview Force Layout Grid Align layout\n * @author wenyanqi\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERLayout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar core_1 = __importDefault(__webpack_require__(/*! ./core */ \"./node_modules/@antv/layout/lib/layout/er/core.js\"));\nvar ERLayout = /** @class */ (function (_super) {\n __extends(ERLayout, _super);\n function ERLayout(options) {\n var _this = _super.call(this) || this;\n _this.width = 300;\n _this.height = 300;\n _this.nodeMinGap = 50;\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n if (options) {\n _this.updateCfg(options);\n }\n return _this;\n }\n ERLayout.prototype.getDefaultCfg = function () {\n return {\n width: 300,\n height: 300,\n nodeMinGap: 50,\n };\n };\n /**\n * 执行布局\n */\n ERLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var edges = self.edges;\n // 节点初始化,size初始化\n nodes === null || nodes === void 0 ? void 0 : nodes.forEach(function (node) {\n if (!node.size) {\n node.size = [50, 50];\n }\n });\n return (0, core_1.default)({\n nodes: nodes,\n edges: edges,\n }, {\n width: this.width,\n height: this.height,\n nodeMinGap: this.nodeMinGap,\n }).then(function () {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n });\n };\n ERLayout.prototype.getType = function () {\n return \"er\";\n };\n return ERLayout;\n}(base_1.Base));\nexports.ERLayout = ERLayout;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/annotation/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/annotation/index.js ***! - \*************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/er/mysqlWorkbench.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/er/mysqlWorkbench.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! insert-css */ \"./node_modules/insert-css/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(insert_css__WEBPACK_IMPORTED_MODULE_3__);\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n\n\n\n\n\n\n\ntypeof document !== 'undefined' && insert_css__WEBPACK_IMPORTED_MODULE_3___default()(\"\\n .g6-annotation-container {\\n background-color: rgba(255, 255, 255, 0.3);\\n padding: 8px;\\n }\\n .g6-annotation-wrapper {\\n background-color: #fff;\\n box-shadow: 0 0 8px rgba(0, 0, 0, 0.85);\\n }\\n .g6-annotation-header-wapper {\\n height: fit-content;\\n width: 100%;\\n background-color: #5B8FF9;\\n display: inline-flex;\\n cursor: move;\\n }\\n .g6-annotation-title {\\n margin: 4px 40px 4px 8px;\\n cursor: text;\\n }\\n .g6-annotation-collapse {\\n margin: 4px;\\n cursor: pointer;\\n }\\n .g6-annotation-expand {\\n margin: 4px;\\n cursor: pointer;\\n }\\n .g6-annotation-close {\\n margin: 4px 8px 4px 0;\\n cursor: pointer;\\n }\\n .g6-annotation-content {\\n padding: 8px;\\n width: fit-content;\\n cursor: text;\\n word-break: break-all;\\n }\\n .g6-annotation-title-input-wrapper {\\n margin: 4px 40px 4px 8px;\\n }\\n .g6-annotation-content-input {\\n height: 100%;\\n word-break: break-all;\\n }\\n .g6-annotation-content-input-wrapper {\\n margin: 8px;\\n height: 100%;\\n }\\n\");\n\nvar Annotation =\n/** @class */\nfunction (_super) {\n __extends(Annotation, _super);\n\n function Annotation(config) {\n return _super.call(this, config) || this;\n }\n\n Annotation.prototype.getDefaultCfgs = function () {\n return {\n trigger: 'click',\n editable: true,\n itemHighlightState: 'highlight',\n linkHighlightStyle: {\n shadowColor: '#5B8FF9',\n shadowBlur: 10\n },\n cardCfg: {\n minHeight: 60,\n width: 'fit-content',\n height: 'fit-content',\n collapseType: 'minimize',\n closeType: 'hide',\n borderRadius: 5,\n maxTitleLength: 20\n }\n };\n }; // class-methods-use-this\n\n\n Annotation.prototype.getEvents = function () {\n var events = {\n 'viewportchange': 'updateLinks',\n 'afterlayout': 'updateLinks',\n 'aftergraphrefreshposition': 'updateLinks',\n 'afterupdateitem': 'updateLink',\n 'afterchangedata': 'onGraphDataChange',\n 'afteritemvisibilitychange': 'onGraphItemVisibilityChange'\n };\n\n switch (this.get('trigger')) {\n case 'click':\n events = __assign(__assign({}, events), {\n 'node:click': 'showAnnotation',\n 'edge:click': 'showAnnotation'\n });\n }\n\n return events;\n };\n\n Annotation.prototype.getDOMContent = function (cfg) {\n if (this.destroyed) return;\n var collapsed = cfg.collapsed,\n maxWidth = cfg.maxWidth,\n _a = cfg.title,\n title = _a === void 0 ? '' : _a,\n _b = cfg.content,\n content = _b === void 0 ? '' : _b,\n _c = cfg.borderRadius,\n r = _c === void 0 ? 5 : _c;\n var collapseExpandDOM = collapsed ? \"

+

\" : \"

-

\";\n var contentDOM = collapsed ? '' : \"

\".concat(content, \"

\");\n var closeDOM = \"

x

\";\n var borderRadius = collapsed ? \"\".concat(r, \"px\") : \"\".concat(r, \"px \").concat(r, \"px 0 0\");\n return \"
\\n \\n

\").concat(title, \"

\\n \").concat(collapseExpandDOM, \"\\n \").concat(closeDOM, \"\\n
\\n \").concat(contentDOM, \"\\n
\");\n };\n\n Annotation.prototype.init = function () {\n var self = this;\n if (self.destroyed) return;\n var graph = self.get('graph');\n var graphCantainer = graph.getContainer();\n var container = self.get('container');\n var containerCfg = this.get('containerCfg');\n\n if (containerCfg) {\n container = this.createContainer();\n graphCantainer.appendChild(container);\n } else {\n container = graphCantainer;\n }\n\n this.set('container', container); // 绘制连接 annotation 和元素的连线的画布\n\n var graphContainerBBox = graphCantainer.getBoundingClientRect();\n var linkCanvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_4__[\"Canvas\"]({\n container: graphCantainer,\n width: graphContainerBBox.right - graphContainerBBox.left,\n height: graphContainerBBox.bottom - graphContainerBBox.top\n });\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(linkCanvas.get('el'), {\n position: 'absolute',\n top: 0,\n left: 0,\n pointerEvents: 'none'\n }); // 需要传入 self,无法 removeEventListener,只能在内部判断 self 被销毁则不继续\n\n window.addEventListener('resize', Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"debounce\"])(function () {\n return self.resizeCanvas(self);\n }, 100));\n var linkGroup = linkCanvas.addGroup({\n id: 'annotation-link-group'\n });\n self.set('linkGroup', linkGroup);\n self.set('canvas', linkCanvas);\n\n if (!self.get('getTitle')) {\n self.set('getTitle', function (item) {\n var _a;\n\n var _b = ((_a = item === null || item === void 0 ? void 0 : item.getModel) === null || _a === void 0 ? void 0 : _a.call(item)) || {},\n label = _b.label,\n id = _b.id;\n\n return label || id || '-';\n });\n }\n\n if (!self.get('getContent')) {\n self.set('getContent', function (item) {\n var _a, _b;\n\n if (!item) return '-';\n\n var _c = ((_a = item.getModel) === null || _a === void 0 ? void 0 : _a.call(item)) || {},\n label = _c.label,\n id = _c.id;\n\n var type = (_b = item.getType) === null || _b === void 0 ? void 0 : _b.call(item);\n var suffix = type ? \"\".concat(type, \": \") : '';\n return \"\".concat(suffix).concat(label || id || '');\n });\n } // init with defaultData\n\n\n var defaultData = self.get('defaultData');\n if (defaultData) this.readData(defaultData);\n };\n\n Annotation.prototype.createContainer = function () {\n var _this = this;\n\n if (this.destroyed) return;\n var containerCfg = this.get('containerCfg');\n var graph = this.get('graph');\n var graphContainer = graph.getContainer();\n\n var _a = graphContainer.getBoundingClientRect(),\n gLeft = _a.left,\n gRight = _a.right,\n gTop = _a.top,\n gBottom = _a.bottom;\n\n var graphContainerHeight = gBottom - gTop;\n var graphContainerWidth = gRight - gLeft;\n\n var _b = containerCfg.position,\n position = _b === void 0 ? 'top' : _b,\n _c = containerCfg.offsetX,\n offsetX = _c === void 0 ? 0 : _c,\n _d = containerCfg.offsetY,\n offsetY = _d === void 0 ? 0 : _d,\n otherStyle = __rest(containerCfg, [\"position\", \"offsetX\", \"offsetY\"]);\n\n var _e = containerCfg.height,\n height = _e === void 0 ? 'fit-content' : _e,\n _f = containerCfg.width,\n width = _f === void 0 ? graph.getWidth() : _f;\n if (height === '100%') height = graphContainerHeight;\n if (width === '100%') width = graphContainerWidth;\n var maxHeight = 'unset',\n maxWidth = 'unset';\n var containerPosition = {};\n\n switch (position) {\n case 'right':\n maxHeight = \"\".concat(graphContainerHeight, \"px\");\n containerPosition = {\n top: 0,\n right: 0\n };\n containerPosition.right += gLeft + offsetX;\n containerPosition.top += gTop + offsetY;\n break;\n\n case 'bottom':\n maxWidth = \"\".concat(graphContainerWidth, \"px\");\n containerPosition = {\n bottom: 0,\n left: 0\n };\n containerPosition.left += gLeft + offsetX;\n containerPosition.bottom += gTop + offsetY;\n break;\n\n case 'top':\n maxWidth = \"\".concat(graphContainerWidth, \"px\");\n\n case 'left':\n maxHeight = \"\".concat(graphContainerHeight, \"px\");\n\n default:\n containerPosition = {\n top: 0,\n left: 0\n };\n containerPosition.left += gLeft + offsetX;\n containerPosition.top += gTop + offsetY;\n break;\n }\n\n Object.keys(containerPosition).forEach(function (key) {\n containerPosition[key] = \"\".concat(containerPosition[key], \"px\");\n });\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\"));\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(container, __assign(__assign({\n position: 'absolute',\n display: position === 'top' || position === 'bottom' ? 'inline-flex' : 'unset',\n width: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(width) ? \"\".concat(width, \"px\") : width,\n height: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(height) ? \"\".concat(height, \"px\") : height,\n maxHeight: maxHeight,\n maxWidth: maxWidth,\n overflow: 'scroll'\n }, containerPosition), otherStyle));\n graphContainer.appendChild(container);\n container.addEventListener('scroll', function (e) {\n _this.updateLinks();\n });\n return container;\n };\n\n Annotation.prototype.resizeCanvas = function (self) {\n // 仅在 resize 完成后进行调整\n clearTimeout(self.resizeTimer);\n self.resizeTimer = setTimeout(function () {\n if (!self || self.destroyed) return;\n var cBBox = self.get('container').getBoundingClientRect();\n var newWidth = cBBox.right - cBBox.left;\n var newHeight = cBBox.bottom - cBBox.top;\n self.get('canvas').changeSize(newWidth, newHeight);\n self.updateOutsideCards(self);\n }, 250);\n };\n\n Annotation.prototype.updateOutsideCards = function (self) {\n var cardInfoMap = self.get('cardInfoMap') || {};\n var graph = self.get('graph');\n var graphLeftTopCanvas = graph.getPointByCanvas(0, 0);\n var graphRightBottomCanvas = graph.getPointByCanvas(graph.getWidth(), graph.getHeight());\n\n var _a = graph.getClientByPoint(graphLeftTopCanvas.x, graphLeftTopCanvas.y),\n graphLeft = _a.x,\n graphTop = _a.y;\n\n var _b = graph.getClientByPoint(graphRightBottomCanvas.x, graphRightBottomCanvas.y),\n graphRight = _b.x,\n graphBottom = _b.y;\n\n Object.values(cardInfoMap).forEach(function (cardInfo) {\n var card = cardInfo.card;\n if (!card) return;\n var style = card.style;\n var left = px2Num(style.left);\n var top = px2Num(style.top);\n\n var _a = card.getBoundingClientRect(),\n width = _a.width,\n height = _a.height;\n\n var newLeft = left;\n var newTop = top;\n\n if (left + width > graphRight - graphLeft) {\n newLeft = graphRight - graphLeft - width;\n }\n\n if (left < 0) {\n newLeft = 0;\n }\n\n if (top + height > graphBottom - graphTop) {\n newTop = graphBottom - graphTop - height;\n }\n\n if (top < 0) {\n newTop = 0;\n }\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(card, {\n left: \"\".concat(newLeft, \"px\"),\n top: \"\".concat(newTop, \"px\")\n });\n });\n self.updateLinks();\n };\n\n Annotation.prototype.showAnnotation = function (evt) {\n if (this.destroyed) return;\n var item = evt.item;\n this.toggleAnnotation(item);\n };\n\n Annotation.prototype.hideCards = function () {\n var self = this;\n if (self.destroyed) return;\n var cardInfoMap = self.get('cardInfoMap') || {};\n Object.keys(cardInfoMap).forEach(function (itemId) {\n self.hideCard(itemId);\n });\n };\n\n Annotation.prototype.toggleAnnotation = function (item, cfg) {\n var _a;\n\n if (cfg === void 0) {\n cfg = {};\n }\n\n var self = this;\n if (self.destroyed) return;\n var cardInfoMap = self.get('cardInfoMap') || {};\n var graph = self.get('graph');\n var container = self.get('container');\n var containerCfg = self.get('containerCfg');\n\n var _b = Object.assign({}, self.get('cardCfg') || {}, cfg),\n minHeight = _b.minHeight,\n minWidth = _b.minWidth,\n width = _b.width,\n height = _b.height,\n _c = _b.collapsed,\n collapsed = _c === void 0 ? false : _c,\n propsX = _b.x,\n propsY = _b.y,\n propsTitle = _b.title,\n propsContent = _b.content,\n maxTitleLength = _b.maxTitleLength,\n defaultBegin = _b.defaultBegin,\n otherCardCfg = __rest(_b, [\"minHeight\", \"minWidth\", \"width\", \"height\", \"collapsed\", \"x\", \"y\", \"title\", \"content\", \"maxTitleLength\", \"defaultBegin\"]);\n\n var linkGroup = self.get('linkGroup');\n var rows = this.get('rows') || [[]];\n var isCanvas = (_a = item.isCanvas) === null || _a === void 0 ? void 0 : _a.call(item);\n var itemId = isCanvas ? 'canvas-annotation' : item.getID();\n\n var _d = cardInfoMap[itemId] || {},\n card = _d.card,\n link = _d.link,\n x = _d.x,\n y = _d.y,\n title = _d.title,\n content = _d.content;\n\n var getTitle = this.get('getTitle');\n var getContent = this.get('getContent');\n var newCard = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(this.getDOMContent(__assign({\n itemId: itemId,\n collapsed: collapsed,\n title: (title || propsTitle || (getTitle === null || getTitle === void 0 ? void 0 : getTitle(item))).substr(0, maxTitleLength),\n content: content || propsContent || (getContent === null || getContent === void 0 ? void 0 : getContent(item))\n }, otherCardCfg)));\n var minHeightPx = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(minHeight) ? \"\".concat(minHeight, \"px\") : minHeight;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(newCard, {\n minHeight: collapsed ? 'unset' : minHeightPx,\n minWidth: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(minWidth) ? \"\".concat(minWidth, \"px\") : minWidth,\n height: height,\n width: width\n });\n var exist = !!card;\n\n if (exist) {\n // 移除相应连线\n link === null || link === void 0 ? void 0 : link.remove(true); // 替换原来的卡片\n\n container.replaceChild(newCard, card);\n } else {\n container.appendChild(newCard);\n }\n\n var containerBBox;\n\n if (!containerCfg) {\n containerBBox = container.getBoundingClientRect() || {};\n\n if (propsX !== undefined && propsY !== undefined) {\n // 使用配置的位置\n x = propsX;\n y = propsY;\n } else if (!exist && !isCanvas) {\n // 第一次创建,且无 conatiner,初始化位置\n var containerTop = containerBBox.top;\n\n var _e = defaultBegin || {},\n beginLeft = _e.left,\n _f = _e.right,\n propsBeginRight = _f === void 0 ? 16 : _f,\n _g = _e.top,\n propsBeginTop = _g === void 0 ? 8 : _g,\n beginBottom = _e.bottom;\n\n var beginRight = propsBeginRight;\n var beginTop = propsBeginTop;\n\n if (!isNaN(beginLeft)) {\n beginRight = container.scrollWidth - beginLeft;\n }\n\n if (!isNaN(beginBottom)) {\n beginTop = container.scrollHeight - beginBottom;\n }\n\n var cardWidth = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(minWidth) ? minWidth : 100;\n x = container.scrollWidth - newCard.scrollWidth - (rows.length - 1) * cardWidth - beginRight;\n var currentRow = rows[rows.length - 1];\n var lastCardBBox = (currentRow[currentRow.length - 1] || {}).bbox;\n y = (lastCardBBox === null || lastCardBBox === void 0 ? void 0 : lastCardBBox.bottom) - containerTop || beginTop;\n }\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(newCard, {\n position: 'absolute',\n left: \"\".concat(x, \"px\"),\n top: \"\".concat(y, \"px\"),\n cusor: containerCfg ? 'unset' : 'move'\n });\n }\n\n this.bindListener(newCard, itemId);\n var cardBBox = newCard.getBoundingClientRect();\n\n if (!isCanvas) {\n // 创建相关连线\n var path = getPathItem2Card(item, cardBBox, graph, this.get('canvas'));\n var linkStyle = this.get('linkStyle');\n link = linkGroup.addShape('path', {\n attrs: __assign({\n lineWidth: 1,\n lineDash: [5, 5],\n stroke: '#ccc',\n path: path\n }, linkStyle)\n });\n }\n\n cardInfoMap[itemId] = __assign(__assign({}, cardInfoMap[itemId] || {}), {\n id: itemId,\n collapsed: collapsed,\n card: newCard,\n link: link,\n x: x,\n y: y,\n cardBBox: cardBBox,\n content: content || propsContent,\n title: title || propsTitle,\n isCanvas: isCanvas\n });\n self.set('cardInfoMap', cardInfoMap);\n\n if (containerCfg) {\n this.updateCardPositionsInConatainer();\n this.updateLinks();\n } else {\n var hasPropsPosition = !isNaN(propsX) && !isNaN(propsY);\n\n if (!exist && !isCanvas && !hasPropsPosition) {\n // 没有 container、新增 card 时,记录当前列中最下方位置,方便换行\n var _h = containerBBox.bottom,\n containerBottom = _h === void 0 ? 0 : _h,\n containerTop = containerBBox.top;\n rows[rows.length - 1].push({\n id: itemId,\n bbox: cardBBox\n });\n if (cardBBox.top > containerBottom - containerTop - cardBBox.height - 16) rows.push([]);\n this.set('rows', rows);\n }\n }\n\n this.updateCardSize(itemId);\n var onAnnotationChange = this.get('onAnnotationChange');\n onAnnotationChange === null || onAnnotationChange === void 0 ? void 0 : onAnnotationChange(cardInfoMap[itemId], exist ? 'update' : 'create');\n };\n\n Annotation.prototype.updateCardPositionsInConatainer = function () {\n if (this.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var container = this.get('container');\n var position = this.get('containerCfg').position;\n var containerWidth = container.getBoundingClientRect().width;\n var computeStyle = getComputedStyle(container);\n var sidePadding = px2Num(computeStyle['paddingLeft']) + px2Num(computeStyle['paddingRight']);\n containerWidth -= sidePadding;\n Object.values(cardInfoMap).forEach(function (_a) {\n var card = _a.card;\n var cardWidth = card.getBoundingClientRect().width;\n\n switch (position) {\n case 'right':\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(card, {\n marginLeft: containerWidth ? \"\".concat(containerWidth - cardWidth, \"px\") : '0px'\n });\n break;\n\n case 'top':\n case 'bottom':\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(card, {\n marginLeft: '8px'\n });\n\n default:\n break;\n }\n });\n };\n\n Annotation.prototype.handleExpandCollapseCard = function (id) {\n if (this.destroyed) return;\n var graph = this.get('graph');\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var collapsed = cardInfoMap[id].collapsed;\n var item = graph.findById(id);\n if (!item) return;\n var collapseType = this.get('cardCfg').collapseType;\n\n if (collapseType === 'hide' && !collapsed) {\n // collapse 行为被配置为隐藏\n this.hideCard(id);\n } else {\n this.toggleAnnotation(item, {\n collapsed: !collapsed\n });\n }\n\n cardInfoMap[id] = __assign(__assign({}, cardInfoMap[id]), {\n collapsed: !collapsed\n });\n };\n /**\n * 隐藏标注卡片,下次打开还保留隐藏前的配置,包括文本内容、位置等\n * @param id 卡片 id,即元素(节点/边)的 id\n * @returns\n */\n\n\n Annotation.prototype.hideCard = function (id) {\n if (this.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var _a = cardInfoMap[id],\n card = _a.card,\n link = _a.link;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(card, {\n display: 'none'\n });\n link === null || link === void 0 ? void 0 : link.hide();\n var onAnnotationChange = this.get('onAnnotationChange');\n onAnnotationChange(cardInfoMap[id], 'hide');\n };\n /**\n * 移除标注卡片,下一次生成时将被初始化\n * @param id 卡片 id,即元素(节点/边)的 id\n * @returns\n */\n\n\n Annotation.prototype.removeCard = function (id) {\n if (this.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var cardInfo = cardInfoMap[id];\n var card = cardInfo.card,\n link = cardInfo.link;\n var container = this.get('container');\n container.removeChild(card);\n link === null || link === void 0 ? void 0 : link.remove(true);\n delete cardInfoMap[id];\n var onAnnotationChange = this.get('onAnnotationChange');\n onAnnotationChange(cardInfo, 'remove');\n };\n\n Annotation.prototype.bindListener = function (card, itemId) {\n var _this = this;\n\n if (this.destroyed) return;\n card.addEventListener('mousemove', function (e) {\n // icon 的鼠标进入监听,方便外部加 tooltip\n var iconType;\n\n if (e.target.className === 'g6-annotation-collapse') {\n iconType = 'collapse';\n } else if (e.target.className === 'g6-annotation-expand') {\n iconType = 'expand';\n } else if (e.target.className === 'g6-annotation-close') {\n iconType = 'close';\n }\n\n if (iconType) {\n var _a = _this.get('cardCfg').onMouseEnterIcon,\n onMouseEnterIcon = _a === void 0 ? function () {} : _a;\n\n onMouseEnterIcon(e, itemId, iconType);\n }\n });\n card.addEventListener('mouseout', function (e) {\n // icon 的鼠标移出监听,方便外部加 tooltip\n var iconType;\n\n if (e.target.className === 'g6-annotation-collapse') {\n iconType = 'collapse';\n } else if (e.target.className === 'g6-annotation-expand') {\n iconType = 'expand';\n } else if (e.target.className === 'g6-annotation-close') {\n iconType = 'close';\n }\n\n if (iconType) {\n var _a = _this.get('cardCfg').onMouseLeaveIcon,\n onMouseLeaveIcon = _a === void 0 ? function () {} : _a;\n\n onMouseLeaveIcon(e, itemId, iconType);\n }\n }); // mouseenter and mouseleave to highlight the corresponding items\n\n card.addEventListener('mouseenter', function (e) {\n var cardInfoMap = _this.get('cardInfoMap');\n\n if (!cardInfoMap) return;\n\n var graph = _this.get('graph');\n\n var item = graph.findById(itemId);\n\n if (item) {\n var itemHighlightState = _this.get('itemHighlightState');\n\n graph.setItemState(item, itemHighlightState, true);\n }\n\n var link = cardInfoMap[itemId].link;\n\n if (link) {\n var linkHighlightStyle = _this.get('linkHighlightStyle') || {};\n link.attr(linkHighlightStyle);\n }\n });\n card.addEventListener('mouseleave', function (e) {\n var cardInfoMap = _this.get('cardInfoMap');\n\n if (!cardInfoMap) return;\n\n var graph = _this.get('graph');\n\n var item = graph.findById(itemId);\n\n if (item) {\n var itemHighlightState = _this.get('itemHighlightState');\n\n graph.setItemState(item, itemHighlightState, false);\n }\n\n var link = cardInfoMap[itemId].link;\n\n if (link) {\n var linkHighlightStyle = _this.get('linkHighlightStyle') || {};\n Object.keys(linkHighlightStyle).forEach(function (key) {\n link.attr(key, undefined);\n link.attr(key, undefined);\n });\n\n var linkStyle = _this.get('linkStyle');\n\n link.attr(linkStyle);\n }\n });\n card.addEventListener('click', function (e) {\n var onClickIcon = (_this.get('cardCfg') || {}).onClickIcon;\n\n if (e.target.className === 'g6-annotation-collapse' || e.target.className === 'g6-annotation-expand') {\n // collapse & expand\n var collapseType = _this.get('cardCfg').collapseType;\n\n if (collapseType === 'hide') {\n _this.hideCard(itemId);\n } else {\n _this.handleExpandCollapseCard(itemId);\n }\n\n onClickIcon === null || onClickIcon === void 0 ? void 0 : onClickIcon(e, itemId, e.target.className === 'g6-annotation-collapse' ? 'collapse' : 'expand');\n } else if (e.target.className === 'g6-annotation-close') {\n // close\n var closeType = _this.get('cardCfg').closeType;\n\n if (closeType === 'remove') {\n _this.removeCard(itemId);\n } else {\n _this.hideCard(itemId);\n }\n\n onClickIcon === null || onClickIcon === void 0 ? void 0 : onClickIcon(e, itemId, 'close');\n }\n }); // dblclick to edit the title and content text\n\n var editable = this.get('editable');\n\n if (editable) {\n card.addEventListener('dblclick', function (e) {\n var cardInfoMap = _this.get('cardInfoMap');\n\n var _a = (_this.get('cardCfg') || {}).maxTitleLength,\n maxTitleLength = _a === void 0 ? 20 : _a;\n if (!cardInfoMap) return;\n var target = e.target;\n var targetClass = target.className;\n if (targetClass !== 'g6-annotation-title' && targetClass !== 'g6-annotation-content') return;\n\n var _b = target.getBoundingClientRect(),\n width = _b.width,\n height = _b.height;\n\n var computeStyle = getComputedStyle(target);\n var inputTag = targetClass === 'g6-annotation-title' ? 'input' : 'textarea';\n var input = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"<\".concat(inputTag, \" class=\\\"\").concat(targetClass, \"-input\\\" type=\\\"textarea\\\" style=\\\"width:\").concat(width, \"px; height: \").concat(height, \"px\\\"/>\"));\n var inputWrapper = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\"));\n inputWrapper.appendChild(input);\n target.parentNode.replaceChild(inputWrapper, target);\n\n if (targetClass === 'g6-annotation-title') {\n input.name = 'title';\n input.maxLength = maxTitleLength;\n } else {\n input.name = 'content';\n }\n\n input.innerHTML = target.innerHTML;\n input.value = target.innerHTML;\n input.focus();\n var cardInfo = cardInfoMap[itemId];\n input.addEventListener('blur', function (blurEvt) {\n if (input.value) {\n target.innerHTML = input.value;\n cardInfo[input.name || 'title'] = input.value;\n }\n\n inputWrapper.parentNode.replaceChild(target, inputWrapper);\n\n _this.updateCardSize(itemId);\n\n var onAnnotationChange = _this.get('onAnnotationChange');\n\n onAnnotationChange === null || onAnnotationChange === void 0 ? void 0 : onAnnotationChange(cardInfo, 'update');\n });\n });\n }\n\n var unmovableClasses = ['g6-annotation-title', 'g6-annotation-content', 'g6-annotation-title-input', 'g6-annotation-content-input'];\n card.draggable = true;\n card.addEventListener('dragstart', function (e) {\n var targetClass = e.target.className;\n if (unmovableClasses.includes(targetClass)) return;\n var style = card.style;\n\n _this.set('dragging', {\n card: card,\n x: e.clientX,\n y: e.clientY,\n left: px2Num(style.left),\n top: px2Num(style.top)\n });\n });\n card.addEventListener('drag', function (e) {\n e.preventDefault();\n\n var cardInfoMap = _this.get('cardInfoMap');\n\n if (!cardInfoMap) return;\n var clientX = e.clientX,\n clientY = e.clientY;\n\n var dragging = _this.get('dragging');\n\n if (isNaN(clientX) || isNaN(clientY) || !dragging) return;\n var x = dragging.x,\n y = dragging.y,\n left = dragging.left,\n top = dragging.top,\n draggingCard = dragging.card;\n var dx = clientX - x;\n var dy = clientY - y;\n left += dx;\n top += dy;\n\n var graph = _this.get('graph');\n\n var graphLeftTopCanvas = graph.getPointByCanvas(0, 0);\n var graphRightBottomCanvas = graph.getPointByCanvas(graph.getWidth(), graph.getHeight());\n\n var _a = graph.getClientByPoint(graphLeftTopCanvas.x, graphLeftTopCanvas.y),\n graphLeft = _a.x,\n graphTop = _a.y;\n\n var _b = graph.getClientByPoint(graphRightBottomCanvas.x, graphRightBottomCanvas.y),\n graphRight = _b.x,\n graphBottom = _b.y;\n\n var cardBBox = draggingCard.getBoundingClientRect();\n var cardWidth = cardBBox.right - cardBBox.left;\n var cardHeight = cardBBox.bottom - cardBBox.top;\n if (left > graphRight - graphLeft - cardWidth && dx > 0 || left < 0 && dx < 0) left -= dx;\n if (top > graphBottom - graphTop - cardHeight && dy > 0 || top < 0 && dy < 0) top -= dy; // 更新卡片位置\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(draggingCard, {\n left: \"\".concat(left, \"px\"),\n top: \"\".concat(top, \"px\"),\n visibility: 'hidden'\n });\n x = clientX;\n y = clientY; // 更新连线位置\n\n var link = (cardInfoMap[itemId] || {}).link;\n\n if (link) {\n var item = graph.findById(itemId);\n link.attr('path', getPathItem2Card(item, cardBBox, graph, _this.get('canvas')));\n }\n\n _this.set('dragging', {\n x: x,\n y: y,\n left: left,\n top: top,\n card: draggingCard\n });\n });\n\n var dragendListener = function dragendListener(e) {\n var cardInfoMap = _this.get('cardInfoMap');\n\n if (!cardInfoMap) return;\n\n var dragging = _this.get('dragging');\n\n if (dragging) {\n // = dragend\n var left = dragging.left,\n top_1 = dragging.top,\n draggingCard = dragging.card;\n cardInfoMap[itemId].x = left;\n cardInfoMap[itemId].y = top_1;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(draggingCard, {\n visibility: 'visible'\n });\n\n _this.set('dragging', false); // 移动过的卡片从 rows 中移除,避免影响后续卡片出生位置\n\n\n var rows = _this.get(\"rows\");\n\n rows === null || rows === void 0 ? void 0 : rows.forEach(function (rowItems) {\n for (var i = rowItems.length - 1; i >= 0; i--) {\n if (rowItems[i].id === itemId) rowItems.splice(i, 1);\n }\n });\n\n var onAnnotationChange = _this.get('onAnnotationChange');\n\n onAnnotationChange === null || onAnnotationChange === void 0 ? void 0 : onAnnotationChange(cardInfoMap[itemId], 'update');\n }\n };\n\n card.addEventListener('dragend', dragendListener);\n };\n\n Annotation.prototype.updateCardSize = function (id) {\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var card = cardInfoMap[id].card;\n var width = card.getBoundingClientRect().width;\n var title = card.getElementsByClassName('g6-annotation-title')[0];\n\n if (title) {\n var computeStyle = getComputedStyle(title);\n var sideMargin = px2Num(computeStyle['marginLeft']);\n var titleWidth = title.getBoundingClientRect().width;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(title, {\n marginRight: \"\".concat(width - sideMargin - 24 - 16 - titleWidth, \"px\")\n });\n }\n };\n\n Annotation.prototype.updateLink = function (_a) {\n var item = _a.item;\n if (!item) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var canvas = this.get('canvas');\n var graph = this.get('graph');\n var id = item.getID();\n\n var _b = cardInfoMap[id] || {},\n link = _b.link,\n card = _b.card;\n\n if (link) {\n var path = getPathItem2Card(item, card.getBoundingClientRect(), graph, canvas);\n link.attr('path', path);\n }\n };\n\n Annotation.prototype.updateLinks = function () {\n var _this = this;\n\n if (this.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var graph = this.get('graph');\n Object.values(cardInfoMap).forEach(function (cardInfo) {\n var id = cardInfo.id;\n var item = graph.findById(id);\n\n _this.updateLink({\n item: item\n });\n });\n };\n\n Annotation.prototype.onGraphDataChange = function () {\n var _this = this;\n\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var graph = this.get('graph');\n Object.values(cardInfoMap).forEach(function (info) {\n var id = info.id,\n card = info.card,\n isCanvas = info.isCanvas;\n if (isCanvas || card.style.display === 'none') return;\n var item = graph.findById(id);\n\n if (item && item.isVisible()) {\n _this.toggleAnnotation(item);\n } else {\n _this.hideCard(id);\n }\n });\n };\n\n Annotation.prototype.onGraphItemVisibilityChange = function (_a) {\n var item = _a.item,\n visible = _a.visible;\n if (!item || item.destroyed) return;\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var id = item.getID();\n if (!cardInfoMap[id]) return;\n if (!visible) this.hideCard(id);\n };\n\n Annotation.prototype.saveData = function (saveClosed) {\n if (saveClosed === void 0) {\n saveClosed = false;\n }\n\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var graph = this.get('graph');\n var getTitle = this.get('getTitle');\n var getContent = this.get('getContent');\n var data = [];\n Object.values(cardInfoMap).forEach(function (info) {\n var title = info.title,\n content = info.content,\n x = info.x,\n y = info.y,\n id = info.id,\n collapsed = info.collapsed,\n card = info.card;\n if (card.style.display === 'none' && !saveClosed) return;\n var item = graph.findById(id) || graph.get('canvas');\n data.push({\n id: id,\n x: x,\n y: y,\n collapsed: collapsed,\n title: title || (getTitle === null || getTitle === void 0 ? void 0 : getTitle(item)),\n content: content || (getContent === null || getContent === void 0 ? void 0 : getContent(item)),\n visible: card.style.display !== 'none'\n });\n });\n return data;\n };\n\n Annotation.prototype.readData = function (data) {\n var _this = this;\n\n var graph = this.get('graph');\n data.forEach(function (info) {\n var id = info.id,\n x = info.x,\n y = info.y,\n title = info.title,\n content = info.content,\n collapsed = info.collapsed,\n visible = info.visible;\n var item = graph.findById(id) || graph.get('canvas');\n\n _this.toggleAnnotation(item, {\n x: x,\n y: y,\n title: title,\n content: content,\n collapsed: collapsed\n });\n\n if (!visible) _this.hideCard(id);\n });\n };\n /**\n * Clear the cards and links\n */\n\n\n Annotation.prototype.clear = function () {\n var cardInfoMap = this.get('cardInfoMap');\n if (!cardInfoMap) return;\n var container = this.get('container');\n Object.values(cardInfoMap).forEach(function (cardInfo) {\n var card = cardInfo.card,\n link = cardInfo.link;\n container.removeChild(card);\n link === null || link === void 0 ? void 0 : link.remove(true);\n });\n this.set('cardInfoMap', {});\n };\n /**\n * Destroy the component\n */\n\n\n Annotation.prototype.destroy = function () {\n var _a;\n\n this.clear();\n (_a = this.get('canvas')) === null || _a === void 0 ? void 0 : _a.destroy();\n var graph = this.get('graph');\n if (!graph || graph.destroyed) return;\n\n if (this.get('containerCfg')) {\n graph.getContainer().removeChild(this.get('container'));\n }\n\n this.destroyed = true;\n };\n\n return Annotation;\n}(_base__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Annotation);\n\nvar getPath = function getPath(startPoints, endPoints) {\n var startPoint,\n endPoint,\n posKeys,\n distance = Infinity;\n Object.keys(startPoints).forEach(function (skey) {\n var spos = startPoints[skey];\n Object.keys(endPoints).forEach(function (ekey) {\n var epos = endPoints[ekey];\n var xdist = spos.x - epos.x;\n var ydist = spos.y - epos.y;\n var dist = xdist * xdist + ydist * ydist;\n\n if (distance > dist) {\n distance = dist;\n startPoint = spos;\n endPoint = epos;\n posKeys = [skey, ekey];\n }\n });\n });\n var curveOffset = 20;\n var controlPoint = _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].getControlPoint(startPoint, endPoint, 0.5, curveOffset);\n return [['M', startPoint.x, startPoint.y], ['Q', controlPoint.x, controlPoint.y, endPoint.x, endPoint.y]];\n};\n\nvar getPathItem2Card = function getPathItem2Card(item, cardBBox, graph, annotationCanvas) {\n var _a;\n\n var itemLinkPoints;\n var itemType = item.getType();\n\n if (itemType === 'edge') {\n itemLinkPoints = [item.getKeyShape().getPoint(0.5)];\n } else {\n var _b = (_a = item.getKeyShape) === null || _a === void 0 ? void 0 : _a.call(item).getBBox(),\n minX = _b.minX,\n minY = _b.minY,\n maxX = _b.maxX,\n maxY = _b.maxY;\n\n var _c = item.getModel(),\n x = _c.x,\n y = _c.y;\n\n minX += x;\n minY += y;\n maxX += x;\n maxY += y;\n itemLinkPoints = {\n left: {\n x: minX,\n y: (minY + maxY) / 2\n },\n right: {\n x: maxX,\n y: (minY + maxY) / 2\n },\n top: {\n x: (minX + maxX) / 2,\n y: minY\n },\n bottom: {\n x: (minX + maxX) / 2,\n y: maxY\n }\n };\n } // 由 graph 所在 canvas 转换为 Client 坐标系,然后再由 annotation 所在 canvas 转换为绘制坐标系\n\n\n Object.keys(itemLinkPoints).forEach(function (key) {\n var _a = itemLinkPoints[key],\n x = _a.x,\n y = _a.y;\n var clientPos = graph.getClientByPoint(x, y);\n itemLinkPoints[key] = annotationCanvas.getPointByClient(clientPos.x, clientPos.y);\n });\n var _d = cardBBox.top,\n cardTop = _d === void 0 ? 0 : _d,\n _e = cardBBox.left,\n cardLeft = _e === void 0 ? 0 : _e,\n _f = cardBBox.right,\n cardRight = _f === void 0 ? 0 : _f,\n _g = cardBBox.bottom,\n cardBottom = _g === void 0 ? 0 : _g;\n var cardLinkPoints = {\n left: annotationCanvas.getPointByClient(cardLeft, (cardTop + cardBottom) / 2),\n right: annotationCanvas.getPointByClient(cardRight, (cardTop + cardBottom) / 2),\n top: annotationCanvas.getPointByClient((cardLeft + cardRight) / 2, cardTop),\n bottom: annotationCanvas.getPointByClient((cardLeft + cardRight) / 2, cardBottom)\n };\n return getPath(itemLinkPoints, cardLinkPoints);\n};\n\nvar px2Num = function px2Num(px) {\n return Number(px.replace(/\\s+|px/gi, \"\")) || 0;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/annotation/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar graphWidth = 1200;\nvar graphHeight = 800;\nvar OVERLAP_QUOT = 10000000;\nvar MIN_DIST = 10;\nvar M_PI = 3.14159265358979323846;\nvar M_PI_2 = 1.57079632679489661923;\nvar PI_38 = M_PI * 0.375;\nvar PI_58 = M_PI * 0.625;\nvar nodeEdgeMap = new Map();\nvar CELL_W = 10;\nvar CELL_H = 10;\nvar T = 0.8;\nvar T_MIN = 0.1;\nvar R = 0.5;\nfunction distanceToNode(node1, node2, isHoriz) {\n var x11 = node1.x - node1.size[0] / 2;\n var y11 = node1.y - node1.size[1] / 2;\n var x12 = node1.x + node1.size[0] / 2;\n var y12 = node1.y + node1.size[1] / 2;\n var x21 = node2.x - node2.size[0] / 2;\n var y21 = node2.y - node2.size[1] / 2;\n var x22 = node2.x + node2.size[0] / 2;\n var y22 = node2.y + node2.size[1] / 2;\n var cx1 = node1.x;\n var cy1 = node1.y;\n var cx2 = node2.x;\n var cy2 = node2.y;\n var dcx = cx2 - cx1;\n // 两个节点间的方位角 \n var qr = Math.atan2(dcx, (cy2 - cy1));\n var dx = 0;\n var dy = 0;\n var l1 = 0;\n var l2 = 0;\n if (qr > M_PI_2) {\n dy = y11 - y22;\n dx = x21 - x12;\n l1 = parseFloat(dy ? (dy / Math.cos(qr)).toFixed(2) : (dx).toFixed(2));\n l2 = parseFloat(dx ? (dx / Math.sin(qr)).toFixed(2) : (dy).toFixed(2));\n }\n else if (0.0 < qr && qr <= M_PI_2) {\n dy = y21 - y12;\n dx = x21 - x12;\n if (dy > dx) {\n l1 = l2 = parseFloat(dy ? (dy / Math.cos(qr)).toFixed(2) : (dx).toFixed(2));\n }\n else {\n l1 = l2 = parseFloat(dx ? (dx / Math.sin(qr)).toFixed(2) : (dy).toFixed(2));\n }\n }\n else if (qr < -M_PI_2) {\n dy = y11 - y22;\n dx = -(x22 - x11);\n if (dy > dx) {\n l1 = l2 = parseFloat(dy ? (dy / Math.cos(qr)).toFixed(2) : (dx).toFixed(2));\n }\n else {\n l1 = l2 = parseFloat(dx ? (dx / Math.sin(qr)).toFixed(2) : (dy).toFixed(2));\n }\n }\n else {\n dy = y21 - y12;\n if (Math.abs(dcx) > (x12 - x11) / 2) {\n dx = x11 - x22;\n }\n else {\n dx = dcx;\n }\n if (dy > dx) {\n l1 = l2 = parseFloat(dy ? (dy / Math.cos(qr)).toFixed(2) : (dx).toFixed(2));\n }\n else {\n l1 = l2 = parseFloat((dx && qr !== 0.0) ? (dx / Math.sin(qr)).toFixed(2) : (dy).toFixed(2));\n }\n }\n var aqr = parseFloat(qr.toFixed(2));\n // 判断是否水平,角度\n var newHoriz = isHoriz;\n if (isHoriz) {\n newHoriz = PI_38 < aqr && aqr < PI_58;\n }\n return {\n distance: Math.abs(l1 < l2 ? l1 : l2),\n isHoriz: newHoriz,\n };\n}\nfunction calcNodePair(nodeA, nodeB) {\n // 确定两个节点间是否存在连线\n var edges = nodeEdgeMap.get(nodeA.id) || [];\n var isLinked = edges.find(function (edge) {\n return edge.source === nodeB.id || edge.target === nodeB.id;\n });\n var areaA = nodeA.size[0] * nodeA.size[1];\n var areaB = nodeB.size[0] * nodeB.size[1];\n var node1 = areaA > areaB ? nodeB : nodeA;\n var node2 = areaA > areaB ? nodeA : nodeB;\n var x11 = node1.x - node1.size[0] / 2;\n var y11 = node1.y - node1.size[1] / 2;\n var x12 = node1.x + node1.size[0] / 2;\n var y12 = node1.y + node1.size[1] / 2;\n var x21 = node2.x - node2.size[0] / 2;\n var y21 = node2.y - node2.size[1] / 2;\n var x22 = node2.x + node2.size[0] / 2;\n var y22 = node2.y + node2.size[1] / 2;\n var cx1 = node1.x;\n var cy1 = node1.y;\n var cx2 = node2.x;\n var cy2 = node2.y;\n // Detect if nodes overlap 检查节点之间是否存在覆盖问题\n var isoverlap = ((x12 >= x21) && (x22 >= x11) && (y12 >= y21) && (y22 >= y11));\n var e = 0;\n var distance = 0;\n if (isoverlap) {\n distance = Math.sqrt(Math.pow((cx2 - cx1), 2) + Math.pow((cy2 - cy1), 2));\n // calc area of overlap 计算重复区域的坐标和面积\n var sx1 = x11 > x21 ? x11 : x21;\n var sy1 = y11 > y21 ? y11 : y21;\n var sx2 = x12 < x22 ? x12 : x22;\n var sy2 = y12 < y22 ? y12 : y22;\n var dsx = sx2 - sx1;\n var dsy = sy2 - sy1;\n var sov = dsx * dsy;\n if (distance === 0.0) {\n distance = 0.0000001;\n }\n e = MIN_DIST * 1 / distance * 100 + sov;\n e *= OVERLAP_QUOT;\n }\n else {\n var isHoriz = false;\n var res = distanceToNode(node1, node2, isHoriz);\n distance = res.distance;\n isHoriz = res.isHoriz;\n if (distance <= MIN_DIST) {\n if (distance !== 0) {\n if (isLinked) {\n e += MIN_DIST + OVERLAP_QUOT * 1 / distance;\n }\n else {\n e += MIN_DIST + OVERLAP_QUOT * MIN_DIST / distance;\n }\n }\n else {\n e += OVERLAP_QUOT;\n }\n }\n else {\n e += distance;\n if (isLinked) {\n e += distance * distance;\n }\n }\n }\n return e;\n}\nfunction calcEnergy(nodes) {\n var energy = 0;\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if ((node.x < 0) || (node.y < 0) || (node.x > graphWidth) || (node.y > graphHeight)) {\n energy += 1000000000000;\n }\n for (var j = i + 1; j < nodes.length; j++) {\n energy += calcNodePair(node, nodes[j]);\n }\n }\n return energy;\n}\nfunction isCorrectPosition(node, newPosition, nodes, edges) {\n var nodeIdxMap = new Map();\n nodes.forEach(function (o, i) {\n nodeIdxMap.set(o.id, o);\n });\n var relateEdges = edges.filter(function (edge) { return edge.source === node.id || edge.target === node.id; }) || [];\n var relateNodes = [];\n relateEdges.forEach(function (edge) {\n var otherNodeId = edge.source === node.id ? edge.target : edge.source;\n var otherNode = nodeIdxMap.get(otherNodeId);\n if (otherNode) {\n relateNodes.push(otherNode);\n }\n });\n var flag = true;\n for (var i = 0; i < relateNodes.length; i++) {\n var item = relateNodes[i];\n // 判断条件调整,节点的坐标不需要完全一致。可以根据节点间的夹角来判断\n var delta = Math.atan((node.y - item.y) / (item.x - node.y)) * 180;\n var newDelta = Math.atan((newPosition.y - item.y) / (item.x - newPosition.y)) * 180;\n var isHor = delta < 30 || delta > 150;\n var newIsHor = newDelta < 30 || newDelta > 150;\n var isVer = delta > 70 && delta < 110;\n var newIsVer = newDelta > 70 && newDelta < 110;\n // 定义四个相似角度区间,0-15度,75-90度,90到105度,165到180度。\n if (isHor && !newIsHor || ((delta * newDelta) < 0)) {\n flag = false;\n break;\n }\n else if (isVer && !newIsVer || ((delta * newDelta) < 0)) {\n flag = false;\n break;\n }\n else if ((item.x - node.x) * (item.x - newPosition.x) < 0) {\n flag = false;\n break;\n }\n else if ((item.y - node.y) * (item.y - newPosition.y) < 0) {\n flag = false;\n break;\n }\n }\n return flag;\n}\nfunction shuffle(nodes, edges) {\n var foundSmallerEnergy = false;\n // 多次测试发现step为1时的效果最佳。\n var step = 1;\n var wstep = CELL_W * step;\n var hstep = CELL_H * step;\n var wsteps = [wstep, -wstep, 0, 0,];\n var hsteps = [0, 0, hstep, -hstep,];\n for (var i = 0; i < nodes.length; ++i) {\n var node = nodes[i];\n var nodeEnergy = calcNodeEnergy(node, nodes);\n for (var ns = 0; ns < wsteps.length; ns++) {\n // 判断新位置与其他连线节点的位置关系是否违规\n var flag = isCorrectPosition(node, { x: node.x + wsteps[ns], y: node.y + hsteps[ns] }, nodes, edges);\n if (flag) {\n // 节点朝上下左右四个方向移动,找到能量最小的那个位置\n node.x += wsteps[ns];\n node.y += hsteps[ns];\n // 计算移动后节点的能量\n var energy = calcNodeEnergy(node, nodes);\n var rdm = Math.random();\n if (energy < nodeEnergy) {\n nodeEnergy = energy;\n foundSmallerEnergy = true;\n }\n else if (rdm < T && rdm > T_MIN) {\n nodeEnergy = energy;\n foundSmallerEnergy = true;\n }\n else {\n // 回归原位\n node.x -= wsteps[ns];\n node.y -= hsteps[ns];\n }\n }\n }\n }\n if (T > T_MIN) {\n T *= R;\n }\n // 重新计算图整体的能量\n if (foundSmallerEnergy) {\n return calcEnergy(nodes);\n }\n return 0;\n}\n// 计算节点的能量,\nfunction calcNodeEnergy(node, nodes) {\n var e = 0.0;\n if ((node.x < 0) || (node.y < 0) ||\n (node.x + node.size[0] + 20 > graphWidth) ||\n (node.y + node.size[1] + 20 > graphHeight)) {\n e += 1000000000000.0;\n }\n for (var i = 0; i < nodes.length; ++i) {\n if (node.id !== nodes[i].id) {\n e += calcNodePair(node, nodes[i]);\n }\n }\n return e;\n}\nfunction layout(nodes, edges) {\n if (nodes.length === 0) {\n return { nodes: nodes, edges: edges };\n }\n nodes.forEach(function (node) {\n var relateEdge = edges.filter(function (edge) { return edge.source === node.id || edge.target === node.id; });\n nodeEdgeMap.set(node, relateEdge);\n });\n // 1. 初始化\n // 将node按照连接数进行排序\n nodes.sort(function (node1, node2) {\n var _a, _b;\n return ((_a = nodeEdgeMap.get(node1.id)) === null || _a === void 0 ? void 0 : _a.length) - ((_b = nodeEdgeMap.get(node2.id)) === null || _b === void 0 ? void 0 : _b.length);\n });\n // 2. 计算图能量\n var minEnergy = calcEnergy(nodes);\n var deSameCount = 20; // de=0 count\n var de = 1; // energy delta\n var prevEnergy = 0;\n // 定义总的迭代次数。超过就停掉,防止死循环\n var MAX_COUNT = 50;\n var count = 0;\n while (deSameCount > 0) {\n count++;\n if (count >= MAX_COUNT) {\n break;\n }\n var ea = shuffle(nodes, edges);\n if (ea !== 0) {\n prevEnergy = ea;\n }\n de = prevEnergy - minEnergy;\n minEnergy = prevEnergy;\n if (de === 0) {\n --deSameCount;\n }\n else {\n deSameCount = 20;\n }\n }\n nodes.forEach(function (node) {\n node.x = node.x - node.size[0] / 2;\n node.y = node.y - node.size[1] / 2;\n });\n return {\n nodes: nodes,\n edges: edges,\n };\n}\nexports.default = layout;\n//# sourceMappingURL=mysqlWorkbench.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/mysqlWorkbench.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/base.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/base.js ***! - \*************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/force/force-in-a-box.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/force/force-in-a-box.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\nvar PluginBase =\n/** @class */\nfunction () {\n /**\n * 插件基类的构造函数\n * @param cfgs 插件的配置项\n */\n function PluginBase(cfgs) {\n this._cfgs = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"deepMix\"])(this.getDefaultCfgs(), cfgs);\n this._events = {};\n this.destroyed = false;\n }\n /**\n * 获取默认的插件配置\n */\n\n\n PluginBase.prototype.getDefaultCfgs = function () {\n return {};\n };\n /**\n * 初始化插件\n * @param graph IGraph 实例\n */\n\n\n PluginBase.prototype.initPlugin = function (graph) {\n var self = this;\n self.set('graph', graph);\n var events = self.getEvents();\n var bindEvents = {};\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (v, k) {\n var event = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"wrapBehavior\"])(self, v);\n bindEvents[k] = event;\n graph.on(k, event);\n });\n this._events = bindEvents;\n this.init();\n };\n /**\n * 获取插件中的事件和事件处理方法,供子类实现\n */\n\n\n PluginBase.prototype.getEvents = function () {\n return {};\n };\n /**\n * 获取配置项中的某个值\n * @param key 键值\n */\n\n\n PluginBase.prototype.get = function (key) {\n var _a;\n\n return (_a = this._cfgs) === null || _a === void 0 ? void 0 : _a[key];\n };\n /**\n * 将指定的值存储到 cfgs 中\n * @param key 键值\n * @param val 设置的值\n */\n\n\n PluginBase.prototype.set = function (key, val) {\n this._cfgs[key] = val;\n };\n /**\n * 销毁方法,供子类复写\n */\n\n\n PluginBase.prototype.destroy = function () {};\n /**\n * 销毁插件\n */\n\n\n PluginBase.prototype.destroyPlugin = function () {\n this.destroy();\n var graph = this.get('graph');\n var events = this._events;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(events, function (v, k) {\n graph.off(k, v);\n });\n this._events = null;\n this._cfgs = null;\n this.destroyed = true;\n };\n\n return PluginBase;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (PluginBase);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/base.js?"); +eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar d3Force = __importStar(__webpack_require__(/*! d3-force */ \"./node_modules/@antv/layout/node_modules/d3-force/src/index.js\"));\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\n// https://github.com/john-guerra/forceInABox/blob/master/src/forceInABox.js\nfunction forceInABox() {\n function constant(_) {\n return function () { return _; };\n }\n var groupBy = function (d) {\n return d.cluster;\n };\n var forceNodeSize = constant(1);\n var forceCharge = constant(-1);\n var forceLinkDistance = constant(100);\n var forceLinkStrength = constant(0.1);\n var offset = [0, 0];\n var nodes = [];\n var nodesMap = {};\n var links = [];\n var centerX = 100;\n var centerY = 100;\n var foci = {\n none: {\n x: 0,\n y: 0,\n },\n };\n var templateNodes = [];\n var templateForce;\n var template = 'force';\n var enableGrouping = true;\n var strength = 0.1;\n function force(alpha) {\n if (!enableGrouping) {\n return force;\n }\n templateForce.tick();\n getFocisFromTemplate();\n for (var i = 0, n = nodes.length, node = void 0, k = alpha * strength; i < n; ++i) {\n node = nodes[i];\n node.vx += (foci[groupBy(node)].x - node.x) * k;\n node.vy += (foci[groupBy(node)].y - node.y) * k;\n }\n }\n function initialize() {\n if (!nodes)\n return;\n initializeWithForce();\n }\n function initializeWithForce() {\n if (!nodes || !nodes.length) {\n return;\n }\n if (groupBy(nodes[0]) === undefined) {\n throw Error(\"Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()\");\n }\n // checkLinksAsObjects();\n var net = getGroupsGraph();\n templateForce = d3Force\n .forceSimulation(net.nodes)\n .force('x', d3Force.forceX(centerX).strength(0.1))\n .force('y', d3Force.forceY(centerY).strength(0.1))\n .force('collide', d3Force.forceCollide(function (d) { return d.r; }).iterations(4))\n .force('charge', d3Force.forceManyBody().strength(forceCharge))\n .force('links', d3Force\n .forceLink(net.nodes.length ? net.links : [])\n .distance(forceLinkDistance)\n .strength(forceLinkStrength));\n templateNodes = templateForce.nodes();\n getFocisFromTemplate();\n }\n function getGroupsGraph() {\n var gnodes = [];\n var glinks = [];\n var dNodes = {};\n var clustersList = [];\n var clustersCounts = {};\n var clustersLinks = [];\n clustersCounts = computeClustersNodeCounts(nodes);\n clustersLinks = computeClustersLinkCounts(links);\n clustersList = Object.keys(clustersCounts);\n clustersList.forEach(function (key, index) {\n var val = clustersCounts[key];\n // Uses approx meta-node size\n gnodes.push({\n id: key,\n size: val.count,\n r: Math.sqrt(val.sumforceNodeSize / Math.PI),\n });\n dNodes[key] = index;\n });\n clustersLinks.forEach(function (l) {\n var sourceTerminal = (0, util_1.getEdgeTerminal)(l, 'source');\n var targetTerminal = (0, util_1.getEdgeTerminal)(l, 'target');\n var source = dNodes[sourceTerminal];\n var target = dNodes[targetTerminal];\n if (source !== undefined && target !== undefined) {\n glinks.push({\n source: source,\n target: target,\n count: l.count,\n });\n }\n });\n return {\n nodes: gnodes,\n links: glinks,\n };\n }\n function computeClustersNodeCounts(nodes) {\n var clustersCounts = {};\n nodes.forEach(function (d) {\n var key = groupBy(d);\n if (!clustersCounts[key]) {\n clustersCounts[key] = {\n count: 0,\n sumforceNodeSize: 0,\n };\n }\n });\n nodes.forEach(function (d) {\n var key = groupBy(d);\n var nodeSize = forceNodeSize(d);\n var tmpCount = clustersCounts[key];\n tmpCount.count = tmpCount.count + 1;\n tmpCount.sumforceNodeSize =\n tmpCount.sumforceNodeSize + Math.PI * (nodeSize * nodeSize) * 1.3;\n clustersCounts[key] = tmpCount;\n });\n return clustersCounts;\n }\n function computeClustersLinkCounts(links) {\n var dClusterLinks = {};\n var clusterLinks = [];\n links.forEach(function (l) {\n var key = getLinkKey(l);\n var count = 0;\n if (dClusterLinks[key] !== undefined) {\n count = dClusterLinks[key];\n }\n count += 1;\n dClusterLinks[key] = count;\n });\n // @ts-ignore\n var entries = Object.entries(dClusterLinks);\n entries.forEach(function (_a) {\n var key = _a[0], count = _a[1];\n var source = key.split('~')[0];\n var target = key.split('~')[1];\n if (source !== undefined && target !== undefined) {\n clusterLinks.push({\n source: source,\n target: target,\n count: count,\n });\n }\n });\n return clusterLinks;\n }\n function getFocisFromTemplate() {\n foci = {\n none: {\n x: 0,\n y: 0,\n },\n };\n templateNodes.forEach(function (d) {\n foci[d.id] = {\n x: d.x - offset[0],\n y: d.y - offset[1],\n };\n });\n return foci;\n }\n function getLinkKey(l) {\n var source = (0, util_1.getEdgeTerminal)(l, 'source');\n var target = (0, util_1.getEdgeTerminal)(l, 'target');\n var sourceID = groupBy(nodesMap[source]);\n var targetID = groupBy(nodesMap[target]);\n return sourceID <= targetID\n ? \"\".concat(sourceID, \"~\").concat(targetID)\n : \"\".concat(targetID, \"~\").concat(sourceID);\n }\n function genNodesMap(nodes) {\n nodesMap = {};\n nodes.forEach(function (node) {\n nodesMap[node.id] = node;\n });\n }\n function setTemplate(x) {\n if (!arguments.length)\n return template;\n template = x;\n initialize();\n return force;\n }\n function setGroupBy(x) {\n if (!arguments.length)\n return groupBy;\n if (typeof x === 'string') {\n groupBy = function (d) {\n return d[x];\n };\n return force;\n }\n groupBy = x;\n return force;\n }\n function setEnableGrouping(x) {\n if (!arguments.length)\n return enableGrouping;\n enableGrouping = x;\n return force;\n }\n function setStrength(x) {\n if (!arguments.length)\n return strength;\n strength = x;\n return force;\n }\n function setCenterX(_) {\n if (arguments.length) {\n centerX = _;\n return force;\n }\n return centerX;\n }\n function setCenterY(_) {\n if (arguments.length) {\n centerY = _;\n return force;\n }\n return centerY;\n }\n function setNodes(_) {\n if (arguments.length) {\n genNodesMap(_ || []);\n nodes = _ || [];\n return force;\n }\n return nodes;\n }\n function setLinks(_) {\n if (arguments.length) {\n links = _ || [];\n initialize();\n return force;\n }\n return links;\n }\n function setForceNodeSize(_) {\n if (arguments.length) {\n if (typeof _ === 'function') {\n forceNodeSize = _;\n }\n else {\n forceNodeSize = constant(+_);\n }\n initialize();\n return force;\n }\n return forceNodeSize;\n }\n function setForceCharge(_) {\n if (arguments.length) {\n if (typeof _ === 'function') {\n forceCharge = _;\n }\n else {\n forceCharge = constant(+_);\n }\n initialize();\n return force;\n }\n return forceCharge;\n }\n function setForceLinkDistance(_) {\n if (arguments.length) {\n if (typeof _ === 'function') {\n forceLinkDistance = _;\n }\n else {\n forceLinkDistance = constant(+_);\n }\n initialize();\n return force;\n }\n return forceLinkDistance;\n }\n function setForceLinkStrength(_) {\n if (arguments.length) {\n if (typeof _ === 'function') {\n forceLinkStrength = _;\n }\n else {\n forceLinkStrength = constant(+_);\n }\n initialize();\n return force;\n }\n return forceLinkStrength;\n }\n function setOffset(_) {\n if (arguments.length) {\n offset = _;\n return force;\n }\n return offset;\n }\n force.initialize = function (_) {\n nodes = _;\n initialize();\n };\n force.template = setTemplate;\n force.groupBy = setGroupBy;\n force.enableGrouping = setEnableGrouping;\n force.strength = setStrength;\n force.centerX = setCenterX;\n force.centerY = setCenterY;\n force.nodes = setNodes;\n force.links = setLinks;\n force.forceNodeSize = setForceNodeSize;\n // Legacy support\n force.nodeSize = force.forceNodeSize;\n force.forceCharge = setForceCharge;\n force.forceLinkDistance = setForceLinkDistance;\n force.forceLinkStrength = setForceLinkStrength;\n force.offset = setOffset;\n force.getFocis = getFocisFromTemplate;\n return force;\n}\nexports.default = forceInABox;\n//# sourceMappingURL=force-in-a-box.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force/force-in-a-box.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/bundling/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/bundling/index.js ***! - \***********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/force/force.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/force/force.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\nfunction getEucliDis(pointA, pointB, eps) {\n var vx = pointA.x - pointB.x;\n var vy = pointA.y - pointB.y;\n\n if (!eps || Math.abs(vx) > eps || Math.abs(vy) > eps) {\n return Math.sqrt(vx * vx + vy * vy);\n }\n\n return eps;\n}\n\nfunction getDotProduct(ei, ej) {\n return ei.x * ej.x + ei.y * ej.y;\n}\n\nfunction projectPointToEdge(p, e) {\n var k = (e.source.y - e.target.y) / (e.source.x - e.target.x);\n var x = (k * k * e.source.x + k * (p.y - e.source.y) + p.x) / (k * k + 1);\n var y = k * (x - e.source.x) + e.source.y;\n return {\n x: x,\n y: y\n };\n}\n\nvar Bundling =\n/** @class */\nfunction (_super) {\n __extends(Bundling, _super);\n\n function Bundling(config) {\n return _super.call(this, config) || this;\n }\n\n Bundling.prototype.getDefaultCfgs = function () {\n return {\n edgeBundles: [],\n edgePoints: [],\n K: 0.1,\n lambda: 0.1,\n divisions: 1,\n divRate: 2,\n cycles: 6,\n iterations: 90,\n iterRate: 0.6666667,\n bundleThreshold: 0.6,\n eps: 1e-6,\n onLayoutEnd: function onLayoutEnd() {},\n onTick: function onTick() {}\n };\n };\n\n Bundling.prototype.init = function () {\n var graph = this.get('graph');\n var onTick = this.get('onTick');\n\n var tick = function tick() {\n if (onTick) {\n onTick();\n }\n\n graph.refreshPositions();\n };\n\n this.set('tick', tick);\n };\n\n Bundling.prototype.bundling = function (data) {\n var self = this;\n self.set('data', data); // 如果正在布局,忽略布局请求\n\n if (self.isTicking()) {\n return;\n }\n\n var edges = data.edges || [];\n var nodes = data.nodes || [];\n var nodeIdMap = {};\n var error = false;\n nodes.forEach(function (node) {\n if (node.x === null || !node.y === null || node.x === undefined || !node.y === undefined) {\n error = true;\n }\n\n nodeIdMap[node.id] = node;\n });\n if (error) throw new Error('please layout the graph or assign x and y for nodes first');\n self.set('nodeIdMap', nodeIdMap); // subdivide each edges\n\n var divisions = self.get('divisions');\n var divRate = self.get('divRate');\n var edgePoints = self.divideEdges(divisions);\n self.set('edgePoints', edgePoints); // compute the bundles\n\n var edgeBundles = self.getEdgeBundles();\n self.set('edgeBundles', edgeBundles); // iterations\n\n var C = self.get('cycles');\n var iterations = self.get('iterations');\n var iterRate = self.get('iterRate');\n var lambda = self.get('lambda');\n\n for (var i = 0; i < C; i++) {\n var _loop_1 = function _loop_1(j) {\n var forces = [];\n edges.forEach(function (e, k) {\n if (e.source === e.target) return;\n var source = nodeIdMap[e.source];\n var target = nodeIdMap[e.target];\n forces[k] = self.getEdgeForces({\n source: source,\n target: target\n }, k, divisions, lambda);\n\n for (var p = 0; p < divisions + 1; p++) {\n edgePoints[k][p].x += forces[k][p].x;\n edgePoints[k][p].y += forces[k][p].y;\n }\n });\n };\n\n for (var j = 0; j < iterations; j++) {\n _loop_1(j);\n } // parameters for nex cycle\n\n\n lambda = lambda / 2;\n divisions *= divRate;\n iterations *= iterRate;\n edgePoints = self.divideEdges(divisions);\n self.set('edgePoints', edgePoints);\n } // change the edges according to edgePoints\n\n\n edges.forEach(function (e, i) {\n if (e.source === e.target) return;\n e.type = 'polyline';\n e.controlPoints = edgePoints[i].slice(1, edgePoints[i].length - 1);\n });\n var graph = self.get('graph');\n graph.refresh();\n };\n\n Bundling.prototype.updateBundling = function (cfg) {\n var self = this;\n var data = cfg.data;\n\n if (data) {\n self.set('data', data);\n }\n\n if (self.get('ticking')) {\n self.set('ticking', false);\n }\n\n Object.keys(cfg).forEach(function (key) {\n self.set(key, cfg[key]);\n });\n\n if (cfg.onTick) {\n var graph_1 = this.get('graph');\n self.set('tick', function () {\n cfg.onTick();\n graph_1.refresh();\n });\n }\n\n self.bundling(data);\n };\n\n Bundling.prototype.divideEdges = function (divisions) {\n var self = this;\n var edges = self.get('data').edges;\n var nodeIdMap = self.get('nodeIdMap');\n var edgePoints = self.get('edgePoints');\n if (!edgePoints || edgePoints === undefined) edgePoints = [];\n edges.forEach(function (edge, i) {\n var _a;\n\n if (!edgePoints[i] || edgePoints[i] === undefined) {\n edgePoints[i] = [];\n }\n\n var source = nodeIdMap[edge.source];\n var target = nodeIdMap[edge.target];\n\n if (divisions === 1) {\n edgePoints[i].push({\n x: source.x,\n y: source.y\n }); // source\n\n edgePoints[i].push({\n x: 0.5 * (source.x + target.x),\n y: 0.5 * (source.y + target.y)\n }); // mid\n\n edgePoints[i].push({\n x: target.x,\n y: target.y\n }); // target\n } else {\n var edgeLength = 0;\n\n if (!((_a = edgePoints[i]) === null || _a === void 0 ? void 0 : _a.length)) {\n // it is a straight line\n edgeLength = getEucliDis({\n x: source.x,\n y: source.y\n }, {\n x: target.x,\n y: target.y\n });\n } else {\n edgeLength = self.getEdgeLength(edgePoints[i]);\n }\n\n var divisionLength_1 = edgeLength / (divisions + 1);\n var currentDivisonLength_1 = divisionLength_1;\n var newEdgePoints_1 = [{\n x: source.x,\n y: source.y\n }]; // source\n\n edgePoints[i].forEach(function (ep, j) {\n if (j === 0) return;\n var oriDivisionLength = getEucliDis(ep, edgePoints[i][j - 1]);\n\n while (oriDivisionLength > currentDivisonLength_1) {\n var ratio = currentDivisonLength_1 / oriDivisionLength;\n var edgePoint = {\n x: edgePoints[i][j - 1].x,\n y: edgePoints[i][j - 1].y\n };\n edgePoint.x += ratio * (ep.x - edgePoints[i][j - 1].x);\n edgePoint.y += ratio * (ep.y - edgePoints[i][j - 1].y);\n newEdgePoints_1.push(edgePoint);\n oriDivisionLength -= currentDivisonLength_1;\n currentDivisonLength_1 = divisionLength_1;\n }\n\n currentDivisonLength_1 -= oriDivisionLength;\n });\n newEdgePoints_1.push({\n x: target.x,\n y: target.y\n }); // target\n\n edgePoints[i] = newEdgePoints_1;\n }\n });\n return edgePoints;\n };\n /**\n * 计算边的长度\n * @param points\n */\n\n\n Bundling.prototype.getEdgeLength = function (points) {\n var length = 0;\n points.forEach(function (p, i) {\n if (i === 0) return;\n length += getEucliDis(p, points[i - 1]);\n });\n return length;\n };\n\n Bundling.prototype.getEdgeBundles = function () {\n var self = this;\n var data = self.get('data');\n var edges = data.edges || [];\n var bundleThreshold = self.get('bundleThreshold');\n var nodeIdMap = self.get('nodeIdMap');\n var edgeBundles = self.get('edgeBundles');\n if (!edgeBundles) edgeBundles = [];\n edges.forEach(function (e, i) {\n if (!edgeBundles[i] || edgeBundles[i] === undefined) {\n edgeBundles[i] = [];\n }\n });\n edges.forEach(function (ei, i) {\n var iSource = nodeIdMap[ei.source];\n var iTarget = nodeIdMap[ei.target];\n edges.forEach(function (ej, j) {\n if (j <= i) return;\n var jSource = nodeIdMap[ej.source];\n var jTarget = nodeIdMap[ej.target];\n var score = self.getBundleScore({\n source: iSource,\n target: iTarget\n }, {\n source: jSource,\n target: jTarget\n });\n\n if (score >= bundleThreshold) {\n edgeBundles[i].push(j);\n edgeBundles[j].push(i);\n }\n });\n });\n return edgeBundles;\n };\n\n Bundling.prototype.getBundleScore = function (ei, ej) {\n var self = this;\n ei.vx = ei.target.x - ei.source.x;\n ei.vy = ei.target.y - ei.source.y;\n ej.vx = ej.target.x - ej.source.x;\n ej.vy = ej.target.y - ej.source.y;\n ei.length = getEucliDis({\n x: ei.source.x,\n y: ei.source.y\n }, {\n x: ei.target.x,\n y: ei.target.y\n });\n ej.length = getEucliDis({\n x: ej.source.x,\n y: ej.source.y\n }, {\n x: ej.target.x,\n y: ej.target.y\n }); // angle score\n\n var aScore = self.getAngleScore(ei, ej); // scale score\n\n var sScore = self.getScaleScore(ei, ej); // position score\n\n var pScore = self.getPositionScore(ei, ej); // visibility socre\n\n var vScore = self.getVisibilityScore(ei, ej);\n return aScore * sScore * pScore * vScore;\n };\n\n Bundling.prototype.getAngleScore = function (ei, ej) {\n var dotProduct = getDotProduct({\n x: ei.vx,\n y: ei.vy\n }, {\n x: ej.vx,\n y: ej.vy\n });\n return dotProduct / (ei.length * ej.length);\n };\n\n Bundling.prototype.getScaleScore = function (ei, ej) {\n var aLength = (ei.length + ej.length) / 2;\n var score = 2 / (aLength / Math.min(ei.length, ej.length) + Math.max(ei.length, ej.length) / aLength);\n return score;\n };\n\n Bundling.prototype.getPositionScore = function (ei, ej) {\n var aLength = (ei.length + ej.length) / 2;\n var iMid = {\n x: (ei.source.x + ei.target.x) / 2,\n y: (ei.source.y + ei.target.y) / 2\n };\n var jMid = {\n x: (ej.source.x + ej.target.x) / 2,\n y: (ej.source.y + ej.target.y) / 2\n };\n var distance = getEucliDis(iMid, jMid);\n return aLength / (aLength + distance);\n };\n\n Bundling.prototype.getVisibilityScore = function (ei, ej) {\n var vij = this.getEdgeVisibility(ei, ej);\n var vji = this.getEdgeVisibility(ej, ei);\n return vij < vji ? vij : vji;\n };\n\n Bundling.prototype.getEdgeVisibility = function (ei, ej) {\n var ps = projectPointToEdge(ej.source, ei);\n var pt = projectPointToEdge(ej.target, ei);\n var pMid = {\n x: (ps.x + pt.x) / 2,\n y: (ps.y + pt.y) / 2\n };\n var iMid = {\n x: (ei.source.x + ei.target.x) / 2,\n y: (ei.source.y + ei.target.y) / 2\n };\n return Math.max(0, 1 - 2 * getEucliDis(pMid, iMid) / getEucliDis(ps, pt));\n };\n\n Bundling.prototype.getEdgeForces = function (e, eidx, divisions, lambda) {\n var self = this;\n var edgePoints = self.get('edgePoints');\n var K = self.get('K');\n var kp = K / (getEucliDis(e.source, e.target) * (divisions + 1));\n var edgePointForces = [{\n x: 0,\n y: 0\n }];\n\n for (var i = 1; i < divisions; i++) {\n var force = {\n x: 0,\n y: 0\n };\n var spring = self.getSpringForce({\n pre: edgePoints[eidx][i - 1],\n cur: edgePoints[eidx][i],\n next: edgePoints[eidx][i + 1]\n }, kp);\n var electrostatic = self.getElectrostaticForce(i, eidx);\n force.x = lambda * (spring.x + electrostatic.x);\n force.y = lambda * (spring.y + electrostatic.y);\n edgePointForces.push(force);\n }\n\n edgePointForces.push({\n x: 0,\n y: 0\n });\n return edgePointForces;\n };\n\n Bundling.prototype.getSpringForce = function (divisions, kp) {\n var x = divisions.pre.x + divisions.next.x - 2 * divisions.cur.x;\n var y = divisions.pre.y + divisions.next.y - 2 * divisions.cur.y;\n x *= kp;\n y *= kp;\n return {\n x: x,\n y: y\n };\n };\n\n Bundling.prototype.getElectrostaticForce = function (pidx, eidx) {\n var self = this;\n var eps = self.get('eps');\n var edgeBundles = self.get('edgeBundles');\n var edgePoints = self.get('edgePoints');\n var edgeBundle = edgeBundles[eidx];\n var resForce = {\n x: 0,\n y: 0\n };\n edgeBundle.forEach(function (eb) {\n var force = {\n x: edgePoints[eb][pidx].x - edgePoints[eidx][pidx].x,\n y: edgePoints[eb][pidx].y - edgePoints[eidx][pidx].y\n };\n\n if (Math.abs(force.x) > eps || Math.abs(force.y) > eps) {\n var length_1 = getEucliDis(edgePoints[eb][pidx], edgePoints[eidx][pidx]);\n var diff = 1 / length_1;\n resForce.x += force.x * diff;\n resForce.y += force.y * diff;\n }\n });\n return resForce;\n };\n\n Bundling.prototype.isTicking = function () {\n return this.get('ticking');\n };\n\n Bundling.prototype.getSimulation = function () {\n return this.get('forceSimulation');\n };\n\n Bundling.prototype.destroy = function () {\n if (this.get('ticking')) {\n this.getSimulation().stop();\n }\n\n _super.prototype.destroy.call(this);\n };\n\n return Bundling;\n}(_base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Bundling);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/bundling/index.js?"); +eval("\n/**\n * @fileOverview random layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ForceLayout = void 0;\nvar d3Force = __importStar(__webpack_require__(/*! d3-force */ \"./node_modules/@antv/layout/node_modules/d3-force/src/index.js\"));\nvar force_in_a_box_1 = __importDefault(__webpack_require__(/*! ./force-in-a-box */ \"./node_modules/@antv/layout/lib/layout/force/force-in-a-box.js\"));\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar constants_1 = __webpack_require__(/*! ../constants */ \"./node_modules/@antv/layout/lib/layout/constants.js\");\n/**\n * 经典力导布局 force-directed\n */\nvar ForceLayout = /** @class */ (function (_super) {\n __extends(ForceLayout, _super);\n function ForceLayout(options) {\n var _this = _super.call(this) || this;\n /** 向心力作用点 */\n _this.center = [0, 0];\n /** 节点作用力 */\n _this.nodeStrength = null;\n /** 边的作用力, 默认为根据节点的入度出度自适应 */\n _this.edgeStrength = null;\n /** 是否防止节点相互覆盖 */\n _this.preventOverlap = false;\n /** 聚类节点作用力 */\n _this.clusterNodeStrength = null;\n /** 聚类边作用力 */\n _this.clusterEdgeStrength = null;\n /** 聚类边长度 */\n _this.clusterEdgeDistance = null;\n /** 聚类节点大小 / 直径,直径越大,越分散 */\n _this.clusterNodeSize = null;\n /** 用于 foci 的力 */\n _this.clusterFociStrength = null;\n /** 默认边长度 */\n _this.linkDistance = 50;\n /** 迭代阈值的衰减率 [0, 1],0.028 对应最大迭代数为 300 */\n _this.alphaDecay = 0.028;\n /** 停止迭代的阈值 */\n _this.alphaMin = 0.001;\n /** 当前阈值 */\n _this.alpha = 0.3;\n /** 防止重叠的力强度 */\n _this.collideStrength = 1;\n /** 是否启用web worker。前提是在web worker里执行布局,否则无效\t*/\n _this.workerEnabled = false;\n _this.tick = function () { };\n /** 布局完成回调 */\n _this.onLayoutEnd = function () { };\n /** 是否正在布局 */\n _this.ticking = undefined;\n if (options) {\n _this.updateCfg(options);\n }\n return _this;\n }\n ForceLayout.prototype.getDefaultCfg = function () {\n return {\n center: [0, 0],\n nodeStrength: null,\n edgeStrength: null,\n preventOverlap: false,\n nodeSize: undefined,\n nodeSpacing: undefined,\n linkDistance: 50,\n forceSimulation: null,\n alphaDecay: 0.028,\n alphaMin: 0.001,\n alpha: 0.3,\n collideStrength: 1,\n clustering: false,\n clusterNodeStrength: -1,\n clusterEdgeStrength: 0.1,\n clusterEdgeDistance: 100,\n clusterFociStrength: 0.8,\n clusterNodeSize: 10,\n tick: function () { },\n onLayoutEnd: function () { },\n // 是否启用web worker。前提是在web worker里执行布局,否则无效\n workerEnabled: false\n };\n };\n /**\n * 初始化\n * @param {object} data 数据\n */\n ForceLayout.prototype.init = function (data) {\n var self = this;\n self.nodes = data.nodes || [];\n var edges = data.edges || [];\n self.edges = edges.map(function (edge) {\n var res = {};\n var expectKeys = [\"targetNode\", \"sourceNode\", \"startPoint\", \"endPoint\"];\n Object.keys(edge).forEach(function (key) {\n if (!(expectKeys.indexOf(key) > -1)) {\n res[key] = edge[key];\n }\n });\n return res;\n });\n self.ticking = false;\n };\n /**\n * 执行布局\n */\n ForceLayout.prototype.execute = function (reloadData) {\n var self = this;\n var nodes = self.nodes;\n var edges = self.edges;\n // 如果正在布局,忽略布局请求\n if (self.ticking) {\n return;\n }\n var simulation = self.forceSimulation;\n var alphaMin = self.alphaMin;\n var alphaDecay = self.alphaDecay;\n var alpha = self.alpha;\n if (!simulation) {\n try {\n // 定义节点的力\n var nodeForce = d3Force.forceManyBody();\n if (self.nodeStrength) {\n nodeForce.strength(self.nodeStrength);\n }\n simulation = d3Force.forceSimulation().nodes(nodes);\n if (self.clustering) {\n var clusterForce = (0, force_in_a_box_1.default)();\n clusterForce\n .centerX(self.center[0])\n .centerY(self.center[1])\n .template(\"force\")\n .strength(self.clusterFociStrength);\n if (edges) {\n clusterForce.links(edges);\n }\n if (nodes) {\n clusterForce.nodes(nodes);\n }\n clusterForce\n .forceLinkDistance(self.clusterEdgeDistance)\n .forceLinkStrength(self.clusterEdgeStrength)\n .forceCharge(self.clusterNodeStrength)\n .forceNodeSize(self.clusterNodeSize);\n self.clusterForce = clusterForce;\n simulation.force(\"group\", clusterForce);\n }\n simulation\n .force(\"center\", d3Force.forceCenter(self.center[0], self.center[1]))\n .force(\"charge\", nodeForce)\n .alpha(alpha)\n .alphaDecay(alphaDecay)\n .alphaMin(alphaMin);\n if (self.preventOverlap) {\n self.overlapProcess(simulation);\n }\n // 如果有边,定义边的力\n if (edges) {\n // d3 的 forceLayout 会重新生成边的数据模型,为了避免污染源数据\n var edgeForce = d3Force\n .forceLink()\n .id(function (d) { return d.id; })\n .links(edges);\n if (self.edgeStrength) {\n edgeForce.strength(self.edgeStrength);\n }\n if (self.linkDistance) {\n edgeForce.distance(self.linkDistance);\n }\n self.edgeForce = edgeForce;\n simulation.force(\"link\", edgeForce);\n }\n if (self.workerEnabled && !isInWorker()) {\n // 如果不是运行在web worker里,不用web worker布局\n self.workerEnabled = false;\n console.warn(\"workerEnabled option is only supported when running in web worker.\");\n }\n if (!self.workerEnabled) {\n simulation\n .on(\"tick\", function () {\n self.tick();\n })\n .on(\"end\", function () {\n self.ticking = false;\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n });\n self.ticking = true;\n }\n else {\n // worker is enabled\n simulation.stop();\n var totalTicks = getSimulationTicks(simulation);\n for (var currentTick = 1; currentTick <= totalTicks; currentTick++) {\n simulation.tick();\n // currentTick starts from 1.\n postMessage({\n nodes: nodes,\n currentTick: currentTick,\n totalTicks: totalTicks,\n type: constants_1.LAYOUT_MESSAGE.TICK\n }, undefined);\n }\n self.ticking = false;\n }\n self.forceSimulation = simulation;\n self.ticking = true;\n }\n catch (e) {\n self.ticking = false;\n console.warn(e);\n }\n }\n else {\n if (reloadData) {\n if (self.clustering && self.clusterForce) {\n self.clusterForce.nodes(nodes);\n self.clusterForce.links(edges);\n }\n simulation.nodes(nodes);\n if (edges && self.edgeForce)\n self.edgeForce.links(edges);\n else if (edges && !self.edgeForce) {\n // d3 的 forceLayout 会重新生成边的数据模型,为了避免污染源数据\n var edgeForce = d3Force\n .forceLink()\n .id(function (d) { return d.id; })\n .links(edges);\n if (self.edgeStrength) {\n edgeForce.strength(self.edgeStrength);\n }\n if (self.linkDistance) {\n edgeForce.distance(self.linkDistance);\n }\n self.edgeForce = edgeForce;\n simulation.force(\"link\", edgeForce);\n }\n }\n if (self.preventOverlap) {\n self.overlapProcess(simulation);\n }\n simulation.alpha(alpha).restart();\n this.ticking = true;\n }\n };\n /**\n * 防止重叠\n * @param {object} simulation 力模拟模型\n */\n ForceLayout.prototype.overlapProcess = function (simulation) {\n var self = this;\n var nodeSize = self.nodeSize;\n var nodeSpacing = self.nodeSpacing;\n var nodeSizeFunc;\n var nodeSpacingFunc;\n var collideStrength = self.collideStrength;\n if ((0, util_1.isNumber)(nodeSpacing)) {\n nodeSpacingFunc = function () { return nodeSpacing; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing)) {\n nodeSpacingFunc = nodeSpacing;\n }\n else {\n nodeSpacingFunc = function () { return 0; };\n }\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return res / 2 + nodeSpacingFunc(d);\n }\n if ((0, util_1.isObject)(d.size)) {\n var res = d.size.width > d.size.height ? d.size.width : d.size.height;\n return res / 2 + nodeSpacingFunc(d);\n }\n return d.size / 2 + nodeSpacingFunc(d);\n }\n return 10 + nodeSpacingFunc(d);\n };\n }\n else if ((0, util_1.isFunction)(nodeSize)) {\n nodeSizeFunc = function (d) {\n var size = nodeSize(d);\n return size + nodeSpacingFunc(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n var larger = nodeSize[0] > nodeSize[1] ? nodeSize[0] : nodeSize[1];\n var radius_1 = larger / 2;\n nodeSizeFunc = function (d) { return radius_1 + nodeSpacingFunc(d); };\n }\n else if ((0, util_1.isNumber)(nodeSize)) {\n var radius_2 = nodeSize / 2;\n nodeSizeFunc = function (d) { return radius_2 + nodeSpacingFunc(d); };\n }\n else {\n nodeSizeFunc = function () { return 10; };\n }\n // forceCollide's parameter is a radius\n simulation.force(\"collisionForce\", d3Force.forceCollide(nodeSizeFunc).strength(collideStrength));\n };\n /**\n * 更新布局配置,但不执行布局\n * @param {object} cfg 需要更新的配置项\n */\n ForceLayout.prototype.updateCfg = function (cfg) {\n var self = this;\n if (self.ticking) {\n self.forceSimulation.stop();\n self.ticking = false;\n }\n self.forceSimulation = null;\n Object.assign(self, cfg);\n };\n ForceLayout.prototype.destroy = function () {\n var self = this;\n if (self.ticking) {\n self.forceSimulation.stop();\n self.ticking = false;\n }\n self.nodes = null;\n self.edges = null;\n self.destroyed = true;\n };\n return ForceLayout;\n}(base_1.Base));\nexports.ForceLayout = ForceLayout;\n// Return total ticks of d3-force simulation\nfunction getSimulationTicks(simulation) {\n var alphaMin = simulation.alphaMin();\n var alphaTarget = simulation.alphaTarget();\n var alpha = simulation.alpha();\n var totalTicksFloat = Math.log((alphaMin - alphaTarget) / (alpha - alphaTarget)) /\n Math.log(1 - simulation.alphaDecay());\n var totalTicks = Math.ceil(totalTicksFloat);\n return totalTicks;\n}\n// 判断是否运行在web worker里\nfunction isInWorker() {\n // eslint-disable-next-line no-undef\n return (typeof WorkerGlobalScope !== \"undefined\" &&\n self instanceof WorkerGlobalScope);\n}\n//# sourceMappingURL=force.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force/force.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/edgeFilterLens/index.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/edgeFilterLens/index.js ***! - \*****************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/force/index.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/force/index.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\n\n\nvar distance = _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].distance;\nvar DELTA = 0.05;\nvar lensDelegateStyle = {\n stroke: '#000',\n strokeOpacity: 0.8,\n lineWidth: 2,\n fillOpacity: 1,\n fill: '#fff'\n};\n\nvar EdgeFilterLens =\n/** @class */\nfunction (_super) {\n __extends(EdgeFilterLens, _super);\n\n function EdgeFilterLens(config) {\n return _super.call(this, config) || this;\n }\n\n EdgeFilterLens.prototype.getDefaultCfgs = function () {\n return {\n type: 'both',\n trigger: 'mousemove',\n r: 60,\n delegateStyle: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(lensDelegateStyle),\n showLabel: 'edge',\n scaleRBy: 'wheel'\n };\n }; // class-methods-use-this\n\n\n EdgeFilterLens.prototype.getEvents = function () {\n var events;\n\n switch (this.get('trigger')) {\n case 'click':\n events = {\n click: 'filter'\n };\n break;\n\n case 'drag':\n events = {\n click: 'createDelegate'\n };\n break;\n\n default:\n events = {\n mousemove: 'filter'\n };\n break;\n }\n\n return events;\n };\n\n EdgeFilterLens.prototype.init = function () {\n var self = this;\n var showLabel = self.get('showLabel');\n var showNodeLabel = showLabel === 'node' || showLabel === 'both';\n var showEdgeLabel = showLabel === 'edge' || showLabel === 'both';\n self.set('showNodeLabel', showNodeLabel);\n self.set('showEdgeLabel', showEdgeLabel);\n var shouldShow = self.get('shouldShow');\n if (!shouldShow) self.set('shouldShow', function () {\n return true;\n });\n }; // Create the delegate when the trigger is drag\n\n\n EdgeFilterLens.prototype.createDelegate = function (e) {\n var self = this;\n var lensDelegate = self.get('delegate');\n\n if (!lensDelegate || lensDelegate.destroyed) {\n self.filter(e);\n lensDelegate = self.get('delegate'); // drag to move the lens\n\n lensDelegate.on('dragstart', function (evt) {});\n lensDelegate.on('drag', function (evt) {\n self.filter(evt);\n }); // 绑定调整范围(r)\n // 由于 drag 用于改变 lens 位置,因此在此模式下,drag 不能用于调整 r\n // scaling r\n\n if (this.get('scaleRBy') === 'wheel') {\n lensDelegate.on('mousewheel', function (evt) {\n self.scaleRByWheel(evt);\n });\n }\n }\n };\n /**\n * Scale the range by wheel\n * @param e mouse wheel event\n */\n\n\n EdgeFilterLens.prototype.scaleRByWheel = function (e) {\n var self = this;\n if (!e || !e.originalEvent) return;\n if (e.preventDefault) e.preventDefault();\n var graph = self.get('graph');\n var ratio;\n var lensDelegate = self.get('delegate');\n var lensCenter = lensDelegate ? {\n x: lensDelegate.attr('x'),\n y: lensDelegate.attr('y')\n } : undefined;\n var mousePos = lensCenter || graph.getPointByClient(e.clientX, e.clientY);\n\n if (e.originalEvent.wheelDelta < 0) {\n ratio = 1 - DELTA;\n } else {\n ratio = 1 / (1 - DELTA);\n }\n\n var maxR = self.get('maxR');\n var minR = self.get('minR');\n var r = self.get('r');\n\n if (r > (maxR || graph.get('height')) && ratio > 1 || r < (minR || graph.get('height') * 0.05) && ratio < 1) {\n ratio = 1;\n }\n\n r *= ratio;\n self.set('r', r);\n self.filter(e);\n };\n /**\n * Response function for mousemove, click, or drag to filter out the edges\n * @param e mouse event\n */\n\n\n EdgeFilterLens.prototype.filter = function (e) {\n var self = this;\n var graph = self.get('graph');\n var nodes = graph.getNodes();\n var hitNodesMap = {};\n var r = self.get('r');\n var type = self.get('type');\n var fCenter = {\n x: e.x,\n y: e.y\n };\n self.updateDelegate(fCenter, r);\n var shouldShow = self.get('shouldShow');\n var vShapes = self.get('vShapes');\n\n if (vShapes) {\n vShapes.forEach(function (shape) {\n shape.remove();\n shape.destroy();\n });\n }\n\n vShapes = [];\n nodes.forEach(function (node) {\n var model = node.getModel();\n var x = model.x,\n y = model.y;\n\n if (distance({\n x: x,\n y: y\n }, fCenter) < r) {\n hitNodesMap[model.id] = node;\n }\n });\n var edges = graph.getEdges();\n var hitEdges = [];\n edges.forEach(function (edge) {\n var model = edge.getModel();\n var sourceId = model.source;\n var targetId = model.target;\n\n if (shouldShow(model)) {\n if (type === 'only-source' || type === 'one') {\n if (hitNodesMap[sourceId] && !hitNodesMap[targetId]) hitEdges.push(edge);\n } else if (type === 'only-target' || type === 'one') {\n if (hitNodesMap[targetId] && !hitNodesMap[sourceId]) hitEdges.push(edge);\n } else if (type === 'both' && hitNodesMap[sourceId] && hitNodesMap[targetId]) {\n hitEdges.push(edge);\n }\n }\n });\n var showNodeLabel = self.get('showNodeLabel');\n var showEdgeLabel = self.get('showEdgelabel'); // copy the shapes in hitEdges\n\n var group = graph.get('group');\n hitEdges.forEach(function (edge) {\n var shapes = edge.get('group').get('children');\n shapes.forEach(function (shape) {\n var shapeType = shape.get('type');\n var vShape = group.addShape(shapeType, {\n attrs: shape.attr()\n });\n vShapes.push(vShape);\n\n if (showNodeLabel && shapeType === 'text') {\n vShape.set('visible', true);\n }\n });\n }); // copy the shape sof hitNodes\n\n Object.keys(hitNodesMap).forEach(function (key) {\n var node = hitNodesMap[key];\n var clonedGroup = node.get('group').clone();\n group.add(clonedGroup);\n vShapes.push(clonedGroup);\n\n if (showEdgeLabel) {\n var shapes = clonedGroup.get('children');\n\n for (var j = 0; j < shapes.length; j++) {\n var shape = shapes[j];\n\n if (shape.get('type') === 'text') {\n shape.set('visible', true);\n }\n }\n }\n });\n self.set('vShapes', vShapes);\n };\n /**\n * Adjust part of the parameters, including trigger, type, r, maxR, minR, shouldShow, showLabel, and scaleRBy\n * @param {EdgeFilterLensConfig} cfg\n */\n\n\n EdgeFilterLens.prototype.updateParams = function (cfg) {\n var self = this;\n var r = cfg.r,\n trigger = cfg.trigger,\n minR = cfg.minR,\n maxR = cfg.maxR,\n scaleRBy = cfg.scaleRBy,\n showLabel = cfg.showLabel,\n shouldShow = cfg.shouldShow;\n\n if (!isNaN(cfg.r)) {\n self.set('r', r);\n }\n\n if (!isNaN(maxR)) {\n self.set('maxR', maxR);\n }\n\n if (!isNaN(minR)) {\n self.set('minR', minR);\n }\n\n if (trigger === 'mousemove' || trigger === 'click') {\n self.set('trigger', trigger);\n }\n\n if (scaleRBy === 'wheel' || scaleRBy === 'unset') {\n self.set('scaleRBy', scaleRBy);\n self.get('delegate').remove();\n self.get('delegate').destroy();\n var dPercentText = self.get('dPercentText');\n\n if (dPercentText) {\n dPercentText.remove();\n dPercentText.destroy();\n }\n }\n\n if (showLabel === 'node' || showLabel === 'both') {\n self.set('showNodeLabel', true);\n }\n\n if (showLabel === 'edge' || showLabel === 'both') {\n self.set('showEdgeLabel', true);\n }\n\n if (shouldShow) {\n self.set('shouldShow', shouldShow);\n }\n };\n /**\n * Update the delegate shape of the lens\n * @param {Point} mCenter the center of the shape\n * @param {number} r the radius of the shape\n */\n\n\n EdgeFilterLens.prototype.updateDelegate = function (mCenter, r) {\n var self = this;\n var graph = self.get('graph');\n var lensDelegate = self.get('delegate');\n\n if (!lensDelegate || lensDelegate.destroyed) {\n // 拖动多个\n var parent_1 = graph.get('group');\n var attrs = self.get('delegateStyle') || lensDelegateStyle; // model上的x, y是相对于图形中心的,delegateShape是g实例,x,y是绝对坐标\n\n lensDelegate = parent_1.addShape('circle', {\n attrs: __assign({\n r: r,\n x: mCenter.x,\n y: mCenter.y\n }, attrs),\n name: 'lens-shape',\n draggable: true\n });\n\n if (this.get('trigger') !== 'drag') {\n // 调整范围 r 的监听\n if (this.get('scaleRBy') === 'wheel') {\n // 使用滚轮调整 r\n lensDelegate.on('mousewheel', function (evt) {\n self.scaleRByWheel(evt);\n });\n }\n }\n } else {\n lensDelegate.attr({\n x: mCenter.x,\n y: mCenter.y,\n r: r\n });\n }\n\n self.set('delegate', lensDelegate);\n };\n /**\n * Clear the filtering\n */\n\n\n EdgeFilterLens.prototype.clear = function () {\n var self = this;\n var vShapes = self.get('vShapes');\n\n if (vShapes) {\n vShapes.forEach(function (shape) {\n shape.remove();\n shape.destroy();\n });\n }\n\n vShapes = [];\n self.set('vShapes', vShapes);\n var lensDelegate = self.get('delegate');\n\n if (lensDelegate && !lensDelegate.destroyed) {\n lensDelegate.remove();\n lensDelegate.destroy();\n }\n };\n /**\n * Destroy the component\n */\n\n\n EdgeFilterLens.prototype.destroy = function () {\n this.clear();\n };\n\n return EdgeFilterLens;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (EdgeFilterLens);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/edgeFilterLens/index.js?"); +eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(__webpack_require__(/*! ./force */ \"./node_modules/@antv/layout/lib/layout/force/force.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/fisheye/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/fisheye/index.js ***! - \**********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/force2/ForceNBody.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/force2/ForceNBody.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\n\nvar DELTA = 0.05;\nvar lensDelegateStyle = {\n stroke: '#000',\n strokeOpacity: 0.8,\n lineWidth: 2,\n fillOpacity: 0.1,\n fill: '#ccc'\n};\n\nvar Fisheye =\n/** @class */\nfunction (_super) {\n __extends(Fisheye, _super);\n\n function Fisheye(config) {\n return _super.call(this, config) || this;\n }\n\n Fisheye.prototype.getDefaultCfgs = function () {\n return {\n trigger: 'mousemove',\n d: 1.5,\n r: 300,\n delegateStyle: Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"clone\"])(lensDelegateStyle),\n showLabel: false,\n maxD: 5,\n minD: 0,\n scaleRBy: 'unset',\n scaleDBy: 'unset',\n showDPercent: true\n };\n }; // class-methods-use-this\n\n\n Fisheye.prototype.getEvents = function () {\n var events;\n\n switch (this.get('trigger')) {\n case 'click':\n events = {\n click: 'magnify'\n };\n break;\n\n case 'drag':\n events = {\n click: 'createDelegate'\n };\n break;\n\n default:\n events = {\n mousemove: 'magnify'\n };\n break;\n }\n\n return events;\n };\n\n Fisheye.prototype.init = function () {\n var self = this;\n var r = self.get('r');\n self.set('cachedMagnifiedModels', []);\n self.set('cachedOriginPositions', {});\n self.set('r2', r * r);\n var d = self.get('d');\n self.set('molecularParam', (d + 1) * r);\n }; // Create the delegate when the trigger is drag\n\n\n Fisheye.prototype.createDelegate = function (e) {\n var _this = this;\n\n var self = this;\n var lensDelegate = self.get('delegate');\n\n if (!lensDelegate || lensDelegate.destroyed) {\n self.magnify(e);\n lensDelegate = self.get('delegate'); // drag to move the lens\n\n lensDelegate.on('dragstart', function (evt) {\n self.set('delegateCenterDiff', {\n x: lensDelegate.attr('x') - evt.x,\n y: lensDelegate.attr('y') - evt.y\n });\n });\n lensDelegate.on('drag', function (evt) {\n self.magnify(evt);\n }); // 绑定调整范围(r)和缩放系数(d)的监听\n // 由于 drag 用于改变 lens 位置, 因此在此模式下, drag 不能用于调整 r 和 d\n // scaling d\n\n if (this.get('scaleDBy') === 'wheel') {\n lensDelegate.on('mousewheel', function (evt) {\n _this.scaleDByWheel(evt);\n });\n } // scaling r\n\n\n if (this.get('scaleRBy') === 'wheel') {\n lensDelegate.on('mousewheel', function (evt) {\n self.scaleRByWheel(evt);\n });\n }\n }\n };\n /**\n * Scale the range by wheel\n * @param e mouse wheel event\n */\n\n\n Fisheye.prototype.scaleRByWheel = function (e) {\n var self = this;\n if (!e || !e.originalEvent) return;\n if (e.preventDefault) e.preventDefault();\n var graph = self.get('graph');\n var ratio;\n var lensDelegate = self.get('delegate');\n var lensCenter = lensDelegate ? {\n x: lensDelegate.attr('x'),\n y: lensDelegate.attr('y')\n } : undefined;\n var mousePos = lensCenter || graph.getPointByClient(e.clientX, e.clientY);\n\n if (e.originalEvent.wheelDelta < 0) {\n ratio = 1 - DELTA;\n } else {\n ratio = 1 / (1 - DELTA);\n }\n\n var maxR = self.get('maxR');\n var minR = self.get('minR');\n var r = self.get('r');\n\n if (r > (maxR || graph.get('height')) && ratio > 1 || r < (minR || graph.get('height') * 0.05) && ratio < 1) {\n ratio = 1;\n }\n\n r *= ratio;\n self.set('r', r);\n self.set('r2', r * r);\n var d = self.get('d');\n self.set('molecularParam', (d + 1) * r);\n self.set('delegateCenterDiff', undefined);\n self.magnify(e, mousePos);\n };\n /**\n * Scale the range by dragging\n * @param e mouse event\n */\n\n\n Fisheye.prototype.scaleRByDrag = function (e) {\n var self = this;\n if (!e) return;\n var dragPrePos = self.get('dragPrePos');\n var graph = self.get('graph');\n var ratio;\n var mousePos = graph.getPointByClient(e.clientX, e.clientY);\n\n if (e.x - dragPrePos.x < 0) {\n ratio = 1 - DELTA;\n } else {\n ratio = 1 / (1 - DELTA);\n }\n\n var maxR = self.get('maxR');\n var minR = self.get('minR');\n var r = self.get('r');\n\n if (r > (maxR || graph.get('height')) && ratio > 1 || r < (minR || graph.get('height') * 0.05) && ratio < 1) {\n ratio = 1;\n }\n\n r *= ratio;\n self.set('r', r);\n self.set('r2', r * r);\n var d = self.get('d');\n self.set('molecularParam', (d + 1) * r);\n self.magnify(e, mousePos);\n self.set('dragPrePos', {\n x: e.x,\n y: e.y\n });\n };\n /**\n * Scale the magnifying factor by wheel\n * @param e mouse wheel event\n */\n\n\n Fisheye.prototype.scaleDByWheel = function (evt) {\n var self = this;\n if (!evt && !evt.originalEvent) return;\n if (evt.preventDefault) evt.preventDefault();\n var delta = 0;\n\n if (evt.originalEvent.wheelDelta < 0) {\n delta = -0.1;\n } else {\n delta = 0.1;\n }\n\n var d = self.get('d');\n var newD = d + delta;\n var maxD = self.get('maxD');\n var minD = self.get('minD');\n\n if (newD < maxD && newD > minD) {\n self.set('d', newD);\n var r = self.get('r');\n self.set('molecularParam', (newD + 1) * r);\n var lensDelegate = self.get('delegate');\n var lensCenter = lensDelegate ? {\n x: lensDelegate.attr('x'),\n y: lensDelegate.attr('y')\n } : undefined;\n self.set('delegateCenterDiff', undefined);\n self.magnify(evt, lensCenter);\n }\n };\n /**\n * Scale the magnifying factor by dragging\n * @param e mouse event\n */\n\n\n Fisheye.prototype.scaleDByDrag = function (e) {\n var self = this;\n var dragPrePos = self.get('dragPrePos');\n var delta = e.x - dragPrePos.x > 0 ? 0.1 : -0.1;\n var d = self.get('d');\n var newD = d + delta;\n var maxD = self.get('maxD');\n var minD = self.get('minD');\n\n if (newD < maxD && newD > minD) {\n self.set('d', newD);\n var r = self.get('r');\n self.set('molecularParam', (newD + 1) * r);\n self.magnify(e);\n }\n\n self.set('dragPrePos', {\n x: e.x,\n y: e.y\n });\n };\n /**\n * Response function for mousemove, click, or drag to magnify\n * @param e mouse event\n */\n\n\n Fisheye.prototype.magnify = function (e, mousePos) {\n var self = this;\n self.restoreCache();\n var graph = self.get('graph');\n var cachedMagnifiedModels = self.get('cachedMagnifiedModels');\n var cachedOriginPositions = self.get('cachedOriginPositions');\n var showLabel = self.get('showLabel');\n var r = self.get('r');\n var r2 = self.get('r2');\n var d = self.get('d');\n var molecularParam = self.get('molecularParam');\n var nodes = graph.getNodes();\n var nodeLength = nodes.length;\n var mCenter = mousePos ? {\n x: mousePos.x,\n y: mousePos.y\n } : {\n x: e.x,\n y: e.y\n };\n\n if (self.get('dragging') && (self.get('trigger') === 'mousemove' || self.get('trigger') === 'click')) {\n mCenter = self.get('cacheCenter');\n }\n\n var delegateCenterDiff = self.get('delegateCenterDiff');\n\n if (delegateCenterDiff) {\n mCenter.x += delegateCenterDiff.x;\n mCenter.y += delegateCenterDiff.y;\n }\n\n self.updateDelegate(mCenter, r);\n\n for (var i = 0; i < nodeLength; i++) {\n var model = nodes[i].getModel();\n var x = model.x,\n y = model.y;\n if (isNaN(x) || isNaN(y)) continue; // the square of the distance between the node and the magnified center\n\n var dist2 = (x - mCenter.x) * (x - mCenter.x) + (y - mCenter.y) * (y - mCenter.y);\n\n if (!isNaN(dist2) && dist2 < r2 && dist2 !== 0) {\n var dist = Math.sqrt(dist2); // (r * (d + 1) * (dist / r)) / (d * (dist / r) + 1);\n\n var magnifiedDist = molecularParam * dist / (d * dist + r);\n var cos = (x - mCenter.x) / dist;\n var sin = (y - mCenter.y) / dist;\n model.x = cos * magnifiedDist + mCenter.x;\n model.y = sin * magnifiedDist + mCenter.y;\n\n if (!cachedOriginPositions[model.id]) {\n cachedOriginPositions[model.id] = {\n x: x,\n y: y,\n texts: []\n };\n }\n\n cachedMagnifiedModels.push(model);\n\n if (showLabel && 2 * dist < r) {\n var node = nodes[i];\n var nodeGroup = node.getContainer();\n var shapes = nodeGroup.getChildren();\n var shapeLength = shapes.length;\n\n for (var j = 0; j < shapeLength; j++) {\n var shape = shapes[j];\n\n if (shape.get('type') === 'text') {\n cachedOriginPositions[model.id].texts.push({\n visible: shape.get('visible'),\n shape: shape\n });\n shape.set('visible', true);\n }\n }\n }\n }\n }\n\n graph.refreshPositions();\n };\n /**\n * Restore the cache nodes while magnifying\n */\n\n\n Fisheye.prototype.restoreCache = function () {\n var self = this;\n var cachedMagnifiedModels = self.get('cachedMagnifiedModels');\n var cachedOriginPositions = self.get('cachedOriginPositions');\n var cacheLength = cachedMagnifiedModels.length;\n\n for (var i = 0; i < cacheLength; i++) {\n var node = cachedMagnifiedModels[i];\n var id = node.id;\n var ori = cachedOriginPositions[id];\n node.x = ori.x;\n node.y = ori.y;\n var textLength = ori.texts.length;\n\n for (var j = 0; j < textLength; j++) {\n var text = ori.texts[j];\n text.shape.set('visible', text.visible);\n }\n }\n\n self.set('cachedMagnifiedModels', []);\n self.set('cachedOriginPositions', {});\n };\n /**\n * Adjust part of the parameters, including trigger, d, r, maxR, minR, maxD, minD, scaleRBy, and scaleDBy\n * @param {FisheyeConfig} cfg\n */\n\n\n Fisheye.prototype.updateParams = function (cfg) {\n var self = this;\n var r = cfg.r,\n d = cfg.d,\n trigger = cfg.trigger,\n minD = cfg.minD,\n maxD = cfg.maxD,\n minR = cfg.minR,\n maxR = cfg.maxR,\n scaleDBy = cfg.scaleDBy,\n scaleRBy = cfg.scaleRBy;\n\n if (!isNaN(cfg.r)) {\n self.set('r', r);\n self.set('r2', r * r);\n }\n\n if (!isNaN(d)) {\n self.set('d', d);\n }\n\n if (!isNaN(maxD)) {\n self.set('maxD', maxD);\n }\n\n if (!isNaN(minD)) {\n self.set('minD', minD);\n }\n\n if (!isNaN(maxR)) {\n self.set('maxR', maxR);\n }\n\n if (!isNaN(minR)) {\n self.set('minR', minR);\n }\n\n var nd = self.get('d');\n var nr = self.get('r');\n self.set('molecularParam', (nd + 1) * nr);\n\n if (trigger === 'mousemove' || trigger === 'click' || trigger === 'drag') {\n self.set('trigger', trigger);\n }\n\n if (scaleDBy === 'drag' || scaleDBy === 'wheel' || scaleDBy === 'unset') {\n self.set('scaleDBy', scaleDBy);\n self.get('delegate').remove();\n self.get('delegate').destroy();\n var dPercentText = self.get('dPercentText');\n\n if (dPercentText) {\n dPercentText.remove();\n dPercentText.destroy();\n }\n }\n\n if (scaleRBy === 'drag' || scaleRBy === 'wheel' || scaleRBy === 'unset') {\n self.set('scaleRBy', scaleRBy);\n self.get('delegate').remove();\n self.get('delegate').destroy();\n var dPercentText = self.get('dPercentText');\n\n if (dPercentText) {\n dPercentText.remove();\n dPercentText.destroy();\n }\n }\n };\n /**\n * Update the delegate shape of the lens\n * @param {Point} mCenter the center of the shape\n * @param {number} r the radius of the shape\n */\n\n\n Fisheye.prototype.updateDelegate = function (mCenter, r) {\n var _this = this;\n\n var self = this;\n var graph = self.get('graph');\n var lensDelegate = self.get('delegate');\n\n if (!lensDelegate || lensDelegate.destroyed) {\n // 拖动多个\n var parent_1 = graph.get('group');\n var attrs = self.get('delegateStyle') || lensDelegateStyle; // model上的x, y是相对于图形中心的, delegateShape是g实例, x,y是绝对坐标\n\n lensDelegate = parent_1.addShape('circle', {\n attrs: __assign({\n r: r / 1.5,\n x: mCenter.x,\n y: mCenter.y\n }, attrs),\n name: 'lens-shape',\n draggable: true\n });\n\n if (this.get('trigger') !== 'drag') {\n // 调整范围 r 的监听\n if (this.get('scaleRBy') === 'wheel') {\n // 使用滚轮调整 r\n lensDelegate.on('mousewheel', function (evt) {\n self.scaleRByWheel(evt);\n });\n } else if (this.get('scaleRBy') === 'drag') {\n // 使用拖拽调整 r\n lensDelegate.on('dragstart', function (e) {\n self.set('dragging', true);\n self.set('cacheCenter', {\n x: e.x,\n y: e.y\n });\n self.set('dragPrePos', {\n x: e.x,\n y: e.y\n });\n });\n lensDelegate.on('drag', function (evt) {\n self.scaleRByDrag(evt);\n });\n lensDelegate.on('dragend', function (e) {\n self.set('dragging', false);\n });\n } // 调整缩放系数 d 的监听\n\n\n if (this.get('scaleDBy') === 'wheel') {\n // 使用滚轮调整 d\n lensDelegate.on('mousewheel', function (evt) {\n _this.scaleDByWheel(evt);\n });\n } else if (this.get('scaleDBy') === 'drag') {\n // 使用拖拽调整 d\n lensDelegate.on('dragstart', function (evt) {\n self.set('dragging', true);\n self.set('cacheCenter', {\n x: evt.x,\n y: evt.y\n });\n self.set('dragPrePos', {\n x: evt.x,\n y: evt.y\n });\n });\n lensDelegate.on('drag', function (evt) {\n _this.scaleDByDrag(evt);\n });\n lensDelegate.on('dragend', function (evt) {\n self.set('dragging', false);\n });\n }\n }\n } else {\n lensDelegate.attr({\n x: mCenter.x,\n y: mCenter.y,\n r: r / 1.5\n });\n } // 绘制缩放系数百分比文本\n\n\n if (self.get('showDPercent')) {\n var percent = Math.round((self.get('d') - self.get('minD')) / (self.get('maxD') - self.get('minD')) * 100);\n var dPercentText = self.get('dPercentText');\n var textY = mCenter.y + r / 1.5 + 16;\n\n if (!dPercentText || dPercentText.destroyed) {\n var parent_2 = graph.get('group');\n dPercentText = parent_2.addShape('text', {\n attrs: {\n text: \"\".concat(percent, \"%\"),\n x: mCenter.x,\n y: textY,\n fill: '#aaa',\n stroke: '#fff',\n lineWidth: 1,\n fontSize: 12\n }\n });\n self.set('dPercentText', dPercentText);\n } else {\n dPercentText.attr({\n text: \"\".concat(percent, \"%\"),\n x: mCenter.x,\n y: textY\n });\n }\n }\n\n self.set('delegate', lensDelegate);\n };\n /**\n * Clear the fisheye lens\n */\n\n\n Fisheye.prototype.clear = function () {\n var graph = this.get('graph');\n this.restoreCache();\n graph.refreshPositions();\n var lensDelegate = this.get('delegate');\n\n if (lensDelegate && !lensDelegate.destroyed) {\n lensDelegate.remove();\n lensDelegate.destroy();\n }\n\n var dPercentText = this.get('dPercentText');\n\n if (dPercentText && !dPercentText.destroyed) {\n dPercentText.remove();\n dPercentText.destroy();\n }\n };\n /**\n * Destroy the component\n */\n\n\n Fisheye.prototype.destroy = function () {\n this.clear();\n };\n\n return Fisheye;\n}(_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Fisheye);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/fisheye/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.forceNBody = void 0;\nvar d3_quadtree_1 = __webpack_require__(/*! d3-quadtree */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js\");\nvar theta2 = 0.81; // Barnes-Hut approximation threshold\nvar epsilon = 0.1; // 为了防止出现除0的情况,加一个epsilon\nfunction forceNBody(nodes, nodeMap, factor, coulombDisScale2, accArray) {\n var weightParam = factor / coulombDisScale2;\n var data = nodes.map(function (n, i) {\n // @ts-ignore\n var mappedNode = nodeMap[n.id];\n // @ts-ignore\n var nodeData = mappedNode.data, x = mappedNode.x, y = mappedNode.y, size = mappedNode.size;\n var nodeStrength = nodeData.layout.force.nodeStrength;\n return {\n x: x,\n y: y,\n size: size,\n index: i,\n vx: 0,\n vy: 0,\n weight: weightParam * nodeStrength,\n };\n });\n var tree = (0, d3_quadtree_1.quadtree)(data, function (d) { return d.x; }, function (d) { return d.y; }).visitAfter(accumulate); // init internal node\n data.forEach(function (n) {\n // @ts-ignore\n computeForce(n, tree);\n });\n data.map(function (n, i) {\n // @ts-ignore\n var mappedNode = nodeMap[nodes[i].id];\n // @ts-ignore\n var _a = mappedNode.data.layout.force.mass, mass = _a === void 0 ? 1 : _a;\n // 从 0 开始,= 初始化 + 加斥力\n accArray[2 * i] = n.vx / mass;\n accArray[2 * i + 1] = n.vy / mass;\n });\n return accArray;\n}\nexports.forceNBody = forceNBody;\n// @ts-ignore\nfunction accumulate(quad) {\n var accWeight = 0;\n var accX = 0;\n var accY = 0;\n if (quad.length) {\n // internal node, accumulate 4 child quads\n for (var i = 0; i < 4; i++) {\n var q = quad[i];\n if (q && q.weight) {\n accWeight += q.weight;\n accX += q.x * q.weight;\n accY += q.y * q.weight;\n }\n }\n quad.x = accX / accWeight;\n quad.y = accY / accWeight;\n quad.weight = accWeight;\n }\n else {\n // leaf node\n var q = quad;\n quad.x = q.data.x;\n quad.y = q.data.y;\n quad.weight = q.data.weight;\n }\n}\n// @ts-ignore\nvar apply = function (quad, x1, y1, x2, y2, node) {\n var dx = (node.x - quad.x) || epsilon;\n var dy = (node.y - quad.y) || epsilon;\n var width = x2 - x1;\n var len2 = dx * dx + dy * dy;\n var len3 = Math.sqrt(len2) * len2;\n // far node, apply Barnes-Hut approximation\n if ((width * width) * theta2 < len2) {\n var param = quad.weight / len3;\n node.vx += dx * param;\n node.vy += dy * param;\n return true;\n }\n // near quad, compute force directly\n if (quad.length)\n return false; // internal node, visit children\n // leaf node\n if (quad.data !== node) {\n var param = quad.data.weight / len3;\n node.vx += dx * param;\n node.vy += dy * param;\n }\n};\n// @ts-ignore\nfunction computeForce(node, tree) {\n // @ts-ignore\n tree.visit(function (quad, x1, y1, x2, y2) { return apply(quad, x1, y1, x2, y2, node); });\n}\n//# sourceMappingURL=ForceNBody.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force2/ForceNBody.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/grid/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/grid/index.js ***! - \*******************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/force2/index.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/force2/index.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n // 网格背景图片\n\nvar GRID_PNG = 'url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0iNDAiIGhlaWdodD0iNDAiIHhtbG5zPSJodHRwOi8vd3d3LnczLm9yZy8yMDAwL3N2ZyI+PGRlZnM+PHBhdHRlcm4gaWQ9ImdyaWQiIHdpZHRoPSI0MCIgaGVpZ2h0PSI0MCIgcGF0dGVyblVuaXRzPSJ1c2VyU3BhY2VPblVzZSI+PHBhdGggZD0iTSAwIDEwIEwgNDAgMTAgTSAxMCAwIEwgMTAgNDAgTSAwIDIwIEwgNDAgMjAgTSAyMCAwIEwgMjAgNDAgTSAwIDMwIEwgNDAgMzAgTSAzMCAwIEwgMzAgNDAiIGZpbGw9Im5vbmUiIHN0cm9rZT0iI2UwZTBlMCIgb3BhY2l0eT0iMC4yIiBzdHJva2Utd2lkdGg9IjEiLz48cGF0aCBkPSJNIDQwIDAgTCAwIDAgMCA0MCIgZmlsbD0ibm9uZSIgc3Ryb2tlPSIjZTBlMGUwIiBzdHJva2Utd2lkdGg9IjEiLz48L3BhdHRlcm4+PC9kZWZzPjxyZWN0IHdpZHRoPSIxMDAlIiBoZWlnaHQ9IjEwMCUiIGZpbGw9InVybCgjZ3JpZCkiLz48L3N2Zz4=)';\n\nvar Grid =\n/** @class */\nfunction (_super) {\n __extends(Grid, _super);\n\n function Grid(config) {\n return _super.call(this, config) || this;\n }\n\n Grid.prototype.getDefaultCfgs = function () {\n return {\n img: GRID_PNG,\n follow: true\n };\n };\n\n Grid.prototype.init = function () {\n var graph = this.get('graph');\n var graphContainer = graph.get('container');\n var canvas = graph.get('canvas').get('el');\n var img = this.get('img') || GRID_PNG;\n\n if (!img.includes('url(')) {\n img = \"url(\\\"\".concat(img, \"\\\")\");\n }\n\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\");\n var gridContainer = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n this.set('container', container);\n this.set('gridContainer', gridContainer);\n this.positionInit();\n container.appendChild(gridContainer);\n graphContainer.insertBefore(container, canvas);\n };\n /** 定位信息初始化 */\n\n\n Grid.prototype.positionInit = function () {\n var graph = this.get('graph');\n var minZoom = graph.get('minZoom');\n var width = graph.get('width');\n var height = graph.get('height');\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.get('container'), {\n width: \"\".concat(width, \"px\"),\n height: \"\".concat(height, \"px\")\n }); // 网格 40*40 需保证 (gridContainerWidth / 2) % 40 = 0 才能让网格线对齐左上角 故 * 80\n\n var gridContainerWidth = width * 80 / minZoom;\n var gridContainerHeight = height * 80 / minZoom;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.get('gridContainer'), {\n width: \"\".concat(gridContainerWidth, \"px\"),\n height: \"\".concat(gridContainerHeight, \"px\"),\n left: \"-\".concat(gridContainerWidth / 2, \"px\"),\n top: \"-\".concat(gridContainerHeight / 2, \"px\")\n });\n }; // class-methods-use-this\n\n\n Grid.prototype.getEvents = function () {\n return {\n viewportchange: 'updateGrid'\n };\n };\n /**\n * viewport change 事件的响应函数\n * @param param\n */\n\n\n Grid.prototype.updateGrid = function (param) {\n var gridContainer = this.get('gridContainer');\n var matrix = param.matrix;\n if (!matrix) matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var isFollow = this.get('follow');\n var transform = \"matrix(\".concat(matrix[0], \", \").concat(matrix[1], \", \").concat(matrix[3], \", \").concat(matrix[4], \", \").concat(isFollow ? matrix[6] : '0', \", \").concat(isFollow ? matrix[7] : '0', \")\");\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(gridContainer, {\n transform: transform\n });\n };\n\n Grid.prototype.getContainer = function () {\n return this.get('container');\n };\n\n Grid.prototype.destroy = function () {\n var graph = this.get('graph');\n var graphContainer = graph.get('container');\n var container = this.get('container');\n graphContainer.removeChild(container);\n };\n\n return Grid;\n}(_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Grid);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/grid/index.js?"); +eval("\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Force2Layout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar ForceNBody_1 = __webpack_require__(/*! ./ForceNBody */ \"./node_modules/@antv/layout/lib/layout/force2/ForceNBody.js\");\nvar proccessToFunc = function (value, defaultV) {\n var func;\n if (!value) {\n func = function (d) {\n return defaultV || 1;\n };\n }\n else if ((0, util_1.isNumber)(value)) {\n func = function (d) {\n return value;\n };\n }\n else {\n func = value;\n }\n return func;\n};\n/**\n * graphin 中的 force 布局\n */\nvar Force2Layout = /** @class */ (function (_super) {\n __extends(Force2Layout, _super);\n function Force2Layout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 是否启动 worker */\n _this.workerEnabled = false;\n /** 弹簧引力系数 */\n _this.edgeStrength = 200;\n /** 斥力系数 */\n _this.nodeStrength = 1000;\n /** 库伦系数 */\n _this.coulombDisScale = 0.005;\n /** 阻尼系数 */\n _this.damping = 0.9;\n /** 最大速度 */\n _this.maxSpeed = 500;\n /** 一次迭代的平均移动距离小于该值时停止迭代 */\n _this.minMovement = 0.4;\n /** 迭代中衰减 */\n _this.interval = 0.02;\n /** 斥力的一个系数 */\n _this.factor = 1;\n /** 理想边长 */\n _this.linkDistance = 200;\n /** 重力大小 */\n _this.gravity = 0;\n /** 节点聚类作用力系数 */\n _this.clusterNodeStrength = 20;\n /** 是否防止重叠 */\n _this.preventOverlap = true;\n /** 阈值的使用条件,mean 代表平均移动距离小于 minMovement 时停止迭代,max 代表最大移动距离大时 minMovement 时停时迭代。默认为 mean */\n _this.distanceThresholdMode = 'mean';\n /** 每次迭代结束的回调函数 */\n _this.tick = function () { };\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n _this.judgingDistance = 0;\n /** 默认的向心配置 */\n _this.centripetalOptions = {\n leaf: 2,\n single: 2,\n others: 1,\n // eslint-disable-next-line\n center: function (n) {\n return {\n x: _this.width / 2,\n y: _this.height / 2,\n };\n },\n };\n var getMass = options.getMass;\n _this.propsGetMass = getMass;\n _this.updateCfg(options);\n return _this;\n }\n Force2Layout.prototype.getCentripetalOptions = function () {\n var _a = this, leafCluster = _a.leafCluster, clustering = _a.clustering, nodeClusterBy = _a.nodeClusterBy, nodes = _a.nodes, nodeMap = _a.nodeMap, propsClusterNodeStrength = _a.clusterNodeStrength;\n var getClusterNodeStrength = function (node) {\n return typeof propsClusterNodeStrength === 'function'\n ? propsClusterNodeStrength(node)\n : propsClusterNodeStrength;\n };\n var centripetalOptions = {};\n var sameTypeLeafMap;\n // 如果传入了需要叶子节点聚类\n if (leafCluster) {\n sameTypeLeafMap = this.getSameTypeLeafMap() || {};\n var relativeNodesType_1 = Array.from(new Set(nodes === null || nodes === void 0 ? void 0 : nodes.map(function (node) { return node[nodeClusterBy]; }))) || [];\n centripetalOptions = {\n single: 100,\n leaf: function (node, nodes, edges) {\n // 找出与它关联的边的起点或终点出发的所有一度节点中同类型的叶子节点\n var _a = sameTypeLeafMap[node.id] || {}, relativeLeafNodes = _a.relativeLeafNodes, sameTypeLeafNodes = _a.sameTypeLeafNodes;\n // 如果都是同一类型或者每种类型只有1个,则施加默认向心力\n if ((sameTypeLeafNodes === null || sameTypeLeafNodes === void 0 ? void 0 : sameTypeLeafNodes.length) === (relativeLeafNodes === null || relativeLeafNodes === void 0 ? void 0 : relativeLeafNodes.length) ||\n (relativeNodesType_1 === null || relativeNodesType_1 === void 0 ? void 0 : relativeNodesType_1.length) === 1) {\n return 1;\n }\n return getClusterNodeStrength(node);\n },\n others: 1,\n center: function (node, nodes, edges) {\n var _a;\n var degree = (((_a = node.data) === null || _a === void 0 ? void 0 : _a.layout) || {}).degree;\n // 孤点默认给1个远离的中心点\n if (!degree) {\n return {\n x: 100,\n y: 100,\n };\n }\n var centerNode;\n if (degree === 1) {\n // 如果为叶子节点\n // 找出与它关联的边的起点出发的所有一度节点中同类型的叶子节点\n var _b = (sameTypeLeafMap[node.id] || {}).sameTypeLeafNodes, sameTypeLeafNodes = _b === void 0 ? [] : _b;\n if (sameTypeLeafNodes.length === 1) {\n // 如果同类型的叶子节点只有1个,中心节点置为undefined\n centerNode = undefined;\n }\n else if (sameTypeLeafNodes.length > 1) {\n // 找出同类型节点平均位置节点的距离最近的节点作为中心节点\n centerNode = (0, util_1.getAvgNodePosition)(sameTypeLeafNodes);\n }\n }\n else {\n centerNode = undefined;\n }\n return {\n x: centerNode === null || centerNode === void 0 ? void 0 : centerNode.x,\n y: centerNode === null || centerNode === void 0 ? void 0 : centerNode.y,\n };\n },\n };\n }\n // 如果传入了全局节点聚类\n if (clustering) {\n if (!sameTypeLeafMap)\n sameTypeLeafMap = this.getSameTypeLeafMap();\n var clusters = Array.from(new Set(nodes.map(function (node, i) {\n return node[nodeClusterBy];\n }))).filter(function (item) { return item !== undefined; });\n var centerNodeInfo_1 = {};\n clusters.forEach(function (cluster) {\n var sameTypeNodes = nodes\n .filter(function (item) { return item[nodeClusterBy] === cluster; })\n .map(function (node) { return nodeMap[node.id]; });\n // 找出同类型节点平均位置节点的距离最近的节点作为中心节点\n centerNodeInfo_1[cluster] = (0, util_1.getAvgNodePosition)(sameTypeNodes);\n });\n centripetalOptions = {\n single: function (node) { return getClusterNodeStrength(node); },\n leaf: function (node) { return getClusterNodeStrength(node); },\n others: function (node) { return getClusterNodeStrength(node); },\n center: function (node, nodes, edges) {\n // 找出同类型节点平均位置节点的距离最近的节点作为中心节点\n var centerNode = centerNodeInfo_1[node[nodeClusterBy]];\n return {\n x: centerNode === null || centerNode === void 0 ? void 0 : centerNode.x,\n y: centerNode === null || centerNode === void 0 ? void 0 : centerNode.y,\n };\n },\n };\n }\n this.centripetalOptions = __assign(__assign({}, this.centripetalOptions), centripetalOptions);\n var _b = this.centripetalOptions, leaf = _b.leaf, single = _b.single, others = _b.others;\n if (leaf && typeof leaf !== 'function')\n this.centripetalOptions.leaf = function () { return leaf; };\n if (single && typeof single !== 'function')\n this.centripetalOptions.single = function () { return single; };\n if (others && typeof others !== 'function')\n this.centripetalOptions.others = function () { return others; };\n };\n Force2Layout.prototype.updateCfg = function (cfg) {\n if (cfg)\n Object.assign(this, cfg);\n };\n Force2Layout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 500,\n gravity: 10,\n enableTick: true,\n animate: true,\n };\n };\n /**\n * 执行布局\n */\n Force2Layout.prototype.execute = function () {\n var self = this;\n self.stop();\n var nodes = self.nodes, edges = self.edges, defSpringLen = self.defSpringLen;\n self.judgingDistance = 0;\n if (!nodes || nodes.length === 0) {\n self.onLayoutEnd([]);\n return;\n }\n if (!self.width && typeof window !== 'undefined') {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== 'undefined') {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n self.onLayoutEnd([__assign({}, nodes[0])]);\n return;\n }\n self.degreesMap = (0, util_1.getDegreeMap)(nodes, edges);\n if (self.propsGetMass) {\n self.getMass = self.propsGetMass;\n }\n else {\n self.getMass = function (d) {\n var massWeight = 1;\n if ((0, util_1.isNumber)(d.mass))\n massWeight = d.mass;\n var degree = self.degreesMap[d.id].all;\n return !degree || degree < 5 ? massWeight : degree * 5 * massWeight;\n };\n }\n // node size function\n var nodeSize = self.nodeSize;\n var nodeSizeFunc;\n if (self.preventOverlap) {\n var nodeSpacing_1 = self.nodeSpacing;\n var nodeSpacingFunc_1;\n if ((0, util_1.isNumber)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = function () { return nodeSpacing_1; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = nodeSpacing_1;\n }\n else {\n nodeSpacingFunc_1 = function () { return 0; };\n }\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return Math.max(d.size[0], d.size[1]) + nodeSpacingFunc_1(d);\n }\n else if ((0, util_1.isObject)(d.size)) {\n return Math.max(d.size.width, d.size.height) + nodeSpacingFunc_1(d);\n }\n return d.size + nodeSpacingFunc_1(d);\n }\n return 10 + nodeSpacingFunc_1(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function (d) {\n return Math.max(nodeSize[0], nodeSize[1]) + nodeSpacingFunc_1(d);\n };\n }\n else {\n nodeSizeFunc = function (d) { return nodeSize + nodeSpacingFunc_1(d); };\n }\n }\n self.nodeSize = nodeSizeFunc;\n self.linkDistance = proccessToFunc(self.linkDistance, 1);\n self.nodeStrength = proccessToFunc(self.nodeStrength, 1);\n self.edgeStrength = proccessToFunc(self.edgeStrength, 1);\n var nodeMap = {};\n var nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * self.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * self.height;\n var degree = self.degreesMap[node.id];\n nodeMap[node.id] = __assign(__assign({}, node), { data: __assign(__assign({}, node.data), { size: self.nodeSize(node) || 30, layout: {\n inDegree: degree.in,\n outDegree: degree.out,\n degree: degree.all,\n tDegree: degree.in,\n sDegree: degree.out,\n force: {\n mass: self.getMass(node),\n nodeStrength: self.nodeStrength(node, edges),\n },\n } }) });\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n self.edgeInfos = [];\n edges === null || edges === void 0 ? void 0 : edges.forEach(function (edge) {\n var sourceNode = nodeMap[edge.source];\n var targetNode = nodeMap[edge.target];\n if (!sourceNode || !targetNode) {\n elf.edgeInfos.push({});\n }\n else {\n self.edgeInfos.push({\n edgeStrength: self.edgeStrength(edge),\n linkDistance: defSpringLen\n ? defSpringLen(__assign(__assign({}, edge), { source: sourceNode, target: targetNode }), sourceNode, targetNode)\n : self.linkDistance(edge, sourceNode, targetNode) ||\n 1 + (nodeSize(sourceNode) + nodeSize(sourceNode) || 0) / 2,\n });\n }\n });\n this.getCentripetalOptions();\n self.onLayoutEnd = self.onLayoutEnd || (function () { });\n self.run();\n };\n Force2Layout.prototype.run = function () {\n var self = this;\n var maxIteration = self.maxIteration, nodes = self.nodes, edges = self.edges, workerEnabled = self.workerEnabled, minMovement = self.minMovement, animate = self.animate, nodeMap = self.nodeMap, height = self.height;\n self.currentMinY = 0;\n self.currentMaxY = height;\n if (!nodes)\n return;\n var velArray = [];\n nodes.forEach(function (_, i) {\n velArray[2 * i] = 0;\n velArray[2 * i + 1] = 0;\n });\n if (this.defSideCoe && typeof this.defSideCoe === 'function') {\n var relatedEdges_1 = {};\n edges.forEach(function (edge) {\n var source = edge.source, target = edge.target;\n relatedEdges_1[source] = relatedEdges_1[source] || [];\n relatedEdges_1[source].push(edge);\n relatedEdges_1[target] = relatedEdges_1[target] || [];\n relatedEdges_1[target].push(edge);\n });\n this.relatedEdges = relatedEdges_1;\n }\n var maxIter = maxIteration;\n var silence = !animate;\n if (workerEnabled || silence) {\n var usedIter = 0;\n for (var i = 0; (self.judgingDistance > minMovement || i < 1) && i < maxIter; i++) {\n usedIter = i;\n self.runOneStep(i, velArray);\n }\n self.onLayoutEnd(Object.values(nodeMap));\n }\n else {\n if (typeof window === 'undefined')\n return;\n var iter_1 = 0;\n // interval for render the result after each iteration\n this.timeInterval = window.setInterval(function () {\n if (!nodes)\n return;\n self.runOneStep(iter_1, velArray);\n iter_1++;\n if (iter_1 >= maxIter || self.judgingDistance < minMovement) {\n self.onLayoutEnd(Object.values(nodeMap));\n window.clearInterval(self.timeInterval);\n }\n }, 0);\n }\n };\n Force2Layout.prototype.runOneStep = function (iter, velArray) {\n var _a;\n var self = this;\n var nodes = self.nodes, edges = self.edges, nodeMap = self.nodeMap, monitor = self.monitor;\n var accArray = [];\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return;\n self.calRepulsive(accArray);\n if (edges)\n self.calAttractive(accArray);\n self.calGravity(accArray);\n self.attractToSide(accArray);\n var stepInterval = self.interval; // Math.max(0.02, self.interval - iter * 0.002);\n self.updateVelocity(accArray, velArray, stepInterval);\n self.updatePosition(velArray, stepInterval);\n (_a = self.tick) === null || _a === void 0 ? void 0 : _a.call(self);\n /** 如果需要监控信息,则提供给用户 */\n if (monitor) {\n var energy = this.calTotalEnergy(accArray);\n monitor({ energy: energy, nodes: nodes, edges: edges, iterations: iter });\n }\n };\n Force2Layout.prototype.calTotalEnergy = function (accArray) {\n var _a = this, nodes = _a.nodes, nodeMap = _a.nodeMap;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return 0;\n var energy = 0.0;\n nodes.forEach(function (node, i) {\n var vx = accArray[2 * i];\n var vy = accArray[2 * i + 1];\n var speed2 = vx * vx + vy * vy;\n var _a = nodeMap[node.id].data.layout.force.mass, mass = _a === void 0 ? 1 : _a;\n energy += mass * speed2 * 0.5; // p = 1/2*(mv^2)\n });\n return energy;\n };\n // coulombs law\n Force2Layout.prototype.calRepulsive = function (accArray) {\n var self = this;\n var nodes = self.nodes, nodeMap = self.nodeMap, factor = self.factor, coulombDisScale = self.coulombDisScale;\n var nodeSize = self.nodeSize;\n (0, ForceNBody_1.forceNBody)(nodes, nodeMap, factor, coulombDisScale * coulombDisScale, accArray);\n };\n // hooks law\n Force2Layout.prototype.calAttractive = function (accArray) {\n var self = this;\n var edges = self.edges, nodeMap = self.nodeMap, nodeIdxMap = self.nodeIdxMap, edgeInfos = self.edgeInfos;\n var nodeSize = self.nodeSize;\n edges.forEach(function (edge, i) {\n var source = (0, util_1.getEdgeTerminal)(edge, 'source');\n var target = (0, util_1.getEdgeTerminal)(edge, 'target');\n var sourceNode = nodeMap[source];\n var targetNode = nodeMap[target];\n if (!sourceNode || !targetNode)\n return;\n var vecX = targetNode.x - sourceNode.x;\n var vecY = targetNode.y - sourceNode.y;\n if (!vecX && !vecY) {\n vecX = Math.random() * 0.01;\n vecY = Math.random() * 0.01;\n }\n var vecLength = Math.sqrt(vecX * vecX + vecY * vecY);\n var direX = vecX / vecLength;\n var direY = vecY / vecLength;\n // @ts-ignore\n var _a = edgeInfos[i] || {}, _b = _a.linkDistance, linkDistance = _b === void 0 ? 200 : _b, _c = _a.edgeStrength, edgeStrength = _c === void 0 ? 200 : _c;\n var diff = linkDistance - vecLength;\n var param = diff * edgeStrength;\n var massSource = sourceNode.data.layout.force.mass || 1;\n var massTarget = targetNode.data.layout.force.mass || 1;\n // 质量占比越大,对另一端影响程度越大\n var sourceMassRatio = 1 / massSource;\n var targetMassRatio = 1 / massTarget;\n var disX = direX * param;\n var disY = direY * param;\n var sourceIdx = 2 * nodeIdxMap[source];\n var targetIdx = 2 * nodeIdxMap[target];\n accArray[sourceIdx] -= disX * sourceMassRatio;\n accArray[sourceIdx + 1] -= disY * sourceMassRatio;\n accArray[targetIdx] += disX * targetMassRatio;\n accArray[targetIdx + 1] += disY * targetMassRatio;\n });\n };\n // attract to center\n Force2Layout.prototype.calGravity = function (accArray) {\n var _a;\n var self = this;\n var nodes = self.nodes, _b = self.edges, edges = _b === void 0 ? [] : _b, nodeMap = self.nodeMap, width = self.width, height = self.height, center = self.center, defaultGravity = self.gravity, degreesMap = self.degreesMap, centripetalOptions = self.centripetalOptions;\n if (!nodes)\n return;\n var nodeLength = nodes.length;\n for (var i = 0; i < nodeLength; i++) {\n var idx = 2 * i;\n var node = nodeMap[nodes[i].id];\n var _c = node.data.layout.force.mass, mass = _c === void 0 ? 1 : _c;\n var vecX = 0;\n var vecY = 0;\n var gravity = defaultGravity;\n var _d = degreesMap[node.id], inDegree = _d.in, outDegree = _d.out, degree = _d.all;\n var forceCenter = (_a = self.getCenter) === null || _a === void 0 ? void 0 : _a.call(self, node, degree);\n if (forceCenter) {\n var centerX = forceCenter[0], centerY = forceCenter[1], strength = forceCenter[2];\n vecX = node.x - centerX;\n vecY = node.y - centerY;\n gravity = strength;\n }\n else {\n vecX = node.x - center[0];\n vecY = node.y - center[1];\n }\n if (gravity) {\n accArray[idx] -= (gravity * vecX) / mass;\n accArray[idx + 1] -= (gravity * vecY) / mass;\n }\n if (centripetalOptions) {\n var leaf = centripetalOptions.leaf, single = centripetalOptions.single, others = centripetalOptions.others, centriCenter = centripetalOptions.center;\n var _e = (centriCenter === null || centriCenter === void 0 ? void 0 : centriCenter(node, nodes, edges, width, height)) || {\n x: 0,\n y: 0,\n centerStrength: 0,\n }, centriX = _e.x, centriY = _e.y, centerStrength = _e.centerStrength;\n if (!(0, util_1.isNumber)(centriX) || !(0, util_1.isNumber)(centriY))\n continue;\n var vx = (node.x - centriX) / mass;\n var vy = (node.y - centriY) / mass;\n if (centerStrength) {\n accArray[idx] -= centerStrength * vx;\n accArray[idx + 1] -= centerStrength * vy;\n }\n // 孤点\n if (degree === 0) {\n var singleStrength = single(node);\n if (!singleStrength)\n continue;\n accArray[idx] -= singleStrength * vx;\n accArray[idx + 1] -= singleStrength * vy;\n continue;\n }\n // 没有出度或没有入度,都认为是叶子节点\n if (inDegree === 0 || outDegree === 0) {\n var leafStrength = leaf(node, nodes, edges);\n if (!leafStrength)\n continue;\n accArray[idx] -= leafStrength * vx;\n accArray[idx + 1] -= leafStrength * vy;\n continue;\n }\n /** others */\n var othersStrength = others(node);\n if (!othersStrength)\n continue;\n accArray[idx] -= othersStrength * vx;\n accArray[idx + 1] -= othersStrength * vy;\n }\n }\n };\n /**\n * Attract forces to the top and bottom.\n * @param accArray\n * @returns\n */\n Force2Layout.prototype.attractToSide = function (accArray) {\n var _a = this, defSideCoe = _a.defSideCoe, height = _a.height, nodes = _a.nodes, relatedEdges = _a.relatedEdges, _b = _a.currentMinY, currentMinY = _b === void 0 ? 0 : _b, _c = _a.currentMaxY, currentMaxY = _c === void 0 ? this.height : _c;\n if (!defSideCoe || typeof defSideCoe !== 'function' || !(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return;\n nodes.forEach(function (node, i) {\n var sideCoe = defSideCoe(node, relatedEdges[node.id] || []);\n if (sideCoe === 0)\n return;\n var targetY = sideCoe < 0 ? currentMinY : currentMaxY;\n var strength = Math.abs(sideCoe);\n accArray[2 * i + 1] -= strength * (node.y - targetY);\n });\n };\n Force2Layout.prototype.updateVelocity = function (accArray, velArray, stepInterval) {\n var self = this;\n var nodes = self.nodes, damping = self.damping, maxSpeed = self.maxSpeed;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return;\n nodes.forEach(function (_, i) {\n var vx = (velArray[2 * i] + accArray[2 * i] * stepInterval) * damping || 0.01;\n var vy = (velArray[2 * i + 1] + accArray[2 * i + 1] * stepInterval) * damping ||\n 0.01;\n var vLength = Math.sqrt(vx * vx + vy * vy);\n if (vLength > maxSpeed) {\n var param2 = maxSpeed / vLength;\n vx = param2 * vx;\n vy = param2 * vy;\n }\n velArray[2 * i] = vx;\n velArray[2 * i + 1] = vy;\n });\n };\n Force2Layout.prototype.updatePosition = function (velArray, stepInterval) {\n var self = this;\n var nodes = self.nodes, distanceThresholdMode = self.distanceThresholdMode, nodeMap = self.nodeMap;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length)) {\n this.judgingDistance = 0;\n return;\n }\n var sum = 0;\n if (distanceThresholdMode === 'max')\n self.judgingDistance = -Infinity;\n else if (distanceThresholdMode === 'min')\n self.judgingDistance = Infinity;\n var currentMinY = Infinity;\n var currentMaxY = -Infinity;\n nodes.forEach(function (node, i) {\n var mappedNode = nodeMap[node.id];\n if ((0, util_1.isNumber)(node.fx) && (0, util_1.isNumber)(node.fy)) {\n node.x = node.fx;\n node.y = node.fy;\n mappedNode.x = node.x;\n mappedNode.y = node.y;\n return;\n }\n var distX = velArray[2 * i] * stepInterval;\n var distY = velArray[2 * i + 1] * stepInterval;\n node.x += distX;\n node.y += distY;\n mappedNode.x = node.x;\n mappedNode.y = node.y;\n if (node.y < currentMinY)\n currentMinY = node.y;\n if (node.y > currentMaxY)\n currentMaxY = node.y;\n var distanceMagnitude = Math.sqrt(distX * distX + distY * distY);\n switch (distanceThresholdMode) {\n case 'max':\n if (self.judgingDistance < distanceMagnitude)\n self.judgingDistance = distanceMagnitude;\n break;\n case 'min':\n if (self.judgingDistance > distanceMagnitude)\n self.judgingDistance = distanceMagnitude;\n break;\n default:\n sum = sum + distanceMagnitude;\n break;\n }\n });\n this.currentMinY = currentMinY;\n this.currentMaxY = currentMaxY;\n if (!distanceThresholdMode || distanceThresholdMode === 'mean')\n self.judgingDistance = sum / nodes.length;\n };\n Force2Layout.prototype.stop = function () {\n if (this.timeInterval && typeof window !== 'undefined') {\n window.clearInterval(this.timeInterval);\n }\n };\n Force2Layout.prototype.destroy = function () {\n var self = this;\n self.stop();\n self.tick = null;\n self.nodes = null;\n self.edges = null;\n self.destroyed = true;\n };\n Force2Layout.prototype.getType = function () {\n return 'force2';\n };\n Force2Layout.prototype.getSameTypeLeafMap = function () {\n var _a = this, nodeClusterBy = _a.nodeClusterBy, nodes = _a.nodes, edges = _a.edges, nodeMap = _a.nodeMap, degreesMap = _a.degreesMap;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return;\n // eslint-disable-next-line\n var sameTypeLeafMap = {};\n nodes.forEach(function (node, i) {\n var degree = degreesMap[node.id].all;\n if (degree === 1) {\n sameTypeLeafMap[node.id] = (0, util_1.getCoreNodeAndRelativeLeafNodes)('leaf', node, edges, nodeClusterBy, degreesMap, nodeMap);\n }\n });\n return sameTypeLeafMap;\n };\n return Force2Layout;\n}(base_1.Base));\nexports.Force2Layout = Force2Layout;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force2/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/imageMinimap/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/imageMinimap/index.js ***! - \***************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/forceAtlas2/body.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/forceAtlas2/body.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\n\n\nvar applyMatrix = _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].applyMatrix;\n\nfunction getImgNaturalDimension(img, callback) {\n var nWidth, nHeight;\n\n if (img.naturalWidth) {\n // 现代浏览器\n nWidth = img.naturalWidth;\n nHeight = img.naturalHeight;\n } else {\n // IE6/7/8\n var image_1 = new Image();\n image_1.src = img.src;\n\n image_1.onload = function () {\n if (callback) callback(image_1.width, image_1.height);\n };\n }\n\n return [nWidth, nHeight];\n}\n\nvar ImageMiniMap =\n/** @class */\nfunction (_super) {\n __extends(ImageMiniMap, _super);\n\n function ImageMiniMap(config) {\n return _super.call(this, config) || this;\n }\n\n ImageMiniMap.prototype.getDefaultCfgs = function () {\n return {\n container: null,\n className: 'g6-minimap',\n viewportClassName: 'g6-minimap-viewport',\n width: 200,\n delegateStyle: {\n fill: '#40a9ff',\n stroke: '#096dd9'\n },\n refresh: true\n };\n };\n\n ImageMiniMap.prototype.getEvents = function () {\n return {\n beforepaint: 'updateViewport',\n beforeanimate: 'disableRefresh',\n afteranimate: 'enableRefresh',\n viewportchange: 'disableOneRefresh'\n };\n }; // 若是正在进行动画,不刷新缩略图\n\n\n ImageMiniMap.prototype.disableRefresh = function () {\n this.set('refresh', false);\n };\n\n ImageMiniMap.prototype.enableRefresh = function () {\n this.set('refresh', true);\n this.updateCanvas();\n };\n\n ImageMiniMap.prototype.disableOneRefresh = function () {\n this.set('viewportChange', true);\n };\n\n ImageMiniMap.prototype.initViewport = function () {\n var _this = this;\n\n var cfgs = this._cfgs; // cWidth and cHeight are the width and height of the minimap's container\n\n var graph = cfgs.graph;\n if (this.destroyed) return;\n var containerDOM = this.get('container');\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(containerDOM)) {\n containerDOM = document.getElementById(containerDOM);\n }\n\n var viewport = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\")); // 计算拖拽水平方向距离\n\n var x = 0; // 计算拖拽垂直方向距离\n\n var y = 0; // 是否在拖拽minimap的视口\n\n var dragging = false; // 缓存viewport当前对于画布的x\n\n var left = 0; // 缓存viewport当前对于画布的y\n\n var top = 0; // 缓存viewport当前宽度\n\n var width = 0; // 缓存viewport当前高度\n\n var height = 0;\n var ratio = 0;\n var zoom = 0;\n containerDOM.addEventListener('mousedown', function (e) {\n cfgs.refresh = false;\n\n if (e.target !== viewport) {\n return;\n } // 如果视口已经最大了,不需要拖拽\n\n\n var style = viewport.style;\n width = parseInt(style.width, 10);\n height = parseInt(style.height, 10);\n\n var cWidth = _this.get('width');\n\n var cHeight = _this.get('height');\n\n if (width > cWidth || height > cHeight) {\n return;\n }\n\n zoom = graph.getZoom();\n ratio = _this.get('ratio');\n dragging = true;\n x = e.clientX;\n y = e.clientY;\n }, false);\n containerDOM.addEventListener('mousemove', function (e) {\n if (!dragging || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(e.clientX) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(e.clientY)) {\n return;\n }\n\n var cWidth = _this.get('width');\n\n var cHeight = _this.get('height');\n\n var style = viewport.style;\n left = parseInt(style.left, 10);\n top = parseInt(style.top, 10);\n width = parseInt(style.width, 10);\n height = parseInt(style.height, 10);\n var dx = x - e.clientX;\n var dy = y - e.clientY; // 若视口移动到最左边或最右边了,仅移动到边界\n\n if (left - dx < 0) {\n dx = left;\n } else if (left - dx + width >= cWidth) {\n dx = 0;\n } // 若视口移动到最上或最下边了,仅移动到边界\n\n\n if (top - dy < 0) {\n dy = top;\n } else if (top - dy + height >= cHeight) {\n dy = 0;\n }\n\n left -= dx;\n top -= dy; // 先移动视口,避免移动到边上以后出现视口闪烁\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(viewport, {\n left: \"\".concat(left, \"px\"),\n top: \"\".concat(top, \"px\")\n }); // graph 移动需要偏移量 dx/dy * 缩放比例才会得到正确的移动距离\n\n graph.translate(dx * zoom / ratio, dy * zoom / ratio);\n x = e.clientX;\n y = e.clientY;\n }, false);\n containerDOM.addEventListener('mouseleave', function () {\n dragging = false;\n cfgs.refresh = true;\n }, false);\n containerDOM.addEventListener('mouseup', function () {\n dragging = false;\n cfgs.refresh = true;\n }, false);\n this.set('viewport', viewport);\n containerDOM.appendChild(viewport);\n };\n /**\n * 更新 viewport 视图\n */\n\n\n ImageMiniMap.prototype.updateViewport = function () {\n if (this.destroyed) return;\n var ratio = this.get('ratio');\n var cWidth = this.get('width');\n var cHeight = this.get('height');\n var graph = this.get('graph');\n var graphWidth = graph.get('width');\n var graphHeight = graph.get('height');\n var aspectRatio = graphWidth / graphHeight;\n var graphGroup = graph.getGroup(); // 主图的 bbox(矩阵变换相关的 bbox)\n\n var graphCanvasBBox = graphGroup.getCanvasBBox(); // 扩展 graphBBox 到和 graphWidth / graphHeight 等比\n\n var graphCanvasBBoxMean = [(graphCanvasBBox.minX + graphCanvasBBox.maxX) / 2, (graphCanvasBBox.minY + graphCanvasBBox.maxY) / 2];\n var graphCanvasBBoxSize = [graphCanvasBBox.maxX - graphCanvasBBox.minX, graphCanvasBBox.maxY - graphCanvasBBox.minY];\n var expandedGraphCanvasBBox = {\n centerX: graphCanvasBBoxMean[0],\n centerY: graphCanvasBBoxMean[1],\n width: 0,\n height: 0,\n minX: 0,\n minY: 0\n };\n\n if (graphCanvasBBox[0] / graphCanvasBBox[1] > aspectRatio) {\n expandedGraphCanvasBBox.width = graphCanvasBBoxSize[0];\n expandedGraphCanvasBBox.height = expandedGraphCanvasBBox.width / aspectRatio;\n } else {\n expandedGraphCanvasBBox.height = graphCanvasBBoxSize[1];\n expandedGraphCanvasBBox.width = expandedGraphCanvasBBox.height * aspectRatio;\n }\n\n expandedGraphCanvasBBox.minX = graphCanvasBBoxMean[0] - expandedGraphCanvasBBox.width / 2;\n expandedGraphCanvasBBox.minY = graphCanvasBBoxMean[1] - expandedGraphCanvasBBox.height / 2;\n var graphMatrix = graphGroup.getMatrix();\n if (!graphMatrix) graphMatrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var invertGraphMatrix = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__[\"mat3\"].invert([1, 0, 0, 0, 1, 0, 0, 0, 1], graphMatrix);\n var minXY = applyMatrix({\n x: expandedGraphCanvasBBox.minX,\n y: expandedGraphCanvasBBox.minY\n }, invertGraphMatrix); // 扩展 graphBBox 后的 bbox 的左上角对应的 canvas container 坐标\n\n var topLeft = graph.getCanvasByPoint(minXY.x, minXY.y);\n var viewport = this.get('viewport');\n\n if (!viewport) {\n this.initViewport();\n } // Viewport 与 minimap container 的比例 = Graph container 与 expandedGraphBBox 比例\n\n\n var vpToMc = graphWidth / expandedGraphCanvasBBox.width; // viewport 宽高 = vpToMc * minimap container 宽高\n\n var width = vpToMc * cWidth;\n var height = vpToMc * cHeight; // vierport 左上角到 minimap container 的距离 / minimap container 宽高\n // = 主图 expandedBBox 左上角 canvas container 坐标距离 / expandedBBox 宽高\n\n var left = cWidth * -topLeft.x / expandedGraphCanvasBBox.width;\n var top = cHeight * -topLeft.y / expandedGraphCanvasBBox.height;\n var right = left + width;\n var bottom = top + height;\n\n if (left < 0) {\n width += left;\n left = 0;\n }\n\n if (right > cWidth) {\n width = width - (right - cWidth);\n }\n\n if (top < 0) {\n height += top;\n top = 0;\n }\n\n if (bottom > cHeight) {\n height = height - (bottom - cHeight);\n } // 缓存目前缩放比,在移动 minimap 视窗时就不用再计算大图的移动量\n\n\n this.set('ratio', ratio);\n var correctLeft = \"\".concat(left, \"px\");\n var correctTop = \"\".concat(top, \"px\");\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(viewport, {\n left: correctLeft,\n top: correctTop,\n width: \"\".concat(width, \"px\"),\n height: \"\".concat(height, \"px\")\n });\n };\n\n ImageMiniMap.prototype.init = function () {\n this.initContainer();\n };\n /**\n * 初始化 Minimap 的容器\n */\n\n\n ImageMiniMap.prototype.initContainer = function () {\n var self = this;\n var graph = self.get('graph');\n var graphWidth = graph.get('width');\n var graphHeight = graph.get('height');\n var aspectRatio = graphHeight / graphWidth;\n var className = self.get('className');\n var parentNode = self.get('container'); // size of the minimap's container\n\n var cWidth = self.get('width');\n var cHeight = self.get('height');\n\n if (!cWidth && !cHeight) {\n cWidth = 200;\n }\n\n if (cWidth) {\n cHeight = aspectRatio * cWidth;\n self.set('height', cHeight);\n } else {\n cWidth = 1 / aspectRatio * cHeight;\n self.set('width', cWidth);\n }\n\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\"));\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(parentNode)) {\n parentNode = document.getElementById(parentNode);\n }\n\n if (parentNode) {\n parentNode.appendChild(container);\n } else {\n graph.get('container').appendChild(container);\n }\n\n self.set('container', container);\n var containerDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\");\n container.appendChild(containerDOM);\n var span = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"\");\n containerDOM.appendChild(span);\n self.set('containerDOM', containerDOM);\n self.set('containerSpan', span);\n var img = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"\\\"\\\"\"));\n self.set('imgDOM', img);\n self.updateImgSize();\n span.appendChild(img);\n self.updateCanvas();\n };\n\n ImageMiniMap.prototype.updateImgSize = function () {\n var self = this;\n var imgDOM = self.get('imgDOM');\n var cWidth = self.get('width');\n var cHeight = self.get('height');\n\n imgDOM.onload = function () {\n var naturalSize = getImgNaturalDimension(imgDOM);\n\n if (naturalSize[0] > naturalSize[1]) {\n imgDOM.width = cWidth;\n } else {\n imgDOM.height = cHeight;\n }\n };\n };\n\n ImageMiniMap.prototype.updateCanvas = function () {\n // 如果是在动画,则不刷新视图\n var isRefresh = this.get('refresh');\n\n if (!isRefresh) {\n return;\n }\n\n var graph = this.get('graph');\n\n if (graph.get('destroyed')) {\n return;\n } // 如果是视口变换,也不刷新视图,但是需要重置视口大小和位置\n\n\n if (this.get('viewportChange')) {\n this.set('viewportChange', false);\n this.updateViewport();\n }\n\n var cWidth = this.get('width');\n var graphBBox = graph.get('canvas').getCanvasBBox();\n var width = graphBBox.width;\n var ratio = cWidth / width; // // 更新minimap视口\n\n this.set('ratio', ratio);\n this.updateViewport();\n };\n /**\n * 获取minimap的窗口\n * @return {HTMLElement} 窗口的dom实例\n */\n\n\n ImageMiniMap.prototype.getViewport = function () {\n return this.get('viewport');\n };\n /**\n * 获取minimap的容器dom\n * @return {HTMLElement} dom\n */\n\n\n ImageMiniMap.prototype.getContainer = function () {\n return this.get('container');\n };\n\n ImageMiniMap.prototype.updateGraphImg = function (img) {\n var self = this;\n var oriImgDOM = self.get('imgDOM');\n oriImgDOM.remove();\n self.set('graphImg', img);\n var imgDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"\\\"\\\"\"));\n self.set('imgDOM', imgDOM);\n imgDOM.src = img;\n self.updateImgSize();\n var span = self.get('containerSpan');\n span.appendChild(imgDOM);\n self.updateCanvas();\n };\n\n ImageMiniMap.prototype.destroy = function () {\n var container = this.get('container');\n container.parentNode.removeChild(container);\n };\n\n return ImageMiniMap;\n}(_base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ImageMiniMap);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/imageMinimap/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// represents a body(a point mass) and its position\nvar Body = /** @class */ (function () {\n function Body(params) {\n /**\n * the id of this body, the same with the node id\n * @type {number}\n */\n this.id = params.id || 0;\n /**\n * the position of this body\n * @type {number}\n */\n this.rx = params.rx;\n /**\n * the position of this body\n * @type {number}\n */\n this.ry = params.ry;\n /**\n * the force acting on this body\n * @type {number}\n */\n this.fx = 0;\n /**\n * the force acting on this body\n * @type {number}\n */\n this.fy = 0;\n /**\n * the mass of this body, =1 for a node\n * @type {number}\n */\n this.mass = params.mass;\n /**\n * the degree of the node represented by this body\n * @type {number}\n */\n this.degree = params.degree;\n /**\n * the parameter for repulsive force, = kr\n * @type {number}\n */\n this.g = params.g || 0;\n }\n // returns the euclidean distance\n Body.prototype.distanceTo = function (bo) {\n var dx = this.rx - bo.rx;\n var dy = this.ry - bo.ry;\n return Math.hypot(dx, dy);\n };\n Body.prototype.setPos = function (x, y) {\n this.rx = x;\n this.ry = y;\n };\n // resets the forces\n Body.prototype.resetForce = function () {\n this.fx = 0;\n this.fy = 0;\n };\n Body.prototype.addForce = function (b) {\n var dx = b.rx - this.rx;\n var dy = b.ry - this.ry;\n var dist = Math.hypot(dx, dy);\n dist = dist < 0.0001 ? 0.0001 : dist;\n // the repulsive defined by force atlas 2\n var F = (this.g * (this.degree + 1) * (b.degree + 1)) / dist;\n this.fx += F * dx / dist;\n this.fy += F * dy / dist;\n };\n // if quad contains this body\n Body.prototype.in = function (quad) {\n return quad.contains(this.rx, this.ry);\n };\n // returns a new body\n Body.prototype.add = function (bo) {\n var nenwMass = this.mass + bo.mass;\n var x = (this.rx * this.mass + bo.rx * bo.mass) / nenwMass;\n var y = (this.ry * this.mass + bo.ry * bo.mass) / nenwMass;\n var dg = this.degree + bo.degree;\n var params = {\n rx: x,\n ry: y,\n mass: nenwMass,\n degree: dg\n };\n return new Body(params);\n };\n return Body;\n}());\nexports.default = Body;\n//# sourceMappingURL=body.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/forceAtlas2/body.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/index.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/index.js ***! - \**************************************************/ -/*! exports provided: PluginBase, Menu, Grid, Minimap, Bundling, ToolBar, Tooltip, Fisheye, TimeBar, ImageMinimap, EdgeFilterLens, SnapLine, Legend, Annotation, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js ***! + \*******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _grid__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./grid */ \"./node_modules/@antv/g6-plugin/es/grid/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Grid\", function() { return _grid__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _menu__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./menu */ \"./node_modules/@antv/g6-plugin/es/menu/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return _menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _minimap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./minimap */ \"./node_modules/@antv/g6-plugin/es/minimap/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Minimap\", function() { return _minimap__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _bundling__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./bundling */ \"./node_modules/@antv/g6-plugin/es/bundling/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Bundling\", function() { return _bundling__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _fisheye__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./fisheye */ \"./node_modules/@antv/g6-plugin/es/fisheye/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Fisheye\", function() { return _fisheye__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _toolBar__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./toolBar */ \"./node_modules/@antv/g6-plugin/es/toolBar/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ToolBar\", function() { return _toolBar__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _tooltip__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./tooltip */ \"./node_modules/@antv/g6-plugin/es/tooltip/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tooltip\", function() { return _tooltip__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _timeBar__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./timeBar */ \"./node_modules/@antv/g6-plugin/es/timeBar/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TimeBar\", function() { return _timeBar__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _imageMinimap__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./imageMinimap */ \"./node_modules/@antv/g6-plugin/es/imageMinimap/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ImageMinimap\", function() { return _imageMinimap__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _edgeFilterLens__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./edgeFilterLens */ \"./node_modules/@antv/g6-plugin/es/edgeFilterLens/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EdgeFilterLens\", function() { return _edgeFilterLens__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _snapline__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./snapline */ \"./node_modules/@antv/g6-plugin/es/snapline/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SnapLine\", function() { return _snapline__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"PluginBase\", function() { return _base__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _legend__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./legend */ \"./node_modules/@antv/g6-plugin/es/legend/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Legend\", function() { return _legend__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _annotation__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./annotation */ \"./node_modules/@antv/g6-plugin/es/annotation/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Annotation\", function() { return _annotation__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\nvar Plugin = {\n PluginBase: _base__WEBPACK_IMPORTED_MODULE_11__[\"default\"],\n Menu: _menu__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n Grid: _grid__WEBPACK_IMPORTED_MODULE_0__[\"default\"],\n Minimap: _minimap__WEBPACK_IMPORTED_MODULE_2__[\"default\"],\n Bundling: _bundling__WEBPACK_IMPORTED_MODULE_3__[\"default\"],\n ToolBar: _toolBar__WEBPACK_IMPORTED_MODULE_5__[\"default\"],\n Tooltip: _tooltip__WEBPACK_IMPORTED_MODULE_6__[\"default\"],\n Fisheye: _fisheye__WEBPACK_IMPORTED_MODULE_4__[\"default\"],\n TimeBar: _timeBar__WEBPACK_IMPORTED_MODULE_7__[\"default\"],\n ImageMinimap: _imageMinimap__WEBPACK_IMPORTED_MODULE_8__[\"default\"],\n EdgeFilterLens: _edgeFilterLens__WEBPACK_IMPORTED_MODULE_9__[\"default\"],\n SnapLine: _snapline__WEBPACK_IMPORTED_MODULE_10__[\"default\"],\n Legend: _legend__WEBPACK_IMPORTED_MODULE_12__[\"default\"],\n Annotation: _annotation__WEBPACK_IMPORTED_MODULE_13__[\"default\"]\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (Plugin);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/index.js?"); +eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ForceAtlas2Layout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar body_1 = __importDefault(__webpack_require__(/*! ./body */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/body.js\"));\nvar quad_1 = __importDefault(__webpack_require__(/*! ./quad */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/quad.js\"));\nvar quadTree_1 = __importDefault(__webpack_require__(/*! ./quadTree */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/quadTree.js\"));\nvar ForceAtlas2Layout = /** @class */ (function (_super) {\n __extends(ForceAtlas2Layout, _super);\n function ForceAtlas2Layout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 宽度 */\n _this.width = 300;\n /** 高度 */\n _this.height = 300;\n _this.nodes = [];\n _this.edges = [];\n /**\n * the parameter for repulsive forces,\n * it will scale the layout but won't change the layout\n * larger the kr, looser the layout\n * @type {number}\n */\n _this.kr = 5;\n /**\n * the parameter for gravity forces\n * @type {number}\n */\n _this.kg = 1;\n /**\n * modes:\n * 'normal' for normal using\n * 'linlog' for compact clusters.\n * @type {string}\n */\n _this.mode = 'normal';\n /**\n * whether preventing the node overlapping\n * @type {boolean}\n */\n _this.preventOverlap = false;\n /**\n * whether active the dissuade hub mode\n * true: grant authorities (nodes with a high indegree)\n * a more central position than hubs (nodes with a high outdegree)\n * @type {boolean}\n */\n _this.dissuadeHubs = false;\n /**\n * whether active the barnes hut optimization on computing repulsive forces\n * @type {boolean}\n */\n _this.barnesHut = undefined;\n /**\n * the max iteration number\n * @type {number}\n */\n _this.maxIteration = 0;\n /**\n * control the global velocity\n * defualt: 0.1(gephi)\n * @type {number}\n */\n _this.ks = 0.1;\n /**\n * the max global velocity\n * @type {number}\n */\n _this.ksmax = 10;\n /**\n * the tolerance for the global swinging\n * @type {number}\n */\n _this.tao = 0.1;\n /**\n * the function of layout complete listener, display the legend and minimap after layout\n * @type {function}\n */\n _this.onLayoutEnd = function () { };\n /**\n * activate prune or not.\n * prune the leaves during most iterations, layout the leaves in the last 50 iteraitons.\n * if prune === '', it will be activated when the nodes number > 100\n * note that it will reduce the quality of the layout\n * @type {boolean}\n */\n _this.prune = undefined;\n _this.updateCfg(options);\n return _this;\n }\n ForceAtlas2Layout.prototype.getDefaultCfg = function () {\n return {};\n };\n // execute the layout\n ForceAtlas2Layout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes, onLayoutEnd = self.onLayoutEnd, prune = self.prune;\n var maxIteration = self.maxIteration;\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n // the whidth of each nodes\n var sizes = [];\n var nodeNum = nodes.length;\n for (var i = 0; i < nodeNum; i += 1) {\n var node = nodes[i];\n var nodeWidth = 10;\n var nodeHeight = 10;\n if ((0, util_1.isNumber)(node.size)) {\n nodeWidth = node.size;\n nodeHeight = node.size;\n }\n if ((0, util_1.isArray)(node.size)) {\n if (!isNaN(node.size[0]))\n nodeWidth = node.size[0];\n if (!isNaN(node.size[1]))\n nodeHeight = node.size[1];\n }\n else if ((0, util_1.isObject)(node.size)) {\n nodeWidth = node.size.width;\n nodeHeight = node.size.height;\n }\n if (self.getWidth && !isNaN(self.getWidth(node)))\n nodeHeight = self.getWidth(node);\n if (self.getHeight && !isNaN(self.getHeight(node)))\n nodeWidth = self.getHeight(node);\n var maxSize = Math.max(nodeWidth, nodeHeight);\n sizes.push(maxSize);\n }\n if (self.barnesHut === undefined && nodeNum > 250)\n self.barnesHut = true;\n if (self.prune === undefined && nodeNum > 100)\n self.prune = true;\n if (this.maxIteration === 0 && !self.prune) {\n maxIteration = 250;\n if (nodeNum <= 200 && nodeNum > 100)\n maxIteration = 1000;\n else if (nodeNum > 200)\n maxIteration = 1200;\n this.maxIteration = maxIteration;\n }\n else if (this.maxIteration === 0 && prune) {\n maxIteration = 100;\n if (nodeNum <= 200 && nodeNum > 100)\n maxIteration = 500;\n else if (nodeNum > 200)\n maxIteration = 950;\n this.maxIteration = maxIteration;\n }\n if (!self.kr) {\n self.kr = 50;\n if (nodeNum > 100 && nodeNum <= 500)\n self.kr = 20;\n else if (nodeNum > 500)\n self.kr = 1;\n }\n if (!self.kg) {\n self.kg = 20;\n if (nodeNum > 100 && nodeNum <= 500)\n self.kg = 10;\n else if (nodeNum > 500)\n self.kg = 1;\n }\n this.nodes = self.updateNodesByForces(sizes);\n onLayoutEnd();\n };\n ForceAtlas2Layout.prototype.updateNodesByForces = function (sizes) {\n var self = this;\n var edges = self.edges, maxIteration = self.maxIteration;\n var nodes = self.nodes;\n var nonLoopEdges = edges.filter(function (edge) {\n var source = (0, util_1.getEdgeTerminal)(edge, 'source');\n var target = (0, util_1.getEdgeTerminal)(edge, 'target');\n return source !== target;\n });\n var size = nodes.length;\n var esize = nonLoopEdges.length;\n var degrees = [];\n var idMap = {};\n var edgeEndsIdMap = {};\n // tslint:disable-next-line\n var Es = [];\n for (var i = 0; i < size; i += 1) {\n idMap[nodes[i].id] = i;\n degrees[i] = 0;\n if (nodes[i].x === undefined || isNaN(nodes[i].x)) {\n nodes[i].x = Math.random() * 1000;\n }\n if (nodes[i].y === undefined || isNaN(nodes[i].y)) {\n nodes[i].y = Math.random() * 1000;\n }\n Es.push({ x: nodes[i].x, y: nodes[i].y });\n }\n for (var i = 0; i < esize; i += 1) {\n var node1 = void 0;\n var node2 = void 0;\n var sIdx = 0;\n var tIdx = 0;\n for (var j = 0; j < size; j += 1) {\n var source = (0, util_1.getEdgeTerminal)(nonLoopEdges[i], 'source');\n var target = (0, util_1.getEdgeTerminal)(nonLoopEdges[i], 'target');\n if (nodes[j].id === source) {\n node1 = nodes[j];\n sIdx = j;\n }\n else if (nodes[j].id === target) {\n node2 = nodes[j];\n tIdx = j;\n }\n edgeEndsIdMap[i] = { sourceIdx: sIdx, targetIdx: tIdx };\n }\n if (node1)\n degrees[idMap[node1.id]] += 1;\n if (node2)\n degrees[idMap[node2.id]] += 1;\n }\n var iteration = maxIteration;\n nodes = this.iterate(iteration, idMap, edgeEndsIdMap, esize, degrees, sizes);\n // if prune, place the leaves around their parents, and then re-layout for several iterations.\n if (self.prune) {\n for (var j = 0; j < esize; j += 1) {\n if (degrees[edgeEndsIdMap[j].sourceIdx] <= 1) {\n nodes[edgeEndsIdMap[j].sourceIdx].x = nodes[edgeEndsIdMap[j].targetIdx].x;\n nodes[edgeEndsIdMap[j].sourceIdx].y = nodes[edgeEndsIdMap[j].targetIdx].y;\n }\n else if (degrees[edgeEndsIdMap[j].targetIdx] <= 1) {\n nodes[edgeEndsIdMap[j].targetIdx].x = nodes[edgeEndsIdMap[j].sourceIdx].x;\n nodes[edgeEndsIdMap[j].targetIdx].y = nodes[edgeEndsIdMap[j].sourceIdx].y;\n }\n }\n self.prune = false;\n self.barnesHut = false;\n iteration = 100;\n nodes = this.iterate(iteration, idMap, edgeEndsIdMap, esize, degrees, sizes);\n }\n return nodes;\n };\n ForceAtlas2Layout.prototype.iterate = function (iteration, idMap, edgeEndsIdMap, esize, degrees, sizes) {\n var self = this;\n var nodes = self.nodes;\n var kr = self.kr, preventOverlap = self.preventOverlap;\n var barnesHut = self.barnesHut;\n var nodeNum = nodes.length;\n var sg = 0;\n var krPrime = 100;\n var iter = iteration;\n var prevoIter = 50;\n var forces = [];\n var preForces = [];\n var bodies = [];\n for (var i = 0; i < nodeNum; i += 1) {\n forces[2 * i] = 0;\n forces[2 * i + 1] = 0;\n if (barnesHut) {\n var params = {\n id: i,\n rx: nodes[i].x,\n ry: nodes[i].y,\n mass: 1,\n g: kr,\n degree: degrees[i]\n };\n bodies[i] = new body_1.default(params);\n }\n }\n while (iter > 0) {\n for (var i = 0; i < nodeNum; i += 1) {\n preForces[2 * i] = forces[2 * i];\n preForces[2 * i + 1] = forces[2 * i + 1];\n forces[2 * i] = 0;\n forces[2 * i + 1] = 0;\n }\n // attractive forces, existing on every actual edge\n forces = this.getAttrForces(iter, prevoIter, esize, idMap, edgeEndsIdMap, degrees, sizes, forces);\n // repulsive forces and Gravity, existing on every node pair\n // if preventOverlap, using the no-optimized method in the last prevoIter instead.\n if (barnesHut && ((preventOverlap && iter > prevoIter) || !preventOverlap)) {\n forces = this.getOptRepGraForces(forces, bodies, degrees);\n }\n else {\n forces = this.getRepGraForces(iter, prevoIter, forces, krPrime, sizes, degrees);\n }\n // update the positions\n var res = this.updatePos(forces, preForces, sg, degrees);\n nodes = res.nodes;\n sg = res.sg;\n iter--;\n if (self.tick)\n self.tick();\n }\n return nodes;\n };\n ForceAtlas2Layout.prototype.getAttrForces = function (iter, prevoIter, esize, idMap, edgeEndsIdMap, degrees, sizes, forces) {\n var self = this;\n var nodes = self.nodes, preventOverlap = self.preventOverlap, dissuadeHubs = self.dissuadeHubs, mode = self.mode, prune = self.prune;\n for (var i = 0; i < esize; i += 1) {\n var sourceNode = nodes[edgeEndsIdMap[i].sourceIdx];\n var sourceIdx = edgeEndsIdMap[i].sourceIdx;\n var targetNode = nodes[edgeEndsIdMap[i].targetIdx];\n var targetIdx = edgeEndsIdMap[i].targetIdx;\n if (prune && (degrees[sourceIdx] <= 1 || degrees[targetIdx] <= 1))\n continue;\n var dir = [targetNode.x - sourceNode.x, targetNode.y - sourceNode.y];\n var eucliDis = Math.hypot(dir[0], dir[1]);\n eucliDis = eucliDis < 0.0001 ? 0.0001 : eucliDis;\n dir[0] = dir[0] / eucliDis;\n dir[1] = dir[1] / eucliDis;\n if (preventOverlap && iter < prevoIter)\n eucliDis = eucliDis - sizes[sourceIdx] - sizes[targetIdx];\n var Fa1 = eucliDis; // tslint:disable-line\n var Fa2 = Fa1; // tslint:disable-line\n if (mode === 'linlog') {\n Fa1 = Math.log(1 + eucliDis);\n Fa2 = Fa1;\n }\n if (dissuadeHubs) {\n Fa1 = eucliDis / degrees[sourceIdx];\n Fa2 = eucliDis / degrees[targetIdx];\n }\n if (preventOverlap && iter < prevoIter && eucliDis <= 0) {\n Fa1 = 0;\n Fa2 = 0;\n }\n else if (preventOverlap && iter < prevoIter && eucliDis > 0) {\n Fa1 = eucliDis;\n Fa2 = eucliDis;\n }\n forces[2 * idMap[sourceNode.id]] += Fa1 * dir[0];\n forces[2 * idMap[targetNode.id]] -= Fa2 * dir[0];\n forces[2 * idMap[sourceNode.id] + 1] += Fa1 * dir[1];\n forces[2 * idMap[targetNode.id] + 1] -= Fa2 * dir[1];\n }\n return forces;\n };\n ForceAtlas2Layout.prototype.getRepGraForces = function (iter, prevoIter, forces, krPrime, sizes, degrees) {\n var self = this;\n var nodes = self.nodes, preventOverlap = self.preventOverlap, kr = self.kr, kg = self.kg, center = self.center, prune = self.prune;\n var nodeNum = nodes.length;\n for (var i = 0; i < nodeNum; i += 1) {\n for (var j = i + 1; j < nodeNum; j += 1) {\n if (prune && (degrees[i] <= 1 || degrees[j] <= 1))\n continue;\n var dir_1 = [nodes[j].x - nodes[i].x, nodes[j].y - nodes[i].y];\n var eucliDis_1 = Math.hypot(dir_1[0], dir_1[1]);\n eucliDis_1 = eucliDis_1 < 0.0001 ? 0.0001 : eucliDis_1;\n dir_1[0] = dir_1[0] / eucliDis_1;\n dir_1[1] = dir_1[1] / eucliDis_1;\n if (preventOverlap && iter < prevoIter)\n eucliDis_1 = eucliDis_1 - sizes[i] - sizes[j];\n var Fr = kr * (degrees[i] + 1) * (degrees[j] + 1) / eucliDis_1; // tslint:disable-line\n if (preventOverlap && iter < prevoIter && eucliDis_1 < 0) {\n Fr = krPrime * (degrees[i] + 1) * (degrees[j] + 1);\n }\n else if (preventOverlap && iter < prevoIter && eucliDis_1 === 0) {\n Fr = 0;\n }\n else if (preventOverlap && iter < prevoIter && eucliDis_1 > 0) {\n Fr = kr * (degrees[i] + 1) * (degrees[j] + 1) / eucliDis_1;\n }\n forces[2 * i] -= Fr * dir_1[0];\n forces[2 * j] += Fr * dir_1[0];\n forces[2 * i + 1] -= Fr * dir_1[1];\n forces[2 * j + 1] += Fr * dir_1[1];\n }\n // gravity\n var dir = [nodes[i].x - center[0], nodes[i].y - center[1]];\n var eucliDis = Math.hypot(dir[0], dir[1]);\n dir[0] = dir[0] / eucliDis;\n dir[1] = dir[1] / eucliDis;\n var Fg = kg * (degrees[i] + 1); // tslint:disable-line\n forces[2 * i] -= Fg * dir[0];\n forces[2 * i + 1] -= Fg * dir[1];\n }\n return forces;\n };\n ForceAtlas2Layout.prototype.getOptRepGraForces = function (forces, bodies, degrees) {\n var self = this;\n var nodes = self.nodes, kg = self.kg, center = self.center, prune = self.prune;\n var nodeNum = nodes.length;\n var minx = 9e10;\n var maxx = -9e10;\n var miny = 9e10;\n var maxy = -9e10;\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n bodies[i].setPos(nodes[i].x, nodes[i].y);\n if (nodes[i].x >= maxx)\n maxx = nodes[i].x;\n if (nodes[i].x <= minx)\n minx = nodes[i].x;\n if (nodes[i].y >= maxy)\n maxy = nodes[i].y;\n if (nodes[i].y <= miny)\n miny = nodes[i].y;\n }\n var width = Math.max(maxx - minx, maxy - miny);\n var quadParams = {\n xmid: (maxx + minx) / 2,\n ymid: (maxy + miny) / 2,\n length: width,\n massCenter: center,\n mass: nodeNum\n };\n var quad = new quad_1.default(quadParams);\n var quadTree = new quadTree_1.default(quad);\n // build the tree, insert the nodes(quads) into the tree\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n if (bodies[i].in(quad))\n quadTree.insert(bodies[i]);\n }\n // update the repulsive forces and the gravity.\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n bodies[i].resetForce();\n quadTree.updateForce(bodies[i]);\n forces[2 * i] -= bodies[i].fx;\n forces[2 * i + 1] -= bodies[i].fy;\n // gravity\n var dir = [nodes[i].x - center[0], nodes[i].y - center[1]];\n var eucliDis = Math.hypot(dir[0], dir[1]);\n eucliDis = eucliDis < 0.0001 ? 0.0001 : eucliDis;\n dir[0] = dir[0] / eucliDis;\n dir[1] = dir[1] / eucliDis;\n var Fg = kg * (degrees[i] + 1); // tslint:disable-line\n forces[2 * i] -= Fg * dir[0];\n forces[2 * i + 1] -= Fg * dir[1];\n }\n return forces;\n };\n ForceAtlas2Layout.prototype.updatePos = function (forces, preForces, sg, degrees) {\n var self = this;\n var nodes = self.nodes, ks = self.ks, tao = self.tao, prune = self.prune, ksmax = self.ksmax;\n var nodeNum = nodes.length;\n var swgns = [];\n var trans = [];\n // swg(G) and tra(G)\n var swgG = 0;\n var traG = 0;\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n var minus = [forces[2 * i] - preForces[2 * i],\n forces[2 * i + 1] - preForces[2 * i + 1]\n ];\n var minusNorm = Math.hypot(minus[0], minus[1]);\n var add = [forces[2 * i] + preForces[2 * i],\n forces[2 * i + 1] + preForces[2 * i + 1]\n ];\n var addNorm = Math.hypot(add[0], add[1]);\n swgns[i] = minusNorm;\n trans[i] = addNorm / 2;\n swgG += (degrees[i] + 1) * swgns[i];\n traG += (degrees[i] + 1) * trans[i];\n }\n var preSG = sg;\n sg = tao * traG / swgG; // tslint:disable-line\n if (preSG !== 0) {\n sg = sg > (1.5 * preSG) ? (1.5 * preSG) : sg; // tslint:disable-line\n }\n // update the node positions\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n if ((0, util_1.isNumber)(nodes[i].fx) && (0, util_1.isNumber)(nodes[i].fy))\n continue;\n var sn = ks * sg / (1 + sg * Math.sqrt(swgns[i]));\n var absForce = Math.hypot(forces[2 * i], forces[2 * i + 1]);\n absForce = absForce < 0.0001 ? 0.0001 : absForce;\n var max = ksmax / absForce;\n sn = sn > max ? max : sn;\n var dnx = sn * forces[2 * i];\n var dny = sn * forces[2 * i + 1];\n nodes[i].x += dnx;\n nodes[i].y += dny;\n }\n return { nodes: nodes, sg: sg };\n };\n return ForceAtlas2Layout;\n}(base_1.Base));\nexports.ForceAtlas2Layout = ForceAtlas2Layout;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/legend/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/legend/index.js ***! - \*********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/forceAtlas2/quad.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/forceAtlas2/quad.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\n\nvar ALLOW_EVENTS = ['click', 'mouseenter'];\n\nvar Legend =\n/** @class */\nfunction (_super) {\n __extends(Legend, _super);\n\n function Legend(config) {\n return _super.call(this, config) || this;\n }\n\n Legend.prototype.getDefaultCfgs = function () {\n return {\n data: {},\n position: 'top',\n padding: 8,\n margin: 8,\n offsetX: 0,\n offsetY: 0,\n layout: 'horizontal',\n flipPage: false,\n containerStyle: {},\n align: undefined,\n horiSep: 8,\n vertiSep: 8,\n filter: {\n enable: false,\n trigger: 'click'\n }\n };\n };\n\n Legend.prototype.init = function () {\n this.formatArray('padding');\n this.formatArray('margin');\n var filter = this.get('filter') || {};\n var multiple = filter.multiple;\n if (multiple && filter.trigger === 'mouseenter') this.set('multiple', false);\n var align = this.get('align');\n\n if (!align) {\n var positions = this.get('position').split('-');\n if (positions.includes('left')) align = 'left';\n if (positions.includes('right')) align = 'right';else align = 'center';\n this.set('align', align);\n }\n\n var graph = this.get('graph');\n var graphContainer = graph.get('container');\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\");\n graphContainer.appendChild(container);\n this.set('container', container);\n var size = this.render();\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(container, this.getContainerPos(size));\n this.bindEvents();\n };\n\n Legend.prototype.getContainerPos = function (size) {\n if (size === void 0) {\n size = [0, 0];\n }\n\n var self = this;\n var graph = self.get('graph');\n var offsetX = this.get('offsetX');\n var offsetY = this.get('offsetY');\n var margin = this.get('margin');\n var positions = this.get('position').split('-');\n var posIdxMap = {\n 'top': 0,\n 'right': 1,\n 'bottom': 2,\n 'left': 3\n };\n var x = 0,\n y = 0;\n var containerCSS = {\n left: (graph.getWidth() - size[0]) / 2 + x,\n top: (graph.getHeight() - size[1]) / 2 + y\n };\n positions.forEach(function (pos) {\n var marginValue = margin[posIdxMap[pos]];\n var key = pos;\n\n switch (pos) {\n case 'top':\n marginValue += y;\n break;\n\n case 'left':\n marginValue += x;\n break;\n\n case 'bottom':\n marginValue = graph.getHeight() - size[1] - marginValue + y;\n key = 'top';\n break;\n\n default:\n marginValue = graph.getWidth() - size[0] - marginValue + x;\n key = 'left';\n break;\n }\n\n containerCSS[key] = marginValue;\n });\n containerCSS.top += offsetY + graph.getContainer().offsetTop;\n containerCSS.left += offsetX + graph.getContainer().offsetLeft;\n Object.keys(containerCSS).forEach(function (key) {\n containerCSS[key] = \"\".concat(containerCSS[key], \"px\");\n });\n return containerCSS;\n }; // class-methods-use-this\n\n\n Legend.prototype.bindEvents = function () {\n var self = this;\n var filter = self.get('filter');\n if (!filter || !filter.enable) return;\n var trigger = filter.trigger || 'click';\n\n if (!ALLOW_EVENTS.includes(trigger)) {\n console.warn('Trigger for legend filterling must be \\'click\\' or \\'mouseenter\\', \\'click\\' will take effect by default.');\n trigger = 'click';\n }\n\n var lc = self.get('legendCanvas');\n\n if (trigger === 'mouseenter') {\n lc.on('node-container:mouseenter', function (e) {\n return self.filterData(e);\n });\n lc.on('node-container:mouseleave', function (e) {\n self.clearFilter();\n self.clearActiveLegend();\n });\n } else {\n lc.on('node-container:click', function (e) {\n return self.filterData(e);\n });\n lc.on('click', function (e) {\n if (e.target && e.target.isCanvas && e.target.isCanvas()) {\n self.clearFilter();\n self.clearActiveLegend();\n }\n });\n }\n };\n /**\n * 更新 legend 数据,开放给用户控制\n * @param param\n */\n\n\n Legend.prototype.changeData = function (data) {\n this.set('data', data);\n var size = this.render();\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(this.get('container'), this.getContainerPos(size));\n };\n\n Legend.prototype.activateLegend = function (shape) {\n var filter = this.get('filter');\n var multiple = filter === null || filter === void 0 ? void 0 : filter.multiple;\n if (!multiple) this.clearActiveLegend();\n var shapeGroup = shape.get('parent'); // 若被高亮元素已经处于 active 状态,则取消它的 active 状态\n // 并根据目前是否有其他 active 状态的元素决定是否要设置为 inactive 状态\n\n if (shapeGroup.get('active')) {\n shapeGroup.set('active', false);\n if (this.findLegendItemsByState('active').length) shapeGroup.set('inactive', true);\n } else {\n shapeGroup.set('inactive', false);\n shapeGroup.set('active', true);\n } // 当目前有元素为 active 状态时,将非 active 的元素设置为 inactive\n\n\n if (this.findLegendItemsByState('active').length) {\n this.findLegendItemsByState('active', 'all', false).forEach(function (subGroup) {\n subGroup.set('inactive', true);\n });\n } else {\n this.clearActiveLegend();\n } // 设置样式\n\n\n var stateStyles = (filter === null || filter === void 0 ? void 0 : filter.legendStateStyles) || {};\n var legendInactive = (stateStyles === null || stateStyles === void 0 ? void 0 : stateStyles.inactive) || {\n opacity: 0.5,\n 'text-shape': {\n opacity: 0.5\n }\n };\n var legendTextInactive = legendInactive['text-shape'] || {};\n this.findLegendItemsByState('inactive').forEach(function (subGroup) {\n var _a = subGroup.get('children'),\n keyShape = _a[0],\n text = _a[1];\n\n keyShape.attr(__assign(__assign({}, keyShape.get('oriAttrs')), legendInactive));\n text.attr(__assign(__assign({}, text.get('oriAttrs')), legendTextInactive));\n });\n var legendActive = (stateStyles === null || stateStyles === void 0 ? void 0 : stateStyles.active) || {\n stroke: '#000',\n lineWidth: 2,\n 'text-shape': {\n fontWeight: 'bold'\n }\n };\n var legendTextActive = legendActive['text-shape'] || {};\n this.findLegendItemsByState('active').forEach(function (subGroup) {\n var _a = subGroup.get('children'),\n keyShape = _a[0],\n text = _a[1];\n\n keyShape.attr(__assign(__assign({}, keyShape.get('oriAttrs')), legendActive));\n text.attr(__assign(__assign({}, text.get('oriAttrs')), legendTextActive));\n });\n };\n\n Legend.prototype.findLegendItemsByState = function (stateName, type, value) {\n if (type === void 0) {\n type = 'all';\n }\n\n if (value === void 0) {\n value = true;\n }\n\n var group = this.get('legendCanvas').find(function (e) {\n return e.get('name') === 'root';\n });\n var nodeGroup = group.find(function (e) {\n return e.get('name') === 'node-group';\n });\n var edgeGroup = group.find(function (e) {\n return e.get('name') === 'edge-group';\n });\n if (type === 'node') return nodeGroup.get('children').filter(function (g) {\n return !!g.get(stateName) === value;\n });\n if (type === 'edge') return edgeGroup.get('children').filter(function (g) {\n return !!g.get(stateName) === value;\n });\n return nodeGroup.get('children').filter(function (g) {\n return !!g.get(stateName) === value;\n }).concat(edgeGroup.get('children').filter(function (g) {\n return !!g.get(stateName) === value;\n }));\n };\n\n Legend.prototype.clearActiveLegend = function () {\n var lg = this.get('legendCanvas');\n var group = lg.find(function (e) {\n return e.get('name') === 'root';\n });\n var groups = [group.find(function (e) {\n return e.get('name') === 'node-group';\n }), group.find(function (e) {\n return e.get('name') === 'edge-group';\n })];\n groups.forEach(function (itemGroup) {\n itemGroup.get('children').forEach(function (subGroup) {\n subGroup.set('active', false);\n subGroup.set('inactive', false);\n\n var _a = subGroup.get('children'),\n keyShape = _a[0],\n text = _a[1];\n\n keyShape.attr(keyShape.get('oriAttrs'));\n text.attr(text.get('oriAttrs'));\n });\n });\n };\n /**\n * 高亮和置灰图例,并过滤主图元素\n * @param param\n */\n\n\n Legend.prototype.filterData = function (e) {\n var filter = this.get('filter');\n var filterFunctions = filter === null || filter === void 0 ? void 0 : filter.filterFunctions;\n if (!filter || !filterFunctions) return;\n var lc = this.get('legendCanvas');\n var graph = this.get('graph');\n var activeState = filter.graphActiveState || 'active';\n var inactiveState = filter.graphInactiveState || 'inactive';\n var multiple = filter.multiple;\n this.clearFilter();\n if (!multiple) this.clearActiveLegend(); // 设置 legend 的高亮状态\n\n this.activateLegend(e.target);\n var group = lc.find(function (e) {\n return e.get('name') === 'root';\n });\n var nodeGroup = group.find(function (e) {\n return e.get('name') === 'node-group';\n });\n var edgeGroup = group.find(function (e) {\n return e.get('name') === 'edge-group';\n });\n var activeNodeLegend = nodeGroup.get('children').filter(function (e) {\n return e.get('active');\n });\n var activeEdgeLegend = edgeGroup.get('children').filter(function (e) {\n return e.get('active');\n });\n var activeCount = 0;\n var typeFuncs = ['getNodes', 'getEdges'];\n typeFuncs.forEach(function (typeFunc) {\n graph[typeFunc]().forEach(function (graphItem) {\n var active = false;\n var activeLegend = typeFunc === 'getNodes' ? activeNodeLegend : activeEdgeLegend;\n activeLegend.forEach(function (itemGroup) {\n var func = filterFunctions[itemGroup.get('id')];\n active = active || func(graphItem.getModel());\n });\n\n if (active) {\n graph.setItemState(graphItem, inactiveState, false);\n graph.setItemState(graphItem, activeState, true);\n activeCount++;\n } else {\n graph.setItemState(graphItem, activeState, false);\n graph.setItemState(graphItem, inactiveState, true);\n }\n });\n });\n if (!activeCount) typeFuncs.forEach(function (typeFunc) {\n graph[typeFunc]().forEach(function (graphItem) {\n graph.clearItemStates(graphItem, [inactiveState]);\n });\n });\n };\n /**\n * 清除主图相关状态\n * @param param\n */\n\n\n Legend.prototype.clearFilter = function () {\n // 清除 legend 的高亮状态\n var graph = this.get('graph');\n var filter = this.get('filter');\n if (!filter) return;\n var activeState = filter.graphActiveState || 'active';\n var inactiveState = filter.graphInactiveState || 'inactive';\n graph.getNodes().forEach(function (node) {\n graph.clearItemStates(node, [activeState, inactiveState]);\n });\n graph.getEdges().forEach(function (edge) {\n graph.clearItemStates(edge, [activeState, inactiveState]);\n });\n };\n /**\n * 渲染 legend 图\n * @param param\n */\n\n\n Legend.prototype.render = function () {\n var _this = this;\n\n this.processData();\n var lc = this.get('legendCanvas');\n\n if (!lc) {\n lc = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_4__[\"Canvas\"]({\n container: this.get('container'),\n width: 200,\n height: 200\n });\n } else {\n lc.clear();\n }\n\n var group = lc.addGroup({\n name: 'root'\n });\n var nodeGroup = group.addGroup({\n name: 'node-group'\n });\n var edgeGroup = group.addGroup({\n name: 'edge-group'\n });\n this.set('legendCanvas', lc);\n var itemsData = this.get('itemsData');\n var itemTypes = ['nodes', 'edges'];\n var itemGroup = [nodeGroup, edgeGroup];\n itemTypes.forEach(function (itemType, i) {\n itemsData[itemType].forEach(function (data) {\n var _a;\n\n var subGroup = itemGroup[i].addGroup({\n id: data.id,\n name: 'node-container'\n });\n var attrs;\n var shapeType = data.type;\n\n var _b = _this.getShapeSize(data),\n width = _b.width,\n height = _b.height,\n r = _b.r;\n\n var style = _this.getStyle(itemType.substr(0, 4), data);\n\n switch (data.type) {\n case 'circle':\n attrs = {\n r: r,\n x: 0,\n y: 0\n };\n break;\n\n case 'rect':\n attrs = {\n width: width,\n height: height,\n x: -width / 2,\n y: -height / 2\n };\n break;\n\n case 'ellipse':\n attrs = {\n r1: width,\n r2: height,\n x: 0,\n y: 0\n };\n break;\n\n case 'line':\n attrs = {\n x1: -width / 2,\n y1: 0,\n x2: width / 2,\n y2: 0\n };\n shapeType = 'line';\n break;\n\n case 'quadratic':\n attrs = {\n path: [['M', -width / 2, 0], ['Q', 0, width / 2, width / 2, 0]]\n };\n shapeType = 'path';\n break;\n\n case 'cubic':\n attrs = {\n path: [['M', -width / 2, 0], ['C', -width / 6, width / 2, width / 6, -width / 2, width / 2, 0]]\n };\n shapeType = 'path';\n break;\n\n default:\n attrs = {\n r: r,\n x: 0,\n y: 0\n };\n break;\n }\n\n var keyShape = subGroup.addShape(shapeType, {\n attrs: __assign(__assign({}, attrs), style),\n name: \"\".concat(data.type, \"-node-keyShape\"),\n oriAttrs: __assign({\n opacity: 1\n }, style)\n });\n\n if (data.label) {\n var keyShapeBBox = keyShape.getBBox();\n var labelStyle = ((_a = data.labelCfg) === null || _a === void 0 ? void 0 : _a.style) || {};\n\n var attrs_1 = __assign({\n textAlign: 'begin',\n fontSize: 12,\n textBaseline: 'middle',\n fill: '#000',\n opacity: 1,\n fontWeight: 'normal'\n }, labelStyle);\n\n subGroup.addShape('text', {\n attrs: __assign({\n x: keyShapeBBox.maxX + 4,\n y: 0,\n text: data.label\n }, attrs_1),\n className: 'legend-label',\n name: \"\".concat(data.type, \"-node-text\"),\n oriAttrs: attrs_1\n });\n }\n });\n });\n var padding = this.get('padding');\n var titleShape;\n var titleGroup = group.find(function (e) {\n return e.get('name') === 'title-container';\n });\n var titleGroupBBox = {\n height: 0,\n maxY: 0,\n width: 0\n };\n\n if (this.get('title')) {\n if (!titleGroup) {\n titleGroup = group.addGroup({\n name: 'title-container'\n });\n }\n\n var defaultTitleStyle = {\n fontSize: 20,\n fontFamily: 'Arial',\n fontWeight: 300,\n textBaseline: 'top',\n textAlign: 'center',\n fill: \"#000\",\n x: 0,\n y: padding[0]\n };\n var titleConfig = this.get('titleConfig') || {};\n var style = Object.assign(defaultTitleStyle, titleConfig.style || {});\n titleShape = titleGroup.addShape('text', {\n attrs: __assign({\n text: this.get('title')\n }, style)\n });\n titleGroupBBox = titleGroup.getCanvasBBox();\n titleGroup.setMatrix([1, 0, 0, 0, 1, 0, titleConfig.offsetX, titleConfig.offsetY, 1]);\n }\n\n this.layoutItems();\n var lcBBox = group.getCanvasBBox();\n var nodeGroupBBox = nodeGroup.getCanvasBBox(); // 若有图形超过边界的情况,平移回来\n\n var nodeGroupBeginX = nodeGroupBBox.minX < 0 ? Math.abs(nodeGroupBBox.minX) + padding[3] : padding[3];\n var nodeGroupBeginY = titleGroupBBox.maxY < nodeGroupBBox.minY ? Math.abs(titleGroupBBox.maxY - nodeGroupBBox.minY) + padding[0] : titleGroupBBox.maxY + padding[0];\n var nodeGroupMatrix = [1, 0, 0, 0, 1, 0, nodeGroupBeginX, nodeGroupBeginY, 1];\n nodeGroup.setMatrix(nodeGroupMatrix);\n lcBBox = group.getCanvasBBox();\n var size = [lcBBox.minX + lcBBox.width + padding[1], lcBBox.minY + lcBBox.height + padding[2]]; // 根据 size 和 titleConfig 调整 title 位置,再调整 nodeGroup 位置\n\n if (titleShape) {\n var titleConfig = __assign({\n position: 'center',\n offsetX: 0,\n offsetY: 0\n }, this.get('titleConfig'));\n\n titleGroupBBox = titleGroup.getCanvasBBox();\n var titleGroupMatrix = titleGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n\n if (titleConfig.position === 'center') {\n titleGroupMatrix[6] = size[0] / 2 + titleConfig.offsetX;\n } else if (titleConfig.position === 'right') {\n titleGroupMatrix[6] = size[0] - padding[3] + titleConfig.offsetX;\n titleShape.attr({\n textAlign: 'right'\n });\n } else {\n titleGroupMatrix[6] = padding[3] + titleConfig.offsetX;\n titleShape.attr({\n textAlign: 'left'\n });\n }\n\n titleGroup.setMatrix(titleGroupMatrix);\n titleGroupBBox = titleGroup.getCanvasBBox(); // 若有图形超过边界的情况,平移回来\n\n nodeGroupBeginX = nodeGroupBBox.minX < 0 ? Math.abs(nodeGroupBBox.minX) + padding[3] : padding[3];\n nodeGroupBeginY = nodeGroupBBox.minY < titleGroupBBox.maxY ? Math.abs(titleGroupBBox.maxY - nodeGroupBBox.minY) + padding[0] : titleGroupBBox.maxY + padding[0];\n nodeGroupMatrix = [1, 0, 0, 0, 1, 0, nodeGroupBeginX, nodeGroupBeginY, 1];\n nodeGroup.setMatrix(nodeGroupMatrix);\n var edgeGroupMatrix_1 = [1, 0, 0, 0, 1, 0, nodeGroupBeginX, nodeGroupBeginY, 1];\n if (this.get('layout') === 'vertical') edgeGroupMatrix_1[6] += nodeGroupBBox.maxX + this.get('horiSep');else edgeGroupMatrix_1[7] += nodeGroupBBox.maxY + this.get('vertiSep');\n edgeGroup.setMatrix(edgeGroupMatrix_1);\n } else {\n // 没有 title,也需要平移 edgeGroup\n nodeGroupBBox = nodeGroup.getCanvasBBox();\n var edgeGroupMatrix_2 = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n if (this.get('layout') === 'vertical') edgeGroupMatrix_2[6] += nodeGroupMatrix[6] + nodeGroupBBox.maxX + this.get('horiSep');else edgeGroupMatrix_2[7] += nodeGroupMatrix[7] + nodeGroupBBox.maxY + this.get('vertiSep');\n edgeGroup.setMatrix(edgeGroupMatrix_2);\n }\n\n lcBBox = group.getCanvasBBox();\n nodeGroupBBox = nodeGroup.getCanvasBBox();\n nodeGroupMatrix = nodeGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var edgeGroupMatrix = edgeGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var edgeGroupBBox = edgeGroup.getCanvasBBox();\n size = [Math.max(nodeGroupBBox.width + nodeGroupMatrix[6], edgeGroupBBox.width + edgeGroupMatrix[6]) + padding[1], Math.max(nodeGroupBBox.height + nodeGroupMatrix[7], edgeGroupBBox.height + edgeGroupMatrix[7]) + padding[2]];\n lc.changeSize(size[0], size[1]); // 更新容器背景样式\n\n var containerStyle = this.get('containerStyle');\n var viewportMatrix = group.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var beginPos = _antv_g6_core__WEBPACK_IMPORTED_MODULE_3__[\"Util\"].invertMatrix({\n x: 0,\n y: 0\n }, viewportMatrix);\n var backRect = group.addShape('rect', {\n attrs: __assign({\n x: beginPos.x + (containerStyle.lineWidth || 1),\n y: beginPos.y + (containerStyle.lineWidth || 1),\n width: size[0] - 2 * (containerStyle.lineWidth || 1),\n height: size[1] - 2 * (containerStyle.lineWidth || 1),\n fill: \"#f00\",\n stroke: '#000',\n lineWidth: 1,\n opacity: 0.5\n }, containerStyle),\n name: 'legend-back-rect',\n capture: false\n });\n backRect.toBack();\n return size;\n };\n\n Legend.prototype.layoutItems = function () {\n var lc = this.get('legendCanvas');\n var horiSep = this.get('horiSep');\n var vertiSep = this.get('vertiSep');\n var layout = this.get('layout');\n var align = this.get('align');\n var begin = [0, 0];\n var group = lc.find(function (e) {\n return e.get('name') === 'root';\n });\n var nodeGroup = group.find(function (e) {\n return e.get('name') === 'node-group';\n });\n var edgeGroup = group.find(function (e) {\n return e.get('name') === 'edge-group';\n });\n var nodeLegendSize = {\n min: 0,\n max: -Infinity\n };\n var rowMaxY = -Infinity;\n nodeGroup.get('children').forEach(function (cNodeGroup, i) {\n if (i === 0) nodeLegendSize.min = begin[0];\n var keyShape = cNodeGroup.get('children')[0];\n var bbox = cNodeGroup.getCanvasBBox();\n\n var _a = keyShape.getBBox(),\n keyShapeWidth = _a.width,\n keyShapeHeight = _a.height;\n\n var curHeight = 0,\n x = 0,\n y = 0;\n\n if (layout === 'vertical') {\n x = begin[1];\n y = begin[0] + keyShapeWidth / 2;\n begin[0] = y + bbox.height + vertiSep;\n curHeight = bbox.maxX + x + keyShapeWidth / 2;\n } else {\n x = begin[0] + keyShapeWidth / 2;\n y = begin[1];\n begin[0] = x + bbox.width + horiSep;\n curHeight = bbox.maxY + y + keyShapeHeight / 2;\n }\n\n if (begin[0] > nodeLegendSize.max) nodeLegendSize.max = begin[0];\n if (curHeight > rowMaxY) rowMaxY = curHeight;\n cNodeGroup.setMatrix([1, 0, 0, 0, 1, 0, x, y, 1]);\n });\n var nw = nodeLegendSize.max - nodeLegendSize.min;\n var edgeLegendSize = {\n min: 0,\n max: -Infinity\n };\n var nodeGroupBBox = nodeGroup.getCanvasBBox();\n begin[0] = 0;\n begin[1] = layout === 'vertical' ? nodeGroupBBox.maxX + horiSep : nodeGroupBBox.maxY + vertiSep;\n edgeGroup.get('children').forEach(function (subGroup, i) {\n if (i === 0) edgeLegendSize.min = begin[0];\n var keyShape = subGroup.get('children')[0];\n var bbox = subGroup.getCanvasBBox();\n\n var _a = keyShape.getBBox(),\n keyShapeWidth = _a.width,\n keyShapeHeight = _a.height;\n\n var x = 0,\n y = 0;\n\n if (layout === 'vertical') {\n x = begin[1];\n y = begin[0];\n begin[0] = y + bbox.height + vertiSep;\n subGroup.setMatrix([1, 0, 0, 0, 1, 0, 0, y + keyShapeHeight / 2, 1]);\n } else {\n x = begin[0];\n y = begin[1];\n begin[0] = x + bbox.width + horiSep;\n subGroup.setMatrix([1, 0, 0, 0, 1, 0, x + keyShapeWidth / 2, 0, 1]);\n }\n\n if (begin[0] > edgeLegendSize.max) edgeLegendSize.max = begin[0];\n });\n var ew = edgeLegendSize.max - edgeLegendSize.min;\n\n if (align && align !== '' && align !== 'left') {\n var widthDiff = nw - ew;\n var movement_1 = align === 'center' ? Math.abs(widthDiff) / 2 : Math.abs(widthDiff);\n var shouldAdjustGroup = widthDiff < 0 ? nodeGroup : edgeGroup;\n shouldAdjustGroup.get('children').forEach(function (subGroup) {\n var matrix = subGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n if (layout === 'vertical') matrix[7] += movement_1;else matrix[6] += movement_1;\n subGroup.setMatrix(matrix);\n });\n }\n };\n\n Legend.prototype.processData = function () {\n var data = this.get('data');\n var itemsData = {\n nodes: [],\n edges: []\n };\n\n if (data.nodes) {\n data.nodes.sort(function (a, b) {\n return a.order - b.order;\n });\n data.nodes.forEach(function (node) {\n var _a, _b, _c, _d, _e;\n\n var size = node.size || [((_a = node.style) === null || _a === void 0 ? void 0 : _a.width) || ((_b = node.style) === null || _b === void 0 ? void 0 : _b.r) || 8, ((_c = node.style) === null || _c === void 0 ? void 0 : _c.height) || ((_d = node.style) === null || _d === void 0 ? void 0 : _d.r) || 8];\n var labelStyle = ((_e = node.labelCfg) === null || _e === void 0 ? void 0 : _e.style) || {};\n itemsData.nodes.push({\n id: node.id || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"uniqueId\"])(),\n type: node.type || 'circle',\n style: __assign({}, node.style),\n order: node.order,\n label: node.label,\n itemType: 'node',\n size: size,\n labelCfg: {\n position: 'right',\n style: __assign({\n fontFamily: \"Arial\"\n }, labelStyle)\n }\n });\n });\n }\n\n if (data.edges) {\n data.edges.sort(function (a, b) {\n return a.order - b.order;\n });\n data.edges.forEach(function (edge) {\n var _a, _b;\n\n var type = edge.type || 'line';\n if (edge.type === 'cubic-horizontal') type = 'cubic';\n var labelStyle = ((_a = edge.labelCfg) === null || _a === void 0 ? void 0 : _a.style) || {};\n var size = edge.size || [((_b = edge.style) === null || _b === void 0 ? void 0 : _b.width) || 8, 1];\n itemsData.edges.push({\n id: edge.id || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"uniqueId\"])(),\n type: type,\n size: size,\n style: __assign({\n lineWidth: Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(size) ? size[1] : 1\n }, edge.style),\n order: edge.order,\n label: edge.label,\n itemType: 'edge',\n labelCfg: {\n position: 'right',\n style: __assign({\n fontFamily: \"Arial\"\n }, labelStyle)\n }\n });\n });\n }\n\n this.set('itemsData', itemsData);\n };\n\n Legend.prototype.getContainer = function () {\n return this.get('container');\n };\n\n Legend.prototype.formatArray = function (key) {\n var value = this.get(key);\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(value)) this.set(key, [value, value, value, value]);else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(value)) {\n switch (value.length) {\n case 0:\n this.set(key, [0, 0, 0, 0]);\n break;\n\n case 1:\n this.set(key, [value[0], value[0], value[0], value[0]]);\n break;\n\n case 2:\n this.set(key, [value[0], value[1], value[0], value[1]]);\n break;\n\n case 3:\n this.set(key, [value[0], value[1], value[2], value[1]]);\n break;\n\n default:\n break;\n }\n }\n return this.get(key);\n };\n\n Legend.prototype.getShapeSize = function (data) {\n var width, height, r;\n\n if (data.size) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(data.size)) {\n width = data.size[0];\n height = data.size[1] || data.size[0];\n r = data.size[0] / 2;\n } else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNumber\"])(data.size)) {\n width = data.size;\n height = data.size;\n r = data.size / 2;\n }\n }\n\n if (data.style) {\n if (data.style.width) width = data.style.width;\n if (data.style.height) height = data.style.height;\n if (data.style.r) r = data.style.r;\n }\n\n if (!r) r = 5;\n if (!width) width = r;\n if (!height) height = r;\n return {\n width: width,\n height: height,\n r: r\n };\n };\n\n Legend.prototype.getStyle = function (type, data) {\n var defaultStyle = type === 'node' ? {\n fill: '#ccc',\n lineWidth: 0\n } : {\n stroke: '#000',\n lineWidth: 1\n };\n return __assign(__assign({}, defaultStyle), data.style || {});\n };\n\n Legend.prototype.destroy = function () {\n var lc = this.get('legendCanvas');\n lc === null || lc === void 0 ? void 0 : lc.destroy();\n var graph = this.get('graph');\n var graphContainer = graph.get('container');\n var container = this.get('container');\n graphContainer.removeChild(container);\n };\n\n return Legend;\n}(_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Legend);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/legend/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Quad = /** @class */ (function () {\n function Quad(params) {\n /**\n * the center position of this quad\n * @type {number}\n */\n this.xmid = params.xmid;\n /**\n * the center position of this quad\n * @type {number}\n */\n this.ymid = params.ymid;\n /**\n * the length of this quad\n * @type {number}\n */\n this.length = params.length;\n /**\n * the mass center of this quad\n * @type {number}\n */\n this.massCenter = params.massCenter || [0, 0];\n /**\n * the mass of this quad\n * @type {number}\n */\n this.mass = params.mass || 1;\n }\n Quad.prototype.getLength = function () {\n return this.length;\n };\n Quad.prototype.contains = function (x, y) {\n var halfLen = this.length / 2;\n return (x <= this.xmid + halfLen &&\n x >= this.xmid - halfLen &&\n y <= this.ymid + halfLen &&\n y >= this.ymid - halfLen);\n };\n // northwest quadrant\n // tslint:disable-next-line\n Quad.prototype.NW = function () {\n var x = this.xmid - this.length / 4;\n var y = this.ymid + this.length / 4;\n var len = this.length / 2;\n var params = {\n xmid: x,\n ymid: y,\n length: len\n };\n var NW = new Quad(params);\n return NW;\n };\n // northeast\n // tslint:disable-next-line\n Quad.prototype.NE = function () {\n var x = this.xmid + this.length / 4;\n var y = this.ymid + this.length / 4;\n var len = this.length / 2;\n var params = {\n xmid: x,\n ymid: y,\n length: len\n };\n var NE = new Quad(params);\n return NE;\n };\n // southwest\n // tslint:disable-next-line\n Quad.prototype.SW = function () {\n var x = this.xmid - this.length / 4;\n var y = this.ymid - this.length / 4;\n var len = this.length / 2;\n var params = {\n xmid: x,\n ymid: y,\n length: len\n };\n var SW = new Quad(params);\n return SW;\n };\n // southeast\n // tslint:disable-next-line\n Quad.prototype.SE = function () {\n var x = this.xmid + this.length / 4;\n var y = this.ymid - this.length / 4;\n var len = this.length / 2;\n var params = {\n xmid: x,\n ymid: y,\n length: len\n };\n var SE = new Quad(params);\n return SE;\n };\n return Quad;\n}());\nexports.default = Quad;\n//# sourceMappingURL=quad.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/forceAtlas2/quad.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/menu/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/menu/index.js ***! - \*******************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/forceAtlas2/quadTree.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/forceAtlas2/quadTree.js ***! + \**********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! insert-css */ \"./node_modules/insert-css/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(insert_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\n\ntypeof document !== 'undefined' && insert_css__WEBPACK_IMPORTED_MODULE_2___default()(\"\\n .g6-component-contextmenu {\\n border: 1px solid #e2e2e2;\\n border-radius: 4px;\\n font-size: 12px;\\n color: #545454;\\n background-color: rgba(255, 255, 255, 0.9);\\n padding: 10px 8px;\\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\\n }\\n .g6-contextmenu-ul {\\n padding: 0;\\n margin: 0;\\n list-style: none;\\n }\\n\\n\");\n\nvar Menu =\n/** @class */\nfunction (_super) {\n __extends(Menu, _super);\n\n function Menu(config) {\n return _super.call(this, config) || this;\n }\n\n Menu.prototype.getDefaultCfgs = function () {\n return {\n offsetX: 6,\n offsetY: 6,\n handleMenuClick: undefined,\n // 指定菜单内容,function(e) {...}\n getContent: function getContent(e) {\n return \"\\n
    \\n
  • \\u83DC\\u5355\\u98791
  • \\n
  • \\u83DC\\u5355\\u98792
  • \\n
\\n \";\n },\n shouldBegin: function shouldBegin(e) {\n return true;\n },\n // 菜单隐藏事件\n onHide: function onHide() {\n return true;\n },\n itemTypes: ['node', 'edge', 'combo'],\n trigger: 'contextmenu'\n };\n }; // class-methods-use-this\n\n\n Menu.prototype.getEvents = function () {\n if (this.get('trigger') === 'click') {\n return {\n click: 'onMenuShow',\n touchend: 'onMenuShow'\n };\n }\n\n return {\n contextmenu: 'onMenuShow'\n };\n };\n\n Menu.prototype.init = function () {\n var className = this.get('className');\n var menu = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(menu, {\n top: '0px',\n position: 'absolute',\n visibility: 'hidden'\n });\n var container = this.get('container');\n\n if (!container) {\n container = this.get('graph').get('container');\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n container.appendChild(menu);\n this.set('menu', menu);\n };\n\n Menu.prototype.onMenuShow = function (e) {\n var self = this;\n e.preventDefault();\n var itemTypes = this.get('itemTypes');\n\n if (!e.item) {\n if (itemTypes.indexOf('canvas') === -1) {\n self.onMenuHide();\n return;\n }\n } else {\n if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) {\n self.onMenuHide();\n return;\n }\n }\n\n var shouldBegin = this.get('shouldBegin');\n if (!shouldBegin(e)) return;\n var menuDom = this.get('menu');\n var getContent = this.get('getContent');\n var graph = this.get('graph');\n var menu = getContent(e, graph);\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(menu)) {\n menuDom.innerHTML = menu;\n } else {\n menuDom.innerHTML = menu.outerHTML;\n } // 清除之前监听的事件\n\n\n this.removeMenuEventListener();\n var handleMenuClick = this.get('handleMenuClick');\n\n if (handleMenuClick) {\n var handleMenuClickWrapper = function handleMenuClickWrapper(evt) {\n handleMenuClick(evt.target, e.item, graph);\n };\n\n this.set('handleMenuClickWrapper', handleMenuClickWrapper);\n menuDom.addEventListener('click', handleMenuClickWrapper);\n }\n\n var width = graph.get('width');\n var height = graph.get('height');\n var bbox = menuDom.getBoundingClientRect();\n var offsetX = this.get('offsetX') || 0;\n var offsetY = this.get('offsetY') || 0;\n var graphTop = graph.getContainer().offsetTop;\n var graphLeft = graph.getContainer().offsetLeft;\n var x = e.canvasX + graphLeft + offsetX;\n var y = e.canvasY + graphTop + offsetY; // when the menu is (part of) out of the canvas\n\n if (x + bbox.width > width) {\n x = e.canvasX - bbox.width - offsetX + graphLeft;\n }\n\n if (y + bbox.height > height) {\n y = e.canvasY - bbox.height - offsetY + graphTop;\n }\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(menuDom, {\n top: \"\".concat(y, \"px\"),\n left: \"\".concat(x, \"px\"),\n visibility: 'visible'\n }); // 左键单击会触发 body 上监听的 click 事件,导致菜单展示出来后又立即被隐藏了,需要过滤掉\n\n var triggeredByFirstClick = this.get('trigger') === 'click';\n\n var handler = function handler(evt) {\n if (triggeredByFirstClick) {\n triggeredByFirstClick = false;\n return;\n }\n\n self.onMenuHide();\n }; // 如果在页面中其他任意地方进行click, 隐去菜单\n\n\n document.body.addEventListener('click', handler);\n this.set('handler', handler);\n };\n\n Menu.prototype.removeMenuEventListener = function () {\n var handleMenuClickWrapper = this.get('handleMenuClickWrapper');\n var handler = this.get('handler');\n\n if (handleMenuClickWrapper) {\n var menuDom = this.get('menu');\n menuDom.removeEventListener('click', handleMenuClickWrapper);\n this.set('handleMenuClickWrapper', null);\n }\n\n if (handler) {\n document.body.removeEventListener('click', handler);\n }\n };\n\n Menu.prototype.onMenuHide = function () {\n var menuDom = this.get('menu');\n\n if (menuDom) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(menuDom, {\n visibility: 'hidden'\n });\n } // 隐藏菜单后需要移除事件监听\n\n\n this.removeMenuEventListener();\n };\n\n Menu.prototype.destroy = function () {\n var menu = this.get('menu');\n this.removeMenuEventListener();\n\n if (menu) {\n var container = this.get('container');\n\n if (!container) {\n container = this.get('graph').get('container');\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n container.removeChild(menu);\n }\n };\n\n return Menu;\n}(_base__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Menu);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/menu/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * @fileOverview quadTree\n * @author shiwu.wyy@antfin.com\n */\nvar QuadTree = /** @class */ (function () {\n // each quadtree represents a quadrant and an aggregate body\n // that represents all bodies inside the quadrant\n function QuadTree(param) {\n /**\n * (aggregated) body in this quad\n * @type {object}\n */\n this.body = null;\n /**\n * tree representing the northwest quadrant\n * @type {object}\n */\n this.quad = null;\n this.NW = null;\n this.NE = null;\n this.SW = null;\n this.SE = null;\n /**\n * threshold\n * @type {number}\n */\n this.theta = 0.5;\n if (param != null)\n this.quad = param;\n }\n // insert a body(node) into the tree\n QuadTree.prototype.insert = function (bo) {\n // if this node does not contain a body, put the new body bo here\n if (this.body == null) {\n this.body = bo;\n return;\n }\n // internal node\n if (!this._isExternal()) {\n // update mass info\n this.body = this.body.add(bo);\n // insert body into quadrant\n this._putBody(bo);\n }\n else { // external node\n // divide this region into four children\n if (this.quad) {\n this.NW = new QuadTree(this.quad.NW());\n this.NE = new QuadTree(this.quad.NE());\n this.SW = new QuadTree(this.quad.SW());\n this.SE = new QuadTree(this.quad.SE());\n }\n // insert this body and bo\n this._putBody(this.body);\n this._putBody(bo);\n // update the mass info\n this.body = this.body.add(bo);\n }\n };\n // inserts bo into a quad\n // tslint:disable-next-line\n QuadTree.prototype._putBody = function (bo) {\n if (!this.quad)\n return;\n if (bo.in(this.quad.NW()) && this.NW)\n this.NW.insert(bo);\n else if (bo.in(this.quad.NE()) && this.NE)\n this.NE.insert(bo);\n else if (bo.in(this.quad.SW()) && this.SW)\n this.SW.insert(bo);\n else if (bo.in(this.quad.SE()) && this.SE)\n this.SE.insert(bo);\n };\n // tslint:disable-next-line\n QuadTree.prototype._isExternal = function () {\n // four children are null\n return (this.NW == null && this.NE == null && this.SW == null && this.SE == null);\n };\n // update the forces\n QuadTree.prototype.updateForce = function (bo) {\n if (this.body == null || bo === this.body) {\n return;\n }\n // if the current node is external\n if (this._isExternal())\n bo.addForce(this.body);\n // internal nodes\n else {\n var s = this.quad ? this.quad.getLength() : 0;\n var d = this.body.distanceTo(bo);\n // b is far enough\n if ((s / d) < this.theta)\n bo.addForce(this.body);\n else {\n this.NW && this.NW.updateForce(bo);\n this.NE && this.NE.updateForce(bo);\n this.SW && this.SW.updateForce(bo);\n this.SE && this.SE.updateForce(bo);\n }\n }\n };\n return QuadTree;\n}());\nexports.default = QuadTree;\n//# sourceMappingURL=quadTree.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/forceAtlas2/quadTree.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/minimap/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/minimap/index.js ***! - \**********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/fruchterman.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/fruchterman.js ***! + \*************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\n/* harmony import */ var _antv_g_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-svg */ \"./node_modules/@antv/g-svg/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\n\n\nvar max = Math.max;\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_4__[\"ext\"].transform;\nvar DEFAULT_MODE = 'default';\nvar KEYSHAPE_MODE = 'keyShape';\nvar DELEGATE_MODE = 'delegate';\nvar SVG = 'svg';\n\nvar MiniMap =\n/** @class */\nfunction (_super) {\n __extends(MiniMap, _super);\n\n function MiniMap(config) {\n var _this = _super.call(this, config) || this;\n /**\n * 主图更新的监听函数,使用 debounce 减少渲染频率\n * e.g. 拖拽节点只会在松手后的 100ms 后执行 updateCanvas\n * e.g. render 时大量 addItem 也只会执行一次 updateCanvas\n */\n\n\n _this.handleUpdateCanvas = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"debounce\"])(function (event) {\n var self = _this;\n if (self.destroyed) return;\n self.updateCanvas();\n }, 100, false);\n return _this;\n }\n\n MiniMap.prototype.getDefaultCfgs = function () {\n return {\n container: null,\n className: 'g6-minimap',\n viewportClassName: 'g6-minimap-viewport',\n // Minimap 中默认展示和主图一样的内容,KeyShape 只展示节点和边的 key shape 部分,delegate表示展示自定义的rect,用户可自定义样式\n type: 'default',\n padding: 50,\n size: [200, 120],\n delegateStyle: {\n fill: '#40a9ff',\n stroke: '#096dd9'\n },\n refresh: true\n };\n };\n\n MiniMap.prototype.getEvents = function () {\n return {\n beforepaint: 'updateViewport',\n beforeanimate: 'disableRefresh',\n afteranimate: 'enableRefresh',\n viewportchange: 'disableOneRefresh'\n };\n }; // 若是正在进行动画,不刷新缩略图\n\n\n MiniMap.prototype.disableRefresh = function () {\n this.set('refresh', false);\n };\n\n MiniMap.prototype.enableRefresh = function () {\n this.set('refresh', true);\n this.updateCanvas();\n };\n\n MiniMap.prototype.disableOneRefresh = function () {\n this.set('viewportChange', true);\n };\n\n MiniMap.prototype.initViewport = function () {\n var _this = this;\n\n var cfgs = this._cfgs;\n var size = cfgs.size,\n graph = cfgs.graph;\n if (this.destroyed) return;\n var canvas = this.get('canvas');\n var containerDOM = canvas.get('container');\n var viewport = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"createDom\"])(\"\\n \"));\n var isFireFox = navigator.userAgent.toLowerCase().indexOf('firefox') > -1; // 计算拖拽水平方向距离\n\n var x = 0; // 计算拖拽垂直方向距离\n\n var y = 0; // 是否在拖拽minimap的视口\n\n var dragging = false; // 缓存viewport当前对于画布的x\n\n var left = 0; // 缓存viewport当前对于画布的y\n\n var top = 0; // 缓存viewport当前宽度\n\n var width = 0; // 缓存viewport当前高度\n\n var height = 0;\n var ratio = 0;\n var zoom = 0;\n viewport.addEventListener('dragstart', function (e) {\n var _a, _b;\n\n if (e.dataTransfer) {\n var img = new Image();\n img.src = \"data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' %3E%3Cpath /%3E%3C/svg%3E\";\n (_b = (_a = e.dataTransfer).setDragImage) === null || _b === void 0 ? void 0 : _b.call(_a, img, 0, 0);\n\n try {\n e.dataTransfer.setData('text/html', 'view-port-minimap');\n } catch (_c) {\n // support IE\n e.dataTransfer.setData('text', 'view-port-minimap');\n }\n }\n\n cfgs.refresh = false;\n\n if (e.target !== viewport) {\n return;\n } // 如果视口已经最大了,不需要拖拽\n\n\n var style = viewport.style;\n left = parseInt(style.left, 10);\n top = parseInt(style.top, 10);\n width = parseInt(style.width, 10);\n height = parseInt(style.height, 10);\n\n if (width > size[0] || height > size[1]) {\n return;\n }\n\n zoom = graph.getZoom();\n ratio = _this.get('ratio');\n dragging = true;\n x = e.clientX;\n y = e.clientY;\n }, false);\n viewport.addEventListener(isFireFox ? 'dragover' : 'drag', function (e) {\n if (!dragging || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNil\"])(e.clientX) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isNil\"])(e.clientY)) {\n return;\n }\n\n var dx = x - e.clientX;\n var dy = y - e.clientY; // 若视口移动到最左边或最右边了,仅移动到边界\n\n if (left - dx < 0 || left - dx + width >= size[0]) {\n dx = 0;\n } // 若视口移动到最上或最下边了,仅移动到边界\n\n\n if (top - dy < 0 || top - dy + height >= size[1]) {\n dy = 0;\n }\n\n left -= dx;\n top -= dy; // 先移动视口,避免移动到边上以后出现视口闪烁\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"modifyCSS\"])(viewport, {\n left: \"\".concat(left, \"px\"),\n top: \"\".concat(top, \"px\")\n }); // graph 移动需要偏移量 dx/dy * 缩放比例才会得到正确的移动距离\n\n graph.translate(dx * zoom / ratio, dy * zoom / ratio);\n x = e.clientX;\n y = e.clientY;\n }, false);\n viewport.addEventListener('dragend', function () {\n dragging = false;\n cfgs.refresh = true;\n }, false);\n this.set('viewport', viewport);\n containerDOM.appendChild(viewport);\n };\n /**\n * 更新 viewport 视图\n */\n\n\n MiniMap.prototype.updateViewport = function () {\n if (this.destroyed) return;\n var ratio = this.get('ratio');\n var dx = this.get('dx');\n var dy = this.get('dy');\n var totaldx = this.get('totaldx');\n var totaldy = this.get('totaldy');\n var graph = this.get('graph');\n var size = this.get('size');\n var graphWidth = graph.get('width');\n var graphHeight = graph.get('height');\n var topLeft = graph.getPointByCanvas(0, 0);\n var bottomRight = graph.getPointByCanvas(graphWidth, graphHeight);\n var viewport = this.get('viewport');\n\n if (!viewport) {\n this.initViewport();\n } // viewport宽高,左上角点的计算\n\n\n var width = (bottomRight.x - topLeft.x) * ratio;\n var height = (bottomRight.y - topLeft.y) * ratio;\n var left = topLeft.x * ratio + totaldx;\n var top = topLeft.y * ratio + totaldy;\n var right = left + width;\n var bottom = top + height;\n\n if (left < 0) {\n width += left;\n left = 0;\n }\n\n if (right > size[0]) {\n width = width - (right - size[0]);\n }\n\n if (top < 0) {\n height += top;\n top = 0;\n }\n\n if (bottom > size[1]) {\n height = height - (bottom - size[1]);\n } // 缓存目前缩放比,在移动 minimap 视窗时就不用再计算大图的移动量\n\n\n this.set('ratio', ratio);\n var correctLeft = \"\".concat(left, \"px\");\n var correctTop = \"\".concat(top, \"px\");\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"modifyCSS\"])(viewport, {\n left: correctLeft,\n top: correctTop,\n width: \"\".concat(width, \"px\"),\n height: \"\".concat(height, \"px\")\n });\n };\n /**\n * 将主图上的图形完全复制到小图\n */\n\n\n MiniMap.prototype.updateGraphShapes = function () {\n var graph = this._cfgs.graph;\n var canvas = this.get('canvas');\n var graphGroup = graph.get('group');\n if (graphGroup.destroyed) return;\n var clonedGroup = graphGroup.clone();\n clonedGroup.resetMatrix();\n canvas.clear();\n canvas.add(clonedGroup); // 当 renderer 是 svg,由于渲染引擎的 bug,这里需要将 visible 为 false 的元素手动隐藏\n\n var renderer = graph.get('renderer');\n\n if (renderer === SVG) {\n // 递归更新子元素\n this.updateVisible(clonedGroup);\n }\n }; // svg 在 canvas.add(clonedGroup) 之后会出现 visible 为 false 的元素被展示出来,需要递归更新\n\n\n MiniMap.prototype.updateVisible = function (ele) {\n var _this = this;\n\n if (!ele.isGroup() && !ele.get('visible')) {\n ele.hide();\n } else {\n var children = ele.get('children');\n if (!children || !children.length) return;\n children.forEach(function (child) {\n if (!child.get('visible')) child.hide();\n\n _this.updateVisible(child);\n });\n }\n }; // 仅在 minimap 上绘制 keyShape\n // FIXME 如果用户自定义绘制了其他内容,minimap上就无法画出\n\n\n MiniMap.prototype.updateKeyShapes = function () {\n var _this = this;\n\n var graph = this._cfgs.graph;\n var canvas = this.get('canvas');\n var group = canvas.get('children')[0] || canvas.addGroup();\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(graph.getEdges(), function (edge) {\n _this.updateOneEdgeKeyShape(edge, group);\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(graph.getNodes(), function (node) {\n _this.updateOneNodeKeyShape(node, group);\n });\n var combos = graph.getCombos();\n\n if (combos && combos.length) {\n var comboGroup_1 = group.find(function (e) {\n return e.get('name') === 'comboGroup';\n }) || group.addGroup({\n name: 'comboGroup'\n });\n setTimeout(function () {\n if (_this.destroyed) return;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(combos, function (combo) {\n _this.updateOneComboKeyShape(combo, comboGroup_1);\n });\n comboGroup_1 === null || comboGroup_1 === void 0 ? void 0 : comboGroup_1.sort();\n comboGroup_1 === null || comboGroup_1 === void 0 ? void 0 : comboGroup_1.toBack();\n\n _this.updateCanvas();\n }, 250);\n }\n\n this.clearDestroyedShapes();\n };\n /**\n * 增加/更新单个元素的 keyShape\n * @param item ICombo 实例\n */\n\n\n MiniMap.prototype.updateOneComboKeyShape = function (item, comboGroup) {\n if (this.destroyed) return;\n var itemMap = this.get('itemMap') || {}; // 差量更新 minimap 上的一个节点,对应主图的 item\n\n var mappedItem = itemMap[item.get('id')];\n var bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox\n\n var cKeyShape = item.get('keyShape').clone();\n var keyShapeStyle = cKeyShape.attr();\n var attrs = {\n x: bbox.centerX,\n y: bbox.centerY\n };\n\n if (!mappedItem) {\n mappedItem = cKeyShape;\n comboGroup.add(mappedItem);\n } else {\n attrs = Object.assign(keyShapeStyle, attrs);\n }\n\n var shapeType = mappedItem.get('type');\n\n if (shapeType === 'rect' || shapeType === 'image') {\n attrs.x = bbox.minX;\n attrs.y = bbox.minY;\n }\n\n mappedItem.attr(attrs);\n if (!item.isVisible()) mappedItem.hide();else mappedItem.show();\n mappedItem.exist = true;\n var zIndex = item.getModel().depth;\n if (!isNaN(zIndex)) mappedItem.set('zIndex', zIndex);\n itemMap[item.get('id')] = mappedItem;\n this.set('itemMap', itemMap);\n };\n /**\n * 增加/更新单个元素的 keyShape\n * @param item INode 实例\n */\n\n\n MiniMap.prototype.updateOneNodeKeyShape = function (item, group) {\n var itemMap = this.get('itemMap') || {}; // 差量更新 minimap 上的一个节点,对应主图的 item\n\n var mappedItem = itemMap[item.get('id')];\n var bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox\n\n var cKeyShape = item.get('keyShape').clone();\n var keyShapeStyle = cKeyShape.attr();\n var attrs = {\n x: bbox.centerX,\n y: bbox.centerY\n };\n\n if (!mappedItem) {\n mappedItem = cKeyShape;\n group.add(mappedItem);\n } else {\n attrs = Object.assign(keyShapeStyle, attrs);\n }\n\n var shapeType = mappedItem.get('type');\n\n if (shapeType === 'rect' || shapeType === 'image') {\n attrs.x = bbox.minX;\n attrs.y = bbox.minY;\n }\n\n mappedItem.attr(attrs);\n if (!item.isVisible()) mappedItem.hide();else mappedItem.show();\n mappedItem.exist = true;\n var zIndex = item.getModel().depth;\n if (!isNaN(zIndex)) mappedItem.set('zIndex', zIndex);\n itemMap[item.get('id')] = mappedItem;\n this.set('itemMap', itemMap);\n };\n /**\n * Minimap 中展示自定义的rect,支持用户自定义样式和节点大小\n */\n\n\n MiniMap.prototype.updateDelegateShapes = function () {\n var _this = this;\n\n var graph = this._cfgs.graph;\n var canvas = this.get('canvas');\n var group = canvas.get('children')[0] || canvas.addGroup(); // 差量更新 minimap 上的节点和边\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(graph.getEdges(), function (edge) {\n _this.updateOneEdgeKeyShape(edge, group);\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(graph.getNodes(), function (node) {\n _this.updateOneNodeDelegateShape(node, group);\n });\n var combos = graph.getCombos();\n\n if (combos && combos.length) {\n var comboGroup_2 = group.find(function (e) {\n return e.get('name') === 'comboGroup';\n }) || group.addGroup({\n name: 'comboGroup'\n });\n setTimeout(function () {\n if (_this.destroyed) return;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(combos, function (combo) {\n _this.updateOneComboKeyShape(combo, comboGroup_2);\n });\n comboGroup_2 === null || comboGroup_2 === void 0 ? void 0 : comboGroup_2.sort();\n comboGroup_2 === null || comboGroup_2 === void 0 ? void 0 : comboGroup_2.toBack();\n\n _this.updateCanvas();\n }, 250);\n }\n\n this.clearDestroyedShapes();\n };\n\n MiniMap.prototype.clearDestroyedShapes = function () {\n var itemMap = this.get('itemMap') || {};\n var keys = Object.keys(itemMap);\n if (!keys || keys.length === 0) return;\n\n for (var i = keys.length - 1; i >= 0; i--) {\n var shape = itemMap[keys[i]];\n var exist = shape.exist;\n shape.exist = false;\n\n if (!exist) {\n shape.remove();\n delete itemMap[keys[i]];\n }\n }\n };\n /**\n * 设置只显示 edge 的 keyShape\n * @param item IEdge 实例\n */\n\n\n MiniMap.prototype.updateOneEdgeKeyShape = function (item, group) {\n var itemMap = this.get('itemMap') || {}; // 差量更新 minimap 上的一个节点,对应主图的 item\n\n var mappedItem = itemMap[item.get('id')];\n\n if (mappedItem) {\n var path = item.get('keyShape').attr('path');\n mappedItem.attr('path', path);\n } else {\n mappedItem = item.get('keyShape').clone();\n group.add(mappedItem);\n }\n\n if (!item.isVisible()) mappedItem.hide();else mappedItem.show();\n mappedItem.exist = true;\n itemMap[item.get('id')] = mappedItem;\n this.set('itemMap', itemMap);\n };\n /**\n * Minimap 中展示自定义的 rect,支持用户自定义样式和节点大小\n * 增加/更新单个元素\n * @param item INode 实例\n */\n\n\n MiniMap.prototype.updateOneNodeDelegateShape = function (item, group) {\n var delegateStyle = this.get('delegateStyle');\n var itemMap = this.get('itemMap') || {}; // 差量更新 minimap 上的一个节点,对应主图的 item\n\n var mappedItem = itemMap[item.get('id')];\n var bbox = item.getBBox(); // 计算了节点父组矩阵的 bbox\n\n if (mappedItem) {\n var attrs = {\n x: bbox.minX,\n y: bbox.minY,\n width: bbox.width,\n height: bbox.height\n };\n mappedItem.attr(attrs);\n } else {\n mappedItem = group.addShape('rect', {\n attrs: __assign({\n x: bbox.minX,\n y: bbox.minY,\n width: bbox.width,\n height: bbox.height\n }, delegateStyle),\n name: 'minimap-node-shape'\n });\n }\n\n if (!item.isVisible()) mappedItem.hide();else mappedItem.show();\n mappedItem.exist = true;\n itemMap[item.get('id')] = mappedItem;\n this.set('itemMap', itemMap);\n };\n\n MiniMap.prototype.init = function () {\n this.initContainer();\n this.get('graph').on('afterupdateitem', this.handleUpdateCanvas);\n this.get('graph').on('afteritemstatechange', this.handleUpdateCanvas);\n this.get('graph').on('afteradditem', this.handleUpdateCanvas);\n this.get('graph').on('afterremoveitem', this.handleUpdateCanvas);\n this.get('graph').on('afterrender', this.handleUpdateCanvas);\n this.get('graph').on('afterlayout', this.handleUpdateCanvas);\n };\n /**\n * 初始化 Minimap 的容器\n */\n\n\n MiniMap.prototype.initContainer = function () {\n var self = this;\n var graph = self.get('graph');\n var size = self.get('size');\n var className = self.get('className');\n var parentNode = self.get('container');\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"createDom\"])(\"
\"));\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isString\"])(parentNode)) {\n parentNode = document.getElementById(parentNode);\n }\n\n if (parentNode) {\n parentNode.appendChild(container);\n } else {\n graph.get('container').appendChild(container);\n }\n\n self.set('container', container);\n var containerDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_3__[\"createDom\"])('
');\n container.appendChild(containerDOM);\n containerDOM.addEventListener('dragenter', function (e) {\n e.preventDefault();\n });\n containerDOM.addEventListener('dragover', function (e) {\n e.preventDefault();\n });\n var canvas;\n var renderer = graph.get('renderer');\n\n if (renderer === SVG) {\n canvas = new _antv_g_svg__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"]({\n container: containerDOM,\n width: size[0],\n height: size[1]\n });\n } else {\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_0__[\"Canvas\"]({\n container: containerDOM,\n width: size[0],\n height: size[1]\n });\n }\n\n self.set('canvas', canvas);\n self.updateCanvas();\n };\n\n MiniMap.prototype.updateCanvas = function () {\n if (this.destroyed) return; // 如果是在动画,则不刷新视图\n\n var isRefresh = this.get('refresh');\n\n if (!isRefresh) {\n return;\n }\n\n var graph = this.get('graph');\n\n if (graph.get('destroyed')) {\n return;\n } // 如果是视口变换,也不刷新视图,但是需要重置视口大小和位置\n\n\n if (this.get('viewportChange')) {\n this.set('viewportChange', false);\n this.updateViewport();\n }\n\n var size = this.get('size'); // 用户定义的 minimap size\n\n var canvas = this.get('canvas'); // minimap 的 canvas\n\n var type = this.get('type'); // minimap 的类型\n\n var padding = this.get('padding'); // 用户额定义的 minimap 的 padding\n\n if (canvas.destroyed) {\n return;\n }\n\n switch (type) {\n case DEFAULT_MODE:\n this.updateGraphShapes();\n break;\n\n case KEYSHAPE_MODE:\n this.updateKeyShapes();\n break;\n\n case DELEGATE_MODE:\n // 得到的节点直接带有 x 和 y,每个节点不存在父 group,即每个节点位置不由父 group 控制\n this.updateDelegateShapes();\n break;\n\n default:\n break;\n }\n\n var group = canvas.get('children')[0];\n if (!group) return;\n group.resetMatrix(); // 该 bbox 是准确的,不计算 matrix 的包围盒\n\n var bbox = group.getCanvasBBox();\n var graphBBox = graph.get('canvas').getCanvasBBox(); // 主图的 bbox\n\n var graphZoom = graph.getZoom() || 1;\n var width = graphBBox.width / graphZoom;\n var height = graphBBox.height / graphZoom;\n\n if (Number.isFinite(bbox.width)) {\n // 刷新后bbox可能会变,需要重置画布矩阵以缩放到合适的大小\n width = max(bbox.width, width);\n height = max(bbox.height, height);\n }\n\n width += 2 * padding;\n height += 2 * padding;\n var ratio = Math.min(size[0] / width, size[1] / height);\n var matrix = [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var minX = 0;\n var minY = 0; // 平移到左上角\n\n if (Number.isFinite(bbox.minX)) {\n minX = -bbox.minX;\n }\n\n if (Number.isFinite(bbox.minY)) {\n minY = -bbox.minY;\n } // 缩放到适合视口后, 平移到画布中心\n\n\n var dx = (size[0] - (width - 2 * padding) * ratio) / 2;\n var dy = (size[1] - (height - 2 * padding) * ratio) / 2;\n matrix = transform(matrix, [['t', minX, minY], ['s', ratio, ratio], ['t', dx, dy] // 移动到画布中心\n ]);\n group.setMatrix(matrix); // 更新minimap视口\n\n this.set('ratio', ratio);\n this.set('totaldx', dx + minX * ratio);\n this.set('totaldy', dy + minY * ratio);\n this.set('dx', dx);\n this.set('dy', dy);\n this.updateViewport();\n };\n /**\n * 获取minimap的画布\n * @return {GCanvas} G的canvas实例\n */\n\n\n MiniMap.prototype.getCanvas = function () {\n return this.get('canvas');\n };\n /**\n * 获取minimap的窗口\n * @return {HTMLElement} 窗口的dom实例\n */\n\n\n MiniMap.prototype.getViewport = function () {\n return this.get('viewport');\n };\n /**\n * 获取minimap的容器dom\n * @return {HTMLElement} dom\n */\n\n\n MiniMap.prototype.getContainer = function () {\n return this.get('container');\n };\n\n MiniMap.prototype.destroy = function () {\n var _a;\n\n (_a = this.get('canvas')) === null || _a === void 0 ? void 0 : _a.destroy();\n var container = this.get('container');\n if (container === null || container === void 0 ? void 0 : container.parentNode) container.parentNode.removeChild(container);\n };\n\n return MiniMap;\n}(_base__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (MiniMap);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/minimap/index.js?"); +eval("\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FruchtermanLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar SPEED_DIVISOR = 800;\n/**\n * fruchterman 布局\n */\nvar FruchtermanLayout = /** @class */ (function (_super) {\n __extends(FruchtermanLayout, _super);\n function FruchtermanLayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 是否启动 worker */\n _this.workerEnabled = false;\n /** 重力大小,影响图的紧凑程度 */\n _this.gravity = 10;\n /** 速度 */\n _this.speed = 5;\n /** 是否产生聚类力 */\n _this.clustering = false;\n /** 聚类力大小 */\n _this.clusterGravity = 10;\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n /** 每次迭代结束的回调函数 */\n _this.tick = function () { };\n /** 是否使用 window.setInterval 运行迭代 */\n _this.animate = true;\n _this.updateCfg(options);\n return _this;\n }\n FruchtermanLayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 1000,\n gravity: 10,\n speed: 1,\n clustering: false,\n clusterGravity: 10,\n animate: true\n };\n };\n /**\n * 执行布局\n */\n FruchtermanLayout.prototype.execute = function () {\n var _this = this;\n var _a, _b;\n var self = this;\n var nodes = self.nodes;\n if (self.timeInterval !== undefined && typeof window !== \"undefined\") {\n window.clearInterval(self.timeInterval);\n }\n if (!nodes || nodes.length === 0) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n (_b = self.onLayoutEnd) === null || _b === void 0 ? void 0 : _b.call(self);\n return;\n }\n var nodeMap = {};\n var nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * _this.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * _this.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n // layout\n return self.run();\n };\n FruchtermanLayout.prototype.run = function () {\n var _a;\n var self = this;\n var nodes = self.nodes;\n if (!nodes)\n return;\n var edges = self.edges, maxIteration = self.maxIteration, workerEnabled = self.workerEnabled, clustering = self.clustering, animate = self.animate;\n var clusterMap = {};\n if (clustering) {\n nodes.forEach(function (n) {\n if (clusterMap[n.cluster] === undefined) {\n clusterMap[n.cluster] = {\n name: n.cluster,\n cx: 0,\n cy: 0,\n count: 0\n };\n }\n });\n }\n if (workerEnabled || !animate) {\n for (var i = 0; i < maxIteration; i++) {\n self.runOneStep(clusterMap);\n }\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n }\n else {\n if (typeof window === \"undefined\")\n return;\n var iter_1 = 0;\n // interval for render the result after each iteration\n this.timeInterval = window.setInterval(function () {\n var _a;\n self.runOneStep(clusterMap);\n iter_1++;\n if (iter_1 >= maxIteration) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n window.clearInterval(self.timeInterval);\n }\n }, 0);\n }\n return {\n nodes: nodes,\n edges: edges\n };\n };\n FruchtermanLayout.prototype.runOneStep = function (clusterMap) {\n var _a;\n var self = this;\n var nodes = self.nodes;\n if (!nodes)\n return;\n var edges = self.edges, center = self.center, gravity = self.gravity, speed = self.speed, clustering = self.clustering;\n var area = self.height * self.width;\n var maxDisplace = Math.sqrt(area) / 10;\n var k2 = area / (nodes.length + 1);\n var k = Math.sqrt(k2);\n var displacements = [];\n nodes.forEach(function (_, j) {\n displacements[j] = { x: 0, y: 0 };\n });\n self.applyCalculate(nodes, edges, displacements, k, k2);\n // gravity for clusters\n if (clustering) {\n // re-compute the clustering centers\n for (var key in clusterMap) {\n clusterMap[key].cx = 0;\n clusterMap[key].cy = 0;\n clusterMap[key].count = 0;\n }\n nodes.forEach(function (n) {\n var c = clusterMap[n.cluster];\n if ((0, util_1.isNumber)(n.x)) {\n c.cx += n.x;\n }\n if ((0, util_1.isNumber)(n.y)) {\n c.cy += n.y;\n }\n c.count++;\n });\n for (var key in clusterMap) {\n clusterMap[key].cx /= clusterMap[key].count;\n clusterMap[key].cy /= clusterMap[key].count;\n }\n // compute the cluster gravity forces\n var clusterGravity_1 = self.clusterGravity || gravity;\n nodes.forEach(function (n, j) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n var c = clusterMap[n.cluster];\n var distLength = Math.sqrt((n.x - c.cx) * (n.x - c.cx) + (n.y - c.cy) * (n.y - c.cy));\n var gravityForce = k * clusterGravity_1;\n displacements[j].x -= (gravityForce * (n.x - c.cx)) / distLength;\n displacements[j].y -= (gravityForce * (n.y - c.cy)) / distLength;\n });\n }\n // gravity\n nodes.forEach(function (n, j) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n var gravityForce = 0.01 * k * gravity;\n displacements[j].x -= gravityForce * (n.x - center[0]);\n displacements[j].y -= gravityForce * (n.y - center[1]);\n });\n // move\n nodes.forEach(function (n, j) {\n if ((0, util_1.isNumber)(n.fx) && (0, util_1.isNumber)(n.fy)) {\n n.x = n.fx;\n n.y = n.fy;\n return;\n }\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n var distLength = Math.sqrt(displacements[j].x * displacements[j].x +\n displacements[j].y * displacements[j].y);\n if (distLength > 0) {\n // && !n.isFixed()\n var limitedDist = Math.min(maxDisplace * (speed / SPEED_DIVISOR), distLength);\n n.x += (displacements[j].x / distLength) * limitedDist;\n n.y += (displacements[j].y / distLength) * limitedDist;\n }\n });\n (_a = self.tick) === null || _a === void 0 ? void 0 : _a.call(self);\n };\n FruchtermanLayout.prototype.applyCalculate = function (nodes, edges, displacements, k, k2) {\n var self = this;\n self.calRepulsive(nodes, displacements, k2);\n if (edges)\n self.calAttractive(edges, displacements, k);\n };\n FruchtermanLayout.prototype.calRepulsive = function (nodes, displacements, k2) {\n nodes.forEach(function (v, i) {\n displacements[i] = { x: 0, y: 0 };\n nodes.forEach(function (u, j) {\n if (i === j) {\n return;\n }\n if (!(0, util_1.isNumber)(v.x) ||\n !(0, util_1.isNumber)(u.x) ||\n !(0, util_1.isNumber)(v.y) ||\n !(0, util_1.isNumber)(u.y)) {\n return;\n }\n var vecX = v.x - u.x;\n var vecY = v.y - u.y;\n var vecLengthSqr = vecX * vecX + vecY * vecY;\n if (vecLengthSqr === 0) {\n vecLengthSqr = 1;\n var sign = i > j ? 1 : -1;\n vecX = 0.01 * sign;\n vecY = 0.01 * sign;\n }\n var common = k2 / vecLengthSqr;\n displacements[i].x += vecX * common;\n displacements[i].y += vecY * common;\n });\n });\n };\n FruchtermanLayout.prototype.calAttractive = function (edges, displacements, k) {\n var _this = this;\n edges.forEach(function (e) {\n var source = (0, util_1.getEdgeTerminal)(e, 'source');\n var target = (0, util_1.getEdgeTerminal)(e, 'target');\n if (!source || !target)\n return;\n var uIndex = _this.nodeIdxMap[source];\n var vIndex = _this.nodeIdxMap[target];\n if (uIndex === vIndex) {\n return;\n }\n var u = _this.nodeMap[source];\n var v = _this.nodeMap[target];\n if (!(0, util_1.isNumber)(v.x) || !(0, util_1.isNumber)(u.x) || !(0, util_1.isNumber)(v.y) || !(0, util_1.isNumber)(u.y)) {\n return;\n }\n var vecX = v.x - u.x;\n var vecY = v.y - u.y;\n var vecLength = Math.sqrt(vecX * vecX + vecY * vecY);\n var common = (vecLength * vecLength) / k;\n displacements[vIndex].x -= (vecX / vecLength) * common;\n displacements[vIndex].y -= (vecY / vecLength) * common;\n displacements[uIndex].x += (vecX / vecLength) * common;\n displacements[uIndex].y += (vecY / vecLength) * common;\n });\n };\n FruchtermanLayout.prototype.stop = function () {\n if (this.timeInterval && typeof window !== \"undefined\") {\n window.clearInterval(this.timeInterval);\n }\n };\n FruchtermanLayout.prototype.destroy = function () {\n var self = this;\n self.stop();\n self.tick = null;\n self.nodes = null;\n self.edges = null;\n self.destroyed = true;\n };\n FruchtermanLayout.prototype.getType = function () {\n return \"fruchterman\";\n };\n return FruchtermanLayout;\n}(base_1.Base));\nexports.FruchtermanLayout = FruchtermanLayout;\n//# sourceMappingURL=fruchterman.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/fruchterman.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/snapline/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/snapline/index.js ***! - \***********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/gForce.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/gForce.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g6-core */ \"./node_modules/@antv/g6-core/es/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\nvar pointLineDistance = _antv_g6_core__WEBPACK_IMPORTED_MODULE_1__[\"Util\"].pointLineDistance; // 对齐线样式\n\nvar alignLineStyle = {\n stroke: '#FA8C16',\n lineWidth: 1\n};\n\nvar SnapLine =\n/** @class */\nfunction (_super) {\n __extends(SnapLine, _super);\n\n function SnapLine(props) {\n return _super.call(this, props) || this;\n }\n\n SnapLine.prototype.getDefaultCfgs = function () {\n return {\n line: alignLineStyle,\n\n /**\n * item align type\n * @type {String|True|False}\n */\n itemAlignType: 'center',\n\n /**\n * tolerance to item force align\n * @type {String|True|False}\n */\n tolerance: 5,\n horizontalLines: {},\n verticalLines: {},\n alignLines: []\n };\n };\n\n SnapLine.prototype.init = function () {}; // class-methods-use-this\n\n\n SnapLine.prototype.getEvents = function () {\n return {\n 'node:dragstart': 'onDragStart',\n 'node:drag': 'onDrag',\n 'node:dragend': 'onDragEnd'\n };\n };\n\n SnapLine.prototype.onDragStart = function () {\n this.initBoxLine();\n };\n\n SnapLine.prototype.onDrag = function (e) {\n var item = e.item; // 计算辅助线位置,拖动过程中更新辅助线\n\n var delegateShape = item.get('delegateShape') || item;\n var bbox = delegateShape.getBBox();\n var model = item.getModel();\n var dx = model.x - bbox.x;\n var dy = model.y - bbox.y;\n this.show({\n x: bbox.minX + dx,\n y: bbox.minY + dy\n }, {\n width: bbox.width,\n height: bbox.height\n });\n };\n\n SnapLine.prototype.onDragEnd = function () {\n // 拖动结束时候删除辅助线\n this.destory();\n };\n /**\n * 每次开始拖动之前,计算出所有节点在水平和垂直方向上,左中右三条中线,并缓存起来\n *\n * @param {object} item Node节点\n * @memberof AlignLine\n */\n\n\n SnapLine.prototype.initBoxLine = function () {\n var _a = this._cfgs,\n horizontalLines = _a.horizontalLines,\n verticalLines = _a.verticalLines,\n itemAlignType = _a.itemAlignType;\n var graph = this.get('graph');\n var nodes = graph.getNodes();\n nodes.forEach(function (item) {\n var bbox = item.getBBox();\n var nodeId = item.get('id'); // 设置水平方向辅助线\n\n if (itemAlignType === true || itemAlignType === 'horizontal') {\n // tltr: top left top right\n // lcrc: left center right center\n // blbr: bottom left bottom right\n horizontalLines[\"\".concat(nodeId, \"tltr\")] = [bbox.minX, bbox.minY, bbox.maxX, bbox.minY, item];\n horizontalLines[\"\".concat(nodeId, \"lcrc\")] = [bbox.minX, bbox.centerY, bbox.maxX, bbox.centerY, item];\n horizontalLines[\"\".concat(nodeId, \"blbr\")] = [bbox.minX, bbox.maxY, bbox.maxX, bbox.maxY, item];\n } else if (itemAlignType === 'center') {\n horizontalLines[\"\".concat(nodeId, \"lcrc\")] = [bbox.minX, bbox.centerY, bbox.maxX, bbox.centerY, item];\n } // 设置垂直方向辅助线\n\n\n if (itemAlignType === true || itemAlignType === 'vertical') {\n // tlbl: top left bottom left\n // tcbc: top center bottom center\n // trbr: top right bottom right\n verticalLines[\"\".concat(nodeId, \"tlbl\")] = [bbox.minX, bbox.minY, bbox.minX, bbox.maxY, item];\n verticalLines[\"\".concat(nodeId, \"tcbc\")] = [bbox.centerX, bbox.minY, bbox.centerX, bbox.maxY, item];\n verticalLines[\"\".concat(nodeId, \"trbr\")] = [bbox.maxX, bbox.minY, bbox.maxX, bbox.maxY, item];\n } else if (itemAlignType === 'center') {\n verticalLines[\"\".concat(nodeId, \"tcbc\")] = [bbox.centerX, bbox.minY, bbox.centerX, bbox.maxY, item];\n }\n });\n };\n /**\n * 显示AlignLine\n *\n * @param {object} point 起始点\n * @param {object} bbox BBox\n * @returns\n * @memberof AlignLine\n */\n\n\n SnapLine.prototype.show = function (point, bbox) {\n var originPoint = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"mix\"])({}, point);\n this.itemAlign(point, bbox, originPoint);\n return point;\n };\n /**\n * 拖动拖出中添加辅助线\n *\n * @param {object} point 起始点\n * @param {object} bbox 代理形状的bbox\n * @param {object} originPoint 原始点,同point\n * @memberof AlignLine\n */\n\n\n SnapLine.prototype.itemAlign = function (point, bbox, originPoint) {\n var _this = this;\n\n var _a = this._cfgs,\n horizontalLines = _a.horizontalLines,\n verticalLines = _a.verticalLines,\n tolerance = _a.tolerance;\n var tc = {\n x: originPoint.x + bbox.width / 2,\n y: originPoint.y\n };\n var cc = {\n x: originPoint.x + bbox.width / 2,\n y: originPoint.y + bbox.height / 2\n };\n var bc = {\n x: originPoint.x + bbox.width / 2,\n y: originPoint.y + bbox.height\n };\n var lc = {\n x: originPoint.x,\n y: originPoint.y + bbox.height / 2\n };\n var rc = {\n x: originPoint.x + bbox.width,\n y: originPoint.y + bbox.height / 2\n };\n var horizontalDis = [];\n var verticalDis = [];\n var alignCfg = null;\n this.clearAlignLine();\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(horizontalLines, function (line) {\n if (line[4].isVisible) {\n horizontalDis.push(_this.getLineDisObject(line, tc));\n horizontalDis.push(_this.getLineDisObject(line, cc));\n horizontalDis.push(_this.getLineDisObject(line, bc));\n }\n });\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(verticalLines, function (line) {\n if (line[4].isVisible) {\n verticalDis.push(_this.getLineDisObject(line, lc));\n verticalDis.push(_this.getLineDisObject(line, cc));\n verticalDis.push(_this.getLineDisObject(line, rc));\n }\n });\n horizontalDis.sort(function (a, b) {\n return a.dis - b.dis;\n });\n verticalDis.sort(function (a, b) {\n return a.dis - b.dis;\n });\n\n if (horizontalDis.length !== 0 && horizontalDis[0].dis < tolerance) {\n point.y = horizontalDis[0].line[1] - horizontalDis[0].point.y + originPoint.y;\n alignCfg = {\n type: 'item',\n horizontals: [horizontalDis[0]]\n };\n\n for (var i = 1; i < 3; i++) {\n if (horizontalDis[0].dis === horizontalDis[i].dis) {\n alignCfg.horizontals.push(horizontalDis[i]);\n }\n }\n }\n\n if (verticalDis.length !== 0 && verticalDis[0].dis < tolerance) {\n point.x = verticalDis[0].line[0] - verticalDis[0].point.x + originPoint.x;\n\n if (!alignCfg) {\n alignCfg = {\n type: 'item',\n verticals: [verticalDis[0]]\n };\n } else {\n alignCfg.verticals = [verticalDis[0]];\n }\n\n for (var i = 1; i < 3; i++) {\n if (verticalDis[0].dis === verticalDis[i].dis) {\n alignCfg.verticals.push(verticalDis[i]);\n }\n }\n }\n\n if (alignCfg) {\n alignCfg.bbox = bbox;\n this.addAlignLine(alignCfg);\n }\n };\n /**\n * 根据配置项添加辅助线\n *\n * @param {object} cfg\n * @memberof AlignLine\n */\n\n\n SnapLine.prototype.addAlignLine = function (cfg) {\n var bbox = cfg.bbox,\n type = cfg.type,\n horizontals = cfg.horizontals,\n verticals = cfg.verticals;\n var _a = this._cfgs,\n lineStyle = _a.line,\n alignLines = _a.alignLines;\n var graph = this.get('graph');\n var group = graph.get('group');\n\n if (type === 'item') {\n if (horizontals) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(horizontals, function (horizontal) {\n var refLine = horizontal.line,\n refPoint = horizontal.point;\n var lineCenterX = (refLine[0] + refLine[2]) / 2;\n var x1;\n var x2;\n\n if (refPoint.x < lineCenterX) {\n x1 = refPoint.x - bbox.width / 2;\n x2 = Math.max(refLine[0], refLine[2]);\n } else {\n x1 = refPoint.x + bbox.width / 2;\n x2 = Math.min(refLine[0], refLine[2]);\n }\n\n var lineAttrs = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"mix\"])({\n x1: x1,\n y1: refLine[1],\n x2: x2,\n y2: refLine[1]\n }, lineStyle);\n var line = group.addShape('line', {\n attrs: lineAttrs,\n capture: false\n });\n alignLines.push(line);\n });\n }\n\n if (verticals) {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(verticals, function (vertical) {\n var refLine = vertical.line,\n refPoint = vertical.point;\n var lineCenterY = (refLine[1] + refLine[3]) / 2;\n var y1;\n var y2;\n\n if (refPoint.y < lineCenterY) {\n y1 = refPoint.y - bbox.height / 2;\n y2 = Math.max(refLine[1], refLine[3]);\n } else {\n y1 = refPoint.y + bbox.height / 2;\n y2 = Math.min(refLine[1], refLine[3]);\n }\n\n var lineAtts = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"mix\"])({\n x1: refLine[0],\n y1: y1,\n x2: refLine[0],\n y2: y2\n }, lineStyle);\n var line = group.addShape('line', {\n attrs: lineAtts,\n capture: false\n });\n alignLines.push(line);\n });\n }\n }\n };\n /**\n * 获取点到线的距离\n *\n * @param {array} line [x1, y1, x2, y2] 线的四个点\n * @param {object} point 点的x和y坐标点 {x, y}\n * @returns\n * @memberof AlignLine\n */\n\n\n SnapLine.prototype.getLineDisObject = function (line, point) {\n return {\n line: line,\n point: point,\n dis: pointLineDistance(line, point)\n };\n };\n\n SnapLine.prototype.getContainer = function () {\n return this.get('container');\n };\n /**\n * 拖动过程中,清楚上次绘制的线\n *\n * @memberof AlignLine\n */\n\n\n SnapLine.prototype.clearAlignLine = function () {\n var alignLines = this._cfgs.alignLines;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(alignLines, function (line) {\n line.remove();\n });\n alignLines.length = 0;\n };\n /**\n * 拖动结束时候,情况缓存的节点的辅助线,同时删除绘制的线\n *\n * @memberof AlignLine\n */\n\n\n SnapLine.prototype.destory = function () {\n var _a = this._cfgs,\n horizontalLines = _a.horizontalLines,\n verticalLines = _a.verticalLines;\n var graph = this.get('graph');\n var nodes = graph.getNodes();\n nodes.forEach(function (node) {\n var itemId = node.get('id');\n delete horizontalLines[\"\".concat(itemId, \"tltr\")];\n delete horizontalLines[\"\".concat(itemId, \"lcrc\")];\n delete horizontalLines[\"\".concat(itemId, \"blbr\")];\n delete verticalLines[\"\".concat(itemId, \"tlbl\")];\n delete verticalLines[\"\".concat(itemId, \"tcbc\")];\n delete verticalLines[\"\".concat(itemId, \"trbr\")];\n });\n this.clearAlignLine();\n };\n\n return SnapLine;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (SnapLine);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/snapline/index.js?"); +eval("\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GForceLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar proccessToFunc = function (value, defaultV) {\n var func;\n if (!value) {\n func = function (d) {\n return defaultV || 1;\n };\n }\n else if ((0, util_1.isNumber)(value)) {\n func = function (d) {\n return value;\n };\n }\n else {\n func = value;\n }\n return func;\n};\n/**\n * graphin 中的 force 布局\n */\nvar GForceLayout = /** @class */ (function (_super) {\n __extends(GForceLayout, _super);\n function GForceLayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 500;\n /** 是否启动 worker */\n _this.workerEnabled = false;\n /** 弹簧引力系数 */\n _this.edgeStrength = 200;\n /** 斥力系数 */\n _this.nodeStrength = 1000;\n /** 库伦系数 */\n _this.coulombDisScale = 0.005;\n /** 阻尼系数 */\n _this.damping = 0.9;\n /** 最大速度 */\n _this.maxSpeed = 1000;\n /** 一次迭代的平均移动距离小于该值时停止迭代 */\n _this.minMovement = 0.5;\n /** 迭代中衰减 */\n _this.interval = 0.02;\n /** 斥力的一个系数 */\n _this.factor = 1;\n /** 理想边长 */\n _this.linkDistance = 1;\n /** 重力大小 */\n _this.gravity = 10;\n /** 是否防止重叠 */\n _this.preventOverlap = true;\n /** 防止重叠的力大小参数 */\n _this.collideStrength = 1;\n /** 每次迭代结束的回调函数 */\n _this.tick = function () { };\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n /** 是否使用 window.setInterval 运行迭代 */\n _this.animate = true;\n _this.updateCfg(options);\n return _this;\n }\n GForceLayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 500,\n gravity: 10,\n enableTick: true,\n animate: true,\n };\n };\n /**\n * 执行布局\n */\n GForceLayout.prototype.execute = function () {\n var _a, _b;\n var self = this;\n var nodes = self.nodes;\n if (self.timeInterval !== undefined && typeof window !== \"undefined\") {\n window.clearInterval(self.timeInterval);\n }\n if (!nodes || nodes.length === 0) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n (_b = self.onLayoutEnd) === null || _b === void 0 ? void 0 : _b.call(self);\n return;\n }\n var nodeMap = {};\n var nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * self.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * self.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n self.linkDistance = proccessToFunc(self.linkDistance, 1);\n self.nodeStrength = proccessToFunc(self.nodeStrength, 1);\n self.edgeStrength = proccessToFunc(self.edgeStrength, 1);\n // node size function\n var nodeSize = self.nodeSize;\n var nodeSizeFunc;\n if (self.preventOverlap) {\n var nodeSpacing_1 = self.nodeSpacing;\n var nodeSpacingFunc_1;\n if ((0, util_1.isNumber)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = function () { return nodeSpacing_1; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = nodeSpacing_1;\n }\n else {\n nodeSpacingFunc_1 = function () { return 0; };\n }\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return Math.max(d.size[0], d.size[1]) + nodeSpacingFunc_1(d);\n }\n if ((0, util_1.isObject)(d.size)) {\n return Math.max(d.size.width, d.size.height) + nodeSpacingFunc_1(d);\n }\n return d.size + nodeSpacingFunc_1(d);\n }\n return 10 + nodeSpacingFunc_1(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function (d) {\n return Math.max(nodeSize[0], nodeSize[1]) + nodeSpacingFunc_1(d);\n };\n }\n else {\n nodeSizeFunc = function (d) { return nodeSize + nodeSpacingFunc_1(d); };\n }\n }\n self.nodeSize = nodeSizeFunc;\n var edges = self.edges;\n self.degrees = (0, util_1.getDegree)(nodes.length, self.nodeIdxMap, edges);\n if (!self.getMass) {\n self.getMass = function (d) {\n var mass = d.mass || self.degrees[self.nodeIdxMap[d.id]].all || 1;\n return mass;\n };\n }\n // layout\n self.run();\n };\n GForceLayout.prototype.run = function () {\n var _a;\n var self = this;\n var maxIteration = self.maxIteration, nodes = self.nodes, workerEnabled = self.workerEnabled, minMovement = self.minMovement, animate = self.animate;\n if (!nodes)\n return;\n if (workerEnabled || !animate) {\n for (var i = 0; i < maxIteration; i++) {\n var previousPos = self.runOneStep(i);\n if (self.reachMoveThreshold(nodes, previousPos, minMovement)) {\n break;\n }\n }\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n }\n else {\n if (typeof window === \"undefined\")\n return;\n var iter_1 = 0;\n // interval for render the result after each iteration\n this.timeInterval = window.setInterval(function () {\n var _a, _b;\n if (!nodes)\n return;\n var previousPos = self.runOneStep(iter_1) || [];\n if (self.reachMoveThreshold(nodes, previousPos, minMovement)) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n window.clearInterval(self.timeInterval);\n }\n iter_1++;\n if (iter_1 >= maxIteration) {\n (_b = self.onLayoutEnd) === null || _b === void 0 ? void 0 : _b.call(self);\n window.clearInterval(self.timeInterval);\n }\n }, 0);\n }\n };\n GForceLayout.prototype.reachMoveThreshold = function (nodes, previousPos, minMovement) {\n // whether to stop the iteration\n var movement = 0;\n nodes.forEach(function (node, j) {\n var vx = node.x - previousPos[j].x;\n var vy = node.y - previousPos[j].y;\n movement += Math.sqrt(vx * vx + vy * vy);\n });\n movement /= nodes.length;\n return movement < minMovement;\n };\n GForceLayout.prototype.runOneStep = function (iter) {\n var _a;\n var self = this;\n var nodes = self.nodes, edges = self.edges;\n var accArray = [];\n var velArray = [];\n if (!nodes)\n return;\n nodes.forEach(function (_, i) {\n accArray[2 * i] = 0;\n accArray[2 * i + 1] = 0;\n velArray[2 * i] = 0;\n velArray[2 * i + 1] = 0;\n });\n self.calRepulsive(accArray, nodes);\n if (edges)\n self.calAttractive(accArray, edges);\n self.calGravity(accArray, nodes);\n var stepInterval = Math.max(0.02, self.interval - iter * 0.002);\n self.updateVelocity(accArray, velArray, stepInterval, nodes);\n var previousPos = [];\n nodes.forEach(function (node) {\n previousPos.push({\n x: node.x,\n y: node.y\n });\n });\n self.updatePosition(velArray, stepInterval, nodes);\n (_a = self.tick) === null || _a === void 0 ? void 0 : _a.call(self);\n return previousPos;\n };\n GForceLayout.prototype.calRepulsive = function (accArray, nodes) {\n var self = this;\n var getMass = self.getMass, factor = self.factor, coulombDisScale = self.coulombDisScale, preventOverlap = self.preventOverlap, _a = self.collideStrength, collideStrength = _a === void 0 ? 1 : _a;\n var nodeStrength = self.nodeStrength;\n var nodeSize = self.nodeSize;\n nodes.forEach(function (ni, i) {\n var massi = getMass ? getMass(ni) : 1;\n nodes.forEach(function (nj, j) {\n if (i >= j)\n return;\n // if (!accArray[j]) accArray[j] = 0;\n var vecX = ni.x - nj.x;\n var vecY = ni.y - nj.y;\n if (vecX === 0 && vecY === 0) {\n vecX = Math.random() * 0.01;\n vecY = Math.random() * 0.01;\n }\n var lengthSqr = vecX * vecX + vecY * vecY;\n var vecLength = Math.sqrt(lengthSqr);\n var nVecLength = (vecLength + 0.1) * coulombDisScale;\n var direX = vecX / vecLength;\n var direY = vecY / vecLength;\n var param = (((nodeStrength(ni) + nodeStrength(nj)) * 0.5) * factor) /\n (nVecLength * nVecLength);\n var massj = getMass ? getMass(nj) : 1;\n accArray[2 * i] += (direX * param);\n accArray[2 * i + 1] += (direY * param);\n accArray[2 * j] -= (direX * param);\n accArray[2 * j + 1] -= (direY * param);\n if (preventOverlap && (nodeSize(ni) + nodeSize(nj)) / 2 > vecLength) {\n var paramOverlap = collideStrength * (nodeStrength(ni) + nodeStrength(nj)) * 0.5 / lengthSqr;\n accArray[2 * i] += (direX * paramOverlap) / massi;\n accArray[2 * i + 1] += (direY * paramOverlap) / massi;\n accArray[2 * j] -= (direX * paramOverlap) / massj;\n accArray[2 * j + 1] -= (direY * paramOverlap) / massj;\n }\n });\n });\n };\n GForceLayout.prototype.calAttractive = function (accArray, edges) {\n var self = this;\n var nodeMap = self.nodeMap, nodeIdxMap = self.nodeIdxMap, linkDistance = self.linkDistance, edgeStrength = self.edgeStrength;\n var nodeSize = self.nodeSize;\n var getMass = self.getMass;\n edges.forEach(function (edge, i) {\n var source = (0, util_1.getEdgeTerminal)(edge, 'source');\n var target = (0, util_1.getEdgeTerminal)(edge, 'target');\n var sourceNode = nodeMap[source];\n var targetNode = nodeMap[target];\n var vecX = targetNode.x - sourceNode.x;\n var vecY = targetNode.y - sourceNode.y;\n if (vecX === 0 && vecY === 0) {\n vecX = Math.random() * 0.01;\n vecY = Math.random() * 0.01;\n }\n var vecLength = Math.sqrt(vecX * vecX + vecY * vecY);\n var direX = vecX / vecLength;\n var direY = vecY / vecLength;\n var length = linkDistance(edge, sourceNode, targetNode) || 1 + ((nodeSize(sourceNode) + nodeSize(targetNode)) || 0) / 2;\n var diff = length - vecLength;\n var param = diff * edgeStrength(edge);\n var sourceIdx = nodeIdxMap[source];\n var targetIdx = nodeIdxMap[target];\n var massSource = getMass ? getMass(sourceNode) : 1;\n var massTarget = getMass ? getMass(targetNode) : 1;\n accArray[2 * sourceIdx] -= (direX * param) / massSource;\n accArray[2 * sourceIdx + 1] -= (direY * param) / massSource;\n accArray[2 * targetIdx] += (direX * param) / massTarget;\n accArray[2 * targetIdx + 1] += (direY * param) / massTarget;\n });\n };\n GForceLayout.prototype.calGravity = function (accArray, nodes) {\n var self = this;\n // const nodes = self.nodes;\n var center = self.center;\n var defaultGravity = self.gravity;\n var degrees = self.degrees;\n var nodeLength = nodes.length;\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n var vecX = node.x - center[0];\n var vecY = node.y - center[1];\n var gravity = defaultGravity;\n if (self.getCenter) {\n var customCenterOpt = self.getCenter(node, degrees[i].all);\n if (customCenterOpt &&\n (0, util_1.isNumber)(customCenterOpt[0]) &&\n (0, util_1.isNumber)(customCenterOpt[1]) &&\n (0, util_1.isNumber)(customCenterOpt[2])) {\n vecX = node.x - customCenterOpt[0];\n vecY = node.y - customCenterOpt[1];\n gravity = customCenterOpt[2];\n }\n }\n if (!gravity)\n continue;\n accArray[2 * i] -= gravity * vecX;\n accArray[2 * i + 1] -= gravity * vecY;\n }\n };\n GForceLayout.prototype.updateVelocity = function (accArray, velArray, stepInterval, nodes) {\n var self = this;\n var param = stepInterval * self.damping;\n // const nodes = self.nodes;\n nodes.forEach(function (node, i) {\n var vx = accArray[2 * i] * param || 0.01;\n var vy = accArray[2 * i + 1] * param || 0.01;\n var vLength = Math.sqrt(vx * vx + vy * vy);\n if (vLength > self.maxSpeed) {\n var param2 = self.maxSpeed / vLength;\n vx = param2 * vx;\n vy = param2 * vy;\n }\n velArray[2 * i] = vx;\n velArray[2 * i + 1] = vy;\n });\n };\n GForceLayout.prototype.updatePosition = function (velArray, stepInterval, nodes) {\n nodes.forEach(function (node, i) {\n if ((0, util_1.isNumber)(node.fx) && (0, util_1.isNumber)(node.fy)) {\n node.x = node.fx;\n node.y = node.fy;\n return;\n }\n var distX = velArray[2 * i] * stepInterval;\n var distY = velArray[2 * i + 1] * stepInterval;\n node.x += distX;\n node.y += distY;\n });\n };\n GForceLayout.prototype.stop = function () {\n if (this.timeInterval && typeof window !== \"undefined\") {\n window.clearInterval(this.timeInterval);\n }\n };\n GForceLayout.prototype.destroy = function () {\n var self = this;\n self.stop();\n self.tick = null;\n self.nodes = null;\n self.edges = null;\n self.destroyed = true;\n };\n GForceLayout.prototype.getType = function () {\n return \"gForce\";\n };\n return GForceLayout;\n}(base_1.Base));\nexports.GForceLayout = GForceLayout;\n//# sourceMappingURL=gForce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gForce.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/constant.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/constant.js ***! - \*************************************************************/ -/*! exports provided: TIMELINE_START, TIMELINE_END, VALUE_CHANGE, TIMEBAR_CONFIG_CHANGE, PLAY_PAUSE_BTN, NEXT_STEP_BTN, PRE_STEP_BTN */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js ***! + \*****************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TIMELINE_START\", function() { return TIMELINE_START; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TIMELINE_END\", function() { return TIMELINE_END; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"VALUE_CHANGE\", function() { return VALUE_CHANGE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TIMEBAR_CONFIG_CHANGE\", function() { return TIMEBAR_CONFIG_CHANGE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PLAY_PAUSE_BTN\", function() { return PLAY_PAUSE_BTN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NEXT_STEP_BTN\", function() { return NEXT_STEP_BTN; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PRE_STEP_BTN\", function() { return PRE_STEP_BTN; });\nvar TIMELINE_START = 'timebarstartplay';\nvar TIMELINE_END = 'timebarendplay';\nvar VALUE_CHANGE = 'valuechange';\nvar TIMEBAR_CONFIG_CHANGE = 'timebarConfigChanged';\nvar PLAY_PAUSE_BTN = 'playPauseBtn';\nvar NEXT_STEP_BTN = 'nextStepBtn';\nvar PRE_STEP_BTN = 'preStepBtn';\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/constant.js?"); +eval("\n// @ts-nocheck\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FruchtermanGPULayout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\n// @ts-ignore\nvar g_webgpu_1 = __webpack_require__(/*! @antv/g-webgpu */ \"./node_modules/@antv/g-webgpu/es/index.js\");\n// compile at runtime in dev mode\nvar gpu_1 = __webpack_require__(/*! ../../util/gpu */ \"./node_modules/@antv/layout/lib/util/gpu.js\");\n// use compiled bundle in prod mode\nvar fruchtermanShader_1 = __webpack_require__(/*! ./fruchtermanShader */ \"./node_modules/@antv/layout/lib/layout/gpu/fruchtermanShader.js\");\nvar constants_1 = __webpack_require__(/*! ../constants */ \"./node_modules/@antv/layout/lib/layout/constants.js\");\n/**\n * fruchterman 布局\n */\nvar FruchtermanGPULayout = /** @class */ (function (_super) {\n __extends(FruchtermanGPULayout, _super);\n function FruchtermanGPULayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 重力大小,影响图的紧凑程度 */\n _this.gravity = 10;\n /** 速度 */\n _this.speed = 1;\n /** 是否产生聚类力 */\n _this.clustering = false;\n /** 根据哪个字段聚类 */\n _this.clusterField = \"cluster\";\n /** 聚类力大小 */\n _this.clusterGravity = 10;\n /** 是否启用web worker。前提是在web worker里执行布局,否则无效\t*/\n _this.workerEnabled = false;\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n _this.updateCfg(options);\n return _this;\n }\n FruchtermanGPULayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 1000,\n gravity: 10,\n speed: 1,\n clustering: false,\n clusterGravity: 10\n };\n };\n /**\n * 执行布局\n */\n FruchtermanGPULayout.prototype.execute = function () {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, center, nodeMap, nodeIdxMap;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return [2 /*return*/];\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return [2 /*return*/];\n }\n nodeMap = {};\n nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * _this.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * _this.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n // layout\n return [4 /*yield*/, self.run()];\n case 1:\n // layout\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n FruchtermanGPULayout.prototype.executeWithWorker = function (canvas, ctx) {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, center, nodeMap, nodeIdxMap;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n center = self.center;\n if (!nodes || nodes.length === 0) {\n return [2 /*return*/];\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n return [2 /*return*/];\n }\n nodeMap = {};\n nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * _this.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * _this.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n // layout\n return [4 /*yield*/, self.run(canvas, ctx)];\n case 1:\n // layout\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n FruchtermanGPULayout.prototype.run = function (canvas, ctx) {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, edges, maxIteration, center, area, maxDisplace, k2, k, speed, clustering, _a, attributeArray, clusterCount, numParticles, _b, maxEdgePerVetex, nodesEdgesArray, workerEnabled, world, onLayoutEnd, clusterCenters, i, kernelFruchterman, kernelCluster, execute;\n var _this = this;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n edges = self.edges;\n maxIteration = self.maxIteration;\n center = self.center;\n area = self.height * self.width;\n maxDisplace = Math.sqrt(area) / 10;\n k2 = area / (nodes.length + 1);\n k = Math.sqrt(k2);\n speed = self.speed;\n clustering = self.clustering;\n _a = (0, gpu_1.attributesToTextureData)([self.clusterField], nodes), attributeArray = _a.array, clusterCount = _a.count;\n // pushing the fx and fy\n nodes.forEach(function (node, i) {\n var fx = 0;\n var fy = 0;\n if ((0, util_1.isNumber)(node.fx) && (0, util_1.isNumber)(node.fy)) {\n fx = node.fx || 0.001;\n fy = node.fy || 0.001;\n }\n attributeArray[4 * i + 1] = fx;\n attributeArray[4 * i + 2] = fy;\n });\n numParticles = nodes.length;\n _b = (0, gpu_1.buildTextureData)(nodes, edges), maxEdgePerVetex = _b.maxEdgePerVetex, nodesEdgesArray = _b.array;\n workerEnabled = self.workerEnabled;\n if (workerEnabled) {\n world = g_webgpu_1.World.create({\n canvas: canvas,\n engineOptions: {\n supportCompute: true\n }\n });\n }\n else {\n world = g_webgpu_1.World.create({\n engineOptions: {\n supportCompute: true\n }\n });\n }\n onLayoutEnd = self.onLayoutEnd;\n clusterCenters = [];\n for (i = 0; i < clusterCount; i++) {\n clusterCenters.push(0, 0, 0, 0);\n }\n kernelFruchterman = world\n .createKernel(fruchtermanShader_1.fruchtermanBundle)\n .setDispatch([numParticles, 1, 1])\n .setBinding({\n u_Data: nodesEdgesArray,\n u_K: k,\n u_K2: k2,\n u_Gravity: self.gravity,\n u_ClusterGravity: self.clusterGravity || self.gravity || 1,\n u_Speed: speed,\n u_MaxDisplace: maxDisplace,\n u_Clustering: clustering ? 1 : 0,\n u_Center: center,\n u_AttributeArray: attributeArray,\n u_ClusterCenters: clusterCenters,\n MAX_EDGE_PER_VERTEX: maxEdgePerVetex,\n VERTEX_COUNT: numParticles\n });\n if (clustering) {\n kernelCluster = world\n .createKernel(fruchtermanShader_1.clusterBundle)\n .setDispatch([clusterCount, 1, 1])\n .setBinding({\n u_Data: nodesEdgesArray,\n u_NodeAttributes: attributeArray,\n u_ClusterCenters: clusterCenters,\n VERTEX_COUNT: numParticles,\n CLUSTER_COUNT: clusterCount\n });\n }\n execute = function () { return __awaiter(_this, void 0, void 0, function () {\n var i, finalParticleData;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < maxIteration)) return [3 /*break*/, 6];\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, kernelFruchterman.execute()];\n case 2:\n // eslint-disable-next-line no-await-in-loop\n _a.sent();\n if (!clustering) return [3 /*break*/, 4];\n kernelCluster.setBinding({\n u_Data: kernelFruchterman\n });\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, kernelCluster.execute()];\n case 3:\n // eslint-disable-next-line no-await-in-loop\n _a.sent();\n kernelFruchterman.setBinding({\n u_ClusterCenters: kernelCluster\n });\n _a.label = 4;\n case 4:\n kernelFruchterman.setBinding({\n u_MaxDisplace: maxDisplace *= 0.99\n });\n _a.label = 5;\n case 5:\n i++;\n return [3 /*break*/, 1];\n case 6: return [4 /*yield*/, kernelFruchterman.getOutput()];\n case 7:\n finalParticleData = _a.sent();\n if (canvas) {\n // 传递数据给主线程\n ctx.postMessage({\n type: constants_1.LAYOUT_MESSAGE.GPUEND,\n vertexEdgeData: finalParticleData\n // edgeIndexBufferData,\n });\n }\n else {\n nodes.forEach(function (node, i) {\n var x = finalParticleData[4 * i];\n var y = finalParticleData[4 * i + 1];\n node.x = x;\n node.y = y;\n });\n }\n if (onLayoutEnd)\n onLayoutEnd();\n return [2 /*return*/];\n }\n });\n }); };\n return [4 /*yield*/, execute()];\n case 1:\n _c.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n FruchtermanGPULayout.prototype.getType = function () {\n return \"fruchterman-gpu\";\n };\n return FruchtermanGPULayout;\n}(base_1.Base));\nexports.FruchtermanGPULayout = FruchtermanGPULayout;\n//# sourceMappingURL=fruchterman.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js ***! - \******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/gpu/fruchtermanShader.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/gpu/fruchtermanShader.js ***! + \***********************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _timeButton__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timeButton */ \"./node_modules/@antv/g6-plugin/es/timeBar/timeButton.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__[\"ext\"].transform;\nvar DEFAULT_RECT_FILL = '#aaa';\nvar DEFAULT_RECT_STROKE = 'green';\nvar DEFAULT_PLAYBTN_STYLE = {\n fill: '#aaa',\n fillOpacity: 0.35,\n stroke: '#aaa'\n};\nvar DEFAULT_PREBTN_STYLE = {\n fill: '#fff'\n};\nvar DEFAULT_NEXTBTN_STYLE = {\n fill: 'green'\n};\nvar DEFAULT_SPEED_CONTROLLER_STYLE = {\n pointer: {\n fill: '#aaa',\n lineWidth: 0\n },\n scroller: {\n stroke: '#aaa',\n fill: '#aaa',\n lineWidth: 1,\n lineAppendWidth: 5,\n cursor: 'pointer'\n },\n text: {\n fill: '#aaa',\n textBaseline: 'top'\n }\n};\nvar DEFAULT_TIMETYPE_CONTROLLER_STYLE = {\n check: {\n stroke: 'green',\n lineWidth: 3\n },\n box: {\n fill: '#fff',\n stroke: '#aaa',\n lineWidth: 2,\n radius: 3,\n width: 12,\n height: 12\n },\n text: {\n fill: '#aaa',\n fontSize: 12,\n textBaseline: 'top'\n }\n};\nvar DEFAULT_CONTROLLER_CONFIG = {\n speed: 1,\n loop: false,\n fill: '#fff',\n stroke: '#fff',\n hideTimeTypeController: false,\n preBtnStyle: {\n fill: '#aaa',\n stroke: '#aaa'\n },\n nextBtnStyle: {\n fill: '#aaa',\n stroke: '#aaa'\n },\n playBtnStyle: {\n fill: '#aaa',\n stroke: '#aaa',\n fillOpacity: 0.05\n },\n speedControllerStyle: DEFAULT_SPEED_CONTROLLER_STYLE,\n timeTypeControllerStyle: DEFAULT_TIMETYPE_CONTROLLER_STYLE\n};\nvar SPEED_CONTROLLER_OFFSET = 110;\nvar TOGGLE_MODEL_OFFSET = 50;\n\nvar ControllerBtn =\n/** @class */\nfunction () {\n function ControllerBtn(cfg) {\n this.controllerCfg = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"deepMix\"])({}, DEFAULT_CONTROLLER_CONFIG, cfg);\n this.group = cfg.group;\n this.controllerGroup = this.group.addGroup({\n name: 'controller-group'\n });\n this.speedAxisY = [];\n this.currentSpeed = this.controllerCfg.speed;\n this.currentType = 'range';\n this.fontFamily = cfg.fontFamily || 'Arial, sans-serif';\n this.init();\n }\n\n ControllerBtn.prototype.init = function () {\n this.renderPlayButton();\n };\n /** 获取播放键 marker path */\n\n\n ControllerBtn.prototype.getNextMarkerPath = function (x, y, len) {\n return [['M', x, y - len], ['L', x + len, y], ['L', x, y + len], ['Z', x, y - len], ['M', x, y], ['L', x - len, y - len], ['L', x - len, y + len], ['Z']];\n };\n\n ControllerBtn.prototype.getPreMarkerPath = function (x, y, len) {\n return [['M', x, y - len], ['L', x - len, y], ['L', x, y + len], ['L', x, y - len], ['M', x, y], ['L', x + len, y - len], ['L', x + len, y + len], ['Z']];\n };\n\n ControllerBtn.prototype.renderPlayButton = function () {\n var controllerCfg = this.controllerCfg;\n var width = controllerCfg.width,\n height = controllerCfg.height,\n x = controllerCfg.x,\n y = controllerCfg.y,\n hideTimeTypeController = controllerCfg.hideTimeTypeController,\n _a = controllerCfg.fill,\n fill = _a === void 0 ? DEFAULT_RECT_FILL : _a,\n _b = controllerCfg.stroke,\n stroke = _b === void 0 ? DEFAULT_RECT_STROKE : _b,\n _c = controllerCfg.containerStyle,\n containerStyle = _c === void 0 ? {} : _c;\n\n var playBtnStyle = __assign(__assign({}, DEFAULT_PLAYBTN_STYLE), controllerCfg.playBtnStyle || {});\n\n var preBtnStyle = __assign(__assign({}, DEFAULT_PREBTN_STYLE), controllerCfg.preBtnStyle || {});\n\n var nextBtnStyle = __assign(__assign({}, DEFAULT_NEXTBTN_STYLE), controllerCfg.nextBtnStyle || {});\n\n var r = height / 2 - 5;\n var realY = y + 10; // 绘制最外层的矩形包围框\n\n var container = this.controllerGroup.addShape('rect', {\n attrs: __assign({\n x: x,\n y: realY,\n width: width,\n height: height,\n stroke: stroke,\n fill: fill\n }, containerStyle),\n name: 'container-rect'\n });\n\n if (this.playButton) {\n this.playButton.update({\n x: width / 2,\n y: realY,\n r: r\n });\n } else {\n this.playButton = new _timeButton__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n group: this.controllerGroup,\n x: width / 2,\n y: realY + r + 5,\n r: r,\n isPlay: this.isPlay,\n style: playBtnStyle\n });\n } // 后退按钮\n\n\n var prePaddingX = preBtnStyle.offsetX || 0;\n var prePaddingY = preBtnStyle.offsetY || 0;\n var preR = (preBtnStyle.scale || 1) * r;\n this.controllerGroup.addShape('path', {\n attrs: __assign({\n path: this.getPreMarkerPath(width / 2 - 5 * r + prePaddingX, realY + r + 5 + prePaddingY, preR * 0.5)\n }, preBtnStyle),\n name: _constant__WEBPACK_IMPORTED_MODULE_3__[\"PRE_STEP_BTN\"]\n }); // 前进按钮\n\n var nxtPaddingX = nextBtnStyle.offsetX || 0;\n var nxtPaddingY = nextBtnStyle.offsetY || 0;\n var nxtR = (nextBtnStyle.scale || 1) * r;\n this.controllerGroup.addShape('path', {\n attrs: __assign({\n path: this.getNextMarkerPath(width / 2 + 5 * r + nxtPaddingX, realY + r + 5 + nxtPaddingY, nxtR * 0.5)\n }, nextBtnStyle),\n name: _constant__WEBPACK_IMPORTED_MODULE_3__[\"NEXT_STEP_BTN\"]\n });\n container.toBack(); // 调节speed的按钮\n\n this.renderSpeedBtn();\n\n if (!hideTimeTypeController) {\n this.renderToggleTime();\n }\n\n this.bindEvent(); // 根据配置的 scale、offsetX,offsetY 缩放和移动控制栏\n\n var _d = this.controllerCfg.scale,\n scale = _d === void 0 ? 1 : _d;\n var currentBBox = this.controllerGroup.getCanvasBBox();\n var centerX = (currentBBox.maxX + currentBBox.minX) / 2;\n var centerY = (currentBBox.maxY + currentBBox.minY) / 2;\n var matrix = transform([1, 0, 0, 0, 1, 0, 0, 0, 1], [['t', -centerX, -centerY], ['s', scale, scale], ['t', centerX, centerY]]);\n this.controllerGroup.setMatrix(matrix);\n };\n\n ControllerBtn.prototype.renderSpeedBtn = function () {\n var _a = this.controllerCfg,\n y = _a.y,\n width = _a.width,\n hideTimeTypeController = _a.hideTimeTypeController;\n\n var speedControllerStyle = __assign(__assign({}, DEFAULT_SPEED_CONTROLLER_STYLE), this.controllerCfg.speedControllerStyle || {});\n\n var _b = speedControllerStyle.scroller,\n scroller = _b === void 0 ? {} : _b,\n _c = speedControllerStyle.text,\n text = _c === void 0 ? {} : _c,\n _d = speedControllerStyle.pointer,\n pointer = _d === void 0 ? {} : _d,\n _e = speedControllerStyle.scale,\n scale = _e === void 0 ? 1 : _e,\n _f = speedControllerStyle.offsetX,\n offsetX = _f === void 0 ? 0 : _f,\n _g = speedControllerStyle.offsetY,\n offsetY = _g === void 0 ? 0 : _g;\n var speedGroup = this.controllerGroup.addGroup({\n name: 'speed-group'\n });\n this.speedGroup = speedGroup;\n var speedNum = [];\n var maxSpeed = 5;\n this.speedAxisY = [19, 22, 26, 32, 39]; // 增加speed刻度\n\n for (var i = 0; i < 5; i++) {\n var axisY = y + this.speedAxisY[i]; // 灰色刻度\n\n var startX = width - (!hideTimeTypeController ? SPEED_CONTROLLER_OFFSET : TOGGLE_MODEL_OFFSET);\n speedGroup.addShape('line', {\n attrs: __assign({\n x1: startX,\n x2: startX + 15,\n y1: axisY,\n y2: axisY\n }, scroller),\n speed: maxSpeed,\n name: 'speed-rect'\n });\n this.speedAxisY[i] = axisY;\n speedNum.push(maxSpeed);\n maxSpeed = maxSpeed - 1;\n } // 速度文本\n\n\n this.speedText = speedGroup.addShape('text', {\n attrs: __assign({\n x: width - (!hideTimeTypeController ? SPEED_CONTROLLER_OFFSET : TOGGLE_MODEL_OFFSET) + 20,\n y: this.speedAxisY[0] + 4,\n text: \"1.0X\",\n fontFamily: this.fontFamily || 'Arial, sans-serif'\n }, text),\n name: 'speed-text'\n });\n this.speedPoint = speedGroup.addShape('path', {\n attrs: __assign({\n path: this.getPointerPath(width - (!hideTimeTypeController ? SPEED_CONTROLLER_OFFSET : TOGGLE_MODEL_OFFSET), 0),\n matrix: [1, 0, 0, 0, 1, 0, 0, this.speedAxisY[4], 1]\n }, pointer),\n name: 'speed-pointer'\n }); // 根据配置在 speedControllerStyle 中的 scale offsetX offsetY 缩放和移动速度控制器\n\n var currentBBox = this.speedGroup.getCanvasBBox();\n var centerX = (currentBBox.maxX + currentBBox.minX) / 2;\n var centerY = (currentBBox.maxY + currentBBox.minY) / 2;\n var matrix = this.speedGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n matrix = transform(matrix, [['t', -centerX, -centerY], ['s', scale, scale], ['t', centerX + offsetX * scale, centerY + offsetY * scale]]);\n this.speedGroup.setMatrix(matrix);\n };\n\n ControllerBtn.prototype.getPointerPath = function (x, y) {\n return [['M', x, y], ['L', x - 10, y - 4], ['L', x - 10, y + 4], ['Z']];\n };\n\n ControllerBtn.prototype.renderToggleTime = function () {\n var _a;\n\n var width = this.controllerCfg.width;\n\n var timeTypeControllerStyle = __assign(__assign({}, DEFAULT_TIMETYPE_CONTROLLER_STYLE), this.controllerCfg.timeTypeControllerStyle || {});\n\n var _b = timeTypeControllerStyle.scale,\n scale = _b === void 0 ? 1 : _b,\n _c = timeTypeControllerStyle.offsetX,\n offsetX = _c === void 0 ? 0 : _c,\n _d = timeTypeControllerStyle.offsetY,\n offsetY = _d === void 0 ? 0 : _d,\n _e = timeTypeControllerStyle.box,\n box = _e === void 0 ? {} : _e,\n _f = timeTypeControllerStyle.check,\n check = _f === void 0 ? {} : _f,\n _g = timeTypeControllerStyle.text,\n text = _g === void 0 ? {} : _g;\n this.toggleGroup = this.controllerGroup.addGroup({\n name: 'toggle-group'\n });\n this.toggleGroup.addShape('rect', {\n attrs: __assign({\n x: width - TOGGLE_MODEL_OFFSET,\n y: this.speedAxisY[0] + 3.5\n }, box),\n isChecked: false,\n name: 'toggle-model'\n });\n this.checkedIcon = this.toggleGroup.addShape('path', {\n attrs: __assign({\n path: [['M', width - TOGGLE_MODEL_OFFSET + 3, this.speedAxisY[1] + 6], ['L', width - TOGGLE_MODEL_OFFSET + 7, this.speedAxisY[1] + 10], ['L', width - TOGGLE_MODEL_OFFSET + 12, this.speedAxisY[1] + 4]]\n }, check),\n capture: false,\n name: 'check-icon'\n });\n this.checkedIcon.hide();\n this.checkedText = this.toggleGroup.addShape('text', {\n attrs: __assign({\n text: ((_a = this.controllerCfg) === null || _a === void 0 ? void 0 : _a.timePointControllerText) || '单一时间',\n x: width - TOGGLE_MODEL_OFFSET + 15,\n y: this.speedAxisY[0] + 4,\n fontFamily: typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif'\n }, text),\n name: 'checked-text'\n }); // 根据配置在 timeTypeControllerStyle 中的 scale offsetX offsetY 缩放和移动速度控制器\n\n var currentBBox = this.toggleGroup.getCanvasBBox();\n var centerX = (currentBBox.maxX + currentBBox.minX) / 2;\n var centerY = (currentBBox.maxY + currentBBox.minY) / 2;\n var matrix = this.toggleGroup.getMatrix() || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n matrix = transform(matrix, [['t', -centerX, -centerY], ['s', scale, scale], ['t', centerX + offsetX * scale, centerY + offsetY * scale]]);\n this.toggleGroup.setMatrix(matrix);\n };\n\n ControllerBtn.prototype.bindEvent = function () {\n var _this = this;\n\n this.speedGroup.on('speed-rect:click', function (evt) {\n var currentPointerY = evt.target.attr('y1');\n\n var pointerMatrix = _this.speedPoint.attr('matrix');\n\n var currentYIdx = _this.speedAxisY.indexOf(pointerMatrix[7] || 0);\n\n var targetYIdx = _this.speedAxisY.indexOf(currentPointerY);\n\n var yDiff = _this.speedAxisY[targetYIdx] - _this.speedAxisY[currentYIdx];\n pointerMatrix = transform(pointerMatrix, [['t', 0, yDiff]]);\n\n _this.speedPoint.setMatrix(pointerMatrix);\n\n _this.currentSpeed = _this.speedAxisY.length - targetYIdx;\n\n _this.speedText.attr('text', \"\".concat(_this.currentSpeed, \".0X\"));\n\n _this.group.emit(_constant__WEBPACK_IMPORTED_MODULE_3__[\"TIMEBAR_CONFIG_CHANGE\"], {\n speed: _this.currentSpeed,\n type: _this.currentType\n });\n });\n this.speedGroup.on('mousewheel', function (evt) {\n evt.preventDefault();\n var pointerMatrix = _this.speedPoint.attr('matrix') || [1, 0, 0, 0, 1, 0, 0, 0, 1];\n var currentPointerY = pointerMatrix[7];\n\n var currentYIdx = _this.speedAxisY.indexOf(currentPointerY);\n\n if (currentYIdx === -1) {\n // 找到最近的一个 y\n var minDist_1 = Infinity;\n\n _this.speedAxisY.forEach(function (y, idx) {\n var dist = Math.abs(y - currentPointerY);\n\n if (minDist_1 > dist) {\n minDist_1 = dist;\n currentYIdx = idx;\n }\n });\n }\n\n if (evt.originalEvent.deltaY > 0) currentYIdx = Math.max(0, currentYIdx - 1);else currentYIdx = Math.min(_this.speedAxisY.length - 1, currentYIdx + 1);\n var yDiff = _this.speedAxisY[currentYIdx] - currentPointerY;\n pointerMatrix = transform(pointerMatrix, [['t', 0, yDiff]]);\n\n _this.speedPoint.setMatrix(pointerMatrix);\n\n _this.currentSpeed = _this.speedAxisY.length - currentYIdx;\n\n _this.speedText.attr('text', \"\".concat(_this.currentSpeed, \".0X\"));\n\n _this.group.emit(_constant__WEBPACK_IMPORTED_MODULE_3__[\"TIMEBAR_CONFIG_CHANGE\"], {\n speed: _this.currentSpeed,\n type: _this.currentType\n });\n });\n\n if (this.toggleGroup) {\n this.toggleGroup.on('toggle-model:click', function (evt) {\n var _a, _b;\n\n var isChecked = evt.target.get('isChecked');\n\n if (!isChecked) {\n _this.checkedIcon.show();\n\n _this.checkedText.attr('text', ((_a = _this.controllerCfg) === null || _a === void 0 ? void 0 : _a.timeRangeControllerText) || '时间范围');\n\n _this.currentType = 'single';\n } else {\n _this.checkedIcon.hide();\n\n _this.checkedText.attr('text', ((_b = _this.controllerCfg) === null || _b === void 0 ? void 0 : _b.timePointControllerText) || '单一时间');\n\n _this.currentType = 'range';\n }\n\n evt.target.set('isChecked', !isChecked);\n\n _this.group.emit(_constant__WEBPACK_IMPORTED_MODULE_3__[\"TIMEBAR_CONFIG_CHANGE\"], {\n type: _this.currentType,\n speed: _this.currentSpeed\n });\n });\n }\n };\n\n ControllerBtn.prototype.destroy = function () {\n this.speedGroup.off('speed-rect:click');\n\n if (this.toggleGroup) {\n this.toggleGroup.off('toggle-model:click');\n this.toggleGroup.destroy();\n }\n\n this.speedGroup.destroy();\n };\n\n return ControllerBtn;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ControllerBtn);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clusterBundle = exports.clusterCode = exports.fruchtermanBundle = exports.fruchtermanCode = void 0;\nexports.fruchtermanCode = \"\\nimport { globalInvocationID } from 'g-webgpu';\\nconst MAX_EDGE_PER_VERTEX;\\nconst VERTEX_COUNT;\\n@numthreads(1, 1, 1)\\nclass Fruchterman {\\n @in @out\\n u_Data: vec4[];\\n @in\\n u_K: float;\\n @in\\n u_K2: float;\\n \\n @in\\n u_Center: vec2;\\n @in\\n u_Gravity: float;\\n @in\\n u_ClusterGravity: float;\\n @in\\n u_Speed: float;\\n @in\\n u_MaxDisplace: float;\\n @in\\n u_Clustering: float;\\n @in\\n u_AttributeArray: vec4[];\\n @in\\n u_ClusterCenters: vec4[];\\n calcRepulsive(i: int, currentNode: vec4): vec2 {\\n let dx = 0, dy = 0;\\n for (let j = 0; j < VERTEX_COUNT; j++) {\\n if (i != j) {\\n const nextNode = this.u_Data[j];\\n const xDist = currentNode[0] - nextNode[0];\\n const yDist = currentNode[1] - nextNode[1];\\n const dist = (xDist * xDist + yDist * yDist) + 0.01;\\n let param = this.u_K2 / dist;\\n \\n if (dist > 0.0) {\\n dx += param * xDist;\\n dy += param * yDist;\\n if (xDist == 0 && yDist == 0) {\\n const sign = i < j ? 1 : -1;\\n dx += param * sign;\\n dy += param * sign;\\n }\\n }\\n }\\n }\\n return [dx, dy];\\n }\\n calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { // \\n let dx = 0, dy = 0;\\n const vx = currentNode[0] - this.u_Center[0];\\n const vy = currentNode[1] - this.u_Center[1];\\n const gf = 0.01 * this.u_K * this.u_Gravity;\\n dx = gf * vx;\\n dy = gf * vy;\\n if (this.u_Clustering == 1) {\\n const clusterIdx = int(nodeAttributes[0]);\\n const center = this.u_ClusterCenters[clusterIdx];\\n const cvx = currentNode[0] - center[0];\\n const cvy = currentNode[1] - center[1];\\n const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;\\n const parma = this.u_K * this.u_ClusterGravity / dist;\\n dx += parma * cvx;\\n dy += parma * cvy;\\n }\\n return [dx, dy];\\n }\\n calcAttractive(i: int, currentNode: vec4): vec2 {\\n let dx = 0, dy = 0;\\n const arr_offset = int(floor(currentNode[2] + 0.5));\\n const length = int(floor(currentNode[3] + 0.5));\\n const node_buffer: vec4;\\n for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {\\n if (p >= length) break;\\n const arr_idx = arr_offset + p;\\n // when arr_idx % 4 == 0 update currentNodedx_buffer\\n const buf_offset = arr_idx - arr_idx / 4 * 4;\\n if (p == 0 || buf_offset == 0) {\\n node_buffer = this.u_Data[int(arr_idx / 4)];\\n }\\n const float_j = buf_offset == 0 ? node_buffer[0] :\\n buf_offset == 1 ? node_buffer[1] :\\n buf_offset == 2 ? node_buffer[2] :\\n node_buffer[3];\\n const nextNode = this.u_Data[int(float_j)];\\n const xDist = currentNode[0] - nextNode[0];\\n const yDist = currentNode[1] - nextNode[1];\\n const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;\\n let attractiveF = dist / this.u_K;\\n \\n if (dist > 0.0) {\\n dx -= xDist * attractiveF;\\n dy -= yDist * attractiveF;\\n if (xDist == 0 && yDist == 0) {\\n const sign = i < int(float_j) ? 1 : -1;\\n dx -= sign * attractiveF;\\n dy -= sign * attractiveF;\\n }\\n }\\n }\\n return [dx, dy];\\n }\\n @main\\n compute() {\\n const i = globalInvocationID.x;\\n const currentNode = this.u_Data[i];\\n let dx = 0, dy = 0;\\n if (i >= VERTEX_COUNT) {\\n this.u_Data[i] = currentNode;\\n return;\\n }\\n\\n // [gravity, fx, fy, 0]\\n const nodeAttributes = this.u_AttributeArray[i];\\n\\n if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {\\n // the node is fixed\\n this.u_Data[i] = [\\n nodeAttributes[1],\\n nodeAttributes[2],\\n currentNode[2],\\n currentNode[3]\\n ];\\n return;\\n }\\n\\n // repulsive\\n const repulsive = this.calcRepulsive(i, currentNode);\\n dx += repulsive[0];\\n dy += repulsive[1];\\n // attractive\\n const attractive = this.calcAttractive(i, currentNode);\\n dx += attractive[0];\\n dy += attractive[1];\\n // gravity\\n const gravity = this.calcGravity(currentNode, nodeAttributes);\\n dx -= gravity[0];\\n dy -= gravity[1];\\n // speed\\n dx *= this.u_Speed;\\n dy *= this.u_Speed;\\n\\n // move\\n const distLength = sqrt(dx * dx + dy * dy);\\n if (distLength > 0.0) {\\n const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);\\n this.u_Data[i] = [\\n currentNode[0] + dx / distLength * limitedDist,\\n currentNode[1] + dy / distLength * limitedDist,\\n currentNode[2],\\n currentNode[3]\\n ];\\n }\\n }\\n}\\n\";\nexports.fruchtermanBundle = \"{\\\"shaders\\\":{\\\"WGSL\\\":\\\"\\\",\\\"GLSL450\\\":\\\"\\\",\\\"GLSL100\\\":\\\"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_K;\\\\nuniform float u_K2;\\\\nuniform vec2 u_Center;\\\\nuniform float u_Gravity;\\\\nuniform float u_ClusterGravity;\\\\nuniform float u_Speed;\\\\nuniform float u_MaxDisplace;\\\\nuniform float u_Clustering;\\\\nuniform sampler2D u_AttributeArray;\\\\nuniform vec2 u_AttributeArraySize;\\\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AttributeArray(float address1D) {\\\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\\\n}\\\\nvec4 getDatau_AttributeArray(int address1D) {\\\\n return getDatau_AttributeArray(float(address1D));\\\\n}\\\\nuniform sampler2D u_ClusterCenters;\\\\nuniform vec2 u_ClusterCentersSize;\\\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\\\n}\\\\nvec4 getDatau_ClusterCenters(float address1D) {\\\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\\\n}\\\\nvec4 getDatau_ClusterCenters(int address1D) {\\\\n return getDatau_ClusterCenters(float(address1D));\\\\n}\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat param = u_K2 / dist;\\\\nif (dist > 0.0) {dx += param * xDist;\\\\ndy += param * yDist;\\\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\\\ndx += param * sign;\\\\ndy += param * sign;}}}}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfloat vx = currentNode.x - u_Center.x;\\\\nfloat vy = currentNode.y - u_Center.y;\\\\nfloat gf = (0.01 * u_K) * u_Gravity;\\\\ndx = gf * vx;\\\\ndy = gf * vy;\\\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\\\nfloat cvx = currentNode.x - center.x;\\\\nfloat cvy = currentNode.y - center.y;\\\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\\\ndx += parma * cvx;\\\\ndy += parma * cvy;}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcAttractive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nint arr_offset = int(floor(currentNode.z + 0.5));\\\\nint length = int(floor(currentNode.w + 0.5));\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + int(p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\\\nvec4 nextNode = getDatau_Data(int(float_j));\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat attractiveF = dist / u_K;\\\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\\\ndy -= yDist * attractiveF;\\\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\\\ndx -= sign * attractiveF;\\\\ndy -= sign * attractiveF;}}}\\\\nreturn vec2(dx, dy);}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 currentNode = getDatau_Data(i);\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\\\nreturn ;}\\\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\\\nreturn ;}\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\ndx += repulsive.x;\\\\ndy += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode);\\\\ndx += attractive.x;\\\\ndy += attractive.y;\\\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\\\ndx -= gravity.x;\\\\ndy -= gravity.y;\\\\ndx *= u_Speed;\\\\ndy *= u_Speed;\\\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n\\\"},\\\"context\\\":{\\\"name\\\":\\\"\\\",\\\"dispatch\\\":[1,1,1],\\\"threadGroupSize\\\":[1,1,1],\\\"maxIteration\\\":1,\\\"defines\\\":[{\\\"name\\\":\\\"MAX_EDGE_PER_VERTEX\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true},{\\\"name\\\":\\\"VERTEX_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true}],\\\"uniforms\\\":[{\\\"name\\\":\\\"u_Data\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":false,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_K\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_K2\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_Center\\\",\\\"type\\\":\\\"vec2\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_Gravity\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_ClusterGravity\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_Speed\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_MaxDisplace\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_Clustering\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_AttributeArray\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_ClusterCenters\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]}],\\\"globalDeclarations\\\":[],\\\"output\\\":{\\\"name\\\":\\\"u_Data\\\",\\\"size\\\":[1,1],\\\"length\\\":1},\\\"needPingpong\\\":true}}\";\nexports.clusterCode = \"\\nimport { globalInvocationID } from 'g-webgpu';\\nconst VERTEX_COUNT;\\nconst CLUSTER_COUNT;\\n@numthreads(1, 1, 1)\\nclass CalcCenter {\\n @in\\n u_Data: vec4[];\\n @in\\n u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]\\n @in @out\\n u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]\\n @main\\n compute() {\\n const i = globalInvocationID.x;\\n const center = this.u_ClusterCenters[i];\\n let sumx = 0;\\n let sumy = 0;\\n let count = 0;\\n for (let j = 0; j < VERTEX_COUNT; j++) {\\n const attributes = this.u_NodeAttributes[j];\\n const clusterIdx = int(attributes[0]);\\n const vertex = this.u_Data[j];\\n if (clusterIdx == i) {\\n sumx += vertex.x;\\n sumy += vertex.y;\\n count += 1;\\n }\\n }\\n this.u_ClusterCenters[i] = [\\n sumx / count,\\n sumy / count,\\n count,\\n i\\n ];\\n }\\n}\\n\";\nexports.clusterBundle = \"{\\\"shaders\\\":{\\\"WGSL\\\":\\\"\\\",\\\"GLSL450\\\":\\\"\\\",\\\"GLSL100\\\":\\\"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform sampler2D u_NodeAttributes;\\\\nuniform vec2 u_NodeAttributesSize;\\\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributes(float address1D) {\\\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\\\n}\\\\nvec4 getDatau_NodeAttributes(int address1D) {\\\\n return getDatau_NodeAttributes(float(address1D));\\\\n}\\\\nuniform sampler2D u_ClusterCenters;\\\\nuniform vec2 u_ClusterCentersSize;\\\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\\\n}\\\\nvec4 getDatau_ClusterCenters(float address1D) {\\\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\\\n}\\\\nvec4 getDatau_ClusterCenters(int address1D) {\\\\n return getDatau_ClusterCenters(float(address1D));\\\\n}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 center = getDatau_ClusterCenters(i);\\\\nfloat sumx = 0.0;\\\\nfloat sumy = 0.0;\\\\nfloat count = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\\\nint clusterIdx = int(attributes.x);\\\\nvec4 vertex = getDatau_Data(j);\\\\nif (clusterIdx == i) {sumx += vertex.x;\\\\nsumy += vertex.y;\\\\ncount += 1.0;}}\\\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n\\\"},\\\"context\\\":{\\\"name\\\":\\\"\\\",\\\"dispatch\\\":[1,1,1],\\\"threadGroupSize\\\":[1,1,1],\\\"maxIteration\\\":1,\\\"defines\\\":[{\\\"name\\\":\\\"VERTEX_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true},{\\\"name\\\":\\\"CLUSTER_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true}],\\\"uniforms\\\":[{\\\"name\\\":\\\"u_Data\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_NodeAttributes\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_ClusterCenters\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":false,\\\"writeonly\\\":false,\\\"size\\\":[1,1]}],\\\"globalDeclarations\\\":[],\\\"output\\\":{\\\"name\\\":\\\"u_ClusterCenters\\\",\\\"size\\\":[1,1],\\\"length\\\":1},\\\"needPingpong\\\":true}}\";\n//# sourceMappingURL=fruchtermanShader.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gpu/fruchtermanShader.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/handler.js": +/***/ "./node_modules/@antv/layout/lib/layout/gpu/gForce.js": /*!************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/handler.js ***! + !*** ./node_modules/@antv/layout/lib/layout/gpu/gForce.js ***! \************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\nvar DEFAULT_STYLE = {\n fill: '#1890ff',\n stroke: '#1890ff',\n type: 'trend',\n radius: 2,\n opacity: 1,\n cursor: 'ew-resize',\n // 高亮的颜色\n highLightFill: '#0050b3'\n};\nvar SIMPLE_DEFAULT_STYLE = {\n fill: '#fff',\n stroke: '#1890ff',\n radius: 2,\n opacity: 1,\n cursor: 'ew-resize'\n};\n\nvar Handler =\n/** @class */\nfunction () {\n function Handler(cfg) {\n var group = cfg.group,\n name = cfg.name,\n type = cfg.type,\n _a = cfg.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfg.y,\n y = _b === void 0 ? 0 : _b,\n _c = cfg.width,\n width = _c === void 0 ? 2 : _c,\n _d = cfg.height,\n height = _d === void 0 ? 24 : _d,\n _e = cfg.style,\n style = _e === void 0 ? {} : _e;\n this.group = group;\n this.name = name;\n this.handleType = type;\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n\n if (type === 'trend') {\n this.style = __assign(__assign({}, DEFAULT_STYLE), style);\n } else if (type === 'simple') {\n this.style = __assign(__assign({}, SIMPLE_DEFAULT_STYLE), style);\n }\n\n this.renderHandle();\n }\n /**\n * 设置位置 x\n * @param x\n */\n\n\n Handler.prototype.setX = function (x) {\n this.setXY(x, undefined);\n };\n /**\n * 设置位置 y\n * @param y\n */\n\n\n Handler.prototype.setY = function (y) {\n this.setXY(undefined, y);\n };\n\n Handler.prototype.setXY = function (x, y) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(x)) {\n this.x = x;\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(y)) {\n this.y = y;\n }\n\n this.updateXY();\n };\n /**\n * 初始化组件\n * @private\n */\n\n\n Handler.prototype.renderHandle = function () {\n var _a = this,\n width = _a.width,\n height = _a.height,\n style = _a.style,\n name = _a.name;\n\n var fill = style.fill,\n stroke = style.stroke,\n radius = style.radius,\n opacity = style.opacity,\n cursor = style.cursor;\n this.handleGroup = this.group.addGroup(); // 趋势图时的 handle\n\n if (this.handleType === 'trend') {\n // 垂直线\n this.verticalLine = this.handleGroup.addShape('rect', {\n attrs: {\n x: 0,\n y: 0,\n width: width,\n height: height,\n fill: fill,\n stroke: stroke,\n radius: radius,\n opacity: opacity,\n cursor: cursor\n },\n name: \"\".concat(name, \"-handler\")\n });\n this.topCircle = this.handleGroup.addShape('circle', {\n attrs: {\n x: width / 2,\n y: 0,\n r: 2 * width,\n fill: fill,\n stroke: stroke,\n radius: radius,\n opacity: opacity,\n cursor: cursor,\n lineAppendWidth: 12\n },\n name: \"\".concat(name, \"-handler\")\n });\n this.bottomCircle = this.handleGroup.addShape('circle', {\n attrs: {\n x: width / 2,\n y: height,\n r: 2 * width,\n fill: fill,\n stroke: stroke,\n radius: radius,\n opacity: opacity,\n cursor: cursor\n },\n name: \"\".concat(name, \"-handler\")\n });\n } else if (this.handleType === 'simple') {\n this.topCircle = this.handleGroup.addShape('circle', {\n attrs: {\n x: width / 2,\n y: height / 2,\n r: 2 * width,\n fill: fill,\n stroke: stroke,\n radius: radius,\n opacity: opacity,\n cursor: cursor,\n lineWidth: 2\n },\n name: \"\".concat(name, \"-handler\")\n });\n } // 移动到对应的位置\n\n\n this.updateXY();\n\n if (this.handleType === 'trend') {\n this.bindTrendEvents();\n } else if (this.handleType === 'simple') {\n this.bindSimpleEvents();\n }\n };\n\n Handler.prototype.bindSimpleEvents = function () {\n var _this = this;\n\n var name = this.name;\n this.handleGroup.on(\"\".concat(name, \"-handler:mouseenter\"), function () {\n var highLightFill = _this.style.highLightFill;\n\n _this.topCircle.attr('fill', highLightFill);\n });\n this.handleGroup.on(\"\".concat(name, \"-handler:mouseleave\"), function () {\n var fill = _this.style.fill;\n\n _this.topCircle.attr('fill', fill);\n });\n };\n\n Handler.prototype.bindTrendEvents = function () {\n var _this = this;\n\n var name = this.name;\n this.handleGroup.on(\"\".concat(name, \"-handler:mouseenter\"), function () {\n var highLightFill = _this.style.highLightFill;\n\n _this.verticalLine.attr('fill', highLightFill);\n\n _this.topCircle.attr('fill', highLightFill);\n\n _this.bottomCircle.attr('fill', highLightFill);\n });\n this.handleGroup.on(\"\".concat(name, \"-handler:mouseleave\"), function () {\n var fill = _this.style.fill;\n\n _this.verticalLine.attr('fill', fill);\n\n _this.topCircle.attr('fill', fill);\n\n _this.bottomCircle.attr('fill', fill);\n });\n };\n\n Handler.prototype.show = function () {\n this.handleGroup.show();\n };\n\n Handler.prototype.hide = function () {\n this.handleGroup.hide();\n };\n\n Handler.prototype.updateXY = function () {\n this.handleGroup.setMatrix([1, 0, 0, 0, 1, 0, this.x, this.y, 1]);\n };\n\n return Handler;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Handler);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/handler.js?"); +eval("\n// @ts-nocheck\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GForceGPULayout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\n// @ts-ignore\nvar g_webgpu_1 = __webpack_require__(/*! @antv/g-webgpu */ \"./node_modules/@antv/g-webgpu/es/index.js\");\nvar gpu_1 = __webpack_require__(/*! ../../util/gpu */ \"./node_modules/@antv/layout/lib/util/gpu.js\");\nvar math_1 = __webpack_require__(/*! ../../util/math */ \"./node_modules/@antv/layout/lib/util/math.js\");\nvar gForceShader_1 = __webpack_require__(/*! ./gForceShader */ \"./node_modules/@antv/layout/lib/layout/gpu/gForceShader.js\");\nvar constants_1 = __webpack_require__(/*! ../constants */ \"./node_modules/@antv/layout/lib/layout/constants.js\");\n/**\n * graphin 中的 force 布局\n */\nvar GForceGPULayout = /** @class */ (function (_super) {\n __extends(GForceGPULayout, _super);\n function GForceGPULayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 弹簧引力系数 */\n _this.edgeStrength = 200;\n /** 斥力系数 */\n _this.nodeStrength = 1000;\n /** 库伦系数 */\n _this.coulombDisScale = 0.005;\n /** 阻尼系数 */\n _this.damping = 0.9;\n /** 最大速度 */\n _this.maxSpeed = 1000;\n /** 一次迭代的平均移动距离小于该值时停止迭代 */\n _this.minMovement = 0.5;\n /** 迭代中衰减 */\n _this.interval = 0.02;\n /** 斥力的一个系数 */\n _this.factor = 1;\n /** 理想边长 */\n _this.linkDistance = 1;\n /** 重力大小 */\n _this.gravity = 10;\n /** 是否启用web worker。前提是在web worker里执行布局,否则无效\t*/\n _this.workerEnabled = false;\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n _this.updateCfg(options);\n return _this;\n }\n GForceGPULayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 2000,\n gravity: 10,\n clustering: false,\n clusterGravity: 10\n };\n };\n /**\n * 执行布局\n */\n GForceGPULayout.prototype.execute = function () {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, center, nodeMap, nodeIdxMap;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return [2 /*return*/];\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return [2 /*return*/];\n }\n nodeMap = {};\n nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * self.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * self.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n self.nodeStrength = (0, gpu_1.proccessToFunc)(self.nodeStrength, 1);\n self.edgeStrength = (0, gpu_1.proccessToFunc)(self.edgeStrength, 1);\n // layout\n return [4 /*yield*/, self.run()];\n case 1:\n // layout\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n GForceGPULayout.prototype.executeWithWorker = function (canvas, ctx) {\n var self = this;\n var nodes = self.nodes;\n var center = self.center;\n if (!nodes || nodes.length === 0) {\n return;\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n return;\n }\n var nodeMap = {};\n var nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * self.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * self.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n self.nodeStrength = (0, gpu_1.proccessToFunc)(self.nodeStrength, 1);\n self.edgeStrength = (0, gpu_1.proccessToFunc)(self.edgeStrength, 1);\n // layout\n self.run(canvas, ctx);\n };\n GForceGPULayout.prototype.run = function (canvas, ctx) {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, edges, maxIteration, numParticles, _a, maxEdgePerVetex, nodesEdgesArray, masses, nodeStrengths, centerXs, centerYs, centerGravities, fxs, fys, gravity, center, nodeAttributeArray1, nodeAttributeArray2, workerEnabled, world, onLayoutEnd, initPreviousData, i, kernelGForce, kernelAveMovement, execute;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n edges = self.edges;\n maxIteration = self.maxIteration;\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n numParticles = nodes.length;\n self.linkDistance = (0, gpu_1.proccessToFunc)(self.linkDistance);\n self.edgeStrength = (0, gpu_1.proccessToFunc)(self.edgeStrength);\n _a = (0, gpu_1.buildTextureDataWithTwoEdgeAttr)(nodes, edges, self.linkDistance, self.edgeStrength), maxEdgePerVetex = _a.maxEdgePerVetex, nodesEdgesArray = _a.array;\n // init degree for mass\n self.degrees = (0, math_1.getDegree)(nodes.length, self.nodeIdxMap, edges).map(function (degree) { return degree.all; });\n masses = [];\n nodeStrengths = [];\n centerXs = [];\n centerYs = [];\n centerGravities = [];\n fxs = [];\n fys = [];\n if (!self.getMass) {\n self.getMass = function (d) {\n return self.degrees[self.nodeIdxMap[d.id]] || 1;\n };\n }\n gravity = self.gravity;\n center = self.center;\n nodes.forEach(function (node, i) {\n masses.push(self.getMass(node));\n nodeStrengths.push(self.nodeStrength(node));\n if (!self.degrees[i])\n self.degrees[i] = 0;\n var nodeGravity = [center[0], center[1], gravity];\n if (self.getCenter) {\n var customCenter = self.getCenter(node, self.degrees[i]);\n if (customCenter &&\n (0, util_1.isNumber)(customCenter[0]) &&\n (0, util_1.isNumber)(customCenter[1]) &&\n (0, util_1.isNumber)(customCenter[2])) {\n nodeGravity = customCenter;\n }\n }\n centerXs.push(nodeGravity[0]);\n centerYs.push(nodeGravity[1]);\n centerGravities.push(nodeGravity[2]);\n if ((0, util_1.isNumber)(node.fx) && (0, util_1.isNumber)(node.fy)) {\n fxs.push(node.fx || 0.001);\n fys.push(node.fy || 0.001);\n }\n else {\n fxs.push(0);\n fys.push(0);\n }\n });\n nodeAttributeArray1 = (0, gpu_1.arrayToTextureData)([\n masses,\n self.degrees,\n nodeStrengths,\n fxs\n ]);\n nodeAttributeArray2 = (0, gpu_1.arrayToTextureData)([\n centerXs,\n centerYs,\n centerGravities,\n fys\n ]);\n workerEnabled = self.workerEnabled;\n if (workerEnabled) {\n world = g_webgpu_1.World.create({\n canvas: canvas,\n engineOptions: {\n supportCompute: true\n }\n });\n }\n else {\n world = g_webgpu_1.World.create({\n engineOptions: {\n supportCompute: true\n }\n });\n }\n onLayoutEnd = self.onLayoutEnd;\n initPreviousData = [];\n nodesEdgesArray.forEach(function (value) {\n initPreviousData.push(value);\n });\n for (i = 0; i < 4; i++) {\n initPreviousData.push(0);\n }\n kernelGForce = world\n .createKernel(gForceShader_1.gForceBundle)\n .setDispatch([numParticles, 1, 1])\n .setBinding({\n u_Data: nodesEdgesArray,\n u_damping: self.damping,\n u_maxSpeed: self.maxSpeed,\n u_minMovement: self.minMovement,\n u_coulombDisScale: self.coulombDisScale,\n u_factor: self.factor,\n u_NodeAttributeArray1: nodeAttributeArray1,\n u_NodeAttributeArray2: nodeAttributeArray2,\n MAX_EDGE_PER_VERTEX: maxEdgePerVetex,\n VERTEX_COUNT: numParticles,\n u_AveMovement: initPreviousData,\n u_interval: self.interval // 每次迭代更新,首次设置为 interval,在 onIterationCompleted 中更新\n });\n kernelAveMovement = world\n .createKernel(gForceShader_1.aveMovementBundle)\n .setDispatch([1, 1, 1])\n .setBinding({\n u_Data: nodesEdgesArray,\n VERTEX_COUNT: numParticles,\n u_AveMovement: [0, 0, 0, 0]\n });\n execute = function () { return __awaiter(_this, void 0, void 0, function () {\n var i, stepInterval, finalParticleData;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < maxIteration)) return [3 /*break*/, 5];\n // TODO: 似乎都来自 kernelGForce 是一个引用\n // 当前坐标作为下一次迭代的 PreviousData\n // if (i > 0) {\n // kernelAveMovement.setBinding({\n // u_PreviousData: kernelGForce\n // });\n // }\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, kernelGForce.execute()];\n case 2:\n // TODO: 似乎都来自 kernelGForce 是一个引用\n // 当前坐标作为下一次迭代的 PreviousData\n // if (i > 0) {\n // kernelAveMovement.setBinding({\n // u_PreviousData: kernelGForce\n // });\n // }\n // eslint-disable-next-line no-await-in-loop\n _a.sent();\n // midRes = await kernelGForce.getOutput();\n // 每次迭代完成后\n // 计算平均位移,用于提前终止迭代\n kernelAveMovement.setBinding({\n u_Data: kernelGForce\n });\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, kernelAveMovement.execute()];\n case 3:\n // eslint-disable-next-line no-await-in-loop\n _a.sent();\n stepInterval = Math.max(0.02, self.interval - i * 0.002);\n kernelGForce.setBinding({\n u_interval: stepInterval,\n u_AveMovement: kernelAveMovement\n });\n _a.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 1];\n case 5: return [4 /*yield*/, kernelGForce.getOutput()];\n case 6:\n finalParticleData = _a.sent();\n // 所有迭代完成后\n if (canvas) {\n // 传递数据给主线程\n ctx.postMessage({\n type: constants_1.LAYOUT_MESSAGE.GPUEND,\n vertexEdgeData: finalParticleData\n // edgeIndexBufferData,\n });\n }\n else {\n nodes.forEach(function (node, i) {\n var x = finalParticleData[4 * i];\n var y = finalParticleData[4 * i + 1];\n node.x = x;\n node.y = y;\n });\n }\n if (onLayoutEnd)\n onLayoutEnd();\n return [2 /*return*/];\n }\n });\n }); };\n return [4 /*yield*/, execute()];\n case 1:\n _b.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n GForceGPULayout.prototype.getType = function () {\n return \"gForce-gpu\";\n };\n return GForceGPULayout;\n}(base_1.Base));\nexports.GForceGPULayout = GForceGPULayout;\n//# sourceMappingURL=gForce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gpu/gForce.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/index.js ***! - \**********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/gpu/gForceShader.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/gpu/gForceShader.js ***! + \******************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_g_canvas__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g-canvas */ \"./node_modules/@antv/g-canvas/esm/index.js\");\n/* harmony import */ var _antv_g_svg__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/g-svg */ \"./node_modules/@antv/g-svg/esm/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony import */ var _trendTimeBar__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./trendTimeBar */ \"./node_modules/@antv/g6-plugin/es/timeBar/trendTimeBar.js\");\n/* harmony import */ var _timeBarSlice__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./timeBarSlice */ \"./node_modules/@antv/g6-plugin/es/timeBar/timeBarSlice.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\nvar __rest = undefined && undefined.__rest || function (s, e) {\n var t = {};\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0) t[p] = s[p];\n }\n\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\") for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i])) t[p[i]] = s[p[i]];\n }\n return t;\n};\n/**\n * 基于 G 的时间轴组件\n */\n\n\n\n\n\n\n\n\n\n // simple 版本默认高度\n\nvar DEFAULT_SIMPLE_HEIGHT = 4; // trend 版本默认高度\n\nvar DEFAULT_TREND_HEIGHT = 26;\n\nvar TimeBar =\n/** @class */\nfunction (_super) {\n __extends(TimeBar, _super);\n\n function TimeBar(config) {\n return _super.call(this, config) || this;\n }\n\n TimeBar.prototype.getDefaultCfgs = function () {\n return {\n container: null,\n className: 'g6-component-timebar',\n padding: 10,\n type: 'trend',\n trend: {\n data: [],\n isArea: false,\n smooth: true\n },\n controllerCfg: {\n speed: 1,\n loop: false\n },\n slider: {\n start: 0.1,\n end: 0.9,\n minText: 'min',\n maxText: 'max'\n },\n tick: {\n start: 0.1,\n end: 0.9,\n data: []\n },\n textStyle: {},\n filterEdge: false,\n filterItemTypes: ['node'],\n containerCSS: {}\n };\n };\n /**\n * 初始化 TimeBar 的容器\n */\n\n\n TimeBar.prototype.initContainer = function () {\n var graph = this.get('graph');\n var _a = this._cfgs,\n width = _a.width,\n height = _a.height;\n var className = this.get('className') || 'g6-component-timebar';\n var container = this.get('container');\n var graphContainer = this.get('graph').get('container');\n var timeBarContainer;\n\n if (!container) {\n timeBarContainer = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"createDom\"])(\"
\"));\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(timeBarContainer, {\n position: 'relative'\n });\n } else {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_7__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n timeBarContainer = container;\n }\n\n graphContainer.appendChild(timeBarContainer);\n this.set('timeBarContainer', timeBarContainer);\n var canvas;\n var renderer = graph.get('renderer');\n\n if (renderer === 'SVG') {\n canvas = new _antv_g_svg__WEBPACK_IMPORTED_MODULE_1__[\"Canvas\"]({\n container: timeBarContainer,\n width: width,\n height: height\n });\n } else {\n canvas = new _antv_g_canvas__WEBPACK_IMPORTED_MODULE_0__[\"Canvas\"]({\n container: timeBarContainer,\n width: width,\n height: height\n });\n } // 根据传入的参数修改容器 CSS 样式\n\n\n if (this.get('containerCSS')) Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_2__[\"modifyCSS\"])(timeBarContainer, this.get('containerCSS'));\n this.set('canvas', canvas);\n };\n\n TimeBar.prototype.init = function () {\n this.initContainer();\n var canvas = this.get('canvas');\n var timeBarGroup = canvas.addGroup({\n name: 'timebar-group'\n });\n this.set('timeBarGroup', timeBarGroup);\n this.renderTrend();\n this.initEvent();\n var fontFamily = typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif';\n this.set('fontFamily', fontFamily);\n };\n\n TimeBar.prototype.renderTrend = function () {\n var _this = this;\n\n var _a = this._cfgs,\n width = _a.width,\n x = _a.x,\n y = _a.y,\n padding = _a.padding,\n type = _a.type,\n trend = _a.trend,\n slider = _a.slider,\n controllerCfg = _a.controllerCfg,\n textStyle = _a.textStyle,\n tick = _a.tick,\n backgroundStyle = _a.backgroundStyle,\n foregroundStyle = _a.foregroundStyle;\n\n var data = trend.data,\n other = __rest(trend, [\"data\"]);\n\n var realWidth = width - 2 * padding;\n var defaultHeight = type === 'trend' ? DEFAULT_TREND_HEIGHT : DEFAULT_SIMPLE_HEIGHT;\n var graph = this.get('graph');\n var group = this.get('timeBarGroup');\n var canvas = this.get('canvas');\n var timebar = null;\n\n if (type === 'trend' || type === 'simple') {\n var getValue_1 = this.get('getValue');\n timebar = new _trendTimeBar__WEBPACK_IMPORTED_MODULE_4__[\"default\"](__assign(__assign({\n graph: graph,\n canvas: canvas,\n group: group,\n type: type,\n x: x + padding,\n y: type === 'trend' ? y + padding : y + padding + 15,\n width: realWidth,\n height: defaultHeight,\n padding: padding,\n backgroundStyle: backgroundStyle,\n foregroundStyle: foregroundStyle,\n trendCfg: __assign(__assign({}, other), {\n data: data.map(function (d) {\n return (getValue_1 === null || getValue_1 === void 0 ? void 0 : getValue_1(d)) || d.value;\n })\n })\n }, slider), {\n tick: {\n ticks: data,\n tickLabelFormatter: tick.tickLabelFormatter,\n tickLabelStyle: tick.tickLabelStyle,\n tickLineStyle: tick.tickLineStyle\n },\n handlerStyle: __assign(__assign({}, slider.handlerStyle), {\n height: slider.height || defaultHeight\n }),\n controllerCfg: controllerCfg,\n textStyle: textStyle\n }));\n } else if (type === 'tick') {\n // 刻度时间轴\n timebar = new _timeBarSlice__WEBPACK_IMPORTED_MODULE_5__[\"default\"](__assign({\n graph: graph,\n canvas: canvas,\n group: group,\n x: x + padding,\n y: y + padding,\n width: width,\n height: 42,\n padding: 2\n }, tick));\n } // 鼠标按下左/右滑块或范围条后在任意地方释放,都触发暂停播放\n\n\n var handleMouseUp = function handleMouseUp() {\n var timebarInstance = _this.get('timebar');\n\n timebarInstance.draggingHandler = false;\n\n if (timebarInstance.isPlay) {\n timebarInstance.isPlay = false;\n timebarInstance.currentHandler = timebarInstance.maxHandlerShape;\n timebarInstance.changePlayStatus();\n }\n\n document.removeEventListener('mouseup', handleMouseUp);\n };\n\n canvas.on('mousedown', function (e) {\n if (e.target.get('name') === 'maxHandlerShape-handler' || e.target.get('name') === 'minHandlerShape-handler' || e.target === timebar.foregroundShape) {\n document.addEventListener('mouseup', handleMouseUp);\n }\n });\n this.set('timebar', timebar);\n };\n\n TimeBar.prototype.filterData = function (evt) {\n var _a;\n\n var value = evt.value;\n var trendData = null;\n var type = this._cfgs.type;\n\n if (type === 'trend' || type === 'simple') {\n trendData = this._cfgs.trend.data;\n } else if (type === 'tick') {\n trendData = this._cfgs.tick.data;\n }\n\n if (!trendData || trendData.length === 0) {\n console.warn('请配置 TimeBar 组件的数据');\n return;\n }\n\n var rangeChange = this.get('rangeChange');\n var graph = this.get('graph');\n var min = Math.round(trendData.length * value[0]);\n var max = Math.round(trendData.length * value[1]);\n max = max >= trendData.length ? trendData.length - 1 : max;\n min = min >= trendData.length ? trendData.length - 1 : min;\n var tickLabelFormatter = (_a = this._cfgs.tick) === null || _a === void 0 ? void 0 : _a.tickLabelFormatter;\n var minText = tickLabelFormatter ? tickLabelFormatter(trendData[min]) : trendData[min].date;\n var maxText = tickLabelFormatter ? tickLabelFormatter(trendData[max]) : trendData[max].date;\n\n if (type !== 'tick') {\n var timebar = this.get('timebar');\n timebar.setText(minText, maxText);\n }\n\n if (rangeChange) {\n rangeChange(graph, minText, maxText);\n } else {\n // 自动过滤数据,并渲染 graph\n if (!this.cacheGraphData || this.cacheGraphData.nodes && this.cacheGraphData.nodes.length === 0) {\n this.cacheGraphData = graph.get('data'); // graph.save() as GraphData;\n }\n\n var filterItemTypes = this.get('filterItemTypes');\n var changeData = this.get('changeData'); // 过滤不在 min 和 max 范围内的节点\n\n var getDate_1 = this.get('getDate');\n var shouldIgnore_1 = this.get('shouldIgnore');\n var minDate_1 = trendData[min].date,\n maxDate_1 = trendData[max].date;\n\n if (changeData || changeData === undefined) {\n var filterNodes = this.cacheGraphData.nodes;\n var filterEdges = this.cacheGraphData.edges;\n\n if (filterItemTypes.includes('node')) {\n filterNodes = filterNodes.filter(function (node) {\n var date = +((getDate_1 === null || getDate_1 === void 0 ? void 0 : getDate_1(node)) || node.date);\n return date >= minDate_1 && date <= maxDate_1 || (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('node', node, {\n min: minDate_1,\n max: maxDate_1\n }));\n });\n var nodeIds_1 = filterNodes.map(function (node) {\n return node.id;\n });\n\n if (filterEdges) {\n // 过滤 source 或 target 不在 min 和 max 范围内的边\n filterEdges = filterEdges.filter(function (edge) {\n return nodeIds_1.includes(edge.source) && nodeIds_1.includes(edge.target) || (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('edge', edge, {\n min: minDate_1,\n max: maxDate_1\n }));\n });\n }\n }\n\n if (this.get('filterEdge') || filterItemTypes.includes('edge')) {\n filterEdges = filterEdges.filter(function (edge) {\n var date = +((getDate_1 === null || getDate_1 === void 0 ? void 0 : getDate_1(edge)) || edge.date);\n return date >= minDate_1 && date <= maxDate_1 || (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('edge', edge, {\n min: minDate_1,\n max: maxDate_1\n }));\n });\n }\n\n graph.changeData({\n nodes: filterNodes,\n edges: filterEdges\n });\n } else {\n if (filterItemTypes.includes('node')) {\n graph.getNodes().forEach(function (node) {\n var model = node.getModel();\n if (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('node', model, {\n min: minDate_1,\n max: maxDate_1\n })) return;\n var date = +((getDate_1 === null || getDate_1 === void 0 ? void 0 : getDate_1(model)) || model.date);\n\n if (date < minDate_1 || date > maxDate_1) {\n graph.hideItem(node);\n } else {\n graph.showItem(node);\n }\n });\n }\n\n if (this.get('filterEdge') || filterItemTypes.includes('edge')) {\n graph.getEdges().forEach(function (edge) {\n var model = edge.getModel();\n if (shouldIgnore_1 === null || shouldIgnore_1 === void 0 ? void 0 : shouldIgnore_1('edge', model, {\n min: trendData[min].date,\n max: trendData[max].date\n })) return;\n var date = +((getDate_1 === null || getDate_1 === void 0 ? void 0 : getDate_1(model)) || model.date);\n\n if (date < trendData[min].date || date > trendData[max].date) {\n graph.hideItem(edge);\n } else {\n graph.showItem(edge);\n }\n });\n }\n }\n }\n };\n\n TimeBar.prototype.initEvent = function () {\n var _this = this;\n\n var start = 0;\n var end = 0;\n var type = this._cfgs.type;\n\n if (!type || type === 'trend' || type === 'simple') {\n start = this._cfgs.slider.start;\n end = this._cfgs.slider.end;\n } else if (type === 'tick') {\n start = this._cfgs.tick.start;\n end = this._cfgs.tick.end;\n }\n\n var graph = this.get('graph');\n graph.on('afterrender', function (e) {\n _this.filterData({\n value: [start, end]\n });\n }); // 时间轴的值发生改变的事件\n\n graph.on(_constant__WEBPACK_IMPORTED_MODULE_6__[\"VALUE_CHANGE\"], Object(_antv_util__WEBPACK_IMPORTED_MODULE_7__[\"throttle\"])(function (e) {\n _this.filterData(e);\n }, 200, {\n trailing: true,\n leading: true\n }));\n };\n\n TimeBar.prototype.destroy = function () {\n var timebar = this.get('timebar');\n\n if (timebar && timebar.destory) {\n timebar.destory();\n }\n\n _super.prototype.destroy.call(this);\n\n var timeBarContainer = this.get('timeBarContainer');\n\n if (timeBarContainer) {\n var container = this.get('container');\n\n if (!container) {\n container = this.get('graph').get('container');\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_7__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n container.removeChild(timeBarContainer);\n }\n };\n\n return TimeBar;\n}(_base__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TimeBar);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.aveMovementBundle = exports.aveMovementCode = exports.gForceBundle = exports.gForceCode = void 0;\nexports.gForceCode = \"\\nimport { globalInvocationID } from 'g-webgpu';\\n\\nconst MAX_EDGE_PER_VERTEX;\\nconst VERTEX_COUNT;\\nconst SHIFT_20 = 1048576;\\n\\n@numthreads(1, 1, 1)\\nclass GGForce {\\n @in @out\\n u_Data: vec4[];\\n\\n @in\\n u_damping: float;\\n \\n @in\\n u_maxSpeed: float;\\n\\n @in\\n u_minMovement: float;\\n\\n @in\\n u_AveMovement: vec4[];\\n\\n @in\\n u_coulombDisScale: float;\\n\\n @in\\n u_factor: float;\\n\\n @in\\n u_NodeAttributeArray1: vec4[];\\n\\n @in\\n u_NodeAttributeArray2: vec4[];\\n\\n @in\\n u_interval: float;\\n\\n unpack_float(packedValue: float): ivec2 {\\n const packedIntValue = int(packedValue);\\n const v0 = packedIntValue / SHIFT_20;\\n return [v0, packedIntValue - v0 * SHIFT_20];\\n }\\n\\n calcRepulsive(i: int, currentNode: vec4): vec2 {\\n let ax = 0, ay = 0;\\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\\n if (i != j) {\\n const nextNode = this.u_Data[j];\\n const vx = currentNode[0] - nextNode[0];\\n const vy = currentNode[1] - nextNode[1];\\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\\n const n_dist = (dist + 0.1) * this.u_coulombDisScale;\\n const direx = vx / dist;\\n const direy = vy / dist;\\n const attributesi = this.u_NodeAttributeArray1[i];\\n const attributesj = this.u_NodeAttributeArray1[j];\\n const massi = attributesi[0];\\n const nodeStrengthi = attributesi[2];\\n const nodeStrengthj = attributesj[2];\\n const nodeStrength = (nodeStrengthi + nodeStrengthj) / 2;\\n // const param = nodeStrength * this.u_factor / (n_dist * n_dist * massi);\\n const param = nodeStrength * this.u_factor / (n_dist * n_dist);\\n ax += direx * param;\\n ay += direy * param;\\n }\\n }\\n return [ax, ay];\\n }\\n\\n calcGravity(i: int, currentNode: vec4, attributes2: vec4): vec2 {\\n // note: attributes2 = [centerX, centerY, gravity, 0]\\n\\n const vx = currentNode[0] - attributes2[0];\\n const vy = currentNode[1] - attributes2[1];\\n \\n const ax = vx * attributes2[2];\\n const ay = vy * attributes2[2];\\n \\n return [ax, ay];\\n }\\n\\n calcAttractive(i: int, currentNode: vec4, attributes1: vec4): vec2 {\\n // note: attributes1 = [mass, degree, nodeSterngth, 0]\\n\\n const mass = attributes1[0];\\n let ax = 0, ay = 0;\\n // const arr_offset = int(floor(currentNode[2] + 0.5));\\n // const length = int(floor(currentNode[3] + 0.5));\\n\\n const compressed = this.unpack_float(currentNode[2]);\\n const length = compressed[0];\\n const arr_offset = compressed[1];\\n\\n const node_buffer: vec4;\\n for (let p: int = 0; p < MAX_EDGE_PER_VERTEX; p++) {\\n if (p >= length) break;\\n const arr_idx = arr_offset + 4 * p; // i \\u8282\\u70B9\\u7684\\u7B2C p \\u6761\\u8FB9\\u5F00\\u59CB\\u7684\\u5C0F\\u683C\\u5B50\\u4F4D\\u7F6E\\n const buf_offset = arr_idx - arr_idx / 4 * 4;\\n if (p == 0 || buf_offset == 0) {\\n node_buffer = this.u_Data[int(arr_idx / 4)]; // \\u5927\\u683C\\u5B50\\uFF0C\\u5927\\u683C\\u5B50\\u4F4D\\u7F6E=\\u5C0F\\u4E2A\\u5B50\\u4F4D\\u7F6E / 4\\uFF0C\\n }\\n\\n let float_j: float = node_buffer[0];\\n\\n const nextNode = this.u_Data[int(float_j)];\\n const vx = nextNode[0] - currentNode[0];\\n const vy = nextNode[1] - currentNode[1];\\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\\n const direx = vx / dist;\\n const direy = vy / dist;\\n const edgeLength = node_buffer[1];\\n const edgeStrength = node_buffer[2];\\n const diff: float = edgeLength - dist;//edgeLength\\n // const param = diff * this.u_stiffness / mass; //\\n const param = diff * edgeStrength / mass; // \\n ax -= direx * param;\\n ay -= direy * param;\\n }\\n return [ax, ay];\\n }\\n\\n @main\\n compute() {\\n const i = globalInvocationID.x;\\n const currentNode = this.u_Data[i];\\n const movement = u_AveMovement[0];\\n let ax = 0, ay = 0;\\n\\n if (i >= VERTEX_COUNT || movement.x < u_minMovement) {\\n this.u_Data[i] = currentNode;\\n return;\\n }\\n\\n // \\u6BCF\\u4E2A\\u8282\\u70B9\\u5C5E\\u6027\\u5360\\u4E24\\u4E2A\\u6570\\u7EC4\\u4E2D\\u5404\\u4E00\\u683C\\n // [mass, degree, nodeStrength, fx]\\n const nodeAttributes1 = this.u_NodeAttributeArray1[i];\\n // [centerX, centerY, centerGravity, fy]\\n const nodeAttributes2 = this.u_NodeAttributeArray2[i];\\n\\n // repulsive\\n const repulsive = this.calcRepulsive(i, currentNode);\\n ax += repulsive[0];\\n ay += repulsive[1];\\n\\n // attractive\\n const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);\\n ax += attractive[0];\\n ay += attractive[1];\\n\\n // gravity\\n const gravity = this.calcGravity(i, currentNode, nodeAttributes2);\\n ax -= gravity[0];\\n ay -= gravity[1];\\n\\n // speed\\n const param = this.u_interval * this.u_damping;\\n let vx = ax * param;\\n let vy = ay * param;\\n const vlength = sqrt(vx * vx + vy * vy) + 0.0001;\\n if (vlength > this.u_maxSpeed) {\\n const param2 = this.u_maxSpeed / vlength;\\n vx = param2 * vx;\\n vy = param2 * vy;\\n }\\n\\n // move\\n if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {\\n this.u_Data[i] = [\\n nodeAttributes1[3],\\n nodeAttributes2[3],\\n currentNode[2],\\n 0\\n ];\\n } else {\\n const distx = vx * this.u_interval;\\n const disty = vy * this.u_interval;\\n const distLength = sqrt(distx * distx + disty * disty);\\n this.u_Data[i] = [\\n currentNode[0] + distx,\\n currentNode[1] + disty,\\n currentNode[2],\\n distLength\\n ];\\n }\\n \\n // the avarage move distance\\n // need to share memory\\n \\n }\\n}\\n\";\nexports.gForceBundle = \"{\\\"shaders\\\":{\\\"WGSL\\\":\\\"\\\",\\\"GLSL450\\\":\\\"\\\",\\\"GLSL100\\\":\\\"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define SHIFT_20 1048576.0\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_damping;\\\\nuniform float u_maxSpeed;\\\\nuniform float u_minMovement;\\\\nuniform sampler2D u_AveMovement;\\\\nuniform vec2 u_AveMovementSize;\\\\nvec4 getDatau_AveMovement(vec2 address2D) {\\\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AveMovement(float address1D) {\\\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\\\n}\\\\nvec4 getDatau_AveMovement(int address1D) {\\\\n return getDatau_AveMovement(float(address1D));\\\\n}\\\\nuniform float u_coulombDisScale;\\\\nuniform float u_factor;\\\\nuniform sampler2D u_NodeAttributeArray1;\\\\nuniform vec2 u_NodeAttributeArray1Size;\\\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\\\n}\\\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\\\n return getDatau_NodeAttributeArray1(float(address1D));\\\\n}\\\\nuniform sampler2D u_NodeAttributeArray2;\\\\nuniform vec2 u_NodeAttributeArray2Size;\\\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\\\n}\\\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\\\n return getDatau_NodeAttributeArray2(float(address1D));\\\\n}\\\\nuniform float u_interval;\\\\nivec2 unpack_float(float packedValue) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint packedIntValue = int(packedValue);\\\\nint v0 = packedIntValue / int(SHIFT_20);\\\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\\\nfloat vx = currentNode.x - nextNode.x;\\\\nfloat vy = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\\\nfloat massi = attributesi.x;\\\\nfloat nodeStrengthi = attributesi.z;\\\\nfloat nodeStrengthj = attributesj.z;\\\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\\\nax += direx * param;\\\\nay += direy * param;}}\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat vx = currentNode.x - attributes2.x;\\\\nfloat vy = currentNode.y - attributes2.y;\\\\nfloat ax = vx * attributes2.z;\\\\nfloat ay = vy * attributes2.z;\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat mass = attributes1.x;\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nivec2 compressed = unpack_float(currentNode.z);\\\\nint length = compressed.x;\\\\nint arr_offset = compressed.y;\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + (4 * p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\\\nfloat float_j = node_buffer.x;\\\\nvec4 nextNode = getDatau_Data(int(float_j));\\\\nfloat vx = nextNode.x - currentNode.x;\\\\nfloat vy = nextNode.y - currentNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nfloat edgeLength = node_buffer.y;\\\\nfloat edgeStrength = node_buffer.z;\\\\nfloat diff = edgeLength - dist;\\\\nfloat param = (diff * edgeStrength) / mass;\\\\nax -= direx * param;\\\\nay -= direy * param;}\\\\nreturn vec2(ax, ay);}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 currentNode = getDatau_Data(i);\\\\nvec4 movement = getDatau_AveMovement(0.0);\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\\\nreturn ;}\\\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\nax += repulsive.x;\\\\nay += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\\\nax += attractive.x;\\\\nay += attractive.y;\\\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\\\nax -= gravity.x;\\\\nay -= gravity.y;\\\\nfloat param = u_interval * u_damping;\\\\nfloat vx = ax * param;\\\\nfloat vy = ay * param;\\\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\\\nvx = param2 * vx;\\\\nvy = param2 * vy;}\\\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {float distx = vx * u_interval;\\\\nfloat disty = vy * u_interval;\\\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\\\ngl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n\\\"},\\\"context\\\":{\\\"name\\\":\\\"\\\",\\\"dispatch\\\":[1,1,1],\\\"threadGroupSize\\\":[1,1,1],\\\"maxIteration\\\":1,\\\"defines\\\":[{\\\"name\\\":\\\"MAX_EDGE_PER_VERTEX\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true},{\\\"name\\\":\\\"VERTEX_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true},{\\\"name\\\":\\\"SHIFT_20\\\",\\\"type\\\":\\\"Float\\\",\\\"value\\\":1048576,\\\"runtime\\\":false}],\\\"uniforms\\\":[{\\\"name\\\":\\\"u_Data\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":false,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_damping\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_maxSpeed\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_minMovement\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_AveMovement\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_coulombDisScale\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_factor\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_NodeAttributeArray1\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_NodeAttributeArray2\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_interval\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]}],\\\"globalDeclarations\\\":[],\\\"output\\\":{\\\"name\\\":\\\"u_Data\\\",\\\"size\\\":[1,1],\\\"length\\\":1},\\\"needPingpong\\\":true}}\";\nexports.aveMovementCode = \"\\nconst VERTEX_COUNT;\\n@numthreads(1, 1, 1)\\nclass CalcAveMovement {\\n @in\\n u_Data: vec4[];\\n @in\\n u_iter: float;\\n @in @out\\n u_AveMovement: vec4[];\\n @main\\n compute() {\\n let movement = 0;\\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\\n const vertex = this.u_Data[j];\\n movement += vertex[3];\\n }\\n movement = movement / float(VERTEX_COUNT);\\n this.u_AveMovement[0] = [movement, 0, 0, 0];\\n }\\n}\\n\";\nexports.aveMovementBundle = \"{\\\"shaders\\\":{\\\"WGSL\\\":\\\"\\\",\\\"GLSL450\\\":\\\"\\\",\\\"GLSL100\\\":\\\"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_iter;\\\\nuniform sampler2D u_AveMovement;\\\\nuniform vec2 u_AveMovementSize;\\\\nvec4 getDatau_AveMovement(vec2 address2D) {\\\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AveMovement(float address1D) {\\\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\\\n}\\\\nvec4 getDatau_AveMovement(int address1D) {\\\\n return getDatau_AveMovement(float(address1D));\\\\n}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat movement = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\\\nmovement += vertex.w;}\\\\nmovement = movement / float(VERTEX_COUNT);\\\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n\\\"},\\\"context\\\":{\\\"name\\\":\\\"\\\",\\\"dispatch\\\":[1,1,1],\\\"threadGroupSize\\\":[1,1,1],\\\"maxIteration\\\":1,\\\"defines\\\":[{\\\"name\\\":\\\"VERTEX_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true}],\\\"uniforms\\\":[{\\\"name\\\":\\\"u_Data\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_iter\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_AveMovement\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":false,\\\"writeonly\\\":false,\\\"size\\\":[1,1]}],\\\"globalDeclarations\\\":[],\\\"output\\\":{\\\"name\\\":\\\"u_AveMovement\\\",\\\"size\\\":[1,1],\\\"length\\\":1},\\\"needPingpong\\\":true}}\";\n//# sourceMappingURL=gForceShader.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gpu/gForceShader.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/path.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/path.js ***! - \*********************************************************/ -/*! exports provided: getLinePath, getSmoothLinePath, dataToPath, dataToRectPath, getAreaLineY, linePathToAreaPath, getRectPoints, getRectPath */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/grid.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/grid.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLinePath\", function() { return getLinePath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSmoothLinePath\", function() { return getSmoothLinePath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataToPath\", function() { return dataToPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dataToRectPath\", function() { return dataToRectPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAreaLineY\", function() { return getAreaLineY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"linePathToAreaPath\", function() { return linePathToAreaPath; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRectPoints\", function() { return getRectPoints; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRectPath\", function() { return getRectPath; });\n/* harmony import */ var _antv_path_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/path-util */ \"./node_modules/@antv/path-util/esm/index.js\");\n/* harmony import */ var _antv_scale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/scale */ \"./node_modules/@antv/scale/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\nvar __spreadArray = undefined && undefined.__spreadArray || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\n\n\n\n\n/**\n * 点数组转 path\n * @param points\n */\n\nfunction pointsToPath(points) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(points, function (p, idx) {\n var command = idx === 0 ? 'M' : 'L';\n var x = p[0],\n y = p[1];\n return [command, x, y];\n });\n}\n/**\n * 将点连接成路径 path\n * @param points\n */\n\n\nfunction getLinePath(points) {\n return pointsToPath(points);\n}\n/**\n * 将点连成平滑的曲线\n * @param points\n */\n\nfunction getSmoothLinePath(points) {\n if (points.length <= 2) {\n // 两点以内直接绘制成路径\n return getLinePath(points);\n }\n\n var data = [];\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(points, function (p) {\n // 当前点和上一个点一样的时候,忽略掉\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isEqual\"])(p, data.slice(data.length - 2))) {\n data.push(p[0], p[1]);\n }\n });\n var path = _antv_path_util__WEBPACK_IMPORTED_MODULE_0__[\"catmullRom2Bezier\"](data, false);\n\n var _a = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"head\"])(points),\n x = _a[0],\n y = _a[1];\n\n path.unshift(['M', x, y]);\n return path;\n}\n/**\n * 将数据转成 path,利用 scale 的归一化能力\n * @param data\n * @param width\n * @param height\n * @param smooth\n */\n\nfunction dataToPath(data, width, height, smooth) {\n if (smooth === void 0) {\n smooth = true;\n } // 利用 scale 来获取 y 上的映射\n\n\n var y = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Linear\"]({\n values: data\n });\n var x = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Category\"]({\n values: Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(data, function (v, idx) {\n return idx;\n })\n });\n var points = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(data, function (v, idx) {\n return [x.scale(idx) * width, height - y.scale(v) * height];\n });\n return smooth ? getSmoothLinePath(points) : getLinePath(points);\n}\nfunction dataToRectPath(data, width, height, barWidth) {\n if (barWidth === void 0) {\n barWidth = 5;\n } // 利用 scale 来获取 y 上的映射\n\n\n var y = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Linear\"]({\n values: data\n });\n var x = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Category\"]({\n values: Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(data, function (v, idx) {\n return idx;\n })\n });\n var points = Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"map\"])(data, function (v, idx) {\n return [x.scale(idx) * width, height - y.scale(v) * height];\n });\n var rectPoints = [];\n\n for (var i = 0; i < points.length; i++) {\n var point = points[i];\n var param = {\n x: point[0],\n y: point[1],\n y0: height,\n size: barWidth\n };\n var rectPoint = getRectPoints(param);\n rectPoints.push.apply(rectPoints, rectPoint);\n }\n\n return getRectPath(rectPoints);\n}\n/**\n * 获得 area 面积的横向连接线的 px 位置\n * @param data\n * @param width\n * @param height\n */\n\nfunction getAreaLineY(data, height) {\n var y = new _antv_scale__WEBPACK_IMPORTED_MODULE_1__[\"Linear\"]({\n values: data\n });\n var lineY = Math.max(0, y.min);\n return height - y.scale(lineY) * height;\n}\n/**\n * 线 path 转 area path\n * @param path\n * @param width\n * @param height\n */\n\nfunction linePathToAreaPath(path, width, height, data) {\n var areaPath = __spreadArray([], path, true);\n\n var lineYPx = getAreaLineY(data, height);\n areaPath.push(['L', width, lineYPx]);\n areaPath.push(['L', 0, lineYPx]);\n areaPath.push(['Z']);\n return areaPath;\n}\n/**\n * @ignore\n * 根据数据点生成矩形的四个关键点\n * @param pointInfo 数据点信息\n * @returns rect points 返回矩形四个顶点信息\n */\n\nfunction getRectPoints(pointInfo) {\n var x = pointInfo.x,\n y = pointInfo.y,\n y0 = pointInfo.y0,\n size = pointInfo.size; // 有 4 种情况,\n // 1. x, y 都不是数组\n // 2. y是数组,x不是\n // 3. x是数组,y不是\n // 4. x, y 都是数组\n\n var yMin;\n var yMax;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(y)) {\n yMin = y[0], yMax = y[1];\n } else {\n yMin = y0;\n yMax = y;\n }\n\n var xMin;\n var xMax;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"isArray\"])(x)) {\n xMin = x[0], xMax = x[1];\n } else {\n xMin = x - size / 2;\n xMax = x + size / 2;\n }\n\n var points = [{\n x: xMin,\n y: yMin\n }, {\n x: xMin,\n y: yMax\n }]; // 矩形的四个关键点,结构如下(左下角顺时针连接)\n // 1 ---- 2\n // | |\n // 0 ---- 3\n\n points.push({\n x: xMax,\n y: yMax\n }, {\n x: xMax,\n y: yMin\n });\n return points;\n}\n/**\n * @ignore\n * 根据矩形关键点绘制 path\n * @param points 关键点数组\n * @param isClosed path 是否需要闭合\n * @returns 返回矩形的 path\n */\n\nfunction getRectPath(points, isClosed) {\n if (isClosed === void 0) {\n isClosed = true;\n }\n\n var path = [];\n var firstPoint = points[0];\n path.push(['M', firstPoint.x, firstPoint.y]);\n\n for (var i = 1, len = points.length; i < len; i++) {\n path.push(['L', points[i].x, points[i].y]);\n } // 对于 shape=\"line\" path 不应该闭合,否则会造成 lineCap 绘图属性失效\n\n\n if (isClosed) {\n path.push(['L', firstPoint.x, firstPoint.y]); // 需要闭合\n\n path.push(['z']);\n }\n\n return path;\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/path.js?"); +eval("\n/**\n * @fileOverview grid layout\n * @author shiwu.wyy@antfin.com\n * this algorithm refers to - https://github.com/cytoscape/cytoscape.js/\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GridLayout = void 0;\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\n/**\n * 网格布局\n */\nvar GridLayout = /** @class */ (function (_super) {\n __extends(GridLayout, _super);\n function GridLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局起始点 */\n _this.begin = [0, 0];\n /** prevents node overlap, may overflow boundingBox if not enough space */\n _this.preventOverlap = true;\n /** extra spacing around nodes when preventOverlap: true */\n _this.preventOverlapPadding = 10;\n /** uses all available space on false, uses minimal space on true */\n _this.condense = false;\n /** a sorting function to order the nodes; e.g. function(a, b){ return a.datapublic ('weight') - b.data('weight') } */\n _this.sortBy = \"degree\";\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.row = 0;\n _this.col = 0;\n _this.cellWidth = 0;\n _this.cellHeight = 0;\n _this.cellUsed = {};\n _this.id2manPos = {};\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n GridLayout.prototype.getDefaultCfg = function () {\n return {\n begin: [0, 0],\n preventOverlap: true,\n preventOverlapPadding: 10,\n condense: false,\n rows: undefined,\n cols: undefined,\n position: undefined,\n sortBy: \"degree\",\n nodeSize: 30\n };\n };\n /**\n * 执行布局\n */\n GridLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes, edges = self.edges, begin = self.begin;\n var n = nodes.length;\n if (n === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n }\n if (n === 1) {\n nodes[0].x = begin[0];\n nodes[0].y = begin[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges,\n };\n }\n var sortBy = self.sortBy, width = self.width, height = self.height;\n var condense = self.condense, preventOverlapPadding = self.preventOverlapPadding, preventOverlap = self.preventOverlap, paramNodeSpacing = self.nodeSpacing, paramNodeSize = self.nodeSize;\n var layoutNodes = [];\n nodes.forEach(function (node) {\n layoutNodes.push(node);\n });\n var nodeIdxMap = {};\n layoutNodes.forEach(function (node, i) {\n nodeIdxMap[node.id] = i;\n });\n if (sortBy === \"degree\" ||\n !(0, util_1.isString)(sortBy) ||\n layoutNodes[0][sortBy] === undefined) {\n sortBy = \"degree\";\n if ((0, util_1.isNaN)(nodes[0].degree)) {\n var values_1 = (0, util_1.getDegree)(layoutNodes.length, nodeIdxMap, edges);\n layoutNodes.forEach(function (node, i) {\n node.degree = values_1[i].all;\n });\n }\n }\n // sort nodes by value\n layoutNodes.sort(function (n1, n2) { return n2[sortBy] - n1[sortBy]; });\n if (!width && typeof window !== \"undefined\") {\n width = window.innerWidth;\n }\n if (!height && typeof window !== \"undefined\") {\n height = window.innerHeight;\n }\n var oRows = self.rows;\n var oCols = self.cols != null ? self.cols : self.columns;\n self.cells = n;\n // if rows or columns were set in self, use those values\n if (oRows != null && oCols != null) {\n self.rows = oRows;\n self.cols = oCols;\n }\n else if (oRows != null && oCols == null) {\n self.rows = oRows;\n self.cols = Math.ceil(self.cells / self.rows);\n }\n else if (oRows == null && oCols != null) {\n self.cols = oCols;\n self.rows = Math.ceil(self.cells / self.cols);\n }\n else {\n // otherwise use the automatic values and adjust accordingly\t // otherwise use the automatic values and adjust accordingly\n // width/height * splits^2 = cells where splits is number of times to split width\n self.splits = Math.sqrt((self.cells * self.height) / self.width);\n self.rows = Math.round(self.splits);\n self.cols = Math.round((self.width / self.height) * self.splits);\n }\n self.rows = Math.max(self.rows, 1);\n self.cols = Math.max(self.cols, 1);\n if (self.cols * self.rows > self.cells) {\n // otherwise use the automatic values and adjust accordingly\n // if rounding was up, see if we can reduce rows or columns\n var sm = self.small();\n var lg = self.large();\n // reducing the small side takes away the most cells, so try it first\n if ((sm - 1) * lg >= self.cells) {\n self.small(sm - 1);\n }\n else if ((lg - 1) * sm >= self.cells) {\n self.large(lg - 1);\n }\n }\n else {\n // if rounding was too low, add rows or columns\n while (self.cols * self.rows < self.cells) {\n var sm = self.small();\n var lg = self.large();\n // try to add to larger side first (adds less in multiplication)\n if ((lg + 1) * sm >= self.cells) {\n self.large(lg + 1);\n }\n else {\n self.small(sm + 1);\n }\n }\n }\n self.cellWidth = width / self.cols;\n self.cellHeight = height / self.rows;\n if (condense) {\n self.cellWidth = 0;\n self.cellHeight = 0;\n }\n if (preventOverlap || paramNodeSpacing) {\n var nodeSpacing_1 = (0, util_1.getFuncByUnknownType)(10, paramNodeSpacing);\n var nodeSize_1 = (0, util_1.getFuncByUnknownType)(30, paramNodeSize, false);\n layoutNodes.forEach(function (node) {\n if (!node.x || !node.y) {\n // for bb\n node.x = 0;\n node.y = 0;\n }\n var res = nodeSize_1(node) || 30;\n var nodeW;\n var nodeH;\n if ((0, util_1.isArray)(res)) {\n nodeW = res[0];\n nodeH = res[1];\n }\n else {\n nodeW = res;\n nodeH = res;\n }\n var p = nodeSpacing_1 !== undefined ? nodeSpacing_1(node) : preventOverlapPadding;\n var w = nodeW + p;\n var h = nodeH + p;\n self.cellWidth = Math.max(self.cellWidth, w);\n self.cellHeight = Math.max(self.cellHeight, h);\n });\n }\n self.cellUsed = {}; // e.g. 'c-0-2' => true\n // to keep track of current cell position\n self.row = 0;\n self.col = 0;\n // get a cache of all the manual positions\n self.id2manPos = {};\n for (var i = 0; i < layoutNodes.length; i++) {\n var node = layoutNodes[i];\n var rcPos = void 0;\n if (self.position) {\n rcPos = self.position(node);\n }\n if (rcPos && (rcPos.row !== undefined || rcPos.col !== undefined)) {\n // must have at least row or col def'd\n var pos = {\n row: rcPos.row,\n col: rcPos.col\n };\n if (pos.col === undefined) {\n // find unused col\n pos.col = 0;\n while (self.used(pos.row, pos.col)) {\n pos.col++;\n }\n }\n else if (pos.row === undefined) {\n // find unused row\n pos.row = 0;\n while (self.used(pos.row, pos.col)) {\n pos.row++;\n }\n }\n self.id2manPos[node.id] = pos;\n self.use(pos.row, pos.col);\n }\n self.getPos(node);\n }\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n edges: edges,\n nodes: layoutNodes\n };\n };\n GridLayout.prototype.small = function (val) {\n var self = this;\n var res;\n var rows = self.rows || 5;\n var cols = self.cols || 5;\n if (val == null) {\n res = Math.min(rows, cols);\n }\n else {\n var min = Math.min(rows, cols);\n if (min === self.rows) {\n self.rows = val;\n }\n else {\n self.cols = val;\n }\n }\n return res;\n };\n GridLayout.prototype.large = function (val) {\n var self = this;\n var res;\n var rows = self.rows || 5;\n var cols = self.cols || 5;\n if (val == null) {\n res = Math.max(rows, cols);\n }\n else {\n var max = Math.max(rows, cols);\n if (max === self.rows) {\n self.rows = val;\n }\n else {\n self.cols = val;\n }\n }\n return res;\n };\n GridLayout.prototype.used = function (row, col) {\n var self = this;\n return self.cellUsed[\"c-\".concat(row, \"-\").concat(col)] || false;\n };\n GridLayout.prototype.use = function (row, col) {\n var self = this;\n self.cellUsed[\"c-\".concat(row, \"-\").concat(col)] = true;\n };\n GridLayout.prototype.moveToNextCell = function () {\n var self = this;\n var cols = self.cols || 5;\n self.col++;\n if (self.col >= cols) {\n self.col = 0;\n self.row++;\n }\n };\n GridLayout.prototype.getPos = function (node) {\n var self = this;\n var begin = self.begin, cellWidth = self.cellWidth, cellHeight = self.cellHeight;\n var x;\n var y;\n // see if we have a manual position set\n var rcPos = self.id2manPos[node.id];\n if (rcPos) {\n x = rcPos.col * cellWidth + cellWidth / 2 + begin[0];\n y = rcPos.row * cellHeight + cellHeight / 2 + begin[1];\n }\n else {\n // otherwise set automatically\n while (self.used(self.row, self.col)) {\n self.moveToNextCell();\n }\n x = self.col * cellWidth + cellWidth / 2 + begin[0];\n y = self.row * cellHeight + cellHeight / 2 + begin[1];\n self.use(self.row, self.col);\n self.moveToNextCell();\n }\n node.x = x;\n node.y = y;\n };\n GridLayout.prototype.getType = function () {\n return \"grid\";\n };\n return GridLayout;\n}(base_1.Base));\nexports.GridLayout = GridLayout;\n//# sourceMappingURL=grid.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/grid.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/timeBarSlice.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/timeBarSlice.js ***! - \*****************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/index.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/index.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _timeBarTooltip__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./timeBarTooltip */ \"./node_modules/@antv/g6-plugin/es/timeBar/timeBarTooltip.js\");\n/* harmony import */ var _controllerBtn__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./controllerBtn */ \"./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n/**\n * 基于 G 的刻度时间轴组件\n */\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"ext\"].transform;\nvar DEFAULT_SELECTEDTICK_STYLE = {\n fill: '#5B8FF9'\n};\nvar DEFAULT_UNSELECTEDTICK_STYLE = {\n fill: '#e6e8e9'\n};\n\nvar TimeBarSlice =\n/** @class */\nfunction () {\n function TimeBarSlice(cfgs) {\n this.frameCount = 0;\n this.fontFamily = 'Arial, sans-serif';\n var graph = cfgs.graph,\n canvas = cfgs.canvas,\n group = cfgs.group,\n width = cfgs.width,\n height = cfgs.height,\n padding = cfgs.padding,\n data = cfgs.data,\n start = cfgs.start,\n end = cfgs.end,\n _a = cfgs.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfgs.y,\n y = _b === void 0 ? 0 : _b,\n tickLabelFormatter = cfgs.tickLabelFormatter,\n _c = cfgs.selectedTickStyle,\n selectedTickStyle = _c === void 0 ? DEFAULT_SELECTEDTICK_STYLE : _c,\n _d = cfgs.unselectedTickStyle,\n unselectedTickStyle = _d === void 0 ? DEFAULT_UNSELECTEDTICK_STYLE : _d,\n tooltipBackgroundColor = cfgs.tooltipBackgroundColor,\n tooltipFomatter = cfgs.tooltipFomatter,\n tickLabelStyle = cfgs.tickLabelStyle;\n this.graph = graph;\n this.group = group;\n this.sliceGroup = group.addGroup({\n name: 'slice-group'\n });\n this.canvas = canvas;\n this.width = width;\n this.height = height;\n this.padding = padding;\n this.data = data;\n this.start = start;\n this.end = end;\n this.tickLabelFormatter = tickLabelFormatter;\n this.tickLabelStyle = tickLabelStyle || {};\n this.selectedTickStyle = selectedTickStyle;\n this.unselectedTickStyle = unselectedTickStyle;\n this.x = x;\n this.y = y;\n this.tooltipBackgroundColor = tooltipBackgroundColor;\n this.tooltipFomatter = tooltipFomatter; // 初始化 fontFamily,如果有浏览器,取 body 上的字体,防止文字更新时局部渲染造成的重影\n\n this.fontFamily = typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif';\n this.renderSlices();\n this.initEvent();\n }\n\n TimeBarSlice.prototype.renderSlices = function () {\n var _this = this;\n\n var _a = this,\n width = _a.width,\n height = _a.height,\n padding = _a.padding,\n data = _a.data,\n start = _a.start,\n end = _a.end,\n tickLabelFormatter = _a.tickLabelFormatter,\n selectedTickStyle = _a.selectedTickStyle,\n unselectedTickStyle = _a.unselectedTickStyle,\n tickLabelStyle = _a.tickLabelStyle;\n\n var realWidth = width - 2 * padding;\n var fontSize = 10;\n var labelLineHeight = 4;\n var labelAreaHeight = 3 * padding + labelLineHeight + fontSize;\n var ticksAreaHeight = height - labelAreaHeight - 2 * padding;\n var gap = 2;\n var ticksLength = data.length;\n var tickWidth = (realWidth - gap * (ticksLength - 1)) / ticksLength;\n this.tickWidth = tickWidth;\n var sliceGroup = this.sliceGroup;\n var tickRects = [];\n var labels = [];\n var startTickId = Math.round(ticksLength * start);\n var endTickId = Math.round(ticksLength * end);\n this.startTickRectId = startTickId;\n this.endTickRectId = endTickId;\n var rotate = tickLabelStyle.rotate;\n delete tickLabelStyle.rotate;\n data.forEach(function (d, i) {\n // draw the tick rects\n var selected = i >= startTickId && i <= endTickId;\n var tickStyle = selected ? selectedTickStyle : unselectedTickStyle;\n var rect = sliceGroup.addShape('rect', {\n attrs: __assign({\n x: padding + i * (tickWidth + gap),\n y: padding,\n width: tickWidth,\n height: ticksAreaHeight\n }, tickStyle),\n draggable: true,\n name: \"tick-rect-\".concat(i)\n }); // draw the pick tick rects\n\n var pickRect = sliceGroup.addShape('rect', {\n attrs: {\n x: padding + i * tickWidth + gap * (2 * i - 1) / 2,\n y: padding,\n width: i === 0 || i === ticksLength - 1 ? tickWidth + gap / 2 : tickWidth + gap,\n height: ticksAreaHeight,\n fill: '#fff',\n opacity: 0\n },\n draggable: true,\n name: \"pick-rect-\".concat(i)\n });\n pickRect.toFront();\n var rectBBox = rect.getBBox();\n var centerX = (rectBBox.minX + rectBBox.maxX) / 2;\n tickRects.push({\n rect: rect,\n pickRect: pickRect,\n value: d.date,\n x: centerX,\n y: rectBBox.minY\n });\n var label;\n\n if (tickLabelFormatter) {\n label = tickLabelFormatter(d);\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(label) && label) {\n // return true\n label = d.date;\n }\n } else if (i % Math.round(ticksLength / 10) === 0) {\n label = d.date;\n }\n\n if (label) {\n labels.push(label); // draw tick lines\n\n var lineStartY = rectBBox.maxY + padding * 2;\n sliceGroup.addShape('line', {\n attrs: {\n stroke: '#BFBFBF',\n x1: centerX,\n y1: lineStartY,\n x2: centerX,\n y2: lineStartY + labelLineHeight\n },\n name: 'tick-line'\n });\n var labelStartY = lineStartY + labelLineHeight + padding;\n var text = sliceGroup.addShape('text', {\n attrs: __assign({\n fill: '#8c8c8c',\n stroke: '#fff',\n lineWidth: 1,\n x: centerX,\n y: labelStartY,\n textAlign: 'center',\n text: label,\n textBaseline: 'top',\n fontSize: 10,\n fontFamily: _this.fontFamily || 'Arial, sans-serif'\n }, tickLabelStyle),\n capture: false,\n name: 'tick-label'\n });\n var textBBox = text.getBBox();\n\n if (textBBox.maxX > width) {\n text.attr('textAlign', 'right');\n } else if (textBBox.minX < 0) {\n text.attr('textAlign', 'left');\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(rotate) && labels.length !== 10) {\n var matrix = transform([1, 0, 0, 0, 1, 0, 0, 0, 1], [['t', -centerX, -labelStartY], ['r', rotate], ['t', centerX - 5, labelStartY + 2]]);\n text.attr({\n textAlign: 'left',\n matrix: matrix\n });\n }\n\n if (labels.length === 1) {\n text.attr({\n textAlign: 'left'\n });\n } else if (labels.length === 10) {\n text.attr({\n textAlign: 'right'\n });\n } // draw tick labels\n\n }\n });\n this.tickRects = tickRects; // 渲染播放、快进和后退的控制按钮\n\n var group = this.group;\n this.currentSpeed = 1;\n this.controllerBtnGroup = new _controllerBtn__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n group: group,\n x: this.x,\n y: this.y + height + 5,\n width: width,\n height: 40,\n hideTimeTypeController: true,\n speed: this.currentSpeed,\n fontFamily: this.fontFamily || 'Arial, sans-serif'\n });\n };\n\n TimeBarSlice.prototype.initEvent = function () {\n var _this = this;\n\n var sliceGroup = this.sliceGroup;\n sliceGroup.on('click', function (e) {\n var targetRect = e.target;\n if (targetRect.get('type') !== 'rect' || !targetRect.get('name')) return;\n var id = parseInt(targetRect.get('name').split('-')[2], 10);\n\n if (!isNaN(id)) {\n var tickRects_1 = _this.tickRects; // cancel the selected ticks\n\n var unselectedTickStyle_1 = _this.unselectedTickStyle;\n tickRects_1.forEach(function (tickRect) {\n tickRect.rect.attr(unselectedTickStyle_1);\n });\n var selectedTickStyle = _this.selectedTickStyle;\n tickRects_1[id].rect.attr(selectedTickStyle);\n _this.startTickRectId = id;\n _this.endTickRectId = id;\n var ticksLength = tickRects_1.length;\n var start = id / ticksLength;\n\n _this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, start]\n });\n }\n });\n sliceGroup.on('dragstart', function (e) {\n var tickRects = _this.tickRects; // cancel the selected ticks\n\n var unselectedTickStyle = _this.unselectedTickStyle;\n tickRects.forEach(function (tickRect) {\n tickRect.rect.attr(unselectedTickStyle);\n });\n var targetRect = e.target;\n var id = parseInt(targetRect.get('name').split('-')[2], 10);\n var selectedTickStyle = _this.selectedTickStyle;\n tickRects[id].rect.attr(selectedTickStyle);\n _this.startTickRectId = id;\n var ticksLength = tickRects.length;\n var start = id / ticksLength;\n\n _this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, start]\n });\n\n _this.dragging = true;\n });\n sliceGroup.on('dragover', function (e) {\n if (!_this.dragging) return;\n if (e.target.get('type') !== 'rect') return;\n var id = parseInt(e.target.get('name').split('-')[2], 10);\n var startTickRectId = _this.startTickRectId;\n var tickRects = _this.tickRects;\n var selectedTickStyle = _this.selectedTickStyle;\n var unselectedTickStyle = _this.unselectedTickStyle;\n\n for (var i = 0; i < tickRects.length; i++) {\n var style = i >= startTickRectId && i <= id ? selectedTickStyle : unselectedTickStyle;\n tickRects[i].rect.attr(style);\n }\n\n var ticksLength = tickRects.length;\n _this.endTickRectId = id;\n var start = startTickRectId / ticksLength;\n var end = id / ticksLength;\n\n _this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, end]\n });\n });\n sliceGroup.on('drop', function (e) {\n if (!_this.dragging) return;\n _this.dragging = false;\n if (e.target.get('type') !== 'rect') return;\n var startTickRectId = _this.startTickRectId;\n var id = parseInt(e.target.get('name').split('-')[2], 10);\n if (id < startTickRectId) return;\n var selectedTickStyle = _this.selectedTickStyle;\n var tickRects = _this.tickRects;\n tickRects[id].rect.attr(selectedTickStyle);\n _this.endTickRectId = id;\n var ticksLength = tickRects.length;\n var start = startTickRectId / ticksLength;\n var end = id / ticksLength;\n\n _this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, end]\n });\n }); // tooltip\n\n var _a = this,\n tooltipBackgroundColor = _a.tooltipBackgroundColor,\n tooltipFomatter = _a.tooltipFomatter,\n canvas = _a.canvas;\n\n var tooltip = new _timeBarTooltip__WEBPACK_IMPORTED_MODULE_2__[\"default\"]({\n container: canvas.get('container'),\n backgroundColor: tooltipBackgroundColor\n });\n var tickRects = this.tickRects;\n tickRects.forEach(function (tickRect) {\n var pickRect = tickRect.pickRect;\n pickRect.on('mouseenter', function (e) {\n var rect = e.target;\n if (rect.get('type') !== 'rect') return;\n var id = parseInt(rect.get('name').split('-')[2], 10);\n var clientPoint = canvas.getClientByPoint(tickRects[id].x, tickRects[id].y);\n tooltip.show({\n x: tickRects[id].x,\n y: tickRects[id].y,\n clientX: clientPoint.x,\n clientY: clientPoint.y,\n text: tooltipFomatter ? tooltipFomatter(tickRects[id].value) : tickRects[id].value\n });\n });\n pickRect.on('mouseleave', function (e) {\n tooltip.hide();\n });\n }); // play controller events\n\n var group = this.group; // 播放区按钮控制\n\n /** 播放/暂停事件 */\n\n group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"PLAY_PAUSE_BTN\"], \":click\"), function () {\n _this.isPlay = !_this.isPlay;\n\n _this.changePlayStatus();\n }); // 处理前进一步的事件\n\n group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"NEXT_STEP_BTN\"], \":click\"), function () {\n _this.updateStartEnd(1);\n }); // 处理后退一步的事件\n\n group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"PRE_STEP_BTN\"], \":click\"), function () {\n _this.updateStartEnd(-1);\n });\n group.on(_constant__WEBPACK_IMPORTED_MODULE_4__[\"TIMEBAR_CONFIG_CHANGE\"], function (_a) {\n var type = _a.type,\n speed = _a.speed;\n _this.currentSpeed = speed;\n });\n };\n\n TimeBarSlice.prototype.changePlayStatus = function (isSync) {\n if (isSync === void 0) {\n isSync = true;\n }\n\n this.controllerBtnGroup.playButton.update({\n isPlay: this.isPlay\n });\n\n if (this.isPlay) {\n // 开始播放\n this.playHandler = this.startPlay();\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"TIMELINE_START\"], null);\n } else {\n // 结束播放\n if (this.playHandler) {\n if (typeof window !== 'undefined') window.cancelAnimationFrame(this.playHandler);\n\n if (isSync) {\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"TIMELINE_END\"], null);\n }\n }\n }\n };\n\n TimeBarSlice.prototype.startPlay = function () {\n var _this = this;\n\n return typeof window !== 'undefined' ? window.requestAnimationFrame(function () {\n var speed = _this.currentSpeed; // 一分钟刷新一次\n\n if (_this.frameCount % (60 / speed) === 0) {\n _this.frameCount = 0;\n\n _this.updateStartEnd(1);\n }\n\n _this.frameCount++;\n\n if (_this.isPlay) {\n _this.playHandler = _this.startPlay();\n }\n }) : undefined;\n };\n\n TimeBarSlice.prototype.updateStartEnd = function (sign) {\n var self = this;\n var tickRects = this.tickRects;\n var ticksLength = tickRects.length;\n var unselectedTickStyle = this.unselectedTickStyle;\n var selectedTickStyle = this.selectedTickStyle;\n var previousEndTickRectId = self.endTickRectId;\n\n if (sign > 0) {\n self.endTickRectId++;\n } else {\n tickRects[self.endTickRectId].rect.attr(unselectedTickStyle);\n self.endTickRectId--;\n } // 若此时 start 与 end 不同,范围前进/后退/播放\n\n\n if (previousEndTickRectId !== self.startTickRectId) {\n if (self.endTickRectId < self.startTickRectId) {\n self.startTickRectId = self.endTickRectId;\n }\n } else {\n // 否则是单帧的前进/后退/播放\n for (var i = self.startTickRectId; i <= self.endTickRectId - 1; i++) {\n tickRects[i].rect.attr(unselectedTickStyle);\n }\n\n self.startTickRectId = self.endTickRectId;\n }\n\n if (tickRects[self.endTickRectId]) {\n tickRects[self.endTickRectId].rect.attr(selectedTickStyle);\n var start = self.startTickRectId / ticksLength;\n var end = self.endTickRectId / ticksLength;\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], {\n value: [start, end]\n });\n }\n };\n\n TimeBarSlice.prototype.destory = function () {\n this.graph.off(_constant__WEBPACK_IMPORTED_MODULE_4__[\"VALUE_CHANGE\"], function () {});\n var group = this.sliceGroup;\n group.off('click');\n group.off('dragstart');\n group.off('dragover');\n group.off('drop');\n this.tickRects.forEach(function (tickRect) {\n var pickRect = tickRect.pickRect;\n pickRect.off('mouseenter');\n pickRect.off('mouseleave');\n });\n this.tickRects.length = 0;\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"PLAY_PAUSE_BTN\"], \":click\"));\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"NEXT_STEP_BTN\"], \":click\"));\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_4__[\"PRE_STEP_BTN\"], \":click\"));\n group.off(_constant__WEBPACK_IMPORTED_MODULE_4__[\"TIMEBAR_CONFIG_CHANGE\"]);\n this.sliceGroup.destroy();\n };\n\n return TimeBarSlice;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TimeBarSlice);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/timeBarSlice.js?"); +eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERLayout = exports.ForceAtlas2Layout = exports.ComboCombinedLayout = exports.ComboForceLayout = exports.GForceGPULayout = exports.FruchtermanGPULayout = exports.FruchtermanLayout = exports.MDSLayout = exports.ConcentricLayout = exports.RadialLayout = exports.DagreCompoundLayout = exports.DagreLayout = exports.CircularLayout = exports.ForceLayout = exports.Force2Layout = exports.GForceLayout = exports.RandomLayout = exports.GridLayout = exports.Layouts = exports.Layout = void 0;\nvar grid_1 = __webpack_require__(/*! ./grid */ \"./node_modules/@antv/layout/lib/layout/grid.js\");\nObject.defineProperty(exports, \"GridLayout\", { enumerable: true, get: function () { return grid_1.GridLayout; } });\nvar random_1 = __webpack_require__(/*! ./random */ \"./node_modules/@antv/layout/lib/layout/random.js\");\nObject.defineProperty(exports, \"RandomLayout\", { enumerable: true, get: function () { return random_1.RandomLayout; } });\nvar gForce_1 = __webpack_require__(/*! ./gForce */ \"./node_modules/@antv/layout/lib/layout/gForce.js\");\nObject.defineProperty(exports, \"GForceLayout\", { enumerable: true, get: function () { return gForce_1.GForceLayout; } });\nvar force2_1 = __webpack_require__(/*! ./force2 */ \"./node_modules/@antv/layout/lib/layout/force2/index.js\");\nObject.defineProperty(exports, \"Force2Layout\", { enumerable: true, get: function () { return force2_1.Force2Layout; } });\nvar force_1 = __webpack_require__(/*! ./force */ \"./node_modules/@antv/layout/lib/layout/force/index.js\");\nObject.defineProperty(exports, \"ForceLayout\", { enumerable: true, get: function () { return force_1.ForceLayout; } });\nvar circular_1 = __webpack_require__(/*! ./circular */ \"./node_modules/@antv/layout/lib/layout/circular.js\");\nObject.defineProperty(exports, \"CircularLayout\", { enumerable: true, get: function () { return circular_1.CircularLayout; } });\nvar dagre_1 = __webpack_require__(/*! ./dagre */ \"./node_modules/@antv/layout/lib/layout/dagre.js\");\nObject.defineProperty(exports, \"DagreLayout\", { enumerable: true, get: function () { return dagre_1.DagreLayout; } });\nvar dagreCompound_1 = __webpack_require__(/*! ./dagreCompound */ \"./node_modules/@antv/layout/lib/layout/dagreCompound.js\");\nObject.defineProperty(exports, \"DagreCompoundLayout\", { enumerable: true, get: function () { return dagreCompound_1.DagreCompoundLayout; } });\nvar radial_1 = __webpack_require__(/*! ./radial */ \"./node_modules/@antv/layout/lib/layout/radial/index.js\");\nObject.defineProperty(exports, \"RadialLayout\", { enumerable: true, get: function () { return radial_1.RadialLayout; } });\nvar concentric_1 = __webpack_require__(/*! ./concentric */ \"./node_modules/@antv/layout/lib/layout/concentric.js\");\nObject.defineProperty(exports, \"ConcentricLayout\", { enumerable: true, get: function () { return concentric_1.ConcentricLayout; } });\nvar mds_1 = __webpack_require__(/*! ./mds */ \"./node_modules/@antv/layout/lib/layout/mds.js\");\nObject.defineProperty(exports, \"MDSLayout\", { enumerable: true, get: function () { return mds_1.MDSLayout; } });\nvar fruchterman_1 = __webpack_require__(/*! ./fruchterman */ \"./node_modules/@antv/layout/lib/layout/fruchterman.js\");\nObject.defineProperty(exports, \"FruchtermanLayout\", { enumerable: true, get: function () { return fruchterman_1.FruchtermanLayout; } });\nvar fruchterman_2 = __webpack_require__(/*! ./gpu/fruchterman */ \"./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js\");\nObject.defineProperty(exports, \"FruchtermanGPULayout\", { enumerable: true, get: function () { return fruchterman_2.FruchtermanGPULayout; } });\nvar gForce_2 = __webpack_require__(/*! ./gpu/gForce */ \"./node_modules/@antv/layout/lib/layout/gpu/gForce.js\");\nObject.defineProperty(exports, \"GForceGPULayout\", { enumerable: true, get: function () { return gForce_2.GForceGPULayout; } });\nvar comboForce_1 = __webpack_require__(/*! ./comboForce */ \"./node_modules/@antv/layout/lib/layout/comboForce.js\");\nObject.defineProperty(exports, \"ComboForceLayout\", { enumerable: true, get: function () { return comboForce_1.ComboForceLayout; } });\nvar comboCombined_1 = __webpack_require__(/*! ./comboCombined */ \"./node_modules/@antv/layout/lib/layout/comboCombined.js\");\nObject.defineProperty(exports, \"ComboCombinedLayout\", { enumerable: true, get: function () { return comboCombined_1.ComboCombinedLayout; } });\nvar forceAtlas2_1 = __webpack_require__(/*! ./forceAtlas2 */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js\");\nObject.defineProperty(exports, \"ForceAtlas2Layout\", { enumerable: true, get: function () { return forceAtlas2_1.ForceAtlas2Layout; } });\nvar er_1 = __webpack_require__(/*! ./er */ \"./node_modules/@antv/layout/lib/layout/er/index.js\");\nObject.defineProperty(exports, \"ERLayout\", { enumerable: true, get: function () { return er_1.ERLayout; } });\nvar layout_1 = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/layout/lib/layout/layout.js\");\nObject.defineProperty(exports, \"Layout\", { enumerable: true, get: function () { return layout_1.Layout; } });\nObject.defineProperty(exports, \"Layouts\", { enumerable: true, get: function () { return layout_1.Layouts; } });\n// types file\n__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@antv/layout/lib/layout/types.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/timeBarTooltip.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/timeBarTooltip.js ***! - \*******************************************************************/ -/*! exports provided: BACKGROUND_STYLE, ARROW_STYLE, TEXT_STYLE, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/layout.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/layout.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BACKGROUND_STYLE\", function() { return BACKGROUND_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ARROW_STYLE\", function() { return ARROW_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TEXT_STYLE\", function() { return TEXT_STYLE; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n\n\nvar BACKGROUND_STYLE = {\n opacity: 0.5,\n fill: '#000'\n};\nvar ARROW_STYLE = {\n opacity: 0.5,\n fill: '#000',\n r: 5\n};\nvar TEXT_STYLE = {\n fill: '#fff',\n fontSize: 12\n};\n/**\n * 缩略趋势图\n */\n\nvar TimeBarTooltip =\n/** @class */\nfunction () {\n function TimeBarTooltip(cfg) {\n var _a = cfg.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfg.y,\n y = _b === void 0 ? 0 : _b,\n container = cfg.container,\n text = cfg.text,\n _c = cfg.padding,\n padding = _c === void 0 ? [4, 4, 4, 4] : _c,\n _d = cfg.className,\n className = _d === void 0 ? 'g6-component-timebar-tooltip' : _d,\n _e = cfg.backgroundColor,\n backgroundColor = _e === void 0 ? '#000' : _e,\n _f = cfg.textColor,\n textColor = _f === void 0 ? '#fff' : _f,\n _g = cfg.opacity,\n opacity = _g === void 0 ? 0.8 : _g,\n _h = cfg.fontSize,\n fontSize = _h === void 0 ? 12 : _h;\n this.container = container;\n this.className = className;\n this.backgroundColor = backgroundColor;\n this.textColor = textColor;\n this.x = x;\n this.y = y;\n this.text = text;\n this.padding = padding;\n this.opacity = opacity;\n this.fontSize = fontSize;\n this.render();\n }\n /**\n * 首次渲染\n * @private\n */\n\n\n TimeBarTooltip.prototype.render = function () {\n var self = this;\n var className = self.className,\n x = self.x,\n y = self.y,\n backgroundColor = self.backgroundColor,\n textColor = self.textColor,\n text = self.text,\n padding = self.padding,\n opacity = self.opacity,\n fontSize = self.fontSize;\n var parentNode = self.container;\n var container = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"createDom\"])(\"
\"));\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(parentNode)) {\n parentNode = document.getElementById(parentNode);\n }\n\n parentNode.appendChild(container);\n self.parentHeight = parentNode.offsetHeight;\n self.parentWidth = parentNode.offsetWidth;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(container, {\n visibility: 'hidden',\n top: 0,\n left: 0\n });\n var background = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"createDom\"])(\"\\n
\"));\n background.innerHTML = text;\n container.appendChild(background);\n self.backgroundDOM = background;\n var arrow = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"createDom\"])(\"
\"));\n container.appendChild(arrow);\n self.arrowDOM = arrow;\n self.container = container;\n };\n\n TimeBarTooltip.prototype.show = function (cfg) {\n var self = this;\n var text = cfg.text,\n x = cfg.x,\n y = cfg.y,\n clientX = cfg.clientX,\n clientY = cfg.clientY;\n self.backgroundDOM.innerHTML = text;\n var backgroundWidth = self.backgroundDOM.offsetWidth;\n var backgroundHeight = self.backgroundDOM.offsetHeight;\n var arrowWidth = self.arrowDOM.offsetWidth;\n var arrowHeight = self.arrowDOM.offsetHeight;\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.container, {\n top: \"\".concat(-backgroundHeight - arrowHeight, \"px\"),\n left: \"\".concat(x, \"px\"),\n visibility: 'visible'\n });\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.backgroundDOM, {\n marginLeft: \"\".concat(-backgroundWidth / 2, \"px\")\n });\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.arrowDOM, {\n marginLeft: \"\".concat(-arrowWidth / 2, \"px\"),\n top: \"\".concat(backgroundHeight, \"px\")\n });\n var left = x - backgroundWidth / 2;\n var right = x + backgroundWidth / 2;\n\n if (left < 0) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.backgroundDOM, {\n marginLeft: \"\".concat(-backgroundWidth / 2 - left, \"px\")\n });\n } else if (right > self.parentWidth) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(self.backgroundDOM, {\n marginLeft: \"\".concat(-backgroundWidth / 2 - right + self.parentWidth + 12, \"px\")\n });\n }\n };\n\n TimeBarTooltip.prototype.hide = function () {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"])(this.container, {\n top: 0,\n left: 0,\n visibility: 'hidden'\n });\n };\n\n return TimeBarTooltip;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TimeBarTooltip);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/timeBarTooltip.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Layouts = exports.Layout = void 0;\nvar registy_1 = __webpack_require__(/*! ../registy */ \"./node_modules/@antv/layout/lib/registy/index.js\");\nvar grid_1 = __webpack_require__(/*! ./grid */ \"./node_modules/@antv/layout/lib/layout/grid.js\");\nvar random_1 = __webpack_require__(/*! ./random */ \"./node_modules/@antv/layout/lib/layout/random.js\");\nvar force2_1 = __webpack_require__(/*! ./force2 */ \"./node_modules/@antv/layout/lib/layout/force2/index.js\");\nvar gForce_1 = __webpack_require__(/*! ./gForce */ \"./node_modules/@antv/layout/lib/layout/gForce.js\");\nvar force_1 = __webpack_require__(/*! ./force */ \"./node_modules/@antv/layout/lib/layout/force/index.js\");\nvar circular_1 = __webpack_require__(/*! ./circular */ \"./node_modules/@antv/layout/lib/layout/circular.js\");\nvar dagre_1 = __webpack_require__(/*! ./dagre */ \"./node_modules/@antv/layout/lib/layout/dagre.js\");\nvar radial_1 = __webpack_require__(/*! ./radial */ \"./node_modules/@antv/layout/lib/layout/radial/index.js\");\nvar concentric_1 = __webpack_require__(/*! ./concentric */ \"./node_modules/@antv/layout/lib/layout/concentric.js\");\nvar mds_1 = __webpack_require__(/*! ./mds */ \"./node_modules/@antv/layout/lib/layout/mds.js\");\nvar fruchterman_1 = __webpack_require__(/*! ./fruchterman */ \"./node_modules/@antv/layout/lib/layout/fruchterman.js\");\nvar fruchterman_2 = __webpack_require__(/*! ./gpu/fruchterman */ \"./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js\");\nvar gForce_2 = __webpack_require__(/*! ./gpu/gForce */ \"./node_modules/@antv/layout/lib/layout/gpu/gForce.js\");\nvar comboForce_1 = __webpack_require__(/*! ./comboForce */ \"./node_modules/@antv/layout/lib/layout/comboForce.js\");\nvar comboCombined_1 = __webpack_require__(/*! ./comboCombined */ \"./node_modules/@antv/layout/lib/layout/comboCombined.js\");\nvar forceAtlas2_1 = __webpack_require__(/*! ./forceAtlas2 */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js\");\nvar er_1 = __webpack_require__(/*! ./er */ \"./node_modules/@antv/layout/lib/layout/er/index.js\");\nvar dagreCompound_1 = __webpack_require__(/*! ./dagreCompound */ \"./node_modules/@antv/layout/lib/layout/dagreCompound.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar Layout = /** @class */ (function () {\n function Layout(options) {\n var layoutClass = (0, registy_1.getLayoutByName)(options.type);\n this.layoutInstance = new layoutClass(options);\n }\n Layout.prototype.layout = function (data) {\n return this.layoutInstance.layout(data);\n };\n Layout.prototype.updateCfg = function (cfg) {\n this.layoutInstance.updateCfg(cfg);\n };\n Layout.prototype.init = function (data) {\n this.correctLayers(data.nodes);\n this.layoutInstance.init(data);\n };\n /**\n * correcting the layers on the node data\n * if min(layer) <= 0, layers should begin from abs(min(layer)) + 1\n * @param nodes\n * @returns\n */\n Layout.prototype.correctLayers = function (nodes) {\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return;\n var minLayer = Infinity;\n var hasLayerNodes = [];\n nodes.forEach(function (node) {\n if ((0, util_1.isString)(node.layer)) {\n node.layer = parseInt(node.layer, 10);\n }\n // keep node.layer === undefined for TS problem\n if (node.layer === undefined || isNaN(node.layer))\n return;\n hasLayerNodes.push(node);\n if (node.layer < minLayer)\n minLayer = node.layer;\n });\n if (minLayer <= 0) {\n var layerOffset_1 = Math.abs(minLayer) + 1;\n // @ts-ignore\n hasLayerNodes.forEach(function (node) { return node.layer += layerOffset_1; });\n }\n };\n Layout.prototype.execute = function () {\n this.layoutInstance.execute();\n };\n Layout.prototype.getDefaultCfg = function () {\n return this.layoutInstance.getDefaultCfg();\n };\n Layout.prototype.destroy = function () {\n return this.layoutInstance.destroy();\n };\n return Layout;\n}());\nexports.Layout = Layout;\n// FIXME\n// FOR G6\n// tslint:disable-next-line\nexports.Layouts = {\n force: force_1.ForceLayout,\n fruchterman: fruchterman_1.FruchtermanLayout,\n forceAtlas2: forceAtlas2_1.ForceAtlas2Layout,\n gForce: gForce_1.GForceLayout,\n force2: force2_1.Force2Layout,\n dagre: dagre_1.DagreLayout,\n dagreCompound: dagreCompound_1.DagreCompoundLayout,\n circular: circular_1.CircularLayout,\n radial: radial_1.RadialLayout,\n concentric: concentric_1.ConcentricLayout,\n grid: grid_1.GridLayout,\n mds: mds_1.MDSLayout,\n comboForce: comboForce_1.ComboForceLayout,\n comboCombined: comboCombined_1.ComboCombinedLayout,\n random: random_1.RandomLayout,\n 'gForce-gpu': gForce_2.GForceGPULayout,\n 'fruchterman-gpu': fruchterman_2.FruchtermanGPULayout,\n er: er_1.ERLayout,\n};\n//# sourceMappingURL=layout.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/layout.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/timeButton.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/timeButton.js ***! - \***************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/mds.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/mds.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\n/**\n * 基于 G 的按钮组件\n */\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\n\n\nvar Button =\n/** @class */\nfunction () {\n function Button(cfg) {\n this.config = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"deepMix\"])({}, cfg);\n this.init();\n }\n\n Button.prototype.update = function (cfg) {\n this.config = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"deepMix\"])({}, this.config, cfg);\n this.updateElement();\n this.renderMarker();\n };\n\n Button.prototype.init = function () {\n this.initElement();\n this.renderMarker();\n };\n\n Button.prototype.initElement = function () {\n var _a = this.config,\n group = _a.group,\n style = _a.style;\n var _b = style.scale,\n scale = _b === void 0 ? 1 : _b,\n _c = style.offsetX,\n offsetX = _c === void 0 ? 0 : _c,\n _d = style.offsetY,\n offsetY = _d === void 0 ? 0 : _d;\n var x = this.config.x + offsetX;\n var y = this.config.y + offsetY;\n var buttonGroup = group.addGroup({\n name: _constant__WEBPACK_IMPORTED_MODULE_1__[\"PLAY_PAUSE_BTN\"]\n });\n this.startMarkerGroup = buttonGroup.addGroup({\n name: _constant__WEBPACK_IMPORTED_MODULE_1__[\"PLAY_PAUSE_BTN\"]\n });\n this.circle = group.addShape('circle', {\n attrs: __assign({\n x: x,\n y: y,\n r: this.config.r * scale\n }, style),\n name: _constant__WEBPACK_IMPORTED_MODULE_1__[\"PLAY_PAUSE_BTN\"]\n });\n this.startMarker = this.startMarkerGroup.addShape('path', {\n attrs: {\n path: this.getStartMarkerPath(x, y, scale),\n fill: style.stroke || '#aaa'\n },\n name: 'start-marker'\n });\n this.pauseMarkerGroup = buttonGroup.addGroup({\n name: _constant__WEBPACK_IMPORTED_MODULE_1__[\"PLAY_PAUSE_BTN\"]\n });\n var width = 0.25 * this.config.r * scale;\n var height = 0.5 * this.config.r * Math.sqrt(3) * scale;\n this.pauseLeftMarker = this.pauseMarkerGroup.addShape('rect', {\n attrs: {\n x: x - 0.375 * this.config.r * scale,\n y: y - height / 2,\n width: width,\n height: height,\n fill: style.stroke || '#aaa',\n lineWidth: 0\n }\n });\n this.pauseRightMarker = this.pauseMarkerGroup.addShape('rect', {\n attrs: {\n x: x + 1 / 8 * this.config.r * scale,\n y: y - height / 2,\n width: width,\n height: height,\n fill: style.stroke || '#aaa',\n lineWidth: 0\n }\n });\n };\n\n Button.prototype.updateElement = function () {\n var _a = this.config.style,\n _b = _a.scale,\n scale = _b === void 0 ? 1 : _b,\n _c = _a.offsetX,\n offsetX = _c === void 0 ? 0 : _c,\n _d = _a.offsetY,\n offsetY = _d === void 0 ? 0 : _d;\n var x = this.config.x + offsetX;\n var y = this.config.y + offsetY;\n this.circle.attr('x', x);\n this.circle.attr('y', y);\n this.circle.attr('r', this.config.r * scale);\n this.startMarker.attr('path', this.getStartMarkerPath(x, y, scale));\n var width = 0.25 * this.config.r * scale;\n var height = 0.5 * this.config.r * Math.sqrt(3) * scale;\n this.pauseLeftMarker.attr('x', x - (1 / 4 + 1 / 8) * this.config.r * scale);\n this.pauseLeftMarker.attr('y', y - height / 2);\n this.pauseLeftMarker.attr('width', width);\n this.pauseLeftMarker.attr('height', height);\n this.pauseRightMarker.attr('x', x + 1 / 8 * this.config.r * scale);\n this.pauseRightMarker.attr('y', y - height / 2);\n this.pauseRightMarker.attr('width', width);\n this.pauseRightMarker.attr('height', height);\n };\n\n Button.prototype.renderMarker = function () {\n if (this.config.isPlay) {\n this.startMarkerGroup.hide();\n this.pauseMarkerGroup.show();\n } else {\n this.startMarkerGroup.show();\n this.pauseMarkerGroup.hide();\n }\n };\n /** 获取播放键 marker path */\n\n\n Button.prototype.getStartMarkerPath = function (x, y, scale) {\n var sideLength = 0.5 * this.config.r * Math.sqrt(3) * scale;\n return [['M', x - sideLength / Math.sqrt(3) / 2, y - sideLength / 2], ['L', x + sideLength / Math.sqrt(3), y], ['L', x - sideLength / Math.sqrt(3) / 2, y + sideLength / 2]];\n };\n\n return Button;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Button);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/timeButton.js?"); +eval("\n/**\n * @fileOverview MDS layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MDSLayout = void 0;\nvar ml_matrix_1 = __webpack_require__(/*! ml-matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/index.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\n/**\n * mds 布局\n */\nvar MDSLayout = /** @class */ (function (_super) {\n __extends(MDSLayout, _super);\n function MDSLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 边长度 */\n _this.linkDistance = 50;\n _this.nodes = [];\n _this.edges = [];\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n MDSLayout.prototype.getDefaultCfg = function () {\n return {\n center: [0, 0],\n linkDistance: 50\n };\n };\n /**\n * 执行布局\n */\n MDSLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes, _a = self.edges, edges = _a === void 0 ? [] : _a;\n var center = self.center;\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n var linkDistance = self.linkDistance;\n // the graph-theoretic distance (shortest path distance) matrix\n var adjMatrix = (0, util_1.getAdjMatrix)({ nodes: nodes, edges: edges }, false);\n var distances = (0, util_1.floydWarshall)(adjMatrix);\n self.handleInfinity(distances);\n // scale the ideal edge length acoording to linkDistance\n var scaledD = (0, util_1.scaleMatrix)(distances, linkDistance);\n self.scaledDistances = scaledD;\n // get positions by MDS\n var positions = self.runMDS();\n self.positions = positions;\n positions.forEach(function (p, i) {\n nodes[i].x = p[0] + center[0];\n nodes[i].y = p[1] + center[1];\n });\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n };\n /**\n * mds 算法\n * @return {array} positions 计算后的节点位置数组\n */\n MDSLayout.prototype.runMDS = function () {\n var self = this;\n var dimension = 2;\n var distances = self.scaledDistances;\n // square distances\n var M = ml_matrix_1.Matrix.mul(ml_matrix_1.Matrix.pow(distances, 2), -0.5);\n // double centre the rows/columns\n var rowMeans = M.mean(\"row\");\n var colMeans = M.mean(\"column\");\n var totalMean = M.mean();\n M.add(totalMean)\n .subRowVector(rowMeans)\n .subColumnVector(colMeans);\n // take the SVD of the double centred matrix, and return the\n // points from it\n var ret = new ml_matrix_1.SingularValueDecomposition(M);\n var eigenValues = ml_matrix_1.Matrix.sqrt(ret.diagonalMatrix).diagonal();\n return ret.leftSingularVectors.toJSON().map(function (row) {\n return ml_matrix_1.Matrix.mul([row], [eigenValues])\n .toJSON()[0]\n .splice(0, dimension);\n });\n };\n MDSLayout.prototype.handleInfinity = function (distances) {\n var maxDistance = -999999;\n distances.forEach(function (row) {\n row.forEach(function (value) {\n if (value === Infinity) {\n return;\n }\n if (maxDistance < value) {\n maxDistance = value;\n }\n });\n });\n distances.forEach(function (row, i) {\n row.forEach(function (value, j) {\n if (value === Infinity) {\n distances[i][j] = maxDistance;\n }\n });\n });\n };\n MDSLayout.prototype.getType = function () {\n return \"mds\";\n };\n return MDSLayout;\n}(base_1.Base));\nexports.MDSLayout = MDSLayout;\n//# sourceMappingURL=mds.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/mds.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/trend.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/trend.js ***! - \**********************************************************/ -/*! exports provided: LINE_STYLE, AREA_STYLE, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/radial/index.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/radial/index.js ***! + \**************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LINE_STYLE\", function() { return LINE_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AREA_STYLE\", function() { return AREA_STYLE; });\n/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path */ \"./node_modules/@antv/g6-plugin/es/timeBar/path.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\nvar LINE_STYLE = {\n stroke: '#C5C5C5',\n strokeOpacity: 0.85\n};\nvar AREA_STYLE = {\n fill: '#CACED4',\n opacity: 0.85\n};\n/**\n * 缩略趋势图\n */\n\nvar Trend =\n/** @class */\nfunction () {\n function Trend(cfg) {\n var _a = cfg.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfg.y,\n y = _b === void 0 ? 0 : _b,\n _c = cfg.width,\n width = _c === void 0 ? 200 : _c,\n _d = cfg.height,\n height = _d === void 0 ? 26 : _d,\n _e = cfg.smooth,\n smooth = _e === void 0 ? true : _e,\n _f = cfg.isArea,\n isArea = _f === void 0 ? false : _f,\n _g = cfg.data,\n data = _g === void 0 ? [] : _g,\n lineStyle = cfg.lineStyle,\n areaStyle = cfg.areaStyle,\n group = cfg.group,\n _h = cfg.interval,\n interval = _h === void 0 ? null : _h;\n this.group = group;\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.data = data;\n this.smooth = smooth;\n this.isArea = isArea;\n this.lineStyle = Object.assign({}, LINE_STYLE, lineStyle);\n this.areaStyle = Object.assign({}, AREA_STYLE, areaStyle);\n this.intervalConfig = interval;\n this.renderLine();\n }\n /**\n * 构造\n * @private\n */\n\n\n Trend.prototype.renderLine = function () {\n var _a = this,\n x = _a.x,\n y = _a.y,\n width = _a.width,\n height = _a.height,\n barWidth = _a.barWidth,\n data = _a.data,\n smooth = _a.smooth,\n isArea = _a.isArea,\n lineStyle = _a.lineStyle,\n areaStyle = _a.areaStyle;\n\n var trendGroup = this.group.addGroup({\n name: 'trend-group'\n });\n\n if (data) {\n var path = Object(_path__WEBPACK_IMPORTED_MODULE_0__[\"dataToPath\"])(data, width, height, smooth); // 线\n\n trendGroup.addShape('path', {\n attrs: __assign({\n path: path\n }, lineStyle),\n name: 'trend-line'\n }); // 在 line 的基础上,绘制面积图\n\n if (isArea) {\n var areaPath = Object(_path__WEBPACK_IMPORTED_MODULE_0__[\"linePathToAreaPath\"])(path, width, height, data);\n trendGroup.addShape('path', {\n attrs: __assign({\n path: areaPath\n }, areaStyle),\n name: 'trend-area'\n });\n }\n } // 绘制柱状图📊\n\n\n if (this.intervalConfig) {\n trendGroup.addShape('path', {\n attrs: __assign({\n path: Object(_path__WEBPACK_IMPORTED_MODULE_0__[\"dataToRectPath\"])(this.intervalConfig.data, width, height, this.intervalConfig.style.barWidth)\n }, this.intervalConfig.style),\n name: 'trend-interval'\n });\n } // 统一移动到对应的位置\n\n\n trendGroup.move(x, y);\n };\n\n Trend.prototype.destory = function () {\n this.group.destroy();\n };\n\n return Trend;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Trend);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/trend.js?"); +eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(__webpack_require__(/*! ./radial */ \"./node_modules/@antv/layout/lib/layout/radial/radial.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/radial/index.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/timeBar/trendTimeBar.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/timeBar/trendTimeBar.js ***! - \*****************************************************************/ -/*! exports provided: BACKGROUND_STYLE, FOREGROUND_STYLE, DEFAULT_HANDLER_WIDTH, HANDLER_STYLE, TEXT_STYLE, TICK_LABEL_STYLE, TICK_LINE_STYLE, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/radial/mds.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/radial/mds.js ***! + \************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BACKGROUND_STYLE\", function() { return BACKGROUND_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"FOREGROUND_STYLE\", function() { return FOREGROUND_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_HANDLER_WIDTH\", function() { return DEFAULT_HANDLER_WIDTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HANDLER_STYLE\", function() { return HANDLER_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TEXT_STYLE\", function() { return TEXT_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TICK_LABEL_STYLE\", function() { return TICK_LABEL_STYLE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"TICK_LINE_STYLE\", function() { return TICK_LINE_STYLE; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/matrix-util/esm/index.js\");\n/* harmony import */ var _trend__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./trend */ \"./node_modules/@antv/g6-plugin/es/timeBar/trend.js\");\n/* harmony import */ var _handler__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./handler */ \"./node_modules/@antv/g6-plugin/es/timeBar/handler.js\");\n/* harmony import */ var _controllerBtn__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./controllerBtn */ \"./node_modules/@antv/g6-plugin/es/timeBar/controllerBtn.js\");\n/* harmony import */ var _constant__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./constant */ \"./node_modules/@antv/g6-plugin/es/timeBar/constant.js\");\nvar __assign = undefined && undefined.__assign || function () {\n __assign = Object.assign || function (t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n\n for (var p in s) {\n if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\n }\n }\n\n return t;\n };\n\n return __assign.apply(this, arguments);\n};\n\n\n\n\n\n\n\n\nvar transform = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_1__[\"ext\"].transform;\n/**\n * 一些默认的样式配置\n */\n\nvar BACKGROUND_STYLE = {\n fill: '#416180',\n opacity: 0.05\n};\nvar SIMPLE_BACKGROUND_STYLE = {\n fill: '#416180',\n opacity: 0.15,\n radius: 5\n};\nvar FOREGROUND_STYLE = {\n fill: '#5B8FF9',\n opacity: 0.3,\n cursor: 'grab'\n};\nvar DEFAULT_HANDLER_WIDTH = 2;\nvar HANDLER_STYLE = {\n width: DEFAULT_HANDLER_WIDTH,\n height: 24\n};\nvar TEXT_STYLE = {\n textBaseline: 'middle',\n fill: '#000',\n opacity: 0.45\n};\nvar TICK_LABEL_STYLE = {\n textAlign: 'center',\n textBaseline: 'top',\n fill: '#607889',\n opacity: 0.35\n};\nvar TICK_LINE_STYLE = {\n lineWidth: 1,\n stroke: '#ccc'\n};\n\nvar TrendTimeBar =\n/** @class */\nfunction () {\n function TrendTimeBar(cfg) {\n var _this = this;\n\n this.prevX = 0;\n\n this.onMouseDown = function (handler) {\n return function (e) {\n // 1. 记录点击的滑块\n _this.currentHandler = handler;\n var event = e.originalEvent; // 2. 存储当前点击位置\n\n event.stopPropagation();\n event.preventDefault(); // 兼容移动端获取数据\n\n _this.prevX = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(event, 'touches.0.pageX', event.pageX); // 3. 开始滑动的时候,绑定 move 和 up 事件\n\n var containerDOM = _this.canvas.get('container');\n\n containerDOM.addEventListener('mousemove', _this.onMouseMove);\n containerDOM.addEventListener('mouseup', _this.onMouseUp);\n containerDOM.addEventListener('mouseleave', _this.onMouseUp); // 移动端事件\n\n containerDOM.addEventListener('touchmove', _this.onMouseMove);\n containerDOM.addEventListener('touchend', _this.onMouseUp);\n containerDOM.addEventListener('touchcancel', _this.onMouseUp);\n };\n };\n\n this.onMouseMove = function (e) {\n // 滑动过程中,计算偏移,更新滑块,然后 emit 数据出去\n e.stopPropagation();\n e.preventDefault();\n var x = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(e, 'touches.0.pageX', e.pageX); // 横向的 slider 只处理 x\n\n var offsetX = x - _this.prevX;\n\n var offsetXRange = _this.adjustOffsetRange(offsetX / _this.width); // 更新 start end range 范围\n\n\n _this.updateStartEnd(offsetXRange); // 更新 ui\n\n\n _this.updateUI();\n\n _this.prevX = x;\n };\n\n this.onMouseUp = function () {\n // 结束之后,取消绑定的事件\n if (_this.currentHandler) {\n _this.currentHandler = undefined;\n }\n\n var containerDOM = _this.canvas.get('container');\n\n if (containerDOM) {\n containerDOM.removeEventListener('mousemove', _this.onMouseMove);\n containerDOM.removeEventListener('mouseup', _this.onMouseUp); // 防止滑动到 canvas 外部之后,状态丢失\n\n containerDOM.removeEventListener('mouseleave', _this.onMouseUp); // 移动端事件\n\n containerDOM.removeEventListener('touchmove', _this.onMouseMove);\n containerDOM.removeEventListener('touchend', _this.onMouseUp);\n containerDOM.removeEventListener('touchcancel', _this.onMouseUp);\n }\n };\n\n var _a = cfg.x,\n x = _a === void 0 ? 0 : _a,\n _b = cfg.y,\n y = _b === void 0 ? 0 : _b,\n _c = cfg.width,\n width = _c === void 0 ? 100 : _c,\n height = cfg.height,\n _d = cfg.padding,\n padding = _d === void 0 ? 10 : _d,\n trendCfg = cfg.trendCfg,\n _e = cfg.controllerCfg,\n controllerCfg = _e === void 0 ? {\n speed: 1\n } : _e,\n _f = cfg.backgroundStyle,\n backgroundStyle = _f === void 0 ? {} : _f,\n _g = cfg.foregroundStyle,\n foregroundStyle = _g === void 0 ? {} : _g,\n _h = cfg.handlerStyle,\n handlerStyle = _h === void 0 ? {} : _h,\n _j = cfg.textStyle,\n textStyle = _j === void 0 ? {} : _j,\n // 缩略轴的初始位置\n _k = cfg.start,\n // 缩略轴的初始位置\n start = _k === void 0 ? 0 : _k,\n _l = cfg.end,\n end = _l === void 0 ? 1 : _l,\n _m = cfg.minText,\n minText = _m === void 0 ? '' : _m,\n _o = cfg.maxText,\n maxText = _o === void 0 ? '' : _o,\n group = cfg.group,\n graph = cfg.graph,\n canvas = cfg.canvas,\n _p = cfg.tick,\n tick = _p === void 0 ? {\n tickLabelStyle: {},\n tickLineStyle: {},\n tickLabelFormatter: function tickLabelFormatter(d) {\n return d;\n },\n ticks: []\n } : _p,\n type = cfg.type;\n this.graph = graph;\n this.canvas = canvas;\n this.group = group;\n this.timeBarType = type; // position size\n\n this.x = x;\n this.y = y;\n this.width = width;\n this.height = height;\n this.padding = padding;\n this.ticks = tick.ticks;\n this.trendCfg = trendCfg;\n this.controllerCfg = controllerCfg;\n this.currentSpeed = controllerCfg.speed || 1;\n this.tickLabelFormatter = tick.tickLabelFormatter; // style\n\n if (type === 'trend') {\n this.backgroundStyle = __assign(__assign({}, BACKGROUND_STYLE), backgroundStyle);\n } else if (type === 'simple') {\n this.backgroundStyle = __assign(__assign({}, SIMPLE_BACKGROUND_STYLE), backgroundStyle);\n }\n\n this.foregroundStyle = __assign(__assign({}, FOREGROUND_STYLE), foregroundStyle);\n this.handlerStyle = __assign(__assign({}, HANDLER_STYLE), handlerStyle);\n this.textStyle = __assign(__assign({}, TEXT_STYLE), textStyle);\n this.tickLabelStyle = __assign(__assign({}, TICK_LABEL_STYLE), tick.tickLabelStyle);\n this.tickLineStyle = __assign(__assign({}, TICK_LINE_STYLE), tick.tickLineStyle);\n this.currentMode = 'range'; // 初始信息\n\n this.start = start;\n this.end = end;\n this.minText = minText;\n this.maxText = maxText; // 初始化 fontFamily,如果有浏览器,取 body 上的字体,防止文字更新时局部渲染造成的重影\n\n this.fontFamily = typeof window !== 'undefined' ? window.getComputedStyle(document.body, null).getPropertyValue('font-family') || 'Arial, sans-serif' : 'Arial, sans-serif';\n this.renderSlider();\n }\n /**\n * 更新配置\n * @param cfg\n */\n\n\n TrendTimeBar.prototype.update = function (cfg) {\n var x = cfg.x,\n y = cfg.y,\n width = cfg.width,\n height = cfg.height,\n minText = cfg.minText,\n maxText = cfg.maxText,\n start = cfg.start,\n end = cfg.end; // start、end 只能是 0~1 范围\n\n this.start = Math.min(1, Math.max(start, 0));\n this.end = Math.min(1, Math.max(end, 0)); // 如果传了则更新,没有传则不更新\n // @ts-ignore\n\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"assign\"])(this, {\n x: x,\n y: y,\n width: width,\n height: height,\n minText: minText,\n maxText: maxText\n }); // 更新 ui,不自动绘制\n\n this.updateUI();\n };\n\n TrendTimeBar.prototype.setText = function (minText, maxText) {\n this.minTextShape.attr('text', minText);\n this.maxTextShape.attr('text', maxText);\n };\n /**\n * 初始化组件结构\n * @private\n */\n\n\n TrendTimeBar.prototype.renderSlider = function () {\n var _this = this;\n\n var _a = this,\n width = _a.width,\n height = _a.height,\n timeBarType = _a.timeBarType; // 趋势图数据\n\n\n if (timeBarType === 'trend' && Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"size\"])(Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.trendCfg, 'data'))) {\n var trendComponent = new _trend__WEBPACK_IMPORTED_MODULE_2__[\"default\"](__assign(__assign({\n x: this.x,\n y: this.y,\n width: width,\n height: height\n }, this.trendCfg), {\n group: this.group\n }));\n this.trendComponent = trendComponent;\n }\n\n var sliderGroup = this.group.addGroup({\n name: 'slider-group'\n }); // 1. 背景\n\n sliderGroup.addShape('rect', {\n attrs: __assign({\n x: 0,\n y: 0,\n width: width,\n height: height\n }, this.backgroundStyle),\n name: 'background'\n });\n var textGroup = this.group.addGroup(); // 2. 左右文字\n\n if (timeBarType === 'trend') {\n this.minTextShape = textGroup.addShape('text', {\n attrs: __assign({\n x: 0,\n y: height / 2 + this.y,\n textAlign: 'right',\n text: this.minText,\n silent: false,\n fontFamily: this.fontFamily || 'Arial, sans-serif',\n stroke: '#fff',\n lineWidth: 5\n }, this.textStyle),\n capture: false,\n name: 'min-text-shape'\n });\n this.maxTextShape = textGroup.addShape('text', {\n attrs: __assign({\n y: height / 2 + this.y,\n textAlign: 'left',\n text: this.maxText,\n silent: false,\n fontFamily: this.fontFamily || 'Arial, sans-serif',\n stroke: '#fff',\n lineWidth: 5\n }, this.textStyle),\n capture: false,\n name: 'max-text-shape'\n });\n } else {\n this.minTextShape = textGroup.addShape('text', {\n attrs: __assign({\n x: 0,\n y: this.y - 10,\n textAlign: 'center',\n text: this.minText,\n silent: false,\n fontFamily: this.fontFamily || 'Arial, sans-serif',\n stroke: '#fff',\n lineWidth: 5\n }, this.textStyle),\n capture: false,\n name: 'min-text-shape'\n });\n this.maxTextShape = textGroup.addShape('text', {\n attrs: __assign({\n y: this.y - 10,\n textAlign: 'center',\n text: this.maxText,\n silent: false,\n fontFamily: this.fontFamily || 'Arial, sans-serif',\n stroke: '#fff',\n lineWidth: 5\n }, this.textStyle),\n capture: false,\n name: 'max-text-shape'\n });\n } // 3. 前景 选中背景框\n\n\n this.foregroundShape = this.group.addGroup().addShape('rect', {\n attrs: __assign({\n x: 0,\n y: this.y,\n height: height\n }, this.foregroundStyle),\n name: 'foreground-shape'\n });\n this.foregroundShape.on('mousedown', function (e) {\n e.target.attr('cursor', 'grabbing');\n });\n this.foregroundShape.on('mouseup', function (e) {\n e.target.attr('cursor', _this.foregroundStyle.cursor || 'grab');\n }); // 滑块相关的大小信息\n\n var handlerWidth = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.handlerStyle, 'width', 2);\n var handlerHeight = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.handlerStyle, 'height', 24);\n var minHandleGroup = this.group.addGroup({\n name: 'minHandlerShape'\n }); // 4. 左右滑块\n\n this.minHandlerShape = new _handler__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n name: 'minHandlerShape',\n group: minHandleGroup,\n type: timeBarType,\n x: this.x,\n y: this.y,\n width: handlerWidth,\n height: handlerHeight,\n style: this.handlerStyle\n });\n var maxHandleGroup = this.group.addGroup({\n name: 'maxHandlerShape'\n });\n this.maxHandlerShape = new _handler__WEBPACK_IMPORTED_MODULE_3__[\"default\"]({\n name: 'maxHandlerShape',\n group: maxHandleGroup,\n type: timeBarType,\n x: this.x,\n y: this.y,\n width: handlerWidth,\n height: handlerHeight,\n style: this.handlerStyle\n }); // 缩略图下面的时间刻度\n\n var tickData = this.ticks;\n var interval = width / (tickData.length - 1);\n this.tickPosList = [];\n\n if (this.textList && this.textList.length) {\n this.textList.forEach(function (text) {\n text.destroy();\n });\n }\n\n var lastX = -Infinity;\n var rotate = this.tickLabelStyle.rotate;\n delete this.tickLabelStyle.rotate;\n this.textList = tickData.map(function (data, index) {\n _this.tickPosList.push(_this.x + index * interval);\n\n var label;\n\n if (_this.tickLabelFormatter) {\n label = _this.tickLabelFormatter(data);\n\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(label) && label) {\n // return true\n label = data.date;\n }\n } else {\n label = data.date;\n } // 文本刻度\n\n\n var textX = _this.x + index * interval,\n textY = _this.y + height + 5;\n\n var text = _this.group.addShape('text', {\n attrs: __assign({\n x: textX,\n y: textY,\n text: label,\n fontFamily: _this.fontFamily || 'Arial, sans-serif'\n }, _this.tickLabelStyle),\n name: 'tick-label'\n });\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(rotate) && index !== tickData.length - 1) {\n var matrix = transform([1, 0, 0, 0, 1, 0, 0, 0, 1], [['t', -textX, -textY], ['r', rotate], ['t', textX - 5, textY + 2]]);\n text.attr({\n textAlign: 'left',\n matrix: matrix\n });\n }\n\n if (index === 0) {\n text.attr({\n textAlign: 'left'\n });\n } else if (index !== tickData.length - 1) {\n text.attr({\n textAlign: 'right'\n });\n } // 文本刻度上面的竖线\n\n\n var line = _this.group.addShape('line', {\n attrs: __assign({\n x1: _this.x + index * interval,\n y1: _this.y + height + 2,\n x2: _this.x + index * interval,\n y2: _this.y + height + 6\n }, _this.tickLineStyle),\n name: 'tick-line'\n });\n\n line.toBack();\n var bbox = text.getBBox(); // 抽样,标签与标签间距不小于 10\n\n if (bbox.minX > lastX) {\n text.show();\n line.show();\n lastX = bbox.minX + bbox.width + 10;\n } else {\n text.hide();\n line.hide();\n }\n\n return text;\n }); // 渲染播放、快进和后退的控制按钮\n\n this.controllerBtnGroup = new _controllerBtn__WEBPACK_IMPORTED_MODULE_4__[\"default\"](__assign({\n group: this.group,\n x: this.x,\n y: this.y + height + 25,\n width: width,\n height: 35\n }, this.controllerCfg)); // 初始化 minText 和 maxText,方便计算它们的 bbox\n\n this.updateStartEnd(0); // 根据 start end 更新 ui 的位置信息\n\n this.updateUI(); // 移动到对应的位置\n\n sliderGroup.move(this.x, this.y); // 绑定事件鼠标事件\n\n this.bindEvents();\n };\n /**\n * 绑定事件:\n * - 点击\n * - 滑动\n * - 拖拽\n * - 滚动\n * @private\n */\n\n\n TrendTimeBar.prototype.bindEvents = function () {\n var _this = this; // 1. 左滑块的滑动\n\n\n var minHandleShapeGroup = this.group.find(function (group) {\n return group.get('name') === 'minHandlerShape';\n });\n\n if (minHandleShapeGroup) {\n minHandleShapeGroup.on('minHandlerShape-handler:mousedown', this.onMouseDown(this.minHandlerShape));\n minHandleShapeGroup.on('minHandlerShape-handler:touchstart', this.onMouseDown(this.minHandlerShape));\n }\n\n var maxHandleShapeGroup = this.group.find(function (group) {\n return group.get('name') === 'maxHandlerShape';\n }); // 2. 右滑块的滑动\n\n if (maxHandleShapeGroup) {\n maxHandleShapeGroup.on('maxHandlerShape-handler:mousedown', this.onMouseDown(this.maxHandlerShape));\n maxHandleShapeGroup.on('maxHandlerShape-handler:touchstart', this.onMouseDown(this.maxHandlerShape));\n } // 3. 前景选中区域\n\n\n this.foregroundShape.on('mousedown', this.onMouseDown(this.foregroundShape));\n this.foregroundShape.on('touchstart', this.onMouseDown(this.foregroundShape)); // 播放区按钮控制\n\n /** 播放/暂停事件 */\n\n this.group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"PLAY_PAUSE_BTN\"], \":click\"), function () {\n _this.isPlay = !_this.isPlay;\n _this.currentHandler = _this.maxHandlerShape;\n\n _this.changePlayStatus();\n }); // 处理前进一步的事件\n\n this.group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"NEXT_STEP_BTN\"], \":click\"), function () {\n _this.currentHandler = _this.maxHandlerShape;\n\n _this.updateStartEnd(0.01);\n\n _this.updateUI();\n }); // 处理后退一步的事件\n\n this.group.on(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"PRE_STEP_BTN\"], \":click\"), function () {\n _this.currentHandler = _this.maxHandlerShape;\n\n _this.updateStartEnd(-0.01);\n\n _this.updateUI();\n });\n this.group.on(_constant__WEBPACK_IMPORTED_MODULE_5__[\"TIMEBAR_CONFIG_CHANGE\"], function (_a) {\n var type = _a.type,\n speed = _a.speed;\n _this.currentSpeed = speed;\n _this.currentMode = type;\n\n if (type === 'single') {\n _this.minHandlerShape.hide();\n\n _this.foregroundShape.hide();\n\n _this.minTextShape.hide();\n } else if (type === 'range') {\n _this.minHandlerShape.show();\n\n _this.foregroundShape.show();\n\n _this.minTextShape.show();\n }\n });\n };\n /** 输入当前圆点位置,输出离哪个 tick 的位置最近 */\n\n\n TrendTimeBar.prototype.adjustTickIndex = function (timeSelectX) {\n for (var i = 0; i < this.tickPosList.length - 1; i++) {\n if (this.tickPosList[i] <= timeSelectX && timeSelectX <= this.tickPosList[i + 1]) {\n return Math.abs(this.tickPosList[i] - timeSelectX) < Math.abs(timeSelectX - this.tickPosList[i + 1]) ? i : i + 1;\n }\n }\n\n return 0;\n };\n /**\n * 调整 offsetRange,因为一些范围的限制\n * @param offsetRange\n */\n\n\n TrendTimeBar.prototype.adjustOffsetRange = function (offsetRange) {\n // 针对不同的滑动组件,处理的方式不同\n switch (this.currentHandler) {\n case this.minHandlerShape:\n {\n var min = 0 - this.start;\n var max = 1 - this.start;\n return Math.min(max, Math.max(min, offsetRange));\n }\n\n case this.maxHandlerShape:\n {\n var min = 0 - this.end;\n var max = 1 - this.end;\n return Math.min(max, Math.max(min, offsetRange));\n }\n\n case this.foregroundShape:\n {\n var min = 0 - this.start;\n var max = 1 - this.end;\n return Math.min(max, Math.max(min, offsetRange));\n }\n\n default:\n return 0;\n }\n };\n /**\n * 更新起始、结束的控制块位置、文本、范围值(原始值)\n * @param offsetRange\n */\n\n\n TrendTimeBar.prototype.updateStartEnd = function (offsetRange) {\n var minData = this.ticks[this.adjustTickIndex(this.start * this.width)];\n var maxData = this.ticks[this.adjustTickIndex(this.end * this.width)];\n\n if (!this.currentHandler) {\n this.minText = this.tickLabelFormatter ? this.tickLabelFormatter(minData) : minData === null || minData === void 0 ? void 0 : minData.date;\n this.maxText = this.tickLabelFormatter ? this.tickLabelFormatter(maxData) : maxData === null || maxData === void 0 ? void 0 : maxData.date;\n return;\n } // 操作不同的组件,反馈不一样\n\n\n switch (this.currentHandler) {\n case this.minHandlerShape:\n // 拖动最小滑块时使用当前最大值设置最大值的文本,以便恢复到默认值\n this.maxText = this.maxTextShape.attr('text');\n this.start += offsetRange;\n this.minText = this.tickLabelFormatter ? this.tickLabelFormatter(minData) : minData.date;\n break;\n\n case this.maxHandlerShape:\n // 拖动最大滑块时使用当前最小值设置最小值的文本,以便恢复到默认值\n this.minText = this.minTextShape.attr('text');\n this.end += offsetRange;\n this.maxText = this.tickLabelFormatter ? this.tickLabelFormatter(maxData) : maxData.date;\n break;\n\n case this.foregroundShape:\n this.start += offsetRange;\n this.end += offsetRange;\n this.minText = this.tickLabelFormatter ? this.tickLabelFormatter(minData) : minData.date;\n this.maxText = this.tickLabelFormatter ? this.tickLabelFormatter(maxData) : maxData.date;\n break;\n\n default:\n break;\n }\n };\n /**\n * 根据移动的比例来更新 ui,更新范围(0-1 范围的比例值)\n * @private\n */\n\n\n TrendTimeBar.prototype.updateUI = function () {\n var _this = this;\n\n if (this.start < 0) {\n this.start = 0;\n }\n\n if (this.end > 1) {\n this.end = 1;\n }\n\n var min = this.x + this.start * this.width;\n var max = this.x + this.end * this.width; // 1. foreground\n\n this.foregroundShape.attr('x', min);\n this.foregroundShape.attr('width', max - min); // 滑块相关的大小信息\n\n var handlerWidth = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.handlerStyle, 'width', DEFAULT_HANDLER_WIDTH); // 设置文本\n\n this.setText(this.minText, this.maxText);\n\n var _a = this.dodgeText([min, max]),\n minAttrs = _a[0],\n maxAttrs = _a[1]; // 2. 左侧滑块和文字位置\n\n\n this.minHandlerShape.setX(min - handlerWidth / 2);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(minAttrs, function (v, k) {\n return _this.minTextShape.attr(k, v);\n }); // 3. 右侧滑块和文字位置\n\n this.maxHandlerShape.setX(max - handlerWidth / 2);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(maxAttrs, function (v, k) {\n return _this.maxTextShape.attr(k, v);\n });\n\n if (this.currentMode === 'range') {\n // 因为存储的 start、end 可能不一定是按大小存储的,所以排序一下,对外是 end >= start\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_5__[\"VALUE_CHANGE\"], {\n value: [this.start, this.end].sort()\n });\n } else if (this.currentMode === 'single') {\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_5__[\"VALUE_CHANGE\"], {\n value: [this.end, this.end]\n });\n }\n };\n /**\n * 调整 text 的位置,自动躲避\n * 根据位置,调整返回新的位置\n * @param range\n */\n\n\n TrendTimeBar.prototype.dodgeText = function (range) {\n var _a, _b;\n\n var TEXTPADDING = 2;\n var handlerWidth = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"get\"])(this.handlerStyle, 'width', DEFAULT_HANDLER_WIDTH);\n var minTextShape = this.minTextShape;\n var maxTextShape = this.maxTextShape;\n var min = range[0],\n max = range[1];\n var sorted = false; // 如果交换了位置,则对应的 min max 也交换\n\n if (min > max) {\n _a = [max, min], min = _a[0], max = _a[1];\n _b = [maxTextShape, minTextShape], minTextShape = _b[0], maxTextShape = _b[1];\n sorted = true;\n } // 避让规则,优先显示在两侧,只有显示不下的时候,才显示在中间\n\n\n var minBBox = minTextShape.getBBox();\n var maxBBox = maxTextShape.getBBox();\n var minAttrs = null;\n var maxAttrs = null;\n\n if (this.timeBarType === 'trend') {\n minAttrs = min - minBBox.width < this.x + TEXTPADDING ? {\n x: min + handlerWidth / 2 + TEXTPADDING,\n textAlign: 'left'\n } : {\n x: min - handlerWidth / 2 - TEXTPADDING,\n textAlign: 'right'\n };\n maxAttrs = max + maxBBox.width > this.x + this.width ? {\n x: max - handlerWidth / 2 - TEXTPADDING,\n textAlign: 'right'\n } : {\n x: max + handlerWidth / 2 + TEXTPADDING,\n textAlign: 'left'\n };\n } else if (this.timeBarType === 'simple') {\n minAttrs = minTextShape.attr('x') > minBBox.width // 左边滑块文本位置小于其宽度代表文字超过左边届\n ? {\n x: min,\n textAlign: 'center'\n } : {\n x: min,\n textAlign: 'left'\n };\n maxAttrs = maxTextShape.attr('x') > this.width - maxBBox.width // 有边滑块文本位置大于宽度代表文字超过右边界\n ? {\n x: max,\n textAlign: 'right'\n } : {\n x: max,\n textAlign: 'center'\n };\n }\n\n return !sorted ? [minAttrs, maxAttrs] : [maxAttrs, minAttrs];\n };\n\n TrendTimeBar.prototype.startPlay = function () {\n var _this = this;\n\n return typeof window !== 'undefined' ? window.requestAnimationFrame(function () {\n var _a = _this,\n ticks = _a.ticks,\n width = _a.width;\n var speed = _this.currentSpeed;\n var tickInterval = width / ticks.length;\n var offsetX = tickInterval / ((10 - speed) * 1000 / 60);\n\n var offsetXRange = _this.adjustOffsetRange(offsetX / _this.width);\n\n _this.updateStartEnd(offsetXRange);\n\n _this.updateUI();\n\n if (_this.isPlay) {\n _this.playHandler = _this.startPlay();\n }\n }) : undefined;\n };\n\n TrendTimeBar.prototype.changePlayStatus = function (isSync) {\n if (isSync === void 0) {\n isSync = true;\n }\n\n this.controllerBtnGroup.playButton.update({\n isPlay: this.isPlay\n });\n\n if (this.isPlay) {\n // 开始播放\n this.playHandler = this.startPlay();\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_5__[\"TIMELINE_START\"], null);\n } else {\n // 结束播放\n if (this.playHandler) {\n if (typeof window !== 'undefined') window.cancelAnimationFrame(this.playHandler);\n\n if (isSync) {\n this.graph.emit(_constant__WEBPACK_IMPORTED_MODULE_5__[\"TIMELINE_END\"], null);\n }\n }\n }\n };\n\n TrendTimeBar.prototype.destory = function () {\n this.graph.off(_constant__WEBPACK_IMPORTED_MODULE_5__[\"VALUE_CHANGE\"], function () {});\n var group = this.group;\n var minHandleShapeGroup = group.find(function (g) {\n return g.get('name') === 'minHandlerShape';\n });\n\n if (minHandleShapeGroup) {\n minHandleShapeGroup.off('minHandlerShape-handler:mousedown');\n minHandleShapeGroup.off('minHandlerShape-handler:touchstart');\n minHandleShapeGroup.destroy();\n }\n\n var maxHandleShapeGroup = group.find(function (g) {\n return g.get('name') === 'maxHandlerShape';\n }); // 2. 右滑块的滑动\n\n if (maxHandleShapeGroup) {\n maxHandleShapeGroup.off('maxHandlerShape-handler:mousedown');\n maxHandleShapeGroup.off('maxHandlerShape-handler:touchstart');\n maxHandleShapeGroup.destroy();\n } // 3. 前景选中区域\n\n\n this.foregroundShape.off('mousedown');\n this.foregroundShape.off('touchstart');\n this.foregroundShape.destroy();\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"PLAY_PAUSE_BTN\"], \":click\"));\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"NEXT_STEP_BTN\"], \":click\"));\n group.off(\"\".concat(_constant__WEBPACK_IMPORTED_MODULE_5__[\"PRE_STEP_BTN\"], \":click\"));\n group.off(_constant__WEBPACK_IMPORTED_MODULE_5__[\"TIMEBAR_CONFIG_CHANGE\"]);\n group.destroy();\n\n if (this.trendComponent) {\n this.trendComponent.destory();\n }\n };\n\n return TrendTimeBar;\n}();\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (TrendTimeBar);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/timeBar/trendTimeBar.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ml_matrix_1 = __webpack_require__(/*! ml-matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/index.js\");\nvar MDS = /** @class */ (function () {\n function MDS(params) {\n this.distances = params.distances;\n this.dimension = params.dimension || 2;\n this.linkDistance = params.linkDistance;\n }\n MDS.prototype.layout = function () {\n var self = this;\n var dimension = self.dimension, distances = self.distances, linkDistance = self.linkDistance;\n try {\n // square distances\n var M = ml_matrix_1.Matrix.mul(ml_matrix_1.Matrix.pow(distances, 2), -0.5);\n // double centre the rows/columns\n var rowMeans = M.mean('row');\n var colMeans = M.mean('column');\n var totalMean = M.mean();\n M.add(totalMean).subRowVector(rowMeans).subColumnVector(colMeans);\n // take the SVD of the double centred matrix, and return the\n // points from it\n var ret = new ml_matrix_1.SingularValueDecomposition(M);\n var eigenValues_1 = ml_matrix_1.Matrix.sqrt(ret.diagonalMatrix).diagonal();\n return ret.leftSingularVectors.toJSON().map(function (row) {\n return ml_matrix_1.Matrix.mul([row], [eigenValues_1]).toJSON()[0].splice(0, dimension);\n });\n }\n catch (_a) {\n var res = [];\n for (var i = 0; i < distances.length; i++) {\n var x = Math.random() * linkDistance;\n var y = Math.random() * linkDistance;\n res.push([x, y]);\n }\n return res;\n }\n };\n return MDS;\n}());\nexports.default = MDS;\n//# sourceMappingURL=mds.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/radial/mds.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/toolBar/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/toolBar/index.js ***! - \**********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/radial/radial.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/radial/radial.js ***! + \***************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! insert-css */ \"./node_modules/insert-css/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_3___default = /*#__PURE__*/__webpack_require__.n(insert_css__WEBPACK_IMPORTED_MODULE_3__);\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\n\nvar DELTA = 0.05;\ntypeof document !== 'undefined' && insert_css__WEBPACK_IMPORTED_MODULE_3___default()(\"\\n .g6-component-toolbar {\\n position: absolute;\\n list-style-type: none;\\n padding: 6px;\\n left: 0px;\\n top: 0px;\\n background-color: rgba(255, 255, 255, 0.9);\\n border: 1px solid #e2e2e2;\\n border-radius: 4px;\\n font-size: 12px;\\n color: #545454;\\n margin: 0;\\n }\\n .g6-component-toolbar li {\\n float: left;\\n text-align: center;\\n width: 35px;\\n height: 24px;\\n cursor: pointer;\\n\\t\\tlist-style-type:none;\\n list-style: none;\\n margin-left: 0px;\\n }\\n .g6-component-toolbar li .icon {\\n opacity: 0.7;\\n }\\n .g6-component-toolbar li .icon:hover {\\n opacity: 1;\\n }\\n\");\n\nvar getEventPath = function getEventPath(evt) {\n if (!evt) {\n return [];\n }\n\n if (evt.composedPath) {\n return evt.composedPath();\n }\n\n var path = [];\n var el = evt.target;\n\n while (el) {\n path.push(el);\n\n if (el.tagName === 'HTML') {\n path.push(document, window);\n return path;\n }\n\n el = el.parentElement;\n }\n\n return path;\n};\n\nvar ToolBar =\n/** @class */\nfunction (_super) {\n __extends(ToolBar, _super);\n\n function ToolBar(config) {\n return _super.call(this, config) || this;\n }\n\n ToolBar.prototype.getDefaultCfgs = function () {\n return {\n handleClick: undefined,\n // 指定菜单内容,function(e) {...}\n getContent: function getContent(graph) {\n return \"\\n
    \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
  • \\n \\n \\n \\n
  • \\n
\\n \";\n },\n zoomSensitivity: 2\n };\n };\n\n ToolBar.prototype.init = function () {\n var _this = this;\n\n var graph = this.get('graph');\n var getContent = this.get('getContent');\n var toolBar = getContent(graph);\n var toolBarDOM = toolBar;\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(toolBar)) {\n toolBarDOM = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(toolBar);\n }\n\n var className = this.get('className');\n toolBarDOM.setAttribute('class', className || 'g6-component-toolbar');\n var container = this.get('container');\n\n if (!container) {\n container = this.get('graph').get('container');\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n container.appendChild(toolBarDOM);\n this.set('toolBar', toolBarDOM);\n var handleClick = this.get('handleClick');\n toolBarDOM.addEventListener('click', function (evt) {\n var current = getEventPath(evt).filter(function (p) {\n return p.nodeName === 'LI';\n });\n\n if (current.length === 0) {\n return;\n }\n\n var code = current[0].getAttribute('code');\n\n if (!code) {\n return;\n }\n\n if (handleClick) {\n handleClick(code, graph);\n } else {\n _this.handleDefaultOperator(code);\n }\n });\n var pos = this.get('position');\n\n if (pos) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(toolBarDOM, {\n top: \"\".concat(pos.y, \"px\"),\n left: \"\".concat(pos.x, \"px\")\n });\n }\n\n this.bindUndoRedo();\n };\n\n ToolBar.prototype.bindUndoRedo = function () {\n var graph = this.get('graph');\n var undoDom = document.querySelector('.g6-component-toolbar li[code=\"undo\"]');\n var undoDomIcon = document.querySelector('.g6-component-toolbar li[code=\"undo\"] svg');\n var redoDom = document.querySelector('.g6-component-toolbar li[code=\"redo\"]');\n var redoDomIcon = document.querySelector('.g6-component-toolbar li[code=\"redo\"] svg');\n\n if (!undoDom || !undoDomIcon || !redoDom || !redoDomIcon) {\n return;\n }\n\n graph.on('stackchange', function (evt) {\n var undoStack = evt.undoStack,\n redoStack = evt.redoStack;\n var undoStackLen = undoStack.length;\n var redoStackLen = redoStack.length; // undo 不可用\n\n if (undoStackLen === 1) {\n undoDom.setAttribute('style', 'cursor: not-allowed');\n undoDomIcon.setAttribute('style', 'opacity: 0.4');\n } else {\n undoDom.removeAttribute('style');\n undoDomIcon.removeAttribute('style');\n } // redo 不可用\n\n\n if (redoStackLen === 0) {\n redoDom.setAttribute('style', 'cursor: not-allowed');\n redoDomIcon.setAttribute('style', 'opacity: 0.4');\n } else {\n redoDom.removeAttribute('style');\n redoDomIcon.removeAttribute('style');\n }\n });\n };\n /**\n * undo 操作\n */\n\n\n ToolBar.prototype.undo = function () {\n var graph = this.get('graph');\n var undoStack = graph.getUndoStack();\n\n if (!undoStack || undoStack.length === 1) {\n return;\n }\n\n var currentData = undoStack.pop();\n\n if (currentData) {\n var action = currentData.action;\n graph.pushStack(action, Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(currentData.data), 'redo');\n var data_1 = currentData.data.before;\n\n if (action === 'add') {\n data_1 = currentData.data.after;\n }\n\n if (!data_1) return;\n\n switch (action) {\n case 'visible':\n {\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n var item = graph.findById(model.id);\n\n if (model.visible) {\n graph.showItem(item, false);\n } else {\n graph.hideItem(item, false);\n }\n });\n });\n break;\n }\n\n case 'render':\n case 'update':\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n var item = graph.findById(model.id);\n delete model.id;\n graph.updateItem(item, model, false);\n if (item.getType() === 'combo') graph.updateCombo(item);\n });\n });\n break;\n\n case 'changedata':\n graph.changeData(data_1, false);\n break;\n\n case 'delete':\n {\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n var itemType = model.itemType;\n delete model.itemType;\n graph.addItem(itemType, model, false);\n });\n });\n break;\n }\n\n case 'add':\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n graph.removeItem(model.id, false);\n });\n });\n break;\n\n case 'updateComboTree':\n Object.keys(data_1).forEach(function (key) {\n var array = data_1[key];\n if (!array) return;\n array.forEach(function (model) {\n graph.updateComboTree(model.id, model.parentId, false);\n });\n });\n break;\n\n case 'layout':\n graph.updateLayout(data_1, undefined, undefined, false);\n break;\n\n default:\n }\n }\n };\n /**\n * redo 操作\n */\n\n\n ToolBar.prototype.redo = function () {\n var graph = this.get('graph');\n var redoStack = graph.getRedoStack();\n\n if (!redoStack || redoStack.length === 0) {\n return;\n }\n\n var currentData = redoStack.pop();\n\n if (currentData) {\n var action = currentData.action;\n var data_2 = currentData.data.after;\n graph.pushStack(action, Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"clone\"])(currentData.data));\n\n if (action === 'delete') {\n data_2 = currentData.data.before;\n }\n\n if (!data_2) return;\n\n switch (action) {\n case 'visible':\n {\n Object.keys(data_2).forEach(function (key) {\n var array = data_2[key];\n if (!array) return;\n array.forEach(function (model) {\n var item = graph.findById(model.id);\n\n if (model.visible) {\n graph.showItem(item, false);\n } else {\n graph.hideItem(item, false);\n }\n });\n });\n break;\n }\n\n case 'render':\n case 'update':\n Object.keys(data_2).forEach(function (key) {\n var array = data_2[key];\n if (!array) return;\n array.forEach(function (model) {\n var item = graph.findById(model.id);\n delete model.id;\n graph.updateItem(item, model, false);\n if (item.getType() === 'combo') graph.updateCombo(item);\n });\n });\n break;\n\n case 'changedata':\n graph.changeData(data_2, false);\n break;\n\n case 'delete':\n if (data_2.edges) {\n data_2.edges.forEach(function (model) {\n graph.removeItem(model.id, false);\n });\n }\n\n if (data_2.nodes) {\n data_2.nodes.forEach(function (model) {\n graph.removeItem(model.id, false);\n });\n }\n\n if (data_2.combos) {\n data_2.combos.forEach(function (model) {\n graph.removeItem(model.id, false);\n });\n }\n\n break;\n\n case 'add':\n {\n Object.keys(data_2).forEach(function (key) {\n var array = data_2[key];\n if (!array) return;\n array.forEach(function (model) {\n var itemType = model.itemType;\n delete model.itemType;\n graph.addItem(itemType, model, false);\n });\n });\n break;\n }\n\n case 'updateComboTree':\n Object.keys(data_2).forEach(function (key) {\n var array = data_2[key];\n if (!array) return;\n array.forEach(function (model) {\n graph.updateComboTree(model.id, model.parentId, false);\n });\n });\n break;\n\n case 'layout':\n graph.updateLayout(data_2, undefined, undefined, false);\n break;\n\n default:\n }\n }\n };\n /**\n * zoomOut 操作\n */\n\n\n ToolBar.prototype.zoomOut = function () {\n var graph = this.get('graph');\n var currentZoom = graph.getZoom();\n var ratioOut = 1 / (1 - DELTA * this.get('zoomSensitivity'));\n var maxZoom = this.get('maxZoom') || graph.get('maxZoom');\n\n if (ratioOut * currentZoom > maxZoom) {\n return;\n }\n\n graph.zoomTo(currentZoom * ratioOut);\n };\n /**\n * zoomIn 操作\n */\n\n\n ToolBar.prototype.zoomIn = function () {\n var graph = this.get('graph');\n var currentZoom = graph.getZoom();\n var ratioIn = 1 - DELTA * this.get('zoomSensitivity');\n var minZoom = this.get('minZoom') || graph.get('minZoom');\n\n if (ratioIn * currentZoom < minZoom) {\n return;\n }\n\n graph.zoomTo(currentZoom * ratioIn);\n };\n /**\n * realZoom 操作\n */\n\n\n ToolBar.prototype.realZoom = function () {\n var graph = this.get('graph');\n graph.zoomTo(1);\n };\n /**\n * autoZoom 操作\n */\n\n\n ToolBar.prototype.autoZoom = function () {\n var graph = this.get('graph');\n graph.fitView([20, 20]);\n };\n /**\n * 根据 Toolbar 上不同类型对图进行操作\n * @param code 操作类型编码\n * @param graph Graph 实例\n */\n\n\n ToolBar.prototype.handleDefaultOperator = function (code) {\n switch (code) {\n case 'redo':\n this.redo();\n break;\n\n case 'undo':\n this.undo();\n break;\n\n case 'zoomOut':\n this.zoomOut();\n break;\n\n case 'zoomIn':\n this.zoomIn();\n break;\n\n case 'realZoom':\n this.realZoom();\n break;\n\n case 'autoZoom':\n this.autoZoom();\n break;\n\n default:\n }\n };\n\n ToolBar.prototype.destroy = function () {\n var toolBar = this.get('toolBar');\n\n if (toolBar) {\n var container = this.get('container');\n\n if (!container) {\n container = this.get('graph').get('container');\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n container.removeChild(toolBar);\n }\n\n var handleClick = this.get('handleClick');\n\n if (handleClick) {\n toolBar.removeEventListener('click', handleClick);\n }\n };\n\n return ToolBar;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (ToolBar);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/toolBar/index.js?"); +eval("\n/**\n * @fileOverview random layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RadialLayout = void 0;\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar mds_1 = __importDefault(__webpack_require__(/*! ./mds */ \"./node_modules/@antv/layout/lib/layout/radial/mds.js\"));\nvar radialNonoverlapForce_1 = __importDefault(__webpack_require__(/*! ./radialNonoverlapForce */ \"./node_modules/@antv/layout/lib/layout/radial/radialNonoverlapForce.js\"));\nfunction getWeightMatrix(M) {\n var rows = M.length;\n var cols = M[0].length;\n var result = [];\n for (var i = 0; i < rows; i++) {\n var row = [];\n for (var j = 0; j < cols; j++) {\n if (M[i][j] !== 0) {\n row.push(1 / (M[i][j] * M[i][j]));\n }\n else {\n row.push(0);\n }\n }\n result.push(row);\n }\n return result;\n}\nfunction getIndexById(array, id) {\n var index = -1;\n array.forEach(function (a, i) {\n if (a.id === id) {\n index = i;\n }\n });\n return index;\n}\nfunction getEDistance(p1, p2) {\n return Math.sqrt((p1[0] - p2[0]) * (p1[0] - p2[0]) + (p1[1] - p2[1]) * (p1[1] - p2[1]));\n}\n/**\n * 辐射状布局\n */\nvar RadialLayout = /** @class */ (function (_super) {\n __extends(RadialLayout, _super);\n function RadialLayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 中心点,默认为数据中第一个点 */\n _this.focusNode = null;\n /** 每一圈半径 */\n _this.unitRadius = null;\n /** 默认边长度 */\n _this.linkDistance = 50;\n /** 是否防止重叠 */\n _this.preventOverlap = false;\n /** 是否必须是严格的 radial 布局,即每一层的节点严格布局在一个环上。preventOverlap 为 true 时生效 */\n _this.strictRadial = true;\n /** 防止重叠步骤的最大迭代次数 */\n _this.maxPreventOverlapIteration = 200;\n _this.sortStrength = 10;\n _this.nodes = [];\n _this.edges = [];\n _this.updateCfg(options);\n return _this;\n }\n RadialLayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 1000,\n focusNode: null,\n unitRadius: null,\n linkDistance: 50,\n preventOverlap: false,\n nodeSize: undefined,\n nodeSpacing: undefined,\n strictRadial: true,\n maxPreventOverlapIteration: 200,\n sortBy: undefined,\n sortStrength: 10\n };\n };\n /**\n * 执行布局\n */\n RadialLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var edges = self.edges || [];\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n var linkDistance = self.linkDistance;\n // layout\n var focusNode = null;\n if ((0, util_1.isString)(self.focusNode)) {\n var found = false;\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].id === self.focusNode) {\n focusNode = nodes[i];\n self.focusNode = focusNode;\n found = true;\n i = nodes.length;\n }\n }\n if (!found) {\n focusNode = null;\n }\n }\n else {\n focusNode = self.focusNode;\n }\n // default focus node\n if (!focusNode) {\n focusNode = nodes[0];\n self.focusNode = focusNode;\n }\n // the index of the focusNode in data\n var focusIndex = getIndexById(nodes, focusNode.id);\n if (focusIndex < 0)\n focusIndex = 0;\n self.focusIndex = focusIndex;\n // the graph-theoretic distance (shortest path distance) matrix\n var adjMatrix = (0, util_1.getAdjMatrix)({ nodes: nodes, edges: edges }, false);\n var D = (0, util_1.floydWarshall)(adjMatrix);\n var maxDistance = self.maxToFocus(D, focusIndex);\n // replace first node in unconnected component to the circle at (maxDistance + 1)\n self.handleInfinity(D, focusIndex, maxDistance + 1);\n self.distances = D;\n // the shortest path distance from each node to focusNode\n var focusNodeD = D[focusIndex];\n var width = self.width || 500;\n var height = self.height || 500;\n var semiWidth = width - center[0] > center[0] ? center[0] : width - center[0];\n var semiHeight = height - center[1] > center[1] ? center[1] : height - center[1];\n if (semiWidth === 0) {\n semiWidth = width / 2;\n }\n if (semiHeight === 0) {\n semiHeight = height / 2;\n }\n // the maxRadius of the graph\n var maxRadius = semiHeight > semiWidth ? semiWidth : semiHeight;\n var maxD = Math.max.apply(Math, focusNodeD);\n // the radius for each nodes away from focusNode\n var radii = [];\n focusNodeD.forEach(function (value, i) {\n if (!self.unitRadius) {\n self.unitRadius = maxRadius / maxD;\n }\n radii[i] = value * self.unitRadius;\n });\n self.radii = radii;\n var eIdealD = self.eIdealDisMatrix();\n // const eIdealD = scaleMatrix(D, linkDistance);\n self.eIdealDistances = eIdealD;\n // the weight matrix, Wij = 1 / dij^(-2)\n var W = getWeightMatrix(eIdealD);\n self.weights = W;\n // the initial positions from mds\n var mds = new mds_1.default({ linkDistance: linkDistance, distances: eIdealD });\n var positions = mds.layout();\n positions.forEach(function (p) {\n if ((0, util_1.isNaN)(p[0])) {\n p[0] = Math.random() * linkDistance;\n }\n if ((0, util_1.isNaN)(p[1])) {\n p[1] = Math.random() * linkDistance;\n }\n });\n self.positions = positions;\n positions.forEach(function (p, i) {\n nodes[i].x = p[0] + center[0];\n nodes[i].y = p[1] + center[1];\n });\n // move the graph to origin, centered at focusNode\n positions.forEach(function (p) {\n p[0] -= positions[focusIndex][0];\n p[1] -= positions[focusIndex][1];\n });\n self.run();\n var preventOverlap = self.preventOverlap;\n var nodeSize = self.nodeSize;\n var nodeSizeFunc;\n var strictRadial = self.strictRadial;\n // stagger the overlapped nodes\n if (preventOverlap) {\n var nodeSpacing_1 = self.nodeSpacing;\n var nodeSpacingFunc_1;\n if ((0, util_1.isNumber)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = function () { return nodeSpacing_1; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = nodeSpacing_1;\n }\n else {\n nodeSpacingFunc_1 = function () { return 0; };\n }\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return res + nodeSpacingFunc_1(d);\n }\n if ((0, util_1.isObject)(d.size)) {\n var res = d.size.width > d.size.height ? d.size.width : d.size.height;\n return res + nodeSpacingFunc_1(d);\n }\n return d.size + nodeSpacingFunc_1(d);\n }\n return 10 + nodeSpacingFunc_1(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function (d) {\n var res = nodeSize[0] > nodeSize[1] ? nodeSize[0] : nodeSize[1];\n return res + nodeSpacingFunc_1(d);\n };\n }\n else {\n nodeSizeFunc = function (d) { return nodeSize + nodeSpacingFunc_1(d); };\n }\n var nonoverlapForceParams = {\n nodes: nodes,\n nodeSizeFunc: nodeSizeFunc,\n adjMatrix: adjMatrix,\n positions: positions,\n radii: radii,\n height: height,\n width: width,\n strictRadial: strictRadial,\n focusID: focusIndex,\n iterations: self.maxPreventOverlapIteration || 200,\n k: positions.length / 4.5\n };\n var nonoverlapForce = new radialNonoverlapForce_1.default(nonoverlapForceParams);\n positions = nonoverlapForce.layout();\n }\n // move the graph to center\n positions.forEach(function (p, i) {\n nodes[i].x = p[0] + center[0];\n nodes[i].y = p[1] + center[1];\n });\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n };\n RadialLayout.prototype.run = function () {\n var self = this;\n var maxIteration = self.maxIteration;\n var positions = self.positions || [];\n var W = self.weights || [];\n var eIdealDis = self.eIdealDistances || [];\n var radii = self.radii || [];\n for (var i = 0; i <= maxIteration; i++) {\n var param = i / maxIteration;\n self.oneIteration(param, positions, radii, eIdealDis, W);\n }\n };\n RadialLayout.prototype.oneIteration = function (param, positions, radii, D, W) {\n var self = this;\n var vparam = 1 - param;\n var focusIndex = self.focusIndex;\n positions.forEach(function (v, i) {\n // v\n var originDis = getEDistance(v, [0, 0]);\n var reciODis = originDis === 0 ? 0 : 1 / originDis;\n if (i === focusIndex) {\n return;\n }\n var xMolecule = 0;\n var yMolecule = 0;\n var denominator = 0;\n positions.forEach(function (u, j) {\n // u\n if (i === j) {\n return;\n }\n // the euclidean distance between v and u\n var edis = getEDistance(v, u);\n var reciEdis = edis === 0 ? 0 : 1 / edis;\n var idealDis = D[j][i];\n // same for x and y\n denominator += W[i][j];\n // x\n xMolecule += W[i][j] * (u[0] + idealDis * (v[0] - u[0]) * reciEdis);\n // y\n yMolecule += W[i][j] * (u[1] + idealDis * (v[1] - u[1]) * reciEdis);\n });\n var reciR = radii[i] === 0 ? 0 : 1 / radii[i];\n denominator *= vparam;\n denominator += param * reciR * reciR;\n // x\n xMolecule *= vparam;\n xMolecule += param * reciR * v[0] * reciODis;\n v[0] = xMolecule / denominator;\n // y\n yMolecule *= vparam;\n yMolecule += param * reciR * v[1] * reciODis;\n v[1] = yMolecule / denominator;\n });\n };\n RadialLayout.prototype.eIdealDisMatrix = function () {\n var self = this;\n var nodes = self.nodes;\n if (!nodes)\n return [];\n var D = self.distances;\n var linkDis = self.linkDistance;\n var radii = self.radii || [];\n var unitRadius = self.unitRadius || 50;\n var result = [];\n if (D) {\n D.forEach(function (row, i) {\n var newRow = [];\n row.forEach(function (v, j) {\n if (i === j) {\n newRow.push(0);\n }\n else if (radii[i] === radii[j]) {\n // i and j are on the same circle\n if (self.sortBy === \"data\") {\n // sort the nodes on the same circle according to the ordering of the data\n newRow.push((v * (Math.abs(i - j) * self.sortStrength)) /\n (radii[i] / unitRadius));\n }\n else if (self.sortBy) {\n // sort the nodes on the same circle according to the attributes\n var iValue = nodes[i][self.sortBy] || 0;\n var jValue = nodes[j][self.sortBy] || 0;\n if ((0, util_1.isString)(iValue)) {\n iValue = iValue.charCodeAt(0);\n }\n if ((0, util_1.isString)(jValue)) {\n jValue = jValue.charCodeAt(0);\n }\n newRow.push((v * (Math.abs(iValue - jValue) * self.sortStrength)) /\n (radii[i] / unitRadius));\n }\n else {\n newRow.push((v * linkDis) / (radii[i] / unitRadius));\n }\n }\n else {\n // i and j are on different circle\n // i and j are on different circle\n var link = (linkDis + unitRadius) / 2;\n newRow.push(v * link);\n }\n });\n result.push(newRow);\n });\n }\n return result;\n };\n RadialLayout.prototype.handleInfinity = function (matrix, focusIndex, step) {\n var length = matrix.length;\n // 遍历 matrix 中遍历 focus 对应行\n for (var i = 0; i < length; i++) {\n // matrix 关注点对应行的 Inf 项\n if (matrix[focusIndex][i] === Infinity) {\n matrix[focusIndex][i] = step;\n matrix[i][focusIndex] = step;\n // 遍历 matrix 中的 i 行,i 行中非 Inf 项若在 focus 行为 Inf,则替换 focus 行的那个 Inf\n for (var j = 0; j < length; j++) {\n if (matrix[i][j] !== Infinity && matrix[focusIndex][j] === Infinity) {\n matrix[focusIndex][j] = step + matrix[i][j];\n matrix[j][focusIndex] = step + matrix[i][j];\n }\n }\n }\n }\n // 处理其他行的 Inf。根据该行对应点与 focus 距离以及 Inf 项点 与 focus 距离,决定替换值\n for (var i = 0; i < length; i++) {\n if (i === focusIndex) {\n continue;\n }\n for (var j = 0; j < length; j++) {\n if (matrix[i][j] === Infinity) {\n var minus = Math.abs(matrix[focusIndex][i] - matrix[focusIndex][j]);\n minus = minus === 0 ? 1 : minus;\n matrix[i][j] = minus;\n }\n }\n }\n };\n RadialLayout.prototype.maxToFocus = function (matrix, focusIndex) {\n var max = 0;\n for (var i = 0; i < matrix[focusIndex].length; i++) {\n if (matrix[focusIndex][i] === Infinity) {\n continue;\n }\n max = matrix[focusIndex][i] > max ? matrix[focusIndex][i] : max;\n }\n return max;\n };\n RadialLayout.prototype.getType = function () {\n return \"radial\";\n };\n return RadialLayout;\n}(base_1.Base));\nexports.RadialLayout = RadialLayout;\n//# sourceMappingURL=radial.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/radial/radial.js?"); /***/ }), -/***/ "./node_modules/@antv/g6-plugin/es/tooltip/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/g6-plugin/es/tooltip/index.js ***! - \**********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/radial/radialNonoverlapForce.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/radial/radialNonoverlapForce.js ***! + \******************************************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_dom_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/dom-util */ \"./node_modules/@antv/dom-util/esm/index.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! insert-css */ \"./node_modules/insert-css/index.js\");\n/* harmony import */ var insert_css__WEBPACK_IMPORTED_MODULE_2___default = /*#__PURE__*/__webpack_require__.n(insert_css__WEBPACK_IMPORTED_MODULE_2__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/g6-plugin/es/base.js\");\nvar __extends = undefined && undefined.__extends || function () {\n var _extendStatics = function extendStatics(d, b) {\n _extendStatics = Object.setPrototypeOf || {\n __proto__: []\n } instanceof Array && function (d, b) {\n d.__proto__ = b;\n } || function (d, b) {\n for (var p in b) {\n if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p];\n }\n };\n\n return _extendStatics(d, b);\n };\n\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null) throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n\n _extendStatics(d, b);\n\n function __() {\n this.constructor = d;\n }\n\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n}();\n\n\n\n\n\ntypeof document !== 'undefined' && insert_css__WEBPACK_IMPORTED_MODULE_2___default()(\"\\n .g6-component-tooltip {\\n border: 1px solid #e2e2e2;\\n border-radius: 4px;\\n font-size: 12px;\\n color: #545454;\\n background-color: rgba(255, 255, 255, 0.9);\\n padding: 10px 8px;\\n box-shadow: rgb(174, 174, 174) 0px 0px 10px;\\n }\\n .tooltip-type {\\n padding: 0;\\n margin: 0;\\n }\\n .tooltip-id {\\n color: #531dab;\\n }\\n\");\n\nvar Tooltip =\n/** @class */\nfunction (_super) {\n __extends(Tooltip, _super);\n\n function Tooltip(config) {\n return _super.call(this, config) || this;\n }\n\n Tooltip.prototype.getDefaultCfgs = function () {\n return {\n offsetX: 6,\n offsetY: 6,\n // 指定菜单内容,function(e) {...}\n getContent: function getContent(e) {\n return \"\\n

\\u7C7B\\u578B\\uFF1A\".concat(e.item.getType(), \"

\\n ID\\uFF1A\").concat(e.item.getID(), \"\\n \");\n },\n shouldBegin: function shouldBegin(e) {\n return true;\n },\n itemTypes: ['node', 'edge', 'combo'],\n trigger: 'mouseenter',\n fixToNode: undefined\n };\n }; // class-methods-use-this\n\n\n Tooltip.prototype.getEvents = function () {\n if (this.get('trigger') === 'click') {\n return {\n 'node:click': 'onClick',\n 'edge:click': 'onClick',\n 'combo:click': 'onClick',\n 'canvas:click': 'onMouseLeave',\n afterremoveitem: 'onMouseLeave',\n contextmenu: 'onMouseLeave',\n drag: 'onMouseLeave'\n };\n }\n\n return {\n 'node:mouseenter': 'onMouseEnter',\n 'node:mouseleave': 'onMouseLeave',\n 'node:mousemove': 'onMouseMove',\n 'edge:mouseenter': 'onMouseEnter',\n 'edge:mouseleave': 'onMouseLeave',\n 'edge:mousemove': 'onMouseMove',\n 'combo:mouseenter': 'onMouseEnter',\n 'combo:mouseleave': 'onMouseLeave',\n 'combo:mousemove': 'onMouseMove',\n afterremoveitem: 'onMouseLeave',\n contextmenu: 'onMouseLeave',\n 'node:drag': 'onMouseLeave'\n };\n };\n\n Tooltip.prototype.init = function () {\n var self = this;\n var className = self.get('className') || 'g6-component-tooltip';\n var tooltip = Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"createDom\"])(\"
\"));\n var container = self.get('container');\n\n if (!container) {\n container = self.get('graph').get('container');\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n position: 'absolute',\n visibility: 'hidden',\n display: 'none'\n });\n container.appendChild(tooltip);\n\n if (self.get('trigger') !== 'click') {\n tooltip.addEventListener('mouseenter', function (e) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n visibility: 'visible',\n display: 'unset'\n });\n });\n tooltip.addEventListener('mouseleave', function (e) {\n self.hideTooltip();\n });\n }\n\n self.set('tooltip', tooltip);\n };\n\n Tooltip.prototype.onClick = function (e) {\n var itemTypes = this.get('itemTypes');\n if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return;\n var item = e.item;\n var graph = this.get('graph'); // 若与上一次同一 item,隐藏该 tooltip\n\n if (this.currentTarget === item) {\n this.currentTarget = null;\n this.hideTooltip();\n graph.emit('tooltipchange', {\n item: e.item,\n action: 'hide'\n });\n } else {\n this.currentTarget = item;\n this.showTooltip(e);\n graph.emit('tooltipchange', {\n item: e.item,\n action: 'show'\n });\n }\n };\n\n Tooltip.prototype.onMouseEnter = function (e) {\n var itemTypes = this.get('itemTypes');\n if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return;\n var item = e.item;\n var graph = this.get('graph');\n this.currentTarget = item;\n this.showTooltip(e);\n graph.emit('tooltipchange', {\n item: e.item,\n action: 'show'\n });\n };\n\n Tooltip.prototype.onMouseMove = function (e) {\n var itemTypes = this.get('itemTypes');\n if (e.item && e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return;\n\n if (!this.currentTarget || e.item !== this.currentTarget) {\n return;\n }\n\n this.showTooltip(e);\n };\n\n Tooltip.prototype.onMouseLeave = function () {\n this.hideTooltip();\n var graph = this.get('graph');\n graph.emit('tooltipchange', {\n item: this.currentTarget,\n action: 'hide'\n });\n this.currentTarget = null;\n };\n\n Tooltip.prototype.clearContainer = function () {\n var container = this.get('tooltip');\n\n if (container) {\n container.innerHTML = '';\n }\n };\n\n Tooltip.prototype.showTooltip = function (e) {\n if (!e.item) {\n return;\n }\n\n var itemTypes = this.get('itemTypes');\n if (e.item.getType && itemTypes.indexOf(e.item.getType()) === -1) return;\n var container = this.get('tooltip');\n var getContent = this.get('getContent');\n var tooltip = getContent(e);\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(tooltip)) {\n container.innerHTML = tooltip;\n } else {\n this.clearContainer();\n container.appendChild(tooltip);\n }\n\n this.updatePosition(e);\n };\n\n Tooltip.prototype.hideTooltip = function () {\n var tooltip = this.get('tooltip');\n\n if (tooltip) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n visibility: 'hidden',\n display: 'none'\n });\n }\n };\n\n Tooltip.prototype.updatePosition = function (e) {\n var shouldBegin = this.get('shouldBegin');\n var tooltip = this.get('tooltip');\n\n if (!shouldBegin(e)) {\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n visibility: 'hidden',\n display: 'none'\n });\n return;\n }\n\n var graph = this.get('graph');\n var width = graph.get('width');\n var height = graph.get('height');\n var offsetX = this.get('offsetX') || 0;\n var offsetY = this.get('offsetY') || 0;\n var point = graph.getPointByClient(e.clientX, e.clientY);\n var fixToNode = this.get('fixToNode');\n var item = e.item;\n\n if (item.getType && item.getType() === 'node' && fixToNode && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isArray\"])(fixToNode) && fixToNode.length >= 2) {\n var itemBBox = item.getBBox();\n point = {\n x: itemBBox.minX + itemBBox.width * fixToNode[0],\n y: itemBBox.minY + itemBBox.height * fixToNode[1]\n };\n }\n\n var _a = graph.getCanvasByPoint(point.x, point.y),\n x = _a.x,\n y = _a.y;\n\n var graphContainer = graph.getContainer();\n var res = {\n x: x + graphContainer.offsetLeft + offsetX,\n y: y + graphContainer.offsetTop + offsetY\n }; // 先修改为 visible 方可正确计算 bbox\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n visibility: 'visible',\n display: 'unset'\n });\n var bbox = tooltip.getBoundingClientRect();\n\n if (x + bbox.width + offsetX > width) {\n res.x -= bbox.width + offsetX;\n }\n\n if (y + bbox.height + offsetY > height) {\n res.y -= bbox.height + offsetY;\n }\n\n Object(_antv_dom_util__WEBPACK_IMPORTED_MODULE_0__[\"modifyCSS\"])(tooltip, {\n left: \"\".concat(res.x, \"px\"),\n top: \"\".concat(res.y, \"px\")\n });\n };\n\n Tooltip.prototype.hide = function () {\n this.onMouseLeave();\n };\n\n Tooltip.prototype.destroy = function () {\n var tooltip = this.get('tooltip');\n\n if (tooltip) {\n var container = this.get('container');\n\n if (!container) {\n container = this.get('graph').get('container');\n }\n\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(container)) {\n container = document.getElementById(container);\n }\n\n container.removeChild(tooltip);\n }\n };\n\n return Tooltip;\n}(_base__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (Tooltip);\n\n//# sourceURL=webpack:///./node_modules/@antv/g6-plugin/es/tooltip/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SPEED_DIVISOR = 800;\nvar RadialNonoverlapForce = /** @class */ (function () {\n function RadialNonoverlapForce(params) {\n this.disp = [];\n this.positions = params.positions;\n this.adjMatrix = params.adjMatrix;\n this.focusID = params.focusID;\n this.radii = params.radii;\n this.iterations = params.iterations || 10;\n this.height = params.height || 10;\n this.width = params.width || 10;\n this.speed = params.speed || 100;\n this.gravity = params.gravity || 10;\n this.nodeSizeFunc = params.nodeSizeFunc;\n this.k = params.k || 5;\n this.strictRadial = params.strictRadial;\n this.nodes = params.nodes;\n }\n RadialNonoverlapForce.prototype.layout = function () {\n var self = this;\n var positions = self.positions;\n var disp = [];\n var iterations = self.iterations;\n var maxDisplace = self.width / 10;\n self.maxDisplace = maxDisplace;\n self.disp = disp;\n for (var i = 0; i < iterations; i++) {\n positions.forEach(function (_, k) {\n disp[k] = { x: 0, y: 0 };\n });\n // 给重叠的节点增加斥力\n self.getRepulsion();\n self.updatePositions();\n }\n return positions;\n };\n RadialNonoverlapForce.prototype.getRepulsion = function () {\n var self = this;\n var positions = self.positions;\n var nodes = self.nodes;\n var disp = self.disp;\n var k = self.k;\n var radii = self.radii || [];\n positions.forEach(function (v, i) {\n disp[i] = { x: 0, y: 0 };\n positions.forEach(function (u, j) {\n if (i === j) {\n return;\n }\n // v and u are not on the same circle, return\n if (radii[i] !== radii[j]) {\n return;\n }\n var vecx = v[0] - u[0];\n var vecy = v[1] - u[1];\n var vecLength = Math.sqrt(vecx * vecx + vecy * vecy);\n if (vecLength === 0) {\n vecLength = 1;\n var sign = i > j ? 1 : -1;\n vecx = 0.01 * sign;\n vecy = 0.01 * sign;\n }\n // these two nodes overlap\n if (vecLength < self.nodeSizeFunc(nodes[i]) / 2 + self.nodeSizeFunc(nodes[j]) / 2) {\n var common = (k * k) / vecLength;\n disp[i].x += (vecx / vecLength) * common;\n disp[i].y += (vecy / vecLength) * common;\n }\n });\n });\n };\n RadialNonoverlapForce.prototype.updatePositions = function () {\n var self = this;\n var positions = self.positions;\n var disp = self.disp;\n var speed = self.speed;\n var strictRadial = self.strictRadial;\n var f = self.focusID;\n var maxDisplace = self.maxDisplace || self.width / 10;\n if (strictRadial) {\n disp.forEach(function (di, i) {\n var vx = positions[i][0] - positions[f][0];\n var vy = positions[i][1] - positions[f][1];\n var vLength = Math.sqrt(vx * vx + vy * vy);\n var vpx = vy / vLength;\n var vpy = -vx / vLength;\n var diLength = Math.sqrt(di.x * di.x + di.y * di.y);\n var alpha = Math.acos((vpx * di.x + vpy * di.y) / diLength);\n if (alpha > Math.PI / 2) {\n alpha -= Math.PI / 2;\n vpx *= -1;\n vpy *= -1;\n }\n var tdispLength = Math.cos(alpha) * diLength;\n di.x = vpx * tdispLength;\n di.y = vpy * tdispLength;\n });\n }\n // move\n var radii = self.radii;\n positions.forEach(function (n, i) {\n if (i === f) {\n return;\n }\n var distLength = Math.sqrt(disp[i].x * disp[i].x + disp[i].y * disp[i].y);\n if (distLength > 0 && i !== f) {\n var limitedDist = Math.min(maxDisplace * (speed / SPEED_DIVISOR), distLength);\n n[0] += (disp[i].x / distLength) * limitedDist;\n n[1] += (disp[i].y / distLength) * limitedDist;\n if (strictRadial) {\n var vx = n[0] - positions[f][0];\n var vy = n[1] - positions[f][1];\n var nfDis = Math.sqrt(vx * vx + vy * vy);\n vx = (vx / nfDis) * radii[i];\n vy = (vy / nfDis) * radii[i];\n n[0] = positions[f][0] + vx;\n n[1] = positions[f][1] + vy;\n }\n }\n });\n };\n return RadialNonoverlapForce;\n}());\nexports.default = RadialNonoverlapForce;\n//# sourceMappingURL=radialNonoverlapForce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/radial/radialNonoverlapForce.js?"); /***/ }), -/***/ "./node_modules/@antv/g6/es/index.js": -/*!*******************************************!*\ - !*** ./node_modules/@antv/g6/es/index.js ***! - \*******************************************/ -/*! exports provided: G6GraphEvent, Node, Edge, Combo, Hull, registerNode, registerCombo, AbstractGraph, registerEdge, registerBehavior, AbstractLayout, AbstractEvent, BaseGlobal, Graph, TreeGraph, Util, Layout, TreeLayout, registerLayout, Global, Minimap, Grid, Bundling, Menu, Fisheye, Algorithm, ToolBar, Tooltip, TimeBar, ImageMinimap, EdgeFilterLens, SnapLine, Legend, Annotation, Arrow, Marker, Shape, default, version */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/random.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/random.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"version\", function() { return version; });\n/* harmony import */ var _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/g6-pc */ \"./node_modules/@antv/g6-pc/es/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"G6GraphEvent\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"G6GraphEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Node\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Node\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Edge\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Edge\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Combo\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Combo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Hull\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Hull\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerNode\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerNode\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerCombo\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerCombo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractGraph\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"AbstractGraph\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerEdge\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerEdge\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerBehavior\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerBehavior\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractLayout\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"AbstractLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractEvent\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"AbstractEvent\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"BaseGlobal\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"BaseGlobal\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Graph\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Graph\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeGraph\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"TreeGraph\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Util\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Util\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Layout\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Layout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TreeLayout\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"TreeLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerLayout\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"registerLayout\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Global\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Global\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Minimap\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Minimap\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Grid\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Grid\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Bundling\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Bundling\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Menu\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Menu\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Fisheye\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Fisheye\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Algorithm\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Algorithm\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ToolBar\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"ToolBar\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Tooltip\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Tooltip\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TimeBar\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"TimeBar\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"ImageMinimap\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"ImageMinimap\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EdgeFilterLens\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"EdgeFilterLens\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SnapLine\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"SnapLine\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Legend\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Legend\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Annotation\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Annotation\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Arrow\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Arrow\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Marker\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Marker\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Shape\", function() { return _antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"Shape\"]; });\n\n\n_antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"default\"].version = '4.7.3';\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_antv_g6_pc__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\nvar version = '4.7.3';\n\n//# sourceURL=webpack:///./node_modules/@antv/g6/es/index.js?"); +eval("\n/**\n * @fileOverview random layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RandomLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\n/**\n * 随机布局\n */\nvar RandomLayout = /** @class */ (function (_super) {\n __extends(RandomLayout, _super);\n function RandomLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 宽度 */\n _this.width = 300;\n /** 高度 */\n _this.height = 300;\n _this.nodes = [];\n _this.edges = [];\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n RandomLayout.prototype.getDefaultCfg = function () {\n return {\n center: [0, 0],\n width: 300,\n height: 300\n };\n };\n /**\n * 执行布局\n */\n RandomLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var layoutScale = 0.9;\n var center = self.center;\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (nodes) {\n nodes.forEach(function (node) {\n node.x = (Math.random() - 0.5) * layoutScale * self.width + center[0];\n node.y = (Math.random() - 0.5) * layoutScale * self.height + center[1];\n });\n }\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: this.edges\n };\n };\n RandomLayout.prototype.getType = function () {\n return \"random\";\n };\n return RandomLayout;\n}(base_1.Base));\nexports.RandomLayout = RandomLayout;\n//# sourceMappingURL=random.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/random.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/Graph/enum.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/Graph/enum.js ***! - \******************************************************/ -/*! exports provided: GraphEnum */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/layout/types.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/layout/lib/layout/types.js ***! + \*******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GraphEnum\", function() { return GraphEnum; });\nvar GraphEnum;\n\n(function (GraphEnum) {\n GraphEnum[\"DEFAULT_EDGE_NAME\"] = \"\\0\";\n GraphEnum[\"GRAPH_NODE\"] = \"\\0\";\n GraphEnum[\"EDGE_KEY_DELIM\"] = \"\\x01\";\n})(GraphEnum || (GraphEnum = {}));\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/Graph/enum.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/types.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/Graph/event.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/Graph/event.js ***! - \*******************************************************/ -/*! exports provided: GraphWithEvent */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/registy/index.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/layout/lib/registy/index.js ***! + \********************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GraphWithEvent\", function() { return GraphWithEvent; });\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! . */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _get() { if (typeof Reflect !== \"undefined\" && Reflect.get) { _get = Reflect.get; } else { _get = function _get(target, property, receiver) { var base = _superPropBase(target, property); if (!base) return; var desc = Object.getOwnPropertyDescriptor(base, property); if (desc.get) { return desc.get.call(arguments.length < 3 ? target : receiver); } return desc.value; }; } return _get.apply(this, arguments); }\n\nfunction _superPropBase(object, property) { while (!Object.prototype.hasOwnProperty.call(object, property)) { object = _getPrototypeOf(object); if (object === null) break; } return object; }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\n\nvar GraphWithEvent = /*#__PURE__*/function (_Graph) {\n _inherits(GraphWithEvent, _Graph);\n\n var _super = _createSuper(GraphWithEvent);\n\n function GraphWithEvent() {\n var _this;\n\n _classCallCheck(this, GraphWithEvent);\n\n for (var _len = arguments.length, args = new Array(_len), _key = 0; _key < _len; _key++) {\n args[_key] = arguments[_key];\n }\n\n _this = _super.call.apply(_super, [this].concat(args));\n _this.eventPool = {};\n return _this;\n }\n\n _createClass(GraphWithEvent, [{\n key: \"appendEvent\",\n value:\n /**\n * @description Add an event listener.\n * @description.zh-CN 添加事件监听器。\n */\n function appendEvent(type, callback) {\n if (!this.eventPool[type]) {\n this.eventPool[type] = [];\n }\n\n this.eventPool[type].push(callback);\n }\n /**\n * @description remove an event listener.\n * @description.zh-CN 移除事件监听器。\n */\n\n }, {\n key: \"removeEvent\",\n value: function removeEvent(type, callback) {\n if (!this.eventPool[type]) {\n return;\n }\n\n var index = this.eventPool[type].indexOf(callback);\n\n if (index > -1) {\n this.eventPool[type].splice(index, 1);\n }\n }\n /**\n * @description trigger an event.\n * @description.zh-CN 触发事件。\n */\n\n }, {\n key: \"emitEvent\",\n value: function emitEvent(type) {\n for (var _len2 = arguments.length, args = new Array(_len2 > 1 ? _len2 - 1 : 0), _key2 = 1; _key2 < _len2; _key2++) {\n args[_key2 - 1] = arguments[_key2];\n }\n\n if (!this.eventPool[type]) {\n return;\n }\n\n this.eventPool[type].forEach(function (callback) {\n callback.apply(void 0, args);\n });\n }\n }, {\n key: \"setNode\",\n value: function setNode(node, value) {\n _get(_getPrototypeOf(GraphWithEvent.prototype), \"setNode\", this).call(this, node, value);\n\n this.emitEvent('nodeAdd', node, value);\n return this;\n }\n }, {\n key: \"removeNode\",\n value: function removeNode(node) {\n _get(_getPrototypeOf(GraphWithEvent.prototype), \"removeNode\", this).call(this, node);\n\n this.emitEvent('nodeRemove', node);\n return this;\n }\n }, {\n key: \"setEdge\",\n value: function setEdge(v_, w_, value, name) {\n _get(_getPrototypeOf(GraphWithEvent.prototype), \"setEdge\", this).call(this, v_, w_, value, name);\n\n this.emitEvent('edgeAdd', v_, w_, value, name);\n return this;\n }\n }, {\n key: \"removeEdge\",\n value: function removeEdge(v_, w_, name) {\n _get(_getPrototypeOf(GraphWithEvent.prototype), \"removeEdge\", this).call(this, v_, w_, name);\n\n this.emitEvent('edgeRemove', v_, w_, name);\n return this;\n }\n }]);\n\n return GraphWithEvent;\n}(___WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/Graph/event.js?"); +eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getLayoutByName = exports.unRegisterLayout = exports.registerLayout = void 0;\nvar base_1 = __webpack_require__(/*! ../layout/base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar map = new Map();\nvar registerLayout = function (name, layoutOverride) {\n if (map.get(name)) {\n console.warn(\"The layout with the name \".concat(name, \" exists already, it will be overridden\"));\n }\n if ((0, util_1.isObject)(layoutOverride)) {\n // tslint:disable-next-line: max-classes-per-file\n var GLayout = /** @class */ (function (_super) {\n __extends(GLayout, _super);\n function GLayout(cfg) {\n var _this = this;\n var _a;\n _this = _super.call(this) || this;\n var self = _this;\n var props = {};\n var defaultCfg = Object.assign({}, self.getDefaultCfg(), ((_a = layoutOverride.getDefaultCfg) === null || _a === void 0 ? void 0 : _a.call(layoutOverride)) || {});\n Object.assign(props, defaultCfg, layoutOverride, cfg);\n Object.keys(props).forEach(function (key) {\n var value = props[key];\n self[key] = value;\n });\n return _this;\n }\n return GLayout;\n }(base_1.Base));\n map.set(name, GLayout);\n }\n else {\n map.set(name, layoutOverride);\n }\n return map.get(name);\n};\nexports.registerLayout = registerLayout;\nvar unRegisterLayout = function (name) {\n if (map.has(name)) {\n map.delete(name);\n }\n};\nexports.unRegisterLayout = unRegisterLayout;\nvar getLayoutByName = function (name) {\n if (map.has(name)) {\n return map.get(name);\n }\n return null;\n};\nexports.getLayoutByName = getLayoutByName;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/registy/index.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/Graph/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/Graph/index.js ***! - \*******************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/util/array.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/layout/lib/util/array.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Graph; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/graphlib/es/util.js\");\n/* harmony import */ var _enum__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./enum */ \"./node_modules/@antv/graphlib/es/Graph/enum.js\");\n/* harmony import */ var _toJSON__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./toJSON */ \"./node_modules/@antv/graphlib/es/Graph/toJSON.js\");\nfunction ownKeys(object, enumerableOnly) { var keys = Object.keys(object); if (Object.getOwnPropertySymbols) { var symbols = Object.getOwnPropertySymbols(object); enumerableOnly && (symbols = symbols.filter(function (sym) { return Object.getOwnPropertyDescriptor(object, sym).enumerable; })), keys.push.apply(keys, symbols); } return keys; }\n\nfunction _objectSpread(target) { for (var i = 1; i < arguments.length; i++) { var source = null != arguments[i] ? arguments[i] : {}; i % 2 ? ownKeys(Object(source), !0).forEach(function (key) { _defineProperty(target, key, source[key]); }) : Object.getOwnPropertyDescriptors ? Object.defineProperties(target, Object.getOwnPropertyDescriptors(source)) : ownKeys(Object(source)).forEach(function (key) { Object.defineProperty(target, key, Object.getOwnPropertyDescriptor(source, key)); }); } return target; }\n\nfunction _defineProperty(obj, key, value) { if (key in obj) { Object.defineProperty(obj, key, { value: value, enumerable: true, configurable: true, writable: true }); } else { obj[key] = value; } return obj; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\n\n\n\n\nvar defaultOption = {\n compound: false,\n multigraph: false,\n directed: true\n};\n\nvar Graph = /*#__PURE__*/function () {\n // Graph option or basic props\n\n /**\n * @description Label for this graph itself\n * @description.zh-CN 图本身的标签(label)\n * @default undefined\n */\n\n /**\n * @description Number of nodes in the graph\n * @description.zh-CN 节点的数量\n * @default 0\n */\n\n /**\n * @description Number of edges in the graph\n * @description.zh-CN 节点的数量\n * @default 0\n */\n\n /**\n * @description return node label with its id\n * @description.zh-CN 返回节点的默认的标签\n */\n\n /**\n * @description return edge label with its id\n * @description.zh-CN 返回边的默认的标签\n */\n function Graph() {\n var _this = this;\n\n var options = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : {};\n\n _classCallCheck(this, Graph);\n\n this.directed = true;\n this.multigraph = false;\n this.compound = false;\n this.GRAPH_NODE = _enum__WEBPACK_IMPORTED_MODULE_1__[\"GraphEnum\"].GRAPH_NODE;\n this.label = void 0;\n this.nodeCountNum = 0;\n this.edgeCountNum = 0;\n\n this.defaultNodeLabelFn = function () {\n return undefined;\n };\n\n this.defaultEdgeLabelFn = function () {\n return undefined;\n };\n\n this.parentMap = void 0;\n this.childrenMap = void 0;\n this.nodesLabelMap = new Map();\n this.inEdgesMap = new Map();\n this.outEdgesMap = new Map();\n this.predecessorsMap = new Map();\n this.successorsMap = new Map();\n this.edgesMap = new Map();\n this.edgesLabelsMap = new Map();\n\n this.isDirected = function () {\n return _this.directed;\n };\n\n this.isMultigraph = function () {\n return _this.multigraph;\n };\n\n this.isCompound = function () {\n return _this.compound;\n };\n\n this.setGraph = function (label) {\n _this.label = label;\n return _this;\n };\n\n this.graph = function () {\n return _this.label;\n };\n\n this.setDefaultNodeLabel = function (newDefault) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(newDefault)) {\n _this.defaultNodeLabelFn = newDefault;\n } else {\n _this.defaultNodeLabelFn = function () {\n return newDefault;\n };\n }\n\n return _this;\n };\n\n this.nodeCount = function () {\n return _this.nodeCountNum;\n };\n\n this.node = function (n) {\n return _this.nodesLabelMap.get(n);\n };\n\n this.nodes = function () {\n return Array.from(_this.nodesLabelMap.keys());\n };\n\n this.sources = function () {\n return _this.nodes().filter(function (n) {\n var _this$inEdgesMap$get;\n\n return !((_this$inEdgesMap$get = _this.inEdgesMap.get(n)) === null || _this$inEdgesMap$get === void 0 ? void 0 : _this$inEdgesMap$get.size);\n });\n };\n\n this.sinks = function () {\n return _this.nodes().filter(function (n) {\n var _this$outEdgesMap$get;\n\n return !((_this$outEdgesMap$get = _this.outEdgesMap.get(n)) === null || _this$outEdgesMap$get === void 0 ? void 0 : _this$outEdgesMap$get.size);\n });\n };\n\n this.setNodes = function (nodes, value) {\n nodes.map(function (node) {\n return _this.setNode(node, value);\n });\n return _this;\n };\n\n this.hasNode = function (node) {\n return _this.nodesLabelMap.has(node);\n };\n\n this.checkCompound = function () {\n if (!_this.isCompound()) {\n throw new Error('Cannot construct parent-children relations in a non-compound graph');\n }\n };\n\n this.parent = function (node) {\n if (_this.isCompound()) {\n var _this$parentMap;\n\n var parent = (_this$parentMap = _this.parentMap) === null || _this$parentMap === void 0 ? void 0 : _this$parentMap.get(node);\n\n if (parent !== _this.GRAPH_NODE) {\n return parent;\n }\n }\n };\n\n this.removeFromParentsChildList = function (node) {\n var targetParent = _this.parentMap.get(node);\n\n _this.childrenMap.get(targetParent).delete(node);\n };\n\n this.setParent = function (node, parent) {\n var _this$parentMap2, _this$childrenMap;\n\n _this.checkCompound();\n\n var realParent = parent === undefined ? _this.GRAPH_NODE : parent;\n\n var checkNode = _this.parent(realParent);\n\n while (checkNode) {\n if (node === checkNode) {\n throw new Error('Setting ' + parent + ' as parent of ' + node + ' would create a cycle');\n }\n\n checkNode = _this.parent(checkNode);\n }\n\n if (parent) {\n _this.setNode(parent);\n }\n\n _this.setNode(node);\n\n _this.removeFromParentsChildList(node);\n\n (_this$parentMap2 = _this.parentMap) === null || _this$parentMap2 === void 0 ? void 0 : _this$parentMap2.set(node, realParent);\n\n var realParentChilren = _this.childrenMap.get(realParent);\n\n realParentChilren.set(node, true);\n (_this$childrenMap = _this.childrenMap) === null || _this$childrenMap === void 0 ? void 0 : _this$childrenMap.set(realParent, realParentChilren);\n return _this;\n };\n\n this.children = function (node) {\n var targetNode = node === undefined ? _this.GRAPH_NODE : node;\n\n if (_this.isCompound()) {\n var _this$childrenMap2;\n\n var target = (_this$childrenMap2 = _this.childrenMap) === null || _this$childrenMap2 === void 0 ? void 0 : _this$childrenMap2.get(targetNode);\n\n if (target) {\n return Array.from(target.keys());\n }\n\n return undefined;\n }\n\n if (targetNode === _this.GRAPH_NODE) {\n return _this.nodes();\n }\n\n if (node && _this.hasNode(node)) {\n return [];\n }\n };\n\n this.predecessors = function (node) {\n var preds = _this.predecessorsMap.get(node);\n\n return preds ? Array.from(preds.keys()) : undefined;\n };\n\n this.successors = function (node) {\n var succs = _this.successorsMap.get(node);\n\n return succs ? Array.from(succs.keys()) : undefined;\n };\n\n this.neighbors = function (node) {\n var _this$predecessors;\n\n if (!_this.hasNode(node)) {\n return undefined;\n }\n\n return Array.from(new Set((_this$predecessors = _this.predecessors(node)) === null || _this$predecessors === void 0 ? void 0 : _this$predecessors.concat(_this.successors(node))));\n };\n\n this.isLeaf = function (node) {\n var _this$neighbors;\n\n if (_this.isDirected()) {\n var _this$successors;\n\n return !((_this$successors = _this.successors(node)) === null || _this$successors === void 0 ? void 0 : _this$successors.length);\n }\n\n return !((_this$neighbors = _this.neighbors(node)) === null || _this$neighbors === void 0 ? void 0 : _this$neighbors.length);\n };\n\n this.filterNodes = function (filter) {\n var directed = _this.directed,\n multigraph = _this.multigraph,\n compound = _this.compound;\n var copyGraph = new Graph({\n directed: directed,\n multigraph: multigraph,\n compound: compound\n });\n copyGraph.setGraph(_this.graph());\n\n _this.nodes().forEach(function (n) {\n if (filter(n)) {\n copyGraph.setNode(n, _this.node(n));\n }\n });\n\n _this.edges().forEach(function (edgeObj) {\n if (copyGraph.hasNode(edgeObj.v) && copyGraph.hasNode(edgeObj.w)) {\n copyGraph.setEdgeObj(edgeObj, _this.edge(edgeObj));\n }\n });\n\n if (compound) {\n var findParent = function findParent(node) {\n var parent = _this.parent(node);\n\n while (parent !== undefined && !copyGraph.hasNode(parent)) {\n parent = _this.parent(parent);\n }\n\n return parent;\n };\n\n copyGraph.nodes().forEach(function (node) {\n copyGraph.setParent(node, findParent(node));\n });\n }\n\n return copyGraph;\n };\n\n this.setDefaultEdgeLabel = function (newDefault) {\n if (Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(newDefault)) {\n _this.defaultEdgeLabelFn = newDefault;\n } else {\n _this.defaultEdgeLabelFn = function () {\n return newDefault;\n };\n }\n\n return _this;\n };\n\n this.edgeCount = function () {\n return _this.edgeCountNum;\n };\n\n this.setEdgeObj = function (edgeObj, value) {\n return _this.setEdge(edgeObj.v, edgeObj.w, value, edgeObj.name);\n };\n\n this.setPath = function (edges, value) {\n edges.reduce(function (v, w) {\n _this.setEdge(v, w, value);\n\n return w;\n });\n return _this;\n };\n\n this.edgeFromArgs = function (v, w, name) {\n return _this.edge({\n v: v,\n w: w,\n name: name\n });\n };\n\n this.edge = function (edgeObj) {\n return _this.edgesLabelsMap.get(Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeObjToId\"])(_this.isDirected(), edgeObj));\n };\n\n this.hasEdge = function (v, w, name) {\n return _this.edgesLabelsMap.has(Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeObjToId\"])(_this.isDirected(), {\n v: v,\n w: w,\n name: name\n }));\n };\n\n this.removeEdgeObj = function (_ref) {\n var v = _ref.v,\n w = _ref.w,\n name = _ref.name;\n return _this.removeEdge(v, w, name);\n };\n\n this.edges = function () {\n return Array.from(_this.edgesMap.values());\n };\n\n this.inEdges = function (v, u) {\n var inV = _this.inEdgesMap.get(v);\n\n if (inV) {\n return Array.from(inV.values()).filter(function (e) {\n return !u || e.v === u;\n });\n }\n\n return undefined;\n };\n\n this.outEdges = function (w, u) {\n var outW = _this.outEdgesMap.get(w);\n\n if (outW) {\n return Array.from(outW.values()).filter(function (e) {\n return !u || e.w === u;\n });\n }\n\n return undefined;\n };\n\n this.nodeEdges = function (v, w) {\n var _this$inEdges;\n\n if (!_this.hasNode(v)) {\n return undefined;\n }\n\n return (_this$inEdges = _this.inEdges(v, w)) === null || _this$inEdges === void 0 ? void 0 : _this$inEdges.concat(_this.outEdges(v, w));\n };\n\n this.toJSON = function () {\n return Object(_toJSON__WEBPACK_IMPORTED_MODULE_2__[\"write\"])(_this);\n };\n\n this.nodeInDegree = function (node) {\n var inEdges = _this.inEdgesMap.get(node);\n\n if (inEdges) {\n return inEdges.size;\n }\n\n return 0;\n };\n\n this.nodeOutDegree = function (node) {\n var outEdges = _this.outEdgesMap.get(node);\n\n if (outEdges) {\n return outEdges.size;\n }\n\n return 0;\n };\n\n this.nodeDegree = function (node) {\n return _this.nodeInDegree(node) + _this.nodeOutDegree(node);\n };\n\n this.source = function (edge) {\n return edge.v;\n };\n\n this.target = function (edge) {\n return edge.w;\n };\n\n var resultOptions = _objectSpread(_objectSpread({}, defaultOption), options);\n\n this.compound = resultOptions.compound;\n this.directed = resultOptions.directed;\n this.multigraph = resultOptions.multigraph;\n\n if (this.compound) {\n this.parentMap = new Map();\n this.childrenMap = new Map();\n }\n } // Map for graph\n\n /**\n * @description Map for parent relationship\n * @description.zh-CN 父子关系的映射\n */\n\n\n _createClass(Graph, [{\n key: \"setNode\",\n value:\n /**\n * @description Set Node label in graph if node not in graph then create it\n * @description.zh-CN 设置节点的label,如果这个节点不在图中,则在图中创建这个节点\n * @param node\n * @param value\n * @returns\n */\n function setNode(node, value) {\n var nodesLabelMap = this.nodesLabelMap,\n defaultNodeLabelFn = this.defaultNodeLabelFn,\n isCompound = this.isCompound,\n parentMap = this.parentMap,\n childrenMap = this.childrenMap,\n inEdgesMap = this.inEdgesMap,\n outEdgesMap = this.outEdgesMap,\n predecessorsMap = this.predecessorsMap,\n successorsMap = this.successorsMap; // 如果节点不在图中,则创建节点\n\n if (nodesLabelMap.has(node)) {\n if (value !== undefined) {\n nodesLabelMap.set(node, value);\n }\n\n return this;\n }\n\n nodesLabelMap.set(node, value || defaultNodeLabelFn(node)); // 如果是复合图,则创建节点的子节点\n\n if (isCompound()) {\n var _childrenMap$get;\n\n parentMap === null || parentMap === void 0 ? void 0 : parentMap.set(node, this.GRAPH_NODE);\n childrenMap === null || childrenMap === void 0 ? void 0 : childrenMap.set(node, new Map());\n\n if (!(childrenMap === null || childrenMap === void 0 ? void 0 : childrenMap.has(this.GRAPH_NODE))) {\n childrenMap === null || childrenMap === void 0 ? void 0 : childrenMap.set(this.GRAPH_NODE, new Map());\n }\n\n childrenMap === null || childrenMap === void 0 ? void 0 : (_childrenMap$get = childrenMap.get(this.GRAPH_NODE)) === null || _childrenMap$get === void 0 ? void 0 : _childrenMap$get.set(node, true);\n }\n\n [inEdgesMap, outEdgesMap, predecessorsMap, successorsMap].forEach(function (map) {\n return map.set(node, new Map());\n });\n this.nodeCountNum += 1;\n return this;\n }\n /**\n * @description Set nodes or add nodes in batch\n * @description.zh-CN 批量设置或者创建节点\n * @param nodes\n * @param value\n * @returns\n */\n\n }, {\n key: \"removeNode\",\n value:\n /**\n * @description Remove node from graph\n * @description.zh-CN 将节点从图中移除\n * @param node\n * @returns\n */\n function removeNode(node) {\n var _this2 = this;\n\n if (this.hasNode(node)) {\n var cleanEdge = function cleanEdge(edgeObj) {\n _this2.removeEdge(edgeObj.v, edgeObj.w, edgeObj.name);\n };\n\n var inEdgesMap = this.inEdgesMap,\n outEdgesMap = this.outEdgesMap,\n predecessorsMap = this.predecessorsMap,\n successorsMap = this.successorsMap,\n nodesLabelMap = this.nodesLabelMap;\n\n if (this.isCompound()) {\n var _this$parentMap3, _this$children, _this$childrenMap3;\n\n this.removeFromParentsChildList(node);\n (_this$parentMap3 = this.parentMap) === null || _this$parentMap3 === void 0 ? void 0 : _this$parentMap3.delete(node);\n (_this$children = this.children(node)) === null || _this$children === void 0 ? void 0 : _this$children.forEach(function (n) {\n return _this2.setParent(n);\n });\n (_this$childrenMap3 = this.childrenMap) === null || _this$childrenMap3 === void 0 ? void 0 : _this$childrenMap3.delete(node);\n }\n\n var inE = inEdgesMap.get(node);\n var outE = outEdgesMap.get(node);\n Array.from(inE.values()).forEach(function (edge) {\n return cleanEdge(edge);\n });\n Array.from(outE.values()).forEach(function (edge) {\n return cleanEdge(edge);\n });\n nodesLabelMap.delete(node);\n inEdgesMap.delete(node);\n outEdgesMap.delete(node);\n predecessorsMap.delete(node);\n successorsMap.delete(node);\n this.nodeCountNum -= 1;\n }\n\n return this;\n }\n /**\n * @description Set function that generate default label for edge, if param is non-function value then default label will always be this value;\n * @description.zh-CN 设置默认获取边Label的方法,如果传入不是函数的,那么默认label 的值只会是传入值\n * @param newDefault\n * @returns\n */\n\n }, {\n key: \"setEdge\",\n value:\n /**\n * @description set edge value, if nodes or edges not exsit then add to graph\n * @description.zh-CN 设置边的属性,如果边或节点不存在,那么将他们加入这个图\n * @param v\n * @param w\n * @param value\n * @param name\n * @returns\n */\n function setEdge(v_, w_, value, name) {\n var _this$inEdgesMap$get2, _this$outEdgesMap$get2;\n\n var edgeObj = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeArgsToObj\"])(this.isDirected(), v_, w_, name);\n var edgeId = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeObjToId\"])(this.isDirected(), edgeObj);\n var v = edgeObj.v,\n w = edgeObj.w;\n\n if (this.edgesLabelsMap.has(edgeId)) {\n this.edgesLabelsMap.set(edgeId, value);\n return this;\n }\n\n if (name !== undefined && !this.isMultigraph()) {\n throw new Error('Cannot set a named edge when isMultigraph = false');\n }\n\n this.setNode(v);\n this.setNode(w);\n this.edgesLabelsMap.set(edgeId, value || this.defaultEdgeLabelFn(v, w, name));\n Object.freeze(edgeObj);\n this.edgesMap.set(edgeId, edgeObj);\n var preds = this.predecessorsMap.get(w);\n var succs = this.successorsMap.get(v);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"incrementOrInitEntry\"])(preds, v);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"incrementOrInitEntry\"])(succs, w);\n (_this$inEdgesMap$get2 = this.inEdgesMap.get(w)) === null || _this$inEdgesMap$get2 === void 0 ? void 0 : _this$inEdgesMap$get2.set(edgeId, edgeObj);\n (_this$outEdgesMap$get2 = this.outEdgesMap.get(v)) === null || _this$outEdgesMap$get2 === void 0 ? void 0 : _this$outEdgesMap$get2.set(edgeId, edgeObj);\n this.edgeCountNum += 1;\n return this;\n }\n }, {\n key: \"removeEdge\",\n value:\n /**\n * @description remove a specific edge\n * @description.zh-CN 删除一条边\n * @param v\n * @param w\n * @param name\n * @returns\n */\n function removeEdge(v_, w_, name) {\n var edgeId = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeArgsToId\"])(this.isDirected(), v_, w_, name);\n var edgeObj = this.edgesMap.get(edgeId);\n\n if (edgeObj) {\n var _edgeArgsToObj = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"edgeArgsToObj\"])(this.isDirected(), v_, w_, name),\n v = _edgeArgsToObj.v,\n w = _edgeArgsToObj.w;\n\n this.edgesLabelsMap.delete(edgeId);\n this.edgesMap.delete(edgeId);\n var preds = this.predecessorsMap.get(w);\n var succs = this.successorsMap.get(v);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"decrementOrRemoveEntry\"])(preds, v);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"decrementOrRemoveEntry\"])(succs, w);\n this.inEdgesMap.get(w).delete(edgeId);\n this.outEdgesMap.get(v).delete(edgeId);\n this.edgeCountNum -= 1;\n }\n\n return this;\n }\n /**\n * @description remove a specific edge by edge object\n * @description.zh-CN 删除一条边\n */\n\n }]);\n\n return Graph;\n}();\n\nGraph.fromJSON = _toJSON__WEBPACK_IMPORTED_MODULE_2__[\"read\"];\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/Graph/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isArray = void 0;\nexports.isArray = Array.isArray;\n//# sourceMappingURL=array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/array.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/Graph/toJSON.js": +/***/ "./node_modules/@antv/layout/lib/util/function.js": /*!********************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/Graph/toJSON.js ***! + !*** ./node_modules/@antv/layout/lib/util/function.js ***! \********************************************************/ -/*! exports provided: write, read */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"write\", function() { return write; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"read\", function() { return read; });\n/* harmony import */ var ___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! . */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\n\n/**\n * @description Convert a graph's node to JSON.\n * @description.zh-CN 转换图的节点为 JSON。\n * @param graph\n * @returns\n */\n\nvar nodeToJSON = function nodeToJSON(graph) {\n return graph.nodes().map(function (n) {\n var value = graph.node(n);\n var parent = graph.parent(n);\n var node = {\n id: n,\n value: value,\n parent: parent\n };\n\n if (node.value === undefined) {\n delete node.value;\n }\n\n if (node.parent === undefined) {\n delete node.parent;\n }\n\n return node;\n });\n};\n/**\n * @description Convert all graph's edges to JSON.\n * @description.zh-CN 转换图的所有边为 JSON。\n * @param graph\n * @returns\n */\n\n\nvar edgeToJSON = function edgeToJSON(graph) {\n return graph.edges().map(function (edge) {\n var value = graph.edge(edge);\n var e = {\n v: edge.v,\n w: edge.w,\n value: value,\n name: edge.name\n };\n\n if (e.name === undefined) {\n delete e.name;\n }\n\n if (e.value === undefined) {\n delete e.value;\n }\n\n return e;\n });\n};\n/**\n * @description Convert a graph to JSON.\n * @description.zh-CN 转换图为 JSON。\n * @param graph\n * @returns\n */\n\n\nvar write = function write(graph) {\n var json = {\n options: {\n directed: graph.isDirected(),\n multigraph: graph.isMultigraph(),\n compound: graph.isCompound()\n },\n nodes: nodeToJSON(graph),\n edges: edgeToJSON(graph),\n value: graph.graph()\n };\n\n if (json.value === undefined) {\n delete json.value;\n }\n\n return json;\n};\n/**\n * @description read a graph from JSON.\n * @description.zh-CN 从 JSON 读取图。\n * @param json\n * @returns\n */\n\nvar read = function read(json) {\n var graph = new ___WEBPACK_IMPORTED_MODULE_0__[\"default\"](json.options);\n\n if (json.value !== undefined) {\n graph.setGraph(json.value);\n }\n\n json.nodes.forEach(function (entry) {\n graph.setNode(entry.id, entry.value);\n\n if (entry.parent) {\n graph.setParent(entry.id, entry.parent);\n }\n });\n json.edges.forEach(function (entry) {\n graph.setEdge(entry.v, entry.w, entry.value, entry.name);\n });\n return graph;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/Graph/toJSON.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFuncByUnknownType = exports.getFunc = exports.isFunction = void 0;\nvar _1 = __webpack_require__(/*! . */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar number_1 = __webpack_require__(/*! ./number */ \"./node_modules/@antv/layout/lib/util/number.js\");\nvar isFunction = function (val) {\n return typeof val === 'function';\n};\nexports.isFunction = isFunction;\nvar getFunc = function (value, defaultValue, func) {\n var resultFunc;\n if (func) {\n resultFunc = func;\n }\n else if ((0, number_1.isNumber)(value)) {\n resultFunc = function () { return value; };\n }\n else {\n resultFunc = function () { return defaultValue; };\n }\n return resultFunc;\n};\nexports.getFunc = getFunc;\nvar getFuncByUnknownType = function (defaultValue, value, resultIsNumber) {\n if (resultIsNumber === void 0) { resultIsNumber = true; }\n if (!value && value !== 0) {\n return function (d) {\n if (d.size) {\n if ((0, _1.isArray)(d.size))\n return d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n if ((0, _1.isObject)(d.size))\n return d.size.width > d.size.height ? d.size.width : d.size.height;\n return d.size;\n }\n return defaultValue;\n };\n }\n if ((0, exports.isFunction)(value)) {\n return value;\n }\n if ((0, number_1.isNumber)(value)) {\n return function () { return value; };\n }\n if ((0, _1.isArray)(value)) {\n return function () {\n if (resultIsNumber) {\n var max = Math.max.apply(Math, value);\n return isNaN(max) ? defaultValue : max;\n }\n return value;\n };\n }\n if ((0, _1.isObject)(value)) {\n return function () {\n if (resultIsNumber) {\n var max = Math.max(value.width, value.height);\n return isNaN(max) ? defaultValue : max;\n }\n return [value.width, value.height];\n };\n }\n return function () { return defaultValue; };\n};\nexports.getFuncByUnknownType = getFuncByUnknownType;\n//# sourceMappingURL=function.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/function.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js ***! - \*************************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/util/gpu.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/layout/lib/util/gpu.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return PriorityQueue; });\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\n// A PriorityQueue is a queue that can be sorted by priority.\nvar PriorityQueue = /*#__PURE__*/_createClass(function PriorityQueue() {\n var _this = this;\n\n _classCallCheck(this, PriorityQueue);\n\n this.arr = [];\n this.keyIndice = new Map();\n\n this.size = function () {\n return _this.arr.length;\n };\n\n this.keys = function () {\n return _this.arr.map(function (e) {\n return e.key;\n });\n };\n\n this.has = function (key) {\n return _this.keyIndice.has(key);\n };\n\n this.priority = function (key) {\n var index = _this.keyIndice.get(key);\n\n if (index !== undefined) {\n return _this.arr[index].priority;\n }\n };\n\n this.swap = function (i, j) {\n var arr = _this.arr,\n keyIndice = _this.keyIndice;\n var _ref = [arr[i], arr[j]],\n originI = _ref[0],\n originJ = _ref[1];\n arr[i] = originJ;\n arr[j] = originI;\n keyIndice.set(originI.key, j);\n keyIndice.set(originJ.key, i);\n };\n\n this.innerDecrease = function (index) {\n var arr = _this.arr;\n var priority = arr[index].priority;\n var parent;\n var i = index;\n\n while (i !== 0) {\n var _arr$parent;\n\n parent = i >> 1;\n\n if (((_arr$parent = arr[parent]) === null || _arr$parent === void 0 ? void 0 : _arr$parent.priority) < priority) {\n break;\n }\n\n _this.swap(i, parent);\n\n i = parent;\n }\n };\n\n this.heapify = function (i) {\n var arr = _this.arr;\n var l = i << 1;\n var r = l + 1;\n var largest = i;\n\n if (l < arr.length) {\n largest = arr[l].priority < arr[largest].priority ? l : largest;\n\n if (r < arr.length) {\n largest = arr[r].priority < arr[largest].priority ? r : largest;\n }\n\n if (largest !== i) {\n _this.swap(i, largest);\n\n _this.heapify(largest);\n }\n }\n };\n\n this.min = function () {\n if (_this.size() === 0) {\n throw new Error('Queue underflow');\n }\n\n return _this.arr[0].key;\n };\n\n this.add = function (key, priority) {\n var keyIndice = _this.keyIndice,\n arr = _this.arr; // if the key is already in the queue, update the priority\n\n if (!keyIndice.has(key)) {\n var index = arr.length;\n keyIndice.set(key, index);\n arr.push({\n key: key,\n priority: priority\n });\n\n _this.innerDecrease(index);\n\n return true;\n }\n\n return false;\n };\n\n this.removeMin = function () {\n _this.swap(0, _this.arr.length - 1);\n\n var min = _this.arr.pop();\n\n _this.keyIndice.delete(min.key);\n\n _this.heapify(0);\n\n return min.key;\n };\n\n this.decrease = function (key, priority) {\n if (!_this.has(key)) {\n throw new Error(\"There's no key named \".concat(key));\n } // there must be an index\n\n\n var index = _this.keyIndice.get(key);\n\n if (priority > _this.arr[index].priority) {\n throw new Error(\"New priority is greater than current priority.Key: \".concat(key, \" Old: + \").concat(_this.arr[index].priority, \" New: \").concat(priority));\n }\n\n _this.arr[index].priority = priority;\n\n _this.innerDecrease(index);\n };\n});\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.arrayToTextureData = exports.attributesToTextureData = exports.buildTextureDataWithTwoEdgeAttr = exports.buildTextureData = exports.proccessToFunc = void 0;\nvar _1 = __webpack_require__(/*! ./ */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar math_1 = __webpack_require__(/*! ./math */ \"./node_modules/@antv/layout/lib/util/math.js\");\n/**\n * 将 number | Function 类型的参数转换为 return number 的 Function\n * @param {number | Function} value 需要被转换的值\n * @param {number} defaultV 返回函数的默认返回值\n * @return {Function} 转换后的函数\n */\nvar proccessToFunc = function (value, defaultV) {\n var func;\n if (!value) {\n func = function () {\n return defaultV || 1;\n };\n }\n else if ((0, _1.isNumber)(value)) {\n func = function () {\n return value;\n };\n }\n else {\n func = value;\n }\n return func;\n};\nexports.proccessToFunc = proccessToFunc;\n/**\n * 将节点和边数据转换为 GPU 可读的数组。并返回 maxEdgePerVetex,每个节点上最多的边数\n * @param {NodeConfig[]} nodes 需要被转换的值\n * @param {EdgeConfig[]} edges 返回函数的默认返回值\n * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n */\nvar buildTextureData = function (nodes, edges) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n var source = (0, math_1.getEdgeTerminal)(e, 'source');\n var target = (0, math_1.getEdgeTerminal)(e, 'target');\n if (!isNaN(mapIdPos[source]) && !isNaN(mapIdPos[target])) {\n nodeDict[mapIdPos[source]].push(mapIdPos[target]);\n nodeDict[mapIdPos[target]].push(mapIdPos[source]);\n }\n }\n var maxEdgePerVetex = 0;\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i];\n var len = dests.length;\n dataArray[i * 4 + 2] = offset;\n dataArray[i * 4 + 3] = len;\n maxEdgePerVetex = Math.max(maxEdgePerVetex, len);\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n }\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n return {\n maxEdgePerVetex: maxEdgePerVetex,\n array: new Float32Array(dataArray),\n };\n};\nexports.buildTextureData = buildTextureData;\n/**\n* 将节点和边数据转换为 GPU 可读的数组,每条边带有一个属性。并返回 maxEdgePerVetex,每个节点上最多的边数\n* @param {NodeConfig[]} nodes 节点数组\n* @param {EdgeConfig[]} edges 边数组\n* @param {Function} attrs 读取边属性的函数\n* @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n*/\n// export const buildTextureDataWithOneEdgeAttr = (nodes: OutNode[], edges: Edge[], attrs: Function): {\n// array: Float32Array,\n// maxEdgePerVetex: number\n// } => {\n// const dataArray = [];\n// const nodeDict: any = [];\n// const mapIdPos: IndexMap = {};\n// let i = 0;\n// for (i = 0; i < nodes.length; i++) {\n// const n = nodes[i];\n// mapIdPos[n.id] = i;\n// dataArray.push(n.x);\n// dataArray.push(n.y);\n// dataArray.push(0);\n// dataArray.push(0);\n// nodeDict.push([]);\n// }\n// for (i = 0; i < edges.length; i++) {\n// const e = edges[i];\n// nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]);\n// nodeDict[mapIdPos[e.source]].push(attrs(e)); // 理想边长,后续可以改成每条边不同\n// nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]);\n// nodeDict[mapIdPos[e.target]].push(attrs(e)); // 理想边长,后续可以改成每条边不同\n// }\n// let maxEdgePerVetex = 0;\n// for (i = 0; i < nodes.length; i++) {\n// const offset: number = dataArray.length;\n// const dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长……\n// const len = dests.length;\n// dataArray[i * 4 + 2] = offset;\n// dataArray[i * 4 + 3] = len / 2; // 第四位存储与该节点相关的所有节点个数\n// maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 2);\n// for (let j = 0; j < len; ++j) {\n// const dest = dests[j];\n// dataArray.push(+dest);\n// }\n// }\n// // 不是 4 的倍数,填充 0\n// while (dataArray.length % 4 !== 0) {\n// dataArray.push(0);\n// }\n// return {\n// array: new Float32Array(dataArray),\n// maxEdgePerVetex\n// }\n// }\n/**\n* 将节点和边数据转换为 GPU 可读的数组,每条边带有一个以上属性。并返回 maxEdgePerVetex,每个节点上最多的边数\n* @param {NodeConfig[]} nodes 节点数组\n* @param {EdgeConfig[]} edges 边数组\n* @param {Function} attrs 读取边属性的函数\n* @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n*/\nvar buildTextureDataWithTwoEdgeAttr = function (nodes, edges, attrs1, attrs2) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n var source = (0, math_1.getEdgeTerminal)(e, 'source');\n var target = (0, math_1.getEdgeTerminal)(e, 'target');\n nodeDict[mapIdPos[source]].push(mapIdPos[target]);\n nodeDict[mapIdPos[source]].push(attrs1(e));\n nodeDict[mapIdPos[source]].push(attrs2(e));\n nodeDict[mapIdPos[source]].push(0);\n nodeDict[mapIdPos[target]].push(mapIdPos[source]);\n nodeDict[mapIdPos[target]].push(attrs1(e));\n nodeDict[mapIdPos[target]].push(attrs2(e));\n nodeDict[mapIdPos[target]].push(0);\n }\n var maxEdgePerVetex = 0;\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长……\n var len = dests.length;\n // dataArray[i * 4 + 2] = offset;\n // dataArray[i * 4 + 3] = len / 4; // 第四位存储与该节点相关的所有节点个数\n // pack offset & length into float32: offset 20bit, length 12bit\n dataArray[i * 4 + 2] = offset + 1048576 * len / 4;\n dataArray[i * 4 + 3] = 0; // 第四位存储与上一次的距离差值\n maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 4);\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n }\n // 不是 4 的倍数,填充 0\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n return {\n maxEdgePerVetex: maxEdgePerVetex,\n array: new Float32Array(dataArray),\n };\n};\nexports.buildTextureDataWithTwoEdgeAttr = buildTextureDataWithTwoEdgeAttr;\n/**\n* transform the extended attributes of nodes or edges to a texture array\n* @param {string[]} attributeNames attributes' name to be read from items and put into output array\n* @param {ModelConfig[]} items the items to be read\n* @return {Float32Array} the attributes' value array to be read by GPU\n*/\nvar attributesToTextureData = function (attributeNames, items) {\n var dataArray = [];\n var attributeNum = attributeNames.length;\n var attributteStringMap = {};\n items.forEach(function (item) {\n attributeNames.forEach(function (name, i) {\n if (attributteStringMap[item[name]] === undefined) {\n attributteStringMap[item[name]] = Object.keys(attributteStringMap).length;\n }\n dataArray.push(attributteStringMap[item[name]]);\n // insure each node's attributes take inter number of grids\n if (i === attributeNum - 1) {\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n }\n });\n });\n return {\n array: new Float32Array(dataArray),\n count: Object.keys(attributteStringMap).length\n };\n};\nexports.attributesToTextureData = attributesToTextureData;\n/**\n* transform the number array format of extended attributes of nodes or edges to a texture array\n* @param {string[]} attributeNames attributes' name to be read from items and put into output array\n* @return {Float32Array} the attributes' value array to be read by GPU\n*/\nvar arrayToTextureData = function (valueArrays) {\n var dataArray = [];\n var attributeNum = valueArrays.length;\n var itemNum = valueArrays[0].length;\n var _loop_1 = function (j) {\n valueArrays.forEach(function (valueArray, i) {\n dataArray.push(valueArray[j]);\n // insure each node's attributes take inter number of grids\n if (i === attributeNum - 1) {\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n }\n });\n };\n for (var j = 0; j < itemNum; j++) {\n _loop_1(j);\n }\n return new Float32Array(dataArray);\n};\nexports.arrayToTextureData = arrayToTextureData;\n//# sourceMappingURL=gpu.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/gpu.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/components.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/components.js ***! - \****************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/util/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/layout/lib/util/index.js ***! + \*****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar components = function components(graph) {\n var visited = new Set();\n var resultComponents = [];\n var nodes = graph.nodes();\n nodes.forEach(function (n) {\n var componentsArr = [];\n var waitingList = [n];\n\n while (waitingList.length > 0) {\n var node = waitingList.pop();\n\n if (!visited.has(node)) {\n var _graph$successors, _graph$predecessors;\n\n visited.add(node);\n componentsArr.push(node);\n (_graph$successors = graph.successors(node)) === null || _graph$successors === void 0 ? void 0 : _graph$successors.forEach(function (n) {\n return waitingList.push(n);\n });\n (_graph$predecessors = graph.predecessors(node)) === null || _graph$predecessors === void 0 ? void 0 : _graph$predecessors.forEach(function (n) {\n return waitingList.push(n);\n });\n }\n }\n\n if (componentsArr.length) {\n resultComponents.push(componentsArr);\n }\n });\n return resultComponents;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (components);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/components.js?"); +eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(__webpack_require__(/*! ./string */ \"./node_modules/@antv/layout/lib/util/string.js\"), exports);\n__exportStar(__webpack_require__(/*! ./array */ \"./node_modules/@antv/layout/lib/util/array.js\"), exports);\n__exportStar(__webpack_require__(/*! ./number */ \"./node_modules/@antv/layout/lib/util/number.js\"), exports);\n__exportStar(__webpack_require__(/*! ./math */ \"./node_modules/@antv/layout/lib/util/math.js\"), exports);\n__exportStar(__webpack_require__(/*! ./object */ \"./node_modules/@antv/layout/lib/util/object.js\"), exports);\n__exportStar(__webpack_require__(/*! ./function */ \"./node_modules/@antv/layout/lib/util/function.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/index.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/dfs.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/dfs.js ***! - \*********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { - -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @description DFS traversal.\n * @description.zh-CN DFS 遍历。\n */\nvar doDFS = function doDFS(graph, node, postorder, visited, navigator, result) {\n if (!visited.includes(node)) {\n visited.push(node);\n\n if (!postorder) {\n result.push(node);\n }\n\n navigator(node).forEach(function (n) {\n return doDFS(graph, n, postorder, visited, navigator, result);\n });\n\n if (postorder) {\n result.push(node);\n }\n }\n};\n/**\n * @description DFS traversal.\n * @description.zh-CN DFS 遍历。\n */\n\n\nvar dfs = function dfs(graph, node, order) {\n var nodes = Array.isArray(node) ? node : [node];\n\n var navigator = function navigator(n) {\n return graph.isDirected() ? graph.successors(n) : graph.neighbors(n);\n };\n\n var results = [];\n var visited = [];\n nodes.forEach(function (node) {\n if (!graph.hasNode(node)) {\n throw new Error('Graph does not have node: ' + node);\n } else {\n doDFS(graph, node, order === 'post', visited, navigator, results);\n }\n });\n return results;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dfs);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/dfs.js?"); +/***/ "./node_modules/@antv/layout/lib/util/math.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/layout/lib/util/math.js ***! + \****************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { + +"use strict"; +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCoreNodeAndRelativeLeafNodes = exports.getAvgNodePosition = exports.getLayoutBBox = exports.traverseTreeUp = exports.scaleMatrix = exports.getAdjMatrix = exports.floydWarshall = exports.getDegreeMap = exports.getDegree = exports.getEdgeTerminal = void 0;\nvar array_1 = __webpack_require__(/*! ./array */ \"./node_modules/@antv/layout/lib/util/array.js\");\nvar number_1 = __webpack_require__(/*! ./number */ \"./node_modules/@antv/layout/lib/util/number.js\");\nvar object_1 = __webpack_require__(/*! ./object */ \"./node_modules/@antv/layout/lib/util/object.js\");\nvar getEdgeTerminal = function (edge, type) {\n var terminal = edge[type];\n if ((0, object_1.isObject)(terminal)) {\n return terminal.cell;\n }\n return terminal;\n};\nexports.getEdgeTerminal = getEdgeTerminal;\nvar getDegree = function (n, nodeIdxMap, edges) {\n var degrees = [];\n for (var i = 0; i < n; i++) {\n degrees[i] = {\n in: 0,\n out: 0,\n all: 0\n };\n }\n if (!edges)\n return degrees;\n edges.forEach(function (e) {\n var source = (0, exports.getEdgeTerminal)(e, 'source');\n var target = (0, exports.getEdgeTerminal)(e, 'target');\n if (source && degrees[nodeIdxMap[source]]) {\n degrees[nodeIdxMap[source]].out += 1;\n degrees[nodeIdxMap[source]].all += 1;\n }\n if (target && degrees[nodeIdxMap[target]]) {\n degrees[nodeIdxMap[target]].in += 1;\n degrees[nodeIdxMap[target]].all += 1;\n }\n });\n return degrees;\n};\nexports.getDegree = getDegree;\nvar getDegreeMap = function (nodes, edges) {\n var degreesMap = {};\n nodes.forEach(function (node) {\n degreesMap[node.id] = {\n in: 0,\n out: 0,\n all: 0\n };\n });\n if (!edges)\n return degreesMap;\n edges.forEach(function (e) {\n var source = (0, exports.getEdgeTerminal)(e, 'source');\n var target = (0, exports.getEdgeTerminal)(e, 'target');\n if (source) {\n degreesMap[source].out += 1;\n degreesMap[source].all += 1;\n }\n if (target) {\n degreesMap[target].in += 1;\n degreesMap[target].all += 1;\n }\n });\n return degreesMap;\n};\nexports.getDegreeMap = getDegreeMap;\nvar floydWarshall = function (adjMatrix) {\n // initialize\n var dist = [];\n var size = adjMatrix.length;\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n }\n else if (adjMatrix[i][j] === 0 || !adjMatrix[i][j]) {\n dist[i][j] = Infinity;\n }\n else {\n dist[i][j] = adjMatrix[i][j];\n }\n }\n }\n // floyd\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n return dist;\n};\nexports.floydWarshall = floydWarshall;\nvar getAdjMatrix = function (data, directed) {\n var nodes = data.nodes, edges = data.edges;\n var matrix = [];\n // map node with index in data.nodes\n var nodeMap = {};\n if (!nodes) {\n throw new Error('invalid nodes data!');\n }\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n edges === null || edges === void 0 ? void 0 : edges.forEach(function (e) {\n var source = (0, exports.getEdgeTerminal)(e, 'source');\n var target = (0, exports.getEdgeTerminal)(e, 'target');\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n if (sIndex === undefined || tIndex === undefined)\n return;\n matrix[sIndex][tIndex] = 1;\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n return matrix;\n};\nexports.getAdjMatrix = getAdjMatrix;\n/**\n * scale matrix\n * @param matrix [ [], [], [] ]\n * @param ratio\n */\nvar scaleMatrix = function (matrix, ratio) {\n var result = [];\n matrix.forEach(function (row) {\n var newRow = [];\n row.forEach(function (v) {\n newRow.push(v * ratio);\n });\n result.push(newRow);\n });\n return result;\n};\nexports.scaleMatrix = scaleMatrix;\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseUp = function (data, fn) {\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverseUp(data.children[i], fn))\n return;\n }\n }\n if (!fn(data)) {\n return false;\n }\n return true;\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseTreeUp = function (data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n traverseUp(data, fn);\n};\nexports.traverseTreeUp = traverseTreeUp;\n/**\n * calculate the bounding box for the nodes according to their x, y, and size\n * @param nodes nodes in the layout\n * @returns\n */\nvar getLayoutBBox = function (nodes) {\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n nodes.forEach(function (node) {\n var size = node.size;\n if ((0, array_1.isArray)(size)) {\n if (size.length === 1)\n size = [size[0], size[0]];\n }\n else if ((0, number_1.isNumber)(size)) {\n size = [size, size];\n }\n else if (size === undefined || isNaN(size)) {\n size = [30, 30];\n }\n var halfSize = [size[0] / 2, size[1] / 2];\n var left = node.x - halfSize[0];\n var right = node.x + halfSize[0];\n var top = node.y - halfSize[1];\n var bottom = node.y + halfSize[1];\n if (minX > left)\n minX = left;\n if (minY > top)\n minY = top;\n if (maxX < right)\n maxX = right;\n if (maxY < bottom)\n maxY = bottom;\n });\n return { minX: minX, minY: minY, maxX: maxX, maxY: maxY };\n};\nexports.getLayoutBBox = getLayoutBBox;\n/**\n * 获取节点集合的平均位置信息\n * @param nodes 节点集合\n * @returns 平局内置\n */\nvar getAvgNodePosition = function (nodes) {\n var totalNodes = { x: 0, y: 0 };\n nodes.forEach(function (node) {\n totalNodes.x += node.x || 0;\n totalNodes.y += node.y || 0;\n });\n // 获取均值向量\n var length = nodes.length || 1;\n return {\n x: totalNodes.x / length,\n y: totalNodes.y / length,\n };\n};\nexports.getAvgNodePosition = getAvgNodePosition;\n// 找出指定节点关联的边的起点或终点\nvar getCoreNode = function (type, node, edges) {\n var _a, _b;\n if (type === 'source') {\n return (((_a = edges === null || edges === void 0 ? void 0 : edges.find(function (edge) { return edge.target === node.id; })) === null || _a === void 0 ? void 0 : _a.source) || {});\n }\n return (((_b = edges === null || edges === void 0 ? void 0 : edges.find(function (edge) { return edge.source === node.id; })) === null || _b === void 0 ? void 0 : _b.target) || {});\n};\n// 找出指定节点为起点或终点的所有一度叶子节点\nvar getRelativeNodeIds = function (type, coreNode, edges) {\n var relativeNodes = [];\n switch (type) {\n case 'source':\n relativeNodes = edges === null || edges === void 0 ? void 0 : edges.filter(function (edge) { return edge.source === coreNode.id; }).map(function (edge) { return edge.target; });\n break;\n case 'target':\n relativeNodes = edges === null || edges === void 0 ? void 0 : edges.filter(function (edge) { return edge.target === coreNode.id; }).map(function (edge) { return edge.source; });\n break;\n case 'both':\n relativeNodes = edges === null || edges === void 0 ? void 0 : edges.filter(function (edge) { return edge.source === coreNode.id; }).map(function (edge) { return edge.target; }).concat(edges === null || edges === void 0 ? void 0 : edges.filter(function (edge) { return edge.target === coreNode.id; }).map(function (edge) { return edge.source; }));\n break;\n default:\n break;\n }\n // 去重\n var set = new Set(relativeNodes);\n return Array.from(set);\n};\n// 找出同类型的节点\nvar getSameTypeNodes = function (type, nodeClusterBy, node, relativeNodes, degreesMap) {\n // @ts-ignore\n var typeName = node[nodeClusterBy] || '';\n // @ts-ignore\n var sameTypeNodes = (relativeNodes === null || relativeNodes === void 0 ? void 0 : relativeNodes.filter(function (item) { return item[nodeClusterBy] === typeName; })) || [];\n if (type === 'leaf') {\n sameTypeNodes = sameTypeNodes.filter(function (node) { var _a, _b; return ((_a = degreesMap[node.id]) === null || _a === void 0 ? void 0 : _a.in) === 0 || ((_b = degreesMap[node.id]) === null || _b === void 0 ? void 0 : _b.out) === 0; });\n }\n return sameTypeNodes;\n};\n// 找出与指定节点关联的边的起点或终点出发的所有一度叶子节点\nvar getCoreNodeAndRelativeLeafNodes = function (type, node, edges, nodeClusterBy, degreesMap, nodeMap) {\n var _a = degreesMap[node.id], inDegree = _a.in, outDegree = _a.out;\n var coreNode = node;\n var relativeLeafNodes = [];\n if (inDegree === 0) {\n // 如果为没有出边的叶子节点,则找出与它关联的边的起点出发的所有一度节点\n coreNode = getCoreNode('source', node, edges);\n relativeLeafNodes = getRelativeNodeIds('both', coreNode, edges).map(function (nodeId) { return nodeMap[nodeId]; });\n }\n else if (outDegree === 0) {\n // 如果为没有入边边的叶子节点,则找出与它关联的边的起点出发的所有一度节点\n coreNode = getCoreNode('target', node, edges);\n relativeLeafNodes = getRelativeNodeIds('both', coreNode, edges).map(function (nodeId) { return nodeMap[nodeId]; });\n }\n relativeLeafNodes = relativeLeafNodes.filter(function (node) { return degreesMap[node.id] && (degreesMap[node.id].in === 0 || degreesMap[node.id].out === 0); });\n var sameTypeLeafNodes = getSameTypeNodes(type, nodeClusterBy, node, relativeLeafNodes, degreesMap);\n return { coreNode: coreNode, relativeLeafNodes: relativeLeafNodes, sameTypeLeafNodes: sameTypeLeafNodes };\n};\nexports.getCoreNodeAndRelativeLeafNodes = getCoreNodeAndRelativeLeafNodes;\n//# sourceMappingURL=math.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/math.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/dijkstra-all.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/dijkstra-all.js ***! - \******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/util/number.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/layout/lib/util/number.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dijkstra__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/graphlib/es/algorithm/dijkstra.js\");\n\n\nvar dijkstraAll = function dijkstraAll(graph, weightFn, edgeFn) {\n var map = {};\n graph.nodes().forEach(function (node) {\n map[String(node)] = Object(_dijkstra__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph, node, weightFn, edgeFn);\n return map;\n });\n return map;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dijkstraAll);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/dijkstra-all.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toNumber = exports.isNaN = exports.isNumber = void 0;\nvar isNumber = function (val) { return typeof val === 'number'; };\nexports.isNumber = isNumber;\nvar isNaN = function (num) { return Number.isNaN(Number(num)); };\nexports.isNaN = isNaN;\nvar toNumber = function (val) {\n var n = parseFloat(val);\n return (0, exports.isNaN)(n) ? val : n;\n};\nexports.toNumber = toNumber;\n//# sourceMappingURL=number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/number.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/dijkstra.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/dijkstra.js ***! - \**************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/util/object.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/layout/lib/util/object.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _PriorityQueue__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./PriorityQueue */ \"./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n\n\nvar DEFAULT_WEIGHT_FUNC = function DEFAULT_WEIGHT_FUNC() {\n return 1;\n};\n/**\n * @description Dijkstra's algorithm for single-source shortest paths.\n * @description https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm\n * @description.zh-CN Dijkstra 算法用于单源最短路径。\n */\n\n\nvar dijkstra = function dijkstra(graph, source, weightFn, edgeFn) {\n return runDijkstra(graph, source, weightFn || DEFAULT_WEIGHT_FUNC, edgeFn || function (v) {\n return graph.outEdges(v);\n });\n};\n/**\n * @description Dijkstra's algorithm for single-source shortest paths.\n * @description https://en.wikipedia.org/wiki/Dijkstra%27s_algorithm\n * @description.zh-CN Dijkstra 算法用于单源最短路径。\n */\n\n\nvar runDijkstra = function runDijkstra(graph, source, weightFn, edgeFn) {\n var results = new Map();\n var pq = new _PriorityQueue__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n var v;\n var vEntry;\n\n var updateNeighbors = function updateNeighbors(edge) {\n var w = edge.v !== v ? edge.v : edge.w;\n var wEntry = results.get(w);\n var weight = weightFn(edge);\n var distance = vEntry.distance + weight;\n\n if (weight < 0) {\n throw new Error('dijkstra does not allow negative edge weights. ' + 'Bad edge: ' + edge + ' Weight: ' + weight);\n } // If there is already a shorter path to w, ignore this edge.\n\n\n if (distance < wEntry.distance) {\n wEntry.distance = distance;\n wEntry.predecessor = v;\n pq.decrease(w, distance);\n }\n };\n\n graph.nodes().forEach(function (v) {\n var distance = v === source ? 0 : Number.POSITIVE_INFINITY;\n results.set(v, {\n distance: distance\n });\n pq.add(v, distance);\n });\n\n while (pq.size() > 0) {\n v = pq.removeMin();\n vEntry = results.get(v);\n\n if (vEntry && vEntry.distance === Number.POSITIVE_INFINITY) {\n break;\n }\n\n edgeFn(v).forEach(updateNeighbors);\n }\n\n var obj = {};\n Array.from(results.entries()).forEach(function (_ref) {\n var _ref2 = _slicedToArray(_ref, 2),\n node = _ref2[0],\n e = _ref2[1];\n\n obj[String(node)] = e;\n return obj;\n });\n return obj;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dijkstra);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/dijkstra.js?"); +eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clone = exports.isObject = void 0;\nvar isObject = function (val) {\n return val !== null && typeof val === 'object';\n};\nexports.isObject = isObject;\nvar clone = function (target) {\n if (target === null) {\n return target;\n }\n if (target instanceof Date) {\n return new Date(target.getTime());\n }\n if (target instanceof Array) {\n var cp_1 = [];\n target.forEach(function (v) {\n cp_1.push(v);\n });\n return cp_1.map(function (n) { return (0, exports.clone)(n); });\n }\n if (typeof target === 'object' && Object.keys(target).length) {\n var cp_2 = __assign({}, target);\n Object.keys(cp_2).forEach(function (k) {\n cp_2[k] = (0, exports.clone)(cp_2[k]);\n });\n return cp_2;\n }\n return target;\n};\nexports.clone = clone;\n//# sourceMappingURL=object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/object.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/find-cycles.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/find-cycles.js ***! - \*****************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/lib/util/string.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/layout/lib/util/string.js ***! + \******************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _tarjan__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./tarjan */ \"./node_modules/@antv/graphlib/es/algorithm/tarjan.js\");\n\n\nvar findCycles = function findCycles(graph) {\n return Object(_tarjan__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph).filter(function (cmpt) {\n return cmpt.length > 1 || cmpt.length === 1 && graph.hasEdge(cmpt[0], cmpt[0]);\n });\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (findCycles);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/find-cycles.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.camelize = exports.isString = void 0;\nvar isString = function (val) { return typeof val === 'string'; };\nexports.isString = isString;\nvar cacheStringFunction = function (fn) {\n var cache = Object.create(null);\n return (function (str) {\n var hit = cache[str];\n return hit || (cache[str] = fn(str));\n });\n};\nvar camelizeRE = /-(\\w)/g;\nexports.camelize = cacheStringFunction(function (str) {\n return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });\n});\n// export const capitalize = cacheStringFunction(\n// (str: string) => str.charAt(0).toUpperCase() + str.slice(1),\n// )\n//# sourceMappingURL=string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/string.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/floyd-warshall.js": -/*!********************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/floyd-warshall.js ***! - \********************************************************************/ -/*! exports provided: floydWarshall, default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/color/arr2rgb.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/color/arr2rgb.js ***! + \********************************************************************************/ +/*! exports provided: toHex, arr2rgb */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floydWarshall\", function() { return floydWarshall; });\nvar DEFAULT_WEIGHT_FUNC = function DEFAULT_WEIGHT_FUNC() {\n return 1;\n};\n\nfunction floydWarshall(graph, weightFn, edgeFn) {\n return runFloydWarshall(graph, weightFn || DEFAULT_WEIGHT_FUNC, edgeFn || function (v) {\n return graph.outEdges(v);\n });\n}\n\nfunction runFloydWarshall(graph, weightFn, edgeFn) {\n var results = {};\n var nodes = graph.nodes();\n nodes.forEach(function (node) {\n var v = String(node);\n results[v] = {};\n results[v][v] = {\n distance: 0\n };\n nodes.forEach(function (w) {\n if (node !== w) {\n results[v][String(w)] = {\n distance: Number.POSITIVE_INFINITY\n };\n }\n });\n edgeFn(node).forEach(function (edge) {\n var w = edge.v === node ? edge.w : edge.v;\n var d = weightFn(edge);\n results[v][String(w)] = {\n distance: d,\n predecessor: node\n };\n });\n });\n nodes.forEach(function (nodek) {\n var k = String(nodek);\n var rowK = results[k];\n nodes.forEach(function (nodei) {\n var i = String(nodei);\n var rowI = results[i];\n nodes.forEach(function (nodej) {\n var j = String(nodej);\n var ik = rowI[k];\n var kj = rowK[j];\n var ij = rowI[j];\n var altDistance = ik.distance + kj.distance;\n\n if (altDistance < ij.distance) {\n ij.distance = altDistance;\n ij.predecessor = kj.predecessor;\n }\n });\n });\n });\n return results;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (floydWarshall);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/floyd-warshall.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toHex\", function() { return toHex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arr2rgb\", function() { return arr2rgb; });\n/**\n * 将数值从 0-255 转换成 16 进制字符串\n * @param value\n * @returns\n */\nfunction toHex(value) {\n var x16Value = Math.round(value).toString(16);\n return x16Value.length === 1 ? \"0\" + x16Value : x16Value;\n}\n/**\n * 数组转换成颜色\n * @param arr\n * @returns\n */\nfunction arr2rgb(arr) {\n return \"#\" + toHex(arr[0]) + toHex(arr[1]) + toHex(arr[2]);\n}\n//# sourceMappingURL=arr2rgb.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/color/arr2rgb.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/index.js ***! - \***********************************************************/ -/*! exports provided: components, dfs, dijkstra, dijkstraAll, findCycles, tarjan, isAcyclic, postorder, preorder, prim, topsort, floydWarshall */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/color/gradient.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/color/gradient.js ***! + \*********************************************************************************/ +/*! exports provided: gradient */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _prim__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./prim */ \"./node_modules/@antv/graphlib/es/algorithm/prim.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"prim\", function() { return _prim__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _components__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./components */ \"./node_modules/@antv/graphlib/es/algorithm/components.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"components\", function() { return _components__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _dfs__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dfs */ \"./node_modules/@antv/graphlib/es/algorithm/dfs.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"dfs\", function() { return _dfs__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _dijkstra__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./dijkstra */ \"./node_modules/@antv/graphlib/es/algorithm/dijkstra.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"dijkstra\", function() { return _dijkstra__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _dijkstra_all__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./dijkstra-all */ \"./node_modules/@antv/graphlib/es/algorithm/dijkstra-all.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"dijkstraAll\", function() { return _dijkstra_all__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _find_cycles__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./find-cycles */ \"./node_modules/@antv/graphlib/es/algorithm/find-cycles.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"findCycles\", function() { return _find_cycles__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _is_acyclic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./is-acyclic */ \"./node_modules/@antv/graphlib/es/algorithm/is-acyclic.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isAcyclic\", function() { return _is_acyclic__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _postorder__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./postorder */ \"./node_modules/@antv/graphlib/es/algorithm/postorder.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"postorder\", function() { return _postorder__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _preorder__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./preorder */ \"./node_modules/@antv/graphlib/es/algorithm/preorder.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"preorder\", function() { return _preorder__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _tarjan__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./tarjan */ \"./node_modules/@antv/graphlib/es/algorithm/tarjan.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"tarjan\", function() { return _tarjan__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _topsort__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./topsort */ \"./node_modules/@antv/graphlib/es/algorithm/topsort.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"topsort\", function() { return _topsort__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _floyd_warshall__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./floyd-warshall */ \"./node_modules/@antv/graphlib/es/algorithm/floyd-warshall.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"floydWarshall\", function() { return _floyd_warshall__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gradient\", function() { return gradient; });\n/* harmony import */ var _rgb2arr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rgb2arr */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/rgb2arr.js\");\n/* harmony import */ var _arr2rgb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./arr2rgb */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/arr2rgb.js\");\n/* harmony import */ var _torgb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./torgb */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/torgb.js\");\n\n\n\n/**\n * 获取颜色之间的插值\n * @param start\n * @param end\n * @param percent\n * @param index\n * @returns\n */\nfunction getValue(start, end, percent, index) {\n return start[index] + (end[index] - start[index]) * percent;\n}\n/**\n * 计算颜色\n * @param points\n * @param percent\n * @returns\n */\nfunction calColor(points, percent) {\n var fixedPercent = isNaN(Number(percent)) || percent < 0 ? 0 : percent > 1 ? 1 : Number(percent);\n var steps = points.length - 1;\n var step = Math.floor(steps * fixedPercent);\n var left = steps * fixedPercent - step;\n var start = points[step];\n var end = step === steps ? start : points[step + 1];\n return Object(_arr2rgb__WEBPACK_IMPORTED_MODULE_1__[\"arr2rgb\"])([getValue(start, end, left, 0), getValue(start, end, left, 1), getValue(start, end, left, 2)]);\n}\n/**\n * 获取渐变函数\n * @param colors 多个颜色\n * @return 颜色值\n */\nfunction gradient(colors) {\n var colorArray = typeof colors === 'string' ? colors.split('-') : colors;\n var points = colorArray.map(function (color) {\n return Object(_rgb2arr__WEBPACK_IMPORTED_MODULE_0__[\"rgb2arr\"])(color.indexOf('#') === -1 ? Object(_torgb__WEBPACK_IMPORTED_MODULE_2__[\"toRGB\"])(color) : color);\n });\n // 返回一个函数\n return function (percent) {\n return calColor(points, percent);\n };\n}\n//# sourceMappingURL=gradient.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/color/gradient.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/is-acyclic.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/is-acyclic.js ***! - \****************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/color/index.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/color/index.js ***! + \******************************************************************************/ +/*! exports provided: rgb2arr, gradient, toRGB, toCSSGradient */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _topsort__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./topsort */ \"./node_modules/@antv/graphlib/es/algorithm/topsort.js\");\n\n\nvar isAcyclic = function isAcyclic(graph) {\n try {\n Object(_topsort__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph);\n } catch (e) {\n if (e instanceof _topsort__WEBPACK_IMPORTED_MODULE_0__[\"CycleException\"]) {\n return false;\n }\n\n throw e;\n }\n\n return true;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (isAcyclic);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/is-acyclic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _rgb2arr__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./rgb2arr */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/rgb2arr.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"rgb2arr\", function() { return _rgb2arr__WEBPACK_IMPORTED_MODULE_0__[\"rgb2arr\"]; });\n\n/* harmony import */ var _gradient__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./gradient */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/gradient.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"gradient\", function() { return _gradient__WEBPACK_IMPORTED_MODULE_1__[\"gradient\"]; });\n\n/* harmony import */ var _torgb__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./torgb */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/torgb.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toRGB\", function() { return _torgb__WEBPACK_IMPORTED_MODULE_2__[\"toRGB\"]; });\n\n/* harmony import */ var _tocssgradient__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./tocssgradient */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/tocssgradient.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toCSSGradient\", function() { return _tocssgradient__WEBPACK_IMPORTED_MODULE_3__[\"toCSSGradient\"]; });\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/color/index.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/postorder.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/postorder.js ***! - \***************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/color/rgb2arr.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/color/rgb2arr.js ***! + \********************************************************************************/ +/*! exports provided: rgb2arr */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dfs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs */ \"./node_modules/@antv/graphlib/es/algorithm/dfs.js\");\n\n\nvar postorder = function postorder(graph, nodes) {\n return Object(_dfs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph, nodes, 'post');\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (postorder);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/postorder.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb2arr\", function() { return rgb2arr; });\n/**\n * rgb 颜色转换成数组\n * @param str\n * @returns\n */\nfunction rgb2arr(str) {\n return [parseInt(str.substr(1, 2), 16), parseInt(str.substr(3, 2), 16), parseInt(str.substr(5, 2), 16)];\n}\n//# sourceMappingURL=rgb2arr.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/color/rgb2arr.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/preorder.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/preorder.js ***! - \**************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/color/tocssgradient.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/color/tocssgradient.js ***! + \**************************************************************************************/ +/*! exports provided: toCSSGradient */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dfs__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dfs */ \"./node_modules/@antv/graphlib/es/algorithm/dfs.js\");\n\n\nvar preorder = function preorder(graph, nodes) {\n return Object(_dfs__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(graph, nodes, 'pre');\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (preorder);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/preorder.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toCSSGradient\", function() { return toCSSGradient; });\nvar regexLG = /^l\\s*\\(\\s*([\\d.]+)\\s*\\)\\s*(.*)/i;\nvar regexRG = /^r\\s*\\(\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*,\\s*([\\d.]+)\\s*\\)\\s*(.*)/i;\nvar regexColorStop = /[\\d.]+:(#[^\\s]+|[^)]+\\))/gi;\nfunction isGradientColor(val) {\n return /^[r,R,L,l]{1}[\\s]*\\(/.test(val);\n}\nfunction toCSSGradient(gradientColor) {\n if (isGradientColor(gradientColor)) {\n var cssColor_1;\n var steps = void 0;\n if (gradientColor[0] === 'l') {\n // 线性渐变\n var arr = regexLG.exec(gradientColor);\n var angle = +arr[1] + 90; // css 和 g 的渐变起始角度不同\n steps = arr[2];\n cssColor_1 = \"linear-gradient(\" + angle + \"deg, \";\n }\n else if (gradientColor[0] === 'r') {\n // 径向渐变\n cssColor_1 = 'radial-gradient(';\n var arr = regexRG.exec(gradientColor);\n steps = arr[4];\n }\n var colorStops_1 = steps.match(regexColorStop);\n colorStops_1.forEach(function (item, index) {\n var itemArr = item.split(':');\n cssColor_1 += itemArr[1] + \" \" + Number(itemArr[0]) * 100 + \"%\";\n if (index !== colorStops_1.length - 1) {\n cssColor_1 += ', ';\n }\n });\n cssColor_1 += ')';\n return cssColor_1;\n }\n return gradientColor;\n}\n//# sourceMappingURL=tocssgradient.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/color/tocssgradient.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/prim.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/prim.js ***! - \**********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/color/torgb.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/color/torgb.js ***! + \******************************************************************************/ +/*! exports provided: toRGB */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Graph */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\n/* harmony import */ var _PriorityQueue__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./PriorityQueue */ \"./node_modules/@antv/graphlib/es/algorithm/PriorityQueue/index.js\");\n\n\n\nvar prim = function prim(graph, weightFn) {\n var result = new _Graph__WEBPACK_IMPORTED_MODULE_0__[\"default\"]();\n var parents = new Map();\n var pq = new _PriorityQueue__WEBPACK_IMPORTED_MODULE_1__[\"default\"]();\n var v;\n\n function updateNeighbors(edge) {\n var w = edge.v === v ? edge.w : edge.v;\n var pri = pq.priority(w);\n\n if (pri !== undefined) {\n var edgeWeight = weightFn(edge);\n\n if (edgeWeight < pri) {\n parents.set(w, v);\n pq.decrease(w, edgeWeight);\n }\n }\n }\n\n if (graph.nodeCount() === 0) {\n return result;\n }\n\n graph.nodes().forEach(function (node) {\n pq.add(node, Number.POSITIVE_INFINITY);\n result.setNode(node);\n }); // Start from an arbitrary node\n\n pq.decrease(graph.nodes()[0], 0);\n var init = false;\n\n while (pq.size() > 0) {\n var _graph$nodeEdges;\n\n v = pq.removeMin();\n\n if (parents.has(v)) {\n result.setEdge(v, parents.get(v));\n } else if (init) {\n throw new Error('Input graph is not connected: ' + graph.graph());\n } else {\n init = true;\n }\n\n (_graph$nodeEdges = graph.nodeEdges(v)) === null || _graph$nodeEdges === void 0 ? void 0 : _graph$nodeEdges.forEach(updateNeighbors);\n }\n\n return result;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (prim);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/prim.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRGB\", function() { return toRGB; });\n/* harmony import */ var _lodash__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../lodash */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index.js\");\n/* harmony import */ var _arr2rgb__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./arr2rgb */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/arr2rgb.js\");\n\n\nvar RGB_REG = /rgba?\\(([\\s.,0-9]+)\\)/;\n/**\n * 创建辅助 tag 取颜色\n * @returns\n */\nfunction createTmp() {\n var i = document.createElement('i');\n i.title = 'Web Colour Picker';\n i.style.display = 'none';\n document.body.appendChild(i);\n return i;\n}\nvar iEl;\n/**\n * 将颜色转换到 rgb 的格式\n * @param {color} color 颜色\n * @return 将颜色转换到 '#ffffff' 的格式\n */\nfunction toRGBString(color) {\n // 如果已经是 rgb的格式\n if (color[0] === '#' && color.length === 7) {\n return color;\n }\n if (!iEl) {\n // 防止防止在页头报错\n iEl = createTmp();\n }\n iEl.style.color = color;\n var rst = document.defaultView.getComputedStyle(iEl, '').getPropertyValue('color');\n var matches = RGB_REG.exec(rst);\n var cArray = matches[1].split(/\\s*,\\s*/).map(function (s) { return Number(s); });\n rst = Object(_arr2rgb__WEBPACK_IMPORTED_MODULE_1__[\"arr2rgb\"])(cArray);\n return rst;\n}\n/**\n * export with memoize.\n * @param color\n * @returns\n */\nvar toRGB = Object(_lodash__WEBPACK_IMPORTED_MODULE_0__[\"memoize\"])(toRGBString, function (color) { return color; }, 256);\n//# sourceMappingURL=torgb.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/color/torgb.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/tarjan.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/tarjan.js ***! - \************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/create-dom.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/create-dom.js ***! + \*********************************************************************************/ +/*! exports provided: createDOM */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @description Tarjan's algorithm for finding the strongly connected components of a graph.\n * @description https://en.wikipedia.org/wiki/Tarjan%27s_strongly_connected_components_algorithm\n * @description.zh-CN Tarjan 算法用于找到图的强连通子图。\n * @param graph\n * @returns\n */\nvar tarjan = function tarjan(graph) {\n var index = 0;\n var stack = [];\n var visited = new Map(); // node id -> { onStack, lowlink, index }\n\n var results = [];\n\n function dfs(v) {\n var _graph$successors;\n\n var entry = {\n onStack: true,\n lowlink: index,\n index: index\n };\n visited.set(v, entry);\n index += 1;\n stack.push(v);\n (_graph$successors = graph.successors(v)) === null || _graph$successors === void 0 ? void 0 : _graph$successors.forEach(function (w) {\n var _visited$get;\n\n // 如果 w 没有被访问过,则继续访问 w\n if (!visited.has(w)) {\n dfs(w);\n var wEntry = visited.get(w);\n entry.lowlink = Math.min(entry.lowlink, wEntry.lowlink); // 如果 w 在栈顶,则说明 w 和 v 不是强连通的\n } else if ((_visited$get = visited.get(w)) === null || _visited$get === void 0 ? void 0 : _visited$get.onStack) {\n var _wEntry = visited.get(w); // 如果 w 在栈中,则说明 w 在当前访问的路径上\n\n\n entry.lowlink = Math.min(entry.lowlink, _wEntry.index);\n }\n }); // 如果 v 的 lowlink 不等于 v 的 index,则说明 v 和 v 的 lowlink 不是强连通的\n\n if (entry.lowlink === entry.index) {\n var cmpt = [];\n var w;\n\n do {\n // 将 w 出栈,并将 w 的所有邻接点加入强连通子图\n w = stack.pop();\n var wEntry = visited.get(w);\n wEntry.onStack = false;\n cmpt.push(w);\n } while (v !== w);\n\n results.push(cmpt);\n }\n }\n\n graph.nodes().forEach(function (v) {\n if (!visited.has(v)) {\n dfs(v);\n }\n });\n return results;\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (tarjan);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/tarjan.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"createDOM\", function() { return createDOM; });\n/**\n * Create DOM from a html string.\n * @param str\n * @returns\n */\nfunction createDOM(str) {\n var container = document.createElement('div');\n container.innerHTML = str;\n var dom = container.childNodes[0];\n if (dom && container.contains(dom)) {\n container.removeChild(dom);\n }\n return dom;\n}\n//# sourceMappingURL=create-dom.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/create-dom.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/algorithm/topsort.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/algorithm/topsort.js ***! - \*************************************************************/ -/*! exports provided: CycleException, default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/index.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/index.js ***! + \****************************************************************************/ +/*! exports provided: createDOM, modifyCSS */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"CycleException\", function() { return CycleException; });\nfunction _typeof(obj) { \"@babel/helpers - typeof\"; return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) { return typeof obj; } : function (obj) { return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj; }, _typeof(obj); }\n\nfunction _defineProperties(target, props) { for (var i = 0; i < props.length; i++) { var descriptor = props[i]; descriptor.enumerable = descriptor.enumerable || false; descriptor.configurable = true; if (\"value\" in descriptor) descriptor.writable = true; Object.defineProperty(target, descriptor.key, descriptor); } }\n\nfunction _createClass(Constructor, protoProps, staticProps) { if (protoProps) _defineProperties(Constructor.prototype, protoProps); if (staticProps) _defineProperties(Constructor, staticProps); Object.defineProperty(Constructor, \"prototype\", { writable: false }); return Constructor; }\n\nfunction _classCallCheck(instance, Constructor) { if (!(instance instanceof Constructor)) { throw new TypeError(\"Cannot call a class as a function\"); } }\n\nfunction _inherits(subClass, superClass) { if (typeof superClass !== \"function\" && superClass !== null) { throw new TypeError(\"Super expression must either be null or a function\"); } subClass.prototype = Object.create(superClass && superClass.prototype, { constructor: { value: subClass, writable: true, configurable: true } }); Object.defineProperty(subClass, \"prototype\", { writable: false }); if (superClass) _setPrototypeOf(subClass, superClass); }\n\nfunction _createSuper(Derived) { var hasNativeReflectConstruct = _isNativeReflectConstruct(); return function _createSuperInternal() { var Super = _getPrototypeOf(Derived), result; if (hasNativeReflectConstruct) { var NewTarget = _getPrototypeOf(this).constructor; result = Reflect.construct(Super, arguments, NewTarget); } else { result = Super.apply(this, arguments); } return _possibleConstructorReturn(this, result); }; }\n\nfunction _possibleConstructorReturn(self, call) { if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) { return call; } else if (call !== void 0) { throw new TypeError(\"Derived constructors may only return object or undefined\"); } return _assertThisInitialized(self); }\n\nfunction _assertThisInitialized(self) { if (self === void 0) { throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\"); } return self; }\n\nfunction _wrapNativeSuper(Class) { var _cache = typeof Map === \"function\" ? new Map() : undefined; _wrapNativeSuper = function _wrapNativeSuper(Class) { if (Class === null || !_isNativeFunction(Class)) return Class; if (typeof Class !== \"function\") { throw new TypeError(\"Super expression must either be null or a function\"); } if (typeof _cache !== \"undefined\") { if (_cache.has(Class)) return _cache.get(Class); _cache.set(Class, Wrapper); } function Wrapper() { return _construct(Class, arguments, _getPrototypeOf(this).constructor); } Wrapper.prototype = Object.create(Class.prototype, { constructor: { value: Wrapper, enumerable: false, writable: true, configurable: true } }); return _setPrototypeOf(Wrapper, Class); }; return _wrapNativeSuper(Class); }\n\nfunction _construct(Parent, args, Class) { if (_isNativeReflectConstruct()) { _construct = Reflect.construct; } else { _construct = function _construct(Parent, args, Class) { var a = [null]; a.push.apply(a, args); var Constructor = Function.bind.apply(Parent, a); var instance = new Constructor(); if (Class) _setPrototypeOf(instance, Class.prototype); return instance; }; } return _construct.apply(null, arguments); }\n\nfunction _isNativeReflectConstruct() { if (typeof Reflect === \"undefined\" || !Reflect.construct) return false; if (Reflect.construct.sham) return false; if (typeof Proxy === \"function\") return true; try { Boolean.prototype.valueOf.call(Reflect.construct(Boolean, [], function () {})); return true; } catch (e) { return false; } }\n\nfunction _isNativeFunction(fn) { return Function.toString.call(fn).indexOf(\"[native code]\") !== -1; }\n\nfunction _setPrototypeOf(o, p) { _setPrototypeOf = Object.setPrototypeOf || function _setPrototypeOf(o, p) { o.__proto__ = p; return o; }; return _setPrototypeOf(o, p); }\n\nfunction _getPrototypeOf(o) { _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf : function _getPrototypeOf(o) { return o.__proto__ || Object.getPrototypeOf(o); }; return _getPrototypeOf(o); }\n\nvar CycleException = /*#__PURE__*/function (_Error) {\n _inherits(CycleException, _Error);\n\n var _super = _createSuper(CycleException);\n\n function CycleException() {\n _classCallCheck(this, CycleException);\n\n return _super.apply(this, arguments);\n }\n\n return _createClass(CycleException);\n}( /*#__PURE__*/_wrapNativeSuper(Error));\n\nfunction topsort(graph) {\n var visited = new Set();\n var stack = new Set();\n var results = [];\n\n function visit(node) {\n if (stack.has(node)) {\n throw new CycleException();\n }\n\n if (!visited.has(node)) {\n var _graph$predecessors;\n\n stack.add(node);\n visited.add(node);\n (_graph$predecessors = graph.predecessors(node)) === null || _graph$predecessors === void 0 ? void 0 : _graph$predecessors.forEach(visit);\n stack.delete(node);\n results.push(node);\n }\n }\n\n graph.sinks().forEach(visit);\n\n if (visited.size !== graph.nodeCount()) {\n throw new CycleException();\n }\n\n return results;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (topsort);\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/algorithm/topsort.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _create_dom__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./create-dom */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/create-dom.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"createDOM\", function() { return _create_dom__WEBPACK_IMPORTED_MODULE_0__[\"createDOM\"]; });\n\n/* harmony import */ var _modify_css__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./modify-css */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/modify-css.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"modifyCSS\", function() { return _modify_css__WEBPACK_IMPORTED_MODULE_1__[\"modifyCSS\"]; });\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/index.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/comparision/complement.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/comparision/complement.js ***! - \******************************************************************/ -/*! exports provided: isGraphComplement */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/modify-css.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/modify-css.js ***! + \*********************************************************************************/ +/*! exports provided: modifyCSS */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraphComplement\", function() { return isGraphComplement; });\n/* harmony import */ var _essence__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../essence */ \"./node_modules/@antv/graphlib/es/essence/index.js\");\n/* harmony import */ var _contain__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contain */ \"./node_modules/@antv/graphlib/es/comparision/contain.js\");\n\n\n/**\n * @description Check if one graph is the complement of another graph.\n * @description.zh-CN 检查一个图是否是另一个图的补图。\n */\n\nvar isGraphComplement = function isGraphComplement(originGraph, targetGraph) {\n if (!Object(_essence__WEBPACK_IMPORTED_MODULE_0__[\"isSimpleGraph\"])(originGraph) || !Object(_essence__WEBPACK_IMPORTED_MODULE_0__[\"isSimpleGraph\"])(targetGraph)) {\n return false;\n }\n\n if (!Object(_contain__WEBPACK_IMPORTED_MODULE_1__[\"containAllSameNodes\"])(originGraph, targetGraph)) {\n return false;\n }\n\n if (Object(_contain__WEBPACK_IMPORTED_MODULE_1__[\"containSameEdges\"])(originGraph, targetGraph)) {\n return false;\n }\n\n var nodeCount = originGraph.nodeCount();\n return originGraph.edgeCount() + targetGraph.edgeCount() === nodeCount * (nodeCount - 1) / 2;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/comparision/complement.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"modifyCSS\", function() { return modifyCSS; });\n/**\n * Modify the CSS of a DOM.\n * @param dom\n * @param css\n * @returns\n */\nfunction modifyCSS(dom, css) {\n if (!dom)\n return;\n Object.keys(css).forEach(function (key) {\n dom.style[key] = css[key];\n });\n return dom;\n}\n//# sourceMappingURL=modify-css.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/modify-css.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/comparision/contain.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/comparision/contain.js ***! - \***************************************************************/ -/*! exports provided: containSameNodes, containSameEdges, getSameNodes, getSameEdges, isGraphOptionSame, containAllSameNodes, containAllSameEdges, isGraphSame, isGraphContainsAnother */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/index.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/index.js ***! + \************************************************************************/ +/*! exports provided: rgb2arr, gradient, toRGB, toCSSGradient, transform, angleTo, direction, vertical, path2String, path2Curve, path2Absolute, clonePath, normalizePath, reverseCurve, arcToCubic, getPathBBox, getTotalLength, getPathBBoxTotalLength, getRotatedCurve, getPathArea, getDrawDirection, getPointAtLength, isPointInStroke, distanceSquareRoot, equalizeSegments, contains, includes, difference, find, findIndex, firstValue, flatten, flattenDeep, getRange, pull, pullAt, reduce, remove, sortBy, union, uniq, valuesOfKey, head, last, startsWith, endsWith, filter, every, some, group, groupBy, groupToMap, getWrapBehavior, wrapBehavior, number2color, parseRadius, clamp, fixedBase, isDecimal, isEven, isInteger, isNegative, isNumberEqual, isOdd, isPositive, max, maxBy, min, minBy, mod, toDegree, toInteger, toRadian, forIn, has, hasKey, hasValue, keys, isMatch, values, lowerCase, lowerFirst, substitute, upperCase, upperFirst, getType, isArguments, isArray, isArrayLike, isBoolean, isDate, isError, isFunction, isFinite, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrototype, isRegExp, isString, isType, isUndefined, isElement, requestAnimationFrame, clearAnimationFrame, augment, clone, debounce, memoize, deepMix, each, extend, indexOf, isEmpty, isEqual, isEqualWith, map, mapValues, mix, assign, get, set, pick, omit, throttle, toArray, toString, uniqueId, noop, identity, size, Cache, isPointInPolygon, isPolygonsIntersect, createDOM, modifyCSS */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containSameNodes\", function() { return containSameNodes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containSameEdges\", function() { return containSameEdges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSameNodes\", function() { return getSameNodes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getSameEdges\", function() { return getSameEdges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraphOptionSame\", function() { return isGraphOptionSame; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containAllSameNodes\", function() { return containAllSameNodes; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"containAllSameEdges\", function() { return containAllSameEdges; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraphSame\", function() { return isGraphSame; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraphContainsAnother\", function() { return isGraphContainsAnother; });\n/**\n * @file Functions that used to find similar element between two graph\n * @file.zh-CN 在两个图中查找相似元素的函数\n */\n\n/**\n * @description Check if two graphs are contains the same nodes.\n * @description.zh-CN 检查两个图是否包含相同的节点。\n */\nvar containSameNodes = function containSameNodes(aGraph, bGraph) {\n var aNodes = aGraph.nodes();\n\n for (var i = 0; i < aNodes.length; i++) {\n var aNode = aNodes[i];\n\n if (bGraph.hasNode(aNode)) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * @description Check if two graphs are contains the same edges.\n * @description.zh-CN 检查两个图是否包含相同的边。\n */\n\nvar containSameEdges = function containSameEdges(aGraph, bGraph) {\n var aEdges = aGraph.edges();\n\n for (var i = 0; i < aEdges.length; i++) {\n var aEdge = aEdges[i];\n\n if (bGraph.hasEdge(aEdge.v, aEdge.w, aEdge.name)) {\n return true;\n }\n }\n\n return false;\n};\n/**\n * @description get same nodes in two graphs.\n * @description.zh-CN 获取两个图中相同的节点。\n */\n\nvar getSameNodes = function getSameNodes(aGraph, bGraph) {\n var aNodes = aGraph.nodes();\n var sameNodes = aNodes.filter(function (aNode) {\n return bGraph.hasNode(aNode);\n });\n return sameNodes;\n};\n/**\n * @description get same edges in two graphs.\n * @description.zh-CN 获取两个图中相同的边。\n */\n\nvar getSameEdges = function getSameEdges(aGraph, bGraph) {\n var aEdges = aGraph.edges();\n var sameEdges = aEdges.filter(function (aEdge) {\n return bGraph.hasEdge(aEdge.v, aEdge.w, aEdge.name);\n });\n return sameEdges;\n};\n/**\n * @description Check if two graphs'option are the same.\n * @description.zh-CN 检查两个图的选项是否相同。\n */\n\nvar isGraphOptionSame = function isGraphOptionSame(aGraph, bGraph) {\n return aGraph.isCompound() === bGraph.isCompound() && aGraph.isDirected() === bGraph.isDirected() && aGraph.isMultigraph() === bGraph.isMultigraph();\n};\n/**\n * @description Check if a graph contains all nodes in another graph.\n * @description.zh-CN 检查一个图是否包含另一个图的所有节点。\n */\n\nvar containAllSameNodes = function containAllSameNodes(aGraph, bGraph) {\n var sameNodes = getSameNodes(aGraph, bGraph);\n return sameNodes.length === aGraph.nodes().length;\n};\n/**\n * @description Check if a graph contains all edges in another graph.\n * @description.zh-CN 检查一个图是否包含另一个图的所有边。\n */\n\nvar containAllSameEdges = function containAllSameEdges(aGraph, bGraph) {\n var sameEdges = getSameEdges(aGraph, bGraph);\n return sameEdges.length === aGraph.edges().length;\n};\n/**\n * @description Check if two graphs are the same.\n * @description.zh-CN 检查两个图是否相同。\n */\n\nvar isGraphSame = function isGraphSame(aGraph, bGraph) {\n return isGraphOptionSame(aGraph, bGraph) && aGraph.nodeCount() === bGraph.nodeCount() && containAllSameNodes(aGraph, bGraph) && aGraph.edgeCount() === bGraph.edgeCount() && containAllSameEdges(aGraph, bGraph);\n};\n/**\n * @description Check if one graph is the subgraph of another graph.\n * @description.zh-CN 检查一个图是否是另一个图的子图。\n */\n\nvar isGraphContainsAnother = function isGraphContainsAnother(originGraph, targetGraph) {\n return containAllSameNodes(originGraph, targetGraph) && containAllSameEdges(originGraph, targetGraph);\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/comparision/contain.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/color/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"rgb2arr\", function() { return _color__WEBPACK_IMPORTED_MODULE_0__[\"rgb2arr\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"gradient\", function() { return _color__WEBPACK_IMPORTED_MODULE_0__[\"gradient\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toRGB\", function() { return _color__WEBPACK_IMPORTED_MODULE_0__[\"toRGB\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toCSSGradient\", function() { return _color__WEBPACK_IMPORTED_MODULE_0__[\"toCSSGradient\"]; });\n\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"transform\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_1__[\"transform\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"angleTo\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_1__[\"angleTo\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"direction\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_1__[\"direction\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vertical\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_1__[\"vertical\"]; });\n\n/* harmony import */ var _path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./path */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2String\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"path2String\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Curve\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"path2Curve\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Absolute\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"path2Absolute\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clonePath\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"clonePath\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"normalizePath\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"normalizePath\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"reverseCurve\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"reverseCurve\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"arcToCubic\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"arcToCubic\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getPathBBox\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"getPathBBox\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTotalLength\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"getTotalLength\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getPathBBoxTotalLength\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"getPathBBoxTotalLength\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getRotatedCurve\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"getRotatedCurve\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getPathArea\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"getPathArea\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getDrawDirection\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"getDrawDirection\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getPointAtLength\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"getPointAtLength\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPointInStroke\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"isPointInStroke\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"distanceSquareRoot\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"distanceSquareRoot\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"equalizeSegments\", function() { return _path__WEBPACK_IMPORTED_MODULE_2__[\"equalizeSegments\"]; });\n\n/* harmony import */ var _lodash__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./lodash */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"contains\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"contains\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"includes\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"includes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"difference\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"difference\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"find\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"find\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"findIndex\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"findIndex\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"firstValue\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"firstValue\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flatten\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"flatten\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flattenDeep\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"flattenDeep\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getRange\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"getRange\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pull\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"pull\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pullAt\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"pullAt\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"reduce\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"reduce\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"remove\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"sortBy\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"sortBy\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"union\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"union\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"uniq\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"uniq\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"valuesOfKey\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"valuesOfKey\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"head\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"head\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"last\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"last\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"startsWith\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"startsWith\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"endsWith\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"endsWith\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"filter\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"every\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"every\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"some\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"some\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"group\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"group\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"groupBy\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"groupBy\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"groupToMap\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"groupToMap\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getWrapBehavior\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"getWrapBehavior\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"wrapBehavior\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"wrapBehavior\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"number2color\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"number2color\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parseRadius\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"parseRadius\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clamp\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"clamp\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fixedBase\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"fixedBase\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isDecimal\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isDecimal\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEven\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isEven\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isInteger\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isInteger\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNegative\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isNegative\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNumberEqual\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isNumberEqual\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isOdd\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isOdd\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPositive\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isPositive\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"max\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"maxBy\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"maxBy\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"min\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"minBy\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"minBy\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mod\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"mod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toDegree\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"toDegree\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toInteger\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"toInteger\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"toRadian\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forIn\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"forIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"has\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hasKey\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"hasKey\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hasValue\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"hasValue\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"keys\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isMatch\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isMatch\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"values\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lowerCase\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"lowerCase\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lowerFirst\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"lowerFirst\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"substitute\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"substitute\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"upperCase\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"upperCase\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"upperFirst\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"upperFirst\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"getType\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArguments\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isArguments\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArray\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isArray\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArrayLike\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isArrayLike\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isBoolean\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isBoolean\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isDate\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isDate\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isError\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isError\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isFunction\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isFunction\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isFinite\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isFinite\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNil\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isNil\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNull\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isNull\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isNumber\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isObject\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isObjectLike\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isObjectLike\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPlainObject\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isPlainObject\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPrototype\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isPrototype\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isRegExp\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isRegExp\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isString\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isString\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isType\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isType\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isUndefined\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isUndefined\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isElement\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isElement\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"requestAnimationFrame\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"requestAnimationFrame\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clearAnimationFrame\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"clearAnimationFrame\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"augment\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"augment\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"clone\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"debounce\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"memoize\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"memoize\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"deepMix\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"deepMix\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"each\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"each\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"extend\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"indexOf\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"indexOf\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEmpty\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isEmpty\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEqual\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isEqual\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEqualWith\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"isEqualWith\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"map\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mapValues\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"mapValues\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mix\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"mix\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"assign\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"assign\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"get\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"set\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pick\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"pick\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"omit\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"omit\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"throttle\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toArray\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"toArray\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toString\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"toString\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"uniqueId\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"noop\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"noop\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"identity\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"size\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"size\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Cache\", function() { return _lodash__WEBPACK_IMPORTED_MODULE_3__[\"Cache\"]; });\n\n/* harmony import */ var _math__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./math */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/math/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPointInPolygon\", function() { return _math__WEBPACK_IMPORTED_MODULE_4__[\"isPointInPolygon\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPolygonsIntersect\", function() { return _math__WEBPACK_IMPORTED_MODULE_4__[\"isPolygonsIntersect\"]; });\n\n/* harmony import */ var _dom__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./dom */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/dom/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"createDOM\", function() { return _dom__WEBPACK_IMPORTED_MODULE_5__[\"createDOM\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"modifyCSS\", function() { return _dom__WEBPACK_IMPORTED_MODULE_5__[\"modifyCSS\"]; });\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/index.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/comparision/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/comparision/index.js ***! - \*************************************************************/ -/*! exports provided: containAllSameEdges, containAllSameNodes, containSameEdges, containSameNodes, isGraphComplement, isGraphOptionSame, getSameEdges, getSameNodes, isGraphSame, isGraphContainsAnother */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/augment.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/augment.js ***! + \*********************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _contain__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contain */ \"./node_modules/@antv/graphlib/es/comparision/contain.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"containAllSameEdges\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"containAllSameEdges\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"containAllSameNodes\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"containAllSameNodes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"containSameEdges\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"containSameEdges\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"containSameNodes\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"containSameNodes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isGraphOptionSame\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"isGraphOptionSame\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getSameEdges\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"getSameEdges\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getSameNodes\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"getSameNodes\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isGraphSame\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"isGraphSame\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isGraphContainsAnother\", function() { return _contain__WEBPACK_IMPORTED_MODULE_0__[\"isGraphContainsAnother\"]; });\n\n/* harmony import */ var _complement__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./complement */ \"./node_modules/@antv/graphlib/es/comparision/complement.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isGraphComplement\", function() { return _complement__WEBPACK_IMPORTED_MODULE_1__[\"isGraphComplement\"]; });\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/comparision/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mix.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\n\nvar augment = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var c = args[0];\n for (var i = 1; i < args.length; i++) {\n var obj = args[i];\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj)) {\n obj = obj.prototype;\n }\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(c.prototype, obj);\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (augment);\n//# sourceMappingURL=augment.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/augment.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/essence/index.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/essence/index.js ***! - \*********************************************************/ -/*! exports provided: isGraph, isSimpleGraph, isNullGraph, hasSelfLoop */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/cache.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/cache.js ***! + \*******************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isGraph\", function() { return isGraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSimpleGraph\", function() { return isSimpleGraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNullGraph\", function() { return isNullGraph; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hasSelfLoop\", function() { return hasSelfLoop; });\n/* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../Graph */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\nfunction _slicedToArray(arr, i) { return _arrayWithHoles(arr) || _iterableToArrayLimit(arr, i) || _unsupportedIterableToArray(arr, i) || _nonIterableRest(); }\n\nfunction _nonIterableRest() { throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\"); }\n\nfunction _unsupportedIterableToArray(o, minLen) { if (!o) return; if (typeof o === \"string\") return _arrayLikeToArray(o, minLen); var n = Object.prototype.toString.call(o).slice(8, -1); if (n === \"Object\" && o.constructor) n = o.constructor.name; if (n === \"Map\" || n === \"Set\") return Array.from(o); if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return _arrayLikeToArray(o, minLen); }\n\nfunction _arrayLikeToArray(arr, len) { if (len == null || len > arr.length) len = arr.length; for (var i = 0, arr2 = new Array(len); i < len; i++) { arr2[i] = arr[i]; } return arr2; }\n\nfunction _iterableToArrayLimit(arr, i) { var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"]; if (_i == null) return; var _arr = []; var _n = true; var _d = false; var _s, _e; try { for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) { _arr.push(_s.value); if (i && _arr.length === i) break; } } catch (err) { _d = true; _e = err; } finally { try { if (!_n && _i[\"return\"] != null) _i[\"return\"](); } finally { if (_d) throw _e; } } return _arr; }\n\nfunction _arrayWithHoles(arr) { if (Array.isArray(arr)) return arr; }\n\n/**\n * @file To get graph essencial information.\n * @file.zh-CN 获取图的基本信息\n * @module essence\n */\n\n/**\n * @description Check if the object is a graph.\n * @description.zh-CN 检查对象是否为图。\n */\n\nfunction isGraph(obj) {\n return obj instanceof _Graph__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\n}\n/**\n * @description Check if the graph is a simple graph.\n * @description.zh-CN 检查图是否为简单图。\n */\n\nfunction isSimpleGraph(graph) {\n if (graph.isMultigraph()) {\n return false;\n }\n\n var edges = graph.edges();\n var edgeStack = new Map();\n\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n\n if (edge.v === edge.w) {\n return false;\n }\n\n var _sort = [edge.v, edge.w].sort(),\n _sort2 = _slicedToArray(_sort, 2),\n v = _sort2[0],\n w = _sort2[1];\n\n var key = \"\".concat(v, \"-\").concat(w);\n\n if (edgeStack.has(key)) {\n return false;\n }\n\n edgeStack.set(key, true);\n }\n\n return true;\n}\n/**\n * @description Check if the graph is a null graph.\n * @description.zh-CN 检查图是否为空图。\n */\n\nfunction isNullGraph(graph) {\n return graph.nodes().length === 0;\n}\n/**\n * @description Check if the graph contains Self loops.\n * @description.zh-CN 检查图是否包含自环。\n */\n\nfunction hasSelfLoop(graph) {\n var edges = graph.edges();\n\n for (var i = 0; i < edges.length; i++) {\n var edge = edges[i];\n\n if (edge.v === edge.w) {\n return true;\n }\n }\n\n return false;\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/essence/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * k-v 存储\n */\nvar default_1 = /** @class */ (function () {\n function default_1() {\n this.map = {};\n }\n default_1.prototype.has = function (key) {\n return this.map[key] !== undefined;\n };\n default_1.prototype.get = function (key, def) {\n var v = this.map[key];\n return v === undefined ? def : v;\n };\n default_1.prototype.set = function (key, value) {\n this.map[key] = value;\n };\n default_1.prototype.clear = function () {\n this.map = {};\n };\n default_1.prototype.delete = function (key) {\n delete this.map[key];\n };\n default_1.prototype.size = function () {\n return Object.keys(this.map).length;\n };\n return default_1;\n}());\n/* harmony default export */ __webpack_exports__[\"default\"] = (default_1);\n//# sourceMappingURL=cache.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/cache.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/generate/compelement.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/generate/compelement.js ***! - \****************************************************************/ -/*! exports provided: getGraphComplement */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clamp.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clamp.js ***! + \*******************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getGraphComplement\", function() { return getGraphComplement; });\n/* harmony import */ var _essence__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../essence */ \"./node_modules/@antv/graphlib/es/essence/index.js\");\n/* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../Graph */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\n\n\n/**\n * @description Get the graph's complement\n * @description.zh-CN 获取图的补图\n */\n\nvar getGraphComplement = function getGraphComplement(originGraph) {\n if (!Object(_essence__WEBPACK_IMPORTED_MODULE_0__[\"isSimpleGraph\"])(originGraph)) {\n return null;\n }\n\n var nodeCount = originGraph.nodeCount();\n var complementGraph = new _Graph__WEBPACK_IMPORTED_MODULE_1__[\"default\"]({\n compound: originGraph.isCompound(),\n directed: originGraph.isDirected(),\n multigraph: originGraph.isMultigraph()\n });\n var nodes = originGraph.nodes();\n\n for (var i = 0; i < nodeCount; i++) {\n var nodei = nodes[i];\n complementGraph.setNode(nodei, originGraph.node(nodei));\n\n for (var j = i + 1; j < nodeCount; j++) {\n var nodej = nodes[j];\n\n if (!originGraph.hasEdge(nodei, nodej)) {\n complementGraph.setEdge(nodei, nodej);\n }\n }\n }\n\n return complementGraph;\n};\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/generate/compelement.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar clamp = function (a, min, max) {\n if (a < min) {\n return min;\n }\n else if (a > max) {\n return max;\n }\n return a;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (clamp);\n//# sourceMappingURL=clamp.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clamp.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/generate/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/generate/index.js ***! - \**********************************************************/ -/*! exports provided: getGraphComplement */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clear-animation-frame.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clear-animation-frame.js ***! + \***********************************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _compelement__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./compelement */ \"./node_modules/@antv/graphlib/es/generate/compelement.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getGraphComplement\", function() { return _compelement__WEBPACK_IMPORTED_MODULE_0__[\"getGraphComplement\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/generate/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return cancelAnimationFrame; });\nfunction cancelAnimationFrame(handler) {\n var method = window.cancelAnimationFrame ||\n // @ts-ignore\n window.webkitCancelAnimationFrame ||\n // @ts-ignore\n window.mozCancelAnimationFrame ||\n // @ts-ignore\n window.msCancelAnimationFrame ||\n clearTimeout;\n method(handler);\n}\n//# sourceMappingURL=clear-animation-frame.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clear-animation-frame.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/index.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/index.js ***! - \*************************************************/ -/*! exports provided: Graph, GraphWithEvent, algorithm, comparision, essence, generate */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clone.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clone.js ***! + \*******************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Graph__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Graph */ \"./node_modules/@antv/graphlib/es/Graph/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Graph\", function() { return _Graph__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _Graph_event__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Graph/event */ \"./node_modules/@antv/graphlib/es/Graph/event.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"GraphWithEvent\", function() { return _Graph_event__WEBPACK_IMPORTED_MODULE_1__[\"GraphWithEvent\"]; });\n\n/* harmony import */ var _algorithm__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./algorithm */ \"./node_modules/@antv/graphlib/es/algorithm/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"algorithm\", function() { return _algorithm__WEBPACK_IMPORTED_MODULE_2__; });\n/* harmony import */ var _comparision__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./comparision */ \"./node_modules/@antv/graphlib/es/comparision/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"comparision\", function() { return _comparision__WEBPACK_IMPORTED_MODULE_3__; });\n/* harmony import */ var _essence__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./essence */ \"./node_modules/@antv/graphlib/es/essence/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"essence\", function() { return _essence__WEBPACK_IMPORTED_MODULE_4__; });\n/* harmony import */ var _generate__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./generate */ \"./node_modules/@antv/graphlib/es/generate/index.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"generate\", function() { return _generate__WEBPACK_IMPORTED_MODULE_5__; });\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n\nvar clone = function (obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n var rst;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) {\n rst = [];\n for (var i = 0, l = obj.length; i < l; i++) {\n if (typeof obj[i] === 'object' && obj[i] != null) {\n rst[i] = clone(obj[i]);\n }\n else {\n rst[i] = obj[i];\n }\n }\n }\n else {\n rst = {};\n for (var k in obj) {\n if (typeof obj[k] === 'object' && obj[k] != null) {\n rst[k] = clone(obj[k]);\n }\n else {\n rst[k] = obj[k];\n }\n }\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (clone);\n//# sourceMappingURL=clone.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clone.js?"); /***/ }), -/***/ "./node_modules/@antv/graphlib/es/util.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/graphlib/es/util.js ***! - \************************************************/ -/*! exports provided: incrementOrInitEntry, decrementOrRemoveEntry, edgeArgsToId, edgeArgsToObj, edgeObjToId, isFunction */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/contains.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/contains.js ***! + \**********************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"incrementOrInitEntry\", function() { return incrementOrInitEntry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"decrementOrRemoveEntry\", function() { return decrementOrRemoveEntry; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"edgeArgsToId\", function() { return edgeArgsToId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"edgeArgsToObj\", function() { return edgeArgsToObj; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"edgeObjToId\", function() { return edgeObjToId; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isFunction\", function() { return isFunction; });\n/* harmony import */ var _Graph_enum__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Graph/enum */ \"./node_modules/@antv/graphlib/es/Graph/enum.js\");\n\n/**\n * @description add one to key's value in map\n * @description.zh-CN 在 map 中 key 的值加 1\n * @param map\n * @param key\n */\n\nfunction incrementOrInitEntry(map, key) {\n var val = map.get(key) || 0;\n map.set(key, val + 1);\n}\n/**\n * @description minus one from key's value in map, is value is 0, delete the key\n * @description.zh-CN 在 map 中 key 的值减 1,如果值为 0,则删除 key\n */\n\nfunction decrementOrRemoveEntry(map, key) {\n var val = map.get(key);\n\n if (val !== undefined) {\n val = val - 1;\n\n if (val > 0) {\n map.set(key, val);\n } else {\n map.delete(key);\n }\n }\n}\n/**\n * @description convert edge to string id\n * @description.zh-CN 转换边为字符串 id\n */\n\nfunction edgeArgsToId(isDirected, v_, w_, name) {\n var v = String(v_);\n var w = String(w_);\n\n if (!isDirected && v > w) {\n var tmp = v;\n v = w;\n w = tmp;\n }\n\n return v + _Graph_enum__WEBPACK_IMPORTED_MODULE_0__[\"GraphEnum\"].EDGE_KEY_DELIM + w + _Graph_enum__WEBPACK_IMPORTED_MODULE_0__[\"GraphEnum\"].EDGE_KEY_DELIM + (name === undefined ? _Graph_enum__WEBPACK_IMPORTED_MODULE_0__[\"GraphEnum\"].DEFAULT_EDGE_NAME : name);\n}\n/**\n * @description convert edge arguments to edge object\n * @description.zh-CN 转换边参数为边对象\n */\n\nfunction edgeArgsToObj(isDirected, v, w, name) {\n var strV = String(v);\n var strW = String(w);\n var edgeObj = {\n v: v,\n w: w\n };\n\n if (!isDirected && strV > strW) {\n var tmp = edgeObj.v;\n edgeObj.v = edgeObj.w;\n edgeObj.w = tmp;\n }\n\n if (name !== undefined) {\n edgeObj.name = name;\n }\n\n return edgeObj;\n}\n/**\n * @description convert edge object to string id\n * @description.zh-CN 转换边对象为字符串 id\n */\n\nfunction edgeObjToId(isDirected, edgeObj) {\n return edgeArgsToId(isDirected, edgeObj.v, edgeObj.w, edgeObj.name);\n}\nfunction isFunction(obj) {\n return typeof obj === 'function';\n}\n\n//# sourceURL=webpack:///./node_modules/@antv/graphlib/es/util.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\nvar contains = function (arr, value) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return false;\n }\n return arr.indexOf(value) > -1;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (contains);\n//# sourceMappingURL=contains.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/contains.js?"); /***/ }), -/***/ "./node_modules/@antv/hierarchy/build/hierarchy.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/hierarchy/build/hierarchy.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/debounce.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/debounce.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("(function webpackUniversalModuleDefinition(root, factory) {\n\tif(true)\n\t\tmodule.exports = factory();\n\telse {}\n})(typeof self !== 'undefined' ? self : this, function() {\nreturn /******/ (function(modules) { // webpackBootstrap\n/******/ \t// The module cache\n/******/ \tvar installedModules = {};\n/******/\n/******/ \t// The require function\n/******/ \tfunction __webpack_require__(moduleId) {\n/******/\n/******/ \t\t// Check if module is in cache\n/******/ \t\tif(installedModules[moduleId]) {\n/******/ \t\t\treturn installedModules[moduleId].exports;\n/******/ \t\t}\n/******/ \t\t// Create a new module (and put it into the cache)\n/******/ \t\tvar module = installedModules[moduleId] = {\n/******/ \t\t\ti: moduleId,\n/******/ \t\t\tl: false,\n/******/ \t\t\texports: {}\n/******/ \t\t};\n/******/\n/******/ \t\t// Execute the module function\n/******/ \t\tmodules[moduleId].call(module.exports, module, module.exports, __webpack_require__);\n/******/\n/******/ \t\t// Flag the module as loaded\n/******/ \t\tmodule.l = true;\n/******/\n/******/ \t\t// Return the exports of the module\n/******/ \t\treturn module.exports;\n/******/ \t}\n/******/\n/******/\n/******/ \t// expose the modules object (__webpack_modules__)\n/******/ \t__webpack_require__.m = modules;\n/******/\n/******/ \t// expose the module cache\n/******/ \t__webpack_require__.c = installedModules;\n/******/\n/******/ \t// define getter function for harmony exports\n/******/ \t__webpack_require__.d = function(exports, name, getter) {\n/******/ \t\tif(!__webpack_require__.o(exports, name)) {\n/******/ \t\t\tObject.defineProperty(exports, name, {\n/******/ \t\t\t\tconfigurable: false,\n/******/ \t\t\t\tenumerable: true,\n/******/ \t\t\t\tget: getter\n/******/ \t\t\t});\n/******/ \t\t}\n/******/ \t};\n/******/\n/******/ \t// getDefaultExport function for compatibility with non-harmony modules\n/******/ \t__webpack_require__.n = function(module) {\n/******/ \t\tvar getter = module && module.__esModule ?\n/******/ \t\t\tfunction getDefault() { return module['default']; } :\n/******/ \t\t\tfunction getModuleExports() { return module; };\n/******/ \t\t__webpack_require__.d(getter, 'a', getter);\n/******/ \t\treturn getter;\n/******/ \t};\n/******/\n/******/ \t// Object.prototype.hasOwnProperty.call\n/******/ \t__webpack_require__.o = function(object, property) { return Object.prototype.hasOwnProperty.call(object, property); };\n/******/\n/******/ \t// __webpack_public_path__\n/******/ \t__webpack_require__.p = \"\";\n/******/\n/******/ \t// Load entry module and return exports\n/******/ \treturn __webpack_require__(__webpack_require__.s = 31);\n/******/ })\n/************************************************************************/\n/******/ ([\n/* 0 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n return Array.isArray ? Array.isArray(value) : Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Array');\n});\n\n/***/ }),\n/* 1 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar isArrayLike = function (value) {\n /**\n * isArrayLike([1, 2, 3]) => true\n * isArrayLike(document.body.children) => true\n * isArrayLike('abc') => true\n * isArrayLike(Function) => false\n */\n return value !== null && typeof value !== 'function' && isFinite(value.length);\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isArrayLike);\n\n/***/ }),\n/* 2 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_object__ = __webpack_require__(13);\n\n\n\nfunction each(elements, func) {\n if (!elements) {\n return;\n }\n\n var rst;\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(elements)) {\n for (var i = 0, len = elements.length; i < len; i++) {\n rst = func(elements[i], i);\n\n if (rst === false) {\n break;\n }\n }\n } else if (Object(__WEBPACK_IMPORTED_MODULE_1__is_object__[\"a\" /* default */])(elements)) {\n for (var k in elements) {\n if (elements.hasOwnProperty(k)) {\n rst = func(elements[k], k);\n\n if (rst === false) {\n break;\n }\n }\n }\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (each);\n\n/***/ }),\n/* 3 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n/**\n * 是否为函数\n * @param {*} fn 对象\n * @return {Boolean} 是否函数\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Function');\n});\n\n/***/ }),\n/* 4 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar toString = {}.toString;\n\nvar isType = function (value, type) {\n return toString.call(value) === '[object ' + type + ']';\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isType);\n\n/***/ }),\n/* 5 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n/**\n * 判断是否数字\n * @return {Boolean} 是否数字\n */\n\n\nvar isNumber = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Number');\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isNumber);\n\n/***/ }),\n/* 6 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n// isFinite,\nvar isNil = function (value) {\n /**\n * isNil(null) => true\n * isNil() => true\n */\n return value === null || value === undefined;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isNil);\n\n/***/ }),\n/* 7 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar _require = __webpack_require__(33),\n mix = _require.mix;\n\nmodule.exports = {\n assign: mix\n};\n\n/***/ }),\n/* 8 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (str) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(str, 'String');\n});\n\n/***/ }),\n/* 9 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object_like__ = __webpack_require__(15);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_type__ = __webpack_require__(4);\n\n\n\nvar isPlainObject = function (value) {\n /**\n * isObjectLike(new Foo) => false\n * isObjectLike([1, 2, 3]) => false\n * isObjectLike({ x: 0, y: 0 }) => true\n * isObjectLike(Object.create(null)) => true\n */\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__[\"a\" /* default */])(value) || !Object(__WEBPACK_IMPORTED_MODULE_1__is_type__[\"a\" /* default */])(value, 'Object')) {\n return false;\n }\n\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n\n var proto = value;\n\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n\n return Object.getPrototypeOf(value) === proto;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isPlainObject);\n\n/***/ }),\n/* 10 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(value)) return '';\n return value.toString();\n});\n\n/***/ }),\n/* 11 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar hierarchy = __webpack_require__(18);\n\nvar Layout = /*#__PURE__*/function () {\n function Layout(root, options) {\n if (options === void 0) {\n options = {};\n }\n\n var me = this;\n me.options = options;\n me.rootNode = hierarchy(root, options);\n }\n\n var _proto = Layout.prototype;\n\n _proto.execute = function execute() {\n throw new Error('please override this method');\n };\n\n return Layout;\n}();\n\nmodule.exports = Layout;\n\n/***/ }),\n/* 12 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\n\nvar contains = function (arr, value) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return false;\n }\n\n return arr.indexOf(value) > -1;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (contains);\n\n/***/ }),\n/* 13 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n /**\n * isObject({}) => true\n * isObject([1, 2, 3]) => true\n * isObject(Function) => true\n * isObject(null) => false\n */\n var type = typeof value;\n return value !== null && type === 'object' || type === 'function';\n});\n\n/***/ }),\n/* 14 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);\n\n\n\nvar filter = function (arr, func) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(arr)) {\n return arr;\n }\n\n var result = [];\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(arr, function (value, index) {\n if (func(value, index)) {\n result.push(value);\n }\n });\n return result;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (filter);\n\n/***/ }),\n/* 15 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar isObjectLike = function (value) {\n /**\n * isObjectLike({}) => true\n * isObjectLike([1, 2, 3]) => true\n * isObjectLike(Function) => false\n * isObjectLike(null) => false\n */\n return typeof value === 'object' && value !== null;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isObjectLike);\n\n/***/ }),\n/* 16 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = mix;\n// FIXME: Mutable param should be forbidden in static lang.\nfunction _mix(dist, obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {\n dist[key] = obj[key];\n }\n }\n}\n\nfunction mix(dist, src1, src2, src3) {\n if (src1) _mix(dist, src1);\n if (src2) _mix(dist, src2);\n if (src3) _mix(dist, src3);\n return dist;\n}\n\n/***/ }),\n/* 17 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar separateTree = __webpack_require__(30);\n\nvar VALID_DIRECTIONS = ['LR', // left to right\n'RL', // right to left\n'TB', // top to bottom\n'BT', // bottom to top\n'H', // horizontal\n'V' // vertical\n];\nvar HORIZONTAL_DIRECTIONS = ['LR', 'RL', 'H'];\n\nvar isHorizontal = function isHorizontal(direction) {\n return HORIZONTAL_DIRECTIONS.indexOf(direction) > -1;\n};\n\nvar DEFAULT_DIRECTION = VALID_DIRECTIONS[0];\n\nmodule.exports = function (root, options, layoutAlgrithm) {\n var direction = options.direction || DEFAULT_DIRECTION;\n options.isHorizontal = isHorizontal(direction);\n\n if (direction && VALID_DIRECTIONS.indexOf(direction) === -1) {\n throw new TypeError(\"Invalid direction: \" + direction);\n }\n\n if (direction === VALID_DIRECTIONS[0]) {\n // LR\n layoutAlgrithm(root, options);\n } else if (direction === VALID_DIRECTIONS[1]) {\n // RL\n layoutAlgrithm(root, options);\n root.right2left();\n } else if (direction === VALID_DIRECTIONS[2]) {\n // TB\n layoutAlgrithm(root, options);\n } else if (direction === VALID_DIRECTIONS[3]) {\n // BT\n layoutAlgrithm(root, options);\n root.bottom2top();\n } else if (direction === VALID_DIRECTIONS[4] || direction === VALID_DIRECTIONS[5]) {\n // H or V\n // separate into left and right trees\n var _separateTree = separateTree(root, options),\n left = _separateTree.left,\n right = _separateTree.right; // do layout for left and right trees\n\n\n layoutAlgrithm(left, options);\n layoutAlgrithm(right, options);\n options.isHorizontal ? left.right2left() : left.bottom2top(); // combine left and right trees\n\n right.translate(left.x - right.x, left.y - right.y); // translate root\n\n root.x = left.x;\n root.y = right.y;\n var bb = root.getBoundingBox();\n\n if (options.isHorizontal) {\n if (bb.top < 0) {\n root.translate(0, -bb.top);\n }\n } else {\n if (bb.left < 0) {\n root.translate(-bb.left, 0);\n }\n }\n } // fixed root position, default value is true\n\n\n var fixedRoot = options.fixedRoot;\n if (fixedRoot === undefined) fixedRoot = true;\n\n if (fixedRoot) {\n root.translate(-(root.x + root.width / 2 + root.hgap), -(root.y + root.height / 2 + root.vgap));\n }\n\n return root;\n};\n\n/***/ }),\n/* 18 */\n/***/ (function(module, exports, __webpack_require__) {\n\n/* eslint-disable no-cond-assign */\nvar util = __webpack_require__(7);\n\nvar PEM = 18;\nvar DEFAULT_HEIGHT = PEM * 2;\nvar DEFAULT_GAP = PEM;\nvar DEFAULT_OPTIONS = {\n getId: function getId(d) {\n return d.id || d.name;\n },\n getPreH: function getPreH(d) {\n return d.preH || 0;\n },\n getPreV: function getPreV(d) {\n return d.preV || 0;\n },\n getHGap: function getHGap(d) {\n return d.hgap || DEFAULT_GAP;\n },\n getVGap: function getVGap(d) {\n return d.vgap || DEFAULT_GAP;\n },\n getChildren: function getChildren(d) {\n return d.children;\n },\n getHeight: function getHeight(d) {\n return d.height || DEFAULT_HEIGHT;\n },\n getWidth: function getWidth(d) {\n var label = d.label || ' ';\n return d.width || label.split('').length * PEM; // FIXME DO NOT get width like this\n }\n};\n\nfunction Node(data, options) {\n var me = this;\n me.vgap = me.hgap = 0;\n if (data instanceof Node) return data;\n me.data = data;\n /*\n * Gaps: filling space between nodes\n * (x, y) ----------------------\n * | vgap |\n * | -------------------- h\n * | h | | e\n * | g | | i\n * | a | | g\n * | p | | h\n * | --------------------- t\n * | |\n * -----------width------------\n */\n\n var hgap = options.getHGap(data);\n var vgap = options.getVGap(data);\n me.preH = options.getPreH(data);\n me.preV = options.getPreV(data);\n me.width = options.getWidth(data);\n me.height = options.getHeight(data);\n me.width += me.preH;\n me.height += me.preV;\n me.id = options.getId(data);\n me.x = me.y = 0;\n me.depth = 0;\n\n if (!me.children) {\n me.children = [];\n }\n\n me.addGap(hgap, vgap);\n return me;\n}\n\nutil.assign(Node.prototype, {\n isRoot: function isRoot() {\n return this.depth === 0;\n },\n isLeaf: function isLeaf() {\n return this.children.length === 0;\n },\n addGap: function addGap(hgap, vgap) {\n var me = this;\n me.hgap += hgap;\n me.vgap += vgap;\n me.width += 2 * hgap;\n me.height += 2 * vgap;\n },\n eachNode: function eachNode(callback) {\n // Depth First traverse\n var me = this;\n var nodes = [me];\n var current;\n\n while (current = nodes.shift()) {\n callback(current);\n nodes = current.children.concat(nodes);\n }\n },\n DFTraverse: function DFTraverse(callback) {\n // Depth First traverse\n this.eachNode(callback);\n },\n BFTraverse: function BFTraverse(callback) {\n // Breadth First traverse\n var me = this;\n var nodes = [me];\n var current;\n\n while (current = nodes.shift()) {\n callback(current);\n nodes = nodes.concat(current.children);\n }\n },\n getBoundingBox: function getBoundingBox() {\n // BBox for just one tree node\n var bb = {\n left: Number.MAX_VALUE,\n top: Number.MAX_VALUE,\n width: 0,\n height: 0\n };\n this.eachNode(function (node) {\n bb.left = Math.min(bb.left, node.x);\n bb.top = Math.min(bb.top, node.y);\n bb.width = Math.max(bb.width, node.x + node.width);\n bb.height = Math.max(bb.height, node.y + node.height);\n });\n return bb;\n },\n // translate\n translate: function translate(tx, ty) {\n if (tx === void 0) {\n tx = 0;\n }\n\n if (ty === void 0) {\n ty = 0;\n }\n\n this.eachNode(function (node) {\n node.x += tx;\n node.y += ty;\n node.x += node.preH;\n node.y += node.preV;\n });\n },\n right2left: function right2left() {\n var me = this;\n var bb = me.getBoundingBox();\n me.eachNode(function (node) {\n node.x = node.x - (node.x - bb.left) * 2 - node.width; // node.x = - node.x;\n });\n me.translate(bb.width, 0);\n },\n bottom2top: function bottom2top() {\n var me = this;\n var bb = me.getBoundingBox();\n me.eachNode(function (node) {\n node.y = node.y - (node.y - bb.top) * 2 - node.height; // node.y = - node.y;\n });\n me.translate(0, bb.height);\n }\n});\n\nfunction hierarchy(data, options, isolated) {\n if (options === void 0) {\n options = {};\n }\n\n options = util.assign({}, DEFAULT_OPTIONS, options);\n var root = new Node(data, options);\n var nodes = [root];\n var node;\n\n if (!isolated && !data.collapsed) {\n while (node = nodes.shift()) {\n if (!node.data.collapsed) {\n var children = options.getChildren(node.data);\n var length = children ? children.length : 0;\n node.children = new Array(length);\n\n if (children && length) {\n for (var i = 0; i < length; i++) {\n var child = new Node(children[i], options);\n node.children[i] = child;\n nodes.push(child);\n child.parent = node;\n child.depth = node.depth + 1;\n }\n }\n }\n }\n }\n\n return root;\n}\n\nmodule.exports = hierarchy;\n\n/***/ }),\n/* 19 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__keys__ = __webpack_require__(20);\n\n\n\nfunction isMatch(obj, attrs) {\n var _keys = Object(__WEBPACK_IMPORTED_MODULE_1__keys__[\"a\" /* default */])(attrs);\n\n var length = _keys.length;\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(obj)) return !length;\n\n for (var i = 0; i < length; i += 1) {\n var key = _keys[i];\n\n if (attrs[key] !== obj[key] || !(key in obj)) {\n return false;\n }\n }\n\n return true;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isMatch);\n\n/***/ }),\n/* 20 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);\n\n\nvar keys = Object.keys ? function (obj) {\n return Object.keys(obj);\n} : function (obj) {\n var result = [];\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(obj, function (value, key) {\n if (!(Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(obj) && key === 'prototype')) {\n result.push(key);\n }\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (keys);\n\n/***/ }),\n/* 21 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nvar splice = Array.prototype.splice;\n\nvar pullAt = function pullAt(arr, indexes) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return [];\n }\n\n var length = arr ? indexes.length : 0;\n var last = length - 1;\n\n while (length--) {\n var previous = void 0;\n var index = indexes[length];\n\n if (length === last || index !== previous) {\n previous = index;\n splice.call(arr, index, 1);\n }\n }\n\n return arr;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (pullAt);\n\n/***/ }),\n/* 22 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__contains__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__each__ = __webpack_require__(2);\n\n\n\nvar uniq = function (arr) {\n var resultArr = [];\n Object(__WEBPACK_IMPORTED_MODULE_1__each__[\"a\" /* default */])(arr, function (item) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__contains__[\"a\" /* default */])(resultArr, item)) {\n resultArr.push(item);\n }\n });\n return resultArr;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (uniq);\n\n/***/ }),\n/* 23 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__group_by__ = __webpack_require__(24);\n\n\n\n\nvar groupToMap = function (data, condition) {\n if (!condition) {\n return {\n 0: data\n };\n }\n\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(condition)) {\n var paramsCondition_1 = Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(condition) ? condition : condition.replace(/\\s+/g, '').split('*');\n\n condition = function (row) {\n var unique = '_'; // 避免出现数字作为Key的情况,会进行按照数字的排序\n\n for (var i = 0, l = paramsCondition_1.length; i < l; i++) {\n unique += row[paramsCondition_1[i]] && row[paramsCondition_1[i]].toString();\n }\n\n return unique;\n };\n }\n\n var groups = Object(__WEBPACK_IMPORTED_MODULE_2__group_by__[\"a\" /* default */])(data, condition);\n return groups;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (groupToMap);\n\n/***/ }),\n/* 24 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(3);\n\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction groupBy(data, condition) {\n if (!condition || !Object(__WEBPACK_IMPORTED_MODULE_1__is_array__[\"a\" /* default */])(data)) {\n return {};\n }\n\n var result = {}; // 兼容方法和 字符串的写法\n\n var predicate = Object(__WEBPACK_IMPORTED_MODULE_2__is_function__[\"a\" /* default */])(condition) ? condition : function (item) {\n return item[condition];\n };\n var key;\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(data, function (item) {\n key = predicate(item);\n\n if (hasOwnProperty.call(result, key)) {\n result[key].push(item);\n } else {\n result[key] = [item];\n }\n });\n return result;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (groupBy);\n\n/***/ }),\n/* 25 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, key) {\n return obj.hasOwnProperty(key);\n});\n\n/***/ }),\n/* 26 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);\n\n // @ts-ignore\n\nvar values = Object.values ? function (obj) {\n return Object.values(obj);\n} : function (obj) {\n var result = [];\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(obj, function (value, key) {\n if (!(Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(obj) && key === 'prototype')) {\n result.push(value);\n }\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (values);\n\n/***/ }),\n/* 27 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar toString = {}.toString;\n\nvar getType = function (value) {\n return toString.call(value).replace(/^\\[object /, '').replace(/]$/, '');\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (getType);\n\n/***/ }),\n/* 28 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar objectProto = Object.prototype;\n\nvar isPrototype = function (value) {\n var Ctor = value && value.constructor;\n var proto = typeof Ctor === 'function' && Ctor.prototype || objectProto;\n return value === proto;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isPrototype);\n\n/***/ }),\n/* 29 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object_like__ = __webpack_require__(15);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_string__ = __webpack_require__(8);\n\n\n\n\nvar isEqual = function (value, other) {\n if (value === other) {\n return true;\n }\n\n if (!value || !other) {\n return false;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_2__is_string__[\"a\" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_2__is_string__[\"a\" /* default */])(other)) {\n return false;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(other)) {\n if (value.length !== other.length) {\n return false;\n }\n\n var rst = true;\n\n for (var i = 0; i < value.length; i++) {\n rst = isEqual(value[i], other[i]);\n\n if (!rst) {\n break;\n }\n }\n\n return rst;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__[\"a\" /* default */])(value) || Object(__WEBPACK_IMPORTED_MODULE_0__is_object_like__[\"a\" /* default */])(other)) {\n var valueKeys = Object.keys(value);\n var otherKeys = Object.keys(other);\n\n if (valueKeys.length !== otherKeys.length) {\n return false;\n }\n\n var rst = true;\n\n for (var i = 0; i < valueKeys.length; i++) {\n rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);\n\n if (!rst) {\n break;\n }\n }\n\n return rst;\n }\n\n return false;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isEqual);\n\n/***/ }),\n/* 30 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar hierarchy = __webpack_require__(18);\n\nmodule.exports = function (root, options) {\n // separate into left and right trees\n var left = hierarchy(root.data, options, true); // root only\n\n var right = hierarchy(root.data, options, true); // root only\n // automatically\n\n var treeSize = root.children.length;\n var rightTreeSize = Math.round(treeSize / 2); // separate left and right tree by meta data\n\n var getSide = options.getSide || function (child, index) {\n if (index < rightTreeSize) {\n return 'right';\n }\n\n return 'left';\n };\n\n for (var i = 0; i < treeSize; i++) {\n var child = root.children[i];\n var side = getSide(child, i);\n\n if (side === 'right') {\n right.children.push(child);\n } else {\n left.children.push(child);\n }\n }\n\n left.eachNode(function (node) {\n if (!node.isRoot()) {\n node.side = 'left';\n }\n });\n right.eachNode(function (node) {\n if (!node.isRoot()) {\n node.side = 'right';\n }\n });\n return {\n left: left,\n right: right\n };\n};\n\n/***/ }),\n/* 31 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar hierarchy = {\n compactBox: __webpack_require__(32),\n dendrogram: __webpack_require__(114),\n indented: __webpack_require__(116),\n mindmap: __webpack_require__(118)\n};\nmodule.exports = hierarchy;\n\n/***/ }),\n/* 32 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar TreeLayout = __webpack_require__(11);\n\nvar nonLayeredTidyTree = __webpack_require__(113);\n\nvar doTreeLayout = __webpack_require__(17);\n\nvar util = __webpack_require__(7);\n\nvar CompactBoxTreeLayout = /*#__PURE__*/function (_TreeLayout) {\n _inheritsLoose(CompactBoxTreeLayout, _TreeLayout);\n\n function CompactBoxTreeLayout() {\n return _TreeLayout.apply(this, arguments) || this;\n }\n\n var _proto = CompactBoxTreeLayout.prototype;\n\n _proto.execute = function execute() {\n var me = this;\n return doTreeLayout(me.rootNode, me.options, nonLayeredTidyTree);\n };\n\n return CompactBoxTreeLayout;\n}(TreeLayout);\n\nvar DEFAULT_OPTIONS = {};\n\nfunction compactBoxLayout(root, options) {\n options = util.assign({}, DEFAULT_OPTIONS, options);\n return new CompactBoxTreeLayout(root, options).execute();\n}\n\nmodule.exports = compactBoxLayout;\n\n/***/ }),\n/* 33 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nObject.defineProperty(__webpack_exports__, \"__esModule\", { value: true });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__contains__ = __webpack_require__(12);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"contains\", function() { return __WEBPACK_IMPORTED_MODULE_0__contains__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"includes\", function() { return __WEBPACK_IMPORTED_MODULE_0__contains__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__difference__ = __webpack_require__(34);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"difference\", function() { return __WEBPACK_IMPORTED_MODULE_1__difference__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__find__ = __webpack_require__(35);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"find\", function() { return __WEBPACK_IMPORTED_MODULE_2__find__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__find_index__ = __webpack_require__(36);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"findIndex\", function() { return __WEBPACK_IMPORTED_MODULE_3__find_index__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_4__first_value__ = __webpack_require__(37);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"firstValue\", function() { return __WEBPACK_IMPORTED_MODULE_4__first_value__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_5__flatten__ = __webpack_require__(38);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"flatten\", function() { return __WEBPACK_IMPORTED_MODULE_5__flatten__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_6__flatten_deep__ = __webpack_require__(39);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"flattenDeep\", function() { return __WEBPACK_IMPORTED_MODULE_6__flatten_deep__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_7__get_range__ = __webpack_require__(40);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"getRange\", function() { return __WEBPACK_IMPORTED_MODULE_7__get_range__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_8__pull__ = __webpack_require__(41);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"pull\", function() { return __WEBPACK_IMPORTED_MODULE_8__pull__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_9__pull_at__ = __webpack_require__(21);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"pullAt\", function() { return __WEBPACK_IMPORTED_MODULE_9__pull_at__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_10__reduce__ = __webpack_require__(42);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"reduce\", function() { return __WEBPACK_IMPORTED_MODULE_10__reduce__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_11__remove__ = __webpack_require__(43);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return __WEBPACK_IMPORTED_MODULE_11__remove__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_12__sort_by__ = __webpack_require__(44);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"sortBy\", function() { return __WEBPACK_IMPORTED_MODULE_12__sort_by__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_13__union__ = __webpack_require__(45);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"union\", function() { return __WEBPACK_IMPORTED_MODULE_13__union__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_14__uniq__ = __webpack_require__(22);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"uniq\", function() { return __WEBPACK_IMPORTED_MODULE_14__uniq__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_15__values_of_key__ = __webpack_require__(46);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"valuesOfKey\", function() { return __WEBPACK_IMPORTED_MODULE_15__values_of_key__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_16__head__ = __webpack_require__(47);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"head\", function() { return __WEBPACK_IMPORTED_MODULE_16__head__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_17__last__ = __webpack_require__(48);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"last\", function() { return __WEBPACK_IMPORTED_MODULE_17__last__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_18__starts_with__ = __webpack_require__(49);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"startsWith\", function() { return __WEBPACK_IMPORTED_MODULE_18__starts_with__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_19__ends_with__ = __webpack_require__(50);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"endsWith\", function() { return __WEBPACK_IMPORTED_MODULE_19__ends_with__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_20__filter__ = __webpack_require__(14);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return __WEBPACK_IMPORTED_MODULE_20__filter__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_21__every__ = __webpack_require__(51);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"every\", function() { return __WEBPACK_IMPORTED_MODULE_21__every__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_22__some__ = __webpack_require__(52);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"some\", function() { return __WEBPACK_IMPORTED_MODULE_22__some__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_23__group__ = __webpack_require__(53);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"group\", function() { return __WEBPACK_IMPORTED_MODULE_23__group__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_24__group_by__ = __webpack_require__(24);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"groupBy\", function() { return __WEBPACK_IMPORTED_MODULE_24__group_by__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_25__group_to_map__ = __webpack_require__(23);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"groupToMap\", function() { return __WEBPACK_IMPORTED_MODULE_25__group_to_map__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_26__get_wrap_behavior__ = __webpack_require__(54);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"getWrapBehavior\", function() { return __WEBPACK_IMPORTED_MODULE_26__get_wrap_behavior__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_27__wrap_behavior__ = __webpack_require__(55);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"wrapBehavior\", function() { return __WEBPACK_IMPORTED_MODULE_27__wrap_behavior__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_28__number2color__ = __webpack_require__(56);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"number2color\", function() { return __WEBPACK_IMPORTED_MODULE_28__number2color__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_29__parse_radius__ = __webpack_require__(57);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"parseRadius\", function() { return __WEBPACK_IMPORTED_MODULE_29__parse_radius__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_30__clamp__ = __webpack_require__(58);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"clamp\", function() { return __WEBPACK_IMPORTED_MODULE_30__clamp__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_31__fixed_base__ = __webpack_require__(59);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"fixedBase\", function() { return __WEBPACK_IMPORTED_MODULE_31__fixed_base__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_32__is_decimal__ = __webpack_require__(60);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isDecimal\", function() { return __WEBPACK_IMPORTED_MODULE_32__is_decimal__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_33__is_even__ = __webpack_require__(61);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isEven\", function() { return __WEBPACK_IMPORTED_MODULE_33__is_even__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_34__is_integer__ = __webpack_require__(62);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isInteger\", function() { return __WEBPACK_IMPORTED_MODULE_34__is_integer__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_35__is_negative__ = __webpack_require__(63);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNegative\", function() { return __WEBPACK_IMPORTED_MODULE_35__is_negative__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_36__is_number_equal__ = __webpack_require__(64);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumberEqual\", function() { return __WEBPACK_IMPORTED_MODULE_36__is_number_equal__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_37__is_odd__ = __webpack_require__(65);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isOdd\", function() { return __WEBPACK_IMPORTED_MODULE_37__is_odd__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_38__is_positive__ = __webpack_require__(66);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isPositive\", function() { return __WEBPACK_IMPORTED_MODULE_38__is_positive__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_39__max_by__ = __webpack_require__(67);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"maxBy\", function() { return __WEBPACK_IMPORTED_MODULE_39__max_by__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_40__min_by__ = __webpack_require__(68);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"minBy\", function() { return __WEBPACK_IMPORTED_MODULE_40__min_by__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_41__mod__ = __webpack_require__(69);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"mod\", function() { return __WEBPACK_IMPORTED_MODULE_41__mod__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_42__to_degree__ = __webpack_require__(70);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toDegree\", function() { return __WEBPACK_IMPORTED_MODULE_42__to_degree__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_43__to_integer__ = __webpack_require__(71);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toInteger\", function() { return __WEBPACK_IMPORTED_MODULE_43__to_integer__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_44__to_radian__ = __webpack_require__(72);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return __WEBPACK_IMPORTED_MODULE_44__to_radian__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_45__for_in__ = __webpack_require__(73);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"forIn\", function() { return __WEBPACK_IMPORTED_MODULE_45__for_in__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_46__has__ = __webpack_require__(25);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return __WEBPACK_IMPORTED_MODULE_46__has__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_47__has_key__ = __webpack_require__(74);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"hasKey\", function() { return __WEBPACK_IMPORTED_MODULE_47__has_key__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_48__has_value__ = __webpack_require__(75);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"hasValue\", function() { return __WEBPACK_IMPORTED_MODULE_48__has_value__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_49__keys__ = __webpack_require__(20);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return __WEBPACK_IMPORTED_MODULE_49__keys__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_50__is_match__ = __webpack_require__(19);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isMatch\", function() { return __WEBPACK_IMPORTED_MODULE_50__is_match__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_51__values__ = __webpack_require__(26);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return __WEBPACK_IMPORTED_MODULE_51__values__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_52__lower_case__ = __webpack_require__(76);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"lowerCase\", function() { return __WEBPACK_IMPORTED_MODULE_52__lower_case__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_53__lower_first__ = __webpack_require__(77);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"lowerFirst\", function() { return __WEBPACK_IMPORTED_MODULE_53__lower_first__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_54__substitute__ = __webpack_require__(78);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"substitute\", function() { return __WEBPACK_IMPORTED_MODULE_54__substitute__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_55__upper_case__ = __webpack_require__(79);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"upperCase\", function() { return __WEBPACK_IMPORTED_MODULE_55__upper_case__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_56__upper_first__ = __webpack_require__(80);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"upperFirst\", function() { return __WEBPACK_IMPORTED_MODULE_56__upper_first__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_57__get_type__ = __webpack_require__(27);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return __WEBPACK_IMPORTED_MODULE_57__get_type__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_58__is_arguments__ = __webpack_require__(81);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isArguments\", function() { return __WEBPACK_IMPORTED_MODULE_58__is_arguments__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_59__is_array__ = __webpack_require__(0);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isArray\", function() { return __WEBPACK_IMPORTED_MODULE_59__is_array__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_60__is_array_like__ = __webpack_require__(1);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isArrayLike\", function() { return __WEBPACK_IMPORTED_MODULE_60__is_array_like__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_61__is_boolean__ = __webpack_require__(82);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isBoolean\", function() { return __WEBPACK_IMPORTED_MODULE_61__is_boolean__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_62__is_date__ = __webpack_require__(83);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isDate\", function() { return __WEBPACK_IMPORTED_MODULE_62__is_date__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_63__is_error__ = __webpack_require__(84);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isError\", function() { return __WEBPACK_IMPORTED_MODULE_63__is_error__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_64__is_function__ = __webpack_require__(3);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isFunction\", function() { return __WEBPACK_IMPORTED_MODULE_64__is_function__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_65__is_finite__ = __webpack_require__(85);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isFinite\", function() { return __WEBPACK_IMPORTED_MODULE_65__is_finite__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_66__is_nil__ = __webpack_require__(6);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNil\", function() { return __WEBPACK_IMPORTED_MODULE_66__is_nil__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_67__is_null__ = __webpack_require__(86);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNull\", function() { return __WEBPACK_IMPORTED_MODULE_67__is_null__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_68__is_number__ = __webpack_require__(5);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return __WEBPACK_IMPORTED_MODULE_68__is_number__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_69__is_object__ = __webpack_require__(13);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return __WEBPACK_IMPORTED_MODULE_69__is_object__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_70__is_object_like__ = __webpack_require__(15);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isObjectLike\", function() { return __WEBPACK_IMPORTED_MODULE_70__is_object_like__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_71__is_plain_object__ = __webpack_require__(9);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isPlainObject\", function() { return __WEBPACK_IMPORTED_MODULE_71__is_plain_object__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_72__is_prototype__ = __webpack_require__(28);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isPrototype\", function() { return __WEBPACK_IMPORTED_MODULE_72__is_prototype__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_73__is_reg_exp__ = __webpack_require__(87);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isRegExp\", function() { return __WEBPACK_IMPORTED_MODULE_73__is_reg_exp__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_74__is_string__ = __webpack_require__(8);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isString\", function() { return __WEBPACK_IMPORTED_MODULE_74__is_string__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_75__is_type__ = __webpack_require__(4);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isType\", function() { return __WEBPACK_IMPORTED_MODULE_75__is_type__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_76__is_undefined__ = __webpack_require__(88);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isUndefined\", function() { return __WEBPACK_IMPORTED_MODULE_76__is_undefined__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_77__is_element__ = __webpack_require__(89);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isElement\", function() { return __WEBPACK_IMPORTED_MODULE_77__is_element__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_78__request_animation_frame__ = __webpack_require__(90);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"requestAnimationFrame\", function() { return __WEBPACK_IMPORTED_MODULE_78__request_animation_frame__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_79__clear_animation_frame__ = __webpack_require__(91);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"clearAnimationFrame\", function() { return __WEBPACK_IMPORTED_MODULE_79__clear_animation_frame__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_80__augment__ = __webpack_require__(92);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"augment\", function() { return __WEBPACK_IMPORTED_MODULE_80__augment__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_81__clone__ = __webpack_require__(93);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return __WEBPACK_IMPORTED_MODULE_81__clone__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_82__debounce__ = __webpack_require__(94);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return __WEBPACK_IMPORTED_MODULE_82__debounce__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_83__memoize__ = __webpack_require__(95);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"memoize\", function() { return __WEBPACK_IMPORTED_MODULE_83__memoize__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_84__deep_mix__ = __webpack_require__(96);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"deepMix\", function() { return __WEBPACK_IMPORTED_MODULE_84__deep_mix__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_85__each__ = __webpack_require__(2);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"each\", function() { return __WEBPACK_IMPORTED_MODULE_85__each__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_86__extend__ = __webpack_require__(97);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return __WEBPACK_IMPORTED_MODULE_86__extend__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_87__index_of__ = __webpack_require__(98);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"indexOf\", function() { return __WEBPACK_IMPORTED_MODULE_87__index_of__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_88__is_empty__ = __webpack_require__(99);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isEmpty\", function() { return __WEBPACK_IMPORTED_MODULE_88__is_empty__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_89__is_equal__ = __webpack_require__(29);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isEqual\", function() { return __WEBPACK_IMPORTED_MODULE_89__is_equal__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_90__is_equal_with__ = __webpack_require__(100);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"isEqualWith\", function() { return __WEBPACK_IMPORTED_MODULE_90__is_equal_with__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_91__map__ = __webpack_require__(101);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return __WEBPACK_IMPORTED_MODULE_91__map__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_92__map_values__ = __webpack_require__(102);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"mapValues\", function() { return __WEBPACK_IMPORTED_MODULE_92__map_values__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_93__mix__ = __webpack_require__(16);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"mix\", function() { return __WEBPACK_IMPORTED_MODULE_93__mix__[\"a\"]; });\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"assign\", function() { return __WEBPACK_IMPORTED_MODULE_93__mix__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_94__get__ = __webpack_require__(103);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return __WEBPACK_IMPORTED_MODULE_94__get__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_95__set__ = __webpack_require__(104);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return __WEBPACK_IMPORTED_MODULE_95__set__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_96__pick__ = __webpack_require__(105);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"pick\", function() { return __WEBPACK_IMPORTED_MODULE_96__pick__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_97__throttle__ = __webpack_require__(106);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return __WEBPACK_IMPORTED_MODULE_97__throttle__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_98__to_array__ = __webpack_require__(107);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toArray\", function() { return __WEBPACK_IMPORTED_MODULE_98__to_array__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_99__to_string__ = __webpack_require__(10);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"toString\", function() { return __WEBPACK_IMPORTED_MODULE_99__to_string__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_100__unique_id__ = __webpack_require__(108);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return __WEBPACK_IMPORTED_MODULE_100__unique_id__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_101__noop__ = __webpack_require__(109);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"noop\", function() { return __WEBPACK_IMPORTED_MODULE_101__noop__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_102__identity__ = __webpack_require__(110);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return __WEBPACK_IMPORTED_MODULE_102__identity__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_103__size__ = __webpack_require__(111);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"size\", function() { return __WEBPACK_IMPORTED_MODULE_103__size__[\"a\"]; });\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_104__cache__ = __webpack_require__(112);\n/* harmony reexport (binding) */ __webpack_require__.d(__webpack_exports__, \"Cache\", function() { return __WEBPACK_IMPORTED_MODULE_104__cache__[\"a\"]; });\n// array\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // event\n\n\n // format\n\n\n // math\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // object\n\n\n\n\n\n\n\n // string\n\n\n\n\n\n // type\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // other\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n // 不知道为什么,需要把这个 export,不然 ts 会报类型错误\n\n\n\n/***/ }),\n/* 34 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__filter__ = __webpack_require__(14);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__contains__ = __webpack_require__(12);\n\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to inspect.\n * @param {Array} values The values to exclude.\n * @return {Array} Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3]); // => [1]\n */\n\nvar difference = function (arr, values) {\n if (values === void 0) {\n values = [];\n }\n\n return Object(__WEBPACK_IMPORTED_MODULE_0__filter__[\"a\" /* default */])(arr, function (value) {\n return !Object(__WEBPACK_IMPORTED_MODULE_1__contains__[\"a\" /* default */])(values, value);\n });\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (difference);\n\n/***/ }),\n/* 35 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(3);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_match__ = __webpack_require__(19);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_plain_object__ = __webpack_require__(9);\n\n\n\n\n\nfunction find(arr, predicate) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_2__is_array__[\"a\" /* default */])(arr)) return null;\n\n var _predicate;\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_function__[\"a\" /* default */])(predicate)) {\n _predicate = predicate;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_3__is_plain_object__[\"a\" /* default */])(predicate)) {\n _predicate = function (a) {\n return Object(__WEBPACK_IMPORTED_MODULE_1__is_match__[\"a\" /* default */])(a, predicate);\n };\n }\n\n if (_predicate) {\n for (var i = 0; i < arr.length; i += 1) {\n if (_predicate(arr[i])) {\n return arr[i];\n }\n }\n }\n\n return null;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (find);\n\n/***/ }),\n/* 36 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nfunction findIndex(arr, predicate, fromIndex) {\n if (fromIndex === void 0) {\n fromIndex = 0;\n }\n\n for (var i = fromIndex; i < arr.length; i++) {\n if (predicate(arr[i], i)) {\n // 找到终止循环\n return i;\n }\n }\n\n return -1;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (findIndex);\n\n/***/ }),\n/* 37 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);\n\n\n\nvar firstValue = function (data, name) {\n var rst = null;\n\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(value)) {\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array__[\"a\" /* default */])(value)) {\n rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云\n } else {\n rst = value;\n }\n\n break;\n }\n }\n\n return rst;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (firstValue);\n\n/***/ }),\n/* 38 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]\n */\n\nvar flatten = function (arr) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr)) {\n return [];\n }\n\n var rst = [];\n\n for (var i = 0; i < arr.length; i++) {\n rst = rst.concat(arr[i]);\n }\n\n return rst;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (flatten);\n\n/***/ }),\n/* 39 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @param {Array} result The array to return.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]\n */\n\nvar flattenDeep = function (arr, result) {\n if (result === void 0) {\n result = [];\n }\n\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr)) {\n result.push(arr);\n } else {\n for (var i = 0; i < arr.length; i += 1) {\n flattenDeep(arr[i], result);\n }\n }\n\n return result;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (flattenDeep);\n\n/***/ }),\n/* 40 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__filter__ = __webpack_require__(14);\n\n\n\nvar getRange = function (values) {\n // 存在 NaN 时,min,max 判定会出问题\n values = Object(__WEBPACK_IMPORTED_MODULE_1__filter__[\"a\" /* default */])(values, function (v) {\n return !isNaN(v);\n });\n\n if (!values.length) {\n // 如果没有数值则直接返回0\n return {\n min: 0,\n max: 0\n };\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(values[0])) {\n var tmp = [];\n\n for (var i = 0; i < values.length; i++) {\n tmp = tmp.concat(values[i]);\n }\n\n values = tmp;\n }\n\n var max = Math.max.apply(null, values);\n var min = Math.min.apply(null, values);\n return {\n min: min,\n max: max\n };\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (getRange);\n\n/***/ }),\n/* 41 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar arrPrototype = Array.prototype;\nvar splice = arrPrototype.splice;\nvar indexOf = arrPrototype.indexOf;\n\nvar pull = function (arr) {\n var values = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n var fromIndex = -1;\n\n while ((fromIndex = indexOf.call(arr, value)) > -1) {\n splice.call(arr, fromIndex, 1);\n }\n }\n\n return arr;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (pull);\n\n/***/ }),\n/* 42 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_plain_object__ = __webpack_require__(9);\n\n\n\n\nvar reduce = function (arr, fn, init) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__[\"a\" /* default */])(arr) && !Object(__WEBPACK_IMPORTED_MODULE_2__is_plain_object__[\"a\" /* default */])(arr)) {\n return arr;\n }\n\n var result = init;\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(arr, function (data, i) {\n result = fn(result, data, i);\n });\n return result;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (reduce);\n\n/***/ }),\n/* 43 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__pull_at__ = __webpack_require__(21);\n\n\n\nvar remove = function (arr, predicate) {\n /**\n * const arr = [1, 2, 3, 4]\n * const evens = remove(arr, n => n % 2 == 0)\n * console.log(arr) // => [1, 3]\n * console.log(evens) // => [2, 4]\n */\n var result = [];\n\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return result;\n }\n\n var i = -1;\n var indexes = [];\n var length = arr.length;\n\n while (++i < length) {\n var value = arr[i];\n\n if (predicate(value, i, arr)) {\n result.push(value);\n indexes.push(i);\n }\n }\n\n Object(__WEBPACK_IMPORTED_MODULE_1__pull_at__[\"a\" /* default */])(arr, indexes);\n return result;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (remove);\n\n/***/ }),\n/* 44 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(3);\n\n\n\n\nfunction sortBy(arr, key) {\n var comparer;\n\n if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__[\"a\" /* default */])(key)) {\n comparer = function (a, b) {\n return key(a) - key(b);\n };\n } else {\n var keys_1 = [];\n\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_string__[\"a\" /* default */])(key)) {\n keys_1.push(key);\n } else if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(key)) {\n keys_1 = key;\n }\n\n comparer = function (a, b) {\n for (var i = 0; i < keys_1.length; i += 1) {\n var prop = keys_1[i];\n\n if (a[prop] > b[prop]) {\n return 1;\n }\n\n if (a[prop] < b[prop]) {\n return -1;\n }\n }\n\n return 0;\n };\n }\n\n arr.sort(comparer);\n return arr;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (sortBy);\n\n/***/ }),\n/* 45 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__uniq__ = __webpack_require__(22);\n\n\nvar union = function () {\n var sources = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n\n return Object(__WEBPACK_IMPORTED_MODULE_0__uniq__[\"a\" /* default */])([].concat.apply([], sources));\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (union);\n\n/***/ }),\n/* 46 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_nil__ = __webpack_require__(6);\n\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (data, name) {\n var rst = [];\n var tmpMap = {};\n data.forEach(function (obj) {\n var value = obj[name];\n\n if (!Object(__WEBPACK_IMPORTED_MODULE_2__is_nil__[\"a\" /* default */])(value)) {\n // flatten\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__[\"a\" /* default */])(value)) {\n value = [value];\n }\n\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(value, function (val) {\n // unique\n if (!tmpMap[val]) {\n rst.push(val);\n tmpMap[val] = true;\n }\n });\n }\n });\n return rst;\n});\n\n/***/ }),\n/* 47 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = head;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nfunction head(o) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(o)) {\n return o[0];\n }\n\n return undefined;\n}\n\n/***/ }),\n/* 48 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = last;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\nfunction last(o) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(o)) {\n var arr = o;\n return arr[arr.length - 1];\n }\n\n return undefined;\n}\n\n/***/ }),\n/* 49 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(8);\n\n\n\nfunction startsWith(arr, e) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__is_string__[\"a\" /* default */])(arr) ? arr[0] === e : false;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (startsWith);\n\n/***/ }),\n/* 50 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(8);\n\n\n\nfunction endsWith(arr, e) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(arr) || Object(__WEBPACK_IMPORTED_MODULE_1__is_string__[\"a\" /* default */])(arr) ? arr[arr.length - 1] === e : false;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (endsWith);\n\n/***/ }),\n/* 51 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 只要有一个不满足条件就返回 false\n * @param arr\n * @param func\n */\nvar every = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (!func(arr[i], i)) return false;\n }\n\n return true;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (every);\n\n/***/ }),\n/* 52 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 只要有一个满足条件就返回 true\n * @param arr\n * @param func\n */\nvar some = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (func(arr[i], i)) return true;\n }\n\n return false;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (some);\n\n/***/ }),\n/* 53 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__group_to_map__ = __webpack_require__(23);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (data, condition) {\n if (!condition) {\n // 没有条件,则自身改成数组\n return [data];\n }\n\n var groups = Object(__WEBPACK_IMPORTED_MODULE_0__group_to_map__[\"a\" /* default */])(data, condition);\n var array = [];\n\n for (var i in groups) {\n array.push(groups[i]);\n }\n\n return array;\n});\n\n/***/ }),\n/* 54 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 获取封装的事件\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction getWrapBehavior(obj, action) {\n return obj['_wrap_' + action];\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (getWrapBehavior);\n\n/***/ }),\n/* 55 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 封装事件,便于使用上下文this,和便于解除事件时使用\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction wrapBehavior(obj, action) {\n if (obj['_wrap_' + action]) {\n return obj['_wrap_' + action];\n }\n\n var method = function (e) {\n obj[action](e);\n };\n\n obj['_wrap_' + action] = method;\n return method;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (wrapBehavior);\n\n/***/ }),\n/* 56 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar numColorCache = {};\n\nfunction numberToColor(num) {\n // 增加缓存\n var color = numColorCache[num];\n\n if (!color) {\n var str = num.toString(16);\n\n for (var i = str.length; i < 6; i++) {\n str = '0' + str;\n }\n\n color = '#' + str;\n numColorCache[num] = color;\n }\n\n return color;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (numberToColor);\n\n/***/ }),\n/* 57 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\n\nfunction parseRadius(radius) {\n var r1 = 0,\n r2 = 0,\n r3 = 0,\n r4 = 0;\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(radius)) {\n if (radius.length === 1) {\n r1 = r2 = r3 = r4 = radius[0];\n } else if (radius.length === 2) {\n r1 = r3 = radius[0];\n r2 = r4 = radius[1];\n } else if (radius.length === 3) {\n r1 = radius[0];\n r2 = r4 = radius[1];\n r3 = radius[2];\n } else {\n r1 = radius[0];\n r2 = radius[1];\n r3 = radius[2];\n r4 = radius[3];\n }\n } else {\n r1 = r2 = r3 = r4 = radius;\n }\n\n return {\n r1: r1,\n r2: r2,\n r3: r3,\n r4: r4\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (parseRadius);\n\n/***/ }),\n/* 58 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar clamp = function (a, min, max) {\n if (a < min) {\n return min;\n } else if (a > max) {\n return max;\n }\n\n return a;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (clamp);\n\n/***/ }),\n/* 59 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar fixedBase = function (v, base) {\n var str = base.toString();\n var index = str.indexOf('.');\n\n if (index === -1) {\n return Math.round(v);\n }\n\n var length = str.substr(index + 1).length;\n\n if (length > 20) {\n length = 20;\n }\n\n return parseFloat(v.toFixed(length));\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (fixedBase);\n\n/***/ }),\n/* 60 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\n\nvar isDecimal = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num % 1 !== 0;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isDecimal);\n\n/***/ }),\n/* 61 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\n\nvar isEven = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num % 2 === 0;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isEven);\n\n/***/ }),\n/* 62 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\nvar isInteger = Number.isInteger ? Number.isInteger : function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num % 1 === 0;\n};\n/* harmony default export */ __webpack_exports__[\"a\"] = (isInteger);\n\n/***/ }),\n/* 63 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\n\nvar isNegative = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num < 0;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isNegative);\n\n/***/ }),\n/* 64 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = isNumberEqual;\nvar PRECISION = 0.00001; // numbers less than this is considered as 0\n\nfunction isNumberEqual(a, b, precision) {\n if (precision === void 0) {\n precision = PRECISION;\n }\n\n return Math.abs(a - b) < precision;\n}\n;\n\n/***/ }),\n/* 65 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\n\nvar isOdd = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num % 2 !== 0;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isOdd);\n\n/***/ }),\n/* 66 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n\n\nvar isPositive = function (num) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(num) && num > 0;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isPositive);\n\n/***/ }),\n/* 67 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(3);\n\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (arr, fn) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__[\"a\" /* default */])(arr)) {\n return undefined;\n }\n\n var max = arr[0];\n var maxData;\n\n if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__[\"a\" /* default */])(fn)) {\n maxData = fn(arr[0]);\n } else {\n maxData = arr[0][fn];\n }\n\n var data;\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(arr, function (val) {\n if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__[\"a\" /* default */])(fn)) {\n data = fn(val);\n } else {\n data = val[fn];\n }\n\n if (data > maxData) {\n max = val;\n maxData = data;\n }\n });\n return max;\n});\n\n/***/ }),\n/* 68 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_function__ = __webpack_require__(3);\n\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (arr, fn) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array__[\"a\" /* default */])(arr)) {\n return undefined;\n }\n\n var min = arr[0];\n var minData;\n\n if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__[\"a\" /* default */])(fn)) {\n minData = fn(arr[0]);\n } else {\n minData = arr[0][fn];\n }\n\n var data;\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(arr, function (val) {\n if (Object(__WEBPACK_IMPORTED_MODULE_2__is_function__[\"a\" /* default */])(fn)) {\n data = fn(val);\n } else {\n data = val[fn];\n }\n\n if (data < minData) {\n min = val;\n minData = data;\n }\n });\n return min;\n});\n\n/***/ }),\n/* 69 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar mod = function (n, m) {\n return (n % m + m) % m;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (mod);\n\n/***/ }),\n/* 70 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar DEGREE = 180 / Math.PI;\n\nvar toDegree = function (radian) {\n return DEGREE * radian;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (toDegree);\n\n/***/ }),\n/* 71 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (parseInt);\n\n/***/ }),\n/* 72 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar RADIAN = Math.PI / 180;\n\nvar toRadian = function (degree) {\n return RADIAN * degree;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (toRadian);\n\n/***/ }),\n/* 73 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */]);\n\n/***/ }),\n/* 74 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__has__ = __webpack_require__(25);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (__WEBPACK_IMPORTED_MODULE_0__has__[\"a\" /* default */]);\n\n/***/ }),\n/* 75 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__contains__ = __webpack_require__(12);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__values__ = __webpack_require__(26);\n\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__contains__[\"a\" /* default */])(Object(__WEBPACK_IMPORTED_MODULE_1__values__[\"a\" /* default */])(obj), value);\n});\n\n/***/ }),\n/* 76 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(10);\n\n\nvar lowerCase = function (str) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__to_string__[\"a\" /* default */])(str).toLowerCase();\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (lowerCase);\n\n/***/ }),\n/* 77 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(10);\n\n\nvar lowerFirst = function (value) {\n var str = Object(__WEBPACK_IMPORTED_MODULE_0__to_string__[\"a\" /* default */])(value);\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (lowerFirst);\n\n/***/ }),\n/* 78 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nfunction substitute(str, o) {\n if (!str || !o) {\n return str;\n }\n\n return str.replace(/\\\\?\\{([^{}]+)\\}/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.slice(1);\n }\n\n return o[name] === undefined ? '' : o[name];\n });\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (substitute);\n\n/***/ }),\n/* 79 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(10);\n\n\nvar upperCase = function (str) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__to_string__[\"a\" /* default */])(str).toUpperCase();\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (upperCase);\n\n/***/ }),\n/* 80 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__to_string__ = __webpack_require__(10);\n\n\nvar upperFirst = function (value) {\n var str = Object(__WEBPACK_IMPORTED_MODULE_0__to_string__[\"a\" /* default */])(value);\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (upperFirst);\n\n/***/ }),\n/* 81 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\n\nvar isArguments = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Arguments');\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isArguments);\n\n/***/ }),\n/* 82 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n/**\n * 是否是布尔类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\n\nvar isBoolean = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Boolean');\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isBoolean);\n\n/***/ }),\n/* 83 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n\n\nvar isDate = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Date');\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isDate);\n\n/***/ }),\n/* 84 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\n\nvar isError = function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(value, 'Error');\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isError);\n\n/***/ }),\n/* 85 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_number__ = __webpack_require__(5);\n/**\n * 判断是否为有限数\n * @return {Boolean}\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_number__[\"a\" /* default */])(value) && isFinite(value);\n});\n\n/***/ }),\n/* 86 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar isNull = function (value) {\n return value === null;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isNull);\n\n/***/ }),\n/* 87 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_type__ = __webpack_require__(4);\n\n\nvar isRegExp = function (str) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_type__[\"a\" /* default */])(str, 'RegExp');\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isRegExp);\n\n/***/ }),\n/* 88 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar isUndefined = function (value) {\n return value === undefined;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isUndefined);\n\n/***/ }),\n/* 89 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * 判断是否HTML元素\n * @return {Boolean} 是否HTML元素\n */\nvar isElement = function (o) {\n return o instanceof Element || o instanceof HTMLDocument;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isElement);\n\n/***/ }),\n/* 90 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = requestAnimationFrame;\nfunction requestAnimationFrame(fn) {\n var method = window.requestAnimationFrame || window.webkitRequestAnimationFrame || // @ts-ignore\n window.mozRequestAnimationFrame || // @ts-ignore\n window.msRequestAnimationFrame || function (f) {\n return setTimeout(f, 16);\n };\n\n return method(fn);\n}\n;\n\n/***/ }),\n/* 91 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = cancelAnimationFrame;\nfunction cancelAnimationFrame(handler) {\n var method = window.cancelAnimationFrame || window.webkitCancelAnimationFrame || // @ts-ignore\n window.mozCancelAnimationFrame || // @ts-ignore\n window.msCancelAnimationFrame || clearTimeout;\n method(handler);\n}\n;\n\n/***/ }),\n/* 92 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mix__ = __webpack_require__(16);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);\n\n\n\nvar augment = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n\n var c = args[0];\n\n for (var i = 1; i < args.length; i++) {\n var obj = args[i];\n\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(obj)) {\n obj = obj.prototype;\n }\n\n Object(__WEBPACK_IMPORTED_MODULE_0__mix__[\"a\" /* default */])(c.prototype, obj);\n }\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (augment);\n\n/***/ }),\n/* 93 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n\n\nvar clone = function (obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n\n var rst;\n\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(obj)) {\n rst = [];\n\n for (var i = 0, l = obj.length; i < l; i++) {\n if (typeof obj[i] === 'object' && obj[i] != null) {\n rst[i] = clone(obj[i]);\n } else {\n rst[i] = obj[i];\n }\n }\n } else {\n rst = {};\n\n for (var k in obj) {\n if (typeof obj[k] === 'object' && obj[k] != null) {\n rst[k] = clone(obj[k]);\n } else {\n rst[k] = obj[k];\n }\n }\n }\n\n return rst;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (clone);\n\n/***/ }),\n/* 94 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nfunction debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this,\n args = arguments;\n\n var later = function () {\n timeout = null;\n\n if (!immediate) {\n func.apply(context, args);\n }\n };\n\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (debounce);\n\n/***/ }),\n/* 95 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(3);\n\n/**\n * _.memoize(calColor);\n * _.memoize(calColor, (...args) => args[0]);\n * @param f\n * @param resolver\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (f, resolver) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_function__[\"a\" /* default */])(f)) {\n throw new TypeError('Expected a function');\n }\n\n var memoized = function () {\n var args = [];\n\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n } // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key\n\n\n var key = resolver ? resolver.apply(this, args) : args[0];\n var cache = memoized.cache;\n\n if (cache.has(key)) {\n return cache.get(key);\n }\n\n var result = f.apply(this, args); // 缓存起来\n\n cache.set(key, result);\n return result;\n };\n\n memoized.cache = new Map();\n return memoized;\n});\n\n/***/ }),\n/* 96 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array__ = __webpack_require__(0);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_plain_object__ = __webpack_require__(9);\n\n\nvar MAX_MIX_LEVEL = 5;\n\nfunction _deepMix(dist, src, level, maxLevel) {\n level = level || 0;\n maxLevel = maxLevel || MAX_MIX_LEVEL;\n\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n var value = src[key];\n\n if (value !== null && Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__[\"a\" /* default */])(value)) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__[\"a\" /* default */])(dist[key])) {\n dist[key] = {};\n }\n\n if (level < maxLevel) {\n _deepMix(dist[key], value, level + 1, maxLevel);\n } else {\n dist[key] = src[key];\n }\n } else if (Object(__WEBPACK_IMPORTED_MODULE_0__is_array__[\"a\" /* default */])(value)) {\n dist[key] = [];\n dist[key] = dist[key].concat(value);\n } else if (value !== undefined) {\n dist[key] = value;\n }\n }\n }\n} // todo 重写\n\n\nvar deepMix = function (rst) {\n var args = [];\n\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n\n for (var i = 0; i < args.length; i += 1) {\n _deepMix(rst, args[i]);\n }\n\n return rst;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (deepMix);\n\n/***/ }),\n/* 97 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__mix__ = __webpack_require__(16);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_function__ = __webpack_require__(3);\n\n\n\nvar extend = function (subclass, superclass, overrides, staticOverrides) {\n // 如果只提供父类构造函数,则自动生成子类构造函数\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_function__[\"a\" /* default */])(superclass)) {\n overrides = superclass;\n superclass = subclass;\n\n subclass = function () {};\n }\n\n var create = Object.create ? function (proto, c) {\n return Object.create(proto, {\n constructor: {\n value: c\n }\n });\n } : function (proto, c) {\n function Tmp() {}\n\n Tmp.prototype = proto;\n var o = new Tmp();\n o.constructor = c;\n return o;\n };\n var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype\n\n subclass.prototype = Object(__WEBPACK_IMPORTED_MODULE_0__mix__[\"a\" /* default */])(superObj, subclass.prototype); // 指定子类的prototype\n\n subclass.superclass = create(superclass.prototype, superclass);\n Object(__WEBPACK_IMPORTED_MODULE_0__mix__[\"a\" /* default */])(superObj, overrides);\n Object(__WEBPACK_IMPORTED_MODULE_0__mix__[\"a\" /* default */])(subclass, staticOverrides);\n return subclass;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (extend);\n\n/***/ }),\n/* 98 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\n\nvar indexOf = function (arr, obj) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(arr)) {\n return -1;\n }\n\n var m = Array.prototype.indexOf;\n\n if (m) {\n return m.call(arr, obj);\n }\n\n var index = -1;\n\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === obj) {\n index = i;\n break;\n }\n }\n\n return index;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (indexOf);\n\n/***/ }),\n/* 99 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__get_type__ = __webpack_require__(27);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_3__is_prototype__ = __webpack_require__(28);\n\n\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n\nfunction isEmpty(value) {\n /**\n * isEmpty(null) => true\n * isEmpty() => true\n * isEmpty(true) => true\n * isEmpty(1) => true\n * isEmpty([1, 2, 3]) => false\n * isEmpty('abc') => false\n * isEmpty({ a: 1 }) => false\n */\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(value)) {\n return true;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(value)) {\n return !value.length;\n }\n\n var type = Object(__WEBPACK_IMPORTED_MODULE_2__get_type__[\"a\" /* default */])(value);\n\n if (type === 'Map' || type === 'Set') {\n return !value.size;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_3__is_prototype__[\"a\" /* default */])(value)) {\n return !Object.keys(value).length;\n }\n\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n\n return true;\n}\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (isEmpty);\n\n/***/ }),\n/* 100 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_function__ = __webpack_require__(3);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_equal__ = __webpack_require__(29);\n\n\n/**\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [fn] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * isEqualWith(array, other, customizer); // => true\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value, other, fn) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_function__[\"a\" /* default */])(fn)) {\n return Object(__WEBPACK_IMPORTED_MODULE_1__is_equal__[\"a\" /* default */])(value, other);\n }\n\n return !!fn(value, other);\n});\n\n/***/ }),\n/* 101 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);\n\n\n\nvar map = function (arr, func) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(arr)) {\n // @ts-ignore\n return arr;\n }\n\n var result = [];\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(arr, function (value, index) {\n result.push(func(value, index));\n });\n return result;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (map);\n\n/***/ }),\n/* 102 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_object__ = __webpack_require__(13);\n\n\n\nvar identity = function (v) {\n return v;\n};\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (object, func) {\n if (func === void 0) {\n func = identity;\n }\n\n var r = {};\n\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_object__[\"a\" /* default */])(object) && !Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(object)) {\n Object.keys(object).forEach(function (key) {\n // @ts-ignore\n r[key] = func(object[key], key);\n });\n }\n\n return r;\n});\n\n/***/ }),\n/* 103 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_string__ = __webpack_require__(8);\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param key\n * @param defaultValue\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, key, defaultValue) {\n var p = 0;\n var keyArr = Object(__WEBPACK_IMPORTED_MODULE_0__is_string__[\"a\" /* default */])(key) ? key.split('.') : key;\n\n while (obj && p < keyArr.length) {\n obj = obj[keyArr[p++]];\n }\n\n return obj === undefined || p < keyArr.length ? defaultValue : obj;\n});\n\n/***/ }),\n/* 104 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_object__ = __webpack_require__(13);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_string__ = __webpack_require__(8);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_2__is_number__ = __webpack_require__(5);\n\n\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param path\n * @param value\n */\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (obj, path, value) {\n var o = obj;\n var keyArr = Object(__WEBPACK_IMPORTED_MODULE_1__is_string__[\"a\" /* default */])(path) ? path.split('.') : path;\n keyArr.forEach(function (key, idx) {\n // 不是最后一个\n if (idx < keyArr.length - 1) {\n if (!Object(__WEBPACK_IMPORTED_MODULE_0__is_object__[\"a\" /* default */])(o[key])) {\n o[key] = Object(__WEBPACK_IMPORTED_MODULE_2__is_number__[\"a\" /* default */])(keyArr[idx + 1]) ? [] : {};\n }\n\n o = o[key];\n } else {\n o[key] = value;\n }\n });\n return obj;\n});\n\n/***/ }),\n/* 105 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__each__ = __webpack_require__(2);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_plain_object__ = __webpack_require__(9);\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (object, keys) {\n if (object === null || !Object(__WEBPACK_IMPORTED_MODULE_1__is_plain_object__[\"a\" /* default */])(object)) {\n return {};\n }\n\n var result = {};\n Object(__WEBPACK_IMPORTED_MODULE_0__each__[\"a\" /* default */])(keys, function (key) {\n if (hasOwnProperty.call(object, key)) {\n result[key] = object[key];\n }\n });\n return result;\n});\n\n/***/ }),\n/* 106 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options) options = {};\n\n var later = function () {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n };\n\n var throttled = function () {\n var now = Date.now();\n if (!previous && options.leading === false) previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n\n previous = now;\n result = func.apply(context, args);\n if (!timeout) context = args = null;\n } else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n\n return result;\n };\n\n throttled.cancel = function () {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n\n return throttled;\n});\n\n/***/ }),\n/* 107 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_array_like__ = __webpack_require__(1);\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (value) {\n return Object(__WEBPACK_IMPORTED_MODULE_0__is_array_like__[\"a\" /* default */])(value) ? Array.prototype.slice.call(value) : [];\n});\n\n/***/ }),\n/* 108 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\nvar map = {};\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (prefix) {\n prefix = prefix || 'g';\n\n if (!map[prefix]) {\n map[prefix] = 1;\n } else {\n map[prefix] += 1;\n }\n\n return prefix + map[prefix];\n});\n\n/***/ }),\n/* 109 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function () {});\n\n/***/ }),\n/* 110 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony default export */ __webpack_exports__[\"a\"] = (function (v) {\n return v;\n});\n\n/***/ }),\n/* 111 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/* harmony export (immutable) */ __webpack_exports__[\"a\"] = size;\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_0__is_nil__ = __webpack_require__(6);\n/* harmony import */ var __WEBPACK_IMPORTED_MODULE_1__is_array_like__ = __webpack_require__(1);\n\n\nfunction size(o) {\n if (Object(__WEBPACK_IMPORTED_MODULE_0__is_nil__[\"a\" /* default */])(o)) {\n return 0;\n }\n\n if (Object(__WEBPACK_IMPORTED_MODULE_1__is_array_like__[\"a\" /* default */])(o)) {\n return o.length;\n }\n\n return Object.keys(o).length;\n}\n\n/***/ }),\n/* 112 */\n/***/ (function(module, __webpack_exports__, __webpack_require__) {\n\n\"use strict\";\n/**\n * k-v 存储\n */\nvar default_1 =\n/** @class */\nfunction () {\n function default_1() {\n this.map = {};\n }\n\n default_1.prototype.has = function (key) {\n return this.map[key] !== undefined;\n };\n\n default_1.prototype.get = function (key, def) {\n var v = this.map[key];\n return v === undefined ? def : v;\n };\n\n default_1.prototype.set = function (key, value) {\n this.map[key] = value;\n };\n\n default_1.prototype.clear = function () {\n this.map = {};\n };\n\n default_1.prototype.delete = function (key) {\n delete this.map[key];\n };\n\n default_1.prototype.size = function () {\n return Object.keys(this.map).length;\n };\n\n return default_1;\n}();\n\n/* harmony default export */ __webpack_exports__[\"a\"] = (default_1);\n\n/***/ }),\n/* 113 */\n/***/ (function(module, exports) {\n\n// wrap tree node\nfunction WrappedTree(w, h, y, c) {\n if (c === void 0) {\n c = [];\n }\n\n var me = this; // size\n\n me.w = w || 0;\n me.h = h || 0; // position\n\n me.y = y || 0;\n me.x = 0; // children\n\n me.c = c || [];\n me.cs = c.length; // modified\n\n me.prelim = 0;\n me.mod = 0;\n me.shift = 0;\n me.change = 0; // left/right tree\n\n me.tl = null;\n me.tr = null; // extreme left/right tree\n\n me.el = null;\n me.er = null; // modified left/right tree\n\n me.msel = 0;\n me.mser = 0;\n}\n\nWrappedTree.fromNode = function (root, isHorizontal) {\n if (!root) return null;\n var children = [];\n root.children.forEach(function (child) {\n children.push(WrappedTree.fromNode(child, isHorizontal));\n });\n if (isHorizontal) return new WrappedTree(root.height, root.width, root.x, children);\n return new WrappedTree(root.width, root.height, root.y, children);\n}; // node utils\n\n\nfunction moveRight(node, move, isHorizontal) {\n if (isHorizontal) {\n node.y += move;\n } else {\n node.x += move;\n }\n\n node.children.forEach(function (child) {\n moveRight(child, move, isHorizontal);\n });\n}\n\nfunction getMin(node, isHorizontal) {\n var res = isHorizontal ? node.y : node.x;\n node.children.forEach(function (child) {\n res = Math.min(getMin(child, isHorizontal), res);\n });\n return res;\n}\n\nfunction normalize(node, isHorizontal) {\n var min = getMin(node, isHorizontal);\n moveRight(node, -min, isHorizontal);\n}\n\nfunction convertBack(converted\n/* WrappedTree */\n, root\n/* TreeNode */\n, isHorizontal) {\n if (isHorizontal) {\n root.y = converted.x;\n } else {\n root.x = converted.x;\n }\n\n converted.c.forEach(function (child, i) {\n convertBack(child, root.children[i], isHorizontal);\n });\n}\n\nfunction layer(node, isHorizontal, d) {\n if (d === void 0) {\n d = 0;\n }\n\n if (isHorizontal) {\n node.x = d;\n d += node.width;\n } else {\n node.y = d;\n d += node.height;\n }\n\n node.children.forEach(function (child) {\n layer(child, isHorizontal, d);\n });\n}\n\nmodule.exports = function (root, options) {\n if (options === void 0) {\n options = {};\n }\n\n var isHorizontal = options.isHorizontal;\n\n function firstWalk(t) {\n if (t.cs === 0) {\n setExtremes(t);\n return;\n }\n\n firstWalk(t.c[0]);\n var ih = updateIYL(bottom(t.c[0].el), 0, null);\n\n for (var i = 1; i < t.cs; ++i) {\n firstWalk(t.c[i]);\n var min = bottom(t.c[i].er);\n separate(t, i, ih);\n ih = updateIYL(min, i, ih);\n }\n\n positionRoot(t);\n setExtremes(t);\n }\n\n function setExtremes(t) {\n if (t.cs === 0) {\n t.el = t;\n t.er = t;\n t.msel = t.mser = 0;\n } else {\n t.el = t.c[0].el;\n t.msel = t.c[0].msel;\n t.er = t.c[t.cs - 1].er;\n t.mser = t.c[t.cs - 1].mser;\n }\n }\n\n function separate(t, i, ih) {\n var sr = t.c[i - 1];\n var mssr = sr.mod;\n var cl = t.c[i];\n var mscl = cl.mod;\n\n while (sr !== null && cl !== null) {\n if (bottom(sr) > ih.low) ih = ih.nxt;\n var dist = mssr + sr.prelim + sr.w - (mscl + cl.prelim);\n\n if (dist > 0) {\n mscl += dist;\n moveSubtree(t, i, ih.index, dist);\n }\n\n var sy = bottom(sr);\n var cy = bottom(cl);\n\n if (sy <= cy) {\n sr = nextRightContour(sr);\n if (sr !== null) mssr += sr.mod;\n }\n\n if (sy >= cy) {\n cl = nextLeftContour(cl);\n if (cl !== null) mscl += cl.mod;\n }\n }\n\n if (!sr && !!cl) {\n setLeftThread(t, i, cl, mscl);\n } else if (!!sr && !cl) {\n setRightThread(t, i, sr, mssr);\n }\n }\n\n function moveSubtree(t, i, si, dist) {\n t.c[i].mod += dist;\n t.c[i].msel += dist;\n t.c[i].mser += dist;\n distributeExtra(t, i, si, dist);\n }\n\n function nextLeftContour(t) {\n return t.cs === 0 ? t.tl : t.c[0];\n }\n\n function nextRightContour(t) {\n return t.cs === 0 ? t.tr : t.c[t.cs - 1];\n }\n\n function bottom(t) {\n return t.y + t.h;\n }\n\n function setLeftThread(t, i, cl, modsumcl) {\n var li = t.c[0].el;\n li.tl = cl;\n var diff = modsumcl - cl.mod - t.c[0].msel;\n li.mod += diff;\n li.prelim -= diff;\n t.c[0].el = t.c[i].el;\n t.c[0].msel = t.c[i].msel;\n }\n\n function setRightThread(t, i, sr, modsumsr) {\n var ri = t.c[i].er;\n ri.tr = sr;\n var diff = modsumsr - sr.mod - t.c[i].mser;\n ri.mod += diff;\n ri.prelim -= diff;\n t.c[i].er = t.c[i - 1].er;\n t.c[i].mser = t.c[i - 1].mser;\n }\n\n function positionRoot(t) {\n 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 }\n\n function secondWalk(t, modsum) {\n modsum += t.mod;\n t.x = t.prelim + modsum;\n addChildSpacing(t);\n\n for (var i = 0; i < t.cs; i++) {\n secondWalk(t.c[i], modsum);\n }\n }\n\n function distributeExtra(t, i, si, dist) {\n if (si !== i - 1) {\n var nr = i - si;\n t.c[si + 1].shift += dist / nr;\n t.c[i].shift -= dist / nr;\n t.c[i].change -= dist - dist / nr;\n }\n }\n\n function addChildSpacing(t) {\n var d = 0;\n var modsumdelta = 0;\n\n for (var i = 0; i < t.cs; i++) {\n d += t.c[i].shift;\n modsumdelta += d + t.c[i].change;\n t.c[i].mod += modsumdelta;\n }\n }\n\n function updateIYL(low, index, ih) {\n while (ih !== null && low >= ih.low) {\n ih = ih.nxt;\n }\n\n return {\n low: low,\n index: index,\n nxt: ih\n };\n } // do layout\n\n\n layer(root, isHorizontal);\n var wt = WrappedTree.fromNode(root, isHorizontal);\n firstWalk(wt);\n secondWalk(wt, 0);\n convertBack(wt, root, isHorizontal);\n normalize(root, isHorizontal);\n return root;\n};\n\n/***/ }),\n/* 114 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar TreeLayout = __webpack_require__(11);\n\nvar dendrogram = __webpack_require__(115);\n\nvar doTreeLayout = __webpack_require__(17);\n\nvar util = __webpack_require__(7);\n\nvar DendrogramLayout = /*#__PURE__*/function (_TreeLayout) {\n _inheritsLoose(DendrogramLayout, _TreeLayout);\n\n function DendrogramLayout() {\n return _TreeLayout.apply(this, arguments) || this;\n }\n\n var _proto = DendrogramLayout.prototype;\n\n _proto.execute = function execute() {\n var me = this;\n me.rootNode.width = 0;\n return doTreeLayout(me.rootNode, me.options, dendrogram);\n };\n\n return DendrogramLayout;\n}(TreeLayout);\n\nvar DEFAULT_OPTIONS = {};\n\nfunction dendrogramLayout(root, options) {\n options = util.assign({}, DEFAULT_OPTIONS, options);\n return new DendrogramLayout(root, options).execute();\n}\n\nmodule.exports = dendrogramLayout;\n\n/***/ }),\n/* 115 */\n/***/ (function(module, exports, __webpack_require__) {\n\n// wrap tree node\n// TODO considering size\nvar util = __webpack_require__(7);\n\nfunction WrappedTree(height, children) {\n if (height === void 0) {\n height = 0;\n }\n\n if (children === void 0) {\n children = [];\n }\n\n var me = this;\n me.x = me.y = 0;\n me.leftChild = me.rightChild = null;\n me.height = 0;\n me.children = children;\n}\n\nvar DEFAULT_OPTIONS = {\n isHorizontal: true,\n nodeSep: 20,\n nodeSize: 20,\n rankSep: 200,\n subTreeSep: 10\n};\n\nfunction convertBack(converted\n/* WrappedTree */\n, root\n/* TreeNode */\n, isHorizontal) {\n if (isHorizontal) {\n root.x = converted.x;\n root.y = converted.y;\n } else {\n root.x = converted.y;\n root.y = converted.x;\n }\n\n converted.children.forEach(function (child, i) {\n convertBack(child, root.children[i], isHorizontal);\n });\n}\n\nmodule.exports = function (root, options) {\n if (options === void 0) {\n options = {};\n }\n\n options = util.assign({}, DEFAULT_OPTIONS, options);\n var maxDepth = 0;\n\n function wrappedTreeFromNode(n) {\n if (!n) return null;\n n.width = 0;\n\n if (n.depth && n.depth > maxDepth) {\n maxDepth = n.depth; // get the max depth\n }\n\n var children = n.children;\n var childrenCount = children.length;\n var t = new WrappedTree(n.height, []);\n children.forEach(function (child, i) {\n var childWT = wrappedTreeFromNode(child);\n t.children.push(childWT);\n\n if (i === 0) {\n // t.leftChild = childWT.leftChild ? childWT.leftChild : childWT\n t.leftChild = childWT;\n }\n\n if (i === childrenCount - 1) {\n // t.rightChild = childWT.rightChild ? childWT.rightChild : childWT\n t.rightChild = childWT;\n }\n });\n t.originNode = n;\n t.isLeaf = n.isLeaf();\n return t;\n }\n\n function getDrawingDepth(t) {\n if (t.isLeaf || t.children.length === 0) {\n t.drawingDepth = maxDepth;\n } else {\n var depths = t.children.map(function (child) {\n return getDrawingDepth(child);\n });\n var minChildDepth = Math.min.apply(null, depths);\n t.drawingDepth = minChildDepth - 1;\n }\n\n return t.drawingDepth;\n }\n\n var prevLeaf;\n\n function position(t) {\n t.x = t.drawingDepth * options.rankSep;\n\n if (t.isLeaf) {\n t.y = 0;\n\n if (prevLeaf) {\n t.y = prevLeaf.y + prevLeaf.height + options.nodeSep;\n\n if (t.originNode.parent !== prevLeaf.originNode.parent) {\n t.y += options.subTreeSep;\n }\n }\n\n prevLeaf = t;\n } else {\n t.children.forEach(function (child) {\n position(child);\n });\n t.y = (t.leftChild.y + t.rightChild.y) / 2;\n }\n } // wrap node\n\n\n var wt = wrappedTreeFromNode(root); // get depth for drawing\n\n getDrawingDepth(wt); // get position\n\n position(wt); // get x, y\n\n convertBack(wt, root, options.isHorizontal);\n return root;\n};\n\n/***/ }),\n/* 116 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar TreeLayout = __webpack_require__(11);\n\nvar indentedTree = __webpack_require__(117);\n\nvar separateTree = __webpack_require__(30);\n\nvar util = __webpack_require__(7);\n\nvar VALID_DIRECTIONS = ['LR', // left to right\n'RL', // right to left\n'H' // horizontal\n];\nvar DEFAULT_DIRECTION = VALID_DIRECTIONS[0];\n\nvar IndentedLayout = /*#__PURE__*/function (_TreeLayout) {\n _inheritsLoose(IndentedLayout, _TreeLayout);\n\n function IndentedLayout() {\n return _TreeLayout.apply(this, arguments) || this;\n }\n\n var _proto = IndentedLayout.prototype;\n\n _proto.execute = function execute() {\n var me = this;\n var options = me.options;\n var root = me.rootNode;\n options.isHorizontal = true; // default indent 20 and sink first children;\n\n var _options$indent = options.indent,\n indent = _options$indent === void 0 ? 20 : _options$indent,\n _options$dropCap = options.dropCap,\n dropCap = _options$dropCap === void 0 ? true : _options$dropCap;\n var direction = options.direction || DEFAULT_DIRECTION;\n\n if (direction && VALID_DIRECTIONS.indexOf(direction) === -1) {\n throw new TypeError(\"Invalid direction: \" + direction);\n }\n\n if (direction === VALID_DIRECTIONS[0]) {\n // LR\n indentedTree(root, indent, dropCap);\n } else if (direction === VALID_DIRECTIONS[1]) {\n // RL\n indentedTree(root, indent, dropCap);\n root.right2left();\n } else if (direction === VALID_DIRECTIONS[2]) {\n // H\n // separate into left and right trees\n var _separateTree = separateTree(root, options),\n left = _separateTree.left,\n right = _separateTree.right;\n\n indentedTree(left, indent, dropCap);\n left.right2left();\n indentedTree(right, indent, dropCap);\n var bbox = left.getBoundingBox();\n right.translate(bbox.width, 0);\n root.x = right.x - root.width / 2;\n }\n\n return root;\n };\n\n return IndentedLayout;\n}(TreeLayout);\n\nvar DEFAULT_OPTIONS = {};\n\nfunction indentedLayout(root, options) {\n options = util.assign({}, DEFAULT_OPTIONS, options);\n return new IndentedLayout(root, options).execute();\n}\n\nmodule.exports = indentedLayout;\n\n/***/ }),\n/* 117 */\n/***/ (function(module, exports) {\n\nfunction positionNode(node, previousNode, indent, dropCap) {\n // caculate the node's horizontal offset DX, dx's type might be number or function\n var displacementX = typeof indent === 'function' ? indent(node) : indent * node.depth;\n\n if (!dropCap) {\n try {\n if (node.id === node.parent.children[0].id) {\n node.x += displacementX;\n node.y = previousNode ? previousNode.y : 0;\n return;\n }\n } catch (e) {// skip to normal when a node has no parent\n }\n }\n\n node.x += displacementX;\n node.y = previousNode ? previousNode.y + previousNode.height : 0;\n return;\n}\n\nmodule.exports = function (root, indent, dropCap) {\n var previousNode = null;\n root.eachNode(function (node) {\n positionNode(node, previousNode, indent, dropCap);\n previousNode = node;\n });\n};\n\n/***/ }),\n/* 118 */\n/***/ (function(module, exports, __webpack_require__) {\n\nfunction _inheritsLoose(subClass, superClass) { subClass.prototype = Object.create(superClass.prototype); subClass.prototype.constructor = subClass; subClass.__proto__ = superClass; }\n\nvar TreeLayout = __webpack_require__(11);\n\nvar mindmap = __webpack_require__(119);\n\nvar doTreeLayout = __webpack_require__(17);\n\nvar util = __webpack_require__(7);\n\nvar MindmapLayout = /*#__PURE__*/function (_TreeLayout) {\n _inheritsLoose(MindmapLayout, _TreeLayout);\n\n function MindmapLayout() {\n return _TreeLayout.apply(this, arguments) || this;\n }\n\n var _proto = MindmapLayout.prototype;\n\n _proto.execute = function execute() {\n var me = this;\n return doTreeLayout(me.rootNode, me.options, mindmap);\n };\n\n return MindmapLayout;\n}(TreeLayout);\n\nvar DEFAULT_OPTIONS = {};\n\nfunction mindmapLayout(root, options) {\n options = util.assign({}, DEFAULT_OPTIONS, options);\n return new MindmapLayout(root, options).execute();\n}\n\nmodule.exports = mindmapLayout;\n\n/***/ }),\n/* 119 */\n/***/ (function(module, exports, __webpack_require__) {\n\nvar util = __webpack_require__(7);\n\nfunction secondWalk(node, options) {\n var totalHeight = 0;\n\n if (!node.children.length) {\n totalHeight = node.height;\n } else {\n node.children.forEach(function (c) {\n totalHeight += secondWalk(c, options);\n });\n }\n\n node._subTreeSep = options.getSubTreeSep(node.data);\n node.totalHeight = Math.max(node.height, totalHeight) + 2 * node._subTreeSep;\n return node.totalHeight;\n}\n\nfunction thirdWalk(node) {\n var children = node.children;\n var len = children.length;\n\n if (len) {\n children.forEach(function (c) {\n thirdWalk(c);\n });\n var first = children[0];\n var last = children[len - 1];\n var childrenHeight = last.y - first.y + last.height;\n var childrenTotalHeight = 0;\n children.forEach(function (child) {\n childrenTotalHeight += child.totalHeight;\n });\n\n if (childrenHeight > node.height) {\n // 当子节点总高度大于父节点高度\n node.y = first.y + childrenHeight / 2 - node.height / 2;\n } else if (children.length !== 1 || node.height > childrenTotalHeight) {\n // 多于一个子节点或者父节点大于所有子节点的总高度\n var offset = node.y + (node.height - childrenHeight) / 2 - first.y;\n children.forEach(function (c) {\n c.translate(0, offset);\n });\n } else {\n // 只有一个子节点\n node.y = (first.y + first.height / 2 + last.y + last.height / 2) / 2 - node.height / 2;\n }\n }\n}\n\nvar DEFAULT_OPTIONS = {\n getSubTreeSep: function getSubTreeSep() {\n return 0;\n }\n};\n\nmodule.exports = function (root, options) {\n if (options === void 0) {\n options = {};\n }\n\n options = util.assign({}, DEFAULT_OPTIONS, options);\n root.parent = {\n x: 0,\n width: 0,\n height: 0,\n y: 0\n }; // first walk\n\n root.BFTraverse(function (node) {\n node.x = node.parent.x + node.parent.width; // simply get x\n });\n root.parent = null; // second walk\n\n secondWalk(root, options); // assign sub tree totalHeight\n // adjusting\n // separating nodes\n\n root.startY = 0;\n root.y = root.totalHeight / 2 - root.height / 2;\n root.eachNode(function (node) {\n var children = node.children;\n var len = children.length;\n\n if (len) {\n var first = children[0];\n first.startY = node.startY + node._subTreeSep;\n\n if (len === 1) {\n first.y = node.y + node.height / 2 - first.height / 2;\n } else {\n first.y = first.startY + first.totalHeight / 2 - first.height / 2;\n\n for (var i = 1; i < len; i++) {\n var c = children[i];\n c.startY = children[i - 1].startY + children[i - 1].totalHeight;\n c.y = c.startY + c.totalHeight / 2 - c.height / 2;\n }\n }\n }\n }); // third walk\n\n thirdWalk(root);\n};\n\n/***/ })\n/******/ ]);\n});\n//# sourceMappingURL=hierarchy.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/hierarchy/build/hierarchy.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nfunction debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (debounce);\n//# sourceMappingURL=debounce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/debounce.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/index.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/layout/lib/index.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/deep-mix.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/deep-mix.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getLayoutByName = exports.unRegisterLayout = exports.registerLayout = void 0;\nvar registy_1 = __webpack_require__(/*! ./registy */ \"./node_modules/@antv/layout/lib/registy/index.js\");\nObject.defineProperty(exports, \"registerLayout\", { enumerable: true, get: function () { return registy_1.registerLayout; } });\nObject.defineProperty(exports, \"unRegisterLayout\", { enumerable: true, get: function () { return registy_1.unRegisterLayout; } });\nObject.defineProperty(exports, \"getLayoutByName\", { enumerable: true, get: function () { return registy_1.getLayoutByName; } });\n// layout, layout types file, worker\n__exportStar(__webpack_require__(/*! ./layout */ \"./node_modules/@antv/layout/lib/layout/index.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-plain-object.js\");\n\n\nvar MAX_MIX_LEVEL = 5;\nfunction hasOwn(object, property) {\n if (Object.hasOwn) {\n return Object.hasOwn(object, property);\n }\n if (object == null) {\n throw new TypeError('Cannot convert undefined or null to object');\n }\n return Object.prototype.hasOwnProperty.call(Object(object), property);\n}\nfunction _deepMix(dist, src, level, maxLevel) {\n level = level || 0;\n maxLevel = maxLevel || MAX_MIX_LEVEL;\n for (var key in src) {\n if (hasOwn(src, key)) {\n var value = src[key];\n if (value !== null && Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n if (!Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(dist[key])) {\n dist[key] = {};\n }\n if (level < maxLevel) {\n _deepMix(dist[key], value, level + 1, maxLevel);\n }\n else {\n dist[key] = src[key];\n }\n }\n else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n dist[key] = [];\n dist[key] = dist[key].concat(value);\n }\n else if (value !== undefined) {\n dist[key] = value;\n }\n }\n }\n}\n// todo 重写\nvar deepMix = function (rst) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < args.length; i += 1) {\n _deepMix(rst, args[i]);\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (deepMix);\n//# sourceMappingURL=deep-mix.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/deep-mix.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/base.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/base.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/difference.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/difference.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Base = void 0;\nvar Base = /** @class */ (function () {\n function Base() {\n this.nodes = [];\n this.edges = [];\n this.combos = [];\n this.comboEdges = [];\n this.hiddenNodes = [];\n this.hiddenEdges = [];\n this.hiddenCombos = [];\n this.positions = [];\n this.destroyed = false;\n this.onLayoutEnd = function () { };\n }\n Base.prototype.layout = function (data) {\n this.init(data);\n return this.execute(true);\n };\n Base.prototype.init = function (data) {\n this.nodes = data.nodes || [];\n this.edges = data.edges || [];\n this.combos = data.combos || [];\n this.comboEdges = data.comboEdges || [];\n this.hiddenNodes = data.hiddenNodes || [];\n this.hiddenEdges = data.hiddenEdges || [];\n this.hiddenCombos = data.hiddenCombos || [];\n };\n Base.prototype.execute = function (reloadData) { };\n Base.prototype.executeWithWorker = function () { };\n Base.prototype.getDefaultCfg = function () {\n return {};\n };\n Base.prototype.updateCfg = function (cfg) {\n if (cfg) {\n Object.assign(this, cfg);\n }\n };\n Base.prototype.getType = function () {\n return 'base';\n };\n Base.prototype.destroy = function () {\n this.nodes = null;\n this.edges = null;\n this.combos = null;\n this.positions = null;\n this.destroyed = true;\n };\n return Base;\n}());\nexports.Base = Base;\n//# sourceMappingURL=base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/base.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/filter.js\");\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/contains.js\");\n\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to inspect.\n * @param {Array} values The values to exclude.\n * @return {Array} Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3]); // => [1]\n */\nvar difference = function (arr, values) {\n if (values === void 0) { values = []; }\n return Object(_filter__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr, function (value) { return !Object(_contains__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(values, value); });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (difference);\n//# sourceMappingURL=difference.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/difference.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/circular.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/circular.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview random layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.CircularLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nfunction initHierarchy(nodes, edges, nodeMap, directed) {\n nodes.forEach(function (_, i) {\n nodes[i].children = [];\n nodes[i].parent = [];\n });\n if (directed) {\n edges.forEach(function (e) {\n var source = (0, util_1.getEdgeTerminal)(e, 'source');\n var target = (0, util_1.getEdgeTerminal)(e, 'target');\n var sourceIdx = 0;\n if (source) {\n sourceIdx = nodeMap[source];\n }\n var targetIdx = 0;\n if (target) {\n targetIdx = nodeMap[target];\n }\n var child = nodes[sourceIdx].children;\n var parent = nodes[targetIdx].parent;\n child.push(nodes[targetIdx].id);\n parent.push(nodes[sourceIdx].id);\n });\n }\n else {\n edges.forEach(function (e) {\n var source = (0, util_1.getEdgeTerminal)(e, 'source');\n var target = (0, util_1.getEdgeTerminal)(e, 'target');\n var sourceIdx = 0;\n if (source) {\n sourceIdx = nodeMap[source];\n }\n var targetIdx = 0;\n if (target) {\n targetIdx = nodeMap[target];\n }\n var sourceChildren = nodes[sourceIdx].children;\n var targetChildren = nodes[targetIdx].children;\n sourceChildren.push(nodes[targetIdx].id);\n targetChildren.push(nodes[sourceIdx].id);\n });\n }\n}\nfunction connect(a, b, edges) {\n var m = edges.length;\n for (var i = 0; i < m; i++) {\n var source = (0, util_1.getEdgeTerminal)(edges[i], 'source');\n var target = (0, util_1.getEdgeTerminal)(edges[i], 'target');\n if ((a.id === source && b.id === target) ||\n (b.id === source && a.id === target)) {\n return true;\n }\n }\n return false;\n}\nfunction compareDegree(a, b) {\n var aDegree = a.degree;\n var bDegree = b.degree;\n if (aDegree < bDegree) {\n return -1;\n }\n if (aDegree > bDegree) {\n return 1;\n }\n return 0;\n}\n/**\n * 圆形布局\n */\nvar CircularLayout = /** @class */ (function (_super) {\n __extends(CircularLayout, _super);\n function CircularLayout(options) {\n var _this = _super.call(this) || this;\n /** 固定半径,若设置了 radius,则 startRadius 与 endRadius 不起效 */\n _this.radius = null;\n /** 节点大小,配合 nodeSpacing,一起用于计算 radius。若不配置,节点大小默认为 30 */\n _this.nodeSize = undefined;\n /** 起始半径 */\n _this.startRadius = null;\n /** 终止半径 */\n _this.endRadius = null;\n /** 起始角度 */\n _this.startAngle = 0;\n /** 终止角度 */\n _this.endAngle = 2 * Math.PI;\n /** 是否顺时针 */\n _this.clockwise = true;\n /** 节点在环上分成段数(几个段将均匀分布),在 endRadius - startRadius != 0 时生效 */\n _this.divisions = 1;\n /** 节点在环上排序的依据,可选: 'topology', 'degree', 'null' */\n _this.ordering = null;\n /** how many 2*pi from first to last nodes */\n _this.angleRatio = 1;\n _this.nodes = [];\n _this.edges = [];\n _this.nodeMap = {};\n _this.degrees = [];\n _this.width = 300;\n _this.height = 300;\n _this.updateCfg(options);\n return _this;\n }\n CircularLayout.prototype.getDefaultCfg = function () {\n return {\n radius: null,\n startRadius: null,\n endRadius: null,\n startAngle: 0,\n endAngle: 2 * Math.PI,\n clockwise: true,\n divisions: 1,\n ordering: null,\n angleRatio: 1\n };\n };\n /**\n * 执行布局\n */\n CircularLayout.prototype.execute = function () {\n var _a;\n var self = this;\n var nodes = self.nodes;\n var edges = self.edges;\n var n = nodes.length;\n if (n === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (n === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n var radius = self.radius, startRadius = self.startRadius, endRadius = self.endRadius;\n var divisions = self.divisions, startAngle = self.startAngle, endAngle = self.endAngle, angleRatio = self.angleRatio, ordering = self.ordering, clockwise = self.clockwise, paramNodeSpacing = self.nodeSpacing, paramNodeSize = self.nodeSize;\n var angleStep = (endAngle - startAngle) / n;\n // layout\n var nodeMap = {};\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n var degrees = (0, util_1.getDegree)(nodes.length, nodeMap, edges);\n self.degrees = degrees;\n if (paramNodeSpacing) {\n var nodeSpacing_1 = (0, util_1.getFuncByUnknownType)(10, paramNodeSpacing);\n var nodeSize_1 = (0, util_1.getFuncByUnknownType)(10, paramNodeSize);\n var maxNodeSize_1 = -Infinity;\n nodes.forEach(function (node) {\n var nSize = nodeSize_1(node);\n if (maxNodeSize_1 < nSize)\n maxNodeSize_1 = nSize;\n });\n var length_1 = 0;\n nodes.forEach(function (node, i) {\n if (i === 0)\n length_1 += (maxNodeSize_1 || 10);\n else\n length_1 += (nodeSpacing_1(node) || 0) + (maxNodeSize_1 || 10);\n });\n radius = length_1 / (2 * Math.PI);\n }\n else if (!radius && !startRadius && !endRadius) {\n radius = self.height > self.width ? self.width / 2 : self.height / 2;\n }\n else if (!startRadius && endRadius) {\n startRadius = endRadius;\n }\n else if (startRadius && !endRadius) {\n endRadius = startRadius;\n }\n var astep = angleStep * angleRatio;\n var layoutNodes = [];\n if (ordering === \"topology\") {\n // layout according to the topology\n layoutNodes = self.topologyOrdering();\n }\n else if (ordering === \"topology-directed\") {\n // layout according to the topology\n layoutNodes = self.topologyOrdering(true);\n }\n else if (ordering === \"degree\") {\n // layout according to the descent order of degrees\n layoutNodes = self.degreeOrdering();\n }\n else {\n // layout according to the original order in the data.nodes\n layoutNodes = nodes;\n }\n var divN = Math.ceil(n / divisions); // node number in each division\n for (var i = 0; i < n; ++i) {\n var r = radius;\n if (!r && startRadius !== null && endRadius !== null) {\n r = startRadius + (i * (endRadius - startRadius)) / (n - 1);\n }\n if (!r) {\n r = 10 + (i * 100) / (n - 1);\n }\n var angle = startAngle +\n (i % divN) * astep +\n ((2 * Math.PI) / divisions) * Math.floor(i / divN);\n if (!clockwise) {\n angle =\n endAngle -\n (i % divN) * astep -\n ((2 * Math.PI) / divisions) * Math.floor(i / divN);\n }\n layoutNodes[i].x = center[0] + Math.cos(angle) * r;\n layoutNodes[i].y = center[1] + Math.sin(angle) * r;\n layoutNodes[i].weight = degrees[i].all;\n }\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n return {\n nodes: layoutNodes,\n edges: this.edges\n };\n };\n /**\n * 根据节点的拓扑结构排序\n * @return {array} orderedNodes 排序后的结果\n */\n CircularLayout.prototype.topologyOrdering = function (directed) {\n if (directed === void 0) { directed = false; }\n var self = this;\n var degrees = self.degrees;\n var edges = self.edges;\n var nodes = self.nodes;\n var cnodes = (0, util_1.clone)(nodes);\n var nodeMap = self.nodeMap;\n var orderedCNodes = [cnodes[0]];\n var resNodes = [nodes[0]];\n var pickFlags = [];\n var n = nodes.length;\n pickFlags[0] = true;\n initHierarchy(cnodes, edges, nodeMap, directed);\n var k = 0;\n cnodes.forEach(function (cnode, i) {\n if (i !== 0) {\n if ((i === n - 1 ||\n degrees[i].all !== degrees[i + 1].all ||\n connect(orderedCNodes[k], cnode, edges)) &&\n !pickFlags[i]) {\n orderedCNodes.push(cnode);\n resNodes.push(nodes[nodeMap[cnode.id]]);\n pickFlags[i] = true;\n k++;\n }\n else {\n var children = orderedCNodes[k].children;\n var foundChild = false;\n for (var j = 0; j < children.length; j++) {\n var childIdx = nodeMap[children[j]];\n if (degrees[childIdx].all === degrees[i].all && !pickFlags[childIdx]) {\n orderedCNodes.push(cnodes[childIdx]);\n resNodes.push(nodes[nodeMap[cnodes[childIdx].id]]);\n pickFlags[childIdx] = true;\n foundChild = true;\n break;\n }\n }\n var ii = 0;\n while (!foundChild) {\n if (!pickFlags[ii]) {\n orderedCNodes.push(cnodes[ii]);\n resNodes.push(nodes[nodeMap[cnodes[ii].id]]);\n pickFlags[ii] = true;\n foundChild = true;\n }\n ii++;\n if (ii === n) {\n break;\n }\n }\n }\n }\n });\n return resNodes;\n };\n /**\n * 根据节点度数大小排序\n * @return {array} orderedNodes 排序后的结果\n */\n CircularLayout.prototype.degreeOrdering = function () {\n var self = this;\n var nodes = self.nodes;\n var orderedNodes = [];\n var degrees = self.degrees;\n nodes.forEach(function (node, i) {\n node.degree = degrees[i].all;\n orderedNodes.push(node);\n });\n orderedNodes.sort(compareDegree);\n return orderedNodes;\n };\n CircularLayout.prototype.getType = function () {\n return \"circular\";\n };\n return CircularLayout;\n}(base_1.Base));\nexports.CircularLayout = CircularLayout;\n//# sourceMappingURL=circular.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/circular.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object.js\");\n\n\nfunction each(elements, func) {\n if (!elements) {\n return;\n }\n var rst;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elements)) {\n for (var i = 0, len = elements.length; i < len; i++) {\n rst = func(elements[i], i);\n if (rst === false) {\n break;\n }\n }\n }\n else if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(elements)) {\n for (var k in elements) {\n if (elements.hasOwnProperty(k)) {\n rst = func(elements[k], k);\n if (rst === false) {\n break;\n }\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (each);\n//# sourceMappingURL=each.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/comboCombined.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/comboCombined.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/ends-with.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/ends-with.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview Combo force layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ComboCombinedLayout = void 0;\nvar constants_1 = __webpack_require__(/*! ./constants */ \"./node_modules/@antv/layout/lib/layout/constants.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar _1 = __webpack_require__(/*! . */ \"./node_modules/@antv/layout/lib/layout/index.js\");\n/**\n * combined two layouts (inner and outer) for graph with combos\n */\nvar ComboCombinedLayout = /** @class */ (function (_super) {\n __extends(ComboCombinedLayout, _super);\n function ComboCombinedLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 内部计算参数 */\n _this.nodes = [];\n _this.edges = [];\n _this.combos = [];\n _this.comboEdges = [];\n /** Combo 内部的 padding */\n _this.comboPadding = 10;\n _this.comboTrees = [];\n _this.updateCfg(options);\n return _this;\n }\n ComboCombinedLayout.prototype.getDefaultCfg = function () {\n return {};\n };\n /**\n * 执行布局\n */\n ComboCombinedLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var center = self.center;\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n self.initVals();\n // layout\n self.run();\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n };\n ComboCombinedLayout.prototype.run = function () {\n var _a;\n var self = this;\n var nodes = self.nodes, edges = self.edges, combos = self.combos, comboEdges = self.comboEdges, center = self.center;\n var nodeMap = {};\n nodes.forEach(function (node) {\n nodeMap[node.id] = node;\n });\n var comboMap = {};\n combos.forEach(function (combo) {\n comboMap[combo.id] = combo;\n });\n var innerGraphs = self.getInnerGraphs(nodeMap);\n // 每个 innerGraph 作为一个节点,带有大小,参与 force 计算\n var outerNodeIds = [];\n var outerNodes = [];\n var nodeAncestorIdMap = {};\n var allHaveNoPosition = true;\n this.comboTrees.forEach(function (cTree) {\n var innerNode = innerGraphs[cTree.id];\n // 代表 combo 的节点\n var oNode = __assign(__assign({}, cTree), { x: innerNode.x || comboMap[cTree.id].x, y: innerNode.y || comboMap[cTree.id].y, fx: innerNode.fx || comboMap[cTree.id].fx, fy: innerNode.fy || comboMap[cTree.id].fy, mass: innerNode.mass || comboMap[cTree.id].mass, size: innerNode.size });\n outerNodes.push(oNode);\n if (!isNaN(oNode.x) && oNode.x !== 0 && !isNaN(oNode.y) && oNode.y !== 0) {\n allHaveNoPosition = false;\n }\n else {\n oNode.x = Math.random() * 100;\n oNode.y = Math.random() * 100;\n }\n outerNodeIds.push(cTree.id);\n (0, util_1.traverseTreeUp)(cTree, function (child) {\n if (child.id !== cTree.id)\n nodeAncestorIdMap[child.id] = cTree.id;\n return true;\n });\n });\n nodes.forEach(function (node) {\n if (node.comboId && comboMap[node.comboId])\n return;\n // 代表节点的节点\n var oNode = __assign({}, node);\n outerNodes.push(oNode);\n if (!isNaN(oNode.x) && oNode.x !== 0 && !isNaN(oNode.y) && oNode.y !== 0) {\n allHaveNoPosition = false;\n }\n else {\n oNode.x = Math.random() * 100;\n oNode.y = Math.random() * 100;\n }\n outerNodeIds.push(node.id);\n });\n var outerEdges = [];\n edges.concat(comboEdges).forEach(function (edge) {\n var sourceAncestorId = nodeAncestorIdMap[edge.source] || edge.source;\n var targetAncestorId = nodeAncestorIdMap[edge.target] || edge.target;\n // 若两个点的祖先都在力导图的节点中,且是不同的节点,创建一条链接两个祖先的边到力导图的边中\n if (sourceAncestorId !== targetAncestorId &&\n outerNodeIds.includes(sourceAncestorId) &&\n outerNodeIds.includes(targetAncestorId)) {\n outerEdges.push({\n source: sourceAncestorId,\n target: targetAncestorId\n });\n }\n });\n // 若有需要最外层的 combo 或节点,则对最外层执行力导向\n if (outerNodes === null || outerNodes === void 0 ? void 0 : outerNodes.length) {\n if (outerNodes.length === 1) {\n outerNodes[0].x = center[0];\n outerNodes[0].y = center[1];\n }\n else {\n var outerData = {\n nodes: outerNodes,\n edges: outerEdges\n };\n // 需要使用一个同步的布局\n // @ts-ignore\n var outerLayout = this.outerLayout || new _1.GForceLayout({\n gravity: 1,\n factor: 2,\n linkDistance: function (edge, source, target) {\n var _a, _b;\n var nodeSize = ((((_a = source.size) === null || _a === void 0 ? void 0 : _a[0]) || 30) + (((_b = target.size) === null || _b === void 0 ? void 0 : _b[0]) || 30)) / 2;\n return Math.min(nodeSize * 1.5, 700);\n }\n });\n var outerLayoutType = (_a = outerLayout.getType) === null || _a === void 0 ? void 0 : _a.call(outerLayout);\n outerLayout.updateCfg({\n center: center,\n kg: 5,\n preventOverlap: true,\n animate: false,\n });\n // 若所有 outerNodes 都没有位置,且 outerLayout 是力导家族的布局,则先执行 preset mds 或 grid\n if (allHaveNoPosition && constants_1.FORCE_LAYOUT_TYPE_MAP[outerLayoutType]) {\n var outerLayoutPreset = outerNodes.length < 100 ? new _1.MDSLayout() : new _1.GridLayout();\n outerLayoutPreset.layout(outerData);\n }\n outerLayout.layout(outerData);\n }\n // 根据外部布局结果,平移 innerGraphs 中的节点(第一层)\n outerNodes.forEach(function (oNode) {\n var innerGraph = innerGraphs[oNode.id];\n if (!innerGraph) {\n var node = nodeMap[oNode.id];\n if (node) {\n node.x = oNode.x;\n node.y = oNode.y;\n }\n return;\n }\n innerGraph.visited = true;\n innerGraph.x = oNode.x;\n innerGraph.y = oNode.y;\n innerGraph.nodes.forEach(function (node) {\n node.x += oNode.x;\n node.y += oNode.y;\n });\n });\n }\n // 至上而下遍历树处理下面各层节点位置\n var innerGraphIds = Object.keys(innerGraphs);\n var _loop_1 = function (i) {\n var id = innerGraphIds[i];\n var innerGraph = innerGraphs[id];\n if (!innerGraph)\n return \"continue\";\n innerGraph.nodes.forEach(function (node) {\n if (!innerGraph.visited) {\n node.x += (innerGraph.x || 0);\n node.y += (innerGraph.y || 0);\n }\n if (nodeMap[node.id]) {\n nodeMap[node.id].x = node.x;\n nodeMap[node.id].y = node.y;\n }\n });\n if (comboMap[id]) {\n comboMap[id].x = innerGraph.x;\n comboMap[id].y = innerGraph.y;\n }\n };\n for (var i = innerGraphIds.length - 1; i >= 0; i--) {\n _loop_1(i);\n }\n return { nodes: nodes, edges: edges, combos: combos, comboEdges: comboEdges };\n };\n ComboCombinedLayout.prototype.getInnerGraphs = function (nodeMap) {\n var self = this;\n var comboTrees = self.comboTrees, nodeSize = self.nodeSize, edges = self.edges, comboPadding = self.comboPadding, spacing = self.spacing;\n var innerGraphs = {};\n // @ts-ignore\n var innerGraphLayout = this.innerLayout || (new _1.ConcentricLayout({ sortBy: 'id' }));\n innerGraphLayout.center = [0, 0];\n innerGraphLayout.preventOverlap = true;\n innerGraphLayout.nodeSpacing = spacing;\n (comboTrees || []).forEach(function (ctree) {\n (0, util_1.traverseTreeUp)(ctree, function (treeNode) {\n var _a;\n // @ts-ignore\n var padding = (comboPadding === null || comboPadding === void 0 ? void 0 : comboPadding(treeNode)) || 10; // 返回的最大值\n if ((0, util_1.isArray)(padding))\n padding = Math.max.apply(Math, padding);\n if (!((_a = treeNode.children) === null || _a === void 0 ? void 0 : _a.length)) {\n // 空 combo\n if (treeNode.itemType === 'combo') {\n var treeNodeSize = padding ? [padding * 2, padding * 2] : [30, 30];\n innerGraphs[treeNode.id] = {\n id: treeNode.id,\n nodes: [],\n size: treeNodeSize\n };\n }\n }\n else {\n // 非空 combo\n var innerGraphNodes = treeNode.children.map(function (child) {\n if (child.itemType === 'combo')\n return innerGraphs[child.id];\n var oriNode = nodeMap[child.id] || {};\n return __assign(__assign({}, oriNode), child);\n });\n var innerGraphNodeIds_1 = innerGraphNodes.map(function (node) { return node.id; });\n var innerGraphData = {\n nodes: innerGraphNodes,\n edges: edges.filter(function (edge) { return innerGraphNodeIds_1.includes(edge.source) && innerGraphNodeIds_1.includes(edge.target); })\n };\n var minNodeSize_1 = Infinity;\n innerGraphNodes.forEach(function (node) {\n var _a;\n // @ts-ignore\n if (!node.size)\n node.size = ((_a = innerGraphs[node.id]) === null || _a === void 0 ? void 0 : _a.size) || (nodeSize === null || nodeSize === void 0 ? void 0 : nodeSize(node)) || [30, 30];\n if ((0, util_1.isNumber)(node.size))\n node.size = [node.size, node.size];\n if (minNodeSize_1 > node.size[0])\n minNodeSize_1 = node.size[0];\n if (minNodeSize_1 > node.size[1])\n minNodeSize_1 = node.size[1];\n });\n // 根据节点数量、spacing,调整布局参数\n innerGraphLayout.layout(innerGraphData);\n var _b = (0, util_1.findMinMaxNodeXY)(innerGraphNodes), minX = _b.minX, minY = _b.minY, maxX = _b.maxX, maxY = _b.maxY;\n var innerGraphSize = Math.max(maxX - minX, maxY - minY, minNodeSize_1) + padding * 2;\n innerGraphs[treeNode.id] = {\n id: treeNode.id,\n nodes: innerGraphNodes,\n size: [innerGraphSize, innerGraphSize]\n };\n }\n return true;\n });\n });\n return innerGraphs;\n };\n ComboCombinedLayout.prototype.initVals = function () {\n var self = this;\n var nodeSize = self.nodeSize;\n var spacing = self.spacing;\n var nodeSizeFunc;\n var spacingFunc;\n // nodeSpacing to function\n if ((0, util_1.isNumber)(spacing)) {\n spacingFunc = function () { return spacing; };\n }\n else if ((0, util_1.isFunction)(spacing)) {\n spacingFunc = spacing;\n }\n else {\n spacingFunc = function () { return 0; };\n }\n this.spacing = spacingFunc;\n // nodeSize to function\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n var spacing = spacingFunc(d);\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return (res + spacing) / 2;\n }\n if ((0, util_1.isObject)(d.size)) {\n var res = d.size.width > d.size.height ? d.size.width : d.size.height;\n return (res + spacing) / 2;\n }\n return (d.size + spacing) / 2;\n }\n return 10 + spacing / 2;\n };\n }\n else if ((0, util_1.isFunction)(nodeSize)) {\n nodeSizeFunc = function (d) {\n var size = nodeSize(d);\n var spacing = spacingFunc(d);\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return (res + spacing) / 2;\n }\n return ((size || 10) + spacing) / 2;\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n var larger = nodeSize[0] > nodeSize[1] ? nodeSize[0] : nodeSize[1];\n var radius_1 = larger / 2;\n nodeSizeFunc = function (d) { return radius_1 + spacingFunc(d) / 2; };\n }\n else {\n // number type\n var radius_2 = nodeSize / 2;\n nodeSizeFunc = function (d) { return radius_2 + spacingFunc(d) / 2; };\n }\n this.nodeSize = nodeSizeFunc;\n // comboPadding to function\n var comboPadding = self.comboPadding;\n var comboPaddingFunc;\n if ((0, util_1.isNumber)(comboPadding)) {\n comboPaddingFunc = function () { return comboPadding; };\n }\n else if ((0, util_1.isArray)(comboPadding)) {\n comboPaddingFunc = function () { return Math.max.apply(null, comboPadding); };\n }\n else if ((0, util_1.isFunction)(comboPadding)) {\n comboPaddingFunc = comboPadding;\n }\n else {\n // null type\n comboPaddingFunc = function () { return 0; };\n }\n this.comboPadding = comboPaddingFunc;\n };\n ComboCombinedLayout.prototype.getType = function () {\n return \"comboCombined\";\n };\n return ComboCombinedLayout;\n}(base_1.Base));\nexports.ComboCombinedLayout = ComboCombinedLayout;\n//# sourceMappingURL=comboCombined.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/comboCombined.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js\");\n\n\nfunction endsWith(arr, e) {\n return Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr) ? arr[arr.length - 1] === e : false;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (endsWith);\n//# sourceMappingURL=ends-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/ends-with.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/comboForce.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/comboForce.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/every.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/every.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview Combo force layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ComboForceLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\n/**\n * force layout for graph with combos\n */\nvar ComboForceLayout = /** @class */ (function (_super) {\n __extends(ComboForceLayout, _super);\n function ComboForceLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 100;\n /** 重力大小,影响图的紧凑程度 */\n _this.gravity = 10;\n /** 群组中心力大小 */\n _this.comboGravity = 10;\n /** 默认边长度 */\n _this.linkDistance = 10;\n /** 每次迭代位移的衰减相关参数 */\n _this.alpha = 1;\n _this.alphaMin = 0.001;\n _this.alphaDecay = 1 - Math.pow(_this.alphaMin, (1 / 300));\n _this.alphaTarget = 0;\n /** 节点运动速度衰减参数 */\n _this.velocityDecay = 0.6;\n /** 边引力大小 */\n _this.edgeStrength = 0.6;\n /** 节点引力大小 */\n _this.nodeStrength = 30;\n /** 是否开启防止重叠 */\n _this.preventOverlap = false;\n /** 是否开启节点之间的防止重叠 */\n _this.preventNodeOverlap = false;\n /** 是否开启 Combo 之间的防止重叠 */\n _this.preventComboOverlap = false;\n /** 防止重叠的碰撞力大小 */\n _this.collideStrength = undefined;\n /** 防止重叠的碰撞力大小 */\n _this.nodeCollideStrength = 0.5;\n /** 防止重叠的碰撞力大小 */\n _this.comboCollideStrength = 0.5;\n /** Combo 最小间距,防止重叠时的间隙 */\n _this.comboSpacing = 20;\n /** Combo 内部的 padding */\n _this.comboPadding = 10;\n /** 优化计算斥力的速度,两节点间距超过 optimizeRangeFactor * width 则不再计算斥力和重叠斥力 */\n _this.optimizeRangeFactor = 1;\n /** 每次迭代的回调函数 */\n _this.onTick = function () { };\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n /** 根据边两端节点层级差距的调整引力系数的因子,取值范围 [0, 1]。层级差距越大,引力越小 */\n _this.depthAttractiveForceScale = 1;\n /** 根据边两端节点层级差距的调整斥力系数的因子,取值范围 [1, Infinity]。层级差距越大,斥力越大 */\n _this.depthRepulsiveForceScale = 2;\n /** 内部计算参数 */\n _this.nodes = [];\n _this.edges = [];\n _this.combos = [];\n _this.comboTrees = [];\n _this.width = 300;\n _this.height = 300;\n _this.bias = [];\n _this.nodeMap = {};\n _this.oriComboMap = {};\n _this.indexMap = {};\n _this.comboMap = {};\n _this.previousLayouted = false;\n _this.updateCfg(options);\n return _this;\n }\n ComboForceLayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 100,\n center: [0, 0],\n gravity: 10,\n speed: 1,\n comboGravity: 30,\n preventOverlap: false,\n preventComboOverlap: true,\n preventNodeOverlap: true,\n nodeSpacing: undefined,\n collideStrength: undefined,\n nodeCollideStrength: 0.5,\n comboCollideStrength: 0.5,\n comboSpacing: 20,\n comboPadding: 10,\n edgeStrength: 0.6,\n nodeStrength: 30,\n linkDistance: 10\n };\n };\n /**\n * 执行布局\n */\n ComboForceLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var center = self.center;\n self.comboTree = {\n id: \"comboTreeRoot\",\n depth: -1,\n children: self.comboTrees\n };\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n self.initVals();\n // layout\n self.run();\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n };\n ComboForceLayout.prototype.run = function () {\n var self = this;\n var nodes = self.nodes;\n var maxIteration = self.previousLayouted\n ? self.maxIteration / 5\n : self.maxIteration;\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n var center = self.center;\n var velocityDecay = self.velocityDecay;\n // init the positions to make the nodes with same combo gather around the combo\n var comboMap = self.comboMap;\n if (!self.previousLayouted)\n self.initPos(comboMap);\n var _loop_1 = function (i) {\n var displacements = [];\n nodes.forEach(function (_, j) {\n displacements[j] = { x: 0, y: 0 };\n });\n self.applyCalculate(displacements);\n // gravity for combos\n self.applyComboCenterForce(displacements);\n // move\n nodes.forEach(function (n, j) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n n.x += displacements[j].x * velocityDecay;\n n.y += displacements[j].y * velocityDecay;\n });\n self.alpha += (self.alphaTarget - self.alpha) * self.alphaDecay;\n self.onTick();\n };\n // iterate\n for (var i = 0; i < maxIteration; i++) {\n _loop_1(i);\n }\n // move to center\n var meanCenter = [0, 0];\n nodes.forEach(function (n) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n meanCenter[0] += n.x;\n meanCenter[1] += n.y;\n });\n meanCenter[0] /= nodes.length;\n meanCenter[1] /= nodes.length;\n var centerOffset = [center[0] - meanCenter[0], center[1] - meanCenter[1]];\n nodes.forEach(function (n, j) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n n.x += centerOffset[0];\n n.y += centerOffset[1];\n });\n // arrange the empty combo\n self.combos.forEach(function (combo) {\n var mapped = comboMap[combo.id];\n if (mapped && mapped.empty) {\n combo.x = mapped.cx || combo.x;\n combo.y = mapped.cy || combo.y;\n }\n });\n self.previousLayouted = true;\n };\n ComboForceLayout.prototype.initVals = function () {\n var self = this;\n var edges = self.edges;\n var nodes = self.nodes;\n var combos = self.combos;\n var count = {};\n var nodeMap = {};\n var indexMap = {};\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = node;\n indexMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.indexMap = indexMap;\n var oriComboMap = {};\n combos.forEach(function (combo) {\n oriComboMap[combo.id] = combo;\n });\n self.oriComboMap = oriComboMap;\n self.comboMap = self.getComboMap();\n var preventOverlap = self.preventOverlap;\n self.preventComboOverlap = self.preventComboOverlap || preventOverlap;\n self.preventNodeOverlap = self.preventNodeOverlap || preventOverlap;\n var collideStrength = self.collideStrength;\n if (collideStrength) {\n self.comboCollideStrength = collideStrength;\n self.nodeCollideStrength = collideStrength;\n }\n self.comboCollideStrength = self.comboCollideStrength\n ? self.comboCollideStrength\n : 0;\n self.nodeCollideStrength = self.nodeCollideStrength\n ? self.nodeCollideStrength\n : 0;\n // get edge bias\n for (var i = 0; i < edges.length; ++i) {\n var source = (0, util_1.getEdgeTerminal)(edges[i], 'source');\n var target = (0, util_1.getEdgeTerminal)(edges[i], 'target');\n if (count[source])\n count[source]++;\n else\n count[source] = 1;\n if (count[target])\n count[target]++;\n else\n count[target] = 1;\n }\n var bias = [];\n for (var i = 0; i < edges.length; ++i) {\n var source = (0, util_1.getEdgeTerminal)(edges[i], 'source');\n var target = (0, util_1.getEdgeTerminal)(edges[i], 'target');\n bias[i] = count[source] / (count[source] + count[target]);\n }\n this.bias = bias;\n var nodeSize = self.nodeSize;\n var nodeSpacing = self.nodeSpacing;\n var nodeSizeFunc;\n var nodeSpacingFunc;\n // nodeSpacing to function\n if ((0, util_1.isNumber)(nodeSpacing)) {\n nodeSpacingFunc = function () { return nodeSpacing; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing)) {\n nodeSpacingFunc = nodeSpacing;\n }\n else {\n nodeSpacingFunc = function () { return 0; };\n }\n this.nodeSpacing = nodeSpacingFunc;\n // nodeSize to function\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return res / 2;\n }\n if ((0, util_1.isObject)(d.size)) {\n var res = d.size.width > d.size.height ? d.size.width : d.size.height;\n return res / 2;\n }\n return d.size / 2;\n }\n return 10;\n };\n }\n else if ((0, util_1.isFunction)(nodeSize)) {\n nodeSizeFunc = function (d) {\n return nodeSize(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n var larger = nodeSize[0] > nodeSize[1] ? nodeSize[0] : nodeSize[1];\n var radius_1 = larger / 2;\n nodeSizeFunc = function (d) { return radius_1; };\n }\n else {\n // number type\n var radius_2 = nodeSize / 2;\n nodeSizeFunc = function (d) { return radius_2; };\n }\n this.nodeSize = nodeSizeFunc;\n // comboSpacing to function\n var comboSpacing = self.comboSpacing;\n var comboSpacingFunc;\n if ((0, util_1.isNumber)(comboSpacing)) {\n comboSpacingFunc = function () { return comboSpacing; };\n }\n else if ((0, util_1.isFunction)(comboSpacing)) {\n comboSpacingFunc = comboSpacing;\n }\n else {\n // null type\n comboSpacingFunc = function () { return 0; };\n }\n this.comboSpacing = comboSpacingFunc;\n // comboPadding to function\n var comboPadding = self.comboPadding;\n var comboPaddingFunc;\n if ((0, util_1.isNumber)(comboPadding)) {\n comboPaddingFunc = function () { return comboPadding; };\n }\n else if ((0, util_1.isArray)(comboPadding)) {\n comboPaddingFunc = function () { return Math.max.apply(null, comboPadding); };\n }\n else if ((0, util_1.isFunction)(comboPadding)) {\n comboPaddingFunc = comboPadding;\n }\n else {\n // null type\n comboPaddingFunc = function () { return 0; };\n }\n this.comboPadding = comboPaddingFunc;\n // linkDistance to function\n var linkDistance = this.linkDistance;\n var linkDistanceFunc;\n if (!linkDistance) {\n linkDistance = 10;\n }\n if ((0, util_1.isNumber)(linkDistance)) {\n linkDistanceFunc = function (d) {\n return linkDistance;\n };\n }\n else {\n linkDistanceFunc = linkDistance;\n }\n this.linkDistance = linkDistanceFunc;\n // linkStrength to function\n var edgeStrength = this.edgeStrength;\n var edgeStrengthFunc;\n if (!edgeStrength) {\n edgeStrength = 1;\n }\n if ((0, util_1.isNumber)(edgeStrength)) {\n edgeStrengthFunc = function (d) {\n return edgeStrength;\n };\n }\n else {\n edgeStrengthFunc = edgeStrength;\n }\n this.edgeStrength = edgeStrengthFunc;\n // nodeStrength to function\n var nodeStrength = this.nodeStrength;\n var nodeStrengthFunc;\n if (!nodeStrength) {\n nodeStrength = 30;\n }\n if ((0, util_1.isNumber)(nodeStrength)) {\n nodeStrengthFunc = function (d) {\n return nodeStrength;\n };\n }\n else {\n nodeStrengthFunc = nodeStrength;\n }\n this.nodeStrength = nodeStrengthFunc;\n };\n ComboForceLayout.prototype.initPos = function (comboMap) {\n var self = this;\n var nodes = self.nodes;\n nodes.forEach(function (node, i) {\n var comboId = node.comboId;\n var combo = comboMap[comboId];\n if (comboId && combo) {\n node.x = combo.cx + 100 / (i + 1);\n node.y = combo.cy + 100 / (i + 1);\n }\n else {\n node.x = 100 / (i + 1);\n node.y = 100 / (i + 1);\n }\n });\n };\n ComboForceLayout.prototype.getComboMap = function () {\n var self = this;\n var nodeMap = self.nodeMap;\n var comboTrees = self.comboTrees;\n var oriComboMap = self.oriComboMap;\n var comboMap = {};\n (comboTrees || []).forEach(function (ctree) {\n var treeChildren = [];\n (0, util_1.traverseTreeUp)(ctree, function (treeNode) {\n if (treeNode.itemType === \"node\")\n return true; // skip it\n if (!oriComboMap[treeNode.id])\n return true; // means it is hidden, skip it\n if (comboMap[treeNode.id] === undefined) {\n var combo = {\n id: treeNode.id,\n name: treeNode.id,\n cx: 0,\n cy: 0,\n count: 0,\n depth: self.oriComboMap[treeNode.id].depth || 0,\n children: []\n };\n comboMap[treeNode.id] = combo;\n }\n var children = treeNode.children;\n if (children) {\n children.forEach(function (child) {\n if (!comboMap[child.id] && !nodeMap[child.id])\n return true; // means it is hidden\n treeChildren.push(child);\n });\n }\n var c = comboMap[treeNode.id];\n c.cx = 0;\n c.cy = 0;\n if (treeChildren.length === 0) {\n c.empty = true;\n var oriCombo = oriComboMap[treeNode.id];\n c.cx = oriCombo.x;\n c.cy = oriCombo.y;\n }\n treeChildren.forEach(function (child) {\n c.count++;\n if (child.itemType !== \"node\") {\n var childCombo = comboMap[child.id];\n if ((0, util_1.isNumber)(childCombo.cx))\n c.cx += childCombo.cx;\n if ((0, util_1.isNumber)(childCombo.cy))\n c.cy += childCombo.cy;\n return;\n }\n var node = nodeMap[child.id];\n // means the node is hidden, skip it\n if (!node)\n return;\n if ((0, util_1.isNumber)(node.x)) {\n c.cx += node.x;\n }\n if ((0, util_1.isNumber)(node.y)) {\n c.cy += node.y;\n }\n });\n c.cx /= (c.count || 1);\n c.cy /= (c.count || 1);\n c.children = treeChildren;\n return true;\n });\n });\n return comboMap;\n };\n ComboForceLayout.prototype.applyComboCenterForce = function (displacements) {\n var self = this;\n var gravity = self.gravity;\n var comboGravity = self.comboGravity || gravity;\n var alpha = this.alpha;\n var comboTrees = self.comboTrees;\n var indexMap = self.indexMap;\n var nodeMap = self.nodeMap;\n var comboMap = self.comboMap;\n (comboTrees || []).forEach(function (ctree) {\n (0, util_1.traverseTreeUp)(ctree, function (treeNode) {\n if (treeNode.itemType === \"node\")\n return true; // skip it\n var combo = comboMap[treeNode.id];\n // means the combo is hidden, skip it\n if (!combo)\n return true;\n var c = comboMap[treeNode.id];\n // higher depth the combo, larger the gravity\n var gravityScale = ((c.depth + 1) / 10) * 0.5;\n // apply combo center force for all the descend nodes in this combo\n // and update the center position and count for this combo\n var comboX = c.cx;\n var comboY = c.cy;\n c.cx = 0;\n c.cy = 0;\n c.children.forEach(function (child) {\n if (child.itemType !== \"node\") {\n var childCombo = comboMap[child.id];\n if (childCombo && (0, util_1.isNumber)(childCombo.cx))\n c.cx += childCombo.cx;\n if (childCombo && (0, util_1.isNumber)(childCombo.cy))\n c.cy += childCombo.cy;\n return;\n }\n var node = nodeMap[child.id];\n var vecX = (node.x - comboX) || 0.005;\n var vecY = (node.y - comboY) || 0.005;\n var l = Math.sqrt(vecX * vecX + vecY * vecY);\n var childIdx = indexMap[node.id];\n var params = ((comboGravity * alpha) / l) * gravityScale;\n displacements[childIdx].x -= vecX * params;\n displacements[childIdx].y -= vecY * params;\n if ((0, util_1.isNumber)(node.x))\n c.cx += node.x;\n if ((0, util_1.isNumber)(node.y))\n c.cy += node.y;\n });\n c.cx /= (c.count || 1);\n c.cy /= (c.count || 1);\n return true;\n });\n });\n };\n ComboForceLayout.prototype.applyCalculate = function (displacements) {\n var self = this;\n var comboMap = self.comboMap;\n var nodes = self.nodes;\n // store the vx, vy, and distance to reduce dulplicate calculation\n var vecMap = {};\n nodes.forEach(function (v, i) {\n nodes.forEach(function (u, j) {\n if (i < j)\n return;\n var vx = (v.x - u.x) || 0.005;\n var vy = (v.y - u.y) || 0.005;\n var vl2 = vx * vx + vy * vy;\n var vl = Math.sqrt(vl2);\n if (vl2 < 1)\n vl2 = vl;\n vecMap[\"\".concat(v.id, \"-\").concat(u.id)] = { vx: vx, vy: vy, vl2: vl2, vl: vl };\n vecMap[\"\".concat(u.id, \"-\").concat(v.id)] = { vl2: vl2, vl: vl, vx: -vx, vy: -vy };\n });\n });\n // get the sizes of the combos\n self.updateComboSizes(comboMap);\n self.calRepulsive(displacements, vecMap);\n self.calAttractive(displacements, vecMap);\n var preventComboOverlap = self.preventComboOverlap;\n if (preventComboOverlap)\n self.comboNonOverlapping(displacements, comboMap);\n };\n /**\n * Update the sizes of the combos according to their children\n * Used for combos nonoverlap, but not re-render the combo shapes\n */\n ComboForceLayout.prototype.updateComboSizes = function (comboMap) {\n var self = this;\n var comboTrees = self.comboTrees;\n var nodeMap = self.nodeMap;\n var nodeSize = self.nodeSize;\n var comboSpacing = self.comboSpacing;\n var comboPadding = self.comboPadding;\n (comboTrees || []).forEach(function (ctree) {\n var treeChildren = [];\n (0, util_1.traverseTreeUp)(ctree, function (treeNode) {\n if (treeNode.itemType === \"node\")\n return true; // skip it\n var c = comboMap[treeNode.id];\n // means the combo is hidden, skip it\n if (!c)\n return false;\n var children = treeNode.children;\n if (children) {\n children.forEach(function (child) {\n // means the combo is hidden.\n if (!comboMap[child.id] && !nodeMap[child.id])\n return;\n treeChildren.push(child);\n });\n }\n c.minX = Infinity;\n c.minY = Infinity;\n c.maxX = -Infinity;\n c.maxY = -Infinity;\n treeChildren.forEach(function (child) {\n if (child.itemType !== \"node\")\n return true; // skip it\n var node = nodeMap[child.id];\n if (!node)\n return true; // means it is hidden\n var r = nodeSize(node);\n var nodeMinX = node.x - r;\n var nodeMinY = node.y - r;\n var nodeMaxX = node.x + r;\n var nodeMaxY = node.y + r;\n if (c.minX > nodeMinX)\n c.minX = nodeMinX;\n if (c.minY > nodeMinY)\n c.minY = nodeMinY;\n if (c.maxX < nodeMaxX)\n c.maxX = nodeMaxX;\n if (c.maxY < nodeMaxY)\n c.maxY = nodeMaxY;\n });\n var minSize = self.oriComboMap[treeNode.id].size || 10;\n if ((0, util_1.isArray)(minSize))\n minSize = minSize[0];\n var maxLength = Math.max(c.maxX - c.minX, c.maxY - c.minY, minSize);\n c.r = maxLength / 2 + comboSpacing(c) / 2 + comboPadding(c);\n return true;\n });\n });\n };\n /**\n * prevent the overlappings among combos\n */\n ComboForceLayout.prototype.comboNonOverlapping = function (displacements, comboMap) {\n var self = this;\n var comboTree = self.comboTree;\n var comboCollideStrength = self.comboCollideStrength;\n var indexMap = self.indexMap;\n var nodeMap = self.nodeMap;\n (0, util_1.traverseTreeUp)(comboTree, function (treeNode) {\n if (!comboMap[treeNode.id] &&\n !nodeMap[treeNode.id] &&\n treeNode.id !== \"comboTreeRoot\") {\n return false;\n } // means it is hidden\n var children = treeNode.children;\n // 同个子树下的子 combo 间两两对比\n if (children && children.length > 1) {\n children.forEach(function (v, i) {\n if (v.itemType === \"node\")\n return false; // skip it\n var cv = comboMap[v.id];\n if (!cv)\n return; // means it is hidden, skip it\n children.forEach(function (u, j) {\n if (i <= j)\n return false;\n if (u.itemType === \"node\")\n return false; // skip it\n var cu = comboMap[u.id];\n if (!cu)\n return false; // means it is hidden, skip it\n var vx = (cv.cx - cu.cx) || 0.005;\n var vy = (cv.cy - cu.cy) || 0.005;\n var l = vx * vx + vy * vy;\n var rv = cv.r || 1;\n var ru = cu.r || 1;\n var r = rv + ru;\n var ru2 = ru * ru;\n var rv2 = rv * rv;\n // overlapping\n if (l < r * r) {\n var vnodes = v.children;\n if (!vnodes || vnodes.length === 0)\n return false; // skip it\n var unodes_1 = u.children;\n if (!unodes_1 || unodes_1.length === 0)\n return false; // skip it\n var sqrtl = Math.sqrt(l);\n var ll = ((r - sqrtl) / sqrtl) * comboCollideStrength;\n var xl_1 = vx * ll;\n var yl_1 = vy * ll;\n var rratio_1 = ru2 / (rv2 + ru2);\n var irratio_1 = 1 - rratio_1;\n // 两兄弟 combo 的子节点上施加斥力\n vnodes.forEach(function (vn) {\n if (vn.itemType !== \"node\")\n return false; // skip it\n if (!nodeMap[vn.id])\n return; // means it is hidden, skip it\n var vindex = indexMap[vn.id];\n unodes_1.forEach(function (un) {\n if (un.itemType !== \"node\")\n return false;\n if (!nodeMap[un.id])\n return false; // means it is hidden, skip it\n var uindex = indexMap[un.id];\n displacements[vindex].x += xl_1 * rratio_1;\n displacements[vindex].y += yl_1 * rratio_1;\n displacements[uindex].x -= xl_1 * irratio_1;\n displacements[uindex].y -= yl_1 * irratio_1;\n });\n });\n }\n });\n });\n }\n return true;\n });\n };\n /**\n * Calculate the repulsive force between each node pair\n * @param displacements The array stores the displacements for nodes\n * @param vecMap The map stores vector between each node pair\n */\n ComboForceLayout.prototype.calRepulsive = function (displacements, vecMap) {\n var self = this;\n var nodes = self.nodes;\n var max = self.width * self.optimizeRangeFactor;\n var nodeStrength = self.nodeStrength;\n var alpha = self.alpha;\n var nodeCollideStrength = self.nodeCollideStrength;\n var preventNodeOverlap = self.preventNodeOverlap;\n var nodeSizeFunc = self.nodeSize;\n var nodeSpacingFunc = self.nodeSpacing;\n var scale = self.depthRepulsiveForceScale;\n var center = self.center;\n nodes.forEach(function (v, i) {\n if (!v.x || !v.y)\n return;\n // center gravity\n if (center) {\n var gravity = self.gravity;\n var vecX = (v.x - center[0]) || 0.005;\n var vecY = (v.y - center[1]) || 0.005;\n var l = Math.sqrt(vecX * vecX + vecY * vecY);\n displacements[i].x -= (vecX * gravity * alpha) / l;\n displacements[i].y -= (vecY * gravity * alpha) / l;\n }\n nodes.forEach(function (u, j) {\n if (i === j) {\n return;\n }\n if (!u.x || !u.y)\n return;\n var _a = vecMap[\"\".concat(v.id, \"-\").concat(u.id)], vl2 = _a.vl2, vl = _a.vl;\n if (vl > max)\n return;\n var _b = vecMap[\"\".concat(v.id, \"-\").concat(u.id)], vx = _b.vx, vy = _b.vy;\n var depthDiff = Math.log(Math.abs(u.depth - v.depth) / 10) + 1 || 1;\n depthDiff = depthDiff < 1 ? 1 : depthDiff;\n if (u.comboId !== v.comboId)\n depthDiff += 1;\n var depthParam = depthDiff ? Math.pow(scale, depthDiff) : 1;\n var params = ((nodeStrength(u) * alpha) / vl2) * depthParam;\n displacements[i].x += vx * params;\n displacements[i].y += vy * params;\n // prevent node overlappings\n if (i < j && preventNodeOverlap) {\n var ri = (nodeSizeFunc(v) + nodeSpacingFunc(v)) || 1;\n var rj = (nodeSizeFunc(u) + nodeSpacingFunc(u)) || 1;\n var r = ri + rj;\n if (vl2 < r * r) {\n var ll = ((r - vl) / vl) * nodeCollideStrength;\n var rj2 = rj * rj;\n var rratio = rj2 / (ri * ri + rj2);\n var xl = vx * ll;\n var yl = vy * ll;\n displacements[i].x += xl * rratio;\n displacements[i].y += yl * rratio;\n rratio = 1 - rratio;\n displacements[j].x -= xl * rratio;\n displacements[j].y -= yl * rratio;\n }\n }\n });\n });\n };\n /**\n * Calculate the attractive force between the node pair with edge\n * @param displacements The array stores the displacements for nodes\n * @param vecMap The map stores vector between each node pair\n */\n ComboForceLayout.prototype.calAttractive = function (displacements, vecMap) {\n var self = this;\n var edges = self.edges;\n var linkDistance = self.linkDistance;\n var alpha = self.alpha;\n var edgeStrength = self.edgeStrength;\n var bias = self.bias;\n var scale = self.depthAttractiveForceScale;\n edges.forEach(function (e, i) {\n var source = (0, util_1.getEdgeTerminal)(e, 'source');\n var target = (0, util_1.getEdgeTerminal)(e, 'target');\n if (!source || !target || source === target)\n return;\n var uIndex = self.indexMap[source];\n var vIndex = self.indexMap[target];\n var u = self.nodeMap[source];\n var v = self.nodeMap[target];\n if (!u || !v)\n return;\n var depthDiff = u.depth === v.depth ? 0 : Math.log(Math.abs(u.depth - v.depth) / 10);\n if (u.comboId === v.comboId) {\n depthDiff = depthDiff / 2;\n }\n var depthParam = depthDiff ? Math.pow(scale, depthDiff) : 1;\n if (u.comboId !== v.comboId && depthParam === 1) {\n depthParam = scale / 2;\n }\n else if (u.comboId === v.comboId) {\n depthParam = 2;\n }\n if (!(0, util_1.isNumber)(v.x) || !(0, util_1.isNumber)(u.x) || !(0, util_1.isNumber)(v.y) || !(0, util_1.isNumber)(u.y)) {\n return;\n }\n var _a = vecMap[\"\".concat(target, \"-\").concat(source)], vl = _a.vl, vx = _a.vx, vy = _a.vy;\n var l = ((vl - linkDistance(e)) / vl) * alpha * edgeStrength(e) * depthParam;\n var vecX = vx * l;\n var vecY = vy * l;\n var b = bias[i];\n displacements[vIndex].x -= vecX * b;\n displacements[vIndex].y -= vecY * b;\n displacements[uIndex].x += vecX * (1 - b);\n displacements[uIndex].y += vecY * (1 - b);\n });\n };\n ComboForceLayout.prototype.getType = function () {\n return \"comboForce\";\n };\n return ComboForceLayout;\n}(base_1.Base));\nexports.ComboForceLayout = ComboForceLayout;\n//# sourceMappingURL=comboForce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/comboForce.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 只要有一个不满足条件就返回 false\n * @param arr\n * @param func\n */\nvar every = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (!func(arr[i], i))\n return false;\n }\n return true;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (every);\n//# sourceMappingURL=every.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/every.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/concentric.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/concentric.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/extend.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/extend.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview concentric layout\n * @author shiwu.wyy@antfin.com\n * this algorithm refers to - https://github.com/cytoscape/cytoscape.js/\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ConcentricLayout = void 0;\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\n/**\n * 同心圆布局\n */\nvar ConcentricLayout = /** @class */ (function (_super) {\n __extends(ConcentricLayout, _super);\n function ConcentricLayout(options) {\n var _this = _super.call(this) || this;\n _this.nodeSize = 30;\n /** min spacing between outside of nodes (used for radius adjustment) */\n _this.minNodeSpacing = 10;\n /** same as minNodeSpacing. min spacing between outside of nodes (used for radius adjustment) */\n _this.nodeSpacing = 10;\n /** prevents node overlap, may overflow boundingBox if not enough space */\n _this.preventOverlap = false;\n /** whether levels have an equal radial distance betwen them, may cause bounding box overflow */\n _this.equidistant = false;\n /** where nodes start in radians */\n _this.startAngle = (3 / 2) * Math.PI;\n /** whether the layout should go clockwise (true) or counterclockwise/anticlockwise (false) */\n _this.clockwise = true;\n /** 根据 sortBy 指定的属性进行排布,数值高的放在中心,如果是 sortBy 则会计算节点度数,度数最高的放在中心 */\n _this.sortBy = \"degree\";\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n ConcentricLayout.prototype.getDefaultCfg = function () {\n return {\n nodeSize: 30,\n minNodeSpacing: 10,\n nodeSpacing: 10,\n preventOverlap: false,\n sweep: undefined,\n equidistant: false,\n startAngle: (3 / 2) * Math.PI,\n clockwise: true,\n maxLevelDiff: undefined,\n sortBy: \"degree\"\n };\n };\n /**\n * 执行布局\n */\n ConcentricLayout.prototype.execute = function () {\n var _a, _b;\n var self = this;\n var nodes = self.nodes, edges = self.edges;\n var n = nodes.length;\n if (n === 0) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (n === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n (_b = self.onLayoutEnd) === null || _b === void 0 ? void 0 : _b.call(self);\n return;\n }\n var nodeSize = self.nodeSize, nodeSpacing = self.nodeSpacing;\n var layoutNodes = [];\n var maxNodeSize;\n var maxNodeSpacing = 0;\n if ((0, util_1.isArray)(nodeSize)) {\n maxNodeSize = Math.max(nodeSize[0], nodeSize[1]);\n }\n else {\n maxNodeSize = nodeSize;\n }\n if ((0, util_1.isArray)(nodeSpacing)) {\n maxNodeSpacing = Math.max(nodeSpacing[0], nodeSpacing[1]);\n }\n else if ((0, util_1.isNumber)(nodeSpacing)) {\n maxNodeSpacing = nodeSpacing;\n }\n nodes.forEach(function (node) {\n layoutNodes.push(node);\n var nodeSize = maxNodeSize;\n if ((0, util_1.isArray)(node.size)) {\n nodeSize = Math.max(node.size[0], node.size[1]);\n }\n else if ((0, util_1.isNumber)(node.size)) {\n nodeSize = node.size;\n }\n else if ((0, util_1.isObject)(node.size)) {\n nodeSize = Math.max(node.size.width, node.size.height);\n }\n maxNodeSize = Math.max(maxNodeSize, nodeSize);\n if ((0, util_1.isFunction)(nodeSpacing)) {\n maxNodeSpacing = Math.max(nodeSpacing(node), maxNodeSpacing);\n }\n });\n self.clockwise =\n self.counterclockwise !== undefined\n ? !self.counterclockwise\n : self.clockwise;\n // layout\n var nodeMap = {};\n var indexMap = {};\n layoutNodes.forEach(function (node, i) {\n nodeMap[node.id] = node;\n indexMap[node.id] = i;\n });\n // get the node degrees\n if (self.sortBy === \"degree\" ||\n !(0, util_1.isString)(self.sortBy) ||\n layoutNodes[0][self.sortBy] === undefined) {\n self.sortBy = \"degree\";\n if (!(0, util_1.isNumber)(nodes[0].degree)) {\n var values_1 = (0, util_1.getDegree)(nodes.length, indexMap, edges);\n layoutNodes.forEach(function (node, i) {\n node.degree = values_1[i].all;\n });\n }\n }\n // sort nodes by value\n layoutNodes.sort(function (n1, n2) {\n return n2[self.sortBy] - n1[self.sortBy];\n });\n self.maxValueNode = layoutNodes[0];\n self.maxLevelDiff =\n self.maxLevelDiff || self.maxValueNode[self.sortBy] / 4;\n // put the values into levels\n var levels = [[]];\n var currentLevel = levels[0];\n layoutNodes.forEach(function (node) {\n if (currentLevel.length > 0) {\n var diff = Math.abs(currentLevel[0][self.sortBy] - node[self.sortBy]);\n if (self.maxLevelDiff && diff >= self.maxLevelDiff) {\n currentLevel = [];\n levels.push(currentLevel);\n }\n }\n currentLevel.push(node);\n });\n // create positions for levels\n var minDist = maxNodeSize + (maxNodeSpacing || self.minNodeSpacing); // min dist between nodes\n if (!self.preventOverlap) {\n // then strictly constrain to bb\n var firstLvlHasMulti = levels.length > 0 && levels[0].length > 1;\n var maxR = Math.min(self.width, self.height) / 2 - minDist;\n var rStep = maxR / (levels.length + (firstLvlHasMulti ? 1 : 0));\n minDist = Math.min(minDist, rStep);\n }\n // find the metrics for each level\n var r = 0;\n levels.forEach(function (level) {\n var sweep = self.sweep;\n if (sweep === undefined) {\n sweep = 2 * Math.PI - (2 * Math.PI) / level.length;\n }\n var dTheta = (level.dTheta = sweep / Math.max(1, level.length - 1));\n // calculate the radius\n if (level.length > 1 && self.preventOverlap) {\n // but only if more than one node (can't overlap)\n var dcos = Math.cos(dTheta) - Math.cos(0);\n var dsin = Math.sin(dTheta) - Math.sin(0);\n var rMin = Math.sqrt((minDist * minDist) / (dcos * dcos + dsin * dsin)); // s.t. no nodes overlapping\n r = Math.max(rMin, r);\n }\n level.r = r;\n r += minDist;\n });\n if (self.equidistant) {\n var rDeltaMax_1 = 0;\n var rr_1 = 0;\n for (var i = 0; i < levels.length; i++) {\n var level = levels[i];\n var rDelta = level.r - rr_1;\n rDeltaMax_1 = Math.max(rDeltaMax_1, rDelta);\n }\n rr_1 = 0;\n levels.forEach(function (level, i) {\n if (i === 0) {\n rr_1 = level.r;\n }\n level.r = rr_1;\n rr_1 += rDeltaMax_1;\n });\n }\n // calculate the node positions\n levels.forEach(function (level) {\n var dTheta = level.dTheta;\n var rr = level.r;\n level.forEach(function (node, j) {\n var theta = self.startAngle + (self.clockwise ? 1 : -1) * dTheta * j;\n node.x = center[0] + rr * Math.cos(theta);\n node.y = center[1] + rr * Math.sin(theta);\n });\n });\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n };\n ConcentricLayout.prototype.getType = function () {\n return \"concentric\";\n };\n return ConcentricLayout;\n}(base_1.Base));\nexports.ConcentricLayout = ConcentricLayout;\n//# sourceMappingURL=concentric.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/concentric.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mix.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\n\nvar extend = function (subclass, superclass, overrides, staticOverrides) {\n // 如果只提供父类构造函数,则自动生成子类构造函数\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(superclass)) {\n overrides = superclass;\n superclass = subclass;\n subclass = function () { };\n }\n var create = Object.create\n ? function (proto, c) {\n return Object.create(proto, {\n constructor: {\n value: c,\n },\n });\n }\n : function (proto, c) {\n function Tmp() { }\n Tmp.prototype = proto;\n var o = new Tmp();\n o.constructor = c;\n return o;\n };\n var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype\n subclass.prototype = Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(superObj, subclass.prototype); // 指定子类的prototype\n subclass.superclass = create(superclass.prototype, superclass);\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(superObj, overrides);\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(subclass, staticOverrides);\n return subclass;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (extend);\n//# sourceMappingURL=extend.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/extend.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/constants.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/constants.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/filter.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/filter.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FORCE_LAYOUT_TYPE_MAP = exports.LAYOUT_MESSAGE = void 0;\n/** layout message type */\nexports.LAYOUT_MESSAGE = {\n // run layout\n RUN: \"LAYOUT_RUN\",\n // layout ended with success\n END: \"LAYOUT_END\",\n // layout error\n ERROR: \"LAYOUT_ERROR\",\n // layout tick, used in force directed layout\n TICK: \"LAYOUT_TICK\",\n GPURUN: \"GPU_LAYOUT_RUN\",\n GPUEND: \"GPU_LAYOUT_END\"\n};\nexports.FORCE_LAYOUT_TYPE_MAP = {\n 'gForce': true,\n 'force2': true,\n 'fruchterman': true,\n 'forceAtlas2': true,\n 'force': true,\n 'graphin-force': true,\n};\n//# sourceMappingURL=constants.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/constants.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\nvar filter = function (arr, func) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n if (func(value, index)) {\n result.push(value);\n }\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (filter);\n//# sourceMappingURL=filter.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/filter.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/find-index.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/find-index.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview dagre layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DagreLayout = void 0;\nvar index_1 = __importDefault(__webpack_require__(/*! ./dagre/index */ \"./node_modules/@antv/layout/lib/layout/dagre/index.js\"));\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar graph_1 = __webpack_require__(/*! ./dagre/graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\n/**\n * 层次布局\n */\nvar DagreLayout = /** @class */ (function (_super) {\n __extends(DagreLayout, _super);\n function DagreLayout(options) {\n var _this = _super.call(this) || this;\n /** layout 方向, 可选 TB, BT, LR, RL */\n _this.rankdir = \"TB\";\n /** 节点水平间距(px) */\n _this.nodesep = 50;\n /** 每一层节点之间间距 */\n _this.ranksep = 50;\n /** 是否保留布局连线的控制点 */\n _this.controlPoints = false;\n /** 每层节点是否根据节点数据中的 comboId 进行排序,以防止同层 combo 重叠 */\n _this.sortByCombo = false;\n /** 是否保留每条边上的dummy node */\n _this.edgeLabelSpace = true;\n /** 是否基于 dagre 进行辐射布局,若是,第一层节点将被放置在最内环上,其余层依次向外辐射 */\n _this.radial = false;\n _this.nodes = [];\n _this.edges = [];\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.layoutNode = function (nodeId) {\n var self = _this;\n var nodes = self.nodes;\n var node = nodes.find(function (node) { return node.id === nodeId; });\n if (node) {\n var layout = node.layout !== false;\n return layout;\n }\n return true;\n };\n _this.updateCfg(options);\n return _this;\n }\n DagreLayout.prototype.getDefaultCfg = function () {\n return {\n rankdir: \"TB\",\n align: undefined,\n nodeSize: undefined,\n nodesepFunc: undefined,\n ranksepFunc: undefined,\n nodesep: 50,\n ranksep: 50,\n controlPoints: false,\n radial: false,\n focusNode: null, // radial 为 true 时生效,关注的节点\n };\n };\n /**\n * 执行布局\n */\n DagreLayout.prototype.execute = function () {\n var _this = this;\n var _a, _b;\n var self = this;\n var nodes = self.nodes, nodeSize = self.nodeSize, rankdir = self.rankdir, combos = self.combos, begin = self.begin, radial = self.radial;\n if (!nodes)\n return;\n var edges = self.edges || [];\n var g = new graph_1.Graph({\n multigraph: true,\n compound: true,\n });\n var nodeSizeFunc;\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return d.size;\n }\n if ((0, util_1.isObject)(d.size)) {\n return [d.size.width || 40, d.size.height || 40];\n }\n return [d.size, d.size];\n }\n return [40, 40];\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function () { return nodeSize; };\n }\n else {\n nodeSizeFunc = function () { return [nodeSize, nodeSize]; };\n }\n var ranksepfunc = (0, util_1.getFunc)(self.ranksep, 50, self.ranksepFunc);\n var nodesepfunc = (0, util_1.getFunc)(self.nodesep, 50, self.nodesepFunc);\n var horisep = nodesepfunc;\n var vertisep = ranksepfunc;\n if (rankdir === \"LR\" || rankdir === \"RL\") {\n horisep = ranksepfunc;\n vertisep = nodesepfunc;\n }\n g.setDefaultEdgeLabel(function () { return ({}); });\n g.setGraph(self);\n var comboMap = {};\n if (this.sortByCombo && combos) {\n combos.forEach(function (combo) {\n if (!combo.parentId)\n return;\n if (!comboMap[combo.parentId]) {\n comboMap[combo.parentId] = true;\n g.setNode(combo.parentId, {});\n }\n g.setParent(combo.id, combo.parentId);\n });\n }\n nodes.filter(function (node) { return node.layout !== false; }).forEach(function (node) {\n var size = nodeSizeFunc(node);\n var verti = vertisep(node);\n var hori = horisep(node);\n var width = size[0] + 2 * hori;\n var height = size[1] + 2 * verti;\n var layer = node.layer;\n if ((0, util_1.isNumber)(layer)) {\n // 如果有layer属性,加入到node的label中\n g.setNode(node.id, { width: width, height: height, layer: layer });\n }\n else {\n g.setNode(node.id, { width: width, height: height });\n }\n if (_this.sortByCombo && node.comboId) {\n if (!comboMap[node.comboId]) {\n comboMap[node.comboId] = true;\n g.setNode(node.comboId, {});\n }\n g.setParent(node.id, node.comboId);\n }\n });\n edges.forEach(function (edge) {\n // dagrejs Wiki https://github.com/dagrejs/dagre/wiki#configuring-the-layout\n var source = (0, util_1.getEdgeTerminal)(edge, 'source');\n var target = (0, util_1.getEdgeTerminal)(edge, 'target');\n if (_this.layoutNode(source) && _this.layoutNode(target)) {\n g.setEdge(source, target, {\n weight: edge.weight || 1,\n });\n }\n });\n // 考虑增量图中的原始图\n var prevGraph = undefined;\n if ((_a = self.preset) === null || _a === void 0 ? void 0 : _a.nodes) {\n prevGraph = new graph_1.Graph({\n multigraph: true,\n compound: true,\n });\n self.preset.nodes.forEach(function (node) {\n prevGraph === null || prevGraph === void 0 ? void 0 : prevGraph.setNode(node.id, node);\n });\n }\n index_1.default.layout(g, {\n prevGraph: prevGraph,\n edgeLabelSpace: self.edgeLabelSpace,\n keepNodeOrder: Boolean(!!self.nodeOrder),\n nodeOrder: self.nodeOrder,\n });\n var dBegin = [0, 0];\n if (begin) {\n var minX_1 = Infinity;\n var minY_1 = Infinity;\n g.nodes().forEach(function (node) {\n var coord = g.node(node);\n if (minX_1 > coord.x)\n minX_1 = coord.x;\n if (minY_1 > coord.y)\n minY_1 = coord.y;\n });\n g.edges().forEach(function (edge) {\n var _a;\n var coord = g.edge(edge);\n (_a = coord.points) === null || _a === void 0 ? void 0 : _a.forEach(function (point) {\n if (minX_1 > point.x)\n minX_1 = point.x;\n if (minY_1 > point.y)\n minY_1 = point.y;\n });\n });\n dBegin[0] = begin[0] - minX_1;\n dBegin[1] = begin[1] - minY_1;\n }\n // 变形为辐射\n if (radial) {\n var _c = this, focusNode = _c.focusNode, ranksep = _c.ranksep, getRadialPos_1 = _c.getRadialPos;\n var focusId = (0, util_1.isString)(focusNode) ? focusNode : focusNode === null || focusNode === void 0 ? void 0 : focusNode.id;\n var focusLayer_1 = focusId ? (_b = g.node(focusId)) === null || _b === void 0 ? void 0 : _b._rank : 0;\n var layers_1 = [];\n var isHorizontal = rankdir === 'LR' || rankdir === 'RL';\n var dim_1 = isHorizontal ? 'y' : 'x';\n var sizeDim_1 = isHorizontal ? 'height' : 'width';\n // 找到整个图作为环的坐标维度(dim)的最大、最小值,考虑节点宽度\n var min_1 = Infinity;\n var max_1 = -Infinity;\n g.nodes().forEach(function (node) {\n var coord = g.node(node);\n var i = nodes.findIndex(function (it) { return it.id === node; });\n if (!nodes[i])\n return;\n var currentNodesep = nodesepfunc(nodes[i]);\n if (focusLayer_1 === 0) {\n if (!layers_1[coord._rank])\n layers_1[coord._rank] = { nodes: [], totalWidth: 0, maxSize: -Infinity };\n layers_1[coord._rank].nodes.push(node);\n layers_1[coord._rank].totalWidth += currentNodesep * 2 + coord[sizeDim_1];\n if (layers_1[coord._rank].maxSize < Math.max(coord.width, coord.height))\n layers_1[coord._rank].maxSize = Math.max(coord.width, coord.height);\n }\n else {\n var diffLayer = coord._rank - focusLayer_1;\n if (diffLayer === 0) {\n if (!layers_1[diffLayer])\n layers_1[diffLayer] = { nodes: [], totalWidth: 0, maxSize: -Infinity };\n layers_1[diffLayer].nodes.push(node);\n layers_1[diffLayer].totalWidth += currentNodesep * 2 + coord[sizeDim_1];\n if (layers_1[diffLayer].maxSize < Math.max(coord.width, coord.height))\n layers_1[diffLayer].maxSize = Math.max(coord.width, coord.height);\n }\n else {\n var diffLayerAbs = Math.abs(diffLayer);\n if (!layers_1[diffLayerAbs])\n layers_1[diffLayerAbs] = { left: [], right: [], totalWidth: 0, maxSize: -Infinity };\n layers_1[diffLayerAbs].totalWidth += currentNodesep * 2 + coord[sizeDim_1];\n if (layers_1[diffLayerAbs].maxSize < Math.max(coord.width, coord.height))\n layers_1[diffLayerAbs].maxSize = Math.max(coord.width, coord.height);\n if (diffLayer < 0) {\n layers_1[diffLayerAbs].left.push(node);\n }\n else {\n layers_1[diffLayerAbs].right.push(node);\n }\n }\n }\n var leftPos = coord[dim_1] - coord[sizeDim_1] / 2 - currentNodesep;\n var rightPos = coord[dim_1] + coord[sizeDim_1] / 2 + currentNodesep;\n if (leftPos < min_1)\n min_1 = leftPos;\n if (rightPos > max_1)\n max_1 = rightPos;\n });\n // const padding = (max - min) * 0.1; // TODO\n // \b初始化为第一圈的半径,后面根据每层 ranksep 叠加\n var radius_1 = ranksep || 50; // TODO;\n var radiusMap_1 = {};\n // 扩大最大最小值范围,以便为环上留出接缝处的空隙\n var rangeLength_1 = (max_1 - min_1) / 0.9;\n var range_1 = [(min_1 + max_1 - rangeLength_1) * 0.5, (min_1 + max_1 + rangeLength_1) * 0.5];\n // 根据半径、分布比例,计算节点在环上的位置,并返回该组节点中最大的 ranksep 值\n var processNodes_1 = function (layerNodes, radius, propsMaxRanksep, arcRange) {\n if (propsMaxRanksep === void 0) { propsMaxRanksep = -Infinity; }\n if (arcRange === void 0) { arcRange = [0, 1]; }\n var maxRanksep = propsMaxRanksep;\n layerNodes.forEach(function (node) {\n var coord = g.node(node);\n radiusMap_1[node] = radius;\n // 获取变形为 radial 后的直角坐标系坐标\n var _a = getRadialPos_1(coord[dim_1], range_1, rangeLength_1, radius, arcRange), newX = _a.x, newY = _a.y;\n // 将新坐标写入源数据\n var i = nodes.findIndex(function (it) { return it.id === node; });\n if (!nodes[i])\n return;\n nodes[i].x = newX + dBegin[0];\n nodes[i].y = newY + dBegin[1];\n // @ts-ignore: pass layer order to data for increment layout use\n nodes[i]._order = coord._order;\n // 找到本层最大的一个 ranksep,作为下一层与本层的间隙,叠加到下一层的半径上\n var currentNodeRanksep = ranksepfunc(nodes[i]);\n if (maxRanksep < currentNodeRanksep)\n maxRanksep = currentNodeRanksep;\n });\n return maxRanksep;\n };\n var isFirstLevel_1 = true;\n var lastLayerMaxNodeSize_1 = 0;\n layers_1.forEach(function (layerNodes) {\n var _a, _b, _c, _d, _e, _f, _g;\n if (!((_a = layerNodes === null || layerNodes === void 0 ? void 0 : layerNodes.nodes) === null || _a === void 0 ? void 0 : _a.length) && !((_b = layerNodes === null || layerNodes === void 0 ? void 0 : layerNodes.left) === null || _b === void 0 ? void 0 : _b.length) && !((_c = layerNodes === null || layerNodes === void 0 ? void 0 : layerNodes.right) === null || _c === void 0 ? void 0 : _c.length))\n return;\n // 第一层只有一个节点,直接放在圆心,初始半径设定为 0\n if (isFirstLevel_1 && layerNodes.nodes.length === 1) {\n // 将新坐标写入源数据\n var i = nodes.findIndex(function (it) { return it.id === layerNodes.nodes[0]; });\n nodes[i].x = dBegin[0];\n nodes[i].y = dBegin[1];\n radiusMap_1[layerNodes.nodes[0]] = 0;\n radius_1 = ranksepfunc(nodes[i]);\n isFirstLevel_1 = false;\n return;\n }\n // 为接缝留出空隙,半径也需要扩大\n radius_1 = Math.max(radius_1, layerNodes.totalWidth / (2 * Math.PI)); // / 0.9;\n var maxRanksep = -Infinity;\n if (focusLayer_1 === 0 || ((_d = layerNodes.nodes) === null || _d === void 0 ? void 0 : _d.length)) {\n maxRanksep = processNodes_1(layerNodes.nodes, radius_1, maxRanksep, [0, 1]); // 0.8\n }\n else {\n var leftRatio = ((_e = layerNodes.left) === null || _e === void 0 ? void 0 : _e.length) / (((_f = layerNodes.left) === null || _f === void 0 ? void 0 : _f.length) + ((_g = layerNodes.right) === null || _g === void 0 ? void 0 : _g.length));\n maxRanksep = processNodes_1(layerNodes.left, radius_1, maxRanksep, [0, leftRatio]); // 接缝留出 0.05 的缝隙\n maxRanksep = processNodes_1(layerNodes.right, radius_1, maxRanksep, [leftRatio + 0.05, 1]); // 接缝留出 0.05 的缝隙\n }\n radius_1 += maxRanksep;\n isFirstLevel_1 = false;\n lastLayerMaxNodeSize_1 - layerNodes.maxSize;\n });\n g.edges().forEach(function (edge) {\n var _a, _b, _c;\n var coord = g.edge(edge);\n var i = edges.findIndex(function (it) {\n var source = (0, util_1.getEdgeTerminal)(it, 'source');\n var target = (0, util_1.getEdgeTerminal)(it, 'target');\n return source === edge.v && target === edge.w;\n });\n if ((self.edgeLabelSpace) && self.controlPoints && edges[i].type !== \"loop\") {\n var otherDim_1 = dim_1 === 'x' ? 'y' : 'x';\n var controlPoints = (_a = coord === null || coord === void 0 ? void 0 : coord.points) === null || _a === void 0 ? void 0 : _a.slice(1, coord.points.length - 1);\n var newControlPoints_1 = [];\n var sourceOtherDimValue_1 = (_b = g.node(edge.v)) === null || _b === void 0 ? void 0 : _b[otherDim_1];\n var otherDimDist_1 = sourceOtherDimValue_1 - ((_c = g.node(edge.w)) === null || _c === void 0 ? void 0 : _c[otherDim_1]);\n var sourceRadius_1 = radiusMap_1[edge.v];\n var radiusDist_1 = sourceRadius_1 - radiusMap_1[edge.w];\n controlPoints === null || controlPoints === void 0 ? void 0 : controlPoints.forEach(function (point) {\n // 根据该边的起点、终点半径,及起点、终点、控制点位置关系,确定该控制点的半径\n var cRadius = (point[otherDim_1] - sourceOtherDimValue_1) / otherDimDist_1 * radiusDist_1 + sourceRadius_1;\n // 获取变形为 radial 后的直角坐标系坐标\n var newPos = getRadialPos_1(point[dim_1], range_1, rangeLength_1, cRadius);\n newControlPoints_1.push({\n x: newPos.x + dBegin[0],\n y: newPos.y + dBegin[1]\n });\n });\n edges[i].controlPoints = newControlPoints_1;\n }\n });\n }\n else {\n g.nodes().forEach(function (node) {\n var coord = g.node(node);\n var i = nodes.findIndex(function (it) { return it.id === node; });\n if (!nodes[i])\n return;\n nodes[i].x = coord.x + dBegin[0];\n nodes[i].y = coord.y + dBegin[1];\n // @ts-ignore: pass layer order to data for increment layout use\n nodes[i]._order = coord._order;\n });\n g.edges().forEach(function (edge) {\n var _a;\n var coord = g.edge(edge);\n var i = edges.findIndex(function (it) {\n var source = (0, util_1.getEdgeTerminal)(it, 'source');\n var target = (0, util_1.getEdgeTerminal)(it, 'target');\n return source === edge.v && target === edge.w;\n });\n if ((self.edgeLabelSpace) && self.controlPoints && edges[i].type !== \"loop\") {\n edges[i].controlPoints = (_a = coord === null || coord === void 0 ? void 0 : coord.points) === null || _a === void 0 ? void 0 : _a.slice(1, coord.points.length - 1); // 去掉头尾\n edges[i].controlPoints.forEach(function (point) {\n point.x += dBegin[0];\n point.y += dBegin[1];\n });\n }\n });\n }\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges,\n };\n };\n DagreLayout.prototype.getRadialPos = function (dimValue, range, rangeLength, radius, arcRange) {\n if (arcRange === void 0) { arcRange = [0, 1]; }\n // dimRatio 占圆弧的比例\n var dimRatio = (dimValue - range[0]) / rangeLength;\n // 再进一步归一化到指定的范围上\n dimRatio = dimRatio * (arcRange[1] - arcRange[0]) + arcRange[0];\n // 使用最终归一化后的范围计算角度\n var angle = dimRatio * 2 * Math.PI; // 弧度\n // 将极坐标系转换为直角坐标系\n return {\n x: Math.cos(angle) * radius,\n y: Math.sin(angle) * radius\n };\n };\n DagreLayout.prototype.getType = function () {\n return \"dagre\";\n };\n return DagreLayout;\n}(base_1.Base));\nexports.DagreLayout = DagreLayout;\n//# sourceMappingURL=dagre.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nfunction findIndex(arr, predicate, fromIndex) {\n if (fromIndex === void 0) { fromIndex = 0; }\n for (var i = fromIndex; i < arr.length; i++) {\n if (predicate(arr[i], i)) {\n // 找到终止循环\n return i;\n }\n }\n return -1;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (findIndex);\n//# sourceMappingURL=find-index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/find-index.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/graph.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/graph.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/find.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/find.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Graph = void 0;\nvar graphlib_1 = __webpack_require__(/*! @antv/graphlib */ \"./node_modules/@antv/graphlib/es/index.js\");\nvar Graph = /** @class */ (function (_super) {\n __extends(Graph, _super);\n function Graph() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return Graph;\n}(graphlib_1.Graph));\nexports.Graph = Graph;\n//# sourceMappingURL=graph.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/graph.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n/* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-match */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-match.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-plain-object.js\");\n\n\n\n\nfunction find(arr, predicate) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arr))\n return null;\n var _predicate;\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(predicate)) {\n _predicate = predicate;\n }\n if (Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(predicate)) {\n _predicate = function (a) { return Object(_is_match__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(a, predicate); };\n }\n if (_predicate) {\n for (var i = 0; i < arr.length; i += 1) {\n if (_predicate(arr[i])) {\n return arr[i];\n }\n }\n }\n return null;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (find);\n//# sourceMappingURL=find.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/find.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/index.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/first-value.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/first-value.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\nCopyright (c) 2012-2014 Chris Pettitt\n\nPermission is hereby granted, free of charge, to any person obtaining a copy\nof this software and associated documentation files (the \"Software\"), to deal\nin the Software without restriction, including without limitation the rights\nto use, copy, modify, merge, publish, distribute, sublicense, and/or sell\ncopies of the Software, and to permit persons to whom the Software is\nfurnished to do so, subject to the following conditions:\n\nThe above copyright notice and this permission notice shall be included in\nall copies or substantial portions of the Software.\n\nTHE SOFTWARE IS PROVIDED \"AS IS\", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR\nIMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,\nFITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE\nAUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER\nLIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,\nOUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN\nTHE SOFTWARE.\n*/\nvar layout_1 = __importDefault(__webpack_require__(/*! ./src/layout */ \"./node_modules/@antv/layout/lib/layout/dagre/src/layout.js\"));\nvar util_1 = __webpack_require__(/*! ./src/util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nexports.default = {\n layout: layout_1.default,\n util: {\n time: util_1.time,\n notime: util_1.notime\n },\n};\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n\n\nvar firstValue = function (data, name) {\n var rst = null;\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云\n }\n else {\n rst = value;\n }\n break;\n }\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (firstValue);\n//# sourceMappingURL=first-value.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/first-value.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/acyclic.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/acyclic.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/fixed-base.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/fixed-base.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar greedy_fas_1 = __importDefault(__webpack_require__(/*! ./greedy-fas */ \"./node_modules/@antv/layout/lib/layout/dagre/src/greedy-fas.js\"));\nvar run = function (g) {\n var weightFn = function (g) {\n return function (e) { var _a; return ((_a = g.edge(e)) === null || _a === void 0 ? void 0 : _a.weight) || 1; };\n };\n var fas = g.graph().acyclicer === \"greedy\" ? (0, greedy_fas_1.default)(g, weightFn(g)) : dfsFAS(g);\n fas === null || fas === void 0 ? void 0 : fas.forEach(function (e) {\n var label = g.edge(e);\n g.removeEdgeObj(e);\n label.forwardName = e.name;\n label.reversed = true;\n g.setEdge(e.w, e.v, label, \"rev-\".concat(Math.random()));\n });\n};\nvar dfsFAS = function (g) {\n var fas = [];\n var stack = {};\n var visited = {};\n var dfs = function (v) {\n var _a;\n if (visited[v]) {\n return;\n }\n visited[v] = true;\n stack[v] = true;\n (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n if (stack[e.w]) {\n fas.push(e);\n }\n else {\n dfs(e.w);\n }\n });\n delete stack[v];\n };\n g.nodes().forEach(dfs);\n return fas;\n};\nvar undo = function (g) {\n g.edges().forEach(function (e) {\n var label = g.edge(e);\n if (label.reversed) {\n g.removeEdgeObj(e);\n var forwardName = label.forwardName;\n delete label.reversed;\n delete label.forwardName;\n g.setEdge(e.w, e.v, label, forwardName);\n }\n });\n};\nexports.default = { run: run, undo: undo };\n//# sourceMappingURL=acyclic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/acyclic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar fixedBase = function (v, base) {\n var str = base.toString();\n var index = str.indexOf('.');\n if (index === -1) {\n return Math.round(v);\n }\n var length = str.substr(index + 1).length;\n if (length > 20) {\n length = 20;\n }\n return parseFloat(v.toFixed(length));\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (fixedBase);\n//# sourceMappingURL=fixed-base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/fixed-base.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/add-border-segments.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/add-border-segments.js ***! - \*******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/flatten-deep.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/flatten-deep.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar addBorderSegments = function (g) {\n var _a;\n var dfs = function (v) {\n var children = g.children(v);\n var node = g.node(v);\n if (children === null || children === void 0 ? void 0 : children.length) {\n children.forEach(function (child) { return dfs(child); });\n }\n if (node.hasOwnProperty(\"minRank\")) {\n node.borderLeft = [];\n node.borderRight = [];\n for (var rank = node.minRank, maxRank = node.maxRank + 1; rank < maxRank; rank += 1) {\n addBorderNode(g, \"borderLeft\", \"_bl\", v, node, rank);\n addBorderNode(g, \"borderRight\", \"_br\", v, node, rank);\n }\n }\n };\n (_a = g.children()) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { return dfs(child); });\n};\nvar addBorderNode = function (g, prop, prefix, sg, sgNode, rank) {\n var label = { rank: rank, borderType: prop, width: 0, height: 0 };\n var prev = sgNode[prop][rank - 1];\n var curr = (0, util_1.addDummyNode)(g, \"border\", label, prefix);\n sgNode[prop][rank] = curr;\n g.setParent(curr, sg);\n if (prev) {\n g.setEdge(prev, curr, { weight: 1 });\n }\n};\nexports.default = addBorderSegments;\n//# sourceMappingURL=add-border-segments.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/add-border-segments.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @param {Array} result The array to return.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]\n */\nvar flattenDeep = function (arr, result) {\n if (result === void 0) { result = []; }\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n result.push(arr);\n }\n else {\n for (var i = 0; i < arr.length; i += 1) {\n flattenDeep(arr[i], result);\n }\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (flattenDeep);\n//# sourceMappingURL=flatten-deep.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/flatten-deep.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/coordinate-system.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/coordinate-system.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/flatten.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/flatten.js ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar adjust = function (g) {\n var _a;\n var rankDir = (_a = g.graph().rankdir) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n if (rankDir === \"lr\" || rankDir === \"rl\") {\n swapWidthHeight(g);\n }\n};\nvar undo = function (g) {\n var _a;\n var rankDir = (_a = g.graph().rankdir) === null || _a === void 0 ? void 0 : _a.toLowerCase();\n if (rankDir === \"bt\" || rankDir === \"rl\") {\n reverseY(g);\n }\n if (rankDir === \"lr\" || rankDir === \"rl\") {\n swapXY(g);\n swapWidthHeight(g);\n }\n};\nvar swapWidthHeight = function (g) {\n g.nodes().forEach(function (v) {\n swapWidthHeightOne(g.node(v));\n });\n g.edges().forEach(function (e) {\n swapWidthHeightOne(g.edge(e));\n });\n};\nvar swapWidthHeightOne = function (attrs) {\n var w = attrs.width;\n attrs.width = attrs.height;\n attrs.height = w;\n};\nvar reverseY = function (g) {\n g.nodes().forEach(function (v) {\n reverseYOne(g.node(v));\n });\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n (_a = edge.points) === null || _a === void 0 ? void 0 : _a.forEach(function (point) { return reverseYOne(point); });\n if (edge.hasOwnProperty(\"y\")) {\n reverseYOne(edge);\n }\n });\n};\nvar reverseYOne = function (attrs) {\n if (attrs === null || attrs === void 0 ? void 0 : attrs.y) {\n attrs.y = -attrs.y;\n }\n};\nvar swapXY = function (g) {\n g.nodes().forEach(function (v) {\n swapXYOne(g.node(v));\n });\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n (_a = edge.points) === null || _a === void 0 ? void 0 : _a.forEach(function (point) { return swapXYOne(point); });\n if (edge.hasOwnProperty(\"x\")) {\n swapXYOne(edge);\n }\n });\n};\nvar swapXYOne = function (attrs) {\n var x = attrs.x;\n attrs.x = attrs.y;\n attrs.y = x;\n};\nexports.default = { adjust: adjust, undo: undo };\n//# sourceMappingURL=coordinate-system.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/coordinate-system.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]\n */\nvar flatten = function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return [];\n }\n var rst = [];\n for (var i = 0; i < arr.length; i++) {\n rst = rst.concat(arr[i]);\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (flatten);\n//# sourceMappingURL=flatten.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/flatten.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/data/list.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/data/list.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/for-in.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/for-in.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar filterOutLinks = function (k, v) {\n if (k !== \"next\" && k !== \"prev\") {\n return v;\n }\n};\nvar unlink = function (entry) {\n entry.prev.next = entry.next;\n entry.next.prev = entry.prev;\n delete entry.next;\n delete entry.prev;\n};\nvar List = /** @class */ (function () {\n function List() {\n var shortcut = {};\n shortcut.prev = shortcut;\n shortcut.next = shortcut.prev;\n this.shortcut = shortcut;\n }\n List.prototype.dequeue = function () {\n var shortcut = this.shortcut;\n var entry = shortcut.prev;\n if (entry && entry !== shortcut) {\n unlink(entry);\n return entry;\n }\n };\n List.prototype.enqueue = function (entry) {\n var shortcut = this.shortcut;\n if (entry.prev && entry.next) {\n unlink(entry);\n }\n entry.next = shortcut.next;\n shortcut.next.prev = entry;\n shortcut.next = entry;\n entry.prev = shortcut;\n };\n List.prototype.toString = function () {\n var strs = [];\n var sentinel = this.shortcut;\n var curr = sentinel.prev;\n while (curr !== sentinel) {\n strs.push(JSON.stringify(curr, filterOutLinks));\n curr = curr === null || curr === void 0 ? void 0 : curr.prev;\n }\n return \"[\".concat(strs.join(\", \"), \"]\");\n };\n return List;\n}());\nexports.default = List;\n//# sourceMappingURL=list.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/data/list.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n//# sourceMappingURL=for-in.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/for-in.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/greedy-fas.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/greedy-fas.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-range.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-range.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar list_1 = __importDefault(__webpack_require__(/*! ./data/list */ \"./node_modules/@antv/layout/lib/layout/dagre/src/data/list.js\"));\nvar graphlib_1 = __webpack_require__(/*! @antv/graphlib */ \"./node_modules/@antv/graphlib/es/index.js\");\nvar List = /** @class */ (function (_super) {\n __extends(List, _super);\n function List() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return List;\n}(list_1.default));\nvar StateGraph = /** @class */ (function (_super) {\n __extends(StateGraph, _super);\n function StateGraph() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return StateGraph;\n}(graphlib_1.Graph));\n/*\n * A greedy heuristic for finding a feedback arc set for a graph. A feedback\n * arc set is a set of edges that can be removed to make a graph acyclic.\n * The algorithm comes from: P. Eades, X. Lin, and W. F. Smyth, \"A fast and\n * effective heuristic for the feedback arc set problem.\" This implementation\n * adjusts that from the paper to allow for weighted edges.\n */\nvar DEFAULT_WEIGHT_FN = function () { return 1; };\nvar greedyFAS = function (g, weightFn) {\n var _a;\n if (g.nodeCount() <= 1)\n return [];\n var state = buildState(g, weightFn || DEFAULT_WEIGHT_FN);\n var results = doGreedyFAS(state.graph, state.buckets, state.zeroIdx);\n return (_a = results.map(function (e) { return g.outEdges(e.v, e.w); })) === null || _a === void 0 ? void 0 : _a.flat();\n};\nvar doGreedyFAS = function (g, buckets, zeroIdx) {\n var results = [];\n var sources = buckets[buckets.length - 1];\n var sinks = buckets[0];\n var entry;\n while (g.nodeCount()) {\n while ((entry = sinks.dequeue())) {\n removeNode(g, buckets, zeroIdx, entry);\n }\n while ((entry = sources.dequeue())) {\n removeNode(g, buckets, zeroIdx, entry);\n }\n if (g.nodeCount()) {\n for (var i = buckets.length - 2; i > 0; --i) {\n entry = buckets[i].dequeue();\n if (entry) {\n results = results.concat(removeNode(g, buckets, zeroIdx, entry, true));\n break;\n }\n }\n }\n }\n return results;\n};\nvar removeNode = function (g, buckets, zeroIdx, entry, collectPredecessors) {\n var _a, _b;\n var results = [];\n (_a = g.inEdges(entry.v)) === null || _a === void 0 ? void 0 : _a.forEach(function (edge) {\n var weight = g.edge(edge);\n var uEntry = g.node(edge.v);\n if (collectPredecessors) {\n // this result not really care about in or out\n results.push({ v: edge.v, w: edge.w, in: 0, out: 0 });\n }\n if (uEntry.out === undefined)\n uEntry.out = 0;\n uEntry.out -= weight;\n assignBucket(buckets, zeroIdx, uEntry);\n });\n (_b = g.outEdges(entry.v)) === null || _b === void 0 ? void 0 : _b.forEach(function (edge) {\n var weight = g.edge(edge);\n var w = edge.w;\n var wEntry = g.node(w);\n if (wEntry.in === undefined)\n wEntry.in = 0;\n wEntry.in -= weight;\n assignBucket(buckets, zeroIdx, wEntry);\n });\n g.removeNode(entry.v);\n return collectPredecessors ? results : undefined;\n};\nvar buildState = function (g, weightFn) {\n var fasGraph = new StateGraph();\n var maxIn = 0;\n var maxOut = 0;\n g.nodes().forEach(function (v) {\n fasGraph.setNode(v, { v: v, in: 0, out: 0 });\n });\n // Aggregate weights on nodes, but also sum the weights across multi-edges\n // into a single edge for the fasGraph.\n g.edges().forEach(function (e) {\n var prevWeight = fasGraph.edge(e) || 0;\n var weight = (weightFn === null || weightFn === void 0 ? void 0 : weightFn(e)) || 1;\n var edgeWeight = prevWeight + weight;\n fasGraph.setEdge(e.v, e.w, edgeWeight);\n maxOut = Math.max(maxOut, (fasGraph.node(e.v).out += weight));\n maxIn = Math.max(maxIn, (fasGraph.node(e.w).in += weight));\n });\n var buckets = [];\n var rangeMax = maxOut + maxIn + 3;\n for (var i = 0; i < rangeMax; i++) {\n buckets.push(new List());\n }\n var zeroIdx = maxIn + 1;\n fasGraph.nodes().forEach(function (v) {\n assignBucket(buckets, zeroIdx, fasGraph.node(v));\n });\n return { buckets: buckets, zeroIdx: zeroIdx, graph: fasGraph };\n};\nvar assignBucket = function (buckets, zeroIdx, entry) {\n if (!entry.out) {\n buckets[0].enqueue(entry);\n }\n else if (!entry[\"in\"]) {\n buckets[buckets.length - 1].enqueue(entry);\n }\n else {\n buckets[entry.out - entry[\"in\"] + zeroIdx].enqueue(entry);\n }\n};\nexports.default = greedyFAS;\n//# sourceMappingURL=greedy-fas.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/greedy-fas.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _max__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./max */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max.js\");\n/* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./min */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min.js\");\n\n\n\nvar getRange = function (values) {\n // 存在 NaN 时,min,max 判定会出问题\n var filterValues = values.filter(function (v) { return !isNaN(v); });\n if (!filterValues.length) {\n // 如果没有数值则直接返回0\n return {\n min: 0,\n max: 0,\n };\n }\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(values[0])) {\n var tmp = [];\n for (var i = 0; i < values.length; i++) {\n tmp = tmp.concat(values[i]);\n }\n filterValues = tmp;\n }\n var max = Object(_max__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(filterValues);\n var min = Object(_min__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(filterValues);\n return {\n min: min,\n max: max,\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (getRange);\n//# sourceMappingURL=get-range.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-range.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/layout.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/layout.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-type.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-type.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar acyclic_1 = __importDefault(__webpack_require__(/*! ./acyclic */ \"./node_modules/@antv/layout/lib/layout/dagre/src/acyclic.js\"));\nvar normalize_1 = __importDefault(__webpack_require__(/*! ./normalize */ \"./node_modules/@antv/layout/lib/layout/dagre/src/normalize.js\"));\nvar rank_1 = __importDefault(__webpack_require__(/*! ./rank */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/index.js\"));\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar parent_dummy_chains_1 = __importDefault(__webpack_require__(/*! ./parent-dummy-chains */ \"./node_modules/@antv/layout/lib/layout/dagre/src/parent-dummy-chains.js\"));\nvar nesting_graph_1 = __importDefault(__webpack_require__(/*! ./nesting-graph */ \"./node_modules/@antv/layout/lib/layout/dagre/src/nesting-graph.js\"));\nvar add_border_segments_1 = __importDefault(__webpack_require__(/*! ./add-border-segments */ \"./node_modules/@antv/layout/lib/layout/dagre/src/add-border-segments.js\"));\nvar coordinate_system_1 = __importDefault(__webpack_require__(/*! ./coordinate-system */ \"./node_modules/@antv/layout/lib/layout/dagre/src/coordinate-system.js\"));\nvar order_1 = __importDefault(__webpack_require__(/*! ./order */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/index.js\"));\nvar position_1 = __importDefault(__webpack_require__(/*! ./position */ \"./node_modules/@antv/layout/lib/layout/dagre/src/position/index.js\"));\nvar init_data_order_1 = __importDefault(__webpack_require__(/*! ./order/init-data-order */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/init-data-order.js\"));\nvar graph_1 = __webpack_require__(/*! ../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\nvar layout = function (g, opts) {\n var time = opts && opts.debugTiming ? util_1.time : util_1.notime;\n time(\"layout\", function () {\n // 如果在原图基础上修改,继承原图的order结果\n if (opts && !opts.keepNodeOrder && opts.prevGraph) {\n time(\" inheritOrder\", function () {\n inheritOrder(g, opts.prevGraph);\n });\n }\n var layoutGraph = time(\" buildLayoutGraph\", function () {\n return buildLayoutGraph(g);\n });\n // 控制是否为边的label留位置(这会影响是否在边中间添加dummy node)\n if (!(opts && opts.edgeLabelSpace === false)) {\n time(\" makeSpaceForEdgeLabels\", function () {\n makeSpaceForEdgeLabels(layoutGraph);\n });\n }\n // TODO: 暂时处理层级设置不正确时的异常报错,提示设置正确的层级\n try {\n time(\" runLayout\", function () {\n runLayout(layoutGraph, time, opts);\n });\n }\n catch (e) {\n if (e.message ===\n \"Not possible to find intersection inside of the rectangle\") {\n console.error(\"The following error may be caused by improper layer setting, please make sure your manual layer setting does not violate the graph's structure:\\n\", e);\n return;\n }\n throw e;\n }\n time(\" updateInputGraph\", function () {\n updateInputGraph(g, layoutGraph);\n });\n });\n};\nvar runLayout = function (g, time, opts) {\n time(\" removeSelfEdges\", function () {\n removeSelfEdges(g);\n });\n time(\" acyclic\", function () {\n acyclic_1.default.run(g);\n });\n time(\" nestingGraph.run\", function () {\n nesting_graph_1.default.run(g);\n });\n time(\" rank\", function () {\n (0, rank_1.default)((0, util_1.asNonCompoundGraph)(g));\n });\n time(\" injectEdgeLabelProxies\", function () {\n injectEdgeLabelProxies(g);\n });\n time(\" removeEmptyRanks\", function () {\n (0, util_1.removeEmptyRanks)(g);\n });\n time(\" nestingGraph.cleanup\", function () {\n nesting_graph_1.default.cleanup(g);\n });\n time(\" normalizeRanks\", function () {\n (0, util_1.normalizeRanks)(g);\n });\n time(\" assignRankMinMax\", function () {\n assignRankMinMax(g);\n });\n time(\" removeEdgeLabelProxies\", function () {\n removeEdgeLabelProxies(g);\n });\n time(\" normalize.run\", function () {\n normalize_1.default.run(g);\n });\n time(\" parentDummyChains\", function () {\n (0, parent_dummy_chains_1.default)(g);\n });\n time(\" addBorderSegments\", function () {\n (0, add_border_segments_1.default)(g);\n });\n if (opts && opts.keepNodeOrder) {\n time(\" initDataOrder\", function () {\n (0, init_data_order_1.default)(g, opts.nodeOrder);\n });\n }\n time(\" order\", function () {\n (0, order_1.default)(g);\n });\n time(\" insertSelfEdges\", function () {\n insertSelfEdges(g);\n });\n time(\" adjustCoordinateSystem\", function () {\n coordinate_system_1.default.adjust(g);\n });\n time(\" position\", function () {\n (0, position_1.default)(g);\n });\n time(\" positionSelfEdges\", function () {\n positionSelfEdges(g);\n });\n time(\" removeBorderNodes\", function () {\n removeBorderNodes(g);\n });\n time(\" normalize.undo\", function () {\n normalize_1.default.undo(g);\n });\n time(\" fixupEdgeLabelCoords\", function () {\n fixupEdgeLabelCoords(g);\n });\n time(\" undoCoordinateSystem\", function () {\n coordinate_system_1.default.undo(g);\n });\n time(\" translateGraph\", function () {\n translateGraph(g);\n });\n time(\" assignNodeIntersects\", function () {\n assignNodeIntersects(g);\n });\n time(\" reversePoints\", function () {\n reversePointsForReversedEdges(g);\n });\n time(\" acyclic.undo\", function () {\n acyclic_1.default.undo(g);\n });\n};\n/**\n * 继承上一个布局中的order,防止翻转\n * TODO: 暂时没有考虑涉及层级变动的布局,只保证原来布局层级和相对顺序不变\n */\nvar inheritOrder = function (currG, prevG) {\n currG.nodes().forEach(function (n) {\n var node = currG.node(n);\n var prevNode = prevG.node(n);\n if (prevNode !== undefined) {\n node.fixorder = prevNode._order;\n delete prevNode._order;\n }\n else {\n delete node.fixorder;\n }\n });\n};\n/*\n * Copies final layout information from the layout graph back to the input\n * graph. This process only copies whitelisted attributes from the layout graph\n * to the input graph, so it serves as a good place to determine what\n * attributes can influence layout.\n */\nvar updateInputGraph = function (inputGraph, layoutGraph) {\n inputGraph.nodes().forEach(function (v) {\n var _a;\n var inputLabel = inputGraph.node(v);\n if (inputLabel) {\n var layoutLabel = layoutGraph.node(v);\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n inputLabel._order = layoutLabel.order;\n inputLabel._rank = layoutLabel.rank;\n if ((_a = layoutGraph.children(v)) === null || _a === void 0 ? void 0 : _a.length) {\n inputLabel.width = layoutLabel.width;\n inputLabel.height = layoutLabel.height;\n }\n }\n });\n inputGraph.edges().forEach(function (e) {\n var inputLabel = inputGraph.edge(e);\n var layoutLabel = layoutGraph.edge(e);\n inputLabel.points = layoutLabel.points;\n if (layoutLabel.hasOwnProperty(\"x\")) {\n inputLabel.x = layoutLabel.x;\n inputLabel.y = layoutLabel.y;\n }\n });\n inputGraph.graph().width = layoutGraph.graph().width;\n inputGraph.graph().height = layoutGraph.graph().height;\n};\nvar graphNumAttrs = [\"nodesep\", \"edgesep\", \"ranksep\", \"marginx\", \"marginy\"];\nvar graphDefaults = { ranksep: 50, edgesep: 20, nodesep: 50, rankdir: \"tb\" };\nvar graphAttrs = [\"acyclicer\", \"ranker\", \"rankdir\", \"align\"];\nvar nodeNumAttrs = [\"width\", \"height\", \"layer\", \"fixorder\"]; // 需要传入layer, fixOrder作为参数参考\nvar nodeDefaults = { width: 0, height: 0 };\nvar edgeNumAttrs = [\"minlen\", \"weight\", \"width\", \"height\", \"labeloffset\"];\nvar edgeDefaults = {\n minlen: 1,\n weight: 1,\n width: 0,\n height: 0,\n labeloffset: 10,\n labelpos: \"r\",\n};\nvar edgeAttrs = [\"labelpos\"];\n/*\n * Constructs a new graph from the input graph, which can be used for layout.\n * This process copies only whitelisted attributes from the input graph to the\n * layout graph. Thus this function serves as a good place to determine what\n * attributes can influence layout.\n */\nvar buildLayoutGraph = function (inputGraph) {\n var g = new graph_1.Graph({ multigraph: true, compound: true });\n var graph = canonicalize(inputGraph.graph());\n var pickedProperties = {};\n graphAttrs === null || graphAttrs === void 0 ? void 0 : graphAttrs.forEach(function (key) {\n if (graph[key] !== undefined)\n pickedProperties[key] = graph[key];\n });\n g.setGraph(Object.assign({}, graphDefaults, selectNumberAttrs(graph, graphNumAttrs), pickedProperties));\n inputGraph.nodes().forEach(function (v) {\n var node = canonicalize(inputGraph.node(v));\n var defaultNode = __assign(__assign({}, nodeDefaults), node);\n var defaultAttrs = selectNumberAttrs(defaultNode, nodeNumAttrs);\n g.setNode(v, defaultAttrs);\n g.setParent(v, inputGraph.parent(v));\n });\n inputGraph.edges().forEach(function (e) {\n var edge = canonicalize(inputGraph.edge(e));\n var pickedProperties = {};\n edgeAttrs === null || edgeAttrs === void 0 ? void 0 : edgeAttrs.forEach(function (key) {\n if (edge[key] !== undefined)\n pickedProperties[key] = edge[key];\n });\n g.setEdgeObj(e, Object.assign({}, edgeDefaults, selectNumberAttrs(edge, edgeNumAttrs), pickedProperties));\n });\n return g;\n};\n/*\n * This idea comes from the Gansner paper: to account for edge labels in our\n * layout we split each rank in half by doubling minlen and halving ranksep.\n * Then we can place labels at these mid-points between nodes.\n *\n * We also add some minimal padding to the width to push the label for the edge\n * away from the edge itself a bit.\n */\nvar makeSpaceForEdgeLabels = function (g) {\n var graph = g.graph();\n if (!graph.ranksep)\n graph.ranksep = 0;\n graph.ranksep /= 2;\n g.nodes().forEach(function (n) {\n var node = g.node(n);\n if (!isNaN(node.layer)) {\n if (!node.layer)\n node.layer = 0;\n }\n });\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n edge.minlen *= 2;\n if (((_a = edge.labelpos) === null || _a === void 0 ? void 0 : _a.toLowerCase()) !== \"c\") {\n if (graph.rankdir === \"TB\" || graph.rankdir === \"BT\") {\n edge.width += edge.labeloffset;\n }\n else {\n edge.height += edge.labeloffset;\n }\n }\n });\n};\n/*\n * Creates temporary dummy nodes that capture the rank in which each edge's\n * label is going to, if it has one of non-zero width and height. We do this\n * so that we can safely remove empty ranks while preserving balance for the\n * label's position.\n */\nvar injectEdgeLabelProxies = function (g) {\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (edge.width && edge.height) {\n var v = g.node(e.v);\n var w = g.node(e.w);\n var label = {\n e: e,\n rank: (w.rank - v.rank) / 2 + v.rank,\n };\n (0, util_1.addDummyNode)(g, \"edge-proxy\", label, \"_ep\");\n }\n });\n};\nvar assignRankMinMax = function (g) {\n var maxRank = 0;\n g.nodes().forEach(function (v) {\n var _a, _b;\n var node = g.node(v);\n if (node.borderTop) {\n node.minRank = (_a = g.node(node.borderTop)) === null || _a === void 0 ? void 0 : _a.rank;\n node.maxRank = (_b = g.node(node.borderBottom)) === null || _b === void 0 ? void 0 : _b.rank;\n maxRank = Math.max(maxRank, node.maxRank || -Infinity);\n }\n });\n g.graph().maxRank = maxRank;\n};\nvar removeEdgeLabelProxies = function (g) {\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (node.dummy === \"edge-proxy\") {\n g.edge(node.e).labelRank = node.rank;\n g.removeNode(v);\n }\n });\n};\nvar translateGraph = function (g) {\n var minX;\n var maxX = 0;\n var minY;\n var maxY = 0;\n var graphLabel = g.graph();\n var marginX = graphLabel.marginx || 0;\n var marginY = graphLabel.marginy || 0;\n var getExtremes = function (attrs) {\n if (!attrs)\n return;\n var x = attrs.x;\n var y = attrs.y;\n var w = attrs.width;\n var h = attrs.height;\n if (!isNaN(x) && !isNaN(w)) {\n if (minX === undefined) {\n minX = x - w / 2;\n }\n minX = Math.min(minX, x - w / 2);\n maxX = Math.max(maxX, x + w / 2);\n }\n if (!isNaN(y) && !isNaN(h)) {\n if (minY === undefined) {\n minY = y - h / 2;\n }\n minY = Math.min(minY, y - h / 2);\n maxY = Math.max(maxY, y + h / 2);\n }\n };\n g.nodes().forEach(function (v) {\n getExtremes(g.node(v));\n });\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (edge === null || edge === void 0 ? void 0 : edge.hasOwnProperty(\"x\")) {\n getExtremes(edge);\n }\n });\n minX -= marginX;\n minY -= marginY;\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (node) {\n node.x -= minX;\n node.y -= minY;\n }\n });\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n (_a = edge.points) === null || _a === void 0 ? void 0 : _a.forEach(function (p) {\n p.x -= minX;\n p.y -= minY;\n });\n if (edge.hasOwnProperty(\"x\")) {\n edge.x -= minX;\n }\n if (edge.hasOwnProperty(\"y\")) {\n edge.y -= minY;\n }\n });\n graphLabel.width = maxX - minX + marginX;\n graphLabel.height = maxY - minY + marginY;\n};\nvar assignNodeIntersects = function (g) {\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n var nodeV = g.node(e.v);\n var nodeW = g.node(e.w);\n var p1;\n var p2;\n if (!edge.points) {\n edge.points = [];\n p1 = nodeW;\n p2 = nodeV;\n }\n else {\n p1 = edge.points[0];\n p2 = edge.points[edge.points.length - 1];\n }\n edge.points.unshift((0, util_1.intersectRect)(nodeV, p1));\n edge.points.push((0, util_1.intersectRect)(nodeW, p2));\n });\n};\nvar fixupEdgeLabelCoords = function (g) {\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (edge === null || edge === void 0 ? void 0 : edge.hasOwnProperty(\"x\")) {\n if (edge.labelpos === \"l\" || edge.labelpos === \"r\") {\n edge.width -= edge.labeloffset;\n }\n switch (edge.labelpos) {\n case \"l\":\n edge.x -= edge.width / 2 + edge.labeloffset;\n break;\n case \"r\":\n edge.x += edge.width / 2 + edge.labeloffset;\n break;\n }\n }\n });\n};\nvar reversePointsForReversedEdges = function (g) {\n g.edges().forEach(function (e) {\n var _a;\n var edge = g.edge(e);\n if (edge.reversed) {\n (_a = edge.points) === null || _a === void 0 ? void 0 : _a.reverse();\n }\n });\n};\nvar removeBorderNodes = function (g) {\n g.nodes().forEach(function (v) {\n var _a, _b, _c;\n if ((_a = g.children(v)) === null || _a === void 0 ? void 0 : _a.length) {\n var node = g.node(v);\n var t = g.node(node.borderTop);\n var b = g.node(node.borderBottom);\n var l = g.node(node.borderLeft[((_b = node.borderLeft) === null || _b === void 0 ? void 0 : _b.length) - 1]);\n var r = g.node(node.borderRight[((_c = node.borderRight) === null || _c === void 0 ? void 0 : _c.length) - 1]);\n node.width = Math.abs((r === null || r === void 0 ? void 0 : r.x) - (l === null || l === void 0 ? void 0 : l.x)) || 10;\n node.height = Math.abs((b === null || b === void 0 ? void 0 : b.y) - (t === null || t === void 0 ? void 0 : t.y)) || 10;\n node.x = ((l === null || l === void 0 ? void 0 : l.x) || 0) + node.width / 2;\n node.y = ((t === null || t === void 0 ? void 0 : t.y) || 0) + node.height / 2;\n }\n });\n g.nodes().forEach(function (v) {\n var _a;\n if (((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.dummy) === \"border\") {\n g.removeNode(v);\n }\n });\n};\nvar removeSelfEdges = function (g) {\n g.edges().forEach(function (e) {\n if (e.v === e.w) {\n var node = g.node(e.v);\n if (!node.selfEdges) {\n node.selfEdges = [];\n }\n node.selfEdges.push({ e: e, label: g.edge(e) });\n g.removeEdgeObj(e);\n }\n });\n};\nvar insertSelfEdges = function (g) {\n var layers = (0, util_1.buildLayerMatrix)(g);\n layers === null || layers === void 0 ? void 0 : layers.forEach(function (layer) {\n var orderShift = 0;\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v, i) {\n var _a;\n var node = g.node(v);\n node.order = i + orderShift;\n (_a = node.selfEdges) === null || _a === void 0 ? void 0 : _a.forEach(function (selfEdge) {\n (0, util_1.addDummyNode)(g, \"selfedge\", {\n width: selfEdge.label.width,\n height: selfEdge.label.height,\n rank: node.rank,\n order: i + ++orderShift,\n e: selfEdge.e,\n label: selfEdge.label,\n }, \"_se\");\n });\n delete node.selfEdges;\n });\n });\n};\nvar positionSelfEdges = function (g) {\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (node.dummy === \"selfedge\") {\n var selfNode = g.node(node.e.v);\n var x = selfNode.x + selfNode.width / 2;\n var y = selfNode.y;\n var dx = node.x - x;\n var dy = selfNode.height / 2;\n g.setEdgeObj(node.e, node.label);\n g.removeNode(v);\n node.label.points = [\n { x: x + (2 * dx) / 3, y: y - dy },\n { x: x + (5 * dx) / 6, y: y - dy },\n { y: y, x: x + dx },\n { x: x + (5 * dx) / 6, y: y + dy },\n { x: x + (2 * dx) / 3, y: y + dy },\n ];\n node.label.x = node.x;\n node.label.y = node.y;\n }\n });\n};\nvar selectNumberAttrs = function (obj, attrs) {\n var pickedProperties = {};\n attrs === null || attrs === void 0 ? void 0 : attrs.forEach(function (key) {\n if (obj[key] === undefined)\n return;\n pickedProperties[key] = (+obj[key]);\n });\n return pickedProperties;\n};\nvar canonicalize = function (attrs) {\n if (attrs === void 0) { attrs = {}; }\n var newAttrs = {};\n Object.keys(attrs).forEach(function (k) {\n newAttrs[k.toLowerCase()] = attrs[k];\n });\n return newAttrs;\n};\nexports.default = layout;\n//# sourceMappingURL=layout.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/layout.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar toString = {}.toString;\nvar getType = function (value) {\n return toString\n .call(value)\n .replace(/^\\[object /, '')\n .replace(/]$/, '');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (getType);\n//# sourceMappingURL=get-type.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-type.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/nesting-graph.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/nesting-graph.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-wrap-behavior.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-wrap-behavior.js ***! + \*******************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\n/*\n * A nesting graph creates dummy nodes for the tops and bottoms of subgraphs,\n * adds appropriate edges to ensure that all cluster nodes are placed between\n * these boundries, and ensures that the graph is connected.\n *\n * In addition we ensure, through the use of the minlen property, that nodes\n * and subgraph border nodes to not end up on the same rank.\n *\n * Preconditions:\n *\n * 1. Input graph is a DAG\n * 2. Nodes in the input graph has a minlen attribute\n *\n * Postconditions:\n *\n * 1. Input graph is connected.\n * 2. Dummy nodes are added for the tops and bottoms of subgraphs.\n * 3. The minlen attribute for nodes is adjusted to ensure nodes do not\n * get placed on the same rank as subgraph border nodes.\n *\n * The nesting graph idea comes from Sander, \"Layout of Compound Directed\n * Graphs.\"\n */\nvar run = function (g) {\n var _a;\n var root = (0, util_1.addDummyNode)(g, \"root\", {}, \"_root\");\n var depths = treeDepths(g);\n var maxDepth = Math.max.apply(Math, Object.values(depths));\n if (Math.abs(maxDepth) === Infinity) {\n maxDepth = 1;\n }\n var height = maxDepth - 1; // Note: depths is an Object not an array\n var nodeSep = 2 * height + 1;\n g.graph().nestingRoot = root;\n // Multiply minlen by nodeSep to align nodes on non-border ranks.\n g.edges().forEach(function (e) {\n g.edge(e).minlen *= nodeSep;\n });\n // Calculate a weight that is sufficient to keep subgraphs vertically compact\n var weight = sumWeights(g) + 1;\n // Create border nodes and link them up\n (_a = g.children()) === null || _a === void 0 ? void 0 : _a.forEach(function (child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n });\n // Save the multiplier for node layers for later removal of empty border\n // layers.\n g.graph().nodeRankFactor = nodeSep;\n};\nvar dfs = function (g, root, nodeSep, weight, height, depths, v) {\n var children = g.children(v);\n if (!(children === null || children === void 0 ? void 0 : children.length)) {\n if (v !== root) {\n g.setEdge(root, v, { weight: 0, minlen: nodeSep });\n }\n return;\n }\n var top = (0, util_1.addBorderNode)(g, \"_bt\");\n var bottom = (0, util_1.addBorderNode)(g, \"_bb\");\n var label = g.node(v);\n g.setParent(top, v);\n label.borderTop = top;\n g.setParent(bottom, v);\n label.borderBottom = bottom;\n children === null || children === void 0 ? void 0 : children.forEach(function (child) {\n dfs(g, root, nodeSep, weight, height, depths, child);\n var childNode = g.node(child);\n var childTop = childNode.borderTop ? childNode.borderTop : child;\n var childBottom = childNode.borderBottom ? childNode.borderBottom : child;\n var thisWeight = childNode.borderTop ? weight : 2 * weight;\n var minlen = childTop !== childBottom ? 1 : height - depths[v] + 1;\n g.setEdge(top, childTop, {\n minlen: minlen,\n weight: thisWeight,\n nestingEdge: true,\n });\n g.setEdge(childBottom, bottom, {\n minlen: minlen,\n weight: thisWeight,\n nestingEdge: true,\n });\n });\n if (!g.parent(v)) {\n g.setEdge(root, top, { weight: 0, minlen: height + depths[v] });\n }\n};\nvar treeDepths = function (g) {\n var _a;\n var depths = {};\n var dfs = function (v, depth) {\n var children = g.children(v);\n children === null || children === void 0 ? void 0 : children.forEach(function (child) { return dfs(child, depth + 1); });\n depths[v] = depth;\n };\n (_a = g.children()) === null || _a === void 0 ? void 0 : _a.forEach(function (v) { return dfs(v, 1); });\n return depths;\n};\nvar sumWeights = function (g) {\n var result = 0;\n g.edges().forEach(function (e) {\n result += g.edge(e).weight;\n });\n return result;\n};\nvar cleanup = function (g) {\n var graphLabel = g.graph();\n graphLabel.nestingRoot && g.removeNode(graphLabel.nestingRoot);\n delete graphLabel.nestingRoot;\n g.edges().forEach(function (e) {\n var edge = g.edge(e);\n if (edge.nestingEdge) {\n g.removeEdgeObj(e);\n }\n });\n};\nexports.default = { run: run, cleanup: cleanup };\n//# sourceMappingURL=nesting-graph.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/nesting-graph.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 获取封装的事件\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction getWrapBehavior(obj, action) {\n return obj['_wrap_' + action];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (getWrapBehavior);\n//# sourceMappingURL=get-wrap-behavior.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-wrap-behavior.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/normalize.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/normalize.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\n/*\n * Breaks any long edges in the graph into short segments that span 1 layer\n * each. This operation is undoable with the denormalize function.\n *\n * Pre-conditions:\n *\n * 1. The input graph is a DAG.\n * 2. Each node in the graph has a \"rank\" property.\n *\n * Post-condition:\n *\n * 1. All edges in the graph have a length of 1.\n * 2. Dummy nodes are added where edges have been split into segments.\n * 3. The graph is augmented with a \"dummyChains\" attribute which contains\n * the first dummy in each chain of dummy nodes produced.\n */\nvar run = function (g) {\n g.graph().dummyChains = [];\n g.edges().forEach(function (edge) { return normalizeEdge(g, edge); });\n};\nvar normalizeEdge = function (g, e) {\n var v = e.v;\n var vRank = g.node(v).rank;\n var w = e.w;\n var wRank = g.node(w).rank;\n var name = e.name;\n var edgeLabel = g.edge(e);\n var labelRank = edgeLabel.labelRank;\n if (wRank === vRank + 1)\n return;\n g.removeEdgeObj(e);\n var graph = g.graph();\n var dummy;\n var attrs;\n var i;\n for (i = 0, ++vRank; vRank < wRank; ++i, ++vRank) {\n edgeLabel.points = [];\n attrs = {\n edgeLabel: edgeLabel,\n width: 0,\n height: 0,\n edgeObj: e,\n rank: vRank,\n };\n dummy = (0, util_1.addDummyNode)(g, \"edge\", attrs, \"_d\");\n if (vRank === labelRank) {\n attrs.width = edgeLabel.width;\n attrs.height = edgeLabel.height;\n attrs.dummy = \"edge-label\";\n attrs.labelpos = edgeLabel.labelpos;\n }\n g.setEdge(v, dummy, { weight: edgeLabel.weight }, name);\n if (i === 0) {\n if (!graph.dummyChains)\n graph.dummyChains = [];\n graph.dummyChains.push(dummy);\n }\n v = dummy;\n }\n g.setEdge(v, w, { weight: edgeLabel.weight }, name);\n};\nvar undo = function (g) {\n var _a;\n (_a = g.graph().dummyChains) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {\n var node = g.node(v);\n var origLabel = node.edgeLabel;\n var w;\n if (node.edgeObj) {\n g.setEdgeObj(node.edgeObj, origLabel);\n }\n var currentV = v;\n while (node.dummy) {\n w = g.successors(currentV)[0];\n g.removeNode(currentV);\n origLabel.points.push({ x: node.x, y: node.y });\n if (node.dummy === \"edge-label\") {\n origLabel.x = node.x;\n origLabel.y = node.y;\n origLabel.width = node.width;\n origLabel.height = node.height;\n }\n currentV = w;\n node = g.node(currentV);\n }\n });\n};\nexports.default = { run: run, undo: undo };\n//# sourceMappingURL=normalize.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/normalize.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js\");\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param key\n * @param defaultValue\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, key, defaultValue) {\n var p = 0;\n var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(key) ? key.split('.') : key;\n while (obj && p < keyArr.length) {\n obj = obj[keyArr[p++]];\n }\n return obj === undefined || p < keyArr.length ? defaultValue : obj;\n});\n//# sourceMappingURL=get.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/add-subgraph-constraints.js": -/*!******************************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/add-subgraph-constraints.js ***! - \******************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-by.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-by.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar addSubgraphConstraints = function (g, cg, vs) {\n var prev = {};\n var rootPrev;\n vs === null || vs === void 0 ? void 0 : vs.forEach(function (v) {\n var child = g.parent(v);\n var parent;\n var prevChild;\n while (child) {\n parent = g.parent(child);\n if (parent) {\n prevChild = prev[parent];\n prev[parent] = child;\n }\n else {\n prevChild = rootPrev;\n rootPrev = child;\n }\n if (prevChild && prevChild !== child) {\n cg.setEdge(prevChild, child);\n return;\n }\n child = parent;\n }\n });\n};\nexports.default = addSubgraphConstraints;\n//# sourceMappingURL=add-subgraph-constraints.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/add-subgraph-constraints.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction groupBy(data, condition) {\n if (!condition || !Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data)) {\n return {};\n }\n var result = {};\n // 兼容方法和 字符串的写法\n var predicate = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(condition) ? condition : function (item) { return item[condition]; };\n var key;\n for (var i = 0; i < data.length; i++) {\n var item = data[i];\n key = predicate(item);\n if (hasOwnProperty.call(result, key)) {\n result[key].push(item);\n }\n else {\n result[key] = [item];\n }\n }\n return result;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (groupBy);\n//# sourceMappingURL=group-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-by.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/barycenter.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/barycenter.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-to-map.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-to-map.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar barycenter = function (g, movable) {\n return movable.map(function (v) {\n var inV = g.inEdges(v);\n if (!(inV === null || inV === void 0 ? void 0 : inV.length)) {\n return { v: v };\n }\n {\n var result_1 = { sum: 0, weight: 0 };\n inV === null || inV === void 0 ? void 0 : inV.forEach(function (e) {\n var edge = g.edge(e);\n var nodeU = g.node(e.v);\n result_1.sum += (edge.weight * nodeU.order);\n result_1.weight += edge.weight;\n });\n return {\n v: v,\n barycenter: result_1.sum / result_1.weight,\n weight: result_1.weight\n };\n }\n });\n};\nexports.default = barycenter;\n//# sourceMappingURL=barycenter.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/barycenter.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return groupToMap; });\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n/* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./group-by */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-by.js\");\n\n\n\n/**\n * 将数据分组成 map\n * @param data\n * @param condition\n */\nfunction groupToMap(data, condition) {\n if (!condition) {\n return {\n 0: data,\n };\n }\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(condition)) {\n // 如果是字符串,则按照 a*b 风格成数组\n var paramscondition_1 = Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(condition) ? condition : condition.replace(/\\s+/g, '').split('*');\n condition = function (row) {\n var unique = '_'; // 避免出现数字作为Key的情况,会进行按照数字的排序\n // 根据字段列表的值,拼接成 key\n for (var i = 0, l = paramscondition_1.length; i < l; i++) {\n unique += row[paramscondition_1[i]] && row[paramscondition_1[i]].toString();\n }\n return unique;\n };\n }\n return Object(_group_by__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(data, condition);\n}\n//# sourceMappingURL=group-to-map.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-to-map.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/build-layer-graph.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/build-layer-graph.js ***! - \***********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group.js ***! + \*******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar graph_1 = __webpack_require__(/*! ../../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\n/*\n * Constructs a graph that can be used to sort a layer of nodes. The graph will\n * contain all base and subgraph nodes from the request layer in their original\n * hierarchy and any edges that are incident on these nodes and are of the type\n * requested by the \"relationship\" parameter.\n *\n * Nodes from the requested rank that do not have parents are assigned a root\n * node in the output graph, which is set in the root graph attribute. This\n * makes it easy to walk the hierarchy of movable nodes during ordering.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG\n * 2. Base nodes in the input graph have a rank attribute\n * 3. Subgraph nodes in the input graph has minRank and maxRank attributes\n * 4. Edges have an assigned weight\n *\n * Post-conditions:\n *\n * 1. Output graph has all nodes in the movable rank with preserved\n * hierarchy.\n * 2. Root nodes in the movable layer are made children of the node\n * indicated by the root attribute of the graph.\n * 3. Non-movable nodes incident on movable nodes, selected by the\n * relationship parameter, are included in the graph (without hierarchy).\n * 4. Edges incident on movable nodes, selected by the relationship\n * parameter, are added to the output graph.\n * 5. The weights for copied edges are aggregated as need, since the output\n * graph is not a multi-graph.\n */\nvar buildLayerGraph = function (g, rank, relationship) {\n var root = createRootNode(g);\n var result = new graph_1.Graph({ compound: true })\n .setGraph({ root: root })\n .setDefaultNodeLabel(function (v) {\n return g.node(v);\n });\n g.nodes().forEach(function (v) {\n var _a;\n var node = g.node(v);\n var parent = g.parent(v);\n if (node.rank === rank ||\n (node.minRank <= rank && rank <= node.maxRank)) {\n result.setNode(v);\n result.setParent(v, parent || root);\n // This assumes we have only short edges!\n (_a = g[relationship](v)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var u = e.v === v ? e.w : e.v;\n var edge = result.edgeFromArgs(u, v);\n var weight = edge !== undefined ? edge.weight : 0;\n result.setEdge(u, v, { weight: g.edge(e).weight + weight });\n });\n if (node.hasOwnProperty(\"minRank\")) {\n result.setNode(v, {\n borderLeft: node.borderLeft[rank],\n borderRight: node.borderRight[rank],\n });\n }\n }\n });\n return result;\n};\nvar createRootNode = function (g) {\n var v;\n while (g.hasNode((v = \"_root\".concat(Math.random()))))\n ;\n return v;\n};\nexports.default = buildLayerGraph;\n//# sourceMappingURL=build-layer-graph.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/build-layer-graph.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./group-to-map */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-to-map.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (data, condition) {\n if (!condition) {\n // 没有条件,则自身改成数组\n return [data];\n }\n var groups = Object(_group_to_map__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data, condition);\n var array = [];\n for (var i in groups) {\n array.push(groups[i]);\n }\n return array;\n});\n//# sourceMappingURL=group.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/cross-count.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/cross-count.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has-key.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has-key.js ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/*\n * A function that takes a layering (an array of layers, each with an array of\n * ordererd nodes) and a graph and returns a weighted crossing count.\n *\n * Pre-conditions:\n *\n * 1. Input graph must be simple (not a multigraph), directed, and include\n * only simple edges.\n * 2. Edges in the input graph must have assigned weights.\n *\n * Post-conditions:\n *\n * 1. The graph and layering matrix are left unchanged.\n *\n * This algorithm is derived from Barth, et al., \"Bilayer Cross Counting.\"\n */\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar twoLayerCrossCount = function (g, northLayer, southLayer) {\n // Sort all of the edges between the north and south layers by their position\n // in the north layer and then the south. Map these edges to the position of\n // their head in the south layer.\n var southPos = (0, util_1.zipObject)(southLayer, southLayer.map(function (v, i) { return i; }));\n var unflat = northLayer.map(function (v) {\n var _a;\n var unsort = (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.map(function (e) {\n return { pos: southPos[e.w] || 0, weight: g.edge(e).weight };\n });\n return unsort === null || unsort === void 0 ? void 0 : unsort.sort(function (a, b) { return a.pos - b.pos; });\n });\n var southEntries = unflat.flat().filter(function (entry) { return entry !== undefined; });\n // Build the accumulator tree\n var firstIndex = 1;\n while (firstIndex < southLayer.length)\n firstIndex <<= 1;\n var treeSize = 2 * firstIndex - 1;\n firstIndex -= 1;\n var tree = Array(treeSize).fill(0, 0, treeSize);\n // Calculate the weighted crossings\n var cc = 0;\n southEntries === null || southEntries === void 0 ? void 0 : southEntries.forEach(function (entry) {\n if (entry) {\n var index = entry.pos + firstIndex;\n tree[index] += entry.weight;\n var weightSum = 0;\n while (index > 0) {\n if (index % 2) {\n weightSum += tree[index + 1];\n }\n index = (index - 1) >> 1;\n tree[index] += entry.weight;\n }\n cc += entry.weight * weightSum;\n }\n });\n return cc;\n};\nvar crossCount = function (g, layering) {\n var cc = 0;\n for (var i = 1; i < (layering === null || layering === void 0 ? void 0 : layering.length); i += 1) {\n cc += twoLayerCrossCount(g, layering[i - 1], layering[i]);\n }\n return cc;\n};\nexports.default = crossCount;\n//# sourceMappingURL=cross-count.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/cross-count.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./has */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_has__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n//# sourceMappingURL=has-key.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has-key.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/index.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has-value.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has-value.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar init_order_1 = __importDefault(__webpack_require__(/*! ./init-order */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/init-order.js\"));\nvar cross_count_1 = __importDefault(__webpack_require__(/*! ./cross-count */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/cross-count.js\"));\nvar build_layer_graph_1 = __importDefault(__webpack_require__(/*! ./build-layer-graph */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/build-layer-graph.js\"));\nvar add_subgraph_constraints_1 = __importDefault(__webpack_require__(/*! ./add-subgraph-constraints */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/add-subgraph-constraints.js\"));\nvar sort_subgraph_1 = __importDefault(__webpack_require__(/*! ./sort-subgraph */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/sort-subgraph.js\"));\nvar util_1 = __webpack_require__(/*! ../../../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar graph_1 = __webpack_require__(/*! ../../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\nvar util_2 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\n/*\n * Applies heuristics to minimize edge crossings in the graph and sets the best\n * order solution as an order attribute on each node.\n *\n * Pre-conditions:\n *\n * 1. Graph must be DAG\n * 2. Graph nodes must be objects with a \"rank\" attribute\n * 3. Graph edges must have the \"weight\" attribute\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have an \"order\" attribute based on the results of the\n * algorithm.\n */\nvar order = function (g) {\n var mxRank = (0, util_2.maxRank)(g);\n var range1 = [];\n var range2 = [];\n for (var i = 1; i < mxRank + 1; i++)\n range1.push(i);\n for (var i = mxRank - 1; i > -1; i--)\n range2.push(i);\n var downLayerGraphs = buildLayerGraphs(g, range1, \"inEdges\");\n var upLayerGraphs = buildLayerGraphs(g, range2, \"outEdges\");\n var layering = (0, init_order_1.default)(g);\n assignOrder(g, layering);\n var bestCC = Number.POSITIVE_INFINITY;\n var best;\n for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {\n sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2);\n layering = (0, util_2.buildLayerMatrix)(g);\n var cc = (0, cross_count_1.default)(g, layering);\n if (cc < bestCC) {\n lastBest = 0;\n best = (0, util_1.clone)(layering);\n bestCC = cc;\n }\n }\n // consider use previous result, maybe somewhat reduendant\n layering = (0, init_order_1.default)(g);\n assignOrder(g, layering);\n for (var i = 0, lastBest = 0; lastBest < 4; ++i, ++lastBest) {\n sweepLayerGraphs(i % 2 ? downLayerGraphs : upLayerGraphs, i % 4 >= 2, true);\n layering = (0, util_2.buildLayerMatrix)(g);\n var cc = (0, cross_count_1.default)(g, layering);\n if (cc < bestCC) {\n lastBest = 0;\n best = (0, util_1.clone)(layering);\n bestCC = cc;\n }\n }\n assignOrder(g, best);\n};\nvar buildLayerGraphs = function (g, ranks, relationship) {\n return ranks.map(function (rank) {\n return (0, build_layer_graph_1.default)(g, rank, relationship);\n });\n};\nvar sweepLayerGraphs = function (layerGraphs, biasRight, usePrev) {\n var cg = new graph_1.Graph();\n layerGraphs === null || layerGraphs === void 0 ? void 0 : layerGraphs.forEach(function (lg) {\n var _a;\n var root = lg.graph().root;\n var sorted = (0, sort_subgraph_1.default)(lg, root, cg, biasRight, usePrev);\n for (var i = 0; i < ((_a = sorted.vs) === null || _a === void 0 ? void 0 : _a.length) || 0; i++) {\n var lnode = lg.node(sorted.vs[i]);\n if (lnode) {\n lnode.order = i;\n }\n }\n (0, add_subgraph_constraints_1.default)(lg, cg, sorted.vs);\n });\n};\nvar assignOrder = function (g, layering) {\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v, i) {\n g.node(v).order = i;\n });\n });\n};\nexports.default = order;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/contains.js\");\n/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, value) { return Object(_contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Object(_values__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj), value); });\n//# sourceMappingURL=has-value.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has-value.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/init-data-order.js": -/*!*********************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/init-data-order.js ***! - \*********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * 按照数据中的结果设置fixorder\n */\nvar initDataOrder = function (g, nodeOrder) {\n var simpleNodes = g.nodes().filter(function (v) {\n var _a;\n return !((_a = g.children(v)) === null || _a === void 0 ? void 0 : _a.length);\n });\n var ranks = simpleNodes.map(function (v) { return g.node(v).rank; });\n var maxRank = Math.max.apply(Math, ranks);\n var layers = Array(maxRank + 1).fill([]);\n nodeOrder === null || nodeOrder === void 0 ? void 0 : nodeOrder.forEach(function (n) {\n var node = g.node(n);\n // 只考虑原有节点,dummy节点需要按照后续算法排出\n if (!node || (node === null || node === void 0 ? void 0 : node.dummy)) {\n return;\n }\n if (!isNaN(node.rank)) {\n node.fixorder = layers[node.rank].length; // 设置fixorder为当层的顺序\n layers[node.rank].push(n);\n }\n });\n};\nexports.default = initDataOrder;\n//# sourceMappingURL=init-data-order.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/init-data-order.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, key) { return obj.hasOwnProperty(key); });\n//# sourceMappingURL=has.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/init-order.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/init-order.js ***! - \****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/head.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/head.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/*\n * Assigns an initial order value for each node by performing a DFS search\n * starting from nodes in the first rank. Nodes are assigned an order in their\n * rank as they are first visited.\n *\n * This approach comes from Gansner, et al., \"A Technique for Drawing Directed\n * Graphs.\"\n *\n * Returns a layering matrix with an array per layer and each layer sorted by\n * the order of its nodes.\n */\nvar initOrder = function (g) {\n var visited = {};\n var simpleNodes = g.nodes().filter(function (v) {\n var _a;\n return !((_a = g.children(v)) === null || _a === void 0 ? void 0 : _a.length);\n });\n var nodeRanks = simpleNodes.map(function (v) { return g.node(v).rank; });\n var maxRank = Math.max.apply(Math, nodeRanks);\n var layers = [];\n for (var i = 0; i < maxRank + 1; i++) {\n layers.push([]);\n }\n var dfs = function (v) {\n var _a;\n if (visited.hasOwnProperty(v))\n return;\n visited[v] = true;\n var node = g.node(v);\n if (!isNaN(node.rank)) {\n layers[node.rank].push(v);\n }\n (_a = g.successors(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (child) { return dfs(child); });\n };\n var orderedVs = simpleNodes.sort(function (a, b) { return g.node(a).rank - g.node(b).rank; });\n // const orderedVs = _.sortBy(simpleNodes, function(v) { return g.node(v)!.rank; });\n // 有fixOrder的,直接排序好放进去\n var beforeSort = orderedVs.filter(function (n) {\n return g.node(n).fixorder !== undefined;\n });\n var fixOrderNodes = beforeSort.sort(function (a, b) { return g.node(a).fixorder - g.node(b).fixorder; });\n fixOrderNodes === null || fixOrderNodes === void 0 ? void 0 : fixOrderNodes.forEach(function (n) {\n if (!isNaN(g.node(n).rank)) {\n layers[g.node(n).rank].push(n);\n }\n visited[n] = true;\n });\n orderedVs === null || orderedVs === void 0 ? void 0 : orderedVs.forEach(dfs);\n return layers;\n};\nexports.default = initOrder;\n//# sourceMappingURL=init-order.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/init-order.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return head; });\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\nfunction head(o) {\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n return o[0];\n }\n return undefined;\n}\n//# sourceMappingURL=head.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/head.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/resolve-conflicts.js": -/*!***********************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/resolve-conflicts.js ***! - \***********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/identity.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/identity.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar resolveConflicts = function (entries, cg) {\n var _a, _b, _c;\n var mappedEntries = {};\n entries === null || entries === void 0 ? void 0 : entries.forEach(function (entry, i) {\n mappedEntries[entry.v] = {\n i: i,\n indegree: 0,\n in: [],\n out: [],\n vs: [entry.v],\n };\n var tmp = mappedEntries[entry.v];\n if (entry.barycenter !== undefined) {\n tmp.barycenter = entry.barycenter;\n tmp.weight = entry.weight;\n }\n });\n (_a = cg.edges()) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var entryV = mappedEntries[e.v];\n var entryW = mappedEntries[e.w];\n if (entryV !== undefined && entryW !== undefined) {\n entryW.indegree++;\n entryV.out.push(mappedEntries[e.w]);\n }\n });\n var sourceSet = (_c = (_b = Object.values(mappedEntries)).filter) === null || _c === void 0 ? void 0 : _c.call(_b, function (entry) { return !entry.indegree; });\n return doResolveConflicts(sourceSet);\n};\nvar doResolveConflicts = function (sourceSet) {\n var _a, _b;\n var entries = [];\n var handleIn = function (vEntry) {\n return function (uEntry) {\n if (uEntry.merged)\n return;\n if (uEntry.barycenter === undefined ||\n vEntry.barycenter === undefined ||\n uEntry.barycenter >= vEntry.barycenter) {\n mergeEntries(vEntry, uEntry);\n }\n };\n };\n var handleOut = function (vEntry) {\n return function (wEntry) {\n wEntry[\"in\"].push(vEntry);\n if (--wEntry.indegree === 0) {\n sourceSet.push(wEntry);\n }\n };\n };\n var _loop_1 = function () {\n var entry = sourceSet.pop();\n entries.push(entry);\n (_a = entry[\"in\"].reverse()) === null || _a === void 0 ? void 0 : _a.forEach(function (e) { return handleIn(entry)(e); });\n (_b = entry.out) === null || _b === void 0 ? void 0 : _b.forEach(function (e) { return handleOut(entry)(e); });\n };\n while (sourceSet === null || sourceSet === void 0 ? void 0 : sourceSet.length) {\n _loop_1();\n }\n var filtered = entries.filter(function (entry) { return !entry.merged; });\n var keys = [\n \"vs\",\n \"i\",\n \"barycenter\",\n \"weight\",\n ];\n return filtered.map(function (entry) {\n var picked = {};\n keys === null || keys === void 0 ? void 0 : keys.forEach(function (key) {\n if (entry[key] === undefined)\n return;\n picked[key] = entry[key];\n });\n return picked;\n });\n};\nvar mergeEntries = function (target, source) {\n var _a;\n var sum = 0;\n var weight = 0;\n if (target.weight) {\n sum += target.barycenter * target.weight;\n weight += target.weight;\n }\n if (source.weight) {\n sum += source.barycenter * source.weight;\n weight += source.weight;\n }\n target.vs = (_a = source.vs) === null || _a === void 0 ? void 0 : _a.concat(target.vs);\n target.barycenter = sum / weight;\n target.weight = weight;\n target.i = Math.min(source.i, target.i);\n source.merged = true;\n};\nexports.default = resolveConflicts;\n//# sourceMappingURL=resolve-conflicts.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/resolve-conflicts.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (v) { return v; });\n//# sourceMappingURL=identity.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/identity.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/sort-subgraph.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/sort-subgraph.js ***! - \*******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index-of.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index-of.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar barycenter_1 = __importDefault(__webpack_require__(/*! ./barycenter */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/barycenter.js\"));\nvar resolve_conflicts_1 = __importDefault(__webpack_require__(/*! ./resolve-conflicts */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/resolve-conflicts.js\"));\nvar sort_1 = __importDefault(__webpack_require__(/*! ./sort */ \"./node_modules/@antv/layout/lib/layout/dagre/src/order/sort.js\"));\nvar sortSubgraph = function (g, v, cg, biasRight, usePrev) {\n var _a, _b, _c, _d;\n var movable = g.children(v);\n // fixorder的点不参与排序(这个方案不合适,只排了新增节点,和原来的分离)\n var node = g.node(v);\n var bl = node ? node.borderLeft : undefined;\n var br = node ? node.borderRight : undefined;\n var subgraphs = {};\n if (bl) {\n movable = movable === null || movable === void 0 ? void 0 : movable.filter(function (w) {\n return w !== bl && w !== br;\n });\n }\n var barycenters = (0, barycenter_1.default)(g, movable || []);\n barycenters === null || barycenters === void 0 ? void 0 : barycenters.forEach(function (entry) {\n var _a;\n if ((_a = g.children(entry.v)) === null || _a === void 0 ? void 0 : _a.length) {\n var subgraphResult = sortSubgraph(g, entry.v, cg, biasRight);\n subgraphs[entry.v] = subgraphResult;\n if (subgraphResult.hasOwnProperty(\"barycenter\")) {\n mergeBarycenters(entry, subgraphResult);\n }\n }\n });\n var entries = (0, resolve_conflicts_1.default)(barycenters, cg);\n expandSubgraphs(entries, subgraphs);\n // 添加fixorder信息到entries里边\n // TODO: 不考虑复合情况,只用第一个点的fixorder信息,后续考虑更完备的实现\n (_a = entries\n .filter(function (e) { return e.vs.length > 0; })) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var node = g.node(e.vs[0]);\n if (node) {\n e.fixorder = node.fixorder;\n e.order = node.order;\n }\n });\n var result = (0, sort_1.default)(entries, biasRight, usePrev);\n if (bl) {\n result.vs = [bl, result.vs, br].flat();\n if ((_b = g.predecessors(bl)) === null || _b === void 0 ? void 0 : _b.length) {\n var blPred = g.node(((_c = g.predecessors(bl)) === null || _c === void 0 ? void 0 : _c[0]) || \"\");\n var brPred = g.node(((_d = g.predecessors(br)) === null || _d === void 0 ? void 0 : _d[0]) || \"\");\n if (!result.hasOwnProperty(\"barycenter\")) {\n result.barycenter = 0;\n result.weight = 0;\n }\n result.barycenter =\n (result.barycenter * result.weight +\n blPred.order +\n brPred.order) /\n (result.weight + 2);\n result.weight += 2;\n }\n }\n return result;\n};\nvar expandSubgraphs = function (entries, subgraphs) {\n entries === null || entries === void 0 ? void 0 : entries.forEach(function (entry) {\n var _a;\n var vss = (_a = entry.vs) === null || _a === void 0 ? void 0 : _a.map(function (v) {\n if (subgraphs[v]) {\n return subgraphs[v].vs;\n }\n return v;\n });\n entry.vs = vss.flat();\n });\n};\nvar mergeBarycenters = function (target, other) {\n if (target.barycenter !== undefined) {\n target.barycenter =\n (target.barycenter * target.weight + other.barycenter * other.weight) /\n (target.weight + other.weight);\n target.weight += other.weight;\n }\n else {\n target.barycenter = other.barycenter;\n target.weight = other.weight;\n }\n};\nexports.default = sortSubgraph;\n//# sourceMappingURL=sort-subgraph.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/sort-subgraph.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\nvar indexOf = function (arr, obj) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return -1;\n }\n var m = Array.prototype.indexOf;\n if (m) {\n return m.call(arr, obj);\n }\n var index = -1;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === obj) {\n index = i;\n break;\n }\n }\n return index;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (indexOf);\n//# sourceMappingURL=index-of.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index-of.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/order/sort.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/order/sort.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index.js ***! + \*******************************************************************************/ +/*! exports provided: contains, includes, difference, find, findIndex, firstValue, flatten, flattenDeep, getRange, pull, pullAt, reduce, remove, sortBy, union, uniq, valuesOfKey, head, last, startsWith, endsWith, filter, every, some, group, groupBy, groupToMap, getWrapBehavior, wrapBehavior, number2color, parseRadius, clamp, fixedBase, isDecimal, isEven, isInteger, isNegative, isNumberEqual, isOdd, isPositive, max, maxBy, min, minBy, mod, toDegree, toInteger, toRadian, forIn, has, hasKey, hasValue, keys, isMatch, values, lowerCase, lowerFirst, substitute, upperCase, upperFirst, getType, isArguments, isArray, isArrayLike, isBoolean, isDate, isError, isFunction, isFinite, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrototype, isRegExp, isString, isType, isUndefined, isElement, requestAnimationFrame, clearAnimationFrame, augment, clone, debounce, memoize, deepMix, each, extend, indexOf, isEmpty, isEqual, isEqualWith, map, mapValues, mix, assign, get, set, pick, omit, throttle, toArray, toString, uniqueId, noop, identity, size, Cache */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar sort = function (entries, biasRight, usePrev) {\n var parts = (0, util_1.partition)(entries, function (entry) {\n // NOTE: 有fixorder的也可以排\n return (entry.hasOwnProperty(\"fixorder\") && !isNaN(entry.fixorder)) || entry.hasOwnProperty(\"barycenter\");\n });\n var sortable = parts.lhs;\n var unsortable = parts.rhs.sort(function (a, b) { return -a.i - (-b.i); });\n var vs = [];\n var sum = 0;\n var weight = 0;\n var vsIndex = 0;\n sortable === null || sortable === void 0 ? void 0 : sortable.sort(compareWithBias(!!biasRight, !!usePrev));\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n sortable === null || sortable === void 0 ? void 0 : sortable.forEach(function (entry) {\n var _a;\n vsIndex += (_a = entry.vs) === null || _a === void 0 ? void 0 : _a.length;\n vs.push(entry.vs);\n sum += entry.barycenter * entry.weight;\n weight += entry.weight;\n vsIndex = consumeUnsortable(vs, unsortable, vsIndex);\n });\n var result = { vs: vs.flat() };\n if (weight) {\n result.barycenter = sum / weight;\n result.weight = weight;\n }\n return result;\n};\nvar consumeUnsortable = function (vs, unsortable, index) {\n var iindex = index;\n var last;\n while (unsortable.length && (last = unsortable[unsortable.length - 1]).i <= iindex) {\n unsortable.pop();\n vs === null || vs === void 0 ? void 0 : vs.push(last.vs);\n iindex++;\n }\n return iindex;\n};\n/**\n * 配置是否考虑使用之前的布局结果\n */\nvar compareWithBias = function (bias, usePrev) {\n return function (entryV, entryW) {\n // 排序的时候先判断fixorder,不行再判断重心\n if (entryV.fixorder !== undefined && entryW.fixorder !== undefined) {\n return entryV.fixorder - entryW.fixorder;\n }\n if (entryV.barycenter < entryW.barycenter) {\n return -1;\n }\n if (entryV.barycenter > entryW.barycenter) {\n return 1;\n }\n // 重心相同,考虑之前排好的顺序\n if (usePrev && entryV.order !== undefined && entryW.order !== undefined) {\n if (entryV.order < entryW.order) {\n return -1;\n }\n if (entryV.order > entryW.order) {\n return 1;\n }\n }\n return !bias ? entryV.i - entryW.i : entryW.i - entryV.i;\n };\n};\nexports.default = sort;\n//# sourceMappingURL=sort.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/order/sort.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/contains.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"contains\", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"includes\", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _difference__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./difference */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/difference.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"difference\", function() { return _difference__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _find__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./find */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/find.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"find\", function() { return _find__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _find_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./find-index */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/find-index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"findIndex\", function() { return _find_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _first_value__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./first-value */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/first-value.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"firstValue\", function() { return _first_value__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _flatten__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flatten */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/flatten.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flatten\", function() { return _flatten__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _flatten_deep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flatten-deep */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/flatten-deep.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flattenDeep\", function() { return _flatten_deep__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _get_range__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-range */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-range.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getRange\", function() { return _get_range__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _pull__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pull */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pull\", function() { return _pull__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pull-at */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull-at.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pullAt\", function() { return _pull_at__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./reduce */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/reduce.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"reduce\", function() { return _reduce__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./remove */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/remove.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return _remove__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _sort_by__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./sort-by */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/sort-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"sortBy\", function() { return _sort_by__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _union__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./union */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/union.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"union\", function() { return _union__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./uniq */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/uniq.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"uniq\", function() { return _uniq__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony import */ var _values_of_key__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./values-of-key */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values-of-key.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"valuesOfKey\", function() { return _values_of_key__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony import */ var _head__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./head */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/head.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"head\", function() { return _head__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n/* harmony import */ var _last__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./last */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/last.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"last\", function() { return _last__WEBPACK_IMPORTED_MODULE_17__[\"default\"]; });\n\n/* harmony import */ var _starts_with__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./starts-with */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/starts-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"startsWith\", function() { return _starts_with__WEBPACK_IMPORTED_MODULE_18__[\"default\"]; });\n\n/* harmony import */ var _ends_with__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ends-with */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/ends-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"endsWith\", function() { return _ends_with__WEBPACK_IMPORTED_MODULE_19__[\"default\"]; });\n\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./filter */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/filter.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return _filter__WEBPACK_IMPORTED_MODULE_20__[\"default\"]; });\n\n/* harmony import */ var _every__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./every */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/every.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"every\", function() { return _every__WEBPACK_IMPORTED_MODULE_21__[\"default\"]; });\n\n/* harmony import */ var _some__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./some */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/some.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"some\", function() { return _some__WEBPACK_IMPORTED_MODULE_22__[\"default\"]; });\n\n/* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./group */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"group\", function() { return _group__WEBPACK_IMPORTED_MODULE_23__[\"default\"]; });\n\n/* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./group-by */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"groupBy\", function() { return _group_by__WEBPACK_IMPORTED_MODULE_24__[\"default\"]; });\n\n/* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./group-to-map */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/group-to-map.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"groupToMap\", function() { return _group_to_map__WEBPACK_IMPORTED_MODULE_25__[\"default\"]; });\n\n/* harmony import */ var _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./get-wrap-behavior */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-wrap-behavior.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getWrapBehavior\", function() { return _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__[\"default\"]; });\n\n/* harmony import */ var _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./wrap-behavior */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/wrap-behavior.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"wrapBehavior\", function() { return _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__[\"default\"]; });\n\n/* harmony import */ var _number2color__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./number2color */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/number2color.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"number2color\", function() { return _number2color__WEBPACK_IMPORTED_MODULE_28__[\"default\"]; });\n\n/* harmony import */ var _parse_radius__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parse-radius */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/parse-radius.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parseRadius\", function() { return _parse_radius__WEBPACK_IMPORTED_MODULE_29__[\"default\"]; });\n\n/* harmony import */ var _clamp__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./clamp */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clamp.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clamp\", function() { return _clamp__WEBPACK_IMPORTED_MODULE_30__[\"default\"]; });\n\n/* harmony import */ var _fixed_base__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./fixed-base */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/fixed-base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fixedBase\", function() { return _fixed_base__WEBPACK_IMPORTED_MODULE_31__[\"default\"]; });\n\n/* harmony import */ var _is_decimal__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./is-decimal */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-decimal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isDecimal\", function() { return _is_decimal__WEBPACK_IMPORTED_MODULE_32__[\"default\"]; });\n\n/* harmony import */ var _is_even__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./is-even */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-even.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEven\", function() { return _is_even__WEBPACK_IMPORTED_MODULE_33__[\"default\"]; });\n\n/* harmony import */ var _is_integer__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./is-integer */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-integer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isInteger\", function() { return _is_integer__WEBPACK_IMPORTED_MODULE_34__[\"default\"]; });\n\n/* harmony import */ var _is_negative__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./is-negative */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-negative.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNegative\", function() { return _is_negative__WEBPACK_IMPORTED_MODULE_35__[\"default\"]; });\n\n/* harmony import */ var _is_number_equal__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./is-number-equal */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number-equal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNumberEqual\", function() { return _is_number_equal__WEBPACK_IMPORTED_MODULE_36__[\"default\"]; });\n\n/* harmony import */ var _is_odd__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./is-odd */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-odd.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isOdd\", function() { return _is_odd__WEBPACK_IMPORTED_MODULE_37__[\"default\"]; });\n\n/* harmony import */ var _is_positive__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./is-positive */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-positive.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPositive\", function() { return _is_positive__WEBPACK_IMPORTED_MODULE_38__[\"default\"]; });\n\n/* harmony import */ var _max__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./max */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return _max__WEBPACK_IMPORTED_MODULE_39__[\"default\"]; });\n\n/* harmony import */ var _max_by__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./max-by */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"maxBy\", function() { return _max_by__WEBPACK_IMPORTED_MODULE_40__[\"default\"]; });\n\n/* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./min */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return _min__WEBPACK_IMPORTED_MODULE_41__[\"default\"]; });\n\n/* harmony import */ var _min_by__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./min-by */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"minBy\", function() { return _min_by__WEBPACK_IMPORTED_MODULE_42__[\"default\"]; });\n\n/* harmony import */ var _mod__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./mod */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mod.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mod\", function() { return _mod__WEBPACK_IMPORTED_MODULE_43__[\"default\"]; });\n\n/* harmony import */ var _to_degree__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./to-degree */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-degree.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toDegree\", function() { return _to_degree__WEBPACK_IMPORTED_MODULE_44__[\"default\"]; });\n\n/* harmony import */ var _to_integer__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./to-integer */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-integer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toInteger\", function() { return _to_integer__WEBPACK_IMPORTED_MODULE_45__[\"default\"]; });\n\n/* harmony import */ var _to_radian__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./to-radian */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-radian.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return _to_radian__WEBPACK_IMPORTED_MODULE_46__[\"default\"]; });\n\n/* harmony import */ var _for_in__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./for-in */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/for-in.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forIn\", function() { return _for_in__WEBPACK_IMPORTED_MODULE_47__[\"default\"]; });\n\n/* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./has */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return _has__WEBPACK_IMPORTED_MODULE_48__[\"default\"]; });\n\n/* harmony import */ var _has_key__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./has-key */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has-key.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hasKey\", function() { return _has_key__WEBPACK_IMPORTED_MODULE_49__[\"default\"]; });\n\n/* harmony import */ var _has_value__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./has-value */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/has-value.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hasValue\", function() { return _has_value__WEBPACK_IMPORTED_MODULE_50__[\"default\"]; });\n\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./keys */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/keys.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return _keys__WEBPACK_IMPORTED_MODULE_51__[\"default\"]; });\n\n/* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./is-match */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-match.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isMatch\", function() { return _is_match__WEBPACK_IMPORTED_MODULE_52__[\"default\"]; });\n\n/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./values */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return _values__WEBPACK_IMPORTED_MODULE_53__[\"default\"]; });\n\n/* harmony import */ var _lower_case__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./lower-case */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/lower-case.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lowerCase\", function() { return _lower_case__WEBPACK_IMPORTED_MODULE_54__[\"default\"]; });\n\n/* harmony import */ var _lower_first__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./lower-first */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/lower-first.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lowerFirst\", function() { return _lower_first__WEBPACK_IMPORTED_MODULE_55__[\"default\"]; });\n\n/* harmony import */ var _substitute__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./substitute */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/substitute.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"substitute\", function() { return _substitute__WEBPACK_IMPORTED_MODULE_56__[\"default\"]; });\n\n/* harmony import */ var _upper_case__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./upper-case */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/upper-case.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"upperCase\", function() { return _upper_case__WEBPACK_IMPORTED_MODULE_57__[\"default\"]; });\n\n/* harmony import */ var _upper_first__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./upper-first */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/upper-first.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"upperFirst\", function() { return _upper_first__WEBPACK_IMPORTED_MODULE_58__[\"default\"]; });\n\n/* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./get-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-type.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return _get_type__WEBPACK_IMPORTED_MODULE_59__[\"default\"]; });\n\n/* harmony import */ var _is_arguments__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./is-arguments */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-arguments.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArguments\", function() { return _is_arguments__WEBPACK_IMPORTED_MODULE_60__[\"default\"]; });\n\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArray\", function() { return _is_array__WEBPACK_IMPORTED_MODULE_61__[\"default\"]; });\n\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArrayLike\", function() { return _is_array_like__WEBPACK_IMPORTED_MODULE_62__[\"default\"]; });\n\n/* harmony import */ var _is_boolean__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./is-boolean */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-boolean.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isBoolean\", function() { return _is_boolean__WEBPACK_IMPORTED_MODULE_63__[\"default\"]; });\n\n/* harmony import */ var _is_date__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./is-date */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-date.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isDate\", function() { return _is_date__WEBPACK_IMPORTED_MODULE_64__[\"default\"]; });\n\n/* harmony import */ var _is_error__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./is-error */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-error.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isError\", function() { return _is_error__WEBPACK_IMPORTED_MODULE_65__[\"default\"]; });\n\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isFunction\", function() { return _is_function__WEBPACK_IMPORTED_MODULE_66__[\"default\"]; });\n\n/* harmony import */ var _is_finite__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./is-finite */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-finite.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isFinite\", function() { return _is_finite__WEBPACK_IMPORTED_MODULE_67__[\"default\"]; });\n\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNil\", function() { return _is_nil__WEBPACK_IMPORTED_MODULE_68__[\"default\"]; });\n\n/* harmony import */ var _is_null__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./is-null */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-null.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNull\", function() { return _is_null__WEBPACK_IMPORTED_MODULE_69__[\"default\"]; });\n\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return _is_number__WEBPACK_IMPORTED_MODULE_70__[\"default\"]; });\n\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return _is_object__WEBPACK_IMPORTED_MODULE_71__[\"default\"]; });\n\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object-like.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isObjectLike\", function() { return _is_object_like__WEBPACK_IMPORTED_MODULE_72__[\"default\"]; });\n\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-plain-object.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPlainObject\", function() { return _is_plain_object__WEBPACK_IMPORTED_MODULE_73__[\"default\"]; });\n\n/* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./is-prototype */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-prototype.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPrototype\", function() { return _is_prototype__WEBPACK_IMPORTED_MODULE_74__[\"default\"]; });\n\n/* harmony import */ var _is_reg_exp__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./is-reg-exp */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-reg-exp.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isRegExp\", function() { return _is_reg_exp__WEBPACK_IMPORTED_MODULE_75__[\"default\"]; });\n\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isString\", function() { return _is_string__WEBPACK_IMPORTED_MODULE_76__[\"default\"]; });\n\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isType\", function() { return _is_type__WEBPACK_IMPORTED_MODULE_77__[\"default\"]; });\n\n/* harmony import */ var _is_undefined__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./is-undefined */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-undefined.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isUndefined\", function() { return _is_undefined__WEBPACK_IMPORTED_MODULE_78__[\"default\"]; });\n\n/* harmony import */ var _is_element__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./is-element */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-element.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isElement\", function() { return _is_element__WEBPACK_IMPORTED_MODULE_79__[\"default\"]; });\n\n/* harmony import */ var _request_animation_frame__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./request-animation-frame */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/request-animation-frame.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"requestAnimationFrame\", function() { return _request_animation_frame__WEBPACK_IMPORTED_MODULE_80__[\"default\"]; });\n\n/* harmony import */ var _clear_animation_frame__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./clear-animation-frame */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clear-animation-frame.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clearAnimationFrame\", function() { return _clear_animation_frame__WEBPACK_IMPORTED_MODULE_81__[\"default\"]; });\n\n/* harmony import */ var _augment__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./augment */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/augment.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"augment\", function() { return _augment__WEBPACK_IMPORTED_MODULE_82__[\"default\"]; });\n\n/* harmony import */ var _clone__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./clone */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/clone.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return _clone__WEBPACK_IMPORTED_MODULE_83__[\"default\"]; });\n\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./debounce */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/debounce.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return _debounce__WEBPACK_IMPORTED_MODULE_84__[\"default\"]; });\n\n/* harmony import */ var _memoize__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./memoize */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/memoize.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"memoize\", function() { return _memoize__WEBPACK_IMPORTED_MODULE_85__[\"default\"]; });\n\n/* harmony import */ var _deep_mix__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./deep-mix */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/deep-mix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"deepMix\", function() { return _deep_mix__WEBPACK_IMPORTED_MODULE_86__[\"default\"]; });\n\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"each\", function() { return _each__WEBPACK_IMPORTED_MODULE_87__[\"default\"]; });\n\n/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./extend */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/extend.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return _extend__WEBPACK_IMPORTED_MODULE_88__[\"default\"]; });\n\n/* harmony import */ var _index_of__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./index-of */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index-of.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"indexOf\", function() { return _index_of__WEBPACK_IMPORTED_MODULE_89__[\"default\"]; });\n\n/* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./is-empty */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-empty.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEmpty\", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_90__[\"default\"]; });\n\n/* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./is-equal */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEqual\", function() { return _is_equal__WEBPACK_IMPORTED_MODULE_91__[\"default\"]; });\n\n/* harmony import */ var _is_equal_with__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./is-equal-with */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEqualWith\", function() { return _is_equal_with__WEBPACK_IMPORTED_MODULE_92__[\"default\"]; });\n\n/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./map */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/map.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return _map__WEBPACK_IMPORTED_MODULE_93__[\"default\"]; });\n\n/* harmony import */ var _map_values__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./map-values */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/map-values.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mapValues\", function() { return _map_values__WEBPACK_IMPORTED_MODULE_94__[\"default\"]; });\n\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mix\", function() { return _mix__WEBPACK_IMPORTED_MODULE_95__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"assign\", function() { return _mix__WEBPACK_IMPORTED_MODULE_95__[\"default\"]; });\n\n/* harmony import */ var _get__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./get */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return _get__WEBPACK_IMPORTED_MODULE_96__[\"default\"]; });\n\n/* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./set */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/set.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return _set__WEBPACK_IMPORTED_MODULE_97__[\"default\"]; });\n\n/* harmony import */ var _pick__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./pick */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pick.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pick\", function() { return _pick__WEBPACK_IMPORTED_MODULE_98__[\"default\"]; });\n\n/* harmony import */ var _omit__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./omit */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/omit.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"omit\", function() { return _omit__WEBPACK_IMPORTED_MODULE_99__[\"default\"]; });\n\n/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./throttle */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/throttle.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return _throttle__WEBPACK_IMPORTED_MODULE_100__[\"default\"]; });\n\n/* harmony import */ var _to_array__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./to-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toArray\", function() { return _to_array__WEBPACK_IMPORTED_MODULE_101__[\"default\"]; });\n\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toString\", function() { return _to_string__WEBPACK_IMPORTED_MODULE_102__[\"default\"]; });\n\n/* harmony import */ var _unique_id__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./unique-id */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/unique-id.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return _unique_id__WEBPACK_IMPORTED_MODULE_103__[\"default\"]; });\n\n/* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./noop */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/noop.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"noop\", function() { return _noop__WEBPACK_IMPORTED_MODULE_104__[\"default\"]; });\n\n/* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./identity */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/identity.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return _identity__WEBPACK_IMPORTED_MODULE_105__[\"default\"]; });\n\n/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./size */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/size.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"size\", function() { return _size__WEBPACK_IMPORTED_MODULE_106__[\"default\"]; });\n\n/* harmony import */ var _cache__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./cache */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/cache.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Cache\", function() { return _cache__WEBPACK_IMPORTED_MODULE_107__[\"default\"]; });\n\n// array\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// event\n\n\n// format\n\n\n// math\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// object\n\n\n\n\n\n\n\n// string\n\n\n\n\n\n// type\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// other\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// 不知道为什么,需要把这个 export,不然 ts 会报类型错误\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/index.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/parent-dummy-chains.js": -/*!*******************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/parent-dummy-chains.js ***! - \*******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-arguments.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-arguments.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// deep first search with both order low for pre, lim for post\nvar dfsBothOrder = function (g) {\n var _a;\n var result = {};\n var lim = 0;\n var dfs = function (v) {\n var _a;\n var low = lim;\n (_a = g.children(v)) === null || _a === void 0 ? void 0 : _a.forEach(dfs);\n result[v] = { low: low, lim: lim++ };\n };\n (_a = g.children()) === null || _a === void 0 ? void 0 : _a.forEach(dfs);\n return result;\n};\n// Find a path from v to w through the lowest common ancestor (LCA). Return the\n// full path and the LCA.\nvar findPath = function (g, postorderNums, v, w) {\n var vPath = [];\n var wPath = [];\n var low = Math.min(postorderNums[v].low, postorderNums[w].low);\n var lim = Math.max(postorderNums[v].lim, postorderNums[w].lim);\n var parent;\n var lca;\n // Traverse up from v to find the LCA\n parent = v;\n do {\n parent = g.parent(parent);\n vPath.push(parent);\n } while (parent &&\n (postorderNums[parent].low > low || lim > postorderNums[parent].lim));\n lca = parent;\n // Traverse from w to LCA\n parent = w;\n while (parent && parent !== lca) {\n wPath.push(parent);\n parent = g.parent(parent);\n }\n return { lca: lca, path: vPath.concat(wPath.reverse()) };\n};\nvar parentDummyChains = function (g) {\n var _a;\n var postorderNums = dfsBothOrder(g);\n (_a = g.graph().dummyChains) === null || _a === void 0 ? void 0 : _a.forEach(function (startV) {\n var _a, _b;\n var v = startV;\n var node = g.node(v);\n var edgeObj = node.edgeObj;\n if (!edgeObj)\n return;\n var pathData = findPath(g, postorderNums, edgeObj.v, edgeObj.w);\n var path = pathData.path;\n var lca = pathData.lca;\n var pathIdx = 0;\n var pathV = path[pathIdx];\n var ascending = true;\n while (v !== edgeObj.w) {\n node = g.node(v);\n if (ascending) {\n while (pathV !== lca && ((_a = g.node(pathV)) === null || _a === void 0 ? void 0 : _a.maxRank) < node.rank) {\n pathIdx++;\n pathV = path[pathIdx];\n }\n if (pathV === lca) {\n ascending = false;\n }\n }\n if (!ascending) {\n while (pathIdx < path.length - 1 &&\n ((_b = g.node(path[pathIdx + 1])) === null || _b === void 0 ? void 0 : _b.minRank) <=\n node.rank) {\n pathIdx++;\n }\n pathV = path[pathIdx];\n }\n g.setParent(v, pathV);\n v = g.successors(v)[0];\n }\n });\n};\nexports.default = parentDummyChains;\n//# sourceMappingURL=parent-dummy-chains.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/parent-dummy-chains.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isArguments = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Arguments');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isArguments);\n//# sourceMappingURL=is-arguments.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-arguments.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/position/bk.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/position/bk.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.width = exports.sep = exports.positionX = exports.balance = exports.alignCoordinates = exports.findSmallestWidthAlignment = exports.buildBlockGraph = exports.horizontalCompaction = exports.verticalAlignment = exports.hasConflict = exports.addConflict = exports.findOtherInnerSegmentNode = exports.findType2Conflicts = exports.findType1Conflicts = void 0;\n/*\n * This module provides coordinate assignment based on Brandes and Köpf, \"Fast\n * and Simple Horizontal Coordinate Assignment.\"\n */\nvar graphlib_1 = __webpack_require__(/*! @antv/graphlib */ \"./node_modules/@antv/graphlib/es/index.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar BlockGraph = /** @class */ (function (_super) {\n __extends(BlockGraph, _super);\n function BlockGraph() {\n return _super !== null && _super.apply(this, arguments) || this;\n }\n return BlockGraph;\n}(graphlib_1.Graph));\nvar findType1Conflicts = function (g, layering) {\n var conflicts = {};\n var visitLayer = function (prevLayer, layer) {\n // last visited node in the previous layer that is incident on an inner\n // segment.\n var k0 = 0;\n // Tracks the last node in this layer scanned for crossings with a type-1\n // segment.\n var scanPos = 0;\n var prevLayerLength = prevLayer.length;\n var lastNode = layer === null || layer === void 0 ? void 0 : layer[(layer === null || layer === void 0 ? void 0 : layer.length) - 1];\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v, i) {\n var _a;\n var w = (0, exports.findOtherInnerSegmentNode)(g, v);\n var k1 = w ? g.node(w).order : prevLayerLength;\n if (w || v === lastNode) {\n (_a = layer.slice(scanPos, i + 1)) === null || _a === void 0 ? void 0 : _a.forEach(function (scanNode) {\n var _a;\n (_a = g.predecessors(scanNode)) === null || _a === void 0 ? void 0 : _a.forEach(function (u) {\n var _a;\n var uLabel = g.node(u);\n var uPos = uLabel.order;\n if ((uPos < k0 || k1 < uPos) &&\n !(uLabel.dummy && ((_a = g.node(scanNode)) === null || _a === void 0 ? void 0 : _a.dummy))) {\n (0, exports.addConflict)(conflicts, u, scanNode);\n }\n });\n });\n scanPos = i + 1;\n k0 = k1;\n }\n });\n return layer;\n };\n if (layering === null || layering === void 0 ? void 0 : layering.length) {\n layering.reduce(visitLayer);\n }\n return conflicts;\n};\nexports.findType1Conflicts = findType1Conflicts;\nvar findType2Conflicts = function (g, layering) {\n var conflicts = {};\n var scan = function (south, southPos, southEnd, prevNorthBorder, nextNorthBorder) {\n var v;\n var range = [];\n for (var i = southPos; i < southEnd; i++) {\n range.push(i);\n }\n range.forEach(function (i) {\n var _a, _b;\n v = south[i];\n if ((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.dummy) {\n (_b = g.predecessors(v)) === null || _b === void 0 ? void 0 : _b.forEach(function (u) {\n var uNode = g.node(u);\n if (uNode.dummy &&\n (uNode.order < prevNorthBorder ||\n uNode.order > nextNorthBorder)) {\n (0, exports.addConflict)(conflicts, u, v);\n }\n });\n }\n });\n };\n var visitLayer = function (north, south) {\n var prevNorthPos = -1;\n var nextNorthPos;\n var southPos = 0;\n south === null || south === void 0 ? void 0 : south.forEach(function (v, southLookahead) {\n var _a;\n if (((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.dummy) === \"border\") {\n var predecessors = g.predecessors(v) || [];\n if (predecessors.length) {\n nextNorthPos = g.node(predecessors[0]).order;\n scan(south, southPos, southLookahead, prevNorthPos, nextNorthPos);\n southPos = southLookahead;\n prevNorthPos = nextNorthPos;\n }\n }\n scan(south, southPos, south.length, nextNorthPos, north.length);\n });\n return south;\n };\n if (layering === null || layering === void 0 ? void 0 : layering.length) {\n layering.reduce(visitLayer);\n }\n return conflicts;\n};\nexports.findType2Conflicts = findType2Conflicts;\nvar findOtherInnerSegmentNode = function (g, v) {\n var _a, _b;\n if ((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.dummy) {\n return (_b = g.predecessors(v)) === null || _b === void 0 ? void 0 : _b.find(function (u) { return g.node(u).dummy; });\n }\n};\nexports.findOtherInnerSegmentNode = findOtherInnerSegmentNode;\nvar addConflict = function (conflicts, v, w) {\n var vv = v;\n var ww = w;\n if (vv > ww) {\n var tmp = vv;\n vv = ww;\n ww = tmp;\n }\n var conflictsV = conflicts[vv];\n if (!conflictsV) {\n conflicts[vv] = conflictsV = {};\n }\n conflictsV[ww] = true;\n};\nexports.addConflict = addConflict;\nvar hasConflict = function (conflicts, v, w) {\n var vv = v;\n var ww = w;\n if (vv > ww) {\n var tmp = v;\n vv = ww;\n ww = tmp;\n }\n return !!conflicts[vv];\n};\nexports.hasConflict = hasConflict;\n/*\n * Try to align nodes into vertical \"blocks\" where possible. This algorithm\n * attempts to align a node with one of its median neighbors. If the edge\n * connecting a neighbor is a type-1 conflict then we ignore that possibility.\n * If a previous node has already formed a block with a node after the node\n * we're trying to form a block with, we also ignore that possibility - our\n * blocks would be split in that scenario.\n */\nvar verticalAlignment = function (g, layering, conflicts, neighborFn) {\n var root = {};\n var align = {};\n var pos = {};\n // We cache the position here based on the layering because the graph and\n // layering may be out of sync. The layering matrix is manipulated to\n // generate different extreme alignments.\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v, order) {\n root[v] = v;\n align[v] = v;\n pos[v] = order;\n });\n });\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n var prevIdx = -1;\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v) {\n var ws = neighborFn(v);\n if (ws.length) {\n ws = ws.sort(function (a, b) { return pos[a] - pos[b]; });\n var mp = (ws.length - 1) / 2;\n for (var i = Math.floor(mp), il = Math.ceil(mp); i <= il; ++i) {\n var w = ws[i];\n if (align[v] === v &&\n prevIdx < pos[w] &&\n !(0, exports.hasConflict)(conflicts, v, w)) {\n align[w] = v;\n align[v] = root[v] = root[w];\n prevIdx = pos[w];\n }\n }\n }\n });\n });\n return { root: root, align: align };\n};\nexports.verticalAlignment = verticalAlignment;\nvar horizontalCompaction = function (g, layering, root, align, reverseSep) {\n var _a;\n // This portion of the algorithm differs from BK due to a number of problems.\n // Instead of their algorithm we construct a new block graph and do two\n // sweeps. The first sweep places blocks with the smallest possible\n // coordinates. The second sweep removes unused space by moving blocks to the\n // greatest coordinates without violating separation.\n var xs = {};\n var blockG = (0, exports.buildBlockGraph)(g, layering, root, reverseSep);\n var borderType = reverseSep ? \"borderLeft\" : \"borderRight\";\n var iterate = function (setXsFunc, nextNodesFunc) {\n var stack = blockG.nodes();\n var elem = stack.pop();\n var visited = {};\n while (elem) {\n if (visited[elem]) {\n setXsFunc(elem);\n }\n else {\n visited[elem] = true;\n stack.push(elem);\n stack = stack.concat(nextNodesFunc(elem));\n }\n elem = stack.pop();\n }\n };\n // First pass, assign smallest coordinates\n var pass1 = function (elem) {\n xs[elem] = (blockG.inEdges(elem) || []).reduce(function (acc, e) {\n return Math.max(acc, (xs[e.v] || 0) + blockG.edge(e));\n }, 0);\n };\n // Second pass, assign greatest coordinates\n var pass2 = function (elem) {\n var min = (blockG.outEdges(elem) || []).reduce(function (acc, e) {\n return Math.min(acc, (xs[e.w] || 0) - blockG.edge(e));\n }, Number.POSITIVE_INFINITY);\n var node = g.node(elem);\n if (min !== Number.POSITIVE_INFINITY && node.borderType !== borderType) {\n xs[elem] = Math.max(xs[elem], min);\n }\n };\n iterate(pass1, blockG.predecessors.bind(blockG));\n iterate(pass2, blockG.successors.bind(blockG));\n // Assign x coordinates to all nodes\n (_a = Object.values(align)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {\n xs[v] = xs[root[v]];\n });\n return xs;\n};\nexports.horizontalCompaction = horizontalCompaction;\nvar buildBlockGraph = function (g, layering, root, reverseSep) {\n var blockGraph = new BlockGraph();\n var graphLabel = g.graph();\n var sepFn = (0, exports.sep)(graphLabel.nodesep, graphLabel.edgesep, reverseSep);\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n var u;\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v) {\n var vRoot = root[v];\n blockGraph.setNode(vRoot);\n if (u) {\n var uRoot = root[u];\n var prevMax = blockGraph.edgeFromArgs(uRoot, vRoot);\n blockGraph.setEdge(uRoot, vRoot, Math.max(sepFn(g, v, u), prevMax || 0));\n }\n u = v;\n });\n });\n return blockGraph;\n};\nexports.buildBlockGraph = buildBlockGraph;\n/*\n * Returns the alignment that has the smallest width of the given alignments.\n */\nvar findSmallestWidthAlignment = function (g, xss) {\n return (0, util_1.minBy)(Object.values(xss), function (xs) {\n var _a;\n var max = Number.NEGATIVE_INFINITY;\n var min = Number.POSITIVE_INFINITY;\n (_a = Object.keys(xs)) === null || _a === void 0 ? void 0 : _a.forEach(function (v) {\n var x = xs[v];\n var halfWidth = (0, exports.width)(g, v) / 2;\n max = Math.max(x + halfWidth, max);\n min = Math.min(x - halfWidth, min);\n });\n return max - min;\n });\n};\nexports.findSmallestWidthAlignment = findSmallestWidthAlignment;\n/*\n * Align the coordinates of each of the layout alignments such that\n * left-biased alignments have their minimum coordinate at the same point as\n * the minimum coordinate of the smallest width alignment and right-biased\n * alignments have their maximum coordinate at the same point as the maximum\n * coordinate of the smallest width alignment.\n */\nfunction alignCoordinates(xss, alignTo) {\n // @ts-ignore\n var alignToVals = Object.values(alignTo);\n var alignToMin = Math.min.apply(Math, alignToVals);\n var alignToMax = Math.max.apply(Math, alignToVals);\n [\"u\", \"d\"].forEach(function (vert) {\n [\"l\", \"r\"].forEach(function (horiz) {\n var alignment = vert + horiz;\n var xs = xss[alignment];\n var delta;\n if (xs === alignTo)\n return;\n var xsVals = Object.values(xs);\n delta =\n horiz === \"l\"\n ? alignToMin - Math.min.apply(Math, xsVals)\n : alignToMax - Math.max.apply(Math, xsVals);\n if (delta) {\n xss[alignment] = {};\n Object.keys(xs).forEach(function (key) {\n xss[alignment][key] = xs[key] + delta;\n });\n }\n });\n });\n}\nexports.alignCoordinates = alignCoordinates;\nvar balance = function (xss, align) {\n var result = {};\n Object.keys(xss.ul).forEach(function (key) {\n if (align) {\n result[key] = xss[align.toLowerCase()][key];\n }\n else {\n var values = Object.values(xss).map(function (x) { return x[key]; });\n result[key] = (values[0] + values[1]) / 2; // (ur + ul) / 2\n }\n });\n return result;\n};\nexports.balance = balance;\nvar positionX = function (g) {\n var layering = (0, util_1.buildLayerMatrix)(g);\n var conflicts = Object.assign((0, exports.findType1Conflicts)(g, layering), (0, exports.findType2Conflicts)(g, layering));\n var xss = {};\n var adjustedLayering;\n [\"u\", \"d\"].forEach(function (vert) {\n adjustedLayering =\n vert === \"u\" ? layering : Object.values(layering).reverse();\n [\"l\", \"r\"].forEach(function (horiz) {\n if (horiz === \"r\") {\n adjustedLayering = adjustedLayering.map(function (inner) {\n return Object.values(inner).reverse();\n });\n }\n var neighborFn = (vert === \"u\" ? g.predecessors : g.successors).bind(g);\n var align = (0, exports.verticalAlignment)(g, adjustedLayering, conflicts, neighborFn);\n var xs = (0, exports.horizontalCompaction)(g, adjustedLayering, align.root, align.align, horiz === \"r\");\n if (horiz === \"r\") {\n Object.keys(xs).forEach(function (key) {\n xs[key] = -xs[key];\n });\n }\n xss[vert + horiz] = xs;\n });\n });\n var smallestWidth = (0, exports.findSmallestWidthAlignment)(g, xss);\n alignCoordinates(xss, smallestWidth);\n return (0, exports.balance)(xss, g.graph().align);\n};\nexports.positionX = positionX;\nvar sep = function (nodeSep, edgeSep, reverseSep) {\n return function (g, v, w) {\n var vLabel = g.node(v);\n var wLabel = g.node(w);\n var sum = 0;\n var delta;\n sum += vLabel.width / 2;\n if (vLabel.hasOwnProperty(\"labelpos\")) {\n switch ((vLabel.labelpos || \"\").toLowerCase()) {\n case \"l\":\n delta = -vLabel.width / 2;\n break;\n case \"r\":\n delta = vLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n sum += (vLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += (wLabel.dummy ? edgeSep : nodeSep) / 2;\n sum += wLabel.width / 2;\n if (wLabel.labelpos) {\n switch ((wLabel.labelpos || \"\").toLowerCase()) {\n case \"l\":\n delta = wLabel.width / 2;\n break;\n case \"r\":\n delta = -wLabel.width / 2;\n break;\n }\n }\n if (delta) {\n sum += reverseSep ? delta : -delta;\n }\n delta = 0;\n return sum;\n };\n};\nexports.sep = sep;\nvar width = function (g, v) { return g.node(v).width || 0; };\nexports.width = width;\n//# sourceMappingURL=bk.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/position/bk.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar isArrayLike = function (value) {\n /**\n * isArrayLike([1, 2, 3]) => true\n * isArrayLike(document.body.children) => true\n * isArrayLike('abc') => true\n * isArrayLike(Function) => false\n */\n return value !== null && typeof value !== 'function' && isFinite(value.length);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isArrayLike);\n//# sourceMappingURL=is-array-like.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/position/index.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/position/index.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar bk_1 = __webpack_require__(/*! ./bk */ \"./node_modules/@antv/layout/lib/layout/dagre/src/position/bk.js\");\nvar positionY = function (g) {\n var layering = (0, util_1.buildLayerMatrix)(g);\n var rankSep = g.graph().ranksep;\n var prevY = 0;\n layering === null || layering === void 0 ? void 0 : layering.forEach(function (layer) {\n var heights = layer.map(function (v) { return g.node(v).height; });\n var maxHeight = Math.max.apply(Math, heights);\n layer === null || layer === void 0 ? void 0 : layer.forEach(function (v) {\n g.node(v).y = prevY + maxHeight / 2;\n });\n prevY += maxHeight + rankSep;\n });\n};\nvar positionX = function (g) {\n var layering = (0, util_1.buildLayerMatrix)(g);\n var conflicts = Object.assign((0, bk_1.findType1Conflicts)(g, layering), (0, bk_1.findType2Conflicts)(g, layering));\n var xss = {};\n var adjustedLayering = [];\n [\"u\", \"d\"].forEach(function (vert) {\n adjustedLayering =\n vert === \"u\" ? layering : Object.values(layering).reverse();\n [\"l\", \"r\"].forEach(function (horiz) {\n if (horiz === \"r\") {\n adjustedLayering = adjustedLayering.map(function (inner) {\n return Object.values(inner).reverse();\n });\n }\n var neighborFn = (vert === \"u\" ? g.predecessors : g.successors).bind(g);\n var align = (0, bk_1.verticalAlignment)(g, adjustedLayering, conflicts, neighborFn);\n var xs = (0, bk_1.horizontalCompaction)(g, adjustedLayering, align.root, align.align, horiz === \"r\");\n if (horiz === \"r\") {\n Object.keys(xs).forEach(function (xsKey) { return (xs[xsKey] = -xs[xsKey]); });\n }\n xss[vert + horiz] = xs;\n });\n });\n var smallestWidth = (0, bk_1.findSmallestWidthAlignment)(g, xss);\n smallestWidth && (0, bk_1.alignCoordinates)(xss, smallestWidth);\n return (0, bk_1.balance)(xss, g.graph().align);\n};\nvar position = function (g) {\n var _a;\n var ng = (0, util_1.asNonCompoundGraph)(g);\n positionY(ng);\n var xs = positionX(ng);\n (_a = Object.keys(xs)) === null || _a === void 0 ? void 0 : _a.forEach(function (key) {\n ng.node(key).x = xs[key];\n });\n};\nexports.default = position;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/position/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Array.isArray ? Array.isArray(value) : Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Array');\n});\n//# sourceMappingURL=is-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-boolean.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-boolean.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.feasibleTreeWithLayer = exports.feasibleTree = void 0;\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js\");\nvar util_2 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar graph_1 = __webpack_require__(/*! ../../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\n/*\n * Constructs a spanning tree with tight edges and adjusted the input node's\n * ranks to achieve this. A tight edge is one that is has a length that matches\n * its \"minlen\" attribute.\n *\n * The basic structure for this function is derived from Gansner, et al., \"A\n * Technique for Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a DAG.\n * 2. Graph must be connected.\n * 3. Graph must have at least one node.\n * 5. Graph nodes must have been previously assigned a \"rank\" property that\n * respects the \"minlen\" property of incident edges.\n * 6. Graph edges must have a \"minlen\" property.\n *\n * Post-conditions:\n *\n * - Graph nodes will have their rank adjusted to ensure that all edges are\n * tight.\n *\n * Returns a tree (undirected graph) that is constructed using only \"tight\"\n * edges.\n */\nvar feasibleTree = function (g) {\n var t = new graph_1.Graph({ directed: false });\n // Choose arbitrary node from which to start our tree\n var start = g.nodes()[0];\n var size = g.nodeCount();\n t.setNode(start, {});\n var edge;\n var delta;\n while (tightTree(t, g) < size) {\n edge = findMinSlackEdge(t, g);\n delta = t.hasNode(edge.v) ? (0, util_1.slack)(g, edge) : -(0, util_1.slack)(g, edge);\n shiftRanks(t, g, delta);\n }\n return t;\n};\nexports.feasibleTree = feasibleTree;\n/*\n * Finds a maximal tree of tight edges and returns the number of nodes in the\n * tree.\n */\nvar tightTree = function (t, g) {\n var dfs = function (v) {\n g.nodeEdges(v).forEach(function (e) {\n var edgeV = e.v;\n var w = (v === edgeV) ? e.w : edgeV;\n if (!t.hasNode(w) && !(0, util_1.slack)(g, e)) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n };\n t.nodes().forEach(dfs);\n return t.nodeCount();\n};\n/*\n * Constructs a spanning tree with tight edges and adjusted the input node's\n * ranks to achieve this. A tight edge is one that is has a length that matches\n * its \"minlen\" attribute.\n *\n * The basic structure for this function is derived from Gansner, et al., \"A\n * Technique for Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a DAG.\n * 2. Graph must be connected.\n * 3. Graph must have at least one node.\n * 5. Graph nodes must have been previously assigned a \"rank\" property that\n * respects the \"minlen\" property of incident edges.\n * 6. Graph edges must have a \"minlen\" property.\n *\n * Post-conditions:\n *\n * - Graph nodes will have their rank adjusted to ensure that all edges are\n * tight.\n *\n * Returns a tree (undirected graph) that is constructed using only \"tight\"\n * edges.\n */\nvar feasibleTreeWithLayer = function (g) {\n var t = new graph_1.Graph({ directed: false });\n // Choose arbitrary node from which to start our tree\n var start = g.nodes()[0];\n var size = g.nodeCount();\n t.setNode(start, {});\n var edge;\n var delta;\n while (tightTreeWithLayer(t, g) < size) {\n edge = findMinSlackEdge(t, g);\n delta = t.hasNode(edge.v) ? (0, util_1.slack)(g, edge) : -(0, util_1.slack)(g, edge);\n shiftRanks(t, g, delta);\n }\n return t;\n};\nexports.feasibleTreeWithLayer = feasibleTreeWithLayer;\n/*\n * Finds a maximal tree of tight edges and returns the number of nodes in the\n * tree.\n */\nvar tightTreeWithLayer = function (t, g) {\n var dfs = function (v) {\n var _a;\n (_a = g.nodeEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var edgeV = e.v;\n var w = (v === edgeV) ? e.w : edgeV;\n // 对于指定layer的,直接加入tight-tree,不参与调整\n if (!t.hasNode(w) && (g.node(w).layer !== undefined || !(0, util_1.slack)(g, e))) {\n t.setNode(w, {});\n t.setEdge(v, w, {});\n dfs(w);\n }\n });\n };\n t.nodes().forEach(dfs);\n return t.nodeCount();\n};\n/*\n * Finds the edge with the smallest slack that is incident on tree and returns\n * it.\n */\nvar findMinSlackEdge = function (t, g) {\n return (0, util_2.minBy)(g.edges(), function (e) {\n if (t.hasNode(e.v) !== t.hasNode(e.w)) {\n return (0, util_1.slack)(g, e);\n }\n return Infinity;\n });\n};\nvar shiftRanks = function (t, g, delta) {\n t.nodes().forEach(function (v) {\n if (!g.node(v).rank)\n g.node(v).rank = 0;\n g.node(v).rank += delta;\n });\n};\nexports.default = {\n feasibleTree: feasibleTree,\n feasibleTreeWithLayer: feasibleTreeWithLayer\n};\n//# sourceMappingURL=feasible-tree.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n/**\n * 是否是布尔类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isBoolean = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Boolean');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isBoolean);\n//# sourceMappingURL=is-boolean.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-boolean.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/rank/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/rank/index.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-date.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-date.js ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n// \"use strict\";\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// var rankUtil = require(\"./util\");\n// var longestPath = rankUtil.longestPathWithLayer;\n// var feasibleTree = require(\"./feasible-tree\").feasibleTreeWithLayer;\n// var networkSimplex = require(\"./network-simplex\");\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js\");\nvar feasible_tree_1 = __webpack_require__(/*! ./feasible-tree */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js\");\nvar network_simplex_1 = __importDefault(__webpack_require__(/*! ./network-simplex */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/network-simplex.js\"));\n/*\n * Assigns a rank to each node in the input graph that respects the \"minlen\"\n * constraint specified on edges between nodes.\n *\n * This basic structure is derived from Gansner, et al., \"A Technique for\n * Drawing Directed Graphs.\"\n *\n * Pre-conditions:\n *\n * 1. Graph must be a connected DAG\n * 2. Graph nodes must be objects\n * 3. Graph edges must have \"weight\" and \"minlen\" attributes\n *\n * Post-conditions:\n *\n * 1. Graph nodes will have a \"rank\" attribute based on the results of the\n * algorithm. Ranks can start at any index (including negative), we'll\n * fix them up later.\n */\nvar rank = function (g) {\n switch (g.graph().ranker) {\n case \"network-simplex\":\n networkSimplexRanker(g);\n break;\n case \"tight-tree\":\n tightTreeRanker(g);\n break;\n case \"longest-path\":\n longestPathRanker(g);\n break;\n // default: networkSimplexRanker(g);\n default: tightTreeRanker(g);\n }\n};\n// A fast and simple ranker, but results are far from optimal.\nvar longestPathRanker = util_1.longestPath;\nvar tightTreeRanker = function (g) {\n (0, util_1.longestPathWithLayer)(g);\n (0, feasible_tree_1.feasibleTreeWithLayer)(g);\n};\nvar networkSimplexRanker = function (g) {\n (0, network_simplex_1.default)(g);\n};\nexports.default = rank;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/rank/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n\nvar isDate = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Date');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isDate);\n//# sourceMappingURL=is-date.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-date.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/rank/network-simplex.js": -/*!********************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/rank/network-simplex.js ***! - \********************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-decimal.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-decimal.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.exchangeEdges = exports.enterEdge = exports.leaveEdge = exports.initLowLimValues = exports.calcCutValue = exports.initCutValues = void 0;\nvar feasible_tree_1 = __webpack_require__(/*! ./feasible-tree */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/feasible-tree.js\");\nvar util_1 = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js\");\nvar util_2 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/layout/dagre/src/util.js\");\nvar graphlib_1 = __webpack_require__(/*! @antv/graphlib */ \"./node_modules/@antv/graphlib/es/index.js\");\nvar preorder = graphlib_1.algorithm.preorder, postorder = graphlib_1.algorithm.postorder;\n/*\n * The network simplex algorithm assigns ranks to each node in the input graph\n * and iteratively improves the ranking to reduce the length of edges.\n *\n * Preconditions:\n *\n * 1. The input graph must be a DAG.\n * 2. All nodes in the graph must have an object value.\n * 3. All edges in the graph must have \"minlen\" and \"weight\" attributes.\n *\n * Postconditions:\n *\n * 1. All nodes in the graph will have an assigned \"rank\" attribute that has\n * been optimized by the network simplex algorithm. Ranks start at 0.\n *\n *\n * A rough sketch of the algorithm is as follows:\n *\n * 1. Assign initial ranks to each node. We use the longest path algorithm,\n * which assigns ranks to the lowest position possible. In general this\n * leads to very wide bottom ranks and unnecessarily long edges.\n * 2. Construct a feasible tight tree. A tight tree is one such that all\n * edges in the tree have no slack (difference between length of edge\n * and minlen for the edge). This by itself greatly improves the assigned\n * rankings by shorting edges.\n * 3. Iteratively find edges that have negative cut values. Generally a\n * negative cut value indicates that the edge could be removed and a new\n * tree edge could be added to produce a more compact graph.\n *\n * Much of the algorithms here are derived from Gansner, et al., \"A Technique\n * for Drawing Directed Graphs.\" The structure of the file roughly follows the\n * structure of the overall algorithm.\n */\nvar networkSimplex = function (og) {\n var g = (0, util_2.simplify)(og);\n (0, util_1.longestPath)(g);\n var t = (0, feasible_tree_1.feasibleTree)(g);\n (0, exports.initLowLimValues)(t);\n (0, exports.initCutValues)(t, g);\n var e;\n var f;\n while ((e = (0, exports.leaveEdge)(t))) {\n f = (0, exports.enterEdge)(t, g, e);\n (0, exports.exchangeEdges)(t, g, e, f);\n }\n};\n/*\n * Initializes cut values for all edges in the tree.\n */\nvar initCutValues = function (t, g) {\n var vs = postorder(t, t.nodes());\n vs = vs === null || vs === void 0 ? void 0 : vs.slice(0, (vs === null || vs === void 0 ? void 0 : vs.length) - 1);\n vs === null || vs === void 0 ? void 0 : vs.forEach(function (v) {\n assignCutValue(t, g, v);\n });\n};\nexports.initCutValues = initCutValues;\nvar assignCutValue = function (t, g, child) {\n var childLab = t.node(child);\n var parent = childLab.parent;\n t.edgeFromArgs(child, parent).cutvalue = (0, exports.calcCutValue)(t, g, child);\n};\n/*\n * Given the tight tree, its graph, and a child in the graph calculate and\n * return the cut value for the edge between the child and its parent.\n */\nvar calcCutValue = function (t, g, child) {\n var _a;\n var childLab = t.node(child);\n var parent = childLab.parent;\n // True if the child is on the tail end of the edge in the directed graph\n var childIsTail = true;\n // The graph's view of the tree edge we're inspecting\n var graphEdge = g.edgeFromArgs(child, parent);\n // The accumulated cut value for the edge between this node and its parent\n var cutValue = 0;\n if (!graphEdge) {\n childIsTail = false;\n graphEdge = g.edgeFromArgs(parent, child);\n }\n cutValue = graphEdge.weight;\n (_a = g.nodeEdges(child)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var isOutEdge = e.v === child;\n var other = isOutEdge ? e.w : e.v;\n if (other !== parent) {\n var pointsToHead = isOutEdge === childIsTail;\n var otherWeight = g.edge(e).weight;\n cutValue += pointsToHead ? otherWeight : -otherWeight;\n if (isTreeEdge(t, child, other)) {\n var otherCutValue = t.edgeFromArgs(child, other).cutvalue;\n cutValue += pointsToHead ? -otherCutValue : otherCutValue;\n }\n }\n });\n return cutValue;\n};\nexports.calcCutValue = calcCutValue;\nvar initLowLimValues = function (tree, root) {\n if (root === void 0) { root = tree.nodes()[0]; }\n dfsAssignLowLim(tree, {}, 1, root);\n};\nexports.initLowLimValues = initLowLimValues;\nvar dfsAssignLowLim = function (tree, visited, nextLim, v, parent) {\n var _a;\n var low = nextLim;\n var useNextLim = nextLim;\n var label = tree.node(v);\n visited[v] = true;\n (_a = tree.neighbors(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (w) {\n if (!visited[w]) {\n useNextLim = dfsAssignLowLim(tree, visited, useNextLim, w, v);\n }\n });\n label.low = low;\n label.lim = useNextLim++;\n if (parent) {\n label.parent = parent;\n }\n else {\n // TODO should be able to remove this when we incrementally update low lim\n delete label.parent;\n }\n return useNextLim;\n};\nvar leaveEdge = function (tree) {\n return tree.edges().find(function (e) {\n return tree.edge(e).cutvalue < 0;\n });\n};\nexports.leaveEdge = leaveEdge;\nvar enterEdge = function (t, g, edge) {\n var v = edge.v;\n var w = edge.w;\n // For the rest of this function we assume that v is the tail and w is the\n // head, so if we don't have this edge in the graph we should flip it to\n // match the correct orientation.\n if (!g.hasEdge(v, w)) {\n v = edge.w;\n w = edge.v;\n }\n var vLabel = t.node(v);\n var wLabel = t.node(w);\n var tailLabel = vLabel;\n var flip = false;\n // If the root is in the tail of the edge then we need to flip the logic that\n // checks for the head and tail nodes in the candidates function below.\n if (vLabel.lim > wLabel.lim) {\n tailLabel = wLabel;\n flip = true;\n }\n var candidates = g.edges().filter(function (edge) {\n return flip === isDescendant(t, t.node(edge.v), tailLabel) &&\n flip !== isDescendant(t, t.node(edge.w), tailLabel);\n });\n return (0, util_2.minBy)(candidates, function (edge) { return (0, util_1.slack)(g, edge); });\n};\nexports.enterEdge = enterEdge;\nvar exchangeEdges = function (t, g, e, f) {\n var v = e.v;\n var w = e.w;\n t.removeEdge(v, w);\n t.setEdge(f.v, f.w, {});\n (0, exports.initLowLimValues)(t);\n (0, exports.initCutValues)(t, g);\n updateRanks(t, g);\n};\nexports.exchangeEdges = exchangeEdges;\nvar updateRanks = function (t, g) {\n var root = t.nodes().find(function (v) { var _a; return !((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.parent); });\n var vs = preorder(t, root);\n vs = vs === null || vs === void 0 ? void 0 : vs.slice(1);\n vs === null || vs === void 0 ? void 0 : vs.forEach(function (v) {\n var parent = t.node(v).parent;\n var edge = g.edgeFromArgs(v, parent);\n var flipped = false;\n if (!edge) {\n edge = g.edgeFromArgs(parent, v);\n flipped = true;\n }\n g.node(v).rank = g.node(parent).rank + (flipped ? edge.minlen : -edge.minlen);\n });\n};\n/*\n * Returns true if the edge is in the tree.\n */\nvar isTreeEdge = function (tree, u, v) {\n return tree.hasEdge(u, v);\n};\n/*\n * Returns true if the specified node is descendant of the root node per the\n * assigned low and lim attributes in the tree.\n */\nvar isDescendant = function (tree, vLabel, rootLabel) {\n return rootLabel.low <= vLabel.lim && vLabel.lim <= rootLabel.lim;\n};\nexports.default = networkSimplex;\n//# sourceMappingURL=network-simplex.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/rank/network-simplex.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n\nvar isDecimal = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 1 !== 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isDecimal);\n//# sourceMappingURL=is-decimal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-decimal.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-element.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-element.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.slack = exports.longestPathWithLayer = exports.longestPath = void 0;\n/*\n * Initializes ranks for the input graph using the longest path algorithm. This\n * algorithm scales well and is fast in practice, it yields rather poor\n * solutions. Nodes are pushed to the lowest layer possible, leaving the bottom\n * ranks wide and leaving edges longer than necessary. However, due to its\n * speed, this algorithm is good for getting an initial ranking that can be fed\n * into other algorithms.\n *\n * This algorithm does not normalize layers because it will be used by other\n * algorithms in most cases. If using this algorithm directly, be sure to\n * run normalize at the end.\n *\n * Pre-conditions:\n *\n * 1. Input graph is a DAG.\n * 2. Input graph node labels can be assigned properties.\n *\n * Post-conditions:\n *\n * 1. Each node will be assign an (unnormalized) \"rank\" property.\n */\nvar longestPath = function (g) {\n var _a;\n var visited = {};\n var dfs = function (v) {\n var _a;\n var label = g.node(v);\n if (visited[v]) {\n return label.rank;\n }\n visited[v] = true;\n var rank;\n (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (edgeObj) {\n var wRank = dfs(edgeObj.w);\n var minLen = g.edge(edgeObj).minlen;\n var r = wRank - minLen;\n if (r) {\n if (rank === undefined || r < rank) {\n rank = r;\n }\n }\n });\n if (!rank) {\n rank = 0;\n }\n label.rank = rank;\n return rank;\n };\n (_a = g.sources()) === null || _a === void 0 ? void 0 : _a.forEach(function (source) { return dfs(source); });\n};\nexports.longestPath = longestPath;\nvar longestPathWithLayer = function (g) {\n var _a;\n // 用longest path,找出最深的点\n var visited = {};\n var minRank;\n var dfs = function (v) {\n var _a;\n var label = g.node(v);\n if (visited[v]) {\n return label.rank;\n }\n visited[v] = true;\n var rank;\n (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (edgeObj) {\n var wRank = dfs(edgeObj.w);\n var minLen = g.edge(edgeObj).minlen;\n var r = wRank - minLen;\n if (r) {\n if (rank === undefined || r < rank) {\n rank = r;\n }\n }\n });\n if (!rank) {\n rank = 0;\n }\n if (minRank === undefined || rank < minRank) {\n minRank = rank;\n }\n label.rank = rank;\n return rank;\n };\n (_a = g.sources()) === null || _a === void 0 ? void 0 : _a.forEach(function (source) { return dfs(source); });\n if (minRank === undefined) {\n minRank = 0;\n }\n // minRank += 1; // NOTE: 最小的层级是dummy root,+1\n // forward一遍,赋值层级\n var dfsForward = function (v, nextRank) {\n var _a;\n var label = g.node(v);\n var currRank = (!isNaN(label.layer) ? label.layer : nextRank);\n // 没有指定,取最大值\n if (label.rank === undefined || label.rank < currRank) {\n label.rank = currRank;\n }\n // DFS遍历子节点\n (_a = g.outEdges(v)) === null || _a === void 0 ? void 0 : _a.map(function (e) {\n dfsForward(e.w, currRank + g.edge(e).minlen);\n });\n };\n // 指定层级的,更新下游\n g.nodes().forEach(function (n) {\n var label = g.node(n);\n if (!isNaN(label.layer)) {\n dfsForward(n, label.layer); // 默认的dummy root所在层的rank是-1\n }\n else {\n label.rank -= minRank;\n }\n });\n};\nexports.longestPathWithLayer = longestPathWithLayer;\n/*\n * Returns the amount of slack for the given edge. The slack is defined as the\n * difference between the length of the edge and its minimum length.\n */\nvar slack = function (g, e) {\n return (g.node(e.w).rank -\n g.node(e.v).rank -\n g.edge(e).minlen);\n};\nexports.slack = slack;\nexports.default = {\n longestPath: longestPath,\n longestPathWithLayer: longestPathWithLayer,\n slack: slack,\n};\n//# sourceMappingURL=util.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/rank/util.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 判断是否HTML元素\n * @return {Boolean} 是否HTML元素\n */\nvar isElement = function (o) {\n return o instanceof Element || o instanceof Document;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isElement);\n//# sourceMappingURL=is-element.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-element.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagre/src/util.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagre/src/util.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-empty.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-empty.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.minBy = exports.notime = exports.time = exports.partition = exports.maxRank = exports.addBorderNode = exports.removeEmptyRanks = exports.normalizeRanks = exports.buildLayerMatrix = exports.intersectRect = exports.predecessorWeights = exports.successorWeights = exports.zipObject = exports.asNonCompoundGraph = exports.simplify = exports.addDummyNode = void 0;\nvar util_1 = __webpack_require__(/*! ../../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar graph_1 = __webpack_require__(/*! ../graph */ \"./node_modules/@antv/layout/lib/layout/dagre/graph.js\");\nvar safeSort = function (valueA, valueB) {\n return Number(valueA) - Number(valueB);\n};\n/*\n * Adds a dummy node to the graph and return v.\n */\nvar addDummyNode = function (g, type, attrs, name) {\n var v;\n do {\n v = \"\".concat(name).concat(Math.random());\n } while (g.hasNode(v));\n attrs.dummy = type;\n g.setNode(v, attrs);\n return v;\n};\nexports.addDummyNode = addDummyNode;\n/*\n * Returns a new graph with only simple edges. Handles aggregation of data\n * associated with multi-edges.\n */\nvar simplify = function (g) {\n var simplified = new graph_1.Graph().setGraph(g.graph());\n g.nodes().forEach(function (v) { simplified.setNode(v, g.node(v)); });\n g.edges().forEach(function (e) {\n var simpleLabel = simplified.edgeFromArgs(e.v, e.w) || { weight: 0, minlen: 1 };\n var label = g.edge(e);\n simplified.setEdge(e.v, e.w, {\n weight: simpleLabel.weight + label.weight,\n minlen: Math.max(simpleLabel.minlen, label.minlen)\n });\n });\n return simplified;\n};\nexports.simplify = simplify;\nvar asNonCompoundGraph = function (g) {\n var simplified = new graph_1.Graph({ multigraph: g.isMultigraph() }).setGraph(g.graph());\n g.nodes().forEach(function (node) {\n var _a;\n if (!((_a = g.children(node)) === null || _a === void 0 ? void 0 : _a.length)) {\n simplified.setNode(node, g.node(node));\n }\n });\n g.edges().forEach(function (edge) {\n simplified.setEdgeObj(edge, g.edge(edge));\n });\n return simplified;\n};\nexports.asNonCompoundGraph = asNonCompoundGraph;\nvar zipObject = function (keys, values) {\n return keys === null || keys === void 0 ? void 0 : keys.reduce(function (obj, key, i) {\n obj[key] = values[i];\n return obj;\n }, {});\n};\nexports.zipObject = zipObject;\nvar successorWeights = function (g) {\n var weightsMap = {};\n g.nodes().forEach(function (node) {\n var _a;\n var sucs = {};\n (_a = g.outEdges(node)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n var _a;\n sucs[e.w] = (sucs[e.w] || 0) + (((_a = g.edge(e)) === null || _a === void 0 ? void 0 : _a.weight) || 0);\n });\n weightsMap[node] = sucs;\n });\n return weightsMap;\n};\nexports.successorWeights = successorWeights;\nvar predecessorWeights = function (g) {\n var nodes = g.nodes();\n var weightMap = nodes.map(function (v) {\n var _a;\n var preds = {};\n (_a = g.inEdges(v)) === null || _a === void 0 ? void 0 : _a.forEach(function (e) {\n preds[e.v] = (preds[e.v] || 0) + g.edge(e).weight;\n });\n return preds;\n });\n return (0, exports.zipObject)(nodes, weightMap);\n};\nexports.predecessorWeights = predecessorWeights;\n/*\n * Finds where a line starting at point ({x, y}) would intersect a rectangle\n * ({x, y, width, height}) if it were pointing at the rectangle's center.\n */\nvar intersectRect = function (rect, point) {\n var x = Number(rect.x);\n var y = Number(rect.y);\n // Rectangle intersection algorithm from:\n // http://math.stackexchange.com/questions/108113/find-edge-between-two-boxes\n var dx = Number(point.x) - x;\n var dy = Number(point.y) - y;\n var w = Number(rect.width) / 2;\n var h = Number(rect.height) / 2;\n if (!dx && !dy) {\n // completely overlapped directly, then return points its self\n return { x: 0, y: 0 };\n }\n var sx;\n var sy;\n if (Math.abs(dy) * w > Math.abs(dx) * h) {\n // Intersection is top or bottom of rect.\n if (dy < 0) {\n h = -h;\n }\n sx = (h * dx) / dy;\n sy = h;\n }\n else {\n // Intersection is left or right of rect.\n if (dx < 0) {\n w = -w;\n }\n sx = w;\n sy = (w * dy) / dx;\n }\n return { x: x + sx, y: y + sy };\n};\nexports.intersectRect = intersectRect;\n/*\n * Given a DAG with each node assigned \"rank\" and \"order\" properties, this\n * const will produce a matrix with the ids of each node.\n */\nvar buildLayerMatrix = function (g) {\n var layeringNodes = [];\n var rankMax = (0, exports.maxRank)(g) + 1;\n for (var i = 0; i < rankMax; i++) {\n layeringNodes.push([]);\n }\n // const layering = _.map(_.range(maxRank(g) + 1), function() { return []; });\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n var rank = node.rank;\n if (rank !== undefined && layeringNodes[rank]) {\n layeringNodes[rank].push(v);\n }\n });\n for (var i = 0; i < rankMax; i++) {\n layeringNodes[i] = layeringNodes[i].sort(function (va, vb) { var _a, _b; return safeSort((_a = g.node(va)) === null || _a === void 0 ? void 0 : _a.order, (_b = g.node(vb)) === null || _b === void 0 ? void 0 : _b.order); });\n }\n return layeringNodes;\n};\nexports.buildLayerMatrix = buildLayerMatrix;\n/*\n * Adjusts the ranks for all nodes in the graph such that all nodes v have\n * rank(v) >= 0 and at least one node w has rank(w) = 0.\n */\nvar normalizeRanks = function (g) {\n var nodeRanks = g\n .nodes()\n .filter(function (v) { var _a; return ((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.rank) !== undefined; })\n .map(function (v) { return g.node(v).rank; });\n var min = Math.min.apply(Math, nodeRanks);\n g.nodes().forEach(function (v) {\n var node = g.node(v);\n if (node.hasOwnProperty(\"rank\") && min !== Infinity) {\n node.rank -= min;\n }\n });\n};\nexports.normalizeRanks = normalizeRanks;\nvar removeEmptyRanks = function (g) {\n // Ranks may not start at 0, so we need to offset them\n var nodes = g.nodes();\n var nodeRanks = nodes\n .filter(function (v) { var _a; return ((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.rank) !== undefined; })\n .map(function (v) { return g.node(v).rank; });\n var offset = Math.min.apply(Math, nodeRanks);\n var layers = [];\n nodes.forEach(function (v) {\n var _a;\n var rank = (((_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.rank) || 0) - offset;\n if (!layers[rank]) {\n layers[rank] = [];\n }\n layers[rank].push(v);\n });\n var delta = 0;\n var nodeRankFactor = g.graph().nodeRankFactor || 0;\n for (var i = 0; i < layers.length; i++) {\n var vs = layers[i];\n if (vs === undefined) {\n if (i % nodeRankFactor !== 0) {\n delta -= 1;\n }\n }\n else if (delta) {\n vs === null || vs === void 0 ? void 0 : vs.forEach(function (v) {\n var node = g.node(v);\n if (node) {\n node.rank = node.rank || 0;\n node.rank += delta;\n }\n });\n }\n }\n};\nexports.removeEmptyRanks = removeEmptyRanks;\nvar addBorderNode = function (g, prefix, rank, order) {\n var node = {\n width: 0,\n height: 0\n };\n if ((0, util_1.isNumber)(rank) && (0, util_1.isNumber)(order)) {\n node.rank = rank;\n node.order = order;\n }\n return (0, exports.addDummyNode)(g, \"border\", node, prefix);\n};\nexports.addBorderNode = addBorderNode;\nvar maxRank = function (g) {\n var maxRank;\n g.nodes().forEach(function (v) {\n var _a;\n var rank = (_a = g.node(v)) === null || _a === void 0 ? void 0 : _a.rank;\n if (rank !== undefined) {\n if (maxRank === undefined || rank > maxRank) {\n maxRank = rank;\n }\n }\n });\n if (!maxRank) {\n maxRank = 0;\n }\n return maxRank;\n};\nexports.maxRank = maxRank;\n/*\n * Partition a collection into two groups: `lhs` and `rhs`. If the supplied\n * const returns true for an entry it goes into `lhs`. Otherwise it goes\n * into `rhs.\n */\nvar partition = function (collection, fn) {\n var result = { lhs: [], rhs: [] };\n collection === null || collection === void 0 ? void 0 : collection.forEach(function (value) {\n if (fn(value)) {\n result.lhs.push(value);\n }\n else {\n result.rhs.push(value);\n }\n });\n return result;\n};\nexports.partition = partition;\n/*\n * Returns a new const that wraps `fn` with a timer. The wrapper logs the\n * time it takes to execute the function.\n */\nvar time = function (name, fn) {\n var start = Date.now();\n try {\n return fn();\n }\n finally {\n console.log(\"\".concat(name, \" time: \").concat(Date.now() - start, \"ms\"));\n }\n};\nexports.time = time;\nvar notime = function (name, fn) {\n return fn();\n};\nexports.notime = notime;\nvar minBy = function (array, func) {\n return array.reduce(function (a, b) {\n var valA = func(a);\n var valB = func(b);\n return valA > valB ? b : a;\n });\n};\nexports.minBy = minBy;\n//# sourceMappingURL=util.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagre/src/util.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n/* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/get-type.js\");\n/* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-prototype */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-prototype.js\");\n\n\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction isEmpty(value) {\n /**\n * isEmpty(null) => true\n * isEmpty() => true\n * isEmpty(true) => true\n * isEmpty(1) => true\n * isEmpty([1, 2, 3]) => false\n * isEmpty('abc') => false\n * isEmpty({ a: 1 }) => false\n */\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n return true;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n return !value.length;\n }\n var type = Object(_get_type__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(value);\n if (type === 'Map' || type === 'Set') {\n return !value.size;\n }\n if (Object(_is_prototype__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(value)) {\n return !Object.keys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEmpty);\n//# sourceMappingURL=is-empty.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-empty.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/dagreCompound.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/dagreCompound.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal-with.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal-with.js ***! + \***************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.DagreCompoundLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar dagre_compound_1 = __webpack_require__(/*! dagre-compound */ \"./node_modules/dagre-compound/dist/dagre-compound.es5.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar DagreCompoundLayout = /** @class */ (function (_super) {\n __extends(DagreCompoundLayout, _super);\n function DagreCompoundLayout(options) {\n var _this = _super.call(this) || this;\n /** layout 方向, 可选 TB, BT, LR, RL */\n _this.rankdir = 'TB';\n /** 节点水平间距(px) */\n _this.nodesep = 50;\n /** 边水平间距(px) */\n _this.edgesep = 5;\n /** 每一层节点之间间距 */\n _this.ranksep = 50;\n /** 是否保留布局连线的控制点 */\n _this.controlPoints = true;\n /** 是否保留使用布局计算的锚点 */\n _this.anchorPoint = true;\n _this.nodes = [];\n _this.edges = [];\n _this.combos = [];\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n DagreCompoundLayout.prototype.getDefaultCfg = function () {\n return {\n rankdir: 'TB',\n align: undefined,\n begin: undefined,\n nodeSize: undefined,\n nodesep: 50,\n ranksep: 50,\n controlPoints: true,\n anchorPoint: true // 是否使用布局计算的锚点\n };\n };\n DagreCompoundLayout.prototype.init = function (data) {\n var hiddenNodes = data.hiddenNodes || []; // 被隐藏的节点\n var hiddenEdges = data.hiddenEdges || []; // 被隐藏的边\n var hiddenCombos = data.hiddenCombos || []; // 赋值 hiddenCombos\n // 确保此次排序按照用户输入顺序\n this.nodes = this.getDataByOrder((data.nodes || []).concat(hiddenNodes));\n this.edges = this.getDataByOrder((data.edges || []).concat(hiddenEdges));\n this.combos = (data.combos || []).concat(hiddenCombos.map(function (hc) { return (__assign(__assign({}, hc), { collapsed: true })); }));\n };\n DagreCompoundLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes, edges = self.edges;\n if (!nodes)\n return;\n var _a = self.getLayoutConfig(), graphDef = _a.graphDef, graphOption = _a.graphOption, graphSettings = _a.graphSettings;\n var renderInfo = (0, dagre_compound_1.buildGraph)(graphDef, graphOption, graphSettings);\n var flattenedRenderInfo = (0, dagre_compound_1.flatGraph)(renderInfo, true); // 打平数据进行遍历\n this.updatePosition(flattenedRenderInfo);\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n };\n /**\n * combo 模式下查找节点完整路径\n * @param nodeId\n * @private\n */\n DagreCompoundLayout.prototype.getNodePath = function (nodeId) {\n var self = this;\n var nodes = self.nodes, combos = self.combos;\n var targetNode = nodes.find(function (n) { return n.id === nodeId; });\n var findPath = function (comboId, fullPath) {\n if (fullPath === void 0) { fullPath = []; }\n var combo = combos.find(function (c) { return c.id === comboId; });\n if (combo) {\n fullPath.unshift(comboId);\n if (combo.parentId) {\n return findPath(combo.parentId, fullPath);\n }\n return fullPath;\n }\n return fullPath;\n };\n if (targetNode && targetNode.comboId) {\n return findPath(targetNode.comboId, [nodeId]);\n }\n return [nodeId];\n };\n /** 准备 dagre-compound 布局参数 */\n DagreCompoundLayout.prototype.getLayoutConfig = function () {\n var _a, _b, _c;\n var self = this;\n var nodes = self.nodes, edges = self.edges, combos = self.combos, nodeSize = self.nodeSize, rankdir = self.rankdir, align = self.align, edgesep = self.edgesep, nodesep = self.nodesep, ranksep = self.ranksep, settings = self.settings;\n var compound = (combos || []).reduce(function (pre, cur) {\n var matchedNodes = nodes.filter(function (n) { return n.comboId === cur.id; }).map(function (n) { return n.id; });\n var matchedCombos = (combos || []).filter(function (n) { return n.parentId === cur.id; }).map(function (n) { return n.id; });\n if (matchedNodes.length || matchedCombos.length) {\n pre[cur.id] = __spreadArray(__spreadArray([], matchedNodes, true), matchedCombos, true);\n }\n return pre;\n }, {});\n /** 计算 nodeSize */\n var nodeSizeFunc;\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d && d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return d.size;\n }\n if ((0, util_1.isObject)(d.size)) {\n return [d.size.width || 40, d.size.height || 40];\n }\n return [d.size, d.size];\n }\n return [40, 40];\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function () { return nodeSize; };\n }\n else {\n nodeSizeFunc = function () { return [nodeSize, nodeSize]; };\n }\n /** 计算 comboSize */\n var comboSizeFunc = function (d) {\n if (d && d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return d.size;\n }\n return [d.size, d.size];\n }\n return [80, 40];\n };\n // 接受 defaultCombo 设置的 size\n var _d = comboSizeFunc(combos === null || combos === void 0 ? void 0 : combos[0]), metaWidth = _d[0], metaHeight = _d[1];\n // 初始化 padding\n var subSceneMeta = (_b = (_a = self.graphSettings) === null || _a === void 0 ? void 0 : _a.subScene) === null || _b === void 0 ? void 0 : _b.meta;\n var _e = ((_c = combos.find(function (c) { return !c.collapsed; })) === null || _c === void 0 ? void 0 : _c.padding) || [20, 20, 20, 20], paddingTop = _e[0], paddingRight = _e[1], paddingBottom = _e[2], paddingLeft = _e[3];\n var graphDef = {\n compound: compound,\n nodes: __spreadArray([], (nodes || []).map(function (n) {\n var size = nodeSizeFunc(n);\n var width = size[0];\n var height = size[1];\n return __assign(__assign({}, n), { width: width, height: height });\n }), true),\n edges: __spreadArray([], (edges || []).map(function (e) { return (__assign(__assign({}, e), { v: e.source, w: e.target })); }), true)\n };\n // 需要展开的节点\n var graphOption = {\n expanded: (combos || []).filter(function (c) { return !c.collapsed; }).map(function (c) { return c.id; })\n };\n // dagre-compound 布局参数\n var graphMetaConfig = {\n graph: {\n meta: {\n align: align,\n rankDir: rankdir,\n nodeSep: nodesep,\n edgeSep: edgesep,\n rankSep: ranksep\n }\n },\n subScene: {\n meta: {\n paddingTop: paddingTop || (subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingTop) || 20,\n paddingRight: paddingRight || (subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingRight) || 20,\n paddingBottom: paddingBottom || (subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingBottom) || 20,\n paddingLeft: paddingLeft || (subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingLeft) || 20,\n labelHeight: 0\n }\n },\n nodeSize: {\n meta: {\n width: metaWidth,\n height: metaHeight\n }\n }\n };\n // 合并用户输入的内容\n var graphSettings = (0, dagre_compound_1.mergeConfig)(settings, __assign({}, (0, dagre_compound_1.mergeConfig)(graphMetaConfig, dagre_compound_1.LAYOUT_CONFIG)));\n self.graphSettings = graphSettings;\n return {\n graphDef: graphDef,\n graphOption: graphOption,\n graphSettings: graphSettings\n };\n };\n /** 更新节点与边位置 */\n DagreCompoundLayout.prototype.updatePosition = function (flattenedGraph) {\n var nodes = flattenedGraph.nodes, edges = flattenedGraph.edges;\n this.updateNodePosition(nodes, edges);\n this.updateEdgePosition(nodes, edges);\n };\n DagreCompoundLayout.prototype.getBegin = function (flattenedNodes, flattenedEdges) {\n var self = this;\n var begin = self.begin;\n var dBegin = [0, 0];\n if (begin) {\n var minX_1 = Infinity;\n var minY_1 = Infinity;\n flattenedNodes.forEach(function (node) {\n if (minX_1 > node.x)\n minX_1 = node.x;\n if (minY_1 > node.y)\n minY_1 = node.y;\n });\n flattenedEdges.forEach(function (edge) {\n edge.points.forEach(function (point) {\n if (minX_1 > point.x)\n minX_1 = point.x;\n if (minY_1 > point.y)\n minY_1 = point.y;\n });\n });\n dBegin[0] = begin[0] - minX_1;\n dBegin[1] = begin[1] - minY_1;\n }\n return dBegin;\n };\n DagreCompoundLayout.prototype.updateNodePosition = function (flattenedNodes, flattenedEdges) {\n var self = this;\n var combos = self.combos, nodes = self.nodes, edges = self.edges, anchorPoint = self.anchorPoint, graphSettings = self.graphSettings;\n var dBegin = this.getBegin(flattenedNodes, flattenedEdges);\n flattenedNodes.forEach(function (node) {\n var _a;\n var x = node.x, y = node.y, id = node.id, type = node.type, coreBox = node.coreBox;\n if (type === dagre_compound_1.HierarchyNodeType.META && id !== dagre_compound_1.ROOT_NAME) {\n var i = combos.findIndex(function (item) { return item.id === id; });\n var subSceneMeta = (_a = graphSettings === null || graphSettings === void 0 ? void 0 : graphSettings.subScene) === null || _a === void 0 ? void 0 : _a.meta;\n // 将布局生成的 combo 位置暂存至 offsetX offsetY\n combos[i].offsetX = x + dBegin[0];\n combos[i].offsetY = y + dBegin[1];\n combos[i].fixSize = [coreBox.width, coreBox.height];\n combos[i].fixCollapseSize = [coreBox.width, coreBox.height];\n // 如果设置了收起时隐藏 padding,则手动优化 combo padding 信息,展开的话则恢复\n if (!node.expanded) {\n combos[i].padding = [0, 0, 0, 0];\n }\n else {\n combos[i].padding = [\n subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingTop,\n subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingRight,\n subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingBottom,\n subSceneMeta === null || subSceneMeta === void 0 ? void 0 : subSceneMeta.paddingLeft\n ];\n }\n }\n else if (type === dagre_compound_1.HierarchyNodeType.OP) {\n var i = nodes.findIndex(function (item) { return item.id === id; });\n nodes[i].x = x + dBegin[0];\n nodes[i].y = y + dBegin[1];\n if (anchorPoint) {\n var anchorPoints_1 = [];\n var outEdges = flattenedEdges.filter(function (e) { return e.v === id; });\n var inEdges = flattenedEdges.filter(function (e) { return e.w === id; });\n // 指定出边锚点,锚点中心点为 [0.5, 0.5]\n if (outEdges.length > 0) {\n outEdges.forEach(function (outEdge) {\n var firstPoint = outEdge.points[0];\n var anchorPointX = (firstPoint.x - x) / node.width + 0.5;\n var anchorPointY = (firstPoint.y - y) / node.height + 0.5;\n anchorPoints_1.push([anchorPointX, anchorPointY]);\n // 出边对应 source 边锚点\n outEdge.baseEdgeList.forEach(function (baseEdge) {\n var edge = edges.find(function (e) { return e.source === baseEdge.v && e.target === baseEdge.w; });\n if (edge) {\n edge.sourceAnchor = anchorPoints_1.length - 1;\n }\n });\n });\n }\n // 指定入边锚点\n if (inEdges.length > 0) {\n inEdges.forEach(function (inEdge) {\n var lastPoint = inEdge.points[inEdge.points.length - 1];\n var anchorPointX = (lastPoint.x - x) / node.width + 0.5;\n var anchorPointY = (lastPoint.y - y) / node.height + 0.5;\n anchorPoints_1.push([anchorPointX, anchorPointY]);\n // 出边对应 source 锚点\n inEdge.baseEdgeList.forEach(function (baseEdge) {\n var edge = edges.find(function (e) { return e.source === baseEdge.v && e.target === baseEdge.w; });\n if (edge) {\n edge.targetAnchor = anchorPoints_1.length - 1;\n }\n });\n });\n }\n nodes[i].anchorPoints = anchorPoints_1.length > 0 ? anchorPoints_1 : nodes[i].anchorPoints || [];\n }\n }\n });\n };\n DagreCompoundLayout.prototype.updateEdgePosition = function (flattenedNodes, flattenedEdges) {\n var self = this;\n var combos = self.combos, edges = self.edges, controlPoints = self.controlPoints;\n var dBegin = this.getBegin(flattenedNodes, flattenedEdges);\n if (controlPoints) {\n combos.forEach(function (combo) {\n combo.inEdges = [];\n combo.outEdges = [];\n });\n edges.forEach(function (sourceEdge) {\n var _a, _b, _c, _d;\n var sourceNode = flattenedNodes.find(function (v) { return v.id === sourceEdge.source; });\n var targetNode = flattenedNodes.find(function (v) { return v.id === sourceEdge.target; });\n // Combo 收起状态,dagre-compound 不会渲染该节点,边需要使用到 group 的边作为补充\n var points = [];\n var sortedEdges = [];\n if (sourceNode && targetNode) {\n sortedEdges = (0, dagre_compound_1.getEdges)(sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.id, targetNode === null || targetNode === void 0 ? void 0 : targetNode.id, flattenedNodes);\n }\n else if (!sourceNode || !targetNode) {\n /** 存在收起节点时,需要重新计算边的 controlPoints,确保线正常 */\n // 情况1:目标节点被收起了,向上寻找该节点最近一个存在的父节点\n var sourceNodePath = self.getNodePath(sourceEdge.source);\n var targetNodePath = self.getNodePath(sourceEdge.target);\n var lastExistingSource_1 = sourceNodePath\n .reverse()\n .slice(!sourceNode ? 1 : 0)\n .find(function (parentId) { return flattenedNodes.find(function (fNode) { return fNode.id === parentId; }); });\n var lastExistingTarget_1 = targetNodePath\n .reverse()\n .slice(!targetNode ? 1 : 0)\n .find(function (parentId) { return flattenedNodes.find(function (fNode) { return fNode.id === parentId; }); });\n sourceNode = flattenedNodes.find(function (v) { return v.id === lastExistingSource_1; });\n targetNode = flattenedNodes.find(function (v) { return v.id === lastExistingTarget_1; });\n sortedEdges = (0, dagre_compound_1.getEdges)(sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.id, targetNode === null || targetNode === void 0 ? void 0 : targetNode.id, flattenedNodes, { v: sourceEdge.source, w: sourceEdge.target });\n }\n points = sortedEdges.reduce(function (pre, cur) {\n return __spreadArray(__spreadArray([], pre, true), cur.points.map(function (p) {\n return __assign(__assign({}, p), { x: p.x + dBegin[0], y: p.y + dBegin[1] });\n }), true);\n }, []);\n // 取消首尾节点\n points = points.slice(1, -1);\n sourceEdge.controlPoints = points;\n if ((targetNode === null || targetNode === void 0 ? void 0 : targetNode.type) === dagre_compound_1.NodeType.META) {\n // combo 节点控制点\n var i = combos.findIndex(function (item) { return item.id === (targetNode === null || targetNode === void 0 ? void 0 : targetNode.id); });\n if (!combos[i] || ((_a = combos[i].inEdges) === null || _a === void 0 ? void 0 : _a.some(function (inEdge) { return inEdge.source === sourceNode.id && inEdge.target === targetNode.id; }))) {\n return;\n }\n (_b = combos[i].inEdges) === null || _b === void 0 ? void 0 : _b.push({\n source: sourceNode.id,\n target: targetNode.id,\n controlPoints: points\n });\n }\n if ((sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.type) === dagre_compound_1.NodeType.META) {\n var i = combos.findIndex(function (item) { return item.id === (sourceNode === null || sourceNode === void 0 ? void 0 : sourceNode.id); });\n if (!combos[i] || ((_c = combos[i].outEdges) === null || _c === void 0 ? void 0 : _c.some(function (oedge) { return oedge.source === sourceNode.id && oedge.target === targetNode.id; }))) {\n return;\n }\n (_d = combos[i].outEdges) === null || _d === void 0 ? void 0 : _d.push({\n source: sourceNode.id,\n target: targetNode.id,\n controlPoints: points\n });\n }\n });\n }\n };\n DagreCompoundLayout.prototype.getType = function () {\n return 'dagreCompound';\n };\n /**\n * 确保布局使用的数据与用户输入数据顺序一致\n * 通过 layoutOrder 排序 节点 与 边\n * @param list\n * @private\n */\n DagreCompoundLayout.prototype.getDataByOrder = function (list) {\n if (list.every(function (n) { return n.layoutOrder !== undefined; })) {\n // 所有数据均设置过索引,表示仅布局,数据未变化,无需处理\n }\n else {\n // 首次布局或动态添加删减节点时重新赋值\n list.forEach(function (n, i) {\n n.layoutOrder = i;\n });\n }\n // 按照 layoutOrder 排序\n return list.sort(function (pre, cur) { return pre.layoutOrder - cur.layoutOrder; });\n };\n return DagreCompoundLayout;\n}(base_1.Base));\nexports.DagreCompoundLayout = DagreCompoundLayout;\n//# sourceMappingURL=dagreCompound.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/dagreCompound.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n/* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-equal */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal.js\");\n\n\n/**\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [fn] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * isEqualWith(array, other, customizer); // => true\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value, other, fn) {\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(fn)) {\n return Object(_is_equal__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value, other);\n }\n return !!fn(value, other);\n});\n//# sourceMappingURL=is-equal-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal-with.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/er/core.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/er/core.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar d3Force = __importStar(__webpack_require__(/*! d3-force */ \"./node_modules/@antv/layout/node_modules/d3-force/src/index.js\"));\nvar forceGrid_1 = __importDefault(__webpack_require__(/*! ./forceGrid */ \"./node_modules/@antv/layout/lib/layout/er/forceGrid.js\"));\nvar mysqlWorkbench_1 = __importDefault(__webpack_require__(/*! ./mysqlWorkbench */ \"./node_modules/@antv/layout/lib/layout/er/mysqlWorkbench.js\"));\nvar dagre_1 = __webpack_require__(/*! ../dagre */ \"./node_modules/@antv/layout/lib/layout/dagre.js\");\nfunction layout(data, options) {\n var nodes = data.nodes, edges = data.edges;\n var width = options.width;\n var height = options.height;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return Promise.resolve();\n // 筛选非叶子节点,做Dagre布局\n var noLeafNodes = [];\n nodes.forEach(function (node) {\n var relateEdges = edges.filter(function (edge) {\n return edge.source === node.id || edge.target === node.id;\n });\n if (relateEdges.length > 1) {\n var temp = __assign({}, node);\n delete temp.size;\n noLeafNodes.push(temp);\n }\n });\n var noLeafEdge = [];\n edges.forEach(function (edge) {\n var sourceNode = noLeafNodes.find(function (node) { return node.id === edge.source; });\n var targetNode = noLeafNodes.find(function (node) { return node.id === edge.target; });\n if (sourceNode && targetNode) {\n noLeafEdge.push(edge);\n }\n });\n var graphLayout = new dagre_1.DagreLayout({\n type: 'dagre',\n ranksep: options.nodeMinGap,\n nodesep: options.nodeMinGap,\n });\n var nodesTmp = graphLayout.layout({\n nodes: noLeafNodes,\n edges: noLeafEdge,\n }).nodes;\n // 布局后,坐标同步\n nodes.forEach(function (n) {\n var found = (nodesTmp || []).find(function (temp) { return temp.id === n.id; });\n n.x = (found === null || found === void 0 ? void 0 : found.x) || width / 2;\n n.y = (found === null || found === void 0 ? void 0 : found.y) || height / 2;\n });\n var copyNodes = JSON.parse(JSON.stringify(nodes));\n var copyEdges = JSON.parse(JSON.stringify(edges));\n var simulation = d3Force.forceSimulation().nodes(copyNodes)\n .force(\"link\", d3Force.forceLink(copyEdges).id(function (d) { return d.id; }).distance(function (d) {\n var edgeInfo = noLeafEdge.find(function (edge) { return edge.source === d.source && edge.target === d.target; });\n if (edgeInfo) {\n return 30;\n }\n return 20;\n }))\n .force(\"charge\", d3Force.forceManyBody())\n .force(\"center\", d3Force.forceCenter(width / 2, height / 2))\n .force(\"x\", d3Force.forceX(width / 2))\n .force(\"y\", d3Force.forceY(height / 2))\n .alpha(0.3)\n .alphaDecay(0.08)\n .alphaMin(0.001);\n var layoutPromise = new Promise(function (resolve) {\n simulation.on('end', function () {\n // 坐标信息同步到nodes,edges中\n nodes.forEach(function (node) {\n var nodeInfo = copyNodes.find(function (item) { return item.id === node.id; });\n if (nodeInfo) {\n node.x = nodeInfo.x;\n node.y = nodeInfo.y;\n }\n });\n var minX = Math.min.apply(Math, nodes.map(function (node) { return node.x; }));\n var maxX = Math.max.apply(Math, nodes.map(function (node) { return node.x; }));\n var minY = Math.min.apply(Math, nodes.map(function (node) { return node.y; }));\n var maxY = Math.max.apply(Math, nodes.map(function (node) { return node.y; }));\n var scalex = width / (maxX - minX);\n var scaley = height / (maxY - minY);\n nodes.forEach(function (node) {\n if (node.x !== undefined && scalex < 1) {\n node.x = (node.x - minX) * scalex;\n }\n if (node.y !== undefined && scaley < 1) {\n node.y = (node.y - minY) * scaley;\n }\n });\n // 这一步就执行缩小空间。且不考虑节点size\n nodes.forEach(function (node) {\n node.sizeTemp = node.size;\n node.size = [10, 10];\n });\n (0, mysqlWorkbench_1.default)(nodes, edges);\n nodes.forEach(function (node) {\n node.size = node.sizeTemp || [];\n delete node.sizeTemp;\n });\n // 进行网格对齐+节点大小扩增\n (0, forceGrid_1.default)({\n nodes: nodes,\n edges: edges,\n }, options);\n resolve();\n });\n });\n return layoutPromise;\n}\nexports.default = layout;\n//# sourceMappingURL=core.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/core.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object-like.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js\");\n\n\n\nvar isEqual = function (value, other) {\n if (value === other) {\n return true;\n }\n if (!value || !other) {\n return false;\n }\n if (Object(_is_string__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(value) || Object(_is_string__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(other)) {\n return false;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value) || Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(other)) {\n if (value.length !== other.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < value.length; i++) {\n rst = isEqual(value[i], other[i]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n if (Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) || Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(other)) {\n var valueKeys = Object.keys(value);\n var otherKeys = Object.keys(other);\n if (valueKeys.length !== otherKeys.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < valueKeys.length; i++) {\n rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n return false;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEqual);\n//# sourceMappingURL=is-equal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-equal.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/er/forceGrid.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/er/forceGrid.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-error.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-error.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar grid_1 = __importDefault(__webpack_require__(/*! ./grid */ \"./node_modules/@antv/layout/lib/layout/er/grid.js\"));\nfunction layout(data, options) {\n if (!data.nodes || data.nodes.length === 0)\n return data;\n var width = options.width;\n var height = options.height;\n var nodeMinGap = options.nodeMinGap;\n // 2. 网格布局\n var CELL_W = 10000;\n var CELL_H = 10000;\n data.nodes.forEach(function (node) {\n var nodeWidth = node.size[0] || 50;\n var nodeHeight = node.size[1] || 50;\n CELL_W = Math.min(nodeWidth, CELL_W);\n CELL_H = Math.min(nodeHeight, CELL_H);\n });\n var grid = new grid_1.default();\n grid.init(width, height, {\n CELL_H: CELL_H,\n CELL_W: CELL_W,\n });\n data.nodes.forEach(function (d) {\n var gridpoint = grid.occupyNearest(d);\n if (gridpoint) {\n gridpoint.node = {\n id: d.id,\n size: d.size,\n };\n d.x = gridpoint.x;\n d.y = gridpoint.y;\n d.dx = gridpoint.dx;\n d.dy = gridpoint.dy;\n }\n });\n // 加入节点size\n for (var i = 0; i < data.nodes.length; i++) {\n // 节点宽度大于网格宽度,则往当前网格的右边插入列\n var node = data.nodes[i];\n var result = grid.findGridByNodeId(node.id);\n if (!result)\n throw new Error(\"can not find node cell\");\n var column = result.column, row = result.row;\n if ((node.size[0] + nodeMinGap) > CELL_W) {\n var addGridSize = Math.ceil((node.size[0] + nodeMinGap) / CELL_W) - 1;\n var realAdd = addGridSize;\n // 优化,假设同一列,不同行存在两个size为2的节点,遍历到第一个节点的时候,会往右插入两列,遍历到第二个节点,又往右插入。就会导致多余的网格\n for (var j = 0; j < addGridSize; j++) {\n var hasColumn = grid.additionColumn.indexOf(column + j + 1) > -1;\n if (hasColumn && !grid.cells[column + j + 1][row].node) {\n realAdd--;\n }\n else {\n break;\n }\n }\n grid.insertColumn(column, realAdd);\n }\n // 节点高度大于网格宽度,则往当前网格的下边插入行\n if ((node.size[1] + nodeMinGap) > CELL_H) {\n var addGridSize = Math.ceil((node.size[1] + nodeMinGap) / CELL_H) - 1;\n var realAdd = addGridSize;\n for (var j = 0; j < addGridSize; j++) {\n var hasColumn = grid.additionRow.indexOf(row + j + 1) > -1;\n if (hasColumn && !grid.cells[column][row + j + 1].node) {\n realAdd--;\n }\n else {\n break;\n }\n }\n grid.insertRow(row, realAdd);\n }\n }\n // 同步节点坐标\n for (var i = 0; i < grid.columnNum; i++) {\n var _loop_1 = function (j) {\n var cell = grid.cells[i][j];\n if (cell.node) {\n var node = data.nodes.find(function (node) { var _a; return node.id === ((_a = cell === null || cell === void 0 ? void 0 : cell.node) === null || _a === void 0 ? void 0 : _a.id); });\n if (node) {\n node.x = cell.x + node.size[0] / 2;\n node.y = cell.y + node.size[1] / 2;\n }\n }\n };\n for (var j = 0; j < grid.rowNum; j++) {\n _loop_1(j);\n }\n }\n}\nexports.default = layout;\n//# sourceMappingURL=forceGrid.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/forceGrid.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isError = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Error');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isError);\n//# sourceMappingURL=is-error.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-error.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/er/grid.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/er/grid.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-even.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-even.js ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Grid = /** @class */ (function () {\n function Grid() {\n this.cells = [];\n this.columnNum = 0;\n this.rowNum = 0;\n this.additionColumn = [];\n this.additionRow = [];\n }\n Grid.prototype.init = function (width, height, gridSize) {\n this.cells = [];\n this.CELL_W = gridSize.CELL_W || Grid.DEFAULT_CELL_W;\n this.CELL_H = gridSize.CELL_H || Grid.DEFAULT_CELL_H;\n this.columnNum = Math.ceil(width / this.CELL_W);\n this.rowNum = Math.ceil(height / this.CELL_H);\n Grid.MIN_DIST = Math.pow(width, 2) + Math.pow(height, 2);\n for (var i = 0; i < this.columnNum; i++) {\n var tmp = [];\n for (var j = 0; j < this.rowNum; j++) {\n var cell = {\n dx: i,\n dy: j,\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: false\n };\n tmp.push(cell);\n }\n this.cells.push(tmp);\n }\n };\n Grid.prototype.findGridByNodeId = function (nodeId) {\n var _a, _b;\n for (var i = 0; i < this.columnNum; i++) {\n for (var j = 0; j < this.rowNum; j++) {\n if (this.cells[i][j].node) {\n if (((_b = (_a = this.cells[i][j]) === null || _a === void 0 ? void 0 : _a.node) === null || _b === void 0 ? void 0 : _b.id) === nodeId) {\n return { column: i, row: j };\n }\n }\n }\n }\n return null;\n };\n Grid.prototype.sqdist = function (a, b) {\n return Math.pow(a.x - b.x, 2) + Math.pow(a.y - b.y, 2);\n };\n Grid.prototype.occupyNearest = function (p) {\n var minDist = Grid.MIN_DIST;\n var d;\n var candidate = null;\n for (var i = 0; i < this.columnNum; i++) {\n for (var j = 0; j < this.rowNum; j++) {\n if (!this.cells[i][j].occupied && (d = this.sqdist(p, this.cells[i][j])) < minDist) {\n minDist = d;\n candidate = this.cells[i][j];\n }\n }\n }\n if (candidate) {\n candidate.occupied = true;\n }\n return candidate;\n };\n Grid.prototype.insertColumn = function (columnIndex, length) {\n if (length <= 0)\n return;\n // 插入空列\n for (var i = 0; i < length; i++) {\n this.cells[i + this.columnNum] = [];\n for (var j = 0; j < this.rowNum; j++) {\n this.cells[i + this.columnNum][j] = {\n dx: i,\n dy: j,\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: false,\n node: null,\n };\n }\n }\n // 交换数据\n for (var i = (this.columnNum - 1); i > columnIndex; i--) {\n for (var j = 0; j < this.rowNum; j++) {\n this.cells[i + length][j] = __assign(__assign({}, this.cells[i][j]), { x: (i + length) * this.CELL_W, y: j * this.CELL_H });\n this.cells[i][j] = {\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: true,\n node: null,\n };\n }\n }\n // 已有行列的处理\n for (var j = 0; j < this.additionColumn.length; j++) {\n if (this.additionColumn[j] >= columnIndex) {\n this.additionColumn[j] += length;\n }\n }\n // 记录新增的行列\n for (var i = 0; i < length; i++) {\n this.additionColumn.push(columnIndex + i + 1);\n }\n this.columnNum += length;\n };\n Grid.prototype.insertRow = function (rowIndex, length) {\n if (length <= 0)\n return;\n // 插入空行\n for (var j = 0; j < length; j++) {\n for (var i = 0; i < this.columnNum; i++) {\n this.cells[i][j + this.rowNum] = {\n dx: i,\n dy: j,\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: false,\n node: null,\n };\n }\n }\n // 交换数据\n for (var i = 0; i < this.columnNum; i++) {\n for (var j = (this.rowNum - 1); j > rowIndex; j--) {\n this.cells[i][j + length] = __assign(__assign({}, this.cells[i][j]), { dx: i, dy: j + length, x: i * this.CELL_W, y: (j + length) * this.CELL_H });\n this.cells[i][j] = {\n dx: i,\n dy: j,\n x: i * this.CELL_W,\n y: j * this.CELL_H,\n occupied: false,\n node: null,\n };\n }\n }\n // 已有行列的处理\n for (var j = 0; j < this.additionRow.length; j++) {\n if (this.additionRow[j] >= rowIndex) {\n this.additionRow[j] += length;\n }\n }\n // 记录新增的行列\n for (var i = 0; i < length; i++) {\n this.additionRow.push(rowIndex + i + 1);\n }\n this.rowNum += length;\n };\n Grid.prototype.getNodes = function () {\n var nodes = [];\n for (var i = 0; i < this.columnNum; i++) {\n for (var j = 0; j < this.rowNum; j++) {\n if (this.cells[i][j].node) {\n nodes.push(this.cells[i][j]);\n }\n }\n }\n return nodes;\n };\n Grid.MIN_DIST = 50;\n Grid.DEFAULT_CELL_W = 80;\n Grid.DEFAULT_CELL_H = 80;\n return Grid;\n}());\nexports.default = Grid;\n//# sourceMappingURL=grid.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/grid.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n\nvar isEven = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 2 === 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEven);\n//# sourceMappingURL=is-even.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-even.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/er/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/er/index.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-finite.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-finite.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview Force Layout Grid Align layout\n * @author wenyanqi\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERLayout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar core_1 = __importDefault(__webpack_require__(/*! ./core */ \"./node_modules/@antv/layout/lib/layout/er/core.js\"));\nvar ERLayout = /** @class */ (function (_super) {\n __extends(ERLayout, _super);\n function ERLayout(options) {\n var _this = _super.call(this) || this;\n _this.width = 300;\n _this.height = 300;\n _this.nodeMinGap = 50;\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n if (options) {\n _this.updateCfg(options);\n }\n return _this;\n }\n ERLayout.prototype.getDefaultCfg = function () {\n return {\n width: 300,\n height: 300,\n nodeMinGap: 50,\n };\n };\n /**\n * 执行布局\n */\n ERLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var edges = self.edges;\n // 节点初始化,size初始化\n nodes === null || nodes === void 0 ? void 0 : nodes.forEach(function (node) {\n if (!node.size) {\n node.size = [50, 50];\n }\n });\n return (0, core_1.default)({\n nodes: nodes,\n edges: edges,\n }, {\n width: this.width,\n height: this.height,\n nodeMinGap: this.nodeMinGap,\n }).then(function () {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n });\n };\n ERLayout.prototype.getType = function () {\n return \"er\";\n };\n return ERLayout;\n}(base_1.Base));\nexports.ERLayout = ERLayout;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n/**\n * 判断是否为有限数\n * @return {Boolean}\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) && isFinite(value);\n});\n//# sourceMappingURL=is-finite.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-finite.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/er/mysqlWorkbench.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/er/mysqlWorkbench.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar graphWidth = 1200;\nvar graphHeight = 800;\nvar OVERLAP_QUOT = 10000000;\nvar MIN_DIST = 10;\nvar M_PI = 3.14159265358979323846;\nvar M_PI_2 = 1.57079632679489661923;\nvar PI_38 = M_PI * 0.375;\nvar PI_58 = M_PI * 0.625;\nvar nodeEdgeMap = new Map();\nvar CELL_W = 10;\nvar CELL_H = 10;\nvar T = 0.8;\nvar T_MIN = 0.1;\nvar R = 0.5;\nfunction distanceToNode(node1, node2, isHoriz) {\n var x11 = node1.x - node1.size[0] / 2;\n var y11 = node1.y - node1.size[1] / 2;\n var x12 = node1.x + node1.size[0] / 2;\n var y12 = node1.y + node1.size[1] / 2;\n var x21 = node2.x - node2.size[0] / 2;\n var y21 = node2.y - node2.size[1] / 2;\n var x22 = node2.x + node2.size[0] / 2;\n var y22 = node2.y + node2.size[1] / 2;\n var cx1 = node1.x;\n var cy1 = node1.y;\n var cx2 = node2.x;\n var cy2 = node2.y;\n var dcx = cx2 - cx1;\n // 两个节点间的方位角 \n var qr = Math.atan2(dcx, (cy2 - cy1));\n var dx = 0;\n var dy = 0;\n var l1 = 0;\n var l2 = 0;\n if (qr > M_PI_2) {\n dy = y11 - y22;\n dx = x21 - x12;\n l1 = parseFloat(dy ? (dy / Math.cos(qr)).toFixed(2) : (dx).toFixed(2));\n l2 = parseFloat(dx ? (dx / Math.sin(qr)).toFixed(2) : (dy).toFixed(2));\n }\n else if (0.0 < qr && qr <= M_PI_2) {\n dy = y21 - y12;\n dx = x21 - x12;\n if (dy > dx) {\n l1 = l2 = parseFloat(dy ? (dy / Math.cos(qr)).toFixed(2) : (dx).toFixed(2));\n }\n else {\n l1 = l2 = parseFloat(dx ? (dx / Math.sin(qr)).toFixed(2) : (dy).toFixed(2));\n }\n }\n else if (qr < -M_PI_2) {\n dy = y11 - y22;\n dx = -(x22 - x11);\n if (dy > dx) {\n l1 = l2 = parseFloat(dy ? (dy / Math.cos(qr)).toFixed(2) : (dx).toFixed(2));\n }\n else {\n l1 = l2 = parseFloat(dx ? (dx / Math.sin(qr)).toFixed(2) : (dy).toFixed(2));\n }\n }\n else {\n dy = y21 - y12;\n if (Math.abs(dcx) > (x12 - x11) / 2) {\n dx = x11 - x22;\n }\n else {\n dx = dcx;\n }\n if (dy > dx) {\n l1 = l2 = parseFloat(dy ? (dy / Math.cos(qr)).toFixed(2) : (dx).toFixed(2));\n }\n else {\n l1 = l2 = parseFloat((dx && qr !== 0.0) ? (dx / Math.sin(qr)).toFixed(2) : (dy).toFixed(2));\n }\n }\n var aqr = parseFloat(qr.toFixed(2));\n // 判断是否水平,角度\n var newHoriz = isHoriz;\n if (isHoriz) {\n newHoriz = PI_38 < aqr && aqr < PI_58;\n }\n return {\n distance: Math.abs(l1 < l2 ? l1 : l2),\n isHoriz: newHoriz,\n };\n}\nfunction calcNodePair(nodeA, nodeB) {\n // 确定两个节点间是否存在连线\n var edges = nodeEdgeMap.get(nodeA.id) || [];\n var isLinked = edges.find(function (edge) {\n return edge.source === nodeB.id || edge.target === nodeB.id;\n });\n var areaA = nodeA.size[0] * nodeA.size[1];\n var areaB = nodeB.size[0] * nodeB.size[1];\n var node1 = areaA > areaB ? nodeB : nodeA;\n var node2 = areaA > areaB ? nodeA : nodeB;\n var x11 = node1.x - node1.size[0] / 2;\n var y11 = node1.y - node1.size[1] / 2;\n var x12 = node1.x + node1.size[0] / 2;\n var y12 = node1.y + node1.size[1] / 2;\n var x21 = node2.x - node2.size[0] / 2;\n var y21 = node2.y - node2.size[1] / 2;\n var x22 = node2.x + node2.size[0] / 2;\n var y22 = node2.y + node2.size[1] / 2;\n var cx1 = node1.x;\n var cy1 = node1.y;\n var cx2 = node2.x;\n var cy2 = node2.y;\n // Detect if nodes overlap 检查节点之间是否存在覆盖问题\n var isoverlap = ((x12 >= x21) && (x22 >= x11) && (y12 >= y21) && (y22 >= y11));\n var e = 0;\n var distance = 0;\n if (isoverlap) {\n distance = Math.sqrt(Math.pow((cx2 - cx1), 2) + Math.pow((cy2 - cy1), 2));\n // calc area of overlap 计算重复区域的坐标和面积\n var sx1 = x11 > x21 ? x11 : x21;\n var sy1 = y11 > y21 ? y11 : y21;\n var sx2 = x12 < x22 ? x12 : x22;\n var sy2 = y12 < y22 ? y12 : y22;\n var dsx = sx2 - sx1;\n var dsy = sy2 - sy1;\n var sov = dsx * dsy;\n if (distance === 0.0) {\n distance = 0.0000001;\n }\n e = MIN_DIST * 1 / distance * 100 + sov;\n e *= OVERLAP_QUOT;\n }\n else {\n var isHoriz = false;\n var res = distanceToNode(node1, node2, isHoriz);\n distance = res.distance;\n isHoriz = res.isHoriz;\n if (distance <= MIN_DIST) {\n if (distance !== 0) {\n if (isLinked) {\n e += MIN_DIST + OVERLAP_QUOT * 1 / distance;\n }\n else {\n e += MIN_DIST + OVERLAP_QUOT * MIN_DIST / distance;\n }\n }\n else {\n e += OVERLAP_QUOT;\n }\n }\n else {\n e += distance;\n if (isLinked) {\n e += distance * distance;\n }\n }\n }\n return e;\n}\nfunction calcEnergy(nodes) {\n var energy = 0;\n for (var i = 0; i < nodes.length; i++) {\n var node = nodes[i];\n if ((node.x < 0) || (node.y < 0) || (node.x > graphWidth) || (node.y > graphHeight)) {\n energy += 1000000000000;\n }\n for (var j = i + 1; j < nodes.length; j++) {\n energy += calcNodePair(node, nodes[j]);\n }\n }\n return energy;\n}\nfunction isCorrectPosition(node, newPosition, nodes, edges) {\n var nodeIdxMap = new Map();\n nodes.forEach(function (o, i) {\n nodeIdxMap.set(o.id, o);\n });\n var relateEdges = edges.filter(function (edge) { return edge.source === node.id || edge.target === node.id; }) || [];\n var relateNodes = [];\n relateEdges.forEach(function (edge) {\n var otherNodeId = edge.source === node.id ? edge.target : edge.source;\n var otherNode = nodeIdxMap.get(otherNodeId);\n if (otherNode) {\n relateNodes.push(otherNode);\n }\n });\n var flag = true;\n for (var i = 0; i < relateNodes.length; i++) {\n var item = relateNodes[i];\n // 判断条件调整,节点的坐标不需要完全一致。可以根据节点间的夹角来判断\n var delta = Math.atan((node.y - item.y) / (item.x - node.y)) * 180;\n var newDelta = Math.atan((newPosition.y - item.y) / (item.x - newPosition.y)) * 180;\n var isHor = delta < 30 || delta > 150;\n var newIsHor = newDelta < 30 || newDelta > 150;\n var isVer = delta > 70 && delta < 110;\n var newIsVer = newDelta > 70 && newDelta < 110;\n // 定义四个相似角度区间,0-15度,75-90度,90到105度,165到180度。\n if (isHor && !newIsHor || ((delta * newDelta) < 0)) {\n flag = false;\n break;\n }\n else if (isVer && !newIsVer || ((delta * newDelta) < 0)) {\n flag = false;\n break;\n }\n else if ((item.x - node.x) * (item.x - newPosition.x) < 0) {\n flag = false;\n break;\n }\n else if ((item.y - node.y) * (item.y - newPosition.y) < 0) {\n flag = false;\n break;\n }\n }\n return flag;\n}\nfunction shuffle(nodes, edges) {\n var foundSmallerEnergy = false;\n // 多次测试发现step为1时的效果最佳。\n var step = 1;\n var wstep = CELL_W * step;\n var hstep = CELL_H * step;\n var wsteps = [wstep, -wstep, 0, 0,];\n var hsteps = [0, 0, hstep, -hstep,];\n for (var i = 0; i < nodes.length; ++i) {\n var node = nodes[i];\n var nodeEnergy = calcNodeEnergy(node, nodes);\n for (var ns = 0; ns < wsteps.length; ns++) {\n // 判断新位置与其他连线节点的位置关系是否违规\n var flag = isCorrectPosition(node, { x: node.x + wsteps[ns], y: node.y + hsteps[ns] }, nodes, edges);\n if (flag) {\n // 节点朝上下左右四个方向移动,找到能量最小的那个位置\n node.x += wsteps[ns];\n node.y += hsteps[ns];\n // 计算移动后节点的能量\n var energy = calcNodeEnergy(node, nodes);\n var rdm = Math.random();\n if (energy < nodeEnergy) {\n nodeEnergy = energy;\n foundSmallerEnergy = true;\n }\n else if (rdm < T && rdm > T_MIN) {\n nodeEnergy = energy;\n foundSmallerEnergy = true;\n }\n else {\n // 回归原位\n node.x -= wsteps[ns];\n node.y -= hsteps[ns];\n }\n }\n }\n }\n if (T > T_MIN) {\n T *= R;\n }\n // 重新计算图整体的能量\n if (foundSmallerEnergy) {\n return calcEnergy(nodes);\n }\n return 0;\n}\n// 计算节点的能量,\nfunction calcNodeEnergy(node, nodes) {\n var e = 0.0;\n if ((node.x < 0) || (node.y < 0) ||\n (node.x + node.size[0] + 20 > graphWidth) ||\n (node.y + node.size[1] + 20 > graphHeight)) {\n e += 1000000000000.0;\n }\n for (var i = 0; i < nodes.length; ++i) {\n if (node.id !== nodes[i].id) {\n e += calcNodePair(node, nodes[i]);\n }\n }\n return e;\n}\nfunction layout(nodes, edges) {\n if (nodes.length === 0) {\n return { nodes: nodes, edges: edges };\n }\n nodes.forEach(function (node) {\n var relateEdge = edges.filter(function (edge) { return edge.source === node.id || edge.target === node.id; });\n nodeEdgeMap.set(node, relateEdge);\n });\n // 1. 初始化\n // 将node按照连接数进行排序\n nodes.sort(function (node1, node2) {\n var _a, _b;\n return ((_a = nodeEdgeMap.get(node1.id)) === null || _a === void 0 ? void 0 : _a.length) - ((_b = nodeEdgeMap.get(node2.id)) === null || _b === void 0 ? void 0 : _b.length);\n });\n // 2. 计算图能量\n var minEnergy = calcEnergy(nodes);\n var deSameCount = 20; // de=0 count\n var de = 1; // energy delta\n var prevEnergy = 0;\n // 定义总的迭代次数。超过就停掉,防止死循环\n var MAX_COUNT = 50;\n var count = 0;\n while (deSameCount > 0) {\n count++;\n if (count >= MAX_COUNT) {\n break;\n }\n var ea = shuffle(nodes, edges);\n if (ea !== 0) {\n prevEnergy = ea;\n }\n de = prevEnergy - minEnergy;\n minEnergy = prevEnergy;\n if (de === 0) {\n --deSameCount;\n }\n else {\n deSameCount = 20;\n }\n }\n nodes.forEach(function (node) {\n node.x = node.x - node.size[0] / 2;\n node.y = node.y - node.size[1] / 2;\n });\n return {\n nodes: nodes,\n edges: edges,\n };\n}\nexports.default = layout;\n//# sourceMappingURL=mysqlWorkbench.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/er/mysqlWorkbench.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * @see https://github.com/you-dont-need/You-Dont-Need-Lodash-Underscore#_isfunction\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return typeof value === 'function';\n});\n//# sourceMappingURL=is-function.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/force/force-in-a-box.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/force/force-in-a-box.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-integer.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-integer.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar d3Force = __importStar(__webpack_require__(/*! d3-force */ \"./node_modules/@antv/layout/node_modules/d3-force/src/index.js\"));\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\n// https://github.com/john-guerra/forceInABox/blob/master/src/forceInABox.js\nfunction forceInABox() {\n function constant(_) {\n return function () { return _; };\n }\n var groupBy = function (d) {\n return d.cluster;\n };\n var forceNodeSize = constant(1);\n var forceCharge = constant(-1);\n var forceLinkDistance = constant(100);\n var forceLinkStrength = constant(0.1);\n var offset = [0, 0];\n var nodes = [];\n var nodesMap = {};\n var links = [];\n var centerX = 100;\n var centerY = 100;\n var foci = {\n none: {\n x: 0,\n y: 0,\n },\n };\n var templateNodes = [];\n var templateForce;\n var template = 'force';\n var enableGrouping = true;\n var strength = 0.1;\n function force(alpha) {\n if (!enableGrouping) {\n return force;\n }\n templateForce.tick();\n getFocisFromTemplate();\n for (var i = 0, n = nodes.length, node = void 0, k = alpha * strength; i < n; ++i) {\n node = nodes[i];\n node.vx += (foci[groupBy(node)].x - node.x) * k;\n node.vy += (foci[groupBy(node)].y - node.y) * k;\n }\n }\n function initialize() {\n if (!nodes)\n return;\n initializeWithForce();\n }\n function initializeWithForce() {\n if (!nodes || !nodes.length) {\n return;\n }\n if (groupBy(nodes[0]) === undefined) {\n throw Error(\"Couldnt find the grouping attribute for the nodes. Make sure to set it up with forceInABox.groupBy('clusterAttr') before calling .links()\");\n }\n // checkLinksAsObjects();\n var net = getGroupsGraph();\n templateForce = d3Force\n .forceSimulation(net.nodes)\n .force('x', d3Force.forceX(centerX).strength(0.1))\n .force('y', d3Force.forceY(centerY).strength(0.1))\n .force('collide', d3Force.forceCollide(function (d) { return d.r; }).iterations(4))\n .force('charge', d3Force.forceManyBody().strength(forceCharge))\n .force('links', d3Force\n .forceLink(net.nodes.length ? net.links : [])\n .distance(forceLinkDistance)\n .strength(forceLinkStrength));\n templateNodes = templateForce.nodes();\n getFocisFromTemplate();\n }\n function getGroupsGraph() {\n var gnodes = [];\n var glinks = [];\n var dNodes = {};\n var clustersList = [];\n var clustersCounts = {};\n var clustersLinks = [];\n clustersCounts = computeClustersNodeCounts(nodes);\n clustersLinks = computeClustersLinkCounts(links);\n clustersList = Object.keys(clustersCounts);\n clustersList.forEach(function (key, index) {\n var val = clustersCounts[key];\n // Uses approx meta-node size\n gnodes.push({\n id: key,\n size: val.count,\n r: Math.sqrt(val.sumforceNodeSize / Math.PI),\n });\n dNodes[key] = index;\n });\n clustersLinks.forEach(function (l) {\n var sourceTerminal = (0, util_1.getEdgeTerminal)(l, 'source');\n var targetTerminal = (0, util_1.getEdgeTerminal)(l, 'target');\n var source = dNodes[sourceTerminal];\n var target = dNodes[targetTerminal];\n if (source !== undefined && target !== undefined) {\n glinks.push({\n source: source,\n target: target,\n count: l.count,\n });\n }\n });\n return {\n nodes: gnodes,\n links: glinks,\n };\n }\n function computeClustersNodeCounts(nodes) {\n var clustersCounts = {};\n nodes.forEach(function (d) {\n var key = groupBy(d);\n if (!clustersCounts[key]) {\n clustersCounts[key] = {\n count: 0,\n sumforceNodeSize: 0,\n };\n }\n });\n nodes.forEach(function (d) {\n var key = groupBy(d);\n var nodeSize = forceNodeSize(d);\n var tmpCount = clustersCounts[key];\n tmpCount.count = tmpCount.count + 1;\n tmpCount.sumforceNodeSize =\n tmpCount.sumforceNodeSize + Math.PI * (nodeSize * nodeSize) * 1.3;\n clustersCounts[key] = tmpCount;\n });\n return clustersCounts;\n }\n function computeClustersLinkCounts(links) {\n var dClusterLinks = {};\n var clusterLinks = [];\n links.forEach(function (l) {\n var key = getLinkKey(l);\n var count = 0;\n if (dClusterLinks[key] !== undefined) {\n count = dClusterLinks[key];\n }\n count += 1;\n dClusterLinks[key] = count;\n });\n // @ts-ignore\n var entries = Object.entries(dClusterLinks);\n entries.forEach(function (_a) {\n var key = _a[0], count = _a[1];\n var source = key.split('~')[0];\n var target = key.split('~')[1];\n if (source !== undefined && target !== undefined) {\n clusterLinks.push({\n source: source,\n target: target,\n count: count,\n });\n }\n });\n return clusterLinks;\n }\n function getFocisFromTemplate() {\n foci = {\n none: {\n x: 0,\n y: 0,\n },\n };\n templateNodes.forEach(function (d) {\n foci[d.id] = {\n x: d.x - offset[0],\n y: d.y - offset[1],\n };\n });\n return foci;\n }\n function getLinkKey(l) {\n var source = (0, util_1.getEdgeTerminal)(l, 'source');\n var target = (0, util_1.getEdgeTerminal)(l, 'target');\n var sourceID = groupBy(nodesMap[source]);\n var targetID = groupBy(nodesMap[target]);\n return sourceID <= targetID\n ? \"\".concat(sourceID, \"~\").concat(targetID)\n : \"\".concat(targetID, \"~\").concat(sourceID);\n }\n function genNodesMap(nodes) {\n nodesMap = {};\n nodes.forEach(function (node) {\n nodesMap[node.id] = node;\n });\n }\n function setTemplate(x) {\n if (!arguments.length)\n return template;\n template = x;\n initialize();\n return force;\n }\n function setGroupBy(x) {\n if (!arguments.length)\n return groupBy;\n if (typeof x === 'string') {\n groupBy = function (d) {\n return d[x];\n };\n return force;\n }\n groupBy = x;\n return force;\n }\n function setEnableGrouping(x) {\n if (!arguments.length)\n return enableGrouping;\n enableGrouping = x;\n return force;\n }\n function setStrength(x) {\n if (!arguments.length)\n return strength;\n strength = x;\n return force;\n }\n function setCenterX(_) {\n if (arguments.length) {\n centerX = _;\n return force;\n }\n return centerX;\n }\n function setCenterY(_) {\n if (arguments.length) {\n centerY = _;\n return force;\n }\n return centerY;\n }\n function setNodes(_) {\n if (arguments.length) {\n genNodesMap(_ || []);\n nodes = _ || [];\n return force;\n }\n return nodes;\n }\n function setLinks(_) {\n if (arguments.length) {\n links = _ || [];\n initialize();\n return force;\n }\n return links;\n }\n function setForceNodeSize(_) {\n if (arguments.length) {\n if (typeof _ === 'function') {\n forceNodeSize = _;\n }\n else {\n forceNodeSize = constant(+_);\n }\n initialize();\n return force;\n }\n return forceNodeSize;\n }\n function setForceCharge(_) {\n if (arguments.length) {\n if (typeof _ === 'function') {\n forceCharge = _;\n }\n else {\n forceCharge = constant(+_);\n }\n initialize();\n return force;\n }\n return forceCharge;\n }\n function setForceLinkDistance(_) {\n if (arguments.length) {\n if (typeof _ === 'function') {\n forceLinkDistance = _;\n }\n else {\n forceLinkDistance = constant(+_);\n }\n initialize();\n return force;\n }\n return forceLinkDistance;\n }\n function setForceLinkStrength(_) {\n if (arguments.length) {\n if (typeof _ === 'function') {\n forceLinkStrength = _;\n }\n else {\n forceLinkStrength = constant(+_);\n }\n initialize();\n return force;\n }\n return forceLinkStrength;\n }\n function setOffset(_) {\n if (arguments.length) {\n offset = _;\n return force;\n }\n return offset;\n }\n force.initialize = function (_) {\n nodes = _;\n initialize();\n };\n force.template = setTemplate;\n force.groupBy = setGroupBy;\n force.enableGrouping = setEnableGrouping;\n force.strength = setStrength;\n force.centerX = setCenterX;\n force.centerY = setCenterY;\n force.nodes = setNodes;\n force.links = setLinks;\n force.forceNodeSize = setForceNodeSize;\n // Legacy support\n force.nodeSize = force.forceNodeSize;\n force.forceCharge = setForceCharge;\n force.forceLinkDistance = setForceLinkDistance;\n force.forceLinkStrength = setForceLinkStrength;\n force.offset = setOffset;\n force.getFocis = getFocisFromTemplate;\n return force;\n}\nexports.default = forceInABox;\n//# sourceMappingURL=force-in-a-box.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force/force-in-a-box.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n\nvar isInteger = Number.isInteger\n ? Number.isInteger\n : function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 1 === 0;\n };\n/* harmony default export */ __webpack_exports__[\"default\"] = (isInteger);\n//# sourceMappingURL=is-integer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-integer.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/force/force.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/force/force.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-match.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-match.js ***! + \**********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview random layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\n}) : function(o, v) {\n o[\"default\"] = v;\n});\nvar __importStar = (this && this.__importStar) || function (mod) {\n if (mod && mod.__esModule) return mod;\n var result = {};\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\n __setModuleDefault(result, mod);\n return result;\n};\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ForceLayout = void 0;\nvar d3Force = __importStar(__webpack_require__(/*! d3-force */ \"./node_modules/@antv/layout/node_modules/d3-force/src/index.js\"));\nvar force_in_a_box_1 = __importDefault(__webpack_require__(/*! ./force-in-a-box */ \"./node_modules/@antv/layout/lib/layout/force/force-in-a-box.js\"));\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar constants_1 = __webpack_require__(/*! ../constants */ \"./node_modules/@antv/layout/lib/layout/constants.js\");\n/**\n * 经典力导布局 force-directed\n */\nvar ForceLayout = /** @class */ (function (_super) {\n __extends(ForceLayout, _super);\n function ForceLayout(options) {\n var _this = _super.call(this) || this;\n /** 向心力作用点 */\n _this.center = [0, 0];\n /** 节点作用力 */\n _this.nodeStrength = null;\n /** 边的作用力, 默认为根据节点的入度出度自适应 */\n _this.edgeStrength = null;\n /** 是否防止节点相互覆盖 */\n _this.preventOverlap = false;\n /** 聚类节点作用力 */\n _this.clusterNodeStrength = null;\n /** 聚类边作用力 */\n _this.clusterEdgeStrength = null;\n /** 聚类边长度 */\n _this.clusterEdgeDistance = null;\n /** 聚类节点大小 / 直径,直径越大,越分散 */\n _this.clusterNodeSize = null;\n /** 用于 foci 的力 */\n _this.clusterFociStrength = null;\n /** 默认边长度 */\n _this.linkDistance = 50;\n /** 迭代阈值的衰减率 [0, 1],0.028 对应最大迭代数为 300 */\n _this.alphaDecay = 0.028;\n /** 停止迭代的阈值 */\n _this.alphaMin = 0.001;\n /** 当前阈值 */\n _this.alpha = 0.3;\n /** 防止重叠的力强度 */\n _this.collideStrength = 1;\n /** 是否启用web worker。前提是在web worker里执行布局,否则无效\t*/\n _this.workerEnabled = false;\n _this.tick = function () { };\n /** 布局完成回调 */\n _this.onLayoutEnd = function () { };\n /** 是否正在布局 */\n _this.ticking = undefined;\n if (options) {\n _this.updateCfg(options);\n }\n return _this;\n }\n ForceLayout.prototype.getDefaultCfg = function () {\n return {\n center: [0, 0],\n nodeStrength: null,\n edgeStrength: null,\n preventOverlap: false,\n nodeSize: undefined,\n nodeSpacing: undefined,\n linkDistance: 50,\n forceSimulation: null,\n alphaDecay: 0.028,\n alphaMin: 0.001,\n alpha: 0.3,\n collideStrength: 1,\n clustering: false,\n clusterNodeStrength: -1,\n clusterEdgeStrength: 0.1,\n clusterEdgeDistance: 100,\n clusterFociStrength: 0.8,\n clusterNodeSize: 10,\n tick: function () { },\n onLayoutEnd: function () { },\n // 是否启用web worker。前提是在web worker里执行布局,否则无效\n workerEnabled: false\n };\n };\n /**\n * 初始化\n * @param {object} data 数据\n */\n ForceLayout.prototype.init = function (data) {\n var self = this;\n self.nodes = data.nodes || [];\n var edges = data.edges || [];\n self.edges = edges.map(function (edge) {\n var res = {};\n var expectKeys = [\"targetNode\", \"sourceNode\", \"startPoint\", \"endPoint\"];\n Object.keys(edge).forEach(function (key) {\n if (!(expectKeys.indexOf(key) > -1)) {\n res[key] = edge[key];\n }\n });\n return res;\n });\n self.ticking = false;\n };\n /**\n * 执行布局\n */\n ForceLayout.prototype.execute = function (reloadData) {\n var self = this;\n var nodes = self.nodes;\n var edges = self.edges;\n // 如果正在布局,忽略布局请求\n if (self.ticking) {\n return;\n }\n var simulation = self.forceSimulation;\n var alphaMin = self.alphaMin;\n var alphaDecay = self.alphaDecay;\n var alpha = self.alpha;\n if (!simulation) {\n try {\n // 定义节点的力\n var nodeForce = d3Force.forceManyBody();\n if (self.nodeStrength) {\n nodeForce.strength(self.nodeStrength);\n }\n simulation = d3Force.forceSimulation().nodes(nodes);\n if (self.clustering) {\n var clusterForce = (0, force_in_a_box_1.default)();\n clusterForce\n .centerX(self.center[0])\n .centerY(self.center[1])\n .template(\"force\")\n .strength(self.clusterFociStrength);\n if (edges) {\n clusterForce.links(edges);\n }\n if (nodes) {\n clusterForce.nodes(nodes);\n }\n clusterForce\n .forceLinkDistance(self.clusterEdgeDistance)\n .forceLinkStrength(self.clusterEdgeStrength)\n .forceCharge(self.clusterNodeStrength)\n .forceNodeSize(self.clusterNodeSize);\n self.clusterForce = clusterForce;\n simulation.force(\"group\", clusterForce);\n }\n simulation\n .force(\"center\", d3Force.forceCenter(self.center[0], self.center[1]))\n .force(\"charge\", nodeForce)\n .alpha(alpha)\n .alphaDecay(alphaDecay)\n .alphaMin(alphaMin);\n if (self.preventOverlap) {\n self.overlapProcess(simulation);\n }\n // 如果有边,定义边的力\n if (edges) {\n // d3 的 forceLayout 会重新生成边的数据模型,为了避免污染源数据\n var edgeForce = d3Force\n .forceLink()\n .id(function (d) { return d.id; })\n .links(edges);\n if (self.edgeStrength) {\n edgeForce.strength(self.edgeStrength);\n }\n if (self.linkDistance) {\n edgeForce.distance(self.linkDistance);\n }\n self.edgeForce = edgeForce;\n simulation.force(\"link\", edgeForce);\n }\n if (self.workerEnabled && !isInWorker()) {\n // 如果不是运行在web worker里,不用web worker布局\n self.workerEnabled = false;\n console.warn(\"workerEnabled option is only supported when running in web worker.\");\n }\n if (!self.workerEnabled) {\n simulation\n .on(\"tick\", function () {\n self.tick();\n })\n .on(\"end\", function () {\n self.ticking = false;\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n });\n self.ticking = true;\n }\n else {\n // worker is enabled\n simulation.stop();\n var totalTicks = getSimulationTicks(simulation);\n for (var currentTick = 1; currentTick <= totalTicks; currentTick++) {\n simulation.tick();\n // currentTick starts from 1.\n postMessage({\n nodes: nodes,\n currentTick: currentTick,\n totalTicks: totalTicks,\n type: constants_1.LAYOUT_MESSAGE.TICK\n }, undefined);\n }\n self.ticking = false;\n }\n self.forceSimulation = simulation;\n self.ticking = true;\n }\n catch (e) {\n self.ticking = false;\n console.warn(e);\n }\n }\n else {\n if (reloadData) {\n if (self.clustering && self.clusterForce) {\n self.clusterForce.nodes(nodes);\n self.clusterForce.links(edges);\n }\n simulation.nodes(nodes);\n if (edges && self.edgeForce)\n self.edgeForce.links(edges);\n else if (edges && !self.edgeForce) {\n // d3 的 forceLayout 会重新生成边的数据模型,为了避免污染源数据\n var edgeForce = d3Force\n .forceLink()\n .id(function (d) { return d.id; })\n .links(edges);\n if (self.edgeStrength) {\n edgeForce.strength(self.edgeStrength);\n }\n if (self.linkDistance) {\n edgeForce.distance(self.linkDistance);\n }\n self.edgeForce = edgeForce;\n simulation.force(\"link\", edgeForce);\n }\n }\n if (self.preventOverlap) {\n self.overlapProcess(simulation);\n }\n simulation.alpha(alpha).restart();\n this.ticking = true;\n }\n };\n /**\n * 防止重叠\n * @param {object} simulation 力模拟模型\n */\n ForceLayout.prototype.overlapProcess = function (simulation) {\n var self = this;\n var nodeSize = self.nodeSize;\n var nodeSpacing = self.nodeSpacing;\n var nodeSizeFunc;\n var nodeSpacingFunc;\n var collideStrength = self.collideStrength;\n if ((0, util_1.isNumber)(nodeSpacing)) {\n nodeSpacingFunc = function () { return nodeSpacing; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing)) {\n nodeSpacingFunc = nodeSpacing;\n }\n else {\n nodeSpacingFunc = function () { return 0; };\n }\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return res / 2 + nodeSpacingFunc(d);\n }\n if ((0, util_1.isObject)(d.size)) {\n var res = d.size.width > d.size.height ? d.size.width : d.size.height;\n return res / 2 + nodeSpacingFunc(d);\n }\n return d.size / 2 + nodeSpacingFunc(d);\n }\n return 10 + nodeSpacingFunc(d);\n };\n }\n else if ((0, util_1.isFunction)(nodeSize)) {\n nodeSizeFunc = function (d) {\n var size = nodeSize(d);\n return size + nodeSpacingFunc(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n var larger = nodeSize[0] > nodeSize[1] ? nodeSize[0] : nodeSize[1];\n var radius_1 = larger / 2;\n nodeSizeFunc = function (d) { return radius_1 + nodeSpacingFunc(d); };\n }\n else if ((0, util_1.isNumber)(nodeSize)) {\n var radius_2 = nodeSize / 2;\n nodeSizeFunc = function (d) { return radius_2 + nodeSpacingFunc(d); };\n }\n else {\n nodeSizeFunc = function () { return 10; };\n }\n // forceCollide's parameter is a radius\n simulation.force(\"collisionForce\", d3Force.forceCollide(nodeSizeFunc).strength(collideStrength));\n };\n /**\n * 更新布局配置,但不执行布局\n * @param {object} cfg 需要更新的配置项\n */\n ForceLayout.prototype.updateCfg = function (cfg) {\n var self = this;\n if (self.ticking) {\n self.forceSimulation.stop();\n self.ticking = false;\n }\n self.forceSimulation = null;\n Object.assign(self, cfg);\n };\n ForceLayout.prototype.destroy = function () {\n var self = this;\n if (self.ticking) {\n self.forceSimulation.stop();\n self.ticking = false;\n }\n self.nodes = null;\n self.edges = null;\n self.destroyed = true;\n };\n return ForceLayout;\n}(base_1.Base));\nexports.ForceLayout = ForceLayout;\n// Return total ticks of d3-force simulation\nfunction getSimulationTicks(simulation) {\n var alphaMin = simulation.alphaMin();\n var alphaTarget = simulation.alphaTarget();\n var alpha = simulation.alpha();\n var totalTicksFloat = Math.log((alphaMin - alphaTarget) / (alpha - alphaTarget)) /\n Math.log(1 - simulation.alphaDecay());\n var totalTicks = Math.ceil(totalTicksFloat);\n return totalTicks;\n}\n// 判断是否运行在web worker里\nfunction isInWorker() {\n // eslint-disable-next-line no-undef\n return (typeof WorkerGlobalScope !== \"undefined\" &&\n self instanceof WorkerGlobalScope);\n}\n//# sourceMappingURL=force.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force/force.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js\");\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/keys.js\");\n\n\nfunction isMatch(obj, attrs) {\n var _keys = Object(_keys__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(attrs);\n var length = _keys.length;\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj))\n return !length;\n for (var i = 0; i < length; i += 1) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) {\n return false;\n }\n }\n return true;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (isMatch);\n//# sourceMappingURL=is-match.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-match.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/force/index.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/force/index.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-negative.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-negative.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(__webpack_require__(/*! ./force */ \"./node_modules/@antv/layout/lib/layout/force/force.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n\nvar isNegative = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num < 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNegative);\n//# sourceMappingURL=is-negative.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-negative.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/force2/ForceNBody.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/force2/ForceNBody.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.forceNBody = void 0;\nvar d3_quadtree_1 = __webpack_require__(/*! d3-quadtree */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js\");\nvar theta2 = 0.81; // Barnes-Hut approximation threshold\nvar epsilon = 0.1; // 为了防止出现除0的情况,加一个epsilon\nfunction forceNBody(nodes, nodeMap, factor, coulombDisScale2, accArray) {\n var weightParam = factor / coulombDisScale2;\n var data = nodes.map(function (n, i) {\n // @ts-ignore\n var mappedNode = nodeMap[n.id];\n // @ts-ignore\n var nodeData = mappedNode.data, x = mappedNode.x, y = mappedNode.y, size = mappedNode.size;\n var nodeStrength = nodeData.layout.force.nodeStrength;\n return {\n x: x,\n y: y,\n size: size,\n index: i,\n vx: 0,\n vy: 0,\n weight: weightParam * nodeStrength,\n };\n });\n var tree = (0, d3_quadtree_1.quadtree)(data, function (d) { return d.x; }, function (d) { return d.y; }).visitAfter(accumulate); // init internal node\n data.forEach(function (n) {\n // @ts-ignore\n computeForce(n, tree);\n });\n data.map(function (n, i) {\n // @ts-ignore\n var mappedNode = nodeMap[nodes[i].id];\n // @ts-ignore\n var _a = mappedNode.data.layout.force.mass, mass = _a === void 0 ? 1 : _a;\n // 从 0 开始,= 初始化 + 加斥力\n accArray[2 * i] = n.vx / mass;\n accArray[2 * i + 1] = n.vy / mass;\n });\n return accArray;\n}\nexports.forceNBody = forceNBody;\n// @ts-ignore\nfunction accumulate(quad) {\n var accWeight = 0;\n var accX = 0;\n var accY = 0;\n if (quad.length) {\n // internal node, accumulate 4 child quads\n for (var i = 0; i < 4; i++) {\n var q = quad[i];\n if (q && q.weight) {\n accWeight += q.weight;\n accX += q.x * q.weight;\n accY += q.y * q.weight;\n }\n }\n quad.x = accX / accWeight;\n quad.y = accY / accWeight;\n quad.weight = accWeight;\n }\n else {\n // leaf node\n var q = quad;\n quad.x = q.data.x;\n quad.y = q.data.y;\n quad.weight = q.data.weight;\n }\n}\n// @ts-ignore\nvar apply = function (quad, x1, y1, x2, y2, node) {\n var dx = (node.x - quad.x) || epsilon;\n var dy = (node.y - quad.y) || epsilon;\n var width = x2 - x1;\n var len2 = dx * dx + dy * dy;\n var len3 = Math.sqrt(len2) * len2;\n // far node, apply Barnes-Hut approximation\n if ((width * width) * theta2 < len2) {\n var param = quad.weight / len3;\n node.vx += dx * param;\n node.vy += dy * param;\n return true;\n }\n // near quad, compute force directly\n if (quad.length)\n return false; // internal node, visit children\n // leaf node\n if (quad.data !== node) {\n var param = quad.data.weight / len3;\n node.vx += dx * param;\n node.vy += dy * param;\n }\n};\n// @ts-ignore\nfunction computeForce(node, tree) {\n // @ts-ignore\n tree.visit(function (quad, x1, y1, x2, y2) { return apply(quad, x1, y1, x2, y2, node); });\n}\n//# sourceMappingURL=ForceNBody.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force2/ForceNBody.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n// isFinite,\nvar isNil = function (value) {\n /**\n * isNil(null) => true\n * isNil() => true\n */\n return value === null || value === undefined;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNil);\n//# sourceMappingURL=is-nil.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/force2/index.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/force2/index.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-null.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-null.js ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Force2Layout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar ForceNBody_1 = __webpack_require__(/*! ./ForceNBody */ \"./node_modules/@antv/layout/lib/layout/force2/ForceNBody.js\");\nvar proccessToFunc = function (value, defaultV) {\n var func;\n if (!value) {\n func = function (d) {\n return defaultV || 1;\n };\n }\n else if ((0, util_1.isNumber)(value)) {\n func = function (d) {\n return value;\n };\n }\n else {\n func = value;\n }\n return func;\n};\n/**\n * graphin 中的 force 布局\n */\nvar Force2Layout = /** @class */ (function (_super) {\n __extends(Force2Layout, _super);\n function Force2Layout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 是否启动 worker */\n _this.workerEnabled = false;\n /** 弹簧引力系数 */\n _this.edgeStrength = 200;\n /** 斥力系数 */\n _this.nodeStrength = 1000;\n /** 库伦系数 */\n _this.coulombDisScale = 0.005;\n /** 阻尼系数 */\n _this.damping = 0.9;\n /** 最大速度 */\n _this.maxSpeed = 1000;\n /** 一次迭代的平均移动距离小于该值时停止迭代 */\n _this.minMovement = 0.4;\n /** 迭代中衰减 */\n _this.interval = 0.02;\n /** 斥力的一个系数 */\n _this.factor = 1;\n /** 理想边长 */\n _this.linkDistance = 200;\n /** 重力大小 */\n _this.gravity = 0;\n /** 节点聚类作用力系数 */\n _this.clusterNodeStrength = 20;\n /** 是否防止重叠 */\n _this.preventOverlap = true;\n /** 阈值的使用条件,mean 代表平均移动距离小于 minMovement 时停止迭代,max 代表最大移动距离大时 minMovement 时停时迭代。默认为 mean */\n _this.distanceThresholdMode = 'mean';\n /** 每次迭代结束的回调函数 */\n _this.tick = function () { };\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n _this.judgingDistance = 0;\n /** 默认的向心配置 */\n _this.centripetalOptions = {\n leaf: 2,\n single: 2,\n others: 1,\n // eslint-disable-next-line\n center: function (n) {\n return {\n x: _this.width / 2,\n y: _this.height / 2,\n };\n },\n };\n var getMass = options.getMass;\n _this.propsGetMass = getMass;\n _this.updateCfg(options);\n return _this;\n }\n Force2Layout.prototype.getCentripetalOptions = function () {\n var _a = this, leafCluster = _a.leafCluster, clustering = _a.clustering, nodeClusterBy = _a.nodeClusterBy, nodes = _a.nodes, nodeMap = _a.nodeMap, propsClusterNodeStrength = _a.clusterNodeStrength;\n var getClusterNodeStrength = function (node) {\n return typeof propsClusterNodeStrength === 'function' ? propsClusterNodeStrength(node) : propsClusterNodeStrength;\n };\n var centripetalOptions = {};\n var sameTypeLeafMap;\n // 如果传入了需要叶子节点聚类\n if (leafCluster) {\n sameTypeLeafMap = this.getSameTypeLeafMap() || {};\n var relativeNodesType_1 = Array.from(new Set(nodes === null || nodes === void 0 ? void 0 : nodes.map(function (node) { return node[nodeClusterBy]; }))) || [];\n centripetalOptions = {\n single: 100,\n leaf: function (node, nodes, edges) {\n // 找出与它关联的边的起点或终点出发的所有一度节点中同类型的叶子节点\n var _a = sameTypeLeafMap[node.id] || {}, relativeLeafNodes = _a.relativeLeafNodes, sameTypeLeafNodes = _a.sameTypeLeafNodes;\n // 如果都是同一类型或者每种类型只有1个,则施加默认向心力\n if ((sameTypeLeafNodes === null || sameTypeLeafNodes === void 0 ? void 0 : sameTypeLeafNodes.length) === (relativeLeafNodes === null || relativeLeafNodes === void 0 ? void 0 : relativeLeafNodes.length) || (relativeNodesType_1 === null || relativeNodesType_1 === void 0 ? void 0 : relativeNodesType_1.length) === 1) {\n return 1;\n }\n return getClusterNodeStrength(node);\n },\n others: 1,\n center: function (node, nodes, edges) {\n var _a;\n var degree = (((_a = node.data) === null || _a === void 0 ? void 0 : _a.layout) || {}).degree;\n // 孤点默认给1个远离的中心点\n if (!degree) {\n return {\n x: 100,\n y: 100,\n };\n }\n var centerNode;\n if (degree === 1) {\n // 如果为叶子节点\n // 找出与它关联的边的起点出发的所有一度节点中同类型的叶子节点\n var _b = (sameTypeLeafMap[node.id] || {}).sameTypeLeafNodes, sameTypeLeafNodes = _b === void 0 ? [] : _b;\n if (sameTypeLeafNodes.length === 1) {\n // 如果同类型的叶子节点只有1个,中心节点置为undefined\n centerNode = undefined;\n }\n else if (sameTypeLeafNodes.length > 1) {\n // 找出同类型节点平均位置节点的距离最近的节点作为中心节点\n centerNode = (0, util_1.getAvgNodePosition)(sameTypeLeafNodes);\n }\n }\n else {\n centerNode = undefined;\n }\n return {\n x: centerNode === null || centerNode === void 0 ? void 0 : centerNode.x,\n y: centerNode === null || centerNode === void 0 ? void 0 : centerNode.y,\n };\n },\n };\n }\n // 如果传入了全局节点聚类\n if (clustering) {\n if (!sameTypeLeafMap)\n sameTypeLeafMap = this.getSameTypeLeafMap();\n var clusters = Array.from(new Set(nodes.map(function (node, i) {\n return node[nodeClusterBy];\n }))).filter(function (item) { return item !== undefined; });\n var centerNodeInfo_1 = {};\n clusters.forEach(function (cluster) {\n var sameTypeNodes = nodes.filter(function (item) { return item[nodeClusterBy] === cluster; }).map(function (node) { return nodeMap[node.id]; });\n // 找出同类型节点平均位置节点的距离最近的节点作为中心节点\n centerNodeInfo_1[cluster] = (0, util_1.getAvgNodePosition)(sameTypeNodes);\n });\n centripetalOptions = {\n single: function (node) { return getClusterNodeStrength(node); },\n leaf: function (node) { return getClusterNodeStrength(node); },\n others: function (node) { return getClusterNodeStrength(node); },\n center: function (node, nodes, edges) {\n // 找出同类型节点平均位置节点的距离最近的节点作为中心节点\n var centerNode = centerNodeInfo_1[node[nodeClusterBy]];\n return {\n x: centerNode === null || centerNode === void 0 ? void 0 : centerNode.x,\n y: centerNode === null || centerNode === void 0 ? void 0 : centerNode.y,\n };\n },\n };\n }\n this.centripetalOptions = __assign(__assign({}, this.centripetalOptions), centripetalOptions);\n var _b = this.centripetalOptions, leaf = _b.leaf, single = _b.single, others = _b.others;\n if (leaf && typeof leaf !== 'function')\n this.centripetalOptions.leaf = function () { return leaf; };\n if (single && typeof single !== 'function')\n this.centripetalOptions.single = function () { return single; };\n if (others && typeof others !== 'function')\n this.centripetalOptions.others = function () { return others; };\n };\n Force2Layout.prototype.updateCfg = function (cfg) {\n if (cfg)\n Object.assign(this, cfg);\n };\n Force2Layout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 500,\n gravity: 10,\n enableTick: true,\n animate: true,\n };\n };\n /**\n * 执行布局\n */\n Force2Layout.prototype.execute = function () {\n var self = this;\n self.stop();\n var nodes = self.nodes, edges = self.edges, defSpringLen = self.defSpringLen;\n self.judgingDistance = 0;\n if (!nodes || nodes.length === 0) {\n self.onLayoutEnd([]);\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n self.onLayoutEnd([__assign({}, nodes[0])]);\n return;\n }\n self.degreesMap = (0, util_1.getDegreeMap)(nodes, edges);\n if (self.propsGetMass) {\n self.getMass = self.propsGetMass;\n }\n else {\n self.getMass = function (d) {\n var massWeight = 1;\n if ((0, util_1.isNumber)(d.mass))\n massWeight = d.mass;\n var degree = self.degreesMap[d.id].all;\n return (!degree || degree < 5) ? massWeight : degree * 5 * massWeight;\n };\n }\n // node size function\n var nodeSize = self.nodeSize;\n var nodeSizeFunc;\n if (self.preventOverlap) {\n var nodeSpacing_1 = self.nodeSpacing;\n var nodeSpacingFunc_1;\n if ((0, util_1.isNumber)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = function () { return nodeSpacing_1; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = nodeSpacing_1;\n }\n else {\n nodeSpacingFunc_1 = function () { return 0; };\n }\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return Math.max(d.size[0], d.size[1]) + nodeSpacingFunc_1(d);\n }\n if ((0, util_1.isObject)(d.size)) {\n return Math.max(d.size.width, d.size.height) + nodeSpacingFunc_1(d);\n }\n return d.size + nodeSpacingFunc_1(d);\n }\n return 10 + nodeSpacingFunc_1(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function (d) {\n return Math.max(nodeSize[0], nodeSize[1]) + nodeSpacingFunc_1(d);\n };\n }\n else {\n nodeSizeFunc = function (d) { return nodeSize + nodeSpacingFunc_1(d); };\n }\n }\n self.nodeSize = nodeSizeFunc;\n self.linkDistance = proccessToFunc(self.linkDistance, 1);\n self.nodeStrength = proccessToFunc(self.nodeStrength, 1);\n self.edgeStrength = proccessToFunc(self.edgeStrength, 1);\n var nodeMap = {};\n var nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * self.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * self.height;\n var degree = self.degreesMap[node.id];\n nodeMap[node.id] = __assign(__assign({}, node), { data: __assign(__assign({}, node.data), { size: self.nodeSize(node) || 30, layout: {\n inDegree: degree.in,\n outDegree: degree.out,\n degree: degree.all,\n tDegree: degree.in,\n sDegree: degree.out,\n force: {\n mass: self.getMass(node),\n nodeStrength: self.nodeStrength(node)\n }\n } }) });\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n self.edgeInfos = [];\n edges === null || edges === void 0 ? void 0 : edges.forEach(function (edge) {\n var sourceNode = nodeMap[edge.source];\n var targetNode = nodeMap[edge.target];\n if (!sourceNode || !targetNode) {\n elf.edgeInfos.push({});\n }\n else {\n self.edgeInfos.push({\n edgeStrength: self.edgeStrength(edge),\n linkDistance: defSpringLen ? defSpringLen(__assign(__assign({}, edge), { source: sourceNode, target: targetNode }), sourceNode, targetNode) : self.linkDistance(edge, sourceNode, targetNode) || 1 + ((nodeSize(sourceNode) + nodeSize(sourceNode)) || 0) / 2\n });\n }\n });\n this.getCentripetalOptions();\n self.onLayoutEnd = self.onLayoutEnd || (function () { });\n self.run();\n };\n Force2Layout.prototype.run = function () {\n var self = this;\n var maxIteration = self.maxIteration, nodes = self.nodes, workerEnabled = self.workerEnabled, minMovement = self.minMovement, animate = self.animate, nodeMap = self.nodeMap;\n if (!nodes)\n return;\n var velArray = [];\n nodes.forEach(function (_, i) {\n velArray[2 * i] = 0;\n velArray[2 * i + 1] = 0;\n });\n var maxIter = maxIteration;\n var silence = !animate;\n if (workerEnabled || silence) {\n var usedIter = 0;\n for (var i = 0; (self.judgingDistance > minMovement || i < 1) && i < maxIter; i++) {\n usedIter = i;\n self.runOneStep(i, velArray);\n }\n self.onLayoutEnd(Object.values(nodeMap));\n }\n else {\n if (typeof window === \"undefined\")\n return;\n var iter_1 = 0;\n // interval for render the result after each iteration\n this.timeInterval = window.setInterval(function () {\n if (!nodes)\n return;\n self.runOneStep(iter_1, velArray);\n iter_1++;\n if (iter_1 >= maxIter || self.judgingDistance < minMovement) {\n self.onLayoutEnd(Object.values(nodeMap));\n window.clearInterval(self.timeInterval);\n }\n }, 0);\n }\n };\n Force2Layout.prototype.runOneStep = function (iter, velArray) {\n var _a;\n var self = this;\n var nodes = self.nodes, edges = self.edges, nodeMap = self.nodeMap, monitor = self.monitor;\n var accArray = [];\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return;\n self.calRepulsive(accArray);\n if (edges)\n self.calAttractive(accArray);\n self.calGravity(accArray);\n var stepInterval = self.interval; // Math.max(0.02, self.interval - iter * 0.002);\n self.updateVelocity(accArray, velArray, stepInterval);\n self.updatePosition(velArray, stepInterval);\n (_a = self.tick) === null || _a === void 0 ? void 0 : _a.call(self);\n /** 如果需要监控信息,则提供给用户 */\n if (monitor) {\n var energy = this.calTotalEnergy(accArray);\n monitor({ energy: energy, nodes: nodes, edges: edges, iterations: iter });\n }\n };\n Force2Layout.prototype.calTotalEnergy = function (accArray) {\n var _a = this, nodes = _a.nodes, nodeMap = _a.nodeMap;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return 0;\n var energy = 0.0;\n nodes.forEach(function (node, i) {\n var vx = accArray[2 * i];\n var vy = accArray[2 * i + 1];\n var speed2 = vx * vx + vy * vy;\n var _a = nodeMap[node.id].data.layout.force.mass, mass = _a === void 0 ? 1 : _a;\n energy += mass * speed2 * 0.5; // p = 1/2*(mv^2)\n });\n return energy;\n };\n ;\n // coulombs law\n Force2Layout.prototype.calRepulsive = function (accArray) {\n var self = this;\n var nodes = self.nodes, nodeMap = self.nodeMap, factor = self.factor, coulombDisScale = self.coulombDisScale;\n var nodeSize = self.nodeSize;\n (0, ForceNBody_1.forceNBody)(nodes, nodeMap, factor, coulombDisScale * coulombDisScale, accArray);\n };\n // hooks law\n Force2Layout.prototype.calAttractive = function (accArray) {\n var self = this;\n var edges = self.edges, nodeMap = self.nodeMap, nodeIdxMap = self.nodeIdxMap, edgeInfos = self.edgeInfos;\n var nodeSize = self.nodeSize;\n edges.forEach(function (edge, i) {\n var source = (0, util_1.getEdgeTerminal)(edge, 'source');\n var target = (0, util_1.getEdgeTerminal)(edge, 'target');\n var sourceNode = nodeMap[source];\n var targetNode = nodeMap[target];\n if (!sourceNode || !targetNode)\n return;\n var vecX = targetNode.x - sourceNode.x;\n var vecY = targetNode.y - sourceNode.y;\n if (!vecX && !vecY) {\n vecX = Math.random() * 0.01;\n vecY = Math.random() * 0.01;\n }\n var vecLength = Math.sqrt(vecX * vecX + vecY * vecY);\n var direX = vecX / vecLength;\n var direY = vecY / vecLength;\n // @ts-ignore\n var _a = edgeInfos[i] || {}, _b = _a.linkDistance, linkDistance = _b === void 0 ? 200 : _b, _c = _a.edgeStrength, edgeStrength = _c === void 0 ? 200 : _c;\n var diff = linkDistance - vecLength;\n var param = diff * edgeStrength;\n var massSource = sourceNode.data.layout.force.mass || 1;\n var massTarget = targetNode.data.layout.force.mass || 1;\n // 质量占比越大,对另一端影响程度越大\n var sourceMassRatio = 1 / massSource;\n var targetMassRatio = 1 / massTarget;\n var disX = direX * param;\n var disY = direY * param;\n var sourceIdx = 2 * nodeIdxMap[source];\n var targetIdx = 2 * nodeIdxMap[target];\n accArray[sourceIdx] -= disX * sourceMassRatio;\n accArray[sourceIdx + 1] -= disY * sourceMassRatio;\n accArray[targetIdx] += disX * targetMassRatio;\n accArray[targetIdx + 1] += disY * targetMassRatio;\n });\n };\n // attract to center\n Force2Layout.prototype.calGravity = function (accArray) {\n var _a;\n var self = this;\n var nodes = self.nodes, _b = self.edges, edges = _b === void 0 ? [] : _b, nodeMap = self.nodeMap, width = self.width, height = self.height, center = self.center, defaultGravity = self.gravity, degreesMap = self.degreesMap, centripetalOptions = self.centripetalOptions;\n if (!nodes)\n return;\n var nodeLength = nodes.length;\n for (var i = 0; i < nodeLength; i++) {\n var idx = 2 * i;\n var node = nodeMap[nodes[i].id];\n var _c = node.data.layout.force.mass, mass = _c === void 0 ? 1 : _c;\n var vecX = 0;\n var vecY = 0;\n var gravity = defaultGravity;\n var _d = degreesMap[node.id], inDegree = _d.in, outDegree = _d.out, degree = _d.all;\n var forceCenter = (_a = self.getCenter) === null || _a === void 0 ? void 0 : _a.call(self, node, degree);\n if (forceCenter) {\n var centerX = forceCenter[0], centerY = forceCenter[1], strength = forceCenter[2];\n vecX = node.x - centerX;\n vecY = node.y - centerY;\n gravity = strength;\n }\n else {\n vecX = node.x - center[0];\n vecY = node.y - center[1];\n }\n if (gravity) {\n accArray[idx] -= gravity * vecX / mass;\n accArray[idx + 1] -= gravity * vecY / mass;\n }\n if (centripetalOptions) {\n var leaf = centripetalOptions.leaf, single = centripetalOptions.single, others = centripetalOptions.others, centriCenter = centripetalOptions.center;\n var _e = (centriCenter === null || centriCenter === void 0 ? void 0 : centriCenter(node, nodes, edges, width, height)) || { x: 0, y: 0, centerStrength: 0 }, centriX = _e.x, centriY = _e.y, centerStrength = _e.centerStrength;\n if (!(0, util_1.isNumber)(centriX) || !(0, util_1.isNumber)(centriY))\n continue;\n var vx = (node.x - centriX) / mass;\n var vy = (node.y - centriY) / mass;\n if (centerStrength) {\n accArray[idx] -= centerStrength * vx;\n accArray[idx + 1] -= centerStrength * vy;\n }\n // 孤点\n if (degree === 0) {\n var singleStrength = single(node);\n if (!singleStrength)\n continue;\n accArray[idx] -= singleStrength * vx;\n accArray[idx + 1] -= singleStrength * vy;\n continue;\n }\n // 没有出度或没有入度,都认为是叶子节点\n if (inDegree === 0 || outDegree === 0) {\n var leafStrength = leaf(node, nodes, edges);\n if (!leafStrength)\n continue;\n accArray[idx] -= leafStrength * vx;\n accArray[idx + 1] -= leafStrength * vy;\n continue;\n }\n /** others */\n var othersStrength = others(node);\n if (!othersStrength)\n continue;\n accArray[idx] -= othersStrength * vx;\n accArray[idx + 1] -= othersStrength * vy;\n }\n }\n };\n // TODO: 待 graphin 修改正确\n // public attractToSide(accArray: number[]) {\n // const { defSideCoe, height, nodes } = this;\n // if (!defSideCoe || typeof defSideCoe !== 'function' || !nodes?.length) return;\n // nodes.forEach((node, i) => {\n // const sideCoe = defSideCoe!(node);\n // if (sideCoe === 0) return;\n // const targetY = sideCoe > 0 ? 0 : height;\n // const strength = Math.abs(sideCoe);\n // accArray[2 * i + 1] -= strength * (targetY - node.y);\n // });\n // };\n Force2Layout.prototype.updateVelocity = function (accArray, velArray, stepInterval) {\n var self = this;\n var nodes = self.nodes, damping = self.damping, maxSpeed = self.maxSpeed;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return;\n nodes.forEach(function (_, i) {\n var vx = (velArray[2 * i] + accArray[2 * i] * stepInterval) * damping || 0.01;\n var vy = (velArray[2 * i + 1] + accArray[2 * i + 1] * stepInterval) * damping || 0.01;\n var vLength = Math.sqrt(vx * vx + vy * vy);\n if (vLength > maxSpeed) {\n var param2 = maxSpeed / vLength;\n vx = param2 * vx;\n vy = param2 * vy;\n }\n velArray[2 * i] = vx;\n velArray[2 * i + 1] = vy;\n });\n };\n Force2Layout.prototype.updatePosition = function (velArray, stepInterval) {\n var self = this;\n var nodes = self.nodes, distanceThresholdMode = self.distanceThresholdMode, nodeMap = self.nodeMap;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length)) {\n this.judgingDistance = 0;\n return;\n }\n var sum = 0;\n if (distanceThresholdMode === 'max')\n self.judgingDistance = -Infinity;\n else if (distanceThresholdMode === 'min')\n self.judgingDistance = Infinity;\n nodes.forEach(function (node, i) {\n var mappedNode = nodeMap[node.id];\n if ((0, util_1.isNumber)(node.fx) && (0, util_1.isNumber)(node.fy)) {\n node.x = node.fx;\n node.y = node.fy;\n mappedNode.x = node.x;\n mappedNode.y = node.y;\n return;\n }\n var distX = velArray[2 * i] * stepInterval;\n var distY = velArray[2 * i + 1] * stepInterval;\n node.x += distX;\n node.y += distY;\n mappedNode.x = node.x;\n mappedNode.y = node.y;\n var distanceMagnitude = Math.sqrt(distX * distX + distY * distY);\n switch (distanceThresholdMode) {\n case 'max':\n if (self.judgingDistance < distanceMagnitude)\n self.judgingDistance = distanceMagnitude;\n break;\n case 'min':\n if (self.judgingDistance > distanceMagnitude)\n self.judgingDistance = distanceMagnitude;\n break;\n default:\n sum = sum + distanceMagnitude;\n break;\n }\n });\n if (!distanceThresholdMode || distanceThresholdMode === 'mean')\n self.judgingDistance = sum / nodes.length;\n };\n Force2Layout.prototype.stop = function () {\n if (this.timeInterval && typeof window !== \"undefined\") {\n window.clearInterval(this.timeInterval);\n }\n };\n Force2Layout.prototype.destroy = function () {\n var self = this;\n self.stop();\n self.tick = null;\n self.nodes = null;\n self.edges = null;\n self.destroyed = true;\n };\n Force2Layout.prototype.getType = function () {\n return \"force2\";\n };\n Force2Layout.prototype.getSameTypeLeafMap = function () {\n var _a = this, nodeClusterBy = _a.nodeClusterBy, nodes = _a.nodes, edges = _a.edges, nodeMap = _a.nodeMap, degreesMap = _a.degreesMap;\n if (!(nodes === null || nodes === void 0 ? void 0 : nodes.length))\n return;\n // eslint-disable-next-line\n var sameTypeLeafMap = {};\n nodes.forEach(function (node, i) {\n var degree = degreesMap[node.id].all;\n if (degree === 1) {\n sameTypeLeafMap[node.id] = (0, util_1.getCoreNodeAndRelativeLeafNodes)('leaf', node, edges, nodeClusterBy, degreesMap, nodeMap);\n }\n });\n return sameTypeLeafMap;\n };\n ;\n return Force2Layout;\n}(base_1.Base));\nexports.Force2Layout = Force2Layout;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/force2/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar isNull = function (value) {\n return value === null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNull);\n//# sourceMappingURL=is-null.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-null.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/forceAtlas2/body.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/forceAtlas2/body.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number-equal.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number-equal.js ***! + \*****************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// represents a body(a point mass) and its position\nvar Body = /** @class */ (function () {\n function Body(params) {\n /**\n * the id of this body, the same with the node id\n * @type {number}\n */\n this.id = params.id || 0;\n /**\n * the position of this body\n * @type {number}\n */\n this.rx = params.rx;\n /**\n * the position of this body\n * @type {number}\n */\n this.ry = params.ry;\n /**\n * the force acting on this body\n * @type {number}\n */\n this.fx = 0;\n /**\n * the force acting on this body\n * @type {number}\n */\n this.fy = 0;\n /**\n * the mass of this body, =1 for a node\n * @type {number}\n */\n this.mass = params.mass;\n /**\n * the degree of the node represented by this body\n * @type {number}\n */\n this.degree = params.degree;\n /**\n * the parameter for repulsive force, = kr\n * @type {number}\n */\n this.g = params.g || 0;\n }\n // returns the euclidean distance\n Body.prototype.distanceTo = function (bo) {\n var dx = this.rx - bo.rx;\n var dy = this.ry - bo.ry;\n return Math.hypot(dx, dy);\n };\n Body.prototype.setPos = function (x, y) {\n this.rx = x;\n this.ry = y;\n };\n // resets the forces\n Body.prototype.resetForce = function () {\n this.fx = 0;\n this.fy = 0;\n };\n Body.prototype.addForce = function (b) {\n var dx = b.rx - this.rx;\n var dy = b.ry - this.ry;\n var dist = Math.hypot(dx, dy);\n dist = dist < 0.0001 ? 0.0001 : dist;\n // the repulsive defined by force atlas 2\n var F = (this.g * (this.degree + 1) * (b.degree + 1)) / dist;\n this.fx += F * dx / dist;\n this.fy += F * dy / dist;\n };\n // if quad contains this body\n Body.prototype.in = function (quad) {\n return quad.contains(this.rx, this.ry);\n };\n // returns a new body\n Body.prototype.add = function (bo) {\n var nenwMass = this.mass + bo.mass;\n var x = (this.rx * this.mass + bo.rx * bo.mass) / nenwMass;\n var y = (this.ry * this.mass + bo.ry * bo.mass) / nenwMass;\n var dg = this.degree + bo.degree;\n var params = {\n rx: x,\n ry: y,\n mass: nenwMass,\n degree: dg\n };\n return new Body(params);\n };\n return Body;\n}());\nexports.default = Body;\n//# sourceMappingURL=body.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/forceAtlas2/body.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isNumberEqual; });\nvar PRECISION = 0.00001; // numbers less than this is considered as 0\nfunction isNumberEqual(a, b, precision) {\n if (precision === void 0) { precision = PRECISION; }\n return Math.abs(a - b) < precision;\n}\n//# sourceMappingURL=is-number-equal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number-equal.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ForceAtlas2Layout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar body_1 = __importDefault(__webpack_require__(/*! ./body */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/body.js\"));\nvar quad_1 = __importDefault(__webpack_require__(/*! ./quad */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/quad.js\"));\nvar quadTree_1 = __importDefault(__webpack_require__(/*! ./quadTree */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/quadTree.js\"));\nvar ForceAtlas2Layout = /** @class */ (function (_super) {\n __extends(ForceAtlas2Layout, _super);\n function ForceAtlas2Layout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 宽度 */\n _this.width = 300;\n /** 高度 */\n _this.height = 300;\n _this.nodes = [];\n _this.edges = [];\n /**\n * the parameter for repulsive forces,\n * it will scale the layout but won't change the layout\n * larger the kr, looser the layout\n * @type {number}\n */\n _this.kr = 5;\n /**\n * the parameter for gravity forces\n * @type {number}\n */\n _this.kg = 1;\n /**\n * modes:\n * 'normal' for normal using\n * 'linlog' for compact clusters.\n * @type {string}\n */\n _this.mode = 'normal';\n /**\n * whether preventing the node overlapping\n * @type {boolean}\n */\n _this.preventOverlap = false;\n /**\n * whether active the dissuade hub mode\n * true: grant authorities (nodes with a high indegree)\n * a more central position than hubs (nodes with a high outdegree)\n * @type {boolean}\n */\n _this.dissuadeHubs = false;\n /**\n * whether active the barnes hut optimization on computing repulsive forces\n * @type {boolean}\n */\n _this.barnesHut = undefined;\n /**\n * the max iteration number\n * @type {number}\n */\n _this.maxIteration = 0;\n /**\n * control the global velocity\n * defualt: 0.1(gephi)\n * @type {number}\n */\n _this.ks = 0.1;\n /**\n * the max global velocity\n * @type {number}\n */\n _this.ksmax = 10;\n /**\n * the tolerance for the global swinging\n * @type {number}\n */\n _this.tao = 0.1;\n /**\n * the function of layout complete listener, display the legend and minimap after layout\n * @type {function}\n */\n _this.onLayoutEnd = function () { };\n /**\n * activate prune or not.\n * prune the leaves during most iterations, layout the leaves in the last 50 iteraitons.\n * if prune === '', it will be activated when the nodes number > 100\n * note that it will reduce the quality of the layout\n * @type {boolean}\n */\n _this.prune = undefined;\n _this.updateCfg(options);\n return _this;\n }\n ForceAtlas2Layout.prototype.getDefaultCfg = function () {\n return {};\n };\n // execute the layout\n ForceAtlas2Layout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes, onLayoutEnd = self.onLayoutEnd, prune = self.prune;\n var maxIteration = self.maxIteration;\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n // the whidth of each nodes\n var sizes = [];\n var nodeNum = nodes.length;\n for (var i = 0; i < nodeNum; i += 1) {\n var node = nodes[i];\n var nodeWidth = 10;\n var nodeHeight = 10;\n if ((0, util_1.isNumber)(node.size)) {\n nodeWidth = node.size;\n nodeHeight = node.size;\n }\n if ((0, util_1.isArray)(node.size)) {\n if (!isNaN(node.size[0]))\n nodeWidth = node.size[0];\n if (!isNaN(node.size[1]))\n nodeHeight = node.size[1];\n }\n else if ((0, util_1.isObject)(node.size)) {\n nodeWidth = node.size.width;\n nodeHeight = node.size.height;\n }\n if (self.getWidth && !isNaN(self.getWidth(node)))\n nodeHeight = self.getWidth(node);\n if (self.getHeight && !isNaN(self.getHeight(node)))\n nodeWidth = self.getHeight(node);\n var maxSize = Math.max(nodeWidth, nodeHeight);\n sizes.push(maxSize);\n }\n if (self.barnesHut === undefined && nodeNum > 250)\n self.barnesHut = true;\n if (self.prune === undefined && nodeNum > 100)\n self.prune = true;\n if (this.maxIteration === 0 && !self.prune) {\n maxIteration = 250;\n if (nodeNum <= 200 && nodeNum > 100)\n maxIteration = 1000;\n else if (nodeNum > 200)\n maxIteration = 1200;\n this.maxIteration = maxIteration;\n }\n else if (this.maxIteration === 0 && prune) {\n maxIteration = 100;\n if (nodeNum <= 200 && nodeNum > 100)\n maxIteration = 500;\n else if (nodeNum > 200)\n maxIteration = 950;\n this.maxIteration = maxIteration;\n }\n if (!self.kr) {\n self.kr = 50;\n if (nodeNum > 100 && nodeNum <= 500)\n self.kr = 20;\n else if (nodeNum > 500)\n self.kr = 1;\n }\n if (!self.kg) {\n self.kg = 20;\n if (nodeNum > 100 && nodeNum <= 500)\n self.kg = 10;\n else if (nodeNum > 500)\n self.kg = 1;\n }\n this.nodes = self.updateNodesByForces(sizes);\n onLayoutEnd();\n };\n ForceAtlas2Layout.prototype.updateNodesByForces = function (sizes) {\n var self = this;\n var edges = self.edges, maxIteration = self.maxIteration;\n var nodes = self.nodes;\n var nonLoopEdges = edges.filter(function (edge) {\n var source = (0, util_1.getEdgeTerminal)(edge, 'source');\n var target = (0, util_1.getEdgeTerminal)(edge, 'target');\n return source !== target;\n });\n var size = nodes.length;\n var esize = nonLoopEdges.length;\n var degrees = [];\n var idMap = {};\n var edgeEndsIdMap = {};\n // tslint:disable-next-line\n var Es = [];\n for (var i = 0; i < size; i += 1) {\n idMap[nodes[i].id] = i;\n degrees[i] = 0;\n if (nodes[i].x === undefined || isNaN(nodes[i].x)) {\n nodes[i].x = Math.random() * 1000;\n }\n if (nodes[i].y === undefined || isNaN(nodes[i].y)) {\n nodes[i].y = Math.random() * 1000;\n }\n Es.push({ x: nodes[i].x, y: nodes[i].y });\n }\n for (var i = 0; i < esize; i += 1) {\n var node1 = void 0;\n var node2 = void 0;\n var sIdx = 0;\n var tIdx = 0;\n for (var j = 0; j < size; j += 1) {\n var source = (0, util_1.getEdgeTerminal)(nonLoopEdges[i], 'source');\n var target = (0, util_1.getEdgeTerminal)(nonLoopEdges[i], 'target');\n if (nodes[j].id === source) {\n node1 = nodes[j];\n sIdx = j;\n }\n else if (nodes[j].id === target) {\n node2 = nodes[j];\n tIdx = j;\n }\n edgeEndsIdMap[i] = { sourceIdx: sIdx, targetIdx: tIdx };\n }\n if (node1)\n degrees[idMap[node1.id]] += 1;\n if (node2)\n degrees[idMap[node2.id]] += 1;\n }\n var iteration = maxIteration;\n nodes = this.iterate(iteration, idMap, edgeEndsIdMap, esize, degrees, sizes);\n // if prune, place the leaves around their parents, and then re-layout for several iterations.\n if (self.prune) {\n for (var j = 0; j < esize; j += 1) {\n if (degrees[edgeEndsIdMap[j].sourceIdx] <= 1) {\n nodes[edgeEndsIdMap[j].sourceIdx].x = nodes[edgeEndsIdMap[j].targetIdx].x;\n nodes[edgeEndsIdMap[j].sourceIdx].y = nodes[edgeEndsIdMap[j].targetIdx].y;\n }\n else if (degrees[edgeEndsIdMap[j].targetIdx] <= 1) {\n nodes[edgeEndsIdMap[j].targetIdx].x = nodes[edgeEndsIdMap[j].sourceIdx].x;\n nodes[edgeEndsIdMap[j].targetIdx].y = nodes[edgeEndsIdMap[j].sourceIdx].y;\n }\n }\n self.prune = false;\n self.barnesHut = false;\n iteration = 100;\n nodes = this.iterate(iteration, idMap, edgeEndsIdMap, esize, degrees, sizes);\n }\n return nodes;\n };\n ForceAtlas2Layout.prototype.iterate = function (iteration, idMap, edgeEndsIdMap, esize, degrees, sizes) {\n var self = this;\n var nodes = self.nodes;\n var kr = self.kr, preventOverlap = self.preventOverlap;\n var barnesHut = self.barnesHut;\n var nodeNum = nodes.length;\n var sg = 0;\n var krPrime = 100;\n var iter = iteration;\n var prevoIter = 50;\n var forces = [];\n var preForces = [];\n var bodies = [];\n for (var i = 0; i < nodeNum; i += 1) {\n forces[2 * i] = 0;\n forces[2 * i + 1] = 0;\n if (barnesHut) {\n var params = {\n id: i,\n rx: nodes[i].x,\n ry: nodes[i].y,\n mass: 1,\n g: kr,\n degree: degrees[i]\n };\n bodies[i] = new body_1.default(params);\n }\n }\n while (iter > 0) {\n for (var i = 0; i < nodeNum; i += 1) {\n preForces[2 * i] = forces[2 * i];\n preForces[2 * i + 1] = forces[2 * i + 1];\n forces[2 * i] = 0;\n forces[2 * i + 1] = 0;\n }\n // attractive forces, existing on every actual edge\n forces = this.getAttrForces(iter, prevoIter, esize, idMap, edgeEndsIdMap, degrees, sizes, forces);\n // repulsive forces and Gravity, existing on every node pair\n // if preventOverlap, using the no-optimized method in the last prevoIter instead.\n if (barnesHut && ((preventOverlap && iter > prevoIter) || !preventOverlap)) {\n forces = this.getOptRepGraForces(forces, bodies, degrees);\n }\n else {\n forces = this.getRepGraForces(iter, prevoIter, forces, krPrime, sizes, degrees);\n }\n // update the positions\n var res = this.updatePos(forces, preForces, sg, degrees);\n nodes = res.nodes;\n sg = res.sg;\n iter--;\n if (self.tick)\n self.tick();\n }\n return nodes;\n };\n ForceAtlas2Layout.prototype.getAttrForces = function (iter, prevoIter, esize, idMap, edgeEndsIdMap, degrees, sizes, forces) {\n var self = this;\n var nodes = self.nodes, preventOverlap = self.preventOverlap, dissuadeHubs = self.dissuadeHubs, mode = self.mode, prune = self.prune;\n for (var i = 0; i < esize; i += 1) {\n var sourceNode = nodes[edgeEndsIdMap[i].sourceIdx];\n var sourceIdx = edgeEndsIdMap[i].sourceIdx;\n var targetNode = nodes[edgeEndsIdMap[i].targetIdx];\n var targetIdx = edgeEndsIdMap[i].targetIdx;\n if (prune && (degrees[sourceIdx] <= 1 || degrees[targetIdx] <= 1))\n continue;\n var dir = [targetNode.x - sourceNode.x, targetNode.y - sourceNode.y];\n var eucliDis = Math.hypot(dir[0], dir[1]);\n eucliDis = eucliDis < 0.0001 ? 0.0001 : eucliDis;\n dir[0] = dir[0] / eucliDis;\n dir[1] = dir[1] / eucliDis;\n if (preventOverlap && iter < prevoIter)\n eucliDis = eucliDis - sizes[sourceIdx] - sizes[targetIdx];\n var Fa1 = eucliDis; // tslint:disable-line\n var Fa2 = Fa1; // tslint:disable-line\n if (mode === 'linlog') {\n Fa1 = Math.log(1 + eucliDis);\n Fa2 = Fa1;\n }\n if (dissuadeHubs) {\n Fa1 = eucliDis / degrees[sourceIdx];\n Fa2 = eucliDis / degrees[targetIdx];\n }\n if (preventOverlap && iter < prevoIter && eucliDis <= 0) {\n Fa1 = 0;\n Fa2 = 0;\n }\n else if (preventOverlap && iter < prevoIter && eucliDis > 0) {\n Fa1 = eucliDis;\n Fa2 = eucliDis;\n }\n forces[2 * idMap[sourceNode.id]] += Fa1 * dir[0];\n forces[2 * idMap[targetNode.id]] -= Fa2 * dir[0];\n forces[2 * idMap[sourceNode.id] + 1] += Fa1 * dir[1];\n forces[2 * idMap[targetNode.id] + 1] -= Fa2 * dir[1];\n }\n return forces;\n };\n ForceAtlas2Layout.prototype.getRepGraForces = function (iter, prevoIter, forces, krPrime, sizes, degrees) {\n var self = this;\n var nodes = self.nodes, preventOverlap = self.preventOverlap, kr = self.kr, kg = self.kg, center = self.center, prune = self.prune;\n var nodeNum = nodes.length;\n for (var i = 0; i < nodeNum; i += 1) {\n for (var j = i + 1; j < nodeNum; j += 1) {\n if (prune && (degrees[i] <= 1 || degrees[j] <= 1))\n continue;\n var dir_1 = [nodes[j].x - nodes[i].x, nodes[j].y - nodes[i].y];\n var eucliDis_1 = Math.hypot(dir_1[0], dir_1[1]);\n eucliDis_1 = eucliDis_1 < 0.0001 ? 0.0001 : eucliDis_1;\n dir_1[0] = dir_1[0] / eucliDis_1;\n dir_1[1] = dir_1[1] / eucliDis_1;\n if (preventOverlap && iter < prevoIter)\n eucliDis_1 = eucliDis_1 - sizes[i] - sizes[j];\n var Fr = kr * (degrees[i] + 1) * (degrees[j] + 1) / eucliDis_1; // tslint:disable-line\n if (preventOverlap && iter < prevoIter && eucliDis_1 < 0) {\n Fr = krPrime * (degrees[i] + 1) * (degrees[j] + 1);\n }\n else if (preventOverlap && iter < prevoIter && eucliDis_1 === 0) {\n Fr = 0;\n }\n else if (preventOverlap && iter < prevoIter && eucliDis_1 > 0) {\n Fr = kr * (degrees[i] + 1) * (degrees[j] + 1) / eucliDis_1;\n }\n forces[2 * i] -= Fr * dir_1[0];\n forces[2 * j] += Fr * dir_1[0];\n forces[2 * i + 1] -= Fr * dir_1[1];\n forces[2 * j + 1] += Fr * dir_1[1];\n }\n // gravity\n var dir = [nodes[i].x - center[0], nodes[i].y - center[1]];\n var eucliDis = Math.hypot(dir[0], dir[1]);\n dir[0] = dir[0] / eucliDis;\n dir[1] = dir[1] / eucliDis;\n var Fg = kg * (degrees[i] + 1); // tslint:disable-line\n forces[2 * i] -= Fg * dir[0];\n forces[2 * i + 1] -= Fg * dir[1];\n }\n return forces;\n };\n ForceAtlas2Layout.prototype.getOptRepGraForces = function (forces, bodies, degrees) {\n var self = this;\n var nodes = self.nodes, kg = self.kg, center = self.center, prune = self.prune;\n var nodeNum = nodes.length;\n var minx = 9e10;\n var maxx = -9e10;\n var miny = 9e10;\n var maxy = -9e10;\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n bodies[i].setPos(nodes[i].x, nodes[i].y);\n if (nodes[i].x >= maxx)\n maxx = nodes[i].x;\n if (nodes[i].x <= minx)\n minx = nodes[i].x;\n if (nodes[i].y >= maxy)\n maxy = nodes[i].y;\n if (nodes[i].y <= miny)\n miny = nodes[i].y;\n }\n var width = Math.max(maxx - minx, maxy - miny);\n var quadParams = {\n xmid: (maxx + minx) / 2,\n ymid: (maxy + miny) / 2,\n length: width,\n massCenter: center,\n mass: nodeNum\n };\n var quad = new quad_1.default(quadParams);\n var quadTree = new quadTree_1.default(quad);\n // build the tree, insert the nodes(quads) into the tree\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n if (bodies[i].in(quad))\n quadTree.insert(bodies[i]);\n }\n // update the repulsive forces and the gravity.\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n bodies[i].resetForce();\n quadTree.updateForce(bodies[i]);\n forces[2 * i] -= bodies[i].fx;\n forces[2 * i + 1] -= bodies[i].fy;\n // gravity\n var dir = [nodes[i].x - center[0], nodes[i].y - center[1]];\n var eucliDis = Math.hypot(dir[0], dir[1]);\n eucliDis = eucliDis < 0.0001 ? 0.0001 : eucliDis;\n dir[0] = dir[0] / eucliDis;\n dir[1] = dir[1] / eucliDis;\n var Fg = kg * (degrees[i] + 1); // tslint:disable-line\n forces[2 * i] -= Fg * dir[0];\n forces[2 * i + 1] -= Fg * dir[1];\n }\n return forces;\n };\n ForceAtlas2Layout.prototype.updatePos = function (forces, preForces, sg, degrees) {\n var self = this;\n var nodes = self.nodes, ks = self.ks, tao = self.tao, prune = self.prune, ksmax = self.ksmax;\n var nodeNum = nodes.length;\n var swgns = [];\n var trans = [];\n // swg(G) and tra(G)\n var swgG = 0;\n var traG = 0;\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n var minus = [forces[2 * i] - preForces[2 * i],\n forces[2 * i + 1] - preForces[2 * i + 1]\n ];\n var minusNorm = Math.hypot(minus[0], minus[1]);\n var add = [forces[2 * i] + preForces[2 * i],\n forces[2 * i + 1] + preForces[2 * i + 1]\n ];\n var addNorm = Math.hypot(add[0], add[1]);\n swgns[i] = minusNorm;\n trans[i] = addNorm / 2;\n swgG += (degrees[i] + 1) * swgns[i];\n traG += (degrees[i] + 1) * trans[i];\n }\n var preSG = sg;\n sg = tao * traG / swgG; // tslint:disable-line\n if (preSG !== 0) {\n sg = sg > (1.5 * preSG) ? (1.5 * preSG) : sg; // tslint:disable-line\n }\n // update the node positions\n for (var i = 0; i < nodeNum; i += 1) {\n if (prune && (degrees[i] <= 1))\n continue;\n if ((0, util_1.isNumber)(nodes[i].fx) && (0, util_1.isNumber)(nodes[i].fy))\n continue;\n var sn = ks * sg / (1 + sg * Math.sqrt(swgns[i]));\n var absForce = Math.hypot(forces[2 * i], forces[2 * i + 1]);\n absForce = absForce < 0.0001 ? 0.0001 : absForce;\n var max = ksmax / absForce;\n sn = sn > max ? max : sn;\n var dnx = sn * forces[2 * i];\n var dny = sn * forces[2 * i + 1];\n nodes[i].x += dnx;\n nodes[i].y += dny;\n }\n return { nodes: nodes, sg: sg };\n };\n return ForceAtlas2Layout;\n}(base_1.Base));\nexports.ForceAtlas2Layout = ForceAtlas2Layout;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n/**\n * 判断是否数字\n * @return {Boolean} 是否数字\n */\n\nvar isNumber = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Number');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNumber);\n//# sourceMappingURL=is-number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/forceAtlas2/quad.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/forceAtlas2/quad.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object-like.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object-like.js ***! + \****************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar Quad = /** @class */ (function () {\n function Quad(params) {\n /**\n * the center position of this quad\n * @type {number}\n */\n this.xmid = params.xmid;\n /**\n * the center position of this quad\n * @type {number}\n */\n this.ymid = params.ymid;\n /**\n * the length of this quad\n * @type {number}\n */\n this.length = params.length;\n /**\n * the mass center of this quad\n * @type {number}\n */\n this.massCenter = params.massCenter || [0, 0];\n /**\n * the mass of this quad\n * @type {number}\n */\n this.mass = params.mass || 1;\n }\n Quad.prototype.getLength = function () {\n return this.length;\n };\n Quad.prototype.contains = function (x, y) {\n var halfLen = this.length / 2;\n return (x <= this.xmid + halfLen &&\n x >= this.xmid - halfLen &&\n y <= this.ymid + halfLen &&\n y >= this.ymid - halfLen);\n };\n // northwest quadrant\n // tslint:disable-next-line\n Quad.prototype.NW = function () {\n var x = this.xmid - this.length / 4;\n var y = this.ymid + this.length / 4;\n var len = this.length / 2;\n var params = {\n xmid: x,\n ymid: y,\n length: len\n };\n var NW = new Quad(params);\n return NW;\n };\n // northeast\n // tslint:disable-next-line\n Quad.prototype.NE = function () {\n var x = this.xmid + this.length / 4;\n var y = this.ymid + this.length / 4;\n var len = this.length / 2;\n var params = {\n xmid: x,\n ymid: y,\n length: len\n };\n var NE = new Quad(params);\n return NE;\n };\n // southwest\n // tslint:disable-next-line\n Quad.prototype.SW = function () {\n var x = this.xmid - this.length / 4;\n var y = this.ymid - this.length / 4;\n var len = this.length / 2;\n var params = {\n xmid: x,\n ymid: y,\n length: len\n };\n var SW = new Quad(params);\n return SW;\n };\n // southeast\n // tslint:disable-next-line\n Quad.prototype.SE = function () {\n var x = this.xmid + this.length / 4;\n var y = this.ymid - this.length / 4;\n var len = this.length / 2;\n var params = {\n xmid: x,\n ymid: y,\n length: len\n };\n var SE = new Quad(params);\n return SE;\n };\n return Quad;\n}());\nexports.default = Quad;\n//# sourceMappingURL=quad.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/forceAtlas2/quad.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar isObjectLike = function (value) {\n /**\n * isObjectLike({}) => true\n * isObjectLike([1, 2, 3]) => true\n * isObjectLike(Function) => false\n * isObjectLike(null) => false\n */\n return typeof value === 'object' && value !== null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isObjectLike);\n//# sourceMappingURL=is-object-like.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object-like.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/forceAtlas2/quadTree.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/forceAtlas2/quadTree.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * @fileOverview quadTree\n * @author shiwu.wyy@antfin.com\n */\nvar QuadTree = /** @class */ (function () {\n // each quadtree represents a quadrant and an aggregate body\n // that represents all bodies inside the quadrant\n function QuadTree(param) {\n /**\n * (aggregated) body in this quad\n * @type {object}\n */\n this.body = null;\n /**\n * tree representing the northwest quadrant\n * @type {object}\n */\n this.quad = null;\n this.NW = null;\n this.NE = null;\n this.SW = null;\n this.SE = null;\n /**\n * threshold\n * @type {number}\n */\n this.theta = 0.5;\n if (param != null)\n this.quad = param;\n }\n // insert a body(node) into the tree\n QuadTree.prototype.insert = function (bo) {\n // if this node does not contain a body, put the new body bo here\n if (this.body == null) {\n this.body = bo;\n return;\n }\n // internal node\n if (!this._isExternal()) {\n // update mass info\n this.body = this.body.add(bo);\n // insert body into quadrant\n this._putBody(bo);\n }\n else { // external node\n // divide this region into four children\n if (this.quad) {\n this.NW = new QuadTree(this.quad.NW());\n this.NE = new QuadTree(this.quad.NE());\n this.SW = new QuadTree(this.quad.SW());\n this.SE = new QuadTree(this.quad.SE());\n }\n // insert this body and bo\n this._putBody(this.body);\n this._putBody(bo);\n // update the mass info\n this.body = this.body.add(bo);\n }\n };\n // inserts bo into a quad\n // tslint:disable-next-line\n QuadTree.prototype._putBody = function (bo) {\n if (!this.quad)\n return;\n if (bo.in(this.quad.NW()) && this.NW)\n this.NW.insert(bo);\n else if (bo.in(this.quad.NE()) && this.NE)\n this.NE.insert(bo);\n else if (bo.in(this.quad.SW()) && this.SW)\n this.SW.insert(bo);\n else if (bo.in(this.quad.SE()) && this.SE)\n this.SE.insert(bo);\n };\n // tslint:disable-next-line\n QuadTree.prototype._isExternal = function () {\n // four children are null\n return (this.NW == null && this.NE == null && this.SW == null && this.SE == null);\n };\n // update the forces\n QuadTree.prototype.updateForce = function (bo) {\n if (this.body == null || bo === this.body) {\n return;\n }\n // if the current node is external\n if (this._isExternal())\n bo.addForce(this.body);\n // internal nodes\n else {\n var s = this.quad ? this.quad.getLength() : 0;\n var d = this.body.distanceTo(bo);\n // b is far enough\n if ((s / d) < this.theta)\n bo.addForce(this.body);\n else {\n this.NW && this.NW.updateForce(bo);\n this.NE && this.NE.updateForce(bo);\n this.SW && this.SW.updateForce(bo);\n this.SE && this.SE.updateForce(bo);\n }\n }\n };\n return QuadTree;\n}());\nexports.default = QuadTree;\n//# sourceMappingURL=quadTree.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/forceAtlas2/quadTree.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n /**\n * isObject({}) => true\n * isObject([1, 2, 3]) => true\n * isObject(Function) => true\n * isObject(null) => false\n */\n var type = typeof value;\n return (value !== null && type === 'object') || type === 'function';\n});\n//# sourceMappingURL=is-object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/fruchterman.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/fruchterman.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-odd.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-odd.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FruchtermanLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar SPEED_DIVISOR = 800;\n/**\n * fruchterman 布局\n */\nvar FruchtermanLayout = /** @class */ (function (_super) {\n __extends(FruchtermanLayout, _super);\n function FruchtermanLayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 是否启动 worker */\n _this.workerEnabled = false;\n /** 重力大小,影响图的紧凑程度 */\n _this.gravity = 10;\n /** 速度 */\n _this.speed = 5;\n /** 是否产生聚类力 */\n _this.clustering = false;\n /** 聚类力大小 */\n _this.clusterGravity = 10;\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n /** 每次迭代结束的回调函数 */\n _this.tick = function () { };\n /** 是否使用 window.setInterval 运行迭代 */\n _this.animate = true;\n _this.updateCfg(options);\n return _this;\n }\n FruchtermanLayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 1000,\n gravity: 10,\n speed: 1,\n clustering: false,\n clusterGravity: 10,\n animate: true\n };\n };\n /**\n * 执行布局\n */\n FruchtermanLayout.prototype.execute = function () {\n var _this = this;\n var _a, _b;\n var self = this;\n var nodes = self.nodes;\n if (self.timeInterval !== undefined && typeof window !== \"undefined\") {\n window.clearInterval(self.timeInterval);\n }\n if (!nodes || nodes.length === 0) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n (_b = self.onLayoutEnd) === null || _b === void 0 ? void 0 : _b.call(self);\n return;\n }\n var nodeMap = {};\n var nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * _this.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * _this.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n // layout\n return self.run();\n };\n FruchtermanLayout.prototype.run = function () {\n var _a;\n var self = this;\n var nodes = self.nodes;\n if (!nodes)\n return;\n var edges = self.edges, maxIteration = self.maxIteration, workerEnabled = self.workerEnabled, clustering = self.clustering, animate = self.animate;\n var clusterMap = {};\n if (clustering) {\n nodes.forEach(function (n) {\n if (clusterMap[n.cluster] === undefined) {\n clusterMap[n.cluster] = {\n name: n.cluster,\n cx: 0,\n cy: 0,\n count: 0\n };\n }\n });\n }\n if (workerEnabled || !animate) {\n for (var i = 0; i < maxIteration; i++) {\n self.runOneStep(clusterMap);\n }\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n }\n else {\n if (typeof window === \"undefined\")\n return;\n var iter_1 = 0;\n // interval for render the result after each iteration\n this.timeInterval = window.setInterval(function () {\n var _a;\n self.runOneStep(clusterMap);\n iter_1++;\n if (iter_1 >= maxIteration) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n window.clearInterval(self.timeInterval);\n }\n }, 0);\n }\n return {\n nodes: nodes,\n edges: edges\n };\n };\n FruchtermanLayout.prototype.runOneStep = function (clusterMap) {\n var _a;\n var self = this;\n var nodes = self.nodes;\n if (!nodes)\n return;\n var edges = self.edges, center = self.center, gravity = self.gravity, speed = self.speed, clustering = self.clustering;\n var area = self.height * self.width;\n var maxDisplace = Math.sqrt(area) / 10;\n var k2 = area / (nodes.length + 1);\n var k = Math.sqrt(k2);\n var displacements = [];\n nodes.forEach(function (_, j) {\n displacements[j] = { x: 0, y: 0 };\n });\n self.applyCalculate(nodes, edges, displacements, k, k2);\n // gravity for clusters\n if (clustering) {\n // re-compute the clustering centers\n for (var key in clusterMap) {\n clusterMap[key].cx = 0;\n clusterMap[key].cy = 0;\n clusterMap[key].count = 0;\n }\n nodes.forEach(function (n) {\n var c = clusterMap[n.cluster];\n if ((0, util_1.isNumber)(n.x)) {\n c.cx += n.x;\n }\n if ((0, util_1.isNumber)(n.y)) {\n c.cy += n.y;\n }\n c.count++;\n });\n for (var key in clusterMap) {\n clusterMap[key].cx /= clusterMap[key].count;\n clusterMap[key].cy /= clusterMap[key].count;\n }\n // compute the cluster gravity forces\n var clusterGravity_1 = self.clusterGravity || gravity;\n nodes.forEach(function (n, j) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n var c = clusterMap[n.cluster];\n var distLength = Math.sqrt((n.x - c.cx) * (n.x - c.cx) + (n.y - c.cy) * (n.y - c.cy));\n var gravityForce = k * clusterGravity_1;\n displacements[j].x -= (gravityForce * (n.x - c.cx)) / distLength;\n displacements[j].y -= (gravityForce * (n.y - c.cy)) / distLength;\n });\n }\n // gravity\n nodes.forEach(function (n, j) {\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n var gravityForce = 0.01 * k * gravity;\n displacements[j].x -= gravityForce * (n.x - center[0]);\n displacements[j].y -= gravityForce * (n.y - center[1]);\n });\n // move\n nodes.forEach(function (n, j) {\n if ((0, util_1.isNumber)(n.fx) && (0, util_1.isNumber)(n.fy)) {\n n.x = n.fx;\n n.y = n.fy;\n return;\n }\n if (!(0, util_1.isNumber)(n.x) || !(0, util_1.isNumber)(n.y))\n return;\n var distLength = Math.sqrt(displacements[j].x * displacements[j].x +\n displacements[j].y * displacements[j].y);\n if (distLength > 0) {\n // && !n.isFixed()\n var limitedDist = Math.min(maxDisplace * (speed / SPEED_DIVISOR), distLength);\n n.x += (displacements[j].x / distLength) * limitedDist;\n n.y += (displacements[j].y / distLength) * limitedDist;\n }\n });\n (_a = self.tick) === null || _a === void 0 ? void 0 : _a.call(self);\n };\n FruchtermanLayout.prototype.applyCalculate = function (nodes, edges, displacements, k, k2) {\n var self = this;\n self.calRepulsive(nodes, displacements, k2);\n if (edges)\n self.calAttractive(edges, displacements, k);\n };\n FruchtermanLayout.prototype.calRepulsive = function (nodes, displacements, k2) {\n nodes.forEach(function (v, i) {\n displacements[i] = { x: 0, y: 0 };\n nodes.forEach(function (u, j) {\n if (i === j) {\n return;\n }\n if (!(0, util_1.isNumber)(v.x) ||\n !(0, util_1.isNumber)(u.x) ||\n !(0, util_1.isNumber)(v.y) ||\n !(0, util_1.isNumber)(u.y)) {\n return;\n }\n var vecX = v.x - u.x;\n var vecY = v.y - u.y;\n var vecLengthSqr = vecX * vecX + vecY * vecY;\n if (vecLengthSqr === 0) {\n vecLengthSqr = 1;\n var sign = i > j ? 1 : -1;\n vecX = 0.01 * sign;\n vecY = 0.01 * sign;\n }\n var common = k2 / vecLengthSqr;\n displacements[i].x += vecX * common;\n displacements[i].y += vecY * common;\n });\n });\n };\n FruchtermanLayout.prototype.calAttractive = function (edges, displacements, k) {\n var _this = this;\n edges.forEach(function (e) {\n var source = (0, util_1.getEdgeTerminal)(e, 'source');\n var target = (0, util_1.getEdgeTerminal)(e, 'target');\n if (!source || !target)\n return;\n var uIndex = _this.nodeIdxMap[source];\n var vIndex = _this.nodeIdxMap[target];\n if (uIndex === vIndex) {\n return;\n }\n var u = _this.nodeMap[source];\n var v = _this.nodeMap[target];\n if (!(0, util_1.isNumber)(v.x) || !(0, util_1.isNumber)(u.x) || !(0, util_1.isNumber)(v.y) || !(0, util_1.isNumber)(u.y)) {\n return;\n }\n var vecX = v.x - u.x;\n var vecY = v.y - u.y;\n var vecLength = Math.sqrt(vecX * vecX + vecY * vecY);\n var common = (vecLength * vecLength) / k;\n displacements[vIndex].x -= (vecX / vecLength) * common;\n displacements[vIndex].y -= (vecY / vecLength) * common;\n displacements[uIndex].x += (vecX / vecLength) * common;\n displacements[uIndex].y += (vecY / vecLength) * common;\n });\n };\n FruchtermanLayout.prototype.stop = function () {\n if (this.timeInterval && typeof window !== \"undefined\") {\n window.clearInterval(this.timeInterval);\n }\n };\n FruchtermanLayout.prototype.destroy = function () {\n var self = this;\n self.stop();\n self.tick = null;\n self.nodes = null;\n self.edges = null;\n self.destroyed = true;\n };\n FruchtermanLayout.prototype.getType = function () {\n return \"fruchterman\";\n };\n return FruchtermanLayout;\n}(base_1.Base));\nexports.FruchtermanLayout = FruchtermanLayout;\n//# sourceMappingURL=fruchterman.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/fruchterman.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n\nvar isOdd = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 2 !== 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isOdd);\n//# sourceMappingURL=is-odd.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-odd.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/gForce.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/gForce.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-plain-object.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-plain-object.js ***! + \*****************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GForceLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar proccessToFunc = function (value, defaultV) {\n var func;\n if (!value) {\n func = function (d) {\n return defaultV || 1;\n };\n }\n else if ((0, util_1.isNumber)(value)) {\n func = function (d) {\n return value;\n };\n }\n else {\n func = value;\n }\n return func;\n};\n/**\n * graphin 中的 force 布局\n */\nvar GForceLayout = /** @class */ (function (_super) {\n __extends(GForceLayout, _super);\n function GForceLayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 500;\n /** 是否启动 worker */\n _this.workerEnabled = false;\n /** 弹簧引力系数 */\n _this.edgeStrength = 200;\n /** 斥力系数 */\n _this.nodeStrength = 1000;\n /** 库伦系数 */\n _this.coulombDisScale = 0.005;\n /** 阻尼系数 */\n _this.damping = 0.9;\n /** 最大速度 */\n _this.maxSpeed = 1000;\n /** 一次迭代的平均移动距离小于该值时停止迭代 */\n _this.minMovement = 0.5;\n /** 迭代中衰减 */\n _this.interval = 0.02;\n /** 斥力的一个系数 */\n _this.factor = 1;\n /** 理想边长 */\n _this.linkDistance = 1;\n /** 重力大小 */\n _this.gravity = 10;\n /** 是否防止重叠 */\n _this.preventOverlap = true;\n /** 防止重叠的力大小参数 */\n _this.collideStrength = 1;\n /** 每次迭代结束的回调函数 */\n _this.tick = function () { };\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n /** 是否使用 window.setInterval 运行迭代 */\n _this.animate = true;\n _this.updateCfg(options);\n return _this;\n }\n GForceLayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 500,\n gravity: 10,\n enableTick: true,\n animate: true,\n };\n };\n /**\n * 执行布局\n */\n GForceLayout.prototype.execute = function () {\n var _a, _b;\n var self = this;\n var nodes = self.nodes;\n if (self.timeInterval !== undefined && typeof window !== \"undefined\") {\n window.clearInterval(self.timeInterval);\n }\n if (!nodes || nodes.length === 0) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n (_b = self.onLayoutEnd) === null || _b === void 0 ? void 0 : _b.call(self);\n return;\n }\n var nodeMap = {};\n var nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * self.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * self.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n self.linkDistance = proccessToFunc(self.linkDistance, 1);\n self.nodeStrength = proccessToFunc(self.nodeStrength, 1);\n self.edgeStrength = proccessToFunc(self.edgeStrength, 1);\n // node size function\n var nodeSize = self.nodeSize;\n var nodeSizeFunc;\n if (self.preventOverlap) {\n var nodeSpacing_1 = self.nodeSpacing;\n var nodeSpacingFunc_1;\n if ((0, util_1.isNumber)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = function () { return nodeSpacing_1; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = nodeSpacing_1;\n }\n else {\n nodeSpacingFunc_1 = function () { return 0; };\n }\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n return Math.max(d.size[0], d.size[1]) + nodeSpacingFunc_1(d);\n }\n if ((0, util_1.isObject)(d.size)) {\n return Math.max(d.size.width, d.size.height) + nodeSpacingFunc_1(d);\n }\n return d.size + nodeSpacingFunc_1(d);\n }\n return 10 + nodeSpacingFunc_1(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function (d) {\n return Math.max(nodeSize[0], nodeSize[1]) + nodeSpacingFunc_1(d);\n };\n }\n else {\n nodeSizeFunc = function (d) { return nodeSize + nodeSpacingFunc_1(d); };\n }\n }\n self.nodeSize = nodeSizeFunc;\n var edges = self.edges;\n self.degrees = (0, util_1.getDegree)(nodes.length, self.nodeIdxMap, edges);\n if (!self.getMass) {\n self.getMass = function (d) {\n var mass = d.mass || self.degrees[self.nodeIdxMap[d.id]].all || 1;\n return mass;\n };\n }\n // layout\n self.run();\n };\n GForceLayout.prototype.run = function () {\n var _a;\n var self = this;\n var maxIteration = self.maxIteration, nodes = self.nodes, workerEnabled = self.workerEnabled, minMovement = self.minMovement, animate = self.animate;\n if (!nodes)\n return;\n if (workerEnabled || !animate) {\n for (var i = 0; i < maxIteration; i++) {\n var previousPos = self.runOneStep(i);\n if (self.reachMoveThreshold(nodes, previousPos, minMovement)) {\n break;\n }\n }\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n }\n else {\n if (typeof window === \"undefined\")\n return;\n var iter_1 = 0;\n // interval for render the result after each iteration\n this.timeInterval = window.setInterval(function () {\n var _a, _b;\n if (!nodes)\n return;\n var previousPos = self.runOneStep(iter_1) || [];\n if (self.reachMoveThreshold(nodes, previousPos, minMovement)) {\n (_a = self.onLayoutEnd) === null || _a === void 0 ? void 0 : _a.call(self);\n window.clearInterval(self.timeInterval);\n }\n iter_1++;\n if (iter_1 >= maxIteration) {\n (_b = self.onLayoutEnd) === null || _b === void 0 ? void 0 : _b.call(self);\n window.clearInterval(self.timeInterval);\n }\n }, 0);\n }\n };\n GForceLayout.prototype.reachMoveThreshold = function (nodes, previousPos, minMovement) {\n // whether to stop the iteration\n var movement = 0;\n nodes.forEach(function (node, j) {\n var vx = node.x - previousPos[j].x;\n var vy = node.y - previousPos[j].y;\n movement += Math.sqrt(vx * vx + vy * vy);\n });\n movement /= nodes.length;\n return movement < minMovement;\n };\n GForceLayout.prototype.runOneStep = function (iter) {\n var _a;\n var self = this;\n var nodes = self.nodes, edges = self.edges;\n var accArray = [];\n var velArray = [];\n if (!nodes)\n return;\n nodes.forEach(function (_, i) {\n accArray[2 * i] = 0;\n accArray[2 * i + 1] = 0;\n velArray[2 * i] = 0;\n velArray[2 * i + 1] = 0;\n });\n self.calRepulsive(accArray, nodes);\n if (edges)\n self.calAttractive(accArray, edges);\n self.calGravity(accArray, nodes);\n var stepInterval = Math.max(0.02, self.interval - iter * 0.002);\n self.updateVelocity(accArray, velArray, stepInterval, nodes);\n var previousPos = [];\n nodes.forEach(function (node) {\n previousPos.push({\n x: node.x,\n y: node.y\n });\n });\n self.updatePosition(velArray, stepInterval, nodes);\n (_a = self.tick) === null || _a === void 0 ? void 0 : _a.call(self);\n return previousPos;\n };\n GForceLayout.prototype.calRepulsive = function (accArray, nodes) {\n var self = this;\n var getMass = self.getMass, factor = self.factor, coulombDisScale = self.coulombDisScale, preventOverlap = self.preventOverlap, _a = self.collideStrength, collideStrength = _a === void 0 ? 1 : _a;\n var nodeStrength = self.nodeStrength;\n var nodeSize = self.nodeSize;\n nodes.forEach(function (ni, i) {\n var massi = getMass ? getMass(ni) : 1;\n nodes.forEach(function (nj, j) {\n if (i >= j)\n return;\n // if (!accArray[j]) accArray[j] = 0;\n var vecX = ni.x - nj.x;\n var vecY = ni.y - nj.y;\n if (vecX === 0 && vecY === 0) {\n vecX = Math.random() * 0.01;\n vecY = Math.random() * 0.01;\n }\n var lengthSqr = vecX * vecX + vecY * vecY;\n var vecLength = Math.sqrt(lengthSqr);\n var nVecLength = (vecLength + 0.1) * coulombDisScale;\n var direX = vecX / vecLength;\n var direY = vecY / vecLength;\n var param = (((nodeStrength(ni) + nodeStrength(nj)) * 0.5) * factor) /\n (nVecLength * nVecLength);\n var massj = getMass ? getMass(nj) : 1;\n accArray[2 * i] += (direX * param);\n accArray[2 * i + 1] += (direY * param);\n accArray[2 * j] -= (direX * param);\n accArray[2 * j + 1] -= (direY * param);\n if (preventOverlap && (nodeSize(ni) + nodeSize(nj)) / 2 > vecLength) {\n var paramOverlap = collideStrength * (nodeStrength(ni) + nodeStrength(nj)) * 0.5 / lengthSqr;\n accArray[2 * i] += (direX * paramOverlap) / massi;\n accArray[2 * i + 1] += (direY * paramOverlap) / massi;\n accArray[2 * j] -= (direX * paramOverlap) / massj;\n accArray[2 * j + 1] -= (direY * paramOverlap) / massj;\n }\n });\n });\n };\n GForceLayout.prototype.calAttractive = function (accArray, edges) {\n var self = this;\n var nodeMap = self.nodeMap, nodeIdxMap = self.nodeIdxMap, linkDistance = self.linkDistance, edgeStrength = self.edgeStrength;\n var nodeSize = self.nodeSize;\n var getMass = self.getMass;\n edges.forEach(function (edge, i) {\n var source = (0, util_1.getEdgeTerminal)(edge, 'source');\n var target = (0, util_1.getEdgeTerminal)(edge, 'target');\n var sourceNode = nodeMap[source];\n var targetNode = nodeMap[target];\n var vecX = targetNode.x - sourceNode.x;\n var vecY = targetNode.y - sourceNode.y;\n if (vecX === 0 && vecY === 0) {\n vecX = Math.random() * 0.01;\n vecY = Math.random() * 0.01;\n }\n var vecLength = Math.sqrt(vecX * vecX + vecY * vecY);\n var direX = vecX / vecLength;\n var direY = vecY / vecLength;\n var length = linkDistance(edge, sourceNode, targetNode) || 1 + ((nodeSize(sourceNode) + nodeSize(sourceNode)) || 0) / 2;\n var diff = length - vecLength;\n var param = diff * edgeStrength(edge);\n var sourceIdx = nodeIdxMap[source];\n var targetIdx = nodeIdxMap[target];\n var massSource = getMass ? getMass(sourceNode) : 1;\n var massTarget = getMass ? getMass(targetNode) : 1;\n accArray[2 * sourceIdx] -= (direX * param) / massSource;\n accArray[2 * sourceIdx + 1] -= (direY * param) / massSource;\n accArray[2 * targetIdx] += (direX * param) / massTarget;\n accArray[2 * targetIdx + 1] += (direY * param) / massTarget;\n });\n };\n GForceLayout.prototype.calGravity = function (accArray, nodes) {\n var self = this;\n // const nodes = self.nodes;\n var center = self.center;\n var defaultGravity = self.gravity;\n var degrees = self.degrees;\n var nodeLength = nodes.length;\n for (var i = 0; i < nodeLength; i++) {\n var node = nodes[i];\n var vecX = node.x - center[0];\n var vecY = node.y - center[1];\n var gravity = defaultGravity;\n if (self.getCenter) {\n var customCenterOpt = self.getCenter(node, degrees[i].all);\n if (customCenterOpt &&\n (0, util_1.isNumber)(customCenterOpt[0]) &&\n (0, util_1.isNumber)(customCenterOpt[1]) &&\n (0, util_1.isNumber)(customCenterOpt[2])) {\n vecX = node.x - customCenterOpt[0];\n vecY = node.y - customCenterOpt[1];\n gravity = customCenterOpt[2];\n }\n }\n if (!gravity)\n continue;\n accArray[2 * i] -= gravity * vecX;\n accArray[2 * i + 1] -= gravity * vecY;\n }\n };\n GForceLayout.prototype.updateVelocity = function (accArray, velArray, stepInterval, nodes) {\n var self = this;\n var param = stepInterval * self.damping;\n // const nodes = self.nodes;\n nodes.forEach(function (node, i) {\n var vx = accArray[2 * i] * param || 0.01;\n var vy = accArray[2 * i + 1] * param || 0.01;\n var vLength = Math.sqrt(vx * vx + vy * vy);\n if (vLength > self.maxSpeed) {\n var param2 = self.maxSpeed / vLength;\n vx = param2 * vx;\n vy = param2 * vy;\n }\n velArray[2 * i] = vx;\n velArray[2 * i + 1] = vy;\n });\n };\n GForceLayout.prototype.updatePosition = function (velArray, stepInterval, nodes) {\n nodes.forEach(function (node, i) {\n if ((0, util_1.isNumber)(node.fx) && (0, util_1.isNumber)(node.fy)) {\n node.x = node.fx;\n node.y = node.fy;\n return;\n }\n var distX = velArray[2 * i] * stepInterval;\n var distY = velArray[2 * i + 1] * stepInterval;\n node.x += distX;\n node.y += distY;\n });\n };\n GForceLayout.prototype.stop = function () {\n if (this.timeInterval && typeof window !== \"undefined\") {\n window.clearInterval(this.timeInterval);\n }\n };\n GForceLayout.prototype.destroy = function () {\n var self = this;\n self.stop();\n self.tick = null;\n self.nodes = null;\n self.edges = null;\n self.destroyed = true;\n };\n GForceLayout.prototype.getType = function () {\n return \"gForce\";\n };\n return GForceLayout;\n}(base_1.Base));\nexports.GForceLayout = GForceLayout;\n//# sourceMappingURL=gForce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gForce.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object-like.js\");\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n\n\nvar isPlainObject = function (value) {\n /**\n * isObjectLike(new Foo) => false\n * isObjectLike([1, 2, 3]) => false\n * isObjectLike({ x: 0, y: 0 }) => true\n * isObjectLike(Object.create(null)) => true\n */\n if (!Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) || !Object(_is_type__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value, 'Object')) {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n var proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPlainObject);\n//# sourceMappingURL=is-plain-object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-plain-object.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-positive.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-positive.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n// @ts-nocheck\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.FruchtermanGPULayout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\n// @ts-ignore\nvar g_webgpu_1 = __webpack_require__(/*! @antv/g-webgpu */ \"./node_modules/@antv/g-webgpu/es/index.js\");\n// compile at runtime in dev mode\nvar gpu_1 = __webpack_require__(/*! ../../util/gpu */ \"./node_modules/@antv/layout/lib/util/gpu.js\");\n// use compiled bundle in prod mode\nvar fruchtermanShader_1 = __webpack_require__(/*! ./fruchtermanShader */ \"./node_modules/@antv/layout/lib/layout/gpu/fruchtermanShader.js\");\nvar constants_1 = __webpack_require__(/*! ../constants */ \"./node_modules/@antv/layout/lib/layout/constants.js\");\n/**\n * fruchterman 布局\n */\nvar FruchtermanGPULayout = /** @class */ (function (_super) {\n __extends(FruchtermanGPULayout, _super);\n function FruchtermanGPULayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 重力大小,影响图的紧凑程度 */\n _this.gravity = 10;\n /** 速度 */\n _this.speed = 1;\n /** 是否产生聚类力 */\n _this.clustering = false;\n /** 根据哪个字段聚类 */\n _this.clusterField = \"cluster\";\n /** 聚类力大小 */\n _this.clusterGravity = 10;\n /** 是否启用web worker。前提是在web worker里执行布局,否则无效\t*/\n _this.workerEnabled = false;\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n _this.updateCfg(options);\n return _this;\n }\n FruchtermanGPULayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 1000,\n gravity: 10,\n speed: 1,\n clustering: false,\n clusterGravity: 10\n };\n };\n /**\n * 执行布局\n */\n FruchtermanGPULayout.prototype.execute = function () {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, center, nodeMap, nodeIdxMap;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return [2 /*return*/];\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return [2 /*return*/];\n }\n nodeMap = {};\n nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * _this.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * _this.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n // layout\n return [4 /*yield*/, self.run()];\n case 1:\n // layout\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n FruchtermanGPULayout.prototype.executeWithWorker = function (canvas, ctx) {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, center, nodeMap, nodeIdxMap;\n var _this = this;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n center = self.center;\n if (!nodes || nodes.length === 0) {\n return [2 /*return*/];\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n return [2 /*return*/];\n }\n nodeMap = {};\n nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * _this.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * _this.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n // layout\n return [4 /*yield*/, self.run(canvas, ctx)];\n case 1:\n // layout\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n FruchtermanGPULayout.prototype.run = function (canvas, ctx) {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, edges, maxIteration, center, area, maxDisplace, k2, k, speed, clustering, _a, attributeArray, clusterCount, numParticles, _b, maxEdgePerVetex, nodesEdgesArray, workerEnabled, world, onLayoutEnd, clusterCenters, i, kernelFruchterman, kernelCluster, execute;\n var _this = this;\n return __generator(this, function (_c) {\n switch (_c.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n edges = self.edges;\n maxIteration = self.maxIteration;\n center = self.center;\n area = self.height * self.width;\n maxDisplace = Math.sqrt(area) / 10;\n k2 = area / (nodes.length + 1);\n k = Math.sqrt(k2);\n speed = self.speed;\n clustering = self.clustering;\n _a = (0, gpu_1.attributesToTextureData)([self.clusterField], nodes), attributeArray = _a.array, clusterCount = _a.count;\n // pushing the fx and fy\n nodes.forEach(function (node, i) {\n var fx = 0;\n var fy = 0;\n if ((0, util_1.isNumber)(node.fx) && (0, util_1.isNumber)(node.fy)) {\n fx = node.fx || 0.001;\n fy = node.fy || 0.001;\n }\n attributeArray[4 * i + 1] = fx;\n attributeArray[4 * i + 2] = fy;\n });\n numParticles = nodes.length;\n _b = (0, gpu_1.buildTextureData)(nodes, edges), maxEdgePerVetex = _b.maxEdgePerVetex, nodesEdgesArray = _b.array;\n workerEnabled = self.workerEnabled;\n if (workerEnabled) {\n world = g_webgpu_1.World.create({\n canvas: canvas,\n engineOptions: {\n supportCompute: true\n }\n });\n }\n else {\n world = g_webgpu_1.World.create({\n engineOptions: {\n supportCompute: true\n }\n });\n }\n onLayoutEnd = self.onLayoutEnd;\n clusterCenters = [];\n for (i = 0; i < clusterCount; i++) {\n clusterCenters.push(0, 0, 0, 0);\n }\n kernelFruchterman = world\n .createKernel(fruchtermanShader_1.fruchtermanBundle)\n .setDispatch([numParticles, 1, 1])\n .setBinding({\n u_Data: nodesEdgesArray,\n u_K: k,\n u_K2: k2,\n u_Gravity: self.gravity,\n u_ClusterGravity: self.clusterGravity || self.gravity || 1,\n u_Speed: speed,\n u_MaxDisplace: maxDisplace,\n u_Clustering: clustering ? 1 : 0,\n u_Center: center,\n u_AttributeArray: attributeArray,\n u_ClusterCenters: clusterCenters,\n MAX_EDGE_PER_VERTEX: maxEdgePerVetex,\n VERTEX_COUNT: numParticles\n });\n if (clustering) {\n kernelCluster = world\n .createKernel(fruchtermanShader_1.clusterBundle)\n .setDispatch([clusterCount, 1, 1])\n .setBinding({\n u_Data: nodesEdgesArray,\n u_NodeAttributes: attributeArray,\n u_ClusterCenters: clusterCenters,\n VERTEX_COUNT: numParticles,\n CLUSTER_COUNT: clusterCount\n });\n }\n execute = function () { return __awaiter(_this, void 0, void 0, function () {\n var i, finalParticleData;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < maxIteration)) return [3 /*break*/, 6];\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, kernelFruchterman.execute()];\n case 2:\n // eslint-disable-next-line no-await-in-loop\n _a.sent();\n if (!clustering) return [3 /*break*/, 4];\n kernelCluster.setBinding({\n u_Data: kernelFruchterman\n });\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, kernelCluster.execute()];\n case 3:\n // eslint-disable-next-line no-await-in-loop\n _a.sent();\n kernelFruchterman.setBinding({\n u_ClusterCenters: kernelCluster\n });\n _a.label = 4;\n case 4:\n kernelFruchterman.setBinding({\n u_MaxDisplace: maxDisplace *= 0.99\n });\n _a.label = 5;\n case 5:\n i++;\n return [3 /*break*/, 1];\n case 6: return [4 /*yield*/, kernelFruchterman.getOutput()];\n case 7:\n finalParticleData = _a.sent();\n if (canvas) {\n // 传递数据给主线程\n ctx.postMessage({\n type: constants_1.LAYOUT_MESSAGE.GPUEND,\n vertexEdgeData: finalParticleData\n // edgeIndexBufferData,\n });\n }\n else {\n nodes.forEach(function (node, i) {\n var x = finalParticleData[4 * i];\n var y = finalParticleData[4 * i + 1];\n node.x = x;\n node.y = y;\n });\n }\n if (onLayoutEnd)\n onLayoutEnd();\n return [2 /*return*/];\n }\n });\n }); };\n return [4 /*yield*/, execute()];\n case 1:\n _c.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n FruchtermanGPULayout.prototype.getType = function () {\n return \"fruchterman-gpu\";\n };\n return FruchtermanGPULayout;\n}(base_1.Base));\nexports.FruchtermanGPULayout = FruchtermanGPULayout;\n//# sourceMappingURL=fruchterman.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n\nvar isPositive = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num > 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPositive);\n//# sourceMappingURL=is-positive.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-positive.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/gpu/fruchtermanShader.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/gpu/fruchtermanShader.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-prototype.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-prototype.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clusterBundle = exports.clusterCode = exports.fruchtermanBundle = exports.fruchtermanCode = void 0;\nexports.fruchtermanCode = \"\\nimport { globalInvocationID } from 'g-webgpu';\\nconst MAX_EDGE_PER_VERTEX;\\nconst VERTEX_COUNT;\\n@numthreads(1, 1, 1)\\nclass Fruchterman {\\n @in @out\\n u_Data: vec4[];\\n @in\\n u_K: float;\\n @in\\n u_K2: float;\\n \\n @in\\n u_Center: vec2;\\n @in\\n u_Gravity: float;\\n @in\\n u_ClusterGravity: float;\\n @in\\n u_Speed: float;\\n @in\\n u_MaxDisplace: float;\\n @in\\n u_Clustering: float;\\n @in\\n u_AttributeArray: vec4[];\\n @in\\n u_ClusterCenters: vec4[];\\n calcRepulsive(i: int, currentNode: vec4): vec2 {\\n let dx = 0, dy = 0;\\n for (let j = 0; j < VERTEX_COUNT; j++) {\\n if (i != j) {\\n const nextNode = this.u_Data[j];\\n const xDist = currentNode[0] - nextNode[0];\\n const yDist = currentNode[1] - nextNode[1];\\n const dist = (xDist * xDist + yDist * yDist) + 0.01;\\n let param = this.u_K2 / dist;\\n \\n if (dist > 0.0) {\\n dx += param * xDist;\\n dy += param * yDist;\\n if (xDist == 0 && yDist == 0) {\\n const sign = i < j ? 1 : -1;\\n dx += param * sign;\\n dy += param * sign;\\n }\\n }\\n }\\n }\\n return [dx, dy];\\n }\\n calcGravity(currentNode: vec4, nodeAttributes: vec4): vec2 { // \\n let dx = 0, dy = 0;\\n const vx = currentNode[0] - this.u_Center[0];\\n const vy = currentNode[1] - this.u_Center[1];\\n const gf = 0.01 * this.u_K * this.u_Gravity;\\n dx = gf * vx;\\n dy = gf * vy;\\n if (this.u_Clustering == 1) {\\n const clusterIdx = int(nodeAttributes[0]);\\n const center = this.u_ClusterCenters[clusterIdx];\\n const cvx = currentNode[0] - center[0];\\n const cvy = currentNode[1] - center[1];\\n const dist = sqrt(cvx * cvx + cvy * cvy) + 0.01;\\n const parma = this.u_K * this.u_ClusterGravity / dist;\\n dx += parma * cvx;\\n dy += parma * cvy;\\n }\\n return [dx, dy];\\n }\\n calcAttractive(i: int, currentNode: vec4): vec2 {\\n let dx = 0, dy = 0;\\n const arr_offset = int(floor(currentNode[2] + 0.5));\\n const length = int(floor(currentNode[3] + 0.5));\\n const node_buffer: vec4;\\n for (let p = 0; p < MAX_EDGE_PER_VERTEX; p++) {\\n if (p >= length) break;\\n const arr_idx = arr_offset + p;\\n // when arr_idx % 4 == 0 update currentNodedx_buffer\\n const buf_offset = arr_idx - arr_idx / 4 * 4;\\n if (p == 0 || buf_offset == 0) {\\n node_buffer = this.u_Data[int(arr_idx / 4)];\\n }\\n const float_j = buf_offset == 0 ? node_buffer[0] :\\n buf_offset == 1 ? node_buffer[1] :\\n buf_offset == 2 ? node_buffer[2] :\\n node_buffer[3];\\n const nextNode = this.u_Data[int(float_j)];\\n const xDist = currentNode[0] - nextNode[0];\\n const yDist = currentNode[1] - nextNode[1];\\n const dist = sqrt(xDist * xDist + yDist * yDist) + 0.01;\\n let attractiveF = dist / this.u_K;\\n \\n if (dist > 0.0) {\\n dx -= xDist * attractiveF;\\n dy -= yDist * attractiveF;\\n if (xDist == 0 && yDist == 0) {\\n const sign = i < int(float_j) ? 1 : -1;\\n dx -= sign * attractiveF;\\n dy -= sign * attractiveF;\\n }\\n }\\n }\\n return [dx, dy];\\n }\\n @main\\n compute() {\\n const i = globalInvocationID.x;\\n const currentNode = this.u_Data[i];\\n let dx = 0, dy = 0;\\n if (i >= VERTEX_COUNT) {\\n this.u_Data[i] = currentNode;\\n return;\\n }\\n\\n // [gravity, fx, fy, 0]\\n const nodeAttributes = this.u_AttributeArray[i];\\n\\n if (nodeAttributes[1] != 0 && nodeAttributes[2] != 0) {\\n // the node is fixed\\n this.u_Data[i] = [\\n nodeAttributes[1],\\n nodeAttributes[2],\\n currentNode[2],\\n currentNode[3]\\n ];\\n return;\\n }\\n\\n // repulsive\\n const repulsive = this.calcRepulsive(i, currentNode);\\n dx += repulsive[0];\\n dy += repulsive[1];\\n // attractive\\n const attractive = this.calcAttractive(i, currentNode);\\n dx += attractive[0];\\n dy += attractive[1];\\n // gravity\\n const gravity = this.calcGravity(currentNode, nodeAttributes);\\n dx -= gravity[0];\\n dy -= gravity[1];\\n // speed\\n dx *= this.u_Speed;\\n dy *= this.u_Speed;\\n\\n // move\\n const distLength = sqrt(dx * dx + dy * dy);\\n if (distLength > 0.0) {\\n const limitedDist = min(this.u_MaxDisplace * this.u_Speed, distLength);\\n this.u_Data[i] = [\\n currentNode[0] + dx / distLength * limitedDist,\\n currentNode[1] + dy / distLength * limitedDist,\\n currentNode[2],\\n currentNode[3]\\n ];\\n }\\n }\\n}\\n\";\nexports.fruchtermanBundle = \"{\\\"shaders\\\":{\\\"WGSL\\\":\\\"import \\\\\\\"GLSL.std.450\\\\\\\" as std;\\\\n\\\\n\\\\n# var gWebGPUDebug : bool = false;\\\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\\\n\\\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\\\n# [[builtin work_group_id]] var workGroupID : vec3;\\\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\\\n\\\\ntype GWebGPUParams = [[block]] struct {\\\\n [[offset 0]] u_K : f32;\\\\n [[offset 4]] u_K2 : f32;\\\\n [[offset 8]] u_Center : vec2;\\\\n [[offset 16]] u_Gravity : f32;\\\\n [[offset 20]] u_ClusterGravity : f32;\\\\n [[offset 24]] u_Speed : f32;\\\\n [[offset 28]] u_MaxDisplace : f32;\\\\n [[offset 32]] u_Clustering : f32;\\\\n};\\\\n[[binding 0, set 0]] var gWebGPUUniformParams : GWebGPUParams;\\\\ntype GWebGPUBuffer0 = [[block]] struct {\\\\n [[offset 0]] u_Data : [[stride 16]] array>;\\\\n};\\\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\\\ntype GWebGPUBuffer1 = [[block]] struct {\\\\n [[offset 0]] u_AttributeArray : [[stride 16]] array>;\\\\n};\\\\n[[binding 2, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\\\ntype GWebGPUBuffer2 = [[block]] struct {\\\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array>;\\\\n};\\\\n[[binding 3, set 0]] var gWebGPUBuffer2 : GWebGPUBuffer2;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nfn calcRepulsive(i : i32, currentNode : vec4) -> vec2 {var dx : f32 = 0.0;\\\\nvar dy : f32 = 0.0;\\\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4 = gWebGPUBuffer0.u_Data[j];\\\\nvar xDist : f32 = currentNode.x - nextNode.x;\\\\nvar yDist : f32 = currentNode.y - nextNode.y;\\\\nvar dist : f32 = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nvar param : f32 = gWebGPUUniformParams.u_K2 / dist;\\\\nif (dist > 0.0) {dx = dx + param * xDist;\\\\ndy = dy + param * yDist;\\\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < j);\\\\ndx = dx + param * std::sign;\\\\ndy = dy + param * std::sign;}}}}\\\\nreturn vec2(dx, dy);}\\\\nfn calcGravity(currentNode : vec4, nodeAttributes : vec4) -> vec2 {var dx : f32 = 0.0;\\\\nvar dy : f32 = 0.0;\\\\nvar vx : f32 = currentNode.x - gWebGPUUniformParams.u_Center.x;\\\\nvar vy : f32 = currentNode.y - gWebGPUUniformParams.u_Center.y;\\\\nvar gf : f32 = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\\\ndx = gf * vx;\\\\ndy = gf * vy;\\\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {var clusterIdx : i32 = i32(nodeAttributes.x);\\\\nvar center : vec4 = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\\\nvar cvx : f32 = currentNode.x - center.x;\\\\nvar cvy : f32 = currentNode.y - center.y;\\\\nvar dist : f32 = std::sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\\\nvar parma : f32 = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\\\ndx = dx + parma * cvx;\\\\ndy = dy + parma * cvy;}\\\\nreturn vec2(dx, dy);}\\\\nfn calcAttractive(i : i32, currentNode : vec4) -> vec2 {var dx : f32 = 0.0;\\\\nvar dy : f32 = 0.0;\\\\nvar arr_offset : i32 = i32(std::floor(currentNode.z + 0.5));\\\\nvar length : i32 = i32(std::floor(currentNode.w + 0.5));\\\\nvar node_buffer : vec4;\\\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\\\nvar arr_idx : i32 = arr_offset + i32(p);\\\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\\\nvar float_j : f32 = select(node_buffer.x, select(node_buffer.y, select(node_buffer.z, node_buffer.w, buf_offset == 2), buf_offset == 1), buf_offset == 0);\\\\nvar nextNode : vec4 = gWebGPUBuffer0.u_Data[i32(float_j)];\\\\nvar xDist : f32 = currentNode.x - nextNode.x;\\\\nvar yDist : f32 = currentNode.y - nextNode.y;\\\\nvar dist : f32 = std::sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nvar attractiveF : f32 = dist / gWebGPUUniformParams.u_K;\\\\nif (dist > 0.0) {dx = dx - xDist * attractiveF;\\\\ndy = dy - yDist * attractiveF;\\\\nif ((xDist == 0.0) && (yDist == 0.0)) {var sign : f32 = select(1.0, -1.0, i < i32(float_j));\\\\ndx = dx - std::sign * attractiveF;\\\\ndy = dy - std::sign * attractiveF;}}}\\\\nreturn vec2(dx, dy);}\\\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\\\nvar currentNode : vec4 = gWebGPUBuffer0.u_Data[i];\\\\nvar dx : f32 = 0.0;\\\\nvar dy : f32 = 0.0;\\\\nif (i >= __DefineValuePlaceholder__VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\\\nreturn ;}\\\\nvar nodeAttributes : vec4 = gWebGPUBuffer1.u_AttributeArray[i];\\\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\\\nreturn ;}\\\\nvar repulsive : vec2 = calcRepulsive(i, currentNode);\\\\ndx = dx + repulsive.x;\\\\ndy = dy + repulsive.y;\\\\nvar attractive : vec2 = calcAttractive(i, currentNode);\\\\ndx = dx + attractive.x;\\\\ndy = dy + attractive.y;\\\\nvar gravity : vec2 = calcGravity(currentNode, nodeAttributes);\\\\ndx = dx - gravity.x;\\\\ndy = dy - gravity.y;\\\\ndx = dx * gWebGPUUniformParams.u_Speed;\\\\ndy = dy * gWebGPUUniformParams.u_Speed;\\\\nvar distLength : f32 = std::sqrt((dx * dx) + (dy * dy));\\\\nif (distLength > 0.0) {var limitedDist : f32 = std::min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}\\\\nreturn;}\\\\n\\\\nentry_point compute as \\\\\\\"main\\\\\\\" = main;\\\\n\\\",\\\"GLSL450\\\":\\\"\\\\n\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\\\nivec3 workGroupSize = ivec3(1,1,1);\\\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\\\n\\\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\\\n float u_K;\\\\n float u_K2;\\\\n vec2 u_Center;\\\\n float u_Gravity;\\\\n float u_ClusterGravity;\\\\n float u_Speed;\\\\n float u_MaxDisplace;\\\\n float u_Clustering;\\\\n} gWebGPUUniformParams;\\\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\\\n vec4 u_Data[];\\\\n} gWebGPUBuffer0;\\\\n\\\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\\\n vec4 u_AttributeArray[];\\\\n} gWebGPUBuffer1;\\\\n\\\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\\\n vec4 u_ClusterCenters[];\\\\n} gWebGPUBuffer2;\\\\n\\\\n\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\nlayout (\\\\n local_size_x = 1,\\\\n local_size_y = 1,\\\\n local_size_z = 1\\\\n) in;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {float dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat param = gWebGPUUniformParams.u_K2 / dist;\\\\nif (dist > 0.0) {dx += param * xDist;\\\\ndy += param * yDist;\\\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\\\ndx += param * sign;\\\\ndy += param * sign;}}}}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {float dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfloat vx = currentNode.x - gWebGPUUniformParams.u_Center.x;\\\\nfloat vy = currentNode.y - gWebGPUUniformParams.u_Center.y;\\\\nfloat gf = (0.01 * gWebGPUUniformParams.u_K) * gWebGPUUniformParams.u_Gravity;\\\\ndx = gf * vx;\\\\ndy = gf * vy;\\\\nif (gWebGPUUniformParams.u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[clusterIdx];\\\\nfloat cvx = currentNode.x - center.x;\\\\nfloat cvy = currentNode.y - center.y;\\\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\\\nfloat parma = (gWebGPUUniformParams.u_K * gWebGPUUniformParams.u_ClusterGravity) / dist;\\\\ndx += parma * cvx;\\\\ndy += parma * cvy;}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcAttractive(int i, vec4 currentNode) {float dx = 0.0;\\\\nfloat dy = 0.0;\\\\nint arr_offset = int(floor(currentNode.z + 0.5));\\\\nint length = int(floor(currentNode.w + 0.5));\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + int(p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat attractiveF = dist / gWebGPUUniformParams.u_K;\\\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\\\ndy -= yDist * attractiveF;\\\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\\\ndx -= sign * attractiveF;\\\\ndy -= sign * attractiveF;}}}\\\\nreturn vec2(dx, dy);}\\\\nvoid main() {int i = globalInvocationID.x;\\\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nif (i >= VERTEX_COUNT) {gWebGPUBuffer0.u_Data[i] = currentNode;\\\\nreturn ;}\\\\nvec4 nodeAttributes = gWebGPUBuffer1.u_AttributeArray[i];\\\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w);\\\\nreturn ;}\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\ndx += repulsive.x;\\\\ndy += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode);\\\\ndx += attractive.x;\\\\ndy += attractive.y;\\\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\\\ndx -= gravity.x;\\\\ndy -= gravity.y;\\\\ndx *= gWebGPUUniformParams.u_Speed;\\\\ndy *= gWebGPUUniformParams.u_Speed;\\\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\\\nif (distLength > 0.0) {float limitedDist = min(gWebGPUUniformParams.u_MaxDisplace * gWebGPUUniformParams.u_Speed, distLength);\\\\ngWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w);}}\\\\n\\\",\\\"GLSL100\\\":\\\"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_K;\\\\nuniform float u_K2;\\\\nuniform vec2 u_Center;\\\\nuniform float u_Gravity;\\\\nuniform float u_ClusterGravity;\\\\nuniform float u_Speed;\\\\nuniform float u_MaxDisplace;\\\\nuniform float u_Clustering;\\\\nuniform sampler2D u_AttributeArray;\\\\nuniform vec2 u_AttributeArraySize;\\\\nvec4 getDatau_AttributeArray(vec2 address2D) {\\\\n return vec4(texture2D(u_AttributeArray, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AttributeArray(float address1D) {\\\\n return getDatau_AttributeArray(addrTranslation_1Dto2D(address1D, u_AttributeArraySize));\\\\n}\\\\nvec4 getDatau_AttributeArray(int address1D) {\\\\n return getDatau_AttributeArray(float(address1D));\\\\n}\\\\nuniform sampler2D u_ClusterCenters;\\\\nuniform vec2 u_ClusterCentersSize;\\\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\\\n}\\\\nvec4 getDatau_ClusterCenters(float address1D) {\\\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\\\n}\\\\nvec4 getDatau_ClusterCenters(int address1D) {\\\\n return getDatau_ClusterCenters(float(address1D));\\\\n}\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = ((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat param = u_K2 / dist;\\\\nif (dist > 0.0) {dx += param * xDist;\\\\ndy += param * yDist;\\\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < j) ? (1.0) : (-1.0);\\\\ndx += param * sign;\\\\ndy += param * sign;}}}}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcGravity(vec4 currentNode, vec4 nodeAttributes) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nfloat vx = currentNode.x - u_Center.x;\\\\nfloat vy = currentNode.y - u_Center.y;\\\\nfloat gf = (0.01 * u_K) * u_Gravity;\\\\ndx = gf * vx;\\\\ndy = gf * vy;\\\\nif (u_Clustering == 1.0) {int clusterIdx = int(nodeAttributes.x);\\\\nvec4 center = getDatau_ClusterCenters(clusterIdx);\\\\nfloat cvx = currentNode.x - center.x;\\\\nfloat cvy = currentNode.y - center.y;\\\\nfloat dist = sqrt((cvx * cvx) + (cvy * cvy)) + 0.01;\\\\nfloat parma = (u_K * u_ClusterGravity) / dist;\\\\ndx += parma * cvx;\\\\ndy += parma * cvy;}\\\\nreturn vec2(dx, dy);}\\\\nvec2 calcAttractive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nint arr_offset = int(floor(currentNode.z + 0.5));\\\\nint length = int(floor(currentNode.w + 0.5));\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + int(p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\\\nfloat float_j = (buf_offset == 0) ? (node_buffer.x) : ((buf_offset == 1) ? (node_buffer.y) : ((buf_offset == 2) ? (node_buffer.z) : (node_buffer.w)));\\\\nvec4 nextNode = getDatau_Data(int(float_j));\\\\nfloat xDist = currentNode.x - nextNode.x;\\\\nfloat yDist = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((xDist * xDist) + (yDist * yDist)) + 0.01;\\\\nfloat attractiveF = dist / u_K;\\\\nif (dist > 0.0) {dx -= xDist * attractiveF;\\\\ndy -= yDist * attractiveF;\\\\nif ((xDist == 0.0) && (yDist == 0.0)) {float sign = (i < int(float_j)) ? (1.0) : (-1.0);\\\\ndx -= sign * attractiveF;\\\\ndy -= sign * attractiveF;}}}\\\\nreturn vec2(dx, dy);}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 currentNode = getDatau_Data(i);\\\\nfloat dx = 0.0;\\\\nfloat dy = 0.0;\\\\nif (i >= VERTEX_COUNT) {gl_FragColor = vec4(currentNode);\\\\nreturn ;}\\\\nvec4 nodeAttributes = getDatau_AttributeArray(i);\\\\nif ((nodeAttributes.y != 0.0) && (nodeAttributes.z != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes.y, nodeAttributes.z, currentNode.z, currentNode.w));\\\\nreturn ;}\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\ndx += repulsive.x;\\\\ndy += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode);\\\\ndx += attractive.x;\\\\ndy += attractive.y;\\\\nvec2 gravity = calcGravity(currentNode, nodeAttributes);\\\\ndx -= gravity.x;\\\\ndy -= gravity.y;\\\\ndx *= u_Speed;\\\\ndy *= u_Speed;\\\\nfloat distLength = sqrt((dx * dx) + (dy * dy));\\\\nif (distLength > 0.0) {float limitedDist = min(u_MaxDisplace * u_Speed, distLength);\\\\ngl_FragColor = vec4(vec4(currentNode.x + ((dx / distLength) * limitedDist), currentNode.y + ((dy / distLength) * limitedDist), currentNode.z, currentNode.w));}if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n\\\"},\\\"context\\\":{\\\"name\\\":\\\"\\\",\\\"dispatch\\\":[1,1,1],\\\"threadGroupSize\\\":[1,1,1],\\\"maxIteration\\\":1,\\\"defines\\\":[{\\\"name\\\":\\\"MAX_EDGE_PER_VERTEX\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true},{\\\"name\\\":\\\"VERTEX_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true}],\\\"uniforms\\\":[{\\\"name\\\":\\\"u_Data\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":false,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_K\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_K2\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_Center\\\",\\\"type\\\":\\\"vec2\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_Gravity\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_ClusterGravity\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_Speed\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_MaxDisplace\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_Clustering\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_AttributeArray\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_ClusterCenters\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]}],\\\"globalDeclarations\\\":[],\\\"output\\\":{\\\"name\\\":\\\"u_Data\\\",\\\"size\\\":[1,1],\\\"length\\\":1},\\\"needPingpong\\\":true}}\";\nexports.clusterCode = \"\\nimport { globalInvocationID } from 'g-webgpu';\\nconst VERTEX_COUNT;\\nconst CLUSTER_COUNT;\\n@numthreads(1, 1, 1)\\nclass CalcCenter {\\n @in\\n u_Data: vec4[];\\n @in\\n u_NodeAttributes: vec4[]; // [[clusterIdx, 0, 0, 0], ...]\\n @in @out\\n u_ClusterCenters: vec4[]; // [[cx, cy, nodeCount, clusterIdx], ...]\\n @main\\n compute() {\\n const i = globalInvocationID.x;\\n const center = this.u_ClusterCenters[i];\\n let sumx = 0;\\n let sumy = 0;\\n let count = 0;\\n for (let j = 0; j < VERTEX_COUNT; j++) {\\n const attributes = this.u_NodeAttributes[j];\\n const clusterIdx = int(attributes[0]);\\n const vertex = this.u_Data[j];\\n if (clusterIdx == i) {\\n sumx += vertex.x;\\n sumy += vertex.y;\\n count += 1;\\n }\\n }\\n this.u_ClusterCenters[i] = [\\n sumx / count,\\n sumy / count,\\n count,\\n i\\n ];\\n }\\n}\\n\";\nexports.clusterBundle = \"{\\\"shaders\\\":{\\\"WGSL\\\":\\\"import \\\\\\\"GLSL.std.450\\\\\\\" as std;\\\\n\\\\n\\\\n# var gWebGPUDebug : bool = false;\\\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\\\n\\\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\\\n# [[builtin work_group_id]] var workGroupID : vec3;\\\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\\\n\\\\n\\\\ntype GWebGPUBuffer0 = [[block]] struct {\\\\n [[offset 0]] u_Data : [[stride 16]] array>;\\\\n};\\\\n[[binding 0, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\\\ntype GWebGPUBuffer1 = [[block]] struct {\\\\n [[offset 0]] u_NodeAttributes : [[stride 16]] array>;\\\\n};\\\\n[[binding 1, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\\\ntype GWebGPUBuffer2 = [[block]] struct {\\\\n [[offset 0]] u_ClusterCenters : [[stride 16]] array>;\\\\n};\\\\n[[binding 2, set 0]] var gWebGPUBuffer2 : GWebGPUBuffer2;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\\\nvar center : vec4 = gWebGPUBuffer2.u_ClusterCenters[i];\\\\nvar sumx : f32 = 0.0;\\\\nvar sumy : f32 = 0.0;\\\\nvar count : f32 = 0.0;\\\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var attributes : vec4 = gWebGPUBuffer1.u_NodeAttributes[j];\\\\nvar clusterIdx : i32 = i32(attributes.x);\\\\nvar vertex : vec4 = gWebGPUBuffer0.u_Data[j];\\\\nif (clusterIdx == i) {sumx = sumx + vertex.x;\\\\nsumy = sumy + vertex.y;\\\\ncount = count + 1.0;}}\\\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);\\\\nreturn;}\\\\n\\\\nentry_point compute as \\\\\\\"main\\\\\\\" = main;\\\\n\\\",\\\"GLSL450\\\":\\\"\\\\n\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\\\nivec3 workGroupSize = ivec3(1,1,1);\\\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\\\n\\\\n\\\\nlayout(std430, set = 0, binding = 0) buffer readonly GWebGPUBuffer0 {\\\\n vec4 u_Data[];\\\\n} gWebGPUBuffer0;\\\\n\\\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer1 {\\\\n vec4 u_NodeAttributes[];\\\\n} gWebGPUBuffer1;\\\\n\\\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer2 {\\\\n vec4 u_ClusterCenters[];\\\\n} gWebGPUBuffer2;\\\\n\\\\n\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\\\nlayout (\\\\n local_size_x = 1,\\\\n local_size_y = 1,\\\\n local_size_z = 1\\\\n) in;\\\\n\\\\n\\\\n\\\\nvoid main() {int i = globalInvocationID.x;\\\\nvec4 center = gWebGPUBuffer2.u_ClusterCenters[i];\\\\nfloat sumx = 0.0;\\\\nfloat sumy = 0.0;\\\\nfloat count = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = gWebGPUBuffer1.u_NodeAttributes[j];\\\\nint clusterIdx = int(attributes.x);\\\\nvec4 vertex = gWebGPUBuffer0.u_Data[j];\\\\nif (clusterIdx == i) {sumx += vertex.x;\\\\nsumy += vertex.y;\\\\ncount += 1.0;}}\\\\ngWebGPUBuffer2.u_ClusterCenters[i] = vec4(sumx / count, sumy / count, count, i);}\\\\n\\\",\\\"GLSL100\\\":\\\"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define CLUSTER_COUNT __DefineValuePlaceholder__CLUSTER_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform sampler2D u_NodeAttributes;\\\\nuniform vec2 u_NodeAttributesSize;\\\\nvec4 getDatau_NodeAttributes(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributes, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributes(float address1D) {\\\\n return getDatau_NodeAttributes(addrTranslation_1Dto2D(address1D, u_NodeAttributesSize));\\\\n}\\\\nvec4 getDatau_NodeAttributes(int address1D) {\\\\n return getDatau_NodeAttributes(float(address1D));\\\\n}\\\\nuniform sampler2D u_ClusterCenters;\\\\nuniform vec2 u_ClusterCentersSize;\\\\nvec4 getDatau_ClusterCenters(vec2 address2D) {\\\\n return vec4(texture2D(u_ClusterCenters, address2D).rgba);\\\\n}\\\\nvec4 getDatau_ClusterCenters(float address1D) {\\\\n return getDatau_ClusterCenters(addrTranslation_1Dto2D(address1D, u_ClusterCentersSize));\\\\n}\\\\nvec4 getDatau_ClusterCenters(int address1D) {\\\\n return getDatau_ClusterCenters(float(address1D));\\\\n}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 center = getDatau_ClusterCenters(i);\\\\nfloat sumx = 0.0;\\\\nfloat sumy = 0.0;\\\\nfloat count = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 attributes = getDatau_NodeAttributes(j);\\\\nint clusterIdx = int(attributes.x);\\\\nvec4 vertex = getDatau_Data(j);\\\\nif (clusterIdx == i) {sumx += vertex.x;\\\\nsumy += vertex.y;\\\\ncount += 1.0;}}\\\\ngl_FragColor = vec4(vec4(sumx / count, sumy / count, count, i));if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n\\\"},\\\"context\\\":{\\\"name\\\":\\\"\\\",\\\"dispatch\\\":[1,1,1],\\\"threadGroupSize\\\":[1,1,1],\\\"maxIteration\\\":1,\\\"defines\\\":[{\\\"name\\\":\\\"VERTEX_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true},{\\\"name\\\":\\\"CLUSTER_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true}],\\\"uniforms\\\":[{\\\"name\\\":\\\"u_Data\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_NodeAttributes\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_ClusterCenters\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":false,\\\"writeonly\\\":false,\\\"size\\\":[1,1]}],\\\"globalDeclarations\\\":[],\\\"output\\\":{\\\"name\\\":\\\"u_ClusterCenters\\\",\\\"size\\\":[1,1],\\\"length\\\":1},\\\"needPingpong\\\":true}}\";\n//# sourceMappingURL=fruchtermanShader.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gpu/fruchtermanShader.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar objectProto = Object.prototype;\nvar isPrototype = function (value) {\n var Ctor = value && value.constructor;\n var proto = (typeof Ctor === 'function' && Ctor.prototype) || objectProto;\n return value === proto;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPrototype);\n//# sourceMappingURL=is-prototype.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-prototype.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/gpu/gForce.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/gpu/gForce.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-reg-exp.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-reg-exp.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n// @ts-nocheck\n/**\n * @fileOverview fruchterman layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GForceGPULayout = void 0;\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\n// @ts-ignore\nvar g_webgpu_1 = __webpack_require__(/*! @antv/g-webgpu */ \"./node_modules/@antv/g-webgpu/es/index.js\");\nvar gpu_1 = __webpack_require__(/*! ../../util/gpu */ \"./node_modules/@antv/layout/lib/util/gpu.js\");\nvar math_1 = __webpack_require__(/*! ../../util/math */ \"./node_modules/@antv/layout/lib/util/math.js\");\nvar gForceShader_1 = __webpack_require__(/*! ./gForceShader */ \"./node_modules/@antv/layout/lib/layout/gpu/gForceShader.js\");\nvar constants_1 = __webpack_require__(/*! ../constants */ \"./node_modules/@antv/layout/lib/layout/constants.js\");\n/**\n * graphin 中的 force 布局\n */\nvar GForceGPULayout = /** @class */ (function (_super) {\n __extends(GForceGPULayout, _super);\n function GForceGPULayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 弹簧引力系数 */\n _this.edgeStrength = 200;\n /** 斥力系数 */\n _this.nodeStrength = 1000;\n /** 库伦系数 */\n _this.coulombDisScale = 0.005;\n /** 阻尼系数 */\n _this.damping = 0.9;\n /** 最大速度 */\n _this.maxSpeed = 1000;\n /** 一次迭代的平均移动距离小于该值时停止迭代 */\n _this.minMovement = 0.5;\n /** 迭代中衰减 */\n _this.interval = 0.02;\n /** 斥力的一个系数 */\n _this.factor = 1;\n /** 理想边长 */\n _this.linkDistance = 1;\n /** 重力大小 */\n _this.gravity = 10;\n /** 是否启用web worker。前提是在web worker里执行布局,否则无效\t*/\n _this.workerEnabled = false;\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.nodeMap = {};\n _this.nodeIdxMap = {};\n _this.updateCfg(options);\n return _this;\n }\n GForceGPULayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 2000,\n gravity: 10,\n clustering: false,\n clusterGravity: 10\n };\n };\n /**\n * 执行布局\n */\n GForceGPULayout.prototype.execute = function () {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, center, nodeMap, nodeIdxMap;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return [2 /*return*/];\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return [2 /*return*/];\n }\n nodeMap = {};\n nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * self.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * self.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n self.nodeStrength = (0, gpu_1.proccessToFunc)(self.nodeStrength, 1);\n self.edgeStrength = (0, gpu_1.proccessToFunc)(self.edgeStrength, 1);\n // layout\n return [4 /*yield*/, self.run()];\n case 1:\n // layout\n _a.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n GForceGPULayout.prototype.executeWithWorker = function (canvas, ctx) {\n var self = this;\n var nodes = self.nodes;\n var center = self.center;\n if (!nodes || nodes.length === 0) {\n return;\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n return;\n }\n var nodeMap = {};\n var nodeIdxMap = {};\n nodes.forEach(function (node, i) {\n if (!(0, util_1.isNumber)(node.x))\n node.x = Math.random() * self.width;\n if (!(0, util_1.isNumber)(node.y))\n node.y = Math.random() * self.height;\n nodeMap[node.id] = node;\n nodeIdxMap[node.id] = i;\n });\n self.nodeMap = nodeMap;\n self.nodeIdxMap = nodeIdxMap;\n self.nodeStrength = (0, gpu_1.proccessToFunc)(self.nodeStrength, 1);\n self.edgeStrength = (0, gpu_1.proccessToFunc)(self.edgeStrength, 1);\n // layout\n self.run(canvas, ctx);\n };\n GForceGPULayout.prototype.run = function (canvas, ctx) {\n return __awaiter(this, void 0, void 0, function () {\n var self, nodes, edges, maxIteration, numParticles, _a, maxEdgePerVetex, nodesEdgesArray, masses, nodeStrengths, centerXs, centerYs, centerGravities, fxs, fys, gravity, center, nodeAttributeArray1, nodeAttributeArray2, workerEnabled, world, onLayoutEnd, initPreviousData, i, kernelGForce, kernelAveMovement, execute;\n var _this = this;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n self = this;\n nodes = self.nodes;\n edges = self.edges;\n maxIteration = self.maxIteration;\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n numParticles = nodes.length;\n self.linkDistance = (0, gpu_1.proccessToFunc)(self.linkDistance);\n self.edgeStrength = (0, gpu_1.proccessToFunc)(self.edgeStrength);\n _a = (0, gpu_1.buildTextureDataWithTwoEdgeAttr)(nodes, edges, self.linkDistance, self.edgeStrength), maxEdgePerVetex = _a.maxEdgePerVetex, nodesEdgesArray = _a.array;\n // init degree for mass\n self.degrees = (0, math_1.getDegree)(nodes.length, self.nodeIdxMap, edges).map(function (degree) { return degree.all; });\n masses = [];\n nodeStrengths = [];\n centerXs = [];\n centerYs = [];\n centerGravities = [];\n fxs = [];\n fys = [];\n if (!self.getMass) {\n self.getMass = function (d) {\n return self.degrees[self.nodeIdxMap[d.id]] || 1;\n };\n }\n gravity = self.gravity;\n center = self.center;\n nodes.forEach(function (node, i) {\n masses.push(self.getMass(node));\n nodeStrengths.push(self.nodeStrength(node));\n if (!self.degrees[i])\n self.degrees[i] = 0;\n var nodeGravity = [center[0], center[1], gravity];\n if (self.getCenter) {\n var customCenter = self.getCenter(node, self.degrees[i]);\n if (customCenter &&\n (0, util_1.isNumber)(customCenter[0]) &&\n (0, util_1.isNumber)(customCenter[1]) &&\n (0, util_1.isNumber)(customCenter[2])) {\n nodeGravity = customCenter;\n }\n }\n centerXs.push(nodeGravity[0]);\n centerYs.push(nodeGravity[1]);\n centerGravities.push(nodeGravity[2]);\n if ((0, util_1.isNumber)(node.fx) && (0, util_1.isNumber)(node.fy)) {\n fxs.push(node.fx || 0.001);\n fys.push(node.fy || 0.001);\n }\n else {\n fxs.push(0);\n fys.push(0);\n }\n });\n nodeAttributeArray1 = (0, gpu_1.arrayToTextureData)([\n masses,\n self.degrees,\n nodeStrengths,\n fxs\n ]);\n nodeAttributeArray2 = (0, gpu_1.arrayToTextureData)([\n centerXs,\n centerYs,\n centerGravities,\n fys\n ]);\n workerEnabled = self.workerEnabled;\n if (workerEnabled) {\n world = g_webgpu_1.World.create({\n canvas: canvas,\n engineOptions: {\n supportCompute: true\n }\n });\n }\n else {\n world = g_webgpu_1.World.create({\n engineOptions: {\n supportCompute: true\n }\n });\n }\n onLayoutEnd = self.onLayoutEnd;\n initPreviousData = [];\n nodesEdgesArray.forEach(function (value) {\n initPreviousData.push(value);\n });\n for (i = 0; i < 4; i++) {\n initPreviousData.push(0);\n }\n kernelGForce = world\n .createKernel(gForceShader_1.gForceBundle)\n .setDispatch([numParticles, 1, 1])\n .setBinding({\n u_Data: nodesEdgesArray,\n u_damping: self.damping,\n u_maxSpeed: self.maxSpeed,\n u_minMovement: self.minMovement,\n u_coulombDisScale: self.coulombDisScale,\n u_factor: self.factor,\n u_NodeAttributeArray1: nodeAttributeArray1,\n u_NodeAttributeArray2: nodeAttributeArray2,\n MAX_EDGE_PER_VERTEX: maxEdgePerVetex,\n VERTEX_COUNT: numParticles,\n u_AveMovement: initPreviousData,\n u_interval: self.interval // 每次迭代更新,首次设置为 interval,在 onIterationCompleted 中更新\n });\n kernelAveMovement = world\n .createKernel(gForceShader_1.aveMovementBundle)\n .setDispatch([1, 1, 1])\n .setBinding({\n u_Data: nodesEdgesArray,\n VERTEX_COUNT: numParticles,\n u_AveMovement: [0, 0, 0, 0]\n });\n execute = function () { return __awaiter(_this, void 0, void 0, function () {\n var i, stepInterval, finalParticleData;\n return __generator(this, function (_a) {\n switch (_a.label) {\n case 0:\n i = 0;\n _a.label = 1;\n case 1:\n if (!(i < maxIteration)) return [3 /*break*/, 5];\n // TODO: 似乎都来自 kernelGForce 是一个引用\n // 当前坐标作为下一次迭代的 PreviousData\n // if (i > 0) {\n // kernelAveMovement.setBinding({\n // u_PreviousData: kernelGForce\n // });\n // }\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, kernelGForce.execute()];\n case 2:\n // TODO: 似乎都来自 kernelGForce 是一个引用\n // 当前坐标作为下一次迭代的 PreviousData\n // if (i > 0) {\n // kernelAveMovement.setBinding({\n // u_PreviousData: kernelGForce\n // });\n // }\n // eslint-disable-next-line no-await-in-loop\n _a.sent();\n // midRes = await kernelGForce.getOutput();\n // 每次迭代完成后\n // 计算平均位移,用于提前终止迭代\n kernelAveMovement.setBinding({\n u_Data: kernelGForce\n });\n // eslint-disable-next-line no-await-in-loop\n return [4 /*yield*/, kernelAveMovement.execute()];\n case 3:\n // eslint-disable-next-line no-await-in-loop\n _a.sent();\n stepInterval = Math.max(0.02, self.interval - i * 0.002);\n kernelGForce.setBinding({\n u_interval: stepInterval,\n u_AveMovement: kernelAveMovement\n });\n _a.label = 4;\n case 4:\n i++;\n return [3 /*break*/, 1];\n case 5: return [4 /*yield*/, kernelGForce.getOutput()];\n case 6:\n finalParticleData = _a.sent();\n // 所有迭代完成后\n if (canvas) {\n // 传递数据给主线程\n ctx.postMessage({\n type: constants_1.LAYOUT_MESSAGE.GPUEND,\n vertexEdgeData: finalParticleData\n // edgeIndexBufferData,\n });\n }\n else {\n nodes.forEach(function (node, i) {\n var x = finalParticleData[4 * i];\n var y = finalParticleData[4 * i + 1];\n node.x = x;\n node.y = y;\n });\n }\n if (onLayoutEnd)\n onLayoutEnd();\n return [2 /*return*/];\n }\n });\n }); };\n return [4 /*yield*/, execute()];\n case 1:\n _b.sent();\n return [2 /*return*/];\n }\n });\n });\n };\n GForceGPULayout.prototype.getType = function () {\n return \"gForce-gpu\";\n };\n return GForceGPULayout;\n}(base_1.Base));\nexports.GForceGPULayout = GForceGPULayout;\n//# sourceMappingURL=gForce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gpu/gForce.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n\nvar isRegExp = function (str) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str, 'RegExp');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isRegExp);\n//# sourceMappingURL=is-reg-exp.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-reg-exp.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/gpu/gForceShader.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/gpu/gForceShader.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js ***! + \***********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.aveMovementBundle = exports.aveMovementCode = exports.gForceBundle = exports.gForceCode = void 0;\nexports.gForceCode = \"\\nimport { globalInvocationID } from 'g-webgpu';\\n\\nconst MAX_EDGE_PER_VERTEX;\\nconst VERTEX_COUNT;\\nconst SHIFT_20 = 1048576;\\n\\n@numthreads(1, 1, 1)\\nclass GGForce {\\n @in @out\\n u_Data: vec4[];\\n\\n @in\\n u_damping: float;\\n \\n @in\\n u_maxSpeed: float;\\n\\n @in\\n u_minMovement: float;\\n\\n @in\\n u_AveMovement: vec4[];\\n\\n @in\\n u_coulombDisScale: float;\\n\\n @in\\n u_factor: float;\\n\\n @in\\n u_NodeAttributeArray1: vec4[];\\n\\n @in\\n u_NodeAttributeArray2: vec4[];\\n\\n @in\\n u_interval: float;\\n\\n unpack_float(packedValue: float): ivec2 {\\n const packedIntValue = int(packedValue);\\n const v0 = packedIntValue / SHIFT_20;\\n return [v0, packedIntValue - v0 * SHIFT_20];\\n }\\n\\n calcRepulsive(i: int, currentNode: vec4): vec2 {\\n let ax = 0, ay = 0;\\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\\n if (i != j) {\\n const nextNode = this.u_Data[j];\\n const vx = currentNode[0] - nextNode[0];\\n const vy = currentNode[1] - nextNode[1];\\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\\n const n_dist = (dist + 0.1) * this.u_coulombDisScale;\\n const direx = vx / dist;\\n const direy = vy / dist;\\n const attributesi = this.u_NodeAttributeArray1[i];\\n const attributesj = this.u_NodeAttributeArray1[j];\\n const massi = attributesi[0];\\n const nodeStrengthi = attributesi[2];\\n const nodeStrengthj = attributesj[2];\\n const nodeStrength = (nodeStrengthi + nodeStrengthj) / 2;\\n // const param = nodeStrength * this.u_factor / (n_dist * n_dist * massi);\\n const param = nodeStrength * this.u_factor / (n_dist * n_dist);\\n ax += direx * param;\\n ay += direy * param;\\n }\\n }\\n return [ax, ay];\\n }\\n\\n calcGravity(i: int, currentNode: vec4, attributes2: vec4): vec2 {\\n // note: attributes2 = [centerX, centerY, gravity, 0]\\n\\n const vx = currentNode[0] - attributes2[0];\\n const vy = currentNode[1] - attributes2[1];\\n \\n const ax = vx * attributes2[2];\\n const ay = vy * attributes2[2];\\n \\n return [ax, ay];\\n }\\n\\n calcAttractive(i: int, currentNode: vec4, attributes1: vec4): vec2 {\\n // note: attributes1 = [mass, degree, nodeSterngth, 0]\\n\\n const mass = attributes1[0];\\n let ax = 0, ay = 0;\\n // const arr_offset = int(floor(currentNode[2] + 0.5));\\n // const length = int(floor(currentNode[3] + 0.5));\\n\\n const compressed = this.unpack_float(currentNode[2]);\\n const length = compressed[0];\\n const arr_offset = compressed[1];\\n\\n const node_buffer: vec4;\\n for (let p: int = 0; p < MAX_EDGE_PER_VERTEX; p++) {\\n if (p >= length) break;\\n const arr_idx = arr_offset + 4 * p; // i \\u8282\\u70B9\\u7684\\u7B2C p \\u6761\\u8FB9\\u5F00\\u59CB\\u7684\\u5C0F\\u683C\\u5B50\\u4F4D\\u7F6E\\n const buf_offset = arr_idx - arr_idx / 4 * 4;\\n if (p == 0 || buf_offset == 0) {\\n node_buffer = this.u_Data[int(arr_idx / 4)]; // \\u5927\\u683C\\u5B50\\uFF0C\\u5927\\u683C\\u5B50\\u4F4D\\u7F6E=\\u5C0F\\u4E2A\\u5B50\\u4F4D\\u7F6E / 4\\uFF0C\\n }\\n\\n let float_j: float = node_buffer[0];\\n\\n const nextNode = this.u_Data[int(float_j)];\\n const vx = nextNode[0] - currentNode[0];\\n const vy = nextNode[1] - currentNode[1];\\n const dist = sqrt(vx * vx + vy * vy) + 0.01;\\n const direx = vx / dist;\\n const direy = vy / dist;\\n const edgeLength = node_buffer[1];\\n const edgeStrength = node_buffer[2];\\n const diff: float = edgeLength - dist;//edgeLength\\n // const param = diff * this.u_stiffness / mass; //\\n const param = diff * edgeStrength / mass; // \\n ax -= direx * param;\\n ay -= direy * param;\\n }\\n return [ax, ay];\\n }\\n\\n @main\\n compute() {\\n const i = globalInvocationID.x;\\n const currentNode = this.u_Data[i];\\n const movement = u_AveMovement[0];\\n let ax = 0, ay = 0;\\n\\n if (i >= VERTEX_COUNT || movement.x < u_minMovement) {\\n this.u_Data[i] = currentNode;\\n return;\\n }\\n\\n // \\u6BCF\\u4E2A\\u8282\\u70B9\\u5C5E\\u6027\\u5360\\u4E24\\u4E2A\\u6570\\u7EC4\\u4E2D\\u5404\\u4E00\\u683C\\n // [mass, degree, nodeStrength, fx]\\n const nodeAttributes1 = this.u_NodeAttributeArray1[i];\\n // [centerX, centerY, centerGravity, fy]\\n const nodeAttributes2 = this.u_NodeAttributeArray2[i];\\n\\n // repulsive\\n const repulsive = this.calcRepulsive(i, currentNode);\\n ax += repulsive[0];\\n ay += repulsive[1];\\n\\n // attractive\\n const attractive = this.calcAttractive(i, currentNode, nodeAttributes1);\\n ax += attractive[0];\\n ay += attractive[1];\\n\\n // gravity\\n const gravity = this.calcGravity(i, currentNode, nodeAttributes2);\\n ax -= gravity[0];\\n ay -= gravity[1];\\n\\n // speed\\n const param = this.u_interval * this.u_damping;\\n let vx = ax * param;\\n let vy = ay * param;\\n const vlength = sqrt(vx * vx + vy * vy) + 0.0001;\\n if (vlength > this.u_maxSpeed) {\\n const param2 = this.u_maxSpeed / vlength;\\n vx = param2 * vx;\\n vy = param2 * vy;\\n }\\n\\n // move\\n if (nodeAttributes1[3] != 0 && nodeAttributes2[3] != 0) {\\n this.u_Data[i] = [\\n nodeAttributes1[3],\\n nodeAttributes2[3],\\n currentNode[2],\\n 0\\n ];\\n } else {\\n const distx = vx * this.u_interval;\\n const disty = vy * this.u_interval;\\n const distLength = sqrt(distx * distx + disty * disty);\\n this.u_Data[i] = [\\n currentNode[0] + distx,\\n currentNode[1] + disty,\\n currentNode[2],\\n distLength\\n ];\\n }\\n \\n // the avarage move distance\\n // need to share memory\\n \\n }\\n}\\n\";\nexports.gForceBundle = \"{\\\"shaders\\\":{\\\"WGSL\\\":\\\"import \\\\\\\"GLSL.std.450\\\\\\\" as std;\\\\n\\\\n\\\\n# var gWebGPUDebug : bool = false;\\\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\\\n\\\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\\\n# [[builtin work_group_id]] var workGroupID : vec3;\\\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\\\n\\\\ntype GWebGPUParams = [[block]] struct {\\\\n [[offset 0]] u_damping : f32;\\\\n [[offset 4]] u_maxSpeed : f32;\\\\n [[offset 8]] u_minMovement : f32;\\\\n \\\\n [[offset 12]] u_coulombDisScale : f32;\\\\n [[offset 16]] u_factor : f32;\\\\n \\\\n \\\\n [[offset 20]] u_interval : f32;\\\\n};\\\\n[[binding 0, set 0]] var gWebGPUUniformParams : GWebGPUParams;\\\\ntype GWebGPUBuffer0 = [[block]] struct {\\\\n [[offset 0]] u_Data : [[stride 16]] array>;\\\\n};\\\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\\\ntype GWebGPUBuffer1 = [[block]] struct {\\\\n [[offset 0]] u_AveMovement : [[stride 16]] array>;\\\\n};\\\\n[[binding 2, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\\\ntype GWebGPUBuffer2 = [[block]] struct {\\\\n [[offset 0]] u_NodeAttributeArray1 : [[stride 16]] array>;\\\\n};\\\\n[[binding 3, set 0]] var gWebGPUBuffer2 : GWebGPUBuffer2;\\\\ntype GWebGPUBuffer3 = [[block]] struct {\\\\n [[offset 0]] u_NodeAttributeArray2 : [[stride 16]] array>;\\\\n};\\\\n[[binding 4, set 0]] var gWebGPUBuffer3 : GWebGPUBuffer3;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nfn unpack_float(packedValue : f32) -> vec2 {var packedIntValue : i32 = i32(packedValue);\\\\nvar v0 : i32 = packedIntValue / 1048576;\\\\nreturn vec2(v0, packedIntValue - (v0 * 1048576));}\\\\nfn calcRepulsive(i : i32, currentNode : vec4) -> vec2 {var ax : f32 = 0.0;\\\\nvar ay : f32 = 0.0;\\\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {if (i != j) {var nextNode : vec4 = gWebGPUBuffer0.u_Data[j];\\\\nvar vx : f32 = currentNode.x - nextNode.x;\\\\nvar vy : f32 = currentNode.y - nextNode.y;\\\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nvar n_dist : f32 = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\\\nvar direx : f32 = vx / dist;\\\\nvar direy : f32 = vy / dist;\\\\nvar attributesi : vec4 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\\\nvar attributesj : vec4 = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\\\nvar massi : f32 = attributesi.x;\\\\nvar nodeStrengthi : f32 = attributesi.z;\\\\nvar nodeStrengthj : f32 = attributesj.z;\\\\nvar nodeStrength : f32 = (nodeStrengthi + nodeStrengthj) / 2.0;\\\\nvar param : f32 = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\\\nax = ax + direx * param;\\\\nay = ay + direy * param;}}\\\\nreturn vec2(ax, ay);}\\\\nfn calcGravity(i : i32, currentNode : vec4, attributes2 : vec4) -> vec2 {var vx : f32 = currentNode.x - attributes2.x;\\\\nvar vy : f32 = currentNode.y - attributes2.y;\\\\nvar ax : f32 = vx * attributes2.z;\\\\nvar ay : f32 = vy * attributes2.z;\\\\nreturn vec2(ax, ay);}\\\\nfn calcAttractive(i : i32, currentNode : vec4, attributes1 : vec4) -> vec2 {var mass : f32 = attributes1.x;\\\\nvar ax : f32 = 0.0;\\\\nvar ay : f32 = 0.0;\\\\nvar compressed : vec2 = unpack_float(currentNode.z);\\\\nvar length : i32 = compressed.x;\\\\nvar arr_offset : i32 = compressed.y;\\\\nvar node_buffer : vec4;\\\\nfor (var p : i32 = 0; p < __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX; p = p + 1) {if (p >= length) {break;}\\\\nvar arr_idx : i32 = arr_offset + (4 * p);\\\\nvar buf_offset : i32 = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[i32(arr_idx / 4)];}\\\\nvar float_j : f32 = node_buffer.x;\\\\nvar nextNode : vec4 = gWebGPUBuffer0.u_Data[i32(float_j)];\\\\nvar vx : f32 = nextNode.x - currentNode.x;\\\\nvar vy : f32 = nextNode.y - currentNode.y;\\\\nvar dist : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nvar direx : f32 = vx / dist;\\\\nvar direy : f32 = vy / dist;\\\\nvar edgeLength : f32 = node_buffer.y;\\\\nvar edgeStrength : f32 = node_buffer.z;\\\\nvar diff : f32 = edgeLength - dist;\\\\nvar param : f32 = (diff * edgeStrength) / mass;\\\\nax = ax - direx * param;\\\\nay = ay - direy * param;}\\\\nreturn vec2(ax, ay);}\\\\nfn main() -> void {var i : i32 = globalInvocationID.x;\\\\nvar currentNode : vec4 = gWebGPUBuffer0.u_Data[i];\\\\nvar movement : vec4 = gWebGPUBuffer1.u_AveMovement[0];\\\\nvar ax : f32 = 0.0;\\\\nvar ay : f32 = 0.0;\\\\nif ((i >= __DefineValuePlaceholder__VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\\\nreturn ;}\\\\nvar nodeAttributes1 : vec4 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\\\nvar nodeAttributes2 : vec4 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\\\nvar repulsive : vec2 = calcRepulsive(i, currentNode);\\\\nax = ax + repulsive.x;\\\\nay = ay + repulsive.y;\\\\nvar attractive : vec2 = calcAttractive(i, currentNode, nodeAttributes1);\\\\nax = ax + attractive.x;\\\\nay = ay + attractive.y;\\\\nvar gravity : vec2 = calcGravity(i, currentNode, nodeAttributes2);\\\\nax = ax - gravity.x;\\\\nay = ay - gravity.y;\\\\nvar param : f32 = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\\\nvar vx : f32 = ax * param;\\\\nvar vy : f32 = ay * param;\\\\nvar vlength : f32 = std::sqrt((vx * vx) + (vy * vy)) + 0.0001;\\\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {var param2 : f32 = gWebGPUUniformParams.u_maxSpeed / vlength;\\\\nvx = param2 * vx;\\\\nvy = param2 * vy;}\\\\nvar distx : f32 = vx * gWebGPUUniformParams.u_interval;\\\\nvar disty : f32 = vy * gWebGPUUniformParams.u_interval;\\\\nvar distLength : f32 = std::sqrt((distx * distx) + (disty * disty));\\\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}\\\\nreturn;}\\\\n\\\\nentry_point compute as \\\\\\\"main\\\\\\\" = main;\\\\n\\\",\\\"GLSL450\\\":\\\"\\\\n\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\\\nivec3 workGroupSize = ivec3(1,1,1);\\\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\\\n\\\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\\\n float u_damping;\\\\n float u_maxSpeed;\\\\n float u_minMovement;\\\\n \\\\n float u_coulombDisScale;\\\\n float u_factor;\\\\n \\\\n \\\\n float u_interval;\\\\n} gWebGPUUniformParams;\\\\nlayout(std430, set = 0, binding = 1) buffer GWebGPUBuffer0 {\\\\n vec4 u_Data[];\\\\n} gWebGPUBuffer0;\\\\n\\\\nlayout(std430, set = 0, binding = 2) buffer readonly GWebGPUBuffer1 {\\\\n vec4 u_AveMovement[];\\\\n} gWebGPUBuffer1;\\\\n\\\\nlayout(std430, set = 0, binding = 3) buffer readonly GWebGPUBuffer2 {\\\\n vec4 u_NodeAttributeArray1[];\\\\n} gWebGPUBuffer2;\\\\n\\\\nlayout(std430, set = 0, binding = 4) buffer readonly GWebGPUBuffer3 {\\\\n vec4 u_NodeAttributeArray2[];\\\\n} gWebGPUBuffer3;\\\\n\\\\n\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define SHIFT_20 1048576.0\\\\nlayout (\\\\n local_size_x = 1,\\\\n local_size_y = 1,\\\\n local_size_z = 1\\\\n) in;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nivec2 unpack_float(float packedValue) {int packedIntValue = int(packedValue);\\\\nint v0 = packedIntValue / int(SHIFT_20);\\\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {float ax = 0.0;\\\\nfloat ay = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = gWebGPUBuffer0.u_Data[j];\\\\nfloat vx = currentNode.x - nextNode.x;\\\\nfloat vy = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat n_dist = (dist + 0.1) * gWebGPUUniformParams.u_coulombDisScale;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nvec4 attributesi = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\\\nvec4 attributesj = gWebGPUBuffer2.u_NodeAttributeArray1[j];\\\\nfloat massi = attributesi.x;\\\\nfloat nodeStrengthi = attributesi.z;\\\\nfloat nodeStrengthj = attributesj.z;\\\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\\\nfloat param = (nodeStrength * gWebGPUUniformParams.u_factor) / (n_dist * n_dist);\\\\nax += direx * param;\\\\nay += direy * param;}}\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {float vx = currentNode.x - attributes2.x;\\\\nfloat vy = currentNode.y - attributes2.y;\\\\nfloat ax = vx * attributes2.z;\\\\nfloat ay = vy * attributes2.z;\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {float mass = attributes1.x;\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nivec2 compressed = unpack_float(currentNode.z);\\\\nint length = compressed.x;\\\\nint arr_offset = compressed.y;\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + (4 * p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = gWebGPUBuffer0.u_Data[int(arr_idx / 4)];}\\\\nfloat float_j = node_buffer.x;\\\\nvec4 nextNode = gWebGPUBuffer0.u_Data[int(float_j)];\\\\nfloat vx = nextNode.x - currentNode.x;\\\\nfloat vy = nextNode.y - currentNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nfloat edgeLength = node_buffer.y;\\\\nfloat edgeStrength = node_buffer.z;\\\\nfloat diff = edgeLength - dist;\\\\nfloat param = (diff * edgeStrength) / mass;\\\\nax -= direx * param;\\\\nay -= direy * param;}\\\\nreturn vec2(ax, ay);}\\\\nvoid main() {int i = globalInvocationID.x;\\\\nvec4 currentNode = gWebGPUBuffer0.u_Data[i];\\\\nvec4 movement = gWebGPUBuffer1.u_AveMovement[0];\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nif ((i >= VERTEX_COUNT) || (movement.x < gWebGPUUniformParams.u_minMovement)) {gWebGPUBuffer0.u_Data[i] = currentNode;\\\\nreturn ;}\\\\nvec4 nodeAttributes1 = gWebGPUBuffer2.u_NodeAttributeArray1[i];\\\\nvec4 nodeAttributes2 = gWebGPUBuffer3.u_NodeAttributeArray2[i];\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\nax += repulsive.x;\\\\nay += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\\\nax += attractive.x;\\\\nay += attractive.y;\\\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\\\nax -= gravity.x;\\\\nay -= gravity.y;\\\\nfloat param = gWebGPUUniformParams.u_interval * gWebGPUUniformParams.u_damping;\\\\nfloat vx = ax * param;\\\\nfloat vy = ay * param;\\\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\\\nif (vlength > gWebGPUUniformParams.u_maxSpeed) {float param2 = gWebGPUUniformParams.u_maxSpeed / vlength;\\\\nvx = param2 * vx;\\\\nvy = param2 * vy;}\\\\nfloat distx = vx * gWebGPUUniformParams.u_interval;\\\\nfloat disty = vy * gWebGPUUniformParams.u_interval;\\\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gWebGPUBuffer0.u_Data[i] = vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0);}else {gWebGPUBuffer0.u_Data[i] = vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength);}}\\\\n\\\",\\\"GLSL100\\\":\\\"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define MAX_EDGE_PER_VERTEX __DefineValuePlaceholder__MAX_EDGE_PER_VERTEX\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n#define SHIFT_20 1048576.0\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_damping;\\\\nuniform float u_maxSpeed;\\\\nuniform float u_minMovement;\\\\nuniform sampler2D u_AveMovement;\\\\nuniform vec2 u_AveMovementSize;\\\\nvec4 getDatau_AveMovement(vec2 address2D) {\\\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AveMovement(float address1D) {\\\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\\\n}\\\\nvec4 getDatau_AveMovement(int address1D) {\\\\n return getDatau_AveMovement(float(address1D));\\\\n}\\\\nuniform float u_coulombDisScale;\\\\nuniform float u_factor;\\\\nuniform sampler2D u_NodeAttributeArray1;\\\\nuniform vec2 u_NodeAttributeArray1Size;\\\\nvec4 getDatau_NodeAttributeArray1(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributeArray1, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributeArray1(float address1D) {\\\\n return getDatau_NodeAttributeArray1(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray1Size));\\\\n}\\\\nvec4 getDatau_NodeAttributeArray1(int address1D) {\\\\n return getDatau_NodeAttributeArray1(float(address1D));\\\\n}\\\\nuniform sampler2D u_NodeAttributeArray2;\\\\nuniform vec2 u_NodeAttributeArray2Size;\\\\nvec4 getDatau_NodeAttributeArray2(vec2 address2D) {\\\\n return vec4(texture2D(u_NodeAttributeArray2, address2D).rgba);\\\\n}\\\\nvec4 getDatau_NodeAttributeArray2(float address1D) {\\\\n return getDatau_NodeAttributeArray2(addrTranslation_1Dto2D(address1D, u_NodeAttributeArray2Size));\\\\n}\\\\nvec4 getDatau_NodeAttributeArray2(int address1D) {\\\\n return getDatau_NodeAttributeArray2(float(address1D));\\\\n}\\\\nuniform float u_interval;\\\\nivec2 unpack_float(float packedValue) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint packedIntValue = int(packedValue);\\\\nint v0 = packedIntValue / int(SHIFT_20);\\\\nreturn ivec2(v0, packedIntValue - (v0 * int(SHIFT_20)));}\\\\nvec2 calcRepulsive(int i, vec4 currentNode) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {if (i != j) {vec4 nextNode = getDatau_Data(j);\\\\nfloat vx = currentNode.x - nextNode.x;\\\\nfloat vy = currentNode.y - nextNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat n_dist = (dist + 0.1) * u_coulombDisScale;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nvec4 attributesi = getDatau_NodeAttributeArray1(i);\\\\nvec4 attributesj = getDatau_NodeAttributeArray1(j);\\\\nfloat massi = attributesi.x;\\\\nfloat nodeStrengthi = attributesi.z;\\\\nfloat nodeStrengthj = attributesj.z;\\\\nfloat nodeStrength = (nodeStrengthi + nodeStrengthj) / 2.0;\\\\nfloat param = (nodeStrength * u_factor) / (n_dist * n_dist);\\\\nax += direx * param;\\\\nay += direy * param;}}\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcGravity(int i, vec4 currentNode, vec4 attributes2) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat vx = currentNode.x - attributes2.x;\\\\nfloat vy = currentNode.y - attributes2.y;\\\\nfloat ax = vx * attributes2.z;\\\\nfloat ay = vy * attributes2.z;\\\\nreturn vec2(ax, ay);}\\\\nvec2 calcAttractive(int i, vec4 currentNode, vec4 attributes1) {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat mass = attributes1.x;\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nivec2 compressed = unpack_float(currentNode.z);\\\\nint length = compressed.x;\\\\nint arr_offset = compressed.y;\\\\nvec4 node_buffer;\\\\nfor (int p = 0; p < MAX_EDGE_PER_VERTEX; p++) {if (p >= length) {break;}\\\\nint arr_idx = arr_offset + (4 * p);\\\\nint buf_offset = arr_idx - ((arr_idx / 4) * 4);\\\\nif ((p == 0) || (buf_offset == 0)) {node_buffer = getDatau_Data(int(arr_idx / 4));}\\\\nfloat float_j = node_buffer.x;\\\\nvec4 nextNode = getDatau_Data(int(float_j));\\\\nfloat vx = nextNode.x - currentNode.x;\\\\nfloat vy = nextNode.y - currentNode.y;\\\\nfloat dist = sqrt((vx * vx) + (vy * vy)) + 0.01;\\\\nfloat direx = vx / dist;\\\\nfloat direy = vy / dist;\\\\nfloat edgeLength = node_buffer.y;\\\\nfloat edgeStrength = node_buffer.z;\\\\nfloat diff = edgeLength - dist;\\\\nfloat param = (diff * edgeStrength) / mass;\\\\nax -= direx * param;\\\\nay -= direy * param;}\\\\nreturn vec2(ax, ay);}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nint i = globalInvocationID.x;\\\\nvec4 currentNode = getDatau_Data(i);\\\\nvec4 movement = getDatau_AveMovement(0.0);\\\\nfloat ax = 0.0;\\\\nfloat ay = 0.0;\\\\nif ((i >= VERTEX_COUNT) || (movement.x < u_minMovement)) {gl_FragColor = vec4(currentNode);\\\\nreturn ;}\\\\nvec4 nodeAttributes1 = getDatau_NodeAttributeArray1(i);\\\\nvec4 nodeAttributes2 = getDatau_NodeAttributeArray2(i);\\\\nvec2 repulsive = calcRepulsive(i, currentNode);\\\\nax += repulsive.x;\\\\nay += repulsive.y;\\\\nvec2 attractive = calcAttractive(i, currentNode, nodeAttributes1);\\\\nax += attractive.x;\\\\nay += attractive.y;\\\\nvec2 gravity = calcGravity(i, currentNode, nodeAttributes2);\\\\nax -= gravity.x;\\\\nay -= gravity.y;\\\\nfloat param = u_interval * u_damping;\\\\nfloat vx = ax * param;\\\\nfloat vy = ay * param;\\\\nfloat vlength = sqrt((vx * vx) + (vy * vy)) + 0.0001;\\\\nif (vlength > u_maxSpeed) {float param2 = u_maxSpeed / vlength;\\\\nvx = param2 * vx;\\\\nvy = param2 * vy;}\\\\nfloat distx = vx * u_interval;\\\\nfloat disty = vy * u_interval;\\\\nfloat distLength = sqrt((distx * distx) + (disty * disty));\\\\nif ((nodeAttributes1.w != 0.0) && (nodeAttributes2.w != 0.0)) {gl_FragColor = vec4(vec4(nodeAttributes1.w, nodeAttributes2.w, currentNode.z, 0.0));}else {gl_FragColor = vec4(vec4(currentNode.x + distx, currentNode.y + disty, currentNode.z, distLength));}if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n\\\"},\\\"context\\\":{\\\"name\\\":\\\"\\\",\\\"dispatch\\\":[1,1,1],\\\"threadGroupSize\\\":[1,1,1],\\\"maxIteration\\\":1,\\\"defines\\\":[{\\\"name\\\":\\\"MAX_EDGE_PER_VERTEX\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true},{\\\"name\\\":\\\"VERTEX_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true},{\\\"name\\\":\\\"SHIFT_20\\\",\\\"type\\\":\\\"Float\\\",\\\"value\\\":1048576,\\\"runtime\\\":false}],\\\"uniforms\\\":[{\\\"name\\\":\\\"u_Data\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":false,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_damping\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_maxSpeed\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_minMovement\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_AveMovement\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_coulombDisScale\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_factor\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_NodeAttributeArray1\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_NodeAttributeArray2\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_interval\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]}],\\\"globalDeclarations\\\":[],\\\"output\\\":{\\\"name\\\":\\\"u_Data\\\",\\\"size\\\":[1,1],\\\"length\\\":1},\\\"needPingpong\\\":true}}\";\nexports.aveMovementCode = \"\\nconst VERTEX_COUNT;\\n@numthreads(1, 1, 1)\\nclass CalcAveMovement {\\n @in\\n u_Data: vec4[];\\n @in\\n u_iter: float;\\n @in @out\\n u_AveMovement: vec4[];\\n @main\\n compute() {\\n let movement = 0;\\n for (let j: int = 0; j < VERTEX_COUNT; j++) {\\n const vertex = this.u_Data[j];\\n movement += vertex[3];\\n }\\n movement = movement / float(VERTEX_COUNT);\\n this.u_AveMovement[0] = [movement, 0, 0, 0];\\n }\\n}\\n\";\nexports.aveMovementBundle = \"{\\\"shaders\\\":{\\\"WGSL\\\":\\\"import \\\\\\\"GLSL.std.450\\\\\\\" as std;\\\\n\\\\n\\\\n# var gWebGPUDebug : bool = false;\\\\n# var gWebGPUDebugOutput : vec4 = vec4(0.0);\\\\n\\\\n[[builtin global_invocation_id]] var globalInvocationID : vec3;\\\\n# [[builtin work_group_size]] var workGroupSize : vec3;\\\\n# [[builtin work_group_id]] var workGroupID : vec3;\\\\n[[builtin local_invocation_id]] var localInvocationID : vec3;\\\\n# [[builtin num_work_groups]] var numWorkGroups : vec3;\\\\n[[builtin local_invocation_idx]] var localInvocationIndex : u32;\\\\n\\\\ntype GWebGPUParams = [[block]] struct {\\\\n [[offset 0]] u_iter : f32;\\\\n};\\\\n[[binding 0, set 0]] var gWebGPUUniformParams : GWebGPUParams;\\\\ntype GWebGPUBuffer0 = [[block]] struct {\\\\n [[offset 0]] u_Data : [[stride 16]] array>;\\\\n};\\\\n[[binding 1, set 0]] var gWebGPUBuffer0 : GWebGPUBuffer0;\\\\ntype GWebGPUBuffer1 = [[block]] struct {\\\\n [[offset 0]] u_AveMovement : [[stride 16]] array>;\\\\n};\\\\n[[binding 2, set 0]] var gWebGPUBuffer1 : GWebGPUBuffer1;\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\n\\\\nfn main() -> void {var movement : f32 = 0.0;\\\\nfor (var j : i32 = 0; j < __DefineValuePlaceholder__VERTEX_COUNT; j = j + 1) {var vertex : vec4 = gWebGPUBuffer0.u_Data[j];\\\\nmovement = movement + vertex.w;}\\\\nmovement = movement / f32(__DefineValuePlaceholder__VERTEX_COUNT);\\\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);\\\\nreturn;}\\\\n\\\\nentry_point compute as \\\\\\\"main\\\\\\\" = main;\\\\n\\\",\\\"GLSL450\\\":\\\"\\\\n\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\nivec3 globalInvocationID = ivec3(gl_GlobalInvocationID);\\\\nivec3 workGroupSize = ivec3(1,1,1);\\\\nivec3 workGroupID = ivec3(gl_WorkGroupID);\\\\nivec3 localInvocationID = ivec3(gl_LocalInvocationID);\\\\nivec3 numWorkGroups = ivec3(gl_NumWorkGroups);\\\\nint localInvocationIndex = int(gl_LocalInvocationIndex);\\\\n\\\\nlayout(std140, set = 0, binding = 0) uniform GWebGPUParams {\\\\n float u_iter;\\\\n} gWebGPUUniformParams;\\\\nlayout(std430, set = 0, binding = 1) buffer readonly GWebGPUBuffer0 {\\\\n vec4 u_Data[];\\\\n} gWebGPUBuffer0;\\\\n\\\\nlayout(std430, set = 0, binding = 2) buffer GWebGPUBuffer1 {\\\\n vec4 u_AveMovement[];\\\\n} gWebGPUBuffer1;\\\\n\\\\n\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\nlayout (\\\\n local_size_x = 1,\\\\n local_size_y = 1,\\\\n local_size_z = 1\\\\n) in;\\\\n\\\\n\\\\n\\\\nvoid main() {float movement = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = gWebGPUBuffer0.u_Data[j];\\\\nmovement += vertex.w;}\\\\nmovement = movement / float(VERTEX_COUNT);\\\\ngWebGPUBuffer1.u_AveMovement[0] = vec4(movement, 0.0, 0.0, 0.0);}\\\\n\\\",\\\"GLSL100\\\":\\\"\\\\n\\\\nfloat epsilon = 0.00001;\\\\nvec2 addrTranslation_1Dto2D(float address1D, vec2 texSize) {\\\\n vec2 conv_const = vec2(1.0 / texSize.x, 1.0 / (texSize.x * texSize.y));\\\\n vec2 normAddr2D = float(address1D) * conv_const;\\\\n return vec2(fract(normAddr2D.x + epsilon), normAddr2D.y);\\\\n}\\\\n\\\\nvoid barrier() {}\\\\n \\\\n\\\\nuniform vec2 u_OutputTextureSize;\\\\nuniform int u_OutputTexelCount;\\\\nvarying vec2 v_TexCoord;\\\\n\\\\nbool gWebGPUDebug = false;\\\\nvec4 gWebGPUDebugOutput = vec4(0.0);\\\\n\\\\n#define VERTEX_COUNT __DefineValuePlaceholder__VERTEX_COUNT\\\\n\\\\nuniform sampler2D u_Data;\\\\nuniform vec2 u_DataSize;\\\\nvec4 getDatau_Data(vec2 address2D) {\\\\n return vec4(texture2D(u_Data, address2D).rgba);\\\\n}\\\\nvec4 getDatau_Data(float address1D) {\\\\n return getDatau_Data(addrTranslation_1Dto2D(address1D, u_DataSize));\\\\n}\\\\nvec4 getDatau_Data(int address1D) {\\\\n return getDatau_Data(float(address1D));\\\\n}\\\\nuniform float u_iter;\\\\nuniform sampler2D u_AveMovement;\\\\nuniform vec2 u_AveMovementSize;\\\\nvec4 getDatau_AveMovement(vec2 address2D) {\\\\n return vec4(texture2D(u_AveMovement, address2D).rgba);\\\\n}\\\\nvec4 getDatau_AveMovement(float address1D) {\\\\n return getDatau_AveMovement(addrTranslation_1Dto2D(address1D, u_AveMovementSize));\\\\n}\\\\nvec4 getDatau_AveMovement(int address1D) {\\\\n return getDatau_AveMovement(float(address1D));\\\\n}\\\\nvoid main() {\\\\nivec3 workGroupSize = ivec3(1, 1, 1);\\\\nivec3 numWorkGroups = ivec3(1, 1, 1); \\\\nint globalInvocationIndex = int(floor(v_TexCoord.x * u_OutputTextureSize.x))\\\\n + int(floor(v_TexCoord.y * u_OutputTextureSize.y)) * int(u_OutputTextureSize.x);\\\\nint workGroupIDLength = globalInvocationIndex / (workGroupSize.x * workGroupSize.y * workGroupSize.z);\\\\nivec3 workGroupID = ivec3(workGroupIDLength / numWorkGroups.y / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.z, workGroupIDLength / numWorkGroups.x / numWorkGroups.y);\\\\nint localInvocationIDZ = globalInvocationIndex / (workGroupSize.x * workGroupSize.y);\\\\nint localInvocationIDY = (globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y) / workGroupSize.x;\\\\nint localInvocationIDX = globalInvocationIndex - localInvocationIDZ * workGroupSize.x * workGroupSize.y - localInvocationIDY * workGroupSize.x;\\\\nivec3 localInvocationID = ivec3(localInvocationIDX, localInvocationIDY, localInvocationIDZ);\\\\nivec3 globalInvocationID = workGroupID * workGroupSize + localInvocationID;\\\\nint localInvocationIndex = localInvocationID.z * workGroupSize.x * workGroupSize.y\\\\n + localInvocationID.y * workGroupSize.x + localInvocationID.x;\\\\nfloat movement = 0.0;\\\\nfor (int j = 0; j < VERTEX_COUNT; j++) {vec4 vertex = getDatau_Data(j);\\\\nmovement += vertex.w;}\\\\nmovement = movement / float(VERTEX_COUNT);\\\\ngl_FragColor = vec4(vec4(movement, 0.0, 0.0, 0.0));if (gWebGPUDebug) {\\\\n gl_FragColor = gWebGPUDebugOutput;\\\\n}}\\\\n\\\"},\\\"context\\\":{\\\"name\\\":\\\"\\\",\\\"dispatch\\\":[1,1,1],\\\"threadGroupSize\\\":[1,1,1],\\\"maxIteration\\\":1,\\\"defines\\\":[{\\\"name\\\":\\\"VERTEX_COUNT\\\",\\\"type\\\":\\\"Float\\\",\\\"runtime\\\":true}],\\\"uniforms\\\":[{\\\"name\\\":\\\"u_Data\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_iter\\\",\\\"type\\\":\\\"Float\\\",\\\"storageClass\\\":\\\"Uniform\\\",\\\"readonly\\\":true,\\\"writeonly\\\":false,\\\"size\\\":[1,1]},{\\\"name\\\":\\\"u_AveMovement\\\",\\\"type\\\":\\\"vec4[]\\\",\\\"storageClass\\\":\\\"StorageBuffer\\\",\\\"readonly\\\":false,\\\"writeonly\\\":false,\\\"size\\\":[1,1]}],\\\"globalDeclarations\\\":[],\\\"output\\\":{\\\"name\\\":\\\"u_AveMovement\\\",\\\"size\\\":[1,1],\\\"length\\\":1},\\\"needPingpong\\\":true}}\";\n//# sourceMappingURL=gForceShader.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/gpu/gForceShader.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (str) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str, 'String');\n});\n//# sourceMappingURL=is-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/grid.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/grid.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview grid layout\n * @author shiwu.wyy@antfin.com\n * this algorithm refers to - https://github.com/cytoscape/cytoscape.js/\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.GridLayout = void 0;\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\n/**\n * 网格布局\n */\nvar GridLayout = /** @class */ (function (_super) {\n __extends(GridLayout, _super);\n function GridLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局起始点 */\n _this.begin = [0, 0];\n /** prevents node overlap, may overflow boundingBox if not enough space */\n _this.preventOverlap = true;\n /** extra spacing around nodes when preventOverlap: true */\n _this.preventOverlapPadding = 10;\n /** uses all available space on false, uses minimal space on true */\n _this.condense = false;\n /** a sorting function to order the nodes; e.g. function(a, b){ return a.datapublic ('weight') - b.data('weight') } */\n _this.sortBy = \"degree\";\n _this.nodes = [];\n _this.edges = [];\n _this.width = 300;\n _this.height = 300;\n _this.row = 0;\n _this.col = 0;\n _this.cellWidth = 0;\n _this.cellHeight = 0;\n _this.cellUsed = {};\n _this.id2manPos = {};\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n GridLayout.prototype.getDefaultCfg = function () {\n return {\n begin: [0, 0],\n preventOverlap: true,\n preventOverlapPadding: 10,\n condense: false,\n rows: undefined,\n cols: undefined,\n position: undefined,\n sortBy: \"degree\",\n nodeSize: 30\n };\n };\n /**\n * 执行布局\n */\n GridLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes, edges = self.edges, begin = self.begin;\n var n = nodes.length;\n if (n === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n }\n if (n === 1) {\n nodes[0].x = begin[0];\n nodes[0].y = begin[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges,\n };\n }\n var sortBy = self.sortBy, width = self.width, height = self.height;\n var condense = self.condense, preventOverlapPadding = self.preventOverlapPadding, preventOverlap = self.preventOverlap, paramNodeSpacing = self.nodeSpacing, paramNodeSize = self.nodeSize;\n var layoutNodes = [];\n nodes.forEach(function (node) {\n layoutNodes.push(node);\n });\n var nodeIdxMap = {};\n layoutNodes.forEach(function (node, i) {\n nodeIdxMap[node.id] = i;\n });\n if (sortBy === \"degree\" ||\n !(0, util_1.isString)(sortBy) ||\n layoutNodes[0][sortBy] === undefined) {\n sortBy = \"degree\";\n if ((0, util_1.isNaN)(nodes[0].degree)) {\n var values_1 = (0, util_1.getDegree)(layoutNodes.length, nodeIdxMap, edges);\n layoutNodes.forEach(function (node, i) {\n node.degree = values_1[i].all;\n });\n }\n }\n // sort nodes by value\n layoutNodes.sort(function (n1, n2) { return n2[sortBy] - n1[sortBy]; });\n if (!width && typeof window !== \"undefined\") {\n width = window.innerWidth;\n }\n if (!height && typeof window !== \"undefined\") {\n height = window.innerHeight;\n }\n var oRows = self.rows;\n var oCols = self.cols != null ? self.cols : self.columns;\n self.cells = n;\n // if rows or columns were set in self, use those values\n if (oRows != null && oCols != null) {\n self.rows = oRows;\n self.cols = oCols;\n }\n else if (oRows != null && oCols == null) {\n self.rows = oRows;\n self.cols = Math.ceil(self.cells / self.rows);\n }\n else if (oRows == null && oCols != null) {\n self.cols = oCols;\n self.rows = Math.ceil(self.cells / self.cols);\n }\n else {\n // otherwise use the automatic values and adjust accordingly\t // otherwise use the automatic values and adjust accordingly\n // width/height * splits^2 = cells where splits is number of times to split width\n self.splits = Math.sqrt((self.cells * self.height) / self.width);\n self.rows = Math.round(self.splits);\n self.cols = Math.round((self.width / self.height) * self.splits);\n }\n self.rows = Math.max(self.rows, 1);\n self.cols = Math.max(self.cols, 1);\n if (self.cols * self.rows > self.cells) {\n // otherwise use the automatic values and adjust accordingly\n // if rounding was up, see if we can reduce rows or columns\n var sm = self.small();\n var lg = self.large();\n // reducing the small side takes away the most cells, so try it first\n if ((sm - 1) * lg >= self.cells) {\n self.small(sm - 1);\n }\n else if ((lg - 1) * sm >= self.cells) {\n self.large(lg - 1);\n }\n }\n else {\n // if rounding was too low, add rows or columns\n while (self.cols * self.rows < self.cells) {\n var sm = self.small();\n var lg = self.large();\n // try to add to larger side first (adds less in multiplication)\n if ((lg + 1) * sm >= self.cells) {\n self.large(lg + 1);\n }\n else {\n self.small(sm + 1);\n }\n }\n }\n self.cellWidth = width / self.cols;\n self.cellHeight = height / self.rows;\n if (condense) {\n self.cellWidth = 0;\n self.cellHeight = 0;\n }\n if (preventOverlap || paramNodeSpacing) {\n var nodeSpacing_1 = (0, util_1.getFuncByUnknownType)(10, paramNodeSpacing);\n var nodeSize_1 = (0, util_1.getFuncByUnknownType)(30, paramNodeSize, false);\n layoutNodes.forEach(function (node) {\n if (!node.x || !node.y) {\n // for bb\n node.x = 0;\n node.y = 0;\n }\n var res = nodeSize_1(node) || 30;\n var nodeW;\n var nodeH;\n if ((0, util_1.isArray)(res)) {\n nodeW = res[0];\n nodeH = res[1];\n }\n else {\n nodeW = res;\n nodeH = res;\n }\n var p = nodeSpacing_1 !== undefined ? nodeSpacing_1(node) : preventOverlapPadding;\n var w = nodeW + p;\n var h = nodeH + p;\n self.cellWidth = Math.max(self.cellWidth, w);\n self.cellHeight = Math.max(self.cellHeight, h);\n });\n }\n self.cellUsed = {}; // e.g. 'c-0-2' => true\n // to keep track of current cell position\n self.row = 0;\n self.col = 0;\n // get a cache of all the manual positions\n self.id2manPos = {};\n for (var i = 0; i < layoutNodes.length; i++) {\n var node = layoutNodes[i];\n var rcPos = void 0;\n if (self.position) {\n rcPos = self.position(node);\n }\n if (rcPos && (rcPos.row !== undefined || rcPos.col !== undefined)) {\n // must have at least row or col def'd\n var pos = {\n row: rcPos.row,\n col: rcPos.col\n };\n if (pos.col === undefined) {\n // find unused col\n pos.col = 0;\n while (self.used(pos.row, pos.col)) {\n pos.col++;\n }\n }\n else if (pos.row === undefined) {\n // find unused row\n pos.row = 0;\n while (self.used(pos.row, pos.col)) {\n pos.row++;\n }\n }\n self.id2manPos[node.id] = pos;\n self.use(pos.row, pos.col);\n }\n self.getPos(node);\n }\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n edges: edges,\n nodes: layoutNodes\n };\n };\n GridLayout.prototype.small = function (val) {\n var self = this;\n var res;\n var rows = self.rows || 5;\n var cols = self.cols || 5;\n if (val == null) {\n res = Math.min(rows, cols);\n }\n else {\n var min = Math.min(rows, cols);\n if (min === self.rows) {\n self.rows = val;\n }\n else {\n self.cols = val;\n }\n }\n return res;\n };\n GridLayout.prototype.large = function (val) {\n var self = this;\n var res;\n var rows = self.rows || 5;\n var cols = self.cols || 5;\n if (val == null) {\n res = Math.max(rows, cols);\n }\n else {\n var max = Math.max(rows, cols);\n if (max === self.rows) {\n self.rows = val;\n }\n else {\n self.cols = val;\n }\n }\n return res;\n };\n GridLayout.prototype.used = function (row, col) {\n var self = this;\n return self.cellUsed[\"c-\".concat(row, \"-\").concat(col)] || false;\n };\n GridLayout.prototype.use = function (row, col) {\n var self = this;\n self.cellUsed[\"c-\".concat(row, \"-\").concat(col)] = true;\n };\n GridLayout.prototype.moveToNextCell = function () {\n var self = this;\n var cols = self.cols || 5;\n self.col++;\n if (self.col >= cols) {\n self.col = 0;\n self.row++;\n }\n };\n GridLayout.prototype.getPos = function (node) {\n var self = this;\n var begin = self.begin, cellWidth = self.cellWidth, cellHeight = self.cellHeight;\n var x;\n var y;\n // see if we have a manual position set\n var rcPos = self.id2manPos[node.id];\n if (rcPos) {\n x = rcPos.col * cellWidth + cellWidth / 2 + begin[0];\n y = rcPos.row * cellHeight + cellHeight / 2 + begin[1];\n }\n else {\n // otherwise set automatically\n while (self.used(self.row, self.col)) {\n self.moveToNextCell();\n }\n x = self.col * cellWidth + cellWidth / 2 + begin[0];\n y = self.row * cellHeight + cellHeight / 2 + begin[1];\n self.use(self.row, self.col);\n self.moveToNextCell();\n }\n node.x = x;\n node.y = y;\n };\n GridLayout.prototype.getType = function () {\n return \"grid\";\n };\n return GridLayout;\n}(base_1.Base));\nexports.GridLayout = GridLayout;\n//# sourceMappingURL=grid.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/grid.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar toString = {}.toString;\nvar isType = function (value, type) { return toString.call(value) === '[object ' + type + ']'; };\n/* harmony default export */ __webpack_exports__[\"default\"] = (isType);\n//# sourceMappingURL=is-type.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-type.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/index.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/index.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-undefined.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-undefined.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ERLayout = exports.ForceAtlas2Layout = exports.ComboCombinedLayout = exports.ComboForceLayout = exports.GForceGPULayout = exports.FruchtermanGPULayout = exports.FruchtermanLayout = exports.MDSLayout = exports.ConcentricLayout = exports.RadialLayout = exports.DagreCompoundLayout = exports.DagreLayout = exports.CircularLayout = exports.ForceLayout = exports.Force2Layout = exports.GForceLayout = exports.RandomLayout = exports.GridLayout = exports.Layouts = exports.Layout = void 0;\nvar grid_1 = __webpack_require__(/*! ./grid */ \"./node_modules/@antv/layout/lib/layout/grid.js\");\nObject.defineProperty(exports, \"GridLayout\", { enumerable: true, get: function () { return grid_1.GridLayout; } });\nvar random_1 = __webpack_require__(/*! ./random */ \"./node_modules/@antv/layout/lib/layout/random.js\");\nObject.defineProperty(exports, \"RandomLayout\", { enumerable: true, get: function () { return random_1.RandomLayout; } });\nvar gForce_1 = __webpack_require__(/*! ./gForce */ \"./node_modules/@antv/layout/lib/layout/gForce.js\");\nObject.defineProperty(exports, \"GForceLayout\", { enumerable: true, get: function () { return gForce_1.GForceLayout; } });\nvar force2_1 = __webpack_require__(/*! ./force2 */ \"./node_modules/@antv/layout/lib/layout/force2/index.js\");\nObject.defineProperty(exports, \"Force2Layout\", { enumerable: true, get: function () { return force2_1.Force2Layout; } });\nvar force_1 = __webpack_require__(/*! ./force */ \"./node_modules/@antv/layout/lib/layout/force/index.js\");\nObject.defineProperty(exports, \"ForceLayout\", { enumerable: true, get: function () { return force_1.ForceLayout; } });\nvar circular_1 = __webpack_require__(/*! ./circular */ \"./node_modules/@antv/layout/lib/layout/circular.js\");\nObject.defineProperty(exports, \"CircularLayout\", { enumerable: true, get: function () { return circular_1.CircularLayout; } });\nvar dagre_1 = __webpack_require__(/*! ./dagre */ \"./node_modules/@antv/layout/lib/layout/dagre.js\");\nObject.defineProperty(exports, \"DagreLayout\", { enumerable: true, get: function () { return dagre_1.DagreLayout; } });\nvar dagreCompound_1 = __webpack_require__(/*! ./dagreCompound */ \"./node_modules/@antv/layout/lib/layout/dagreCompound.js\");\nObject.defineProperty(exports, \"DagreCompoundLayout\", { enumerable: true, get: function () { return dagreCompound_1.DagreCompoundLayout; } });\nvar radial_1 = __webpack_require__(/*! ./radial */ \"./node_modules/@antv/layout/lib/layout/radial/index.js\");\nObject.defineProperty(exports, \"RadialLayout\", { enumerable: true, get: function () { return radial_1.RadialLayout; } });\nvar concentric_1 = __webpack_require__(/*! ./concentric */ \"./node_modules/@antv/layout/lib/layout/concentric.js\");\nObject.defineProperty(exports, \"ConcentricLayout\", { enumerable: true, get: function () { return concentric_1.ConcentricLayout; } });\nvar mds_1 = __webpack_require__(/*! ./mds */ \"./node_modules/@antv/layout/lib/layout/mds.js\");\nObject.defineProperty(exports, \"MDSLayout\", { enumerable: true, get: function () { return mds_1.MDSLayout; } });\nvar fruchterman_1 = __webpack_require__(/*! ./fruchterman */ \"./node_modules/@antv/layout/lib/layout/fruchterman.js\");\nObject.defineProperty(exports, \"FruchtermanLayout\", { enumerable: true, get: function () { return fruchterman_1.FruchtermanLayout; } });\nvar fruchterman_2 = __webpack_require__(/*! ./gpu/fruchterman */ \"./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js\");\nObject.defineProperty(exports, \"FruchtermanGPULayout\", { enumerable: true, get: function () { return fruchterman_2.FruchtermanGPULayout; } });\nvar gForce_2 = __webpack_require__(/*! ./gpu/gForce */ \"./node_modules/@antv/layout/lib/layout/gpu/gForce.js\");\nObject.defineProperty(exports, \"GForceGPULayout\", { enumerable: true, get: function () { return gForce_2.GForceGPULayout; } });\nvar comboForce_1 = __webpack_require__(/*! ./comboForce */ \"./node_modules/@antv/layout/lib/layout/comboForce.js\");\nObject.defineProperty(exports, \"ComboForceLayout\", { enumerable: true, get: function () { return comboForce_1.ComboForceLayout; } });\nvar comboCombined_1 = __webpack_require__(/*! ./comboCombined */ \"./node_modules/@antv/layout/lib/layout/comboCombined.js\");\nObject.defineProperty(exports, \"ComboCombinedLayout\", { enumerable: true, get: function () { return comboCombined_1.ComboCombinedLayout; } });\nvar forceAtlas2_1 = __webpack_require__(/*! ./forceAtlas2 */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js\");\nObject.defineProperty(exports, \"ForceAtlas2Layout\", { enumerable: true, get: function () { return forceAtlas2_1.ForceAtlas2Layout; } });\nvar er_1 = __webpack_require__(/*! ./er */ \"./node_modules/@antv/layout/lib/layout/er/index.js\");\nObject.defineProperty(exports, \"ERLayout\", { enumerable: true, get: function () { return er_1.ERLayout; } });\nvar layout_1 = __webpack_require__(/*! ./layout */ \"./node_modules/@antv/layout/lib/layout/layout.js\");\nObject.defineProperty(exports, \"Layout\", { enumerable: true, get: function () { return layout_1.Layout; } });\nObject.defineProperty(exports, \"Layouts\", { enumerable: true, get: function () { return layout_1.Layouts; } });\n// types file\n__exportStar(__webpack_require__(/*! ./types */ \"./node_modules/@antv/layout/lib/layout/types.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar isUndefined = function (value) {\n return value === undefined;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isUndefined);\n//# sourceMappingURL=is-undefined.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-undefined.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/layout.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/layout.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/keys.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/keys.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Layouts = exports.Layout = void 0;\nvar registy_1 = __webpack_require__(/*! ../registy */ \"./node_modules/@antv/layout/lib/registy/index.js\");\nvar grid_1 = __webpack_require__(/*! ./grid */ \"./node_modules/@antv/layout/lib/layout/grid.js\");\nvar random_1 = __webpack_require__(/*! ./random */ \"./node_modules/@antv/layout/lib/layout/random.js\");\nvar force2_1 = __webpack_require__(/*! ./force2 */ \"./node_modules/@antv/layout/lib/layout/force2/index.js\");\nvar gForce_1 = __webpack_require__(/*! ./gForce */ \"./node_modules/@antv/layout/lib/layout/gForce.js\");\nvar force_1 = __webpack_require__(/*! ./force */ \"./node_modules/@antv/layout/lib/layout/force/index.js\");\nvar circular_1 = __webpack_require__(/*! ./circular */ \"./node_modules/@antv/layout/lib/layout/circular.js\");\nvar dagre_1 = __webpack_require__(/*! ./dagre */ \"./node_modules/@antv/layout/lib/layout/dagre.js\");\nvar radial_1 = __webpack_require__(/*! ./radial */ \"./node_modules/@antv/layout/lib/layout/radial/index.js\");\nvar concentric_1 = __webpack_require__(/*! ./concentric */ \"./node_modules/@antv/layout/lib/layout/concentric.js\");\nvar mds_1 = __webpack_require__(/*! ./mds */ \"./node_modules/@antv/layout/lib/layout/mds.js\");\nvar fruchterman_1 = __webpack_require__(/*! ./fruchterman */ \"./node_modules/@antv/layout/lib/layout/fruchterman.js\");\nvar fruchterman_2 = __webpack_require__(/*! ./gpu/fruchterman */ \"./node_modules/@antv/layout/lib/layout/gpu/fruchterman.js\");\nvar gForce_2 = __webpack_require__(/*! ./gpu/gForce */ \"./node_modules/@antv/layout/lib/layout/gpu/gForce.js\");\nvar comboForce_1 = __webpack_require__(/*! ./comboForce */ \"./node_modules/@antv/layout/lib/layout/comboForce.js\");\nvar comboCombined_1 = __webpack_require__(/*! ./comboCombined */ \"./node_modules/@antv/layout/lib/layout/comboCombined.js\");\nvar forceAtlas2_1 = __webpack_require__(/*! ./forceAtlas2 */ \"./node_modules/@antv/layout/lib/layout/forceAtlas2/index.js\");\nvar er_1 = __webpack_require__(/*! ./er */ \"./node_modules/@antv/layout/lib/layout/er/index.js\");\nvar dagreCompound_1 = __webpack_require__(/*! ./dagreCompound */ \"./node_modules/@antv/layout/lib/layout/dagreCompound.js\");\nvar Layout = /** @class */ (function () {\n function Layout(options) {\n var layoutClass = (0, registy_1.getLayoutByName)(options.type);\n this.layoutInstance = new layoutClass(options);\n }\n Layout.prototype.layout = function (data) {\n return this.layoutInstance.layout(data);\n };\n Layout.prototype.updateCfg = function (cfg) {\n this.layoutInstance.updateCfg(cfg);\n };\n Layout.prototype.init = function (data) {\n this.layoutInstance.init(data);\n };\n Layout.prototype.execute = function () {\n this.layoutInstance.execute();\n };\n Layout.prototype.getDefaultCfg = function () {\n return this.layoutInstance.getDefaultCfg();\n };\n Layout.prototype.destroy = function () {\n return this.layoutInstance.destroy();\n };\n return Layout;\n}());\nexports.Layout = Layout;\n// FIXME\n// FOR G6\n// tslint:disable-next-line\nexports.Layouts = {\n force: force_1.ForceLayout,\n fruchterman: fruchterman_1.FruchtermanLayout,\n forceAtlas2: forceAtlas2_1.ForceAtlas2Layout,\n gForce: gForce_1.GForceLayout,\n force2: force2_1.Force2Layout,\n dagre: dagre_1.DagreLayout,\n dagreCompound: dagreCompound_1.DagreCompoundLayout,\n circular: circular_1.CircularLayout,\n radial: radial_1.RadialLayout,\n concentric: concentric_1.ConcentricLayout,\n grid: grid_1.GridLayout,\n mds: mds_1.MDSLayout,\n comboForce: comboForce_1.ComboForceLayout,\n comboCombined: comboCombined_1.ComboCombinedLayout,\n random: random_1.RandomLayout,\n 'gForce-gpu': gForce_2.GForceGPULayout,\n 'fruchterman-gpu': fruchterman_2.FruchtermanGPULayout,\n er: er_1.ERLayout,\n};\n//# sourceMappingURL=layout.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/layout.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\n\nvar keys = Object.keys\n ? function (obj) { return Object.keys(obj); }\n : function (obj) {\n var result = [];\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (value, key) {\n if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj) && key === 'prototype')) {\n result.push(key);\n }\n });\n return result;\n };\n/* harmony default export */ __webpack_exports__[\"default\"] = (keys);\n//# sourceMappingURL=keys.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/keys.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/mds.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/mds.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/last.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/last.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview MDS layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MDSLayout = void 0;\nvar ml_matrix_1 = __webpack_require__(/*! ml-matrix */ \"./node_modules/ml-matrix/src/index.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\n/**\n * mds 布局\n */\nvar MDSLayout = /** @class */ (function (_super) {\n __extends(MDSLayout, _super);\n function MDSLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 边长度 */\n _this.linkDistance = 50;\n _this.nodes = [];\n _this.edges = [];\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n MDSLayout.prototype.getDefaultCfg = function () {\n return {\n center: [0, 0],\n linkDistance: 50\n };\n };\n /**\n * 执行布局\n */\n MDSLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes, _a = self.edges, edges = _a === void 0 ? [] : _a;\n var center = self.center;\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n var linkDistance = self.linkDistance;\n // the graph-theoretic distance (shortest path distance) matrix\n var adjMatrix = (0, util_1.getAdjMatrix)({ nodes: nodes, edges: edges }, false);\n var distances = (0, util_1.floydWarshall)(adjMatrix);\n self.handleInfinity(distances);\n // scale the ideal edge length acoording to linkDistance\n var scaledD = (0, util_1.scaleMatrix)(distances, linkDistance);\n self.scaledDistances = scaledD;\n // get positions by MDS\n var positions = self.runMDS();\n self.positions = positions;\n positions.forEach(function (p, i) {\n nodes[i].x = p[0] + center[0];\n nodes[i].y = p[1] + center[1];\n });\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n };\n /**\n * mds 算法\n * @return {array} positions 计算后的节点位置数组\n */\n MDSLayout.prototype.runMDS = function () {\n var self = this;\n var dimension = 2;\n var distances = self.scaledDistances;\n // square distances\n var M = ml_matrix_1.Matrix.mul(ml_matrix_1.Matrix.pow(distances, 2), -0.5);\n // double centre the rows/columns\n var rowMeans = M.mean(\"row\");\n var colMeans = M.mean(\"column\");\n var totalMean = M.mean();\n M.add(totalMean)\n .subRowVector(rowMeans)\n .subColumnVector(colMeans);\n // take the SVD of the double centred matrix, and return the\n // points from it\n var ret = new ml_matrix_1.SingularValueDecomposition(M);\n var eigenValues = ml_matrix_1.Matrix.sqrt(ret.diagonalMatrix).diagonal();\n return ret.leftSingularVectors.toJSON().map(function (row) {\n return ml_matrix_1.Matrix.mul([row], [eigenValues])\n .toJSON()[0]\n .splice(0, dimension);\n });\n };\n MDSLayout.prototype.handleInfinity = function (distances) {\n var maxDistance = -999999;\n distances.forEach(function (row) {\n row.forEach(function (value) {\n if (value === Infinity) {\n return;\n }\n if (maxDistance < value) {\n maxDistance = value;\n }\n });\n });\n distances.forEach(function (row, i) {\n row.forEach(function (value, j) {\n if (value === Infinity) {\n distances[i][j] = maxDistance;\n }\n });\n });\n };\n MDSLayout.prototype.getType = function () {\n return \"mds\";\n };\n return MDSLayout;\n}(base_1.Base));\nexports.MDSLayout = MDSLayout;\n//# sourceMappingURL=mds.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/mds.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return last; });\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\nfunction last(o) {\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n var arr = o;\n return arr[arr.length - 1];\n }\n return undefined;\n}\n//# sourceMappingURL=last.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/last.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/radial/index.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/radial/index.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/lower-case.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/lower-case.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(__webpack_require__(/*! ./radial */ \"./node_modules/@antv/layout/lib/layout/radial/radial.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/radial/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-string.js\");\n\nvar lowerCase = function (str) {\n return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str).toLowerCase();\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (lowerCase);\n//# sourceMappingURL=lower-case.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/lower-case.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/radial/mds.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/radial/mds.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/lower-first.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/lower-first.js ***! + \*************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar ml_matrix_1 = __webpack_require__(/*! ml-matrix */ \"./node_modules/ml-matrix/src/index.js\");\nvar MDS = /** @class */ (function () {\n function MDS(params) {\n this.distances = params.distances;\n this.dimension = params.dimension || 2;\n this.linkDistance = params.linkDistance;\n }\n MDS.prototype.layout = function () {\n var self = this;\n var dimension = self.dimension, distances = self.distances, linkDistance = self.linkDistance;\n try {\n // square distances\n var M = ml_matrix_1.Matrix.mul(ml_matrix_1.Matrix.pow(distances, 2), -0.5);\n // double centre the rows/columns\n var rowMeans = M.mean('row');\n var colMeans = M.mean('column');\n var totalMean = M.mean();\n M.add(totalMean).subRowVector(rowMeans).subColumnVector(colMeans);\n // take the SVD of the double centred matrix, and return the\n // points from it\n var ret = new ml_matrix_1.SingularValueDecomposition(M);\n var eigenValues_1 = ml_matrix_1.Matrix.sqrt(ret.diagonalMatrix).diagonal();\n return ret.leftSingularVectors.toJSON().map(function (row) {\n return ml_matrix_1.Matrix.mul([row], [eigenValues_1]).toJSON()[0].splice(0, dimension);\n });\n }\n catch (_a) {\n var res = [];\n for (var i = 0; i < distances.length; i++) {\n var x = Math.random() * linkDistance;\n var y = Math.random() * linkDistance;\n res.push([x, y]);\n }\n return res;\n }\n };\n return MDS;\n}());\nexports.default = MDS;\n//# sourceMappingURL=mds.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/radial/mds.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-string.js\");\n\nvar lowerFirst = function (value) {\n var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value);\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (lowerFirst);\n//# sourceMappingURL=lower-first.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/lower-first.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/radial/radial.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/radial/radial.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/map-values.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/map-values.js ***! + \************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview random layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nvar __importDefault = (this && this.__importDefault) || function (mod) {\n return (mod && mod.__esModule) ? mod : { \"default\": mod };\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RadialLayout = void 0;\nvar util_1 = __webpack_require__(/*! ../../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar base_1 = __webpack_require__(/*! ../base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar mds_1 = __importDefault(__webpack_require__(/*! ./mds */ \"./node_modules/@antv/layout/lib/layout/radial/mds.js\"));\nvar radialNonoverlapForce_1 = __importDefault(__webpack_require__(/*! ./radialNonoverlapForce */ \"./node_modules/@antv/layout/lib/layout/radial/radialNonoverlapForce.js\"));\nfunction getWeightMatrix(M) {\n var rows = M.length;\n var cols = M[0].length;\n var result = [];\n for (var i = 0; i < rows; i++) {\n var row = [];\n for (var j = 0; j < cols; j++) {\n if (M[i][j] !== 0) {\n row.push(1 / (M[i][j] * M[i][j]));\n }\n else {\n row.push(0);\n }\n }\n result.push(row);\n }\n return result;\n}\nfunction getIndexById(array, id) {\n var index = -1;\n array.forEach(function (a, i) {\n if (a.id === id) {\n index = i;\n }\n });\n return index;\n}\nfunction getEDistance(p1, p2) {\n return Math.sqrt((p1[0] - p2[0]) * (p1[0] - p2[0]) + (p1[1] - p2[1]) * (p1[1] - p2[1]));\n}\n/**\n * 辐射状布局\n */\nvar RadialLayout = /** @class */ (function (_super) {\n __extends(RadialLayout, _super);\n function RadialLayout(options) {\n var _this = _super.call(this) || this;\n /** 停止迭代的最大迭代数 */\n _this.maxIteration = 1000;\n /** 中心点,默认为数据中第一个点 */\n _this.focusNode = null;\n /** 每一圈半径 */\n _this.unitRadius = null;\n /** 默认边长度 */\n _this.linkDistance = 50;\n /** 是否防止重叠 */\n _this.preventOverlap = false;\n /** 是否必须是严格的 radial 布局,即每一层的节点严格布局在一个环上。preventOverlap 为 true 时生效 */\n _this.strictRadial = true;\n /** 防止重叠步骤的最大迭代次数 */\n _this.maxPreventOverlapIteration = 200;\n _this.sortStrength = 10;\n _this.nodes = [];\n _this.edges = [];\n _this.updateCfg(options);\n return _this;\n }\n RadialLayout.prototype.getDefaultCfg = function () {\n return {\n maxIteration: 1000,\n focusNode: null,\n unitRadius: null,\n linkDistance: 50,\n preventOverlap: false,\n nodeSize: undefined,\n nodeSpacing: undefined,\n strictRadial: true,\n maxPreventOverlapIteration: 200,\n sortBy: undefined,\n sortStrength: 10\n };\n };\n /**\n * 执行布局\n */\n RadialLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var edges = self.edges || [];\n if (!nodes || nodes.length === 0) {\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (!self.center) {\n self.center = [self.width / 2, self.height / 2];\n }\n var center = self.center;\n if (nodes.length === 1) {\n nodes[0].x = center[0];\n nodes[0].y = center[1];\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return;\n }\n var linkDistance = self.linkDistance;\n // layout\n var focusNode = null;\n if ((0, util_1.isString)(self.focusNode)) {\n var found = false;\n for (var i = 0; i < nodes.length; i++) {\n if (nodes[i].id === self.focusNode) {\n focusNode = nodes[i];\n self.focusNode = focusNode;\n found = true;\n i = nodes.length;\n }\n }\n if (!found) {\n focusNode = null;\n }\n }\n else {\n focusNode = self.focusNode;\n }\n // default focus node\n if (!focusNode) {\n focusNode = nodes[0];\n self.focusNode = focusNode;\n }\n // the index of the focusNode in data\n var focusIndex = getIndexById(nodes, focusNode.id);\n if (focusIndex < 0)\n focusIndex = 0;\n self.focusIndex = focusIndex;\n // the graph-theoretic distance (shortest path distance) matrix\n var adjMatrix = (0, util_1.getAdjMatrix)({ nodes: nodes, edges: edges }, false);\n var D = (0, util_1.floydWarshall)(adjMatrix);\n var maxDistance = self.maxToFocus(D, focusIndex);\n // replace first node in unconnected component to the circle at (maxDistance + 1)\n self.handleInfinity(D, focusIndex, maxDistance + 1);\n self.distances = D;\n // the shortest path distance from each node to focusNode\n var focusNodeD = D[focusIndex];\n var width = self.width || 500;\n var height = self.height || 500;\n var semiWidth = width - center[0] > center[0] ? center[0] : width - center[0];\n var semiHeight = height - center[1] > center[1] ? center[1] : height - center[1];\n if (semiWidth === 0) {\n semiWidth = width / 2;\n }\n if (semiHeight === 0) {\n semiHeight = height / 2;\n }\n // the maxRadius of the graph\n var maxRadius = semiHeight > semiWidth ? semiWidth : semiHeight;\n var maxD = Math.max.apply(Math, focusNodeD);\n // the radius for each nodes away from focusNode\n var radii = [];\n focusNodeD.forEach(function (value, i) {\n if (!self.unitRadius) {\n self.unitRadius = maxRadius / maxD;\n }\n radii[i] = value * self.unitRadius;\n });\n self.radii = radii;\n var eIdealD = self.eIdealDisMatrix();\n // const eIdealD = scaleMatrix(D, linkDistance);\n self.eIdealDistances = eIdealD;\n // the weight matrix, Wij = 1 / dij^(-2)\n var W = getWeightMatrix(eIdealD);\n self.weights = W;\n // the initial positions from mds\n var mds = new mds_1.default({ linkDistance: linkDistance, distances: eIdealD });\n var positions = mds.layout();\n positions.forEach(function (p) {\n if ((0, util_1.isNaN)(p[0])) {\n p[0] = Math.random() * linkDistance;\n }\n if ((0, util_1.isNaN)(p[1])) {\n p[1] = Math.random() * linkDistance;\n }\n });\n self.positions = positions;\n positions.forEach(function (p, i) {\n nodes[i].x = p[0] + center[0];\n nodes[i].y = p[1] + center[1];\n });\n // move the graph to origin, centered at focusNode\n positions.forEach(function (p) {\n p[0] -= positions[focusIndex][0];\n p[1] -= positions[focusIndex][1];\n });\n self.run();\n var preventOverlap = self.preventOverlap;\n var nodeSize = self.nodeSize;\n var nodeSizeFunc;\n var strictRadial = self.strictRadial;\n // stagger the overlapped nodes\n if (preventOverlap) {\n var nodeSpacing_1 = self.nodeSpacing;\n var nodeSpacingFunc_1;\n if ((0, util_1.isNumber)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = function () { return nodeSpacing_1; };\n }\n else if ((0, util_1.isFunction)(nodeSpacing_1)) {\n nodeSpacingFunc_1 = nodeSpacing_1;\n }\n else {\n nodeSpacingFunc_1 = function () { return 0; };\n }\n if (!nodeSize) {\n nodeSizeFunc = function (d) {\n if (d.size) {\n if ((0, util_1.isArray)(d.size)) {\n var res = d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n return res + nodeSpacingFunc_1(d);\n }\n if ((0, util_1.isObject)(d.size)) {\n var res = d.size.width > d.size.height ? d.size.width : d.size.height;\n return res + nodeSpacingFunc_1(d);\n }\n return d.size + nodeSpacingFunc_1(d);\n }\n return 10 + nodeSpacingFunc_1(d);\n };\n }\n else if ((0, util_1.isArray)(nodeSize)) {\n nodeSizeFunc = function (d) {\n var res = nodeSize[0] > nodeSize[1] ? nodeSize[0] : nodeSize[1];\n return res + nodeSpacingFunc_1(d);\n };\n }\n else {\n nodeSizeFunc = function (d) { return nodeSize + nodeSpacingFunc_1(d); };\n }\n var nonoverlapForceParams = {\n nodes: nodes,\n nodeSizeFunc: nodeSizeFunc,\n adjMatrix: adjMatrix,\n positions: positions,\n radii: radii,\n height: height,\n width: width,\n strictRadial: strictRadial,\n focusID: focusIndex,\n iterations: self.maxPreventOverlapIteration || 200,\n k: positions.length / 4.5\n };\n var nonoverlapForce = new radialNonoverlapForce_1.default(nonoverlapForceParams);\n positions = nonoverlapForce.layout();\n }\n // move the graph to center\n positions.forEach(function (p, i) {\n nodes[i].x = p[0] + center[0];\n nodes[i].y = p[1] + center[1];\n });\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: edges\n };\n };\n RadialLayout.prototype.run = function () {\n var self = this;\n var maxIteration = self.maxIteration;\n var positions = self.positions || [];\n var W = self.weights || [];\n var eIdealDis = self.eIdealDistances || [];\n var radii = self.radii || [];\n for (var i = 0; i <= maxIteration; i++) {\n var param = i / maxIteration;\n self.oneIteration(param, positions, radii, eIdealDis, W);\n }\n };\n RadialLayout.prototype.oneIteration = function (param, positions, radii, D, W) {\n var self = this;\n var vparam = 1 - param;\n var focusIndex = self.focusIndex;\n positions.forEach(function (v, i) {\n // v\n var originDis = getEDistance(v, [0, 0]);\n var reciODis = originDis === 0 ? 0 : 1 / originDis;\n if (i === focusIndex) {\n return;\n }\n var xMolecule = 0;\n var yMolecule = 0;\n var denominator = 0;\n positions.forEach(function (u, j) {\n // u\n if (i === j) {\n return;\n }\n // the euclidean distance between v and u\n var edis = getEDistance(v, u);\n var reciEdis = edis === 0 ? 0 : 1 / edis;\n var idealDis = D[j][i];\n // same for x and y\n denominator += W[i][j];\n // x\n xMolecule += W[i][j] * (u[0] + idealDis * (v[0] - u[0]) * reciEdis);\n // y\n yMolecule += W[i][j] * (u[1] + idealDis * (v[1] - u[1]) * reciEdis);\n });\n var reciR = radii[i] === 0 ? 0 : 1 / radii[i];\n denominator *= vparam;\n denominator += param * reciR * reciR;\n // x\n xMolecule *= vparam;\n xMolecule += param * reciR * v[0] * reciODis;\n v[0] = xMolecule / denominator;\n // y\n yMolecule *= vparam;\n yMolecule += param * reciR * v[1] * reciODis;\n v[1] = yMolecule / denominator;\n });\n };\n RadialLayout.prototype.eIdealDisMatrix = function () {\n var self = this;\n var nodes = self.nodes;\n if (!nodes)\n return [];\n var D = self.distances;\n var linkDis = self.linkDistance;\n var radii = self.radii || [];\n var unitRadius = self.unitRadius || 50;\n var result = [];\n if (D) {\n D.forEach(function (row, i) {\n var newRow = [];\n row.forEach(function (v, j) {\n if (i === j) {\n newRow.push(0);\n }\n else if (radii[i] === radii[j]) {\n // i and j are on the same circle\n if (self.sortBy === \"data\") {\n // sort the nodes on the same circle according to the ordering of the data\n newRow.push((v * (Math.abs(i - j) * self.sortStrength)) /\n (radii[i] / unitRadius));\n }\n else if (self.sortBy) {\n // sort the nodes on the same circle according to the attributes\n var iValue = nodes[i][self.sortBy] || 0;\n var jValue = nodes[j][self.sortBy] || 0;\n if ((0, util_1.isString)(iValue)) {\n iValue = iValue.charCodeAt(0);\n }\n if ((0, util_1.isString)(jValue)) {\n jValue = jValue.charCodeAt(0);\n }\n newRow.push((v * (Math.abs(iValue - jValue) * self.sortStrength)) /\n (radii[i] / unitRadius));\n }\n else {\n newRow.push((v * linkDis) / (radii[i] / unitRadius));\n }\n }\n else {\n // i and j are on different circle\n // i and j are on different circle\n var link = (linkDis + unitRadius) / 2;\n newRow.push(v * link);\n }\n });\n result.push(newRow);\n });\n }\n return result;\n };\n RadialLayout.prototype.handleInfinity = function (matrix, focusIndex, step) {\n var length = matrix.length;\n // 遍历 matrix 中遍历 focus 对应行\n for (var i = 0; i < length; i++) {\n // matrix 关注点对应行的 Inf 项\n if (matrix[focusIndex][i] === Infinity) {\n matrix[focusIndex][i] = step;\n matrix[i][focusIndex] = step;\n // 遍历 matrix 中的 i 行,i 行中非 Inf 项若在 focus 行为 Inf,则替换 focus 行的那个 Inf\n for (var j = 0; j < length; j++) {\n if (matrix[i][j] !== Infinity && matrix[focusIndex][j] === Infinity) {\n matrix[focusIndex][j] = step + matrix[i][j];\n matrix[j][focusIndex] = step + matrix[i][j];\n }\n }\n }\n }\n // 处理其他行的 Inf。根据该行对应点与 focus 距离以及 Inf 项点 与 focus 距离,决定替换值\n for (var i = 0; i < length; i++) {\n if (i === focusIndex) {\n continue;\n }\n for (var j = 0; j < length; j++) {\n if (matrix[i][j] === Infinity) {\n var minus = Math.abs(matrix[focusIndex][i] - matrix[focusIndex][j]);\n minus = minus === 0 ? 1 : minus;\n matrix[i][j] = minus;\n }\n }\n }\n };\n RadialLayout.prototype.maxToFocus = function (matrix, focusIndex) {\n var max = 0;\n for (var i = 0; i < matrix[focusIndex].length; i++) {\n if (matrix[focusIndex][i] === Infinity) {\n continue;\n }\n max = matrix[focusIndex][i] > max ? matrix[focusIndex][i] : max;\n }\n return max;\n };\n RadialLayout.prototype.getType = function () {\n return \"radial\";\n };\n return RadialLayout;\n}(base_1.Base));\nexports.RadialLayout = RadialLayout;\n//# sourceMappingURL=radial.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/radial/radial.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js\");\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object.js\");\n\n\nvar identity = function (v) { return v; };\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (object, func) {\n if (func === void 0) { func = identity; }\n var r = {};\n if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(object) && !Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(object)) {\n Object.keys(object).forEach(function (key) {\n // @ts-ignore\n r[key] = func(object[key], key);\n });\n }\n return r;\n});\n//# sourceMappingURL=map-values.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/map-values.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/radial/radialNonoverlapForce.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/radial/radialNonoverlapForce.js ***! - \******************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/map.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/map.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar SPEED_DIVISOR = 800;\nvar RadialNonoverlapForce = /** @class */ (function () {\n function RadialNonoverlapForce(params) {\n this.disp = [];\n this.positions = params.positions;\n this.adjMatrix = params.adjMatrix;\n this.focusID = params.focusID;\n this.radii = params.radii;\n this.iterations = params.iterations || 10;\n this.height = params.height || 10;\n this.width = params.width || 10;\n this.speed = params.speed || 100;\n this.gravity = params.gravity || 10;\n this.nodeSizeFunc = params.nodeSizeFunc;\n this.k = params.k || 5;\n this.strictRadial = params.strictRadial;\n this.nodes = params.nodes;\n }\n RadialNonoverlapForce.prototype.layout = function () {\n var self = this;\n var positions = self.positions;\n var disp = [];\n var iterations = self.iterations;\n var maxDisplace = self.width / 10;\n self.maxDisplace = maxDisplace;\n self.disp = disp;\n for (var i = 0; i < iterations; i++) {\n positions.forEach(function (_, k) {\n disp[k] = { x: 0, y: 0 };\n });\n // 给重叠的节点增加斥力\n self.getRepulsion();\n self.updatePositions();\n }\n return positions;\n };\n RadialNonoverlapForce.prototype.getRepulsion = function () {\n var self = this;\n var positions = self.positions;\n var nodes = self.nodes;\n var disp = self.disp;\n var k = self.k;\n var radii = self.radii || [];\n positions.forEach(function (v, i) {\n disp[i] = { x: 0, y: 0 };\n positions.forEach(function (u, j) {\n if (i === j) {\n return;\n }\n // v and u are not on the same circle, return\n if (radii[i] !== radii[j]) {\n return;\n }\n var vecx = v[0] - u[0];\n var vecy = v[1] - u[1];\n var vecLength = Math.sqrt(vecx * vecx + vecy * vecy);\n if (vecLength === 0) {\n vecLength = 1;\n var sign = i > j ? 1 : -1;\n vecx = 0.01 * sign;\n vecy = 0.01 * sign;\n }\n // these two nodes overlap\n if (vecLength < self.nodeSizeFunc(nodes[i]) / 2 + self.nodeSizeFunc(nodes[j]) / 2) {\n var common = (k * k) / vecLength;\n disp[i].x += (vecx / vecLength) * common;\n disp[i].y += (vecy / vecLength) * common;\n }\n });\n });\n };\n RadialNonoverlapForce.prototype.updatePositions = function () {\n var self = this;\n var positions = self.positions;\n var disp = self.disp;\n var speed = self.speed;\n var strictRadial = self.strictRadial;\n var f = self.focusID;\n var maxDisplace = self.maxDisplace || self.width / 10;\n if (strictRadial) {\n disp.forEach(function (di, i) {\n var vx = positions[i][0] - positions[f][0];\n var vy = positions[i][1] - positions[f][1];\n var vLength = Math.sqrt(vx * vx + vy * vy);\n var vpx = vy / vLength;\n var vpy = -vx / vLength;\n var diLength = Math.sqrt(di.x * di.x + di.y * di.y);\n var alpha = Math.acos((vpx * di.x + vpy * di.y) / diLength);\n if (alpha > Math.PI / 2) {\n alpha -= Math.PI / 2;\n vpx *= -1;\n vpy *= -1;\n }\n var tdispLength = Math.cos(alpha) * diLength;\n di.x = vpx * tdispLength;\n di.y = vpy * tdispLength;\n });\n }\n // move\n var radii = self.radii;\n positions.forEach(function (n, i) {\n if (i === f) {\n return;\n }\n var distLength = Math.sqrt(disp[i].x * disp[i].x + disp[i].y * disp[i].y);\n if (distLength > 0 && i !== f) {\n var limitedDist = Math.min(maxDisplace * (speed / SPEED_DIVISOR), distLength);\n n[0] += (disp[i].x / distLength) * limitedDist;\n n[1] += (disp[i].y / distLength) * limitedDist;\n if (strictRadial) {\n var vx = n[0] - positions[f][0];\n var vy = n[1] - positions[f][1];\n var nfDis = Math.sqrt(vx * vx + vy * vy);\n vx = (vx / nfDis) * radii[i];\n vy = (vy / nfDis) * radii[i];\n n[0] = positions[f][0] + vx;\n n[1] = positions[f][1] + vy;\n }\n }\n });\n };\n return RadialNonoverlapForce;\n}());\nexports.default = RadialNonoverlapForce;\n//# sourceMappingURL=radialNonoverlapForce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/radial/radialNonoverlapForce.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\nvar map = function (arr, func) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n // @ts-ignore\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n result.push(func(value, index));\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (map);\n//# sourceMappingURL=map.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/map.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/random.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/random.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max-by.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max-by.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n/**\n * @fileOverview random layout\n * @author shiwu.wyy@antfin.com\n */\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.RandomLayout = void 0;\nvar base_1 = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\n/**\n * 随机布局\n */\nvar RandomLayout = /** @class */ (function (_super) {\n __extends(RandomLayout, _super);\n function RandomLayout(options) {\n var _this = _super.call(this) || this;\n /** 布局中心 */\n _this.center = [0, 0];\n /** 宽度 */\n _this.width = 300;\n /** 高度 */\n _this.height = 300;\n _this.nodes = [];\n _this.edges = [];\n /** 迭代结束的回调函数 */\n _this.onLayoutEnd = function () { };\n _this.updateCfg(options);\n return _this;\n }\n RandomLayout.prototype.getDefaultCfg = function () {\n return {\n center: [0, 0],\n width: 300,\n height: 300\n };\n };\n /**\n * 执行布局\n */\n RandomLayout.prototype.execute = function () {\n var self = this;\n var nodes = self.nodes;\n var layoutScale = 0.9;\n var center = self.center;\n if (!self.width && typeof window !== \"undefined\") {\n self.width = window.innerWidth;\n }\n if (!self.height && typeof window !== \"undefined\") {\n self.height = window.innerHeight;\n }\n if (nodes) {\n nodes.forEach(function (node) {\n node.x = (Math.random() - 0.5) * layoutScale * self.width + center[0];\n node.y = (Math.random() - 0.5) * layoutScale * self.height + center[1];\n });\n }\n if (self.onLayoutEnd)\n self.onLayoutEnd();\n return {\n nodes: nodes,\n edges: this.edges\n };\n };\n RandomLayout.prototype.getType = function () {\n return \"random\";\n };\n return RandomLayout;\n}(base_1.Base));\nexports.RandomLayout = RandomLayout;\n//# sourceMappingURL=random.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/random.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr, fn) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n var maxItem;\n var max = -Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(fn) ? fn(item) : item[fn];\n if (v > max) {\n maxItem = item;\n max = v;\n }\n }\n return maxItem;\n});\n//# sourceMappingURL=max-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max-by.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/layout/types.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/layout/lib/layout/types.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/layout/types.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the maximum value.\n * @example\n *\n * max([1, 2]);\n * // => 2\n *\n * max([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * max(data);\n * // => 1250010\n * // Math.max(...data) will encounter \"Maximum call stack size exceeded\" error\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.max(prev, curr);\n }, arr[0]);\n});\n//# sourceMappingURL=max.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/max.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/registy/index.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/registy/index.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/memoize.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/memoize.js ***! + \*********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __extends = (this && this.__extends) || (function () {\n var extendStatics = function (d, b) {\n extendStatics = Object.setPrototypeOf ||\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\n return extendStatics(d, b);\n };\n return function (d, b) {\n if (typeof b !== \"function\" && b !== null)\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\n extendStatics(d, b);\n function __() { this.constructor = d; }\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\n };\n})();\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getLayoutByName = exports.unRegisterLayout = exports.registerLayout = void 0;\nvar base_1 = __webpack_require__(/*! ../layout/base */ \"./node_modules/@antv/layout/lib/layout/base.js\");\nvar util_1 = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar map = new Map();\nvar registerLayout = function (name, layoutOverride) {\n if (map.get(name)) {\n console.warn(\"The layout with the name \".concat(name, \" exists already, it will be overridden\"));\n }\n if ((0, util_1.isObject)(layoutOverride)) {\n // tslint:disable-next-line: max-classes-per-file\n var GLayout = /** @class */ (function (_super) {\n __extends(GLayout, _super);\n function GLayout(cfg) {\n var _this = _super.call(this) || this;\n var self = _this;\n var props = {};\n var defaultCfg = self.getDefaultCfg();\n Object.assign(props, defaultCfg, layoutOverride, cfg);\n Object.keys(props).forEach(function (key) {\n var value = props[key];\n self[key] = value;\n });\n return _this;\n }\n return GLayout;\n }(base_1.Base));\n map.set(name, GLayout);\n }\n else {\n map.set(name, layoutOverride);\n }\n return map.get(name);\n};\nexports.registerLayout = registerLayout;\nvar unRegisterLayout = function (name) {\n if (map.has(name)) {\n map.delete(name);\n }\n};\nexports.unRegisterLayout = unRegisterLayout;\nvar getLayoutByName = function (name) {\n if (map.has(name)) {\n return map.get(name);\n }\n return null;\n};\nexports.getLayoutByName = getLayoutByName;\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/registy/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\nfunction flru(max) {\n var num, curr, prev;\n var limit = max || 1;\n function keep(key, value) {\n if (++num > limit) {\n prev = curr;\n reset(1);\n ++num;\n }\n curr[key] = value;\n }\n function reset(isPartial) {\n num = 0;\n curr = Object.create(null);\n isPartial || (prev = Object.create(null));\n }\n reset();\n return {\n clear: reset,\n has: function (key) {\n return curr[key] !== void 0 || prev[key] !== void 0;\n },\n get: function (key) {\n var val = curr[key];\n if (val !== void 0)\n return val;\n if ((val = prev[key]) !== void 0) {\n keep(key, val);\n return val;\n }\n },\n set: function (key, value) {\n if (curr[key] !== void 0) {\n curr[key] = value;\n }\n else {\n keep(key, value);\n }\n },\n };\n}\n/**\n * _.memoize(calColor);\n * _.memoize(calColor, (...args) => args[0]);\n * @param f\n * @param resolver\n * @param maxSize lru maxSize\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (f, resolver, maxSize) {\n if (maxSize === void 0) { maxSize = 128; }\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(f)) {\n throw new TypeError('Expected a function');\n }\n var memoized = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key\n var key = resolver ? resolver.apply(this, args) : args[0];\n var cache = memoized.cache;\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = f.apply(this, args);\n // 缓存起来\n cache.set(key, result);\n return result;\n };\n memoized.cache = flru(maxSize);\n return memoized;\n});\n//# sourceMappingURL=memoize.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/memoize.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/util/array.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/layout/lib/util/array.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min-by.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min-by.js ***! + \********************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isArray = void 0;\nexports.isArray = Array.isArray;\n//# sourceMappingURL=array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/array.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr, fn) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n var minItem;\n var min = Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(fn) ? fn(item) : item[fn];\n if (v < min) {\n minItem = item;\n min = v;\n }\n }\n return minItem;\n});\n//# sourceMappingURL=min-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min-by.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/util/function.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/layout/lib/util/function.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFuncByUnknownType = exports.getFunc = exports.isFunction = void 0;\nvar _1 = __webpack_require__(/*! . */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar number_1 = __webpack_require__(/*! ./number */ \"./node_modules/@antv/layout/lib/util/number.js\");\nvar isFunction = function (val) {\n return typeof val === 'function';\n};\nexports.isFunction = isFunction;\nvar getFunc = function (value, defaultValue, func) {\n var resultFunc;\n if (func) {\n resultFunc = func;\n }\n else if ((0, number_1.isNumber)(value)) {\n resultFunc = function () { return value; };\n }\n else {\n resultFunc = function () { return defaultValue; };\n }\n return resultFunc;\n};\nexports.getFunc = getFunc;\nvar getFuncByUnknownType = function (defaultValue, value, resultIsNumber) {\n if (resultIsNumber === void 0) { resultIsNumber = true; }\n if (!value && value !== 0) {\n return function (d) {\n if (d.size) {\n if ((0, _1.isArray)(d.size))\n return d.size[0] > d.size[1] ? d.size[0] : d.size[1];\n if ((0, _1.isObject)(d.size))\n return d.size.width > d.size.height ? d.size.width : d.size.height;\n return d.size;\n }\n return defaultValue;\n };\n }\n if ((0, exports.isFunction)(value)) {\n return value;\n }\n if ((0, number_1.isNumber)(value)) {\n return function () { return value; };\n }\n if ((0, _1.isArray)(value)) {\n return function () {\n if (resultIsNumber) {\n var max = Math.max.apply(Math, value);\n return isNaN(max) ? defaultValue : max;\n }\n return value;\n };\n }\n if ((0, _1.isObject)(value)) {\n return function () {\n if (resultIsNumber) {\n var max = Math.max(value.width, value.height);\n return isNaN(max) ? defaultValue : max;\n }\n return [value.width, value.height];\n };\n }\n return function () { return defaultValue; };\n};\nexports.getFuncByUnknownType = getFuncByUnknownType;\n//# sourceMappingURL=function.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/function.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the minimum value.\n * @example\n *\n * min([1, 2]);\n * // => 1\n *\n * min([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * min(data);\n * // => 1250010\n * // Math.min(...data) will encounter \"Maximum call stack size exceeded\" error\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.min(prev, curr);\n }, arr[0]);\n});\n//# sourceMappingURL=min.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/min.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/util/gpu.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/layout/lib/util/gpu.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mix.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mix.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.arrayToTextureData = exports.attributesToTextureData = exports.buildTextureDataWithTwoEdgeAttr = exports.buildTextureData = exports.proccessToFunc = void 0;\nvar _1 = __webpack_require__(/*! ./ */ \"./node_modules/@antv/layout/lib/util/index.js\");\nvar math_1 = __webpack_require__(/*! ./math */ \"./node_modules/@antv/layout/lib/util/math.js\");\n/**\n * 将 number | Function 类型的参数转换为 return number 的 Function\n * @param {number | Function} value 需要被转换的值\n * @param {number} defaultV 返回函数的默认返回值\n * @return {Function} 转换后的函数\n */\nvar proccessToFunc = function (value, defaultV) {\n var func;\n if (!value) {\n func = function () {\n return defaultV || 1;\n };\n }\n else if ((0, _1.isNumber)(value)) {\n func = function () {\n return value;\n };\n }\n else {\n func = value;\n }\n return func;\n};\nexports.proccessToFunc = proccessToFunc;\n/**\n * 将节点和边数据转换为 GPU 可读的数组。并返回 maxEdgePerVetex,每个节点上最多的边数\n * @param {NodeConfig[]} nodes 需要被转换的值\n * @param {EdgeConfig[]} edges 返回函数的默认返回值\n * @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n */\nvar buildTextureData = function (nodes, edges) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n var source = (0, math_1.getEdgeTerminal)(e, 'source');\n var target = (0, math_1.getEdgeTerminal)(e, 'target');\n if (!isNaN(mapIdPos[source]) && !isNaN(mapIdPos[target])) {\n nodeDict[mapIdPos[source]].push(mapIdPos[target]);\n nodeDict[mapIdPos[target]].push(mapIdPos[source]);\n }\n }\n var maxEdgePerVetex = 0;\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i];\n var len = dests.length;\n console.log('dests', dests, len);\n dataArray[i * 4 + 2] = offset;\n dataArray[i * 4 + 3] = len;\n maxEdgePerVetex = Math.max(maxEdgePerVetex, len);\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n }\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n return {\n maxEdgePerVetex: maxEdgePerVetex,\n array: new Float32Array(dataArray),\n };\n};\nexports.buildTextureData = buildTextureData;\n/**\n* 将节点和边数据转换为 GPU 可读的数组,每条边带有一个属性。并返回 maxEdgePerVetex,每个节点上最多的边数\n* @param {NodeConfig[]} nodes 节点数组\n* @param {EdgeConfig[]} edges 边数组\n* @param {Function} attrs 读取边属性的函数\n* @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n*/\n// export const buildTextureDataWithOneEdgeAttr = (nodes: OutNode[], edges: Edge[], attrs: Function): {\n// array: Float32Array,\n// maxEdgePerVetex: number\n// } => {\n// const dataArray = [];\n// const nodeDict: any = [];\n// const mapIdPos: IndexMap = {};\n// let i = 0;\n// for (i = 0; i < nodes.length; i++) {\n// const n = nodes[i];\n// mapIdPos[n.id] = i;\n// dataArray.push(n.x);\n// dataArray.push(n.y);\n// dataArray.push(0);\n// dataArray.push(0);\n// nodeDict.push([]);\n// }\n// for (i = 0; i < edges.length; i++) {\n// const e = edges[i];\n// nodeDict[mapIdPos[e.source]].push(mapIdPos[e.target]);\n// nodeDict[mapIdPos[e.source]].push(attrs(e)); // 理想边长,后续可以改成每条边不同\n// nodeDict[mapIdPos[e.target]].push(mapIdPos[e.source]);\n// nodeDict[mapIdPos[e.target]].push(attrs(e)); // 理想边长,后续可以改成每条边不同\n// }\n// let maxEdgePerVetex = 0;\n// for (i = 0; i < nodes.length; i++) {\n// const offset: number = dataArray.length;\n// const dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长……\n// const len = dests.length;\n// dataArray[i * 4 + 2] = offset;\n// dataArray[i * 4 + 3] = len / 2; // 第四位存储与该节点相关的所有节点个数\n// maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 2);\n// for (let j = 0; j < len; ++j) {\n// const dest = dests[j];\n// dataArray.push(+dest);\n// }\n// }\n// // 不是 4 的倍数,填充 0\n// while (dataArray.length % 4 !== 0) {\n// dataArray.push(0);\n// }\n// return {\n// array: new Float32Array(dataArray),\n// maxEdgePerVetex\n// }\n// }\n/**\n* 将节点和边数据转换为 GPU 可读的数组,每条边带有一个以上属性。并返回 maxEdgePerVetex,每个节点上最多的边数\n* @param {NodeConfig[]} nodes 节点数组\n* @param {EdgeConfig[]} edges 边数组\n* @param {Function} attrs 读取边属性的函数\n* @return {Object} 转换后的数组及 maxEdgePerVetex 组成的对象\n*/\nvar buildTextureDataWithTwoEdgeAttr = function (nodes, edges, attrs1, attrs2) {\n var dataArray = [];\n var nodeDict = [];\n var mapIdPos = {};\n var i = 0;\n for (i = 0; i < nodes.length; i++) {\n var n = nodes[i];\n mapIdPos[n.id] = i;\n dataArray.push(n.x);\n dataArray.push(n.y);\n dataArray.push(0);\n dataArray.push(0);\n nodeDict.push([]);\n }\n for (i = 0; i < edges.length; i++) {\n var e = edges[i];\n var source = (0, math_1.getEdgeTerminal)(e, 'source');\n var target = (0, math_1.getEdgeTerminal)(e, 'target');\n nodeDict[mapIdPos[source]].push(mapIdPos[target]);\n nodeDict[mapIdPos[source]].push(attrs1(e));\n nodeDict[mapIdPos[source]].push(attrs2(e));\n nodeDict[mapIdPos[source]].push(0);\n nodeDict[mapIdPos[target]].push(mapIdPos[source]);\n nodeDict[mapIdPos[target]].push(attrs1(e));\n nodeDict[mapIdPos[target]].push(attrs2(e));\n nodeDict[mapIdPos[target]].push(0);\n }\n var maxEdgePerVetex = 0;\n for (i = 0; i < nodes.length; i++) {\n var offset = dataArray.length;\n var dests = nodeDict[i]; // dest 中节点 id 与边长间隔存储,即一位节点 id,一位边长……\n var len = dests.length;\n // dataArray[i * 4 + 2] = offset;\n // dataArray[i * 4 + 3] = len / 4; // 第四位存储与该节点相关的所有节点个数\n // pack offset & length into float32: offset 20bit, length 12bit\n dataArray[i * 4 + 2] = offset + 1048576 * len / 4;\n dataArray[i * 4 + 3] = 0; // 第四位存储与上一次的距离差值\n maxEdgePerVetex = Math.max(maxEdgePerVetex, len / 4);\n for (var j = 0; j < len; ++j) {\n var dest = dests[j];\n dataArray.push(+dest);\n }\n }\n // 不是 4 的倍数,填充 0\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n return {\n maxEdgePerVetex: maxEdgePerVetex,\n array: new Float32Array(dataArray),\n };\n};\nexports.buildTextureDataWithTwoEdgeAttr = buildTextureDataWithTwoEdgeAttr;\n/**\n* transform the extended attributes of nodes or edges to a texture array\n* @param {string[]} attributeNames attributes' name to be read from items and put into output array\n* @param {ModelConfig[]} items the items to be read\n* @return {Float32Array} the attributes' value array to be read by GPU\n*/\nvar attributesToTextureData = function (attributeNames, items) {\n var dataArray = [];\n var attributeNum = attributeNames.length;\n var attributteStringMap = {};\n items.forEach(function (item) {\n attributeNames.forEach(function (name, i) {\n if (attributteStringMap[item[name]] === undefined) {\n attributteStringMap[item[name]] = Object.keys(attributteStringMap).length;\n }\n dataArray.push(attributteStringMap[item[name]]);\n // insure each node's attributes take inter number of grids\n if (i === attributeNum - 1) {\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n }\n });\n });\n return {\n array: new Float32Array(dataArray),\n count: Object.keys(attributteStringMap).length\n };\n};\nexports.attributesToTextureData = attributesToTextureData;\n/**\n* transform the number array format of extended attributes of nodes or edges to a texture array\n* @param {string[]} attributeNames attributes' name to be read from items and put into output array\n* @return {Float32Array} the attributes' value array to be read by GPU\n*/\nvar arrayToTextureData = function (valueArrays) {\n var dataArray = [];\n var attributeNum = valueArrays.length;\n var itemNum = valueArrays[0].length;\n var _loop_1 = function (j) {\n valueArrays.forEach(function (valueArray, i) {\n dataArray.push(valueArray[j]);\n // insure each node's attributes take inter number of grids\n if (i === attributeNum - 1) {\n while (dataArray.length % 4 !== 0) {\n dataArray.push(0);\n }\n }\n });\n };\n for (var j = 0; j < itemNum; j++) {\n _loop_1(j);\n }\n return new Float32Array(dataArray);\n};\nexports.arrayToTextureData = arrayToTextureData;\n//# sourceMappingURL=gpu.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/gpu.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return mix; });\n// FIXME: Mutable param should be forbidden in static lang.\nfunction _mix(dist, obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {\n dist[key] = obj[key];\n }\n }\n}\nfunction mix(dist, src1, src2, src3) {\n if (src1)\n _mix(dist, src1);\n if (src2)\n _mix(dist, src2);\n if (src3)\n _mix(dist, src3);\n return dist;\n}\n//# sourceMappingURL=mix.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mix.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/util/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/layout/lib/util/index.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mod.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mod.js ***! + \*****************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n var desc = Object.getOwnPropertyDescriptor(m, k);\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\n desc = { enumerable: true, get: function() { return m[k]; } };\n }\n Object.defineProperty(o, k2, desc);\n}) : (function(o, m, k, k2) {\n if (k2 === undefined) k2 = k;\n o[k2] = m[k];\n}));\nvar __exportStar = (this && this.__exportStar) || function(m, exports) {\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\n__exportStar(__webpack_require__(/*! ./string */ \"./node_modules/@antv/layout/lib/util/string.js\"), exports);\n__exportStar(__webpack_require__(/*! ./array */ \"./node_modules/@antv/layout/lib/util/array.js\"), exports);\n__exportStar(__webpack_require__(/*! ./number */ \"./node_modules/@antv/layout/lib/util/number.js\"), exports);\n__exportStar(__webpack_require__(/*! ./math */ \"./node_modules/@antv/layout/lib/util/math.js\"), exports);\n__exportStar(__webpack_require__(/*! ./object */ \"./node_modules/@antv/layout/lib/util/object.js\"), exports);\n__exportStar(__webpack_require__(/*! ./function */ \"./node_modules/@antv/layout/lib/util/function.js\"), exports);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar mod = function (n, m) {\n return ((n % m) + m) % m;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (mod);\n//# sourceMappingURL=mod.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/mod.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/util/math.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/layout/lib/util/math.js ***! - \****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/noop.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/noop.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getCoreNodeAndRelativeLeafNodes = exports.getAvgNodePosition = exports.findMinMaxNodeXY = exports.traverseTreeUp = exports.scaleMatrix = exports.getAdjMatrix = exports.floydWarshall = exports.getDegreeMap = exports.getDegree = exports.getEdgeTerminal = void 0;\nvar object_1 = __webpack_require__(/*! ./object */ \"./node_modules/@antv/layout/lib/util/object.js\");\nvar getEdgeTerminal = function (edge, type) {\n var terminal = edge[type];\n if ((0, object_1.isObject)(terminal)) {\n return terminal.cell;\n }\n return terminal;\n};\nexports.getEdgeTerminal = getEdgeTerminal;\nvar getDegree = function (n, nodeIdxMap, edges) {\n var degrees = [];\n for (var i = 0; i < n; i++) {\n degrees[i] = {\n in: 0,\n out: 0,\n all: 0\n };\n }\n if (!edges)\n return degrees;\n edges.forEach(function (e) {\n var source = (0, exports.getEdgeTerminal)(e, 'source');\n var target = (0, exports.getEdgeTerminal)(e, 'target');\n if (source && degrees[nodeIdxMap[source]]) {\n degrees[nodeIdxMap[source]].out += 1;\n degrees[nodeIdxMap[source]].all += 1;\n }\n if (target && degrees[nodeIdxMap[target]]) {\n degrees[nodeIdxMap[target]].in += 1;\n degrees[nodeIdxMap[target]].all += 1;\n }\n });\n return degrees;\n};\nexports.getDegree = getDegree;\nvar getDegreeMap = function (nodes, edges) {\n var degreesMap = {};\n nodes.forEach(function (node) {\n degreesMap[node.id] = {\n in: 0,\n out: 0,\n all: 0\n };\n });\n if (!edges)\n return degreesMap;\n edges.forEach(function (e) {\n var source = (0, exports.getEdgeTerminal)(e, 'source');\n var target = (0, exports.getEdgeTerminal)(e, 'target');\n if (source) {\n degreesMap[source].out += 1;\n degreesMap[source].all += 1;\n }\n if (target) {\n degreesMap[target].in += 1;\n degreesMap[target].all += 1;\n }\n });\n return degreesMap;\n};\nexports.getDegreeMap = getDegreeMap;\nvar floydWarshall = function (adjMatrix) {\n // initialize\n var dist = [];\n var size = adjMatrix.length;\n for (var i = 0; i < size; i += 1) {\n dist[i] = [];\n for (var j = 0; j < size; j += 1) {\n if (i === j) {\n dist[i][j] = 0;\n }\n else if (adjMatrix[i][j] === 0 || !adjMatrix[i][j]) {\n dist[i][j] = Infinity;\n }\n else {\n dist[i][j] = adjMatrix[i][j];\n }\n }\n }\n // floyd\n for (var k = 0; k < size; k += 1) {\n for (var i = 0; i < size; i += 1) {\n for (var j = 0; j < size; j += 1) {\n if (dist[i][j] > dist[i][k] + dist[k][j]) {\n dist[i][j] = dist[i][k] + dist[k][j];\n }\n }\n }\n }\n return dist;\n};\nexports.floydWarshall = floydWarshall;\nvar getAdjMatrix = function (data, directed) {\n var nodes = data.nodes, edges = data.edges;\n var matrix = [];\n // map node with index in data.nodes\n var nodeMap = {};\n if (!nodes) {\n throw new Error('invalid nodes data!');\n }\n if (nodes) {\n nodes.forEach(function (node, i) {\n nodeMap[node.id] = i;\n var row = [];\n matrix.push(row);\n });\n }\n if (edges) {\n edges.forEach(function (e) {\n var source = (0, exports.getEdgeTerminal)(e, 'source');\n var target = (0, exports.getEdgeTerminal)(e, 'target');\n var sIndex = nodeMap[source];\n var tIndex = nodeMap[target];\n matrix[sIndex][tIndex] = 1;\n if (!directed) {\n matrix[tIndex][sIndex] = 1;\n }\n });\n }\n return matrix;\n};\nexports.getAdjMatrix = getAdjMatrix;\n/**\n * scale matrix\n * @param matrix [ [], [], [] ]\n * @param ratio\n */\nvar scaleMatrix = function (matrix, ratio) {\n var result = [];\n matrix.forEach(function (row) {\n var newRow = [];\n row.forEach(function (v) {\n newRow.push(v * ratio);\n });\n result.push(newRow);\n });\n return result;\n};\nexports.scaleMatrix = scaleMatrix;\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseUp = function (data, fn) {\n if (data && data.children) {\n for (var i = data.children.length - 1; i >= 0; i--) {\n if (!traverseUp(data.children[i], fn))\n return;\n }\n }\n if (!fn(data)) {\n return false;\n }\n return true;\n};\n/**\n * depth first traverse, from leaves to root, children in inverse order\n * if the fn returns false, terminate the traverse\n */\nvar traverseTreeUp = function (data, fn) {\n if (typeof fn !== 'function') {\n return;\n }\n traverseUp(data, fn);\n};\nexports.traverseTreeUp = traverseTreeUp;\nvar findMinMaxNodeXY = function (nodes) {\n var minX = Infinity;\n var minY = Infinity;\n var maxX = -Infinity;\n var maxY = -Infinity;\n nodes.forEach(function (node) {\n if (minX > node.x)\n minX = node.x;\n if (minY > node.y)\n minY = node.y;\n if (maxX < node.x)\n maxX = node.x;\n if (maxY < node.y)\n maxY = node.y;\n });\n return { minX: minX, minY: minY, maxX: maxX, maxY: maxY };\n};\nexports.findMinMaxNodeXY = findMinMaxNodeXY;\n/**\n * 获取节点集合的平均位置信息\n * @param nodes 节点集合\n * @returns 平局内置\n */\nvar getAvgNodePosition = function (nodes) {\n var totalNodes = { x: 0, y: 0 };\n nodes.forEach(function (node) {\n totalNodes.x += node.x || 0;\n totalNodes.y += node.y || 0;\n });\n // 获取均值向量\n var length = nodes.length || 1;\n return {\n x: totalNodes.x / length,\n y: totalNodes.y / length,\n };\n};\nexports.getAvgNodePosition = getAvgNodePosition;\n// 找出指定节点关联的边的起点或终点\nvar getCoreNode = function (type, node, edges) {\n var _a, _b;\n if (type === 'source') {\n return (((_a = edges === null || edges === void 0 ? void 0 : edges.find(function (edge) { return edge.target === node.id; })) === null || _a === void 0 ? void 0 : _a.source) || {});\n }\n return (((_b = edges === null || edges === void 0 ? void 0 : edges.find(function (edge) { return edge.source === node.id; })) === null || _b === void 0 ? void 0 : _b.target) || {});\n};\n// 找出指定节点为起点或终点的所有一度叶子节点\nvar getRelativeNodeIds = function (type, coreNode, edges) {\n var relativeNodes = [];\n switch (type) {\n case 'source':\n relativeNodes = edges === null || edges === void 0 ? void 0 : edges.filter(function (edge) { return edge.source === coreNode.id; }).map(function (edge) { return edge.target; });\n break;\n case 'target':\n relativeNodes = edges === null || edges === void 0 ? void 0 : edges.filter(function (edge) { return edge.target === coreNode.id; }).map(function (edge) { return edge.source; });\n break;\n case 'both':\n relativeNodes = edges === null || edges === void 0 ? void 0 : edges.filter(function (edge) { return edge.source === coreNode.id; }).map(function (edge) { return edge.target; }).concat(edges === null || edges === void 0 ? void 0 : edges.filter(function (edge) { return edge.target === coreNode.id; }).map(function (edge) { return edge.source; }));\n break;\n default:\n break;\n }\n // 去重\n var set = new Set(relativeNodes);\n return Array.from(set);\n};\n// 找出同类型的节点\nvar getSameTypeNodes = function (type, nodeClusterBy, node, relativeNodes, degreesMap) {\n // @ts-ignore\n var typeName = node[nodeClusterBy] || '';\n // @ts-ignore\n var sameTypeNodes = (relativeNodes === null || relativeNodes === void 0 ? void 0 : relativeNodes.filter(function (item) { return item[nodeClusterBy] === typeName; })) || [];\n if (type === 'leaf') {\n sameTypeNodes = sameTypeNodes.filter(function (node) { var _a, _b; return ((_a = degreesMap[node.id]) === null || _a === void 0 ? void 0 : _a.in) === 0 || ((_b = degreesMap[node.id]) === null || _b === void 0 ? void 0 : _b.out) === 0; });\n }\n return sameTypeNodes;\n};\n// 找出与指定节点关联的边的起点或终点出发的所有一度叶子节点\nvar getCoreNodeAndRelativeLeafNodes = function (type, node, edges, nodeClusterBy, degreesMap, nodeMap) {\n var _a = degreesMap[node.id], inDegree = _a.in, outDegree = _a.out;\n var coreNode = node;\n var relativeLeafNodes = [];\n if (inDegree === 0) {\n // 如果为没有出边的叶子节点,则找出与它关联的边的起点出发的所有一度节点\n coreNode = getCoreNode('source', node, edges);\n relativeLeafNodes = getRelativeNodeIds('both', coreNode, edges).map(function (nodeId) { return nodeMap[nodeId]; });\n }\n else if (outDegree === 0) {\n // 如果为没有入边边的叶子节点,则找出与它关联的边的起点出发的所有一度节点\n coreNode = getCoreNode('target', node, edges);\n relativeLeafNodes = getRelativeNodeIds('both', coreNode, edges).map(function (nodeId) { return nodeMap[nodeId]; });\n }\n relativeLeafNodes = relativeLeafNodes.filter(function (node) { return degreesMap[node.id] && (degreesMap[node.id].in === 0 || degreesMap[node.id].out === 0); });\n var sameTypeLeafNodes = getSameTypeNodes(type, nodeClusterBy, node, relativeLeafNodes, degreesMap);\n return { coreNode: coreNode, relativeLeafNodes: relativeLeafNodes, sameTypeLeafNodes: sameTypeLeafNodes };\n};\nexports.getCoreNodeAndRelativeLeafNodes = getCoreNodeAndRelativeLeafNodes;\n//# sourceMappingURL=math.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/math.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () { });\n//# sourceMappingURL=noop.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/noop.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/util/number.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/layout/lib/util/number.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/number2color.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/number2color.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.toNumber = exports.isNaN = exports.isNumber = void 0;\nvar isNumber = function (val) { return typeof val === 'number'; };\nexports.isNumber = isNumber;\nvar isNaN = function (num) { return Number.isNaN(Number(num)); };\nexports.isNaN = isNaN;\nvar toNumber = function (val) {\n var n = parseFloat(val);\n return (0, exports.isNaN)(n) ? val : n;\n};\nexports.toNumber = toNumber;\n//# sourceMappingURL=number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/number.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar numColorCache = {};\nfunction numberToColor(num) {\n // 增加缓存\n var color = numColorCache[num];\n if (!color) {\n var str = num.toString(16);\n for (var i = str.length; i < 6; i++) {\n str = '0' + str;\n }\n color = '#' + str;\n numColorCache[num] = color;\n }\n return color;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (numberToColor);\n//# sourceMappingURL=number2color.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/number2color.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/util/object.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/layout/lib/util/object.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/omit.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/omit.js ***! + \******************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __assign = (this && this.__assign) || function () {\n __assign = Object.assign || function(t) {\n for (var s, i = 1, n = arguments.length; i < n; i++) {\n s = arguments[i];\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p))\n t[p] = s[p];\n }\n return t;\n };\n return __assign.apply(this, arguments);\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.clone = exports.isObject = void 0;\nvar isObject = function (val) {\n return val !== null && typeof val === 'object';\n};\nexports.isObject = isObject;\nvar clone = function (target) {\n if (target === null) {\n return target;\n }\n if (target instanceof Date) {\n return new Date(target.getTime());\n }\n if (target instanceof Array) {\n var cp_1 = [];\n target.forEach(function (v) {\n cp_1.push(v);\n });\n return cp_1.map(function (n) { return (0, exports.clone)(n); });\n }\n if (typeof target === 'object' && target !== {}) {\n var cp_2 = __assign({}, target);\n Object.keys(cp_2).forEach(function (k) {\n cp_2[k] = (0, exports.clone)(cp_2[k]);\n });\n return cp_2;\n }\n return target;\n};\nexports.clone = clone;\n//# sourceMappingURL=object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/object.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/reduce.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, keys) {\n return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (r, curr, key) {\n if (!keys.includes(key)) {\n r[key] = curr;\n }\n return r;\n }, {});\n});\n//# sourceMappingURL=omit.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/omit.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/lib/util/string.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/layout/lib/util/string.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/parse-radius.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/parse-radius.js ***! + \**************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.camelize = exports.isString = void 0;\nvar isString = function (val) { return typeof val === 'string'; };\nexports.isString = isString;\nvar cacheStringFunction = function (fn) {\n var cache = Object.create(null);\n return (function (str) {\n var hit = cache[str];\n return hit || (cache[str] = fn(str));\n });\n};\nvar camelizeRE = /-(\\w)/g;\nexports.camelize = cacheStringFunction(function (str) {\n return str.replace(camelizeRE, function (_, c) { return (c ? c.toUpperCase() : ''); });\n});\n// export const capitalize = cacheStringFunction(\n// (str: string) => str.charAt(0).toUpperCase() + str.slice(1),\n// )\n//# sourceMappingURL=string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/lib/util/string.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n\nfunction parseRadius(radius) {\n var r1 = 0, r2 = 0, r3 = 0, r4 = 0;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(radius)) {\n if (radius.length === 1) {\n r1 = r2 = r3 = r4 = radius[0];\n }\n else if (radius.length === 2) {\n r1 = r3 = radius[0];\n r2 = r4 = radius[1];\n }\n else if (radius.length === 3) {\n r1 = radius[0];\n r2 = r4 = radius[1];\n r3 = radius[2];\n }\n else {\n r1 = radius[0];\n r2 = radius[1];\n r3 = radius[2];\n r4 = radius[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = radius;\n }\n return {\n r1: r1,\n r2: r2,\n r3: r3,\n r4: r4,\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (parseRadius);\n//# sourceMappingURL=parse-radius.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/parse-radius.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/center.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/center.js ***! - \***********************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pick.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pick.js ***! + \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/center.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-plain-object.js\");\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (object, keys) {\n if (object === null || !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(object)) {\n return {};\n }\n var result = {};\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(keys, function (key) {\n if (hasOwnProperty.call(object, key)) {\n result[key] = object[key];\n }\n });\n return result;\n});\n//# sourceMappingURL=pick.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pick.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/collide.js": -/*!************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/collide.js ***! - \************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull-at.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull-at.js ***! + \*********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var d3_quadtree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-quadtree */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js\");\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n/* harmony import */ var _jiggle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jiggle.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js\");\n\n\n\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = Object(d3_quadtree__WEBPACK_IMPORTED_MODULE_0__[\"quadtree\"])(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += x * x;\n if (y === 0) y = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(+_), initialize(), force) : radius;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/collide.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\nvar splice = Array.prototype.splice;\nvar pullAt = function pullAt(arr, indexes) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return [];\n }\n var length = arr ? indexes.length : 0;\n var last = length - 1;\n while (length--) {\n var previous = void 0;\n var index = indexes[length];\n if (length === last || index !== previous) {\n previous = index;\n splice.call(arr, index, 1);\n }\n }\n return arr;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (pullAt);\n//# sourceMappingURL=pull-at.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull-at.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/constant.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/constant.js ***! - \*************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull.js ***! + \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return function() {\n return x;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/constant.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar arrPrototype = Array.prototype;\nvar splice = arrPrototype.splice;\nvar indexOf = arrPrototype.indexOf;\nvar pull = function (arr) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n var fromIndex = -1;\n while ((fromIndex = indexOf.call(arr, value)) > -1) {\n splice.call(arr, fromIndex, 1);\n }\n }\n return arr;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (pull);\n//# sourceMappingURL=pull.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/index.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/index.js ***! - \**********************************************************************/ -/*! exports provided: forceCenter, forceCollide, forceLink, forceManyBody, forceRadial, forceSimulation, forceX, forceY */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/reduce.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/reduce.js ***! + \********************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _center_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./center.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/center.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceCenter\", function() { return _center_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _collide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collide.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/collide.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceCollide\", function() { return _collide_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _link_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./link.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/link.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceLink\", function() { return _link_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _manyBody_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./manyBody.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/manyBody.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceManyBody\", function() { return _manyBody_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _radial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./radial.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/radial.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceRadial\", function() { return _radial_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _simulation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./simulation.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceSimulation\", function() { return _simulation_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _x_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./x.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/x.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceX\", function() { return _x_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _y_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./y.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/y.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceY\", function() { return _y_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-plain-object.js\");\n\n\n\nvar reduce = function (arr, fn, init) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr) && !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arr)) {\n return arr;\n }\n var result = init;\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr, function (data, i) {\n result = fn(result, data, i);\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (reduce);\n//# sourceMappingURL=reduce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/reduce.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js ***! - \***********************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/remove.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/remove.js ***! + \********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(random) {\n return (random() - 0.5) * 1e-6;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n/* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pull-at */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/pull-at.js\");\n\n\nvar remove = function (arr, predicate) {\n /**\n * const arr = [1, 2, 3, 4]\n * const evens = remove(arr, n => n % 2 == 0)\n * console.log(arr) // => [1, 3]\n * console.log(evens) // => [2, 4]\n */\n var result = [];\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return result;\n }\n var i = -1;\n var indexes = [];\n var length = arr.length;\n while (++i < length) {\n var value = arr[i];\n if (predicate(value, i, arr)) {\n result.push(value);\n indexes.push(i);\n }\n }\n Object(_pull_at__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr, indexes);\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (remove);\n//# sourceMappingURL=remove.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/remove.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/lcg.js": -/*!********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/lcg.js ***! - \********************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/request-animation-frame.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/request-animation-frame.js ***! + \*************************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/lcg.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return requestAnimationFrame; });\nfunction requestAnimationFrame(fn) {\n var method = window.requestAnimationFrame ||\n // @ts-ignore\n window.webkitRequestAnimationFrame ||\n // @ts-ignore\n window.mozRequestAnimationFrame ||\n // @ts-ignore\n window.msRequestAnimationFrame ||\n function (f) {\n return setTimeout(f, 16);\n };\n return method(fn);\n}\n//# sourceMappingURL=request-animation-frame.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/request-animation-frame.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/link.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/link.js ***! - \*********************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/set.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/set.js ***! + \*****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n/* harmony import */ var _jiggle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jiggle.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js\");\n\n\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(random);\n y = target.y + target.vy - source.y - source.vy || Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/link.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-object.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js\");\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-number.js\");\n\n\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param path\n * @param value\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, path, value) {\n var o = obj;\n var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(path) ? path.split('.') : path;\n keyArr.forEach(function (key, idx) {\n // 不是最后一个\n if (idx < keyArr.length - 1) {\n if (!Object(_is_object__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o[key])) {\n o[key] = Object(_is_number__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(keyArr[idx + 1]) ? [] : {};\n }\n o = o[key];\n }\n else {\n o[key] = value;\n }\n });\n return obj;\n});\n//# sourceMappingURL=set.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/set.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/manyBody.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/manyBody.js ***! - \*************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/size.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/size.js ***! + \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var d3_quadtree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-quadtree */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js\");\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n/* harmony import */ var _jiggle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jiggle.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js\");\n/* harmony import */ var _simulation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./simulation.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n var nodes,\n node,\n random,\n alpha,\n strength = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = Object(d3_quadtree__WEBPACK_IMPORTED_MODULE_0__[\"quadtree\"])(nodes, _simulation_js__WEBPACK_IMPORTED_MODULE_3__[\"x\"], _simulation_js__WEBPACK_IMPORTED_MODULE_3__[\"y\"]).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += x * x;\n if (y === 0) y = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += x * x;\n if (y === 0) y = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/manyBody.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return size; });\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\n\nfunction size(o) {\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n return 0;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(o)) {\n return o.length;\n }\n return Object.keys(o).length;\n}\n//# sourceMappingURL=size.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/size.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/radial.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/radial.js ***! - \***********************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/some.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/some.js ***! + \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(radius, x, y) {\n var nodes,\n strength = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0.1),\n strengths,\n radiuses;\n\n if (typeof radius !== \"function\") radius = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+radius);\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force(alpha) {\n for (var i = 0, n = nodes.length; i < n; ++i) {\n var node = nodes[i],\n dx = node.x - x || 1e-6,\n dy = node.y - y || 1e-6,\n r = Math.sqrt(dx * dx + dy * dy),\n k = (radiuses[i] - r) * strengths[i] * alpha / r;\n node.vx += dx * k;\n node.vy += dy * k;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n radiuses = new Array(n);\n for (i = 0; i < n; ++i) {\n radiuses[i] = +radius(nodes[i], i, nodes);\n strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _, initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : radius;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/radial.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 只要有一个满足条件就返回 true\n * @param arr\n * @param func\n */\nvar some = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (func(arr[i], i))\n return true;\n }\n return false;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (some);\n//# sourceMappingURL=some.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/some.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js ***! - \***************************************************************************/ -/*! exports provided: x, y, default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/sort-by.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/sort-by.js ***! + \*********************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"x\", function() { return x; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"y\", function() { return y; });\n/* harmony import */ var d3_dispatch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-dispatch */ \"./node_modules/d3-dispatch/src/index.js\");\n/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-timer */ \"./node_modules/d3-timer/src/index.js\");\n/* harmony import */ var _lcg_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lcg.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/lcg.js\");\n\n\n\n\nfunction x(d) {\n return d.x;\n}\n\nfunction y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = Object(d3_timer__WEBPACK_IMPORTED_MODULE_1__[\"timer\"])(step),\n event = Object(d3_dispatch__WEBPACK_IMPORTED_MODULE_0__[\"dispatch\"])(\"tick\", \"end\"),\n random = Object(_lcg_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\n\n\nfunction sortBy(arr, key) {\n var comparer;\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(key)) {\n comparer = function (a, b) { return key(a) - key(b); };\n }\n else {\n var keys_1 = [];\n if (Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(key)) {\n keys_1.push(key);\n }\n else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(key)) {\n keys_1 = key;\n }\n comparer = function (a, b) {\n for (var i = 0; i < keys_1.length; i += 1) {\n var prop = keys_1[i];\n if (a[prop] > b[prop]) {\n return 1;\n }\n if (a[prop] < b[prop]) {\n return -1;\n }\n }\n return 0;\n };\n }\n arr.sort(comparer);\n return arr;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (sortBy);\n//# sourceMappingURL=sort-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/sort-by.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/x.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/x.js ***! - \******************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/starts-with.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/starts-with.js ***! + \*************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var strength = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0.1),\n nodes,\n strengths,\n xz;\n\n if (typeof x !== \"function\") x = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(x == null ? 0 : +x);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n xz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : strength;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : x;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/x.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-string.js\");\n\n\nfunction startsWith(arr, e) {\n return Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr) ? arr[0] === e : false;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (startsWith);\n//# sourceMappingURL=starts-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/starts-with.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/y.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-force/src/y.js ***! - \******************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/substitute.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/substitute.js ***! + \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(y) {\n var strength = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0.1),\n nodes,\n strengths,\n yz;\n\n if (typeof y !== \"function\") y = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(y == null ? 0 : +y);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n yz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : strength;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : y;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/y.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nfunction substitute(str, o) {\n if (!str || !o) {\n return str;\n }\n return str.replace(/\\\\?\\{([^{}]+)\\}/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.slice(1);\n }\n return o[name] === undefined ? '' : o[name];\n });\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (substitute);\n//# sourceMappingURL=substitute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/substitute.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/add.js": -/*!***********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/add.js ***! - \***********************************************************************/ -/*! exports provided: default, addAll */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/throttle.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/throttle.js ***! + \**********************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addAll\", function() { return addAll; });\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n});\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nfunction addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/add.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options)\n options = {};\n var later = function () {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout)\n context = args = null;\n };\n var throttled = function () {\n var now = Date.now();\n if (!previous && options.leading === false)\n previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout)\n context = args = null;\n }\n else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n throttled.cancel = function () {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n return throttled;\n});\n//# sourceMappingURL=throttle.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/throttle.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/cover.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/cover.js ***! - \*************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-array.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-array.js ***! + \**********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/cover.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array-like.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) ? Array.prototype.slice.call(value) : [];\n});\n//# sourceMappingURL=to-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-array.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/data.js": -/*!************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/data.js ***! - \************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-degree.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-degree.js ***! + \***********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/data.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar DEGREE = 180 / Math.PI;\nvar toDegree = function (radian) {\n return DEGREE * radian;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (toDegree);\n//# sourceMappingURL=to-degree.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-degree.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/extent.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/extent.js ***! - \**************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-integer.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-integer.js ***! + \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/extent.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (parseInt);\n//# sourceMappingURL=to-integer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-integer.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/find.js": -/*!************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/find.js ***! - \************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-radian.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-radian.js ***! + \***********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node[3], xm, ym, x2, y2),\n new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node[2], x1, ym, xm, y2),\n new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node[1], xm, y1, x2, ym),\n new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/find.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar RADIAN = Math.PI / 180;\nvar toRadian = function (degree) {\n return RADIAN * degree;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (toRadian);\n//# sourceMappingURL=to-radian.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-radian.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js ***! - \*************************************************************************/ -/*! exports provided: quadtree */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-string.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-string.js ***! + \***********************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _quadtree_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quadtree.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/quadtree.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"quadtree\", function() { return _quadtree_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value))\n return '';\n return value.toString();\n});\n//# sourceMappingURL=to-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-string.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js": -/*!************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js ***! - \************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/union.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/union.js ***! + \*******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uniq */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/uniq.js\");\n\nvar union = function () {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n return Object(_uniq__WEBPACK_IMPORTED_MODULE_0__[\"default\"])([].concat.apply([], sources));\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (union);\n//# sourceMappingURL=union.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/union.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/quadtree.js": -/*!****************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/quadtree.js ***! - \****************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/uniq.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/uniq.js ***! + \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return quadtree; });\n/* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/add.js\");\n/* harmony import */ var _cover_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cover.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/cover.js\");\n/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./data.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/data.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/extent.js\");\n/* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./find.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/find.js\");\n/* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./remove.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/remove.js\");\n/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./root.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/root.js\");\n/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./size.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/size.js\");\n/* harmony import */ var _visit_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visit.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/visit.js\");\n/* harmony import */ var _visitAfter_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./visitAfter.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/visitAfter.js\");\n/* harmony import */ var _x_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./x.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/x.js\");\n/* harmony import */ var _y_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./y.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/y.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? _x_js__WEBPACK_IMPORTED_MODULE_10__[\"defaultX\"] : x, y == null ? _y_js__WEBPACK_IMPORTED_MODULE_11__[\"defaultY\"] : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = _add_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\ntreeProto.addAll = _add_js__WEBPACK_IMPORTED_MODULE_0__[\"addAll\"];\ntreeProto.cover = _cover_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\ntreeProto.data = _data_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\ntreeProto.extent = _extent_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\ntreeProto.find = _find_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\ntreeProto.remove = _remove_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\ntreeProto.removeAll = _remove_js__WEBPACK_IMPORTED_MODULE_5__[\"removeAll\"];\ntreeProto.root = _root_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\ntreeProto.size = _size_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\ntreeProto.visit = _visit_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\ntreeProto.visitAfter = _visitAfter_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\ntreeProto.x = _x_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"];\ntreeProto.y = _y_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"];\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/quadtree.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return uniq; });\nfunction uniq(arr, cache) {\n if (cache === void 0) { cache = new Map(); }\n var r = [];\n if (Array.isArray(arr)) {\n for (var i = 0, len = arr.length; i < len; i++) {\n var item = arr[i];\n // 加一个 cache,提升性能\n if (!cache.has(item)) {\n r.push(item);\n cache.set(item, true);\n }\n }\n }\n return r;\n}\n//# sourceMappingURL=uniq.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/uniq.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/remove.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/remove.js ***! - \**************************************************************************/ -/*! exports provided: default, removeAll */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/unique-id.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/unique-id.js ***! + \***********************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeAll\", function() { return removeAll; });\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n});\n\nfunction removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/remove.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar map = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (prefix) {\n prefix = prefix || 'g';\n if (!map[prefix]) {\n map[prefix] = 1;\n }\n else {\n map[prefix] += 1;\n }\n return prefix + map[prefix];\n});\n//# sourceMappingURL=unique-id.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/unique-id.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/root.js": -/*!************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/root.js ***! - \************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/upper-case.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/upper-case.js ***! + \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n return this._root;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/root.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-string.js\");\n\nvar upperCase = function (str) {\n return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str).toUpperCase();\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (upperCase);\n//# sourceMappingURL=upper-case.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/upper-case.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/size.js": -/*!************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/size.js ***! - \************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/upper-first.js": +/*!*************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/upper-first.js ***! + \*************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/size.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/to-string.js\");\n\nvar upperFirst = function (value) {\n var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value);\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (upperFirst);\n//# sourceMappingURL=upper-first.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/upper-first.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/visit.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/visit.js ***! - \*************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values-of-key.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values-of-key.js ***! + \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, x0, y0, xm, ym));\n }\n }\n return this;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/visit.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-array.js\");\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-nil.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (data, name) {\n var rst = [];\n var tmpMap = {};\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n // flatten\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n value = [value];\n }\n for (var j = 0; j < value.length; j++) {\n var val = value[j];\n // unique\n if (!tmpMap[val]) {\n rst.push(val);\n tmpMap[val] = true;\n }\n }\n }\n }\n return rst;\n});\n//# sourceMappingURL=values-of-key.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values-of-key.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/visitAfter.js": -/*!******************************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/visitAfter.js ***! - \******************************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values.js ***! + \********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/visitAfter.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/each.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/is-function.js\");\n\n\n// @ts-ignore\nvar values = Object.values\n ? function (obj) { return Object.values(obj); }\n : function (obj) {\n var result = [];\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (value, key) {\n if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj) && key === 'prototype')) {\n result.push(value);\n }\n });\n return result;\n };\n/* harmony default export */ __webpack_exports__[\"default\"] = (values);\n//# sourceMappingURL=values.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/values.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/x.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/x.js ***! - \*********************************************************************/ -/*! exports provided: defaultX, default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/wrap-behavior.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/wrap-behavior.js ***! + \***************************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultX\", function() { return defaultX; });\nfunction defaultX(d) {\n return d[0];\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/x.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 封装事件,便于使用上下文this,和便于解除事件时使用\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction wrapBehavior(obj, action) {\n if (obj['_wrap_' + action]) {\n return obj['_wrap_' + action];\n }\n var method = function (e) {\n obj[action](e);\n };\n obj['_wrap_' + action] = method;\n return method;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (wrapBehavior);\n//# sourceMappingURL=wrap-behavior.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/lodash/wrap-behavior.js?"); /***/ }), -/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/y.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/y.js ***! - \*********************************************************************/ -/*! exports provided: defaultY, default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/math/index.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/math/index.js ***! + \*****************************************************************************/ +/*! exports provided: isPointInPolygon, isPolygonsIntersect */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultY\", function() { return defaultY; });\nfunction defaultY(d) {\n return d[1];\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/y.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-point-in-polygon */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-point-in-polygon.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPointInPolygon\", function() { return _is_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"isPointInPolygon\"]; });\n\n/* harmony import */ var _is_polygons_intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-polygons-intersect */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-polygons-intersect.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPolygonsIntersect\", function() { return _is_polygons_intersect__WEBPACK_IMPORTED_MODULE_1__[\"isPolygonsIntersect\"]; });\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/math/index.js?"); /***/ }), -/***/ "./node_modules/@antv/matrix-util/esm/ext.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/matrix-util/esm/ext.js ***! - \***************************************************/ -/*! exports provided: leftTranslate, leftRotate, leftScale, transform, direction, angleTo, vertical */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-point-in-polygon.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-point-in-polygon.js ***! + \*******************************************************************************************/ +/*! exports provided: isPointInPolygon */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftTranslate\", function() { return leftTranslate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftRotate\", function() { return leftRotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftScale\", function() { return leftScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transform\", function() { return transform; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"direction\", function() { return direction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angleTo\", function() { return angleTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vertical\", function() { return vertical; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/**\n * @description 扩展方法,提供 gl-matrix 为提供的方法\n * */\n\nfunction leftTranslate(out, a, v) {\n var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromTranslation(transMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, transMat, a);\n}\nfunction leftRotate(out, a, rad) {\n var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromRotation(rotateMat, rad);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, rotateMat, a);\n}\nfunction leftScale(out, a, v) {\n var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromScaling(scaleMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, scaleMat, a);\n}\nfunction leftMultiply(out, a, a1) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, a1, a);\n}\n/**\n * 根据 actions 来做 transform\n * @param m\n * @param actions\n */\nfunction transform(m, actions) {\n var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0, len = actions.length; i < len; i++) {\n var action = actions[i];\n switch (action[0]) {\n case 't':\n leftTranslate(matrix, matrix, [action[1], action[2]]);\n break;\n case 's':\n leftScale(matrix, matrix, [action[1], action[2]]);\n break;\n case 'r':\n leftRotate(matrix, matrix, action[1]);\n break;\n case 'm':\n leftMultiply(matrix, matrix, action[1]);\n break;\n default:\n break;\n }\n }\n return matrix;\n}\n/**\n * 向量 v1 到 向量 v2 夹角的方向\n * @param {Array} v1 向量\n * @param {Array} v2 向量\n * @return {Boolean} >= 0 顺时针 < 0 逆时针\n */\nfunction direction(v1, v2) {\n return v1[0] * v2[1] - v2[0] * v1[1];\n}\n/**\n * 二维向量 v1 到 v2 的夹角\n * @param v1\n * @param v2\n * @param direct\n */\nfunction angleTo(v1, v2, direct) {\n var ang = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].angle(v1, v2);\n var angleLargeThanPI = direction(v1, v2) >= 0;\n if (direct) {\n if (angleLargeThanPI) {\n return Math.PI * 2 - ang;\n }\n return ang;\n }\n if (angleLargeThanPI) {\n return ang;\n }\n return Math.PI * 2 - ang;\n}\n/**\n * 计算二维向量的垂直向量\n * @param out\n * @param v\n * @param flag\n */\nfunction vertical(out, v, flag) {\n if (flag) {\n out[0] = v[1];\n out[1] = -1 * v[0];\n }\n else {\n out[0] = -1 * v[1];\n out[1] = v[0];\n }\n return out;\n}\n//# sourceMappingURL=ext.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/matrix-util/esm/ext.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPointInPolygon\", function() { return isPointInPolygon; });\n// 多边形的射线检测,参考:https://blog.csdn.net/WilliamSun0122/article/details/77994526\nvar tolerance = 1e-6;\n// 三态函数,判断两个double在eps精度下的大小关系\nfunction dcmp(x) {\n if (Math.abs(x) < tolerance) {\n return 0;\n }\n return x < 0 ? -1 : 1;\n}\n// 判断点Q是否在p1和p2的线段上\nfunction onSegment(p1, p2, q) {\n if ((q[0] - p1[0]) * (p2[1] - p1[1]) === (p2[0] - p1[0]) * (q[1] - p1[1]) &&\n Math.min(p1[0], p2[0]) <= q[0] &&\n q[0] <= Math.max(p1[0], p2[0]) &&\n Math.min(p1[1], p2[1]) <= q[1] &&\n q[1] <= Math.max(p1[1], p2[1])) {\n return true;\n }\n return false;\n}\n// 判断点P在多边形内-射线法\nfunction isPointInPolygon(points, x, y) {\n var isHit = false;\n var n = points.length;\n if (n <= 2) {\n // svg 中点小于 3 个时,不显示,也无法被拾取\n return false;\n }\n for (var i = 0; i < n; i++) {\n var p1 = points[i];\n var p2 = points[(i + 1) % n];\n if (onSegment(p1, p2, [x, y])) {\n // 点在多边形一条边上\n return true;\n }\n // 前一个判断min(p1[1],p2[1]) 0 !== dcmp(p2[1] - y) > 0 &&\n dcmp(x - ((y - p1[1]) * (p1[0] - p2[0])) / (p1[1] - p2[1]) - p1[0]) < 0) {\n isHit = !isHit;\n }\n }\n return isHit;\n}\n//# sourceMappingURL=is-point-in-polygon.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-point-in-polygon.js?"); /***/ }), -/***/ "./node_modules/@antv/matrix-util/esm/index.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/matrix-util/esm/index.js ***! - \*****************************************************/ -/*! exports provided: mat3, vec2, vec3, ext */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-polygons-intersect.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-polygons-intersect.js ***! + \*********************************************************************************************/ +/*! exports provided: isPolygonsIntersect */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mat3\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vec2\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vec3\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"]; });\n\n/* harmony import */ var _ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ext */ \"./node_modules/@antv/matrix-util/esm/ext.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"ext\", function() { return _ext__WEBPACK_IMPORTED_MODULE_1__; });\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/matrix-util/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPolygonsIntersect\", function() { return isPolygonsIntersect; });\n/* harmony import */ var _is_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-point-in-polygon */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-point-in-polygon.js\");\n\nvar isBetween = function (value, min, max) { return value >= min && value <= max; };\nfunction getLineIntersect(p0, p1, p2, p3) {\n var tolerance = 0.001;\n var E = {\n x: p2.x - p0.x,\n y: p2.y - p0.y,\n };\n var D0 = {\n x: p1.x - p0.x,\n y: p1.y - p0.y,\n };\n var D1 = {\n x: p3.x - p2.x,\n y: p3.y - p2.y,\n };\n var kross = D0.x * D1.y - D0.y * D1.x;\n var sqrKross = kross * kross;\n var sqrLen0 = D0.x * D0.x + D0.y * D0.y;\n var sqrLen1 = D1.x * D1.x + D1.y * D1.y;\n var point = null;\n if (sqrKross > tolerance * sqrLen0 * sqrLen1) {\n var s = (E.x * D1.y - E.y * D1.x) / kross;\n var t = (E.x * D0.y - E.y * D0.x) / kross;\n if (isBetween(s, 0, 1) && isBetween(t, 0, 1)) {\n point = {\n x: p0.x + s * D0.x,\n y: p0.y + s * D0.y,\n };\n }\n }\n return point;\n}\nfunction parseToLines(points) {\n var lines = [];\n var count = points.length;\n for (var i = 0; i < count - 1; i++) {\n var point = points[i];\n var next = points[i + 1];\n lines.push({\n from: {\n x: point[0],\n y: point[1],\n },\n to: {\n x: next[0],\n y: next[1],\n },\n });\n }\n if (lines.length > 1) {\n var first = points[0];\n var last = points[count - 1];\n lines.push({\n from: {\n x: last[0],\n y: last[1],\n },\n to: {\n x: first[0],\n y: first[1],\n },\n });\n }\n return lines;\n}\nfunction lineIntersectPolygon(lines, line) {\n var isIntersect = false;\n lines.forEach(function (l) {\n if (getLineIntersect(l.from, l.to, line.from, line.to)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n}\nfunction getBBox(points) {\n var xArr = points.map(function (p) { return p[0]; });\n var yArr = points.map(function (p) { return p[1]; });\n return {\n minX: Math.min.apply(null, xArr),\n maxX: Math.max.apply(null, xArr),\n minY: Math.min.apply(null, yArr),\n maxY: Math.max.apply(null, yArr),\n };\n}\nfunction intersectBBox(box1, box2) {\n return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);\n}\n/**\n * @see https://stackoverflow.com/questions/753140/how-do-i-determine-if-two-convex-polygons-intersect\n */\nfunction isPolygonsIntersect(points1, points2) {\n // 空数组,或者一个点返回 false\n if (points1.length < 2 || points2.length < 2) {\n return false;\n }\n var bbox1 = getBBox(points1);\n var bbox2 = getBBox(points2);\n // 判定包围盒是否相交,比判定点是否在多边形内要快的多,可以筛选掉大多数情况\n if (!intersectBBox(bbox1, bbox2)) {\n return false;\n }\n var isIn = false;\n // 判定点是否在多边形内部,一旦有一个点在另一个多边形内,则返回\n points2.forEach(function (point) {\n if (Object(_is_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"isPointInPolygon\"])(points1, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n // 两个多边形都需要判定\n points1.forEach(function (point) {\n if (Object(_is_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"isPointInPolygon\"])(points2, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n var lines1 = parseToLines(points1);\n var lines2 = parseToLines(points2);\n var isIntersect = false;\n lines2.forEach(function (line) {\n if (lineIntersectPolygon(lines1, line)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n}\n//# sourceMappingURL=is-polygons-intersect.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/math/is-polygons-intersect.js?"); /***/ }), -/***/ "./node_modules/@antv/matrix-util/lib/ext.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/matrix-util/lib/ext.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/angle-to.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/angle-to.js ***! + \**********************************************************************************/ +/*! exports provided: angleTo */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * @description 扩展方法,提供 gl-matrix 为提供的方法\n * */\nvar gl_matrix_1 = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\nfunction leftTranslate(out, a, v) {\n var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix_1.mat3.fromTranslation(transMat, v);\n return gl_matrix_1.mat3.multiply(out, transMat, a);\n}\nexports.leftTranslate = leftTranslate;\nfunction leftRotate(out, a, rad) {\n var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix_1.mat3.fromRotation(rotateMat, rad);\n return gl_matrix_1.mat3.multiply(out, rotateMat, a);\n}\nexports.leftRotate = leftRotate;\nfunction leftScale(out, a, v) {\n var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix_1.mat3.fromScaling(scaleMat, v);\n return gl_matrix_1.mat3.multiply(out, scaleMat, a);\n}\nexports.leftScale = leftScale;\nfunction leftMultiply(out, a, a1) {\n return gl_matrix_1.mat3.multiply(out, a1, a);\n}\n/**\n * 根据 actions 来做 transform\n * @param m\n * @param actions\n */\nfunction transform(m, actions) {\n var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0, len = actions.length; i < len; i++) {\n var action = actions[i];\n switch (action[0]) {\n case 't':\n leftTranslate(matrix, matrix, [action[1], action[2]]);\n break;\n case 's':\n leftScale(matrix, matrix, [action[1], action[2]]);\n break;\n case 'r':\n leftRotate(matrix, matrix, action[1]);\n break;\n case 'm':\n leftMultiply(matrix, matrix, action[1]);\n break;\n default:\n break;\n }\n }\n return matrix;\n}\nexports.transform = transform;\n/**\n * 向量 v1 到 向量 v2 夹角的方向\n * @param {Array} v1 向量\n * @param {Array} v2 向量\n * @return {Boolean} >= 0 顺时针 < 0 逆时针\n */\nfunction direction(v1, v2) {\n return v1[0] * v2[1] - v2[0] * v1[1];\n}\nexports.direction = direction;\n/**\n * 二维向量 v1 到 v2 的夹角\n * @param v1\n * @param v2\n * @param direct\n */\nfunction angleTo(v1, v2, direct) {\n var ang = gl_matrix_1.vec2.angle(v1, v2);\n var angleLargeThanPI = direction(v1, v2) >= 0;\n if (direct) {\n if (angleLargeThanPI) {\n return Math.PI * 2 - ang;\n }\n return ang;\n }\n if (angleLargeThanPI) {\n return ang;\n }\n return Math.PI * 2 - ang;\n}\nexports.angleTo = angleTo;\n/**\n * 计算二维向量的垂直向量\n * @param out\n * @param v\n * @param flag\n */\nfunction vertical(out, v, flag) {\n if (flag) {\n out[0] = v[1];\n out[1] = -1 * v[0];\n }\n else {\n out[0] = -1 * v[1];\n out[1] = v[0];\n }\n return out;\n}\nexports.vertical = vertical;\n//# sourceMappingURL=ext.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/matrix-util/lib/ext.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angleTo\", function() { return angleTo; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony import */ var _direction__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./direction */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/direction.js\");\n\n\n/**\n * 二维向量 v1 到 v2 的夹角\n * @param v1\n * @param v2\n * @param direct\n */\nfunction angleTo(v1, v2, direct) {\n var ang = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].angle(v1, v2);\n var angleLargeThanPI = Object(_direction__WEBPACK_IMPORTED_MODULE_1__[\"direction\"])(v1, v2) >= 0;\n if (direct) {\n if (angleLargeThanPI) {\n return Math.PI * 2 - ang;\n }\n return ang;\n }\n if (angleLargeThanPI) {\n return ang;\n }\n return Math.PI * 2 - ang;\n}\n//# sourceMappingURL=angle-to.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/angle-to.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/catmull-rom-2-bezier.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/catmull-rom-2-bezier.js ***! - \******************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/direction.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/direction.js ***! + \***********************************************************************************/ +/*! exports provided: direction */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/index.js\");\n\nfunction smoothBezier(points, smooth, isLoop, constraint) {\n var cps = [];\n var hasConstraint = !!constraint;\n var prevPoint;\n var nextPoint;\n var min;\n var max;\n var nextCp0;\n var cp1;\n var cp0;\n if (hasConstraint) {\n min = constraint[0], max = constraint[1];\n for (var i = 0, l = points.length; i < l; i += 1) {\n var point = points[i];\n min = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], min, point);\n max = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], max, point);\n }\n }\n for (var i = 0, len = points.length; i < len; i += 1) {\n var point = points[i];\n if (i === 0 && !isLoop) {\n cp0 = point;\n }\n else if (i === len - 1 && !isLoop) {\n cp1 = point;\n cps.push(cp0);\n cps.push(cp1);\n }\n else {\n var prevIdx = [i ? i - 1 : len - 1, i - 1][isLoop ? 0 : 1];\n prevPoint = points[prevIdx];\n nextPoint = points[isLoop ? (i + 1) % len : i + 1];\n var v = [0, 0];\n v = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].sub(v, nextPoint, prevPoint);\n v = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale(v, v, smooth);\n var d0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].distance(point, prevPoint);\n var d1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].distance(point, nextPoint);\n var sum = d0 + d1;\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n var v1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], v, -d0);\n var v2 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], v, d1);\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], point, v1);\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], point, v2);\n // 下一个控制点必须在这个点和下一个点之间\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], nextCp0, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], nextPoint, point));\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], nextCp0, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], nextPoint, point));\n // 重新计算 cp1 的值\n v1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].sub([0, 0], nextCp0, point);\n v1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], v1, -d0 / d1);\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], point, v1);\n // 上一个控制点必须要在上一个点和这一个点之间\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], cp1, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], prevPoint, point));\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], cp1, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], prevPoint, point));\n // 重新计算 nextCp0 的值\n v2 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].sub([0, 0], point, cp1);\n v2 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], v2, d1 / d0);\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], point, v2);\n if (hasConstraint) {\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], cp1, min);\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], cp1, max);\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], nextCp0, min);\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], nextCp0, max);\n }\n cps.push(cp0);\n cps.push(cp1);\n cp0 = nextCp0;\n }\n }\n if (isLoop) {\n cps.push(cps.shift());\n }\n return cps;\n}\n/**\n * create bezier spline from catmull rom spline\n * @param {Array} crp Catmull Rom Points\n * @param {boolean} z Spline is loop\n * @param {Array} constraint Constraint\n */\nfunction catmullRom2Bezier(crp, z, constraint) {\n if (z === void 0) { z = false; }\n if (constraint === void 0) { constraint = [\n [0, 0],\n [1, 1],\n ]; }\n var isLoop = !!z;\n var pointList = [];\n for (var i = 0, l = crp.length; i < l; i += 2) {\n pointList.push([crp[i], crp[i + 1]]);\n }\n var controlPointList = smoothBezier(pointList, 0.4, isLoop, constraint);\n var len = pointList.length;\n var d1 = [];\n var cp1;\n var cp2;\n var p;\n for (var i = 0; i < len - 1; i += 1) {\n cp1 = controlPointList[i * 2];\n cp2 = controlPointList[i * 2 + 1];\n p = pointList[i + 1];\n d1.push(['C', cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]]);\n }\n if (isLoop) {\n cp1 = controlPointList[len];\n cp2 = controlPointList[len + 1];\n p = pointList[0];\n d1.push(['C', cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]]);\n }\n return d1;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (catmullRom2Bezier);\n//# sourceMappingURL=catmull-rom-2-bezier.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/catmull-rom-2-bezier.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"direction\", function() { return direction; });\n/**\n * 向量 v1 到 向量 v2 夹角的方向\n * @param {Array} v1 向量\n * @param {Array} v2 向量\n * @return {Boolean} >= 0 顺时针 < 0 逆时针\n */\nfunction direction(v1, v2) {\n return v1[0] * v2[1] - v2[0] * v1[1];\n}\n//# sourceMappingURL=direction.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/direction.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/fill-path-by-diff.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/fill-path-by-diff.js ***! - \***************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/index.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/index.js ***! + \*******************************************************************************/ +/*! exports provided: transform, angleTo, direction, vertical */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return fillPathByDiff; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nfunction getMinDiff(del, add, modify) {\n var type = null;\n var min = modify;\n if (add < min) {\n min = add;\n type = 'add';\n }\n if (del < min) {\n min = del;\n type = 'del';\n }\n return {\n type: type,\n min: min,\n };\n}\n/*\n * https://en.wikipedia.org/wiki/Levenshtein_distance\n * 计算两条path的编辑距离\n */\nvar levenshteinDistance = function (source, target) {\n var sourceLen = source.length;\n var targetLen = target.length;\n var sourceSegment, targetSegment;\n var temp = 0;\n if (sourceLen === 0 || targetLen === 0) {\n return null;\n }\n var dist = [];\n for (var i = 0; i <= sourceLen; i++) {\n dist[i] = [];\n dist[i][0] = { min: i };\n }\n for (var j = 0; j <= targetLen; j++) {\n dist[0][j] = { min: j };\n }\n for (var i = 1; i <= sourceLen; i++) {\n sourceSegment = source[i - 1];\n for (var j = 1; j <= targetLen; j++) {\n targetSegment = target[j - 1];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isEqual\"])(sourceSegment, targetSegment)) {\n temp = 0;\n }\n else {\n temp = 1;\n }\n var del = dist[i - 1][j].min + 1;\n var add = dist[i][j - 1].min + 1;\n var modify = dist[i - 1][j - 1].min + temp;\n dist[i][j] = getMinDiff(del, add, modify);\n }\n }\n return dist;\n};\nfunction fillPathByDiff(source, target) {\n var diffMatrix = levenshteinDistance(source, target);\n var sourceLen = source.length;\n var targetLen = target.length;\n var changes = [];\n var index = 1;\n var minPos = 1;\n // 如果source和target不是完全不相等\n // @ts-ignore\n if (diffMatrix[sourceLen][targetLen] !== sourceLen) {\n // 获取从source到target所需改动\n for (var i = 1; i <= sourceLen; i++) {\n var min = diffMatrix[i][i].min;\n minPos = i;\n for (var j = index; j <= targetLen; j++) {\n if (diffMatrix[i][j].min < min) {\n min = diffMatrix[i][j].min;\n minPos = j;\n }\n }\n index = minPos;\n if (diffMatrix[i][index].type) {\n changes.push({ index: i - 1, type: diffMatrix[i][index].type });\n }\n }\n // 对source进行增删path\n for (var i = changes.length - 1; i >= 0; i--) {\n index = changes[i].index;\n if (changes[i].type === 'add') {\n // @ts-ignore\n source.splice(index, 0, [].concat(source[index]));\n }\n else {\n // @ts-ignore\n source.splice(index, 1);\n }\n }\n }\n // source尾部补齐\n sourceLen = source.length;\n if (sourceLen < targetLen) {\n for (var i = 0; i < (targetLen - sourceLen); i++) {\n if (source[sourceLen - 1][0] === 'z' || source[sourceLen - 1][0] === 'Z') {\n // @ts-ignore\n source.splice(sourceLen - 2, 0, source[sourceLen - 2]);\n }\n else {\n // @ts-ignore\n source.push(source[sourceLen - 1]);\n }\n }\n }\n return source;\n}\n//# sourceMappingURL=fill-path-by-diff.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/fill-path-by-diff.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _transform__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./transform */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/transform.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"transform\", function() { return _transform__WEBPACK_IMPORTED_MODULE_0__[\"transform\"]; });\n\n/* harmony import */ var _angle_to__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./angle-to */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/angle-to.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"angleTo\", function() { return _angle_to__WEBPACK_IMPORTED_MODULE_1__[\"angleTo\"]; });\n\n/* harmony import */ var _direction__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./direction */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/direction.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"direction\", function() { return _direction__WEBPACK_IMPORTED_MODULE_2__[\"direction\"]; });\n\n/* harmony import */ var _vertical__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vertical */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/vertical.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vertical\", function() { return _vertical__WEBPACK_IMPORTED_MODULE_3__[\"vertical\"]; });\n\n/**\n * @description 扩展方法,提供 gl-matrix 为提供的方法\n **/\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/index.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/fill-path.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/fill-path.js ***! - \*******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/transform.js": +/*!***********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/transform.js ***! + \***********************************************************************************/ +/*! exports provided: transform */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return fillPath; });\nfunction decasteljau(points, t) {\n var left = [];\n var right = [];\n function recurse(points, t) {\n if (points.length === 1) {\n left.push(points[0]);\n right.push(points[0]);\n }\n else {\n var middlePoints = [];\n for (var i = 0; i < points.length - 1; i++) {\n if (i === 0) {\n left.push(points[0]);\n }\n if (i === points.length - 2) {\n right.push(points[i + 1]);\n }\n middlePoints[i] = [(1 - t) * points[i][0] + t * points[i + 1][0], (1 - t) * points[i][1] + t * points[i + 1][1]];\n }\n recurse(middlePoints, t);\n }\n }\n if (points.length) {\n recurse(points, t);\n }\n return { left: left, right: right.reverse() };\n}\nfunction splitCurve(start, end, count) {\n var points = [[start[1], start[2]]];\n count = count || 2;\n var segments = [];\n if (end[0] === 'A') {\n points.push(end[6]);\n points.push(end[7]);\n }\n else if (end[0] === 'C') {\n points.push([end[1], end[2]]);\n points.push([end[3], end[4]]);\n points.push([end[5], end[6]]);\n }\n else if (end[0] === 'S' || end[0] === 'Q') {\n points.push([end[1], end[2]]);\n points.push([end[3], end[4]]);\n }\n else {\n points.push([end[1], end[2]]);\n }\n var leftSegments = points;\n var t = 1 / count;\n for (var i = 0; i < count - 1; i++) {\n var rt = t / (1 - t * i);\n var split = decasteljau(leftSegments, rt);\n segments.push(split.left);\n leftSegments = split.right;\n }\n segments.push(leftSegments);\n var result = segments.map(function (segment) {\n var cmd = [];\n if (segment.length === 4) {\n cmd.push('C');\n cmd = cmd.concat(segment[2]);\n }\n if (segment.length >= 3) {\n if (segment.length === 3) {\n cmd.push('Q');\n }\n cmd = cmd.concat(segment[1]);\n }\n if (segment.length === 2) {\n cmd.push('L');\n }\n cmd = cmd.concat(segment[segment.length - 1]);\n return cmd;\n });\n return result;\n}\nfunction splitSegment(start, end, count) {\n if (count === 1) {\n return [[].concat(start)];\n }\n var segments = [];\n if (end[0] === 'L' || end[0] === 'C' || end[0] === 'Q') {\n segments = segments.concat(splitCurve(start, end, count));\n }\n else {\n var temp = [].concat(start);\n if (temp[0] === 'M') {\n temp[0] = 'L';\n }\n for (var i = 0; i <= count - 1; i++) {\n segments.push(temp);\n }\n }\n return segments;\n}\nfunction fillPath(source, target) {\n if (source.length === 1) {\n return source;\n }\n var sourceLen = source.length - 1;\n var targetLen = target.length - 1;\n var ratio = sourceLen / targetLen;\n var segmentsToFill = [];\n if (source.length === 1 && source[0][0] === 'M') {\n for (var i = 0; i < targetLen - sourceLen; i++) {\n source.push(source[0]);\n }\n return source;\n }\n for (var i = 0; i < targetLen; i++) {\n var index = Math.floor(ratio * i);\n segmentsToFill[index] = (segmentsToFill[index] || 0) + 1;\n }\n var filled = segmentsToFill.reduce(function (filled, count, i) {\n if (i === sourceLen) {\n return filled.concat(source[sourceLen]);\n }\n return filled.concat(splitSegment(source[i], source[i + 1], count));\n }, []);\n filled.unshift(source[0]);\n if (target[targetLen] === 'Z' || target[targetLen] === 'z') {\n filled.push('Z');\n }\n return filled;\n}\n//# sourceMappingURL=fill-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/fill-path.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transform\", function() { return transform; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n\nfunction leftTranslate(out, a, v) {\n var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromTranslation(transMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, transMat, a);\n}\nfunction leftRotate(out, a, rad) {\n var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromRotation(rotateMat, rad);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, rotateMat, a);\n}\nfunction leftScale(out, a, v) {\n var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromScaling(scaleMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, scaleMat, a);\n}\nfunction leftMultiply(out, a, a1) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, a1, a);\n}\n/**\n * 根据 actions 来做 transform\n * @param m\n * @param actions\n */\nfunction transform(m, actions) {\n var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0, len = actions.length; i < len; i++) {\n var action = actions[i];\n switch (action[0]) {\n case 't':\n leftTranslate(matrix, matrix, [action[1], action[2]]);\n break;\n case 's':\n leftScale(matrix, matrix, [action[1], action[2]]);\n break;\n case 'r':\n leftRotate(matrix, matrix, action[1]);\n break;\n case 'm':\n leftMultiply(matrix, matrix, action[1]);\n break;\n default:\n break;\n }\n }\n return matrix;\n}\n//# sourceMappingURL=transform.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/transform.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/format-path.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/format-path.js ***! - \*********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/vertical.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/vertical.js ***! + \**********************************************************************************/ +/*! exports provided: vertical */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return formatPath; });\n/*\n * 抽取pathSegment中的关键点\n * M,L,A,Q,H,V一个端点\n * Q, S抽取一个端点,一个控制点\n * C抽取一个端点,两个控制点\n */\nfunction _getSegmentPoints(segment) {\n var points = [];\n switch (segment[0]) {\n case 'M':\n points.push([segment[1], segment[2]]);\n break;\n case 'L':\n points.push([segment[1], segment[2]]);\n break;\n case 'A':\n points.push([segment[6], segment[7]]);\n break;\n case 'Q':\n points.push([segment[3], segment[4]]);\n points.push([segment[1], segment[2]]);\n break;\n case 'T':\n points.push([segment[1], segment[2]]);\n break;\n case 'C':\n points.push([segment[5], segment[6]]);\n points.push([segment[1], segment[2]]);\n points.push([segment[3], segment[4]]);\n break;\n case 'S':\n points.push([segment[3], segment[4]]);\n points.push([segment[1], segment[2]]);\n break;\n case 'H':\n points.push([segment[1], segment[1]]);\n break;\n case 'V':\n points.push([segment[1], segment[1]]);\n break;\n default:\n }\n return points;\n}\n// 将两个点均分成count个点\nfunction _splitPoints(points, former, count) {\n var result = [].concat(points);\n var index;\n var t = 1 / (count + 1);\n var formerEnd = _getSegmentPoints(former)[0];\n for (var i = 1; i <= count; i++) {\n t *= i;\n index = Math.floor(points.length * t);\n if (index === 0) {\n result.unshift([formerEnd[0] * t + points[index][0] * (1 - t), formerEnd[1] * t + points[index][1] * (1 - t)]);\n }\n else {\n result.splice(index, 0, [formerEnd[0] * t + points[index][0] * (1 - t), formerEnd[1] * t + points[index][1] * (1 - t)]);\n }\n }\n return result;\n}\nfunction formatPath(fromPath, toPath) {\n if (fromPath.length <= 1) {\n return fromPath;\n }\n var points;\n for (var i = 0; i < toPath.length; i++) {\n if (fromPath[i][0] !== toPath[i][0]) {\n // 获取fromPath的pathSegment的端点,根据toPath的指令对其改造\n points = _getSegmentPoints(fromPath[i]);\n switch (toPath[i][0]) {\n case 'M':\n fromPath[i] = ['M'].concat(points[0]);\n break;\n case 'L':\n fromPath[i] = ['L'].concat(points[0]);\n break;\n case 'A':\n fromPath[i] = [].concat(toPath[i]);\n fromPath[i][6] = points[0][0];\n fromPath[i][7] = points[0][1];\n break;\n case 'Q':\n if (points.length < 2) {\n if (i > 0) {\n points = _splitPoints(points, fromPath[i - 1], 1);\n }\n else {\n fromPath[i] = toPath[i];\n break;\n }\n }\n fromPath[i] = ['Q'].concat(points.reduce(function (arr, i) { return arr.concat(i); }, []));\n break;\n case 'T':\n fromPath[i] = ['T'].concat(points[0]);\n break;\n case 'C':\n if (points.length < 3) {\n if (i > 0) {\n points = _splitPoints(points, fromPath[i - 1], 2);\n }\n else {\n fromPath[i] = toPath[i];\n break;\n }\n }\n fromPath[i] = ['C'].concat(points.reduce(function (arr, i) { return arr.concat(i); }, []));\n break;\n case 'S':\n if (points.length < 2) {\n if (i > 0) {\n points = _splitPoints(points, fromPath[i - 1], 1);\n }\n else {\n fromPath[i] = toPath[i];\n break;\n }\n }\n fromPath[i] = ['S'].concat(points.reduce(function (arr, i) { return arr.concat(i); }, []));\n break;\n default:\n fromPath[i] = toPath[i];\n }\n }\n }\n return fromPath;\n}\n//# sourceMappingURL=format-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/format-path.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vertical\", function() { return vertical; });\n/**\n * 计算二维向量的垂直向量\n * @param out\n * @param v\n * @param flag\n */\nfunction vertical(out, v, flag) {\n if (flag) {\n out[0] = v[1];\n out[1] = -1 * v[0];\n }\n else {\n out[0] = -1 * v[1];\n out[1] = v[0];\n }\n return out;\n}\n//# sourceMappingURL=vertical.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/matrix/vertical.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/get-arc-params.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/get-arc-params.js ***! - \************************************************************/ -/*! exports provided: isSamePoint, default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-absolute.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-absolute.js ***! + \***********************************************************************************************/ +/*! exports provided: path2Absolute */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSamePoint\", function() { return isSamePoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getArcParams; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n// 向量长度\nfunction vMag(v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n}\n// u.v/|u||v|,计算夹角的余弦值\nfunction vRatio(u, v) {\n // 当存在一个向量的长度为 0 时,夹角也为 0,即夹角的余弦值为 1\n return vMag(u) * vMag(v) ? (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)) : 1;\n}\n// 向量角度\nfunction vAngle(u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n}\n/**\n * 判断两个点是否重合,点坐标的格式为 [x, y]\n * @param {Array} point1 第一个点\n * @param {Array} point2 第二个点\n */\nfunction isSamePoint(point1, point2) {\n return point1[0] === point2[0] && point1[1] === point2[1];\n}\n// A 0:rx 1:ry 2:x-axis-rotation 3:large-arc-flag 4:sweep-flag 5: x 6: y\nfunction getArcParams(startPoint, params) {\n var rx = params[1];\n var ry = params[2];\n var xRotation = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"mod\"])(Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"toRadian\"])(params[3]), Math.PI * 2);\n var arcFlag = params[4];\n var sweepFlag = params[5];\n // 弧形起点坐标\n var x1 = startPoint[0];\n var y1 = startPoint[1];\n // 弧形终点坐标\n var x2 = params[6];\n var y2 = params[7];\n var xp = (Math.cos(xRotation) * (x1 - x2)) / 2.0 + (Math.sin(xRotation) * (y1 - y2)) / 2.0;\n var yp = (-1 * Math.sin(xRotation) * (x1 - x2)) / 2.0 + (Math.cos(xRotation) * (y1 - y2)) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var diff = rx * rx * (yp * yp) + ry * ry * (xp * xp);\n var f = diff ? Math.sqrt((rx * rx * (ry * ry) - diff) / diff) : 1;\n if (arcFlag === sweepFlag) {\n f *= -1;\n }\n if (isNaN(f)) {\n f = 0;\n }\n // 旋转前的起点坐标,且当长半轴和短半轴的长度为 0 时,坐标按 (0, 0) 处理\n var cxp = ry ? (f * rx * yp) / ry : 0;\n var cyp = rx ? (f * -ry * xp) / rx : 0;\n // 椭圆圆心坐标\n var cx = (x1 + x2) / 2.0 + Math.cos(xRotation) * cxp - Math.sin(xRotation) * cyp;\n var cy = (y1 + y2) / 2.0 + Math.sin(xRotation) * cxp + Math.cos(xRotation) * cyp;\n // 起始点的单位向量\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n // 终止点的单位向量\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n // 计算起始点和圆心的连线,与 x 轴正方向的夹角\n var theta = vAngle([1, 0], u);\n // 计算圆弧起始点和终止点与椭圆圆心连线的夹角\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = Math.PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (sweepFlag === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * Math.PI;\n }\n if (sweepFlag === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * Math.PI;\n }\n return {\n cx: cx,\n cy: cy,\n // 弧形的起点和终点相同时,长轴和短轴的长度按 0 处理\n rx: isSamePoint(startPoint, [x2, y2]) ? 0 : rx,\n ry: isSamePoint(startPoint, [x2, y2]) ? 0 : ry,\n startAngle: theta,\n endAngle: theta + dTheta,\n xRotation: xRotation,\n arcFlag: arcFlag,\n sweepFlag: sweepFlag,\n };\n}\n//# sourceMappingURL=get-arc-params.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/get-arc-params.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"path2Absolute\", function() { return path2Absolute; });\n/* harmony import */ var _util_is_absolute_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/is-absolute-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-absolute-array.js\");\n/* harmony import */ var _parser_parse_path_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/parse-path-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/parse-path-string.js\");\n\n\nfunction path2Absolute(pathInput) {\n if (Object(_util_is_absolute_array__WEBPACK_IMPORTED_MODULE_0__[\"isAbsoluteArray\"])(pathInput)) {\n return [].concat(pathInput);\n }\n var path = Object(_parser_parse_path_string__WEBPACK_IMPORTED_MODULE_1__[\"parsePathString\"])(pathInput);\n // if (!path || !path.length) {\n // return [['M', 0, 0]];\n // }\n var x = 0;\n var y = 0;\n var mx = 0;\n var my = 0;\n // @ts-ignore\n return path.map(function (segment) {\n var values = segment.slice(1).map(Number);\n var pathCommand = segment[0];\n var absCommand = pathCommand.toUpperCase();\n if (pathCommand === 'M') {\n x = values[0], y = values[1];\n mx = x;\n my = y;\n return ['M', x, y];\n }\n var absoluteSegment;\n if (pathCommand !== absCommand) {\n switch (absCommand) {\n case 'A':\n absoluteSegment = [\n absCommand,\n values[0],\n values[1],\n values[2],\n values[3],\n values[4],\n values[5] + x,\n values[6] + y,\n ];\n break;\n case 'V':\n absoluteSegment = [absCommand, values[0] + y];\n break;\n case 'H':\n absoluteSegment = [absCommand, values[0] + x];\n break;\n default: {\n // use brakets for `eslint: no-case-declaration`\n // https://stackoverflow.com/a/50753272/803358\n var absValues = values.map(function (n, j) { return n + (j % 2 ? y : x); });\n // for n, l, c, s, q, t\n // @ts-ignore\n absoluteSegment = [absCommand].concat(absValues);\n }\n }\n }\n else {\n // @ts-ignore\n absoluteSegment = [absCommand].concat(values);\n }\n var segLength = absoluteSegment.length;\n switch (absCommand) {\n case 'Z':\n x = mx;\n y = my;\n break;\n case 'H':\n x = absoluteSegment[1];\n break;\n case 'V':\n y = absoluteSegment[1];\n break;\n default:\n x = absoluteSegment[segLength - 2];\n y = absoluteSegment[segLength - 1];\n if (absCommand === 'M') {\n mx = x;\n my = y;\n }\n }\n return absoluteSegment;\n });\n}\n//# sourceMappingURL=path-2-absolute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-absolute.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/get-line-intersect.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/get-line-intersect.js ***! - \****************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-curve.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-curve.js ***! + \********************************************************************************************/ +/*! exports provided: path2Curve */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getLineIntersect; });\nvar isBetween = function (value, min, max) { return value >= min && value <= max; };\nfunction getLineIntersect(p0, p1, p2, p3) {\n var tolerance = 0.001;\n var E = {\n x: p2.x - p0.x,\n y: p2.y - p0.y,\n };\n var D0 = {\n x: p1.x - p0.x,\n y: p1.y - p0.y,\n };\n var D1 = {\n x: p3.x - p2.x,\n y: p3.y - p2.y,\n };\n var kross = D0.x * D1.y - D0.y * D1.x;\n var sqrKross = kross * kross;\n var sqrLen0 = D0.x * D0.x + D0.y * D0.y;\n var sqrLen1 = D1.x * D1.x + D1.y * D1.y;\n var point = null;\n if (sqrKross > tolerance * sqrLen0 * sqrLen1) {\n var s = (E.x * D1.y - E.y * D1.x) / kross;\n var t = (E.x * D0.y - E.y * D0.x) / kross;\n if (isBetween(s, 0, 1) && isBetween(t, 0, 1)) {\n point = {\n x: p0.x + s * D0.x,\n y: p0.y + s * D0.y,\n };\n }\n }\n return point;\n}\n;\n//# sourceMappingURL=get-line-intersect.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/get-line-intersect.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"path2Curve\", function() { return path2Curve; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _parser_params_parser__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../parser/params-parser */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-parser.js\");\n/* harmony import */ var _process_fix_arc__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../process/fix-arc */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/fix-arc.js\");\n/* harmony import */ var _process_normalize_path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../process/normalize-path */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-path.js\");\n/* harmony import */ var _util_is_curve_array__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ../util/is-curve-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-curve-array.js\");\n/* harmony import */ var _process_segment_2_cubic__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ../process/segment-2-cubic */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/segment-2-cubic.js\");\n\n\n\n\n\n\n// import { fixPath } from '../process/fix-path';\nfunction path2Curve(pathInput, needZCommandIndexes) {\n if (needZCommandIndexes === void 0) { needZCommandIndexes = false; }\n if (Object(_util_is_curve_array__WEBPACK_IMPORTED_MODULE_4__[\"isCurveArray\"])(pathInput)) {\n var cloned = [].concat(pathInput);\n if (needZCommandIndexes) {\n return [cloned, []];\n }\n else {\n return cloned;\n }\n }\n // fixPath will remove 'Z' command\n // const path = fixPath(normalizePath(pathInput));\n var path = Object(_process_normalize_path__WEBPACK_IMPORTED_MODULE_3__[\"normalizePath\"])(pathInput);\n var params = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _parser_params_parser__WEBPACK_IMPORTED_MODULE_1__[\"paramsParser\"]);\n var allPathCommands = [];\n var pathCommand = '';\n var ii = path.length;\n var segment;\n var seglen;\n var zCommandIndexes = [];\n for (var i = 0; i < ii; i += 1) {\n if (path[i])\n pathCommand = path[i][0];\n allPathCommands[i] = pathCommand;\n var curveSegment = Object(_process_segment_2_cubic__WEBPACK_IMPORTED_MODULE_5__[\"segmentToCubic\"])(path[i], params);\n path[i] = curveSegment;\n Object(_process_fix_arc__WEBPACK_IMPORTED_MODULE_2__[\"fixArc\"])(path, allPathCommands, i);\n ii = path.length; // solves curveArrays ending in Z\n // keep Z command account for lineJoin\n // @see https://github.com/antvis/util/issues/68\n if (pathCommand === 'Z') {\n zCommandIndexes.push(i);\n }\n segment = path[i];\n seglen = segment.length;\n params.x1 = +segment[seglen - 2];\n params.y1 = +segment[seglen - 1];\n params.x2 = +segment[seglen - 4] || params.x1;\n params.y2 = +segment[seglen - 3] || params.y1;\n }\n // validate\n if (needZCommandIndexes) {\n return [path, zCommandIndexes];\n }\n else {\n return path;\n }\n}\n//# sourceMappingURL=path-2-curve.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-curve.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/index.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/index.js ***! - \***************************************************/ -/*! exports provided: parsePath, catmullRom2Bezier, fillPath, fillPathByDiff, formatPath, pathIntersection, parsePathArray, parsePathString, path2Curve, path2Absolute, reactPath, getArcParams, path2Segments, getLineIntersect, isPolygonsIntersect, isPointInPolygon */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-string.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-string.js ***! + \*********************************************************************************************/ +/*! exports provided: path2String */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parse_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse-path */ \"./node_modules/@antv/path-util/esm/parse-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parsePath\", function() { return _parse_path__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _catmull_rom_2_bezier__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./catmull-rom-2-bezier */ \"./node_modules/@antv/path-util/esm/catmull-rom-2-bezier.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"catmullRom2Bezier\", function() { return _catmull_rom_2_bezier__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _fill_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fill-path */ \"./node_modules/@antv/path-util/esm/fill-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fillPath\", function() { return _fill_path__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _fill_path_by_diff__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fill-path-by-diff */ \"./node_modules/@antv/path-util/esm/fill-path-by-diff.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fillPathByDiff\", function() { return _fill_path_by_diff__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _format_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./format-path */ \"./node_modules/@antv/path-util/esm/format-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"formatPath\", function() { return _format_path__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _path_intersection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./path-intersection */ \"./node_modules/@antv/path-util/esm/path-intersection.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pathIntersection\", function() { return _path_intersection__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _parse_path_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parse-path-array */ \"./node_modules/@antv/path-util/esm/parse-path-array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parsePathArray\", function() { return _parse_path_array__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _parse_path_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parse-path-string */ \"./node_modules/@antv/path-util/esm/parse-path-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parsePathString\", function() { return _parse_path_string__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _path_2_curve__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./path-2-curve */ \"./node_modules/@antv/path-util/esm/path-2-curve.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Curve\", function() { return _path_2_curve__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _path_2_absolute__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./path-2-absolute */ \"./node_modules/@antv/path-util/esm/path-2-absolute.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Absolute\", function() { return _path_2_absolute__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _rect_path__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./rect-path */ \"./node_modules/@antv/path-util/esm/rect-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"reactPath\", function() { return _rect_path__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _get_arc_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./get-arc-params */ \"./node_modules/@antv/path-util/esm/get-arc-params.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getArcParams\", function() { return _get_arc_params__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _path_2_segments__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./path-2-segments */ \"./node_modules/@antv/path-util/esm/path-2-segments.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Segments\", function() { return _path_2_segments__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _get_line_intersect__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./get-line-intersect */ \"./node_modules/@antv/path-util/esm/get-line-intersect.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getLineIntersect\", function() { return _get_line_intersect__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _is_polygons_intersect__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./is-polygons-intersect */ \"./node_modules/@antv/path-util/esm/is-polygons-intersect.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPolygonsIntersect\", function() { return _is_polygons_intersect__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony import */ var _point_in_polygon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./point-in-polygon */ \"./node_modules/@antv/path-util/esm/point-in-polygon.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPointInPolygon\", function() { return _point_in_polygon__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"path2String\", function() { return path2String; });\n/* harmony import */ var _process_round_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../process/round-path */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/round-path.js\");\n\n/**\n * Returns a valid `d` attribute string value created\n * by rounding values and concatenating the `pathArray` segments.\n */\nfunction path2String(path, round) {\n if (round === void 0) { round = 'off'; }\n return Object(_process_round_path__WEBPACK_IMPORTED_MODULE_0__[\"roundPath\"])(path, round)\n .map(function (x) { return x[0] + x.slice(1).join(' '); })\n .join('');\n}\n//# sourceMappingURL=path-2-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-string.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/is-polygons-intersect.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/is-polygons-intersect.js ***! - \*******************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/index.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/index.js ***! + \*****************************************************************************/ +/*! exports provided: path2String, path2Curve, path2Absolute, clonePath, normalizePath, reverseCurve, arcToCubic, getPathBBox, getTotalLength, getPathBBoxTotalLength, getRotatedCurve, getPathArea, getDrawDirection, getPointAtLength, isPointInStroke, distanceSquareRoot, equalizeSegments */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isPolygonsIntersect; });\n/* harmony import */ var _point_in_polygon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./point-in-polygon */ \"./node_modules/@antv/path-util/esm/point-in-polygon.js\");\n/* harmony import */ var _get_line_intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get-line-intersect */ \"./node_modules/@antv/path-util/esm/get-line-intersect.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\nfunction parseToLines(points) {\n var lines = [];\n var count = points.length;\n for (var i = 0; i < count - 1; i++) {\n var point = points[i];\n var next = points[i + 1];\n lines.push({\n from: {\n x: point[0],\n y: point[1]\n },\n to: {\n x: next[0],\n y: next[1]\n }\n });\n }\n if (lines.length > 1) {\n var first = points[0];\n var last = points[count - 1];\n lines.push({\n from: {\n x: last[0],\n y: last[1]\n },\n to: {\n x: first[0],\n y: first[1]\n }\n });\n }\n return lines;\n}\nfunction lineIntersectPolygon(lines, line) {\n var isIntersect = false;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(lines, function (l) {\n if (Object(_get_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(l.from, l.to, line.from, line.to)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n}\nfunction getBBox(points) {\n var xArr = points.map(function (p) { return p[0]; });\n var yArr = points.map(function (p) { return p[1]; });\n return {\n minX: Math.min.apply(null, xArr),\n maxX: Math.max.apply(null, xArr),\n minY: Math.min.apply(null, yArr),\n maxY: Math.max.apply(null, yArr)\n };\n}\nfunction intersectBBox(box1, box2) {\n return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);\n}\nfunction isPolygonsIntersect(points1, points2) {\n // 空数组,或者一个点返回 false\n if (points1.length < 2 || points2.length < 2) {\n return false;\n }\n var bbox1 = getBBox(points1);\n var bbox2 = getBBox(points2);\n // 判定包围盒是否相交,比判定点是否在多边形内要快的多,可以筛选掉大多数情况\n if (!intersectBBox(bbox1, bbox2)) {\n return false;\n }\n var isIn = false;\n // 判定点是否在多边形内部,一旦有一个点在另一个多边形内,则返回\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(points2, function (point) {\n if (Object(_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(points1, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n // 两个多边形都需要判定\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(points1, function (point) {\n if (Object(_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(points2, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n var lines1 = parseToLines(points1);\n var lines2 = parseToLines(points2);\n var isIntersect = false;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(lines2, function (line) {\n if (lineIntersectPolygon(lines1, line)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n}\n//# sourceMappingURL=is-polygons-intersect.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/is-polygons-intersect.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _convert_path_2_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./convert/path-2-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2String\", function() { return _convert_path_2_string__WEBPACK_IMPORTED_MODULE_0__[\"path2String\"]; });\n\n/* harmony import */ var _convert_path_2_curve__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./convert/path-2-curve */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-curve.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Curve\", function() { return _convert_path_2_curve__WEBPACK_IMPORTED_MODULE_1__[\"path2Curve\"]; });\n\n/* harmony import */ var _convert_path_2_absolute__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./convert/path-2-absolute */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-absolute.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Absolute\", function() { return _convert_path_2_absolute__WEBPACK_IMPORTED_MODULE_2__[\"path2Absolute\"]; });\n\n/* harmony import */ var _process_clone_path__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./process/clone-path */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/clone-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clonePath\", function() { return _process_clone_path__WEBPACK_IMPORTED_MODULE_3__[\"clonePath\"]; });\n\n/* harmony import */ var _process_normalize_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./process/normalize-path */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"normalizePath\", function() { return _process_normalize_path__WEBPACK_IMPORTED_MODULE_4__[\"normalizePath\"]; });\n\n/* harmony import */ var _process_reverse_curve__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./process/reverse-curve */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/reverse-curve.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"reverseCurve\", function() { return _process_reverse_curve__WEBPACK_IMPORTED_MODULE_5__[\"reverseCurve\"]; });\n\n/* harmony import */ var _process_arc_2_cubic__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./process/arc-2-cubic */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/arc-2-cubic.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"arcToCubic\", function() { return _process_arc_2_cubic__WEBPACK_IMPORTED_MODULE_6__[\"arcToCubic\"]; });\n\n/* harmony import */ var _util_get_path_bbox__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./util/get-path-bbox */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-bbox.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getPathBBox\", function() { return _util_get_path_bbox__WEBPACK_IMPORTED_MODULE_7__[\"getPathBBox\"]; });\n\n/* harmony import */ var _util_get_total_length__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./util/get-total-length */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-total-length.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTotalLength\", function() { return _util_get_total_length__WEBPACK_IMPORTED_MODULE_8__[\"getTotalLength\"]; });\n\n/* harmony import */ var _util_get_path_bbox_total_length__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./util/get-path-bbox-total-length */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-bbox-total-length.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getPathBBoxTotalLength\", function() { return _util_get_path_bbox_total_length__WEBPACK_IMPORTED_MODULE_9__[\"getPathBBoxTotalLength\"]; });\n\n/* harmony import */ var _util_get_rotated_curve__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./util/get-rotated-curve */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-rotated-curve.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getRotatedCurve\", function() { return _util_get_rotated_curve__WEBPACK_IMPORTED_MODULE_10__[\"getRotatedCurve\"]; });\n\n/* harmony import */ var _util_get_path_area__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./util/get-path-area */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-area.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getPathArea\", function() { return _util_get_path_area__WEBPACK_IMPORTED_MODULE_11__[\"getPathArea\"]; });\n\n/* harmony import */ var _util_get_draw_direction__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./util/get-draw-direction */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-draw-direction.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getDrawDirection\", function() { return _util_get_draw_direction__WEBPACK_IMPORTED_MODULE_12__[\"getDrawDirection\"]; });\n\n/* harmony import */ var _util_get_point_at_length__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./util/get-point-at-length */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-point-at-length.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getPointAtLength\", function() { return _util_get_point_at_length__WEBPACK_IMPORTED_MODULE_13__[\"getPointAtLength\"]; });\n\n/* harmony import */ var _util_is_point_in_stroke__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./util/is-point-in-stroke */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-point-in-stroke.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPointInStroke\", function() { return _util_is_point_in_stroke__WEBPACK_IMPORTED_MODULE_14__[\"isPointInStroke\"]; });\n\n/* harmony import */ var _util_distance_square_root__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./util/distance-square-root */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"distanceSquareRoot\", function() { return _util_distance_square_root__WEBPACK_IMPORTED_MODULE_15__[\"distanceSquareRoot\"]; });\n\n/* harmony import */ var _util_equalize_segments__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./util/equalize-segments */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/equalize-segments.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"equalizeSegments\", function() { return _util_equalize_segments__WEBPACK_IMPORTED_MODULE_16__[\"equalizeSegments\"]; });\n\n/* harmony import */ var _types__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./types */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/types.js\");\n/* empty/unused harmony star reexport */\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/index.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/parse-path-array.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/parse-path-array.js ***! - \**************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/finalize-segment.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/finalize-segment.js ***! + \***********************************************************************************************/ +/*! exports provided: finalizeSegment */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return parsePathArray; });\nvar p2s = /,?([a-z]),?/gi;\nfunction parsePathArray(path) {\n return path.join(',').replace(p2s, '$1');\n}\n//# sourceMappingURL=parse-path-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/parse-path-array.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"finalizeSegment\", function() { return finalizeSegment; });\n/* harmony import */ var _params_count__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./params-count */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-count.js\");\n\n/**\n * Breaks the parsing of a pathString once a segment is finalized.\n */\nfunction finalizeSegment(path) {\n var pathCommand = path.pathValue[path.segmentStart];\n var LK = pathCommand.toLowerCase();\n var data = path.data;\n while (data.length >= _params_count__WEBPACK_IMPORTED_MODULE_0__[\"paramsCount\"][LK]) {\n // overloaded `moveTo`\n // https://github.com/rveciana/svg-path-properties/blob/master/src/parse.ts\n if (LK === 'm' && data.length > 2) {\n // @ts-ignore\n path.segments.push([pathCommand].concat(data.splice(0, 2)));\n LK = 'l';\n pathCommand = pathCommand === 'm' ? 'l' : 'L';\n }\n else {\n // @ts-ignore\n path.segments.push([pathCommand].concat(data.splice(0, _params_count__WEBPACK_IMPORTED_MODULE_0__[\"paramsCount\"][LK])));\n }\n if (!_params_count__WEBPACK_IMPORTED_MODULE_0__[\"paramsCount\"][LK]) {\n break;\n }\n }\n}\n//# sourceMappingURL=finalize-segment.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/finalize-segment.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/parse-path-string.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/parse-path-string.js ***! - \***************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-arc-command.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-arc-command.js ***! + \*********************************************************************************************/ +/*! exports provided: isArcCommand */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return parsePathString; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar SPACES = '\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029';\nvar PATH_COMMAND = new RegExp('([a-z])[' + SPACES + ',]*((-?\\\\d*\\\\.?\\\\d*(?:e[\\\\-+]?\\\\d+)?[' + SPACES + ']*,?[' + SPACES + ']*)+)', 'ig');\nvar PATH_VALUES = new RegExp('(-?\\\\d*\\\\.?\\\\d*(?:e[\\\\-+]?\\\\d+)?)[' + SPACES + ']*,?[' + SPACES + ']*', 'ig');\n// Parses given path string into an array of arrays of path segments\nfunction parsePathString(pathString) {\n if (!pathString) {\n return null;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(pathString)) {\n return pathString;\n }\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n u: 3,\n z: 0,\n };\n var data = [];\n String(pathString).replace(PATH_COMMAND, function (a, b, c) {\n var params = [];\n var name = b.toLowerCase();\n c.replace(PATH_VALUES, function (a, b) {\n b && params.push(+b);\n });\n if (name === 'm' && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = 'l';\n b = b === 'm' ? 'l' : 'L';\n }\n if (name === 'o' && params.length === 1) {\n data.push([b, params[0]]);\n }\n if (name === 'r') {\n data.push([b].concat(params));\n }\n else {\n while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n if (!paramCounts[name]) {\n break;\n }\n }\n }\n return '';\n });\n return data;\n}\n//# sourceMappingURL=parse-path-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/parse-path-string.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isArcCommand\", function() { return isArcCommand; });\n/**\n * Checks if the character is an A (arc-to) path command.\n */\nfunction isArcCommand(code) {\n return (code | 0x20) === 0x61;\n}\n//# sourceMappingURL=is-arc-command.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-arc-command.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/parse-path.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/parse-path.js ***! - \********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-digit-start.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-digit-start.js ***! + \*********************************************************************************************/ +/*! exports provided: isDigitStart, isDigit */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar regexTags = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig;\nvar regexDot = /[^\\s\\,]+/ig;\nfunction parsePath(p) {\n var path = p || [];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(path)) {\n return path;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(path)) {\n path = path.match(regexTags);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(path, function (item, index) {\n // @ts-ignore\n item = item.match(regexDot);\n if (item[0].length > 1) {\n var tag = item[0].charAt(0);\n // @ts-ignore\n item.splice(1, 0, item[0].substr(1));\n // @ts-ignore\n item[0] = tag;\n }\n // @ts-ignore\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(item, function (sub, i) {\n if (!isNaN(sub)) {\n // @ts-ignore\n item[i] = +sub;\n }\n });\n // @ts-ignore\n path[index] = item;\n });\n return path;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (parsePath);\n//# sourceMappingURL=parse-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/parse-path.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isDigitStart\", function() { return isDigitStart; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isDigit\", function() { return isDigit; });\n/**\n * Checks if the character is or belongs to a number.\n * [0-9]|+|-|.\n */\nfunction isDigitStart(code) {\n return ((code >= 48 && code <= 57) /* 0..9 */ || code === 0x2b /* + */ || code === 0x2d /* - */ || code === 0x2e); /* . */\n}\nfunction isDigit(code) {\n return code >= 48 && code <= 57; // 0..9\n}\n//# sourceMappingURL=is-digit-start.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-digit-start.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/path-2-absolute.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/path-2-absolute.js ***! - \*************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-path-command.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-path-command.js ***! + \**********************************************************************************************/ +/*! exports provided: isPathCommand */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pathToAbsolute; });\n/* harmony import */ var _parse_path_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse-path-string */ \"./node_modules/@antv/path-util/esm/parse-path-string.js\");\n\nvar REGEX_MD = /[a-z]/;\nfunction toSymmetry(p, c) {\n return [\n c[0] + (c[0] - p[0]),\n c[1] + (c[1] - p[1]),\n ];\n}\nfunction pathToAbsolute(pathString) {\n var pathArray = Object(_parse_path_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(pathString);\n if (!pathArray || !pathArray.length) {\n return [\n ['M', 0, 0],\n ];\n }\n var needProcess = false; // 如果存在小写的命令或者 V,H,T,S 则需要处理\n for (var i = 0; i < pathArray.length; i++) {\n var cmd = pathArray[i][0];\n // 如果存在相对位置的命令,则中断返回\n if (REGEX_MD.test(cmd) || ['V', 'H', 'T', 'S'].indexOf(cmd) >= 0) {\n needProcess = true;\n break;\n }\n }\n // 如果不存在相对命令,则直接返回\n // 如果在业务上都写绝对路径,这种方式最快,仅做了一次检测\n if (!needProcess) {\n return pathArray;\n }\n var res = [];\n var x = 0;\n var y = 0;\n var mx = 0;\n var my = 0;\n var start = 0;\n var pa0;\n var dots;\n var first = pathArray[0];\n if (first[0] === 'M' || first[0] === 'm') {\n x = +first[1];\n y = +first[2];\n mx = x;\n my = y;\n start++;\n res[0] = ['M', x, y];\n }\n for (var i = start, ii = pathArray.length; i < ii; i++) {\n var pa = pathArray[i];\n var preParams = res[i - 1]; // 取前一个已经处理后的节点,否则会出现问题\n var r = [];\n var cmd = pa[0];\n var upCmd = cmd.toUpperCase();\n if (cmd !== upCmd) {\n r[0] = upCmd;\n switch (upCmd) {\n case 'A':\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +pa[6] + x;\n r[7] = +pa[7] + y;\n break;\n case 'V':\n r[1] = +pa[1] + y;\n break;\n case 'H':\n r[1] = +pa[1] + x;\n break;\n case 'M':\n mx = +pa[1] + x;\n my = +pa[2] + y;\n r[1] = mx;\n r[2] = my;\n break; // for lint\n default:\n for (var j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +pa[j] + ((j % 2) ? x : y);\n }\n }\n }\n else { // 如果本来已经大写,则不处理\n r = pathArray[i];\n }\n // 需要在外面统一做,同时处理 V,H,S,T 等特殊指令\n switch (upCmd) {\n case 'Z':\n x = +mx;\n y = +my;\n break;\n case 'H':\n x = r[1];\n r = ['L', x, y];\n break;\n case 'V':\n y = r[1];\n r = ['L', x, y];\n break;\n case 'T':\n x = r[1];\n y = r[2];\n // 以 x, y 为中心的,上一个控制点的对称点\n // 需要假设上一个节点的命令为 Q\n var symetricT = toSymmetry([preParams[1], preParams[2]], [preParams[3], preParams[4]]);\n r = ['Q', symetricT[0], symetricT[1], x, y];\n break;\n case 'S':\n x = r[r.length - 2];\n y = r[r.length - 1];\n // 以 x,y 为中心,取上一个控制点,\n // 需要假设上一个线段为 C 或者 S\n var length_1 = preParams.length;\n var symetricS = toSymmetry([preParams[length_1 - 4], preParams[length_1 - 3]], [preParams[length_1 - 2], preParams[length_1 - 1]]);\n r = ['C', symetricS[0], symetricS[1], r[1], r[2], x, y];\n break;\n case 'M':\n mx = r[r.length - 2];\n my = r[r.length - 1];\n break; // for lint\n default:\n x = r[r.length - 2];\n y = r[r.length - 1];\n }\n res.push(r);\n }\n return res;\n}\n//# sourceMappingURL=path-2-absolute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/path-2-absolute.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPathCommand\", function() { return isPathCommand; });\n/**\n * Checks if the character is a path command.\n */\nfunction isPathCommand(code) {\n // eslint-disable-next-line no-bitwise -- Impossible to satisfy\n switch (code | 0x20) {\n case 0x6d /* m */:\n case 0x7a /* z */:\n case 0x6c /* l */:\n case 0x68 /* h */:\n case 0x76 /* v */:\n case 0x63 /* c */:\n case 0x73 /* s */:\n case 0x71 /* q */:\n case 0x74 /* t */:\n case 0x61 /* a */:\n // case 0x72/* r */:\n return true;\n default:\n return false;\n }\n}\n//# sourceMappingURL=is-path-command.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-path-command.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/path-2-curve.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/path-2-curve.js ***! - \**********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-space.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-space.js ***! + \***************************************************************************************/ +/*! exports provided: isSpace */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pathToCurve; });\n/* harmony import */ var _path_2_absolute__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path-2-absolute */ \"./node_modules/@antv/path-util/esm/path-2-absolute.js\");\n/* harmony import */ var _process_segment_2_cubic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./process/segment-2-cubic */ \"./node_modules/@antv/path-util/esm/process/segment-2-cubic.js\");\n\n\nfunction pathToCurve(path, needZCommandIndexes) {\n if (needZCommandIndexes === void 0) { needZCommandIndexes = false; }\n var pathArray = Object(_path_2_absolute__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(path);\n var params = {\n x1: 0, y1: 0, x2: 0, y2: 0, x: 0, y: 0, qx: null, qy: null,\n };\n var allPathCommands = [];\n var pathCommand = '';\n var ii = pathArray.length;\n var segment;\n var seglen;\n var zCommandIndexes = [];\n for (var i = 0; i < ii; i += 1) {\n if (pathArray[i])\n pathCommand = pathArray[i][0];\n allPathCommands[i] = pathCommand;\n pathArray[i] = Object(_process_segment_2_cubic__WEBPACK_IMPORTED_MODULE_1__[\"segmentToCubic\"])(pathArray[i], params);\n fixArc(pathArray, allPathCommands, i);\n ii = pathArray.length; // solves curveArrays ending in Z\n // keep Z command account for lineJoin\n // @see https://github.com/antvis/util/issues/68\n if (pathCommand === 'Z') {\n zCommandIndexes.push(i);\n }\n segment = pathArray[i];\n seglen = segment.length;\n params.x1 = +segment[seglen - 2];\n params.y1 = +segment[seglen - 1];\n params.x2 = +(segment[seglen - 4]) || params.x1;\n params.y2 = +(segment[seglen - 3]) || params.y1;\n }\n if (needZCommandIndexes) {\n return [pathArray, zCommandIndexes];\n }\n else {\n return pathArray;\n }\n}\nfunction fixArc(pathArray, allPathCommands, i) {\n if (pathArray[i].length > 7) {\n pathArray[i].shift();\n var pi = pathArray[i];\n // const ni = i + 1;\n var ni = i;\n while (pi.length) {\n // if created multiple C:s, their original seg is saved\n allPathCommands[i] = 'A';\n // @ts-ignore\n pathArray.splice(ni += 1, 0, ['C'].concat(pi.splice(0, 6)));\n }\n pathArray.splice(i, 1);\n }\n}\n//# sourceMappingURL=path-2-curve.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/path-2-curve.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSpace\", function() { return isSpace; });\n/**\n * Checks if the character is a space.\n */\nfunction isSpace(ch) {\n var specialSpaces = [\n 0x1680, 0x180e, 0x2000, 0x2001, 0x2002, 0x2003, 0x2004, 0x2005, 0x2006, 0x2007, 0x2008, 0x2009, 0x200a, 0x202f,\n 0x205f, 0x3000, 0xfeff,\n ];\n /* istanbul ignore next */\n return (ch === 0x0a ||\n ch === 0x0d ||\n ch === 0x2028 ||\n ch === 0x2029 || // Line terminators\n // White spaces\n ch === 0x20 ||\n ch === 0x09 ||\n ch === 0x0b ||\n ch === 0x0c ||\n ch === 0xa0 ||\n (ch >= 0x1680 && specialSpaces.includes(ch)));\n}\n//# sourceMappingURL=is-space.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-space.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/path-2-segments.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/path-2-segments.js ***! - \*************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-count.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-count.js ***! + \*******************************************************************************************/ +/*! exports provided: paramsCount */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getSegments; });\n/* harmony import */ var _get_arc_params__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-arc-params */ \"./node_modules/@antv/path-util/esm/get-arc-params.js\");\n/* harmony import */ var _parse_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse-path */ \"./node_modules/@antv/path-util/esm/parse-path.js\");\n\n\n\n// 点对称\nfunction toSymmetry(point, center) {\n return [center[0] + (center[0] - point[0]), center[1] + (center[1] - point[1])];\n}\nfunction getSegments(path) {\n path = Object(_parse_path__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(path);\n var segments = [];\n var currentPoint = null; // 当前图形\n var nextParams = null; // 下一节点的 path 参数\n var startMovePoint = null; // 开始 M 的点,可能会有多个\n var lastStartMovePointIndex = 0; // 最近一个开始点 M 的索引\n var count = path.length;\n for (var i = 0; i < count; i++) {\n var params = path[i];\n nextParams = path[i + 1];\n var command = params[0];\n // 数学定义上的参数,便于后面的计算\n var segment = {\n command: command,\n prePoint: currentPoint,\n params: params,\n startTangent: null,\n endTangent: null,\n };\n switch (command) {\n case 'M':\n startMovePoint = [params[1], params[2]];\n lastStartMovePointIndex = i;\n break;\n case 'A':\n var arcParams = Object(_get_arc_params__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(currentPoint, params);\n segment['arcParams'] = arcParams;\n break;\n default:\n break;\n }\n if (command === 'Z') {\n // 有了 Z 后,当前节点从开始 M 的点开始\n currentPoint = startMovePoint;\n // 如果当前点的命令为 Z,相当于当前点为最近一个 M 点,则下一个点直接指向最近一个 M 点的下一个点\n nextParams = path[lastStartMovePointIndex + 1];\n }\n else {\n var len = params.length;\n currentPoint = [params[len - 2], params[len - 1]];\n }\n if (nextParams && nextParams[0] === 'Z') {\n // 如果下一个点的命令为 Z,则下一个点直接指向最近一个 M 点\n nextParams = path[lastStartMovePointIndex];\n if (segments[lastStartMovePointIndex]) {\n // 如果下一个点的命令为 Z,则最近一个 M 点的前一个点为当前点\n segments[lastStartMovePointIndex].prePoint = currentPoint;\n }\n }\n segment['currentPoint'] = currentPoint;\n // 如果当前点与最近一个 M 点相同,则最近一个 M 点的前一个点为当前点的前一个点\n if (segments[lastStartMovePointIndex] &&\n Object(_get_arc_params__WEBPACK_IMPORTED_MODULE_0__[\"isSamePoint\"])(currentPoint, segments[lastStartMovePointIndex].currentPoint)) {\n segments[lastStartMovePointIndex].prePoint = segment.prePoint;\n }\n var nextPoint = nextParams ? [nextParams[nextParams.length - 2], nextParams[nextParams.length - 1]] : null;\n segment['nextPoint'] = nextPoint;\n // Add startTangent and endTangent\n var prePoint = segment.prePoint;\n if (['L', 'H', 'V'].includes(command)) {\n segment.startTangent = [prePoint[0] - currentPoint[0], prePoint[1] - currentPoint[1]];\n segment.endTangent = [currentPoint[0] - prePoint[0], currentPoint[1] - prePoint[1]];\n }\n else if (command === 'Q') {\n // 二次贝塞尔曲线只有一个控制点\n var cp = [params[1], params[2]];\n // 二次贝塞尔曲线的终点为 currentPoint\n segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];\n segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];\n }\n else if (command === 'T') {\n var preSegment = segments[i - 1];\n var cp = toSymmetry(preSegment.currentPoint, prePoint);\n if (preSegment.command === 'Q') {\n segment.command = 'Q';\n segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];\n segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];\n }\n else {\n segment.command = 'TL';\n segment.startTangent = [prePoint[0] - currentPoint[0], prePoint[1] - currentPoint[1]];\n segment.endTangent = [currentPoint[0] - prePoint[0], currentPoint[1] - prePoint[1]];\n }\n }\n else if (command === 'C') {\n // 三次贝塞尔曲线有两个控制点\n var cp1 = [params[1], params[2]];\n var cp2 = [params[3], params[4]];\n segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];\n segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];\n // horizontal line, eg. ['C', 100, 100, 100, 100, 200, 200]\n if (segment.startTangent[0] === 0 && segment.startTangent[1] === 0) {\n segment.startTangent = [cp1[0] - cp2[0], cp1[1] - cp2[1]];\n }\n if (segment.endTangent[0] === 0 && segment.endTangent[1] === 0) {\n segment.endTangent = [cp2[0] - cp1[0], cp2[1] - cp1[1]];\n }\n }\n else if (command === 'S') {\n var preSegment = segments[i - 1];\n var cp1 = toSymmetry(preSegment.currentPoint, prePoint);\n var cp2 = [params[1], params[2]];\n if (preSegment.command === 'C') {\n segment.command = 'C'; // 将 S 命令变换为 C 命令\n segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];\n segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];\n }\n else {\n segment.command = 'SQ'; // 将 S 命令变换为 SQ 命令\n segment.startTangent = [prePoint[0] - cp2[0], prePoint[1] - cp2[1]];\n segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];\n }\n }\n else if (command === 'A') {\n var d = 0.001;\n var _a = segment['arcParams'] || {}, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, _d = _a.rx, rx = _d === void 0 ? 0 : _d, _e = _a.ry, ry = _e === void 0 ? 0 : _e, _f = _a.sweepFlag, sweepFlag = _f === void 0 ? 0 : _f, _g = _a.startAngle, startAngle = _g === void 0 ? 0 : _g, _h = _a.endAngle, endAngle = _h === void 0 ? 0 : _h;\n if (sweepFlag === 0) {\n d *= -1;\n }\n var dx1 = rx * Math.cos(startAngle - d) + cx;\n var dy1 = ry * Math.sin(startAngle - d) + cy;\n segment.startTangent = [dx1 - startMovePoint[0], dy1 - startMovePoint[1]];\n var dx2 = rx * Math.cos(startAngle + endAngle + d) + cx;\n var dy2 = ry * Math.sin(startAngle + endAngle - d) + cy;\n segment.endTangent = [prePoint[0] - dx2, prePoint[1] - dy2];\n }\n segments.push(segment);\n }\n return segments;\n}\n//# sourceMappingURL=path-2-segments.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/path-2-segments.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"paramsCount\", function() { return paramsCount; });\nvar paramsCount = {\n a: 7,\n c: 6,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n z: 0,\n};\n//# sourceMappingURL=params-count.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-count.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/path-intersection.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/path-intersection.js ***! - \***************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-parser.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-parser.js ***! + \********************************************************************************************/ +/*! exports provided: paramsParser */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pathIntersection; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _rect_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect-path */ \"./node_modules/@antv/path-util/esm/rect-path.js\");\n/* harmony import */ var _path_2_curve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./path-2-curve */ \"./node_modules/@antv/path-util/esm/path-2-curve.js\");\n\n\n\nvar base3 = function (t, p1, p2, p3, p4) {\n var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4;\n var t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;\n return t * t2 - 3 * p1 + 3 * p2;\n};\nvar bezlen = function (x1, y1, x2, y2, x3, y3, x4, y4, z) {\n if (z === null) {\n z = 1;\n }\n z = z > 1 ? 1 : z < 0 ? 0 : z;\n var z2 = z / 2;\n var n = 12;\n var Tvalues = [-0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699, -0.9041, 0.9041, -0.9816, 0.9816];\n var Cvalues = [0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472];\n var sum = 0;\n for (var i = 0; i < n; i++) {\n var ct = z2 * Tvalues[i] + z2;\n var xbase = base3(ct, x1, x2, x3, x4);\n var ybase = base3(ct, y1, y2, y3, y4);\n var comb = xbase * xbase + ybase * ybase;\n sum += Cvalues[i] * Math.sqrt(comb);\n }\n return z2 * sum;\n};\nvar curveDim = function (x0, y0, x1, y1, x2, y2, x3, y3) {\n var tvalues = [];\n var bounds = [\n [],\n [],\n ];\n var a;\n var b;\n var c;\n var t;\n for (var i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n }\n else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (t > 0 && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n var b2ac = b * b - 4 * c * a;\n var sqrtb2ac = Math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n var t1 = (-b + sqrtb2ac) / (2 * a);\n if (t1 > 0 && t1 < 1) {\n tvalues.push(t1);\n }\n var t2 = (-b - sqrtb2ac) / (2 * a);\n if (t2 > 0 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n var j = tvalues.length;\n var jlen = j;\n var mt;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);\n bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);\n }\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n return {\n min: {\n x: Math.min.apply(0, bounds[0]),\n y: Math.min.apply(0, bounds[1]),\n },\n max: {\n x: Math.max.apply(0, bounds[0]),\n y: Math.max.apply(0, bounds[1]),\n },\n };\n};\nvar intersect = function (x1, y1, x2, y2, x3, y3, x4, y4) {\n if (Math.max(x1, x2) < Math.min(x3, x4) ||\n Math.min(x1, x2) > Math.max(x3, x4) ||\n Math.max(y1, y2) < Math.min(y3, y4) ||\n Math.min(y1, y2) > Math.max(y3, y4)) {\n return;\n }\n var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4);\n var ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4);\n var denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n if (!denominator) {\n return;\n }\n var px = nx / denominator;\n var py = ny / denominator;\n var px2 = +px.toFixed(2);\n var py2 = +py.toFixed(2);\n if (px2 < +Math.min(x1, x2).toFixed(2) ||\n px2 > +Math.max(x1, x2).toFixed(2) ||\n px2 < +Math.min(x3, x4).toFixed(2) ||\n px2 > +Math.max(x3, x4).toFixed(2) ||\n py2 < +Math.min(y1, y2).toFixed(2) ||\n py2 > +Math.max(y1, y2).toFixed(2) ||\n py2 < +Math.min(y3, y4).toFixed(2) ||\n py2 > +Math.max(y3, y4).toFixed(2)) {\n return;\n }\n return {\n x: px,\n y: py,\n };\n};\nvar isPointInsideBBox = function (bbox, x, y) {\n return x >= bbox.x &&\n x <= bbox.x + bbox.width &&\n y >= bbox.y &&\n y <= bbox.y + bbox.height;\n};\nvar box = function (x, y, width, height) {\n if (x === null) {\n x = y = width = height = 0;\n }\n if (y === null) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n return {\n x: x,\n y: y,\n width: width,\n w: width,\n height: height,\n h: height,\n x2: x + width,\n y2: y + height,\n cx: x + width / 2,\n cy: y + height / 2,\n r1: Math.min(width, height) / 2,\n r2: Math.max(width, height) / 2,\n r0: Math.sqrt(width * width + height * height) / 2,\n path: Object(_rect_path__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(x, y, width, height),\n vb: [x, y, width, height].join(' '),\n };\n};\nvar isBBoxIntersect = function (bbox1, bbox2) {\n // @ts-ignore\n bbox1 = box(bbox1);\n // @ts-ignore\n bbox2 = box(bbox2);\n return isPointInsideBBox(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);\n};\nvar bezierBBox = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(p1x)) {\n p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];\n }\n var bbox = curveDim.apply(null, p1x);\n return box(bbox.min.x, bbox.min.y, bbox.max.x - bbox.min.x, bbox.max.y - bbox.min.y);\n};\nvar findDotsAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t;\n var t13 = Math.pow(t1, 3);\n var t12 = Math.pow(t1, 2);\n var t2 = t * t;\n var t3 = t2 * t;\n var x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x;\n var y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y;\n var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x);\n var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y);\n var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x);\n var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y);\n var ax = t1 * p1x + t * c1x;\n var ay = t1 * p1y + t * c1y;\n var cx = t1 * c2x + t * p2x;\n var cy = t1 * c2y + t * p2y;\n var alpha = (90 - Math.atan2(mx - nx, my - ny) * 180 / Math.PI);\n // (mx > nx || my < ny) && (alpha += 180);\n return {\n x: x,\n y: y,\n m: {\n x: mx,\n y: my,\n },\n n: {\n x: nx,\n y: ny,\n },\n start: {\n x: ax,\n y: ay,\n },\n end: {\n x: cx,\n y: cy,\n },\n alpha: alpha,\n };\n};\nvar interHelper = function (bez1, bez2, justCount) {\n // @ts-ignore\n var bbox1 = bezierBBox(bez1);\n // @ts-ignore\n var bbox2 = bezierBBox(bez2);\n if (!isBBoxIntersect(bbox1, bbox2)) {\n return justCount ? 0 : [];\n }\n var l1 = bezlen.apply(0, bez1);\n var l2 = bezlen.apply(0, bez2);\n var n1 = ~~(l1 / 8);\n var n2 = ~~(l2 / 8);\n var dots1 = [];\n var dots2 = [];\n var xy = {};\n var res = justCount ? 0 : [];\n for (var i = 0; i < n1 + 1; i++) {\n var d = findDotsAtSegment.apply(0, bez1.concat(i / n1));\n dots1.push({\n x: d.x,\n y: d.y,\n t: i / n1,\n });\n }\n for (var i = 0; i < n2 + 1; i++) {\n var d = findDotsAtSegment.apply(0, bez2.concat(i / n2));\n dots2.push({\n x: d.x,\n y: d.y,\n t: i / n2,\n });\n }\n for (var i = 0; i < n1; i++) {\n for (var j = 0; j < n2; j++) {\n var di = dots1[i];\n var di1 = dots1[i + 1];\n var dj = dots2[j];\n var dj1 = dots2[j + 1];\n var ci = Math.abs(di1.x - di.x) < 0.001 ? 'y' : 'x';\n var cj = Math.abs(dj1.x - dj.x) < 0.001 ? 'y' : 'x';\n var is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);\n if (is) {\n if (xy[is.x.toFixed(4)] === is.y.toFixed(4)) {\n continue;\n }\n xy[is.x.toFixed(4)] = is.y.toFixed(4);\n var t1 = di.t + Math.abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t);\n var t2 = dj.t + Math.abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);\n if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {\n if (justCount) {\n // @ts-ignore\n res++;\n }\n else {\n // @ts-ignore\n res.push({\n x: is.x,\n y: is.y,\n t1: t1,\n t2: t2,\n });\n }\n }\n }\n }\n }\n return res;\n};\nvar interPathHelper = function (path1, path2, justCount) {\n // @ts-ignore\n path1 = Object(_path_2_curve__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(path1);\n // @ts-ignore\n path2 = Object(_path_2_curve__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(path2);\n var x1;\n var y1;\n var x2;\n var y2;\n var x1m;\n var y1m;\n var x2m;\n var y2m;\n var bez1;\n var bez2;\n var res = justCount ? 0 : [];\n for (var i = 0, ii = path1.length; i < ii; i++) {\n var pi = path1[i];\n if (pi[0] === 'M') {\n x1 = x1m = pi[1];\n y1 = y1m = pi[2];\n }\n else {\n if (pi[0] === 'C') {\n bez1 = [x1, y1].concat(pi.slice(1));\n x1 = bez1[6];\n y1 = bez1[7];\n }\n else {\n bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];\n x1 = x1m;\n y1 = y1m;\n }\n for (var j = 0, jj = path2.length; j < jj; j++) {\n var pj = path2[j];\n if (pj[0] === 'M') {\n x2 = x2m = pj[1];\n y2 = y2m = pj[2];\n }\n else {\n if (pj[0] === 'C') {\n bez2 = [x2, y2].concat(pj.slice(1));\n x2 = bez2[6];\n y2 = bez2[7];\n }\n else {\n bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];\n x2 = x2m;\n y2 = y2m;\n }\n var intr = interHelper(bez1, bez2, justCount);\n if (justCount) {\n // @ts-ignore\n res += intr;\n }\n else {\n // @ts-ignore\n for (var k = 0, kk = intr.length; k < kk; k++) {\n intr[k].segment1 = i;\n intr[k].segment2 = j;\n intr[k].bez1 = bez1;\n intr[k].bez2 = bez2;\n }\n // @ts-ignore\n res = res.concat(intr);\n }\n }\n }\n }\n }\n return res;\n};\nfunction pathIntersection(path1, path2) {\n // @ts-ignore\n return interPathHelper(path1, path2);\n}\n//# sourceMappingURL=path-intersection.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/path-intersection.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"paramsParser\", function() { return paramsParser; });\nvar paramsParser = {\n x1: 0,\n y1: 0,\n x2: 0,\n y2: 0,\n x: 0,\n y: 0,\n qx: null,\n qy: null,\n};\n//# sourceMappingURL=params-parser.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-parser.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/point-in-polygon.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/point-in-polygon.js ***! - \**************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/parse-path-string.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/parse-path-string.js ***! + \************************************************************************************************/ +/*! exports provided: parsePathString */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isInPolygon; });\n/**\n * @fileoverview 判断点是否在多边形内\n * @author dxq613@gmail.com\n */\n// 多边形的射线检测,参考:https://blog.csdn.net/WilliamSun0122/article/details/77994526\nvar tolerance = 1e-6;\n// 三态函数,判断两个double在eps精度下的大小关系\nfunction dcmp(x) {\n if (Math.abs(x) < tolerance) {\n return 0;\n }\n return x < 0 ? -1 : 1;\n}\n// 判断点Q是否在p1和p2的线段上\nfunction onSegment(p1, p2, q) {\n if ((q[0] - p1[0]) * (p2[1] - p1[1]) === (p2[0] - p1[0]) * (q[1] - p1[1]) &&\n Math.min(p1[0], p2[0]) <= q[0] &&\n q[0] <= Math.max(p1[0], p2[0]) &&\n Math.min(p1[1], p2[1]) <= q[1] &&\n q[1] <= Math.max(p1[1], p2[1])) {\n return true;\n }\n return false;\n}\n// 判断点P在多边形内-射线法\nfunction isInPolygon(points, x, y) {\n var isHit = false;\n var n = points.length;\n if (n <= 2) {\n // svg 中点小于 3 个时,不显示,也无法被拾取\n return false;\n }\n for (var i = 0; i < n; i++) {\n var p1 = points[i];\n var p2 = points[(i + 1) % n];\n if (onSegment(p1, p2, [x, y])) {\n // 点在多边形一条边上\n return true;\n }\n // 前一个判断min(p1[1],p2[1]) 0 !== dcmp(p2[1] - y) > 0 &&\n dcmp(x - ((y - p1[1]) * (p1[0] - p2[0])) / (p1[1] - p2[1]) - p1[0]) < 0) {\n isHit = !isHit;\n }\n }\n return isHit;\n}\n//# sourceMappingURL=point-in-polygon.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/point-in-polygon.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parsePathString\", function() { return parsePathString; });\n/* harmony import */ var _util_is_path_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/is-path-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-path-array.js\");\n/* harmony import */ var _scan_segment__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./scan-segment */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-segment.js\");\n/* harmony import */ var _skip_spaces__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./skip-spaces */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/skip-spaces.js\");\n/* harmony import */ var _path_parser__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./path-parser */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/path-parser.js\");\n\n\n\n\n/**\n * Parses a path string value and returns an array\n * of segments we like to call `pathArray`.\n */\nfunction parsePathString(pathInput) {\n if (Object(_util_is_path_array__WEBPACK_IMPORTED_MODULE_0__[\"isPathArray\"])(pathInput)) {\n return [].concat(pathInput);\n }\n var path = new _path_parser__WEBPACK_IMPORTED_MODULE_3__[\"PathParser\"](pathInput);\n Object(_skip_spaces__WEBPACK_IMPORTED_MODULE_2__[\"skipSpaces\"])(path);\n while (path.index < path.max && !path.err.length) {\n Object(_scan_segment__WEBPACK_IMPORTED_MODULE_1__[\"scanSegment\"])(path);\n }\n return path.err ? path.err : path.segments;\n}\n//# sourceMappingURL=parse-path-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/parse-path-string.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/process/arc-2-cubic.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/process/arc-2-cubic.js ***! - \*****************************************************************/ -/*! exports provided: arcToCubic */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/path-parser.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/path-parser.js ***! + \******************************************************************************************/ +/*! exports provided: PathParser */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arcToCubic\", function() { return arcToCubic; });\nvar TAU = Math.PI * 2;\nvar mapToEllipse = function (_a, rx, ry, cosphi, sinphi, centerx, centery) {\n var x = _a.x, y = _a.y;\n x *= rx;\n y *= ry;\n var xp = cosphi * x - sinphi * y;\n var yp = sinphi * x + cosphi * y;\n return {\n x: xp + centerx,\n y: yp + centery\n };\n};\nvar approxUnitArc = function (ang1, ang2) {\n // If 90 degree circular arc, use a constant\n // as derived from http://spencermortensen.com/articles/bezier-circle\n var a = ang2 === 1.5707963267948966\n ? 0.551915024494\n : ang2 === -1.5707963267948966\n ? -0.551915024494\n : 4 / 3 * Math.tan(ang2 / 4);\n var x1 = Math.cos(ang1);\n var y1 = Math.sin(ang1);\n var x2 = Math.cos(ang1 + ang2);\n var y2 = Math.sin(ang1 + ang2);\n return [\n {\n x: x1 - y1 * a,\n y: y1 + x1 * a\n },\n {\n x: x2 + y2 * a,\n y: y2 - x2 * a\n },\n {\n x: x2,\n y: y2\n }\n ];\n};\nvar vectorAngle = function (ux, uy, vx, vy) {\n var sign = (ux * vy - uy * vx < 0) ? -1 : 1;\n var dot = ux * vx + uy * vy;\n if (dot > 1) {\n dot = 1;\n }\n if (dot < -1) {\n dot = -1;\n }\n return sign * Math.acos(dot);\n};\nvar getArcCenter = function (px, py, cx, cy, rx, ry, largeArcFlag, sweepFlag, sinphi, cosphi, pxp, pyp) {\n var rxsq = Math.pow(rx, 2);\n var rysq = Math.pow(ry, 2);\n var pxpsq = Math.pow(pxp, 2);\n var pypsq = Math.pow(pyp, 2);\n var radicant = (rxsq * rysq) - (rxsq * pypsq) - (rysq * pxpsq);\n if (radicant < 0) {\n radicant = 0;\n }\n radicant /= (rxsq * pypsq) + (rysq * pxpsq);\n radicant = Math.sqrt(radicant) * (largeArcFlag === sweepFlag ? -1 : 1);\n var centerxp = radicant * rx / ry * pyp;\n var centeryp = radicant * -ry / rx * pxp;\n var centerx = cosphi * centerxp - sinphi * centeryp + (px + cx) / 2;\n var centery = sinphi * centerxp + cosphi * centeryp + (py + cy) / 2;\n var vx1 = (pxp - centerxp) / rx;\n var vy1 = (pyp - centeryp) / ry;\n var vx2 = (-pxp - centerxp) / rx;\n var vy2 = (-pyp - centeryp) / ry;\n var ang1 = vectorAngle(1, 0, vx1, vy1);\n var ang2 = vectorAngle(vx1, vy1, vx2, vy2);\n if (sweepFlag === 0 && ang2 > 0) {\n ang2 -= TAU;\n }\n if (sweepFlag === 1 && ang2 < 0) {\n ang2 += TAU;\n }\n return [centerx, centery, ang1, ang2];\n};\nvar arcToBezier = function (_a) {\n var px = _a.px, py = _a.py, cx = _a.cx, cy = _a.cy, rx = _a.rx, ry = _a.ry, _b = _a.xAxisRotation, xAxisRotation = _b === void 0 ? 0 : _b, _c = _a.largeArcFlag, largeArcFlag = _c === void 0 ? 0 : _c, _d = _a.sweepFlag, sweepFlag = _d === void 0 ? 0 : _d;\n var curves = [];\n if (rx === 0 || ry === 0) {\n return [{ x1: 0, y1: 0, x2: 0, y2: 0, x: cx, y: cy }];\n }\n var sinphi = Math.sin(xAxisRotation * TAU / 360);\n var cosphi = Math.cos(xAxisRotation * TAU / 360);\n var pxp = cosphi * (px - cx) / 2 + sinphi * (py - cy) / 2;\n var pyp = -sinphi * (px - cx) / 2 + cosphi * (py - cy) / 2;\n if (pxp === 0 && pyp === 0) {\n return [{ x1: 0, y1: 0, x2: 0, y2: 0, x: cx, y: cy }];\n }\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n var lambda = Math.pow(pxp, 2) / Math.pow(rx, 2) +\n Math.pow(pyp, 2) / Math.pow(ry, 2);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var _e = getArcCenter(px, py, cx, cy, rx, ry, largeArcFlag, sweepFlag, sinphi, cosphi, pxp, pyp), centerx = _e[0], centery = _e[1], ang1 = _e[2], ang2 = _e[3];\n // If 'ang2' == 90.0000000001, then `ratio` will evaluate to\n // 1.0000000001. This causes `segments` to be greater than one, which is an\n // unecessary split, and adds extra points to the bezier curve. To alleviate\n // this issue, we round to 1.0 when the ratio is close to 1.0.\n var ratio = Math.abs(ang2) / (TAU / 4);\n if (Math.abs(1.0 - ratio) < 0.0000001) {\n ratio = 1.0;\n }\n var segments = Math.max(Math.ceil(ratio), 1);\n ang2 /= segments;\n for (var i = 0; i < segments; i++) {\n curves.push(approxUnitArc(ang1, ang2));\n ang1 += ang2;\n }\n return curves.map(function (curve) {\n var _a = mapToEllipse(curve[0], rx, ry, cosphi, sinphi, centerx, centery), x1 = _a.x, y1 = _a.y;\n var _b = mapToEllipse(curve[1], rx, ry, cosphi, sinphi, centerx, centery), x2 = _b.x, y2 = _b.y;\n var _c = mapToEllipse(curve[2], rx, ry, cosphi, sinphi, centerx, centery), x = _c.x, y = _c.y;\n return { x1: x1, y1: y1, x2: x2, y2: y2, x: x, y: y };\n });\n};\nfunction arcToCubic(x1, y1, rx, ry, angle, LAF, SF, x2, y2) {\n var curves = arcToBezier({\n px: x1,\n py: y1,\n cx: x2,\n cy: y2,\n rx: rx,\n ry: ry,\n xAxisRotation: angle,\n largeArcFlag: LAF,\n sweepFlag: SF,\n });\n return curves.reduce(function (prev, cur) {\n var x1 = cur.x1, y1 = cur.y1, x2 = cur.x2, y2 = cur.y2, x = cur.x, y = cur.y;\n prev.push(x1, y1, x2, y2, x, y);\n return prev;\n }, []);\n}\n//# sourceMappingURL=arc-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/process/arc-2-cubic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"PathParser\", function() { return PathParser; });\n/**\n * The `PathParser` is used by the `parsePathString` static method\n * to generate a `pathArray`.\n */\nvar PathParser = /** @class */ (function () {\n function PathParser(pathString) {\n this.pathValue = pathString;\n // @ts-ignore\n this.segments = [];\n this.max = pathString.length;\n this.index = 0;\n this.param = 0.0;\n this.segmentStart = 0;\n this.data = [];\n this.err = '';\n }\n return PathParser;\n}());\n\n//# sourceMappingURL=path-parser.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/path-parser.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/process/line-2-cubic.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/process/line-2-cubic.js ***! - \******************************************************************/ -/*! exports provided: lineToCubic */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-flag.js": +/*!****************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-flag.js ***! + \****************************************************************************************/ +/*! exports provided: scanFlag */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineToCubic\", function() { return lineToCubic; });\n// export function getPointAtSegLength(p1x: number, p1y: number, c1x: number, c1y: number, c2x: number, c2y: number, p2x: number, p2y: number, t: number) {\n// const t1 = 1 - t;\n// return {\n// x: (t1 ** 3) * p1x\n// + t1 * t1 * 3 * t * c1x\n// + t1 * 3 * t * t * c2x\n// + (t ** 3) * p2x,\n// y: (t1 ** 3) * p1y\n// + t1 * t1 * 3 * t * c1y\n// + t1 * 3 * t * t * c2y\n// + (t ** 3) * p2y,\n// };\n// }\n// export function midPoint(a: number[], b: number[], t: number) {\n// const ax = a[0];\n// const ay = a[1];\n// const bx = b[0];\n// const by = b[1];\n// return [ax + (bx - ax) * t, ay + (by - ay) * t];\n// }\nfunction lineToCubic(x1, y1, x2, y2) {\n return [x1, y1, x2, y2, x2, y2];\n // const t = 0.5;\n // const p0 = [x1, y1];\n // const p1 = [x2, y2];\n // const p2 = midPoint(p0, p1, t);\n // const p3 = midPoint(p1, p2, t);\n // const p4 = midPoint(p2, p3, t);\n // const p5 = midPoint(p3, p4, t);\n // const p6 = midPoint(p4, p5, t);\n // const cp1 = getPointAtSegLength.apply(0, p0.concat(p2, p4, p6, t));\n // const cp2 = getPointAtSegLength.apply(0, p6.concat(p5, p3, p1, 0));\n // return [cp1.x, cp1.y, cp2.x, cp2.y, x2, y2];\n}\n//# sourceMappingURL=line-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/process/line-2-cubic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scanFlag\", function() { return scanFlag; });\n/**\n * Validates an A (arc-to) specific path command value.\n * Usually a `large-arc-flag` or `sweep-flag`.\n */\nfunction scanFlag(path) {\n var index = path.index, pathValue = path.pathValue;\n var code = pathValue.charCodeAt(index);\n if (code === 0x30 /* 0 */) {\n path.param = 0;\n path.index += 1;\n return;\n }\n if (code === 0x31 /* 1 */) {\n path.param = 1;\n path.index += 1;\n return;\n }\n path.err = \"[path-util]: invalid Arc flag \\\"\" + pathValue[index] + \"\\\", expecting 0 or 1 at index \" + index;\n}\n//# sourceMappingURL=scan-flag.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-flag.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/process/quad-2-cubic.js": -/*!******************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/process/quad-2-cubic.js ***! - \******************************************************************/ -/*! exports provided: quadToCubic */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-param.js": +/*!*****************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-param.js ***! + \*****************************************************************************************/ +/*! exports provided: scanParam */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadToCubic\", function() { return quadToCubic; });\nfunction quadToCubic(x1, y1, qx, qy, x2, y2) {\n var r13 = 1 / 3;\n var r23 = 2 / 3;\n return [\n r13 * x1 + r23 * qx,\n r13 * y1 + r23 * qy,\n r13 * x2 + r23 * qx,\n r13 * y2 + r23 * qy,\n x2, y2, // x,y\n ];\n}\n//# sourceMappingURL=quad-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/process/quad-2-cubic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scanParam\", function() { return scanParam; });\n/* harmony import */ var _is_digit_start__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-digit-start */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-digit-start.js\");\n\n/**\n * Validates every character of the path string,\n * every path command, negative numbers or floating point numbers.\n */\nfunction scanParam(path) {\n var max = path.max, pathValue = path.pathValue, start = path.index;\n var index = start;\n var zeroFirst = false;\n var hasCeiling = false;\n var hasDecimal = false;\n var hasDot = false;\n var ch;\n if (index >= max) {\n // path.err = 'SvgPath: missed param (at pos ' + index + ')';\n path.err = \"[path-util]: Invalid path value at index \" + index + \", \\\"pathValue\\\" is missing param\";\n return;\n }\n ch = pathValue.charCodeAt(index);\n if (ch === 0x2b /* + */ || ch === 0x2d /* - */) {\n index += 1;\n // ch = (index < max) ? pathValue.charCodeAt(index) : 0;\n ch = pathValue.charCodeAt(index);\n }\n // This logic is shamelessly borrowed from Esprima\n // https://github.com/ariya/esprimas\n if (!Object(_is_digit_start__WEBPACK_IMPORTED_MODULE_0__[\"isDigit\"])(ch) && ch !== 0x2e /* . */) {\n // path.err = 'SvgPath: param should start with 0..9 or `.` (at pos ' + index + ')';\n path.err = \"[path-util]: Invalid path value at index \" + index + \", \\\"\" + pathValue[index] + \"\\\" is not a number\";\n return;\n }\n if (ch !== 0x2e /* . */) {\n zeroFirst = ch === 0x30 /* 0 */;\n index += 1;\n ch = pathValue.charCodeAt(index);\n if (zeroFirst && index < max) {\n // decimal number starts with '0' such as '09' is illegal.\n if (ch && Object(_is_digit_start__WEBPACK_IMPORTED_MODULE_0__[\"isDigit\"])(ch)) {\n // path.err = 'SvgPath: numbers started with `0` such as `09`\n // are illegal (at pos ' + start + ')';\n path.err = \"[path-util]: Invalid path value at index \" + start + \", \\\"\" + pathValue[start] + \"\\\" illegal number\";\n return;\n }\n }\n while (index < max && Object(_is_digit_start__WEBPACK_IMPORTED_MODULE_0__[\"isDigit\"])(pathValue.charCodeAt(index))) {\n index += 1;\n hasCeiling = true;\n }\n ch = pathValue.charCodeAt(index);\n }\n if (ch === 0x2e /* . */) {\n hasDot = true;\n index += 1;\n while (Object(_is_digit_start__WEBPACK_IMPORTED_MODULE_0__[\"isDigit\"])(pathValue.charCodeAt(index))) {\n index += 1;\n hasDecimal = true;\n }\n ch = pathValue.charCodeAt(index);\n }\n if (ch === 0x65 /* e */ || ch === 0x45 /* E */) {\n if (hasDot && !hasCeiling && !hasDecimal) {\n path.err = \"[path-util]: Invalid path value at index \" + index + \", \\\"\" + pathValue[index] + \"\\\" invalid float exponent\";\n return;\n }\n index += 1;\n ch = pathValue.charCodeAt(index);\n if (ch === 0x2b /* + */ || ch === 0x2d /* - */) {\n index += 1;\n }\n if (index < max && Object(_is_digit_start__WEBPACK_IMPORTED_MODULE_0__[\"isDigit\"])(pathValue.charCodeAt(index))) {\n while (index < max && Object(_is_digit_start__WEBPACK_IMPORTED_MODULE_0__[\"isDigit\"])(pathValue.charCodeAt(index))) {\n index += 1;\n }\n }\n else {\n path.err = \"[path-util]: Invalid path value at index \" + index + \", \\\"\" + pathValue[index] + \"\\\" invalid integer exponent\";\n return;\n }\n }\n path.index = index;\n path.param = +path.pathValue.slice(start, index);\n}\n//# sourceMappingURL=scan-param.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-param.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/process/segment-2-cubic.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/process/segment-2-cubic.js ***! - \*********************************************************************/ -/*! exports provided: segmentToCubic */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-segment.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-segment.js ***! + \*******************************************************************************************/ +/*! exports provided: scanSegment */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentToCubic\", function() { return segmentToCubic; });\n/* harmony import */ var _arc_2_cubic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arc-2-cubic */ \"./node_modules/@antv/path-util/esm/process/arc-2-cubic.js\");\n/* harmony import */ var _quad_2_cubic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quad-2-cubic */ \"./node_modules/@antv/path-util/esm/process/quad-2-cubic.js\");\n/* harmony import */ var _line_2_cubic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./line-2-cubic */ \"./node_modules/@antv/path-util/esm/process/line-2-cubic.js\");\n\n\n\nfunction segmentToCubic(segment, params) {\n if ('TQ'.indexOf(segment[0]) < 0) {\n params.qx = null;\n params.qy = null;\n }\n var _a = segment.slice(1), s1 = _a[0], s2 = _a[1];\n switch (segment[0]) {\n case 'M':\n params.x = s1;\n params.y = s2;\n return segment;\n case 'A':\n return ['C'].concat(_arc_2_cubic__WEBPACK_IMPORTED_MODULE_0__[\"arcToCubic\"].apply(0, [params.x1, params.y1].concat(segment.slice(1))));\n case 'Q':\n params.qx = s1;\n params.qy = s2;\n return ['C'].concat(_quad_2_cubic__WEBPACK_IMPORTED_MODULE_1__[\"quadToCubic\"].apply(0, [params.x1, params.y1].concat(segment.slice(1))));\n case 'L':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(params.x1, params.y1, segment[1], segment[2]));\n case 'H':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(params.x1, params.y1, segment[1], params.y1));\n case 'V':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(params.x1, params.y1, params.x1, segment[1]));\n case 'Z':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(params.x1, params.y1, params.x, params.y));\n default:\n }\n return segment;\n}\n//# sourceMappingURL=segment-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/process/segment-2-cubic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scanSegment\", function() { return scanSegment; });\n/* harmony import */ var _finalize_segment__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./finalize-segment */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/finalize-segment.js\");\n/* harmony import */ var _params_count__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./params-count */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-count.js\");\n/* harmony import */ var _scan_flag__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./scan-flag */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-flag.js\");\n/* harmony import */ var _scan_param__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./scan-param */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-param.js\");\n/* harmony import */ var _skip_spaces__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./skip-spaces */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/skip-spaces.js\");\n/* harmony import */ var _is_path_command__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./is-path-command */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-path-command.js\");\n/* harmony import */ var _is_digit_start__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./is-digit-start */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-digit-start.js\");\n/* harmony import */ var _is_arc_command__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./is-arc-command */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-arc-command.js\");\n\n\n\n\n\n\n\n\n/**\n * Scans every character in the path string to determine\n * where a segment starts and where it ends.\n */\nfunction scanSegment(path) {\n var max = path.max, pathValue = path.pathValue, index = path.index;\n var cmdCode = pathValue.charCodeAt(index);\n var reqParams = _params_count__WEBPACK_IMPORTED_MODULE_1__[\"paramsCount\"][pathValue[index].toLowerCase()];\n path.segmentStart = index;\n if (!Object(_is_path_command__WEBPACK_IMPORTED_MODULE_5__[\"isPathCommand\"])(cmdCode)) {\n path.err = \"[path-util]: Invalid path value \\\"\" + pathValue[index] + \"\\\" is not a path command\";\n return;\n }\n path.index += 1;\n Object(_skip_spaces__WEBPACK_IMPORTED_MODULE_4__[\"skipSpaces\"])(path);\n path.data = [];\n if (!reqParams) {\n // Z\n Object(_finalize_segment__WEBPACK_IMPORTED_MODULE_0__[\"finalizeSegment\"])(path);\n return;\n }\n for (;;) {\n for (var i = reqParams; i > 0; i -= 1) {\n if (Object(_is_arc_command__WEBPACK_IMPORTED_MODULE_7__[\"isArcCommand\"])(cmdCode) && (i === 3 || i === 4))\n Object(_scan_flag__WEBPACK_IMPORTED_MODULE_2__[\"scanFlag\"])(path);\n else\n Object(_scan_param__WEBPACK_IMPORTED_MODULE_3__[\"scanParam\"])(path);\n if (path.err.length) {\n return;\n }\n path.data.push(path.param);\n Object(_skip_spaces__WEBPACK_IMPORTED_MODULE_4__[\"skipSpaces\"])(path);\n // after ',' param is mandatory\n if (path.index < max && pathValue.charCodeAt(path.index) === 0x2c /* , */) {\n path.index += 1;\n Object(_skip_spaces__WEBPACK_IMPORTED_MODULE_4__[\"skipSpaces\"])(path);\n }\n }\n if (path.index >= path.max) {\n break;\n }\n // Stop on next segment\n if (!Object(_is_digit_start__WEBPACK_IMPORTED_MODULE_6__[\"isDigitStart\"])(pathValue.charCodeAt(path.index))) {\n break;\n }\n }\n Object(_finalize_segment__WEBPACK_IMPORTED_MODULE_0__[\"finalizeSegment\"])(path);\n}\n//# sourceMappingURL=scan-segment.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/scan-segment.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/esm/rect-path.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/path-util/esm/rect-path.js ***! - \*******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/skip-spaces.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/skip-spaces.js ***! + \******************************************************************************************/ +/*! exports provided: skipSpaces */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return rectPath; });\nfunction rectPath(x, y, w, h, r) {\n if (r) {\n return [\n ['M', +x + (+r), y],\n ['l', w - r * 2, 0],\n ['a', r, r, 0, 0, 1, r, r],\n ['l', 0, h - r * 2],\n ['a', r, r, 0, 0, 1, -r, r],\n ['l', r * 2 - w, 0],\n ['a', r, r, 0, 0, 1, -r, -r],\n ['l', 0, r * 2 - h],\n ['a', r, r, 0, 0, 1, r, -r],\n ['z'],\n ];\n }\n return [\n ['M', x, y],\n ['l', w, 0],\n ['l', 0, h],\n ['l', -w, 0],\n ['z'],\n ];\n // res.parsePathArray = parsePathArray;\n}\n//# sourceMappingURL=rect-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/rect-path.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"skipSpaces\", function() { return skipSpaces; });\n/* harmony import */ var _is_space__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-space */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/is-space.js\");\n\n/**\n * Points the parser to the next character in the\n * path string every time it encounters any kind of\n * space character.\n */\nfunction skipSpaces(path) {\n var pathValue = path.pathValue, max = path.max;\n while (path.index < max && Object(_is_space__WEBPACK_IMPORTED_MODULE_0__[\"isSpace\"])(pathValue.charCodeAt(path.index))) {\n path.index += 1;\n }\n}\n//# sourceMappingURL=skip-spaces.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/skip-spaces.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/ext.js": -/*!********************************************************************************!*\ - !*** ./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/ext.js ***! - \********************************************************************************/ -/*! exports provided: leftTranslate, leftRotate, leftScale, transform, direction, angleTo, vertical */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/arc-2-cubic.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/arc-2-cubic.js ***! + \*******************************************************************************************/ +/*! exports provided: arcToCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftTranslate\", function() { return leftTranslate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftRotate\", function() { return leftRotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftScale\", function() { return leftScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transform\", function() { return transform; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"direction\", function() { return direction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angleTo\", function() { return angleTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vertical\", function() { return vertical; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/**\n * @description 扩展方法,提供 gl-matrix 为提供的方法\n * */\n\nfunction leftTranslate(out, a, v) {\n var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromTranslation(transMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, transMat, a);\n}\nfunction leftRotate(out, a, rad) {\n var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromRotation(rotateMat, rad);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, rotateMat, a);\n}\nfunction leftScale(out, a, v) {\n var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromScaling(scaleMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, scaleMat, a);\n}\nfunction leftMultiply(out, a, a1) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, a1, a);\n}\n/**\n * 根据 actions 来做 transform\n * @param m\n * @param actions\n */\nfunction transform(m, actions) {\n var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0, len = actions.length; i < len; i++) {\n var action = actions[i];\n switch (action[0]) {\n case 't':\n leftTranslate(matrix, matrix, [action[1], action[2]]);\n break;\n case 's':\n leftScale(matrix, matrix, [action[1], action[2]]);\n break;\n case 'r':\n leftRotate(matrix, matrix, action[1]);\n break;\n case 'm':\n leftMultiply(matrix, matrix, action[1]);\n break;\n default:\n break;\n }\n }\n return matrix;\n}\n/**\n * 向量 v1 到 向量 v2 夹角的方向\n * @param {Array} v1 向量\n * @param {Array} v2 向量\n * @return {Boolean} >= 0 顺时针 < 0 逆时针\n */\nfunction direction(v1, v2) {\n return v1[0] * v2[1] - v2[0] * v1[1];\n}\n/**\n * 二维向量 v1 到 v2 的夹角\n * @param v1\n * @param v2\n * @param direct\n */\nfunction angleTo(v1, v2, direct) {\n var ang = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].angle(v1, v2);\n var angleLargeThanPI = direction(v1, v2) >= 0;\n if (direct) {\n if (angleLargeThanPI) {\n return Math.PI * 2 - ang;\n }\n return ang;\n }\n if (angleLargeThanPI) {\n return ang;\n }\n return Math.PI * 2 - ang;\n}\n/**\n * 计算二维向量的垂直向量\n * @param out\n * @param v\n * @param flag\n */\nfunction vertical(out, v, flag) {\n if (flag) {\n out[0] = v[1];\n out[1] = -1 * v[0];\n }\n else {\n out[0] = -1 * v[1];\n out[1] = v[0];\n }\n return out;\n}\n//# sourceMappingURL=ext.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/ext.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arcToCubic\", function() { return arcToCubic; });\n/* harmony import */ var _util_rotate_vector__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/rotate-vector */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/rotate-vector.js\");\n\n/**\n * Converts A (arc-to) segments to C (cubic-bezier-to).\n *\n * For more information of where this math came from visit:\n * http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n */\nfunction arcToCubic(X1, Y1, RX, RY, angle, LAF, SF, X2, Y2, recursive) {\n var x1 = X1;\n var y1 = Y1;\n var rx = RX;\n var ry = RY;\n var x2 = X2;\n var y2 = Y2;\n // for more information of where this Math came from visit:\n // http://www.w3.org/TR/SVG11/implnote.html#ArcImplementationNotes\n var d120 = (Math.PI * 120) / 180;\n var rad = (Math.PI / 180) * (+angle || 0);\n /** @type {number[]} */\n var res = [];\n var xy;\n var f1;\n var f2;\n var cx;\n var cy;\n if (!recursive) {\n xy = Object(_util_rotate_vector__WEBPACK_IMPORTED_MODULE_0__[\"rotateVector\"])(x1, y1, -rad);\n x1 = xy.x;\n y1 = xy.y;\n xy = Object(_util_rotate_vector__WEBPACK_IMPORTED_MODULE_0__[\"rotateVector\"])(x2, y2, -rad);\n x2 = xy.x;\n y2 = xy.y;\n var x = (x1 - x2) / 2;\n var y = (y1 - y2) / 2;\n var h = (x * x) / (rx * rx) + (y * y) / (ry * ry);\n if (h > 1) {\n h = Math.sqrt(h);\n rx *= h;\n ry *= h;\n }\n var rx2 = rx * rx;\n var ry2 = ry * ry;\n var k = (LAF === SF ? -1 : 1) *\n Math.sqrt(Math.abs((rx2 * ry2 - rx2 * y * y - ry2 * x * x) / (rx2 * y * y + ry2 * x * x)));\n cx = (k * rx * y) / ry + (x1 + x2) / 2;\n cy = (k * -ry * x) / rx + (y1 + y2) / 2;\n // eslint-disable-next-line no-bitwise -- Impossible to satisfy no-bitwise\n f1 = Math.asin(((((y1 - cy) / ry) * Math.pow(10, 9)) >> 0) / Math.pow(10, 9));\n // eslint-disable-next-line no-bitwise -- Impossible to satisfy no-bitwise\n f2 = Math.asin(((((y2 - cy) / ry) * Math.pow(10, 9)) >> 0) / Math.pow(10, 9));\n f1 = x1 < cx ? Math.PI - f1 : f1;\n f2 = x2 < cx ? Math.PI - f2 : f2;\n if (f1 < 0)\n f1 = Math.PI * 2 + f1;\n if (f2 < 0)\n f2 = Math.PI * 2 + f2;\n if (SF && f1 > f2) {\n f1 -= Math.PI * 2;\n }\n if (!SF && f2 > f1) {\n f2 -= Math.PI * 2;\n }\n }\n else {\n f1 = recursive[0], f2 = recursive[1], cx = recursive[2], cy = recursive[3];\n }\n var df = f2 - f1;\n if (Math.abs(df) > d120) {\n var f2old = f2;\n var x2old = x2;\n var y2old = y2;\n f2 = f1 + d120 * (SF && f2 > f1 ? 1 : -1);\n x2 = cx + rx * Math.cos(f2);\n y2 = cy + ry * Math.sin(f2);\n res = arcToCubic(x2, y2, rx, ry, angle, 0, SF, x2old, y2old, [f2, f2old, cx, cy]);\n }\n df = f2 - f1;\n var c1 = Math.cos(f1);\n var s1 = Math.sin(f1);\n var c2 = Math.cos(f2);\n var s2 = Math.sin(f2);\n var t = Math.tan(df / 4);\n var hx = (4 / 3) * rx * t;\n var hy = (4 / 3) * ry * t;\n var m1 = [x1, y1];\n var m2 = [x1 + hx * s1, y1 - hy * c1];\n var m3 = [x2 + hx * s2, y2 - hy * c2];\n var m4 = [x2, y2];\n m2[0] = 2 * m1[0] - m2[0];\n m2[1] = 2 * m1[1] - m2[1];\n if (recursive) {\n return m2.concat(m3, m4, res);\n // return [...m2, ...m3, ...m4, ...res];\n }\n res = m2.concat(m3, m4, res);\n // res = [...m2, ...m3, ...m4, ...res];\n var newres = [];\n for (var i = 0, ii = res.length; i < ii; i += 1) {\n newres[i] = i % 2 ? Object(_util_rotate_vector__WEBPACK_IMPORTED_MODULE_0__[\"rotateVector\"])(res[i - 1], res[i], rad).y : Object(_util_rotate_vector__WEBPACK_IMPORTED_MODULE_0__[\"rotateVector\"])(res[i], res[i + 1], rad).x;\n }\n return newres;\n}\n// const TAU = Math.PI * 2;\n// const mapToEllipse = (\n// { x, y }: { x: number; y: number },\n// rx: number,\n// ry: number,\n// cosphi: number,\n// sinphi: number,\n// centerx: number,\n// centery: number,\n// ) => {\n// x *= rx;\n// y *= ry;\n// const xp = cosphi * x - sinphi * y;\n// const yp = sinphi * x + cosphi * y;\n// return {\n// x: xp + centerx,\n// y: yp + centery,\n// };\n// };\n// const approxUnitArc = (ang1: number, ang2: number) => {\n// // If 90 degree circular arc, use a constant\n// // as derived from http://spencermortensen.com/articles/bezier-circle\n// const a =\n// ang2 === 1.5707963267948966\n// ? 0.551915024494\n// : ang2 === -1.5707963267948966\n// ? -0.551915024494\n// : (4 / 3) * Math.tan(ang2 / 4);\n// const x1 = Math.cos(ang1);\n// const y1 = Math.sin(ang1);\n// const x2 = Math.cos(ang1 + ang2);\n// const y2 = Math.sin(ang1 + ang2);\n// return [\n// {\n// x: x1 - y1 * a,\n// y: y1 + x1 * a,\n// },\n// {\n// x: x2 + y2 * a,\n// y: y2 - x2 * a,\n// },\n// {\n// x: x2,\n// y: y2,\n// },\n// ];\n// };\n// const vectorAngle = (ux: number, uy: number, vx: number, vy: number) => {\n// const sign = ux * vy - uy * vx < 0 ? -1 : 1;\n// let dot = ux * vx + uy * vy;\n// if (dot > 1) {\n// dot = 1;\n// }\n// if (dot < -1) {\n// dot = -1;\n// }\n// return sign * Math.acos(dot);\n// };\n// const getArcCenter = (\n// px: any,\n// py: any,\n// cx: any,\n// cy: any,\n// rx: number,\n// ry: number,\n// largeArcFlag: number,\n// sweepFlag: number,\n// sinphi: number,\n// cosphi: number,\n// pxp: number,\n// pyp: number,\n// ) => {\n// const rxsq = Math.pow(rx, 2);\n// const rysq = Math.pow(ry, 2);\n// const pxpsq = Math.pow(pxp, 2);\n// const pypsq = Math.pow(pyp, 2);\n// let radicant = rxsq * rysq - rxsq * pypsq - rysq * pxpsq;\n// if (radicant < 0) {\n// radicant = 0;\n// }\n// radicant /= rxsq * pypsq + rysq * pxpsq;\n// radicant = Math.sqrt(radicant) * (largeArcFlag === sweepFlag ? -1 : 1);\n// const centerxp = ((radicant * rx) / ry) * pyp;\n// const centeryp = ((radicant * -ry) / rx) * pxp;\n// const centerx = cosphi * centerxp - sinphi * centeryp + (px + cx) / 2;\n// const centery = sinphi * centerxp + cosphi * centeryp + (py + cy) / 2;\n// const vx1 = (pxp - centerxp) / rx;\n// const vy1 = (pyp - centeryp) / ry;\n// const vx2 = (-pxp - centerxp) / rx;\n// const vy2 = (-pyp - centeryp) / ry;\n// const ang1 = vectorAngle(1, 0, vx1, vy1);\n// let ang2 = vectorAngle(vx1, vy1, vx2, vy2);\n// if (sweepFlag === 0 && ang2 > 0) {\n// ang2 -= TAU;\n// }\n// if (sweepFlag === 1 && ang2 < 0) {\n// ang2 += TAU;\n// }\n// return [centerx, centery, ang1, ang2];\n// };\n// const arcToBezier = ({ px, py, cx, cy, rx, ry, xAxisRotation = 0, largeArcFlag = 0, sweepFlag = 0 }) => {\n// const curves = [];\n// if (rx === 0 || ry === 0) {\n// return [{ x1: 0, y1: 0, x2: 0, y2: 0, x: cx, y: cy }];\n// }\n// const sinphi = Math.sin((xAxisRotation * TAU) / 360);\n// const cosphi = Math.cos((xAxisRotation * TAU) / 360);\n// const pxp = (cosphi * (px - cx)) / 2 + (sinphi * (py - cy)) / 2;\n// const pyp = (-sinphi * (px - cx)) / 2 + (cosphi * (py - cy)) / 2;\n// if (pxp === 0 && pyp === 0) {\n// return [{ x1: 0, y1: 0, x2: 0, y2: 0, x: cx, y: cy }];\n// }\n// rx = Math.abs(rx);\n// ry = Math.abs(ry);\n// const lambda = Math.pow(pxp, 2) / Math.pow(rx, 2) + Math.pow(pyp, 2) / Math.pow(ry, 2);\n// if (lambda > 1) {\n// rx *= Math.sqrt(lambda);\n// ry *= Math.sqrt(lambda);\n// }\n// let [centerx, centery, ang1, ang2] = getArcCenter(\n// px,\n// py,\n// cx,\n// cy,\n// rx,\n// ry,\n// largeArcFlag,\n// sweepFlag,\n// sinphi,\n// cosphi,\n// pxp,\n// pyp,\n// );\n// // If 'ang2' == 90.0000000001, then `ratio` will evaluate to\n// // 1.0000000001. This causes `segments` to be greater than one, which is an\n// // unecessary split, and adds extra points to the bezier curve. To alleviate\n// // this issue, we round to 1.0 when the ratio is close to 1.0.\n// let ratio = Math.abs(ang2) / (TAU / 4);\n// if (Math.abs(1.0 - ratio) < 0.0000001) {\n// ratio = 1.0;\n// }\n// const segments = Math.max(Math.ceil(ratio), 1);\n// ang2 /= segments;\n// for (let i = 0; i < segments; i++) {\n// curves.push(approxUnitArc(ang1, ang2));\n// ang1 += ang2;\n// }\n// return curves.map((curve) => {\n// const { x: x1, y: y1 } = mapToEllipse(curve[0], rx, ry, cosphi, sinphi, centerx, centery);\n// const { x: x2, y: y2 } = mapToEllipse(curve[1], rx, ry, cosphi, sinphi, centerx, centery);\n// const { x, y } = mapToEllipse(curve[2], rx, ry, cosphi, sinphi, centerx, centery);\n// return { x1, y1, x2, y2, x, y };\n// });\n// };\n// export function arcToCubic(\n// x1: number,\n// y1: number,\n// rx: number,\n// ry: number,\n// angle: number,\n// LAF: number,\n// SF: number,\n// x2: number,\n// y2: number,\n// ) {\n// const curves = arcToBezier({\n// px: x1,\n// py: y1,\n// cx: x2,\n// cy: y2,\n// rx,\n// ry,\n// xAxisRotation: angle,\n// largeArcFlag: LAF,\n// sweepFlag: SF,\n// });\n// return curves.reduce((prev, cur) => {\n// const { x1, y1, x2, y2, x, y } = cur;\n// prev.push(x1, y1, x2, y2, x, y);\n// return prev;\n// }, [] as number[]);\n// }\n//# sourceMappingURL=arc-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/arc-2-cubic.js?"); /***/ }), -/***/ "./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/index.js": -/*!**********************************************************************************!*\ - !*** ./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/index.js ***! - \**********************************************************************************/ -/*! exports provided: mat3, vec2, vec3, ext */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/clone-path.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/clone-path.js ***! + \******************************************************************************************/ +/*! exports provided: clonePath */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mat3\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vec2\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vec3\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"]; });\n\n/* harmony import */ var _ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ext */ \"./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/ext.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"ext\", function() { return _ext__WEBPACK_IMPORTED_MODULE_1__; });\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clonePath\", function() { return clonePath; });\nfunction clonePath(path) {\n return path.map(function (x) { return (Array.isArray(x) ? [].concat(x) : x); });\n}\n//# sourceMappingURL=clone-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/clone-path.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/base.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/scale/esm/base.js ***! - \**********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/fix-arc.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/fix-arc.js ***! + \***************************************************************************************/ +/*! exports provided: fixArc */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _tick_method_register__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tick-method/register */ \"./node_modules/@antv/scale/esm/tick-method/register.js\");\n\n\nvar Scale = /** @class */ (function () {\n function Scale(cfg) {\n /**\n * 度量的类型\n */\n this.type = 'base';\n /**\n * 是否分类类型的度量\n */\n this.isCategory = false;\n /**\n * 是否线性度量,有linear, time 度量\n */\n this.isLinear = false;\n /**\n * 是否连续类型的度量,linear,time,log, pow, quantile, quantize 都支持\n */\n this.isContinuous = false;\n /**\n * 是否是常量的度量,传入和传出一致\n */\n this.isIdentity = false;\n this.values = [];\n this.range = [0, 1];\n this.ticks = [];\n this.__cfg__ = cfg;\n this.initCfg();\n this.init();\n }\n // 对于原始值的必要转换,如分类、时间字段需转换成数值,用transform/map命名可能更好\n Scale.prototype.translate = function (v) {\n return v;\n };\n /** 重新初始化 */\n Scale.prototype.change = function (cfg) {\n // 覆盖配置项,而不替代\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"assign\"])(this.__cfg__, cfg);\n this.init();\n };\n Scale.prototype.clone = function () {\n return this.constructor(this.__cfg__);\n };\n /** 获取坐标轴需要的ticks */\n Scale.prototype.getTicks = function () {\n var _this = this;\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"map\"])(this.ticks, function (tick, idx) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(tick)) {\n // 仅当符合Tick类型时才有意义\n return tick;\n }\n return {\n text: _this.getText(tick, idx),\n tickValue: tick,\n value: _this.scale(tick),\n };\n });\n };\n /** 获取Tick的格式化结果 */\n Scale.prototype.getText = function (value, key) {\n var formatter = this.formatter;\n var res = formatter ? formatter(value, key) : value;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(res) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(res.toString)) {\n return '';\n }\n return res.toString();\n };\n // 获取配置项中的值,当前 scale 上的值可能会被修改\n Scale.prototype.getConfig = function (key) {\n return this.__cfg__[key];\n };\n // scale初始化\n Scale.prototype.init = function () {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"assign\"])(this, this.__cfg__);\n this.setDomain();\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isEmpty\"])(this.getConfig('ticks'))) {\n this.ticks = this.calculateTicks();\n }\n };\n // 子类上覆盖某些属性,不能直接在类上声明,否则会被覆盖\n Scale.prototype.initCfg = function () { };\n Scale.prototype.setDomain = function () { };\n Scale.prototype.calculateTicks = function () {\n var tickMethod = this.tickMethod;\n var ticks = [];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(tickMethod)) {\n var method = Object(_tick_method_register__WEBPACK_IMPORTED_MODULE_1__[\"getTickMethod\"])(tickMethod);\n if (!method) {\n throw new Error('There is no method to to calculate ticks!');\n }\n ticks = method(this);\n }\n else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(tickMethod)) {\n ticks = tickMethod(this);\n }\n return ticks;\n };\n // range 的最小值\n Scale.prototype.rangeMin = function () {\n return this.range[0];\n };\n // range 的最大值\n Scale.prototype.rangeMax = function () {\n return this.range[1];\n };\n /** 定义域转 0~1 */\n Scale.prototype.calcPercent = function (value, min, max) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(value)) {\n return (value - min) / (max - min);\n }\n return NaN;\n };\n /** 0~1转定义域 */\n Scale.prototype.calcValue = function (percent, min, max) {\n return min + percent * (max - min);\n };\n return Scale;\n}());\n/* harmony default export */ __webpack_exports__[\"default\"] = (Scale);\n//# sourceMappingURL=base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/base.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fixArc\", function() { return fixArc; });\nfunction fixArc(pathArray, allPathCommands, i) {\n if (pathArray[i].length > 7) {\n pathArray[i].shift();\n var pi = pathArray[i];\n // const ni = i + 1;\n var ni = i;\n while (pi.length) {\n // if created multiple C:s, their original seg is saved\n allPathCommands[i] = 'A';\n // @ts-ignore\n pathArray.splice((ni += 1), 0, ['C'].concat(pi.splice(0, 6)));\n }\n pathArray.splice(i, 1);\n }\n}\n//# sourceMappingURL=fix-arc.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/fix-arc.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/category/base.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/scale/esm/category/base.js ***! - \*******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/line-2-cubic.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/line-2-cubic.js ***! + \********************************************************************************************/ +/*! exports provided: lineToCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/scale/esm/base.js\");\n\n\n\n/**\n * 分类度量\n * @class\n */\nvar Category = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Category, _super);\n function Category() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'cat';\n _this.isCategory = true;\n return _this;\n }\n Category.prototype.buildIndexMap = function () {\n if (!this.translateIndexMap) {\n this.translateIndexMap = new Map();\n // 重新构建缓存\n for (var i = 0; i < this.values.length; i++) {\n this.translateIndexMap.set(this.values[i], i);\n }\n }\n };\n Category.prototype.translate = function (value) {\n // 按需构建 map\n this.buildIndexMap();\n // 找得到\n var idx = this.translateIndexMap.get(value);\n if (idx === undefined) {\n idx = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value) ? value : NaN;\n }\n return idx;\n };\n Category.prototype.scale = function (value) {\n var order = this.translate(value);\n // 分类数据允许 0.5 范围内调整\n // if (order < this.min - 0.5 || order > this.max + 0.5) {\n // return NaN;\n // }\n var percent = this.calcPercent(order, this.min, this.max);\n return this.calcValue(percent, this.rangeMin(), this.rangeMax());\n };\n Category.prototype.invert = function (scaledValue) {\n var domainRange = this.max - this.min;\n var percent = this.calcPercent(scaledValue, this.rangeMin(), this.rangeMax());\n var idx = Math.round(domainRange * percent) + this.min;\n if (idx < this.min || idx > this.max) {\n return NaN;\n }\n return this.values[idx];\n };\n Category.prototype.getText = function (value) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var v = value;\n // value为index\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value) && !this.values.includes(value)) {\n v = this.values[v];\n }\n return _super.prototype.getText.apply(this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArrays\"])([v], args));\n };\n // 复写属性\n Category.prototype.initCfg = function () {\n this.tickMethod = 'cat';\n };\n // 设置 min, max\n Category.prototype.setDomain = function () {\n // 用户有可能设置 min\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.getConfig('min'))) {\n this.min = 0;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.getConfig('max'))) {\n var size = this.values.length;\n this.max = size > 1 ? size - 1 : size;\n }\n // scale.init 的时候清除缓存\n if (this.translateIndexMap) {\n this.translateIndexMap = undefined;\n }\n };\n return Category;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Category);\n//# sourceMappingURL=base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/category/base.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineToCubic\", function() { return lineToCubic; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _util_mid_point__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/mid-point */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/mid-point.js\");\n\n\nvar lineToCubic = function (x1, y1, x2, y2) {\n var t = 0.5;\n var mid = Object(_util_mid_point__WEBPACK_IMPORTED_MODULE_1__[\"midPoint\"])([x1, y1], [x2, y2], t);\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArray\"])([], mid, true), [x2, y2, x2, y2], false);\n};\n//# sourceMappingURL=line-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/line-2-cubic.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/category/time.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/scale/esm/category/time.js ***! - \*******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-path.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-path.js ***! + \**********************************************************************************************/ +/*! exports provided: normalizePath */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/time */ \"./node_modules/@antv/scale/esm/util/time.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/category/base.js\");\n\n\n\n\n/**\n * 时间分类度量\n * @class\n */\nvar TimeCat = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(TimeCat, _super);\n function TimeCat() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'timeCat';\n return _this;\n }\n /**\n * @override\n */\n TimeCat.prototype.translate = function (value) {\n value = Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"toTimeStamp\"])(value);\n var index = this.values.indexOf(value);\n if (index === -1) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value) && value < this.values.length) {\n index = value;\n }\n else {\n index = NaN;\n }\n }\n return index;\n };\n /**\n * 由于时间类型数据需要转换一下,所以复写 getText\n * @override\n */\n TimeCat.prototype.getText = function (value, tickIndex) {\n var index = this.translate(value);\n if (index > -1) {\n var result = this.values[index];\n var formatter = this.formatter;\n result = formatter ? formatter(result, tickIndex) : Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"timeFormat\"])(result, this.mask);\n return result;\n }\n return value;\n };\n TimeCat.prototype.initCfg = function () {\n this.tickMethod = 'time-cat';\n this.mask = 'YYYY-MM-DD';\n this.tickCount = 7; // 一般时间数据会显示 7, 14, 30 天的数字\n };\n TimeCat.prototype.setDomain = function () {\n var values = this.values;\n // 针对时间分类类型,会将时间统一转换为时间戳\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(values, function (v, i) {\n values[i] = Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"toTimeStamp\"])(v);\n });\n values.sort(function (v1, v2) {\n return v1 - v2;\n });\n _super.prototype.setDomain.call(this);\n };\n return TimeCat;\n}(_base__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (TimeCat);\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/category/time.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalizePath\", function() { return normalizePath; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _util_is_normalized_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/is-normalized-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-normalized-array.js\");\n/* harmony import */ var _parser_params_parser__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../parser/params-parser */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-parser.js\");\n/* harmony import */ var _convert_path_2_absolute__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../convert/path-2-absolute */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-absolute.js\");\n/* harmony import */ var _normalize_segment__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./normalize-segment */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-segment.js\");\n\n\n\n\n\n/**\n * @example\n * const path = 'M0 0 H50';\n * const normalizedPath = SVGPathCommander.normalizePath(path);\n * // result => [['M', 0, 0], ['L', 50, 0]]\n */\nfunction normalizePath(pathInput) {\n if (Object(_util_is_normalized_array__WEBPACK_IMPORTED_MODULE_1__[\"isNormalizedArray\"])(pathInput)) {\n return [].concat(pathInput);\n }\n var path = Object(_convert_path_2_absolute__WEBPACK_IMPORTED_MODULE_3__[\"path2Absolute\"])(pathInput);\n var params = Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, _parser_params_parser__WEBPACK_IMPORTED_MODULE_2__[\"paramsParser\"]);\n for (var i = 0; i < path.length; i += 1) {\n // Save current path command\n path[i] = Object(_normalize_segment__WEBPACK_IMPORTED_MODULE_4__[\"normalizeSegment\"])(path[i], params);\n var segment = path[i];\n var seglen = segment.length;\n params.x1 = +segment[seglen - 2];\n params.y1 = +segment[seglen - 1];\n params.x2 = +segment[seglen - 4] || params.x1;\n params.y2 = +segment[seglen - 3] || params.y1;\n }\n return path;\n}\n//# sourceMappingURL=normalize-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-path.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/continuous/base.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/continuous/base.js ***! - \*********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-segment.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-segment.js ***! + \*************************************************************************************************/ +/*! exports provided: normalizeSegment */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/scale/esm/base.js\");\n\n\n\n/**\n * 连续度量的基类\n * @class\n */\nvar Continuous = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Continuous, _super);\n function Continuous() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isContinuous = true;\n return _this;\n }\n Continuous.prototype.scale = function (value) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(value)) {\n return NaN;\n }\n var rangeMin = this.rangeMin();\n var rangeMax = this.rangeMax();\n var max = this.max;\n var min = this.min;\n if (max === min) {\n return rangeMin;\n }\n var percent = this.getScalePercent(value);\n return rangeMin + percent * (rangeMax - rangeMin);\n };\n Continuous.prototype.init = function () {\n _super.prototype.init.call(this);\n // init 完成后保证 min, max 包含 ticks 的范围\n var ticks = this.ticks;\n var firstTick = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"head\"])(ticks);\n var lastTick = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"last\"])(ticks);\n if (firstTick < this.min) {\n this.min = firstTick;\n }\n if (lastTick > this.max) {\n this.max = lastTick;\n }\n // strict-limit 方式\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.minLimit)) {\n this.min = firstTick;\n }\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.maxLimit)) {\n this.max = lastTick;\n }\n };\n Continuous.prototype.setDomain = function () {\n var _a = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"getRange\"])(this.values), min = _a.min, max = _a.max;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.min)) {\n this.min = min;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.max)) {\n this.max = max;\n }\n if (this.min > this.max) {\n this.min = min;\n this.max = max;\n }\n };\n Continuous.prototype.calculateTicks = function () {\n var _this = this;\n var ticks = _super.prototype.calculateTicks.call(this);\n if (!this.nice) {\n ticks = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"filter\"])(ticks, function (tick) {\n return tick >= _this.min && tick <= _this.max;\n });\n }\n return ticks;\n };\n // 计算原始值值占的百分比\n Continuous.prototype.getScalePercent = function (value) {\n var max = this.max;\n var min = this.min;\n return (value - min) / (max - min);\n };\n Continuous.prototype.getInvertPercent = function (value) {\n return (value - this.rangeMin()) / (this.rangeMax() - this.rangeMin());\n };\n return Continuous;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Continuous);\n//# sourceMappingURL=base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/base.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalizeSegment\", function() { return normalizeSegment; });\n/**\n * Normalizes a single segment of a `PathArray` object.\n * eg. H/V -> L, T -> Q\n */\nfunction normalizeSegment(segment, params) {\n var pathCommand = segment[0];\n var px1 = params.x1, py1 = params.y1, px2 = params.x2, py2 = params.y2;\n var values = segment.slice(1).map(Number);\n var result = segment;\n if (!'TQ'.includes(pathCommand)) {\n // optional but good to be cautious\n params.qx = null;\n params.qy = null;\n }\n if (pathCommand === 'H') {\n result = ['L', segment[1], py1];\n }\n else if (pathCommand === 'V') {\n result = ['L', px1, segment[1]];\n }\n else if (pathCommand === 'S') {\n var x1 = px1 * 2 - px2;\n var y1 = py1 * 2 - py2;\n params.x1 = x1;\n params.y1 = y1;\n result = ['C', x1, y1].concat(values);\n }\n else if (pathCommand === 'T') {\n var qx = px1 * 2 - params.qx;\n var qy = py1 * 2 - params.qy;\n params.qx = qx;\n params.qy = qy;\n result = ['Q', qx, qy].concat(values);\n }\n else if (pathCommand === 'Q') {\n var nqx = values[0], nqy = values[1];\n params.qx = nqx;\n params.qy = nqy;\n }\n return result;\n}\n//# sourceMappingURL=normalize-segment.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-segment.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/continuous/linear.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/continuous/linear.js ***! - \***********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/quad-2-cubic.js": +/*!********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/quad-2-cubic.js ***! + \********************************************************************************************/ +/*! exports provided: quadToCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/continuous/base.js\");\n\n\n/**\n * 线性度量\n * @class\n */\nvar Linear = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Linear, _super);\n function Linear() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'linear';\n _this.isLinear = true;\n return _this;\n }\n Linear.prototype.invert = function (value) {\n var percent = this.getInvertPercent(value);\n return this.min + percent * (this.max - this.min);\n };\n Linear.prototype.initCfg = function () {\n this.tickMethod = 'wilkinson-extended';\n this.nice = false;\n };\n return Linear;\n}(_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Linear);\n//# sourceMappingURL=linear.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/linear.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadToCubic\", function() { return quadToCubic; });\nfunction quadToCubic(x1, y1, qx, qy, x2, y2) {\n var r13 = 1 / 3;\n var r23 = 2 / 3;\n return [\n r13 * x1 + r23 * qx,\n r13 * y1 + r23 * qy,\n r13 * x2 + r23 * qx,\n r13 * y2 + r23 * qy,\n x2,\n y2, // x,y\n ];\n}\n//# sourceMappingURL=quad-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/quad-2-cubic.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/continuous/log.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/continuous/log.js ***! - \********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/reverse-curve.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/reverse-curve.js ***! + \*********************************************************************************************/ +/*! exports provided: reverseCurve */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/scale/esm/util/math.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/continuous/base.js\");\n\n\n\n/**\n * Log 度量,处理非均匀分布\n */\nvar Log = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Log, _super);\n function Log() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'log';\n return _this;\n }\n /**\n * @override\n */\n Log.prototype.invert = function (value) {\n var base = this.base;\n var max = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, this.max);\n var rangeMin = this.rangeMin();\n var range = this.rangeMax() - rangeMin;\n var min;\n var positiveMin = this.positiveMin;\n if (positiveMin) {\n if (value === 0) {\n return 0;\n }\n min = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, positiveMin / base);\n var appendPercent = (1 / (max - min)) * range; // 0 到 positiveMin的占比\n if (value < appendPercent) {\n // 落到 0 - positiveMin 之间\n return (value / appendPercent) * positiveMin;\n }\n }\n else {\n min = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, this.min);\n }\n var percent = (value - rangeMin) / range;\n var tmp = percent * (max - min) + min;\n return Math.pow(base, tmp);\n };\n Log.prototype.initCfg = function () {\n this.tickMethod = 'log';\n this.base = 10;\n this.tickCount = 6;\n this.nice = true;\n };\n // 设置\n Log.prototype.setDomain = function () {\n _super.prototype.setDomain.call(this);\n var min = this.min;\n if (min < 0) {\n throw new Error('When you use log scale, the minimum value must be greater than zero!');\n }\n if (min === 0) {\n this.positiveMin = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"getLogPositiveMin\"])(this.values, this.base, this.max);\n }\n };\n // 根据当前值获取占比\n Log.prototype.getScalePercent = function (value) {\n var max = this.max;\n var min = this.min;\n if (max === min) {\n return 0;\n }\n // 如果值小于等于0,则按照0处理\n if (value <= 0) {\n return 0;\n }\n var base = this.base;\n var positiveMin = this.positiveMin;\n // 如果min == 0, 则根据比0大的最小值,计算比例关系。这个最小值作为坐标轴上的第二个tick,第一个是0但是不显示\n if (positiveMin) {\n min = (positiveMin * 1) / base;\n }\n var percent;\n // 如果数值小于次小值,那么就计算 value / 次小值 占整体的比例\n if (value < positiveMin) {\n percent = value / positiveMin / (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, max) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, min));\n }\n else {\n percent = (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, value) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, min)) / (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, max) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, min));\n }\n return percent;\n };\n return Log;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Log);\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/log.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"reverseCurve\", function() { return reverseCurve; });\n// reverse CURVE based pathArray segments only\nfunction reverseCurve(pathArray) {\n var rotatedCurve = pathArray\n .slice(1)\n .map(function (x, i, curveOnly) {\n // @ts-ignore\n return !i ? pathArray[0].slice(1).concat(x.slice(1)) : curveOnly[i - 1].slice(-2).concat(x.slice(1));\n })\n // @ts-ignore\n .map(function (x) { return x.map(function (y, i) { return x[x.length - i - 2 * (1 - (i % 2))]; }); })\n .reverse();\n return [['M'].concat(rotatedCurve[0].slice(0, 2))].concat(rotatedCurve.map(function (x) { return ['C'].concat(x.slice(2)); }));\n}\n//# sourceMappingURL=reverse-curve.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/reverse-curve.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/continuous/pow.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/continuous/pow.js ***! - \********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/round-path.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/round-path.js ***! + \******************************************************************************************/ +/*! exports provided: roundPath */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/scale/esm/util/math.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/continuous/base.js\");\n\n\n\n/**\n * Pow 度量,处理非均匀分布\n */\nvar Pow = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Pow, _super);\n function Pow() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'pow';\n return _this;\n }\n /**\n * @override\n */\n Pow.prototype.invert = function (value) {\n var percent = this.getInvertPercent(value);\n var exponent = this.exponent;\n var max = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, this.max);\n var min = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, this.min);\n var tmp = percent * (max - min) + min;\n var factor = tmp >= 0 ? 1 : -1;\n return Math.pow(tmp, exponent) * factor;\n };\n Pow.prototype.initCfg = function () {\n this.tickMethod = 'pow';\n this.exponent = 2;\n this.tickCount = 5;\n this.nice = true;\n };\n // 获取度量计算时,value占的定义域百分比\n Pow.prototype.getScalePercent = function (value) {\n var max = this.max;\n var min = this.min;\n if (max === min) {\n return 0;\n }\n var exponent = this.exponent;\n var percent = (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, value) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, min)) / (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, max) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, min));\n return percent;\n };\n return Pow;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Pow);\n//# sourceMappingURL=pow.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/pow.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"roundPath\", function() { return roundPath; });\n/**\n * Rounds the values of a `PathArray` instance to\n * a specified amount of decimals and returns it.\n */\nfunction roundPath(path, round) {\n if (round === 'off')\n return [].concat(path);\n // to round values to the power\n // the `round` value must be integer\n var pow = typeof round === 'number' && round >= 1 ? Math.pow(10, round) : 1;\n return path.map(function (pi) {\n var values = pi\n .slice(1)\n .map(Number)\n .map(function (n) { return (round ? Math.round(n * pow) / pow : Math.round(n)); });\n // @ts-ignore\n return [pi[0]].concat(values);\n });\n}\n//# sourceMappingURL=round-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/round-path.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/continuous/quantile.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/continuous/quantile.js ***! - \*************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/segment-2-cubic.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/segment-2-cubic.js ***! + \***********************************************************************************************/ +/*! exports provided: segmentToCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _quantize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quantize */ \"./node_modules/@antv/scale/esm/continuous/quantize.js\");\n\n\nvar Quantile = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Quantile, _super);\n function Quantile() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'quantile';\n return _this;\n }\n Quantile.prototype.initCfg = function () {\n this.tickMethod = 'quantile';\n this.tickCount = 5;\n this.nice = true;\n };\n return Quantile;\n}(_quantize__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Quantile);\n//# sourceMappingURL=quantile.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/quantile.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentToCubic\", function() { return segmentToCubic; });\n/* harmony import */ var _arc_2_cubic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arc-2-cubic */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/arc-2-cubic.js\");\n/* harmony import */ var _quad_2_cubic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quad-2-cubic */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/quad-2-cubic.js\");\n/* harmony import */ var _line_2_cubic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./line-2-cubic */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/line-2-cubic.js\");\n\n\n\nfunction segmentToCubic(segment, params) {\n var pathCommand = segment[0];\n var values = segment.slice(1).map(Number);\n var x = values[0], y = values[1];\n var args;\n var px1 = params.x1, py1 = params.y1, px = params.x, py = params.y;\n if (!'TQ'.includes(pathCommand)) {\n params.qx = null;\n params.qy = null;\n }\n switch (pathCommand) {\n case 'M':\n params.x = x;\n params.y = y;\n return segment;\n case 'A':\n args = [px1, py1].concat(values);\n // @ts-ignore\n return ['C'].concat(Object(_arc_2_cubic__WEBPACK_IMPORTED_MODULE_0__[\"arcToCubic\"])(args[0], args[1], args[2], args[3], args[4], args[5], args[6], args[7], args[8], args[9]));\n case 'Q':\n params.qx = x;\n params.qy = y;\n args = [px1, py1].concat(values);\n // @ts-ignore\n return ['C'].concat(Object(_quad_2_cubic__WEBPACK_IMPORTED_MODULE_1__[\"quadToCubic\"])(args[0], args[1], args[2], args[3], args[4], args[5]));\n case 'L':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(px1, py1, x, y));\n case 'Z':\n // prevent NaN from divide 0\n if (px1 === px && py1 === py) {\n return ['C', px1, py1, px, py, px, py];\n }\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(px1, py1, px, py));\n default:\n }\n return segment;\n}\n//# sourceMappingURL=segment-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/segment-2-cubic.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/continuous/quantize.js": -/*!*************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/continuous/quantize.js ***! - \*************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/types.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/types.js ***! + \*****************************************************************************/ +/*! no exports provided */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/continuous/base.js\");\n\n\n\n/**\n * 分段度量\n */\nvar Quantize = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Quantize, _super);\n function Quantize() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'quantize';\n return _this;\n }\n Quantize.prototype.invert = function (value) {\n var ticks = this.ticks;\n var length = ticks.length;\n var percent = this.getInvertPercent(value);\n var minIndex = Math.floor(percent * (length - 1));\n // 最后一个\n if (minIndex >= length - 1) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"last\"])(ticks);\n }\n // 超出左边界, 则取第一个\n if (minIndex < 0) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"head\"])(ticks);\n }\n var minTick = ticks[minIndex];\n var nextTick = ticks[minIndex + 1];\n // 比当前值小的 tick 在度量上的占比\n var minIndexPercent = minIndex / (length - 1);\n var maxIndexPercent = (minIndex + 1) / (length - 1);\n return minTick + (percent - minIndexPercent) / (maxIndexPercent - minIndexPercent) * (nextTick - minTick);\n };\n Quantize.prototype.initCfg = function () {\n this.tickMethod = 'r-pretty';\n this.tickCount = 5;\n this.nice = true;\n };\n Quantize.prototype.calculateTicks = function () {\n var ticks = _super.prototype.calculateTicks.call(this);\n if (!this.nice) { // 如果 nice = false ,补充 min, max\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"last\"])(ticks) !== this.max) {\n ticks.push(this.max);\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"head\"])(ticks) !== this.min) {\n ticks.unshift(this.min);\n }\n }\n return ticks;\n };\n // 计算当前值在刻度中的占比\n Quantize.prototype.getScalePercent = function (value) {\n var ticks = this.ticks;\n // 超出左边界\n if (value < Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"head\"])(ticks)) {\n return 0;\n }\n // 超出右边界\n if (value > Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"last\"])(ticks)) {\n return 1;\n }\n var minIndex = 0;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(ticks, function (tick, index) {\n if (value >= tick) {\n minIndex = index;\n }\n else {\n return false;\n }\n });\n return minIndex / (ticks.length - 1);\n };\n return Quantize;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Quantize);\n//# sourceMappingURL=quantize.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/quantize.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n\n//# sourceMappingURL=types.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/types.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/continuous/time.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/continuous/time.js ***! - \*********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js ***! + \*************************************************************************************************/ +/*! exports provided: distanceSquareRoot */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/time */ \"./node_modules/@antv/scale/esm/util/time.js\");\n/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linear */ \"./node_modules/@antv/scale/esm/continuous/linear.js\");\n\n\n\n\n/**\n * 时间度量\n * @class\n */\nvar Time = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Time, _super);\n function Time() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'time';\n return _this;\n }\n /**\n * @override\n */\n Time.prototype.getText = function (value, index) {\n var numberValue = this.translate(value);\n var formatter = this.formatter;\n return formatter ? formatter(numberValue, index) : Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"timeFormat\"])(numberValue, this.mask);\n };\n /**\n * @override\n */\n Time.prototype.scale = function (value) {\n var v = value;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(v) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isDate\"])(v)) {\n v = this.translate(v);\n }\n return _super.prototype.scale.call(this, v);\n };\n /**\n * 将时间转换成数字\n * @override\n */\n Time.prototype.translate = function (v) {\n return Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"toTimeStamp\"])(v);\n };\n Time.prototype.initCfg = function () {\n this.tickMethod = 'time-pretty';\n this.mask = 'YYYY-MM-DD';\n this.tickCount = 7;\n this.nice = false;\n };\n Time.prototype.setDomain = function () {\n var values = this.values;\n // 是否设置了 min, max,而不是直接取 this.min, this.max\n var minConfig = this.getConfig('min');\n var maxConfig = this.getConfig('max');\n // 如果设置了 min,max 则转换成时间戳\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(minConfig) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(minConfig)) {\n this.min = this.translate(this.min);\n }\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(maxConfig) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(maxConfig)) {\n this.max = this.translate(this.max);\n }\n // 没有设置 min, max 时\n if (values && values.length) {\n // 重新计算最大最小值\n var timeStamps_1 = [];\n var min_1 = Infinity; // 最小值\n var secondMin_1 = min_1; // 次小值\n var max_1 = 0;\n // 使用一个循环,计算min,max,secondMin\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(values, function (v) {\n var timeStamp = Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"toTimeStamp\"])(v);\n if (isNaN(timeStamp)) {\n throw new TypeError(\"Invalid Time: \" + v + \" in time scale!\");\n }\n if (min_1 > timeStamp) {\n secondMin_1 = min_1;\n min_1 = timeStamp;\n }\n else if (secondMin_1 > timeStamp) {\n secondMin_1 = timeStamp;\n }\n if (max_1 < timeStamp) {\n max_1 = timeStamp;\n }\n timeStamps_1.push(timeStamp);\n });\n // 存在多个值时,设置最小间距\n if (values.length > 1) {\n this.minTickInterval = secondMin_1 - min_1;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(minConfig)) {\n this.min = min_1;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(maxConfig)) {\n this.max = max_1;\n }\n }\n };\n return Time;\n}(_linear__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Time);\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/time.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distanceSquareRoot\", function() { return distanceSquareRoot; });\nfunction distanceSquareRoot(a, b) {\n return Math.sqrt((a[0] - b[0]) * (a[0] - b[0]) + (a[1] - b[1]) * (a[1] - b[1]));\n}\n//# sourceMappingURL=distance-square-root.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/factory.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/scale/esm/factory.js ***! - \*************************************************/ -/*! exports provided: Scale, getScale, registerScale */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/equalize-segments.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/equalize-segments.js ***! + \**********************************************************************************************/ +/*! exports provided: equalizeSegments */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScale\", function() { return getClass; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerScale\", function() { return registerClass; });\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Scale\", function() { return _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n\nvar map = {};\nfunction getClass(key) {\n return map[key];\n}\nfunction registerClass(key, cls) {\n if (getClass(key)) {\n throw new Error(\"type '\" + key + \"' existed.\");\n }\n map[key] = cls;\n}\n\n//# sourceMappingURL=factory.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/factory.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equalizeSegments\", function() { return equalizeSegments; });\n/* harmony import */ var _mid_point__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mid-point */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/mid-point.js\");\n/* harmony import */ var _segment_cubic_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./segment-cubic-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-cubic-factory.js\");\n\n\nfunction splitCubic(pts, t) {\n if (t === void 0) { t = 0.5; }\n var p0 = pts.slice(0, 2);\n var p1 = pts.slice(2, 4);\n var p2 = pts.slice(4, 6);\n var p3 = pts.slice(6, 8);\n var p4 = Object(_mid_point__WEBPACK_IMPORTED_MODULE_0__[\"midPoint\"])(p0, p1, t);\n var p5 = Object(_mid_point__WEBPACK_IMPORTED_MODULE_0__[\"midPoint\"])(p1, p2, t);\n var p6 = Object(_mid_point__WEBPACK_IMPORTED_MODULE_0__[\"midPoint\"])(p2, p3, t);\n var p7 = Object(_mid_point__WEBPACK_IMPORTED_MODULE_0__[\"midPoint\"])(p4, p5, t);\n var p8 = Object(_mid_point__WEBPACK_IMPORTED_MODULE_0__[\"midPoint\"])(p5, p6, t);\n var p9 = Object(_mid_point__WEBPACK_IMPORTED_MODULE_0__[\"midPoint\"])(p7, p8, t);\n return [\n // @ts-ignore\n ['C'].concat(p4, p7, p9),\n // @ts-ignore\n ['C'].concat(p8, p6, p3),\n ];\n}\nfunction getCurveArray(segments) {\n return segments.map(function (segment, i, pathArray) {\n // @ts-ignore\n var segmentData = i && pathArray[i - 1].slice(-2).concat(segment.slice(1));\n // @ts-ignore\n var curveLength = i\n ? Object(_segment_cubic_factory__WEBPACK_IMPORTED_MODULE_1__[\"segmentCubicFactory\"])(segmentData[0], segmentData[1], segmentData[2], segmentData[3], segmentData[4], segmentData[5], segmentData[6], segmentData[7], segmentData[8], { bbox: false }).length\n : 0;\n var subsegs;\n if (i) {\n // must be [segment,segment]\n subsegs = curveLength ? splitCubic(segmentData) : [segment, segment];\n }\n else {\n subsegs = [segment];\n }\n return {\n s: segment,\n ss: subsegs,\n l: curveLength,\n };\n });\n}\nfunction equalizeSegments(path1, path2, TL) {\n var c1 = getCurveArray(path1);\n var c2 = getCurveArray(path2);\n var L1 = c1.length;\n var L2 = c2.length;\n var l1 = c1.filter(function (x) { return x.l; }).length;\n var l2 = c2.filter(function (x) { return x.l; }).length;\n var m1 = c1.filter(function (x) { return x.l; }).reduce(function (a, _a) {\n var l = _a.l;\n return a + l;\n }, 0) / l1 || 0;\n var m2 = c2.filter(function (x) { return x.l; }).reduce(function (a, _a) {\n var l = _a.l;\n return a + l;\n }, 0) / l2 || 0;\n var tl = TL || Math.max(L1, L2);\n var mm = [m1, m2];\n var dif = [tl - L1, tl - L2];\n var canSplit = 0;\n var result = [c1, c2].map(function (x, i) {\n // @ts-ignore\n return x.l === tl\n ? x.map(function (y) { return y.s; })\n : x\n .map(function (y, j) {\n canSplit = j && dif[i] && y.l >= mm[i];\n dif[i] -= canSplit ? 1 : 0;\n return canSplit ? y.ss : [y.s];\n })\n .flat();\n });\n return result[0].length === result[1].length ? result : equalizeSegments(result[0], result[1], tl);\n}\n//# sourceMappingURL=equalize-segments.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/equalize-segments.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/identity/index.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/identity/index.js ***! - \********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-draw-direction.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-draw-direction.js ***! + \***********************************************************************************************/ +/*! exports provided: getDrawDirection */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/scale/esm/base.js\");\n\n\n\n/**\n * identity scale原则上是定义域和值域一致,scale/invert方法也是一致的\n * 参考R的实现:https://github.com/r-lib/scales/blob/master/R/pal-identity.r\n * 参考d3的实现(做了下转型):https://github.com/d3/d3-scale/blob/master/src/identity.js\n */\nvar Identity = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Identity, _super);\n function Identity() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'identity';\n _this.isIdentity = true;\n return _this;\n }\n Identity.prototype.calculateTicks = function () {\n return this.values;\n };\n Identity.prototype.scale = function (value) {\n // 如果传入的值不等于 identity 的值,则直接返回,用于一维图时的 dodge\n if (this.values[0] !== value && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value)) {\n return value;\n }\n return this.range[0];\n };\n Identity.prototype.invert = function (value) {\n var range = this.range;\n if (value < range[0] || value > range[1]) {\n return NaN;\n }\n return this.values[0];\n };\n return Identity;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Identity);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/identity/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDrawDirection\", function() { return getDrawDirection; });\n/* harmony import */ var _get_path_area__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-path-area */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-area.js\");\n\nfunction getDrawDirection(pathArray) {\n return Object(_get_path_area__WEBPACK_IMPORTED_MODULE_0__[\"getPathArea\"])(pathArray) >= 0;\n}\n//# sourceMappingURL=get-draw-direction.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-draw-direction.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/index.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/scale/esm/index.js ***! - \***********************************************/ -/*! exports provided: Category, Identity, Linear, Log, Pow, Time, TimeCat, Quantile, Quantize, Scale, getScale, registerScale, getTickMethod, registerTickMethod */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-area.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-area.js ***! + \******************************************************************************************/ +/*! exports provided: getPathArea */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Scale\", function() { return _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _category_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./category/base */ \"./node_modules/@antv/scale/esm/category/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Category\", function() { return _category_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _category_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./category/time */ \"./node_modules/@antv/scale/esm/category/time.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TimeCat\", function() { return _category_time__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _continuous_linear__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./continuous/linear */ \"./node_modules/@antv/scale/esm/continuous/linear.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Linear\", function() { return _continuous_linear__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _continuous_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./continuous/log */ \"./node_modules/@antv/scale/esm/continuous/log.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Log\", function() { return _continuous_log__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _continuous_pow__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./continuous/pow */ \"./node_modules/@antv/scale/esm/continuous/pow.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Pow\", function() { return _continuous_pow__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _continuous_time__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./continuous/time */ \"./node_modules/@antv/scale/esm/continuous/time.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Time\", function() { return _continuous_time__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _continuous_quantize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./continuous/quantize */ \"./node_modules/@antv/scale/esm/continuous/quantize.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Quantize\", function() { return _continuous_quantize__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _continuous_quantile__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./continuous/quantile */ \"./node_modules/@antv/scale/esm/continuous/quantile.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Quantile\", function() { return _continuous_quantile__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./factory */ \"./node_modules/@antv/scale/esm/factory.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getScale\", function() { return _factory__WEBPACK_IMPORTED_MODULE_9__[\"getScale\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerScale\", function() { return _factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"]; });\n\n/* harmony import */ var _identity_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./identity/index */ \"./node_modules/@antv/scale/esm/identity/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Identity\", function() { return _identity_index__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _tick_method_index__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./tick-method/index */ \"./node_modules/@antv/scale/esm/tick-method/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTickMethod\", function() { return _tick_method_index__WEBPACK_IMPORTED_MODULE_11__[\"getTickMethod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerTickMethod\", function() { return _tick_method_index__WEBPACK_IMPORTED_MODULE_11__[\"registerTickMethod\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('cat', _category_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('category', _category_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('identity', _identity_index__WEBPACK_IMPORTED_MODULE_10__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('linear', _continuous_linear__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('log', _continuous_log__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('pow', _continuous_pow__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('time', _continuous_time__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('timeCat', _category_time__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('quantize', _continuous_quantize__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('quantile', _continuous_quantile__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPathArea\", function() { return getPathArea; });\n/* harmony import */ var _convert_path_2_curve__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../convert/path-2-curve */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/convert/path-2-curve.js\");\n\n/**\n * Returns the area of a single cubic-bezier segment.\n *\n * http://objectmix.com/graphics/133553-area-closed-bezier-curve.html\n */\nfunction getCubicSegArea(x1, y1, c1x, c1y, c2x, c2y, x2, y2) {\n // https://stackoverflow.com/a/15845996\n return ((3 *\n ((y2 - y1) * (c1x + c2x) -\n (x2 - x1) * (c1y + c2y) +\n c1y * (x1 - c2x) -\n c1x * (y1 - c2y) +\n y2 * (c2x + x1 / 3) -\n x2 * (c2y + y1 / 3))) /\n 20);\n}\n/**\n * Returns the area of a shape.\n * @author Jürg Lehni & Jonathan Puckey\n *\n * @see https://github.com/paperjs/paper.js/blob/develop/src/path/Path.js\n */\nfunction getPathArea(path) {\n var x = 0;\n var y = 0;\n var len = 0;\n return Object(_convert_path_2_curve__WEBPACK_IMPORTED_MODULE_0__[\"path2Curve\"])(path)\n .map(function (seg) {\n var _a;\n switch (seg[0]) {\n case 'M':\n x = seg[1], y = seg[2];\n return 0;\n default:\n // @ts-ignore\n var _b = seg.slice(1), c1x = _b[0], c1y = _b[1], c2x = _b[2], c2y = _b[3], x2 = _b[4], y2 = _b[5];\n len = getCubicSegArea(x, y, c1x, c1y, c2x, c2y, x2, y2);\n _a = seg.slice(-2), x = _a[0], y = _a[1];\n return len;\n }\n })\n .reduce(function (a, b) { return a + b; }, 0);\n}\n// export function getPathArea(pathArray: AbsoluteArray) {\n// let x = 0;\n// let y = 0;\n// let mx = 0;\n// let my = 0;\n// let len = 0;\n// return pathArray\n// .map((seg) => {\n// switch (seg[0]) {\n// case 'M':\n// case 'Z':\n// mx = seg[0] === 'M' ? seg[1] : mx;\n// my = seg[0] === 'M' ? seg[2] : my;\n// x = mx;\n// y = my;\n// return 0;\n// default:\n// // @ts-ignore\n// len = getCubicSegArea.apply(0, [x, y].concat(seg.slice(1)));\n// [x, y] = seg.slice(-2) as [number, number];\n// return len;\n// }\n// })\n// .reduce((a, b) => a + b, 0);\n// }\n//# sourceMappingURL=get-path-area.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-area.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/cat.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/cat.js ***! - \*********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-bbox-total-length.js": +/*!*******************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-bbox-total-length.js ***! + \*******************************************************************************************************/ +/*! exports provided: getPathBBoxTotalLength */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculateCatTicks; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n/**\n * 计算分类 ticks\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction calculateCatTicks(cfg) {\n var values = cfg.values, tickInterval = cfg.tickInterval, tickCount = cfg.tickCount, showLast = cfg.showLast;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(tickInterval)) {\n var ticks_1 = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"filter\"])(values, function (__, i) { return i % tickInterval === 0; });\n var lastValue = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(values);\n if (showLast && Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks_1) !== lastValue) {\n ticks_1.push(lastValue);\n }\n return ticks_1;\n }\n var len = values.length;\n var min = cfg.min, max = cfg.max;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(min)) {\n min = 0;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(max)) {\n max = values.length - 1;\n }\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(tickCount) || tickCount >= len)\n return values.slice(min, max + 1);\n if (tickCount <= 0 || max <= 0)\n return [];\n var interval = tickCount === 1 ? len : Math.floor(len / (tickCount - 1));\n var ticks = [];\n var idx = min;\n for (var i = 0; i < tickCount; i++) {\n if (idx >= max)\n break;\n idx = Math.min(min + i * interval, max);\n if (i === tickCount - 1 && showLast)\n ticks.push(values[max]);\n else\n ticks.push(values[idx]);\n }\n return ticks;\n}\n//# sourceMappingURL=cat.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/cat.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPathBBoxTotalLength\", function() { return getPathBBoxTotalLength; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _path_length_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path-length-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/path-length-factory.js\");\n\n\n/**\n * Returns the bounding box of a shape.\n */\nfunction getPathBBoxTotalLength(path, options) {\n if (!path) {\n return {\n length: 0,\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n x2: 0,\n y2: 0,\n cx: 0,\n cy: 0,\n cz: 0,\n };\n }\n var _a = Object(_path_length_factory__WEBPACK_IMPORTED_MODULE_1__[\"pathLengthFactory\"])(path, undefined, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, options), { bbox: true, length: true })), length = _a.length, _b = _a.min, xMin = _b.x, yMin = _b.y, _c = _a.max, xMax = _c.x, yMax = _c.y;\n var width = xMax - xMin;\n var height = yMax - yMin;\n return {\n length: length,\n width: width,\n height: height,\n x: xMin,\n y: yMin,\n x2: xMax,\n y2: yMax,\n cx: xMin + width / 2,\n cy: yMin + height / 2,\n // an estimted guess\n cz: Math.max(width, height) + Math.min(width, height) / 2,\n };\n}\n//# sourceMappingURL=get-path-bbox-total-length.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-bbox-total-length.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/d3-linear.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/d3-linear.js ***! - \***************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-bbox.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-bbox.js ***! + \******************************************************************************************/ +/*! exports provided: getPathBBox */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return d3LinearTickMethod; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_d3_linear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/d3-linear */ \"./node_modules/@antv/scale/esm/util/d3-linear.js\");\n/* harmony import */ var _util_interval__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/interval */ \"./node_modules/@antv/scale/esm/util/interval.js\");\n/* harmony import */ var _util_strict_limit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/strict-limit */ \"./node_modules/@antv/scale/esm/util/strict-limit.js\");\n\n\n\n\nfunction d3LinearTickMethod(cfg) {\n var min = cfg.min, max = cfg.max, tickInterval = cfg.tickInterval, minLimit = cfg.minLimit, maxLimit = cfg.maxLimit;\n var ticks = Object(_util_d3_linear__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(cfg);\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(minLimit) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(maxLimit)) {\n return Object(_util_strict_limit__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(cfg, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"head\"])(ticks), Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks));\n }\n if (tickInterval) {\n return Object(_util_interval__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(min, max, tickInterval).ticks;\n }\n return ticks;\n}\n//# sourceMappingURL=d3-linear.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/d3-linear.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPathBBox\", function() { return getPathBBox; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _path_length_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path-length-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/path-length-factory.js\");\n\n\n/**\n * Returns the bounding box of a shape.\n */\nfunction getPathBBox(path, options) {\n if (!path) {\n return {\n x: 0,\n y: 0,\n width: 0,\n height: 0,\n x2: 0,\n y2: 0,\n cx: 0,\n cy: 0,\n cz: 0,\n };\n }\n var _a = Object(_path_length_factory__WEBPACK_IMPORTED_MODULE_1__[\"pathLengthFactory\"])(path, undefined, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, options), { length: false })), _b = _a.min, xMin = _b.x, yMin = _b.y, _c = _a.max, xMax = _c.x, yMax = _c.y;\n var width = xMax - xMin;\n var height = yMax - yMin;\n return {\n width: width,\n height: height,\n x: xMin,\n y: yMin,\n x2: xMax,\n y2: yMax,\n cx: xMin + width / 2,\n cy: yMin + height / 2,\n // an estimted guess\n cz: Math.max(width, height) + Math.min(width, height) / 2,\n };\n}\n//# sourceMappingURL=get-path-bbox.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-path-bbox.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/index.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/index.js ***! - \***********************************************************/ -/*! exports provided: getTickMethod, registerTickMethod */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-point-at-length.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-point-at-length.js ***! + \************************************************************************************************/ +/*! exports provided: getPointAtLength */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _cat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cat */ \"./node_modules/@antv/scale/esm/tick-method/cat.js\");\n/* harmony import */ var _d3_linear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./d3-linear */ \"./node_modules/@antv/scale/esm/tick-method/d3-linear.js\");\n/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linear */ \"./node_modules/@antv/scale/esm/tick-method/linear.js\");\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./log */ \"./node_modules/@antv/scale/esm/tick-method/log.js\");\n/* harmony import */ var _pow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pow */ \"./node_modules/@antv/scale/esm/tick-method/pow.js\");\n/* harmony import */ var _quantile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quantile */ \"./node_modules/@antv/scale/esm/tick-method/quantile.js\");\n/* harmony import */ var _r_prettry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./r-prettry */ \"./node_modules/@antv/scale/esm/tick-method/r-prettry.js\");\n/* harmony import */ var _register__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./register */ \"./node_modules/@antv/scale/esm/tick-method/register.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTickMethod\", function() { return _register__WEBPACK_IMPORTED_MODULE_7__[\"getTickMethod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerTickMethod\", function() { return _register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"]; });\n\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./time */ \"./node_modules/@antv/scale/esm/tick-method/time.js\");\n/* harmony import */ var _time_cat__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./time-cat */ \"./node_modules/@antv/scale/esm/tick-method/time-cat.js\");\n/* harmony import */ var _time_pretty__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./time-pretty */ \"./node_modules/@antv/scale/esm/tick-method/time-pretty.js\");\n\n\n\n\n\n\n\n\n\n\n\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('cat', _cat__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('time-cat', _time_cat__WEBPACK_IMPORTED_MODULE_9__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('wilkinson-extended', _linear__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('r-pretty', _r_prettry__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('time', _time__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('time-pretty', _time_pretty__WEBPACK_IMPORTED_MODULE_10__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('log', _log__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('pow', _pow__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('quantile', _quantile__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('d3-linear', _d3_linear__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPointAtLength\", function() { return getPointAtLength; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _path_length_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path-length-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/path-length-factory.js\");\n\n\n/**\n * Returns [x,y] coordinates of a point at a given length of a shape.\n */\nfunction getPointAtLength(pathInput, distance, options) {\n return Object(_path_length_factory__WEBPACK_IMPORTED_MODULE_1__[\"pathLengthFactory\"])(pathInput, distance, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, options), { bbox: false, length: true })).point;\n}\n//# sourceMappingURL=get-point-at-length.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-point-at-length.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/linear.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/linear.js ***! - \************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-properties-at-length.js": +/*!*****************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-properties-at-length.js ***! + \*****************************************************************************************************/ +/*! exports provided: getPropertiesAtLength */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return linear; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_extended__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/extended */ \"./node_modules/@antv/scale/esm/util/extended.js\");\n/* harmony import */ var _util_interval__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/interval */ \"./node_modules/@antv/scale/esm/util/interval.js\");\n/* harmony import */ var _util_strict_limit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/strict-limit */ \"./node_modules/@antv/scale/esm/util/strict-limit.js\");\n\n\n\n\n/**\n * 计算线性的 ticks,使用 wilkinson extended 方法\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction linear(cfg) {\n var min = cfg.min, max = cfg.max, tickCount = cfg.tickCount, nice = cfg.nice, tickInterval = cfg.tickInterval, minLimit = cfg.minLimit, maxLimit = cfg.maxLimit;\n var ticks = Object(_util_extended__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(min, max, tickCount, nice).ticks;\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(minLimit) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(maxLimit)) {\n return Object(_util_strict_limit__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(cfg, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"head\"])(ticks), Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks));\n }\n if (tickInterval) {\n return Object(_util_interval__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(min, max, tickInterval).ticks;\n }\n return ticks;\n}\n//# sourceMappingURL=linear.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/linear.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPropertiesAtLength\", function() { return getPropertiesAtLength; });\n/* harmony import */ var _parser_parse_path_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/parse-path-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/parse-path-string.js\");\n/* harmony import */ var _get_total_length__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get-total-length */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-total-length.js\");\n\n\n/**\n * Returns the segment, its index and length as well as\n * the length to that segment at a given length in a path.\n */\nfunction getPropertiesAtLength(pathInput, distance) {\n var pathArray = Object(_parser_parse_path_string__WEBPACK_IMPORTED_MODULE_0__[\"parsePathString\"])(pathInput);\n if (typeof pathArray === 'string') {\n throw TypeError(pathArray);\n }\n var pathTemp = pathArray.slice();\n var pathLength = Object(_get_total_length__WEBPACK_IMPORTED_MODULE_1__[\"getTotalLength\"])(pathTemp);\n var index = pathTemp.length - 1;\n var lengthAtSegment = 0;\n var length = 0;\n var segment = pathArray[0];\n var _a = segment.slice(-2), x = _a[0], y = _a[1];\n var point = { x: x, y: y };\n // If the path is empty, return 0.\n if (index <= 0 || !distance || !Number.isFinite(distance)) {\n return {\n segment: segment,\n index: 0,\n length: length,\n point: point,\n lengthAtSegment: lengthAtSegment,\n };\n }\n if (distance >= pathLength) {\n pathTemp = pathArray.slice(0, -1);\n lengthAtSegment = Object(_get_total_length__WEBPACK_IMPORTED_MODULE_1__[\"getTotalLength\"])(pathTemp);\n length = pathLength - lengthAtSegment;\n return {\n segment: pathArray[index],\n index: index,\n length: length,\n lengthAtSegment: lengthAtSegment,\n };\n }\n var segments = [];\n while (index > 0) {\n segment = pathTemp[index];\n pathTemp = pathTemp.slice(0, -1);\n lengthAtSegment = Object(_get_total_length__WEBPACK_IMPORTED_MODULE_1__[\"getTotalLength\"])(pathTemp);\n length = pathLength - lengthAtSegment;\n pathLength = lengthAtSegment;\n segments.push({\n segment: segment,\n index: index,\n length: length,\n lengthAtSegment: lengthAtSegment,\n });\n index -= 1;\n }\n return segments.find(function (_a) {\n var l = _a.lengthAtSegment;\n return l <= distance;\n });\n}\n//# sourceMappingURL=get-properties-at-length.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-properties-at-length.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/log.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/log.js ***! - \*********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-properties-at-point.js": +/*!****************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-properties-at-point.js ***! + \****************************************************************************************************/ +/*! exports provided: getPropertiesAtPoint */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculateLogTicks; });\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/scale/esm/util/math.js\");\n\n/**\n * 计算 log 的 ticks,考虑 min = 0 的场景\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction calculateLogTicks(cfg) {\n var base = cfg.base, tickCount = cfg.tickCount, min = cfg.min, max = cfg.max, values = cfg.values;\n var minTick;\n var maxTick = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"log\"])(base, max);\n if (min > 0) {\n minTick = Math.floor(Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"log\"])(base, min));\n }\n else {\n var positiveMin = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"getLogPositiveMin\"])(values, base, max);\n minTick = Math.floor(Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"log\"])(base, positiveMin));\n }\n var count = maxTick - minTick;\n var avg = Math.ceil(count / tickCount);\n var ticks = [];\n for (var i = minTick; i < maxTick + avg; i = i + avg) {\n ticks.push(Math.pow(base, i));\n }\n if (min <= 0) {\n // 最小值 <= 0 时显示 0\n ticks.unshift(0);\n }\n return ticks;\n}\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/log.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getPropertiesAtPoint\", function() { return getPropertiesAtPoint; });\n/* harmony import */ var _parser_parse_path_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/parse-path-string */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/parse-path-string.js\");\n/* harmony import */ var _process_normalize_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../process/normalize-path */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-path.js\");\n/* harmony import */ var _get_point_at_length__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-point-at-length */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-point-at-length.js\");\n/* harmony import */ var _get_properties_at_length__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./get-properties-at-length */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-properties-at-length.js\");\n/* harmony import */ var _get_total_length__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./get-total-length */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-total-length.js\");\n\n\n\n\n\n/**\n * Returns the point and segment in path closest to a given point as well as\n * the distance to the path stroke.\n * @see https://bl.ocks.org/mbostock/8027637\n */\nfunction getPropertiesAtPoint(pathInput, point) {\n var path = Object(_parser_parse_path_string__WEBPACK_IMPORTED_MODULE_0__[\"parsePathString\"])(pathInput);\n var normalPath = Object(_process_normalize_path__WEBPACK_IMPORTED_MODULE_1__[\"normalizePath\"])(path);\n var pathLength = Object(_get_total_length__WEBPACK_IMPORTED_MODULE_4__[\"getTotalLength\"])(path);\n var distanceTo = function (p) {\n var dx = p.x - point.x;\n var dy = p.y - point.y;\n return dx * dx + dy * dy;\n };\n var precision = 8;\n var scan;\n var scanDistance = 0;\n var closest;\n var bestLength = 0;\n var bestDistance = Infinity;\n // linear scan for coarse approximation\n for (var scanLength = 0; scanLength <= pathLength; scanLength += precision) {\n scan = Object(_get_point_at_length__WEBPACK_IMPORTED_MODULE_2__[\"getPointAtLength\"])(normalPath, scanLength);\n scanDistance = distanceTo(scan);\n if (scanDistance < bestDistance) {\n closest = scan;\n bestLength = scanLength;\n bestDistance = scanDistance;\n }\n }\n // binary search for precise estimate\n precision /= 2;\n var before;\n var after;\n var beforeLength = 0;\n var afterLength = 0;\n var beforeDistance = 0;\n var afterDistance = 0;\n while (precision > 0.5) {\n beforeLength = bestLength - precision;\n before = Object(_get_point_at_length__WEBPACK_IMPORTED_MODULE_2__[\"getPointAtLength\"])(normalPath, beforeLength);\n beforeDistance = distanceTo(before);\n afterLength = bestLength + precision;\n after = Object(_get_point_at_length__WEBPACK_IMPORTED_MODULE_2__[\"getPointAtLength\"])(normalPath, afterLength);\n afterDistance = distanceTo(after);\n if (beforeLength >= 0 && beforeDistance < bestDistance) {\n closest = before;\n bestLength = beforeLength;\n bestDistance = beforeDistance;\n }\n else if (afterLength <= pathLength && afterDistance < bestDistance) {\n closest = after;\n bestLength = afterLength;\n bestDistance = afterDistance;\n }\n else {\n precision /= 2;\n }\n }\n var segment = Object(_get_properties_at_length__WEBPACK_IMPORTED_MODULE_3__[\"getPropertiesAtLength\"])(path, bestLength);\n var distance = Math.sqrt(bestDistance);\n return { closest: closest, distance: distance, segment: segment };\n}\n//# sourceMappingURL=get-properties-at-point.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-properties-at-point.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/pow.js": -/*!*********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/pow.js ***! - \*********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-rotated-curve.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-rotated-curve.js ***! + \**********************************************************************************************/ +/*! exports provided: getRotatedCurve */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculatePowTicks; });\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/scale/esm/util/math.js\");\n/* harmony import */ var _util_pretty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/pretty */ \"./node_modules/@antv/scale/esm/util/pretty.js\");\n\n\n/**\n * 计算 Pow 的 ticks\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction calculatePowTicks(cfg) {\n var exponent = cfg.exponent, tickCount = cfg.tickCount;\n var max = Math.ceil(Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"calBase\"])(exponent, cfg.max));\n var min = Math.floor(Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"calBase\"])(exponent, cfg.min));\n var ticks = Object(_util_pretty__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(min, max, tickCount).ticks;\n return ticks.map(function (tick) {\n var factor = tick >= 0 ? 1 : -1;\n return Math.pow(tick, exponent) * factor;\n });\n}\n//# sourceMappingURL=pow.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/pow.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRotatedCurve\", function() { return getRotatedCurve; });\n/* harmony import */ var _distance_square_root__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distance-square-root */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js\");\n\nfunction getRotations(a) {\n var segCount = a.length;\n var pointCount = segCount - 1;\n return a.map(function (f, idx) {\n return a.map(function (p, i) {\n var oldSegIdx = idx + i;\n var seg;\n if (i === 0 || (a[oldSegIdx] && a[oldSegIdx][0] === 'M')) {\n seg = a[oldSegIdx];\n return ['M'].concat(seg.slice(-2));\n }\n if (oldSegIdx >= segCount)\n oldSegIdx -= pointCount;\n return a[oldSegIdx];\n });\n });\n}\nfunction getRotatedCurve(a, b) {\n var segCount = a.length - 1;\n var lineLengths = [];\n var computedIndex = 0;\n var sumLensSqrd = 0;\n var rotations = getRotations(a);\n rotations.forEach(function (r, i) {\n a.slice(1).forEach(function (s, j) {\n // @ts-ignore\n sumLensSqrd += Object(_distance_square_root__WEBPACK_IMPORTED_MODULE_0__[\"distanceSquareRoot\"])(a[(i + j) % segCount].slice(-2), b[j % segCount].slice(-2));\n });\n lineLengths[i] = sumLensSqrd;\n sumLensSqrd = 0;\n });\n computedIndex = lineLengths.indexOf(Math.min.apply(null, lineLengths));\n return rotations[computedIndex];\n}\n//# sourceMappingURL=get-rotated-curve.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-rotated-curve.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/quantile.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/quantile.js ***! - \**************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-total-length.js": +/*!*********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-total-length.js ***! + \*********************************************************************************************/ +/*! exports provided: getTotalLength */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculateTicks; });\n/**\n * 计算几分位 https://github.com/simple-statistics/simple-statistics/blob/master/src/quantile_sorted.js\n * @param x 数组\n * @param p 百分比\n */\nfunction quantileSorted(x, p) {\n var idx = x.length * p;\n /*if (x.length === 0) { // 当前场景这些条件不可能命中\n throw new Error('quantile requires at least one value.');\n } else if (p < 0 || p > 1) {\n throw new Error('quantiles must be between 0 and 1');\n } else */\n if (p === 1) {\n // If p is 1, directly return the last element\n return x[x.length - 1];\n }\n else if (p === 0) {\n // If p is 0, directly return the first element\n return x[0];\n }\n else if (idx % 1 !== 0) {\n // If p is not integer, return the next element in array\n return x[Math.ceil(idx) - 1];\n }\n else if (x.length % 2 === 0) {\n // If the list has even-length, we'll take the average of this number\n // and the next value, if there is one\n return (x[idx - 1] + x[idx]) / 2;\n }\n else {\n // Finally, in the simple case of an integer value\n // with an odd-length list, return the x value at the index.\n return x[idx];\n }\n}\nfunction calculateTicks(cfg) {\n var tickCount = cfg.tickCount, values = cfg.values;\n if (!values || !values.length) {\n return [];\n }\n var sorted = values.slice().sort(function (a, b) {\n return a - b;\n });\n var ticks = [];\n for (var i = 0; i < tickCount; i++) {\n var p = i / (tickCount - 1);\n ticks.push(quantileSorted(sorted, p));\n }\n return ticks;\n}\n//# sourceMappingURL=quantile.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/quantile.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTotalLength\", function() { return getTotalLength; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _path_length_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./path-length-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/path-length-factory.js\");\n\n\n/**\n * Returns the shape total length, or the equivalent to `shape.getTotalLength()`.\n *\n * The `normalizePath` version is lighter, faster, more efficient and more accurate\n * with paths that are not `curveArray`.\n */\nfunction getTotalLength(pathInput, options) {\n return Object(_path_length_factory__WEBPACK_IMPORTED_MODULE_1__[\"pathLengthFactory\"])(pathInput, undefined, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({}, options), { bbox: false, length: true })).length;\n}\n//# sourceMappingURL=get-total-length.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-total-length.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/r-prettry.js": -/*!***************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/r-prettry.js ***! - \***************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-absolute-array.js": +/*!**********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-absolute-array.js ***! + \**********************************************************************************************/ +/*! exports provided: isAbsoluteArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return linearPretty; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_interval__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/interval */ \"./node_modules/@antv/scale/esm/util/interval.js\");\n/* harmony import */ var _util_pretty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/pretty */ \"./node_modules/@antv/scale/esm/util/pretty.js\");\n/* harmony import */ var _util_strict_limit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/strict-limit */ \"./node_modules/@antv/scale/esm/util/strict-limit.js\");\n\n\n\n\n/**\n * 计算线性的 ticks,使用 R's pretty 方法\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction linearPretty(cfg) {\n var min = cfg.min, max = cfg.max, tickCount = cfg.tickCount, tickInterval = cfg.tickInterval, minLimit = cfg.minLimit, maxLimit = cfg.maxLimit;\n var ticks = Object(_util_pretty__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(min, max, tickCount).ticks;\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(minLimit) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(maxLimit)) {\n return Object(_util_strict_limit__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(cfg, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"head\"])(ticks), Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks));\n }\n if (tickInterval) {\n return Object(_util_interval__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(min, max, tickInterval).ticks;\n }\n return ticks;\n}\n//# sourceMappingURL=r-prettry.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/r-prettry.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAbsoluteArray\", function() { return isAbsoluteArray; });\n/* harmony import */ var _is_path_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-path-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-path-array.js\");\n\n/**\n * Iterates an array to check if it's a `PathArray`\n * with all absolute values.\n */\nfunction isAbsoluteArray(path) {\n return (Object(_is_path_array__WEBPACK_IMPORTED_MODULE_0__[\"isPathArray\"])(path) &&\n // @ts-ignore -- `isPathArray` also checks if it's `Array`\n path.every(function (_a) {\n var x = _a[0];\n return x === x.toUpperCase();\n }));\n}\n//# sourceMappingURL=is-absolute-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-absolute-array.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/register.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/register.js ***! - \**************************************************************/ -/*! exports provided: getTickMethod, registerTickMethod */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-curve-array.js": +/*!*******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-curve-array.js ***! + \*******************************************************************************************/ +/*! exports provided: isCurveArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTickMethod\", function() { return getTickMethod; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerTickMethod\", function() { return registerTickMethod; });\nvar methodCache = {};\n/**\n * 获取计算 ticks 的方法\n * @param key 键值\n * @returns 计算 ticks 的方法\n */\nfunction getTickMethod(key) {\n return methodCache[key];\n}\n/**\n * 注册计算 ticks 的方法\n * @param key 键值\n * @param method 方法\n */\nfunction registerTickMethod(key, method) {\n methodCache[key] = method;\n}\n//# sourceMappingURL=register.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/register.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isCurveArray\", function() { return isCurveArray; });\n/* harmony import */ var _is_normalized_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-normalized-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-normalized-array.js\");\n\n/**\n * Iterates an array to check if it's a `PathArray`\n * with all C (cubic bezier) segments.\n *\n * @param {string | PathArray} path the `Array` to be checked\n * @returns {boolean} iteration result\n */\nfunction isCurveArray(path) {\n return Object(_is_normalized_array__WEBPACK_IMPORTED_MODULE_0__[\"isNormalizedArray\"])(path) && path.every(function (_a) {\n var pc = _a[0];\n return 'MC'.includes(pc);\n });\n}\n//# sourceMappingURL=is-curve-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-curve-array.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/time-cat.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/time-cat.js ***! - \**************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-normalized-array.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-normalized-array.js ***! + \************************************************************************************************/ +/*! exports provided: isNormalizedArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return timeCat; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _cat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cat */ \"./node_modules/@antv/scale/esm/tick-method/cat.js\");\n\n\n/**\n * 计算时间分类的 ticks, 保头,保尾\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction timeCat(cfg) {\n // 默认保留最后一条\n var ticks = Object(_cat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({ showLast: true }, cfg));\n return ticks;\n}\n//# sourceMappingURL=time-cat.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/time-cat.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNormalizedArray\", function() { return isNormalizedArray; });\n/* harmony import */ var _is_absolute_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-absolute-array */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-absolute-array.js\");\n\n/**\n * Iterates an array to check if it's a `PathArray`\n * with all segments are in non-shorthand notation\n * with absolute values.\n */\nfunction isNormalizedArray(path) {\n return Object(_is_absolute_array__WEBPACK_IMPORTED_MODULE_0__[\"isAbsoluteArray\"])(path) && path.every(function (_a) {\n var pc = _a[0];\n return 'ACLMQZ'.includes(pc);\n });\n}\n//# sourceMappingURL=is-normalized-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-normalized-array.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/time-pretty.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/time-pretty.js ***! - \*****************************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-path-array.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-path-array.js ***! + \******************************************************************************************/ +/*! exports provided: isPathArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return timePretty; });\n/* harmony import */ var _util_time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/time */ \"./node_modules/@antv/scale/esm/util/time.js\");\n\nfunction getYear(date) {\n return new Date(date).getFullYear();\n}\nfunction createYear(year) {\n return new Date(year, 0, 1).getTime();\n}\nfunction getMonth(date) {\n return new Date(date).getMonth();\n}\nfunction diffMonth(min, max) {\n var minYear = getYear(min);\n var maxYear = getYear(max);\n var minMonth = getMonth(min);\n var maxMonth = getMonth(max);\n return (maxYear - minYear) * 12 + ((maxMonth - minMonth) % 12);\n}\nfunction creatMonth(year, month) {\n return new Date(year, month, 1).getTime();\n}\nfunction diffDay(min, max) {\n return Math.ceil((max - min) / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"DAY\"]);\n}\nfunction diffHour(min, max) {\n return Math.ceil((max - min) / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"HOUR\"]);\n}\nfunction diffMinus(min, max) {\n return Math.ceil((max - min) / (60 * 1000));\n}\n/**\n * 计算 time 的 ticks,对 month, year 进行 pretty 处理\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction timePretty(cfg) {\n var min = cfg.min, max = cfg.max, minTickInterval = cfg.minTickInterval, tickCount = cfg.tickCount;\n var tickInterval = cfg.tickInterval;\n var ticks = [];\n // 指定 tickInterval 后 tickCount 不生效,需要重新计算\n if (!tickInterval) {\n tickInterval = (max - min) / tickCount;\n // 如果设置了最小间距,则使用最小间距\n if (minTickInterval && tickInterval < minTickInterval) {\n tickInterval = minTickInterval;\n }\n }\n tickInterval = Math.max(Math.floor((max - min) / (Math.pow(2, 12) - 1)), tickInterval);\n var minYear = getYear(min);\n // 如果间距大于 1 年,则将开始日期从整年开始\n if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"YEAR\"]) {\n var maxYear = getYear(max);\n var yearInterval = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"YEAR\"]);\n for (var i = minYear; i <= maxYear + yearInterval; i = i + yearInterval) {\n ticks.push(createYear(i));\n }\n }\n else if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MONTH\"]) {\n // 大于月时\n var monthInterval = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MONTH\"]);\n var mmMoth = getMonth(min);\n var dMonths = diffMonth(min, max);\n for (var i = 0; i <= dMonths + monthInterval; i = i + monthInterval) {\n ticks.push(creatMonth(minYear, i + mmMoth));\n }\n }\n else if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"DAY\"]) {\n // 大于天\n var date = new Date(min);\n var year = date.getFullYear();\n var month = date.getMonth();\n var mday = date.getDate();\n var day = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"DAY\"]);\n var ddays = diffDay(min, max);\n for (var i = 0; i < ddays + day; i = i + day) {\n ticks.push(new Date(year, month, mday + i).getTime());\n }\n }\n else if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"HOUR\"]) {\n // 大于小时\n var date = new Date(min);\n var year = date.getFullYear();\n var month = date.getMonth();\n var day = date.getDate();\n var hour = date.getHours();\n var hours = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"HOUR\"]);\n var dHours = diffHour(min, max);\n for (var i = 0; i <= dHours + hours; i = i + hours) {\n ticks.push(new Date(year, month, day, hour + i).getTime());\n }\n }\n else if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MINUTE\"]) {\n // 大于分钟\n var dMinus = diffMinus(min, max);\n var minutes = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MINUTE\"]);\n for (var i = 0; i <= dMinus + minutes; i = i + minutes) {\n ticks.push(min + i * _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MINUTE\"]);\n }\n }\n else {\n // 小于分钟\n var interval = tickInterval;\n if (interval < _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]) {\n interval = _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"];\n }\n var minSecond = Math.floor(min / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]) * _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"];\n var dSeconds = Math.ceil((max - min) / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]);\n var seconds = Math.ceil(interval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]);\n for (var i = 0; i < dSeconds + seconds; i = i + seconds) {\n ticks.push(minSecond + i * _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]);\n }\n }\n // 最好是能从算法能解决这个问题,但是如果指定了 tickInterval,计算 ticks,也只能这么算,所以\n // 打印警告提示\n if (ticks.length >= 512) {\n console.warn(\"Notice: current ticks length(\" + ticks.length + \") >= 512, may cause performance issues, even out of memory. Because of the configure \\\"tickInterval\\\"(in milliseconds, current is \" + tickInterval + \") is too small, increase the value to solve the problem!\");\n }\n return ticks;\n}\n//# sourceMappingURL=time-pretty.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/time-pretty.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPathArray\", function() { return isPathArray; });\n/* harmony import */ var _parser_params_count__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../parser/params-count */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/parser/params-count.js\");\n\n/**\n * Iterates an array to check if it's an actual `PathArray`.\n */\nfunction isPathArray(path) {\n return (Array.isArray(path) &&\n path.every(function (seg) {\n var lk = seg[0].toLowerCase();\n return _parser_params_count__WEBPACK_IMPORTED_MODULE_0__[\"paramsCount\"][lk] === seg.length - 1 && 'achlmqstvz'.includes(lk);\n }));\n}\n//# sourceMappingURL=is-path-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-path-array.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/tick-method/time.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/tick-method/time.js ***! - \**********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-point-in-stroke.js": +/*!***********************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-point-in-stroke.js ***! + \***********************************************************************************************/ +/*! exports provided: isPointInStroke */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculateTimeTicks; });\n/* harmony import */ var _util_time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/time */ \"./node_modules/@antv/scale/esm/util/time.js\");\n\nfunction calculateTimeTicks(cfg) {\n var min = cfg.min, max = cfg.max, minTickInterval = cfg.minTickInterval;\n var tickInterval = cfg.tickInterval;\n var tickCount = cfg.tickCount;\n // 指定 tickInterval 后 tickCount 不生效,需要重新计算\n if (tickInterval) {\n tickCount = Math.ceil((max - min) / tickInterval);\n }\n else {\n tickInterval = Object(_util_time__WEBPACK_IMPORTED_MODULE_0__[\"getTickInterval\"])(min, max, tickCount)[1];\n var count = (max - min) / tickInterval;\n var ratio = count / tickCount;\n if (ratio > 1) {\n tickInterval = tickInterval * Math.ceil(ratio);\n }\n // 如果设置了最小间距,则使用最小间距\n if (minTickInterval && tickInterval < minTickInterval) {\n tickInterval = minTickInterval;\n }\n }\n tickInterval = Math.max(Math.floor((max - min) / (Math.pow(2, 12) - 1)), tickInterval);\n var ticks = [];\n for (var i = min; i < max + tickInterval; i += tickInterval) {\n ticks.push(i);\n }\n return ticks;\n}\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/time.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isPointInStroke\", function() { return isPointInStroke; });\n/* harmony import */ var _get_properties_at_point__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-properties-at-point */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/get-properties-at-point.js\");\n\n/**\n * Checks if a given point is in the stroke of a path.\n */\nfunction isPointInStroke(pathInput, point) {\n var distance = Object(_get_properties_at_point__WEBPACK_IMPORTED_MODULE_0__[\"getPropertiesAtPoint\"])(pathInput, point).distance;\n return Math.abs(distance) < 0.001; // 0.01 might be more permissive\n}\n//# sourceMappingURL=is-point-in-stroke.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/is-point-in-stroke.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/bisector.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/bisector.js ***! - \*******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/mid-point.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/mid-point.js ***! + \**************************************************************************************/ +/*! exports provided: midPoint */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n/**\n * 二分右侧查找\n * https://github.com/d3/d3-array/blob/master/src/bisector.js\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (getter) {\n /**\n * x: 目标值\n * lo: 起始位置\n * hi: 结束位置\n */\n return function (a, x, _lo, _hi) {\n var lo = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(_lo) ? 0 : _lo;\n var hi = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(_hi) ? a.length : _hi;\n while (lo < hi) {\n var mid = (lo + hi) >>> 1;\n if (getter(a[mid]) > x) {\n hi = mid;\n }\n else {\n lo = mid + 1;\n }\n }\n return lo;\n };\n});\n//# sourceMappingURL=bisector.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/bisector.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"midPoint\", function() { return midPoint; });\nfunction midPoint(a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var bx = b[0];\n var by = b[1];\n return [ax + (bx - ax) * t, ay + (by - ay) * t];\n}\n//# sourceMappingURL=mid-point.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/mid-point.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/d3-linear.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/d3-linear.js ***! - \********************************************************/ -/*! exports provided: default, D3Linear */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/path-length-factory.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/path-length-factory.js ***! + \************************************************************************************************/ +/*! exports provided: pathLengthFactory */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return d3Linear; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"D3Linear\", function() { return D3Linear; });\nfunction d3Linear(cfg) {\n var min = cfg.min, max = cfg.max, nice = cfg.nice, tickCount = cfg.tickCount;\n var linear = new D3Linear();\n linear.domain([min, max]);\n if (nice) {\n linear.nice(tickCount);\n }\n return linear.ticks(tickCount);\n}\nvar DEFAULT_COUNT = 5;\nvar e10 = Math.sqrt(50);\nvar e5 = Math.sqrt(10);\nvar e2 = Math.sqrt(2);\n// https://github.com/d3/d3-scale\nvar D3Linear = /** @class */ (function () {\n function D3Linear() {\n this._domain = [0, 1];\n }\n D3Linear.prototype.domain = function (domain) {\n if (domain) {\n this._domain = Array.from(domain, Number);\n return this;\n }\n return this._domain.slice();\n };\n D3Linear.prototype.nice = function (count) {\n var _a, _b;\n if (count === void 0) { count = DEFAULT_COUNT; }\n var d = this._domain.slice();\n var i0 = 0;\n var i1 = this._domain.length - 1;\n var start = this._domain[i0];\n var stop = this._domain[i1];\n var step;\n if (stop < start) {\n _a = [stop, start], start = _a[0], stop = _a[1];\n _b = [i1, i0], i0 = _b[0], i1 = _b[1];\n }\n step = tickIncrement(start, stop, count);\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n }\n else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n this.domain(d);\n }\n else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n this.domain(d);\n }\n return this;\n };\n D3Linear.prototype.ticks = function (count) {\n if (count === void 0) { count = DEFAULT_COUNT; }\n return d3ArrayTicks(this._domain[0], this._domain[this._domain.length - 1], count || DEFAULT_COUNT);\n };\n return D3Linear;\n}());\n\nfunction d3ArrayTicks(start, stop, count) {\n var reverse;\n var i = -1;\n var n;\n var ticks;\n var step;\n (stop = +stop), (start = +start), (count = +count);\n if (start === stop && count > 0) {\n return [start];\n }\n // tslint:disable-next-line\n if ((reverse = stop < start)) {\n (n = start), (start = stop), (stop = n);\n }\n // tslint:disable-next-line\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) {\n return [];\n }\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array((n = Math.ceil(stop - start + 1)));\n while (++i < n) {\n ticks[i] = (start + i) * step;\n }\n }\n else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array((n = Math.ceil(start - stop + 1)));\n while (++i < n) {\n ticks[i] = (start - i) / step;\n }\n }\n if (reverse) {\n ticks.reverse();\n }\n return ticks;\n}\nfunction tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count);\n var power = Math.floor(Math.log(step) / Math.LN10);\n var error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n//# sourceMappingURL=d3-linear.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/d3-linear.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pathLengthFactory\", function() { return pathLengthFactory; });\n/* harmony import */ var _process_normalize_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../process/normalize-path */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/process/normalize-path.js\");\n/* harmony import */ var _segment_line_factory__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./segment-line-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-line-factory.js\");\n/* harmony import */ var _segment_arc_factory__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./segment-arc-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-arc-factory.js\");\n/* harmony import */ var _segment_cubic_factory__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./segment-cubic-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-cubic-factory.js\");\n/* harmony import */ var _segment_quad_factory__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./segment-quad-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-quad-factory.js\");\n\n\n\n\n\n/**\n * Returns a {x,y} point at a given length\n * of a shape, the shape total length and\n * the shape minimum and maximum {x,y} coordinates.\n */\nfunction pathLengthFactory(pathInput, distance, options) {\n var _a, _b, _c, _d, _e, _f;\n var path = Object(_process_normalize_path__WEBPACK_IMPORTED_MODULE_0__[\"normalizePath\"])(pathInput);\n var distanceIsNumber = typeof distance === 'number';\n var isM;\n var data = [];\n var pathCommand;\n var x = 0;\n var y = 0;\n var mx = 0;\n var my = 0;\n var seg;\n var MIN = [];\n var MAX = [];\n var length = 0;\n var min = { x: 0, y: 0 };\n var max = min;\n var point = min;\n var POINT = min;\n var LENGTH = 0;\n for (var i = 0, ll = path.length; i < ll; i += 1) {\n seg = path[i];\n pathCommand = seg[0];\n isM = pathCommand === 'M';\n data = !isM ? [x, y].concat(seg.slice(1)) : data;\n // this segment is always ZERO\n /* istanbul ignore else */\n if (isM) {\n // remember mx, my for Z\n mx = seg[1], my = seg[2];\n min = { x: mx, y: my };\n max = min;\n length = 0;\n if (distanceIsNumber && distance < 0.001) {\n POINT = min;\n }\n }\n else if (pathCommand === 'L') {\n (_a = Object(_segment_line_factory__WEBPACK_IMPORTED_MODULE_1__[\"segmentLineFactory\"])(data[0], data[1], data[2], data[3], (distance || 0) - LENGTH), length = _a.length, min = _a.min, max = _a.max, point = _a.point);\n }\n else if (pathCommand === 'A') {\n (_b = Object(_segment_arc_factory__WEBPACK_IMPORTED_MODULE_2__[\"segmentArcFactory\"])(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], data[8], (distance || 0) - LENGTH, options || {}), length = _b.length, min = _b.min, max = _b.max, point = _b.point);\n }\n else if (pathCommand === 'C') {\n (_c = Object(_segment_cubic_factory__WEBPACK_IMPORTED_MODULE_3__[\"segmentCubicFactory\"])(data[0], data[1], data[2], data[3], data[4], data[5], data[6], data[7], (distance || 0) - LENGTH, options || {}), length = _c.length, min = _c.min, max = _c.max, point = _c.point);\n }\n else if (pathCommand === 'Q') {\n (_d = Object(_segment_quad_factory__WEBPACK_IMPORTED_MODULE_4__[\"segmentQuadFactory\"])(data[0], data[1], data[2], data[3], data[4], data[5], (distance || 0) - LENGTH, options || {}), length = _d.length, min = _d.min, max = _d.max, point = _d.point);\n }\n else if (pathCommand === 'Z') {\n data = [x, y, mx, my];\n (_e = Object(_segment_line_factory__WEBPACK_IMPORTED_MODULE_1__[\"segmentLineFactory\"])(data[0], data[1], data[2], data[3], (distance || 0) - LENGTH), length = _e.length, min = _e.min, max = _e.max, point = _e.point);\n }\n if (distanceIsNumber && LENGTH < distance && LENGTH + length >= distance) {\n POINT = point;\n }\n MAX.push(max);\n MIN.push(min);\n LENGTH += length;\n _f = pathCommand !== 'Z' ? seg.slice(-2) : [mx, my], x = _f[0], y = _f[1];\n }\n // native `getPointAtLength` behavior when the given distance\n // is higher than total length\n if (distanceIsNumber && distance >= LENGTH) {\n POINT = { x: x, y: y };\n }\n return {\n length: LENGTH,\n point: POINT,\n min: {\n x: Math.min.apply(null, MIN.map(function (n) { return n.x; })),\n y: Math.min.apply(null, MIN.map(function (n) { return n.y; })),\n },\n max: {\n x: Math.max.apply(null, MAX.map(function (n) { return n.x; })),\n y: Math.max.apply(null, MAX.map(function (n) { return n.y; })),\n },\n };\n}\n//# sourceMappingURL=path-length-factory.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/path-length-factory.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/extended.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/extended.js ***! - \*******************************************************/ -/*! exports provided: DEFAULT_Q, ALL_Q, default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/rotate-vector.js": +/*!******************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/rotate-vector.js ***! + \******************************************************************************************/ +/*! exports provided: rotateVector */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_Q\", function() { return DEFAULT_Q; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ALL_Q\", function() { return ALL_Q; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return extended; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _pretty_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pretty-number */ \"./node_modules/@antv/scale/esm/util/pretty-number.js\");\n\n\nvar DEFAULT_Q = [1, 5, 2, 2.5, 4, 3];\nvar ALL_Q = [1, 5, 2, 2.5, 4, 3, 1.5, 7, 6, 8, 9];\nvar eps = Number.EPSILON * 100;\nfunction mod(n, m) {\n return ((n % m) + m) % m;\n}\nfunction round(n) {\n return Math.round(n * 1e12) / 1e12;\n}\nfunction simplicity(q, Q, j, lmin, lmax, lstep) {\n var n = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"size\"])(Q);\n var i = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"indexOf\"])(Q, q);\n var v = 0;\n var m = mod(lmin, lstep);\n if ((m < eps || lstep - m < eps) && lmin <= 0 && lmax >= 0) {\n v = 1;\n }\n return 1 - i / (n - 1) - j + v;\n}\nfunction simplicityMax(q, Q, j) {\n var n = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"size\"])(Q);\n var i = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"indexOf\"])(Q, q);\n var v = 1;\n return 1 - i / (n - 1) - j + v;\n}\nfunction density(k, m, dMin, dMax, lMin, lMax) {\n var r = (k - 1) / (lMax - lMin);\n var rt = (m - 1) / (Math.max(lMax, dMax) - Math.min(dMin, lMin));\n return 2 - Math.max(r / rt, rt / r);\n}\nfunction densityMax(k, m) {\n if (k >= m) {\n return 2 - (k - 1) / (m - 1);\n }\n return 1;\n}\nfunction coverage(dMin, dMax, lMin, lMax) {\n var range = dMax - dMin;\n return 1 - (0.5 * (Math.pow((dMax - lMax), 2) + Math.pow((dMin - lMin), 2))) / Math.pow((0.1 * range), 2);\n}\nfunction coverageMax(dMin, dMax, span) {\n var range = dMax - dMin;\n if (span > range) {\n var half = (span - range) / 2;\n return 1 - Math.pow(half, 2) / Math.pow((0.1 * range), 2);\n }\n return 1;\n}\nfunction legibility() {\n return 1;\n}\n/**\n * An Extension of Wilkinson's Algorithm for Position Tick Labels on Axes\n * https://www.yuque.com/preview/yuque/0/2019/pdf/185317/1546999150858-45c3b9c2-4e86-4223-bf1a-8a732e8195ed.pdf\n * @param dMin 最小值\n * @param dMax 最大值\n * @param m tick个数\n * @param onlyLoose 是否允许扩展min、max,不绝对强制,例如[3, 97]\n * @param Q nice numbers集合\n * @param w 四个优化组件的权重\n */\nfunction extended(dMin, dMax, n, onlyLoose, Q, w) {\n if (n === void 0) { n = 5; }\n if (onlyLoose === void 0) { onlyLoose = true; }\n if (Q === void 0) { Q = DEFAULT_Q; }\n if (w === void 0) { w = [0.25, 0.2, 0.5, 0.05]; }\n // 处理小于 0 和小数的 tickCount\n var m = n < 0 ? 0 : Math.round(n);\n // nan 也会导致异常\n if (Number.isNaN(dMin) || Number.isNaN(dMax) || typeof dMin !== 'number' || typeof dMax !== 'number' || !m) {\n return {\n min: 0,\n max: 0,\n ticks: [],\n };\n }\n // js 极大值极小值问题,差值小于 1e-15 会导致计算出错\n if (dMax - dMin < 1e-15 || m === 1) {\n return {\n min: dMin,\n max: dMax,\n ticks: [dMin],\n };\n }\n // js 超大值问题\n if (dMax - dMin > 1e148) {\n var count = n || 5;\n var step_1 = (dMax - dMin) / count;\n return {\n min: dMin,\n max: dMax,\n ticks: Array(count).fill(null).map(function (_, idx) {\n return Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(dMin + step_1 * idx);\n }),\n };\n }\n var best = {\n score: -2,\n lmin: 0,\n lmax: 0,\n lstep: 0,\n };\n var j = 1;\n while (j < Infinity) {\n for (var i = 0; i < Q.length; i += 1) {\n var q = Q[i];\n var sm = simplicityMax(q, Q, j);\n if (w[0] * sm + w[1] + w[2] + w[3] < best.score) {\n j = Infinity;\n break;\n }\n var k = 2;\n while (k < Infinity) {\n var dm = densityMax(k, m);\n if (w[0] * sm + w[1] + w[2] * dm + w[3] < best.score) {\n break;\n }\n var delta = (dMax - dMin) / (k + 1) / j / q;\n var z = Math.ceil(Math.log10(delta));\n while (z < Infinity) {\n var step = j * q * Math.pow(10, z);\n var cm = coverageMax(dMin, dMax, step * (k - 1));\n if (w[0] * sm + w[1] * cm + w[2] * dm + w[3] < best.score) {\n break;\n }\n var minStart = Math.floor(dMax / step) * j - (k - 1) * j;\n var maxStart = Math.ceil(dMin / step) * j;\n if (minStart <= maxStart) {\n var count = maxStart - minStart;\n for (var i_1 = 0; i_1 <= count; i_1 += 1) {\n var start = minStart + i_1;\n var lMin = start * (step / j);\n var lMax = lMin + step * (k - 1);\n var lStep = step;\n var s = simplicity(q, Q, j, lMin, lMax, lStep);\n var c = coverage(dMin, dMax, lMin, lMax);\n var g = density(k, m, dMin, dMax, lMin, lMax);\n var l = legibility();\n var score = w[0] * s + w[1] * c + w[2] * g + w[3] * l;\n if (score > best.score && (!onlyLoose || (lMin <= dMin && lMax >= dMax))) {\n best.lmin = lMin;\n best.lmax = lMax;\n best.lstep = lStep;\n best.score = score;\n }\n }\n }\n z += 1;\n }\n k += 1;\n }\n }\n j += 1;\n }\n // 处理精度问题,保证这三个数没有精度问题\n var lmax = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(best.lmax);\n var lmin = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(best.lmin);\n var lstep = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(best.lstep);\n // 加 round 是为处理 extended(0.94, 1, 5)\n // 保证生成的 tickCount 没有精度问题\n var tickCount = Math.floor(round((lmax - lmin) / lstep)) + 1;\n var ticks = new Array(tickCount);\n // 少用乘法:防止出现 -1.2 + 1.2 * 3 = 2.3999999999999995 的情况\n ticks[0] = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(lmin);\n for (var i = 1; i < tickCount; i++) {\n ticks[i] = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(ticks[i - 1] + lstep);\n }\n return {\n min: Math.min(dMin, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"head\"])(ticks)),\n max: Math.max(dMax, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks)),\n ticks: ticks,\n };\n}\n//# sourceMappingURL=extended.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/extended.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateVector\", function() { return rotateVector; });\nfunction rotateVector(x, y, rad) {\n var X = x * Math.cos(rad) - y * Math.sin(rad);\n var Y = x * Math.sin(rad) + y * Math.cos(rad);\n return { x: X, y: Y };\n}\n//# sourceMappingURL=rotate-vector.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/rotate-vector.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/interval.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/interval.js ***! - \*******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-arc-factory.js": +/*!************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-arc-factory.js ***! + \************************************************************************************************/ +/*! exports provided: segmentArcFactory */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return intervalTicks; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nfunction snapMultiple(v, base, snapType) {\n var div;\n if (snapType === 'ceil') {\n div = Math.ceil(v / base);\n }\n else if (snapType === 'floor') {\n div = Math.floor(v / base);\n }\n else {\n div = Math.round(v / base);\n }\n return div * base;\n}\nfunction intervalTicks(min, max, interval) {\n // 变成 interval 的倍数\n var minTick = snapMultiple(min, interval, 'floor');\n var maxTick = snapMultiple(max, interval, 'ceil');\n // 统一小数位数\n minTick = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"fixedBase\"])(minTick, interval);\n maxTick = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"fixedBase\"])(maxTick, interval);\n var ticks = [];\n // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n var availableInterval = Math.max((maxTick - minTick) / (Math.pow(2, 12) - 1), interval);\n for (var i = minTick; i <= maxTick; i = i + availableInterval) {\n var tickValue = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"fixedBase\"])(i, availableInterval); // 防止浮点数加法出现问题\n ticks.push(tickValue);\n }\n return {\n min: minTick,\n max: maxTick,\n ticks: ticks\n };\n}\n//# sourceMappingURL=interval.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/interval.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentArcFactory\", function() { return segmentArcFactory; });\n/* harmony import */ var _segment_line_factory__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./segment-line-factory */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-line-factory.js\");\n/* harmony import */ var _distance_square_root__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./distance-square-root */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js\");\n\n\nfunction angleBetween(v0, v1) {\n var v0x = v0.x, v0y = v0.y;\n var v1x = v1.x, v1y = v1.y;\n var p = v0x * v1x + v0y * v1y;\n var n = Math.sqrt((Math.pow(v0x, 2) + Math.pow(v0y, 2)) * (Math.pow(v1x, 2) + Math.pow(v1y, 2)));\n var sign = v0x * v1y - v0y * v1x < 0 ? -1 : 1;\n var angle = sign * Math.acos(p / n);\n return angle;\n}\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the minimum and maximum {x,y} coordinates of a C (cubic-bezier) segment.\n * @see https://github.com/MadLittleMods/svg-curve-lib/blob/master/src/js/svg-curve-lib.js\n */\nfunction getPointAtArcSegmentLength(x1, y1, RX, RY, angle, LAF, SF, x, y, t) {\n var abs = Math.abs, sin = Math.sin, cos = Math.cos, sqrt = Math.sqrt, PI = Math.PI;\n var rx = abs(RX);\n var ry = abs(RY);\n var xRot = ((angle % 360) + 360) % 360;\n var xRotRad = xRot * (PI / 180);\n if (x1 === x && y1 === y) {\n return { x: x1, y: y1 };\n }\n if (rx === 0 || ry === 0) {\n return Object(_segment_line_factory__WEBPACK_IMPORTED_MODULE_0__[\"segmentLineFactory\"])(x1, y1, x, y, t).point;\n }\n var dx = (x1 - x) / 2;\n var dy = (y1 - y) / 2;\n var transformedPoint = {\n x: cos(xRotRad) * dx + sin(xRotRad) * dy,\n y: -sin(xRotRad) * dx + cos(xRotRad) * dy,\n };\n var radiiCheck = Math.pow(transformedPoint.x, 2) / Math.pow(rx, 2) + Math.pow(transformedPoint.y, 2) / Math.pow(ry, 2);\n if (radiiCheck > 1) {\n rx *= sqrt(radiiCheck);\n ry *= sqrt(radiiCheck);\n }\n var cSquareNumerator = Math.pow(rx, 2) * Math.pow(ry, 2) - Math.pow(rx, 2) * Math.pow(transformedPoint.y, 2) - Math.pow(ry, 2) * Math.pow(transformedPoint.x, 2);\n var cSquareRootDenom = Math.pow(rx, 2) * Math.pow(transformedPoint.y, 2) + Math.pow(ry, 2) * Math.pow(transformedPoint.x, 2);\n var cRadicand = cSquareNumerator / cSquareRootDenom;\n cRadicand = cRadicand < 0 ? 0 : cRadicand;\n var cCoef = (LAF !== SF ? 1 : -1) * sqrt(cRadicand);\n var transformedCenter = {\n x: cCoef * ((rx * transformedPoint.y) / ry),\n y: cCoef * (-(ry * transformedPoint.x) / rx),\n };\n var center = {\n x: cos(xRotRad) * transformedCenter.x - sin(xRotRad) * transformedCenter.y + (x1 + x) / 2,\n y: sin(xRotRad) * transformedCenter.x + cos(xRotRad) * transformedCenter.y + (y1 + y) / 2,\n };\n var startVector = {\n x: (transformedPoint.x - transformedCenter.x) / rx,\n y: (transformedPoint.y - transformedCenter.y) / ry,\n };\n var startAngle = angleBetween({ x: 1, y: 0 }, startVector);\n var endVector = {\n x: (-transformedPoint.x - transformedCenter.x) / rx,\n y: (-transformedPoint.y - transformedCenter.y) / ry,\n };\n var sweepAngle = angleBetween(startVector, endVector);\n if (!SF && sweepAngle > 0) {\n sweepAngle -= 2 * PI;\n }\n else if (SF && sweepAngle < 0) {\n sweepAngle += 2 * PI;\n }\n sweepAngle %= 2 * PI;\n var alpha = startAngle + sweepAngle * t;\n var ellipseComponentX = rx * cos(alpha);\n var ellipseComponentY = ry * sin(alpha);\n var point = {\n x: cos(xRotRad) * ellipseComponentX - sin(xRotRad) * ellipseComponentY + center.x,\n y: sin(xRotRad) * ellipseComponentX + cos(xRotRad) * ellipseComponentY + center.y,\n };\n // to be used later\n // point.ellipticalArcStartAngle = startAngle;\n // point.ellipticalArcEndAngle = startAngle + sweepAngle;\n // point.ellipticalArcAngle = alpha;\n // point.ellipticalArcCenter = center;\n // point.resultantRx = rx;\n // point.resultantRy = ry;\n return point;\n}\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the shape minimum and maximum {x,y} coordinates of an A (arc-to) segment.\n *\n * For better performance, it can skip calculate bbox or length in some scenario.\n */\nfunction segmentArcFactory(X1, Y1, RX, RY, angle, LAF, SF, X2, Y2, distance, options) {\n var _a;\n var _b = options.bbox, bbox = _b === void 0 ? true : _b, _c = options.length, length = _c === void 0 ? true : _c, _d = options.sampleSize, sampleSize = _d === void 0 ? 30 : _d;\n var distanceIsNumber = typeof distance === 'number';\n var x = X1;\n var y = Y1;\n var LENGTH = 0;\n var prev = [x, y, LENGTH];\n var cur = [x, y];\n var t = 0;\n var POINT = { x: 0, y: 0 };\n var POINTS = [{ x: x, y: y }];\n if (distanceIsNumber && distance <= 0) {\n POINT = { x: x, y: y };\n }\n // bad perf when size > 100\n for (var j = 0; j <= sampleSize; j += 1) {\n t = j / sampleSize;\n (_a = getPointAtArcSegmentLength(X1, Y1, RX, RY, angle, LAF, SF, X2, Y2, t), x = _a.x, y = _a.y);\n if (bbox) {\n POINTS.push({ x: x, y: y });\n }\n if (length) {\n LENGTH += Object(_distance_square_root__WEBPACK_IMPORTED_MODULE_1__[\"distanceSquareRoot\"])(cur, [x, y]);\n }\n cur = [x, y];\n if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {\n var dv = (LENGTH - distance) / (LENGTH - prev[2]);\n POINT = {\n x: cur[0] * (1 - dv) + prev[0] * dv,\n y: cur[1] * (1 - dv) + prev[1] * dv,\n };\n }\n prev = [x, y, LENGTH];\n }\n if (distanceIsNumber && distance >= LENGTH) {\n POINT = { x: X2, y: Y2 };\n }\n return {\n length: LENGTH,\n point: POINT,\n min: {\n x: Math.min.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.min.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n max: {\n x: Math.max.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.max.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n };\n}\n//# sourceMappingURL=segment-arc-factory.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-arc-factory.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/math.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/math.js ***! - \***************************************************/ -/*! exports provided: calBase, log, getLogPositiveMin, precisionAdd */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-cubic-factory.js": +/*!**************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-cubic-factory.js ***! + \**************************************************************************************************/ +/*! exports provided: segmentCubicFactory */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"calBase\", function() { return calBase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"log\", function() { return log; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLogPositiveMin\", function() { return getLogPositiveMin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"precisionAdd\", function() { return precisionAdd; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n// 求以a为次幂,结果为b的基数,如 x^^a = b;求x\n// 虽然数学上 b 不支持负数,但是这里需要支持 负数\nfunction calBase(a, b) {\n var e = Math.E;\n var value;\n if (b >= 0) {\n value = Math.pow(e, Math.log(b) / a); // 使用换底公式求底\n }\n else {\n value = Math.pow(e, Math.log(-b) / a) * -1; // 使用换底公式求底\n }\n return value;\n}\nfunction log(a, b) {\n if (a === 1) {\n return 1;\n }\n return Math.log(b) / Math.log(a);\n}\nfunction getLogPositiveMin(values, base, max) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(max)) {\n max = Math.max.apply(null, values);\n }\n var positiveMin = max;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(values, function (value) {\n if (value > 0 && value < positiveMin) {\n positiveMin = value;\n }\n });\n if (positiveMin === max) {\n positiveMin = max / base;\n }\n if (positiveMin > 1) {\n positiveMin = 1;\n }\n return positiveMin;\n}\nfunction digitLength(num) {\n // Get digit length of e\n var eSplit = num.toString().split(/[eE]/);\n var len = (eSplit[0].split('.')[1] || '').length - +(eSplit[1] || 0);\n return len > 0 ? len : 0;\n}\n/**\n * 高精度加法,解决 0.1 + 0.2 !== 0.3 的经典问题\n *\n * @param num1 加数\n * @param num2 被加数\n * @return {number} 返回值\n */\nfunction precisionAdd(num1, num2) {\n var num1Digits = digitLength(num1);\n var num2Digits = digitLength(num2);\n var baseNum = Math.pow(10, Math.max(num1Digits, num2Digits));\n return (num1 * baseNum + num2 * baseNum) / baseNum;\n}\n//# sourceMappingURL=math.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/math.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentCubicFactory\", function() { return segmentCubicFactory; });\n/* harmony import */ var _distance_square_root__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distance-square-root */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js\");\n\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the minimum and maximum {x,y} coordinates of a C (cubic-bezier) segment.\n */\nfunction getPointAtCubicSegmentLength(x1, y1, c1x, c1y, c2x, c2y, x2, y2, t) {\n var t1 = 1 - t;\n return {\n x: Math.pow(t1, 3) * x1 + 3 * Math.pow(t1, 2) * t * c1x + 3 * t1 * Math.pow(t, 2) * c2x + Math.pow(t, 3) * x2,\n y: Math.pow(t1, 3) * y1 + 3 * Math.pow(t1, 2) * t * c1y + 3 * t1 * Math.pow(t, 2) * c2y + Math.pow(t, 3) * y2,\n };\n}\n/**\n * Returns the length of a C (cubic-bezier) segment\n * or an {x,y} point at a given length.\n */\nfunction segmentCubicFactory(x1, y1, c1x, c1y, c2x, c2y, x2, y2, distance, options) {\n var _a;\n var _b = options.bbox, bbox = _b === void 0 ? true : _b, _c = options.length, length = _c === void 0 ? true : _c, _d = options.sampleSize, sampleSize = _d === void 0 ? 10 : _d;\n var distanceIsNumber = typeof distance === 'number';\n var x = x1;\n var y = y1;\n var LENGTH = 0;\n var prev = [x, y, LENGTH];\n var cur = [x, y];\n var t = 0;\n var POINT = { x: 0, y: 0 };\n var POINTS = [{ x: x, y: y }];\n if (distanceIsNumber && distance <= 0) {\n POINT = { x: x, y: y };\n }\n // bad perf when size = 300\n for (var j = 0; j <= sampleSize; j += 1) {\n t = j / sampleSize;\n (_a = getPointAtCubicSegmentLength(x1, y1, c1x, c1y, c2x, c2y, x2, y2, t), x = _a.x, y = _a.y);\n if (bbox) {\n POINTS.push({ x: x, y: y });\n }\n if (length) {\n LENGTH += Object(_distance_square_root__WEBPACK_IMPORTED_MODULE_0__[\"distanceSquareRoot\"])(cur, [x, y]);\n }\n cur = [x, y];\n if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {\n var dv = (LENGTH - distance) / (LENGTH - prev[2]);\n POINT = {\n x: cur[0] * (1 - dv) + prev[0] * dv,\n y: cur[1] * (1 - dv) + prev[1] * dv,\n };\n }\n prev = [x, y, LENGTH];\n }\n if (distanceIsNumber && distance >= LENGTH) {\n POINT = { x: x2, y: y2 };\n }\n return {\n length: LENGTH,\n point: POINT,\n min: {\n x: Math.min.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.min.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n max: {\n x: Math.max.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.max.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n };\n}\n//# sourceMappingURL=segment-cubic-factory.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-cubic-factory.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/pretty-number.js": -/*!************************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/pretty-number.js ***! - \************************************************************/ -/*! exports provided: prettyNumber */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-line-factory.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-line-factory.js ***! + \*************************************************************************************************/ +/*! exports provided: segmentLineFactory */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prettyNumber\", function() { return prettyNumber; });\n// 为了解决 js 运算的精度问题\nfunction prettyNumber(n) {\n return Math.abs(n) < 1e-15 ? n : parseFloat(n.toFixed(15));\n}\n//# sourceMappingURL=pretty-number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/pretty-number.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentLineFactory\", function() { return segmentLineFactory; });\n/* harmony import */ var _mid_point__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mid-point */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/mid-point.js\");\n/* harmony import */ var _distance_square_root__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./distance-square-root */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js\");\n\n\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the minimum and maximum {x,y} coordinates of a line (L,V,H,Z) segment.\n */\nfunction segmentLineFactory(x1, y1, x2, y2, distance) {\n var length = Object(_distance_square_root__WEBPACK_IMPORTED_MODULE_1__[\"distanceSquareRoot\"])([x1, y1], [x2, y2]);\n var point = { x: 0, y: 0 };\n if (typeof distance === 'number') {\n if (distance <= 0) {\n point = { x: x1, y: y1 };\n }\n else if (distance >= length) {\n point = { x: x2, y: y2 };\n }\n else {\n var _a = Object(_mid_point__WEBPACK_IMPORTED_MODULE_0__[\"midPoint\"])([x1, y1], [x2, y2], distance / length), x = _a[0], y = _a[1];\n point = { x: x, y: y };\n }\n }\n return {\n length: length,\n point: point,\n min: {\n x: Math.min(x1, x2),\n y: Math.min(y1, y2),\n },\n max: {\n x: Math.max(x1, x2),\n y: Math.max(y1, y2),\n },\n };\n}\n//# sourceMappingURL=segment-line-factory.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-line-factory.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/pretty.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/pretty.js ***! - \*****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-quad-factory.js": +/*!*************************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-quad-factory.js ***! + \*************************************************************************************************/ +/*! exports provided: segmentQuadFactory */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pretty; });\n/* harmony import */ var _pretty_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pretty-number */ \"./node_modules/@antv/scale/esm/util/pretty-number.js\");\n\nfunction pretty(min, max, m) {\n if (m === void 0) { m = 5; }\n if (min === max) {\n return {\n max: max,\n min: min,\n ticks: [min],\n };\n }\n var n = m < 0 ? 0 : Math.round(m);\n if (n === 0)\n return { max: max, min: min, ticks: [] };\n /*\n R pretty:\n https://svn.r-project.org/R/trunk/src/appl/pretty.c\n https://www.rdocumentation.org/packages/base/versions/3.5.2/topics/pretty\n */\n var h = 1.5; // high.u.bias\n var h5 = 0.5 + 1.5 * h; // u5.bias\n // 反正我也不会调参,跳过所有判断步骤\n var d = max - min;\n var c = d / n;\n // 当d非常小的时候触发,但似乎没什么用\n // const min_n = Math.floor(n / 3);\n // const shrink_sml = Math.pow(2, 5);\n // if (Math.log10(d) < -2) {\n // c = (_.max([ Math.abs(max), Math.abs(min) ]) * shrink_sml) / min_n;\n // }\n var base = Math.pow(10, Math.floor(Math.log10(c)));\n var unit = base;\n if (2 * base - c < h * (c - unit)) {\n unit = 2 * base;\n if (5 * base - c < h5 * (c - unit)) {\n unit = 5 * base;\n if (10 * base - c < h * (c - unit)) {\n unit = 10 * base;\n }\n }\n }\n var nu = Math.ceil(max / unit);\n var ns = Math.floor(min / unit);\n var hi = Math.max(nu * unit, max);\n var lo = Math.min(ns * unit, min);\n var size = Math.floor((hi - lo) / unit) + 1;\n var ticks = new Array(size);\n for (var i = 0; i < size; i++) {\n ticks[i] = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_0__[\"prettyNumber\"])(lo + i * unit);\n }\n return {\n min: lo,\n max: hi,\n ticks: ticks,\n };\n}\n//# sourceMappingURL=pretty.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/pretty.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentQuadFactory\", function() { return segmentQuadFactory; });\n/* harmony import */ var _distance_square_root__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./distance-square-root */ \"./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/distance-square-root.js\");\n\n/**\n * Returns the {x,y} coordinates of a point at a\n * given length of a quadratic-bezier segment.\n *\n * @see https://github.com/substack/point-at-length\n */\nfunction getPointAtQuadSegmentLength(x1, y1, cx, cy, x2, y2, t) {\n var t1 = 1 - t;\n return {\n x: Math.pow(t1, 2) * x1 + 2 * t1 * t * cx + Math.pow(t, 2) * x2,\n y: Math.pow(t1, 2) * y1 + 2 * t1 * t * cy + Math.pow(t, 2) * y2,\n };\n}\n/**\n * Returns a {x,y} point at a given length, the total length and\n * the minimum and maximum {x,y} coordinates of a Q (quadratic-bezier) segment.\n */\nfunction segmentQuadFactory(x1, y1, qx, qy, x2, y2, distance, options) {\n var _a;\n var _b = options.bbox, bbox = _b === void 0 ? true : _b, _c = options.length, length = _c === void 0 ? true : _c, _d = options.sampleSize, sampleSize = _d === void 0 ? 10 : _d;\n var distanceIsNumber = typeof distance === 'number';\n var x = x1;\n var y = y1;\n var LENGTH = 0;\n var prev = [x, y, LENGTH];\n var cur = [x, y];\n var t = 0;\n var POINT = { x: 0, y: 0 };\n var POINTS = [{ x: x, y: y }];\n if (distanceIsNumber && distance <= 0) {\n POINT = { x: x, y: y };\n }\n for (var j = 0; j <= sampleSize; j += 1) {\n t = j / sampleSize;\n (_a = getPointAtQuadSegmentLength(x1, y1, qx, qy, x2, y2, t), x = _a.x, y = _a.y);\n if (bbox) {\n POINTS.push({ x: x, y: y });\n }\n if (length) {\n LENGTH += Object(_distance_square_root__WEBPACK_IMPORTED_MODULE_0__[\"distanceSquareRoot\"])(cur, [x, y]);\n }\n cur = [x, y];\n if (distanceIsNumber && LENGTH >= distance && distance > prev[2]) {\n var dv = (LENGTH - distance) / (LENGTH - prev[2]);\n POINT = {\n x: cur[0] * (1 - dv) + prev[0] * dv,\n y: cur[1] * (1 - dv) + prev[1] * dv,\n };\n }\n prev = [x, y, LENGTH];\n }\n /* istanbul ignore else */\n if (distanceIsNumber && distance >= LENGTH) {\n POINT = { x: x2, y: y2 };\n }\n return {\n length: LENGTH,\n point: POINT,\n min: {\n x: Math.min.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.min.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n max: {\n x: Math.max.apply(null, POINTS.map(function (n) { return n.x; })),\n y: Math.max.apply(null, POINTS.map(function (n) { return n.y; })),\n },\n };\n}\n//# sourceMappingURL=segment-quad-factory.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/@antv/util/esm/path/util/segment-quad-factory.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/strict-limit.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/strict-limit.js ***! - \***********************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/center.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/center.js ***! + \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return strictLimit; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n/**\n * 按照给定的 minLimit/maxLimit/tickCount 均匀计算出刻度 ticks\n *\n * @param cfg Scale 配置项\n * @return ticks\n */\nfunction strictLimit(cfg, defaultMin, defaultMax) {\n var _a;\n var minLimit = cfg.minLimit, maxLimit = cfg.maxLimit, min = cfg.min, max = cfg.max, _b = cfg.tickCount, tickCount = _b === void 0 ? 5 : _b;\n var tickMin = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(minLimit) ? (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(defaultMin) ? min : defaultMin) : minLimit;\n var tickMax = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(maxLimit) ? (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(defaultMax) ? max : defaultMax) : maxLimit;\n if (tickMin > tickMax) {\n _a = [tickMin, tickMax], tickMax = _a[0], tickMin = _a[1];\n }\n if (tickCount <= 2) {\n return [tickMin, tickMax];\n }\n var step = (tickMax - tickMin) / (tickCount - 1);\n var ticks = [];\n for (var i = 0; i < tickCount; i++) {\n ticks.push(tickMin + step * i);\n }\n return ticks;\n}\n//# sourceMappingURL=strict-limit.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/strict-limit.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y) {\n var nodes, strength = 1;\n\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force() {\n var i,\n n = nodes.length,\n node,\n sx = 0,\n sy = 0;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i], sx += node.x, sy += node.y;\n }\n\n for (sx = (sx / n - x) * strength, sy = (sy / n - y) * strength, i = 0; i < n; ++i) {\n node = nodes[i], node.x -= sx, node.y -= sy;\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/center.js?"); /***/ }), -/***/ "./node_modules/@antv/scale/esm/util/time.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/scale/esm/util/time.js ***! - \***************************************************/ -/*! exports provided: timeFormat, toTimeStamp, SECOND, MINUTE, HOUR, DAY, MONTH, YEAR, getTickInterval */ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/collide.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/collide.js ***! + \************************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timeFormat\", function() { return timeFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toTimeStamp\", function() { return toTimeStamp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SECOND\", function() { return SECOND; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MINUTE\", function() { return MINUTE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HOUR\", function() { return HOUR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DAY\", function() { return DAY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MONTH\", function() { return MONTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"YEAR\", function() { return YEAR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTickInterval\", function() { return getTickInterval; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var fecha__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fecha */ \"./node_modules/fecha/lib/fecha.js\");\n/* harmony import */ var _bisector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bisector */ \"./node_modules/@antv/scale/esm/util/bisector.js\");\n\n\n\n\nvar FORMAT_METHOD = 'format';\nfunction timeFormat(time, mask) {\n var method = fecha__WEBPACK_IMPORTED_MODULE_1__[FORMAT_METHOD] || fecha__WEBPACK_IMPORTED_MODULE_1__[\"default\"][FORMAT_METHOD];\n return method(time, mask);\n}\n/**\n * 转换成时间戳\n * @param value 时间值\n */\nfunction toTimeStamp(value) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(value)) {\n if (value.indexOf('T') > 0) {\n value = new Date(value).getTime();\n }\n else {\n // new Date('2010/01/10') 和 new Date('2010-01-10') 的差别在于:\n // 如果仅有年月日时,前者是带有时区的: Fri Jan 10 2020 02:40:13 GMT+0800 (中国标准时间)\n // 后者会格式化成 Sun Jan 10 2010 08:00:00 GMT+0800 (中国标准时间)\n value = new Date(value.replace(/-/gi, '/')).getTime();\n }\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isDate\"])(value)) {\n value = value.getTime();\n }\n return value;\n}\nvar SECOND = 1000;\nvar MINUTE = 60 * SECOND;\nvar HOUR = 60 * MINUTE;\nvar DAY = 24 * HOUR;\nvar MONTH = DAY * 31;\nvar YEAR = DAY * 365;\n\nvar intervals = [\n ['HH:mm:ss', SECOND],\n ['HH:mm:ss', SECOND * 10],\n ['HH:mm:ss', SECOND * 30],\n ['HH:mm', MINUTE],\n ['HH:mm', MINUTE * 10],\n ['HH:mm', MINUTE * 30],\n ['HH', HOUR],\n ['HH', HOUR * 6],\n ['HH', HOUR * 12],\n ['YYYY-MM-DD', DAY],\n ['YYYY-MM-DD', DAY * 4],\n ['YYYY-WW', DAY * 7],\n ['YYYY-MM', MONTH],\n ['YYYY-MM', MONTH * 4],\n ['YYYY-MM', MONTH * 6],\n ['YYYY', DAY * 380],\n];\nfunction getTickInterval(min, max, tickCount) {\n var target = (max - min) / tickCount;\n var idx = Object(_bisector__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function (o) { return o[1]; })(intervals, target) - 1;\n var interval = intervals[idx];\n if (idx < 0) {\n interval = intervals[0];\n }\n else if (idx >= intervals.length) {\n interval = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(intervals);\n }\n return interval;\n}\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/time.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var d3_quadtree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-quadtree */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js\");\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n/* harmony import */ var _jiggle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jiggle.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js\");\n\n\n\n\nfunction x(d) {\n return d.x + d.vx;\n}\n\nfunction y(d) {\n return d.y + d.vy;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(radius) {\n var nodes,\n radii,\n random,\n strength = 1,\n iterations = 1;\n\n if (typeof radius !== \"function\") radius = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(radius == null ? 1 : +radius);\n\n function force() {\n var i, n = nodes.length,\n tree,\n node,\n xi,\n yi,\n ri,\n ri2;\n\n for (var k = 0; k < iterations; ++k) {\n tree = Object(d3_quadtree__WEBPACK_IMPORTED_MODULE_0__[\"quadtree\"])(nodes, x, y).visitAfter(prepare);\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n ri = radii[node.index], ri2 = ri * ri;\n xi = node.x + node.vx;\n yi = node.y + node.vy;\n tree.visit(apply);\n }\n }\n\n function apply(quad, x0, y0, x1, y1) {\n var data = quad.data, rj = quad.r, r = ri + rj;\n if (data) {\n if (data.index > node.index) {\n var x = xi - data.x - data.vx,\n y = yi - data.y - data.vy,\n l = x * x + y * y;\n if (l < r * r) {\n if (x === 0) x = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += x * x;\n if (y === 0) y = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += y * y;\n l = (r - (l = Math.sqrt(l))) / l * strength;\n node.vx += (x *= l) * (r = (rj *= rj) / (ri2 + rj));\n node.vy += (y *= l) * r;\n data.vx -= x * (r = 1 - r);\n data.vy -= y * r;\n }\n }\n return;\n }\n return x0 > xi + r || x1 < xi - r || y0 > yi + r || y1 < yi - r;\n }\n }\n\n function prepare(quad) {\n if (quad.data) return quad.r = radii[quad.data.index];\n for (var i = quad.r = 0; i < 4; ++i) {\n if (quad[i] && quad[i].r > quad.r) {\n quad.r = quad[i].r;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n radii = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], radii[node.index] = +radius(node, i, nodes);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = +_, force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(+_), initialize(), force) : radius;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/collide.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/augment.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/augment.js ***! - \************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/constant.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/constant.js ***! + \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/util/esm/mix.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\nvar augment = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var c = args[0];\n for (var i = 1; i < args.length; i++) {\n var obj = args[i];\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj)) {\n obj = obj.prototype;\n }\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(c.prototype, obj);\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (augment);\n//# sourceMappingURL=augment.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/augment.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return function() {\n return x;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/constant.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/cache.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/util/esm/cache.js ***! - \**********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/index.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/index.js ***! + \**********************************************************************/ +/*! exports provided: forceCenter, forceCollide, forceLink, forceManyBody, forceRadial, forceSimulation, forceX, forceY */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * k-v 存储\n */\nvar default_1 = /** @class */ (function () {\n function default_1() {\n this.map = {};\n }\n default_1.prototype.has = function (key) {\n return this.map[key] !== undefined;\n };\n default_1.prototype.get = function (key, def) {\n var v = this.map[key];\n return v === undefined ? def : v;\n };\n default_1.prototype.set = function (key, value) {\n this.map[key] = value;\n };\n default_1.prototype.clear = function () {\n this.map = {};\n };\n default_1.prototype.delete = function (key) {\n delete this.map[key];\n };\n default_1.prototype.size = function () {\n return Object.keys(this.map).length;\n };\n return default_1;\n}());\n/* harmony default export */ __webpack_exports__[\"default\"] = (default_1);\n//# sourceMappingURL=cache.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/cache.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _center_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./center.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/center.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceCenter\", function() { return _center_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _collide_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./collide.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/collide.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceCollide\", function() { return _collide_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _link_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./link.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/link.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceLink\", function() { return _link_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _manyBody_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./manyBody.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/manyBody.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceManyBody\", function() { return _manyBody_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _radial_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./radial.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/radial.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceRadial\", function() { return _radial_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _simulation_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./simulation.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceSimulation\", function() { return _simulation_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _x_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./x.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/x.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceX\", function() { return _x_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _y_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./y.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/y.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forceY\", function() { return _y_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/clamp.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/util/esm/clamp.js ***! - \**********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js ***! + \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar clamp = function (a, min, max) {\n if (a < min) {\n return min;\n }\n else if (a > max) {\n return max;\n }\n return a;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (clamp);\n//# sourceMappingURL=clamp.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/clamp.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(random) {\n return (random() - 0.5) * 1e-6;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/clear-animation-frame.js": -/*!**************************************************************!*\ - !*** ./node_modules/@antv/util/esm/clear-animation-frame.js ***! - \**************************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/lcg.js": +/*!********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/lcg.js ***! + \********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return cancelAnimationFrame; });\nfunction cancelAnimationFrame(handler) {\n var method = window.cancelAnimationFrame ||\n window.webkitCancelAnimationFrame ||\n // @ts-ignore\n window.mozCancelAnimationFrame ||\n // @ts-ignore\n window.msCancelAnimationFrame ||\n clearTimeout;\n method(handler);\n}\n;\n//# sourceMappingURL=clear-animation-frame.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/clear-animation-frame.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n// https://en.wikipedia.org/wiki/Linear_congruential_generator#Parameters_in_common_use\nconst a = 1664525;\nconst c = 1013904223;\nconst m = 4294967296; // 2^32\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n let s = 1;\n return () => (s = (a * s + c) % m) / m;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/lcg.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/clone.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/util/esm/clone.js ***! - \**********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/link.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/link.js ***! + \*********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\nvar clone = function (obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n var rst;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) {\n rst = [];\n for (var i = 0, l = obj.length; i < l; i++) {\n if (typeof obj[i] === 'object' && obj[i] != null) {\n rst[i] = clone(obj[i]);\n }\n else {\n rst[i] = obj[i];\n }\n }\n }\n else {\n rst = {};\n for (var k in obj) {\n if (typeof obj[k] === 'object' && obj[k] != null) {\n rst[k] = clone(obj[k]);\n }\n else {\n rst[k] = obj[k];\n }\n }\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (clone);\n//# sourceMappingURL=clone.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/clone.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n/* harmony import */ var _jiggle_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./jiggle.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js\");\n\n\n\nfunction index(d) {\n return d.index;\n}\n\nfunction find(nodeById, nodeId) {\n var node = nodeById.get(nodeId);\n if (!node) throw new Error(\"node not found: \" + nodeId);\n return node;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(links) {\n var id = index,\n strength = defaultStrength,\n strengths,\n distance = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(30),\n distances,\n nodes,\n count,\n bias,\n random,\n iterations = 1;\n\n if (links == null) links = [];\n\n function defaultStrength(link) {\n return 1 / Math.min(count[link.source.index], count[link.target.index]);\n }\n\n function force(alpha) {\n for (var k = 0, n = links.length; k < iterations; ++k) {\n for (var i = 0, link, source, target, x, y, l, b; i < n; ++i) {\n link = links[i], source = link.source, target = link.target;\n x = target.x + target.vx - source.x - source.vx || Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(random);\n y = target.y + target.vy - source.y - source.vy || Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(random);\n l = Math.sqrt(x * x + y * y);\n l = (l - distances[i]) / l * alpha * strengths[i];\n x *= l, y *= l;\n target.vx -= x * (b = bias[i]);\n target.vy -= y * b;\n source.vx += x * (b = 1 - b);\n source.vy += y * b;\n }\n }\n }\n\n function initialize() {\n if (!nodes) return;\n\n var i,\n n = nodes.length,\n m = links.length,\n nodeById = new Map(nodes.map((d, i) => [id(d, i, nodes), d])),\n link;\n\n for (i = 0, count = new Array(n); i < m; ++i) {\n link = links[i], link.index = i;\n if (typeof link.source !== \"object\") link.source = find(nodeById, link.source);\n if (typeof link.target !== \"object\") link.target = find(nodeById, link.target);\n count[link.source.index] = (count[link.source.index] || 0) + 1;\n count[link.target.index] = (count[link.target.index] || 0) + 1;\n }\n\n for (i = 0, bias = new Array(m); i < m; ++i) {\n link = links[i], bias[i] = count[link.source.index] / (count[link.source.index] + count[link.target.index]);\n }\n\n strengths = new Array(m), initializeStrength();\n distances = new Array(m), initializeDistance();\n }\n\n function initializeStrength() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n strengths[i] = +strength(links[i], i, links);\n }\n }\n\n function initializeDistance() {\n if (!nodes) return;\n\n for (var i = 0, n = links.length; i < n; ++i) {\n distances[i] = +distance(links[i], i, links);\n }\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.links = function(_) {\n return arguments.length ? (links = _, initialize(), force) : links;\n };\n\n force.id = function(_) {\n return arguments.length ? (id = _, force) : id;\n };\n\n force.iterations = function(_) {\n return arguments.length ? (iterations = +_, force) : iterations;\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initializeStrength(), force) : strength;\n };\n\n force.distance = function(_) {\n return arguments.length ? (distance = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initializeDistance(), force) : distance;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/link.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/contains.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/contains.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/manyBody.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/manyBody.js ***! + \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar contains = function (arr, value) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return false;\n }\n return arr.indexOf(value) > -1;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (contains);\n//# sourceMappingURL=contains.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/contains.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var d3_quadtree__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-quadtree */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js\");\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n/* harmony import */ var _jiggle_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./jiggle.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/jiggle.js\");\n/* harmony import */ var _simulation_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./simulation.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n var nodes,\n node,\n random,\n alpha,\n strength = Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(-30),\n strengths,\n distanceMin2 = 1,\n distanceMax2 = Infinity,\n theta2 = 0.81;\n\n function force(_) {\n var i, n = nodes.length, tree = Object(d3_quadtree__WEBPACK_IMPORTED_MODULE_0__[\"quadtree\"])(nodes, _simulation_js__WEBPACK_IMPORTED_MODULE_3__[\"x\"], _simulation_js__WEBPACK_IMPORTED_MODULE_3__[\"y\"]).visitAfter(accumulate);\n for (alpha = _, i = 0; i < n; ++i) node = nodes[i], tree.visit(apply);\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length, node;\n strengths = new Array(n);\n for (i = 0; i < n; ++i) node = nodes[i], strengths[node.index] = +strength(node, i, nodes);\n }\n\n function accumulate(quad) {\n var strength = 0, q, c, weight = 0, x, y, i;\n\n // For internal nodes, accumulate forces from child quadrants.\n if (quad.length) {\n for (x = y = i = 0; i < 4; ++i) {\n if ((q = quad[i]) && (c = Math.abs(q.value))) {\n strength += q.value, weight += c, x += c * q.x, y += c * q.y;\n }\n }\n quad.x = x / weight;\n quad.y = y / weight;\n }\n\n // For leaf nodes, accumulate forces from coincident quadrants.\n else {\n q = quad;\n q.x = q.data.x;\n q.y = q.data.y;\n do strength += strengths[q.data.index];\n while (q = q.next);\n }\n\n quad.value = strength;\n }\n\n function apply(quad, x1, _, x2) {\n if (!quad.value) return true;\n\n var x = quad.x - node.x,\n y = quad.y - node.y,\n w = x2 - x1,\n l = x * x + y * y;\n\n // Apply the Barnes-Hut approximation if possible.\n // Limit forces for very close nodes; randomize direction if coincident.\n if (w * w / theta2 < l) {\n if (l < distanceMax2) {\n if (x === 0) x = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += x * x;\n if (y === 0) y = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n node.vx += x * quad.value * alpha / l;\n node.vy += y * quad.value * alpha / l;\n }\n return true;\n }\n\n // Otherwise, process points directly.\n else if (quad.length || l >= distanceMax2) return;\n\n // Limit forces for very close nodes; randomize direction if coincident.\n if (quad.data !== node || quad.next) {\n if (x === 0) x = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += x * x;\n if (y === 0) y = Object(_jiggle_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(random), l += y * y;\n if (l < distanceMin2) l = Math.sqrt(distanceMin2 * l);\n }\n\n do if (quad.data !== node) {\n w = strengths[quad.data.index] * alpha / l;\n node.vx += x * w;\n node.vy += y * w;\n } while (quad = quad.next);\n }\n\n force.initialize = function(_nodes, _random) {\n nodes = _nodes;\n random = _random;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(+_), initialize(), force) : strength;\n };\n\n force.distanceMin = function(_) {\n return arguments.length ? (distanceMin2 = _ * _, force) : Math.sqrt(distanceMin2);\n };\n\n force.distanceMax = function(_) {\n return arguments.length ? (distanceMax2 = _ * _, force) : Math.sqrt(distanceMax2);\n };\n\n force.theta = function(_) {\n return arguments.length ? (theta2 = _ * _, force) : Math.sqrt(theta2);\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/manyBody.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/debounce.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/debounce.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/radial.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/radial.js ***! + \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nfunction debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (debounce);\n//# sourceMappingURL=debounce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/debounce.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(radius, x, y) {\n var nodes,\n strength = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0.1),\n strengths,\n radiuses;\n\n if (typeof radius !== \"function\") radius = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+radius);\n if (x == null) x = 0;\n if (y == null) y = 0;\n\n function force(alpha) {\n for (var i = 0, n = nodes.length; i < n; ++i) {\n var node = nodes[i],\n dx = node.x - x || 1e-6,\n dy = node.y - y || 1e-6,\n r = Math.sqrt(dx * dx + dy * dy),\n k = (radiuses[i] - r) * strengths[i] * alpha / r;\n node.vx += dx * k;\n node.vy += dy * k;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n radiuses = new Array(n);\n for (i = 0; i < n; ++i) {\n radiuses[i] = +radius(nodes[i], i, nodes);\n strengths[i] = isNaN(radiuses[i]) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _, initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : strength;\n };\n\n force.radius = function(_) {\n return arguments.length ? (radius = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : radius;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = +_, force) : x;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = +_, force) : y;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/radial.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/deep-mix.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/deep-mix.js ***! - \*************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js ***! + \***************************************************************************/ +/*! exports provided: x, y, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n\n\nvar MAX_MIX_LEVEL = 5;\nfunction _deepMix(dist, src, level, maxLevel) {\n level = level || 0;\n maxLevel = maxLevel || MAX_MIX_LEVEL;\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n var value = src[key];\n if (value !== null && Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n if (!Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(dist[key])) {\n dist[key] = {};\n }\n if (level < maxLevel) {\n _deepMix(dist[key], value, level + 1, maxLevel);\n }\n else {\n dist[key] = src[key];\n }\n }\n else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n dist[key] = [];\n dist[key] = dist[key].concat(value);\n }\n else if (value !== undefined) {\n dist[key] = value;\n }\n }\n }\n}\n// todo 重写\nvar deepMix = function (rst) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < args.length; i += 1) {\n _deepMix(rst, args[i]);\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (deepMix);\n//# sourceMappingURL=deep-mix.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/deep-mix.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"x\", function() { return x; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"y\", function() { return y; });\n/* harmony import */ var d3_dispatch__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-dispatch */ \"./node_modules/d3-dispatch/src/index.js\");\n/* harmony import */ var d3_timer__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! d3-timer */ \"./node_modules/d3-timer/src/index.js\");\n/* harmony import */ var _lcg_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./lcg.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/lcg.js\");\n\n\n\n\nfunction x(d) {\n return d.x;\n}\n\nfunction y(d) {\n return d.y;\n}\n\nvar initialRadius = 10,\n initialAngle = Math.PI * (3 - Math.sqrt(5));\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(nodes) {\n var simulation,\n alpha = 1,\n alphaMin = 0.001,\n alphaDecay = 1 - Math.pow(alphaMin, 1 / 300),\n alphaTarget = 0,\n velocityDecay = 0.6,\n forces = new Map(),\n stepper = Object(d3_timer__WEBPACK_IMPORTED_MODULE_1__[\"timer\"])(step),\n event = Object(d3_dispatch__WEBPACK_IMPORTED_MODULE_0__[\"dispatch\"])(\"tick\", \"end\"),\n random = Object(_lcg_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])();\n\n if (nodes == null) nodes = [];\n\n function step() {\n tick();\n event.call(\"tick\", simulation);\n if (alpha < alphaMin) {\n stepper.stop();\n event.call(\"end\", simulation);\n }\n }\n\n function tick(iterations) {\n var i, n = nodes.length, node;\n\n if (iterations === undefined) iterations = 1;\n\n for (var k = 0; k < iterations; ++k) {\n alpha += (alphaTarget - alpha) * alphaDecay;\n\n forces.forEach(function(force) {\n force(alpha);\n });\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n if (node.fx == null) node.x += node.vx *= velocityDecay;\n else node.x = node.fx, node.vx = 0;\n if (node.fy == null) node.y += node.vy *= velocityDecay;\n else node.y = node.fy, node.vy = 0;\n }\n }\n\n return simulation;\n }\n\n function initializeNodes() {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.index = i;\n if (node.fx != null) node.x = node.fx;\n if (node.fy != null) node.y = node.fy;\n if (isNaN(node.x) || isNaN(node.y)) {\n var radius = initialRadius * Math.sqrt(0.5 + i), angle = i * initialAngle;\n node.x = radius * Math.cos(angle);\n node.y = radius * Math.sin(angle);\n }\n if (isNaN(node.vx) || isNaN(node.vy)) {\n node.vx = node.vy = 0;\n }\n }\n }\n\n function initializeForce(force) {\n if (force.initialize) force.initialize(nodes, random);\n return force;\n }\n\n initializeNodes();\n\n return simulation = {\n tick: tick,\n\n restart: function() {\n return stepper.restart(step), simulation;\n },\n\n stop: function() {\n return stepper.stop(), simulation;\n },\n\n nodes: function(_) {\n return arguments.length ? (nodes = _, initializeNodes(), forces.forEach(initializeForce), simulation) : nodes;\n },\n\n alpha: function(_) {\n return arguments.length ? (alpha = +_, simulation) : alpha;\n },\n\n alphaMin: function(_) {\n return arguments.length ? (alphaMin = +_, simulation) : alphaMin;\n },\n\n alphaDecay: function(_) {\n return arguments.length ? (alphaDecay = +_, simulation) : +alphaDecay;\n },\n\n alphaTarget: function(_) {\n return arguments.length ? (alphaTarget = +_, simulation) : alphaTarget;\n },\n\n velocityDecay: function(_) {\n return arguments.length ? (velocityDecay = 1 - _, simulation) : 1 - velocityDecay;\n },\n\n randomSource: function(_) {\n return arguments.length ? (random = _, forces.forEach(initializeForce), simulation) : random;\n },\n\n force: function(name, _) {\n return arguments.length > 1 ? ((_ == null ? forces.delete(name) : forces.set(name, initializeForce(_))), simulation) : forces.get(name);\n },\n\n find: function(x, y, radius) {\n var i = 0,\n n = nodes.length,\n dx,\n dy,\n d2,\n node,\n closest;\n\n if (radius == null) radius = Infinity;\n else radius *= radius;\n\n for (i = 0; i < n; ++i) {\n node = nodes[i];\n dx = x - node.x;\n dy = y - node.y;\n d2 = dx * dx + dy * dy;\n if (d2 < radius) closest = node, radius = d2;\n }\n\n return closest;\n },\n\n on: function(name, _) {\n return arguments.length > 1 ? (event.on(name, _), simulation) : event.on(name);\n }\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/simulation.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/difference.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/difference.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/x.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/x.js ***! + \******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ \"./node_modules/@antv/util/esm/filter.js\");\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/util/esm/contains.js\");\n\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to inspect.\n * @param {Array} values The values to exclude.\n * @return {Array} Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3]); // => [1]\n */\nvar difference = function (arr, values) {\n if (values === void 0) { values = []; }\n return Object(_filter__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr, function (value) { return !Object(_contains__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(values, value); });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (difference);\n//# sourceMappingURL=difference.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/difference.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n var strength = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0.1),\n nodes,\n strengths,\n xz;\n\n if (typeof x !== \"function\") x = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(x == null ? 0 : +x);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vx += (xz[i] - node.x) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n xz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(xz[i] = +x(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : strength;\n };\n\n force.x = function(_) {\n return arguments.length ? (x = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : x;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/x.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/each.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/each.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-force/src/y.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-force/src/y.js ***! + \******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/util/esm/is-object.js\");\n\n\nfunction each(elements, func) {\n if (!elements) {\n return;\n }\n var rst;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elements)) {\n for (var i = 0, len = elements.length; i < len; i++) {\n rst = func(elements[i], i);\n if (rst === false) {\n break;\n }\n }\n }\n else if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(elements)) {\n for (var k in elements) {\n if (elements.hasOwnProperty(k)) {\n rst = func(elements[k], k);\n if (rst === false) {\n break;\n }\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (each);\n//# sourceMappingURL=each.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/each.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/@antv/layout/node_modules/d3-force/src/constant.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(y) {\n var strength = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(0.1),\n nodes,\n strengths,\n yz;\n\n if (typeof y !== \"function\") y = Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(y == null ? 0 : +y);\n\n function force(alpha) {\n for (var i = 0, n = nodes.length, node; i < n; ++i) {\n node = nodes[i], node.vy += (yz[i] - node.y) * strengths[i] * alpha;\n }\n }\n\n function initialize() {\n if (!nodes) return;\n var i, n = nodes.length;\n strengths = new Array(n);\n yz = new Array(n);\n for (i = 0; i < n; ++i) {\n strengths[i] = isNaN(yz[i] = +y(nodes[i], i, nodes)) ? 0 : +strength(nodes[i], i, nodes);\n }\n }\n\n force.initialize = function(_) {\n nodes = _;\n initialize();\n };\n\n force.strength = function(_) {\n return arguments.length ? (strength = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : strength;\n };\n\n force.y = function(_) {\n return arguments.length ? (y = typeof _ === \"function\" ? _ : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+_), initialize(), force) : y;\n };\n\n return force;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-force/src/y.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/ends-with.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/ends-with.js ***! - \**************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/add.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/add.js ***! + \***********************************************************************/ +/*! exports provided: default, addAll */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n\nfunction endsWith(arr, e) {\n return (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr)) ? arr[arr.length - 1] === e : false;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (endsWith);\n//# sourceMappingURL=ends-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/ends-with.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"addAll\", function() { return addAll; });\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(d) {\n const x = +this._x.call(null, d),\n y = +this._y.call(null, d);\n return add(this.cover(x, y), x, y, d);\n});\n\nfunction add(tree, x, y, d) {\n if (isNaN(x) || isNaN(y)) return tree; // ignore invalid points\n\n var parent,\n node = tree._root,\n leaf = {data: d},\n x0 = tree._x0,\n y0 = tree._y0,\n x1 = tree._x1,\n y1 = tree._y1,\n xm,\n ym,\n xp,\n yp,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return tree._root = leaf, tree;\n\n // Find the existing leaf for the new point, or add it.\n while (node.length) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (parent = node, !(node = node[i = bottom << 1 | right])) return parent[i] = leaf, tree;\n }\n\n // Is the new point is exactly coincident with the existing point?\n xp = +tree._x.call(null, node.data);\n yp = +tree._y.call(null, node.data);\n if (x === xp && y === yp) return leaf.next = node, parent ? parent[i] = leaf : tree._root = leaf, tree;\n\n // Otherwise, split the leaf node until the old and new point are separated.\n do {\n parent = parent ? parent[i] = new Array(4) : tree._root = new Array(4);\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n } while ((i = bottom << 1 | right) === (j = (yp >= ym) << 1 | (xp >= xm)));\n return parent[j] = node, parent[i] = leaf, tree;\n}\n\nfunction addAll(data) {\n var d, i, n = data.length,\n x,\n y,\n xz = new Array(n),\n yz = new Array(n),\n x0 = Infinity,\n y0 = Infinity,\n x1 = -Infinity,\n y1 = -Infinity;\n\n // Compute the points and their extent.\n for (i = 0; i < n; ++i) {\n if (isNaN(x = +this._x.call(null, d = data[i])) || isNaN(y = +this._y.call(null, d))) continue;\n xz[i] = x;\n yz[i] = y;\n if (x < x0) x0 = x;\n if (x > x1) x1 = x;\n if (y < y0) y0 = y;\n if (y > y1) y1 = y;\n }\n\n // If there were no (valid) points, abort.\n if (x0 > x1 || y0 > y1) return this;\n\n // Expand the tree to cover the new points.\n this.cover(x0, y0).cover(x1, y1);\n\n // Add the new points.\n for (i = 0; i < n; ++i) {\n add(this, xz[i], yz[i], data[i]);\n }\n\n return this;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/add.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/every.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/util/esm/every.js ***! - \**********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/cover.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/cover.js ***! + \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 只要有一个不满足条件就返回 false\n * @param arr\n * @param func\n */\nvar every = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (!func(arr[i], i))\n return false;\n }\n return true;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (every);\n//# sourceMappingURL=every.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/every.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y) {\n if (isNaN(x = +x) || isNaN(y = +y)) return this; // ignore invalid points\n\n var x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1;\n\n // If the quadtree has no extent, initialize them.\n // Integer extent are necessary so that if we later double the extent,\n // the existing quadrant boundaries don’t change due to floating point error!\n if (isNaN(x0)) {\n x1 = (x0 = Math.floor(x)) + 1;\n y1 = (y0 = Math.floor(y)) + 1;\n }\n\n // Otherwise, double repeatedly to cover.\n else {\n var z = x1 - x0 || 1,\n node = this._root,\n parent,\n i;\n\n while (x0 > x || x >= x1 || y0 > y || y >= y1) {\n i = (y < y0) << 1 | (x < x0);\n parent = new Array(4), parent[i] = node, node = parent, z *= 2;\n switch (i) {\n case 0: x1 = x0 + z, y1 = y0 + z; break;\n case 1: x0 = x1 - z, y1 = y0 + z; break;\n case 2: x1 = x0 + z, y0 = y1 - z; break;\n case 3: x0 = x1 - z, y0 = y1 - z; break;\n }\n }\n\n if (this._root && this._root.length) this._root = node;\n }\n\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n return this;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/cover.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/extend.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/extend.js ***! - \***********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/data.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/data.js ***! + \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/util/esm/mix.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\nvar extend = function (subclass, superclass, overrides, staticOverrides) {\n // 如果只提供父类构造函数,则自动生成子类构造函数\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(superclass)) {\n overrides = superclass;\n superclass = subclass;\n subclass = function () { };\n }\n var create = Object.create ?\n function (proto, c) {\n return Object.create(proto, {\n constructor: {\n value: c\n }\n });\n } :\n function (proto, c) {\n function Tmp() { }\n Tmp.prototype = proto;\n var o = new Tmp();\n o.constructor = c;\n return o;\n };\n var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype\n subclass.prototype = Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(superObj, subclass.prototype); // 指定子类的prototype\n subclass.superclass = create(superclass.prototype, superclass);\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(superObj, overrides);\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(subclass, staticOverrides);\n return subclass;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (extend);\n//# sourceMappingURL=extend.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/extend.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n var data = [];\n this.visit(function(node) {\n if (!node.length) do data.push(node.data); while (node = node.next)\n });\n return data;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/data.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/filter.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/filter.js ***! - \***********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/extent.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/extent.js ***! + \**************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar filter = function (arr, func) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n if (func(value, index)) {\n result.push(value);\n }\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (filter);\n//# sourceMappingURL=filter.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/filter.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(_) {\n return arguments.length\n ? this.cover(+_[0][0], +_[0][1]).cover(+_[1][0], +_[1][1])\n : isNaN(this._x0) ? undefined : [[this._x0, this._y0], [this._x1, this._y1]];\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/extent.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/find-index.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/find-index.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/find.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/find.js ***! + \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nfunction findIndex(arr, predicate, fromIndex) {\n if (fromIndex === void 0) { fromIndex = 0; }\n for (var i = fromIndex; i < arr.length; i++) {\n if (predicate(arr[i], i)) {\n // 找到终止循环\n return i;\n }\n }\n return -1;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (findIndex);\n//# sourceMappingURL=find-index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/find-index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x, y, radius) {\n var data,\n x0 = this._x0,\n y0 = this._y0,\n x1,\n y1,\n x2,\n y2,\n x3 = this._x1,\n y3 = this._y1,\n quads = [],\n node = this._root,\n q,\n i;\n\n if (node) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, x0, y0, x3, y3));\n if (radius == null) radius = Infinity;\n else {\n x0 = x - radius, y0 = y - radius;\n x3 = x + radius, y3 = y + radius;\n radius *= radius;\n }\n\n while (q = quads.pop()) {\n\n // Stop searching if this quadrant can’t contain a closer node.\n if (!(node = q.node)\n || (x1 = q.x0) > x3\n || (y1 = q.y0) > y3\n || (x2 = q.x1) < x0\n || (y2 = q.y1) < y0) continue;\n\n // Bisect the current quadrant.\n if (node.length) {\n var xm = (x1 + x2) / 2,\n ym = (y1 + y2) / 2;\n\n quads.push(\n new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node[3], xm, ym, x2, y2),\n new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node[2], x1, ym, xm, y2),\n new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node[1], xm, y1, x2, ym),\n new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node[0], x1, y1, xm, ym)\n );\n\n // Visit the closest quadrant first.\n if (i = (y >= ym) << 1 | (x >= xm)) {\n q = quads[quads.length - 1];\n quads[quads.length - 1] = quads[quads.length - 1 - i];\n quads[quads.length - 1 - i] = q;\n }\n }\n\n // Visit this point. (Visiting coincident points isn’t necessary!)\n else {\n var dx = x - +this._x.call(null, node.data),\n dy = y - +this._y.call(null, node.data),\n d2 = dx * dx + dy * dy;\n if (d2 < radius) {\n var d = Math.sqrt(radius = d2);\n x0 = x - d, y0 = y - d;\n x3 = x + d, y3 = y + d;\n data = node.data;\n }\n }\n }\n\n return data;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/find.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/find.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/find.js ***! - \*********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js ***! + \*************************************************************************/ +/*! exports provided: quadtree */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n/* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-match */ \"./node_modules/@antv/util/esm/is-match.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n\n\n\n\nfunction find(arr, predicate) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arr))\n return null;\n var _predicate;\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(predicate)) {\n _predicate = predicate;\n }\n if (Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(predicate)) {\n _predicate = function (a) { return Object(_is_match__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(a, predicate); };\n }\n if (_predicate) {\n for (var i = 0; i < arr.length; i += 1) {\n if (_predicate(arr[i])) {\n return arr[i];\n }\n }\n }\n return null;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (find);\n//# sourceMappingURL=find.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/find.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _quadtree_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quadtree.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/quadtree.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"quadtree\", function() { return _quadtree_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/first-value.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/util/esm/first-value.js ***! - \****************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js ***! + \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n\nvar firstValue = function (data, name) {\n var rst = null;\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云\n }\n else {\n rst = value;\n }\n break;\n }\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (firstValue);\n//# sourceMappingURL=first-value.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/first-value.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(node, x0, y0, x1, y1) {\n this.node = node;\n this.x0 = x0;\n this.y0 = y0;\n this.x1 = x1;\n this.y1 = y1;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/fixed-base.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/fixed-base.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/quadtree.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/quadtree.js ***! + \****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar fixedBase = function (v, base) {\n var str = base.toString();\n var index = str.indexOf('.');\n if (index === -1) {\n return Math.round(v);\n }\n var length = str.substr(index + 1).length;\n if (length > 20) {\n length = 20;\n }\n return parseFloat(v.toFixed(length));\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (fixedBase);\n//# sourceMappingURL=fixed-base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/fixed-base.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return quadtree; });\n/* harmony import */ var _add_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./add.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/add.js\");\n/* harmony import */ var _cover_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cover.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/cover.js\");\n/* harmony import */ var _data_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./data.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/data.js\");\n/* harmony import */ var _extent_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./extent.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/extent.js\");\n/* harmony import */ var _find_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./find.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/find.js\");\n/* harmony import */ var _remove_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./remove.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/remove.js\");\n/* harmony import */ var _root_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./root.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/root.js\");\n/* harmony import */ var _size_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./size.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/size.js\");\n/* harmony import */ var _visit_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./visit.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/visit.js\");\n/* harmony import */ var _visitAfter_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./visitAfter.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/visitAfter.js\");\n/* harmony import */ var _x_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./x.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/x.js\");\n/* harmony import */ var _y_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./y.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/y.js\");\n\n\n\n\n\n\n\n\n\n\n\n\n\nfunction quadtree(nodes, x, y) {\n var tree = new Quadtree(x == null ? _x_js__WEBPACK_IMPORTED_MODULE_10__[\"defaultX\"] : x, y == null ? _y_js__WEBPACK_IMPORTED_MODULE_11__[\"defaultY\"] : y, NaN, NaN, NaN, NaN);\n return nodes == null ? tree : tree.addAll(nodes);\n}\n\nfunction Quadtree(x, y, x0, y0, x1, y1) {\n this._x = x;\n this._y = y;\n this._x0 = x0;\n this._y0 = y0;\n this._x1 = x1;\n this._y1 = y1;\n this._root = undefined;\n}\n\nfunction leaf_copy(leaf) {\n var copy = {data: leaf.data}, next = copy;\n while (leaf = leaf.next) next = next.next = {data: leaf.data};\n return copy;\n}\n\nvar treeProto = quadtree.prototype = Quadtree.prototype;\n\ntreeProto.copy = function() {\n var copy = new Quadtree(this._x, this._y, this._x0, this._y0, this._x1, this._y1),\n node = this._root,\n nodes,\n child;\n\n if (!node) return copy;\n\n if (!node.length) return copy._root = leaf_copy(node), copy;\n\n nodes = [{source: node, target: copy._root = new Array(4)}];\n while (node = nodes.pop()) {\n for (var i = 0; i < 4; ++i) {\n if (child = node.source[i]) {\n if (child.length) nodes.push({source: child, target: node.target[i] = new Array(4)});\n else node.target[i] = leaf_copy(child);\n }\n }\n }\n\n return copy;\n};\n\ntreeProto.add = _add_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"];\ntreeProto.addAll = _add_js__WEBPACK_IMPORTED_MODULE_0__[\"addAll\"];\ntreeProto.cover = _cover_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"];\ntreeProto.data = _data_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"];\ntreeProto.extent = _extent_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"];\ntreeProto.find = _find_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"];\ntreeProto.remove = _remove_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"];\ntreeProto.removeAll = _remove_js__WEBPACK_IMPORTED_MODULE_5__[\"removeAll\"];\ntreeProto.root = _root_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"];\ntreeProto.size = _size_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"];\ntreeProto.visit = _visit_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"];\ntreeProto.visitAfter = _visitAfter_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"];\ntreeProto.x = _x_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"];\ntreeProto.y = _y_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"];\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/quadtree.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/flatten-deep.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/util/esm/flatten-deep.js ***! - \*****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/remove.js": +/*!**************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/remove.js ***! + \**************************************************************************/ +/*! exports provided: default, removeAll */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @param {Array} result The array to return.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]\n */\nvar flattenDeep = function (arr, result) {\n if (result === void 0) { result = []; }\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n result.push(arr);\n }\n else {\n for (var i = 0; i < arr.length; i += 1) {\n flattenDeep(arr[i], result);\n }\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (flattenDeep);\n//# sourceMappingURL=flatten-deep.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/flatten-deep.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"removeAll\", function() { return removeAll; });\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(d) {\n if (isNaN(x = +this._x.call(null, d)) || isNaN(y = +this._y.call(null, d))) return this; // ignore invalid points\n\n var parent,\n node = this._root,\n retainer,\n previous,\n next,\n x0 = this._x0,\n y0 = this._y0,\n x1 = this._x1,\n y1 = this._y1,\n x,\n y,\n xm,\n ym,\n right,\n bottom,\n i,\n j;\n\n // If the tree is empty, initialize the root as a leaf.\n if (!node) return this;\n\n // Find the leaf node for the point.\n // While descending, also retain the deepest parent with a non-removed sibling.\n if (node.length) while (true) {\n if (right = x >= (xm = (x0 + x1) / 2)) x0 = xm; else x1 = xm;\n if (bottom = y >= (ym = (y0 + y1) / 2)) y0 = ym; else y1 = ym;\n if (!(parent = node, node = node[i = bottom << 1 | right])) return this;\n if (!node.length) break;\n if (parent[(i + 1) & 3] || parent[(i + 2) & 3] || parent[(i + 3) & 3]) retainer = parent, j = i;\n }\n\n // Find the point to remove.\n while (node.data !== d) if (!(previous = node, node = node.next)) return this;\n if (next = node.next) delete node.next;\n\n // If there are multiple coincident points, remove just the point.\n if (previous) return (next ? previous.next = next : delete previous.next), this;\n\n // If this is the root point, remove it.\n if (!parent) return this._root = next, this;\n\n // Remove this leaf.\n next ? parent[i] = next : delete parent[i];\n\n // If the parent now contains exactly one leaf, collapse superfluous parents.\n if ((node = parent[0] || parent[1] || parent[2] || parent[3])\n && node === (parent[3] || parent[2] || parent[1] || parent[0])\n && !node.length) {\n if (retainer) retainer[j] = node;\n else this._root = node;\n }\n\n return this;\n});\n\nfunction removeAll(data) {\n for (var i = 0, n = data.length; i < n; ++i) this.remove(data[i]);\n return this;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/remove.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/flatten.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/flatten.js ***! - \************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/root.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/root.js ***! + \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]\n */\nvar flatten = function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return [];\n }\n var rst = [];\n for (var i = 0; i < arr.length; i++) {\n rst = rst.concat(arr[i]);\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (flatten);\n//# sourceMappingURL=flatten.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/flatten.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n return this._root;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/root.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/for-in.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/for-in.js ***! - \***********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/size.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/size.js ***! + \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n//# sourceMappingURL=for-in.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/for-in.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function() {\n var size = 0;\n this.visit(function(node) {\n if (!node.length) do ++size; while (node = node.next)\n });\n return size;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/size.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/get-ellipsis-text.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/util/esm/get-ellipsis-text.js ***! - \**********************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/visit.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/visit.js ***! + \*************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n/* harmony import */ var _measure_text_width__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./measure-text-width */ \"./node_modules/@antv/util/esm/measure-text-width.js\");\n\n\n\n/**\n * 获取文本的 ... 文本。\n * 算法(减少每次 measureText 的长度,measureText 的性能跟字符串时间相关):\n * 1. 先通过 STEP 逐步计算,找到最后一个小于 maxWidth 的字符串\n * 2. 然后对最后这个字符串二分计算\n * @param text 需要计算的文本, 由于历史原因 除了支持string,还支持空值,number和数组等\n * @param maxWidth 最大宽度\n * @param font 字体\n * @param str 要替换的文本\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (text, maxWidth, font, str) {\n if (str === void 0) { str = '...'; }\n var STEP = 16; // 每次 16,调参工程师\n var PLACEHOLDER_WIDTH = Object(_measure_text_width__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(str, font);\n var leftText = !Object(_is_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(text) ? Object(_to_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(text) : text;\n var leftWidth = maxWidth;\n var r = []; // 最终的分段字符串\n var currentText;\n var currentWidth;\n if (Object(_measure_text_width__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(text, font) <= maxWidth) {\n return text;\n }\n // 首先通过 step 计算,找出最大的未超出长度的\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // 更新字符串\n currentText = leftText.substr(0, STEP);\n // 计算宽度\n currentWidth = Object(_measure_text_width__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(currentText, font);\n // 超出剩余宽度,则停止\n if (currentWidth + PLACEHOLDER_WIDTH > leftWidth) {\n if (currentWidth > leftWidth) {\n break;\n }\n }\n r.push(currentText);\n // 没有超出,则计算剩余宽度\n leftWidth -= currentWidth;\n leftText = leftText.substr(STEP);\n // 字符串整体没有超出\n if (!leftText) {\n return r.join('');\n }\n }\n // 最下的最后一个 STEP,使用 1 递增(用二分效果更高)\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // 更新字符串\n currentText = leftText.substr(0, 1);\n // 计算宽度\n currentWidth = Object(_measure_text_width__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(currentText, font);\n // 超出剩余宽度,则停止\n if (currentWidth + PLACEHOLDER_WIDTH > leftWidth) {\n break;\n }\n r.push(currentText);\n // 没有超出,则计算剩余宽度\n leftWidth -= currentWidth;\n leftText = leftText.substr(1);\n if (!leftText) {\n return r.join('');\n }\n }\n return \"\" + r.join('') + str;\n});\n//# sourceMappingURL=get-ellipsis-text.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get-ellipsis-text.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(callback) {\n var quads = [], q, node = this._root, child, x0, y0, x1, y1;\n if (node) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](node, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n if (!callback(node = q.node, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1) && node.length) {\n var xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[3]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, xm, ym, x1, y1));\n if (child = node[2]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, x0, ym, xm, y1));\n if (child = node[1]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, xm, y0, x1, ym));\n if (child = node[0]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, x0, y0, xm, ym));\n }\n }\n return this;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/visit.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/get-range.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/get-range.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/visitAfter.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/visitAfter.js ***! + \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _max__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./max */ \"./node_modules/@antv/util/esm/max.js\");\n/* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./min */ \"./node_modules/@antv/util/esm/min.js\");\n\n\n\nvar getRange = function (values) {\n // 存在 NaN 时,min,max 判定会出问题\n var filterValues = values.filter(function (v) { return !isNaN(v); });\n if (!filterValues.length) {\n // 如果没有数值则直接返回0\n return {\n min: 0,\n max: 0,\n };\n }\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(values[0])) {\n var tmp = [];\n for (var i = 0; i < values.length; i++) {\n tmp = tmp.concat(values[i]);\n }\n filterValues = tmp;\n }\n var max = Object(_max__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(filterValues);\n var min = Object(_min__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(filterValues);\n return {\n min: min,\n max: max,\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (getRange);\n//# sourceMappingURL=get-range.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get-range.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./quad.js */ \"./node_modules/@antv/layout/node_modules/d3-quadtree/src/quad.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(callback) {\n var quads = [], next = [], q;\n if (this._root) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](this._root, this._x0, this._y0, this._x1, this._y1));\n while (q = quads.pop()) {\n var node = q.node;\n if (node.length) {\n var child, x0 = q.x0, y0 = q.y0, x1 = q.x1, y1 = q.y1, xm = (x0 + x1) / 2, ym = (y0 + y1) / 2;\n if (child = node[0]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, x0, y0, xm, ym));\n if (child = node[1]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, xm, y0, x1, ym));\n if (child = node[2]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, x0, ym, xm, y1));\n if (child = node[3]) quads.push(new _quad_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"](child, xm, ym, x1, y1));\n }\n next.push(q);\n }\n while (q = next.pop()) {\n callback(q.node, q.x0, q.y0, q.x1, q.y1);\n }\n return this;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/visitAfter.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/get-type.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/get-type.js ***! - \*************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/x.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/x.js ***! + \*********************************************************************/ +/*! exports provided: defaultX, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar toString = {}.toString;\nvar getType = function (value) {\n return toString.call(value).replace(/^\\[object /, '').replace(/]$/, '');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (getType);\n//# sourceMappingURL=get-type.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get-type.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultX\", function() { return defaultX; });\nfunction defaultX(d) {\n return d[0];\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(_) {\n return arguments.length ? (this._x = _, this) : this._x;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/x.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/get-wrap-behavior.js": -/*!**********************************************************!*\ - !*** ./node_modules/@antv/util/esm/get-wrap-behavior.js ***! - \**********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/d3-quadtree/src/y.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/d3-quadtree/src/y.js ***! + \*********************************************************************/ +/*! exports provided: defaultY, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 获取封装的事件\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction getWrapBehavior(obj, action) {\n return obj['_wrap_' + action];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (getWrapBehavior);\n//# sourceMappingURL=get-wrap-behavior.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get-wrap-behavior.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultY\", function() { return defaultY; });\nfunction defaultY(d) {\n return d[1];\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(_) {\n return arguments.length ? (this._y = _, this) : this._y;\n});\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/d3-quadtree/src/y.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/get.js": -/*!********************************************!*\ - !*** ./node_modules/@antv/util/esm/get.js ***! - \********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/correlation.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/correlation.js ***! + \*****************************************************************************/ +/*! exports provided: correlation */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param key\n * @param defaultValue\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, key, defaultValue) {\n var p = 0;\n var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(key) ? key.split('.') : key;\n while (obj && p < keyArr.length) {\n obj = obj[keyArr[p++]];\n }\n return (obj === undefined || p < keyArr.length) ? defaultValue : obj;\n});\n//# sourceMappingURL=get.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"correlation\", function() { return correlation; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n\n\nfunction correlation(xMatrix, yMatrix = xMatrix, options = {}) {\n xMatrix = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](xMatrix);\n let yIsSame = false;\n if (\n typeof yMatrix === 'object' &&\n !_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isMatrix(yMatrix) &&\n !Array.isArray(yMatrix)\n ) {\n options = yMatrix;\n yMatrix = xMatrix;\n yIsSame = true;\n } else {\n yMatrix = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](yMatrix);\n }\n if (xMatrix.rows !== yMatrix.rows) {\n throw new TypeError('Both matrices must have the same number of rows');\n }\n\n const { center = true, scale = true } = options;\n if (center) {\n xMatrix.center('column');\n if (!yIsSame) {\n yMatrix.center('column');\n }\n }\n if (scale) {\n xMatrix.scale('column');\n if (!yIsSame) {\n yMatrix.scale('column');\n }\n }\n\n const sdx = xMatrix.standardDeviation('column', { unbiased: true });\n const sdy = yIsSame\n ? sdx\n : yMatrix.standardDeviation('column', { unbiased: true });\n\n const corr = xMatrix.transpose().mmul(yMatrix);\n for (let i = 0; i < corr.rows; i++) {\n for (let j = 0; j < corr.columns; j++) {\n corr.set(\n i,\n j,\n corr.get(i, j) * (1 / (sdx[i] * sdy[j])) * (1 / (xMatrix.rows - 1)),\n );\n }\n }\n return corr;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/correlation.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/group-by.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/group-by.js ***! - \*************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/covariance.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/covariance.js ***! + \****************************************************************************/ +/*! exports provided: covariance */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction groupBy(data, condition) {\n if (!condition || !Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data)) {\n return {};\n }\n var result = {};\n // 兼容方法和 字符串的写法\n var predicate = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(condition) ? condition : function (item) { return item[condition]; };\n var key;\n for (var i = 0; i < data.length; i++) {\n var item = data[i];\n key = predicate(item);\n if (hasOwnProperty.call(result, key)) {\n result[key].push(item);\n }\n else {\n result[key] = [item];\n }\n }\n return result;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (groupBy);\n//# sourceMappingURL=group-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/group-by.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"covariance\", function() { return covariance; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n\n\nfunction covariance(xMatrix, yMatrix = xMatrix, options = {}) {\n xMatrix = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](xMatrix);\n let yIsSame = false;\n if (\n typeof yMatrix === 'object' &&\n !_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].isMatrix(yMatrix) &&\n !Array.isArray(yMatrix)\n ) {\n options = yMatrix;\n yMatrix = xMatrix;\n yIsSame = true;\n } else {\n yMatrix = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](yMatrix);\n }\n if (xMatrix.rows !== yMatrix.rows) {\n throw new TypeError('Both matrices must have the same number of rows');\n }\n const { center = true } = options;\n if (center) {\n xMatrix = xMatrix.center('column');\n if (!yIsSame) {\n yMatrix = yMatrix.center('column');\n }\n }\n const cov = xMatrix.transpose().mmul(yMatrix);\n for (let i = 0; i < cov.rows; i++) {\n for (let j = 0; j < cov.columns; j++) {\n cov.set(i, j, cov.get(i, j) * (1 / (xMatrix.rows - 1)));\n }\n }\n return cov;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/covariance.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/group-to-map.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/util/esm/group-to-map.js ***! - \*****************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/cholesky.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/cholesky.js ***! + \*****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return groupToMap; });\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n/* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./group-by */ \"./node_modules/@antv/util/esm/group-by.js\");\n\n\n\n/**\n * 将数据分组成 map\n * @param data\n * @param condition\n */\nfunction groupToMap(data, condition) {\n if (!condition) {\n return {\n 0: data,\n };\n }\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(condition)) {\n // 如果是字符串,则按照 a*b 风格成数组\n var paramscondition_1 = Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(condition) ? condition : condition.replace(/\\s+/g, '').split('*');\n condition = function (row) {\n var unique = '_'; // 避免出现数字作为Key的情况,会进行按照数字的排序\n // 根据字段列表的值,拼接成 key\n for (var i = 0, l = paramscondition_1.length; i < l; i++) {\n unique += row[paramscondition_1[i]] && row[paramscondition_1[i]].toString();\n }\n return unique;\n };\n }\n return Object(_group_by__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(data, condition);\n}\n//# sourceMappingURL=group-to-map.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/group-to-map.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CholeskyDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\nclass CholeskyDecomposition {\n constructor(value) {\n value = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(value);\n if (!value.isSymmetric()) {\n throw new Error('Matrix is not symmetric');\n }\n\n let a = value;\n let dimension = a.rows;\n let l = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](dimension, dimension);\n let positiveDefinite = true;\n let i, j, k;\n\n for (j = 0; j < dimension; j++) {\n let d = 0;\n for (k = 0; k < j; k++) {\n let s = 0;\n for (i = 0; i < k; i++) {\n s += l.get(k, i) * l.get(j, i);\n }\n s = (a.get(j, k) - s) / l.get(k, k);\n l.set(j, k, s);\n d = d + s * s;\n }\n\n d = a.get(j, j) - d;\n\n positiveDefinite &= d > 0;\n l.set(j, j, Math.sqrt(Math.max(d, 0)));\n for (k = j + 1; k < dimension; k++) {\n l.set(j, k, 0);\n }\n }\n\n this.L = l;\n this.positiveDefinite = Boolean(positiveDefinite);\n }\n\n isPositiveDefinite() {\n return this.positiveDefinite;\n }\n\n solve(value) {\n value = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(value);\n\n let l = this.L;\n let dimension = l.rows;\n\n if (value.rows !== dimension) {\n throw new Error('Matrix dimensions do not match');\n }\n if (this.isPositiveDefinite() === false) {\n throw new Error('Matrix is not positive definite');\n }\n\n let count = value.columns;\n let B = value.clone();\n let i, j, k;\n\n for (k = 0; k < dimension; k++) {\n for (j = 0; j < count; j++) {\n for (i = 0; i < k; i++) {\n B.set(k, j, B.get(k, j) - B.get(i, j) * l.get(k, i));\n }\n B.set(k, j, B.get(k, j) / l.get(k, k));\n }\n }\n\n for (k = dimension - 1; k >= 0; k--) {\n for (j = 0; j < count; j++) {\n for (i = k + 1; i < dimension; i++) {\n B.set(k, j, B.get(k, j) - B.get(i, j) * l.get(i, k));\n }\n B.set(k, j, B.get(k, j) / l.get(k, k));\n }\n }\n\n return B;\n }\n\n get lowerTriangularMatrix() {\n return this.L;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/cholesky.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/group.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/util/esm/group.js ***! - \**********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/evd.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/evd.js ***! + \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./group-to-map */ \"./node_modules/@antv/util/esm/group-to-map.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (data, condition) {\n if (!condition) {\n // 没有条件,则自身改成数组\n return [data];\n }\n var groups = Object(_group_to_map__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data, condition);\n var array = [];\n for (var i in groups) {\n array.push(groups[i]);\n }\n return array;\n});\n//# sourceMappingURL=group.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/group.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return EigenvalueDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/util.js\");\n\n\n\n\n\nclass EigenvalueDecomposition {\n constructor(matrix, options = {}) {\n const { assumeSymmetric = false } = options;\n\n matrix = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n if (!matrix.isSquare()) {\n throw new Error('Matrix is not a square matrix');\n }\n\n let n = matrix.columns;\n let V = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n let d = new Float64Array(n);\n let e = new Float64Array(n);\n let value = matrix;\n let i, j;\n\n let isSymmetric = false;\n if (assumeSymmetric) {\n isSymmetric = true;\n } else {\n isSymmetric = matrix.isSymmetric();\n }\n\n if (isSymmetric) {\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n V.set(i, j, value.get(i, j));\n }\n }\n tred2(n, e, d, V);\n tql2(n, e, d, V);\n } else {\n let H = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n let ort = new Float64Array(n);\n for (j = 0; j < n; j++) {\n for (i = 0; i < n; i++) {\n H.set(i, j, value.get(i, j));\n }\n }\n orthes(n, H, ort, V);\n hqr2(n, e, d, V, H);\n }\n\n this.n = n;\n this.e = e;\n this.d = d;\n this.V = V;\n }\n\n get realEigenvalues() {\n return Array.from(this.d);\n }\n\n get imaginaryEigenvalues() {\n return Array.from(this.e);\n }\n\n get eigenvectorMatrix() {\n return this.V;\n }\n\n get diagonalMatrix() {\n let n = this.n;\n let e = this.e;\n let d = this.d;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n let i, j;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n X.set(i, j, 0);\n }\n X.set(i, i, d[i]);\n if (e[i] > 0) {\n X.set(i, i + 1, e[i]);\n } else if (e[i] < 0) {\n X.set(i, i - 1, e[i]);\n }\n }\n return X;\n }\n}\n\nfunction tred2(n, e, d, V) {\n let f, g, h, i, j, k, hh, scale;\n\n for (j = 0; j < n; j++) {\n d[j] = V.get(n - 1, j);\n }\n\n for (i = n - 1; i > 0; i--) {\n scale = 0;\n h = 0;\n for (k = 0; k < i; k++) {\n scale = scale + Math.abs(d[k]);\n }\n\n if (scale === 0) {\n e[i] = d[i - 1];\n for (j = 0; j < i; j++) {\n d[j] = V.get(i - 1, j);\n V.set(i, j, 0);\n V.set(j, i, 0);\n }\n } else {\n for (k = 0; k < i; k++) {\n d[k] /= scale;\n h += d[k] * d[k];\n }\n\n f = d[i - 1];\n g = Math.sqrt(h);\n if (f > 0) {\n g = -g;\n }\n\n e[i] = scale * g;\n h = h - f * g;\n d[i - 1] = f - g;\n for (j = 0; j < i; j++) {\n e[j] = 0;\n }\n\n for (j = 0; j < i; j++) {\n f = d[j];\n V.set(j, i, f);\n g = e[j] + V.get(j, j) * f;\n for (k = j + 1; k <= i - 1; k++) {\n g += V.get(k, j) * d[k];\n e[k] += V.get(k, j) * f;\n }\n e[j] = g;\n }\n\n f = 0;\n for (j = 0; j < i; j++) {\n e[j] /= h;\n f += e[j] * d[j];\n }\n\n hh = f / (h + h);\n for (j = 0; j < i; j++) {\n e[j] -= hh * d[j];\n }\n\n for (j = 0; j < i; j++) {\n f = d[j];\n g = e[j];\n for (k = j; k <= i - 1; k++) {\n V.set(k, j, V.get(k, j) - (f * e[k] + g * d[k]));\n }\n d[j] = V.get(i - 1, j);\n V.set(i, j, 0);\n }\n }\n d[i] = h;\n }\n\n for (i = 0; i < n - 1; i++) {\n V.set(n - 1, i, V.get(i, i));\n V.set(i, i, 1);\n h = d[i + 1];\n if (h !== 0) {\n for (k = 0; k <= i; k++) {\n d[k] = V.get(k, i + 1) / h;\n }\n\n for (j = 0; j <= i; j++) {\n g = 0;\n for (k = 0; k <= i; k++) {\n g += V.get(k, i + 1) * V.get(k, j);\n }\n for (k = 0; k <= i; k++) {\n V.set(k, j, V.get(k, j) - g * d[k]);\n }\n }\n }\n\n for (k = 0; k <= i; k++) {\n V.set(k, i + 1, 0);\n }\n }\n\n for (j = 0; j < n; j++) {\n d[j] = V.get(n - 1, j);\n V.set(n - 1, j, 0);\n }\n\n V.set(n - 1, n - 1, 1);\n e[0] = 0;\n}\n\nfunction tql2(n, e, d, V) {\n let g, h, i, j, k, l, m, p, r, dl1, c, c2, c3, el1, s, s2, iter;\n\n for (i = 1; i < n; i++) {\n e[i - 1] = e[i];\n }\n\n e[n - 1] = 0;\n\n let f = 0;\n let tst1 = 0;\n let eps = Number.EPSILON;\n\n for (l = 0; l < n; l++) {\n tst1 = Math.max(tst1, Math.abs(d[l]) + Math.abs(e[l]));\n m = l;\n while (m < n) {\n if (Math.abs(e[m]) <= eps * tst1) {\n break;\n }\n m++;\n }\n\n if (m > l) {\n iter = 0;\n do {\n iter = iter + 1;\n\n g = d[l];\n p = (d[l + 1] - g) / (2 * e[l]);\n r = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(p, 1);\n if (p < 0) {\n r = -r;\n }\n\n d[l] = e[l] / (p + r);\n d[l + 1] = e[l] * (p + r);\n dl1 = d[l + 1];\n h = g - d[l];\n for (i = l + 2; i < n; i++) {\n d[i] -= h;\n }\n\n f = f + h;\n\n p = d[m];\n c = 1;\n c2 = c;\n c3 = c;\n el1 = e[l + 1];\n s = 0;\n s2 = 0;\n for (i = m - 1; i >= l; i--) {\n c3 = c2;\n c2 = c;\n s2 = s;\n g = c * e[i];\n h = c * p;\n r = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(p, e[i]);\n e[i + 1] = s * r;\n s = e[i] / r;\n c = p / r;\n p = c * d[i] - s * g;\n d[i + 1] = h + s * (c * g + s * d[i]);\n\n for (k = 0; k < n; k++) {\n h = V.get(k, i + 1);\n V.set(k, i + 1, s * V.get(k, i) + c * h);\n V.set(k, i, c * V.get(k, i) - s * h);\n }\n }\n\n p = (-s * s2 * c3 * el1 * e[l]) / dl1;\n e[l] = s * p;\n d[l] = c * p;\n } while (Math.abs(e[l]) > eps * tst1);\n }\n d[l] = d[l] + f;\n e[l] = 0;\n }\n\n for (i = 0; i < n - 1; i++) {\n k = i;\n p = d[i];\n for (j = i + 1; j < n; j++) {\n if (d[j] < p) {\n k = j;\n p = d[j];\n }\n }\n\n if (k !== i) {\n d[k] = d[i];\n d[i] = p;\n for (j = 0; j < n; j++) {\n p = V.get(j, i);\n V.set(j, i, V.get(j, k));\n V.set(j, k, p);\n }\n }\n }\n}\n\nfunction orthes(n, H, ort, V) {\n let low = 0;\n let high = n - 1;\n let f, g, h, i, j, m;\n let scale;\n\n for (m = low + 1; m <= high - 1; m++) {\n scale = 0;\n for (i = m; i <= high; i++) {\n scale = scale + Math.abs(H.get(i, m - 1));\n }\n\n if (scale !== 0) {\n h = 0;\n for (i = high; i >= m; i--) {\n ort[i] = H.get(i, m - 1) / scale;\n h += ort[i] * ort[i];\n }\n\n g = Math.sqrt(h);\n if (ort[m] > 0) {\n g = -g;\n }\n\n h = h - ort[m] * g;\n ort[m] = ort[m] - g;\n\n for (j = m; j < n; j++) {\n f = 0;\n for (i = high; i >= m; i--) {\n f += ort[i] * H.get(i, j);\n }\n\n f = f / h;\n for (i = m; i <= high; i++) {\n H.set(i, j, H.get(i, j) - f * ort[i]);\n }\n }\n\n for (i = 0; i <= high; i++) {\n f = 0;\n for (j = high; j >= m; j--) {\n f += ort[j] * H.get(i, j);\n }\n\n f = f / h;\n for (j = m; j <= high; j++) {\n H.set(i, j, H.get(i, j) - f * ort[j]);\n }\n }\n\n ort[m] = scale * ort[m];\n H.set(m, m - 1, scale * g);\n }\n }\n\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n V.set(i, j, i === j ? 1 : 0);\n }\n }\n\n for (m = high - 1; m >= low + 1; m--) {\n if (H.get(m, m - 1) !== 0) {\n for (i = m + 1; i <= high; i++) {\n ort[i] = H.get(i, m - 1);\n }\n\n for (j = m; j <= high; j++) {\n g = 0;\n for (i = m; i <= high; i++) {\n g += ort[i] * V.get(i, j);\n }\n\n g = g / ort[m] / H.get(m, m - 1);\n for (i = m; i <= high; i++) {\n V.set(i, j, V.get(i, j) + g * ort[i]);\n }\n }\n }\n }\n}\n\nfunction hqr2(nn, e, d, V, H) {\n let n = nn - 1;\n let low = 0;\n let high = nn - 1;\n let eps = Number.EPSILON;\n let exshift = 0;\n let norm = 0;\n let p = 0;\n let q = 0;\n let r = 0;\n let s = 0;\n let z = 0;\n let iter = 0;\n let i, j, k, l, m, t, w, x, y;\n let ra, sa, vr, vi;\n let notlast, cdivres;\n\n for (i = 0; i < nn; i++) {\n if (i < low || i > high) {\n d[i] = H.get(i, i);\n e[i] = 0;\n }\n\n for (j = Math.max(i - 1, 0); j < nn; j++) {\n norm = norm + Math.abs(H.get(i, j));\n }\n }\n\n while (n >= low) {\n l = n;\n while (l > low) {\n s = Math.abs(H.get(l - 1, l - 1)) + Math.abs(H.get(l, l));\n if (s === 0) {\n s = norm;\n }\n if (Math.abs(H.get(l, l - 1)) < eps * s) {\n break;\n }\n l--;\n }\n\n if (l === n) {\n H.set(n, n, H.get(n, n) + exshift);\n d[n] = H.get(n, n);\n e[n] = 0;\n n--;\n iter = 0;\n } else if (l === n - 1) {\n w = H.get(n, n - 1) * H.get(n - 1, n);\n p = (H.get(n - 1, n - 1) - H.get(n, n)) / 2;\n q = p * p + w;\n z = Math.sqrt(Math.abs(q));\n H.set(n, n, H.get(n, n) + exshift);\n H.set(n - 1, n - 1, H.get(n - 1, n - 1) + exshift);\n x = H.get(n, n);\n\n if (q >= 0) {\n z = p >= 0 ? p + z : p - z;\n d[n - 1] = x + z;\n d[n] = d[n - 1];\n if (z !== 0) {\n d[n] = x - w / z;\n }\n e[n - 1] = 0;\n e[n] = 0;\n x = H.get(n, n - 1);\n s = Math.abs(x) + Math.abs(z);\n p = x / s;\n q = z / s;\n r = Math.sqrt(p * p + q * q);\n p = p / r;\n q = q / r;\n\n for (j = n - 1; j < nn; j++) {\n z = H.get(n - 1, j);\n H.set(n - 1, j, q * z + p * H.get(n, j));\n H.set(n, j, q * H.get(n, j) - p * z);\n }\n\n for (i = 0; i <= n; i++) {\n z = H.get(i, n - 1);\n H.set(i, n - 1, q * z + p * H.get(i, n));\n H.set(i, n, q * H.get(i, n) - p * z);\n }\n\n for (i = low; i <= high; i++) {\n z = V.get(i, n - 1);\n V.set(i, n - 1, q * z + p * V.get(i, n));\n V.set(i, n, q * V.get(i, n) - p * z);\n }\n } else {\n d[n - 1] = x + p;\n d[n] = x + p;\n e[n - 1] = z;\n e[n] = -z;\n }\n\n n = n - 2;\n iter = 0;\n } else {\n x = H.get(n, n);\n y = 0;\n w = 0;\n if (l < n) {\n y = H.get(n - 1, n - 1);\n w = H.get(n, n - 1) * H.get(n - 1, n);\n }\n\n if (iter === 10) {\n exshift += x;\n for (i = low; i <= n; i++) {\n H.set(i, i, H.get(i, i) - x);\n }\n s = Math.abs(H.get(n, n - 1)) + Math.abs(H.get(n - 1, n - 2));\n x = y = 0.75 * s;\n w = -0.4375 * s * s;\n }\n\n if (iter === 30) {\n s = (y - x) / 2;\n s = s * s + w;\n if (s > 0) {\n s = Math.sqrt(s);\n if (y < x) {\n s = -s;\n }\n s = x - w / ((y - x) / 2 + s);\n for (i = low; i <= n; i++) {\n H.set(i, i, H.get(i, i) - s);\n }\n exshift += s;\n x = y = w = 0.964;\n }\n }\n\n iter = iter + 1;\n\n m = n - 2;\n while (m >= l) {\n z = H.get(m, m);\n r = x - z;\n s = y - z;\n p = (r * s - w) / H.get(m + 1, m) + H.get(m, m + 1);\n q = H.get(m + 1, m + 1) - z - r - s;\n r = H.get(m + 2, m + 1);\n s = Math.abs(p) + Math.abs(q) + Math.abs(r);\n p = p / s;\n q = q / s;\n r = r / s;\n if (m === l) {\n break;\n }\n if (\n Math.abs(H.get(m, m - 1)) * (Math.abs(q) + Math.abs(r)) <\n eps *\n (Math.abs(p) *\n (Math.abs(H.get(m - 1, m - 1)) +\n Math.abs(z) +\n Math.abs(H.get(m + 1, m + 1))))\n ) {\n break;\n }\n m--;\n }\n\n for (i = m + 2; i <= n; i++) {\n H.set(i, i - 2, 0);\n if (i > m + 2) {\n H.set(i, i - 3, 0);\n }\n }\n\n for (k = m; k <= n - 1; k++) {\n notlast = k !== n - 1;\n if (k !== m) {\n p = H.get(k, k - 1);\n q = H.get(k + 1, k - 1);\n r = notlast ? H.get(k + 2, k - 1) : 0;\n x = Math.abs(p) + Math.abs(q) + Math.abs(r);\n if (x !== 0) {\n p = p / x;\n q = q / x;\n r = r / x;\n }\n }\n\n if (x === 0) {\n break;\n }\n\n s = Math.sqrt(p * p + q * q + r * r);\n if (p < 0) {\n s = -s;\n }\n\n if (s !== 0) {\n if (k !== m) {\n H.set(k, k - 1, -s * x);\n } else if (l !== m) {\n H.set(k, k - 1, -H.get(k, k - 1));\n }\n\n p = p + s;\n x = p / s;\n y = q / s;\n z = r / s;\n q = q / p;\n r = r / p;\n\n for (j = k; j < nn; j++) {\n p = H.get(k, j) + q * H.get(k + 1, j);\n if (notlast) {\n p = p + r * H.get(k + 2, j);\n H.set(k + 2, j, H.get(k + 2, j) - p * z);\n }\n\n H.set(k, j, H.get(k, j) - p * x);\n H.set(k + 1, j, H.get(k + 1, j) - p * y);\n }\n\n for (i = 0; i <= Math.min(n, k + 3); i++) {\n p = x * H.get(i, k) + y * H.get(i, k + 1);\n if (notlast) {\n p = p + z * H.get(i, k + 2);\n H.set(i, k + 2, H.get(i, k + 2) - p * r);\n }\n\n H.set(i, k, H.get(i, k) - p);\n H.set(i, k + 1, H.get(i, k + 1) - p * q);\n }\n\n for (i = low; i <= high; i++) {\n p = x * V.get(i, k) + y * V.get(i, k + 1);\n if (notlast) {\n p = p + z * V.get(i, k + 2);\n V.set(i, k + 2, V.get(i, k + 2) - p * r);\n }\n\n V.set(i, k, V.get(i, k) - p);\n V.set(i, k + 1, V.get(i, k + 1) - p * q);\n }\n }\n }\n }\n }\n\n if (norm === 0) {\n return;\n }\n\n for (n = nn - 1; n >= 0; n--) {\n p = d[n];\n q = e[n];\n\n if (q === 0) {\n l = n;\n H.set(n, n, 1);\n for (i = n - 1; i >= 0; i--) {\n w = H.get(i, i) - p;\n r = 0;\n for (j = l; j <= n; j++) {\n r = r + H.get(i, j) * H.get(j, n);\n }\n\n if (e[i] < 0) {\n z = w;\n s = r;\n } else {\n l = i;\n if (e[i] === 0) {\n H.set(i, n, w !== 0 ? -r / w : -r / (eps * norm));\n } else {\n x = H.get(i, i + 1);\n y = H.get(i + 1, i);\n q = (d[i] - p) * (d[i] - p) + e[i] * e[i];\n t = (x * s - z * r) / q;\n H.set(i, n, t);\n H.set(\n i + 1,\n n,\n Math.abs(x) > Math.abs(z) ? (-r - w * t) / x : (-s - y * t) / z,\n );\n }\n\n t = Math.abs(H.get(i, n));\n if (eps * t * t > 1) {\n for (j = i; j <= n; j++) {\n H.set(j, n, H.get(j, n) / t);\n }\n }\n }\n }\n } else if (q < 0) {\n l = n - 1;\n\n if (Math.abs(H.get(n, n - 1)) > Math.abs(H.get(n - 1, n))) {\n H.set(n - 1, n - 1, q / H.get(n, n - 1));\n H.set(n - 1, n, -(H.get(n, n) - p) / H.get(n, n - 1));\n } else {\n cdivres = cdiv(0, -H.get(n - 1, n), H.get(n - 1, n - 1) - p, q);\n H.set(n - 1, n - 1, cdivres[0]);\n H.set(n - 1, n, cdivres[1]);\n }\n\n H.set(n, n - 1, 0);\n H.set(n, n, 1);\n for (i = n - 2; i >= 0; i--) {\n ra = 0;\n sa = 0;\n for (j = l; j <= n; j++) {\n ra = ra + H.get(i, j) * H.get(j, n - 1);\n sa = sa + H.get(i, j) * H.get(j, n);\n }\n\n w = H.get(i, i) - p;\n\n if (e[i] < 0) {\n z = w;\n r = ra;\n s = sa;\n } else {\n l = i;\n if (e[i] === 0) {\n cdivres = cdiv(-ra, -sa, w, q);\n H.set(i, n - 1, cdivres[0]);\n H.set(i, n, cdivres[1]);\n } else {\n x = H.get(i, i + 1);\n y = H.get(i + 1, i);\n vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;\n vi = (d[i] - p) * 2 * q;\n if (vr === 0 && vi === 0) {\n vr =\n eps *\n norm *\n (Math.abs(w) +\n Math.abs(q) +\n Math.abs(x) +\n Math.abs(y) +\n Math.abs(z));\n }\n cdivres = cdiv(\n x * r - z * ra + q * sa,\n x * s - z * sa - q * ra,\n vr,\n vi,\n );\n H.set(i, n - 1, cdivres[0]);\n H.set(i, n, cdivres[1]);\n if (Math.abs(x) > Math.abs(z) + Math.abs(q)) {\n H.set(\n i + 1,\n n - 1,\n (-ra - w * H.get(i, n - 1) + q * H.get(i, n)) / x,\n );\n H.set(\n i + 1,\n n,\n (-sa - w * H.get(i, n) - q * H.get(i, n - 1)) / x,\n );\n } else {\n cdivres = cdiv(\n -r - y * H.get(i, n - 1),\n -s - y * H.get(i, n),\n z,\n q,\n );\n H.set(i + 1, n - 1, cdivres[0]);\n H.set(i + 1, n, cdivres[1]);\n }\n }\n\n t = Math.max(Math.abs(H.get(i, n - 1)), Math.abs(H.get(i, n)));\n if (eps * t * t > 1) {\n for (j = i; j <= n; j++) {\n H.set(j, n - 1, H.get(j, n - 1) / t);\n H.set(j, n, H.get(j, n) / t);\n }\n }\n }\n }\n }\n }\n\n for (i = 0; i < nn; i++) {\n if (i < low || i > high) {\n for (j = i; j < nn; j++) {\n V.set(i, j, H.get(i, j));\n }\n }\n }\n\n for (j = nn - 1; j >= low; j--) {\n for (i = low; i <= high; i++) {\n z = 0;\n for (k = low; k <= Math.min(j, high); k++) {\n z = z + V.get(i, k) * H.get(k, j);\n }\n V.set(i, j, z);\n }\n }\n}\n\nfunction cdiv(xr, xi, yr, yi) {\n let r, d;\n if (Math.abs(yr) > Math.abs(yi)) {\n r = yi / yr;\n d = yr + r * yi;\n return [(xr + r * xi) / d, (xi - r * xr) / d];\n } else {\n r = yr / yi;\n d = yi + r * yr;\n return [(r * xr + xi) / d, (r * xi - xr) / d];\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/evd.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/has-key.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/has-key.js ***! - \************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/lu.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/lu.js ***! + \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./has */ \"./node_modules/@antv/util/esm/has.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_has__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n//# sourceMappingURL=has-key.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/has-key.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return LuDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\nclass LuDecomposition {\n constructor(matrix) {\n matrix = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n\n let lu = matrix.clone();\n let rows = lu.rows;\n let columns = lu.columns;\n let pivotVector = new Float64Array(rows);\n let pivotSign = 1;\n let i, j, k, p, s, t, v;\n let LUcolj, kmax;\n\n for (i = 0; i < rows; i++) {\n pivotVector[i] = i;\n }\n\n LUcolj = new Float64Array(rows);\n\n for (j = 0; j < columns; j++) {\n for (i = 0; i < rows; i++) {\n LUcolj[i] = lu.get(i, j);\n }\n\n for (i = 0; i < rows; i++) {\n kmax = Math.min(i, j);\n s = 0;\n for (k = 0; k < kmax; k++) {\n s += lu.get(i, k) * LUcolj[k];\n }\n LUcolj[i] -= s;\n lu.set(i, j, LUcolj[i]);\n }\n\n p = j;\n for (i = j + 1; i < rows; i++) {\n if (Math.abs(LUcolj[i]) > Math.abs(LUcolj[p])) {\n p = i;\n }\n }\n\n if (p !== j) {\n for (k = 0; k < columns; k++) {\n t = lu.get(p, k);\n lu.set(p, k, lu.get(j, k));\n lu.set(j, k, t);\n }\n\n v = pivotVector[p];\n pivotVector[p] = pivotVector[j];\n pivotVector[j] = v;\n\n pivotSign = -pivotSign;\n }\n\n if (j < rows && lu.get(j, j) !== 0) {\n for (i = j + 1; i < rows; i++) {\n lu.set(i, j, lu.get(i, j) / lu.get(j, j));\n }\n }\n }\n\n this.LU = lu;\n this.pivotVector = pivotVector;\n this.pivotSign = pivotSign;\n }\n\n isSingular() {\n let data = this.LU;\n let col = data.columns;\n for (let j = 0; j < col; j++) {\n if (data.get(j, j) === 0) {\n return true;\n }\n }\n return false;\n }\n\n solve(value) {\n value = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].checkMatrix(value);\n\n let lu = this.LU;\n let rows = lu.rows;\n\n if (rows !== value.rows) {\n throw new Error('Invalid matrix dimensions');\n }\n if (this.isSingular()) {\n throw new Error('LU matrix is singular');\n }\n\n let count = value.columns;\n let X = value.subMatrixRow(this.pivotVector, 0, count - 1);\n let columns = lu.columns;\n let i, j, k;\n\n for (k = 0; k < columns; k++) {\n for (i = k + 1; i < columns; i++) {\n for (j = 0; j < count; j++) {\n X.set(i, j, X.get(i, j) - X.get(k, j) * lu.get(i, k));\n }\n }\n }\n for (k = columns - 1; k >= 0; k--) {\n for (j = 0; j < count; j++) {\n X.set(k, j, X.get(k, j) / lu.get(k, k));\n }\n for (i = 0; i < k; i++) {\n for (j = 0; j < count; j++) {\n X.set(i, j, X.get(i, j) - X.get(k, j) * lu.get(i, k));\n }\n }\n }\n return X;\n }\n\n get determinant() {\n let data = this.LU;\n if (!data.isSquare()) {\n throw new Error('Matrix must be square');\n }\n let determinant = this.pivotSign;\n let col = data.columns;\n for (let j = 0; j < col; j++) {\n determinant *= data.get(j, j);\n }\n return determinant;\n }\n\n get lowerTriangularMatrix() {\n let data = this.LU;\n let rows = data.rows;\n let columns = data.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n if (i > j) {\n X.set(i, j, data.get(i, j));\n } else if (i === j) {\n X.set(i, j, 1);\n } else {\n X.set(i, j, 0);\n }\n }\n }\n return X;\n }\n\n get upperTriangularMatrix() {\n let data = this.LU;\n let rows = data.rows;\n let columns = data.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n if (i <= j) {\n X.set(i, j, data.get(i, j));\n } else {\n X.set(i, j, 0);\n }\n }\n }\n return X;\n }\n\n get pivotPermutationVector() {\n return Array.from(this.pivotVector);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/lu.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/has-value.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/has-value.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/nipals.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/nipals.js ***! + \***************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/util/esm/contains.js\");\n/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values */ \"./node_modules/@antv/util/esm/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, value) { return Object(_contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Object(_values__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj), value); });\n//# sourceMappingURL=has-value.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/has-value.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return nipals; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\nclass nipals {\n constructor(X, options = {}) {\n X = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(X);\n let { Y } = options;\n const {\n scaleScores = false,\n maxIterations = 1000,\n terminationCriteria = 1e-10,\n } = options;\n\n let u;\n if (Y) {\n if (Array.isArray(Y) && typeof Y[0] === 'number') {\n Y = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].columnVector(Y);\n } else {\n Y = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(Y);\n }\n if (!Y.isColumnVector() || Y.rows !== X.rows) {\n throw new Error('Y must be a column vector of length X.rows');\n }\n u = Y;\n } else {\n u = X.getColumnVector(0);\n }\n\n let diff = 1;\n let t, q, w, tOld;\n\n for (\n let counter = 0;\n counter < maxIterations && diff > terminationCriteria;\n counter++\n ) {\n w = X.transpose().mmul(u).div(u.transpose().mmul(u).get(0, 0));\n w = w.div(w.norm());\n\n t = X.mmul(w).div(w.transpose().mmul(w).get(0, 0));\n\n if (counter > 0) {\n diff = t.clone().sub(tOld).pow(2).sum();\n }\n tOld = t.clone();\n\n if (Y) {\n q = Y.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n q = q.div(q.norm());\n\n u = Y.mmul(q).div(q.transpose().mmul(q).get(0, 0));\n } else {\n u = t;\n }\n }\n\n if (Y) {\n let p = X.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n p = p.div(p.norm());\n let xResidual = X.clone().sub(t.clone().mmul(p.transpose()));\n let residual = u.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n let yResidual = Y.clone().sub(\n t.clone().mulS(residual.get(0, 0)).mmul(q.transpose()),\n );\n\n this.t = t;\n this.p = p.transpose();\n this.w = w.transpose();\n this.q = q;\n this.u = u;\n this.s = t.transpose().mmul(t);\n this.xResidual = xResidual;\n this.yResidual = yResidual;\n this.betas = residual;\n } else {\n this.w = w.transpose();\n this.s = t.transpose().mmul(t).sqrt();\n if (scaleScores) {\n this.t = t.clone().div(this.s.get(0, 0));\n } else {\n this.t = t;\n }\n this.xResidual = X.sub(t.mmul(w.transpose()));\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/nipals.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/has.js": -/*!********************************************!*\ - !*** ./node_modules/@antv/util/esm/has.js ***! - \********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/qr.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/qr.js ***! + \***********************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, key) { return obj.hasOwnProperty(key); });\n//# sourceMappingURL=has.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/has.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return QrDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/util.js\");\n\n\n\n\n\nclass QrDecomposition {\n constructor(value) {\n value = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(value);\n\n let qr = value.clone();\n let m = value.rows;\n let n = value.columns;\n let rdiag = new Float64Array(n);\n let i, j, k, s;\n\n for (k = 0; k < n; k++) {\n let nrm = 0;\n for (i = k; i < m; i++) {\n nrm = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(nrm, qr.get(i, k));\n }\n if (nrm !== 0) {\n if (qr.get(k, k) < 0) {\n nrm = -nrm;\n }\n for (i = k; i < m; i++) {\n qr.set(i, k, qr.get(i, k) / nrm);\n }\n qr.set(k, k, qr.get(k, k) + 1);\n for (j = k + 1; j < n; j++) {\n s = 0;\n for (i = k; i < m; i++) {\n s += qr.get(i, k) * qr.get(i, j);\n }\n s = -s / qr.get(k, k);\n for (i = k; i < m; i++) {\n qr.set(i, j, qr.get(i, j) + s * qr.get(i, k));\n }\n }\n }\n rdiag[k] = -nrm;\n }\n\n this.QR = qr;\n this.Rdiag = rdiag;\n }\n\n solve(value) {\n value = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].checkMatrix(value);\n\n let qr = this.QR;\n let m = qr.rows;\n\n if (value.rows !== m) {\n throw new Error('Matrix row dimensions must agree');\n }\n if (!this.isFullRank()) {\n throw new Error('Matrix is rank deficient');\n }\n\n let count = value.columns;\n let X = value.clone();\n let n = qr.columns;\n let i, j, k, s;\n\n for (k = 0; k < n; k++) {\n for (j = 0; j < count; j++) {\n s = 0;\n for (i = k; i < m; i++) {\n s += qr.get(i, k) * X.get(i, j);\n }\n s = -s / qr.get(k, k);\n for (i = k; i < m; i++) {\n X.set(i, j, X.get(i, j) + s * qr.get(i, k));\n }\n }\n }\n for (k = n - 1; k >= 0; k--) {\n for (j = 0; j < count; j++) {\n X.set(k, j, X.get(k, j) / this.Rdiag[k]);\n }\n for (i = 0; i < k; i++) {\n for (j = 0; j < count; j++) {\n X.set(i, j, X.get(i, j) - X.get(k, j) * qr.get(i, k));\n }\n }\n }\n\n return X.subMatrix(0, n - 1, 0, count - 1);\n }\n\n isFullRank() {\n let columns = this.QR.columns;\n for (let i = 0; i < columns; i++) {\n if (this.Rdiag[i] === 0) {\n return false;\n }\n }\n return true;\n }\n\n get upperTriangularMatrix() {\n let qr = this.QR;\n let n = qr.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n let i, j;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (i < j) {\n X.set(i, j, qr.get(i, j));\n } else if (i === j) {\n X.set(i, j, this.Rdiag[i]);\n } else {\n X.set(i, j, 0);\n }\n }\n }\n return X;\n }\n\n get orthogonalMatrix() {\n let qr = this.QR;\n let rows = qr.rows;\n let columns = qr.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](rows, columns);\n let i, j, k, s;\n\n for (k = columns - 1; k >= 0; k--) {\n for (i = 0; i < rows; i++) {\n X.set(i, k, 0);\n }\n X.set(k, k, 1);\n for (j = k; j < columns; j++) {\n if (qr.get(k, k) !== 0) {\n s = 0;\n for (i = k; i < rows; i++) {\n s += qr.get(i, k) * X.get(i, j);\n }\n\n s = -s / qr.get(k, k);\n\n for (i = k; i < rows; i++) {\n X.set(i, j, X.get(i, j) + s * qr.get(i, k));\n }\n }\n }\n }\n return X;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/qr.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/head.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/head.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/svd.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/svd.js ***! + \************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return head; });\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nfunction head(o) {\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n return o[0];\n }\n return undefined;\n}\n//# sourceMappingURL=head.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/head.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return SingularValueDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/util.js\");\n\n\n\n\n\nclass SingularValueDecomposition {\n constructor(value, options = {}) {\n value = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(value);\n\n let m = value.rows;\n let n = value.columns;\n\n const {\n computeLeftSingularVectors = true,\n computeRightSingularVectors = true,\n autoTranspose = false,\n } = options;\n\n let wantu = Boolean(computeLeftSingularVectors);\n let wantv = Boolean(computeRightSingularVectors);\n\n let swapped = false;\n let a;\n if (m < n) {\n if (!autoTranspose) {\n a = value.clone();\n // eslint-disable-next-line no-console\n console.warn(\n 'Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose',\n );\n } else {\n a = value.transpose();\n m = a.rows;\n n = a.columns;\n swapped = true;\n let aux = wantu;\n wantu = wantv;\n wantv = aux;\n }\n } else {\n a = value.clone();\n }\n\n let nu = Math.min(m, n);\n let ni = Math.min(m + 1, n);\n let s = new Float64Array(ni);\n let U = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](m, nu);\n let V = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n\n let e = new Float64Array(n);\n let work = new Float64Array(m);\n\n let si = new Float64Array(ni);\n for (let i = 0; i < ni; i++) si[i] = i;\n\n let nct = Math.min(m - 1, n);\n let nrt = Math.max(0, Math.min(n - 2, m));\n let mrc = Math.max(nct, nrt);\n\n for (let k = 0; k < mrc; k++) {\n if (k < nct) {\n s[k] = 0;\n for (let i = k; i < m; i++) {\n s[k] = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(s[k], a.get(i, k));\n }\n if (s[k] !== 0) {\n if (a.get(k, k) < 0) {\n s[k] = -s[k];\n }\n for (let i = k; i < m; i++) {\n a.set(i, k, a.get(i, k) / s[k]);\n }\n a.set(k, k, a.get(k, k) + 1);\n }\n s[k] = -s[k];\n }\n\n for (let j = k + 1; j < n; j++) {\n if (k < nct && s[k] !== 0) {\n let t = 0;\n for (let i = k; i < m; i++) {\n t += a.get(i, k) * a.get(i, j);\n }\n t = -t / a.get(k, k);\n for (let i = k; i < m; i++) {\n a.set(i, j, a.get(i, j) + t * a.get(i, k));\n }\n }\n e[j] = a.get(k, j);\n }\n\n if (wantu && k < nct) {\n for (let i = k; i < m; i++) {\n U.set(i, k, a.get(i, k));\n }\n }\n\n if (k < nrt) {\n e[k] = 0;\n for (let i = k + 1; i < n; i++) {\n e[k] = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(e[k], e[i]);\n }\n if (e[k] !== 0) {\n if (e[k + 1] < 0) {\n e[k] = 0 - e[k];\n }\n for (let i = k + 1; i < n; i++) {\n e[i] /= e[k];\n }\n e[k + 1] += 1;\n }\n e[k] = -e[k];\n if (k + 1 < m && e[k] !== 0) {\n for (let i = k + 1; i < m; i++) {\n work[i] = 0;\n }\n for (let i = k + 1; i < m; i++) {\n for (let j = k + 1; j < n; j++) {\n work[i] += e[j] * a.get(i, j);\n }\n }\n for (let j = k + 1; j < n; j++) {\n let t = -e[j] / e[k + 1];\n for (let i = k + 1; i < m; i++) {\n a.set(i, j, a.get(i, j) + t * work[i]);\n }\n }\n }\n if (wantv) {\n for (let i = k + 1; i < n; i++) {\n V.set(i, k, e[i]);\n }\n }\n }\n }\n\n let p = Math.min(n, m + 1);\n if (nct < n) {\n s[nct] = a.get(nct, nct);\n }\n if (m < p) {\n s[p - 1] = 0;\n }\n if (nrt + 1 < p) {\n e[nrt] = a.get(nrt, p - 1);\n }\n e[p - 1] = 0;\n\n if (wantu) {\n for (let j = nct; j < nu; j++) {\n for (let i = 0; i < m; i++) {\n U.set(i, j, 0);\n }\n U.set(j, j, 1);\n }\n for (let k = nct - 1; k >= 0; k--) {\n if (s[k] !== 0) {\n for (let j = k + 1; j < nu; j++) {\n let t = 0;\n for (let i = k; i < m; i++) {\n t += U.get(i, k) * U.get(i, j);\n }\n t = -t / U.get(k, k);\n for (let i = k; i < m; i++) {\n U.set(i, j, U.get(i, j) + t * U.get(i, k));\n }\n }\n for (let i = k; i < m; i++) {\n U.set(i, k, -U.get(i, k));\n }\n U.set(k, k, 1 + U.get(k, k));\n for (let i = 0; i < k - 1; i++) {\n U.set(i, k, 0);\n }\n } else {\n for (let i = 0; i < m; i++) {\n U.set(i, k, 0);\n }\n U.set(k, k, 1);\n }\n }\n }\n\n if (wantv) {\n for (let k = n - 1; k >= 0; k--) {\n if (k < nrt && e[k] !== 0) {\n for (let j = k + 1; j < n; j++) {\n let t = 0;\n for (let i = k + 1; i < n; i++) {\n t += V.get(i, k) * V.get(i, j);\n }\n t = -t / V.get(k + 1, k);\n for (let i = k + 1; i < n; i++) {\n V.set(i, j, V.get(i, j) + t * V.get(i, k));\n }\n }\n }\n for (let i = 0; i < n; i++) {\n V.set(i, k, 0);\n }\n V.set(k, k, 1);\n }\n }\n\n let pp = p - 1;\n let iter = 0;\n let eps = Number.EPSILON;\n while (p > 0) {\n let k, kase;\n for (k = p - 2; k >= -1; k--) {\n if (k === -1) {\n break;\n }\n const alpha =\n Number.MIN_VALUE + eps * Math.abs(s[k] + Math.abs(s[k + 1]));\n if (Math.abs(e[k]) <= alpha || Number.isNaN(e[k])) {\n e[k] = 0;\n break;\n }\n }\n if (k === p - 2) {\n kase = 4;\n } else {\n let ks;\n for (ks = p - 1; ks >= k; ks--) {\n if (ks === k) {\n break;\n }\n let t =\n (ks !== p ? Math.abs(e[ks]) : 0) +\n (ks !== k + 1 ? Math.abs(e[ks - 1]) : 0);\n if (Math.abs(s[ks]) <= eps * t) {\n s[ks] = 0;\n break;\n }\n }\n if (ks === k) {\n kase = 3;\n } else if (ks === p - 1) {\n kase = 1;\n } else {\n kase = 2;\n k = ks;\n }\n }\n\n k++;\n\n switch (kase) {\n case 1: {\n let f = e[p - 2];\n e[p - 2] = 0;\n for (let j = p - 2; j >= k; j--) {\n let t = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(s[j], f);\n let cs = s[j] / t;\n let sn = f / t;\n s[j] = t;\n if (j !== k) {\n f = -sn * e[j - 1];\n e[j - 1] = cs * e[j - 1];\n }\n if (wantv) {\n for (let i = 0; i < n; i++) {\n t = cs * V.get(i, j) + sn * V.get(i, p - 1);\n V.set(i, p - 1, -sn * V.get(i, j) + cs * V.get(i, p - 1));\n V.set(i, j, t);\n }\n }\n }\n break;\n }\n case 2: {\n let f = e[k - 1];\n e[k - 1] = 0;\n for (let j = k; j < p; j++) {\n let t = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(s[j], f);\n let cs = s[j] / t;\n let sn = f / t;\n s[j] = t;\n f = -sn * e[j];\n e[j] = cs * e[j];\n if (wantu) {\n for (let i = 0; i < m; i++) {\n t = cs * U.get(i, j) + sn * U.get(i, k - 1);\n U.set(i, k - 1, -sn * U.get(i, j) + cs * U.get(i, k - 1));\n U.set(i, j, t);\n }\n }\n }\n break;\n }\n case 3: {\n const scale = Math.max(\n Math.abs(s[p - 1]),\n Math.abs(s[p - 2]),\n Math.abs(e[p - 2]),\n Math.abs(s[k]),\n Math.abs(e[k]),\n );\n const sp = s[p - 1] / scale;\n const spm1 = s[p - 2] / scale;\n const epm1 = e[p - 2] / scale;\n const sk = s[k] / scale;\n const ek = e[k] / scale;\n const b = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2;\n const c = sp * epm1 * (sp * epm1);\n let shift = 0;\n if (b !== 0 || c !== 0) {\n if (b < 0) {\n shift = 0 - Math.sqrt(b * b + c);\n } else {\n shift = Math.sqrt(b * b + c);\n }\n shift = c / (b + shift);\n }\n let f = (sk + sp) * (sk - sp) + shift;\n let g = sk * ek;\n for (let j = k; j < p - 1; j++) {\n let t = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(f, g);\n if (t === 0) t = Number.MIN_VALUE;\n let cs = f / t;\n let sn = g / t;\n if (j !== k) {\n e[j - 1] = t;\n }\n f = cs * s[j] + sn * e[j];\n e[j] = cs * e[j] - sn * s[j];\n g = sn * s[j + 1];\n s[j + 1] = cs * s[j + 1];\n if (wantv) {\n for (let i = 0; i < n; i++) {\n t = cs * V.get(i, j) + sn * V.get(i, j + 1);\n V.set(i, j + 1, -sn * V.get(i, j) + cs * V.get(i, j + 1));\n V.set(i, j, t);\n }\n }\n t = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(f, g);\n if (t === 0) t = Number.MIN_VALUE;\n cs = f / t;\n sn = g / t;\n s[j] = t;\n f = cs * e[j] + sn * s[j + 1];\n s[j + 1] = -sn * e[j] + cs * s[j + 1];\n g = sn * e[j + 1];\n e[j + 1] = cs * e[j + 1];\n if (wantu && j < m - 1) {\n for (let i = 0; i < m; i++) {\n t = cs * U.get(i, j) + sn * U.get(i, j + 1);\n U.set(i, j + 1, -sn * U.get(i, j) + cs * U.get(i, j + 1));\n U.set(i, j, t);\n }\n }\n }\n e[p - 2] = f;\n iter = iter + 1;\n break;\n }\n case 4: {\n if (s[k] <= 0) {\n s[k] = s[k] < 0 ? -s[k] : 0;\n if (wantv) {\n for (let i = 0; i <= pp; i++) {\n V.set(i, k, -V.get(i, k));\n }\n }\n }\n while (k < pp) {\n if (s[k] >= s[k + 1]) {\n break;\n }\n let t = s[k];\n s[k] = s[k + 1];\n s[k + 1] = t;\n if (wantv && k < n - 1) {\n for (let i = 0; i < n; i++) {\n t = V.get(i, k + 1);\n V.set(i, k + 1, V.get(i, k));\n V.set(i, k, t);\n }\n }\n if (wantu && k < m - 1) {\n for (let i = 0; i < m; i++) {\n t = U.get(i, k + 1);\n U.set(i, k + 1, U.get(i, k));\n U.set(i, k, t);\n }\n }\n k++;\n }\n iter = 0;\n p--;\n break;\n }\n // no default\n }\n }\n\n if (swapped) {\n let tmp = V;\n V = U;\n U = tmp;\n }\n\n this.m = m;\n this.n = n;\n this.s = s;\n this.U = U;\n this.V = V;\n }\n\n solve(value) {\n let Y = value;\n let e = this.threshold;\n let scols = this.s.length;\n let Ls = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].zeros(scols, scols);\n\n for (let i = 0; i < scols; i++) {\n if (Math.abs(this.s[i]) <= e) {\n Ls.set(i, i, 0);\n } else {\n Ls.set(i, i, 1 / this.s[i]);\n }\n }\n\n let U = this.U;\n let V = this.rightSingularVectors;\n\n let VL = V.mmul(Ls);\n let vrows = V.rows;\n let urows = U.rows;\n let VLU = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].zeros(vrows, urows);\n\n for (let i = 0; i < vrows; i++) {\n for (let j = 0; j < urows; j++) {\n let sum = 0;\n for (let k = 0; k < scols; k++) {\n sum += VL.get(i, k) * U.get(j, k);\n }\n VLU.set(i, j, sum);\n }\n }\n\n return VLU.mmul(Y);\n }\n\n solveForDiagonal(value) {\n return this.solve(_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].diag(value));\n }\n\n inverse() {\n let V = this.V;\n let e = this.threshold;\n let vrows = V.rows;\n let vcols = V.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](vrows, this.s.length);\n\n for (let i = 0; i < vrows; i++) {\n for (let j = 0; j < vcols; j++) {\n if (Math.abs(this.s[j]) > e) {\n X.set(i, j, V.get(i, j) / this.s[j]);\n }\n }\n }\n\n let U = this.U;\n\n let urows = U.rows;\n let ucols = U.columns;\n let Y = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](vrows, urows);\n\n for (let i = 0; i < vrows; i++) {\n for (let j = 0; j < urows; j++) {\n let sum = 0;\n for (let k = 0; k < ucols; k++) {\n sum += X.get(i, k) * U.get(j, k);\n }\n Y.set(i, j, sum);\n }\n }\n\n return Y;\n }\n\n get condition() {\n return this.s[0] / this.s[Math.min(this.m, this.n) - 1];\n }\n\n get norm2() {\n return this.s[0];\n }\n\n get rank() {\n let tol = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON;\n let r = 0;\n let s = this.s;\n for (let i = 0, ii = s.length; i < ii; i++) {\n if (s[i] > tol) {\n r++;\n }\n }\n return r;\n }\n\n get diagonal() {\n return Array.from(this.s);\n }\n\n get threshold() {\n return (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0];\n }\n\n get leftSingularVectors() {\n return this.U;\n }\n\n get rightSingularVectors() {\n return this.V;\n }\n\n get diagonalMatrix() {\n return _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].diag(this.s);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/svd.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/identity.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/identity.js ***! - \*************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/util.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/util.js ***! + \*************************************************************************/ +/*! exports provided: hypotenuse */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (v) { return v; });\n//# sourceMappingURL=identity.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/identity.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hypotenuse\", function() { return hypotenuse; });\nfunction hypotenuse(a, b) {\n let r = 0;\n if (Math.abs(a) > Math.abs(b)) {\n r = b / a;\n return Math.abs(a) * Math.sqrt(1 + r * r);\n }\n if (b !== 0) {\n r = a / b;\n return Math.abs(b) * Math.sqrt(1 + r * r);\n }\n return 0;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/util.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/index-of.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/index-of.js ***! - \*************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/decompositions.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/decompositions.js ***! + \********************************************************************************/ +/*! exports provided: inverse, solve */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar indexOf = function (arr, obj) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return -1;\n }\n var m = Array.prototype.indexOf;\n if (m) {\n return m.call(arr, obj);\n }\n var index = -1;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === obj) {\n index = i;\n break;\n }\n }\n return index;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (indexOf);\n//# sourceMappingURL=index-of.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/index-of.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solve\", function() { return solve; });\n/* harmony import */ var _dc_lu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dc/lu */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/lu.js\");\n/* harmony import */ var _dc_qr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dc/qr */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/qr.js\");\n/* harmony import */ var _dc_svd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dc/svd */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/svd.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wrap/WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\n\n\n\nfunction inverse(matrix, useSVD = false) {\n matrix = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__[\"default\"].checkMatrix(matrix);\n if (useSVD) {\n return new _dc_svd__WEBPACK_IMPORTED_MODULE_2__[\"default\"](matrix).inverse();\n } else {\n return solve(matrix, _matrix__WEBPACK_IMPORTED_MODULE_3__[\"default\"].eye(matrix.rows));\n }\n}\n\nfunction solve(leftHandSide, rightHandSide, useSVD = false) {\n leftHandSide = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__[\"default\"].checkMatrix(leftHandSide);\n rightHandSide = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__[\"default\"].checkMatrix(rightHandSide);\n if (useSVD) {\n return new _dc_svd__WEBPACK_IMPORTED_MODULE_2__[\"default\"](leftHandSide).solve(rightHandSide);\n } else {\n return leftHandSide.isSquare()\n ? new _dc_lu__WEBPACK_IMPORTED_MODULE_0__[\"default\"](leftHandSide).solve(rightHandSide)\n : new _dc_qr__WEBPACK_IMPORTED_MODULE_1__[\"default\"](leftHandSide).solve(rightHandSide);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/decompositions.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/index.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/util/esm/index.js ***! - \**********************************************/ -/*! exports provided: contains, includes, difference, find, findIndex, firstValue, flatten, flattenDeep, getRange, pull, pullAt, reduce, remove, sortBy, union, uniq, valuesOfKey, head, last, startsWith, endsWith, filter, every, some, group, groupBy, groupToMap, getWrapBehavior, wrapBehavior, number2color, parseRadius, clamp, fixedBase, isDecimal, isEven, isInteger, isNegative, isNumberEqual, isOdd, isPositive, max, maxBy, min, minBy, mod, toDegree, toInteger, toRadian, forIn, has, hasKey, hasValue, keys, isMatch, values, lowerCase, lowerFirst, substitute, upperCase, upperFirst, getType, isArguments, isArray, isArrayLike, isBoolean, isDate, isError, isFunction, isFinite, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrototype, isRegExp, isString, isType, isUndefined, isElement, requestAnimationFrame, clearAnimationFrame, augment, clone, debounce, memoize, deepMix, each, extend, indexOf, isEmpty, isEqual, isEqualWith, map, mapValues, mix, assign, get, set, pick, omit, throttle, toArray, toString, uniqueId, noop, identity, size, measureTextWidth, getEllipsisText, Cache */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/determinant.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/determinant.js ***! + \*****************************************************************************/ +/*! exports provided: determinant */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/util/esm/contains.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"contains\", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"includes\", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _difference__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./difference */ \"./node_modules/@antv/util/esm/difference.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"difference\", function() { return _difference__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _find__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./find */ \"./node_modules/@antv/util/esm/find.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"find\", function() { return _find__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _find_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./find-index */ \"./node_modules/@antv/util/esm/find-index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"findIndex\", function() { return _find_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _first_value__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./first-value */ \"./node_modules/@antv/util/esm/first-value.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"firstValue\", function() { return _first_value__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _flatten__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flatten */ \"./node_modules/@antv/util/esm/flatten.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flatten\", function() { return _flatten__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _flatten_deep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flatten-deep */ \"./node_modules/@antv/util/esm/flatten-deep.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flattenDeep\", function() { return _flatten_deep__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _get_range__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-range */ \"./node_modules/@antv/util/esm/get-range.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getRange\", function() { return _get_range__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _pull__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pull */ \"./node_modules/@antv/util/esm/pull.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pull\", function() { return _pull__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pull-at */ \"./node_modules/@antv/util/esm/pull-at.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pullAt\", function() { return _pull_at__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./reduce */ \"./node_modules/@antv/util/esm/reduce.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"reduce\", function() { return _reduce__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./remove */ \"./node_modules/@antv/util/esm/remove.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return _remove__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _sort_by__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./sort-by */ \"./node_modules/@antv/util/esm/sort-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"sortBy\", function() { return _sort_by__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _union__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./union */ \"./node_modules/@antv/util/esm/union.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"union\", function() { return _union__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./uniq */ \"./node_modules/@antv/util/esm/uniq.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"uniq\", function() { return _uniq__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony import */ var _values_of_key__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./values-of-key */ \"./node_modules/@antv/util/esm/values-of-key.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"valuesOfKey\", function() { return _values_of_key__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony import */ var _head__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./head */ \"./node_modules/@antv/util/esm/head.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"head\", function() { return _head__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n/* harmony import */ var _last__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./last */ \"./node_modules/@antv/util/esm/last.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"last\", function() { return _last__WEBPACK_IMPORTED_MODULE_17__[\"default\"]; });\n\n/* harmony import */ var _starts_with__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./starts-with */ \"./node_modules/@antv/util/esm/starts-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"startsWith\", function() { return _starts_with__WEBPACK_IMPORTED_MODULE_18__[\"default\"]; });\n\n/* harmony import */ var _ends_with__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ends-with */ \"./node_modules/@antv/util/esm/ends-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"endsWith\", function() { return _ends_with__WEBPACK_IMPORTED_MODULE_19__[\"default\"]; });\n\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./filter */ \"./node_modules/@antv/util/esm/filter.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return _filter__WEBPACK_IMPORTED_MODULE_20__[\"default\"]; });\n\n/* harmony import */ var _every__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./every */ \"./node_modules/@antv/util/esm/every.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"every\", function() { return _every__WEBPACK_IMPORTED_MODULE_21__[\"default\"]; });\n\n/* harmony import */ var _some__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./some */ \"./node_modules/@antv/util/esm/some.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"some\", function() { return _some__WEBPACK_IMPORTED_MODULE_22__[\"default\"]; });\n\n/* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./group */ \"./node_modules/@antv/util/esm/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"group\", function() { return _group__WEBPACK_IMPORTED_MODULE_23__[\"default\"]; });\n\n/* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./group-by */ \"./node_modules/@antv/util/esm/group-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"groupBy\", function() { return _group_by__WEBPACK_IMPORTED_MODULE_24__[\"default\"]; });\n\n/* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./group-to-map */ \"./node_modules/@antv/util/esm/group-to-map.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"groupToMap\", function() { return _group_to_map__WEBPACK_IMPORTED_MODULE_25__[\"default\"]; });\n\n/* harmony import */ var _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./get-wrap-behavior */ \"./node_modules/@antv/util/esm/get-wrap-behavior.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getWrapBehavior\", function() { return _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__[\"default\"]; });\n\n/* harmony import */ var _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./wrap-behavior */ \"./node_modules/@antv/util/esm/wrap-behavior.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"wrapBehavior\", function() { return _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__[\"default\"]; });\n\n/* harmony import */ var _number2color__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./number2color */ \"./node_modules/@antv/util/esm/number2color.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"number2color\", function() { return _number2color__WEBPACK_IMPORTED_MODULE_28__[\"default\"]; });\n\n/* harmony import */ var _parse_radius__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parse-radius */ \"./node_modules/@antv/util/esm/parse-radius.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parseRadius\", function() { return _parse_radius__WEBPACK_IMPORTED_MODULE_29__[\"default\"]; });\n\n/* harmony import */ var _clamp__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./clamp */ \"./node_modules/@antv/util/esm/clamp.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clamp\", function() { return _clamp__WEBPACK_IMPORTED_MODULE_30__[\"default\"]; });\n\n/* harmony import */ var _fixed_base__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./fixed-base */ \"./node_modules/@antv/util/esm/fixed-base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fixedBase\", function() { return _fixed_base__WEBPACK_IMPORTED_MODULE_31__[\"default\"]; });\n\n/* harmony import */ var _is_decimal__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./is-decimal */ \"./node_modules/@antv/util/esm/is-decimal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isDecimal\", function() { return _is_decimal__WEBPACK_IMPORTED_MODULE_32__[\"default\"]; });\n\n/* harmony import */ var _is_even__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./is-even */ \"./node_modules/@antv/util/esm/is-even.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEven\", function() { return _is_even__WEBPACK_IMPORTED_MODULE_33__[\"default\"]; });\n\n/* harmony import */ var _is_integer__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./is-integer */ \"./node_modules/@antv/util/esm/is-integer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isInteger\", function() { return _is_integer__WEBPACK_IMPORTED_MODULE_34__[\"default\"]; });\n\n/* harmony import */ var _is_negative__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./is-negative */ \"./node_modules/@antv/util/esm/is-negative.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNegative\", function() { return _is_negative__WEBPACK_IMPORTED_MODULE_35__[\"default\"]; });\n\n/* harmony import */ var _is_number_equal__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./is-number-equal */ \"./node_modules/@antv/util/esm/is-number-equal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNumberEqual\", function() { return _is_number_equal__WEBPACK_IMPORTED_MODULE_36__[\"default\"]; });\n\n/* harmony import */ var _is_odd__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./is-odd */ \"./node_modules/@antv/util/esm/is-odd.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isOdd\", function() { return _is_odd__WEBPACK_IMPORTED_MODULE_37__[\"default\"]; });\n\n/* harmony import */ var _is_positive__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./is-positive */ \"./node_modules/@antv/util/esm/is-positive.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPositive\", function() { return _is_positive__WEBPACK_IMPORTED_MODULE_38__[\"default\"]; });\n\n/* harmony import */ var _max__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./max */ \"./node_modules/@antv/util/esm/max.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return _max__WEBPACK_IMPORTED_MODULE_39__[\"default\"]; });\n\n/* harmony import */ var _max_by__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./max-by */ \"./node_modules/@antv/util/esm/max-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"maxBy\", function() { return _max_by__WEBPACK_IMPORTED_MODULE_40__[\"default\"]; });\n\n/* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./min */ \"./node_modules/@antv/util/esm/min.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return _min__WEBPACK_IMPORTED_MODULE_41__[\"default\"]; });\n\n/* harmony import */ var _min_by__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./min-by */ \"./node_modules/@antv/util/esm/min-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"minBy\", function() { return _min_by__WEBPACK_IMPORTED_MODULE_42__[\"default\"]; });\n\n/* harmony import */ var _mod__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./mod */ \"./node_modules/@antv/util/esm/mod.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mod\", function() { return _mod__WEBPACK_IMPORTED_MODULE_43__[\"default\"]; });\n\n/* harmony import */ var _to_degree__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./to-degree */ \"./node_modules/@antv/util/esm/to-degree.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toDegree\", function() { return _to_degree__WEBPACK_IMPORTED_MODULE_44__[\"default\"]; });\n\n/* harmony import */ var _to_integer__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./to-integer */ \"./node_modules/@antv/util/esm/to-integer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toInteger\", function() { return _to_integer__WEBPACK_IMPORTED_MODULE_45__[\"default\"]; });\n\n/* harmony import */ var _to_radian__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./to-radian */ \"./node_modules/@antv/util/esm/to-radian.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return _to_radian__WEBPACK_IMPORTED_MODULE_46__[\"default\"]; });\n\n/* harmony import */ var _for_in__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./for-in */ \"./node_modules/@antv/util/esm/for-in.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forIn\", function() { return _for_in__WEBPACK_IMPORTED_MODULE_47__[\"default\"]; });\n\n/* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./has */ \"./node_modules/@antv/util/esm/has.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return _has__WEBPACK_IMPORTED_MODULE_48__[\"default\"]; });\n\n/* harmony import */ var _has_key__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./has-key */ \"./node_modules/@antv/util/esm/has-key.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hasKey\", function() { return _has_key__WEBPACK_IMPORTED_MODULE_49__[\"default\"]; });\n\n/* harmony import */ var _has_value__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./has-value */ \"./node_modules/@antv/util/esm/has-value.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hasValue\", function() { return _has_value__WEBPACK_IMPORTED_MODULE_50__[\"default\"]; });\n\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./keys */ \"./node_modules/@antv/util/esm/keys.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return _keys__WEBPACK_IMPORTED_MODULE_51__[\"default\"]; });\n\n/* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./is-match */ \"./node_modules/@antv/util/esm/is-match.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isMatch\", function() { return _is_match__WEBPACK_IMPORTED_MODULE_52__[\"default\"]; });\n\n/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./values */ \"./node_modules/@antv/util/esm/values.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return _values__WEBPACK_IMPORTED_MODULE_53__[\"default\"]; });\n\n/* harmony import */ var _lower_case__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./lower-case */ \"./node_modules/@antv/util/esm/lower-case.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lowerCase\", function() { return _lower_case__WEBPACK_IMPORTED_MODULE_54__[\"default\"]; });\n\n/* harmony import */ var _lower_first__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./lower-first */ \"./node_modules/@antv/util/esm/lower-first.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lowerFirst\", function() { return _lower_first__WEBPACK_IMPORTED_MODULE_55__[\"default\"]; });\n\n/* harmony import */ var _substitute__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./substitute */ \"./node_modules/@antv/util/esm/substitute.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"substitute\", function() { return _substitute__WEBPACK_IMPORTED_MODULE_56__[\"default\"]; });\n\n/* harmony import */ var _upper_case__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./upper-case */ \"./node_modules/@antv/util/esm/upper-case.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"upperCase\", function() { return _upper_case__WEBPACK_IMPORTED_MODULE_57__[\"default\"]; });\n\n/* harmony import */ var _upper_first__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./upper-first */ \"./node_modules/@antv/util/esm/upper-first.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"upperFirst\", function() { return _upper_first__WEBPACK_IMPORTED_MODULE_58__[\"default\"]; });\n\n/* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./get-type */ \"./node_modules/@antv/util/esm/get-type.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return _get_type__WEBPACK_IMPORTED_MODULE_59__[\"default\"]; });\n\n/* harmony import */ var _is_arguments__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./is-arguments */ \"./node_modules/@antv/util/esm/is-arguments.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArguments\", function() { return _is_arguments__WEBPACK_IMPORTED_MODULE_60__[\"default\"]; });\n\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArray\", function() { return _is_array__WEBPACK_IMPORTED_MODULE_61__[\"default\"]; });\n\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArrayLike\", function() { return _is_array_like__WEBPACK_IMPORTED_MODULE_62__[\"default\"]; });\n\n/* harmony import */ var _is_boolean__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./is-boolean */ \"./node_modules/@antv/util/esm/is-boolean.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isBoolean\", function() { return _is_boolean__WEBPACK_IMPORTED_MODULE_63__[\"default\"]; });\n\n/* harmony import */ var _is_date__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./is-date */ \"./node_modules/@antv/util/esm/is-date.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isDate\", function() { return _is_date__WEBPACK_IMPORTED_MODULE_64__[\"default\"]; });\n\n/* harmony import */ var _is_error__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./is-error */ \"./node_modules/@antv/util/esm/is-error.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isError\", function() { return _is_error__WEBPACK_IMPORTED_MODULE_65__[\"default\"]; });\n\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isFunction\", function() { return _is_function__WEBPACK_IMPORTED_MODULE_66__[\"default\"]; });\n\n/* harmony import */ var _is_finite__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./is-finite */ \"./node_modules/@antv/util/esm/is-finite.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isFinite\", function() { return _is_finite__WEBPACK_IMPORTED_MODULE_67__[\"default\"]; });\n\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNil\", function() { return _is_nil__WEBPACK_IMPORTED_MODULE_68__[\"default\"]; });\n\n/* harmony import */ var _is_null__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./is-null */ \"./node_modules/@antv/util/esm/is-null.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNull\", function() { return _is_null__WEBPACK_IMPORTED_MODULE_69__[\"default\"]; });\n\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return _is_number__WEBPACK_IMPORTED_MODULE_70__[\"default\"]; });\n\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/util/esm/is-object.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return _is_object__WEBPACK_IMPORTED_MODULE_71__[\"default\"]; });\n\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/util/esm/is-object-like.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isObjectLike\", function() { return _is_object_like__WEBPACK_IMPORTED_MODULE_72__[\"default\"]; });\n\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPlainObject\", function() { return _is_plain_object__WEBPACK_IMPORTED_MODULE_73__[\"default\"]; });\n\n/* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./is-prototype */ \"./node_modules/@antv/util/esm/is-prototype.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPrototype\", function() { return _is_prototype__WEBPACK_IMPORTED_MODULE_74__[\"default\"]; });\n\n/* harmony import */ var _is_reg_exp__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./is-reg-exp */ \"./node_modules/@antv/util/esm/is-reg-exp.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isRegExp\", function() { return _is_reg_exp__WEBPACK_IMPORTED_MODULE_75__[\"default\"]; });\n\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isString\", function() { return _is_string__WEBPACK_IMPORTED_MODULE_76__[\"default\"]; });\n\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isType\", function() { return _is_type__WEBPACK_IMPORTED_MODULE_77__[\"default\"]; });\n\n/* harmony import */ var _is_undefined__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./is-undefined */ \"./node_modules/@antv/util/esm/is-undefined.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isUndefined\", function() { return _is_undefined__WEBPACK_IMPORTED_MODULE_78__[\"default\"]; });\n\n/* harmony import */ var _is_element__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./is-element */ \"./node_modules/@antv/util/esm/is-element.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isElement\", function() { return _is_element__WEBPACK_IMPORTED_MODULE_79__[\"default\"]; });\n\n/* harmony import */ var _request_animation_frame__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./request-animation-frame */ \"./node_modules/@antv/util/esm/request-animation-frame.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"requestAnimationFrame\", function() { return _request_animation_frame__WEBPACK_IMPORTED_MODULE_80__[\"default\"]; });\n\n/* harmony import */ var _clear_animation_frame__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./clear-animation-frame */ \"./node_modules/@antv/util/esm/clear-animation-frame.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clearAnimationFrame\", function() { return _clear_animation_frame__WEBPACK_IMPORTED_MODULE_81__[\"default\"]; });\n\n/* harmony import */ var _augment__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./augment */ \"./node_modules/@antv/util/esm/augment.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"augment\", function() { return _augment__WEBPACK_IMPORTED_MODULE_82__[\"default\"]; });\n\n/* harmony import */ var _clone__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./clone */ \"./node_modules/@antv/util/esm/clone.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return _clone__WEBPACK_IMPORTED_MODULE_83__[\"default\"]; });\n\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./debounce */ \"./node_modules/@antv/util/esm/debounce.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return _debounce__WEBPACK_IMPORTED_MODULE_84__[\"default\"]; });\n\n/* harmony import */ var _memoize__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./memoize */ \"./node_modules/@antv/util/esm/memoize.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"memoize\", function() { return _memoize__WEBPACK_IMPORTED_MODULE_85__[\"default\"]; });\n\n/* harmony import */ var _deep_mix__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./deep-mix */ \"./node_modules/@antv/util/esm/deep-mix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"deepMix\", function() { return _deep_mix__WEBPACK_IMPORTED_MODULE_86__[\"default\"]; });\n\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"each\", function() { return _each__WEBPACK_IMPORTED_MODULE_87__[\"default\"]; });\n\n/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./extend */ \"./node_modules/@antv/util/esm/extend.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return _extend__WEBPACK_IMPORTED_MODULE_88__[\"default\"]; });\n\n/* harmony import */ var _index_of__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./index-of */ \"./node_modules/@antv/util/esm/index-of.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"indexOf\", function() { return _index_of__WEBPACK_IMPORTED_MODULE_89__[\"default\"]; });\n\n/* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./is-empty */ \"./node_modules/@antv/util/esm/is-empty.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEmpty\", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_90__[\"default\"]; });\n\n/* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./is-equal */ \"./node_modules/@antv/util/esm/is-equal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEqual\", function() { return _is_equal__WEBPACK_IMPORTED_MODULE_91__[\"default\"]; });\n\n/* harmony import */ var _is_equal_with__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./is-equal-with */ \"./node_modules/@antv/util/esm/is-equal-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEqualWith\", function() { return _is_equal_with__WEBPACK_IMPORTED_MODULE_92__[\"default\"]; });\n\n/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./map */ \"./node_modules/@antv/util/esm/map.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return _map__WEBPACK_IMPORTED_MODULE_93__[\"default\"]; });\n\n/* harmony import */ var _map_values__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./map-values */ \"./node_modules/@antv/util/esm/map-values.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mapValues\", function() { return _map_values__WEBPACK_IMPORTED_MODULE_94__[\"default\"]; });\n\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/util/esm/mix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mix\", function() { return _mix__WEBPACK_IMPORTED_MODULE_95__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"assign\", function() { return _mix__WEBPACK_IMPORTED_MODULE_95__[\"default\"]; });\n\n/* harmony import */ var _get__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./get */ \"./node_modules/@antv/util/esm/get.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return _get__WEBPACK_IMPORTED_MODULE_96__[\"default\"]; });\n\n/* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./set */ \"./node_modules/@antv/util/esm/set.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return _set__WEBPACK_IMPORTED_MODULE_97__[\"default\"]; });\n\n/* harmony import */ var _pick__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./pick */ \"./node_modules/@antv/util/esm/pick.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pick\", function() { return _pick__WEBPACK_IMPORTED_MODULE_98__[\"default\"]; });\n\n/* harmony import */ var _omit__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./omit */ \"./node_modules/@antv/util/esm/omit.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"omit\", function() { return _omit__WEBPACK_IMPORTED_MODULE_99__[\"default\"]; });\n\n/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./throttle */ \"./node_modules/@antv/util/esm/throttle.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return _throttle__WEBPACK_IMPORTED_MODULE_100__[\"default\"]; });\n\n/* harmony import */ var _to_array__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./to-array */ \"./node_modules/@antv/util/esm/to-array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toArray\", function() { return _to_array__WEBPACK_IMPORTED_MODULE_101__[\"default\"]; });\n\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toString\", function() { return _to_string__WEBPACK_IMPORTED_MODULE_102__[\"default\"]; });\n\n/* harmony import */ var _unique_id__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./unique-id */ \"./node_modules/@antv/util/esm/unique-id.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return _unique_id__WEBPACK_IMPORTED_MODULE_103__[\"default\"]; });\n\n/* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./noop */ \"./node_modules/@antv/util/esm/noop.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"noop\", function() { return _noop__WEBPACK_IMPORTED_MODULE_104__[\"default\"]; });\n\n/* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./identity */ \"./node_modules/@antv/util/esm/identity.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return _identity__WEBPACK_IMPORTED_MODULE_105__[\"default\"]; });\n\n/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./size */ \"./node_modules/@antv/util/esm/size.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"size\", function() { return _size__WEBPACK_IMPORTED_MODULE_106__[\"default\"]; });\n\n/* harmony import */ var _measure_text_width__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./measure-text-width */ \"./node_modules/@antv/util/esm/measure-text-width.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"measureTextWidth\", function() { return _measure_text_width__WEBPACK_IMPORTED_MODULE_107__[\"default\"]; });\n\n/* harmony import */ var _get_ellipsis_text__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./get-ellipsis-text */ \"./node_modules/@antv/util/esm/get-ellipsis-text.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getEllipsisText\", function() { return _get_ellipsis_text__WEBPACK_IMPORTED_MODULE_108__[\"default\"]; });\n\n/* harmony import */ var _cache__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./cache */ \"./node_modules/@antv/util/esm/cache.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Cache\", function() { return _cache__WEBPACK_IMPORTED_MODULE_109__[\"default\"]; });\n\n// array\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// event\n\n\n// format\n\n\n// math\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// object\n\n\n\n\n\n\n\n// string\n\n\n\n\n\n// type\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// other\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// text\n\n\n// 不知道为什么,需要把这个 export,不然 ts 会报类型错误\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony import */ var _dc_lu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dc/lu */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/lu.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _views_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./views/selection */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/selection.js\");\n\n\n\n\nfunction determinant(matrix) {\n matrix = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n if (matrix.isSquare()) {\n let a, b, c, d;\n if (matrix.columns === 2) {\n // 2 x 2 matrix\n a = matrix.get(0, 0);\n b = matrix.get(0, 1);\n c = matrix.get(1, 0);\n d = matrix.get(1, 1);\n\n return a * d - b * c;\n } else if (matrix.columns === 3) {\n // 3 x 3 matrix\n let subMatrix0, subMatrix1, subMatrix2;\n subMatrix0 = new _views_selection__WEBPACK_IMPORTED_MODULE_2__[\"default\"](matrix, [1, 2], [1, 2]);\n subMatrix1 = new _views_selection__WEBPACK_IMPORTED_MODULE_2__[\"default\"](matrix, [1, 2], [0, 2]);\n subMatrix2 = new _views_selection__WEBPACK_IMPORTED_MODULE_2__[\"default\"](matrix, [1, 2], [0, 1]);\n a = matrix.get(0, 0);\n b = matrix.get(0, 1);\n c = matrix.get(0, 2);\n\n return (\n a * determinant(subMatrix0) -\n b * determinant(subMatrix1) +\n c * determinant(subMatrix2)\n );\n } else {\n // general purpose determinant using the LU decomposition\n return new _dc_lu__WEBPACK_IMPORTED_MODULE_0__[\"default\"](matrix).determinant;\n }\n } else {\n throw Error('determinant can only be calculated for a square matrix');\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/determinant.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-arguments.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-arguments.js ***! - \*****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/index.js": +/*!***********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/index.js ***! + \***********************************************************************/ +/*! exports provided: AbstractMatrix, default, Matrix, MatrixColumnView, MatrixColumnSelectionView, MatrixFlipColumnView, MatrixFlipRowView, MatrixRowView, MatrixRowSelectionView, MatrixSelectionView, MatrixSubView, MatrixTransposeView, wrap, WrapperMatrix1D, WrapperMatrix2D, solve, inverse, determinant, linearDependencies, pseudoInverse, covariance, correlation, SingularValueDecomposition, SVD, EigenvalueDecomposition, EVD, CholeskyDecomposition, CHO, LuDecomposition, LU, QrDecomposition, QR, Nipals, NIPALS */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isArguments = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Arguments');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isArguments);\n//# sourceMappingURL=is-arguments.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-arguments.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractMatrix\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_0__[\"AbstractMatrix\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Matrix\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _views_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./views/index */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixColumnView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixColumnView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixColumnSelectionView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixColumnSelectionView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixFlipColumnView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixFlipColumnView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixFlipRowView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixFlipRowView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixRowView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixRowView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixRowSelectionView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixRowSelectionView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixSelectionView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixSelectionView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixSubView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixSubView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixTransposeView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixTransposeView\"]; });\n\n/* harmony import */ var _wrap_wrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./wrap/wrap */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/wrap.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"wrap\", function() { return _wrap_wrap__WEBPACK_IMPORTED_MODULE_2__[\"wrap\"]; });\n\n/* harmony import */ var _wrap_WrapperMatrix1D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrap/WrapperMatrix1D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WrapperMatrix1D\", function() { return _wrap_WrapperMatrix1D__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wrap/WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WrapperMatrix2D\", function() { return _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _decompositions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./decompositions */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/decompositions.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"solve\", function() { return _decompositions__WEBPACK_IMPORTED_MODULE_5__[\"solve\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return _decompositions__WEBPACK_IMPORTED_MODULE_5__[\"inverse\"]; });\n\n/* harmony import */ var _determinant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./determinant */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/determinant.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return _determinant__WEBPACK_IMPORTED_MODULE_6__[\"determinant\"]; });\n\n/* harmony import */ var _linearDependencies__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./linearDependencies */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/linearDependencies.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"linearDependencies\", function() { return _linearDependencies__WEBPACK_IMPORTED_MODULE_7__[\"linearDependencies\"]; });\n\n/* harmony import */ var _pseudoInverse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pseudoInverse */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/pseudoInverse.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pseudoInverse\", function() { return _pseudoInverse__WEBPACK_IMPORTED_MODULE_8__[\"pseudoInverse\"]; });\n\n/* harmony import */ var _covariance__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./covariance */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/covariance.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"covariance\", function() { return _covariance__WEBPACK_IMPORTED_MODULE_9__[\"covariance\"]; });\n\n/* harmony import */ var _correlation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./correlation */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/correlation.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"correlation\", function() { return _correlation__WEBPACK_IMPORTED_MODULE_10__[\"correlation\"]; });\n\n/* harmony import */ var _dc_svd_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dc/svd.js */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/svd.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SingularValueDecomposition\", function() { return _dc_svd_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SVD\", function() { return _dc_svd_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _dc_evd_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dc/evd.js */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/evd.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EigenvalueDecomposition\", function() { return _dc_evd_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EVD\", function() { return _dc_evd_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _dc_cholesky_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dc/cholesky.js */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/cholesky.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CholeskyDecomposition\", function() { return _dc_cholesky_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CHO\", function() { return _dc_cholesky_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _dc_lu_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./dc/lu.js */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/lu.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LuDecomposition\", function() { return _dc_lu_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LU\", function() { return _dc_lu_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony import */ var _dc_qr_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./dc/qr.js */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/qr.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"QrDecomposition\", function() { return _dc_qr_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"QR\", function() { return _dc_qr_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony import */ var _dc_nipals_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./dc/nipals.js */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/nipals.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Nipals\", function() { return _dc_nipals_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NIPALS\", function() { return _dc_nipals_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-array-like.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-array-like.js ***! - \******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/inspect.js": +/*!*************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/inspect.js ***! + \*************************************************************************/ +/*! exports provided: inspectMatrix, inspectMatrixWithOptions */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar isArrayLike = function (value) {\n /**\n * isArrayLike([1, 2, 3]) => true\n * isArrayLike(document.body.children) => true\n * isArrayLike('abc') => true\n * isArrayLike(Function) => false\n */\n return value !== null && typeof value !== 'function' && isFinite(value.length);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isArrayLike);\n//# sourceMappingURL=is-array-like.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-array-like.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inspectMatrix\", function() { return inspectMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inspectMatrixWithOptions\", function() { return inspectMatrixWithOptions; });\nconst indent = ' '.repeat(2);\nconst indentData = ' '.repeat(4);\n\nfunction inspectMatrix() {\n return inspectMatrixWithOptions(this);\n}\n\nfunction inspectMatrixWithOptions(matrix, options = {}) {\n const { maxRows = 15, maxColumns = 10, maxNumSize = 8 } = options;\n return `${matrix.constructor.name} {\n${indent}[\n${indentData}${inspectData(matrix, maxRows, maxColumns, maxNumSize)}\n${indent}]\n${indent}rows: ${matrix.rows}\n${indent}columns: ${matrix.columns}\n}`;\n}\n\nfunction inspectData(matrix, maxRows, maxColumns, maxNumSize) {\n const { rows, columns } = matrix;\n const maxI = Math.min(rows, maxRows);\n const maxJ = Math.min(columns, maxColumns);\n const result = [];\n for (let i = 0; i < maxI; i++) {\n let line = [];\n for (let j = 0; j < maxJ; j++) {\n line.push(formatNumber(matrix.get(i, j), maxNumSize));\n }\n result.push(`${line.join(' ')}`);\n }\n if (maxJ !== columns) {\n result[result.length - 1] += ` ... ${columns - maxColumns} more columns`;\n }\n if (maxI !== rows) {\n result.push(`... ${rows - maxRows} more rows`);\n }\n return result.join(`\\n${indentData}`);\n}\n\nfunction formatNumber(num, maxNumSize) {\n const numStr = String(num);\n if (numStr.length <= maxNumSize) {\n return numStr.padEnd(maxNumSize, ' ');\n }\n const precise = num.toPrecision(maxNumSize - 2);\n if (precise.length <= maxNumSize) {\n return precise;\n }\n const exponential = num.toExponential(maxNumSize - 2);\n const eIndex = exponential.indexOf('e');\n const e = exponential.slice(eIndex);\n return exponential.slice(0, maxNumSize - e.length) + e;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/inspect.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-array.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-array.js ***! - \*************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/linearDependencies.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/linearDependencies.js ***! + \************************************************************************************/ +/*! exports provided: linearDependencies */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Array.isArray ?\n Array.isArray(value) :\n Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Array');\n});\n//# sourceMappingURL=is-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-array.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"linearDependencies\", function() { return linearDependencies; });\n/* harmony import */ var _dc_svd__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dc/svd */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/svd.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n\n\n\nfunction xrange(n, exception) {\n let range = [];\n for (let i = 0; i < n; i++) {\n if (i !== exception) {\n range.push(i);\n }\n }\n return range;\n}\n\nfunction dependenciesOneRow(\n error,\n matrix,\n index,\n thresholdValue = 10e-10,\n thresholdError = 10e-10,\n) {\n if (error > thresholdError) {\n return new Array(matrix.rows + 1).fill(0);\n } else {\n let returnArray = matrix.addRow(index, [0]);\n for (let i = 0; i < returnArray.rows; i++) {\n if (Math.abs(returnArray.get(i, 0)) < thresholdValue) {\n returnArray.set(i, 0, 0);\n }\n }\n return returnArray.to1DArray();\n }\n}\n\nfunction linearDependencies(matrix, options = {}) {\n const { thresholdValue = 10e-10, thresholdError = 10e-10 } = options;\n matrix = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n\n let n = matrix.rows;\n let results = new _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"](n, n);\n\n for (let i = 0; i < n; i++) {\n let b = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].columnVector(matrix.getRow(i));\n let Abis = matrix.subMatrixRow(xrange(n, i)).transpose();\n let svd = new _dc_svd__WEBPACK_IMPORTED_MODULE_0__[\"default\"](Abis);\n let x = svd.solve(b);\n let error = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sub(b, Abis.mmul(x)).abs().max();\n results.setRow(\n i,\n dependenciesOneRow(error, x, i, thresholdValue, thresholdError),\n );\n }\n return results;\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/linearDependencies.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-boolean.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-boolean.js ***! - \***************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/mathOperations.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/mathOperations.js ***! + \********************************************************************************/ +/*! exports provided: installMathOperations */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 是否是布尔类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isBoolean = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Boolean');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isBoolean);\n//# sourceMappingURL=is-boolean.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-boolean.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"installMathOperations\", function() { return installMathOperations; });\nfunction installMathOperations(AbstractMatrix, Matrix) {\n AbstractMatrix.prototype.add = function add(value) {\n if (typeof value === 'number') return this.addS(value);\n return this.addM(value);\n };\n\n AbstractMatrix.prototype.addS = function addS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) + value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.addM = function addM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) + matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.add = function add(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.add(value);\n };\n\n AbstractMatrix.prototype.sub = function sub(value) {\n if (typeof value === 'number') return this.subS(value);\n return this.subM(value);\n };\n\n AbstractMatrix.prototype.subS = function subS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) - value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.subM = function subM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) - matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.sub = function sub(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sub(value);\n };\n AbstractMatrix.prototype.subtract = AbstractMatrix.prototype.sub;\n AbstractMatrix.prototype.subtractS = AbstractMatrix.prototype.subS;\n AbstractMatrix.prototype.subtractM = AbstractMatrix.prototype.subM;\n AbstractMatrix.subtract = AbstractMatrix.sub;\n\n AbstractMatrix.prototype.mul = function mul(value) {\n if (typeof value === 'number') return this.mulS(value);\n return this.mulM(value);\n };\n\n AbstractMatrix.prototype.mulS = function mulS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) * value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.mulM = function mulM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) * matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.mul = function mul(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.mul(value);\n };\n AbstractMatrix.prototype.multiply = AbstractMatrix.prototype.mul;\n AbstractMatrix.prototype.multiplyS = AbstractMatrix.prototype.mulS;\n AbstractMatrix.prototype.multiplyM = AbstractMatrix.prototype.mulM;\n AbstractMatrix.multiply = AbstractMatrix.mul;\n\n AbstractMatrix.prototype.div = function div(value) {\n if (typeof value === 'number') return this.divS(value);\n return this.divM(value);\n };\n\n AbstractMatrix.prototype.divS = function divS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) / value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.divM = function divM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) / matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.div = function div(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.div(value);\n };\n AbstractMatrix.prototype.divide = AbstractMatrix.prototype.div;\n AbstractMatrix.prototype.divideS = AbstractMatrix.prototype.divS;\n AbstractMatrix.prototype.divideM = AbstractMatrix.prototype.divM;\n AbstractMatrix.divide = AbstractMatrix.div;\n\n AbstractMatrix.prototype.mod = function mod(value) {\n if (typeof value === 'number') return this.modS(value);\n return this.modM(value);\n };\n\n AbstractMatrix.prototype.modS = function modS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) % value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.modM = function modM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) % matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.mod = function mod(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.mod(value);\n };\n AbstractMatrix.prototype.modulus = AbstractMatrix.prototype.mod;\n AbstractMatrix.prototype.modulusS = AbstractMatrix.prototype.modS;\n AbstractMatrix.prototype.modulusM = AbstractMatrix.prototype.modM;\n AbstractMatrix.modulus = AbstractMatrix.mod;\n\n AbstractMatrix.prototype.and = function and(value) {\n if (typeof value === 'number') return this.andS(value);\n return this.andM(value);\n };\n\n AbstractMatrix.prototype.andS = function andS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) & value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.andM = function andM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) & matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.and = function and(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.and(value);\n };\n\n AbstractMatrix.prototype.or = function or(value) {\n if (typeof value === 'number') return this.orS(value);\n return this.orM(value);\n };\n\n AbstractMatrix.prototype.orS = function orS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) | value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.orM = function orM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) | matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.or = function or(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.or(value);\n };\n\n AbstractMatrix.prototype.xor = function xor(value) {\n if (typeof value === 'number') return this.xorS(value);\n return this.xorM(value);\n };\n\n AbstractMatrix.prototype.xorS = function xorS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) ^ value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.xorM = function xorM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) ^ matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.xor = function xor(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.xor(value);\n };\n\n AbstractMatrix.prototype.leftShift = function leftShift(value) {\n if (typeof value === 'number') return this.leftShiftS(value);\n return this.leftShiftM(value);\n };\n\n AbstractMatrix.prototype.leftShiftS = function leftShiftS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) << value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.leftShiftM = function leftShiftM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) << matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.leftShift = function leftShift(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.leftShift(value);\n };\n\n AbstractMatrix.prototype.signPropagatingRightShift = function signPropagatingRightShift(value) {\n if (typeof value === 'number') return this.signPropagatingRightShiftS(value);\n return this.signPropagatingRightShiftM(value);\n };\n\n AbstractMatrix.prototype.signPropagatingRightShiftS = function signPropagatingRightShiftS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) >> value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.signPropagatingRightShiftM = function signPropagatingRightShiftM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) >> matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.signPropagatingRightShift = function signPropagatingRightShift(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.signPropagatingRightShift(value);\n };\n\n AbstractMatrix.prototype.rightShift = function rightShift(value) {\n if (typeof value === 'number') return this.rightShiftS(value);\n return this.rightShiftM(value);\n };\n\n AbstractMatrix.prototype.rightShiftS = function rightShiftS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) >>> value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.rightShiftM = function rightShiftM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) >>> matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.rightShift = function rightShift(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.rightShift(value);\n };\n AbstractMatrix.prototype.zeroFillRightShift = AbstractMatrix.prototype.rightShift;\n AbstractMatrix.prototype.zeroFillRightShiftS = AbstractMatrix.prototype.rightShiftS;\n AbstractMatrix.prototype.zeroFillRightShiftM = AbstractMatrix.prototype.rightShiftM;\n AbstractMatrix.zeroFillRightShift = AbstractMatrix.rightShift;\n\n AbstractMatrix.prototype.not = function not() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, ~(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.not = function not(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.not();\n };\n\n AbstractMatrix.prototype.abs = function abs() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.abs(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.abs = function abs(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.abs();\n };\n\n AbstractMatrix.prototype.acos = function acos() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.acos(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.acos = function acos(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.acos();\n };\n\n AbstractMatrix.prototype.acosh = function acosh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.acosh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.acosh = function acosh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.acosh();\n };\n\n AbstractMatrix.prototype.asin = function asin() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.asin(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.asin = function asin(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.asin();\n };\n\n AbstractMatrix.prototype.asinh = function asinh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.asinh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.asinh = function asinh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.asinh();\n };\n\n AbstractMatrix.prototype.atan = function atan() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.atan(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.atan = function atan(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.atan();\n };\n\n AbstractMatrix.prototype.atanh = function atanh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.atanh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.atanh = function atanh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.atanh();\n };\n\n AbstractMatrix.prototype.cbrt = function cbrt() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.cbrt(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.cbrt = function cbrt(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.cbrt();\n };\n\n AbstractMatrix.prototype.ceil = function ceil() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.ceil(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.ceil = function ceil(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.ceil();\n };\n\n AbstractMatrix.prototype.clz32 = function clz32() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.clz32(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.clz32 = function clz32(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.clz32();\n };\n\n AbstractMatrix.prototype.cos = function cos() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.cos(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.cos = function cos(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.cos();\n };\n\n AbstractMatrix.prototype.cosh = function cosh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.cosh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.cosh = function cosh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.cosh();\n };\n\n AbstractMatrix.prototype.exp = function exp() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.exp(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.exp = function exp(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.exp();\n };\n\n AbstractMatrix.prototype.expm1 = function expm1() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.expm1(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.expm1 = function expm1(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.expm1();\n };\n\n AbstractMatrix.prototype.floor = function floor() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.floor(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.floor = function floor(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.floor();\n };\n\n AbstractMatrix.prototype.fround = function fround() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.fround(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.fround = function fround(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.fround();\n };\n\n AbstractMatrix.prototype.log = function log() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.log(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.log = function log(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.log();\n };\n\n AbstractMatrix.prototype.log1p = function log1p() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.log1p(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.log1p = function log1p(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.log1p();\n };\n\n AbstractMatrix.prototype.log10 = function log10() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.log10(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.log10 = function log10(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.log10();\n };\n\n AbstractMatrix.prototype.log2 = function log2() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.log2(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.log2 = function log2(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.log2();\n };\n\n AbstractMatrix.prototype.round = function round() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.round(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.round = function round(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.round();\n };\n\n AbstractMatrix.prototype.sign = function sign() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.sign(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.sign = function sign(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sign();\n };\n\n AbstractMatrix.prototype.sin = function sin() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.sin(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.sin = function sin(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sin();\n };\n\n AbstractMatrix.prototype.sinh = function sinh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.sinh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.sinh = function sinh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sinh();\n };\n\n AbstractMatrix.prototype.sqrt = function sqrt() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.sqrt(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.sqrt = function sqrt(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sqrt();\n };\n\n AbstractMatrix.prototype.tan = function tan() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.tan(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.tan = function tan(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.tan();\n };\n\n AbstractMatrix.prototype.tanh = function tanh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.tanh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.tanh = function tanh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.tanh();\n };\n\n AbstractMatrix.prototype.trunc = function trunc() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.trunc(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.trunc = function trunc(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.trunc();\n };\n\n AbstractMatrix.pow = function pow(matrix, arg0) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.pow(arg0);\n };\n\n AbstractMatrix.prototype.pow = function pow(value) {\n if (typeof value === 'number') return this.powS(value);\n return this.powM(value);\n };\n\n AbstractMatrix.prototype.powS = function powS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.pow(this.get(i, j), value));\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.powM = function powM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.pow(this.get(i, j), matrix.get(i, j)));\n }\n }\n return this;\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/mathOperations.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-date.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-date.js ***! - \************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js": +/*!************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js ***! + \************************************************************************/ +/*! exports provided: AbstractMatrix, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\nvar isDate = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Date');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isDate);\n//# sourceMappingURL=is-date.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-date.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AbstractMatrix\", function() { return AbstractMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Matrix; });\n/* harmony import */ var ml_array_rescale__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ml-array-rescale */ \"./node_modules/ml-array-rescale/lib-es6/index.js\");\n/* harmony import */ var _inspect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./inspect */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/inspect.js\");\n/* harmony import */ var _mathOperations__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mathOperations */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/mathOperations.js\");\n/* harmony import */ var _stat__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./stat */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/stat.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js\");\n\n\n\n\n\n\n\nclass AbstractMatrix {\n static from1DArray(newRows, newColumns, newData) {\n let length = newRows * newColumns;\n if (length !== newData.length) {\n throw new RangeError('data length does not match given dimensions');\n }\n let newMatrix = new Matrix(newRows, newColumns);\n for (let row = 0; row < newRows; row++) {\n for (let column = 0; column < newColumns; column++) {\n newMatrix.set(row, column, newData[row * newColumns + column]);\n }\n }\n return newMatrix;\n }\n\n static rowVector(newData) {\n let vector = new Matrix(1, newData.length);\n for (let i = 0; i < newData.length; i++) {\n vector.set(0, i, newData[i]);\n }\n return vector;\n }\n\n static columnVector(newData) {\n let vector = new Matrix(newData.length, 1);\n for (let i = 0; i < newData.length; i++) {\n vector.set(i, 0, newData[i]);\n }\n return vector;\n }\n\n static zeros(rows, columns) {\n return new Matrix(rows, columns);\n }\n\n static ones(rows, columns) {\n return new Matrix(rows, columns).fill(1);\n }\n\n static rand(rows, columns, options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { random = Math.random } = options;\n let matrix = new Matrix(rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n matrix.set(i, j, random());\n }\n }\n return matrix;\n }\n\n static randInt(rows, columns, options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { min = 0, max = 1000, random = Math.random } = options;\n if (!Number.isInteger(min)) throw new TypeError('min must be an integer');\n if (!Number.isInteger(max)) throw new TypeError('max must be an integer');\n if (min >= max) throw new RangeError('min must be smaller than max');\n let interval = max - min;\n let matrix = new Matrix(rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n let value = min + Math.round(random() * interval);\n matrix.set(i, j, value);\n }\n }\n return matrix;\n }\n\n static eye(rows, columns, value) {\n if (columns === undefined) columns = rows;\n if (value === undefined) value = 1;\n let min = Math.min(rows, columns);\n let matrix = this.zeros(rows, columns);\n for (let i = 0; i < min; i++) {\n matrix.set(i, i, value);\n }\n return matrix;\n }\n\n static diag(data, rows, columns) {\n let l = data.length;\n if (rows === undefined) rows = l;\n if (columns === undefined) columns = rows;\n let min = Math.min(l, rows, columns);\n let matrix = this.zeros(rows, columns);\n for (let i = 0; i < min; i++) {\n matrix.set(i, i, data[i]);\n }\n return matrix;\n }\n\n static min(matrix1, matrix2) {\n matrix1 = this.checkMatrix(matrix1);\n matrix2 = this.checkMatrix(matrix2);\n let rows = matrix1.rows;\n let columns = matrix1.columns;\n let result = new Matrix(rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n result.set(i, j, Math.min(matrix1.get(i, j), matrix2.get(i, j)));\n }\n }\n return result;\n }\n\n static max(matrix1, matrix2) {\n matrix1 = this.checkMatrix(matrix1);\n matrix2 = this.checkMatrix(matrix2);\n let rows = matrix1.rows;\n let columns = matrix1.columns;\n let result = new this(rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n result.set(i, j, Math.max(matrix1.get(i, j), matrix2.get(i, j)));\n }\n }\n return result;\n }\n\n static checkMatrix(value) {\n return AbstractMatrix.isMatrix(value) ? value : new Matrix(value);\n }\n\n static isMatrix(value) {\n return value != null && value.klass === 'Matrix';\n }\n\n get size() {\n return this.rows * this.columns;\n }\n\n apply(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('callback must be a function');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n callback.call(this, i, j);\n }\n }\n return this;\n }\n\n to1DArray() {\n let array = [];\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n array.push(this.get(i, j));\n }\n }\n return array;\n }\n\n to2DArray() {\n let copy = [];\n for (let i = 0; i < this.rows; i++) {\n copy.push([]);\n for (let j = 0; j < this.columns; j++) {\n copy[i].push(this.get(i, j));\n }\n }\n return copy;\n }\n\n toJSON() {\n return this.to2DArray();\n }\n\n isRowVector() {\n return this.rows === 1;\n }\n\n isColumnVector() {\n return this.columns === 1;\n }\n\n isVector() {\n return this.rows === 1 || this.columns === 1;\n }\n\n isSquare() {\n return this.rows === this.columns;\n }\n\n isSymmetric() {\n if (this.isSquare()) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j <= i; j++) {\n if (this.get(i, j) !== this.get(j, i)) {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }\n\n isEchelonForm() {\n let i = 0;\n let j = 0;\n let previousColumn = -1;\n let isEchelonForm = true;\n let checked = false;\n while (i < this.rows && isEchelonForm) {\n j = 0;\n checked = false;\n while (j < this.columns && checked === false) {\n if (this.get(i, j) === 0) {\n j++;\n } else if (this.get(i, j) === 1 && j > previousColumn) {\n checked = true;\n previousColumn = j;\n } else {\n isEchelonForm = false;\n checked = true;\n }\n }\n i++;\n }\n return isEchelonForm;\n }\n\n isReducedEchelonForm() {\n let i = 0;\n let j = 0;\n let previousColumn = -1;\n let isReducedEchelonForm = true;\n let checked = false;\n while (i < this.rows && isReducedEchelonForm) {\n j = 0;\n checked = false;\n while (j < this.columns && checked === false) {\n if (this.get(i, j) === 0) {\n j++;\n } else if (this.get(i, j) === 1 && j > previousColumn) {\n checked = true;\n previousColumn = j;\n } else {\n isReducedEchelonForm = false;\n checked = true;\n }\n }\n for (let k = j + 1; k < this.rows; k++) {\n if (this.get(i, k) !== 0) {\n isReducedEchelonForm = false;\n }\n }\n i++;\n }\n return isReducedEchelonForm;\n }\n\n echelonForm() {\n let result = this.clone();\n let h = 0;\n let k = 0;\n while (h < result.rows && k < result.columns) {\n let iMax = h;\n for (let i = h; i < result.rows; i++) {\n if (result.get(i, k) > result.get(iMax, k)) {\n iMax = i;\n }\n }\n if (result.get(iMax, k) === 0) {\n k++;\n } else {\n result.swapRows(h, iMax);\n let tmp = result.get(h, k);\n for (let j = k; j < result.columns; j++) {\n result.set(h, j, result.get(h, j) / tmp);\n }\n for (let i = h + 1; i < result.rows; i++) {\n let factor = result.get(i, k) / result.get(h, k);\n result.set(i, k, 0);\n for (let j = k + 1; j < result.columns; j++) {\n result.set(i, j, result.get(i, j) - result.get(h, j) * factor);\n }\n }\n h++;\n k++;\n }\n }\n return result;\n }\n\n reducedEchelonForm() {\n let result = this.echelonForm();\n let m = result.columns;\n let n = result.rows;\n let h = n - 1;\n while (h >= 0) {\n if (result.maxRow(h) === 0) {\n h--;\n } else {\n let p = 0;\n let pivot = false;\n while (p < n && pivot === false) {\n if (result.get(h, p) === 1) {\n pivot = true;\n } else {\n p++;\n }\n }\n for (let i = 0; i < h; i++) {\n let factor = result.get(i, p);\n for (let j = p; j < m; j++) {\n let tmp = result.get(i, j) - factor * result.get(h, j);\n result.set(i, j, tmp);\n }\n }\n h--;\n }\n }\n return result;\n }\n\n set() {\n throw new Error('set method is unimplemented');\n }\n\n get() {\n throw new Error('get method is unimplemented');\n }\n\n repeat(options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { rows = 1, columns = 1 } = options;\n if (!Number.isInteger(rows) || rows <= 0) {\n throw new TypeError('rows must be a positive integer');\n }\n if (!Number.isInteger(columns) || columns <= 0) {\n throw new TypeError('columns must be a positive integer');\n }\n let matrix = new Matrix(this.rows * rows, this.columns * columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n matrix.setSubMatrix(this, this.rows * i, this.columns * j);\n }\n }\n return matrix;\n }\n\n fill(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, value);\n }\n }\n return this;\n }\n\n neg() {\n return this.mulS(-1);\n }\n\n getRow(index) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, index);\n let row = [];\n for (let i = 0; i < this.columns; i++) {\n row.push(this.get(index, i));\n }\n return row;\n }\n\n getRowVector(index) {\n return Matrix.rowVector(this.getRow(index));\n }\n\n setRow(index, array) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, index);\n array = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowVector\"])(this, array);\n for (let i = 0; i < this.columns; i++) {\n this.set(index, i, array[i]);\n }\n return this;\n }\n\n swapRows(row1, row2) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, row1);\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, row2);\n for (let i = 0; i < this.columns; i++) {\n let temp = this.get(row1, i);\n this.set(row1, i, this.get(row2, i));\n this.set(row2, i, temp);\n }\n return this;\n }\n\n getColumn(index) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, index);\n let column = [];\n for (let i = 0; i < this.rows; i++) {\n column.push(this.get(i, index));\n }\n return column;\n }\n\n getColumnVector(index) {\n return Matrix.columnVector(this.getColumn(index));\n }\n\n setColumn(index, array) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, index);\n array = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnVector\"])(this, array);\n for (let i = 0; i < this.rows; i++) {\n this.set(i, index, array[i]);\n }\n return this;\n }\n\n swapColumns(column1, column2) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, column1);\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, column2);\n for (let i = 0; i < this.rows; i++) {\n let temp = this.get(i, column1);\n this.set(i, column1, this.get(i, column2));\n this.set(i, column2, temp);\n }\n return this;\n }\n\n addRowVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) + vector[j]);\n }\n }\n return this;\n }\n\n subRowVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) - vector[j]);\n }\n }\n return this;\n }\n\n mulRowVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) * vector[j]);\n }\n }\n return this;\n }\n\n divRowVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) / vector[j]);\n }\n }\n return this;\n }\n\n addColumnVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) + vector[i]);\n }\n }\n return this;\n }\n\n subColumnVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) - vector[i]);\n }\n }\n return this;\n }\n\n mulColumnVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) * vector[i]);\n }\n }\n return this;\n }\n\n divColumnVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) / vector[i]);\n }\n }\n return this;\n }\n\n mulRow(index, value) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, index);\n for (let i = 0; i < this.columns; i++) {\n this.set(index, i, this.get(index, i) * value);\n }\n return this;\n }\n\n mulColumn(index, value) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, index);\n for (let i = 0; i < this.rows; i++) {\n this.set(i, index, this.get(i, index) * value);\n }\n return this;\n }\n\n max() {\n let v = this.get(0, 0);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n if (this.get(i, j) > v) {\n v = this.get(i, j);\n }\n }\n }\n return v;\n }\n\n maxIndex() {\n let v = this.get(0, 0);\n let idx = [0, 0];\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n if (this.get(i, j) > v) {\n v = this.get(i, j);\n idx[0] = i;\n idx[1] = j;\n }\n }\n }\n return idx;\n }\n\n min() {\n let v = this.get(0, 0);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n if (this.get(i, j) < v) {\n v = this.get(i, j);\n }\n }\n }\n return v;\n }\n\n minIndex() {\n let v = this.get(0, 0);\n let idx = [0, 0];\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n if (this.get(i, j) < v) {\n v = this.get(i, j);\n idx[0] = i;\n idx[1] = j;\n }\n }\n }\n return idx;\n }\n\n maxRow(row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, row);\n let v = this.get(row, 0);\n for (let i = 1; i < this.columns; i++) {\n if (this.get(row, i) > v) {\n v = this.get(row, i);\n }\n }\n return v;\n }\n\n maxRowIndex(row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, row);\n let v = this.get(row, 0);\n let idx = [row, 0];\n for (let i = 1; i < this.columns; i++) {\n if (this.get(row, i) > v) {\n v = this.get(row, i);\n idx[1] = i;\n }\n }\n return idx;\n }\n\n minRow(row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, row);\n let v = this.get(row, 0);\n for (let i = 1; i < this.columns; i++) {\n if (this.get(row, i) < v) {\n v = this.get(row, i);\n }\n }\n return v;\n }\n\n minRowIndex(row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, row);\n let v = this.get(row, 0);\n let idx = [row, 0];\n for (let i = 1; i < this.columns; i++) {\n if (this.get(row, i) < v) {\n v = this.get(row, i);\n idx[1] = i;\n }\n }\n return idx;\n }\n\n maxColumn(column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, column);\n let v = this.get(0, column);\n for (let i = 1; i < this.rows; i++) {\n if (this.get(i, column) > v) {\n v = this.get(i, column);\n }\n }\n return v;\n }\n\n maxColumnIndex(column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, column);\n let v = this.get(0, column);\n let idx = [0, column];\n for (let i = 1; i < this.rows; i++) {\n if (this.get(i, column) > v) {\n v = this.get(i, column);\n idx[0] = i;\n }\n }\n return idx;\n }\n\n minColumn(column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, column);\n let v = this.get(0, column);\n for (let i = 1; i < this.rows; i++) {\n if (this.get(i, column) < v) {\n v = this.get(i, column);\n }\n }\n return v;\n }\n\n minColumnIndex(column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, column);\n let v = this.get(0, column);\n let idx = [0, column];\n for (let i = 1; i < this.rows; i++) {\n if (this.get(i, column) < v) {\n v = this.get(i, column);\n idx[0] = i;\n }\n }\n return idx;\n }\n\n diag() {\n let min = Math.min(this.rows, this.columns);\n let diag = [];\n for (let i = 0; i < min; i++) {\n diag.push(this.get(i, i));\n }\n return diag;\n }\n\n norm(type = 'frobenius') {\n let result = 0;\n if (type === 'max') {\n return this.max();\n } else if (type === 'frobenius') {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n result = result + this.get(i, j) * this.get(i, j);\n }\n }\n return Math.sqrt(result);\n } else {\n throw new RangeError(`unknown norm type: ${type}`);\n }\n }\n\n cumulativeSum() {\n let sum = 0;\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n sum += this.get(i, j);\n this.set(i, j, sum);\n }\n }\n return this;\n }\n\n dot(vector2) {\n if (AbstractMatrix.isMatrix(vector2)) vector2 = vector2.to1DArray();\n let vector1 = this.to1DArray();\n if (vector1.length !== vector2.length) {\n throw new RangeError('vectors do not have the same size');\n }\n let dot = 0;\n for (let i = 0; i < vector1.length; i++) {\n dot += vector1[i] * vector2[i];\n }\n return dot;\n }\n\n mmul(other) {\n other = Matrix.checkMatrix(other);\n\n let m = this.rows;\n let n = this.columns;\n let p = other.columns;\n\n let result = new Matrix(m, p);\n\n let Bcolj = new Float64Array(n);\n for (let j = 0; j < p; j++) {\n for (let k = 0; k < n; k++) {\n Bcolj[k] = other.get(k, j);\n }\n\n for (let i = 0; i < m; i++) {\n let s = 0;\n for (let k = 0; k < n; k++) {\n s += this.get(i, k) * Bcolj[k];\n }\n\n result.set(i, j, s);\n }\n }\n return result;\n }\n\n strassen2x2(other) {\n other = Matrix.checkMatrix(other);\n let result = new Matrix(2, 2);\n const a11 = this.get(0, 0);\n const b11 = other.get(0, 0);\n const a12 = this.get(0, 1);\n const b12 = other.get(0, 1);\n const a21 = this.get(1, 0);\n const b21 = other.get(1, 0);\n const a22 = this.get(1, 1);\n const b22 = other.get(1, 1);\n\n // Compute intermediate values.\n const m1 = (a11 + a22) * (b11 + b22);\n const m2 = (a21 + a22) * b11;\n const m3 = a11 * (b12 - b22);\n const m4 = a22 * (b21 - b11);\n const m5 = (a11 + a12) * b22;\n const m6 = (a21 - a11) * (b11 + b12);\n const m7 = (a12 - a22) * (b21 + b22);\n\n // Combine intermediate values into the output.\n const c00 = m1 + m4 - m5 + m7;\n const c01 = m3 + m5;\n const c10 = m2 + m4;\n const c11 = m1 - m2 + m3 + m6;\n\n result.set(0, 0, c00);\n result.set(0, 1, c01);\n result.set(1, 0, c10);\n result.set(1, 1, c11);\n return result;\n }\n\n strassen3x3(other) {\n other = Matrix.checkMatrix(other);\n let result = new Matrix(3, 3);\n\n const a00 = this.get(0, 0);\n const a01 = this.get(0, 1);\n const a02 = this.get(0, 2);\n const a10 = this.get(1, 0);\n const a11 = this.get(1, 1);\n const a12 = this.get(1, 2);\n const a20 = this.get(2, 0);\n const a21 = this.get(2, 1);\n const a22 = this.get(2, 2);\n\n const b00 = other.get(0, 0);\n const b01 = other.get(0, 1);\n const b02 = other.get(0, 2);\n const b10 = other.get(1, 0);\n const b11 = other.get(1, 1);\n const b12 = other.get(1, 2);\n const b20 = other.get(2, 0);\n const b21 = other.get(2, 1);\n const b22 = other.get(2, 2);\n\n const m1 = (a00 + a01 + a02 - a10 - a11 - a21 - a22) * b11;\n const m2 = (a00 - a10) * (-b01 + b11);\n const m3 = a11 * (-b00 + b01 + b10 - b11 - b12 - b20 + b22);\n const m4 = (-a00 + a10 + a11) * (b00 - b01 + b11);\n const m5 = (a10 + a11) * (-b00 + b01);\n const m6 = a00 * b00;\n const m7 = (-a00 + a20 + a21) * (b00 - b02 + b12);\n const m8 = (-a00 + a20) * (b02 - b12);\n const m9 = (a20 + a21) * (-b00 + b02);\n const m10 = (a00 + a01 + a02 - a11 - a12 - a20 - a21) * b12;\n const m11 = a21 * (-b00 + b02 + b10 - b11 - b12 - b20 + b21);\n const m12 = (-a02 + a21 + a22) * (b11 + b20 - b21);\n const m13 = (a02 - a22) * (b11 - b21);\n const m14 = a02 * b20;\n const m15 = (a21 + a22) * (-b20 + b21);\n const m16 = (-a02 + a11 + a12) * (b12 + b20 - b22);\n const m17 = (a02 - a12) * (b12 - b22);\n const m18 = (a11 + a12) * (-b20 + b22);\n const m19 = a01 * b10;\n const m20 = a12 * b21;\n const m21 = a10 * b02;\n const m22 = a20 * b01;\n const m23 = a22 * b22;\n\n const c00 = m6 + m14 + m19;\n const c01 = m1 + m4 + m5 + m6 + m12 + m14 + m15;\n const c02 = m6 + m7 + m9 + m10 + m14 + m16 + m18;\n const c10 = m2 + m3 + m4 + m6 + m14 + m16 + m17;\n const c11 = m2 + m4 + m5 + m6 + m20;\n const c12 = m14 + m16 + m17 + m18 + m21;\n const c20 = m6 + m7 + m8 + m11 + m12 + m13 + m14;\n const c21 = m12 + m13 + m14 + m15 + m22;\n const c22 = m6 + m7 + m8 + m9 + m23;\n\n result.set(0, 0, c00);\n result.set(0, 1, c01);\n result.set(0, 2, c02);\n result.set(1, 0, c10);\n result.set(1, 1, c11);\n result.set(1, 2, c12);\n result.set(2, 0, c20);\n result.set(2, 1, c21);\n result.set(2, 2, c22);\n return result;\n }\n\n mmulStrassen(y) {\n y = Matrix.checkMatrix(y);\n let x = this.clone();\n let r1 = x.rows;\n let c1 = x.columns;\n let r2 = y.rows;\n let c2 = y.columns;\n if (c1 !== r2) {\n // eslint-disable-next-line no-console\n console.warn(\n `Multiplying ${r1} x ${c1} and ${r2} x ${c2} matrix: dimensions do not match.`,\n );\n }\n\n // Put a matrix into the top left of a matrix of zeros.\n // `rows` and `cols` are the dimensions of the output matrix.\n function embed(mat, rows, cols) {\n let r = mat.rows;\n let c = mat.columns;\n if (r === rows && c === cols) {\n return mat;\n } else {\n let resultat = AbstractMatrix.zeros(rows, cols);\n resultat = resultat.setSubMatrix(mat, 0, 0);\n return resultat;\n }\n }\n\n // Make sure both matrices are the same size.\n // This is exclusively for simplicity:\n // this algorithm can be implemented with matrices of different sizes.\n\n let r = Math.max(r1, r2);\n let c = Math.max(c1, c2);\n x = embed(x, r, c);\n y = embed(y, r, c);\n\n // Our recursive multiplication function.\n function blockMult(a, b, rows, cols) {\n // For small matrices, resort to naive multiplication.\n if (rows <= 512 || cols <= 512) {\n return a.mmul(b); // a is equivalent to this\n }\n\n // Apply dynamic padding.\n if (rows % 2 === 1 && cols % 2 === 1) {\n a = embed(a, rows + 1, cols + 1);\n b = embed(b, rows + 1, cols + 1);\n } else if (rows % 2 === 1) {\n a = embed(a, rows + 1, cols);\n b = embed(b, rows + 1, cols);\n } else if (cols % 2 === 1) {\n a = embed(a, rows, cols + 1);\n b = embed(b, rows, cols + 1);\n }\n\n let halfRows = parseInt(a.rows / 2, 10);\n let halfCols = parseInt(a.columns / 2, 10);\n // Subdivide input matrices.\n let a11 = a.subMatrix(0, halfRows - 1, 0, halfCols - 1);\n let b11 = b.subMatrix(0, halfRows - 1, 0, halfCols - 1);\n\n let a12 = a.subMatrix(0, halfRows - 1, halfCols, a.columns - 1);\n let b12 = b.subMatrix(0, halfRows - 1, halfCols, b.columns - 1);\n\n let a21 = a.subMatrix(halfRows, a.rows - 1, 0, halfCols - 1);\n let b21 = b.subMatrix(halfRows, b.rows - 1, 0, halfCols - 1);\n\n let a22 = a.subMatrix(halfRows, a.rows - 1, halfCols, a.columns - 1);\n let b22 = b.subMatrix(halfRows, b.rows - 1, halfCols, b.columns - 1);\n\n // Compute intermediate values.\n let m1 = blockMult(\n AbstractMatrix.add(a11, a22),\n AbstractMatrix.add(b11, b22),\n halfRows,\n halfCols,\n );\n let m2 = blockMult(AbstractMatrix.add(a21, a22), b11, halfRows, halfCols);\n let m3 = blockMult(a11, AbstractMatrix.sub(b12, b22), halfRows, halfCols);\n let m4 = blockMult(a22, AbstractMatrix.sub(b21, b11), halfRows, halfCols);\n let m5 = blockMult(AbstractMatrix.add(a11, a12), b22, halfRows, halfCols);\n let m6 = blockMult(\n AbstractMatrix.sub(a21, a11),\n AbstractMatrix.add(b11, b12),\n halfRows,\n halfCols,\n );\n let m7 = blockMult(\n AbstractMatrix.sub(a12, a22),\n AbstractMatrix.add(b21, b22),\n halfRows,\n halfCols,\n );\n\n // Combine intermediate values into the output.\n let c11 = AbstractMatrix.add(m1, m4);\n c11.sub(m5);\n c11.add(m7);\n let c12 = AbstractMatrix.add(m3, m5);\n let c21 = AbstractMatrix.add(m2, m4);\n let c22 = AbstractMatrix.sub(m1, m2);\n c22.add(m3);\n c22.add(m6);\n\n // Crop output to the desired size (undo dynamic padding).\n let resultat = AbstractMatrix.zeros(2 * c11.rows, 2 * c11.columns);\n resultat = resultat.setSubMatrix(c11, 0, 0);\n resultat = resultat.setSubMatrix(c12, c11.rows, 0);\n resultat = resultat.setSubMatrix(c21, 0, c11.columns);\n resultat = resultat.setSubMatrix(c22, c11.rows, c11.columns);\n return resultat.subMatrix(0, rows - 1, 0, cols - 1);\n }\n return blockMult(x, y, r, c);\n }\n\n scaleRows(options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { min = 0, max = 1 } = options;\n if (!Number.isFinite(min)) throw new TypeError('min must be a number');\n if (!Number.isFinite(max)) throw new TypeError('max must be a number');\n if (min >= max) throw new RangeError('min must be smaller than max');\n let newMatrix = new Matrix(this.rows, this.columns);\n for (let i = 0; i < this.rows; i++) {\n const row = this.getRow(i);\n Object(ml_array_rescale__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(row, { min, max, output: row });\n newMatrix.setRow(i, row);\n }\n return newMatrix;\n }\n\n scaleColumns(options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { min = 0, max = 1 } = options;\n if (!Number.isFinite(min)) throw new TypeError('min must be a number');\n if (!Number.isFinite(max)) throw new TypeError('max must be a number');\n if (min >= max) throw new RangeError('min must be smaller than max');\n let newMatrix = new Matrix(this.rows, this.columns);\n for (let i = 0; i < this.columns; i++) {\n const column = this.getColumn(i);\n Object(ml_array_rescale__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(column, {\n min: min,\n max: max,\n output: column,\n });\n newMatrix.setColumn(i, column);\n }\n return newMatrix;\n }\n\n flipRows() {\n const middle = Math.ceil(this.columns / 2);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < middle; j++) {\n let first = this.get(i, j);\n let last = this.get(i, this.columns - 1 - j);\n this.set(i, j, last);\n this.set(i, this.columns - 1 - j, first);\n }\n }\n return this;\n }\n\n flipColumns() {\n const middle = Math.ceil(this.rows / 2);\n for (let j = 0; j < this.columns; j++) {\n for (let i = 0; i < middle; i++) {\n let first = this.get(i, j);\n let last = this.get(this.rows - 1 - i, j);\n this.set(i, j, last);\n this.set(this.rows - 1 - i, j, first);\n }\n }\n return this;\n }\n\n kroneckerProduct(other) {\n other = Matrix.checkMatrix(other);\n\n let m = this.rows;\n let n = this.columns;\n let p = other.rows;\n let q = other.columns;\n\n let result = new Matrix(m * p, n * q);\n for (let i = 0; i < m; i++) {\n for (let j = 0; j < n; j++) {\n for (let k = 0; k < p; k++) {\n for (let l = 0; l < q; l++) {\n result.set(p * i + k, q * j + l, this.get(i, j) * other.get(k, l));\n }\n }\n }\n }\n return result;\n }\n\n transpose() {\n let result = new Matrix(this.columns, this.rows);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n result.set(j, i, this.get(i, j));\n }\n }\n return result;\n }\n\n sortRows(compareFunction = compareNumbers) {\n for (let i = 0; i < this.rows; i++) {\n this.setRow(i, this.getRow(i).sort(compareFunction));\n }\n return this;\n }\n\n sortColumns(compareFunction = compareNumbers) {\n for (let i = 0; i < this.columns; i++) {\n this.setColumn(i, this.getColumn(i).sort(compareFunction));\n }\n return this;\n }\n\n subMatrix(startRow, endRow, startColumn, endColumn) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRange\"])(this, startRow, endRow, startColumn, endColumn);\n let newMatrix = new Matrix(\n endRow - startRow + 1,\n endColumn - startColumn + 1,\n );\n for (let i = startRow; i <= endRow; i++) {\n for (let j = startColumn; j <= endColumn; j++) {\n newMatrix.set(i - startRow, j - startColumn, this.get(i, j));\n }\n }\n return newMatrix;\n }\n\n subMatrixRow(indices, startColumn, endColumn) {\n if (startColumn === undefined) startColumn = 0;\n if (endColumn === undefined) endColumn = this.columns - 1;\n if (\n startColumn > endColumn ||\n startColumn < 0 ||\n startColumn >= this.columns ||\n endColumn < 0 ||\n endColumn >= this.columns\n ) {\n throw new RangeError('Argument out of range');\n }\n\n let newMatrix = new Matrix(indices.length, endColumn - startColumn + 1);\n for (let i = 0; i < indices.length; i++) {\n for (let j = startColumn; j <= endColumn; j++) {\n if (indices[i] < 0 || indices[i] >= this.rows) {\n throw new RangeError(`Row index out of range: ${indices[i]}`);\n }\n newMatrix.set(i, j - startColumn, this.get(indices[i], j));\n }\n }\n return newMatrix;\n }\n\n subMatrixColumn(indices, startRow, endRow) {\n if (startRow === undefined) startRow = 0;\n if (endRow === undefined) endRow = this.rows - 1;\n if (\n startRow > endRow ||\n startRow < 0 ||\n startRow >= this.rows ||\n endRow < 0 ||\n endRow >= this.rows\n ) {\n throw new RangeError('Argument out of range');\n }\n\n let newMatrix = new Matrix(endRow - startRow + 1, indices.length);\n for (let i = 0; i < indices.length; i++) {\n for (let j = startRow; j <= endRow; j++) {\n if (indices[i] < 0 || indices[i] >= this.columns) {\n throw new RangeError(`Column index out of range: ${indices[i]}`);\n }\n newMatrix.set(j - startRow, i, this.get(j, indices[i]));\n }\n }\n return newMatrix;\n }\n\n setSubMatrix(matrix, startRow, startColumn) {\n matrix = Matrix.checkMatrix(matrix);\n let endRow = startRow + matrix.rows - 1;\n let endColumn = startColumn + matrix.columns - 1;\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRange\"])(this, startRow, endRow, startColumn, endColumn);\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n this.set(startRow + i, startColumn + j, matrix.get(i, j));\n }\n }\n return this;\n }\n\n selection(rowIndices, columnIndices) {\n let indices = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkIndices\"])(this, rowIndices, columnIndices);\n let newMatrix = new Matrix(rowIndices.length, columnIndices.length);\n for (let i = 0; i < indices.row.length; i++) {\n let rowIndex = indices.row[i];\n for (let j = 0; j < indices.column.length; j++) {\n let columnIndex = indices.column[j];\n newMatrix.set(i, j, this.get(rowIndex, columnIndex));\n }\n }\n return newMatrix;\n }\n\n trace() {\n let min = Math.min(this.rows, this.columns);\n let trace = 0;\n for (let i = 0; i < min; i++) {\n trace += this.get(i, i);\n }\n return trace;\n }\n\n clone() {\n let newMatrix = new Matrix(this.rows, this.columns);\n for (let row = 0; row < this.rows; row++) {\n for (let column = 0; column < this.columns; column++) {\n newMatrix.set(row, column, this.get(row, column));\n }\n }\n return newMatrix;\n }\n\n sum(by) {\n switch (by) {\n case 'row':\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"sumByRow\"])(this);\n case 'column':\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"sumByColumn\"])(this);\n case undefined:\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"sumAll\"])(this);\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n product(by) {\n switch (by) {\n case 'row':\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"productByRow\"])(this);\n case 'column':\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"productByColumn\"])(this);\n case undefined:\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"productAll\"])(this);\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n mean(by) {\n const sum = this.sum(by);\n switch (by) {\n case 'row': {\n for (let i = 0; i < this.rows; i++) {\n sum[i] /= this.columns;\n }\n return sum;\n }\n case 'column': {\n for (let i = 0; i < this.columns; i++) {\n sum[i] /= this.rows;\n }\n return sum;\n }\n case undefined:\n return sum / this.size;\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n variance(by, options = {}) {\n if (typeof by === 'object') {\n options = by;\n by = undefined;\n }\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { unbiased = true, mean = this.mean(by) } = options;\n if (typeof unbiased !== 'boolean') {\n throw new TypeError('unbiased must be a boolean');\n }\n switch (by) {\n case 'row': {\n if (!Array.isArray(mean)) {\n throw new TypeError('mean must be an array');\n }\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"varianceByRow\"])(this, unbiased, mean);\n }\n case 'column': {\n if (!Array.isArray(mean)) {\n throw new TypeError('mean must be an array');\n }\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"varianceByColumn\"])(this, unbiased, mean);\n }\n case undefined: {\n if (typeof mean !== 'number') {\n throw new TypeError('mean must be a number');\n }\n return Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"varianceAll\"])(this, unbiased, mean);\n }\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n standardDeviation(by, options) {\n if (typeof by === 'object') {\n options = by;\n by = undefined;\n }\n const variance = this.variance(by, options);\n if (by === undefined) {\n return Math.sqrt(variance);\n } else {\n for (let i = 0; i < variance.length; i++) {\n variance[i] = Math.sqrt(variance[i]);\n }\n return variance;\n }\n }\n\n center(by, options = {}) {\n if (typeof by === 'object') {\n options = by;\n by = undefined;\n }\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { center = this.mean(by) } = options;\n switch (by) {\n case 'row': {\n if (!Array.isArray(center)) {\n throw new TypeError('center must be an array');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"centerByRow\"])(this, center);\n return this;\n }\n case 'column': {\n if (!Array.isArray(center)) {\n throw new TypeError('center must be an array');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"centerByColumn\"])(this, center);\n return this;\n }\n case undefined: {\n if (typeof center !== 'number') {\n throw new TypeError('center must be a number');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"centerAll\"])(this, center);\n return this;\n }\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n scale(by, options = {}) {\n if (typeof by === 'object') {\n options = by;\n by = undefined;\n }\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n let scale = options.scale;\n switch (by) {\n case 'row': {\n if (scale === undefined) {\n scale = Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"getScaleByRow\"])(this);\n } else if (!Array.isArray(scale)) {\n throw new TypeError('scale must be an array');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"scaleByRow\"])(this, scale);\n return this;\n }\n case 'column': {\n if (scale === undefined) {\n scale = Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"getScaleByColumn\"])(this);\n } else if (!Array.isArray(scale)) {\n throw new TypeError('scale must be an array');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"scaleByColumn\"])(this, scale);\n return this;\n }\n case undefined: {\n if (scale === undefined) {\n scale = Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"getScaleAll\"])(this);\n } else if (typeof scale !== 'number') {\n throw new TypeError('scale must be a number');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_3__[\"scaleAll\"])(this, scale);\n return this;\n }\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n toString(options) {\n return Object(_inspect__WEBPACK_IMPORTED_MODULE_1__[\"inspectMatrixWithOptions\"])(this, options);\n }\n}\n\nAbstractMatrix.prototype.klass = 'Matrix';\nif (typeof Symbol !== 'undefined') {\n AbstractMatrix.prototype[\n Symbol.for('nodejs.util.inspect.custom')\n ] = _inspect__WEBPACK_IMPORTED_MODULE_1__[\"inspectMatrix\"];\n}\n\nfunction compareNumbers(a, b) {\n return a - b;\n}\n\n// Synonyms\nAbstractMatrix.random = AbstractMatrix.rand;\nAbstractMatrix.randomInt = AbstractMatrix.randInt;\nAbstractMatrix.diagonal = AbstractMatrix.diag;\nAbstractMatrix.prototype.diagonal = AbstractMatrix.prototype.diag;\nAbstractMatrix.identity = AbstractMatrix.eye;\nAbstractMatrix.prototype.negate = AbstractMatrix.prototype.neg;\nAbstractMatrix.prototype.tensorProduct =\n AbstractMatrix.prototype.kroneckerProduct;\n\nclass Matrix extends AbstractMatrix {\n constructor(nRows, nColumns) {\n super();\n if (Matrix.isMatrix(nRows)) {\n return nRows.clone();\n } else if (Number.isInteger(nRows) && nRows > 0) {\n // Create an empty matrix\n this.data = [];\n if (Number.isInteger(nColumns) && nColumns > 0) {\n for (let i = 0; i < nRows; i++) {\n this.data.push(new Float64Array(nColumns));\n }\n } else {\n throw new TypeError('nColumns must be a positive integer');\n }\n } else if (Array.isArray(nRows)) {\n // Copy the values from the 2D array\n const arrayData = nRows;\n nRows = arrayData.length;\n nColumns = arrayData[0].length;\n if (typeof nColumns !== 'number' || nColumns === 0) {\n throw new TypeError(\n 'Data must be a 2D array with at least one element',\n );\n }\n this.data = [];\n for (let i = 0; i < nRows; i++) {\n if (arrayData[i].length !== nColumns) {\n throw new RangeError('Inconsistent array dimensions');\n }\n this.data.push(Float64Array.from(arrayData[i]));\n }\n } else {\n throw new TypeError(\n 'First argument must be a positive number or an array',\n );\n }\n this.rows = nRows;\n this.columns = nColumns;\n return this;\n }\n\n set(rowIndex, columnIndex, value) {\n this.data[rowIndex][columnIndex] = value;\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.data[rowIndex][columnIndex];\n }\n\n removeRow(index) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, index);\n if (this.rows === 1) {\n throw new RangeError('A matrix cannot have less than one row');\n }\n this.data.splice(index, 1);\n this.rows -= 1;\n return this;\n }\n\n addRow(index, array) {\n if (array === undefined) {\n array = index;\n index = this.rows;\n }\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowIndex\"])(this, index, true);\n array = Float64Array.from(Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkRowVector\"])(this, array, true));\n this.data.splice(index, 0, array);\n this.rows += 1;\n return this;\n }\n\n removeColumn(index) {\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, index);\n if (this.columns === 1) {\n throw new RangeError('A matrix cannot have less than one column');\n }\n for (let i = 0; i < this.rows; i++) {\n const newRow = new Float64Array(this.columns - 1);\n for (let j = 0; j < index; j++) {\n newRow[j] = this.data[i][j];\n }\n for (let j = index + 1; j < this.columns; j++) {\n newRow[j - 1] = this.data[i][j];\n }\n this.data[i] = newRow;\n }\n this.columns -= 1;\n return this;\n }\n\n addColumn(index, array) {\n if (typeof array === 'undefined') {\n array = index;\n index = this.columns;\n }\n Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnIndex\"])(this, index, true);\n array = Object(_util__WEBPACK_IMPORTED_MODULE_4__[\"checkColumnVector\"])(this, array);\n for (let i = 0; i < this.rows; i++) {\n const newRow = new Float64Array(this.columns + 1);\n let j = 0;\n for (; j < index; j++) {\n newRow[j] = this.data[i][j];\n }\n newRow[j++] = array[i];\n for (; j < this.columns + 1; j++) {\n newRow[j] = this.data[i][j - 1];\n }\n this.data[i] = newRow;\n }\n this.columns += 1;\n return this;\n }\n}\n\nObject(_mathOperations__WEBPACK_IMPORTED_MODULE_2__[\"installMathOperations\"])(AbstractMatrix, Matrix);\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-decimal.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-decimal.js ***! - \***************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/pseudoInverse.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/pseudoInverse.js ***! + \*******************************************************************************/ +/*! exports provided: pseudoInverse */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isDecimal = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 1 !== 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isDecimal);\n//# sourceMappingURL=is-decimal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-decimal.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pseudoInverse\", function() { return pseudoInverse; });\n/* harmony import */ var _dc_svd__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dc/svd */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/dc/svd.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n\n\n\nfunction pseudoInverse(matrix, threshold = Number.EPSILON) {\n matrix = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n let svdSolution = new _dc_svd__WEBPACK_IMPORTED_MODULE_0__[\"default\"](matrix, { autoTranspose: true });\n\n let U = svdSolution.leftSingularVectors;\n let V = svdSolution.rightSingularVectors;\n let s = svdSolution.diagonal;\n\n for (let i = 0; i < s.length; i++) {\n if (Math.abs(s[i]) > threshold) {\n s[i] = 1.0 / s[i];\n } else {\n s[i] = 0.0;\n }\n }\n\n return V.mmul(_matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].diag(s).mmul(U.transpose()));\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/pseudoInverse.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-element.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-element.js ***! - \***************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/stat.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/stat.js ***! + \**********************************************************************/ +/*! exports provided: sumByRow, sumByColumn, sumAll, productByRow, productByColumn, productAll, varianceByRow, varianceByColumn, varianceAll, centerByRow, centerByColumn, centerAll, getScaleByRow, scaleByRow, getScaleByColumn, scaleByColumn, getScaleAll, scaleAll */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 判断是否HTML元素\n * @return {Boolean} 是否HTML元素\n */\nvar isElement = function (o) {\n return o instanceof Element || o instanceof HTMLDocument;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isElement);\n//# sourceMappingURL=is-element.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-element.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sumByRow\", function() { return sumByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sumByColumn\", function() { return sumByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sumAll\", function() { return sumAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"productByRow\", function() { return productByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"productByColumn\", function() { return productByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"productAll\", function() { return productAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"varianceByRow\", function() { return varianceByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"varianceByColumn\", function() { return varianceByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"varianceAll\", function() { return varianceAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"centerByRow\", function() { return centerByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"centerByColumn\", function() { return centerByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"centerAll\", function() { return centerAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaleByRow\", function() { return getScaleByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleByRow\", function() { return scaleByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaleByColumn\", function() { return getScaleByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleByColumn\", function() { return scaleByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaleAll\", function() { return getScaleAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAll\", function() { return scaleAll; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js\");\n\n\nfunction sumByRow(matrix) {\n let sum = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"newArray\"])(matrix.rows);\n for (let i = 0; i < matrix.rows; ++i) {\n for (let j = 0; j < matrix.columns; ++j) {\n sum[i] += matrix.get(i, j);\n }\n }\n return sum;\n}\n\nfunction sumByColumn(matrix) {\n let sum = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"newArray\"])(matrix.columns);\n for (let i = 0; i < matrix.rows; ++i) {\n for (let j = 0; j < matrix.columns; ++j) {\n sum[j] += matrix.get(i, j);\n }\n }\n return sum;\n}\n\nfunction sumAll(matrix) {\n let v = 0;\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n v += matrix.get(i, j);\n }\n }\n return v;\n}\n\nfunction productByRow(matrix) {\n let sum = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"newArray\"])(matrix.rows, 1);\n for (let i = 0; i < matrix.rows; ++i) {\n for (let j = 0; j < matrix.columns; ++j) {\n sum[i] *= matrix.get(i, j);\n }\n }\n return sum;\n}\n\nfunction productByColumn(matrix) {\n let sum = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"newArray\"])(matrix.columns, 1);\n for (let i = 0; i < matrix.rows; ++i) {\n for (let j = 0; j < matrix.columns; ++j) {\n sum[j] *= matrix.get(i, j);\n }\n }\n return sum;\n}\n\nfunction productAll(matrix) {\n let v = 1;\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n v *= matrix.get(i, j);\n }\n }\n return v;\n}\n\nfunction varianceByRow(matrix, unbiased, mean) {\n const rows = matrix.rows;\n const cols = matrix.columns;\n const variance = [];\n\n for (let i = 0; i < rows; i++) {\n let sum1 = 0;\n let sum2 = 0;\n let x = 0;\n for (let j = 0; j < cols; j++) {\n x = matrix.get(i, j) - mean[i];\n sum1 += x;\n sum2 += x * x;\n }\n if (unbiased) {\n variance.push((sum2 - (sum1 * sum1) / cols) / (cols - 1));\n } else {\n variance.push((sum2 - (sum1 * sum1) / cols) / cols);\n }\n }\n return variance;\n}\n\nfunction varianceByColumn(matrix, unbiased, mean) {\n const rows = matrix.rows;\n const cols = matrix.columns;\n const variance = [];\n\n for (let j = 0; j < cols; j++) {\n let sum1 = 0;\n let sum2 = 0;\n let x = 0;\n for (let i = 0; i < rows; i++) {\n x = matrix.get(i, j) - mean[j];\n sum1 += x;\n sum2 += x * x;\n }\n if (unbiased) {\n variance.push((sum2 - (sum1 * sum1) / rows) / (rows - 1));\n } else {\n variance.push((sum2 - (sum1 * sum1) / rows) / rows);\n }\n }\n return variance;\n}\n\nfunction varianceAll(matrix, unbiased, mean) {\n const rows = matrix.rows;\n const cols = matrix.columns;\n const size = rows * cols;\n\n let sum1 = 0;\n let sum2 = 0;\n let x = 0;\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n x = matrix.get(i, j) - mean;\n sum1 += x;\n sum2 += x * x;\n }\n }\n if (unbiased) {\n return (sum2 - (sum1 * sum1) / size) / (size - 1);\n } else {\n return (sum2 - (sum1 * sum1) / size) / size;\n }\n}\n\nfunction centerByRow(matrix, mean) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) - mean[i]);\n }\n }\n}\n\nfunction centerByColumn(matrix, mean) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) - mean[j]);\n }\n }\n}\n\nfunction centerAll(matrix, mean) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) - mean);\n }\n }\n}\n\nfunction getScaleByRow(matrix) {\n const scale = [];\n for (let i = 0; i < matrix.rows; i++) {\n let sum = 0;\n for (let j = 0; j < matrix.columns; j++) {\n sum += Math.pow(matrix.get(i, j), 2) / (matrix.columns - 1);\n }\n scale.push(Math.sqrt(sum));\n }\n return scale;\n}\n\nfunction scaleByRow(matrix, scale) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) / scale[i]);\n }\n }\n}\n\nfunction getScaleByColumn(matrix) {\n const scale = [];\n for (let j = 0; j < matrix.columns; j++) {\n let sum = 0;\n for (let i = 0; i < matrix.rows; i++) {\n sum += Math.pow(matrix.get(i, j), 2) / (matrix.rows - 1);\n }\n scale.push(Math.sqrt(sum));\n }\n return scale;\n}\n\nfunction scaleByColumn(matrix, scale) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) / scale[j]);\n }\n }\n}\n\nfunction getScaleAll(matrix) {\n const divider = matrix.size - 1;\n let sum = 0;\n for (let j = 0; j < matrix.columns; j++) {\n for (let i = 0; i < matrix.rows; i++) {\n sum += Math.pow(matrix.get(i, j), 2) / divider;\n }\n }\n return Math.sqrt(sum);\n}\n\nfunction scaleAll(matrix, scale) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) / scale);\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/stat.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-empty.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-empty.js ***! - \*************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js": +/*!**********************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js ***! + \**********************************************************************/ +/*! exports provided: checkRowIndex, checkColumnIndex, checkRowVector, checkColumnVector, checkIndices, checkRowIndices, checkColumnIndices, checkRange, newArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n/* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-type */ \"./node_modules/@antv/util/esm/get-type.js\");\n/* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-prototype */ \"./node_modules/@antv/util/esm/is-prototype.js\");\n\n\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction isEmpty(value) {\n /**\n * isEmpty(null) => true\n * isEmpty() => true\n * isEmpty(true) => true\n * isEmpty(1) => true\n * isEmpty([1, 2, 3]) => false\n * isEmpty('abc') => false\n * isEmpty({ a: 1 }) => false\n */\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n return true;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n return !value.length;\n }\n var type = Object(_get_type__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(value);\n if (type === 'Map' || type === 'Set') {\n return !value.size;\n }\n if (Object(_is_prototype__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(value)) {\n return !Object.keys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEmpty);\n//# sourceMappingURL=is-empty.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-empty.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRowIndex\", function() { return checkRowIndex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkColumnIndex\", function() { return checkColumnIndex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRowVector\", function() { return checkRowVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkColumnVector\", function() { return checkColumnVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkIndices\", function() { return checkIndices; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRowIndices\", function() { return checkRowIndices; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkColumnIndices\", function() { return checkColumnIndices; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRange\", function() { return checkRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newArray\", function() { return newArray; });\n/**\n * @private\n * Check that a row index is not out of bounds\n * @param {Matrix} matrix\n * @param {number} index\n * @param {boolean} [outer]\n */\nfunction checkRowIndex(matrix, index, outer) {\n let max = outer ? matrix.rows : matrix.rows - 1;\n if (index < 0 || index > max) {\n throw new RangeError('Row index out of range');\n }\n}\n\n/**\n * @private\n * Check that a column index is not out of bounds\n * @param {Matrix} matrix\n * @param {number} index\n * @param {boolean} [outer]\n */\nfunction checkColumnIndex(matrix, index, outer) {\n let max = outer ? matrix.columns : matrix.columns - 1;\n if (index < 0 || index > max) {\n throw new RangeError('Column index out of range');\n }\n}\n\n/**\n * @private\n * Check that the provided vector is an array with the right length\n * @param {Matrix} matrix\n * @param {Array|Matrix} vector\n * @return {Array}\n * @throws {RangeError}\n */\nfunction checkRowVector(matrix, vector) {\n if (vector.to1DArray) {\n vector = vector.to1DArray();\n }\n if (vector.length !== matrix.columns) {\n throw new RangeError(\n 'vector size must be the same as the number of columns',\n );\n }\n return vector;\n}\n\n/**\n * @private\n * Check that the provided vector is an array with the right length\n * @param {Matrix} matrix\n * @param {Array|Matrix} vector\n * @return {Array}\n * @throws {RangeError}\n */\nfunction checkColumnVector(matrix, vector) {\n if (vector.to1DArray) {\n vector = vector.to1DArray();\n }\n if (vector.length !== matrix.rows) {\n throw new RangeError('vector size must be the same as the number of rows');\n }\n return vector;\n}\n\nfunction checkIndices(matrix, rowIndices, columnIndices) {\n return {\n row: checkRowIndices(matrix, rowIndices),\n column: checkColumnIndices(matrix, columnIndices),\n };\n}\n\nfunction checkRowIndices(matrix, rowIndices) {\n if (typeof rowIndices !== 'object') {\n throw new TypeError('unexpected type for row indices');\n }\n\n let rowOut = rowIndices.some((r) => {\n return r < 0 || r >= matrix.rows;\n });\n\n if (rowOut) {\n throw new RangeError('row indices are out of range');\n }\n\n if (!Array.isArray(rowIndices)) rowIndices = Array.from(rowIndices);\n\n return rowIndices;\n}\n\nfunction checkColumnIndices(matrix, columnIndices) {\n if (typeof columnIndices !== 'object') {\n throw new TypeError('unexpected type for column indices');\n }\n\n let columnOut = columnIndices.some((c) => {\n return c < 0 || c >= matrix.columns;\n });\n\n if (columnOut) {\n throw new RangeError('column indices are out of range');\n }\n if (!Array.isArray(columnIndices)) columnIndices = Array.from(columnIndices);\n\n return columnIndices;\n}\n\nfunction checkRange(matrix, startRow, endRow, startColumn, endColumn) {\n if (arguments.length !== 5) {\n throw new RangeError('expected 4 arguments');\n }\n checkNumber('startRow', startRow);\n checkNumber('endRow', endRow);\n checkNumber('startColumn', startColumn);\n checkNumber('endColumn', endColumn);\n if (\n startRow > endRow ||\n startColumn > endColumn ||\n startRow < 0 ||\n startRow >= matrix.rows ||\n endRow < 0 ||\n endRow >= matrix.rows ||\n startColumn < 0 ||\n startColumn >= matrix.columns ||\n endColumn < 0 ||\n endColumn >= matrix.columns\n ) {\n throw new RangeError('Submatrix indices are out of range');\n }\n}\n\nfunction newArray(length, value = 0) {\n let array = [];\n for (let i = 0; i < length; i++) {\n array.push(value);\n }\n return array;\n}\n\nfunction checkNumber(name, value) {\n if (typeof value !== 'number') {\n throw new TypeError(`${name} must be a number`);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-equal-with.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-equal-with.js ***! - \******************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js": +/*!****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js ***! + \****************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n/* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-equal */ \"./node_modules/@antv/util/esm/is-equal.js\");\n\n\n/**\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [fn] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * isEqualWith(array, other, customizer); // => true\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value, other, fn) {\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(fn)) {\n return Object(_is_equal__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value, other);\n }\n return !!fn(value, other);\n});\n//# sourceMappingURL=is-equal-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-equal-with.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return BaseView; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n\n\nclass BaseView extends _matrix__WEBPACK_IMPORTED_MODULE_0__[\"AbstractMatrix\"] {\n constructor(matrix, rows, columns) {\n super();\n this.matrix = matrix;\n this.rows = rows;\n this.columns = columns;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-equal.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-equal.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/column.js": +/*!******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/column.js ***! + \******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/util/esm/is-object-like.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n\n\nvar isEqual = function (value, other) {\n if (value === other) {\n return true;\n }\n if (!value || !other) {\n return false;\n }\n if (Object(_is_string__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(value) || Object(_is_string__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(other)) {\n return false;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value) || Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(other)) {\n if (value.length !== other.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < value.length; i++) {\n rst = isEqual(value[i], other[i]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n if (Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) || Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(other)) {\n var valueKeys = Object.keys(value);\n var otherKeys = Object.keys(other);\n if (valueKeys.length !== otherKeys.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < valueKeys.length; i++) {\n rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n return false;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEqual);\n//# sourceMappingURL=is-equal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-equal.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixColumnView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixColumnView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkColumnIndex\"])(matrix, column);\n super(matrix, matrix.rows, 1);\n this.column = column;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(rowIndex, this.column, value);\n return this;\n }\n\n get(rowIndex) {\n return this.matrix.get(rowIndex, this.column);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/column.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-error.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-error.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/columnSelection.js": +/*!***************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/columnSelection.js ***! + \***************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isError = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Error');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isError);\n//# sourceMappingURL=is-error.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-error.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixColumnSelectionView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixColumnSelectionView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, columnIndices) {\n columnIndices = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkColumnIndices\"])(matrix, columnIndices);\n super(matrix, matrix.rows, columnIndices.length);\n this.columnIndices = columnIndices;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(rowIndex, this.columnIndices[columnIndex], value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(rowIndex, this.columnIndices[columnIndex]);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/columnSelection.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-even.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-even.js ***! - \************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/flipColumn.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/flipColumn.js ***! + \**********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isEven = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 2 === 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEven);\n//# sourceMappingURL=is-even.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-even.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixFlipColumnView; });\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\nclass MatrixFlipColumnView extends _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(matrix) {\n super(matrix, matrix.rows, matrix.columns);\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(rowIndex, this.columns - columnIndex - 1, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(rowIndex, this.columns - columnIndex - 1);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/flipColumn.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-finite.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-finite.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/flipRow.js": +/*!*******************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/flipRow.js ***! + \*******************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n/**\n * 判断是否为有限数\n * @return {Boolean}\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) && isFinite(value);\n});\n//# sourceMappingURL=is-finite.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-finite.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixFlipRowView; });\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\nclass MatrixFlipRowView extends _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(matrix) {\n super(matrix, matrix.rows, matrix.columns);\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(this.rows - rowIndex - 1, columnIndex, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(this.rows - rowIndex - 1, columnIndex);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/flipRow.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-function.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-function.js ***! - \****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/index.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/index.js ***! + \*****************************************************************************/ +/*! exports provided: MatrixColumnView, MatrixColumnSelectionView, MatrixFlipColumnView, MatrixFlipRowView, MatrixRowView, MatrixRowSelectionView, MatrixSelectionView, MatrixSubView, MatrixTransposeView */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 是否为函数\n * @param {*} fn 对象\n * @return {Boolean} 是否函数\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Function');\n});\n//# sourceMappingURL=is-function.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-function.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./column */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/column.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixColumnView\", function() { return _column__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _columnSelection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./columnSelection */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/columnSelection.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixColumnSelectionView\", function() { return _columnSelection__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _flipColumn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flipColumn */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/flipColumn.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixFlipColumnView\", function() { return _flipColumn__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _flipRow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flipRow */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/flipRow.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixFlipRowView\", function() { return _flipRow__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _row__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./row */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/row.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixRowView\", function() { return _row__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _rowSelection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rowSelection */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/rowSelection.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixRowSelectionView\", function() { return _rowSelection__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/selection.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixSelectionView\", function() { return _selection__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _sub__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sub */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/sub.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixSubView\", function() { return _sub__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _transpose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./transpose */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/transpose.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixTransposeView\", function() { return _transpose__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-integer.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-integer.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/row.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/row.js ***! + \***************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isInteger = Number.isInteger ? Number.isInteger : function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 1 === 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isInteger);\n//# sourceMappingURL=is-integer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-integer.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixRowView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixRowView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkRowIndex\"])(matrix, row);\n super(matrix, 1, matrix.columns);\n this.row = row;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(this.row, columnIndex, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(this.row, columnIndex);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/row.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-match.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-match.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/rowSelection.js": +/*!************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/rowSelection.js ***! + \************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys */ \"./node_modules/@antv/util/esm/keys.js\");\n\n\nfunction isMatch(obj, attrs) {\n var _keys = Object(_keys__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(attrs);\n var length = _keys.length;\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj))\n return !length;\n for (var i = 0; i < length; i += 1) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) {\n return false;\n }\n }\n return true;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (isMatch);\n//# sourceMappingURL=is-match.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-match.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixRowSelectionView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixRowSelectionView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, rowIndices) {\n rowIndices = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkRowIndices\"])(matrix, rowIndices);\n super(matrix, rowIndices.length, matrix.columns);\n this.rowIndices = rowIndices;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(this.rowIndices[rowIndex], columnIndex, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(this.rowIndices[rowIndex], columnIndex);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/rowSelection.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-negative.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-negative.js ***! - \****************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/selection.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/selection.js ***! + \*********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isNegative = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num < 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNegative);\n//# sourceMappingURL=is-negative.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-negative.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixSelectionView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixSelectionView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, rowIndices, columnIndices) {\n let indices = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkIndices\"])(matrix, rowIndices, columnIndices);\n super(matrix, indices.row.length, indices.column.length);\n this.rowIndices = indices.row;\n this.columnIndices = indices.column;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(\n this.rowIndices[rowIndex],\n this.columnIndices[columnIndex],\n value,\n );\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(\n this.rowIndices[rowIndex],\n this.columnIndices[columnIndex],\n );\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/selection.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-nil.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/is-nil.js ***! - \***********************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/sub.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/sub.js ***! + \***************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n// isFinite,\nvar isNil = function (value) {\n /**\n * isNil(null) => true\n * isNil() => true\n */\n return value === null || value === undefined;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNil);\n//# sourceMappingURL=is-nil.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-nil.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixSubView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixSubView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, startRow, endRow, startColumn, endColumn) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkRange\"])(matrix, startRow, endRow, startColumn, endColumn);\n super(matrix, endRow - startRow + 1, endColumn - startColumn + 1);\n this.startRow = startRow;\n this.startColumn = startColumn;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(\n this.startRow + rowIndex,\n this.startColumn + columnIndex,\n value,\n );\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(\n this.startRow + rowIndex,\n this.startColumn + columnIndex,\n );\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/sub.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-null.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-null.js ***! - \************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/views/transpose.js": +/*!*********************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/views/transpose.js ***! + \*********************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar isNull = function (value) {\n return value === null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNull);\n//# sourceMappingURL=is-null.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-null.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixTransposeView; });\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/views/base.js\");\n\n\nclass MatrixTransposeView extends _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(matrix) {\n super(matrix, matrix.columns, matrix.rows);\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(columnIndex, rowIndex, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(columnIndex, rowIndex);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/views/transpose.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-number-equal.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-number-equal.js ***! - \********************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js ***! + \**************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isNumberEqual; });\nvar PRECISION = 0.00001; // numbers less than this is considered as 0\nfunction isNumberEqual(a, b, precision) {\n if (precision === void 0) { precision = PRECISION; }\n return Math.abs((a - b)) < precision;\n}\n;\n//# sourceMappingURL=is-number-equal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-number-equal.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WrapperMatrix1D; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n\n\nclass WrapperMatrix1D extends _matrix__WEBPACK_IMPORTED_MODULE_0__[\"AbstractMatrix\"] {\n constructor(data, options = {}) {\n const { rows = 1 } = options;\n\n if (data.length % rows !== 0) {\n throw new Error('the data length is not divisible by the number of rows');\n }\n super();\n this.rows = rows;\n this.columns = data.length / rows;\n this.data = data;\n }\n\n set(rowIndex, columnIndex, value) {\n let index = this._calculateIndex(rowIndex, columnIndex);\n this.data[index] = value;\n return this;\n }\n\n get(rowIndex, columnIndex) {\n let index = this._calculateIndex(rowIndex, columnIndex);\n return this.data[index];\n }\n\n _calculateIndex(row, column) {\n return row * this.columns + column;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-number.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-number.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js": +/*!**************************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js ***! + \**************************************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 判断是否数字\n * @return {Boolean} 是否数字\n */\n\nvar isNumber = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Number');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNumber);\n//# sourceMappingURL=is-number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-number.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WrapperMatrix2D; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/matrix.js\");\n\n\nclass WrapperMatrix2D extends _matrix__WEBPACK_IMPORTED_MODULE_0__[\"AbstractMatrix\"] {\n constructor(data) {\n super();\n this.data = data;\n this.rows = data.length;\n this.columns = data[0].length;\n }\n\n set(rowIndex, columnIndex, value) {\n this.data[rowIndex][columnIndex] = value;\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.data[rowIndex][columnIndex];\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-object-like.js": -/*!*******************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-object-like.js ***! - \*******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/wrap.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/wrap.js ***! + \***************************************************************************/ +/*! exports provided: wrap */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar isObjectLike = function (value) {\n /**\n * isObjectLike({}) => true\n * isObjectLike([1, 2, 3]) => true\n * isObjectLike(Function) => false\n * isObjectLike(null) => false\n */\n return typeof value === 'object' && value !== null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isObjectLike);\n//# sourceMappingURL=is-object-like.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-object-like.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrap\", function() { return wrap; });\n/* harmony import */ var _WrapperMatrix1D__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./WrapperMatrix1D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js\");\n/* harmony import */ var _WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WrapperMatrix2D */ \"./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\nfunction wrap(array, options) {\n if (Array.isArray(array)) {\n if (array[0] && Array.isArray(array[0])) {\n return new _WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"](array);\n } else {\n return new _WrapperMatrix1D__WEBPACK_IMPORTED_MODULE_0__[\"default\"](array, options);\n }\n } else {\n throw new Error('the argument is not an array');\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/@antv/layout/node_modules/ml-matrix/src/wrap/wrap.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-object.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-object.js ***! - \**************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/matrix-util/esm/ext.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/matrix-util/esm/ext.js ***! + \***************************************************/ +/*! exports provided: leftTranslate, leftRotate, leftScale, transform, direction, angleTo, vertical */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n /**\n * isObject({}) => true\n * isObject([1, 2, 3]) => true\n * isObject(Function) => true\n * isObject(null) => false\n */\n var type = typeof value;\n return value !== null && type === 'object' || type === 'function';\n});\n//# sourceMappingURL=is-object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-object.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftTranslate\", function() { return leftTranslate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftRotate\", function() { return leftRotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftScale\", function() { return leftScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transform\", function() { return transform; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"direction\", function() { return direction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angleTo\", function() { return angleTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vertical\", function() { return vertical; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/**\n * @description 扩展方法,提供 gl-matrix 为提供的方法\n * */\n\nfunction leftTranslate(out, a, v) {\n var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromTranslation(transMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, transMat, a);\n}\nfunction leftRotate(out, a, rad) {\n var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromRotation(rotateMat, rad);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, rotateMat, a);\n}\nfunction leftScale(out, a, v) {\n var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromScaling(scaleMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, scaleMat, a);\n}\nfunction leftMultiply(out, a, a1) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, a1, a);\n}\n/**\n * 根据 actions 来做 transform\n * @param m\n * @param actions\n */\nfunction transform(m, actions) {\n var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0, len = actions.length; i < len; i++) {\n var action = actions[i];\n switch (action[0]) {\n case 't':\n leftTranslate(matrix, matrix, [action[1], action[2]]);\n break;\n case 's':\n leftScale(matrix, matrix, [action[1], action[2]]);\n break;\n case 'r':\n leftRotate(matrix, matrix, action[1]);\n break;\n case 'm':\n leftMultiply(matrix, matrix, action[1]);\n break;\n default:\n break;\n }\n }\n return matrix;\n}\n/**\n * 向量 v1 到 向量 v2 夹角的方向\n * @param {Array} v1 向量\n * @param {Array} v2 向量\n * @return {Boolean} >= 0 顺时针 < 0 逆时针\n */\nfunction direction(v1, v2) {\n return v1[0] * v2[1] - v2[0] * v1[1];\n}\n/**\n * 二维向量 v1 到 v2 的夹角\n * @param v1\n * @param v2\n * @param direct\n */\nfunction angleTo(v1, v2, direct) {\n var ang = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].angle(v1, v2);\n var angleLargeThanPI = direction(v1, v2) >= 0;\n if (direct) {\n if (angleLargeThanPI) {\n return Math.PI * 2 - ang;\n }\n return ang;\n }\n if (angleLargeThanPI) {\n return ang;\n }\n return Math.PI * 2 - ang;\n}\n/**\n * 计算二维向量的垂直向量\n * @param out\n * @param v\n * @param flag\n */\nfunction vertical(out, v, flag) {\n if (flag) {\n out[0] = v[1];\n out[1] = -1 * v[0];\n }\n else {\n out[0] = -1 * v[1];\n out[1] = v[0];\n }\n return out;\n}\n//# sourceMappingURL=ext.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/matrix-util/esm/ext.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-odd.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/is-odd.js ***! - \***********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/matrix-util/esm/index.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/matrix-util/esm/index.js ***! + \*****************************************************/ +/*! exports provided: mat3, vec2, vec3, ext */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isOdd = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 2 !== 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isOdd);\n//# sourceMappingURL=is-odd.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-odd.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mat3\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vec2\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vec3\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"]; });\n\n/* harmony import */ var _ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ext */ \"./node_modules/@antv/matrix-util/esm/ext.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"ext\", function() { return _ext__WEBPACK_IMPORTED_MODULE_1__; });\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/matrix-util/esm/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-plain-object.js": -/*!********************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-plain-object.js ***! - \********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/@antv/matrix-util/lib/ext.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/matrix-util/lib/ext.js ***! + \***************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/util/esm/is-object-like.js\");\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\n\nvar isPlainObject = function (value) {\n /**\n * isObjectLike(new Foo) => false\n * isObjectLike([1, 2, 3]) => false\n * isObjectLike({ x: 0, y: 0 }) => true\n * isObjectLike(Object.create(null)) => true\n */\n if (!Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) || !Object(_is_type__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value, 'Object')) {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n var proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPlainObject);\n//# sourceMappingURL=is-plain-object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-plain-object.js?"); +eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\n/**\n * @description 扩展方法,提供 gl-matrix 为提供的方法\n * */\nvar gl_matrix_1 = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\nfunction leftTranslate(out, a, v) {\n var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix_1.mat3.fromTranslation(transMat, v);\n return gl_matrix_1.mat3.multiply(out, transMat, a);\n}\nexports.leftTranslate = leftTranslate;\nfunction leftRotate(out, a, rad) {\n var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix_1.mat3.fromRotation(rotateMat, rad);\n return gl_matrix_1.mat3.multiply(out, rotateMat, a);\n}\nexports.leftRotate = leftRotate;\nfunction leftScale(out, a, v) {\n var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix_1.mat3.fromScaling(scaleMat, v);\n return gl_matrix_1.mat3.multiply(out, scaleMat, a);\n}\nexports.leftScale = leftScale;\nfunction leftMultiply(out, a, a1) {\n return gl_matrix_1.mat3.multiply(out, a1, a);\n}\n/**\n * 根据 actions 来做 transform\n * @param m\n * @param actions\n */\nfunction transform(m, actions) {\n var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0, len = actions.length; i < len; i++) {\n var action = actions[i];\n switch (action[0]) {\n case 't':\n leftTranslate(matrix, matrix, [action[1], action[2]]);\n break;\n case 's':\n leftScale(matrix, matrix, [action[1], action[2]]);\n break;\n case 'r':\n leftRotate(matrix, matrix, action[1]);\n break;\n case 'm':\n leftMultiply(matrix, matrix, action[1]);\n break;\n default:\n break;\n }\n }\n return matrix;\n}\nexports.transform = transform;\n/**\n * 向量 v1 到 向量 v2 夹角的方向\n * @param {Array} v1 向量\n * @param {Array} v2 向量\n * @return {Boolean} >= 0 顺时针 < 0 逆时针\n */\nfunction direction(v1, v2) {\n return v1[0] * v2[1] - v2[0] * v1[1];\n}\nexports.direction = direction;\n/**\n * 二维向量 v1 到 v2 的夹角\n * @param v1\n * @param v2\n * @param direct\n */\nfunction angleTo(v1, v2, direct) {\n var ang = gl_matrix_1.vec2.angle(v1, v2);\n var angleLargeThanPI = direction(v1, v2) >= 0;\n if (direct) {\n if (angleLargeThanPI) {\n return Math.PI * 2 - ang;\n }\n return ang;\n }\n if (angleLargeThanPI) {\n return ang;\n }\n return Math.PI * 2 - ang;\n}\nexports.angleTo = angleTo;\n/**\n * 计算二维向量的垂直向量\n * @param out\n * @param v\n * @param flag\n */\nfunction vertical(out, v, flag) {\n if (flag) {\n out[0] = v[1];\n out[1] = -1 * v[0];\n }\n else {\n out[0] = -1 * v[1];\n out[1] = v[0];\n }\n return out;\n}\nexports.vertical = vertical;\n//# sourceMappingURL=ext.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/matrix-util/lib/ext.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-positive.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-positive.js ***! - \****************************************************/ +/***/ "./node_modules/@antv/path-util/esm/catmull-rom-2-bezier.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/catmull-rom-2-bezier.js ***! + \******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isPositive = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num > 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPositive);\n//# sourceMappingURL=is-positive.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-positive.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/matrix-util */ \"./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/index.js\");\n\nfunction smoothBezier(points, smooth, isLoop, constraint) {\n var cps = [];\n var hasConstraint = !!constraint;\n var prevPoint;\n var nextPoint;\n var min;\n var max;\n var nextCp0;\n var cp1;\n var cp0;\n if (hasConstraint) {\n min = constraint[0], max = constraint[1];\n for (var i = 0, l = points.length; i < l; i += 1) {\n var point = points[i];\n min = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], min, point);\n max = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], max, point);\n }\n }\n for (var i = 0, len = points.length; i < len; i += 1) {\n var point = points[i];\n if (i === 0 && !isLoop) {\n cp0 = point;\n }\n else if (i === len - 1 && !isLoop) {\n cp1 = point;\n cps.push(cp0);\n cps.push(cp1);\n }\n else {\n var prevIdx = [i ? i - 1 : len - 1, i - 1][isLoop ? 0 : 1];\n prevPoint = points[prevIdx];\n nextPoint = points[isLoop ? (i + 1) % len : i + 1];\n var v = [0, 0];\n v = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].sub(v, nextPoint, prevPoint);\n v = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale(v, v, smooth);\n var d0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].distance(point, prevPoint);\n var d1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].distance(point, nextPoint);\n var sum = d0 + d1;\n if (sum !== 0) {\n d0 /= sum;\n d1 /= sum;\n }\n var v1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], v, -d0);\n var v2 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], v, d1);\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], point, v1);\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], point, v2);\n // 下一个控制点必须在这个点和下一个点之间\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], nextCp0, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], nextPoint, point));\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], nextCp0, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], nextPoint, point));\n // 重新计算 cp1 的值\n v1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].sub([0, 0], nextCp0, point);\n v1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], v1, -d0 / d1);\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], point, v1);\n // 上一个控制点必须要在上一个点和这一个点之间\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], cp1, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], prevPoint, point));\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], cp1, _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], prevPoint, point));\n // 重新计算 nextCp0 的值\n v2 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].sub([0, 0], point, cp1);\n v2 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].scale([0, 0], v2, d1 / d0);\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].add([0, 0], point, v2);\n if (hasConstraint) {\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], cp1, min);\n cp1 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], cp1, max);\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].max([0, 0], nextCp0, min);\n nextCp0 = _antv_matrix_util__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].min([0, 0], nextCp0, max);\n }\n cps.push(cp0);\n cps.push(cp1);\n cp0 = nextCp0;\n }\n }\n if (isLoop) {\n cps.push(cps.shift());\n }\n return cps;\n}\n/**\n * create bezier spline from catmull rom spline\n * @param {Array} crp Catmull Rom Points\n * @param {boolean} z Spline is loop\n * @param {Array} constraint Constraint\n */\nfunction catmullRom2Bezier(crp, z, constraint) {\n if (z === void 0) { z = false; }\n if (constraint === void 0) { constraint = [\n [0, 0],\n [1, 1],\n ]; }\n var isLoop = !!z;\n var pointList = [];\n for (var i = 0, l = crp.length; i < l; i += 2) {\n pointList.push([crp[i], crp[i + 1]]);\n }\n var controlPointList = smoothBezier(pointList, 0.4, isLoop, constraint);\n var len = pointList.length;\n var d1 = [];\n var cp1;\n var cp2;\n var p;\n for (var i = 0; i < len - 1; i += 1) {\n cp1 = controlPointList[i * 2];\n cp2 = controlPointList[i * 2 + 1];\n p = pointList[i + 1];\n d1.push(['C', cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]]);\n }\n if (isLoop) {\n cp1 = controlPointList[len];\n cp2 = controlPointList[len + 1];\n p = pointList[0];\n d1.push(['C', cp1[0], cp1[1], cp2[0], cp2[1], p[0], p[1]]);\n }\n return d1;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (catmullRom2Bezier);\n//# sourceMappingURL=catmull-rom-2-bezier.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/catmull-rom-2-bezier.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-prototype.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-prototype.js ***! - \*****************************************************/ +/***/ "./node_modules/@antv/path-util/esm/fill-path-by-diff.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/fill-path-by-diff.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar objectProto = Object.prototype;\nvar isPrototype = function (value) {\n var Ctor = value && value.constructor;\n var proto = (typeof Ctor === 'function' && Ctor.prototype) || objectProto;\n return value === proto;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPrototype);\n//# sourceMappingURL=is-prototype.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-prototype.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return fillPathByDiff; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nfunction getMinDiff(del, add, modify) {\n var type = null;\n var min = modify;\n if (add < min) {\n min = add;\n type = 'add';\n }\n if (del < min) {\n min = del;\n type = 'del';\n }\n return {\n type: type,\n min: min,\n };\n}\n/*\n * https://en.wikipedia.org/wiki/Levenshtein_distance\n * 计算两条path的编辑距离\n */\nvar levenshteinDistance = function (source, target) {\n var sourceLen = source.length;\n var targetLen = target.length;\n var sourceSegment, targetSegment;\n var temp = 0;\n if (sourceLen === 0 || targetLen === 0) {\n return null;\n }\n var dist = [];\n for (var i = 0; i <= sourceLen; i++) {\n dist[i] = [];\n dist[i][0] = { min: i };\n }\n for (var j = 0; j <= targetLen; j++) {\n dist[0][j] = { min: j };\n }\n for (var i = 1; i <= sourceLen; i++) {\n sourceSegment = source[i - 1];\n for (var j = 1; j <= targetLen; j++) {\n targetSegment = target[j - 1];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isEqual\"])(sourceSegment, targetSegment)) {\n temp = 0;\n }\n else {\n temp = 1;\n }\n var del = dist[i - 1][j].min + 1;\n var add = dist[i][j - 1].min + 1;\n var modify = dist[i - 1][j - 1].min + temp;\n dist[i][j] = getMinDiff(del, add, modify);\n }\n }\n return dist;\n};\nfunction fillPathByDiff(source, target) {\n var diffMatrix = levenshteinDistance(source, target);\n var sourceLen = source.length;\n var targetLen = target.length;\n var changes = [];\n var index = 1;\n var minPos = 1;\n // 如果source和target不是完全不相等\n // @ts-ignore\n if (diffMatrix[sourceLen][targetLen] !== sourceLen) {\n // 获取从source到target所需改动\n for (var i = 1; i <= sourceLen; i++) {\n var min = diffMatrix[i][i].min;\n minPos = i;\n for (var j = index; j <= targetLen; j++) {\n if (diffMatrix[i][j].min < min) {\n min = diffMatrix[i][j].min;\n minPos = j;\n }\n }\n index = minPos;\n if (diffMatrix[i][index].type) {\n changes.push({ index: i - 1, type: diffMatrix[i][index].type });\n }\n }\n // 对source进行增删path\n for (var i = changes.length - 1; i >= 0; i--) {\n index = changes[i].index;\n if (changes[i].type === 'add') {\n // @ts-ignore\n source.splice(index, 0, [].concat(source[index]));\n }\n else {\n // @ts-ignore\n source.splice(index, 1);\n }\n }\n }\n // source尾部补齐\n sourceLen = source.length;\n if (sourceLen < targetLen) {\n for (var i = 0; i < (targetLen - sourceLen); i++) {\n if (source[sourceLen - 1][0] === 'z' || source[sourceLen - 1][0] === 'Z') {\n // @ts-ignore\n source.splice(sourceLen - 2, 0, source[sourceLen - 2]);\n }\n else {\n // @ts-ignore\n source.push(source[sourceLen - 1]);\n }\n }\n }\n return source;\n}\n//# sourceMappingURL=fill-path-by-diff.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/fill-path-by-diff.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-reg-exp.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-reg-exp.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/path-util/esm/fill-path.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/fill-path.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\nvar isRegExp = function (str) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str, 'RegExp');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isRegExp);\n//# sourceMappingURL=is-reg-exp.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-reg-exp.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return fillPath; });\nfunction decasteljau(points, t) {\n var left = [];\n var right = [];\n function recurse(points, t) {\n if (points.length === 1) {\n left.push(points[0]);\n right.push(points[0]);\n }\n else {\n var middlePoints = [];\n for (var i = 0; i < points.length - 1; i++) {\n if (i === 0) {\n left.push(points[0]);\n }\n if (i === points.length - 2) {\n right.push(points[i + 1]);\n }\n middlePoints[i] = [(1 - t) * points[i][0] + t * points[i + 1][0], (1 - t) * points[i][1] + t * points[i + 1][1]];\n }\n recurse(middlePoints, t);\n }\n }\n if (points.length) {\n recurse(points, t);\n }\n return { left: left, right: right.reverse() };\n}\nfunction splitCurve(start, end, count) {\n var points = [[start[1], start[2]]];\n count = count || 2;\n var segments = [];\n if (end[0] === 'A') {\n points.push(end[6]);\n points.push(end[7]);\n }\n else if (end[0] === 'C') {\n points.push([end[1], end[2]]);\n points.push([end[3], end[4]]);\n points.push([end[5], end[6]]);\n }\n else if (end[0] === 'S' || end[0] === 'Q') {\n points.push([end[1], end[2]]);\n points.push([end[3], end[4]]);\n }\n else {\n points.push([end[1], end[2]]);\n }\n var leftSegments = points;\n var t = 1 / count;\n for (var i = 0; i < count - 1; i++) {\n var rt = t / (1 - t * i);\n var split = decasteljau(leftSegments, rt);\n segments.push(split.left);\n leftSegments = split.right;\n }\n segments.push(leftSegments);\n var result = segments.map(function (segment) {\n var cmd = [];\n if (segment.length === 4) {\n cmd.push('C');\n cmd = cmd.concat(segment[2]);\n }\n if (segment.length >= 3) {\n if (segment.length === 3) {\n cmd.push('Q');\n }\n cmd = cmd.concat(segment[1]);\n }\n if (segment.length === 2) {\n cmd.push('L');\n }\n cmd = cmd.concat(segment[segment.length - 1]);\n return cmd;\n });\n return result;\n}\nfunction splitSegment(start, end, count) {\n if (count === 1) {\n return [[].concat(start)];\n }\n var segments = [];\n if (end[0] === 'L' || end[0] === 'C' || end[0] === 'Q') {\n segments = segments.concat(splitCurve(start, end, count));\n }\n else {\n var temp = [].concat(start);\n if (temp[0] === 'M') {\n temp[0] = 'L';\n }\n for (var i = 0; i <= count - 1; i++) {\n segments.push(temp);\n }\n }\n return segments;\n}\nfunction fillPath(source, target) {\n if (source.length === 1) {\n return source;\n }\n var sourceLen = source.length - 1;\n var targetLen = target.length - 1;\n var ratio = sourceLen / targetLen;\n var segmentsToFill = [];\n if (source.length === 1 && source[0][0] === 'M') {\n for (var i = 0; i < targetLen - sourceLen; i++) {\n source.push(source[0]);\n }\n return source;\n }\n for (var i = 0; i < targetLen; i++) {\n var index = Math.floor(ratio * i);\n segmentsToFill[index] = (segmentsToFill[index] || 0) + 1;\n }\n var filled = segmentsToFill.reduce(function (filled, count, i) {\n if (i === sourceLen) {\n return filled.concat(source[sourceLen]);\n }\n return filled.concat(splitSegment(source[i], source[i + 1], count));\n }, []);\n filled.unshift(source[0]);\n if (target[targetLen] === 'Z' || target[targetLen] === 'z') {\n filled.push('Z');\n }\n return filled;\n}\n//# sourceMappingURL=fill-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/fill-path.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-string.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-string.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/path-util/esm/format-path.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/format-path.js ***! + \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (str) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str, 'String');\n});\n//# sourceMappingURL=is-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-string.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return formatPath; });\n/*\n * 抽取pathSegment中的关键点\n * M,L,A,Q,H,V一个端点\n * Q, S抽取一个端点,一个控制点\n * C抽取一个端点,两个控制点\n */\nfunction _getSegmentPoints(segment) {\n var points = [];\n switch (segment[0]) {\n case 'M':\n points.push([segment[1], segment[2]]);\n break;\n case 'L':\n points.push([segment[1], segment[2]]);\n break;\n case 'A':\n points.push([segment[6], segment[7]]);\n break;\n case 'Q':\n points.push([segment[3], segment[4]]);\n points.push([segment[1], segment[2]]);\n break;\n case 'T':\n points.push([segment[1], segment[2]]);\n break;\n case 'C':\n points.push([segment[5], segment[6]]);\n points.push([segment[1], segment[2]]);\n points.push([segment[3], segment[4]]);\n break;\n case 'S':\n points.push([segment[3], segment[4]]);\n points.push([segment[1], segment[2]]);\n break;\n case 'H':\n points.push([segment[1], segment[1]]);\n break;\n case 'V':\n points.push([segment[1], segment[1]]);\n break;\n default:\n }\n return points;\n}\n// 将两个点均分成count个点\nfunction _splitPoints(points, former, count) {\n var result = [].concat(points);\n var index;\n var t = 1 / (count + 1);\n var formerEnd = _getSegmentPoints(former)[0];\n for (var i = 1; i <= count; i++) {\n t *= i;\n index = Math.floor(points.length * t);\n if (index === 0) {\n result.unshift([formerEnd[0] * t + points[index][0] * (1 - t), formerEnd[1] * t + points[index][1] * (1 - t)]);\n }\n else {\n result.splice(index, 0, [formerEnd[0] * t + points[index][0] * (1 - t), formerEnd[1] * t + points[index][1] * (1 - t)]);\n }\n }\n return result;\n}\nfunction formatPath(fromPath, toPath) {\n if (fromPath.length <= 1) {\n return fromPath;\n }\n var points;\n for (var i = 0; i < toPath.length; i++) {\n if (fromPath[i][0] !== toPath[i][0]) {\n // 获取fromPath的pathSegment的端点,根据toPath的指令对其改造\n points = _getSegmentPoints(fromPath[i]);\n switch (toPath[i][0]) {\n case 'M':\n fromPath[i] = ['M'].concat(points[0]);\n break;\n case 'L':\n fromPath[i] = ['L'].concat(points[0]);\n break;\n case 'A':\n fromPath[i] = [].concat(toPath[i]);\n fromPath[i][6] = points[0][0];\n fromPath[i][7] = points[0][1];\n break;\n case 'Q':\n if (points.length < 2) {\n if (i > 0) {\n points = _splitPoints(points, fromPath[i - 1], 1);\n }\n else {\n fromPath[i] = toPath[i];\n break;\n }\n }\n fromPath[i] = ['Q'].concat(points.reduce(function (arr, i) { return arr.concat(i); }, []));\n break;\n case 'T':\n fromPath[i] = ['T'].concat(points[0]);\n break;\n case 'C':\n if (points.length < 3) {\n if (i > 0) {\n points = _splitPoints(points, fromPath[i - 1], 2);\n }\n else {\n fromPath[i] = toPath[i];\n break;\n }\n }\n fromPath[i] = ['C'].concat(points.reduce(function (arr, i) { return arr.concat(i); }, []));\n break;\n case 'S':\n if (points.length < 2) {\n if (i > 0) {\n points = _splitPoints(points, fromPath[i - 1], 1);\n }\n else {\n fromPath[i] = toPath[i];\n break;\n }\n }\n fromPath[i] = ['S'].concat(points.reduce(function (arr, i) { return arr.concat(i); }, []));\n break;\n default:\n fromPath[i] = toPath[i];\n }\n }\n }\n return fromPath;\n}\n//# sourceMappingURL=format-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/format-path.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-type.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-type.js ***! - \************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/path-util/esm/get-arc-params.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/get-arc-params.js ***! + \************************************************************/ +/*! exports provided: isSamePoint, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar toString = {}.toString;\nvar isType = function (value, type) { return toString.call(value) === '[object ' + type + ']'; };\n/* harmony default export */ __webpack_exports__[\"default\"] = (isType);\n//# sourceMappingURL=is-type.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-type.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isSamePoint\", function() { return isSamePoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getArcParams; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n// 向量长度\nfunction vMag(v) {\n return Math.sqrt(v[0] * v[0] + v[1] * v[1]);\n}\n// u.v/|u||v|,计算夹角的余弦值\nfunction vRatio(u, v) {\n // 当存在一个向量的长度为 0 时,夹角也为 0,即夹角的余弦值为 1\n return vMag(u) * vMag(v) ? (u[0] * v[0] + u[1] * v[1]) / (vMag(u) * vMag(v)) : 1;\n}\n// 向量角度\nfunction vAngle(u, v) {\n return (u[0] * v[1] < u[1] * v[0] ? -1 : 1) * Math.acos(vRatio(u, v));\n}\n/**\n * 判断两个点是否重合,点坐标的格式为 [x, y]\n * @param {Array} point1 第一个点\n * @param {Array} point2 第二个点\n */\nfunction isSamePoint(point1, point2) {\n return point1[0] === point2[0] && point1[1] === point2[1];\n}\n// A 0:rx 1:ry 2:x-axis-rotation 3:large-arc-flag 4:sweep-flag 5: x 6: y\nfunction getArcParams(startPoint, params) {\n var rx = params[1];\n var ry = params[2];\n var xRotation = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"mod\"])(Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"toRadian\"])(params[3]), Math.PI * 2);\n var arcFlag = params[4];\n var sweepFlag = params[5];\n // 弧形起点坐标\n var x1 = startPoint[0];\n var y1 = startPoint[1];\n // 弧形终点坐标\n var x2 = params[6];\n var y2 = params[7];\n var xp = (Math.cos(xRotation) * (x1 - x2)) / 2.0 + (Math.sin(xRotation) * (y1 - y2)) / 2.0;\n var yp = (-1 * Math.sin(xRotation) * (x1 - x2)) / 2.0 + (Math.cos(xRotation) * (y1 - y2)) / 2.0;\n var lambda = (xp * xp) / (rx * rx) + (yp * yp) / (ry * ry);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var diff = rx * rx * (yp * yp) + ry * ry * (xp * xp);\n var f = diff ? Math.sqrt((rx * rx * (ry * ry) - diff) / diff) : 1;\n if (arcFlag === sweepFlag) {\n f *= -1;\n }\n if (isNaN(f)) {\n f = 0;\n }\n // 旋转前的起点坐标,且当长半轴和短半轴的长度为 0 时,坐标按 (0, 0) 处理\n var cxp = ry ? (f * rx * yp) / ry : 0;\n var cyp = rx ? (f * -ry * xp) / rx : 0;\n // 椭圆圆心坐标\n var cx = (x1 + x2) / 2.0 + Math.cos(xRotation) * cxp - Math.sin(xRotation) * cyp;\n var cy = (y1 + y2) / 2.0 + Math.sin(xRotation) * cxp + Math.cos(xRotation) * cyp;\n // 起始点的单位向量\n var u = [(xp - cxp) / rx, (yp - cyp) / ry];\n // 终止点的单位向量\n var v = [(-1 * xp - cxp) / rx, (-1 * yp - cyp) / ry];\n // 计算起始点和圆心的连线,与 x 轴正方向的夹角\n var theta = vAngle([1, 0], u);\n // 计算圆弧起始点和终止点与椭圆圆心连线的夹角\n var dTheta = vAngle(u, v);\n if (vRatio(u, v) <= -1) {\n dTheta = Math.PI;\n }\n if (vRatio(u, v) >= 1) {\n dTheta = 0;\n }\n if (sweepFlag === 0 && dTheta > 0) {\n dTheta = dTheta - 2 * Math.PI;\n }\n if (sweepFlag === 1 && dTheta < 0) {\n dTheta = dTheta + 2 * Math.PI;\n }\n return {\n cx: cx,\n cy: cy,\n // 弧形的起点和终点相同时,长轴和短轴的长度按 0 处理\n rx: isSamePoint(startPoint, [x2, y2]) ? 0 : rx,\n ry: isSamePoint(startPoint, [x2, y2]) ? 0 : ry,\n startAngle: theta,\n endAngle: theta + dTheta,\n xRotation: xRotation,\n arcFlag: arcFlag,\n sweepFlag: sweepFlag,\n };\n}\n//# sourceMappingURL=get-arc-params.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/get-arc-params.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/is-undefined.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/util/esm/is-undefined.js ***! - \*****************************************************/ +/***/ "./node_modules/@antv/path-util/esm/get-line-intersect.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/get-line-intersect.js ***! + \****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar isUndefined = function (value) {\n return value === undefined;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isUndefined);\n//# sourceMappingURL=is-undefined.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-undefined.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getLineIntersect; });\nvar isBetween = function (value, min, max) { return value >= min && value <= max; };\nfunction getLineIntersect(p0, p1, p2, p3) {\n var tolerance = 0.001;\n var E = {\n x: p2.x - p0.x,\n y: p2.y - p0.y,\n };\n var D0 = {\n x: p1.x - p0.x,\n y: p1.y - p0.y,\n };\n var D1 = {\n x: p3.x - p2.x,\n y: p3.y - p2.y,\n };\n var kross = D0.x * D1.y - D0.y * D1.x;\n var sqrKross = kross * kross;\n var sqrLen0 = D0.x * D0.x + D0.y * D0.y;\n var sqrLen1 = D1.x * D1.x + D1.y * D1.y;\n var point = null;\n if (sqrKross > tolerance * sqrLen0 * sqrLen1) {\n var s = (E.x * D1.y - E.y * D1.x) / kross;\n var t = (E.x * D0.y - E.y * D0.x) / kross;\n if (isBetween(s, 0, 1) && isBetween(t, 0, 1)) {\n point = {\n x: p0.x + s * D0.x,\n y: p0.y + s * D0.y,\n };\n }\n }\n return point;\n}\n;\n//# sourceMappingURL=get-line-intersect.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/get-line-intersect.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/keys.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/keys.js ***! - \*********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/path-util/esm/index.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/index.js ***! + \***************************************************/ +/*! exports provided: parsePath, catmullRom2Bezier, fillPath, fillPathByDiff, formatPath, pathIntersection, parsePathArray, parsePathString, path2Curve, path2Absolute, reactPath, getArcParams, path2Segments, getLineIntersect, isPolygonsIntersect, isPointInPolygon */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\nvar keys = Object.keys ? function (obj) { return Object.keys(obj); } : function (obj) {\n var result = [];\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (value, key) {\n if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj) && key === 'prototype')) {\n result.push(key);\n }\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (keys);\n//# sourceMappingURL=keys.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/keys.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _parse_path__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse-path */ \"./node_modules/@antv/path-util/esm/parse-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parsePath\", function() { return _parse_path__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _catmull_rom_2_bezier__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./catmull-rom-2-bezier */ \"./node_modules/@antv/path-util/esm/catmull-rom-2-bezier.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"catmullRom2Bezier\", function() { return _catmull_rom_2_bezier__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _fill_path__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./fill-path */ \"./node_modules/@antv/path-util/esm/fill-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fillPath\", function() { return _fill_path__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _fill_path_by_diff__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./fill-path-by-diff */ \"./node_modules/@antv/path-util/esm/fill-path-by-diff.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fillPathByDiff\", function() { return _fill_path_by_diff__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _format_path__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./format-path */ \"./node_modules/@antv/path-util/esm/format-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"formatPath\", function() { return _format_path__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _path_intersection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./path-intersection */ \"./node_modules/@antv/path-util/esm/path-intersection.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pathIntersection\", function() { return _path_intersection__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _parse_path_array__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./parse-path-array */ \"./node_modules/@antv/path-util/esm/parse-path-array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parsePathArray\", function() { return _parse_path_array__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _parse_path_string__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./parse-path-string */ \"./node_modules/@antv/path-util/esm/parse-path-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parsePathString\", function() { return _parse_path_string__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _path_2_curve__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./path-2-curve */ \"./node_modules/@antv/path-util/esm/path-2-curve.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Curve\", function() { return _path_2_curve__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _path_2_absolute__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./path-2-absolute */ \"./node_modules/@antv/path-util/esm/path-2-absolute.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Absolute\", function() { return _path_2_absolute__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _rect_path__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./rect-path */ \"./node_modules/@antv/path-util/esm/rect-path.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"reactPath\", function() { return _rect_path__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _get_arc_params__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./get-arc-params */ \"./node_modules/@antv/path-util/esm/get-arc-params.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getArcParams\", function() { return _get_arc_params__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _path_2_segments__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./path-2-segments */ \"./node_modules/@antv/path-util/esm/path-2-segments.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"path2Segments\", function() { return _path_2_segments__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _get_line_intersect__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./get-line-intersect */ \"./node_modules/@antv/path-util/esm/get-line-intersect.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getLineIntersect\", function() { return _get_line_intersect__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _is_polygons_intersect__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./is-polygons-intersect */ \"./node_modules/@antv/path-util/esm/is-polygons-intersect.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPolygonsIntersect\", function() { return _is_polygons_intersect__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony import */ var _point_in_polygon__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./point-in-polygon */ \"./node_modules/@antv/path-util/esm/point-in-polygon.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPointInPolygon\", function() { return _point_in_polygon__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/last.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/last.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/path-util/esm/is-polygons-intersect.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/is-polygons-intersect.js ***! + \*******************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return last; });\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nfunction last(o) {\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n var arr = o;\n return arr[arr.length - 1];\n }\n return undefined;\n}\n//# sourceMappingURL=last.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/last.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isPolygonsIntersect; });\n/* harmony import */ var _point_in_polygon__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./point-in-polygon */ \"./node_modules/@antv/path-util/esm/point-in-polygon.js\");\n/* harmony import */ var _get_line_intersect__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./get-line-intersect */ \"./node_modules/@antv/path-util/esm/get-line-intersect.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n\n\nfunction parseToLines(points) {\n var lines = [];\n var count = points.length;\n for (var i = 0; i < count - 1; i++) {\n var point = points[i];\n var next = points[i + 1];\n lines.push({\n from: {\n x: point[0],\n y: point[1]\n },\n to: {\n x: next[0],\n y: next[1]\n }\n });\n }\n if (lines.length > 1) {\n var first = points[0];\n var last = points[count - 1];\n lines.push({\n from: {\n x: last[0],\n y: last[1]\n },\n to: {\n x: first[0],\n y: first[1]\n }\n });\n }\n return lines;\n}\nfunction lineIntersectPolygon(lines, line) {\n var isIntersect = false;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(lines, function (l) {\n if (Object(_get_line_intersect__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(l.from, l.to, line.from, line.to)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n}\nfunction getBBox(points) {\n var xArr = points.map(function (p) { return p[0]; });\n var yArr = points.map(function (p) { return p[1]; });\n return {\n minX: Math.min.apply(null, xArr),\n maxX: Math.max.apply(null, xArr),\n minY: Math.min.apply(null, yArr),\n maxY: Math.max.apply(null, yArr)\n };\n}\nfunction intersectBBox(box1, box2) {\n return !(box2.minX > box1.maxX || box2.maxX < box1.minX || box2.minY > box1.maxY || box2.maxY < box1.minY);\n}\nfunction isPolygonsIntersect(points1, points2) {\n // 空数组,或者一个点返回 false\n if (points1.length < 2 || points2.length < 2) {\n return false;\n }\n var bbox1 = getBBox(points1);\n var bbox2 = getBBox(points2);\n // 判定包围盒是否相交,比判定点是否在多边形内要快的多,可以筛选掉大多数情况\n if (!intersectBBox(bbox1, bbox2)) {\n return false;\n }\n var isIn = false;\n // 判定点是否在多边形内部,一旦有一个点在另一个多边形内,则返回\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(points2, function (point) {\n if (Object(_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(points1, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n // 两个多边形都需要判定\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(points1, function (point) {\n if (Object(_point_in_polygon__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(points2, point[0], point[1])) {\n isIn = true;\n return false;\n }\n });\n if (isIn) {\n return true;\n }\n var lines1 = parseToLines(points1);\n var lines2 = parseToLines(points2);\n var isIntersect = false;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_2__[\"each\"])(lines2, function (line) {\n if (lineIntersectPolygon(lines1, line)) {\n isIntersect = true;\n return false;\n }\n });\n return isIntersect;\n}\n//# sourceMappingURL=is-polygons-intersect.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/is-polygons-intersect.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/lower-case.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/lower-case.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/path-util/esm/parse-path-array.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/parse-path-array.js ***! + \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n\nvar lowerCase = function (str) {\n return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str).toLowerCase();\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (lowerCase);\n//# sourceMappingURL=lower-case.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/lower-case.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return parsePathArray; });\nvar p2s = /,?([a-z]),?/gi;\nfunction parsePathArray(path) {\n return path.join(',').replace(p2s, '$1');\n}\n//# sourceMappingURL=parse-path-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/parse-path-array.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/lower-first.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/util/esm/lower-first.js ***! - \****************************************************/ +/***/ "./node_modules/@antv/path-util/esm/parse-path-string.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/parse-path-string.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n\nvar lowerFirst = function (value) {\n var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value);\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (lowerFirst);\n//# sourceMappingURL=lower-first.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/lower-first.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return parsePathString; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar SPACES = '\\x09\\x0a\\x0b\\x0c\\x0d\\x20\\xa0\\u1680\\u180e\\u2000\\u2001\\u2002\\u2003\\u2004\\u2005\\u2006\\u2007\\u2008\\u2009\\u200a\\u202f\\u205f\\u3000\\u2028\\u2029';\nvar PATH_COMMAND = new RegExp('([a-z])[' + SPACES + ',]*((-?\\\\d*\\\\.?\\\\d*(?:e[\\\\-+]?\\\\d+)?[' + SPACES + ']*,?[' + SPACES + ']*)+)', 'ig');\nvar PATH_VALUES = new RegExp('(-?\\\\d*\\\\.?\\\\d*(?:e[\\\\-+]?\\\\d+)?)[' + SPACES + ']*,?[' + SPACES + ']*', 'ig');\n// Parses given path string into an array of arrays of path segments\nfunction parsePathString(pathString) {\n if (!pathString) {\n return null;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(pathString)) {\n return pathString;\n }\n var paramCounts = {\n a: 7,\n c: 6,\n o: 2,\n h: 1,\n l: 2,\n m: 2,\n r: 4,\n q: 4,\n s: 4,\n t: 2,\n v: 1,\n u: 3,\n z: 0,\n };\n var data = [];\n String(pathString).replace(PATH_COMMAND, function (a, b, c) {\n var params = [];\n var name = b.toLowerCase();\n c.replace(PATH_VALUES, function (a, b) {\n b && params.push(+b);\n });\n if (name === 'm' && params.length > 2) {\n data.push([b].concat(params.splice(0, 2)));\n name = 'l';\n b = b === 'm' ? 'l' : 'L';\n }\n if (name === 'o' && params.length === 1) {\n data.push([b, params[0]]);\n }\n if (name === 'r') {\n data.push([b].concat(params));\n }\n else {\n while (params.length >= paramCounts[name]) {\n data.push([b].concat(params.splice(0, paramCounts[name])));\n if (!paramCounts[name]) {\n break;\n }\n }\n }\n return '';\n });\n return data;\n}\n//# sourceMappingURL=parse-path-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/parse-path-string.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/map-values.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/map-values.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/path-util/esm/parse-path.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/parse-path.js ***! + \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/util/esm/is-object.js\");\n\n\nvar identity = function (v) { return v; };\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (object, func) {\n if (func === void 0) { func = identity; }\n var r = {};\n if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(object) && !Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(object)) {\n Object.keys(object).forEach(function (key) {\n // @ts-ignore\n r[key] = func(object[key], key);\n });\n }\n return r;\n});\n//# sourceMappingURL=map-values.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/map-values.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nvar regexTags = /[MLHVQTCSAZ]([^MLHVQTCSAZ]*)/ig;\nvar regexDot = /[^\\s\\,]+/ig;\nfunction parsePath(p) {\n var path = p || [];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(path)) {\n return path;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(path)) {\n path = path.match(regexTags);\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(path, function (item, index) {\n // @ts-ignore\n item = item.match(regexDot);\n if (item[0].length > 1) {\n var tag = item[0].charAt(0);\n // @ts-ignore\n item.splice(1, 0, item[0].substr(1));\n // @ts-ignore\n item[0] = tag;\n }\n // @ts-ignore\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(item, function (sub, i) {\n if (!isNaN(sub)) {\n // @ts-ignore\n item[i] = +sub;\n }\n });\n // @ts-ignore\n path[index] = item;\n });\n return path;\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (parsePath);\n//# sourceMappingURL=parse-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/parse-path.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/map.js": -/*!********************************************!*\ - !*** ./node_modules/@antv/util/esm/map.js ***! - \********************************************/ +/***/ "./node_modules/@antv/path-util/esm/path-2-absolute.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/path-2-absolute.js ***! + \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar map = function (arr, func) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n // @ts-ignore\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n result.push(func(value, index));\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (map);\n//# sourceMappingURL=map.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/map.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pathToAbsolute; });\n/* harmony import */ var _parse_path_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./parse-path-string */ \"./node_modules/@antv/path-util/esm/parse-path-string.js\");\n\nvar REGEX_MD = /[a-z]/;\nfunction toSymmetry(p, c) {\n return [\n c[0] + (c[0] - p[0]),\n c[1] + (c[1] - p[1]),\n ];\n}\nfunction pathToAbsolute(pathString) {\n var pathArray = Object(_parse_path_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(pathString);\n if (!pathArray || !pathArray.length) {\n return [\n ['M', 0, 0],\n ];\n }\n var needProcess = false; // 如果存在小写的命令或者 V,H,T,S 则需要处理\n for (var i = 0; i < pathArray.length; i++) {\n var cmd = pathArray[i][0];\n // 如果存在相对位置的命令,则中断返回\n if (REGEX_MD.test(cmd) || ['V', 'H', 'T', 'S'].indexOf(cmd) >= 0) {\n needProcess = true;\n break;\n }\n }\n // 如果不存在相对命令,则直接返回\n // 如果在业务上都写绝对路径,这种方式最快,仅做了一次检测\n if (!needProcess) {\n return pathArray;\n }\n var res = [];\n var x = 0;\n var y = 0;\n var mx = 0;\n var my = 0;\n var start = 0;\n var pa0;\n var dots;\n var first = pathArray[0];\n if (first[0] === 'M' || first[0] === 'm') {\n x = +first[1];\n y = +first[2];\n mx = x;\n my = y;\n start++;\n res[0] = ['M', x, y];\n }\n for (var i = start, ii = pathArray.length; i < ii; i++) {\n var pa = pathArray[i];\n var preParams = res[i - 1]; // 取前一个已经处理后的节点,否则会出现问题\n var r = [];\n var cmd = pa[0];\n var upCmd = cmd.toUpperCase();\n if (cmd !== upCmd) {\n r[0] = upCmd;\n switch (upCmd) {\n case 'A':\n r[1] = pa[1];\n r[2] = pa[2];\n r[3] = pa[3];\n r[4] = pa[4];\n r[5] = pa[5];\n r[6] = +pa[6] + x;\n r[7] = +pa[7] + y;\n break;\n case 'V':\n r[1] = +pa[1] + y;\n break;\n case 'H':\n r[1] = +pa[1] + x;\n break;\n case 'M':\n mx = +pa[1] + x;\n my = +pa[2] + y;\n r[1] = mx;\n r[2] = my;\n break; // for lint\n default:\n for (var j = 1, jj = pa.length; j < jj; j++) {\n r[j] = +pa[j] + ((j % 2) ? x : y);\n }\n }\n }\n else { // 如果本来已经大写,则不处理\n r = pathArray[i];\n }\n // 需要在外面统一做,同时处理 V,H,S,T 等特殊指令\n switch (upCmd) {\n case 'Z':\n x = +mx;\n y = +my;\n break;\n case 'H':\n x = r[1];\n r = ['L', x, y];\n break;\n case 'V':\n y = r[1];\n r = ['L', x, y];\n break;\n case 'T':\n x = r[1];\n y = r[2];\n // 以 x, y 为中心的,上一个控制点的对称点\n // 需要假设上一个节点的命令为 Q\n var symetricT = toSymmetry([preParams[1], preParams[2]], [preParams[3], preParams[4]]);\n r = ['Q', symetricT[0], symetricT[1], x, y];\n break;\n case 'S':\n x = r[r.length - 2];\n y = r[r.length - 1];\n // 以 x,y 为中心,取上一个控制点,\n // 需要假设上一个线段为 C 或者 S\n var length_1 = preParams.length;\n var symetricS = toSymmetry([preParams[length_1 - 4], preParams[length_1 - 3]], [preParams[length_1 - 2], preParams[length_1 - 1]]);\n r = ['C', symetricS[0], symetricS[1], r[1], r[2], x, y];\n break;\n case 'M':\n mx = r[r.length - 2];\n my = r[r.length - 1];\n break; // for lint\n default:\n x = r[r.length - 2];\n y = r[r.length - 1];\n }\n res.push(r);\n }\n return res;\n}\n//# sourceMappingURL=path-2-absolute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/path-2-absolute.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/max-by.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/max-by.js ***! - \***********************************************/ +/***/ "./node_modules/@antv/path-util/esm/path-2-curve.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/path-2-curve.js ***! + \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr, fn) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n var maxItem;\n var max = -Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(fn) ? fn(item) : item[fn];\n if (v > max) {\n maxItem = item;\n max = v;\n }\n }\n return maxItem;\n});\n//# sourceMappingURL=max-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/max-by.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pathToCurve; });\n/* harmony import */ var _path_2_absolute__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./path-2-absolute */ \"./node_modules/@antv/path-util/esm/path-2-absolute.js\");\n/* harmony import */ var _process_segment_2_cubic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./process/segment-2-cubic */ \"./node_modules/@antv/path-util/esm/process/segment-2-cubic.js\");\n\n\nfunction pathToCurve(path, needZCommandIndexes) {\n if (needZCommandIndexes === void 0) { needZCommandIndexes = false; }\n var pathArray = Object(_path_2_absolute__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(path);\n var params = {\n x1: 0, y1: 0, x2: 0, y2: 0, x: 0, y: 0, qx: null, qy: null,\n };\n var allPathCommands = [];\n var pathCommand = '';\n var ii = pathArray.length;\n var segment;\n var seglen;\n var zCommandIndexes = [];\n for (var i = 0; i < ii; i += 1) {\n if (pathArray[i])\n pathCommand = pathArray[i][0];\n allPathCommands[i] = pathCommand;\n pathArray[i] = Object(_process_segment_2_cubic__WEBPACK_IMPORTED_MODULE_1__[\"segmentToCubic\"])(pathArray[i], params);\n fixArc(pathArray, allPathCommands, i);\n ii = pathArray.length; // solves curveArrays ending in Z\n // keep Z command account for lineJoin\n // @see https://github.com/antvis/util/issues/68\n if (pathCommand === 'Z') {\n zCommandIndexes.push(i);\n }\n segment = pathArray[i];\n seglen = segment.length;\n params.x1 = +segment[seglen - 2];\n params.y1 = +segment[seglen - 1];\n params.x2 = +(segment[seglen - 4]) || params.x1;\n params.y2 = +(segment[seglen - 3]) || params.y1;\n }\n if (needZCommandIndexes) {\n return [pathArray, zCommandIndexes];\n }\n else {\n return pathArray;\n }\n}\nfunction fixArc(pathArray, allPathCommands, i) {\n if (pathArray[i].length > 7) {\n pathArray[i].shift();\n var pi = pathArray[i];\n // const ni = i + 1;\n var ni = i;\n while (pi.length) {\n // if created multiple C:s, their original seg is saved\n allPathCommands[i] = 'A';\n // @ts-ignore\n pathArray.splice(ni += 1, 0, ['C'].concat(pi.splice(0, 6)));\n }\n pathArray.splice(i, 1);\n }\n}\n//# sourceMappingURL=path-2-curve.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/path-2-curve.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/max.js": -/*!********************************************!*\ - !*** ./node_modules/@antv/util/esm/max.js ***! - \********************************************/ +/***/ "./node_modules/@antv/path-util/esm/path-2-segments.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/path-2-segments.js ***! + \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the maximum value.\n * @example\n *\n * max([1, 2]);\n * // => 2\n *\n * max([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * max(data);\n * // => 1250010\n * // Math.max(...data) will encounter \"Maximum call stack size exceeded\" error\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.max(prev, curr);\n }, arr[0]);\n});\n//# sourceMappingURL=max.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/max.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return getSegments; });\n/* harmony import */ var _get_arc_params__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./get-arc-params */ \"./node_modules/@antv/path-util/esm/get-arc-params.js\");\n/* harmony import */ var _parse_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse-path */ \"./node_modules/@antv/path-util/esm/parse-path.js\");\n\n\n\n// 点对称\nfunction toSymmetry(point, center) {\n return [center[0] + (center[0] - point[0]), center[1] + (center[1] - point[1])];\n}\nfunction getSegments(path) {\n path = Object(_parse_path__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(path);\n var segments = [];\n var currentPoint = null; // 当前图形\n var nextParams = null; // 下一节点的 path 参数\n var startMovePoint = null; // 开始 M 的点,可能会有多个\n var lastStartMovePointIndex = 0; // 最近一个开始点 M 的索引\n var count = path.length;\n for (var i = 0; i < count; i++) {\n var params = path[i];\n nextParams = path[i + 1];\n var command = params[0];\n // 数学定义上的参数,便于后面的计算\n var segment = {\n command: command,\n prePoint: currentPoint,\n params: params,\n startTangent: null,\n endTangent: null,\n };\n switch (command) {\n case 'M':\n startMovePoint = [params[1], params[2]];\n lastStartMovePointIndex = i;\n break;\n case 'A':\n var arcParams = Object(_get_arc_params__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(currentPoint, params);\n segment['arcParams'] = arcParams;\n break;\n default:\n break;\n }\n if (command === 'Z') {\n // 有了 Z 后,当前节点从开始 M 的点开始\n currentPoint = startMovePoint;\n // 如果当前点的命令为 Z,相当于当前点为最近一个 M 点,则下一个点直接指向最近一个 M 点的下一个点\n nextParams = path[lastStartMovePointIndex + 1];\n }\n else {\n var len = params.length;\n currentPoint = [params[len - 2], params[len - 1]];\n }\n if (nextParams && nextParams[0] === 'Z') {\n // 如果下一个点的命令为 Z,则下一个点直接指向最近一个 M 点\n nextParams = path[lastStartMovePointIndex];\n if (segments[lastStartMovePointIndex]) {\n // 如果下一个点的命令为 Z,则最近一个 M 点的前一个点为当前点\n segments[lastStartMovePointIndex].prePoint = currentPoint;\n }\n }\n segment['currentPoint'] = currentPoint;\n // 如果当前点与最近一个 M 点相同,则最近一个 M 点的前一个点为当前点的前一个点\n if (segments[lastStartMovePointIndex] &&\n Object(_get_arc_params__WEBPACK_IMPORTED_MODULE_0__[\"isSamePoint\"])(currentPoint, segments[lastStartMovePointIndex].currentPoint)) {\n segments[lastStartMovePointIndex].prePoint = segment.prePoint;\n }\n var nextPoint = nextParams ? [nextParams[nextParams.length - 2], nextParams[nextParams.length - 1]] : null;\n segment['nextPoint'] = nextPoint;\n // Add startTangent and endTangent\n var prePoint = segment.prePoint;\n if (['L', 'H', 'V'].includes(command)) {\n segment.startTangent = [prePoint[0] - currentPoint[0], prePoint[1] - currentPoint[1]];\n segment.endTangent = [currentPoint[0] - prePoint[0], currentPoint[1] - prePoint[1]];\n }\n else if (command === 'Q') {\n // 二次贝塞尔曲线只有一个控制点\n var cp = [params[1], params[2]];\n // 二次贝塞尔曲线的终点为 currentPoint\n segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];\n segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];\n }\n else if (command === 'T') {\n var preSegment = segments[i - 1];\n var cp = toSymmetry(preSegment.currentPoint, prePoint);\n if (preSegment.command === 'Q') {\n segment.command = 'Q';\n segment.startTangent = [prePoint[0] - cp[0], prePoint[1] - cp[1]];\n segment.endTangent = [currentPoint[0] - cp[0], currentPoint[1] - cp[1]];\n }\n else {\n segment.command = 'TL';\n segment.startTangent = [prePoint[0] - currentPoint[0], prePoint[1] - currentPoint[1]];\n segment.endTangent = [currentPoint[0] - prePoint[0], currentPoint[1] - prePoint[1]];\n }\n }\n else if (command === 'C') {\n // 三次贝塞尔曲线有两个控制点\n var cp1 = [params[1], params[2]];\n var cp2 = [params[3], params[4]];\n segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];\n segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];\n // horizontal line, eg. ['C', 100, 100, 100, 100, 200, 200]\n if (segment.startTangent[0] === 0 && segment.startTangent[1] === 0) {\n segment.startTangent = [cp1[0] - cp2[0], cp1[1] - cp2[1]];\n }\n if (segment.endTangent[0] === 0 && segment.endTangent[1] === 0) {\n segment.endTangent = [cp2[0] - cp1[0], cp2[1] - cp1[1]];\n }\n }\n else if (command === 'S') {\n var preSegment = segments[i - 1];\n var cp1 = toSymmetry(preSegment.currentPoint, prePoint);\n var cp2 = [params[1], params[2]];\n if (preSegment.command === 'C') {\n segment.command = 'C'; // 将 S 命令变换为 C 命令\n segment.startTangent = [prePoint[0] - cp1[0], prePoint[1] - cp1[1]];\n segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];\n }\n else {\n segment.command = 'SQ'; // 将 S 命令变换为 SQ 命令\n segment.startTangent = [prePoint[0] - cp2[0], prePoint[1] - cp2[1]];\n segment.endTangent = [currentPoint[0] - cp2[0], currentPoint[1] - cp2[1]];\n }\n }\n else if (command === 'A') {\n var d = 0.001;\n var _a = segment['arcParams'] || {}, _b = _a.cx, cx = _b === void 0 ? 0 : _b, _c = _a.cy, cy = _c === void 0 ? 0 : _c, _d = _a.rx, rx = _d === void 0 ? 0 : _d, _e = _a.ry, ry = _e === void 0 ? 0 : _e, _f = _a.sweepFlag, sweepFlag = _f === void 0 ? 0 : _f, _g = _a.startAngle, startAngle = _g === void 0 ? 0 : _g, _h = _a.endAngle, endAngle = _h === void 0 ? 0 : _h;\n if (sweepFlag === 0) {\n d *= -1;\n }\n var dx1 = rx * Math.cos(startAngle - d) + cx;\n var dy1 = ry * Math.sin(startAngle - d) + cy;\n segment.startTangent = [dx1 - startMovePoint[0], dy1 - startMovePoint[1]];\n var dx2 = rx * Math.cos(startAngle + endAngle + d) + cx;\n var dy2 = ry * Math.sin(startAngle + endAngle - d) + cy;\n segment.endTangent = [prePoint[0] - dx2, prePoint[1] - dy2];\n }\n segments.push(segment);\n }\n return segments;\n}\n//# sourceMappingURL=path-2-segments.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/path-2-segments.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/measure-text-width.js": -/*!***********************************************************!*\ - !*** ./node_modules/@antv/util/esm/measure-text-width.js ***! - \***********************************************************/ +/***/ "./node_modules/@antv/path-util/esm/path-intersection.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/path-intersection.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values */ \"./node_modules/@antv/util/esm/values.js\");\n/* harmony import */ var _memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./memoize */ \"./node_modules/@antv/util/esm/memoize.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n\n\n\nvar ctx;\n/**\n * 计算文本的宽度\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_memoize__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function (text, font) {\n if (font === void 0) { font = {}; }\n var fontSize = font.fontSize, fontFamily = font.fontFamily, fontWeight = font.fontWeight, fontStyle = font.fontStyle, fontVariant = font.fontVariant;\n if (!ctx) {\n ctx = document.createElement('canvas').getContext('2d');\n }\n ctx.font = [fontStyle, fontVariant, fontWeight, fontSize + \"px\", fontFamily].join(' ');\n return ctx.measureText(Object(_is_string__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(text) ? text : '').width;\n}, function (text, font) {\n if (font === void 0) { font = {}; }\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArrays\"])([text], Object(_values__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(font)).join('');\n}));\n//# sourceMappingURL=measure-text-width.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/measure-text-width.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pathIntersection; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _rect_path__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rect-path */ \"./node_modules/@antv/path-util/esm/rect-path.js\");\n/* harmony import */ var _path_2_curve__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./path-2-curve */ \"./node_modules/@antv/path-util/esm/path-2-curve.js\");\n\n\n\nvar base3 = function (t, p1, p2, p3, p4) {\n var t1 = -3 * p1 + 9 * p2 - 9 * p3 + 3 * p4;\n var t2 = t * t1 + 6 * p1 - 12 * p2 + 6 * p3;\n return t * t2 - 3 * p1 + 3 * p2;\n};\nvar bezlen = function (x1, y1, x2, y2, x3, y3, x4, y4, z) {\n if (z === null) {\n z = 1;\n }\n z = z > 1 ? 1 : z < 0 ? 0 : z;\n var z2 = z / 2;\n var n = 12;\n var Tvalues = [-0.1252, 0.1252, -0.3678, 0.3678, -0.5873, 0.5873, -0.7699, 0.7699, -0.9041, 0.9041, -0.9816, 0.9816];\n var Cvalues = [0.2491, 0.2491, 0.2335, 0.2335, 0.2032, 0.2032, 0.1601, 0.1601, 0.1069, 0.1069, 0.0472, 0.0472];\n var sum = 0;\n for (var i = 0; i < n; i++) {\n var ct = z2 * Tvalues[i] + z2;\n var xbase = base3(ct, x1, x2, x3, x4);\n var ybase = base3(ct, y1, y2, y3, y4);\n var comb = xbase * xbase + ybase * ybase;\n sum += Cvalues[i] * Math.sqrt(comb);\n }\n return z2 * sum;\n};\nvar curveDim = function (x0, y0, x1, y1, x2, y2, x3, y3) {\n var tvalues = [];\n var bounds = [\n [],\n [],\n ];\n var a;\n var b;\n var c;\n var t;\n for (var i = 0; i < 2; ++i) {\n if (i === 0) {\n b = 6 * x0 - 12 * x1 + 6 * x2;\n a = -3 * x0 + 9 * x1 - 9 * x2 + 3 * x3;\n c = 3 * x1 - 3 * x0;\n }\n else {\n b = 6 * y0 - 12 * y1 + 6 * y2;\n a = -3 * y0 + 9 * y1 - 9 * y2 + 3 * y3;\n c = 3 * y1 - 3 * y0;\n }\n if (Math.abs(a) < 1e-12) {\n if (Math.abs(b) < 1e-12) {\n continue;\n }\n t = -c / b;\n if (t > 0 && t < 1) {\n tvalues.push(t);\n }\n continue;\n }\n var b2ac = b * b - 4 * c * a;\n var sqrtb2ac = Math.sqrt(b2ac);\n if (b2ac < 0) {\n continue;\n }\n var t1 = (-b + sqrtb2ac) / (2 * a);\n if (t1 > 0 && t1 < 1) {\n tvalues.push(t1);\n }\n var t2 = (-b - sqrtb2ac) / (2 * a);\n if (t2 > 0 && t2 < 1) {\n tvalues.push(t2);\n }\n }\n var j = tvalues.length;\n var jlen = j;\n var mt;\n while (j--) {\n t = tvalues[j];\n mt = 1 - t;\n bounds[0][j] = (mt * mt * mt * x0) + (3 * mt * mt * t * x1) + (3 * mt * t * t * x2) + (t * t * t * x3);\n bounds[1][j] = (mt * mt * mt * y0) + (3 * mt * mt * t * y1) + (3 * mt * t * t * y2) + (t * t * t * y3);\n }\n bounds[0][jlen] = x0;\n bounds[1][jlen] = y0;\n bounds[0][jlen + 1] = x3;\n bounds[1][jlen + 1] = y3;\n bounds[0].length = bounds[1].length = jlen + 2;\n return {\n min: {\n x: Math.min.apply(0, bounds[0]),\n y: Math.min.apply(0, bounds[1]),\n },\n max: {\n x: Math.max.apply(0, bounds[0]),\n y: Math.max.apply(0, bounds[1]),\n },\n };\n};\nvar intersect = function (x1, y1, x2, y2, x3, y3, x4, y4) {\n if (Math.max(x1, x2) < Math.min(x3, x4) ||\n Math.min(x1, x2) > Math.max(x3, x4) ||\n Math.max(y1, y2) < Math.min(y3, y4) ||\n Math.min(y1, y2) > Math.max(y3, y4)) {\n return;\n }\n var nx = (x1 * y2 - y1 * x2) * (x3 - x4) - (x1 - x2) * (x3 * y4 - y3 * x4);\n var ny = (x1 * y2 - y1 * x2) * (y3 - y4) - (y1 - y2) * (x3 * y4 - y3 * x4);\n var denominator = (x1 - x2) * (y3 - y4) - (y1 - y2) * (x3 - x4);\n if (!denominator) {\n return;\n }\n var px = nx / denominator;\n var py = ny / denominator;\n var px2 = +px.toFixed(2);\n var py2 = +py.toFixed(2);\n if (px2 < +Math.min(x1, x2).toFixed(2) ||\n px2 > +Math.max(x1, x2).toFixed(2) ||\n px2 < +Math.min(x3, x4).toFixed(2) ||\n px2 > +Math.max(x3, x4).toFixed(2) ||\n py2 < +Math.min(y1, y2).toFixed(2) ||\n py2 > +Math.max(y1, y2).toFixed(2) ||\n py2 < +Math.min(y3, y4).toFixed(2) ||\n py2 > +Math.max(y3, y4).toFixed(2)) {\n return;\n }\n return {\n x: px,\n y: py,\n };\n};\nvar isPointInsideBBox = function (bbox, x, y) {\n return x >= bbox.x &&\n x <= bbox.x + bbox.width &&\n y >= bbox.y &&\n y <= bbox.y + bbox.height;\n};\nvar box = function (x, y, width, height) {\n if (x === null) {\n x = y = width = height = 0;\n }\n if (y === null) {\n y = x.y;\n width = x.width;\n height = x.height;\n x = x.x;\n }\n return {\n x: x,\n y: y,\n width: width,\n w: width,\n height: height,\n h: height,\n x2: x + width,\n y2: y + height,\n cx: x + width / 2,\n cy: y + height / 2,\n r1: Math.min(width, height) / 2,\n r2: Math.max(width, height) / 2,\n r0: Math.sqrt(width * width + height * height) / 2,\n path: Object(_rect_path__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(x, y, width, height),\n vb: [x, y, width, height].join(' '),\n };\n};\nvar isBBoxIntersect = function (bbox1, bbox2) {\n // @ts-ignore\n bbox1 = box(bbox1);\n // @ts-ignore\n bbox2 = box(bbox2);\n return isPointInsideBBox(bbox2, bbox1.x, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y) || isPointInsideBBox(bbox2, bbox1.x, bbox1.y2) || isPointInsideBBox(bbox2, bbox1.x2, bbox1.y2) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y) || isPointInsideBBox(bbox1, bbox2.x, bbox2.y2) || isPointInsideBBox(bbox1, bbox2.x2, bbox2.y2) || (bbox1.x < bbox2.x2 && bbox1.x > bbox2.x || bbox2.x < bbox1.x2 && bbox2.x > bbox1.x) && (bbox1.y < bbox2.y2 && bbox1.y > bbox2.y || bbox2.y < bbox1.y2 && bbox2.y > bbox1.y);\n};\nvar bezierBBox = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y) {\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isArray\"])(p1x)) {\n p1x = [p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y];\n }\n var bbox = curveDim.apply(null, p1x);\n return box(bbox.min.x, bbox.min.y, bbox.max.x - bbox.min.x, bbox.max.y - bbox.min.y);\n};\nvar findDotsAtSegment = function (p1x, p1y, c1x, c1y, c2x, c2y, p2x, p2y, t) {\n var t1 = 1 - t;\n var t13 = Math.pow(t1, 3);\n var t12 = Math.pow(t1, 2);\n var t2 = t * t;\n var t3 = t2 * t;\n var x = t13 * p1x + t12 * 3 * t * c1x + t1 * 3 * t * t * c2x + t3 * p2x;\n var y = t13 * p1y + t12 * 3 * t * c1y + t1 * 3 * t * t * c2y + t3 * p2y;\n var mx = p1x + 2 * t * (c1x - p1x) + t2 * (c2x - 2 * c1x + p1x);\n var my = p1y + 2 * t * (c1y - p1y) + t2 * (c2y - 2 * c1y + p1y);\n var nx = c1x + 2 * t * (c2x - c1x) + t2 * (p2x - 2 * c2x + c1x);\n var ny = c1y + 2 * t * (c2y - c1y) + t2 * (p2y - 2 * c2y + c1y);\n var ax = t1 * p1x + t * c1x;\n var ay = t1 * p1y + t * c1y;\n var cx = t1 * c2x + t * p2x;\n var cy = t1 * c2y + t * p2y;\n var alpha = (90 - Math.atan2(mx - nx, my - ny) * 180 / Math.PI);\n // (mx > nx || my < ny) && (alpha += 180);\n return {\n x: x,\n y: y,\n m: {\n x: mx,\n y: my,\n },\n n: {\n x: nx,\n y: ny,\n },\n start: {\n x: ax,\n y: ay,\n },\n end: {\n x: cx,\n y: cy,\n },\n alpha: alpha,\n };\n};\nvar interHelper = function (bez1, bez2, justCount) {\n // @ts-ignore\n var bbox1 = bezierBBox(bez1);\n // @ts-ignore\n var bbox2 = bezierBBox(bez2);\n if (!isBBoxIntersect(bbox1, bbox2)) {\n return justCount ? 0 : [];\n }\n var l1 = bezlen.apply(0, bez1);\n var l2 = bezlen.apply(0, bez2);\n var n1 = ~~(l1 / 8);\n var n2 = ~~(l2 / 8);\n var dots1 = [];\n var dots2 = [];\n var xy = {};\n var res = justCount ? 0 : [];\n for (var i = 0; i < n1 + 1; i++) {\n var d = findDotsAtSegment.apply(0, bez1.concat(i / n1));\n dots1.push({\n x: d.x,\n y: d.y,\n t: i / n1,\n });\n }\n for (var i = 0; i < n2 + 1; i++) {\n var d = findDotsAtSegment.apply(0, bez2.concat(i / n2));\n dots2.push({\n x: d.x,\n y: d.y,\n t: i / n2,\n });\n }\n for (var i = 0; i < n1; i++) {\n for (var j = 0; j < n2; j++) {\n var di = dots1[i];\n var di1 = dots1[i + 1];\n var dj = dots2[j];\n var dj1 = dots2[j + 1];\n var ci = Math.abs(di1.x - di.x) < 0.001 ? 'y' : 'x';\n var cj = Math.abs(dj1.x - dj.x) < 0.001 ? 'y' : 'x';\n var is = intersect(di.x, di.y, di1.x, di1.y, dj.x, dj.y, dj1.x, dj1.y);\n if (is) {\n if (xy[is.x.toFixed(4)] === is.y.toFixed(4)) {\n continue;\n }\n xy[is.x.toFixed(4)] = is.y.toFixed(4);\n var t1 = di.t + Math.abs((is[ci] - di[ci]) / (di1[ci] - di[ci])) * (di1.t - di.t);\n var t2 = dj.t + Math.abs((is[cj] - dj[cj]) / (dj1[cj] - dj[cj])) * (dj1.t - dj.t);\n if (t1 >= 0 && t1 <= 1 && t2 >= 0 && t2 <= 1) {\n if (justCount) {\n // @ts-ignore\n res++;\n }\n else {\n // @ts-ignore\n res.push({\n x: is.x,\n y: is.y,\n t1: t1,\n t2: t2,\n });\n }\n }\n }\n }\n }\n return res;\n};\nvar interPathHelper = function (path1, path2, justCount) {\n // @ts-ignore\n path1 = Object(_path_2_curve__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(path1);\n // @ts-ignore\n path2 = Object(_path_2_curve__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(path2);\n var x1;\n var y1;\n var x2;\n var y2;\n var x1m;\n var y1m;\n var x2m;\n var y2m;\n var bez1;\n var bez2;\n var res = justCount ? 0 : [];\n for (var i = 0, ii = path1.length; i < ii; i++) {\n var pi = path1[i];\n if (pi[0] === 'M') {\n x1 = x1m = pi[1];\n y1 = y1m = pi[2];\n }\n else {\n if (pi[0] === 'C') {\n bez1 = [x1, y1].concat(pi.slice(1));\n x1 = bez1[6];\n y1 = bez1[7];\n }\n else {\n bez1 = [x1, y1, x1, y1, x1m, y1m, x1m, y1m];\n x1 = x1m;\n y1 = y1m;\n }\n for (var j = 0, jj = path2.length; j < jj; j++) {\n var pj = path2[j];\n if (pj[0] === 'M') {\n x2 = x2m = pj[1];\n y2 = y2m = pj[2];\n }\n else {\n if (pj[0] === 'C') {\n bez2 = [x2, y2].concat(pj.slice(1));\n x2 = bez2[6];\n y2 = bez2[7];\n }\n else {\n bez2 = [x2, y2, x2, y2, x2m, y2m, x2m, y2m];\n x2 = x2m;\n y2 = y2m;\n }\n var intr = interHelper(bez1, bez2, justCount);\n if (justCount) {\n // @ts-ignore\n res += intr;\n }\n else {\n // @ts-ignore\n for (var k = 0, kk = intr.length; k < kk; k++) {\n intr[k].segment1 = i;\n intr[k].segment2 = j;\n intr[k].bez1 = bez1;\n intr[k].bez2 = bez2;\n }\n // @ts-ignore\n res = res.concat(intr);\n }\n }\n }\n }\n }\n return res;\n};\nfunction pathIntersection(path1, path2) {\n // @ts-ignore\n return interPathHelper(path1, path2);\n}\n//# sourceMappingURL=path-intersection.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/path-intersection.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/memoize.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/memoize.js ***! - \************************************************/ +/***/ "./node_modules/@antv/path-util/esm/point-in-polygon.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/point-in-polygon.js ***! + \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n/**\n * _.memoize(calColor);\n * _.memoize(calColor, (...args) => args[0]);\n * @param f\n * @param resolver\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (f, resolver) {\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(f)) {\n throw new TypeError('Expected a function');\n }\n var memoized = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key\n var key = resolver ? resolver.apply(this, args) : args[0];\n var cache = memoized.cache;\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = f.apply(this, args);\n // 缓存起来\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n});\n//# sourceMappingURL=memoize.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/memoize.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isInPolygon; });\n/**\n * @fileoverview 判断点是否在多边形内\n * @author dxq613@gmail.com\n */\n// 多边形的射线检测,参考:https://blog.csdn.net/WilliamSun0122/article/details/77994526\nvar tolerance = 1e-6;\n// 三态函数,判断两个double在eps精度下的大小关系\nfunction dcmp(x) {\n if (Math.abs(x) < tolerance) {\n return 0;\n }\n return x < 0 ? -1 : 1;\n}\n// 判断点Q是否在p1和p2的线段上\nfunction onSegment(p1, p2, q) {\n if ((q[0] - p1[0]) * (p2[1] - p1[1]) === (p2[0] - p1[0]) * (q[1] - p1[1]) &&\n Math.min(p1[0], p2[0]) <= q[0] &&\n q[0] <= Math.max(p1[0], p2[0]) &&\n Math.min(p1[1], p2[1]) <= q[1] &&\n q[1] <= Math.max(p1[1], p2[1])) {\n return true;\n }\n return false;\n}\n// 判断点P在多边形内-射线法\nfunction isInPolygon(points, x, y) {\n var isHit = false;\n var n = points.length;\n if (n <= 2) {\n // svg 中点小于 3 个时,不显示,也无法被拾取\n return false;\n }\n for (var i = 0; i < n; i++) {\n var p1 = points[i];\n var p2 = points[(i + 1) % n];\n if (onSegment(p1, p2, [x, y])) {\n // 点在多边形一条边上\n return true;\n }\n // 前一个判断min(p1[1],p2[1]) 0 !== dcmp(p2[1] - y) > 0 &&\n dcmp(x - ((y - p1[1]) * (p1[0] - p2[0])) / (p1[1] - p2[1]) - p1[0]) < 0) {\n isHit = !isHit;\n }\n }\n return isHit;\n}\n//# sourceMappingURL=point-in-polygon.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/point-in-polygon.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/min-by.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/min-by.js ***! - \***********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/path-util/esm/process/arc-2-cubic.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/process/arc-2-cubic.js ***! + \*****************************************************************/ +/*! exports provided: arcToCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr, fn) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n var minItem;\n var min = Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(fn) ? fn(item) : item[fn];\n if (v < min) {\n minItem = item;\n min = v;\n }\n }\n return minItem;\n});\n//# sourceMappingURL=min-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/min-by.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"arcToCubic\", function() { return arcToCubic; });\nvar TAU = Math.PI * 2;\nvar mapToEllipse = function (_a, rx, ry, cosphi, sinphi, centerx, centery) {\n var x = _a.x, y = _a.y;\n x *= rx;\n y *= ry;\n var xp = cosphi * x - sinphi * y;\n var yp = sinphi * x + cosphi * y;\n return {\n x: xp + centerx,\n y: yp + centery\n };\n};\nvar approxUnitArc = function (ang1, ang2) {\n // If 90 degree circular arc, use a constant\n // as derived from http://spencermortensen.com/articles/bezier-circle\n var a = ang2 === 1.5707963267948966\n ? 0.551915024494\n : ang2 === -1.5707963267948966\n ? -0.551915024494\n : 4 / 3 * Math.tan(ang2 / 4);\n var x1 = Math.cos(ang1);\n var y1 = Math.sin(ang1);\n var x2 = Math.cos(ang1 + ang2);\n var y2 = Math.sin(ang1 + ang2);\n return [\n {\n x: x1 - y1 * a,\n y: y1 + x1 * a\n },\n {\n x: x2 + y2 * a,\n y: y2 - x2 * a\n },\n {\n x: x2,\n y: y2\n }\n ];\n};\nvar vectorAngle = function (ux, uy, vx, vy) {\n var sign = (ux * vy - uy * vx < 0) ? -1 : 1;\n var dot = ux * vx + uy * vy;\n if (dot > 1) {\n dot = 1;\n }\n if (dot < -1) {\n dot = -1;\n }\n return sign * Math.acos(dot);\n};\nvar getArcCenter = function (px, py, cx, cy, rx, ry, largeArcFlag, sweepFlag, sinphi, cosphi, pxp, pyp) {\n var rxsq = Math.pow(rx, 2);\n var rysq = Math.pow(ry, 2);\n var pxpsq = Math.pow(pxp, 2);\n var pypsq = Math.pow(pyp, 2);\n var radicant = (rxsq * rysq) - (rxsq * pypsq) - (rysq * pxpsq);\n if (radicant < 0) {\n radicant = 0;\n }\n radicant /= (rxsq * pypsq) + (rysq * pxpsq);\n radicant = Math.sqrt(radicant) * (largeArcFlag === sweepFlag ? -1 : 1);\n var centerxp = radicant * rx / ry * pyp;\n var centeryp = radicant * -ry / rx * pxp;\n var centerx = cosphi * centerxp - sinphi * centeryp + (px + cx) / 2;\n var centery = sinphi * centerxp + cosphi * centeryp + (py + cy) / 2;\n var vx1 = (pxp - centerxp) / rx;\n var vy1 = (pyp - centeryp) / ry;\n var vx2 = (-pxp - centerxp) / rx;\n var vy2 = (-pyp - centeryp) / ry;\n var ang1 = vectorAngle(1, 0, vx1, vy1);\n var ang2 = vectorAngle(vx1, vy1, vx2, vy2);\n if (sweepFlag === 0 && ang2 > 0) {\n ang2 -= TAU;\n }\n if (sweepFlag === 1 && ang2 < 0) {\n ang2 += TAU;\n }\n return [centerx, centery, ang1, ang2];\n};\nvar arcToBezier = function (_a) {\n var px = _a.px, py = _a.py, cx = _a.cx, cy = _a.cy, rx = _a.rx, ry = _a.ry, _b = _a.xAxisRotation, xAxisRotation = _b === void 0 ? 0 : _b, _c = _a.largeArcFlag, largeArcFlag = _c === void 0 ? 0 : _c, _d = _a.sweepFlag, sweepFlag = _d === void 0 ? 0 : _d;\n var curves = [];\n if (rx === 0 || ry === 0) {\n return [{ x1: 0, y1: 0, x2: 0, y2: 0, x: cx, y: cy }];\n }\n var sinphi = Math.sin(xAxisRotation * TAU / 360);\n var cosphi = Math.cos(xAxisRotation * TAU / 360);\n var pxp = cosphi * (px - cx) / 2 + sinphi * (py - cy) / 2;\n var pyp = -sinphi * (px - cx) / 2 + cosphi * (py - cy) / 2;\n if (pxp === 0 && pyp === 0) {\n return [{ x1: 0, y1: 0, x2: 0, y2: 0, x: cx, y: cy }];\n }\n rx = Math.abs(rx);\n ry = Math.abs(ry);\n var lambda = Math.pow(pxp, 2) / Math.pow(rx, 2) +\n Math.pow(pyp, 2) / Math.pow(ry, 2);\n if (lambda > 1) {\n rx *= Math.sqrt(lambda);\n ry *= Math.sqrt(lambda);\n }\n var _e = getArcCenter(px, py, cx, cy, rx, ry, largeArcFlag, sweepFlag, sinphi, cosphi, pxp, pyp), centerx = _e[0], centery = _e[1], ang1 = _e[2], ang2 = _e[3];\n // If 'ang2' == 90.0000000001, then `ratio` will evaluate to\n // 1.0000000001. This causes `segments` to be greater than one, which is an\n // unecessary split, and adds extra points to the bezier curve. To alleviate\n // this issue, we round to 1.0 when the ratio is close to 1.0.\n var ratio = Math.abs(ang2) / (TAU / 4);\n if (Math.abs(1.0 - ratio) < 0.0000001) {\n ratio = 1.0;\n }\n var segments = Math.max(Math.ceil(ratio), 1);\n ang2 /= segments;\n for (var i = 0; i < segments; i++) {\n curves.push(approxUnitArc(ang1, ang2));\n ang1 += ang2;\n }\n return curves.map(function (curve) {\n var _a = mapToEllipse(curve[0], rx, ry, cosphi, sinphi, centerx, centery), x1 = _a.x, y1 = _a.y;\n var _b = mapToEllipse(curve[1], rx, ry, cosphi, sinphi, centerx, centery), x2 = _b.x, y2 = _b.y;\n var _c = mapToEllipse(curve[2], rx, ry, cosphi, sinphi, centerx, centery), x = _c.x, y = _c.y;\n return { x1: x1, y1: y1, x2: x2, y2: y2, x: x, y: y };\n });\n};\nfunction arcToCubic(x1, y1, rx, ry, angle, LAF, SF, x2, y2) {\n var curves = arcToBezier({\n px: x1,\n py: y1,\n cx: x2,\n cy: y2,\n rx: rx,\n ry: ry,\n xAxisRotation: angle,\n largeArcFlag: LAF,\n sweepFlag: SF,\n });\n return curves.reduce(function (prev, cur) {\n var x1 = cur.x1, y1 = cur.y1, x2 = cur.x2, y2 = cur.y2, x = cur.x, y = cur.y;\n prev.push(x1, y1, x2, y2, x, y);\n return prev;\n }, []);\n}\n//# sourceMappingURL=arc-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/process/arc-2-cubic.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/min.js": -/*!********************************************!*\ - !*** ./node_modules/@antv/util/esm/min.js ***! - \********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/path-util/esm/process/line-2-cubic.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/process/line-2-cubic.js ***! + \******************************************************************/ +/*! exports provided: lineToCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the minimum value.\n * @example\n *\n * min([1, 2]);\n * // => 1\n *\n * min([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * min(data);\n * // => 1250010\n * // Math.min(...data) will encounter \"Maximum call stack size exceeded\" error\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.min(prev, curr);\n }, arr[0]);\n});\n//# sourceMappingURL=min.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/min.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lineToCubic\", function() { return lineToCubic; });\n// export function getPointAtSegLength(p1x: number, p1y: number, c1x: number, c1y: number, c2x: number, c2y: number, p2x: number, p2y: number, t: number) {\n// const t1 = 1 - t;\n// return {\n// x: (t1 ** 3) * p1x\n// + t1 * t1 * 3 * t * c1x\n// + t1 * 3 * t * t * c2x\n// + (t ** 3) * p2x,\n// y: (t1 ** 3) * p1y\n// + t1 * t1 * 3 * t * c1y\n// + t1 * 3 * t * t * c2y\n// + (t ** 3) * p2y,\n// };\n// }\n// export function midPoint(a: number[], b: number[], t: number) {\n// const ax = a[0];\n// const ay = a[1];\n// const bx = b[0];\n// const by = b[1];\n// return [ax + (bx - ax) * t, ay + (by - ay) * t];\n// }\nfunction lineToCubic(x1, y1, x2, y2) {\n return [x1, y1, x2, y2, x2, y2];\n // const t = 0.5;\n // const p0 = [x1, y1];\n // const p1 = [x2, y2];\n // const p2 = midPoint(p0, p1, t);\n // const p3 = midPoint(p1, p2, t);\n // const p4 = midPoint(p2, p3, t);\n // const p5 = midPoint(p3, p4, t);\n // const p6 = midPoint(p4, p5, t);\n // const cp1 = getPointAtSegLength.apply(0, p0.concat(p2, p4, p6, t));\n // const cp2 = getPointAtSegLength.apply(0, p6.concat(p5, p3, p1, 0));\n // return [cp1.x, cp1.y, cp2.x, cp2.y, x2, y2];\n}\n//# sourceMappingURL=line-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/process/line-2-cubic.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/mix.js": -/*!********************************************!*\ - !*** ./node_modules/@antv/util/esm/mix.js ***! - \********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/path-util/esm/process/quad-2-cubic.js": +/*!******************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/process/quad-2-cubic.js ***! + \******************************************************************/ +/*! exports provided: quadToCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return mix; });\n// FIXME: Mutable param should be forbidden in static lang.\nfunction _mix(dist, obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {\n dist[key] = obj[key];\n }\n }\n}\nfunction mix(dist, src1, src2, src3) {\n if (src1)\n _mix(dist, src1);\n if (src2)\n _mix(dist, src2);\n if (src3)\n _mix(dist, src3);\n return dist;\n}\n//# sourceMappingURL=mix.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/mix.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadToCubic\", function() { return quadToCubic; });\nfunction quadToCubic(x1, y1, qx, qy, x2, y2) {\n var r13 = 1 / 3;\n var r23 = 2 / 3;\n return [\n r13 * x1 + r23 * qx,\n r13 * y1 + r23 * qy,\n r13 * x2 + r23 * qx,\n r13 * y2 + r23 * qy,\n x2, y2, // x,y\n ];\n}\n//# sourceMappingURL=quad-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/process/quad-2-cubic.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/mod.js": -/*!********************************************!*\ - !*** ./node_modules/@antv/util/esm/mod.js ***! - \********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/path-util/esm/process/segment-2-cubic.js": +/*!*********************************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/process/segment-2-cubic.js ***! + \*********************************************************************/ +/*! exports provided: segmentToCubic */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar mod = function (n, m) {\n return ((n % m) + m) % m;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (mod);\n//# sourceMappingURL=mod.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/mod.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"segmentToCubic\", function() { return segmentToCubic; });\n/* harmony import */ var _arc_2_cubic__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./arc-2-cubic */ \"./node_modules/@antv/path-util/esm/process/arc-2-cubic.js\");\n/* harmony import */ var _quad_2_cubic__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quad-2-cubic */ \"./node_modules/@antv/path-util/esm/process/quad-2-cubic.js\");\n/* harmony import */ var _line_2_cubic__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./line-2-cubic */ \"./node_modules/@antv/path-util/esm/process/line-2-cubic.js\");\n\n\n\nfunction segmentToCubic(segment, params) {\n if ('TQ'.indexOf(segment[0]) < 0) {\n params.qx = null;\n params.qy = null;\n }\n var _a = segment.slice(1), s1 = _a[0], s2 = _a[1];\n switch (segment[0]) {\n case 'M':\n params.x = s1;\n params.y = s2;\n return segment;\n case 'A':\n return ['C'].concat(_arc_2_cubic__WEBPACK_IMPORTED_MODULE_0__[\"arcToCubic\"].apply(0, [params.x1, params.y1].concat(segment.slice(1))));\n case 'Q':\n params.qx = s1;\n params.qy = s2;\n return ['C'].concat(_quad_2_cubic__WEBPACK_IMPORTED_MODULE_1__[\"quadToCubic\"].apply(0, [params.x1, params.y1].concat(segment.slice(1))));\n case 'L':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(params.x1, params.y1, segment[1], segment[2]));\n case 'H':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(params.x1, params.y1, segment[1], params.y1));\n case 'V':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(params.x1, params.y1, params.x1, segment[1]));\n case 'Z':\n // @ts-ignore\n return ['C'].concat(Object(_line_2_cubic__WEBPACK_IMPORTED_MODULE_2__[\"lineToCubic\"])(params.x1, params.y1, params.x, params.y));\n default:\n }\n return segment;\n}\n//# sourceMappingURL=segment-2-cubic.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/process/segment-2-cubic.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/noop.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/noop.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/path-util/esm/rect-path.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/path-util/esm/rect-path.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () { });\n//# sourceMappingURL=noop.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/noop.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return rectPath; });\nfunction rectPath(x, y, w, h, r) {\n if (r) {\n return [\n ['M', +x + (+r), y],\n ['l', w - r * 2, 0],\n ['a', r, r, 0, 0, 1, r, r],\n ['l', 0, h - r * 2],\n ['a', r, r, 0, 0, 1, -r, r],\n ['l', r * 2 - w, 0],\n ['a', r, r, 0, 0, 1, -r, -r],\n ['l', 0, r * 2 - h],\n ['a', r, r, 0, 0, 1, r, -r],\n ['z'],\n ];\n }\n return [\n ['M', x, y],\n ['l', w, 0],\n ['l', 0, h],\n ['l', -w, 0],\n ['z'],\n ];\n // res.parsePathArray = parsePathArray;\n}\n//# sourceMappingURL=rect-path.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/esm/rect-path.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/number2color.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/util/esm/number2color.js ***! - \*****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/ext.js": +/*!********************************************************************************!*\ + !*** ./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/ext.js ***! + \********************************************************************************/ +/*! exports provided: leftTranslate, leftRotate, leftScale, transform, direction, angleTo, vertical */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar numColorCache = {};\nfunction numberToColor(num) {\n // 增加缓存\n var color = numColorCache[num];\n if (!color) {\n var str = num.toString(16);\n for (var i = str.length; i < 6; i++) {\n str = '0' + str;\n }\n color = '#' + str;\n numColorCache[num] = color;\n }\n return color;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (numberToColor);\n//# sourceMappingURL=number2color.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/number2color.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftTranslate\", function() { return leftTranslate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftRotate\", function() { return leftRotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"leftScale\", function() { return leftScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transform\", function() { return transform; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"direction\", function() { return direction; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angleTo\", function() { return angleTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"vertical\", function() { return vertical; });\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/**\n * @description 扩展方法,提供 gl-matrix 为提供的方法\n * */\n\nfunction leftTranslate(out, a, v) {\n var transMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromTranslation(transMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, transMat, a);\n}\nfunction leftRotate(out, a, rad) {\n var rotateMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromRotation(rotateMat, rad);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, rotateMat, a);\n}\nfunction leftScale(out, a, v) {\n var scaleMat = [0, 0, 0, 0, 0, 0, 0, 0, 0];\n gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].fromScaling(scaleMat, v);\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, scaleMat, a);\n}\nfunction leftMultiply(out, a, a1) {\n return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"].multiply(out, a1, a);\n}\n/**\n * 根据 actions 来做 transform\n * @param m\n * @param actions\n */\nfunction transform(m, actions) {\n var matrix = m ? [].concat(m) : [1, 0, 0, 0, 1, 0, 0, 0, 1];\n for (var i = 0, len = actions.length; i < len; i++) {\n var action = actions[i];\n switch (action[0]) {\n case 't':\n leftTranslate(matrix, matrix, [action[1], action[2]]);\n break;\n case 's':\n leftScale(matrix, matrix, [action[1], action[2]]);\n break;\n case 'r':\n leftRotate(matrix, matrix, action[1]);\n break;\n case 'm':\n leftMultiply(matrix, matrix, action[1]);\n break;\n default:\n break;\n }\n }\n return matrix;\n}\n/**\n * 向量 v1 到 向量 v2 夹角的方向\n * @param {Array} v1 向量\n * @param {Array} v2 向量\n * @return {Boolean} >= 0 顺时针 < 0 逆时针\n */\nfunction direction(v1, v2) {\n return v1[0] * v2[1] - v2[0] * v1[1];\n}\n/**\n * 二维向量 v1 到 v2 的夹角\n * @param v1\n * @param v2\n * @param direct\n */\nfunction angleTo(v1, v2, direct) {\n var ang = gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"].angle(v1, v2);\n var angleLargeThanPI = direction(v1, v2) >= 0;\n if (direct) {\n if (angleLargeThanPI) {\n return Math.PI * 2 - ang;\n }\n return ang;\n }\n if (angleLargeThanPI) {\n return ang;\n }\n return Math.PI * 2 - ang;\n}\n/**\n * 计算二维向量的垂直向量\n * @param out\n * @param v\n * @param flag\n */\nfunction vertical(out, v, flag) {\n if (flag) {\n out[0] = v[1];\n out[1] = -1 * v[0];\n }\n else {\n out[0] = -1 * v[1];\n out[1] = v[0];\n }\n return out;\n}\n//# sourceMappingURL=ext.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/ext.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/omit.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/omit.js ***! - \*********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/index.js": +/*!**********************************************************************************!*\ + !*** ./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/index.js ***! + \**********************************************************************************/ +/*! exports provided: mat3, vec2, vec3, ext */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ \"./node_modules/@antv/util/esm/reduce.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, keys) {\n return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (r, curr, key) {\n if (!keys.includes(key)) {\n r[key] = curr;\n }\n return r;\n }, {});\n});\n//# sourceMappingURL=omit.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/omit.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var gl_matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! gl-matrix */ \"./node_modules/gl-matrix/esm/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mat3\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"mat3\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vec2\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec2\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"vec3\", function() { return gl_matrix__WEBPACK_IMPORTED_MODULE_0__[\"vec3\"]; });\n\n/* harmony import */ var _ext__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./ext */ \"./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/ext.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"ext\", function() { return _ext__WEBPACK_IMPORTED_MODULE_1__; });\n\n\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/path-util/node_modules/@antv/matrix-util/esm/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/parse-radius.js": -/*!*****************************************************!*\ - !*** ./node_modules/@antv/util/esm/parse-radius.js ***! - \*****************************************************/ +/***/ "./node_modules/@antv/scale/esm/base.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/scale/esm/base.js ***! + \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\nfunction parseRadius(radius) {\n var r1 = 0, r2 = 0, r3 = 0, r4 = 0;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(radius)) {\n if (radius.length === 1) {\n r1 = r2 = r3 = r4 = radius[0];\n }\n else if (radius.length === 2) {\n r1 = r3 = radius[0];\n r2 = r4 = radius[1];\n }\n else if (radius.length === 3) {\n r1 = radius[0];\n r2 = r4 = radius[1];\n r3 = radius[2];\n }\n else {\n r1 = radius[0];\n r2 = radius[1];\n r3 = radius[2];\n r4 = radius[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = radius;\n }\n return {\n r1: r1,\n r2: r2,\n r3: r3,\n r4: r4\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (parseRadius);\n//# sourceMappingURL=parse-radius.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/parse-radius.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _tick_method_register__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./tick-method/register */ \"./node_modules/@antv/scale/esm/tick-method/register.js\");\n\n\nvar Scale = /** @class */ (function () {\n function Scale(cfg) {\n /**\n * 度量的类型\n */\n this.type = 'base';\n /**\n * 是否分类类型的度量\n */\n this.isCategory = false;\n /**\n * 是否线性度量,有linear, time 度量\n */\n this.isLinear = false;\n /**\n * 是否连续类型的度量,linear,time,log, pow, quantile, quantize 都支持\n */\n this.isContinuous = false;\n /**\n * 是否是常量的度量,传入和传出一致\n */\n this.isIdentity = false;\n this.values = [];\n this.range = [0, 1];\n this.ticks = [];\n this.__cfg__ = cfg;\n this.initCfg();\n this.init();\n }\n // 对于原始值的必要转换,如分类、时间字段需转换成数值,用transform/map命名可能更好\n Scale.prototype.translate = function (v) {\n return v;\n };\n /** 重新初始化 */\n Scale.prototype.change = function (cfg) {\n // 覆盖配置项,而不替代\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"assign\"])(this.__cfg__, cfg);\n this.init();\n };\n Scale.prototype.clone = function () {\n return this.constructor(this.__cfg__);\n };\n /** 获取坐标轴需要的ticks */\n Scale.prototype.getTicks = function () {\n var _this = this;\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"map\"])(this.ticks, function (tick, idx) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isObject\"])(tick)) {\n // 仅当符合Tick类型时才有意义\n return tick;\n }\n return {\n text: _this.getText(tick, idx),\n tickValue: tick,\n value: _this.scale(tick),\n };\n });\n };\n /** 获取Tick的格式化结果 */\n Scale.prototype.getText = function (value, key) {\n var formatter = this.formatter;\n var res = formatter ? formatter(value, key) : value;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(res) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(res.toString)) {\n return '';\n }\n return res.toString();\n };\n // 获取配置项中的值,当前 scale 上的值可能会被修改\n Scale.prototype.getConfig = function (key) {\n return this.__cfg__[key];\n };\n // scale初始化\n Scale.prototype.init = function () {\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"assign\"])(this, this.__cfg__);\n this.setDomain();\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isEmpty\"])(this.getConfig('ticks'))) {\n this.ticks = this.calculateTicks();\n }\n };\n // 子类上覆盖某些属性,不能直接在类上声明,否则会被覆盖\n Scale.prototype.initCfg = function () { };\n Scale.prototype.setDomain = function () { };\n Scale.prototype.calculateTicks = function () {\n var tickMethod = this.tickMethod;\n var ticks = [];\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(tickMethod)) {\n var method = Object(_tick_method_register__WEBPACK_IMPORTED_MODULE_1__[\"getTickMethod\"])(tickMethod);\n if (!method) {\n throw new Error('There is no method to to calculate ticks!');\n }\n ticks = method(this);\n }\n else if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isFunction\"])(tickMethod)) {\n ticks = tickMethod(this);\n }\n return ticks;\n };\n // range 的最小值\n Scale.prototype.rangeMin = function () {\n return this.range[0];\n };\n // range 的最大值\n Scale.prototype.rangeMax = function () {\n return this.range[1];\n };\n /** 定义域转 0~1 */\n Scale.prototype.calcPercent = function (value, min, max) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(value)) {\n return (value - min) / (max - min);\n }\n return NaN;\n };\n /** 0~1转定义域 */\n Scale.prototype.calcValue = function (percent, min, max) {\n return min + percent * (max - min);\n };\n return Scale;\n}());\n/* harmony default export */ __webpack_exports__[\"default\"] = (Scale);\n//# sourceMappingURL=base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/base.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/pick.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/pick.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/scale/esm/category/base.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/scale/esm/category/base.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (object, keys) {\n if (object === null || !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(object)) {\n return {};\n }\n var result = {};\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(keys, function (key) {\n if (hasOwnProperty.call(object, key)) {\n result[key] = object[key];\n }\n });\n return result;\n});\n//# sourceMappingURL=pick.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/pick.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/scale/esm/base.js\");\n\n\n\n/**\n * 分类度量\n * @class\n */\nvar Category = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Category, _super);\n function Category() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'cat';\n _this.isCategory = true;\n return _this;\n }\n Category.prototype.buildIndexMap = function () {\n if (!this.translateIndexMap) {\n this.translateIndexMap = new Map();\n // 重新构建缓存\n for (var i = 0; i < this.values.length; i++) {\n this.translateIndexMap.set(this.values[i], i);\n }\n }\n };\n Category.prototype.translate = function (value) {\n // 按需构建 map\n this.buildIndexMap();\n // 找得到\n var idx = this.translateIndexMap.get(value);\n if (idx === undefined) {\n idx = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value) ? value : NaN;\n }\n return idx;\n };\n Category.prototype.scale = function (value) {\n var order = this.translate(value);\n // 分类数据允许 0.5 范围内调整\n // if (order < this.min - 0.5 || order > this.max + 0.5) {\n // return NaN;\n // }\n var percent = this.calcPercent(order, this.min, this.max);\n return this.calcValue(percent, this.rangeMin(), this.rangeMax());\n };\n Category.prototype.invert = function (scaledValue) {\n var domainRange = this.max - this.min;\n var percent = this.calcPercent(scaledValue, this.rangeMin(), this.rangeMax());\n var idx = Math.round(domainRange * percent) + this.min;\n if (idx < this.min || idx > this.max) {\n return NaN;\n }\n return this.values[idx];\n };\n Category.prototype.getText = function (value) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n var v = value;\n // value为index\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value) && !this.values.includes(value)) {\n v = this.values[v];\n }\n return _super.prototype.getText.apply(this, Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArrays\"])([v], args));\n };\n // 复写属性\n Category.prototype.initCfg = function () {\n this.tickMethod = 'cat';\n };\n // 设置 min, max\n Category.prototype.setDomain = function () {\n // 用户有可能设置 min\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.getConfig('min'))) {\n this.min = 0;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.getConfig('max'))) {\n var size = this.values.length;\n this.max = size > 1 ? size - 1 : size;\n }\n // scale.init 的时候清除缓存\n if (this.translateIndexMap) {\n this.translateIndexMap = undefined;\n }\n };\n return Category;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Category);\n//# sourceMappingURL=base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/category/base.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/pull-at.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/pull-at.js ***! - \************************************************/ +/***/ "./node_modules/@antv/scale/esm/category/time.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/scale/esm/category/time.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar splice = Array.prototype.splice;\nvar pullAt = function pullAt(arr, indexes) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return [];\n }\n var length = arr ? indexes.length : 0;\n var last = length - 1;\n while (length--) {\n var previous = void 0;\n var index = indexes[length];\n if (length === last || index !== previous) {\n previous = index;\n splice.call(arr, index, 1);\n }\n }\n return arr;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (pullAt);\n//# sourceMappingURL=pull-at.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/pull-at.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/time */ \"./node_modules/@antv/scale/esm/util/time.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/category/base.js\");\n\n\n\n\n/**\n * 时间分类度量\n * @class\n */\nvar TimeCat = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(TimeCat, _super);\n function TimeCat() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'timeCat';\n return _this;\n }\n /**\n * @override\n */\n TimeCat.prototype.translate = function (value) {\n value = Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"toTimeStamp\"])(value);\n var index = this.values.indexOf(value);\n if (index === -1) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value) && value < this.values.length) {\n index = value;\n }\n else {\n index = NaN;\n }\n }\n return index;\n };\n /**\n * 由于时间类型数据需要转换一下,所以复写 getText\n * @override\n */\n TimeCat.prototype.getText = function (value, tickIndex) {\n var index = this.translate(value);\n if (index > -1) {\n var result = this.values[index];\n var formatter = this.formatter;\n result = formatter ? formatter(result, tickIndex) : Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"timeFormat\"])(result, this.mask);\n return result;\n }\n return value;\n };\n TimeCat.prototype.initCfg = function () {\n this.tickMethod = 'time-cat';\n this.mask = 'YYYY-MM-DD';\n this.tickCount = 7; // 一般时间数据会显示 7, 14, 30 天的数字\n };\n TimeCat.prototype.setDomain = function () {\n var values = this.values;\n // 针对时间分类类型,会将时间统一转换为时间戳\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(values, function (v, i) {\n values[i] = Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"toTimeStamp\"])(v);\n });\n values.sort(function (v1, v2) {\n return v1 - v2;\n });\n _super.prototype.setDomain.call(this);\n };\n return TimeCat;\n}(_base__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (TimeCat);\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/category/time.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/pull.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/pull.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/scale/esm/continuous/base.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/continuous/base.js ***! + \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar arrPrototype = Array.prototype;\nvar splice = arrPrototype.splice;\nvar indexOf = arrPrototype.indexOf;\nvar pull = function (arr) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n var fromIndex = -1;\n while ((fromIndex = indexOf.call(arr, value)) > -1) {\n splice.call(arr, fromIndex, 1);\n }\n }\n return arr;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (pull);\n//# sourceMappingURL=pull.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/pull.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/scale/esm/base.js\");\n\n\n\n/**\n * 连续度量的基类\n * @class\n */\nvar Continuous = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Continuous, _super);\n function Continuous() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.isContinuous = true;\n return _this;\n }\n Continuous.prototype.scale = function (value) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(value)) {\n return NaN;\n }\n var rangeMin = this.rangeMin();\n var rangeMax = this.rangeMax();\n var max = this.max;\n var min = this.min;\n if (max === min) {\n return rangeMin;\n }\n var percent = this.getScalePercent(value);\n return rangeMin + percent * (rangeMax - rangeMin);\n };\n Continuous.prototype.init = function () {\n _super.prototype.init.call(this);\n // init 完成后保证 min, max 包含 ticks 的范围\n var ticks = this.ticks;\n var firstTick = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"head\"])(ticks);\n var lastTick = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"last\"])(ticks);\n if (firstTick < this.min) {\n this.min = firstTick;\n }\n if (lastTick > this.max) {\n this.max = lastTick;\n }\n // strict-limit 方式\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.minLimit)) {\n this.min = firstTick;\n }\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.maxLimit)) {\n this.max = lastTick;\n }\n };\n Continuous.prototype.setDomain = function () {\n var _a = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"getRange\"])(this.values), min = _a.min, max = _a.max;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.min)) {\n this.min = min;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(this.max)) {\n this.max = max;\n }\n if (this.min > this.max) {\n this.min = min;\n this.max = max;\n }\n };\n Continuous.prototype.calculateTicks = function () {\n var _this = this;\n var ticks = _super.prototype.calculateTicks.call(this);\n if (!this.nice) {\n ticks = Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"filter\"])(ticks, function (tick) {\n return tick >= _this.min && tick <= _this.max;\n });\n }\n return ticks;\n };\n // 计算原始值值占的百分比\n Continuous.prototype.getScalePercent = function (value) {\n var max = this.max;\n var min = this.min;\n return (value - min) / (max - min);\n };\n Continuous.prototype.getInvertPercent = function (value) {\n return (value - this.rangeMin()) / (this.rangeMax() - this.rangeMin());\n };\n return Continuous;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Continuous);\n//# sourceMappingURL=base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/base.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/reduce.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/reduce.js ***! - \***********************************************/ +/***/ "./node_modules/@antv/scale/esm/continuous/linear.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/continuous/linear.js ***! + \***********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n\n\n\nvar reduce = function (arr, fn, init) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr) && !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arr)) {\n return arr;\n }\n var result = init;\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr, function (data, i) {\n result = fn(result, data, i);\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (reduce);\n//# sourceMappingURL=reduce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/reduce.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/continuous/base.js\");\n\n\n/**\n * 线性度量\n * @class\n */\nvar Linear = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Linear, _super);\n function Linear() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'linear';\n _this.isLinear = true;\n return _this;\n }\n Linear.prototype.invert = function (value) {\n var percent = this.getInvertPercent(value);\n return this.min + percent * (this.max - this.min);\n };\n Linear.prototype.initCfg = function () {\n this.tickMethod = 'wilkinson-extended';\n this.nice = false;\n };\n return Linear;\n}(_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Linear);\n//# sourceMappingURL=linear.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/linear.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/remove.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/remove.js ***! - \***********************************************/ +/***/ "./node_modules/@antv/scale/esm/continuous/log.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/continuous/log.js ***! + \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n/* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pull-at */ \"./node_modules/@antv/util/esm/pull-at.js\");\n\n\nvar remove = function (arr, predicate) {\n /**\n * const arr = [1, 2, 3, 4]\n * const evens = remove(arr, n => n % 2 == 0)\n * console.log(arr) // => [1, 3]\n * console.log(evens) // => [2, 4]\n */\n var result = [];\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return result;\n }\n var i = -1;\n var indexes = [];\n var length = arr.length;\n while (++i < length) {\n var value = arr[i];\n if (predicate(value, i, arr)) {\n result.push(value);\n indexes.push(i);\n }\n }\n Object(_pull_at__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr, indexes);\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (remove);\n//# sourceMappingURL=remove.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/remove.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/scale/esm/util/math.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/continuous/base.js\");\n\n\n\n/**\n * Log 度量,处理非均匀分布\n */\nvar Log = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Log, _super);\n function Log() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'log';\n return _this;\n }\n /**\n * @override\n */\n Log.prototype.invert = function (value) {\n var base = this.base;\n var max = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, this.max);\n var rangeMin = this.rangeMin();\n var range = this.rangeMax() - rangeMin;\n var min;\n var positiveMin = this.positiveMin;\n if (positiveMin) {\n if (value === 0) {\n return 0;\n }\n min = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, positiveMin / base);\n var appendPercent = (1 / (max - min)) * range; // 0 到 positiveMin的占比\n if (value < appendPercent) {\n // 落到 0 - positiveMin 之间\n return (value / appendPercent) * positiveMin;\n }\n }\n else {\n min = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, this.min);\n }\n var percent = (value - rangeMin) / range;\n var tmp = percent * (max - min) + min;\n return Math.pow(base, tmp);\n };\n Log.prototype.initCfg = function () {\n this.tickMethod = 'log';\n this.base = 10;\n this.tickCount = 6;\n this.nice = true;\n };\n // 设置\n Log.prototype.setDomain = function () {\n _super.prototype.setDomain.call(this);\n var min = this.min;\n if (min < 0) {\n throw new Error('When you use log scale, the minimum value must be greater than zero!');\n }\n if (min === 0) {\n this.positiveMin = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"getLogPositiveMin\"])(this.values, this.base, this.max);\n }\n };\n // 根据当前值获取占比\n Log.prototype.getScalePercent = function (value) {\n var max = this.max;\n var min = this.min;\n if (max === min) {\n return 0;\n }\n // 如果值小于等于0,则按照0处理\n if (value <= 0) {\n return 0;\n }\n var base = this.base;\n var positiveMin = this.positiveMin;\n // 如果min == 0, 则根据比0大的最小值,计算比例关系。这个最小值作为坐标轴上的第二个tick,第一个是0但是不显示\n if (positiveMin) {\n min = (positiveMin * 1) / base;\n }\n var percent;\n // 如果数值小于次小值,那么就计算 value / 次小值 占整体的比例\n if (value < positiveMin) {\n percent = value / positiveMin / (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, max) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, min));\n }\n else {\n percent = (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, value) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, min)) / (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, max) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"log\"])(base, min));\n }\n return percent;\n };\n return Log;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Log);\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/log.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/request-animation-frame.js": -/*!****************************************************************!*\ - !*** ./node_modules/@antv/util/esm/request-animation-frame.js ***! - \****************************************************************/ +/***/ "./node_modules/@antv/scale/esm/continuous/pow.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/continuous/pow.js ***! + \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return requestAnimationFrame; });\nfunction requestAnimationFrame(fn) {\n var method = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n // @ts-ignore\n window.mozRequestAnimationFrame ||\n // @ts-ignore\n window.msRequestAnimationFrame ||\n function (f) {\n return setTimeout(f, 16);\n };\n return method(fn);\n}\n;\n//# sourceMappingURL=request-animation-frame.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/request-animation-frame.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/scale/esm/util/math.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/continuous/base.js\");\n\n\n\n/**\n * Pow 度量,处理非均匀分布\n */\nvar Pow = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Pow, _super);\n function Pow() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'pow';\n return _this;\n }\n /**\n * @override\n */\n Pow.prototype.invert = function (value) {\n var percent = this.getInvertPercent(value);\n var exponent = this.exponent;\n var max = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, this.max);\n var min = Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, this.min);\n var tmp = percent * (max - min) + min;\n var factor = tmp >= 0 ? 1 : -1;\n return Math.pow(tmp, exponent) * factor;\n };\n Pow.prototype.initCfg = function () {\n this.tickMethod = 'pow';\n this.exponent = 2;\n this.tickCount = 5;\n this.nice = true;\n };\n // 获取度量计算时,value占的定义域百分比\n Pow.prototype.getScalePercent = function (value) {\n var max = this.max;\n var min = this.min;\n if (max === min) {\n return 0;\n }\n var exponent = this.exponent;\n var percent = (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, value) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, min)) / (Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, max) - Object(_util_math__WEBPACK_IMPORTED_MODULE_1__[\"calBase\"])(exponent, min));\n return percent;\n };\n return Pow;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Pow);\n//# sourceMappingURL=pow.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/pow.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/set.js": -/*!********************************************!*\ - !*** ./node_modules/@antv/util/esm/set.js ***! - \********************************************/ +/***/ "./node_modules/@antv/scale/esm/continuous/quantile.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/continuous/quantile.js ***! + \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/util/esm/is-object.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\n\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param path\n * @param value\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, path, value) {\n var o = obj;\n var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(path) ? path.split('.') : path;\n keyArr.forEach(function (key, idx) {\n // 不是最后一个\n if (idx < keyArr.length - 1) {\n if (!Object(_is_object__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o[key])) {\n o[key] = Object(_is_number__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(keyArr[idx + 1]) ? [] : {};\n }\n o = o[key];\n }\n else {\n o[key] = value;\n }\n });\n return obj;\n});\n//# sourceMappingURL=set.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/set.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _quantize__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quantize */ \"./node_modules/@antv/scale/esm/continuous/quantize.js\");\n\n\nvar Quantile = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Quantile, _super);\n function Quantile() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'quantile';\n return _this;\n }\n Quantile.prototype.initCfg = function () {\n this.tickMethod = 'quantile';\n this.tickCount = 5;\n this.nice = true;\n };\n return Quantile;\n}(_quantize__WEBPACK_IMPORTED_MODULE_1__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Quantile);\n//# sourceMappingURL=quantile.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/quantile.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/size.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/size.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/scale/esm/continuous/quantize.js": +/*!*************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/continuous/quantize.js ***! + \*************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return size; });\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\n\nfunction size(o) {\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n return 0;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(o)) {\n return o.length;\n }\n return Object.keys(o).length;\n}\n//# sourceMappingURL=size.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/size.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/continuous/base.js\");\n\n\n\n/**\n * 分段度量\n */\nvar Quantize = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Quantize, _super);\n function Quantize() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'quantize';\n return _this;\n }\n Quantize.prototype.invert = function (value) {\n var ticks = this.ticks;\n var length = ticks.length;\n var percent = this.getInvertPercent(value);\n var minIndex = Math.floor(percent * (length - 1));\n // 最后一个\n if (minIndex >= length - 1) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"last\"])(ticks);\n }\n // 超出左边界, 则取第一个\n if (minIndex < 0) {\n return Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"head\"])(ticks);\n }\n var minTick = ticks[minIndex];\n var nextTick = ticks[minIndex + 1];\n // 比当前值小的 tick 在度量上的占比\n var minIndexPercent = minIndex / (length - 1);\n var maxIndexPercent = (minIndex + 1) / (length - 1);\n return minTick + (percent - minIndexPercent) / (maxIndexPercent - minIndexPercent) * (nextTick - minTick);\n };\n Quantize.prototype.initCfg = function () {\n this.tickMethod = 'r-pretty';\n this.tickCount = 5;\n this.nice = true;\n };\n Quantize.prototype.calculateTicks = function () {\n var ticks = _super.prototype.calculateTicks.call(this);\n if (!this.nice) { // 如果 nice = false ,补充 min, max\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"last\"])(ticks) !== this.max) {\n ticks.push(this.max);\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"head\"])(ticks) !== this.min) {\n ticks.unshift(this.min);\n }\n }\n return ticks;\n };\n // 计算当前值在刻度中的占比\n Quantize.prototype.getScalePercent = function (value) {\n var ticks = this.ticks;\n // 超出左边界\n if (value < Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"head\"])(ticks)) {\n return 0;\n }\n // 超出右边界\n if (value > Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"last\"])(ticks)) {\n return 1;\n }\n var minIndex = 0;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(ticks, function (tick, index) {\n if (value >= tick) {\n minIndex = index;\n }\n else {\n return false;\n }\n });\n return minIndex / (ticks.length - 1);\n };\n return Quantize;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Quantize);\n//# sourceMappingURL=quantize.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/quantize.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/some.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/some.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/scale/esm/continuous/time.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/continuous/time.js ***! + \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 只要有一个满足条件就返回 true\n * @param arr\n * @param func\n */\nvar some = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (func(arr[i], i))\n return true;\n }\n return false;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (some);\n//# sourceMappingURL=some.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/some.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/time */ \"./node_modules/@antv/scale/esm/util/time.js\");\n/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./linear */ \"./node_modules/@antv/scale/esm/continuous/linear.js\");\n\n\n\n\n/**\n * 时间度量\n * @class\n */\nvar Time = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Time, _super);\n function Time() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'time';\n return _this;\n }\n /**\n * @override\n */\n Time.prototype.getText = function (value, index) {\n var numberValue = this.translate(value);\n var formatter = this.formatter;\n return formatter ? formatter(numberValue, index) : Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"timeFormat\"])(numberValue, this.mask);\n };\n /**\n * @override\n */\n Time.prototype.scale = function (value) {\n var v = value;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isString\"])(v) || Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isDate\"])(v)) {\n v = this.translate(v);\n }\n return _super.prototype.scale.call(this, v);\n };\n /**\n * 将时间转换成数字\n * @override\n */\n Time.prototype.translate = function (v) {\n return Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"toTimeStamp\"])(v);\n };\n Time.prototype.initCfg = function () {\n this.tickMethod = 'time-pretty';\n this.mask = 'YYYY-MM-DD';\n this.tickCount = 7;\n this.nice = false;\n };\n Time.prototype.setDomain = function () {\n var values = this.values;\n // 是否设置了 min, max,而不是直接取 this.min, this.max\n var minConfig = this.getConfig('min');\n var maxConfig = this.getConfig('max');\n // 如果设置了 min,max 则转换成时间戳\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(minConfig) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(minConfig)) {\n this.min = this.translate(this.min);\n }\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(maxConfig) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(maxConfig)) {\n this.max = this.translate(this.max);\n }\n // 没有设置 min, max 时\n if (values && values.length) {\n // 重新计算最大最小值\n var timeStamps_1 = [];\n var min_1 = Infinity; // 最小值\n var secondMin_1 = min_1; // 次小值\n var max_1 = 0;\n // 使用一个循环,计算min,max,secondMin\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"each\"])(values, function (v) {\n var timeStamp = Object(_util_time__WEBPACK_IMPORTED_MODULE_2__[\"toTimeStamp\"])(v);\n if (isNaN(timeStamp)) {\n throw new TypeError(\"Invalid Time: \" + v + \" in time scale!\");\n }\n if (min_1 > timeStamp) {\n secondMin_1 = min_1;\n min_1 = timeStamp;\n }\n else if (secondMin_1 > timeStamp) {\n secondMin_1 = timeStamp;\n }\n if (max_1 < timeStamp) {\n max_1 = timeStamp;\n }\n timeStamps_1.push(timeStamp);\n });\n // 存在多个值时,设置最小间距\n if (values.length > 1) {\n this.minTickInterval = secondMin_1 - min_1;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(minConfig)) {\n this.min = min_1;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNil\"])(maxConfig)) {\n this.max = max_1;\n }\n }\n };\n return Time;\n}(_linear__WEBPACK_IMPORTED_MODULE_3__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Time);\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/continuous/time.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/sort-by.js": -/*!************************************************!*\ - !*** ./node_modules/@antv/util/esm/sort-by.js ***! - \************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/scale/esm/factory.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/scale/esm/factory.js ***! + \*************************************************/ +/*! exports provided: Scale, getScale, registerScale */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\n\nfunction sortBy(arr, key) {\n var comparer;\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(key)) {\n comparer = function (a, b) { return key(a) - key(b); };\n }\n else {\n var keys_1 = [];\n if (Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(key)) {\n keys_1.push(key);\n }\n else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(key)) {\n keys_1 = key;\n }\n comparer = function (a, b) {\n for (var i = 0; i < keys_1.length; i += 1) {\n var prop = keys_1[i];\n if (a[prop] > b[prop]) {\n return 1;\n }\n if (a[prop] < b[prop]) {\n return -1;\n }\n }\n return 0;\n };\n }\n arr.sort(comparer);\n return arr;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (sortBy);\n//# sourceMappingURL=sort-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/sort-by.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScale\", function() { return getClass; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerScale\", function() { return registerClass; });\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Scale\", function() { return _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n\nvar map = {};\nfunction getClass(key) {\n return map[key];\n}\nfunction registerClass(key, cls) {\n if (getClass(key)) {\n throw new Error(\"type '\" + key + \"' existed.\");\n }\n map[key] = cls;\n}\n\n//# sourceMappingURL=factory.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/factory.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/starts-with.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/util/esm/starts-with.js ***! - \****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/scale/esm/identity/index.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/identity/index.js ***! + \********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n\nfunction startsWith(arr, e) {\n return (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr)) ? arr[0] === e : false;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (startsWith);\n//# sourceMappingURL=starts-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/starts-with.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../base */ \"./node_modules/@antv/scale/esm/base.js\");\n\n\n\n/**\n * identity scale原则上是定义域和值域一致,scale/invert方法也是一致的\n * 参考R的实现:https://github.com/r-lib/scales/blob/master/R/pal-identity.r\n * 参考d3的实现(做了下转型):https://github.com/d3/d3-scale/blob/master/src/identity.js\n */\nvar Identity = /** @class */ (function (_super) {\n Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__extends\"])(Identity, _super);\n function Identity() {\n var _this = _super !== null && _super.apply(this, arguments) || this;\n _this.type = 'identity';\n _this.isIdentity = true;\n return _this;\n }\n Identity.prototype.calculateTicks = function () {\n return this.values;\n };\n Identity.prototype.scale = function (value) {\n // 如果传入的值不等于 identity 的值,则直接返回,用于一维图时的 dodge\n if (this.values[0] !== value && Object(_antv_util__WEBPACK_IMPORTED_MODULE_1__[\"isNumber\"])(value)) {\n return value;\n }\n return this.range[0];\n };\n Identity.prototype.invert = function (value) {\n var range = this.range;\n if (value < range[0] || value > range[1]) {\n return NaN;\n }\n return this.values[0];\n };\n return Identity;\n}(_base__WEBPACK_IMPORTED_MODULE_2__[\"default\"]));\n/* harmony default export */ __webpack_exports__[\"default\"] = (Identity);\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/identity/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/substitute.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/substitute.js ***! - \***************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/scale/esm/index.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/scale/esm/index.js ***! + \***********************************************/ +/*! exports provided: Category, Identity, Linear, Log, Pow, Time, TimeCat, Quantile, Quantize, Scale, getScale, registerScale, getTickMethod, registerTickMethod */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nfunction substitute(str, o) {\n if (!str || !o) {\n return str;\n }\n return str.replace(/\\\\?\\{([^{}]+)\\}/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.slice(1);\n }\n return (o[name] === undefined) ? '' : o[name];\n });\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (substitute);\n//# sourceMappingURL=substitute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/substitute.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/@antv/scale/esm/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Scale\", function() { return _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _category_base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./category/base */ \"./node_modules/@antv/scale/esm/category/base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Category\", function() { return _category_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _category_time__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./category/time */ \"./node_modules/@antv/scale/esm/category/time.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"TimeCat\", function() { return _category_time__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _continuous_linear__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./continuous/linear */ \"./node_modules/@antv/scale/esm/continuous/linear.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Linear\", function() { return _continuous_linear__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _continuous_log__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./continuous/log */ \"./node_modules/@antv/scale/esm/continuous/log.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Log\", function() { return _continuous_log__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _continuous_pow__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./continuous/pow */ \"./node_modules/@antv/scale/esm/continuous/pow.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Pow\", function() { return _continuous_pow__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _continuous_time__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./continuous/time */ \"./node_modules/@antv/scale/esm/continuous/time.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Time\", function() { return _continuous_time__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _continuous_quantize__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./continuous/quantize */ \"./node_modules/@antv/scale/esm/continuous/quantize.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Quantize\", function() { return _continuous_quantize__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _continuous_quantile__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./continuous/quantile */ \"./node_modules/@antv/scale/esm/continuous/quantile.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Quantile\", function() { return _continuous_quantile__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _factory__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./factory */ \"./node_modules/@antv/scale/esm/factory.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getScale\", function() { return _factory__WEBPACK_IMPORTED_MODULE_9__[\"getScale\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerScale\", function() { return _factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"]; });\n\n/* harmony import */ var _identity_index__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./identity/index */ \"./node_modules/@antv/scale/esm/identity/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Identity\", function() { return _identity_index__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _tick_method_index__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./tick-method/index */ \"./node_modules/@antv/scale/esm/tick-method/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTickMethod\", function() { return _tick_method_index__WEBPACK_IMPORTED_MODULE_11__[\"getTickMethod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerTickMethod\", function() { return _tick_method_index__WEBPACK_IMPORTED_MODULE_11__[\"registerTickMethod\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('cat', _category_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('category', _category_base__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('identity', _identity_index__WEBPACK_IMPORTED_MODULE_10__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('linear', _continuous_linear__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('log', _continuous_log__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('pow', _continuous_pow__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('time', _continuous_time__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('timeCat', _category_time__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('quantize', _continuous_quantize__WEBPACK_IMPORTED_MODULE_7__[\"default\"]);\nObject(_factory__WEBPACK_IMPORTED_MODULE_9__[\"registerScale\"])('quantile', _continuous_quantile__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/throttle.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/throttle.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/cat.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/cat.js ***! + \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options)\n options = {};\n var later = function () {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout)\n context = args = null;\n };\n var throttled = function () {\n var now = Date.now();\n if (!previous && options.leading === false)\n previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout)\n context = args = null;\n }\n else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n throttled.cancel = function () {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n return throttled;\n});\n//# sourceMappingURL=throttle.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/throttle.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculateCatTicks; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n/**\n * 计算分类 ticks\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction calculateCatTicks(cfg) {\n var values = cfg.values, tickInterval = cfg.tickInterval, tickCount = cfg.tickCount, showLast = cfg.showLast;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(tickInterval)) {\n var ticks_1 = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"filter\"])(values, function (__, i) { return i % tickInterval === 0; });\n var lastValue = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(values);\n if (showLast && Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks_1) !== lastValue) {\n ticks_1.push(lastValue);\n }\n return ticks_1;\n }\n var len = values.length;\n var min = cfg.min, max = cfg.max;\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(min)) {\n min = 0;\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(max)) {\n max = values.length - 1;\n }\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNumber\"])(tickCount) || tickCount >= len)\n return values.slice(min, max + 1);\n if (tickCount <= 0 || max <= 0)\n return [];\n var interval = tickCount === 1 ? len : Math.floor(len / (tickCount - 1));\n var ticks = [];\n var idx = min;\n for (var i = 0; i < tickCount; i++) {\n if (idx >= max)\n break;\n idx = Math.min(min + i * interval, max);\n if (i === tickCount - 1 && showLast)\n ticks.push(values[max]);\n else\n ticks.push(values[idx]);\n }\n return ticks;\n}\n//# sourceMappingURL=cat.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/cat.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/to-array.js": -/*!*************************************************!*\ - !*** ./node_modules/@antv/util/esm/to-array.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/d3-linear.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/d3-linear.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) ? Array.prototype.slice.call(value) : [];\n});\n//# sourceMappingURL=to-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-array.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return d3LinearTickMethod; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_d3_linear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/d3-linear */ \"./node_modules/@antv/scale/esm/util/d3-linear.js\");\n/* harmony import */ var _util_interval__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/interval */ \"./node_modules/@antv/scale/esm/util/interval.js\");\n/* harmony import */ var _util_strict_limit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/strict-limit */ \"./node_modules/@antv/scale/esm/util/strict-limit.js\");\n\n\n\n\nfunction d3LinearTickMethod(cfg) {\n var min = cfg.min, max = cfg.max, tickInterval = cfg.tickInterval, minLimit = cfg.minLimit, maxLimit = cfg.maxLimit;\n var ticks = Object(_util_d3_linear__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(cfg);\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(minLimit) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(maxLimit)) {\n return Object(_util_strict_limit__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(cfg, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"head\"])(ticks), Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks));\n }\n if (tickInterval) {\n return Object(_util_interval__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(min, max, tickInterval).ticks;\n }\n return ticks;\n}\n//# sourceMappingURL=d3-linear.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/d3-linear.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/to-degree.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/to-degree.js ***! - \**************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/scale/esm/tick-method/index.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/index.js ***! + \***********************************************************/ +/*! exports provided: getTickMethod, registerTickMethod */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar DEGREE = 180 / Math.PI;\nvar toDegree = function (radian) {\n return DEGREE * radian;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (toDegree);\n//# sourceMappingURL=to-degree.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-degree.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _cat__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./cat */ \"./node_modules/@antv/scale/esm/tick-method/cat.js\");\n/* harmony import */ var _d3_linear__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./d3-linear */ \"./node_modules/@antv/scale/esm/tick-method/d3-linear.js\");\n/* harmony import */ var _linear__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./linear */ \"./node_modules/@antv/scale/esm/tick-method/linear.js\");\n/* harmony import */ var _log__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./log */ \"./node_modules/@antv/scale/esm/tick-method/log.js\");\n/* harmony import */ var _pow__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./pow */ \"./node_modules/@antv/scale/esm/tick-method/pow.js\");\n/* harmony import */ var _quantile__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quantile */ \"./node_modules/@antv/scale/esm/tick-method/quantile.js\");\n/* harmony import */ var _r_prettry__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./r-prettry */ \"./node_modules/@antv/scale/esm/tick-method/r-prettry.js\");\n/* harmony import */ var _register__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./register */ \"./node_modules/@antv/scale/esm/tick-method/register.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getTickMethod\", function() { return _register__WEBPACK_IMPORTED_MODULE_7__[\"getTickMethod\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"registerTickMethod\", function() { return _register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"]; });\n\n/* harmony import */ var _time__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./time */ \"./node_modules/@antv/scale/esm/tick-method/time.js\");\n/* harmony import */ var _time_cat__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./time-cat */ \"./node_modules/@antv/scale/esm/tick-method/time-cat.js\");\n/* harmony import */ var _time_pretty__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./time-pretty */ \"./node_modules/@antv/scale/esm/tick-method/time-pretty.js\");\n\n\n\n\n\n\n\n\n\n\n\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('cat', _cat__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('time-cat', _time_cat__WEBPACK_IMPORTED_MODULE_9__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('wilkinson-extended', _linear__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('r-pretty', _r_prettry__WEBPACK_IMPORTED_MODULE_6__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('time', _time__WEBPACK_IMPORTED_MODULE_8__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('time-pretty', _time_pretty__WEBPACK_IMPORTED_MODULE_10__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('log', _log__WEBPACK_IMPORTED_MODULE_3__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('pow', _pow__WEBPACK_IMPORTED_MODULE_4__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('quantile', _quantile__WEBPACK_IMPORTED_MODULE_5__[\"default\"]);\nObject(_register__WEBPACK_IMPORTED_MODULE_7__[\"registerTickMethod\"])('d3-linear', _d3_linear__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/index.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/to-integer.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/to-integer.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/linear.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/linear.js ***! + \************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (parseInt);\n//# sourceMappingURL=to-integer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-integer.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return linear; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_extended__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/extended */ \"./node_modules/@antv/scale/esm/util/extended.js\");\n/* harmony import */ var _util_interval__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/interval */ \"./node_modules/@antv/scale/esm/util/interval.js\");\n/* harmony import */ var _util_strict_limit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/strict-limit */ \"./node_modules/@antv/scale/esm/util/strict-limit.js\");\n\n\n\n\n/**\n * 计算线性的 ticks,使用 wilkinson extended 方法\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction linear(cfg) {\n var min = cfg.min, max = cfg.max, tickCount = cfg.tickCount, nice = cfg.nice, tickInterval = cfg.tickInterval, minLimit = cfg.minLimit, maxLimit = cfg.maxLimit;\n var ticks = Object(_util_extended__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(min, max, tickCount, nice).ticks;\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(minLimit) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(maxLimit)) {\n return Object(_util_strict_limit__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(cfg, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"head\"])(ticks), Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks));\n }\n if (tickInterval) {\n return Object(_util_interval__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(min, max, tickInterval).ticks;\n }\n return ticks;\n}\n//# sourceMappingURL=linear.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/linear.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/to-radian.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/to-radian.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/log.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/log.js ***! + \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar RADIAN = Math.PI / 180;\nvar toRadian = function (degree) {\n return RADIAN * degree;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (toRadian);\n//# sourceMappingURL=to-radian.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-radian.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculateLogTicks; });\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/scale/esm/util/math.js\");\n\n/**\n * 计算 log 的 ticks,考虑 min = 0 的场景\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction calculateLogTicks(cfg) {\n var base = cfg.base, tickCount = cfg.tickCount, min = cfg.min, max = cfg.max, values = cfg.values;\n var minTick;\n var maxTick = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"log\"])(base, max);\n if (min > 0) {\n minTick = Math.floor(Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"log\"])(base, min));\n }\n else {\n var positiveMin = Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"getLogPositiveMin\"])(values, base, max);\n minTick = Math.floor(Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"log\"])(base, positiveMin));\n }\n var count = maxTick - minTick;\n var avg = Math.ceil(count / tickCount);\n var ticks = [];\n for (var i = minTick; i < maxTick + avg; i = i + avg) {\n ticks.push(Math.pow(base, i));\n }\n if (min <= 0) {\n // 最小值 <= 0 时显示 0\n ticks.unshift(0);\n }\n return ticks;\n}\n//# sourceMappingURL=log.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/log.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/to-string.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/to-string.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/pow.js": +/*!*********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/pow.js ***! + \*********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value))\n return '';\n return value.toString();\n});\n//# sourceMappingURL=to-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-string.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculatePowTicks; });\n/* harmony import */ var _util_math__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/math */ \"./node_modules/@antv/scale/esm/util/math.js\");\n/* harmony import */ var _util_pretty__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/pretty */ \"./node_modules/@antv/scale/esm/util/pretty.js\");\n\n\n/**\n * 计算 Pow 的 ticks\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction calculatePowTicks(cfg) {\n var exponent = cfg.exponent, tickCount = cfg.tickCount;\n var max = Math.ceil(Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"calBase\"])(exponent, cfg.max));\n var min = Math.floor(Object(_util_math__WEBPACK_IMPORTED_MODULE_0__[\"calBase\"])(exponent, cfg.min));\n var ticks = Object(_util_pretty__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(min, max, tickCount).ticks;\n return ticks.map(function (tick) {\n var factor = tick >= 0 ? 1 : -1;\n return Math.pow(tick, exponent) * factor;\n });\n}\n//# sourceMappingURL=pow.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/pow.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/union.js": -/*!**********************************************!*\ - !*** ./node_modules/@antv/util/esm/union.js ***! - \**********************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/quantile.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/quantile.js ***! + \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uniq */ \"./node_modules/@antv/util/esm/uniq.js\");\n\nvar union = function () {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n return Object(_uniq__WEBPACK_IMPORTED_MODULE_0__[\"default\"])([].concat.apply([], sources));\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (union);\n//# sourceMappingURL=union.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/union.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculateTicks; });\n/**\n * 计算几分位 https://github.com/simple-statistics/simple-statistics/blob/master/src/quantile_sorted.js\n * @param x 数组\n * @param p 百分比\n */\nfunction quantileSorted(x, p) {\n var idx = x.length * p;\n /*if (x.length === 0) { // 当前场景这些条件不可能命中\n throw new Error('quantile requires at least one value.');\n } else if (p < 0 || p > 1) {\n throw new Error('quantiles must be between 0 and 1');\n } else */\n if (p === 1) {\n // If p is 1, directly return the last element\n return x[x.length - 1];\n }\n else if (p === 0) {\n // If p is 0, directly return the first element\n return x[0];\n }\n else if (idx % 1 !== 0) {\n // If p is not integer, return the next element in array\n return x[Math.ceil(idx) - 1];\n }\n else if (x.length % 2 === 0) {\n // If the list has even-length, we'll take the average of this number\n // and the next value, if there is one\n return (x[idx - 1] + x[idx]) / 2;\n }\n else {\n // Finally, in the simple case of an integer value\n // with an odd-length list, return the x value at the index.\n return x[idx];\n }\n}\nfunction calculateTicks(cfg) {\n var tickCount = cfg.tickCount, values = cfg.values;\n if (!values || !values.length) {\n return [];\n }\n var sorted = values.slice().sort(function (a, b) {\n return a - b;\n });\n var ticks = [];\n for (var i = 0; i < tickCount; i++) {\n var p = i / (tickCount - 1);\n ticks.push(quantileSorted(sorted, p));\n }\n return ticks;\n}\n//# sourceMappingURL=quantile.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/quantile.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/uniq.js": -/*!*********************************************!*\ - !*** ./node_modules/@antv/util/esm/uniq.js ***! - \*********************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/r-prettry.js": +/*!***************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/r-prettry.js ***! + \***************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return uniq; });\nfunction uniq(arr, cache) {\n if (cache === void 0) { cache = new Map(); }\n var r = [];\n if (Array.isArray(arr)) {\n for (var i = 0, len = arr.length; i < len; i++) {\n var item = arr[i];\n // 加一个 cache,提升性能\n if (!cache.has(item)) {\n r.push(item);\n cache.set(item, true);\n }\n }\n }\n return r;\n}\n//# sourceMappingURL=uniq.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/uniq.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return linearPretty; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _util_interval__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../util/interval */ \"./node_modules/@antv/scale/esm/util/interval.js\");\n/* harmony import */ var _util_pretty__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../util/pretty */ \"./node_modules/@antv/scale/esm/util/pretty.js\");\n/* harmony import */ var _util_strict_limit__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ../util/strict-limit */ \"./node_modules/@antv/scale/esm/util/strict-limit.js\");\n\n\n\n\n/**\n * 计算线性的 ticks,使用 R's pretty 方法\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction linearPretty(cfg) {\n var min = cfg.min, max = cfg.max, tickCount = cfg.tickCount, tickInterval = cfg.tickInterval, minLimit = cfg.minLimit, maxLimit = cfg.maxLimit;\n var ticks = Object(_util_pretty__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(min, max, tickCount).ticks;\n if (!Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(minLimit) || !Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(maxLimit)) {\n return Object(_util_strict_limit__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(cfg, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"head\"])(ticks), Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks));\n }\n if (tickInterval) {\n return Object(_util_interval__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(min, max, tickInterval).ticks;\n }\n return ticks;\n}\n//# sourceMappingURL=r-prettry.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/r-prettry.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/unique-id.js": -/*!**************************************************!*\ - !*** ./node_modules/@antv/util/esm/unique-id.js ***! - \**************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/scale/esm/tick-method/register.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/register.js ***! + \**************************************************************/ +/*! exports provided: getTickMethod, registerTickMethod */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar map = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (prefix) {\n prefix = prefix || 'g';\n if (!map[prefix]) {\n map[prefix] = 1;\n }\n else {\n map[prefix] += 1;\n }\n return prefix + map[prefix];\n});\n//# sourceMappingURL=unique-id.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/unique-id.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTickMethod\", function() { return getTickMethod; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"registerTickMethod\", function() { return registerTickMethod; });\nvar methodCache = {};\n/**\n * 获取计算 ticks 的方法\n * @param key 键值\n * @returns 计算 ticks 的方法\n */\nfunction getTickMethod(key) {\n return methodCache[key];\n}\n/**\n * 注册计算 ticks 的方法\n * @param key 键值\n * @param method 方法\n */\nfunction registerTickMethod(key, method) {\n methodCache[key] = method;\n}\n//# sourceMappingURL=register.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/register.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/upper-case.js": -/*!***************************************************!*\ - !*** ./node_modules/@antv/util/esm/upper-case.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/time-cat.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/time-cat.js ***! + \**************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n\nvar upperCase = function (str) {\n return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str).toUpperCase();\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (upperCase);\n//# sourceMappingURL=upper-case.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/upper-case.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return timeCat; });\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _cat__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./cat */ \"./node_modules/@antv/scale/esm/tick-method/cat.js\");\n\n\n/**\n * 计算时间分类的 ticks, 保头,保尾\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction timeCat(cfg) {\n // 默认保留最后一条\n var ticks = Object(_cat__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__assign\"])({ showLast: true }, cfg));\n return ticks;\n}\n//# sourceMappingURL=time-cat.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/time-cat.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/upper-first.js": -/*!****************************************************!*\ - !*** ./node_modules/@antv/util/esm/upper-first.js ***! - \****************************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/time-pretty.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/time-pretty.js ***! + \*****************************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n\nvar upperFirst = function (value) {\n var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value);\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (upperFirst);\n//# sourceMappingURL=upper-first.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/upper-first.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return timePretty; });\n/* harmony import */ var _util_time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/time */ \"./node_modules/@antv/scale/esm/util/time.js\");\n\nfunction getYear(date) {\n return new Date(date).getFullYear();\n}\nfunction createYear(year) {\n return new Date(year, 0, 1).getTime();\n}\nfunction getMonth(date) {\n return new Date(date).getMonth();\n}\nfunction diffMonth(min, max) {\n var minYear = getYear(min);\n var maxYear = getYear(max);\n var minMonth = getMonth(min);\n var maxMonth = getMonth(max);\n return (maxYear - minYear) * 12 + ((maxMonth - minMonth) % 12);\n}\nfunction creatMonth(year, month) {\n return new Date(year, month, 1).getTime();\n}\nfunction diffDay(min, max) {\n return Math.ceil((max - min) / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"DAY\"]);\n}\nfunction diffHour(min, max) {\n return Math.ceil((max - min) / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"HOUR\"]);\n}\nfunction diffMinus(min, max) {\n return Math.ceil((max - min) / (60 * 1000));\n}\n/**\n * 计算 time 的 ticks,对 month, year 进行 pretty 处理\n * @param cfg 度量的配置项\n * @returns 计算后的 ticks\n */\nfunction timePretty(cfg) {\n var min = cfg.min, max = cfg.max, minTickInterval = cfg.minTickInterval, tickCount = cfg.tickCount;\n var tickInterval = cfg.tickInterval;\n var ticks = [];\n // 指定 tickInterval 后 tickCount 不生效,需要重新计算\n if (!tickInterval) {\n tickInterval = (max - min) / tickCount;\n // 如果设置了最小间距,则使用最小间距\n if (minTickInterval && tickInterval < minTickInterval) {\n tickInterval = minTickInterval;\n }\n }\n tickInterval = Math.max(Math.floor((max - min) / (Math.pow(2, 12) - 1)), tickInterval);\n var minYear = getYear(min);\n // 如果间距大于 1 年,则将开始日期从整年开始\n if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"YEAR\"]) {\n var maxYear = getYear(max);\n var yearInterval = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"YEAR\"]);\n for (var i = minYear; i <= maxYear + yearInterval; i = i + yearInterval) {\n ticks.push(createYear(i));\n }\n }\n else if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MONTH\"]) {\n // 大于月时\n var monthInterval = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MONTH\"]);\n var mmMoth = getMonth(min);\n var dMonths = diffMonth(min, max);\n for (var i = 0; i <= dMonths + monthInterval; i = i + monthInterval) {\n ticks.push(creatMonth(minYear, i + mmMoth));\n }\n }\n else if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"DAY\"]) {\n // 大于天\n var date = new Date(min);\n var year = date.getFullYear();\n var month = date.getMonth();\n var mday = date.getDate();\n var day = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"DAY\"]);\n var ddays = diffDay(min, max);\n for (var i = 0; i < ddays + day; i = i + day) {\n ticks.push(new Date(year, month, mday + i).getTime());\n }\n }\n else if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"HOUR\"]) {\n // 大于小时\n var date = new Date(min);\n var year = date.getFullYear();\n var month = date.getMonth();\n var day = date.getDate();\n var hour = date.getHours();\n var hours = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"HOUR\"]);\n var dHours = diffHour(min, max);\n for (var i = 0; i <= dHours + hours; i = i + hours) {\n ticks.push(new Date(year, month, day, hour + i).getTime());\n }\n }\n else if (tickInterval > _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MINUTE\"]) {\n // 大于分钟\n var dMinus = diffMinus(min, max);\n var minutes = Math.ceil(tickInterval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MINUTE\"]);\n for (var i = 0; i <= dMinus + minutes; i = i + minutes) {\n ticks.push(min + i * _util_time__WEBPACK_IMPORTED_MODULE_0__[\"MINUTE\"]);\n }\n }\n else {\n // 小于分钟\n var interval = tickInterval;\n if (interval < _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]) {\n interval = _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"];\n }\n var minSecond = Math.floor(min / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]) * _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"];\n var dSeconds = Math.ceil((max - min) / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]);\n var seconds = Math.ceil(interval / _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]);\n for (var i = 0; i < dSeconds + seconds; i = i + seconds) {\n ticks.push(minSecond + i * _util_time__WEBPACK_IMPORTED_MODULE_0__[\"SECOND\"]);\n }\n }\n // 最好是能从算法能解决这个问题,但是如果指定了 tickInterval,计算 ticks,也只能这么算,所以\n // 打印警告提示\n if (ticks.length >= 512) {\n console.warn(\"Notice: current ticks length(\" + ticks.length + \") >= 512, may cause performance issues, even out of memory. Because of the configure \\\"tickInterval\\\"(in milliseconds, current is \" + tickInterval + \") is too small, increase the value to solve the problem!\");\n }\n return ticks;\n}\n//# sourceMappingURL=time-pretty.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/time-pretty.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/values-of-key.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/util/esm/values-of-key.js ***! - \******************************************************/ +/***/ "./node_modules/@antv/scale/esm/tick-method/time.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/tick-method/time.js ***! + \**********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (data, name) {\n var rst = [];\n var tmpMap = {};\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n // flatten\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n value = [value];\n }\n for (var j = 0; j < value.length; j++) {\n var val = value[j];\n // unique\n if (!tmpMap[val]) {\n rst.push(val);\n tmpMap[val] = true;\n }\n }\n }\n }\n return rst;\n});\n//# sourceMappingURL=values-of-key.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/values-of-key.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return calculateTimeTicks; });\n/* harmony import */ var _util_time__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util/time */ \"./node_modules/@antv/scale/esm/util/time.js\");\n\nfunction calculateTimeTicks(cfg) {\n var min = cfg.min, max = cfg.max, minTickInterval = cfg.minTickInterval;\n var tickInterval = cfg.tickInterval;\n var tickCount = cfg.tickCount;\n // 指定 tickInterval 后 tickCount 不生效,需要重新计算\n if (tickInterval) {\n tickCount = Math.ceil((max - min) / tickInterval);\n }\n else {\n tickInterval = Object(_util_time__WEBPACK_IMPORTED_MODULE_0__[\"getTickInterval\"])(min, max, tickCount)[1];\n var count = (max - min) / tickInterval;\n var ratio = count / tickCount;\n if (ratio > 1) {\n tickInterval = tickInterval * Math.ceil(ratio);\n }\n // 如果设置了最小间距,则使用最小间距\n if (minTickInterval && tickInterval < minTickInterval) {\n tickInterval = minTickInterval;\n }\n }\n tickInterval = Math.max(Math.floor((max - min) / (Math.pow(2, 12) - 1)), tickInterval);\n var ticks = [];\n for (var i = min; i < max + tickInterval; i += tickInterval) {\n ticks.push(i);\n }\n return ticks;\n}\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/tick-method/time.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/values.js": -/*!***********************************************!*\ - !*** ./node_modules/@antv/util/esm/values.js ***! - \***********************************************/ +/***/ "./node_modules/@antv/scale/esm/util/bisector.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/bisector.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\n// @ts-ignore\nvar values = Object.values ? function (obj) { return Object.values(obj); } : function (obj) {\n var result = [];\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (value, key) {\n if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj) && key === 'prototype')) {\n result.push(value);\n }\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (values);\n//# sourceMappingURL=values.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/values.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n/**\n * 二分右侧查找\n * https://github.com/d3/d3-array/blob/master/src/bisector.js\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (getter) {\n /**\n * x: 目标值\n * lo: 起始位置\n * hi: 结束位置\n */\n return function (a, x, _lo, _hi) {\n var lo = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(_lo) ? 0 : _lo;\n var hi = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(_hi) ? a.length : _hi;\n while (lo < hi) {\n var mid = (lo + hi) >>> 1;\n if (getter(a[mid]) > x) {\n hi = mid;\n }\n else {\n lo = mid + 1;\n }\n }\n return lo;\n };\n});\n//# sourceMappingURL=bisector.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/bisector.js?"); /***/ }), -/***/ "./node_modules/@antv/util/esm/wrap-behavior.js": -/*!******************************************************!*\ - !*** ./node_modules/@antv/util/esm/wrap-behavior.js ***! - \******************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/@antv/scale/esm/util/d3-linear.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/d3-linear.js ***! + \********************************************************/ +/*! exports provided: default, D3Linear */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 封装事件,便于使用上下文this,和便于解除事件时使用\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction wrapBehavior(obj, action) {\n if (obj['_wrap_' + action]) {\n return obj['_wrap_' + action];\n }\n var method = function (e) {\n obj[action](e);\n };\n obj['_wrap_' + action] = method;\n return method;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (wrapBehavior);\n//# sourceMappingURL=wrap-behavior.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/wrap-behavior.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return d3Linear; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"D3Linear\", function() { return D3Linear; });\nfunction d3Linear(cfg) {\n var min = cfg.min, max = cfg.max, nice = cfg.nice, tickCount = cfg.tickCount;\n var linear = new D3Linear();\n linear.domain([min, max]);\n if (nice) {\n linear.nice(tickCount);\n }\n return linear.ticks(tickCount);\n}\nvar DEFAULT_COUNT = 5;\nvar e10 = Math.sqrt(50);\nvar e5 = Math.sqrt(10);\nvar e2 = Math.sqrt(2);\n// https://github.com/d3/d3-scale\nvar D3Linear = /** @class */ (function () {\n function D3Linear() {\n this._domain = [0, 1];\n }\n D3Linear.prototype.domain = function (domain) {\n if (domain) {\n this._domain = Array.from(domain, Number);\n return this;\n }\n return this._domain.slice();\n };\n D3Linear.prototype.nice = function (count) {\n var _a, _b;\n if (count === void 0) { count = DEFAULT_COUNT; }\n var d = this._domain.slice();\n var i0 = 0;\n var i1 = this._domain.length - 1;\n var start = this._domain[i0];\n var stop = this._domain[i1];\n var step;\n if (stop < start) {\n _a = [stop, start], start = _a[0], stop = _a[1];\n _b = [i1, i0], i0 = _b[0], i1 = _b[1];\n }\n step = tickIncrement(start, stop, count);\n if (step > 0) {\n start = Math.floor(start / step) * step;\n stop = Math.ceil(stop / step) * step;\n step = tickIncrement(start, stop, count);\n }\n else if (step < 0) {\n start = Math.ceil(start * step) / step;\n stop = Math.floor(stop * step) / step;\n step = tickIncrement(start, stop, count);\n }\n if (step > 0) {\n d[i0] = Math.floor(start / step) * step;\n d[i1] = Math.ceil(stop / step) * step;\n this.domain(d);\n }\n else if (step < 0) {\n d[i0] = Math.ceil(start * step) / step;\n d[i1] = Math.floor(stop * step) / step;\n this.domain(d);\n }\n return this;\n };\n D3Linear.prototype.ticks = function (count) {\n if (count === void 0) { count = DEFAULT_COUNT; }\n return d3ArrayTicks(this._domain[0], this._domain[this._domain.length - 1], count || DEFAULT_COUNT);\n };\n return D3Linear;\n}());\n\nfunction d3ArrayTicks(start, stop, count) {\n var reverse;\n var i = -1;\n var n;\n var ticks;\n var step;\n (stop = +stop), (start = +start), (count = +count);\n if (start === stop && count > 0) {\n return [start];\n }\n // tslint:disable-next-line\n if ((reverse = stop < start)) {\n (n = start), (start = stop), (stop = n);\n }\n // tslint:disable-next-line\n if ((step = tickIncrement(start, stop, count)) === 0 || !isFinite(step)) {\n return [];\n }\n if (step > 0) {\n start = Math.ceil(start / step);\n stop = Math.floor(stop / step);\n ticks = new Array((n = Math.ceil(stop - start + 1)));\n while (++i < n) {\n ticks[i] = (start + i) * step;\n }\n }\n else {\n start = Math.floor(start * step);\n stop = Math.ceil(stop * step);\n ticks = new Array((n = Math.ceil(start - stop + 1)));\n while (++i < n) {\n ticks[i] = (start - i) / step;\n }\n }\n if (reverse) {\n ticks.reverse();\n }\n return ticks;\n}\nfunction tickIncrement(start, stop, count) {\n var step = (stop - start) / Math.max(0, count);\n var power = Math.floor(Math.log(step) / Math.LN10);\n var error = step / Math.pow(10, power);\n return power >= 0\n ? (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1) * Math.pow(10, power)\n : -Math.pow(10, -power) / (error >= e10 ? 10 : error >= e5 ? 5 : error >= e2 ? 2 : 1);\n}\n//# sourceMappingURL=d3-linear.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/d3-linear.js?"); /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/scale/esm/util/extended.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/extended.js ***! + \*******************************************************/ +/*! exports provided: DEFAULT_Q, ALL_Q, default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__(/*! core-js/modules/es.array.reduce.js */ \"./node_modules/core-js/modules/es.array.reduce.js\");\n\nfunction _applyDecoratedDescriptor(target, property, decorators, descriptor, context) {\n var desc = {};\n Object.keys(descriptor).forEach(function (key) {\n desc[key] = descriptor[key];\n });\n desc.enumerable = !!desc.enumerable;\n desc.configurable = !!desc.configurable;\n\n if ('value' in desc || desc.initializer) {\n desc.writable = true;\n }\n\n desc = decorators.slice().reverse().reduce(function (desc, decorator) {\n return decorator(target, property, desc) || desc;\n }, desc);\n\n if (context && desc.initializer !== void 0) {\n desc.value = desc.initializer ? desc.initializer.call(context) : void 0;\n desc.initializer = undefined;\n }\n\n if (desc.initializer === void 0) {\n Object.defineProperty(target, property, desc);\n desc = null;\n }\n\n return desc;\n}\n\nmodule.exports = _applyDecoratedDescriptor, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/applyDecoratedDescriptor.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DEFAULT_Q\", function() { return DEFAULT_Q; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ALL_Q\", function() { return ALL_Q; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return extended; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var _pretty_number__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pretty-number */ \"./node_modules/@antv/scale/esm/util/pretty-number.js\");\n\n\nvar DEFAULT_Q = [1, 5, 2, 2.5, 4, 3];\nvar ALL_Q = [1, 5, 2, 2.5, 4, 3, 1.5, 7, 6, 8, 9];\nvar eps = Number.EPSILON * 100;\nfunction mod(n, m) {\n return ((n % m) + m) % m;\n}\nfunction round(n) {\n return Math.round(n * 1e12) / 1e12;\n}\nfunction simplicity(q, Q, j, lmin, lmax, lstep) {\n var n = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"size\"])(Q);\n var i = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"indexOf\"])(Q, q);\n var v = 0;\n var m = mod(lmin, lstep);\n if ((m < eps || lstep - m < eps) && lmin <= 0 && lmax >= 0) {\n v = 1;\n }\n return 1 - i / (n - 1) - j + v;\n}\nfunction simplicityMax(q, Q, j) {\n var n = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"size\"])(Q);\n var i = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"indexOf\"])(Q, q);\n var v = 1;\n return 1 - i / (n - 1) - j + v;\n}\nfunction density(k, m, dMin, dMax, lMin, lMax) {\n var r = (k - 1) / (lMax - lMin);\n var rt = (m - 1) / (Math.max(lMax, dMax) - Math.min(dMin, lMin));\n return 2 - Math.max(r / rt, rt / r);\n}\nfunction densityMax(k, m) {\n if (k >= m) {\n return 2 - (k - 1) / (m - 1);\n }\n return 1;\n}\nfunction coverage(dMin, dMax, lMin, lMax) {\n var range = dMax - dMin;\n return 1 - (0.5 * (Math.pow((dMax - lMax), 2) + Math.pow((dMin - lMin), 2))) / Math.pow((0.1 * range), 2);\n}\nfunction coverageMax(dMin, dMax, span) {\n var range = dMax - dMin;\n if (span > range) {\n var half = (span - range) / 2;\n return 1 - Math.pow(half, 2) / Math.pow((0.1 * range), 2);\n }\n return 1;\n}\nfunction legibility() {\n return 1;\n}\n/**\n * An Extension of Wilkinson's Algorithm for Position Tick Labels on Axes\n * https://www.yuque.com/preview/yuque/0/2019/pdf/185317/1546999150858-45c3b9c2-4e86-4223-bf1a-8a732e8195ed.pdf\n * @param dMin 最小值\n * @param dMax 最大值\n * @param m tick个数\n * @param onlyLoose 是否允许扩展min、max,不绝对强制,例如[3, 97]\n * @param Q nice numbers集合\n * @param w 四个优化组件的权重\n */\nfunction extended(dMin, dMax, n, onlyLoose, Q, w) {\n if (n === void 0) { n = 5; }\n if (onlyLoose === void 0) { onlyLoose = true; }\n if (Q === void 0) { Q = DEFAULT_Q; }\n if (w === void 0) { w = [0.25, 0.2, 0.5, 0.05]; }\n // 处理小于 0 和小数的 tickCount\n var m = n < 0 ? 0 : Math.round(n);\n // nan 也会导致异常\n if (Number.isNaN(dMin) || Number.isNaN(dMax) || typeof dMin !== 'number' || typeof dMax !== 'number' || !m) {\n return {\n min: 0,\n max: 0,\n ticks: [],\n };\n }\n // js 极大值极小值问题,差值小于 1e-15 会导致计算出错\n if (dMax - dMin < 1e-15 || m === 1) {\n return {\n min: dMin,\n max: dMax,\n ticks: [dMin],\n };\n }\n // js 超大值问题\n if (dMax - dMin > 1e148) {\n var count = n || 5;\n var step_1 = (dMax - dMin) / count;\n return {\n min: dMin,\n max: dMax,\n ticks: Array(count).fill(null).map(function (_, idx) {\n return Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(dMin + step_1 * idx);\n }),\n };\n }\n var best = {\n score: -2,\n lmin: 0,\n lmax: 0,\n lstep: 0,\n };\n var j = 1;\n while (j < Infinity) {\n for (var i = 0; i < Q.length; i += 1) {\n var q = Q[i];\n var sm = simplicityMax(q, Q, j);\n if (w[0] * sm + w[1] + w[2] + w[3] < best.score) {\n j = Infinity;\n break;\n }\n var k = 2;\n while (k < Infinity) {\n var dm = densityMax(k, m);\n if (w[0] * sm + w[1] + w[2] * dm + w[3] < best.score) {\n break;\n }\n var delta = (dMax - dMin) / (k + 1) / j / q;\n var z = Math.ceil(Math.log10(delta));\n while (z < Infinity) {\n var step = j * q * Math.pow(10, z);\n var cm = coverageMax(dMin, dMax, step * (k - 1));\n if (w[0] * sm + w[1] * cm + w[2] * dm + w[3] < best.score) {\n break;\n }\n var minStart = Math.floor(dMax / step) * j - (k - 1) * j;\n var maxStart = Math.ceil(dMin / step) * j;\n if (minStart <= maxStart) {\n var count = maxStart - minStart;\n for (var i_1 = 0; i_1 <= count; i_1 += 1) {\n var start = minStart + i_1;\n var lMin = start * (step / j);\n var lMax = lMin + step * (k - 1);\n var lStep = step;\n var s = simplicity(q, Q, j, lMin, lMax, lStep);\n var c = coverage(dMin, dMax, lMin, lMax);\n var g = density(k, m, dMin, dMax, lMin, lMax);\n var l = legibility();\n var score = w[0] * s + w[1] * c + w[2] * g + w[3] * l;\n if (score > best.score && (!onlyLoose || (lMin <= dMin && lMax >= dMax))) {\n best.lmin = lMin;\n best.lmax = lMax;\n best.lstep = lStep;\n best.score = score;\n }\n }\n }\n z += 1;\n }\n k += 1;\n }\n }\n j += 1;\n }\n // 处理精度问题,保证这三个数没有精度问题\n var lmax = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(best.lmax);\n var lmin = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(best.lmin);\n var lstep = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(best.lstep);\n // 加 round 是为处理 extended(0.94, 1, 5)\n // 保证生成的 tickCount 没有精度问题\n var tickCount = Math.floor(round((lmax - lmin) / lstep)) + 1;\n var ticks = new Array(tickCount);\n // 少用乘法:防止出现 -1.2 + 1.2 * 3 = 2.3999999999999995 的情况\n ticks[0] = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(lmin);\n for (var i = 1; i < tickCount; i++) {\n ticks[i] = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_1__[\"prettyNumber\"])(ticks[i - 1] + lstep);\n }\n return {\n min: Math.min(dMin, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"head\"])(ticks)),\n max: Math.max(dMax, Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(ticks)),\n ticks: ticks,\n };\n}\n//# sourceMappingURL=extended.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/extended.js?"); /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/scale/esm/util/interval.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/interval.js ***! + \*******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n\n for (var i = 0, arr2 = new Array(len); i < len; i++) {\n arr2[i] = arr[i];\n }\n\n return arr2;\n}\n\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return intervalTicks; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\nfunction snapMultiple(v, base, snapType) {\n var div;\n if (snapType === 'ceil') {\n div = Math.ceil(v / base);\n }\n else if (snapType === 'floor') {\n div = Math.floor(v / base);\n }\n else {\n div = Math.round(v / base);\n }\n return div * base;\n}\nfunction intervalTicks(min, max, interval) {\n // 变成 interval 的倍数\n var minTick = snapMultiple(min, interval, 'floor');\n var maxTick = snapMultiple(max, interval, 'ceil');\n // 统一小数位数\n minTick = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"fixedBase\"])(minTick, interval);\n maxTick = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"fixedBase\"])(maxTick, interval);\n var ticks = [];\n // https://developer.mozilla.org/zh-CN/docs/Web/JavaScript/Reference/Errors/Invalid_array_length\n var availableInterval = Math.max((maxTick - minTick) / (Math.pow(2, 12) - 1), interval);\n for (var i = minTick; i <= maxTick; i = i + availableInterval) {\n var tickValue = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"fixedBase\"])(i, availableInterval); // 防止浮点数加法出现问题\n ticks.push(tickValue);\n }\n return {\n min: minTick,\n max: maxTick,\n ticks: ticks\n };\n}\n//# sourceMappingURL=interval.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/interval.js?"); /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/arrayWithHoles.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/arrayWithHoles.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/scale/esm/util/math.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/math.js ***! + \***************************************************/ +/*! exports provided: calBase, log, getLogPositiveMin, precisionAdd */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("function _arrayWithHoles(arr) {\n if (Array.isArray(arr)) return arr;\n}\n\nmodule.exports = _arrayWithHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayWithHoles.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"calBase\", function() { return calBase; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"log\", function() { return log; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getLogPositiveMin\", function() { return getLogPositiveMin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"precisionAdd\", function() { return precisionAdd; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n// 求以a为次幂,结果为b的基数,如 x^^a = b;求x\n// 虽然数学上 b 不支持负数,但是这里需要支持 负数\nfunction calBase(a, b) {\n var e = Math.E;\n var value;\n if (b >= 0) {\n value = Math.pow(e, Math.log(b) / a); // 使用换底公式求底\n }\n else {\n value = Math.pow(e, Math.log(-b) / a) * -1; // 使用换底公式求底\n }\n return value;\n}\nfunction log(a, b) {\n if (a === 1) {\n return 1;\n }\n return Math.log(b) / Math.log(a);\n}\nfunction getLogPositiveMin(values, base, max) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(max)) {\n max = Math.max.apply(null, values);\n }\n var positiveMin = max;\n Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"each\"])(values, function (value) {\n if (value > 0 && value < positiveMin) {\n positiveMin = value;\n }\n });\n if (positiveMin === max) {\n positiveMin = max / base;\n }\n if (positiveMin > 1) {\n positiveMin = 1;\n }\n return positiveMin;\n}\nfunction digitLength(num) {\n // Get digit length of e\n var eSplit = num.toString().split(/[eE]/);\n var len = (eSplit[0].split('.')[1] || '').length - +(eSplit[1] || 0);\n return len > 0 ? len : 0;\n}\n/**\n * 高精度加法,解决 0.1 + 0.2 !== 0.3 的经典问题\n *\n * @param num1 加数\n * @param num2 被加数\n * @return {number} 返回值\n */\nfunction precisionAdd(num1, num2) {\n var num1Digits = digitLength(num1);\n var num2Digits = digitLength(num2);\n var baseNum = Math.pow(10, Math.max(num1Digits, num2Digits));\n return (num1 * baseNum + num2 * baseNum) / baseNum;\n}\n//# sourceMappingURL=math.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/math.js?"); /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/scale/esm/util/pretty-number.js": +/*!************************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/pretty-number.js ***! + \************************************************************/ +/*! exports provided: prettyNumber */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ \"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\n\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\n\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"prettyNumber\", function() { return prettyNumber; });\n// 为了解决 js 运算的精度问题\nfunction prettyNumber(n) {\n return Math.abs(n) < 1e-15 ? n : parseFloat(n.toFixed(15));\n}\n//# sourceMappingURL=pretty-number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/pretty-number.js?"); /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/assertThisInitialized.js": -/*!**********************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/assertThisInitialized.js ***! - \**********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/scale/esm/util/pretty.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/pretty.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n\nfunction _assertThisInitialized(self) {\n if (self === void 0) {\n throw new ReferenceError(\"this hasn't been initialised - super() hasn't been called\");\n }\n\n return self;\n}\n\nmodule.exports = _assertThisInitialized, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/assertThisInitialized.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return pretty; });\n/* harmony import */ var _pretty_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./pretty-number */ \"./node_modules/@antv/scale/esm/util/pretty-number.js\");\n\nfunction pretty(min, max, m) {\n if (m === void 0) { m = 5; }\n if (min === max) {\n return {\n max: max,\n min: min,\n ticks: [min],\n };\n }\n var n = m < 0 ? 0 : Math.round(m);\n if (n === 0)\n return { max: max, min: min, ticks: [] };\n /*\n R pretty:\n https://svn.r-project.org/R/trunk/src/appl/pretty.c\n https://www.rdocumentation.org/packages/base/versions/3.5.2/topics/pretty\n */\n var h = 1.5; // high.u.bias\n var h5 = 0.5 + 1.5 * h; // u5.bias\n // 反正我也不会调参,跳过所有判断步骤\n var d = max - min;\n var c = d / n;\n // 当d非常小的时候触发,但似乎没什么用\n // const min_n = Math.floor(n / 3);\n // const shrink_sml = Math.pow(2, 5);\n // if (Math.log10(d) < -2) {\n // c = (_.max([ Math.abs(max), Math.abs(min) ]) * shrink_sml) / min_n;\n // }\n var base = Math.pow(10, Math.floor(Math.log10(c)));\n var unit = base;\n if (2 * base - c < h * (c - unit)) {\n unit = 2 * base;\n if (5 * base - c < h5 * (c - unit)) {\n unit = 5 * base;\n if (10 * base - c < h * (c - unit)) {\n unit = 10 * base;\n }\n }\n }\n var nu = Math.ceil(max / unit);\n var ns = Math.floor(min / unit);\n var hi = Math.max(nu * unit, max);\n var lo = Math.min(ns * unit, min);\n var size = Math.floor((hi - lo) / unit) + 1;\n var ticks = new Array(size);\n for (var i = 0; i < size; i++) {\n ticks[i] = Object(_pretty_number__WEBPACK_IMPORTED_MODULE_0__[\"prettyNumber\"])(lo + i * unit);\n }\n return {\n min: lo,\n max: hi,\n ticks: ticks,\n };\n}\n//# sourceMappingURL=pretty.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/pretty.js?"); /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js": -/*!*****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/scale/esm/util/strict-limit.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/strict-limit.js ***! + \***********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\n\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n\n _next(undefined);\n });\n };\n}\n\nmodule.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return strictLimit; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n\n/**\n * 按照给定的 minLimit/maxLimit/tickCount 均匀计算出刻度 ticks\n *\n * @param cfg Scale 配置项\n * @return ticks\n */\nfunction strictLimit(cfg, defaultMin, defaultMax) {\n var _a;\n var minLimit = cfg.minLimit, maxLimit = cfg.maxLimit, min = cfg.min, max = cfg.max, _b = cfg.tickCount, tickCount = _b === void 0 ? 5 : _b;\n var tickMin = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(minLimit) ? (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(defaultMin) ? min : defaultMin) : minLimit;\n var tickMax = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(maxLimit) ? (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isNil\"])(defaultMax) ? max : defaultMax) : maxLimit;\n if (tickMin > tickMax) {\n _a = [tickMin, tickMax], tickMax = _a[0], tickMin = _a[1];\n }\n if (tickCount <= 2) {\n return [tickMin, tickMax];\n }\n var step = (tickMax - tickMin) / (tickCount - 1);\n var ticks = [];\n for (var i = 0; i < tickCount; i++) {\n ticks.push(tickMin + step * i);\n }\n return ticks;\n}\n//# sourceMappingURL=strict-limit.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/strict-limit.js?"); /***/ }), -/***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\n\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/createClass.js": -/*!************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/createClass.js ***! - \************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("function _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, descriptor.key, descriptor);\n }\n}\n\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\n\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/createClass.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("function _defineProperty(obj, key, value) {\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n\n return obj;\n}\n\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/getPrototypeOf.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/getPrototypeOf.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("function _getPrototypeOf(o) {\n module.exports = _getPrototypeOf = Object.setPrototypeOf ? Object.getPrototypeOf.bind() : function _getPrototypeOf(o) {\n return o.__proto__ || Object.getPrototypeOf(o);\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _getPrototypeOf(o);\n}\n\nmodule.exports = _getPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/getPrototypeOf.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/inherits.js": -/*!*********************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/inherits.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n\nvar setPrototypeOf = __webpack_require__(/*! ./setPrototypeOf.js */ \"./node_modules/@babel/runtime/helpers/setPrototypeOf.js\");\n\nfunction _inherits(subClass, superClass) {\n if (typeof superClass !== \"function\" && superClass !== null) {\n throw new TypeError(\"Super expression must either be null or a function\");\n }\n\n subClass.prototype = Object.create(superClass && superClass.prototype, {\n constructor: {\n value: subClass,\n writable: true,\n configurable: true\n }\n });\n Object.defineProperty(subClass, \"prototype\", {\n writable: false\n });\n if (superClass) setPrototypeOf(subClass, superClass);\n}\n\nmodule.exports = _inherits, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/inherits.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/initializerDefineProperty.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/initializerDefineProperty.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("function _initializerDefineProperty(target, property, descriptor, context) {\n if (!descriptor) return;\n Object.defineProperty(target, property, {\n enumerable: descriptor.enumerable,\n configurable: descriptor.configurable,\n writable: descriptor.writable,\n value: descriptor.initializer ? descriptor.initializer.call(context) : void 0\n });\n}\n\nmodule.exports = _initializerDefineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/initializerDefineProperty.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/initializerWarningHelper.js": -/*!*************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/initializerWarningHelper.js ***! - \*************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n\nfunction _initializerWarningHelper(descriptor, context) {\n throw new Error('Decorating class property failed. Please ensure that ' + 'proposal-class-properties is enabled and runs after the decorators transform.');\n}\n\nmodule.exports = _initializerWarningHelper, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/initializerWarningHelper.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\n\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/iterableToArray.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js": -/*!*********************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n\nfunction _iterableToArrayLimit(arr, i) {\n var _i = arr == null ? null : typeof Symbol !== \"undefined\" && arr[Symbol.iterator] || arr[\"@@iterator\"];\n\n if (_i == null) return;\n var _arr = [];\n var _n = true;\n var _d = false;\n\n var _s, _e;\n\n try {\n for (_i = _i.call(arr); !(_n = (_s = _i.next()).done); _n = true) {\n _arr.push(_s.value);\n\n if (i && _arr.length === i) break;\n }\n } catch (err) {\n _d = true;\n _e = err;\n } finally {\n try {\n if (!_n && _i[\"return\"] != null) _i[\"return\"]();\n } finally {\n if (_d) throw _e;\n }\n }\n\n return _arr;\n}\n\nmodule.exports = _iterableToArrayLimit, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/nonIterableRest.js": -/*!****************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/nonIterableRest.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n\nfunction _nonIterableRest() {\n throw new TypeError(\"Invalid attempt to destructure non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableRest, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/nonIterableRest.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\n\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/nonIterableSpread.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js": -/*!**************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js ***! - \**************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n\nvar _typeof = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/typeof.js\")[\"default\"];\n\nvar assertThisInitialized = __webpack_require__(/*! ./assertThisInitialized.js */ \"./node_modules/@babel/runtime/helpers/assertThisInitialized.js\");\n\nfunction _possibleConstructorReturn(self, call) {\n if (call && (_typeof(call) === \"object\" || typeof call === \"function\")) {\n return call;\n } else if (call !== void 0) {\n throw new TypeError(\"Derived constructors may only return object or undefined\");\n }\n\n return assertThisInitialized(self);\n}\n\nmodule.exports = _possibleConstructorReturn, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/possibleConstructorReturn.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js": -/*!*******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\n\nvar _typeof = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/typeof.js\")[\"default\"];\n\nfunction _regeneratorRuntime() {\n \"use strict\";\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return exports;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var exports = {},\n Op = Object.prototype,\n hasOwn = Op.hasOwnProperty,\n $Symbol = \"function\" == typeof Symbol ? Symbol : {},\n iteratorSymbol = $Symbol.iterator || \"@@iterator\",\n asyncIteratorSymbol = $Symbol.asyncIterator || \"@@asyncIterator\",\n toStringTagSymbol = $Symbol.toStringTag || \"@@toStringTag\";\n\n function define(obj, key, value) {\n return Object.defineProperty(obj, key, {\n value: value,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), obj[key];\n }\n\n try {\n define({}, \"\");\n } catch (err) {\n define = function define(obj, key, value) {\n return obj[key] = value;\n };\n }\n\n function wrap(innerFn, outerFn, self, tryLocsList) {\n var protoGenerator = outerFn && outerFn.prototype instanceof Generator ? outerFn : Generator,\n generator = Object.create(protoGenerator.prototype),\n context = new Context(tryLocsList || []);\n return generator._invoke = function (innerFn, self, context) {\n var state = \"suspendedStart\";\n return function (method, arg) {\n if (\"executing\" === state) throw new Error(\"Generator is already running\");\n\n if (\"completed\" === state) {\n if (\"throw\" === method) throw arg;\n return doneResult();\n }\n\n for (context.method = method, context.arg = arg;;) {\n var delegate = context.delegate;\n\n if (delegate) {\n var delegateResult = maybeInvokeDelegate(delegate, context);\n\n if (delegateResult) {\n if (delegateResult === ContinueSentinel) continue;\n return delegateResult;\n }\n }\n\n if (\"next\" === context.method) context.sent = context._sent = context.arg;else if (\"throw\" === context.method) {\n if (\"suspendedStart\" === state) throw state = \"completed\", context.arg;\n context.dispatchException(context.arg);\n } else \"return\" === context.method && context.abrupt(\"return\", context.arg);\n state = \"executing\";\n var record = tryCatch(innerFn, self, context);\n\n if (\"normal\" === record.type) {\n if (state = context.done ? \"completed\" : \"suspendedYield\", record.arg === ContinueSentinel) continue;\n return {\n value: record.arg,\n done: context.done\n };\n }\n\n \"throw\" === record.type && (state = \"completed\", context.method = \"throw\", context.arg = record.arg);\n }\n };\n }(innerFn, self, context), generator;\n }\n\n function tryCatch(fn, obj, arg) {\n try {\n return {\n type: \"normal\",\n arg: fn.call(obj, arg)\n };\n } catch (err) {\n return {\n type: \"throw\",\n arg: err\n };\n }\n }\n\n exports.wrap = wrap;\n var ContinueSentinel = {};\n\n function Generator() {}\n\n function GeneratorFunction() {}\n\n function GeneratorFunctionPrototype() {}\n\n var IteratorPrototype = {};\n define(IteratorPrototype, iteratorSymbol, function () {\n return this;\n });\n var getProto = Object.getPrototypeOf,\n NativeIteratorPrototype = getProto && getProto(getProto(values([])));\n NativeIteratorPrototype && NativeIteratorPrototype !== Op && hasOwn.call(NativeIteratorPrototype, iteratorSymbol) && (IteratorPrototype = NativeIteratorPrototype);\n var Gp = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(IteratorPrototype);\n\n function defineIteratorMethods(prototype) {\n [\"next\", \"throw\", \"return\"].forEach(function (method) {\n define(prototype, method, function (arg) {\n return this._invoke(method, arg);\n });\n });\n }\n\n function AsyncIterator(generator, PromiseImpl) {\n function invoke(method, arg, resolve, reject) {\n var record = tryCatch(generator[method], generator, arg);\n\n if (\"throw\" !== record.type) {\n var result = record.arg,\n value = result.value;\n return value && \"object\" == _typeof(value) && hasOwn.call(value, \"__await\") ? PromiseImpl.resolve(value.__await).then(function (value) {\n invoke(\"next\", value, resolve, reject);\n }, function (err) {\n invoke(\"throw\", err, resolve, reject);\n }) : PromiseImpl.resolve(value).then(function (unwrapped) {\n result.value = unwrapped, resolve(result);\n }, function (error) {\n return invoke(\"throw\", error, resolve, reject);\n });\n }\n\n reject(record.arg);\n }\n\n var previousPromise;\n\n this._invoke = function (method, arg) {\n function callInvokeWithMethodAndArg() {\n return new PromiseImpl(function (resolve, reject) {\n invoke(method, arg, resolve, reject);\n });\n }\n\n return previousPromise = previousPromise ? previousPromise.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n };\n }\n\n function maybeInvokeDelegate(delegate, context) {\n var method = delegate.iterator[context.method];\n\n if (undefined === method) {\n if (context.delegate = null, \"throw\" === context.method) {\n if (delegate.iterator[\"return\"] && (context.method = \"return\", context.arg = undefined, maybeInvokeDelegate(delegate, context), \"throw\" === context.method)) return ContinueSentinel;\n context.method = \"throw\", context.arg = new TypeError(\"The iterator does not provide a 'throw' method\");\n }\n\n return ContinueSentinel;\n }\n\n var record = tryCatch(method, delegate.iterator, context.arg);\n if (\"throw\" === record.type) return context.method = \"throw\", context.arg = record.arg, context.delegate = null, ContinueSentinel;\n var info = record.arg;\n return info ? info.done ? (context[delegate.resultName] = info.value, context.next = delegate.nextLoc, \"return\" !== context.method && (context.method = \"next\", context.arg = undefined), context.delegate = null, ContinueSentinel) : info : (context.method = \"throw\", context.arg = new TypeError(\"iterator result is not an object\"), context.delegate = null, ContinueSentinel);\n }\n\n function pushTryEntry(locs) {\n var entry = {\n tryLoc: locs[0]\n };\n 1 in locs && (entry.catchLoc = locs[1]), 2 in locs && (entry.finallyLoc = locs[2], entry.afterLoc = locs[3]), this.tryEntries.push(entry);\n }\n\n function resetTryEntry(entry) {\n var record = entry.completion || {};\n record.type = \"normal\", delete record.arg, entry.completion = record;\n }\n\n function Context(tryLocsList) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], tryLocsList.forEach(pushTryEntry, this), this.reset(!0);\n }\n\n function values(iterable) {\n if (iterable) {\n var iteratorMethod = iterable[iteratorSymbol];\n if (iteratorMethod) return iteratorMethod.call(iterable);\n if (\"function\" == typeof iterable.next) return iterable;\n\n if (!isNaN(iterable.length)) {\n var i = -1,\n next = function next() {\n for (; ++i < iterable.length;) {\n if (hasOwn.call(iterable, i)) return next.value = iterable[i], next.done = !1, next;\n }\n\n return next.value = undefined, next.done = !0, next;\n };\n\n return next.next = next;\n }\n }\n\n return {\n next: doneResult\n };\n }\n\n function doneResult() {\n return {\n value: undefined,\n done: !0\n };\n }\n\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, define(Gp, \"constructor\", GeneratorFunctionPrototype), define(GeneratorFunctionPrototype, \"constructor\", GeneratorFunction), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, toStringTagSymbol, \"GeneratorFunction\"), exports.isGeneratorFunction = function (genFun) {\n var ctor = \"function\" == typeof genFun && genFun.constructor;\n return !!ctor && (ctor === GeneratorFunction || \"GeneratorFunction\" === (ctor.displayName || ctor.name));\n }, exports.mark = function (genFun) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(genFun, GeneratorFunctionPrototype) : (genFun.__proto__ = GeneratorFunctionPrototype, define(genFun, toStringTagSymbol, \"GeneratorFunction\")), genFun.prototype = Object.create(Gp), genFun;\n }, exports.awrap = function (arg) {\n return {\n __await: arg\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, asyncIteratorSymbol, function () {\n return this;\n }), exports.AsyncIterator = AsyncIterator, exports.async = function (innerFn, outerFn, self, tryLocsList, PromiseImpl) {\n void 0 === PromiseImpl && (PromiseImpl = Promise);\n var iter = new AsyncIterator(wrap(innerFn, outerFn, self, tryLocsList), PromiseImpl);\n return exports.isGeneratorFunction(outerFn) ? iter : iter.next().then(function (result) {\n return result.done ? result.value : iter.next();\n });\n }, defineIteratorMethods(Gp), define(Gp, toStringTagSymbol, \"Generator\"), define(Gp, iteratorSymbol, function () {\n return this;\n }), define(Gp, \"toString\", function () {\n return \"[object Generator]\";\n }), exports.keys = function (object) {\n var keys = [];\n\n for (var key in object) {\n keys.push(key);\n }\n\n return keys.reverse(), function next() {\n for (; keys.length;) {\n var key = keys.pop();\n if (key in object) return next.value = key, next.done = !1, next;\n }\n\n return next.done = !0, next;\n };\n }, exports.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(skipTempReset) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = undefined, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = undefined, this.tryEntries.forEach(resetTryEntry), !skipTempReset) for (var name in this) {\n \"t\" === name.charAt(0) && hasOwn.call(this, name) && !isNaN(+name.slice(1)) && (this[name] = undefined);\n }\n },\n stop: function stop() {\n this.done = !0;\n var rootRecord = this.tryEntries[0].completion;\n if (\"throw\" === rootRecord.type) throw rootRecord.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(exception) {\n if (this.done) throw exception;\n var context = this;\n\n function handle(loc, caught) {\n return record.type = \"throw\", record.arg = exception, context.next = loc, caught && (context.method = \"next\", context.arg = undefined), !!caught;\n }\n\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i],\n record = entry.completion;\n if (\"root\" === entry.tryLoc) return handle(\"end\");\n\n if (entry.tryLoc <= this.prev) {\n var hasCatch = hasOwn.call(entry, \"catchLoc\"),\n hasFinally = hasOwn.call(entry, \"finallyLoc\");\n\n if (hasCatch && hasFinally) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n } else if (hasCatch) {\n if (this.prev < entry.catchLoc) return handle(entry.catchLoc, !0);\n } else {\n if (!hasFinally) throw new Error(\"try statement without catch or finally\");\n if (this.prev < entry.finallyLoc) return handle(entry.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(type, arg) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc <= this.prev && hasOwn.call(entry, \"finallyLoc\") && this.prev < entry.finallyLoc) {\n var finallyEntry = entry;\n break;\n }\n }\n\n finallyEntry && (\"break\" === type || \"continue\" === type) && finallyEntry.tryLoc <= arg && arg <= finallyEntry.finallyLoc && (finallyEntry = null);\n var record = finallyEntry ? finallyEntry.completion : {};\n return record.type = type, record.arg = arg, finallyEntry ? (this.method = \"next\", this.next = finallyEntry.finallyLoc, ContinueSentinel) : this.complete(record);\n },\n complete: function complete(record, afterLoc) {\n if (\"throw\" === record.type) throw record.arg;\n return \"break\" === record.type || \"continue\" === record.type ? this.next = record.arg : \"return\" === record.type ? (this.rval = this.arg = record.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === record.type && afterLoc && (this.next = afterLoc), ContinueSentinel;\n },\n finish: function finish(finallyLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n if (entry.finallyLoc === finallyLoc) return this.complete(entry.completion, entry.afterLoc), resetTryEntry(entry), ContinueSentinel;\n }\n },\n \"catch\": function _catch(tryLoc) {\n for (var i = this.tryEntries.length - 1; i >= 0; --i) {\n var entry = this.tryEntries[i];\n\n if (entry.tryLoc === tryLoc) {\n var record = entry.completion;\n\n if (\"throw\" === record.type) {\n var thrown = record.arg;\n resetTryEntry(entry);\n }\n\n return thrown;\n }\n }\n\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(iterable, resultName, nextLoc) {\n return this.delegate = {\n iterator: values(iterable),\n resultName: resultName,\n nextLoc: nextLoc\n }, \"next\" === this.method && (this.arg = undefined), ContinueSentinel;\n }\n }, exports;\n}\n\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/regeneratorRuntime.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/setPrototypeOf.js": -/*!***************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/setPrototypeOf.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("function _setPrototypeOf(o, p) {\n module.exports = _setPrototypeOf = Object.setPrototypeOf ? Object.setPrototypeOf.bind() : function _setPrototypeOf(o, p) {\n o.__proto__ = p;\n return o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n return _setPrototypeOf(o, p);\n}\n\nmodule.exports = _setPrototypeOf, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/setPrototypeOf.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/slicedToArray.js": -/*!**************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/slicedToArray.js ***! - \**************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var arrayWithHoles = __webpack_require__(/*! ./arrayWithHoles.js */ \"./node_modules/@babel/runtime/helpers/arrayWithHoles.js\");\n\nvar iterableToArrayLimit = __webpack_require__(/*! ./iterableToArrayLimit.js */ \"./node_modules/@babel/runtime/helpers/iterableToArrayLimit.js\");\n\nvar unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ \"./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js\");\n\nvar nonIterableRest = __webpack_require__(/*! ./nonIterableRest.js */ \"./node_modules/@babel/runtime/helpers/nonIterableRest.js\");\n\nfunction _slicedToArray(arr, i) {\n return arrayWithHoles(arr) || iterableToArrayLimit(arr, i) || unsupportedIterableToArray(arr, i) || nonIterableRest();\n}\n\nmodule.exports = _slicedToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/slicedToArray.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js": -/*!******************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ \"./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js\");\n\nvar iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ \"./node_modules/@babel/runtime/helpers/iterableToArray.js\");\n\nvar unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ \"./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js\");\n\nvar nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ \"./node_modules/@babel/runtime/helpers/nonIterableSpread.js\");\n\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\n\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/toConsumableArray.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/typeof.js": -/*!*******************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/typeof.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(obj);\n}\n\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/typeof.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": -/*!***************************************************************************!*\ - !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! - \***************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ \"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\n\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\n\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js?"); - -/***/ }), - -/***/ "./node_modules/@babel/runtime/regenerator/index.js": -/*!**********************************************************!*\ - !*** ./node_modules/@babel/runtime/regenerator/index.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("// TODO(Babel 8): Remove this file.\nvar runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ \"./node_modules/@babel/runtime/helpers/regeneratorRuntime.js\")();\n\nmodule.exports = runtime; // Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\n\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/regenerator/index.js?"); - -/***/ }), - -/***/ "./node_modules/@webgpu/types/dist/constants.js": -/*!******************************************************!*\ - !*** ./node_modules/@webgpu/types/dist/constants.js ***! - \******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/scale/esm/util/time.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/scale/esm/util/time.js ***! + \***************************************************/ +/*! exports provided: timeFormat, toTimeStamp, SECOND, MINUTE, HOUR, DAY, MONTH, YEAR, getTickInterval */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n// https://github.com/gpuweb/gpuweb/blob/01b20b4ad93fabae1e8e0d7752515f69708d33e0/spec/index.bs\nObject.defineProperty(exports, \"__esModule\", { value: true });\n// tslint:disable:variable-name\n// String enums\nvar ExtensionName;\n(function (ExtensionName) {\n ExtensionName[\"TextureCompressionBC\"] = \"texture-compression-bc\";\n})(ExtensionName = exports.ExtensionName || (exports.ExtensionName = {}));\nvar AddressMode;\n(function (AddressMode) {\n AddressMode[\"ClampToEdge\"] = \"clamp-to-edge\";\n AddressMode[\"Repeat\"] = \"repeat\";\n AddressMode[\"MirrorRepeat\"] = \"mirror-repeat\";\n})(AddressMode = exports.AddressMode || (exports.AddressMode = {}));\nvar BindingType;\n(function (BindingType) {\n BindingType[\"UniformBuffer\"] = \"uniform-buffer\";\n BindingType[\"StorageBuffer\"] = \"storage-buffer\";\n BindingType[\"ReadonlyStorageBuffer\"] = \"readonly-storage-buffer\";\n BindingType[\"Sampler\"] = \"sampler\";\n BindingType[\"ComparisonSampler\"] = \"comparison-sampler\";\n BindingType[\"SampledTexture\"] = \"sampled-texture\";\n BindingType[\"ReadonlyStorageTexture\"] = \"readonly-storage-texture\";\n BindingType[\"WriteonlyStorageTexture\"] = \"writeonly-storage-texture\";\n})(BindingType = exports.BindingType || (exports.BindingType = {}));\nvar BlendFactor;\n(function (BlendFactor) {\n BlendFactor[\"Zero\"] = \"zero\";\n BlendFactor[\"One\"] = \"one\";\n BlendFactor[\"SrcColor\"] = \"src-color\";\n BlendFactor[\"OneMinusSrcColor\"] = \"one-minus-src-color\";\n BlendFactor[\"SrcAlpha\"] = \"src-alpha\";\n BlendFactor[\"OneMinusSrcAlpha\"] = \"one-minus-src-alpha\";\n BlendFactor[\"DstColor\"] = \"dst-color\";\n BlendFactor[\"OneMinusDstColor\"] = \"one-minus-dst-color\";\n BlendFactor[\"DstAlpha\"] = \"dst-alpha\";\n BlendFactor[\"OneMinusDstAlpha\"] = \"one-minus-dst-alpha\";\n BlendFactor[\"SrcAlphaSaturated\"] = \"src-alpha-saturated\";\n BlendFactor[\"BlendColor\"] = \"blend-color\";\n BlendFactor[\"OneMinusBlendColor\"] = \"one-minus-blend-color\";\n})(BlendFactor = exports.BlendFactor || (exports.BlendFactor = {}));\nvar BlendOperation;\n(function (BlendOperation) {\n BlendOperation[\"Add\"] = \"add\";\n BlendOperation[\"Subtract\"] = \"subtract\";\n BlendOperation[\"ReverseSubtract\"] = \"reverse-subtract\";\n BlendOperation[\"Min\"] = \"min\";\n BlendOperation[\"Max\"] = \"max\";\n})(BlendOperation = exports.BlendOperation || (exports.BlendOperation = {}));\nvar CompareFunction;\n(function (CompareFunction) {\n CompareFunction[\"Never\"] = \"never\";\n CompareFunction[\"Less\"] = \"less\";\n CompareFunction[\"Equal\"] = \"equal\";\n CompareFunction[\"LessEqual\"] = \"less-equal\";\n CompareFunction[\"Greater\"] = \"greater\";\n CompareFunction[\"NotEqual\"] = \"not-equal\";\n CompareFunction[\"GreaterEqual\"] = \"greater-equal\";\n CompareFunction[\"Always\"] = \"always\";\n})(CompareFunction = exports.CompareFunction || (exports.CompareFunction = {}));\nvar CullMode;\n(function (CullMode) {\n CullMode[\"None\"] = \"none\";\n CullMode[\"Front\"] = \"front\";\n CullMode[\"Back\"] = \"back\";\n})(CullMode = exports.CullMode || (exports.CullMode = {}));\nvar FilterMode;\n(function (FilterMode) {\n FilterMode[\"Nearest\"] = \"nearest\";\n FilterMode[\"Linear\"] = \"linear\";\n})(FilterMode = exports.FilterMode || (exports.FilterMode = {}));\nvar FrontFace;\n(function (FrontFace) {\n FrontFace[\"CCW\"] = \"ccw\";\n FrontFace[\"CW\"] = \"cw\";\n})(FrontFace = exports.FrontFace || (exports.FrontFace = {}));\nvar IndexFormat;\n(function (IndexFormat) {\n IndexFormat[\"Uint16\"] = \"uint16\";\n IndexFormat[\"Uint32\"] = \"uint32\";\n})(IndexFormat = exports.IndexFormat || (exports.IndexFormat = {}));\nvar InputStepMode;\n(function (InputStepMode) {\n InputStepMode[\"Vertex\"] = \"vertex\";\n InputStepMode[\"Instance\"] = \"instance\";\n})(InputStepMode = exports.InputStepMode || (exports.InputStepMode = {}));\nvar LoadOp;\n(function (LoadOp) {\n LoadOp[\"Load\"] = \"load\";\n})(LoadOp = exports.LoadOp || (exports.LoadOp = {}));\nvar PrimitiveTopology;\n(function (PrimitiveTopology) {\n PrimitiveTopology[\"PointList\"] = \"point-list\";\n PrimitiveTopology[\"LineList\"] = \"line-list\";\n PrimitiveTopology[\"LineStrip\"] = \"line-strip\";\n PrimitiveTopology[\"TriangleList\"] = \"triangle-list\";\n PrimitiveTopology[\"TriangleStrip\"] = \"triangle-strip\";\n})(PrimitiveTopology = exports.PrimitiveTopology || (exports.PrimitiveTopology = {}));\nvar StencilOperation;\n(function (StencilOperation) {\n StencilOperation[\"Keep\"] = \"keep\";\n StencilOperation[\"Zero\"] = \"zero\";\n StencilOperation[\"Replace\"] = \"replace\";\n StencilOperation[\"Invert\"] = \"invert\";\n StencilOperation[\"IncrementClamp\"] = \"increment-clamp\";\n StencilOperation[\"DecrementClamp\"] = \"decrement-clamp\";\n StencilOperation[\"IncrementWrap\"] = \"increment-wrap\";\n StencilOperation[\"DecrementWrap\"] = \"decrement-wrap\";\n})(StencilOperation = exports.StencilOperation || (exports.StencilOperation = {}));\nvar StoreOp;\n(function (StoreOp) {\n StoreOp[\"Store\"] = \"store\";\n StoreOp[\"Clear\"] = \"clear\";\n})(StoreOp = exports.StoreOp || (exports.StoreOp = {}));\nvar TextureDimension;\n(function (TextureDimension) {\n TextureDimension[\"E1d\"] = \"1d\";\n TextureDimension[\"E2d\"] = \"2d\";\n TextureDimension[\"E3d\"] = \"3d\";\n})(TextureDimension = exports.TextureDimension || (exports.TextureDimension = {}));\nvar TextureFormat;\n(function (TextureFormat) {\n TextureFormat[\"R8Unorm\"] = \"r8unorm\";\n TextureFormat[\"R8Snorm\"] = \"r8snorm\";\n TextureFormat[\"R8Uint\"] = \"r8uint\";\n TextureFormat[\"R8Sint\"] = \"r8sint\";\n TextureFormat[\"R16Uint\"] = \"r16uint\";\n TextureFormat[\"R16Sint\"] = \"r16sint\";\n TextureFormat[\"R16Float\"] = \"r16float\";\n TextureFormat[\"RG8Unorm\"] = \"rg8unorm\";\n TextureFormat[\"RG8Snorm\"] = \"rg8snorm\";\n TextureFormat[\"RG8Uint\"] = \"rg8uint\";\n TextureFormat[\"RG8Sint\"] = \"rg8sint\";\n TextureFormat[\"R32Uint\"] = \"r32uint\";\n TextureFormat[\"R32Sint\"] = \"r32sint\";\n TextureFormat[\"R32Float\"] = \"r32float\";\n TextureFormat[\"RG16Uint\"] = \"rg16uint\";\n TextureFormat[\"RG16Sint\"] = \"rg16sint\";\n TextureFormat[\"RG16Float\"] = \"rg16float\";\n TextureFormat[\"RGBA8Unorm\"] = \"rgba8unorm\";\n TextureFormat[\"RGBA8UnormSRGB\"] = \"rgba8unorm-srgb\";\n TextureFormat[\"RGBA8Snorm\"] = \"rgba8snorm\";\n TextureFormat[\"RGBA8Uint\"] = \"rgba8uint\";\n TextureFormat[\"RGBA8Sint\"] = \"rgba8sint\";\n TextureFormat[\"BGRA8Unorm\"] = \"bgra8unorm\";\n TextureFormat[\"BGRA8UnormSRGB\"] = \"bgra8unorm-srgb\";\n TextureFormat[\"RGB10A2Unorm\"] = \"rgb10a2unorm\";\n TextureFormat[\"RG11B10Float\"] = \"rg11b10float\";\n TextureFormat[\"RG32Uint\"] = \"rg32uint\";\n TextureFormat[\"RG32Sint\"] = \"rg32sint\";\n TextureFormat[\"RG32Float\"] = \"rg32float\";\n TextureFormat[\"RGBA16Uint\"] = \"rgba16uint\";\n TextureFormat[\"RGBA16Sint\"] = \"rgba16sint\";\n TextureFormat[\"RGBA16Float\"] = \"rgba16float\";\n TextureFormat[\"RGBA32Uint\"] = \"rgba32uint\";\n TextureFormat[\"RGBA32Sint\"] = \"rgba32sint\";\n TextureFormat[\"RGBA32Float\"] = \"rgba32float\";\n TextureFormat[\"Depth32Float\"] = \"depth32float\";\n TextureFormat[\"Depth24Plus\"] = \"depth24plus\";\n TextureFormat[\"Depth24PlusStencil8\"] = \"depth24plus-stencil8\";\n})(TextureFormat = exports.TextureFormat || (exports.TextureFormat = {}));\nvar TextureComponentType;\n(function (TextureComponentType) {\n TextureComponentType[\"Float\"] = \"float\";\n TextureComponentType[\"Sint\"] = \"sint\";\n TextureComponentType[\"Uint\"] = \"uint\";\n})(TextureComponentType = exports.TextureComponentType || (exports.TextureComponentType = {}));\nvar TextureViewDimension;\n(function (TextureViewDimension) {\n TextureViewDimension[\"E1d\"] = \"1d\";\n TextureViewDimension[\"E2d\"] = \"2d\";\n TextureViewDimension[\"E2dArray\"] = \"2d-array\";\n TextureViewDimension[\"Cube\"] = \"cube\";\n TextureViewDimension[\"CubeArray\"] = \"cube-array\";\n TextureViewDimension[\"E3d\"] = \"3d\";\n})(TextureViewDimension = exports.TextureViewDimension || (exports.TextureViewDimension = {}));\nvar VertexFormat;\n(function (VertexFormat) {\n VertexFormat[\"Uchar2\"] = \"uchar2\";\n VertexFormat[\"Uchar4\"] = \"uchar4\";\n VertexFormat[\"Char2\"] = \"char2\";\n VertexFormat[\"Char4\"] = \"char4\";\n VertexFormat[\"Uchar2Norm\"] = \"uchar2norm\";\n VertexFormat[\"Uchar4Norm\"] = \"uchar4norm\";\n VertexFormat[\"Char2Norm\"] = \"char2norm\";\n VertexFormat[\"Char4Norm\"] = \"char4norm\";\n VertexFormat[\"Ushort2\"] = \"ushort2\";\n VertexFormat[\"Ushort4\"] = \"ushort4\";\n VertexFormat[\"Short2\"] = \"short2\";\n VertexFormat[\"Short4\"] = \"short4\";\n VertexFormat[\"Ushort2Norm\"] = \"ushort2norm\";\n VertexFormat[\"Ushort4Norm\"] = \"ushort4norm\";\n VertexFormat[\"Short2Norm\"] = \"short2norm\";\n VertexFormat[\"Short4Norm\"] = \"short4norm\";\n VertexFormat[\"Half2\"] = \"half2\";\n VertexFormat[\"Half4\"] = \"half4\";\n VertexFormat[\"Float\"] = \"float\";\n VertexFormat[\"Float2\"] = \"float2\";\n VertexFormat[\"Float3\"] = \"float3\";\n VertexFormat[\"Float4\"] = \"float4\";\n VertexFormat[\"Uint\"] = \"uint\";\n VertexFormat[\"Uint2\"] = \"uint2\";\n VertexFormat[\"Uint3\"] = \"uint3\";\n VertexFormat[\"Uint4\"] = \"uint4\";\n VertexFormat[\"Int\"] = \"int\";\n VertexFormat[\"Int2\"] = \"int2\";\n VertexFormat[\"Int3\"] = \"int3\";\n VertexFormat[\"Int4\"] = \"int4\";\n})(VertexFormat = exports.VertexFormat || (exports.VertexFormat = {}));\nvar TextureAspect;\n(function (TextureAspect) {\n TextureAspect[\"All\"] = \"all\";\n TextureAspect[\"StencilOnly\"] = \"stencil-only\";\n TextureAspect[\"DepthOnly\"] = \"depth-only\";\n})(TextureAspect = exports.TextureAspect || (exports.TextureAspect = {}));\nvar CompilationMessageType;\n(function (CompilationMessageType) {\n CompilationMessageType[\"Error\"] = \"error\";\n CompilationMessageType[\"Warning\"] = \"warning\";\n CompilationMessageType[\"Info\"] = \"info\";\n})(CompilationMessageType = exports.CompilationMessageType || (exports.CompilationMessageType = {}));\nvar QueryType;\n(function (QueryType) {\n QueryType[\"Occlusion\"] = \"occlusion\";\n})(QueryType = exports.QueryType || (exports.QueryType = {}));\n// Bit fields\nvar BufferUsage;\n(function (BufferUsage) {\n BufferUsage[BufferUsage[\"MapRead\"] = 1] = \"MapRead\";\n BufferUsage[BufferUsage[\"MapWrite\"] = 2] = \"MapWrite\";\n BufferUsage[BufferUsage[\"CopySrc\"] = 4] = \"CopySrc\";\n BufferUsage[BufferUsage[\"CopyDst\"] = 8] = \"CopyDst\";\n BufferUsage[BufferUsage[\"Index\"] = 16] = \"Index\";\n BufferUsage[BufferUsage[\"Vertex\"] = 32] = \"Vertex\";\n BufferUsage[BufferUsage[\"Uniform\"] = 64] = \"Uniform\";\n BufferUsage[BufferUsage[\"Storage\"] = 128] = \"Storage\";\n BufferUsage[BufferUsage[\"Indirect\"] = 256] = \"Indirect\";\n BufferUsage[BufferUsage[\"QueryResolve\"] = 512] = \"QueryResolve\";\n})(BufferUsage = exports.BufferUsage || (exports.BufferUsage = {}));\nvar ColorWrite;\n(function (ColorWrite) {\n ColorWrite[ColorWrite[\"Red\"] = 1] = \"Red\";\n ColorWrite[ColorWrite[\"Green\"] = 2] = \"Green\";\n ColorWrite[ColorWrite[\"Blue\"] = 4] = \"Blue\";\n ColorWrite[ColorWrite[\"Alpha\"] = 8] = \"Alpha\";\n ColorWrite[ColorWrite[\"All\"] = 15] = \"All\";\n})(ColorWrite = exports.ColorWrite || (exports.ColorWrite = {}));\nvar ShaderStage;\n(function (ShaderStage) {\n ShaderStage[ShaderStage[\"Vertex\"] = 1] = \"Vertex\";\n ShaderStage[ShaderStage[\"Fragment\"] = 2] = \"Fragment\";\n ShaderStage[ShaderStage[\"Compute\"] = 4] = \"Compute\";\n})(ShaderStage = exports.ShaderStage || (exports.ShaderStage = {}));\nvar TextureUsage;\n(function (TextureUsage) {\n TextureUsage[TextureUsage[\"CopySrc\"] = 1] = \"CopySrc\";\n TextureUsage[TextureUsage[\"CopyDst\"] = 2] = \"CopyDst\";\n TextureUsage[TextureUsage[\"Sampled\"] = 4] = \"Sampled\";\n TextureUsage[TextureUsage[\"Storage\"] = 8] = \"Storage\";\n TextureUsage[TextureUsage[\"OutputAttachment\"] = 16] = \"OutputAttachment\";\n})(TextureUsage = exports.TextureUsage || (exports.TextureUsage = {}));\nvar MapMode;\n(function (MapMode) {\n MapMode[MapMode[\"Read\"] = 1] = \"Read\";\n MapMode[MapMode[\"Write\"] = 2] = \"Write\";\n})(MapMode = exports.MapMode || (exports.MapMode = {}));\n\n\n//# sourceURL=webpack:///./node_modules/@webgpu/types/dist/constants.js?"); - -/***/ }), - -/***/ "./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js&": -/*!***********************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js& ***! - \***********************************************************************************************************************************************************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var debounce = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\n\nvar monacoLoader = __webpack_require__(/*! ./MonacoLoader */ \"./node_modules/vue-monaco-editor/src/MonacoLoader.js\");\n\nmodule.exports = {\n props: {\n width: {\n type: [String, Number],\n default: '100%'\n },\n height: {\n type: [String, Number],\n default: '100%'\n },\n code: {\n type: String,\n default: '// code \\n'\n },\n srcPath: {\n type: String\n },\n language: {\n type: String,\n default: 'javascript'\n },\n theme: {\n type: String,\n default: 'vs-dark'\n },\n // vs, hc-black\n options: {\n type: Object,\n default: () => {}\n },\n highlighted: {\n type: Array,\n default: () => [{\n number: 0,\n class: ''\n }]\n },\n changeThrottle: {\n type: Number,\n default: 0\n }\n },\n\n mounted() {\n this.fetchEditor();\n },\n\n destroyed() {\n this.destroyMonaco();\n },\n\n computed: {\n style() {\n const {\n width,\n height\n } = this;\n const fixedWidth = width.toString().indexOf('%') !== -1 ? width : `${width}px`;\n const fixedHeight = height.toString().indexOf('%') !== -1 ? height : `${height}px`;\n return {\n width: fixedWidth,\n height: fixedHeight\n };\n },\n\n editorOptions() {\n return Object.assign({}, this.defaults, this.options, {\n value: this.code,\n language: this.language,\n theme: this.theme\n });\n }\n\n },\n\n data() {\n return {\n defaults: {\n selectOnLineNumbers: true,\n roundedSelection: false,\n readOnly: false,\n cursorStyle: 'line',\n automaticLayout: false,\n glyphMargin: true\n }\n };\n },\n\n watch: {\n highlighted: {\n handler(lines) {\n this.highlightLines(lines);\n },\n\n deep: true\n }\n },\n methods: {\n highlightLines(lines) {\n if (!this.editor) {\n return;\n }\n\n lines.forEach(line => {\n const className = line.class;\n const highlighted = this.$el.querySelector(`.${className}`);\n\n if (highlighted) {\n highlighted.classList.remove(className);\n }\n\n const number = parseInt(line.number);\n\n if (!this.editor && number < 1 || isNaN(number)) {\n return;\n }\n\n const selectedLine = this.$el.querySelector(`.view-lines [linenumber=\"${number}\"]`);\n\n if (selectedLine) {\n selectedLine.classList.add(className);\n }\n });\n },\n\n editorHasLoaded(editor, monaco) {\n this.editor = editor;\n this.monaco = monaco;\n this.editor.onDidChangeModelContent(event => this.codeChangeHandler(editor, event));\n this.$emit('mounted', editor);\n },\n\n codeChangeHandler: function (editor) {\n if (this.codeChangeEmitter) {\n this.codeChangeEmitter(editor);\n } else {\n this.codeChangeEmitter = debounce(function (editor) {\n this.$emit('codeChange', editor);\n }, this.changeThrottle);\n this.codeChangeEmitter(editor);\n }\n },\n\n fetchEditor() {\n monacoLoader.load(this.srcPath, this.createMonaco);\n },\n\n createMonaco() {\n this.editor = window.monaco.editor.create(this.$el, this.editorOptions);\n this.editorHasLoaded(this.editor, window.monaco);\n },\n\n destroyMonaco() {\n if (typeof this.editor !== 'undefined') {\n this.editor.dispose();\n }\n }\n\n }\n};\n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timeFormat\", function() { return timeFormat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toTimeStamp\", function() { return toTimeStamp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SECOND\", function() { return SECOND; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MINUTE\", function() { return MINUTE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HOUR\", function() { return HOUR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"DAY\", function() { return DAY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"MONTH\", function() { return MONTH; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"YEAR\", function() { return YEAR; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTickInterval\", function() { return getTickInterval; });\n/* harmony import */ var _antv_util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! @antv/util */ \"./node_modules/@antv/util/esm/index.js\");\n/* harmony import */ var fecha__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! fecha */ \"./node_modules/fecha/lib/fecha.js\");\n/* harmony import */ var _bisector__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./bisector */ \"./node_modules/@antv/scale/esm/util/bisector.js\");\n\n\n\n\nvar FORMAT_METHOD = 'format';\nfunction timeFormat(time, mask) {\n var method = fecha__WEBPACK_IMPORTED_MODULE_1__[FORMAT_METHOD] || fecha__WEBPACK_IMPORTED_MODULE_1__[\"default\"][FORMAT_METHOD];\n return method(time, mask);\n}\n/**\n * 转换成时间戳\n * @param value 时间值\n */\nfunction toTimeStamp(value) {\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isString\"])(value)) {\n if (value.indexOf('T') > 0) {\n value = new Date(value).getTime();\n }\n else {\n // new Date('2010/01/10') 和 new Date('2010-01-10') 的差别在于:\n // 如果仅有年月日时,前者是带有时区的: Fri Jan 10 2020 02:40:13 GMT+0800 (中国标准时间)\n // 后者会格式化成 Sun Jan 10 2010 08:00:00 GMT+0800 (中国标准时间)\n value = new Date(value.replace(/-/gi, '/')).getTime();\n }\n }\n if (Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"isDate\"])(value)) {\n value = value.getTime();\n }\n return value;\n}\nvar SECOND = 1000;\nvar MINUTE = 60 * SECOND;\nvar HOUR = 60 * MINUTE;\nvar DAY = 24 * HOUR;\nvar MONTH = DAY * 31;\nvar YEAR = DAY * 365;\n\nvar intervals = [\n ['HH:mm:ss', SECOND],\n ['HH:mm:ss', SECOND * 10],\n ['HH:mm:ss', SECOND * 30],\n ['HH:mm', MINUTE],\n ['HH:mm', MINUTE * 10],\n ['HH:mm', MINUTE * 30],\n ['HH', HOUR],\n ['HH', HOUR * 6],\n ['HH', HOUR * 12],\n ['YYYY-MM-DD', DAY],\n ['YYYY-MM-DD', DAY * 4],\n ['YYYY-WW', DAY * 7],\n ['YYYY-MM', MONTH],\n ['YYYY-MM', MONTH * 4],\n ['YYYY-MM', MONTH * 6],\n ['YYYY', DAY * 380],\n];\nfunction getTickInterval(min, max, tickCount) {\n var target = (max - min) / tickCount;\n var idx = Object(_bisector__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function (o) { return o[1]; })(intervals, target) - 1;\n var interval = intervals[idx];\n if (idx < 0) {\n interval = intervals[0];\n }\n else if (idx >= intervals.length) {\n interval = Object(_antv_util__WEBPACK_IMPORTED_MODULE_0__[\"last\"])(intervals);\n }\n return interval;\n}\n//# sourceMappingURL=time.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/scale/esm/util/time.js?"); /***/ }), -/***/ "./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/JSEditor.vue?vue&type=script&lang=js&": -/*!*********************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/JSEditor.vue?vue&type=script&lang=js& ***! - \*********************************************************************************************************************************************************************************************************************************************************/ +/***/ "./node_modules/@antv/util/esm/augment.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/augment.js ***! + \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_monaco_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-monaco-editor */ \"./node_modules/vue-monaco-editor/index.js\");\n/* harmony import */ var vue_monaco_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue_monaco_editor__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'WorkflowEditor',\n components: {\n MonacoEditor: (vue_monaco_editor__WEBPACK_IMPORTED_MODULE_0___default())\n },\n props: ['code'],\n\n data() {\n return {\n /** 代码组件 */\n editor: null,\n options: {\n selectOnLineNumbers: false\n },\n randomKey: 1231231\n };\n },\n\n methods: {\n onMounted(editor) {\n this.editor = editor;\n },\n\n onCodeChange() {\n this.$emit('onCodeChange', this.editor.getValue());\n }\n\n }\n});\n\n//# sourceURL=webpack:///./src/components/dag/JSEditor.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/util/esm/mix.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\nvar augment = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n var c = args[0];\n for (var i = 1; i < args.length; i++) {\n var obj = args[i];\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj)) {\n obj = obj.prototype;\n }\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(c.prototype, obj);\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (augment);\n//# sourceMappingURL=augment.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/augment.js?"); /***/ }), -/***/ "./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/PowerWorkflow.vue?vue&type=script&lang=js&": -/*!**************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/PowerWorkflow.vue?vue&type=script&lang=js& ***! - \**************************************************************************************************************************************************************************************************************************************************************/ +/***/ "./node_modules/@antv/util/esm/cache.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/util/esm/cache.js ***! + \**********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var power_workflow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! power-workflow */ \"./node_modules/power-workflow/index.js\");\n/* harmony import */ var power_workflow__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(power_workflow__WEBPACK_IMPORTED_MODULE_0__);\n\nconst defaultSize = {\n width: (document.body.clientWidth - 254) * 0.7,\n height: 700\n};\nconst dagSize = {\n default: {\n width: (defaultWidthInc, radio) => (document.body.clientWidth - defaultWidthInc) * radio,\n height: () => document.body.clientHeight\n },\n fiexd: {\n width: (defaultWidthInc, rightWidth) => document.body.clientWidth - defaultWidthInc - rightWidth,\n height: () => document.body.clientHeight\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"PowerWorkflow\",\n\n data() {\n return {\n size: {\n width: document.body.clientWidth - 254,\n height: defaultSize.height\n },\n powerFlow: null,\n selectNode: null,\n zoom: 1\n };\n },\n\n props: [\"onClickImportNode\", \"defaultWidthInc\", \"nodes\", \"edges\", \"rightFixed\", \"fullInc\", \"mode\", \"interceptSelectedNode\", \"onClickImportSpecialNode\"],\n\n mounted() {\n this.size.width = this.defaultWidthInc ? document.body.clientWidth - this.defaultWidthInc : document.body.clientWidth - 254;\n this.initFlow();\n window.addEventListener(\"resize\", this.onFullScreenListener);\n },\n\n methods: {\n /** 初始化图 */\n initFlow() {\n // 整理节点数据\n let {\n nodes,\n edges\n } = this.makeNodes();\n const powerFlow = new power_workflow__WEBPACK_IMPORTED_MODULE_0___default.a({\n container: this.$refs.powerDag,\n width: this.size.width,\n height: this.size.height,\n initNodes: nodes,\n initEdges: edges,\n // layout: 'vertical',\n layout: {\n type: 'dagre',\n // align: 'UR', // 可选\n nodesep: 40,\n // 可选\n // ranksep: 60, // 可选\n rankdir: 'LR',\n controlPoints: true,\n // 可选\n ranksepFunc: node => {\n // console.log(node);\n if (node.nodeType === 2) {\n return 55;\n }\n\n return 60;\n }\n },\n edgeCallback: this.edgeEnd\n });\n powerFlow.graph.setMode(\"edit\"); // powerFlow.graph.fitCenter(20);\n\n this.powerFlow = powerFlow;\n this.powerFlow.graph.on(\"onSelectNode\", item => {\n if (this.interceptSelectedNode && !this.interceptSelectedNode(item)) {\n this.$emit(\"onSelectedNode\", item);\n return;\n } else {\n this.selectNode = item;\n this.$emit(\"onSelectedNode\", item);\n }\n });\n this.powerFlow.graph.on(\"onClearSelectNode\", () => {\n this.selectNode = null;\n this.$emit(\"onClearSelectNode\", null);\n });\n if (this.mode) this.powerFlow.graph.setMode(this.mode);\n this.$emit(\"getDag\", powerFlow, {\n nodes,\n edges,\n resetNodes: this.resetNodes\n });\n },\n\n /** 重置节点 */\n resetNodes() {\n let {\n nodes,\n edges\n } = this.makeNodes();\n this.powerFlow.graph.data({\n nodes,\n edges\n });\n this.powerFlow.graph.render();\n },\n\n /** 判断线是否可以 */\n edgeEnd(sourceNode) {\n // console.log(sourceNode);\n // console.log(targetNode);\n // console.log(sourceNode.get('currentShape'))\n const data = this.isEdge(sourceNode);\n if (!data) return false;\n return { ...data\n };\n },\n\n /** 判断线上是否添加文字以及是否可添加线 */\n isEdge(node) {\n const nodeType = node.get('currentShape');\n\n if (nodeType !== 'max-diamond-node') {\n return {};\n }\n\n const edges = node.getOutEdges();\n\n if (edges.length > 1) {\n this.$message('最多只能有两条边哦');\n return false;\n }\n\n console.log(edges);\n\n if (edges.length === 0) {\n return {\n label: 'Y'\n };\n }\n\n const item = edges[0];\n const model = item.get('model');\n return {\n label: model.label === 'Y' ? 'N' : 'Y'\n };\n },\n\n /** 整理节点信息 */\n makeNodes() {\n let width = 0;\n this.nodes.forEach(item => {\n let len = item.nodeName.length * 9;\n let curtWidth = 0;\n\n if (len > 220) {\n curtWidth = 220;\n } else if (len < 180) {\n curtWidth = 180;\n } else {\n curtWidth = len;\n }\n\n if (curtWidth > width) {\n width = curtWidth;\n }\n });\n let status = {\n 3: {\n color: \"\",\n text: this.$t(\"message.running\")\n },\n 4: {\n color: \"#FFADA4\",\n text: this.$t(\"message.failed\")\n },\n 5: {\n color: \"#C3FFD2\",\n text: this.$t(\"message.success\")\n },\n 10: {\n color: \"\",\n text: this.$t(\"message.stopped\")\n },\n 9: {\n text: this.$t(\"message.canceleded\"),\n color: '#E2E2E2',\n stroke: \"#A5A5A5\"\n }\n };\n let nodes = this.nodes.map(item => {\n let statusValue = {};\n let statusStyle = {};\n\n if (item.nodeType === 2) {\n return {\n id: `${item.nodeId}`,\n type: \"max-diamond-node\",\n text: item.nodeName ? item.nodeName : \"判断\",\n size: [15, 80],\n style: {\n sideLength: 80,\n textStyle: {// fill: \"#FFFFFF\",\n }\n },\n ...item\n };\n }\n\n if (item.status) {\n statusValue = {\n taskStatus: status[item.status] ? status[item.status].text : this.$t(\"message.waitingUpstream\"),\n taskStatusValue: item.status\n };\n\n if (status[item.status] && status[item.status].color) {\n statusStyle = {\n fill: status[item.status].color\n };\n\n if (status[item.status].stroke) {\n statusStyle.stroke = status[item.status].stroke;\n }\n }\n }\n\n return {\n id: `${item.nodeId}`,\n type: item.nodeType === 1 ? \"flow-node\" : 'flow-child-node',\n size: [width, 70],\n leftText: item.jobId,\n titleText: item.nodeName,\n icon1: item.enable ? __webpack_require__(/*! ../../assets/start.svg */ \"./src/assets/start.svg\") : \"\",\n icon2: item.skipWhenFailed ? __webpack_require__(/*! ../../assets/skip.svg */ \"./src/assets/skip.svg\") : \"\",\n // taskStatus: text,\n ...statusValue,\n style: statusStyle,\n rightText: item.instanceId ? item.instanceId : null,\n ...item\n };\n });\n let edges = this.edges.map(item => {\n const property = {};\n\n if (item.property) {\n property.label = item.property === 'true' ? 'Y' : 'N';\n }\n\n return {\n source: `${item.from}`,\n target: `${item.to}`,\n type: \"cvte-polyline\",\n ...property\n };\n });\n return {\n nodes,\n edges\n };\n },\n\n /** 引入判断节点 */\n importJudgeNode() {\n this.onClickImportSpecialNode && this.onClickImportSpecialNode({\n type: 2\n });\n },\n\n /** 引入工作流节点 */\n importWorkflowNode() {\n this.onClickImportSpecialNode && this.onClickImportSpecialNode({\n type: 3\n });\n },\n\n /** 监控全屏 */\n onFullScreenListener() {\n let isFull = document.fullscreenElement || document.msFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || false;\n if (isFull === undefined) isFull = false;\n let incValue = 1;\n\n if (this.selectNode) {\n incValue = 0.7;\n }\n\n let width = 0;\n let height = 0;\n let strage = \"default\";\n\n if (this.rightFixed) {\n strage = \"fiexd\";\n incValue = this.rightFixed;\n\n if (!this.selectNode) {\n incValue = 0;\n }\n }\n\n if (isFull) {\n // if(!this.selectNode) {\n // width = dagSize[strage].width(this.defaultWidthInc, incValue);\n // }\n width = dagSize[strage].width(0, incValue);\n height = dagSize[strage].height();\n this.size = {\n width,\n height\n };\n this.powerFlow.graph.changeSize(this.size.width, this.size.height);\n } else {\n width = dagSize[strage].width(this.defaultWidthInc, incValue);\n height = dagSize[strage].height();\n this.size = {\n width,\n height: defaultSize.height\n };\n this.powerFlow.graph.changeSize(this.size.width, this.size.height);\n }\n },\n\n /** 缩小 */\n handleZoomOut() {\n let zoom = this.powerFlow.graph.getZoom();\n zoom -= 0.1;\n this.powerFlow.graph.zoomTo(zoom);\n },\n\n /** 放大 */\n handleZoomIn() {\n let zoom = this.powerFlow.graph.getZoom();\n zoom += 0.1;\n this.powerFlow.graph.zoomTo(zoom);\n },\n\n /** 自适应 */\n handleAutoFit() {\n this.powerFlow.graph.layout();\n this.powerFlow.graph.fitView(20);\n },\n\n /** 全屏 */\n fullScreen() {\n const el = document.getElementById(this.fullInc) || this.$refs[\"power-job\"];\n const rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;\n\n if (typeof rfs != \"undefined\" && rfs) {\n rfs.call(el);\n return;\n }\n }\n\n },\n watch: {\n /** 监控节点的选中 */\n selectNode() {\n this.onFullScreenListener();\n }\n\n }\n});\n\n//# sourceURL=webpack:///./src/components/dag/PowerWorkflow.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * k-v 存储\n */\nvar default_1 = /** @class */ (function () {\n function default_1() {\n this.map = {};\n }\n default_1.prototype.has = function (key) {\n return this.map[key] !== undefined;\n };\n default_1.prototype.get = function (key, def) {\n var v = this.map[key];\n return v === undefined ? def : v;\n };\n default_1.prototype.set = function (key, value) {\n this.map[key] = value;\n };\n default_1.prototype.clear = function () {\n this.map = {};\n };\n default_1.prototype.delete = function (key) {\n delete this.map[key];\n };\n default_1.prototype.size = function () {\n return Object.keys(this.map).length;\n };\n return default_1;\n}());\n/* harmony default export */ __webpack_exports__[\"default\"] = (default_1);\n//# sourceMappingURL=cache.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/cache.js?"); /***/ }), -/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"3d9796ac-vue-loader-template\"}!./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30&": -/*!******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3d9796ac-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30& ***! - \******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/*! exports provided: render, staticRenderFns */ +/***/ "./node_modules/@antv/util/esm/clamp.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/util/esm/clamp.js ***! + \**********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c,\n _setup = _vm._self._setupProxy;\n\n return _c(\"div\", {\n style: _vm.style\n });\n};\n\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%223d9796ac-vue-loader-template%22%7D!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\nvar clamp = function (a, min, max) {\n if (a < min) {\n return min;\n }\n else if (a > max) {\n return max;\n }\n return a;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (clamp);\n//# sourceMappingURL=clamp.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/clamp.js?"); /***/ }), -/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"3d9796ac-vue-loader-template\"}!./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/JSEditor.vue?vue&type=template&id=123e60ea&": -/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3d9796ac-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/JSEditor.vue?vue&type=template&id=123e60ea& ***! - \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/*! exports provided: render, staticRenderFns */ +/***/ "./node_modules/@antv/util/esm/clear-animation-frame.js": +/*!**************************************************************!*\ + !*** ./node_modules/@antv/util/esm/clear-animation-frame.js ***! + \**************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n\n return _c(\"div\", {\n staticClass: \"code-edit\"\n }, [_c(\"MonacoEditor\", {\n key: _vm.randomKey,\n attrs: {\n code: _vm.code,\n theme: \"vs\",\n height: 300,\n options: _vm.options\n },\n on: {\n mounted: _vm.onMounted,\n codeChange: _vm.onCodeChange\n }\n })], 1);\n};\n\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack:///./src/components/dag/JSEditor.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%223d9796ac-vue-loader-template%22%7D!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return cancelAnimationFrame; });\nfunction cancelAnimationFrame(handler) {\n var method = window.cancelAnimationFrame ||\n window.webkitCancelAnimationFrame ||\n // @ts-ignore\n window.mozCancelAnimationFrame ||\n // @ts-ignore\n window.msCancelAnimationFrame ||\n clearTimeout;\n method(handler);\n}\n;\n//# sourceMappingURL=clear-animation-frame.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/clear-animation-frame.js?"); /***/ }), -/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"3d9796ac-vue-loader-template\"}!./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/PowerWorkflow.vue?vue&type=template&id=1175569f&scoped=true&": -/*!*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"3d9796ac-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/PowerWorkflow.vue?vue&type=template&id=1175569f&scoped=true& ***! - \*********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/*! exports provided: render, staticRenderFns */ +/***/ "./node_modules/@antv/util/esm/clone.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/util/esm/clone.js ***! + \**********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n\n return _c(\"div\", {\n ref: \"power-job\",\n staticClass: \"power-job\"\n }, [_c(\"div\", {\n staticClass: \"power-job-header\"\n }, [_c(\"div\", {\n staticClass: \"job-tools\"\n }, [_vm.onClickImportNode ? _c(\"div\", {\n on: {\n click: _vm.onClickImportNode\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.importJob\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-document-add\"\n })])], 1) : _vm._e(), _vm.mode !== \"view\" ? _c(\"div\", {\n on: {\n click: _vm.importJudgeNode\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.condition\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"iconfont icon-panduanti\"\n })])], 1) : _vm._e(), _vm.mode !== \"view\" ? _c(\"div\", {\n on: {\n click: _vm.importWorkflowNode\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.workflowChild\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"iconfont icon-workflow_\"\n })])], 1) : _vm._e(), _vm._t(\"tool\"), _c(\"div\", {\n on: {\n click: _vm.handleZoomOut\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.zoomOut\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-zoom-out\"\n })])], 1), _c(\"div\", {\n on: {\n click: _vm.handleZoomIn\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.zoomIn\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-zoom-in\"\n })])], 1), _c(\"div\", {\n on: {\n click: _vm.handleAutoFit\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.autoFit\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-aim\"\n })])], 1), _c(\"div\", {\n on: {\n click: _vm.fullScreen\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.fullScreen\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-full-screen\"\n })])], 1)], 2)]), _c(\"div\", {\n staticClass: \"power-job-body\"\n }, [_c(\"div\", {\n ref: \"powerDag\",\n staticClass: \"power-power-flow\",\n style: {\n width: `${_vm.size.width}px`\n }\n }), _vm.selectNode !== null ? _c(\"div\", {\n staticClass: \"power-job-detail\"\n }, [_vm._t(\"default\")], 2) : _vm._e()])]);\n};\n\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack:///./src/components/dag/PowerWorkflow.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%223d9796ac-vue-loader-template%22%7D!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); - -/***/ }), - -/***/ "./node_modules/color-convert/conversions.js": -/*!***************************************************!*\ - !*** ./node_modules/color-convert/conversions.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* MIT license */\nvar cssKeywords = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nvar reverseKeywords = {};\nfor (var key in cssKeywords) {\n\tif (cssKeywords.hasOwnProperty(key)) {\n\t\treverseKeywords[cssKeywords[key]] = key;\n\t}\n}\n\nvar convert = module.exports = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\n// hide .channels and .labels properties\nfor (var model in convert) {\n\tif (convert.hasOwnProperty(model)) {\n\t\tif (!('channels' in convert[model])) {\n\t\t\tthrow new Error('missing channels property: ' + model);\n\t\t}\n\n\t\tif (!('labels' in convert[model])) {\n\t\t\tthrow new Error('missing channel labels property: ' + model);\n\t\t}\n\n\t\tif (convert[model].labels.length !== convert[model].channels) {\n\t\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t\t}\n\n\t\tvar channels = convert[model].channels;\n\t\tvar labels = convert[model].labels;\n\t\tdelete convert[model].channels;\n\t\tdelete convert[model].labels;\n\t\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\t\tObject.defineProperty(convert[model], 'labels', {value: labels});\n\t}\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar min = Math.min(r, g, b);\n\tvar max = Math.max(r, g, b);\n\tvar delta = max - min;\n\tvar h;\n\tvar s;\n\tvar l;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tl = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tvar rdif;\n\tvar gdif;\n\tvar bdif;\n\tvar h;\n\tvar s;\n\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar v = Math.max(r, g, b);\n\tvar diff = v - Math.min(r, g, b);\n\tvar diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = s = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tvar r = rgb[0];\n\tvar g = rgb[1];\n\tvar b = rgb[2];\n\tvar h = convert.rgb.hsl(rgb)[0];\n\tvar w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar c;\n\tvar m;\n\tvar y;\n\tvar k;\n\n\tk = Math.min(1 - r, 1 - g, 1 - b);\n\tc = (1 - r - k) / (1 - k) || 0;\n\tm = (1 - g - k) / (1 - k) || 0;\n\ty = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\n/**\n * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n * */\nfunction comparativeDistance(x, y) {\n\treturn (\n\t\tMath.pow(x[0] - y[0], 2) +\n\t\tMath.pow(x[1] - y[1], 2) +\n\t\tMath.pow(x[2] - y[2], 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tvar reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tvar currentClosestDistance = Infinity;\n\tvar currentClosestKeyword;\n\n\tfor (var keyword in cssKeywords) {\n\t\tif (cssKeywords.hasOwnProperty(keyword)) {\n\t\t\tvar value = cssKeywords[keyword];\n\n\t\t\t// Compute comparative distance\n\t\t\tvar distance = comparativeDistance(rgb, value);\n\n\t\t\t// Check if its less, if so set as closest\n\t\t\tif (distance < currentClosestDistance) {\n\t\t\t\tcurrentClosestDistance = distance;\n\t\t\t\tcurrentClosestKeyword = keyword;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\n\t// assume sRGB\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tvar x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tvar y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tvar z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tvar xyz = convert.rgb.xyz(rgb);\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tvar h = hsl[0] / 360;\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar rgb;\n\tvar val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tt1 = 2 * l - t2;\n\n\trgb = [0, 0, 0];\n\tfor (var i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tvar h = hsl[0];\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar smin = s;\n\tvar lmin = Math.max(l, 0.01);\n\tvar sv;\n\tvar v;\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tv = (l + s) / 2;\n\tsv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tvar h = hsv[0] / 60;\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar hi = Math.floor(h) % 6;\n\n\tvar f = h - Math.floor(h);\n\tvar p = 255 * v * (1 - s);\n\tvar q = 255 * v * (1 - (s * f));\n\tvar t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tvar h = hsv[0];\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar vmin = Math.max(v, 0.01);\n\tvar lmin;\n\tvar sl;\n\tvar l;\n\n\tl = (2 - s) * v;\n\tlmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tvar h = hwb[0] / 360;\n\tvar wh = hwb[1] / 100;\n\tvar bl = hwb[2] / 100;\n\tvar ratio = wh + bl;\n\tvar i;\n\tvar v;\n\tvar f;\n\tvar n;\n\n\t// wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\ti = Math.floor(6 * h);\n\tv = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tn = wh + f * (v - wh); // linear interpolation\n\n\tvar r;\n\tvar g;\n\tvar b;\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tvar c = cmyk[0] / 100;\n\tvar m = cmyk[1] / 100;\n\tvar y = cmyk[2] / 100;\n\tvar k = cmyk[3] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = 1 - Math.min(1, c * (1 - k) + k);\n\tg = 1 - Math.min(1, m * (1 - k) + k);\n\tb = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tvar x = xyz[0] / 100;\n\tvar y = xyz[1] / 100;\n\tvar z = xyz[2] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar x;\n\tvar y;\n\tvar z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tvar y2 = Math.pow(y, 3);\n\tvar x2 = Math.pow(x, 3);\n\tvar z2 = Math.pow(z, 3);\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar hr;\n\tvar h;\n\tvar c;\n\n\thr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tc = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tvar l = lch[0];\n\tvar c = lch[1];\n\tvar h = lch[2];\n\tvar a;\n\tvar b;\n\tvar hr;\n\n\thr = h / 360 * 2 * Math.PI;\n\ta = c * Math.cos(hr);\n\tb = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\tvar value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tvar ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\n\t// we use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tvar ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tvar color = args % 10;\n\n\t// handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tvar mult = (~~(args > 50) + 1) * 0.5;\n\tvar r = ((color & 1) * mult) * 255;\n\tvar g = (((color >> 1) & 1) * mult) * 255;\n\tvar b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// handle greyscale\n\tif (args >= 232) {\n\t\tvar c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tvar rem;\n\tvar r = Math.floor(args / 36) / 5 * 255;\n\tvar g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tvar b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tvar integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tvar match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tvar colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(function (char) {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tvar integer = parseInt(colorString, 16);\n\tvar r = (integer >> 16) & 0xFF;\n\tvar g = (integer >> 8) & 0xFF;\n\tvar b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar max = Math.max(Math.max(r, g), b);\n\tvar min = Math.min(Math.min(r, g), b);\n\tvar chroma = (max - min);\n\tvar grayscale;\n\tvar hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma + 4;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar c = 1;\n\tvar f = 0;\n\n\tif (l < 0.5) {\n\t\tc = 2.0 * s * l;\n\t} else {\n\t\tc = 2.0 * s * (1.0 - l);\n\t}\n\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\n\tvar c = s * v;\n\tvar f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tvar h = hcg[0] / 360;\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tvar pure = [0, 0, 0];\n\tvar hi = (h % 1) * 6;\n\tvar v = hi % 1;\n\tvar w = 1 - v;\n\tvar mg = 0;\n\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar v = c + g * (1.0 - c);\n\tvar f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar l = g * (1.0 - c) + 0.5 * c;\n\tvar s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\tvar v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tvar w = hwb[1] / 100;\n\tvar b = hwb[2] / 100;\n\tvar v = 1 - b;\n\tvar c = v - w;\n\tvar g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = convert.gray.hsv = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tvar val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tvar integer = (val << 16) + (val << 8) + val;\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tvar val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n\n\n//# sourceURL=webpack:///./node_modules/color-convert/conversions.js?"); - -/***/ }), - -/***/ "./node_modules/color-convert/index.js": -/*!*********************************************!*\ - !*** ./node_modules/color-convert/index.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var conversions = __webpack_require__(/*! ./conversions */ \"./node_modules/color-convert/conversions.js\");\nvar route = __webpack_require__(/*! ./route */ \"./node_modules/color-convert/route.js\");\n\nvar convert = {};\n\nvar models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\tvar result = fn(args);\n\n\t\t// we're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (var len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(function (fromModel) {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tvar routes = route(fromModel);\n\tvar routeModels = Object.keys(routes);\n\n\trouteModels.forEach(function (toModel) {\n\t\tvar fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n\n\n//# sourceURL=webpack:///./node_modules/color-convert/index.js?"); - -/***/ }), - -/***/ "./node_modules/color-convert/route.js": -/*!*********************************************!*\ - !*** ./node_modules/color-convert/route.js ***! - \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var conversions = __webpack_require__(/*! ./conversions */ \"./node_modules/color-convert/conversions.js\");\n\n/*\n\tthis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tvar graph = buildGraph();\n\tvar queue = [fromModel]; // unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tvar current = queue.pop();\n\t\tvar adjacents = Object.keys(conversions[current]);\n\n\t\tfor (var len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tvar adjacent = adjacents[i];\n\t\t\tvar node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tvar path = [graph[toModel].parent, toModel];\n\tvar fn = conversions[graph[toModel].parent][toModel];\n\n\tvar cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tvar graph = deriveBFS(fromModel);\n\tvar conversion = {};\n\n\tvar models = Object.keys(graph);\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tvar toModel = models[i];\n\t\tvar node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// no possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n\n\n//# sourceURL=webpack:///./node_modules/color-convert/route.js?"); - -/***/ }), - -/***/ "./node_modules/color-name/index.js": -/*!******************************************!*\ - !*** ./node_modules/color-name/index.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -"use strict"; -eval("\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/color-name/index.js?"); - -/***/ }), - -/***/ "./node_modules/color-string/index.js": -/*!********************************************!*\ - !*** ./node_modules/color-string/index.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\nvar swizzle = __webpack_require__(/*! simple-swizzle */ \"./node_modules/simple-swizzle/index.js\");\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^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*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^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*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n\n\n//# sourceURL=webpack:///./node_modules/color-string/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\nvar clone = function (obj) {\n if (typeof obj !== 'object' || obj === null) {\n return obj;\n }\n var rst;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj)) {\n rst = [];\n for (var i = 0, l = obj.length; i < l; i++) {\n if (typeof obj[i] === 'object' && obj[i] != null) {\n rst[i] = clone(obj[i]);\n }\n else {\n rst[i] = obj[i];\n }\n }\n }\n else {\n rst = {};\n for (var k in obj) {\n if (typeof obj[k] === 'object' && obj[k] != null) {\n rst[k] = clone(obj[k]);\n }\n else {\n rst[k] = obj[k];\n }\n }\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (clone);\n//# sourceMappingURL=clone.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/clone.js?"); /***/ }), -/***/ "./node_modules/color/index.js": -/*!*************************************!*\ - !*** ./node_modules/color/index.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/contains.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/contains.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\n\nvar colorString = __webpack_require__(/*! color-string */ \"./node_modules/color-string/index.js\");\nvar convert = __webpack_require__(/*! color-convert */ \"./node_modules/color-convert/index.js\");\n\nvar _slice = [].slice;\n\nvar skippedModels = [\n\t// to be honest, I don't really feel like keyword belongs in color convert, but eh.\n\t'keyword',\n\n\t// gray conflicts with some method names, and has its own method defined.\n\t'gray',\n\n\t// shouldn't really be in color-convert either...\n\t'hex'\n];\n\nvar hashedModelKeys = {};\nObject.keys(convert).forEach(function (model) {\n\thashedModelKeys[_slice.call(convert[model].labels).sort().join('')] = model;\n});\n\nvar limiters = {};\n\nfunction Color(obj, model) {\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj, model);\n\t}\n\n\tif (model && model in skippedModels) {\n\t\tmodel = null;\n\t}\n\n\tif (model && !(model in convert)) {\n\t\tthrow new Error('Unknown model: ' + model);\n\t}\n\n\tvar i;\n\tvar channels;\n\n\tif (obj == null) { // eslint-disable-line no-eq-null,eqeqeq\n\t\tthis.model = 'rgb';\n\t\tthis.color = [0, 0, 0];\n\t\tthis.valpha = 1;\n\t} else if (obj instanceof Color) {\n\t\tthis.model = obj.model;\n\t\tthis.color = obj.color.slice();\n\t\tthis.valpha = obj.valpha;\n\t} else if (typeof obj === 'string') {\n\t\tvar result = colorString.get(obj);\n\t\tif (result === null) {\n\t\t\tthrow new Error('Unable to parse color from string: ' + obj);\n\t\t}\n\n\t\tthis.model = result.model;\n\t\tchannels = convert[this.model].channels;\n\t\tthis.color = result.value.slice(0, channels);\n\t\tthis.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;\n\t} else if (obj.length) {\n\t\tthis.model = model || 'rgb';\n\t\tchannels = convert[this.model].channels;\n\t\tvar newArr = _slice.call(obj, 0, channels);\n\t\tthis.color = zeroArray(newArr, channels);\n\t\tthis.valpha = typeof obj[channels] === 'number' ? obj[channels] : 1;\n\t} else if (typeof obj === 'number') {\n\t\t// this is always RGB - can be converted later on.\n\t\tobj &= 0xFFFFFF;\n\t\tthis.model = 'rgb';\n\t\tthis.color = [\n\t\t\t(obj >> 16) & 0xFF,\n\t\t\t(obj >> 8) & 0xFF,\n\t\t\tobj & 0xFF\n\t\t];\n\t\tthis.valpha = 1;\n\t} else {\n\t\tthis.valpha = 1;\n\n\t\tvar keys = Object.keys(obj);\n\t\tif ('alpha' in obj) {\n\t\t\tkeys.splice(keys.indexOf('alpha'), 1);\n\t\t\tthis.valpha = typeof obj.alpha === 'number' ? obj.alpha : 0;\n\t\t}\n\n\t\tvar hashedKeys = keys.sort().join('');\n\t\tif (!(hashedKeys in hashedModelKeys)) {\n\t\t\tthrow new Error('Unable to parse color from object: ' + JSON.stringify(obj));\n\t\t}\n\n\t\tthis.model = hashedModelKeys[hashedKeys];\n\n\t\tvar labels = convert[this.model].labels;\n\t\tvar color = [];\n\t\tfor (i = 0; i < labels.length; i++) {\n\t\t\tcolor.push(obj[labels[i]]);\n\t\t}\n\n\t\tthis.color = zeroArray(color);\n\t}\n\n\t// perform limitations (clamping, etc.)\n\tif (limiters[this.model]) {\n\t\tchannels = convert[this.model].channels;\n\t\tfor (i = 0; i < channels; i++) {\n\t\t\tvar limit = limiters[this.model][i];\n\t\t\tif (limit) {\n\t\t\t\tthis.color[i] = limit(this.color[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.valpha = Math.max(0, Math.min(1, this.valpha));\n\n\tif (Object.freeze) {\n\t\tObject.freeze(this);\n\t}\n}\n\nColor.prototype = {\n\ttoString: function () {\n\t\treturn this.string();\n\t},\n\n\ttoJSON: function () {\n\t\treturn this[this.model]();\n\t},\n\n\tstring: function (places) {\n\t\tvar self = this.model in colorString.to ? this : this.rgb();\n\t\tself = self.round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to[self.model](args);\n\t},\n\n\tpercentString: function (places) {\n\t\tvar self = this.rgb().round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to.rgb.percent(args);\n\t},\n\n\tarray: function () {\n\t\treturn this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);\n\t},\n\n\tobject: function () {\n\t\tvar result = {};\n\t\tvar channels = convert[this.model].channels;\n\t\tvar labels = convert[this.model].labels;\n\n\t\tfor (var i = 0; i < channels; i++) {\n\t\t\tresult[labels[i]] = this.color[i];\n\t\t}\n\n\t\tif (this.valpha !== 1) {\n\t\t\tresult.alpha = this.valpha;\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tunitArray: function () {\n\t\tvar rgb = this.rgb().color;\n\t\trgb[0] /= 255;\n\t\trgb[1] /= 255;\n\t\trgb[2] /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.push(this.valpha);\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tunitObject: function () {\n\t\tvar rgb = this.rgb().object();\n\t\trgb.r /= 255;\n\t\trgb.g /= 255;\n\t\trgb.b /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.alpha = this.valpha;\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tround: function (places) {\n\t\tplaces = Math.max(places || 0, 0);\n\t\treturn new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);\n\t},\n\n\talpha: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);\n\t\t}\n\n\t\treturn this.valpha;\n\t},\n\n\t// rgb\n\tred: getset('rgb', 0, maxfn(255)),\n\tgreen: getset('rgb', 1, maxfn(255)),\n\tblue: getset('rgb', 2, maxfn(255)),\n\n\thue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, function (val) { return ((val % 360) + 360) % 360; }), // eslint-disable-line brace-style\n\n\tsaturationl: getset('hsl', 1, maxfn(100)),\n\tlightness: getset('hsl', 2, maxfn(100)),\n\n\tsaturationv: getset('hsv', 1, maxfn(100)),\n\tvalue: getset('hsv', 2, maxfn(100)),\n\n\tchroma: getset('hcg', 1, maxfn(100)),\n\tgray: getset('hcg', 2, maxfn(100)),\n\n\twhite: getset('hwb', 1, maxfn(100)),\n\twblack: getset('hwb', 2, maxfn(100)),\n\n\tcyan: getset('cmyk', 0, maxfn(100)),\n\tmagenta: getset('cmyk', 1, maxfn(100)),\n\tyellow: getset('cmyk', 2, maxfn(100)),\n\tblack: getset('cmyk', 3, maxfn(100)),\n\n\tx: getset('xyz', 0, maxfn(100)),\n\ty: getset('xyz', 1, maxfn(100)),\n\tz: getset('xyz', 2, maxfn(100)),\n\n\tl: getset('lab', 0, maxfn(100)),\n\ta: getset('lab', 1),\n\tb: getset('lab', 2),\n\n\tkeyword: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn convert[this.model].keyword(this.color);\n\t},\n\n\thex: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn colorString.to.hex(this.rgb().round().color);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.rgb().color;\n\t\treturn ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.rgb().color;\n\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tisDark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.rgb().color;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tisLight: function () {\n\t\treturn !this.isDark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = this.rgb();\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb.color[i] = 255 - rgb.color[i];\n\t\t}\n\t\treturn rgb;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] += hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] -= hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] += hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] -= hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[1] += hwb.color[1] * ratio;\n\t\treturn hwb;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[2] += hwb.color[2] * ratio;\n\t\treturn hwb;\n\t},\n\n\tgrayscale: function () {\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar rgb = this.rgb().color;\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\treturn Color.rgb(val, val, val);\n\t},\n\n\tfade: function (ratio) {\n\t\treturn this.alpha(this.valpha - (this.valpha * ratio));\n\t},\n\n\topaquer: function (ratio) {\n\t\treturn this.alpha(this.valpha + (this.valpha * ratio));\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.hsl();\n\t\tvar hue = hsl.color[0];\n\t\thue = (hue + degrees) % 360;\n\t\thue = hue < 0 ? 360 + hue : hue;\n\t\thsl.color[0] = hue;\n\t\treturn hsl;\n\t},\n\n\tmix: function (mixinColor, weight) {\n\t\t// ported from sass implementation in C\n\t\t// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t\tif (!mixinColor || !mixinColor.rgb) {\n\t\t\tthrow new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + typeof mixinColor);\n\t\t}\n\t\tvar color1 = mixinColor.rgb();\n\t\tvar color2 = this.rgb();\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn Color.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue(),\n\t\t\t\tcolor1.alpha() * p + color2.alpha() * (1 - p));\n\t}\n};\n\n// model conversion methods and static constructors\nObject.keys(convert).forEach(function (model) {\n\tif (skippedModels.indexOf(model) !== -1) {\n\t\treturn;\n\t}\n\n\tvar channels = convert[model].channels;\n\n\t// conversion methods\n\tColor.prototype[model] = function () {\n\t\tif (this.model === model) {\n\t\t\treturn new Color(this);\n\t\t}\n\n\t\tif (arguments.length) {\n\t\t\treturn new Color(arguments, model);\n\t\t}\n\n\t\tvar newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;\n\t\treturn new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);\n\t};\n\n\t// 'static' construction methods\n\tColor[model] = function (color) {\n\t\tif (typeof color === 'number') {\n\t\t\tcolor = zeroArray(_slice.call(arguments), channels);\n\t\t}\n\t\treturn new Color(color, model);\n\t};\n});\n\nfunction roundTo(num, places) {\n\treturn Number(num.toFixed(places));\n}\n\nfunction roundToPlace(places) {\n\treturn function (num) {\n\t\treturn roundTo(num, places);\n\t};\n}\n\nfunction getset(model, channel, modifier) {\n\tmodel = Array.isArray(model) ? model : [model];\n\n\tmodel.forEach(function (m) {\n\t\t(limiters[m] || (limiters[m] = []))[channel] = modifier;\n\t});\n\n\tmodel = model[0];\n\n\treturn function (val) {\n\t\tvar result;\n\n\t\tif (arguments.length) {\n\t\t\tif (modifier) {\n\t\t\t\tval = modifier(val);\n\t\t\t}\n\n\t\t\tresult = this[model]();\n\t\t\tresult.color[channel] = val;\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = this[model]().color[channel];\n\t\tif (modifier) {\n\t\t\tresult = modifier(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction maxfn(max) {\n\treturn function (v) {\n\t\treturn Math.max(0, Math.min(max, v));\n\t};\n}\n\nfunction assertArray(val) {\n\treturn Array.isArray(val) ? val : [val];\n}\n\nfunction zeroArray(arr, length) {\n\tfor (var i = 0; i < length; i++) {\n\t\tif (typeof arr[i] !== 'number') {\n\t\t\tarr[i] = 0;\n\t\t}\n\t}\n\n\treturn arr;\n}\n\nmodule.exports = Color;\n\n\n//# sourceURL=webpack:///./node_modules/color/index.js?"); - -/***/ }), - -/***/ "./node_modules/core-js/internals/a-possible-prototype.js": -/*!****************************************************************!*\ - !*** ./node_modules/core-js/internals/a-possible-prototype.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js/internals/is-callable.js\");\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (typeof argument == 'object' || isCallable(argument)) return argument;\n throw $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/a-possible-prototype.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar contains = function (arr, value) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return false;\n }\n return arr.indexOf(value) > -1;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (contains);\n//# sourceMappingURL=contains.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/contains.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/array-method-is-strict.js": -/*!******************************************************************!*\ - !*** ./node_modules/core-js/internals/array-method-is-strict.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/debounce.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/debounce.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js/internals/fails.js\");\n\nmodule.exports = function (METHOD_NAME, argument) {\n var method = [][METHOD_NAME];\n return !!method && fails(function () {\n // eslint-disable-next-line no-useless-call -- required for testing\n method.call(null, argument || function () { return 1; }, 1);\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/array-method-is-strict.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nfunction debounce(func, wait, immediate) {\n var timeout;\n return function () {\n var context = this, args = arguments;\n var later = function () {\n timeout = null;\n if (!immediate) {\n func.apply(context, args);\n }\n };\n var callNow = immediate && !timeout;\n clearTimeout(timeout);\n timeout = setTimeout(later, wait);\n if (callNow) {\n func.apply(context, args);\n }\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (debounce);\n//# sourceMappingURL=debounce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/debounce.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/array-reduce.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/internals/array-reduce.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/deep-mix.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/deep-mix.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js/internals/a-callable.js\");\nvar toObject = __webpack_require__(/*! ../internals/to-object */ \"./node_modules/core-js/internals/to-object.js\");\nvar IndexedObject = __webpack_require__(/*! ../internals/indexed-object */ \"./node_modules/core-js/internals/indexed-object.js\");\nvar lengthOfArrayLike = __webpack_require__(/*! ../internals/length-of-array-like */ \"./node_modules/core-js/internals/length-of-array-like.js\");\n\nvar $TypeError = TypeError;\n\n// `Array.prototype.{ reduce, reduceRight }` methods implementation\nvar createMethod = function (IS_RIGHT) {\n return function (that, callbackfn, argumentsLength, memo) {\n aCallable(callbackfn);\n var O = toObject(that);\n var self = IndexedObject(O);\n var length = lengthOfArrayLike(O);\n var index = IS_RIGHT ? length - 1 : 0;\n var i = IS_RIGHT ? -1 : 1;\n if (argumentsLength < 2) while (true) {\n if (index in self) {\n memo = self[index];\n index += i;\n break;\n }\n index += i;\n if (IS_RIGHT ? index < 0 : length <= index) {\n throw $TypeError('Reduce of empty array with no initial value');\n }\n }\n for (;IS_RIGHT ? index >= 0 : length > index; index += i) if (index in self) {\n memo = callbackfn(memo, self[index], index, O);\n }\n return memo;\n };\n};\n\nmodule.exports = {\n // `Array.prototype.reduce` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduce\n left: createMethod(false),\n // `Array.prototype.reduceRight` method\n // https://tc39.es/ecma262/#sec-array.prototype.reduceright\n right: createMethod(true)\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/array-reduce.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n\n\nvar MAX_MIX_LEVEL = 5;\nfunction _deepMix(dist, src, level, maxLevel) {\n level = level || 0;\n maxLevel = maxLevel || MAX_MIX_LEVEL;\n for (var key in src) {\n if (src.hasOwnProperty(key)) {\n var value = src[key];\n if (value !== null && Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n if (!Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(dist[key])) {\n dist[key] = {};\n }\n if (level < maxLevel) {\n _deepMix(dist[key], value, level + 1, maxLevel);\n }\n else {\n dist[key] = src[key];\n }\n }\n else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n dist[key] = [];\n dist[key] = dist[key].concat(value);\n }\n else if (value !== undefined) {\n dist[key] = value;\n }\n }\n }\n}\n// todo 重写\nvar deepMix = function (rst) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < args.length; i += 1) {\n _deepMix(rst, args[i]);\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (deepMix);\n//# sourceMappingURL=deep-mix.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/deep-mix.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/classof.js": +/***/ "./node_modules/@antv/util/esm/difference.js": /*!***************************************************!*\ - !*** ./node_modules/core-js/internals/classof.js ***! + !*** ./node_modules/@antv/util/esm/difference.js ***! \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ \"./node_modules/core-js/internals/to-string-tag-support.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js/internals/is-callable.js\");\nvar classofRaw = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js/internals/classof-raw.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js/internals/well-known-symbol.js\");\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) == 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) == 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/classof.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./filter */ \"./node_modules/@antv/util/esm/filter.js\");\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/util/esm/contains.js\");\n\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to inspect.\n * @param {Array} values The values to exclude.\n * @return {Array} Returns the new array of filtered values.\n * @example\n * difference([2, 1], [2, 3]); // => [1]\n */\nvar difference = function (arr, values) {\n if (values === void 0) { values = []; }\n return Object(_filter__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr, function (value) { return !Object(_contains__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(values, value); });\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (difference);\n//# sourceMappingURL=difference.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/difference.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/engine-is-node.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/engine-is-node.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/each.js": +/*!*********************************************!*\ + !*** ./node_modules/@antv/util/esm/each.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var classof = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js/internals/classof-raw.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js/internals/global.js\");\n\nmodule.exports = classof(global.process) == 'process';\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/engine-is-node.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/util/esm/is-object.js\");\n\n\nfunction each(elements, func) {\n if (!elements) {\n return;\n }\n var rst;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(elements)) {\n for (var i = 0, len = elements.length; i < len; i++) {\n rst = func(elements[i], i);\n if (rst === false) {\n break;\n }\n }\n }\n else if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(elements)) {\n for (var k in elements) {\n if (elements.hasOwnProperty(k)) {\n rst = func(elements[k], k);\n if (rst === false) {\n break;\n }\n }\n }\n }\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (each);\n//# sourceMappingURL=each.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/each.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/error-stack-clear.js": -/*!*************************************************************!*\ - !*** ./node_modules/core-js/internals/error-stack-clear.js ***! - \*************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/ends-with.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/util/esm/ends-with.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js/internals/function-uncurry-this.js\");\n\nvar $Error = Error;\nvar replace = uncurryThis(''.replace);\n\nvar TEST = (function (arg) { return String($Error(arg).stack); })('zxcasd');\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\n\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {\n while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n } return stack;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/error-stack-clear.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n\nfunction endsWith(arr, e) {\n return (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr)) ? arr[arr.length - 1] === e : false;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (endsWith);\n//# sourceMappingURL=ends-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/ends-with.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/error-stack-installable.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/internals/error-stack-installable.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/every.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/util/esm/every.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js/internals/fails.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js/internals/create-property-descriptor.js\");\n\nmodule.exports = !fails(function () {\n var error = Error('a');\n if (!('stack' in error)) return true;\n // eslint-disable-next-line es-x/no-object-defineproperty -- safe\n Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));\n return error.stack !== 7;\n});\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/error-stack-installable.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 只要有一个不满足条件就返回 false\n * @param arr\n * @param func\n */\nvar every = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (!func(arr[i], i))\n return false;\n }\n return true;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (every);\n//# sourceMappingURL=every.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/every.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/function-apply.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/function-apply.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/extend.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/extend.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es-x/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/function-apply.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/util/esm/mix.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\nvar extend = function (subclass, superclass, overrides, staticOverrides) {\n // 如果只提供父类构造函数,则自动生成子类构造函数\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(superclass)) {\n overrides = superclass;\n superclass = subclass;\n subclass = function () { };\n }\n var create = Object.create ?\n function (proto, c) {\n return Object.create(proto, {\n constructor: {\n value: c\n }\n });\n } :\n function (proto, c) {\n function Tmp() { }\n Tmp.prototype = proto;\n var o = new Tmp();\n o.constructor = c;\n return o;\n };\n var superObj = create(superclass.prototype, subclass); // new superclass(),//实例化父类作为子类的prototype\n subclass.prototype = Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(superObj, subclass.prototype); // 指定子类的prototype\n subclass.superclass = create(superclass.prototype, superclass);\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(superObj, overrides);\n Object(_mix__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(subclass, staticOverrides);\n return subclass;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (extend);\n//# sourceMappingURL=extend.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/extend.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/inherit-if-required.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/internals/inherit-if-required.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/filter.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/filter.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js/internals/is-callable.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js/internals/is-object.js\");\nvar setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ \"./node_modules/core-js/internals/object-set-prototype-of.js\");\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/inherit-if-required.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar filter = function (arr, func) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n if (func(value, index)) {\n result.push(value);\n }\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (filter);\n//# sourceMappingURL=filter.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/filter.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/install-error-cause.js": -/*!***************************************************************!*\ - !*** ./node_modules/core-js/internals/install-error-cause.js ***! - \***************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/find-index.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/find-index.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js/internals/is-object.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js/internals/create-non-enumerable-property.js\");\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/install-error-cause.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nfunction findIndex(arr, predicate, fromIndex) {\n if (fromIndex === void 0) { fromIndex = 0; }\n for (var i = fromIndex; i < arr.length; i++) {\n if (predicate(arr[i], i)) {\n // 找到终止循环\n return i;\n }\n }\n return -1;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (findIndex);\n//# sourceMappingURL=find-index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/find-index.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/normalize-string-argument.js": -/*!*********************************************************************!*\ - !*** ./node_modules/core-js/internals/normalize-string-argument.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/find.js": +/*!*********************************************!*\ + !*** ./node_modules/@antv/util/esm/find.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var toString = __webpack_require__(/*! ../internals/to-string */ \"./node_modules/core-js/internals/to-string.js\");\n\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/normalize-string-argument.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n/* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-match */ \"./node_modules/@antv/util/esm/is-match.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n\n\n\n\nfunction find(arr, predicate) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arr))\n return null;\n var _predicate;\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(predicate)) {\n _predicate = predicate;\n }\n if (Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(predicate)) {\n _predicate = function (a) { return Object(_is_match__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(a, predicate); };\n }\n if (_predicate) {\n for (var i = 0; i < arr.length; i += 1) {\n if (_predicate(arr[i])) {\n return arr[i];\n }\n }\n }\n return null;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (find);\n//# sourceMappingURL=find.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/find.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/object-set-prototype-of.js": -/*!*******************************************************************!*\ - !*** ./node_modules/core-js/internals/object-set-prototype-of.js ***! - \*******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/first-value.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/util/esm/first-value.js ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("/* eslint-disable no-proto -- safe */\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js/internals/function-uncurry-this.js\");\nvar anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js/internals/an-object.js\");\nvar aPossiblePrototype = __webpack_require__(/*! ../internals/a-possible-prototype */ \"./node_modules/core-js/internals/a-possible-prototype.js\");\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es-x/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n // eslint-disable-next-line es-x/no-object-getownpropertydescriptor -- safe\n setter = uncurryThis(Object.getOwnPropertyDescriptor(Object.prototype, '__proto__').set);\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/object-set-prototype-of.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n\nvar firstValue = function (data, name) {\n var rst = null;\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n rst = value[0]; // todo 这里是否应该使用递归,调用 firstValue @绝云\n }\n else {\n rst = value;\n }\n break;\n }\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (firstValue);\n//# sourceMappingURL=first-value.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/first-value.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/proxy-accessor.js": -/*!**********************************************************!*\ - !*** ./node_modules/core-js/internals/proxy-accessor.js ***! - \**********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/fixed-base.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/fixed-base.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var defineProperty = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js/internals/object-define-property.js\").f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/proxy-accessor.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar fixedBase = function (v, base) {\n var str = base.toString();\n var index = str.indexOf('.');\n if (index === -1) {\n return Math.round(v);\n }\n var length = str.substr(index + 1).length;\n if (length > 20) {\n length = 20;\n }\n return parseFloat(v.toFixed(length));\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (fixedBase);\n//# sourceMappingURL=fixed-base.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/fixed-base.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/to-string-tag-support.js": -/*!*****************************************************************!*\ - !*** ./node_modules/core-js/internals/to-string-tag-support.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/flatten-deep.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/util/esm/flatten-deep.js ***! + \*****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js/internals/well-known-symbol.js\");\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/to-string-tag-support.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @param {Array} result The array to return.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flattenDeep([1, [2, [3, [4]], 5]]); // => [1, 2, 3, 4, 5]\n */\nvar flattenDeep = function (arr, result) {\n if (result === void 0) { result = []; }\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n result.push(arr);\n }\n else {\n for (var i = 0; i < arr.length; i += 1) {\n flattenDeep(arr[i], result);\n }\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (flattenDeep);\n//# sourceMappingURL=flatten-deep.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/flatten-deep.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/to-string.js": -/*!*****************************************************!*\ - !*** ./node_modules/core-js/internals/to-string.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/flatten.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/flatten.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("var classof = __webpack_require__(/*! ../internals/classof */ \"./node_modules/core-js/internals/classof.js\");\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/to-string.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n/**\n * Flattens `array` a single level deep.\n *\n * @param {Array} arr The array to flatten.\n * @return {Array} Returns the new flattened array.\n * @example\n *\n * flatten([1, [2, [3, [4]], 5]]); // => [1, 2, [3, [4]], 5]\n */\nvar flatten = function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return [];\n }\n var rst = [];\n for (var i = 0; i < arr.length; i++) {\n rst = rst.concat(arr[i]);\n }\n return rst;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (flatten);\n//# sourceMappingURL=flatten.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/flatten.js?"); /***/ }), -/***/ "./node_modules/core-js/internals/wrap-error-constructor-with-cause.js": -/*!*****************************************************************************!*\ - !*** ./node_modules/core-js/internals/wrap-error-constructor-with-cause.js ***! - \*****************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/for-in.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/for-in.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js/internals/get-built-in.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js/internals/has-own-property.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js/internals/create-non-enumerable-property.js\");\nvar isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ \"./node_modules/core-js/internals/object-is-prototype-of.js\");\nvar setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ \"./node_modules/core-js/internals/object-set-prototype-of.js\");\nvar copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ \"./node_modules/core-js/internals/copy-constructor-properties.js\");\nvar proxyAccessor = __webpack_require__(/*! ../internals/proxy-accessor */ \"./node_modules/core-js/internals/proxy-accessor.js\");\nvar inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ \"./node_modules/core-js/internals/inherit-if-required.js\");\nvar normalizeStringArgument = __webpack_require__(/*! ../internals/normalize-string-argument */ \"./node_modules/core-js/internals/normalize-string-argument.js\");\nvar installErrorCause = __webpack_require__(/*! ../internals/install-error-cause */ \"./node_modules/core-js/internals/install-error-cause.js\");\nvar clearErrorStack = __webpack_require__(/*! ../internals/error-stack-clear */ \"./node_modules/core-js/internals/error-stack-clear.js\");\nvar ERROR_STACK_INSTALLABLE = __webpack_require__(/*! ../internals/error-stack-installable */ \"./node_modules/core-js/internals/error-stack-installable.js\");\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js/internals/descriptors.js\");\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js/internals/is-pure.js\");\n\nmodule.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {\n var STACK_TRACE_LIMIT = 'stackTraceLimit';\n var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;\n var path = FULL_NAME.split('.');\n var ERROR_NAME = path[path.length - 1];\n var OriginalError = getBuiltIn.apply(null, path);\n\n if (!OriginalError) return;\n\n var OriginalErrorPrototype = OriginalError.prototype;\n\n // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006\n if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;\n\n if (!FORCED) return OriginalError;\n\n var BaseError = getBuiltIn('Error');\n\n var WrappedError = wrapper(function (a, b) {\n var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);\n var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();\n if (message !== undefined) createNonEnumerableProperty(result, 'message', message);\n if (ERROR_STACK_INSTALLABLE) createNonEnumerableProperty(result, 'stack', clearErrorStack(result.stack, 2));\n if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);\n if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);\n return result;\n });\n\n WrappedError.prototype = OriginalErrorPrototype;\n\n if (ERROR_NAME !== 'Error') {\n if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);\n else copyConstructorProperties(WrappedError, BaseError, { name: true });\n } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {\n proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);\n proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');\n }\n\n copyConstructorProperties(WrappedError, OriginalError);\n\n if (!IS_PURE) try {\n // Safari 13- bug: WebAssembly errors does not have a proper `.name`\n if (OriginalErrorPrototype.name !== ERROR_NAME) {\n createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);\n }\n OriginalErrorPrototype.constructor = WrappedError;\n } catch (error) { /* empty */ }\n\n return WrappedError;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/wrap-error-constructor-with-cause.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n//# sourceMappingURL=for-in.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/for-in.js?"); /***/ }), -/***/ "./node_modules/core-js/modules/es.array.reduce.js": -/*!*********************************************************!*\ - !*** ./node_modules/core-js/modules/es.array.reduce.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/get-ellipsis-text.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/util/esm/get-ellipsis-text.js ***! + \**********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js/internals/export.js\");\nvar $reduce = __webpack_require__(/*! ../internals/array-reduce */ \"./node_modules/core-js/internals/array-reduce.js\").left;\nvar arrayMethodIsStrict = __webpack_require__(/*! ../internals/array-method-is-strict */ \"./node_modules/core-js/internals/array-method-is-strict.js\");\nvar CHROME_VERSION = __webpack_require__(/*! ../internals/engine-v8-version */ \"./node_modules/core-js/internals/engine-v8-version.js\");\nvar IS_NODE = __webpack_require__(/*! ../internals/engine-is-node */ \"./node_modules/core-js/internals/engine-is-node.js\");\n\nvar STRICT_METHOD = arrayMethodIsStrict('reduce');\n// Chrome 80-82 has a critical bug\n// https://bugs.chromium.org/p/chromium/issues/detail?id=1049982\nvar CHROME_BUG = !IS_NODE && CHROME_VERSION > 79 && CHROME_VERSION < 83;\n\n// `Array.prototype.reduce` method\n// https://tc39.es/ecma262/#sec-array.prototype.reduce\n$({ target: 'Array', proto: true, forced: !STRICT_METHOD || CHROME_BUG }, {\n reduce: function reduce(callbackfn /* , initialValue */) {\n var length = arguments.length;\n return $reduce(this, callbackfn, length, length > 1 ? arguments[1] : undefined);\n }\n});\n\n\n//# sourceURL=webpack:///./node_modules/core-js/modules/es.array.reduce.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n/* harmony import */ var _measure_text_width__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./measure-text-width */ \"./node_modules/@antv/util/esm/measure-text-width.js\");\n\n\n\n/**\n * 获取文本的 ... 文本。\n * 算法(减少每次 measureText 的长度,measureText 的性能跟字符串时间相关):\n * 1. 先通过 STEP 逐步计算,找到最后一个小于 maxWidth 的字符串\n * 2. 然后对最后这个字符串二分计算\n * @param text 需要计算的文本, 由于历史原因 除了支持string,还支持空值,number和数组等\n * @param maxWidth 最大宽度\n * @param font 字体\n * @param str 要替换的文本\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (text, maxWidth, font, str) {\n if (str === void 0) { str = '...'; }\n var STEP = 16; // 每次 16,调参工程师\n var PLACEHOLDER_WIDTH = Object(_measure_text_width__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(str, font);\n var leftText = !Object(_is_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(text) ? Object(_to_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(text) : text;\n var leftWidth = maxWidth;\n var r = []; // 最终的分段字符串\n var currentText;\n var currentWidth;\n if (Object(_measure_text_width__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(text, font) <= maxWidth) {\n return text;\n }\n // 首先通过 step 计算,找出最大的未超出长度的\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // 更新字符串\n currentText = leftText.substr(0, STEP);\n // 计算宽度\n currentWidth = Object(_measure_text_width__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(currentText, font);\n // 超出剩余宽度,则停止\n if (currentWidth + PLACEHOLDER_WIDTH > leftWidth) {\n if (currentWidth > leftWidth) {\n break;\n }\n }\n r.push(currentText);\n // 没有超出,则计算剩余宽度\n leftWidth -= currentWidth;\n leftText = leftText.substr(STEP);\n // 字符串整体没有超出\n if (!leftText) {\n return r.join('');\n }\n }\n // 最下的最后一个 STEP,使用 1 递增(用二分效果更高)\n // eslint-disable-next-line no-constant-condition\n while (true) {\n // 更新字符串\n currentText = leftText.substr(0, 1);\n // 计算宽度\n currentWidth = Object(_measure_text_width__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(currentText, font);\n // 超出剩余宽度,则停止\n if (currentWidth + PLACEHOLDER_WIDTH > leftWidth) {\n break;\n }\n r.push(currentText);\n // 没有超出,则计算剩余宽度\n leftWidth -= currentWidth;\n leftText = leftText.substr(1);\n if (!leftText) {\n return r.join('');\n }\n }\n return \"\" + r.join('') + str;\n});\n//# sourceMappingURL=get-ellipsis-text.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get-ellipsis-text.js?"); /***/ }), -/***/ "./node_modules/core-js/modules/es.error.cause.js": -/*!********************************************************!*\ - !*** ./node_modules/core-js/modules/es.error.cause.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/get-range.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/util/esm/get-range.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("/* eslint-disable no-unused-vars -- required for functions `.length` */\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js/internals/export.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js/internals/global.js\");\nvar apply = __webpack_require__(/*! ../internals/function-apply */ \"./node_modules/core-js/internals/function-apply.js\");\nvar wrapErrorConstructorWithCause = __webpack_require__(/*! ../internals/wrap-error-constructor-with-cause */ \"./node_modules/core-js/internals/wrap-error-constructor-with-cause.js\");\n\nvar WEB_ASSEMBLY = 'WebAssembly';\nvar WebAssembly = global[WEB_ASSEMBLY];\n\nvar FORCED = Error('e', { cause: 7 }).cause !== 7;\n\nvar exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);\n $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);\n};\n\nvar exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n if (WebAssembly && WebAssembly[ERROR_NAME]) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);\n $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);\n }\n};\n\n// https://github.com/tc39/proposal-error-cause\nexportGlobalErrorCauseWrapper('Error', function (init) {\n return function Error(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('EvalError', function (init) {\n return function EvalError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('RangeError', function (init) {\n return function RangeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('ReferenceError', function (init) {\n return function ReferenceError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('SyntaxError', function (init) {\n return function SyntaxError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('TypeError', function (init) {\n return function TypeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('URIError', function (init) {\n return function URIError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('CompileError', function (init) {\n return function CompileError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('LinkError', function (init) {\n return function LinkError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {\n return function RuntimeError(message) { return apply(init, this, arguments); };\n});\n\n\n//# sourceURL=webpack:///./node_modules/core-js/modules/es.error.cause.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _max__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./max */ \"./node_modules/@antv/util/esm/max.js\");\n/* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./min */ \"./node_modules/@antv/util/esm/min.js\");\n\n\n\nvar getRange = function (values) {\n // 存在 NaN 时,min,max 判定会出问题\n var filterValues = values.filter(function (v) { return !isNaN(v); });\n if (!filterValues.length) {\n // 如果没有数值则直接返回0\n return {\n min: 0,\n max: 0,\n };\n }\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(values[0])) {\n var tmp = [];\n for (var i = 0; i < values.length; i++) {\n tmp = tmp.concat(values[i]);\n }\n filterValues = tmp;\n }\n var max = Object(_max__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(filterValues);\n var min = Object(_min__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(filterValues);\n return {\n min: min,\n max: max,\n };\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (getRange);\n//# sourceMappingURL=get-range.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get-range.js?"); /***/ }), -/***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/JSEditor.vue?vue&type=style&index=0&id=123e60ea&lang=css&": -/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/JSEditor.vue?vue&type=style&index=0&id=123e60ea&lang=css& ***! - \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/get-type.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/get-type.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"\\n.code-edit {\\n border: 1px solid #f0f0f0;\\n}\\n.code-edit .margin-view-overlays.monaco-editor-background {\\n width: 0px !important;\\n}\\n.code-edit .margin-view-overlays.monaco-editor-background .view-line .line-numbers {\\n width: 24px !important;\\n left: 0px !important;\\n}\\n.code-edit .margin-view-overlays.monaco-editor-background .glyph-margin {\\n width: 0px !important;\\n}\\n.code-edit .monaco-scrollable-element.editor-scrollable {\\n left: 32px !important;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack:///./src/components/dag/JSEditor.vue?./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar toString = {}.toString;\nvar getType = function (value) {\n return toString.call(value).replace(/^\\[object /, '').replace(/]$/, '');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (getType);\n//# sourceMappingURL=get-type.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get-type.js?"); /***/ }), -/***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/PowerWorkflow.vue?vue&type=style&index=0&id=1175569f&scoped=true&lang=css&": -/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/PowerWorkflow.vue?vue&type=style&index=0&id=1175569f&scoped=true&lang=css& ***! - \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/get-wrap-behavior.js": +/*!**********************************************************!*\ + !*** ./node_modules/@antv/util/esm/get-wrap-behavior.js ***! + \**********************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"\\n*[data-v-1175569f],\\n*[data-v-1175569f]::before,\\n*[data-v-1175569f]::after {\\n box-sizing: border-box;\\n}\\n.iconfont[data-v-1175569f] {\\n font-size: 18px !important;\\n}\\n.power-power-flow[data-v-1175569f] {\\n border: 1px solid #d0d0d0;\\n border-top: 0px;\\n /* box-shadow: 0 10px 10px 1px #c0c0c0; */\\n box-sizing: border-box;\\n border-radius: 10px;\\n border-top-left-radius: 0px;\\n border-top-right-radius: 0px;\\n /* width: 700px; */\\n}\\n.job-tools[data-v-1175569f] {\\n width: 100%;\\n box-sizing: border-box;\\n border: 1px solid #d0d0d0;\\n /* box-shadow: 0 0 10px 1px #c0c0c0; */\\n border-radius: 10px;\\n margin-right: 10px;\\n border-bottom-left-radius: 0px;\\n border-bottom-right-radius: 0px;\\n display: flex;\\n padding: 8px 10px;\\n}\\n.job-tools > div[data-v-1175569f] {\\n box-sizing: border-box;\\n height: 30px;\\n width: 30px;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n cursor: pointer;\\n}\\n.job-tools div[data-v-1175569f]:hover {\\n border: 1px solid #f0f0f0;\\n}\\n.job-tools > div + div[data-v-1175569f] {\\n margin-left: 24px;\\n}\\n.job-tools i[data-v-1175569f] {\\n font-size: 20px;\\n color: #3d3e3e;\\n}\\n.power-job[data-v-1175569f] {\\n width: 100%;\\n background: #fff;\\n}\\n.power-job-body[data-v-1175569f] {\\n display: flex;\\n}\\n.power-job-detail[data-v-1175569f] {\\n flex: 1;\\n border-right: 1px solid #e0e0e0;\\n border-bottom: 1px solid #e0e0e0;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack:///./src/components/dag/PowerWorkflow.vue?./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 获取封装的事件\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction getWrapBehavior(obj, action) {\n return obj['_wrap_' + action];\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (getWrapBehavior);\n//# sourceMappingURL=get-wrap-behavior.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get-wrap-behavior.js?"); /***/ }), -/***/ "./node_modules/d3-color/src/color.js": +/***/ "./node_modules/@antv/util/esm/get.js": /*!********************************************!*\ - !*** ./node_modules/d3-color/src/color.js ***! + !*** ./node_modules/@antv/util/esm/get.js ***! \********************************************/ -/*! exports provided: Color, darker, brighter, default, rgbConvert, rgb, Rgb, hslConvert, hsl */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Color\", function() { return Color; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"darker\", function() { return darker; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"brighter\", function() { return brighter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return color; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgbConvert\", function() { return rgbConvert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb\", function() { return rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Rgb\", function() { return Rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hslConvert\", function() { return hslConvert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hsl\", function() { return hsl; });\n/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ \"./node_modules/d3-color/src/define.js\");\n\n\nfunction Color() {}\n\nvar darker = 0.7;\nvar brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nfunction color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nfunction rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nfunction rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nfunction Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Rgb, rgb, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nfunction hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nfunction hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Hsl, hsl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/color.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param key\n * @param defaultValue\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, key, defaultValue) {\n var p = 0;\n var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(key) ? key.split('.') : key;\n while (obj && p < keyArr.length) {\n obj = obj[keyArr[p++]];\n }\n return (obj === undefined || p < keyArr.length) ? defaultValue : obj;\n});\n//# sourceMappingURL=get.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/get.js?"); /***/ }), -/***/ "./node_modules/d3-color/src/cubehelix.js": -/*!************************************************!*\ - !*** ./node_modules/d3-color/src/cubehelix.js ***! - \************************************************/ -/*! exports provided: default, Cubehelix */ +/***/ "./node_modules/@antv/util/esm/group-by.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/group-by.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return cubehelix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Cubehelix\", function() { return Cubehelix; });\n/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ \"./node_modules/d3-color/src/define.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-color/src/color.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ \"./node_modules/d3-color/src/math.js\");\n\n\n\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__[\"Rgb\"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"rgbConvert\"])(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * _math_js__WEBPACK_IMPORTED_MODULE_2__[\"rad2deg\"] - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nfunction cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Cubehelix, cubehelix, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"Color\"], {\n brighter: function(k) {\n k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__[\"brighter\"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"brighter\"], k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__[\"darker\"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"darker\"], k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * _math_js__WEBPACK_IMPORTED_MODULE_2__[\"deg2rad\"],\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new _color_js__WEBPACK_IMPORTED_MODULE_1__[\"Rgb\"](\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/cubehelix.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction groupBy(data, condition) {\n if (!condition || !Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data)) {\n return {};\n }\n var result = {};\n // 兼容方法和 字符串的写法\n var predicate = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(condition) ? condition : function (item) { return item[condition]; };\n var key;\n for (var i = 0; i < data.length; i++) {\n var item = data[i];\n key = predicate(item);\n if (hasOwnProperty.call(result, key)) {\n result[key].push(item);\n }\n else {\n result[key] = [item];\n }\n }\n return result;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (groupBy);\n//# sourceMappingURL=group-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/group-by.js?"); /***/ }), -/***/ "./node_modules/d3-color/src/define.js": -/*!*********************************************!*\ - !*** ./node_modules/d3-color/src/define.js ***! - \*********************************************/ -/*! exports provided: default, extend */ +/***/ "./node_modules/@antv/util/esm/group-to-map.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/util/esm/group-to-map.js ***! + \*****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n});\n\nfunction extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/define.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return groupToMap; });\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n/* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./group-by */ \"./node_modules/@antv/util/esm/group-by.js\");\n\n\n\n/**\n * 将数据分组成 map\n * @param data\n * @param condition\n */\nfunction groupToMap(data, condition) {\n if (!condition) {\n return {\n 0: data,\n };\n }\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(condition)) {\n // 如果是字符串,则按照 a*b 风格成数组\n var paramscondition_1 = Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(condition) ? condition : condition.replace(/\\s+/g, '').split('*');\n condition = function (row) {\n var unique = '_'; // 避免出现数字作为Key的情况,会进行按照数字的排序\n // 根据字段列表的值,拼接成 key\n for (var i = 0, l = paramscondition_1.length; i < l; i++) {\n unique += row[paramscondition_1[i]] && row[paramscondition_1[i]].toString();\n }\n return unique;\n };\n }\n return Object(_group_by__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(data, condition);\n}\n//# sourceMappingURL=group-to-map.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/group-to-map.js?"); /***/ }), -/***/ "./node_modules/d3-color/src/index.js": -/*!********************************************!*\ - !*** ./node_modules/d3-color/src/index.js ***! - \********************************************/ -/*! exports provided: color, rgb, hsl, lab, hcl, lch, gray, cubehelix */ +/***/ "./node_modules/@antv/util/esm/group.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/util/esm/group.js ***! + \**********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-color/src/color.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"color\", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"rgb\", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__[\"rgb\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hsl\", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__[\"hsl\"]; });\n\n/* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lab.js */ \"./node_modules/d3-color/src/lab.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lab\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hcl\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__[\"hcl\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lch\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__[\"lch\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"gray\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__[\"gray\"]; });\n\n/* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubehelix.js */ \"./node_modules/d3-color/src/cubehelix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"cubehelix\", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./group-to-map */ \"./node_modules/@antv/util/esm/group-to-map.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (data, condition) {\n if (!condition) {\n // 没有条件,则自身改成数组\n return [data];\n }\n var groups = Object(_group_to_map__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(data, condition);\n var array = [];\n for (var i in groups) {\n array.push(groups[i]);\n }\n return array;\n});\n//# sourceMappingURL=group.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/group.js?"); /***/ }), -/***/ "./node_modules/d3-color/src/lab.js": -/*!******************************************!*\ - !*** ./node_modules/d3-color/src/lab.js ***! - \******************************************/ -/*! exports provided: gray, default, Lab, lch, hcl, Hcl */ +/***/ "./node_modules/@antv/util/esm/has-key.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/has-key.js ***! + \************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gray\", function() { return gray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return lab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Lab\", function() { return Lab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lch\", function() { return lch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hcl\", function() { return hcl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Hcl\", function() { return Hcl; });\n/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ \"./node_modules/d3-color/src/define.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-color/src/color.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ \"./node_modules/d3-color/src/math.js\");\n\n\n\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nvar K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__[\"Rgb\"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"rgbConvert\"])(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nfunction gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nfunction lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nfunction Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Lab, lab, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"Color\"], {\n brighter: function(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker: function(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb: function() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new _color_js__WEBPACK_IMPORTED_MODULE_1__[\"Rgb\"](\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * _math_js__WEBPACK_IMPORTED_MODULE_2__[\"rad2deg\"];\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nfunction lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nfunction hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * _math_js__WEBPACK_IMPORTED_MODULE_2__[\"deg2rad\"];\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Hcl, hcl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"Color\"], {\n brighter: function(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker: function(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb: function() {\n return hcl2lab(this).rgb();\n }\n}));\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/lab.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./has */ \"./node_modules/@antv/util/esm/has.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (_has__WEBPACK_IMPORTED_MODULE_0__[\"default\"]);\n//# sourceMappingURL=has-key.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/has-key.js?"); /***/ }), -/***/ "./node_modules/d3-color/src/math.js": -/*!*******************************************!*\ - !*** ./node_modules/d3-color/src/math.js ***! - \*******************************************/ -/*! exports provided: deg2rad, rad2deg */ +/***/ "./node_modules/@antv/util/esm/has-value.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/util/esm/has-value.js ***! + \**************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deg2rad\", function() { return deg2rad; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rad2deg\", function() { return rad2deg; });\nvar deg2rad = Math.PI / 180;\nvar rad2deg = 180 / Math.PI;\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/math.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/util/esm/contains.js\");\n/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values */ \"./node_modules/@antv/util/esm/values.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, value) { return Object(_contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Object(_values__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj), value); });\n//# sourceMappingURL=has-value.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/has-value.js?"); /***/ }), -/***/ "./node_modules/d3-dispatch/src/dispatch.js": -/*!**************************************************!*\ - !*** ./node_modules/d3-dispatch/src/dispatch.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/util/esm/has.js": +/*!********************************************!*\ + !*** ./node_modules/@antv/util/esm/has.js ***! + \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dispatch);\n\n\n//# sourceURL=webpack:///./node_modules/d3-dispatch/src/dispatch.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, key) { return obj.hasOwnProperty(key); });\n//# sourceMappingURL=has.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/has.js?"); /***/ }), -/***/ "./node_modules/d3-dispatch/src/index.js": -/*!***********************************************!*\ - !*** ./node_modules/d3-dispatch/src/index.js ***! - \***********************************************/ -/*! exports provided: dispatch */ +/***/ "./node_modules/@antv/util/esm/head.js": +/*!*********************************************!*\ + !*** ./node_modules/@antv/util/esm/head.js ***! + \*********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dispatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dispatch.js */ \"./node_modules/d3-dispatch/src/dispatch.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"dispatch\", function() { return _dispatch_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-dispatch/src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return head; });\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nfunction head(o) {\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n return o[0];\n }\n return undefined;\n}\n//# sourceMappingURL=head.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/head.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/back.js": -/*!******************************************!*\ - !*** ./node_modules/d3-ease/src/back.js ***! - \******************************************/ -/*! exports provided: backIn, backOut, backInOut */ +/***/ "./node_modules/@antv/util/esm/identity.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/identity.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"backIn\", function() { return backIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"backOut\", function() { return backOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"backInOut\", function() { return backInOut; });\nvar overshoot = 1.70158;\n\nvar backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return (t = +t) * t * (s * (t - 1) + t);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nvar backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((t + 1) * s + t) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nvar backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/back.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (v) { return v; });\n//# sourceMappingURL=identity.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/identity.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/bounce.js": -/*!********************************************!*\ - !*** ./node_modules/d3-ease/src/bounce.js ***! - \********************************************/ -/*! exports provided: bounceIn, bounceOut, bounceInOut */ +/***/ "./node_modules/@antv/util/esm/index-of.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/index-of.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bounceIn\", function() { return bounceIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bounceOut\", function() { return bounceOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bounceInOut\", function() { return bounceInOut; });\nvar b1 = 4 / 11,\n b2 = 6 / 11,\n b3 = 8 / 11,\n b4 = 3 / 4,\n b5 = 9 / 11,\n b6 = 10 / 11,\n b7 = 15 / 16,\n b8 = 21 / 22,\n b9 = 63 / 64,\n b0 = 1 / b1 / b1;\n\nfunction bounceIn(t) {\n return 1 - bounceOut(1 - t);\n}\n\nfunction bounceOut(t) {\n return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\n}\n\nfunction bounceInOut(t) {\n return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/bounce.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar indexOf = function (arr, obj) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return -1;\n }\n var m = Array.prototype.indexOf;\n if (m) {\n return m.call(arr, obj);\n }\n var index = -1;\n for (var i = 0; i < arr.length; i++) {\n if (arr[i] === obj) {\n index = i;\n break;\n }\n }\n return index;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (indexOf);\n//# sourceMappingURL=index-of.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/index-of.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/circle.js": -/*!********************************************!*\ - !*** ./node_modules/d3-ease/src/circle.js ***! - \********************************************/ -/*! exports provided: circleIn, circleOut, circleInOut */ +/***/ "./node_modules/@antv/util/esm/index.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/util/esm/index.js ***! + \**********************************************/ +/*! exports provided: contains, includes, difference, find, findIndex, firstValue, flatten, flattenDeep, getRange, pull, pullAt, reduce, remove, sortBy, union, uniq, valuesOfKey, head, last, startsWith, endsWith, filter, every, some, group, groupBy, groupToMap, getWrapBehavior, wrapBehavior, number2color, parseRadius, clamp, fixedBase, isDecimal, isEven, isInteger, isNegative, isNumberEqual, isOdd, isPositive, max, maxBy, min, minBy, mod, toDegree, toInteger, toRadian, forIn, has, hasKey, hasValue, keys, isMatch, values, lowerCase, lowerFirst, substitute, upperCase, upperFirst, getType, isArguments, isArray, isArrayLike, isBoolean, isDate, isError, isFunction, isFinite, isNil, isNull, isNumber, isObject, isObjectLike, isPlainObject, isPrototype, isRegExp, isString, isType, isUndefined, isElement, requestAnimationFrame, clearAnimationFrame, augment, clone, debounce, memoize, deepMix, each, extend, indexOf, isEmpty, isEqual, isEqualWith, map, mapValues, mix, assign, get, set, pick, omit, throttle, toArray, toString, uniqueId, noop, identity, size, measureTextWidth, getEllipsisText, Cache */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"circleIn\", function() { return circleIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"circleOut\", function() { return circleOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"circleInOut\", function() { return circleInOut; });\nfunction circleIn(t) {\n return 1 - Math.sqrt(1 - t * t);\n}\n\nfunction circleOut(t) {\n return Math.sqrt(1 - --t * t);\n}\n\nfunction circleInOut(t) {\n return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/circle.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _contains__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./contains */ \"./node_modules/@antv/util/esm/contains.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"contains\", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"includes\", function() { return _contains__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _difference__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./difference */ \"./node_modules/@antv/util/esm/difference.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"difference\", function() { return _difference__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _find__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./find */ \"./node_modules/@antv/util/esm/find.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"find\", function() { return _find__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _find_index__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./find-index */ \"./node_modules/@antv/util/esm/find-index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"findIndex\", function() { return _find_index__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _first_value__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./first-value */ \"./node_modules/@antv/util/esm/first-value.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"firstValue\", function() { return _first_value__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _flatten__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./flatten */ \"./node_modules/@antv/util/esm/flatten.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flatten\", function() { return _flatten__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _flatten_deep__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./flatten-deep */ \"./node_modules/@antv/util/esm/flatten-deep.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"flattenDeep\", function() { return _flatten_deep__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _get_range__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./get-range */ \"./node_modules/@antv/util/esm/get-range.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getRange\", function() { return _get_range__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _pull__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pull */ \"./node_modules/@antv/util/esm/pull.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pull\", function() { return _pull__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./pull-at */ \"./node_modules/@antv/util/esm/pull-at.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pullAt\", function() { return _pull_at__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./reduce */ \"./node_modules/@antv/util/esm/reduce.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"reduce\", function() { return _reduce__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _remove__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./remove */ \"./node_modules/@antv/util/esm/remove.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"remove\", function() { return _remove__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _sort_by__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./sort-by */ \"./node_modules/@antv/util/esm/sort-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"sortBy\", function() { return _sort_by__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _union__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./union */ \"./node_modules/@antv/util/esm/union.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"union\", function() { return _union__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./uniq */ \"./node_modules/@antv/util/esm/uniq.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"uniq\", function() { return _uniq__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony import */ var _values_of_key__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./values-of-key */ \"./node_modules/@antv/util/esm/values-of-key.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"valuesOfKey\", function() { return _values_of_key__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony import */ var _head__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./head */ \"./node_modules/@antv/util/esm/head.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"head\", function() { return _head__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n/* harmony import */ var _last__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./last */ \"./node_modules/@antv/util/esm/last.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"last\", function() { return _last__WEBPACK_IMPORTED_MODULE_17__[\"default\"]; });\n\n/* harmony import */ var _starts_with__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./starts-with */ \"./node_modules/@antv/util/esm/starts-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"startsWith\", function() { return _starts_with__WEBPACK_IMPORTED_MODULE_18__[\"default\"]; });\n\n/* harmony import */ var _ends_with__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./ends-with */ \"./node_modules/@antv/util/esm/ends-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"endsWith\", function() { return _ends_with__WEBPACK_IMPORTED_MODULE_19__[\"default\"]; });\n\n/* harmony import */ var _filter__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./filter */ \"./node_modules/@antv/util/esm/filter.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"filter\", function() { return _filter__WEBPACK_IMPORTED_MODULE_20__[\"default\"]; });\n\n/* harmony import */ var _every__WEBPACK_IMPORTED_MODULE_21__ = __webpack_require__(/*! ./every */ \"./node_modules/@antv/util/esm/every.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"every\", function() { return _every__WEBPACK_IMPORTED_MODULE_21__[\"default\"]; });\n\n/* harmony import */ var _some__WEBPACK_IMPORTED_MODULE_22__ = __webpack_require__(/*! ./some */ \"./node_modules/@antv/util/esm/some.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"some\", function() { return _some__WEBPACK_IMPORTED_MODULE_22__[\"default\"]; });\n\n/* harmony import */ var _group__WEBPACK_IMPORTED_MODULE_23__ = __webpack_require__(/*! ./group */ \"./node_modules/@antv/util/esm/group.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"group\", function() { return _group__WEBPACK_IMPORTED_MODULE_23__[\"default\"]; });\n\n/* harmony import */ var _group_by__WEBPACK_IMPORTED_MODULE_24__ = __webpack_require__(/*! ./group-by */ \"./node_modules/@antv/util/esm/group-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"groupBy\", function() { return _group_by__WEBPACK_IMPORTED_MODULE_24__[\"default\"]; });\n\n/* harmony import */ var _group_to_map__WEBPACK_IMPORTED_MODULE_25__ = __webpack_require__(/*! ./group-to-map */ \"./node_modules/@antv/util/esm/group-to-map.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"groupToMap\", function() { return _group_to_map__WEBPACK_IMPORTED_MODULE_25__[\"default\"]; });\n\n/* harmony import */ var _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__ = __webpack_require__(/*! ./get-wrap-behavior */ \"./node_modules/@antv/util/esm/get-wrap-behavior.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getWrapBehavior\", function() { return _get_wrap_behavior__WEBPACK_IMPORTED_MODULE_26__[\"default\"]; });\n\n/* harmony import */ var _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__ = __webpack_require__(/*! ./wrap-behavior */ \"./node_modules/@antv/util/esm/wrap-behavior.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"wrapBehavior\", function() { return _wrap_behavior__WEBPACK_IMPORTED_MODULE_27__[\"default\"]; });\n\n/* harmony import */ var _number2color__WEBPACK_IMPORTED_MODULE_28__ = __webpack_require__(/*! ./number2color */ \"./node_modules/@antv/util/esm/number2color.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"number2color\", function() { return _number2color__WEBPACK_IMPORTED_MODULE_28__[\"default\"]; });\n\n/* harmony import */ var _parse_radius__WEBPACK_IMPORTED_MODULE_29__ = __webpack_require__(/*! ./parse-radius */ \"./node_modules/@antv/util/esm/parse-radius.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"parseRadius\", function() { return _parse_radius__WEBPACK_IMPORTED_MODULE_29__[\"default\"]; });\n\n/* harmony import */ var _clamp__WEBPACK_IMPORTED_MODULE_30__ = __webpack_require__(/*! ./clamp */ \"./node_modules/@antv/util/esm/clamp.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clamp\", function() { return _clamp__WEBPACK_IMPORTED_MODULE_30__[\"default\"]; });\n\n/* harmony import */ var _fixed_base__WEBPACK_IMPORTED_MODULE_31__ = __webpack_require__(/*! ./fixed-base */ \"./node_modules/@antv/util/esm/fixed-base.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"fixedBase\", function() { return _fixed_base__WEBPACK_IMPORTED_MODULE_31__[\"default\"]; });\n\n/* harmony import */ var _is_decimal__WEBPACK_IMPORTED_MODULE_32__ = __webpack_require__(/*! ./is-decimal */ \"./node_modules/@antv/util/esm/is-decimal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isDecimal\", function() { return _is_decimal__WEBPACK_IMPORTED_MODULE_32__[\"default\"]; });\n\n/* harmony import */ var _is_even__WEBPACK_IMPORTED_MODULE_33__ = __webpack_require__(/*! ./is-even */ \"./node_modules/@antv/util/esm/is-even.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEven\", function() { return _is_even__WEBPACK_IMPORTED_MODULE_33__[\"default\"]; });\n\n/* harmony import */ var _is_integer__WEBPACK_IMPORTED_MODULE_34__ = __webpack_require__(/*! ./is-integer */ \"./node_modules/@antv/util/esm/is-integer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isInteger\", function() { return _is_integer__WEBPACK_IMPORTED_MODULE_34__[\"default\"]; });\n\n/* harmony import */ var _is_negative__WEBPACK_IMPORTED_MODULE_35__ = __webpack_require__(/*! ./is-negative */ \"./node_modules/@antv/util/esm/is-negative.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNegative\", function() { return _is_negative__WEBPACK_IMPORTED_MODULE_35__[\"default\"]; });\n\n/* harmony import */ var _is_number_equal__WEBPACK_IMPORTED_MODULE_36__ = __webpack_require__(/*! ./is-number-equal */ \"./node_modules/@antv/util/esm/is-number-equal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNumberEqual\", function() { return _is_number_equal__WEBPACK_IMPORTED_MODULE_36__[\"default\"]; });\n\n/* harmony import */ var _is_odd__WEBPACK_IMPORTED_MODULE_37__ = __webpack_require__(/*! ./is-odd */ \"./node_modules/@antv/util/esm/is-odd.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isOdd\", function() { return _is_odd__WEBPACK_IMPORTED_MODULE_37__[\"default\"]; });\n\n/* harmony import */ var _is_positive__WEBPACK_IMPORTED_MODULE_38__ = __webpack_require__(/*! ./is-positive */ \"./node_modules/@antv/util/esm/is-positive.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPositive\", function() { return _is_positive__WEBPACK_IMPORTED_MODULE_38__[\"default\"]; });\n\n/* harmony import */ var _max__WEBPACK_IMPORTED_MODULE_39__ = __webpack_require__(/*! ./max */ \"./node_modules/@antv/util/esm/max.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return _max__WEBPACK_IMPORTED_MODULE_39__[\"default\"]; });\n\n/* harmony import */ var _max_by__WEBPACK_IMPORTED_MODULE_40__ = __webpack_require__(/*! ./max-by */ \"./node_modules/@antv/util/esm/max-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"maxBy\", function() { return _max_by__WEBPACK_IMPORTED_MODULE_40__[\"default\"]; });\n\n/* harmony import */ var _min__WEBPACK_IMPORTED_MODULE_41__ = __webpack_require__(/*! ./min */ \"./node_modules/@antv/util/esm/min.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return _min__WEBPACK_IMPORTED_MODULE_41__[\"default\"]; });\n\n/* harmony import */ var _min_by__WEBPACK_IMPORTED_MODULE_42__ = __webpack_require__(/*! ./min-by */ \"./node_modules/@antv/util/esm/min-by.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"minBy\", function() { return _min_by__WEBPACK_IMPORTED_MODULE_42__[\"default\"]; });\n\n/* harmony import */ var _mod__WEBPACK_IMPORTED_MODULE_43__ = __webpack_require__(/*! ./mod */ \"./node_modules/@antv/util/esm/mod.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mod\", function() { return _mod__WEBPACK_IMPORTED_MODULE_43__[\"default\"]; });\n\n/* harmony import */ var _to_degree__WEBPACK_IMPORTED_MODULE_44__ = __webpack_require__(/*! ./to-degree */ \"./node_modules/@antv/util/esm/to-degree.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toDegree\", function() { return _to_degree__WEBPACK_IMPORTED_MODULE_44__[\"default\"]; });\n\n/* harmony import */ var _to_integer__WEBPACK_IMPORTED_MODULE_45__ = __webpack_require__(/*! ./to-integer */ \"./node_modules/@antv/util/esm/to-integer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toInteger\", function() { return _to_integer__WEBPACK_IMPORTED_MODULE_45__[\"default\"]; });\n\n/* harmony import */ var _to_radian__WEBPACK_IMPORTED_MODULE_46__ = __webpack_require__(/*! ./to-radian */ \"./node_modules/@antv/util/esm/to-radian.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return _to_radian__WEBPACK_IMPORTED_MODULE_46__[\"default\"]; });\n\n/* harmony import */ var _for_in__WEBPACK_IMPORTED_MODULE_47__ = __webpack_require__(/*! ./for-in */ \"./node_modules/@antv/util/esm/for-in.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"forIn\", function() { return _for_in__WEBPACK_IMPORTED_MODULE_47__[\"default\"]; });\n\n/* harmony import */ var _has__WEBPACK_IMPORTED_MODULE_48__ = __webpack_require__(/*! ./has */ \"./node_modules/@antv/util/esm/has.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"has\", function() { return _has__WEBPACK_IMPORTED_MODULE_48__[\"default\"]; });\n\n/* harmony import */ var _has_key__WEBPACK_IMPORTED_MODULE_49__ = __webpack_require__(/*! ./has-key */ \"./node_modules/@antv/util/esm/has-key.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hasKey\", function() { return _has_key__WEBPACK_IMPORTED_MODULE_49__[\"default\"]; });\n\n/* harmony import */ var _has_value__WEBPACK_IMPORTED_MODULE_50__ = __webpack_require__(/*! ./has-value */ \"./node_modules/@antv/util/esm/has-value.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hasValue\", function() { return _has_value__WEBPACK_IMPORTED_MODULE_50__[\"default\"]; });\n\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_51__ = __webpack_require__(/*! ./keys */ \"./node_modules/@antv/util/esm/keys.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"keys\", function() { return _keys__WEBPACK_IMPORTED_MODULE_51__[\"default\"]; });\n\n/* harmony import */ var _is_match__WEBPACK_IMPORTED_MODULE_52__ = __webpack_require__(/*! ./is-match */ \"./node_modules/@antv/util/esm/is-match.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isMatch\", function() { return _is_match__WEBPACK_IMPORTED_MODULE_52__[\"default\"]; });\n\n/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_53__ = __webpack_require__(/*! ./values */ \"./node_modules/@antv/util/esm/values.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"values\", function() { return _values__WEBPACK_IMPORTED_MODULE_53__[\"default\"]; });\n\n/* harmony import */ var _lower_case__WEBPACK_IMPORTED_MODULE_54__ = __webpack_require__(/*! ./lower-case */ \"./node_modules/@antv/util/esm/lower-case.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lowerCase\", function() { return _lower_case__WEBPACK_IMPORTED_MODULE_54__[\"default\"]; });\n\n/* harmony import */ var _lower_first__WEBPACK_IMPORTED_MODULE_55__ = __webpack_require__(/*! ./lower-first */ \"./node_modules/@antv/util/esm/lower-first.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lowerFirst\", function() { return _lower_first__WEBPACK_IMPORTED_MODULE_55__[\"default\"]; });\n\n/* harmony import */ var _substitute__WEBPACK_IMPORTED_MODULE_56__ = __webpack_require__(/*! ./substitute */ \"./node_modules/@antv/util/esm/substitute.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"substitute\", function() { return _substitute__WEBPACK_IMPORTED_MODULE_56__[\"default\"]; });\n\n/* harmony import */ var _upper_case__WEBPACK_IMPORTED_MODULE_57__ = __webpack_require__(/*! ./upper-case */ \"./node_modules/@antv/util/esm/upper-case.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"upperCase\", function() { return _upper_case__WEBPACK_IMPORTED_MODULE_57__[\"default\"]; });\n\n/* harmony import */ var _upper_first__WEBPACK_IMPORTED_MODULE_58__ = __webpack_require__(/*! ./upper-first */ \"./node_modules/@antv/util/esm/upper-first.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"upperFirst\", function() { return _upper_first__WEBPACK_IMPORTED_MODULE_58__[\"default\"]; });\n\n/* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_59__ = __webpack_require__(/*! ./get-type */ \"./node_modules/@antv/util/esm/get-type.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getType\", function() { return _get_type__WEBPACK_IMPORTED_MODULE_59__[\"default\"]; });\n\n/* harmony import */ var _is_arguments__WEBPACK_IMPORTED_MODULE_60__ = __webpack_require__(/*! ./is-arguments */ \"./node_modules/@antv/util/esm/is-arguments.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArguments\", function() { return _is_arguments__WEBPACK_IMPORTED_MODULE_60__[\"default\"]; });\n\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_61__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArray\", function() { return _is_array__WEBPACK_IMPORTED_MODULE_61__[\"default\"]; });\n\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_62__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isArrayLike\", function() { return _is_array_like__WEBPACK_IMPORTED_MODULE_62__[\"default\"]; });\n\n/* harmony import */ var _is_boolean__WEBPACK_IMPORTED_MODULE_63__ = __webpack_require__(/*! ./is-boolean */ \"./node_modules/@antv/util/esm/is-boolean.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isBoolean\", function() { return _is_boolean__WEBPACK_IMPORTED_MODULE_63__[\"default\"]; });\n\n/* harmony import */ var _is_date__WEBPACK_IMPORTED_MODULE_64__ = __webpack_require__(/*! ./is-date */ \"./node_modules/@antv/util/esm/is-date.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isDate\", function() { return _is_date__WEBPACK_IMPORTED_MODULE_64__[\"default\"]; });\n\n/* harmony import */ var _is_error__WEBPACK_IMPORTED_MODULE_65__ = __webpack_require__(/*! ./is-error */ \"./node_modules/@antv/util/esm/is-error.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isError\", function() { return _is_error__WEBPACK_IMPORTED_MODULE_65__[\"default\"]; });\n\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_66__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isFunction\", function() { return _is_function__WEBPACK_IMPORTED_MODULE_66__[\"default\"]; });\n\n/* harmony import */ var _is_finite__WEBPACK_IMPORTED_MODULE_67__ = __webpack_require__(/*! ./is-finite */ \"./node_modules/@antv/util/esm/is-finite.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isFinite\", function() { return _is_finite__WEBPACK_IMPORTED_MODULE_67__[\"default\"]; });\n\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_68__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNil\", function() { return _is_nil__WEBPACK_IMPORTED_MODULE_68__[\"default\"]; });\n\n/* harmony import */ var _is_null__WEBPACK_IMPORTED_MODULE_69__ = __webpack_require__(/*! ./is-null */ \"./node_modules/@antv/util/esm/is-null.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNull\", function() { return _is_null__WEBPACK_IMPORTED_MODULE_69__[\"default\"]; });\n\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_70__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isNumber\", function() { return _is_number__WEBPACK_IMPORTED_MODULE_70__[\"default\"]; });\n\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_71__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/util/esm/is-object.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isObject\", function() { return _is_object__WEBPACK_IMPORTED_MODULE_71__[\"default\"]; });\n\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_72__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/util/esm/is-object-like.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isObjectLike\", function() { return _is_object_like__WEBPACK_IMPORTED_MODULE_72__[\"default\"]; });\n\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_73__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPlainObject\", function() { return _is_plain_object__WEBPACK_IMPORTED_MODULE_73__[\"default\"]; });\n\n/* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_74__ = __webpack_require__(/*! ./is-prototype */ \"./node_modules/@antv/util/esm/is-prototype.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isPrototype\", function() { return _is_prototype__WEBPACK_IMPORTED_MODULE_74__[\"default\"]; });\n\n/* harmony import */ var _is_reg_exp__WEBPACK_IMPORTED_MODULE_75__ = __webpack_require__(/*! ./is-reg-exp */ \"./node_modules/@antv/util/esm/is-reg-exp.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isRegExp\", function() { return _is_reg_exp__WEBPACK_IMPORTED_MODULE_75__[\"default\"]; });\n\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_76__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isString\", function() { return _is_string__WEBPACK_IMPORTED_MODULE_76__[\"default\"]; });\n\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_77__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isType\", function() { return _is_type__WEBPACK_IMPORTED_MODULE_77__[\"default\"]; });\n\n/* harmony import */ var _is_undefined__WEBPACK_IMPORTED_MODULE_78__ = __webpack_require__(/*! ./is-undefined */ \"./node_modules/@antv/util/esm/is-undefined.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isUndefined\", function() { return _is_undefined__WEBPACK_IMPORTED_MODULE_78__[\"default\"]; });\n\n/* harmony import */ var _is_element__WEBPACK_IMPORTED_MODULE_79__ = __webpack_require__(/*! ./is-element */ \"./node_modules/@antv/util/esm/is-element.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isElement\", function() { return _is_element__WEBPACK_IMPORTED_MODULE_79__[\"default\"]; });\n\n/* harmony import */ var _request_animation_frame__WEBPACK_IMPORTED_MODULE_80__ = __webpack_require__(/*! ./request-animation-frame */ \"./node_modules/@antv/util/esm/request-animation-frame.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"requestAnimationFrame\", function() { return _request_animation_frame__WEBPACK_IMPORTED_MODULE_80__[\"default\"]; });\n\n/* harmony import */ var _clear_animation_frame__WEBPACK_IMPORTED_MODULE_81__ = __webpack_require__(/*! ./clear-animation-frame */ \"./node_modules/@antv/util/esm/clear-animation-frame.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clearAnimationFrame\", function() { return _clear_animation_frame__WEBPACK_IMPORTED_MODULE_81__[\"default\"]; });\n\n/* harmony import */ var _augment__WEBPACK_IMPORTED_MODULE_82__ = __webpack_require__(/*! ./augment */ \"./node_modules/@antv/util/esm/augment.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"augment\", function() { return _augment__WEBPACK_IMPORTED_MODULE_82__[\"default\"]; });\n\n/* harmony import */ var _clone__WEBPACK_IMPORTED_MODULE_83__ = __webpack_require__(/*! ./clone */ \"./node_modules/@antv/util/esm/clone.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return _clone__WEBPACK_IMPORTED_MODULE_83__[\"default\"]; });\n\n/* harmony import */ var _debounce__WEBPACK_IMPORTED_MODULE_84__ = __webpack_require__(/*! ./debounce */ \"./node_modules/@antv/util/esm/debounce.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"debounce\", function() { return _debounce__WEBPACK_IMPORTED_MODULE_84__[\"default\"]; });\n\n/* harmony import */ var _memoize__WEBPACK_IMPORTED_MODULE_85__ = __webpack_require__(/*! ./memoize */ \"./node_modules/@antv/util/esm/memoize.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"memoize\", function() { return _memoize__WEBPACK_IMPORTED_MODULE_85__[\"default\"]; });\n\n/* harmony import */ var _deep_mix__WEBPACK_IMPORTED_MODULE_86__ = __webpack_require__(/*! ./deep-mix */ \"./node_modules/@antv/util/esm/deep-mix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"deepMix\", function() { return _deep_mix__WEBPACK_IMPORTED_MODULE_86__[\"default\"]; });\n\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_87__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"each\", function() { return _each__WEBPACK_IMPORTED_MODULE_87__[\"default\"]; });\n\n/* harmony import */ var _extend__WEBPACK_IMPORTED_MODULE_88__ = __webpack_require__(/*! ./extend */ \"./node_modules/@antv/util/esm/extend.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return _extend__WEBPACK_IMPORTED_MODULE_88__[\"default\"]; });\n\n/* harmony import */ var _index_of__WEBPACK_IMPORTED_MODULE_89__ = __webpack_require__(/*! ./index-of */ \"./node_modules/@antv/util/esm/index-of.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"indexOf\", function() { return _index_of__WEBPACK_IMPORTED_MODULE_89__[\"default\"]; });\n\n/* harmony import */ var _is_empty__WEBPACK_IMPORTED_MODULE_90__ = __webpack_require__(/*! ./is-empty */ \"./node_modules/@antv/util/esm/is-empty.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEmpty\", function() { return _is_empty__WEBPACK_IMPORTED_MODULE_90__[\"default\"]; });\n\n/* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_91__ = __webpack_require__(/*! ./is-equal */ \"./node_modules/@antv/util/esm/is-equal.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEqual\", function() { return _is_equal__WEBPACK_IMPORTED_MODULE_91__[\"default\"]; });\n\n/* harmony import */ var _is_equal_with__WEBPACK_IMPORTED_MODULE_92__ = __webpack_require__(/*! ./is-equal-with */ \"./node_modules/@antv/util/esm/is-equal-with.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"isEqualWith\", function() { return _is_equal_with__WEBPACK_IMPORTED_MODULE_92__[\"default\"]; });\n\n/* harmony import */ var _map__WEBPACK_IMPORTED_MODULE_93__ = __webpack_require__(/*! ./map */ \"./node_modules/@antv/util/esm/map.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"map\", function() { return _map__WEBPACK_IMPORTED_MODULE_93__[\"default\"]; });\n\n/* harmony import */ var _map_values__WEBPACK_IMPORTED_MODULE_94__ = __webpack_require__(/*! ./map-values */ \"./node_modules/@antv/util/esm/map-values.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mapValues\", function() { return _map_values__WEBPACK_IMPORTED_MODULE_94__[\"default\"]; });\n\n/* harmony import */ var _mix__WEBPACK_IMPORTED_MODULE_95__ = __webpack_require__(/*! ./mix */ \"./node_modules/@antv/util/esm/mix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"mix\", function() { return _mix__WEBPACK_IMPORTED_MODULE_95__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"assign\", function() { return _mix__WEBPACK_IMPORTED_MODULE_95__[\"default\"]; });\n\n/* harmony import */ var _get__WEBPACK_IMPORTED_MODULE_96__ = __webpack_require__(/*! ./get */ \"./node_modules/@antv/util/esm/get.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"get\", function() { return _get__WEBPACK_IMPORTED_MODULE_96__[\"default\"]; });\n\n/* harmony import */ var _set__WEBPACK_IMPORTED_MODULE_97__ = __webpack_require__(/*! ./set */ \"./node_modules/@antv/util/esm/set.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return _set__WEBPACK_IMPORTED_MODULE_97__[\"default\"]; });\n\n/* harmony import */ var _pick__WEBPACK_IMPORTED_MODULE_98__ = __webpack_require__(/*! ./pick */ \"./node_modules/@antv/util/esm/pick.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pick\", function() { return _pick__WEBPACK_IMPORTED_MODULE_98__[\"default\"]; });\n\n/* harmony import */ var _omit__WEBPACK_IMPORTED_MODULE_99__ = __webpack_require__(/*! ./omit */ \"./node_modules/@antv/util/esm/omit.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"omit\", function() { return _omit__WEBPACK_IMPORTED_MODULE_99__[\"default\"]; });\n\n/* harmony import */ var _throttle__WEBPACK_IMPORTED_MODULE_100__ = __webpack_require__(/*! ./throttle */ \"./node_modules/@antv/util/esm/throttle.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"throttle\", function() { return _throttle__WEBPACK_IMPORTED_MODULE_100__[\"default\"]; });\n\n/* harmony import */ var _to_array__WEBPACK_IMPORTED_MODULE_101__ = __webpack_require__(/*! ./to-array */ \"./node_modules/@antv/util/esm/to-array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toArray\", function() { return _to_array__WEBPACK_IMPORTED_MODULE_101__[\"default\"]; });\n\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_102__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"toString\", function() { return _to_string__WEBPACK_IMPORTED_MODULE_102__[\"default\"]; });\n\n/* harmony import */ var _unique_id__WEBPACK_IMPORTED_MODULE_103__ = __webpack_require__(/*! ./unique-id */ \"./node_modules/@antv/util/esm/unique-id.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"uniqueId\", function() { return _unique_id__WEBPACK_IMPORTED_MODULE_103__[\"default\"]; });\n\n/* harmony import */ var _noop__WEBPACK_IMPORTED_MODULE_104__ = __webpack_require__(/*! ./noop */ \"./node_modules/@antv/util/esm/noop.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"noop\", function() { return _noop__WEBPACK_IMPORTED_MODULE_104__[\"default\"]; });\n\n/* harmony import */ var _identity__WEBPACK_IMPORTED_MODULE_105__ = __webpack_require__(/*! ./identity */ \"./node_modules/@antv/util/esm/identity.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return _identity__WEBPACK_IMPORTED_MODULE_105__[\"default\"]; });\n\n/* harmony import */ var _size__WEBPACK_IMPORTED_MODULE_106__ = __webpack_require__(/*! ./size */ \"./node_modules/@antv/util/esm/size.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"size\", function() { return _size__WEBPACK_IMPORTED_MODULE_106__[\"default\"]; });\n\n/* harmony import */ var _measure_text_width__WEBPACK_IMPORTED_MODULE_107__ = __webpack_require__(/*! ./measure-text-width */ \"./node_modules/@antv/util/esm/measure-text-width.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"measureTextWidth\", function() { return _measure_text_width__WEBPACK_IMPORTED_MODULE_107__[\"default\"]; });\n\n/* harmony import */ var _get_ellipsis_text__WEBPACK_IMPORTED_MODULE_108__ = __webpack_require__(/*! ./get-ellipsis-text */ \"./node_modules/@antv/util/esm/get-ellipsis-text.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"getEllipsisText\", function() { return _get_ellipsis_text__WEBPACK_IMPORTED_MODULE_108__[\"default\"]; });\n\n/* harmony import */ var _cache__WEBPACK_IMPORTED_MODULE_109__ = __webpack_require__(/*! ./cache */ \"./node_modules/@antv/util/esm/cache.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Cache\", function() { return _cache__WEBPACK_IMPORTED_MODULE_109__[\"default\"]; });\n\n// array\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// event\n\n\n// format\n\n\n// math\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// object\n\n\n\n\n\n\n\n// string\n\n\n\n\n\n// type\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// other\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n// text\n\n\n// 不知道为什么,需要把这个 export,不然 ts 会报类型错误\n\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/index.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/cubic.js": -/*!*******************************************!*\ - !*** ./node_modules/d3-ease/src/cubic.js ***! - \*******************************************/ -/*! exports provided: cubicIn, cubicOut, cubicInOut */ +/***/ "./node_modules/@antv/util/esm/is-arguments.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-arguments.js ***! + \*****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cubicIn\", function() { return cubicIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cubicOut\", function() { return cubicOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cubicInOut\", function() { return cubicInOut; });\nfunction cubicIn(t) {\n return t * t * t;\n}\n\nfunction cubicOut(t) {\n return --t * t * t + 1;\n}\n\nfunction cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/cubic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isArguments = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Arguments');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isArguments);\n//# sourceMappingURL=is-arguments.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-arguments.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/elastic.js": -/*!*********************************************!*\ - !*** ./node_modules/d3-ease/src/elastic.js ***! - \*********************************************/ -/*! exports provided: elasticIn, elasticOut, elasticInOut */ +/***/ "./node_modules/@antv/util/esm/is-array-like.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-array-like.js ***! + \******************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"elasticIn\", function() { return elasticIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"elasticOut\", function() { return elasticOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"elasticInOut\", function() { return elasticInOut; });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/d3-ease/src/math.js\");\n\n\nvar tau = 2 * Math.PI,\n amplitude = 1,\n period = 0.3;\n\nvar elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(-(--t)) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nvar elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(t = +t) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nvar elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(-t) * Math.sin((s - t) / p)\n : 2 - a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/elastic.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar isArrayLike = function (value) {\n /**\n * isArrayLike([1, 2, 3]) => true\n * isArrayLike(document.body.children) => true\n * isArrayLike('abc') => true\n * isArrayLike(Function) => false\n */\n return value !== null && typeof value !== 'function' && isFinite(value.length);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isArrayLike);\n//# sourceMappingURL=is-array-like.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-array-like.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/exp.js": -/*!*****************************************!*\ - !*** ./node_modules/d3-ease/src/exp.js ***! - \*****************************************/ -/*! exports provided: expIn, expOut, expInOut */ +/***/ "./node_modules/@antv/util/esm/is-array.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-array.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expIn\", function() { return expIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expOut\", function() { return expOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expInOut\", function() { return expInOut; });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/d3-ease/src/math.js\");\n\n\nfunction expIn(t) {\n return Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(1 - +t);\n}\n\nfunction expOut(t) {\n return 1 - Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(t);\n}\n\nfunction expInOut(t) {\n return ((t *= 2) <= 1 ? Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(1 - t) : 2 - Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(t - 1)) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/exp.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Array.isArray ?\n Array.isArray(value) :\n Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Array');\n});\n//# sourceMappingURL=is-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-array.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/index.js": -/*!*******************************************!*\ - !*** ./node_modules/d3-ease/src/index.js ***! - \*******************************************/ -/*! exports provided: easeLinear, easeQuad, easeQuadIn, easeQuadOut, easeQuadInOut, easeCubic, easeCubicIn, easeCubicOut, easeCubicInOut, easePoly, easePolyIn, easePolyOut, easePolyInOut, easeSin, easeSinIn, easeSinOut, easeSinInOut, easeExp, easeExpIn, easeExpOut, easeExpInOut, easeCircle, easeCircleIn, easeCircleOut, easeCircleInOut, easeBounce, easeBounceIn, easeBounceOut, easeBounceInOut, easeBack, easeBackIn, easeBackOut, easeBackInOut, easeElastic, easeElasticIn, easeElasticOut, easeElasticInOut */ +/***/ "./node_modules/@antv/util/esm/is-boolean.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-boolean.js ***! + \***************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _linear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linear.js */ \"./node_modules/d3-ease/src/linear.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeLinear\", function() { return _linear_js__WEBPACK_IMPORTED_MODULE_0__[\"linear\"]; });\n\n/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quad.js */ \"./node_modules/d3-ease/src/quad.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeQuad\", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__[\"quadInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeQuadIn\", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__[\"quadIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeQuadOut\", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__[\"quadOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeQuadInOut\", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__[\"quadInOut\"]; });\n\n/* harmony import */ var _cubic_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubic.js */ \"./node_modules/d3-ease/src/cubic.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCubic\", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__[\"cubicInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCubicIn\", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__[\"cubicIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCubicOut\", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__[\"cubicOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCubicInOut\", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__[\"cubicInOut\"]; });\n\n/* harmony import */ var _poly_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./poly.js */ \"./node_modules/d3-ease/src/poly.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easePoly\", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__[\"polyInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easePolyIn\", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__[\"polyIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easePolyOut\", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__[\"polyOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easePolyInOut\", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__[\"polyInOut\"]; });\n\n/* harmony import */ var _sin_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sin.js */ \"./node_modules/d3-ease/src/sin.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeSin\", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__[\"sinInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeSinIn\", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__[\"sinIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeSinOut\", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__[\"sinOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeSinInOut\", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__[\"sinInOut\"]; });\n\n/* harmony import */ var _exp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exp.js */ \"./node_modules/d3-ease/src/exp.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeExp\", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__[\"expInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeExpIn\", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__[\"expIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeExpOut\", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__[\"expOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeExpInOut\", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__[\"expInOut\"]; });\n\n/* harmony import */ var _circle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./circle.js */ \"./node_modules/d3-ease/src/circle.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCircle\", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__[\"circleInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCircleIn\", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__[\"circleIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCircleOut\", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__[\"circleOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCircleInOut\", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__[\"circleInOut\"]; });\n\n/* harmony import */ var _bounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./bounce.js */ \"./node_modules/d3-ease/src/bounce.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBounce\", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__[\"bounceOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBounceIn\", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__[\"bounceIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBounceOut\", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__[\"bounceOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBounceInOut\", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__[\"bounceInOut\"]; });\n\n/* harmony import */ var _back_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./back.js */ \"./node_modules/d3-ease/src/back.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBack\", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__[\"backInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBackIn\", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__[\"backIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBackOut\", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__[\"backOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBackInOut\", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__[\"backInOut\"]; });\n\n/* harmony import */ var _elastic_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./elastic.js */ \"./node_modules/d3-ease/src/elastic.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeElastic\", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__[\"elasticOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeElasticIn\", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__[\"elasticIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeElasticOut\", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__[\"elasticOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeElasticInOut\", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__[\"elasticInOut\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 是否是布尔类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isBoolean = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Boolean');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isBoolean);\n//# sourceMappingURL=is-boolean.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-boolean.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/linear.js": -/*!********************************************!*\ - !*** ./node_modules/d3-ease/src/linear.js ***! - \********************************************/ -/*! exports provided: linear */ +/***/ "./node_modules/@antv/util/esm/is-date.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-date.js ***! + \************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"linear\", function() { return linear; });\nfunction linear(t) {\n return +t;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/linear.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\nvar isDate = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Date');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isDate);\n//# sourceMappingURL=is-date.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-date.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/math.js": -/*!******************************************!*\ - !*** ./node_modules/d3-ease/src/math.js ***! - \******************************************/ -/*! exports provided: tpmt */ +/***/ "./node_modules/@antv/util/esm/is-decimal.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-decimal.js ***! + \***************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"tpmt\", function() { return tpmt; });\n// tpmt is two power minus ten times t scaled to [0,1]\nfunction tpmt(x) {\n return (Math.pow(2, -10 * x) - 0.0009765625) * 1.0009775171065494;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/math.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isDecimal = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 1 !== 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isDecimal);\n//# sourceMappingURL=is-decimal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-decimal.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/poly.js": -/*!******************************************!*\ - !*** ./node_modules/d3-ease/src/poly.js ***! - \******************************************/ -/*! exports provided: polyIn, polyOut, polyInOut */ +/***/ "./node_modules/@antv/util/esm/is-element.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-element.js ***! + \***************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polyIn\", function() { return polyIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polyOut\", function() { return polyOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polyInOut\", function() { return polyInOut; });\nvar exponent = 3;\n\nvar polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nvar polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nvar polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/poly.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 判断是否HTML元素\n * @return {Boolean} 是否HTML元素\n */\nvar isElement = function (o) {\n return o instanceof Element || o instanceof HTMLDocument;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isElement);\n//# sourceMappingURL=is-element.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-element.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/quad.js": -/*!******************************************!*\ - !*** ./node_modules/d3-ease/src/quad.js ***! - \******************************************/ -/*! exports provided: quadIn, quadOut, quadInOut */ +/***/ "./node_modules/@antv/util/esm/is-empty.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-empty.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadIn\", function() { return quadIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadOut\", function() { return quadOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadInOut\", function() { return quadInOut; });\nfunction quadIn(t) {\n return t * t;\n}\n\nfunction quadOut(t) {\n return t * (2 - t);\n}\n\nfunction quadInOut(t) {\n return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/quad.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n/* harmony import */ var _get_type__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./get-type */ \"./node_modules/@antv/util/esm/get-type.js\");\n/* harmony import */ var _is_prototype__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-prototype */ \"./node_modules/@antv/util/esm/is-prototype.js\");\n\n\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\nfunction isEmpty(value) {\n /**\n * isEmpty(null) => true\n * isEmpty() => true\n * isEmpty(true) => true\n * isEmpty(1) => true\n * isEmpty([1, 2, 3]) => false\n * isEmpty('abc') => false\n * isEmpty({ a: 1 }) => false\n */\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n return true;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n return !value.length;\n }\n var type = Object(_get_type__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(value);\n if (type === 'Map' || type === 'Set') {\n return !value.size;\n }\n if (Object(_is_prototype__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(value)) {\n return !Object.keys(value).length;\n }\n for (var key in value) {\n if (hasOwnProperty.call(value, key)) {\n return false;\n }\n }\n return true;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEmpty);\n//# sourceMappingURL=is-empty.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-empty.js?"); /***/ }), -/***/ "./node_modules/d3-ease/src/sin.js": -/*!*****************************************!*\ - !*** ./node_modules/d3-ease/src/sin.js ***! - \*****************************************/ -/*! exports provided: sinIn, sinOut, sinInOut */ +/***/ "./node_modules/@antv/util/esm/is-equal-with.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-equal-with.js ***! + \******************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sinIn\", function() { return sinIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sinOut\", function() { return sinOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sinInOut\", function() { return sinInOut; });\nvar pi = Math.PI,\n halfPi = pi / 2;\n\nfunction sinIn(t) {\n return (+t === 1) ? 1 : 1 - Math.cos(t * halfPi);\n}\n\nfunction sinOut(t) {\n return Math.sin(t * halfPi);\n}\n\nfunction sinInOut(t) {\n return (1 - Math.cos(pi * t)) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/sin.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n/* harmony import */ var _is_equal__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-equal */ \"./node_modules/@antv/util/esm/is-equal.js\");\n\n\n/**\n * @param {*} value The value to compare.\n * @param {*} other The other value to compare.\n * @param {Function} [fn] The function to customize comparisons.\n * @returns {boolean} Returns `true` if the values are equivalent, else `false`.\n * @example\n *\n * function isGreeting(value) {\n * return /^h(?:i|ello)$/.test(value);\n * }\n *\n * function customizer(objValue, othValue) {\n * if (isGreeting(objValue) && isGreeting(othValue)) {\n * return true;\n * }\n * }\n *\n * var array = ['hello', 'goodbye'];\n * var other = ['hi', 'goodbye'];\n *\n * isEqualWith(array, other, customizer); // => true\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value, other, fn) {\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(fn)) {\n return Object(_is_equal__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value, other);\n }\n return !!fn(value, other);\n});\n//# sourceMappingURL=is-equal-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-equal-with.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/array.js": -/*!**************************************************!*\ - !*** ./node_modules/d3-interpolate/src/array.js ***! - \**************************************************/ -/*! exports provided: default, genericArray */ +/***/ "./node_modules/@antv/util/esm/is-equal.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-equal.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"genericArray\", function() { return genericArray; });\n/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ \"./node_modules/d3-interpolate/src/value.js\");\n/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./numberArray.js */ \"./node_modules/d3-interpolate/src/numberArray.js\");\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n return (Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_1__[\"isNumberArray\"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"] : genericArray)(a, b);\n});\n\nfunction genericArray(a, b) {\n var nb = b ? b.length : 0,\n na = a ? Math.min(nb, a.length) : 0,\n x = new Array(na),\n c = new Array(nb),\n i;\n\n for (i = 0; i < na; ++i) x[i] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a[i], b[i]);\n for (; i < nb; ++i) c[i] = b[i];\n\n return function(t) {\n for (i = 0; i < na; ++i) c[i] = x[i](t);\n return c;\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/array.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/util/esm/is-object-like.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n\n\nvar isEqual = function (value, other) {\n if (value === other) {\n return true;\n }\n if (!value || !other) {\n return false;\n }\n if (Object(_is_string__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(value) || Object(_is_string__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(other)) {\n return false;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value) || Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(other)) {\n if (value.length !== other.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < value.length; i++) {\n rst = isEqual(value[i], other[i]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n if (Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) || Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(other)) {\n var valueKeys = Object.keys(value);\n var otherKeys = Object.keys(other);\n if (valueKeys.length !== otherKeys.length) {\n return false;\n }\n var rst = true;\n for (var i = 0; i < valueKeys.length; i++) {\n rst = isEqual(value[valueKeys[i]], other[valueKeys[i]]);\n if (!rst) {\n break;\n }\n }\n return rst;\n }\n return false;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEqual);\n//# sourceMappingURL=is-equal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-equal.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/basis.js": -/*!**************************************************!*\ - !*** ./node_modules/d3-interpolate/src/basis.js ***! - \**************************************************/ -/*! exports provided: basis, default */ +/***/ "./node_modules/@antv/util/esm/is-error.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-error.js ***! + \*************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"basis\", function() { return basis; });\nfunction basis(t1, v0, v1, v2, v3) {\n var t2 = t1 * t1, t3 = t2 * t1;\n return ((1 - 3 * t1 + 3 * t2 - t3) * v0\n + (4 - 6 * t2 + 3 * t3) * v1\n + (1 + 3 * t1 + 3 * t2 - 3 * t3) * v2\n + t3 * v3) / 6;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(values) {\n var n = values.length - 1;\n return function(t) {\n var i = t <= 0 ? (t = 0) : t >= 1 ? (t = 1, n - 1) : Math.floor(t * n),\n v1 = values[i],\n v2 = values[i + 1],\n v0 = i > 0 ? values[i - 1] : 2 * v1 - v2,\n v3 = i < n - 1 ? values[i + 2] : 2 * v2 - v1;\n return basis((t - i / n) * n, v0, v1, v2, v3);\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/basis.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 是否是参数类型\n *\n * @param {Object} value 测试的值\n * @return {Boolean}\n */\n\nvar isError = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Error');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isError);\n//# sourceMappingURL=is-error.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-error.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/basisClosed.js": -/*!********************************************************!*\ - !*** ./node_modules/d3-interpolate/src/basisClosed.js ***! - \********************************************************/ +/***/ "./node_modules/@antv/util/esm/is-even.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-even.js ***! + \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./basis.js */ \"./node_modules/d3-interpolate/src/basis.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(values) {\n var n = values.length;\n return function(t) {\n var i = Math.floor(((t %= 1) < 0 ? ++t : t) * n),\n v0 = values[(i + n - 1) % n],\n v1 = values[i % n],\n v2 = values[(i + 1) % n],\n v3 = values[(i + 2) % n];\n return Object(_basis_js__WEBPACK_IMPORTED_MODULE_0__[\"basis\"])((t - i / n) * n, v0, v1, v2, v3);\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/basisClosed.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isEven = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 2 === 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isEven);\n//# sourceMappingURL=is-even.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-even.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/color.js": +/***/ "./node_modules/@antv/util/esm/is-finite.js": /*!**************************************************!*\ - !*** ./node_modules/d3-interpolate/src/color.js ***! + !*** ./node_modules/@antv/util/esm/is-finite.js ***! \**************************************************/ -/*! exports provided: hue, gamma, default */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hue\", function() { return hue; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gamma\", function() { return gamma; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return nogamma; });\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/d3-interpolate/src/constant.js\");\n\n\nfunction linear(a, d) {\n return function(t) {\n return a + t * d;\n };\n}\n\nfunction exponential(a, b, y) {\n return a = Math.pow(a, y), b = Math.pow(b, y) - a, y = 1 / y, function(t) {\n return Math.pow(a + t * b, y);\n };\n}\n\nfunction hue(a, b) {\n var d = b - a;\n return d ? linear(a, d > 180 || d < -180 ? d - 360 * Math.round(d / 360) : d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(isNaN(a) ? b : a);\n}\n\nfunction gamma(y) {\n return (y = +y) === 1 ? nogamma : function(a, b) {\n return b - a ? exponential(a, b, y) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(isNaN(a) ? b : a);\n };\n}\n\nfunction nogamma(a, b) {\n var d = b - a;\n return d ? linear(a, d) : Object(_constant_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(isNaN(a) ? b : a);\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/color.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n/**\n * 判断是否为有限数\n * @return {Boolean}\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) && isFinite(value);\n});\n//# sourceMappingURL=is-finite.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-finite.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/constant.js": -/*!*****************************************************!*\ - !*** ./node_modules/d3-interpolate/src/constant.js ***! - \*****************************************************/ +/***/ "./node_modules/@antv/util/esm/is-function.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-function.js ***! + \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(x) {\n return function() {\n return x;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/constant.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 是否为函数\n * @param {*} fn 对象\n * @return {Boolean} 是否函数\n */\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Function');\n});\n//# sourceMappingURL=is-function.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-function.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/cubehelix.js": -/*!******************************************************!*\ - !*** ./node_modules/d3-interpolate/src/cubehelix.js ***! - \******************************************************/ -/*! exports provided: default, cubehelixLong */ +/***/ "./node_modules/@antv/util/esm/is-integer.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-integer.js ***! + \***************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cubehelixLong\", function() { return cubehelixLong; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-interpolate/src/color.js\");\n\n\n\nfunction cubehelix(hue) {\n return (function cubehelixGamma(y) {\n y = +y;\n\n function cubehelix(start, end) {\n var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"cubehelix\"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"cubehelix\"])(end)).h),\n s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.s, end.s),\n l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.l, end.l),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(Math.pow(t, y));\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n cubehelix.gamma = cubehelixGamma;\n\n return cubehelix;\n })(1);\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"hue\"]));\nvar cubehelixLong = cubehelix(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/cubehelix.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isInteger = Number.isInteger ? Number.isInteger : function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 1 === 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isInteger);\n//# sourceMappingURL=is-integer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-integer.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/date.js": +/***/ "./node_modules/@antv/util/esm/is-match.js": /*!*************************************************!*\ - !*** ./node_modules/d3-interpolate/src/date.js ***! + !*** ./node_modules/@antv/util/esm/is-match.js ***! \*************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var d = new Date;\n return a = +a, b = +b, function(t) {\n return d.setTime(a * (1 - t) + b * t), d;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/date.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _keys__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./keys */ \"./node_modules/@antv/util/esm/keys.js\");\n\n\nfunction isMatch(obj, attrs) {\n var _keys = Object(_keys__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(attrs);\n var length = _keys.length;\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj))\n return !length;\n for (var i = 0; i < length; i += 1) {\n var key = _keys[i];\n if (attrs[key] !== obj[key] || !(key in obj)) {\n return false;\n }\n }\n return true;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (isMatch);\n//# sourceMappingURL=is-match.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-match.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/discrete.js": -/*!*****************************************************!*\ - !*** ./node_modules/d3-interpolate/src/discrete.js ***! - \*****************************************************/ +/***/ "./node_modules/@antv/util/esm/is-negative.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-negative.js ***! + \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(range) {\n var n = range.length;\n return function(t) {\n return range[Math.max(0, Math.min(n - 1, Math.floor(t * n)))];\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/discrete.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isNegative = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num < 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNegative);\n//# sourceMappingURL=is-negative.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-negative.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/hcl.js": -/*!************************************************!*\ - !*** ./node_modules/d3-interpolate/src/hcl.js ***! - \************************************************/ -/*! exports provided: default, hclLong */ +/***/ "./node_modules/@antv/util/esm/is-nil.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/is-nil.js ***! + \***********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hclLong\", function() { return hclLong; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-interpolate/src/color.js\");\n\n\n\nfunction hcl(hue) {\n return function(start, end) {\n var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"hcl\"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"hcl\"])(end)).h),\n c = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.c, end.c),\n l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.l, end.l),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.c = c(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"hue\"]));\nvar hclLong = hcl(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/hcl.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n// isFinite,\nvar isNil = function (value) {\n /**\n * isNil(null) => true\n * isNil() => true\n */\n return value === null || value === undefined;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNil);\n//# sourceMappingURL=is-nil.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-nil.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/hsl.js": +/***/ "./node_modules/@antv/util/esm/is-null.js": /*!************************************************!*\ - !*** ./node_modules/d3-interpolate/src/hsl.js ***! + !*** ./node_modules/@antv/util/esm/is-null.js ***! \************************************************/ -/*! exports provided: default, hslLong */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hslLong\", function() { return hslLong; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-interpolate/src/color.js\");\n\n\n\nfunction hsl(hue) {\n return function(start, end) {\n var h = hue((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"hsl\"])(start)).h, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"hsl\"])(end)).h),\n s = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.s, end.s),\n l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.l, end.l),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.h = h(t);\n start.s = s(t);\n start.l = l(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"hue\"]));\nvar hslLong = hsl(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/hsl.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar isNull = function (value) {\n return value === null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNull);\n//# sourceMappingURL=is-null.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-null.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/hue.js": -/*!************************************************!*\ - !*** ./node_modules/d3-interpolate/src/hue.js ***! - \************************************************/ +/***/ "./node_modules/@antv/util/esm/is-number-equal.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-number-equal.js ***! + \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-interpolate/src/color.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var i = Object(_color_js__WEBPACK_IMPORTED_MODULE_0__[\"hue\"])(+a, +b);\n return function(t) {\n var x = i(t);\n return x - 360 * Math.floor(x / 360);\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/hue.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return isNumberEqual; });\nvar PRECISION = 0.00001; // numbers less than this is considered as 0\nfunction isNumberEqual(a, b, precision) {\n if (precision === void 0) { precision = PRECISION; }\n return Math.abs((a - b)) < precision;\n}\n;\n//# sourceMappingURL=is-number-equal.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-number-equal.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/index.js": +/***/ "./node_modules/@antv/util/esm/is-number.js": /*!**************************************************!*\ - !*** ./node_modules/d3-interpolate/src/index.js ***! + !*** ./node_modules/@antv/util/esm/is-number.js ***! \**************************************************/ -/*! exports provided: interpolate, interpolateArray, interpolateBasis, interpolateBasisClosed, interpolateDate, interpolateDiscrete, interpolateHue, interpolateNumber, interpolateNumberArray, interpolateObject, interpolateRound, interpolateString, interpolateTransformCss, interpolateTransformSvg, interpolateZoom, interpolateRgb, interpolateRgbBasis, interpolateRgbBasisClosed, interpolateHsl, interpolateHslLong, interpolateLab, interpolateHcl, interpolateHclLong, interpolateCubehelix, interpolateCubehelixLong, piecewise, quantize */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ \"./node_modules/d3-interpolate/src/value.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolate\", function() { return _value_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./array.js */ \"./node_modules/d3-interpolate/src/array.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateArray\", function() { return _array_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basis.js */ \"./node_modules/d3-interpolate/src/basis.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateBasis\", function() { return _basis_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./basisClosed.js */ \"./node_modules/d3-interpolate/src/basisClosed.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateBasisClosed\", function() { return _basisClosed_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./date.js */ \"./node_modules/d3-interpolate/src/date.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateDate\", function() { return _date_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _discrete_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./discrete.js */ \"./node_modules/d3-interpolate/src/discrete.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateDiscrete\", function() { return _discrete_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _hue_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./hue.js */ \"./node_modules/d3-interpolate/src/hue.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHue\", function() { return _hue_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./number.js */ \"./node_modules/d3-interpolate/src/number.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateNumber\", function() { return _number_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ \"./node_modules/d3-interpolate/src/numberArray.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateNumberArray\", function() { return _numberArray_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./object.js */ \"./node_modules/d3-interpolate/src/object.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateObject\", function() { return _object_js__WEBPACK_IMPORTED_MODULE_9__[\"default\"]; });\n\n/* harmony import */ var _round_js__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./round.js */ \"./node_modules/d3-interpolate/src/round.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateRound\", function() { return _round_js__WEBPACK_IMPORTED_MODULE_10__[\"default\"]; });\n\n/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./string.js */ \"./node_modules/d3-interpolate/src/string.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateString\", function() { return _string_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _transform_index_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./transform/index.js */ \"./node_modules/d3-interpolate/src/transform/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateTransformCss\", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__[\"interpolateTransformCss\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateTransformSvg\", function() { return _transform_index_js__WEBPACK_IMPORTED_MODULE_12__[\"interpolateTransformSvg\"]; });\n\n/* harmony import */ var _zoom_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./zoom.js */ \"./node_modules/d3-interpolate/src/zoom.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateZoom\", function() { return _zoom_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./rgb.js */ \"./node_modules/d3-interpolate/src/rgb.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateRgb\", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateRgbBasis\", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__[\"rgbBasis\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateRgbBasisClosed\", function() { return _rgb_js__WEBPACK_IMPORTED_MODULE_14__[\"rgbBasisClosed\"]; });\n\n/* harmony import */ var _hsl_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./hsl.js */ \"./node_modules/d3-interpolate/src/hsl.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHsl\", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHslLong\", function() { return _hsl_js__WEBPACK_IMPORTED_MODULE_15__[\"hslLong\"]; });\n\n/* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./lab.js */ \"./node_modules/d3-interpolate/src/lab.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateLab\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n/* harmony import */ var _hcl_js__WEBPACK_IMPORTED_MODULE_17__ = __webpack_require__(/*! ./hcl.js */ \"./node_modules/d3-interpolate/src/hcl.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHcl\", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateHclLong\", function() { return _hcl_js__WEBPACK_IMPORTED_MODULE_17__[\"hclLong\"]; });\n\n/* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__ = __webpack_require__(/*! ./cubehelix.js */ \"./node_modules/d3-interpolate/src/cubehelix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateCubehelix\", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interpolateCubehelixLong\", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_18__[\"cubehelixLong\"]; });\n\n/* harmony import */ var _piecewise_js__WEBPACK_IMPORTED_MODULE_19__ = __webpack_require__(/*! ./piecewise.js */ \"./node_modules/d3-interpolate/src/piecewise.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"piecewise\", function() { return _piecewise_js__WEBPACK_IMPORTED_MODULE_19__[\"default\"]; });\n\n/* harmony import */ var _quantize_js__WEBPACK_IMPORTED_MODULE_20__ = __webpack_require__(/*! ./quantize.js */ \"./node_modules/d3-interpolate/src/quantize.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"quantize\", function() { return _quantize_js__WEBPACK_IMPORTED_MODULE_20__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n/**\n * 判断是否数字\n * @return {Boolean} 是否数字\n */\n\nvar isNumber = function (value) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value, 'Number');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isNumber);\n//# sourceMappingURL=is-number.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-number.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/lab.js": -/*!************************************************!*\ - !*** ./node_modules/d3-interpolate/src/lab.js ***! - \************************************************/ +/***/ "./node_modules/@antv/util/esm/is-object-like.js": +/*!*******************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-object-like.js ***! + \*******************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return lab; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-interpolate/src/color.js\");\n\n\n\nfunction lab(start, end) {\n var l = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"lab\"])(start)).l, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"lab\"])(end)).l),\n a = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.a, end.a),\n b = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.b, end.b),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.l = l(t);\n start.a = a(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/lab.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar isObjectLike = function (value) {\n /**\n * isObjectLike({}) => true\n * isObjectLike([1, 2, 3]) => true\n * isObjectLike(Function) => false\n * isObjectLike(null) => false\n */\n return typeof value === 'object' && value !== null;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isObjectLike);\n//# sourceMappingURL=is-object-like.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-object-like.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/number.js": -/*!***************************************************!*\ - !*** ./node_modules/d3-interpolate/src/number.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/util/esm/is-object.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-object.js ***! + \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n return a = +a, b = +b, function(t) {\n return a * (1 - t) + b * t;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/number.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n /**\n * isObject({}) => true\n * isObject([1, 2, 3]) => true\n * isObject(Function) => true\n * isObject(null) => false\n */\n var type = typeof value;\n return value !== null && type === 'object' || type === 'function';\n});\n//# sourceMappingURL=is-object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-object.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/numberArray.js": -/*!********************************************************!*\ - !*** ./node_modules/d3-interpolate/src/numberArray.js ***! - \********************************************************/ -/*! exports provided: default, isNumberArray */ +/***/ "./node_modules/@antv/util/esm/is-odd.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/is-odd.js ***! + \***********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isNumberArray\", function() { return isNumberArray; });\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n if (!b) b = [];\n var n = a ? Math.min(b.length, a.length) : 0,\n c = b.slice(),\n i;\n return function(t) {\n for (i = 0; i < n; ++i) c[i] = a[i] * (1 - t) + b[i] * t;\n return c;\n };\n});\n\nfunction isNumberArray(x) {\n return ArrayBuffer.isView(x) && !(x instanceof DataView);\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/numberArray.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isOdd = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num % 2 !== 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isOdd);\n//# sourceMappingURL=is-odd.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-odd.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/object.js": -/*!***************************************************!*\ - !*** ./node_modules/d3-interpolate/src/object.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/util/esm/is-plain-object.js": +/*!********************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-plain-object.js ***! + \********************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _value_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./value.js */ \"./node_modules/d3-interpolate/src/value.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var i = {},\n c = {},\n k;\n\n if (a === null || typeof a !== \"object\") a = {};\n if (b === null || typeof b !== \"object\") b = {};\n\n for (k in b) {\n if (k in a) {\n i[k] = Object(_value_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a[k], b[k]);\n } else {\n c[k] = b[k];\n }\n }\n\n return function(t) {\n for (k in i) c[k] = i[k](t);\n return c;\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/object.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object-like */ \"./node_modules/@antv/util/esm/is-object-like.js\");\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\n\nvar isPlainObject = function (value) {\n /**\n * isObjectLike(new Foo) => false\n * isObjectLike([1, 2, 3]) => false\n * isObjectLike({ x: 0, y: 0 }) => true\n * isObjectLike(Object.create(null)) => true\n */\n if (!Object(_is_object_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) || !Object(_is_type__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value, 'Object')) {\n return false;\n }\n if (Object.getPrototypeOf(value) === null) {\n return true;\n }\n var proto = value;\n while (Object.getPrototypeOf(proto) !== null) {\n proto = Object.getPrototypeOf(proto);\n }\n return Object.getPrototypeOf(value) === proto;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPlainObject);\n//# sourceMappingURL=is-plain-object.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-plain-object.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/piecewise.js": -/*!******************************************************!*\ - !*** ./node_modules/d3-interpolate/src/piecewise.js ***! - \******************************************************/ +/***/ "./node_modules/@antv/util/esm/is-positive.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-positive.js ***! + \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return piecewise; });\nfunction piecewise(interpolate, values) {\n var i = 0, n = values.length - 1, v = values[0], I = new Array(n < 0 ? 0 : n);\n while (i < n) I[i] = interpolate(v, v = values[++i]);\n return function(t) {\n var i = Math.max(0, Math.min(n - 1, Math.floor(t *= n)));\n return I[i](t - i);\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/piecewise.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\nvar isPositive = function (num) {\n return Object(_is_number__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(num) && num > 0;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPositive);\n//# sourceMappingURL=is-positive.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-positive.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/quantize.js": +/***/ "./node_modules/@antv/util/esm/is-prototype.js": /*!*****************************************************!*\ - !*** ./node_modules/d3-interpolate/src/quantize.js ***! + !*** ./node_modules/@antv/util/esm/is-prototype.js ***! \*****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(interpolator, n) {\n var samples = new Array(n);\n for (var i = 0; i < n; ++i) samples[i] = interpolator(i / (n - 1));\n return samples;\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/quantize.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar objectProto = Object.prototype;\nvar isPrototype = function (value) {\n var Ctor = value && value.constructor;\n var proto = (typeof Ctor === 'function' && Ctor.prototype) || objectProto;\n return value === proto;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isPrototype);\n//# sourceMappingURL=is-prototype.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-prototype.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/rgb.js": -/*!************************************************!*\ - !*** ./node_modules/d3-interpolate/src/rgb.js ***! - \************************************************/ -/*! exports provided: default, rgbBasis, rgbBasisClosed */ +/***/ "./node_modules/@antv/util/esm/is-reg-exp.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-reg-exp.js ***! + \***************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgbBasis\", function() { return rgbBasis; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgbBasisClosed\", function() { return rgbBasisClosed; });\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _basis_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./basis.js */ \"./node_modules/d3-interpolate/src/basis.js\");\n/* harmony import */ var _basisClosed_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./basisClosed.js */ \"./node_modules/d3-interpolate/src/basisClosed.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-interpolate/src/color.js\");\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ((function rgbGamma(y) {\n var color = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__[\"gamma\"])(y);\n\n function rgb(start, end) {\n var r = color((start = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"rgb\"])(start)).r, (end = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"rgb\"])(end)).r),\n g = color(start.g, end.g),\n b = color(start.b, end.b),\n opacity = Object(_color_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(start.opacity, end.opacity);\n return function(t) {\n start.r = r(t);\n start.g = g(t);\n start.b = b(t);\n start.opacity = opacity(t);\n return start + \"\";\n };\n }\n\n rgb.gamma = rgbGamma;\n\n return rgb;\n})(1));\n\nfunction rgbSpline(spline) {\n return function(colors) {\n var n = colors.length,\n r = new Array(n),\n g = new Array(n),\n b = new Array(n),\n i, color;\n for (i = 0; i < n; ++i) {\n color = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"rgb\"])(colors[i]);\n r[i] = color.r || 0;\n g[i] = color.g || 0;\n b[i] = color.b || 0;\n }\n r = spline(r);\n g = spline(g);\n b = spline(b);\n color.opacity = 1;\n return function(t) {\n color.r = r(t);\n color.g = g(t);\n color.b = b(t);\n return color + \"\";\n };\n };\n}\n\nvar rgbBasis = rgbSpline(_basis_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]);\nvar rgbBasisClosed = rgbSpline(_basisClosed_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]);\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/rgb.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\nvar isRegExp = function (str) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str, 'RegExp');\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isRegExp);\n//# sourceMappingURL=is-reg-exp.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-reg-exp.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/round.js": +/***/ "./node_modules/@antv/util/esm/is-string.js": /*!**************************************************!*\ - !*** ./node_modules/d3-interpolate/src/round.js ***! + !*** ./node_modules/@antv/util/esm/is-string.js ***! \**************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n return a = +a, b = +b, function(t) {\n return Math.round(a * (1 - t) + b * t);\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/round.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_type__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-type */ \"./node_modules/@antv/util/esm/is-type.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (str) {\n return Object(_is_type__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str, 'String');\n});\n//# sourceMappingURL=is-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-string.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/string.js": -/*!***************************************************!*\ - !*** ./node_modules/d3-interpolate/src/string.js ***! - \***************************************************/ +/***/ "./node_modules/@antv/util/esm/is-type.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-type.js ***! + \************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./number.js */ \"./node_modules/d3-interpolate/src/number.js\");\n\n\nvar reA = /[-+]?(?:\\d+\\.?\\d*|\\.?\\d+)(?:[eE][-+]?\\d+)?/g,\n reB = new RegExp(reA.source, \"g\");\n\nfunction zero(b) {\n return function() {\n return b;\n };\n}\n\nfunction one(b) {\n return function(t) {\n return b(t) + \"\";\n };\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var bi = reA.lastIndex = reB.lastIndex = 0, // scan index for next number in b\n am, // current match in a\n bm, // current match in b\n bs, // string preceding current number in b, if any\n i = -1, // index in s\n s = [], // string constants and placeholders\n q = []; // number interpolators\n\n // Coerce inputs to strings.\n a = a + \"\", b = b + \"\";\n\n // Interpolate pairs of numbers in a & b.\n while ((am = reA.exec(a))\n && (bm = reB.exec(b))) {\n if ((bs = bm.index) > bi) { // a string precedes the next number in b\n bs = b.slice(bi, bs);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n if ((am = am[0]) === (bm = bm[0])) { // numbers in a & b match\n if (s[i]) s[i] += bm; // coalesce with previous string\n else s[++i] = bm;\n } else { // interpolate non-matching numbers\n s[++i] = null;\n q.push({i: i, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(am, bm)});\n }\n bi = reB.lastIndex;\n }\n\n // Add remains of b.\n if (bi < b.length) {\n bs = b.slice(bi);\n if (s[i]) s[i] += bs; // coalesce with previous string\n else s[++i] = bs;\n }\n\n // Special optimization for only a single match.\n // Otherwise, interpolate each of the numbers and rejoin the string.\n return s.length < 2 ? (q[0]\n ? one(q[0].x)\n : zero(b))\n : (b = q.length, function(t) {\n for (var i = 0, o; i < b; ++i) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n });\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/string.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar toString = {}.toString;\nvar isType = function (value, type) { return toString.call(value) === '[object ' + type + ']'; };\n/* harmony default export */ __webpack_exports__[\"default\"] = (isType);\n//# sourceMappingURL=is-type.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-type.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/transform/decompose.js": -/*!****************************************************************!*\ - !*** ./node_modules/d3-interpolate/src/transform/decompose.js ***! - \****************************************************************/ -/*! exports provided: identity, default */ +/***/ "./node_modules/@antv/util/esm/is-undefined.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/util/esm/is-undefined.js ***! + \*****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\nvar degrees = 180 / Math.PI;\n\nvar identity = {\n translateX: 0,\n translateY: 0,\n rotate: 0,\n skewX: 0,\n scaleX: 1,\n scaleY: 1\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b, c, d, e, f) {\n var scaleX, scaleY, skewX;\n if (scaleX = Math.sqrt(a * a + b * b)) a /= scaleX, b /= scaleX;\n if (skewX = a * c + b * d) c -= a * skewX, d -= b * skewX;\n if (scaleY = Math.sqrt(c * c + d * d)) c /= scaleY, d /= scaleY, skewX /= scaleY;\n if (a * d < b * c) a = -a, b = -b, skewX = -skewX, scaleX = -scaleX;\n return {\n translateX: e,\n translateY: f,\n rotate: Math.atan2(b, a) * degrees,\n skewX: Math.atan(skewX) * degrees,\n scaleX: scaleX,\n scaleY: scaleY\n };\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/transform/decompose.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar isUndefined = function (value) {\n return value === undefined;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (isUndefined);\n//# sourceMappingURL=is-undefined.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/is-undefined.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/transform/index.js": -/*!************************************************************!*\ - !*** ./node_modules/d3-interpolate/src/transform/index.js ***! - \************************************************************/ -/*! exports provided: interpolateTransformCss, interpolateTransformSvg */ +/***/ "./node_modules/@antv/util/esm/keys.js": +/*!*********************************************!*\ + !*** ./node_modules/@antv/util/esm/keys.js ***! + \*********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"interpolateTransformCss\", function() { return interpolateTransformCss; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"interpolateTransformSvg\", function() { return interpolateTransformSvg; });\n/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../number.js */ \"./node_modules/d3-interpolate/src/number.js\");\n/* harmony import */ var _parse_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./parse.js */ \"./node_modules/d3-interpolate/src/transform/parse.js\");\n\n\n\nfunction interpolateTransform(parse, pxComma, pxParen, degParen) {\n\n function pop(s) {\n return s.length ? s.pop() + \" \" : \"\";\n }\n\n function translate(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(\"translate(\", null, pxComma, null, pxParen);\n q.push({i: i - 4, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(xa, xb)}, {i: i - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(ya, yb)});\n } else if (xb || yb) {\n s.push(\"translate(\" + xb + pxComma + yb + pxParen);\n }\n }\n\n function rotate(a, b, s, q) {\n if (a !== b) {\n if (a - b > 180) b += 360; else if (b - a > 180) a += 360; // shortest path\n q.push({i: s.push(pop(s) + \"rotate(\", null, degParen) - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a, b)});\n } else if (b) {\n s.push(pop(s) + \"rotate(\" + b + degParen);\n }\n }\n\n function skewX(a, b, s, q) {\n if (a !== b) {\n q.push({i: s.push(pop(s) + \"skewX(\", null, degParen) - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(a, b)});\n } else if (b) {\n s.push(pop(s) + \"skewX(\" + b + degParen);\n }\n }\n\n function scale(xa, ya, xb, yb, s, q) {\n if (xa !== xb || ya !== yb) {\n var i = s.push(pop(s) + \"scale(\", null, \",\", null, \")\");\n q.push({i: i - 4, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(xa, xb)}, {i: i - 2, x: Object(_number_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(ya, yb)});\n } else if (xb !== 1 || yb !== 1) {\n s.push(pop(s) + \"scale(\" + xb + \",\" + yb + \")\");\n }\n }\n\n return function(a, b) {\n var s = [], // string constants and placeholders\n q = []; // number interpolators\n a = parse(a), b = parse(b);\n translate(a.translateX, a.translateY, b.translateX, b.translateY, s, q);\n rotate(a.rotate, b.rotate, s, q);\n skewX(a.skewX, b.skewX, s, q);\n scale(a.scaleX, a.scaleY, b.scaleX, b.scaleY, s, q);\n a = b = null; // gc\n return function(t) {\n var i = -1, n = q.length, o;\n while (++i < n) s[(o = q[i]).i] = o.x(t);\n return s.join(\"\");\n };\n };\n}\n\nvar interpolateTransformCss = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__[\"parseCss\"], \"px, \", \"px)\", \"deg)\");\nvar interpolateTransformSvg = interpolateTransform(_parse_js__WEBPACK_IMPORTED_MODULE_1__[\"parseSvg\"], \", \", \")\", \")\");\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/transform/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\nvar keys = Object.keys ? function (obj) { return Object.keys(obj); } : function (obj) {\n var result = [];\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (value, key) {\n if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj) && key === 'prototype')) {\n result.push(key);\n }\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (keys);\n//# sourceMappingURL=keys.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/keys.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/transform/parse.js": -/*!************************************************************!*\ - !*** ./node_modules/d3-interpolate/src/transform/parse.js ***! - \************************************************************/ -/*! exports provided: parseCss, parseSvg */ +/***/ "./node_modules/@antv/util/esm/last.js": +/*!*********************************************!*\ + !*** ./node_modules/@antv/util/esm/last.js ***! + \*********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseCss\", function() { return parseCss; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseSvg\", function() { return parseSvg; });\n/* harmony import */ var _decompose_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./decompose.js */ \"./node_modules/d3-interpolate/src/transform/decompose.js\");\n\n\nvar cssNode,\n cssRoot,\n cssView,\n svgNode;\n\nfunction parseCss(value) {\n if (value === \"none\") return _decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"identity\"];\n if (!cssNode) cssNode = document.createElement(\"DIV\"), cssRoot = document.documentElement, cssView = document.defaultView;\n cssNode.style.transform = value;\n value = cssView.getComputedStyle(cssRoot.appendChild(cssNode), null).getPropertyValue(\"transform\");\n cssRoot.removeChild(cssNode);\n value = value.slice(7, -1).split(\",\");\n return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(+value[0], +value[1], +value[2], +value[3], +value[4], +value[5]);\n}\n\nfunction parseSvg(value) {\n if (value == null) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"identity\"];\n if (!svgNode) svgNode = document.createElementNS(\"http://www.w3.org/2000/svg\", \"g\");\n svgNode.setAttribute(\"transform\", value);\n if (!(value = svgNode.transform.baseVal.consolidate())) return _decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"identity\"];\n value = value.matrix;\n return Object(_decompose_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value.a, value.b, value.c, value.d, value.e, value.f);\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/transform/parse.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return last; });\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nfunction last(o) {\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n var arr = o;\n return arr[arr.length - 1];\n }\n return undefined;\n}\n//# sourceMappingURL=last.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/last.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/value.js": -/*!**************************************************!*\ - !*** ./node_modules/d3-interpolate/src/value.js ***! - \**************************************************/ +/***/ "./node_modules/@antv/util/esm/lower-case.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/lower-case.js ***! + \***************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var d3_color__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! d3-color */ \"./node_modules/d3-color/src/index.js\");\n/* harmony import */ var _rgb_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./rgb.js */ \"./node_modules/d3-interpolate/src/rgb.js\");\n/* harmony import */ var _array_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./array.js */ \"./node_modules/d3-interpolate/src/array.js\");\n/* harmony import */ var _date_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./date.js */ \"./node_modules/d3-interpolate/src/date.js\");\n/* harmony import */ var _number_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./number.js */ \"./node_modules/d3-interpolate/src/number.js\");\n/* harmony import */ var _object_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./object.js */ \"./node_modules/d3-interpolate/src/object.js\");\n/* harmony import */ var _string_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./string.js */ \"./node_modules/d3-interpolate/src/string.js\");\n/* harmony import */ var _constant_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./constant.js */ \"./node_modules/d3-interpolate/src/constant.js\");\n/* harmony import */ var _numberArray_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./numberArray.js */ \"./node_modules/d3-interpolate/src/numberArray.js\");\n\n\n\n\n\n\n\n\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(a, b) {\n var t = typeof b, c;\n return b == null || t === \"boolean\" ? Object(_constant_js__WEBPACK_IMPORTED_MODULE_7__[\"default\"])(b)\n : (t === \"number\" ? _number_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"]\n : t === \"string\" ? ((c = Object(d3_color__WEBPACK_IMPORTED_MODULE_0__[\"color\"])(b)) ? (b = c, _rgb_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]) : _string_js__WEBPACK_IMPORTED_MODULE_6__[\"default\"])\n : b instanceof d3_color__WEBPACK_IMPORTED_MODULE_0__[\"color\"] ? _rgb_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]\n : b instanceof Date ? _date_js__WEBPACK_IMPORTED_MODULE_3__[\"default\"]\n : Object(_numberArray_js__WEBPACK_IMPORTED_MODULE_8__[\"isNumberArray\"])(b) ? _numberArray_js__WEBPACK_IMPORTED_MODULE_8__[\"default\"]\n : Array.isArray(b) ? _array_js__WEBPACK_IMPORTED_MODULE_2__[\"genericArray\"]\n : typeof b.valueOf !== \"function\" && typeof b.toString !== \"function\" || isNaN(b) ? _object_js__WEBPACK_IMPORTED_MODULE_5__[\"default\"]\n : _number_js__WEBPACK_IMPORTED_MODULE_4__[\"default\"])(a, b);\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/value.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n\nvar lowerCase = function (str) {\n return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str).toLowerCase();\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (lowerCase);\n//# sourceMappingURL=lower-case.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/lower-case.js?"); /***/ }), -/***/ "./node_modules/d3-interpolate/src/zoom.js": -/*!*************************************************!*\ - !*** ./node_modules/d3-interpolate/src/zoom.js ***! - \*************************************************/ +/***/ "./node_modules/@antv/util/esm/lower-first.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/util/esm/lower-first.js ***! + \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\nvar rho = Math.SQRT2,\n rho2 = 2,\n rho4 = 4,\n epsilon2 = 1e-12;\n\nfunction cosh(x) {\n return ((x = Math.exp(x)) + 1 / x) / 2;\n}\n\nfunction sinh(x) {\n return ((x = Math.exp(x)) - 1 / x) / 2;\n}\n\nfunction tanh(x) {\n return ((x = Math.exp(2 * x)) - 1) / (x + 1);\n}\n\n// p0 = [ux0, uy0, w0]\n// p1 = [ux1, uy1, w1]\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(p0, p1) {\n var ux0 = p0[0], uy0 = p0[1], w0 = p0[2],\n ux1 = p1[0], uy1 = p1[1], w1 = p1[2],\n dx = ux1 - ux0,\n dy = uy1 - uy0,\n d2 = dx * dx + dy * dy,\n i,\n S;\n\n // Special case for u0 ≅ u1.\n if (d2 < epsilon2) {\n S = Math.log(w1 / w0) / rho;\n i = function(t) {\n return [\n ux0 + t * dx,\n uy0 + t * dy,\n w0 * Math.exp(rho * t * S)\n ];\n }\n }\n\n // General case.\n else {\n var d1 = Math.sqrt(d2),\n b0 = (w1 * w1 - w0 * w0 + rho4 * d2) / (2 * w0 * rho2 * d1),\n b1 = (w1 * w1 - w0 * w0 - rho4 * d2) / (2 * w1 * rho2 * d1),\n r0 = Math.log(Math.sqrt(b0 * b0 + 1) - b0),\n r1 = Math.log(Math.sqrt(b1 * b1 + 1) - b1);\n S = (r1 - r0) / rho;\n i = function(t) {\n var s = t * S,\n coshr0 = cosh(r0),\n u = w0 / (rho2 * d1) * (coshr0 * tanh(rho * s + r0) - sinh(r0));\n return [\n ux0 + u * dx,\n uy0 + u * dy,\n w0 * coshr0 / cosh(rho * s + r0)\n ];\n }\n }\n\n i.duration = S * 1000;\n\n return i;\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-interpolate/src/zoom.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n\nvar lowerFirst = function (value) {\n var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value);\n return str.charAt(0).toLowerCase() + str.substring(1);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (lowerFirst);\n//# sourceMappingURL=lower-first.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/lower-first.js?"); /***/ }), -/***/ "./node_modules/d3-timer/src/index.js": +/***/ "./node_modules/@antv/util/esm/map-values.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/map-values.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/util/esm/is-object.js\");\n\n\nvar identity = function (v) { return v; };\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (object, func) {\n if (func === void 0) { func = identity; }\n var r = {};\n if (Object(_is_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(object) && !Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(object)) {\n Object.keys(object).forEach(function (key) {\n // @ts-ignore\n r[key] = func(object[key], key);\n });\n }\n return r;\n});\n//# sourceMappingURL=map-values.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/map-values.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/util/esm/map.js": /*!********************************************!*\ - !*** ./node_modules/d3-timer/src/index.js ***! + !*** ./node_modules/@antv/util/esm/map.js ***! \********************************************/ -/*! exports provided: now, timer, timerFlush, timeout, interval */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ \"./node_modules/d3-timer/src/timer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"now\", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"now\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"timer\", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"timer\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"timerFlush\", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"timerFlush\"]; });\n\n/* harmony import */ var _timeout_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timeout.js */ \"./node_modules/d3-timer/src/timeout.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"timeout\", function() { return _timeout_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interval.js */ \"./node_modules/d3-timer/src/interval.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interval\", function() { return _interval_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-timer/src/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar map = function (arr, func) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n // @ts-ignore\n return arr;\n }\n var result = [];\n for (var index = 0; index < arr.length; index++) {\n var value = arr[index];\n result.push(func(value, index));\n }\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (map);\n//# sourceMappingURL=map.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/map.js?"); /***/ }), -/***/ "./node_modules/d3-timer/src/interval.js": +/***/ "./node_modules/@antv/util/esm/max-by.js": /*!***********************************************!*\ - !*** ./node_modules/d3-timer/src/interval.js ***! + !*** ./node_modules/@antv/util/esm/max-by.js ***! \***********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ \"./node_modules/d3-timer/src/timer.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(callback, delay, time) {\n var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"Timer\"], total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n delay = +delay, time = time == null ? Object(_timer_js__WEBPACK_IMPORTED_MODULE_0__[\"now\"])() : +time;\n t.restart(function tick(elapsed) {\n elapsed += total;\n t.restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n return t;\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-timer/src/interval.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the maximum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * maxBy(objects, function(o) { return o.n; });\n * // => { 'n': 2 }\n *\n * maxBy(objects, 'n');\n * // => { 'n': 2 }\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr, fn) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n var maxItem;\n var max = -Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(fn) ? fn(item) : item[fn];\n if (v > max) {\n maxItem = item;\n max = v;\n }\n }\n return maxItem;\n});\n//# sourceMappingURL=max-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/max-by.js?"); /***/ }), -/***/ "./node_modules/d3-timer/src/timeout.js": -/*!**********************************************!*\ - !*** ./node_modules/d3-timer/src/timeout.js ***! - \**********************************************/ +/***/ "./node_modules/@antv/util/esm/max.js": +/*!********************************************!*\ + !*** ./node_modules/@antv/util/esm/max.js ***! + \********************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ \"./node_modules/d3-timer/src/timer.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(callback, delay, time) {\n var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"Timer\"];\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-timer/src/timeout.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the maximum value.\n * @example\n *\n * max([1, 2]);\n * // => 2\n *\n * max([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * max(data);\n * // => 1250010\n * // Math.max(...data) will encounter \"Maximum call stack size exceeded\" error\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.max(prev, curr);\n }, arr[0]);\n});\n//# sourceMappingURL=max.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/max.js?"); /***/ }), -/***/ "./node_modules/d3-timer/src/timer.js": -/*!********************************************!*\ - !*** ./node_modules/d3-timer/src/timer.js ***! - \********************************************/ -/*! exports provided: now, Timer, timer, timerFlush */ +/***/ "./node_modules/@antv/util/esm/measure-text-width.js": +/*!***********************************************************!*\ + !*** ./node_modules/@antv/util/esm/measure-text-width.js ***! + \***********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"now\", function() { return now; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Timer\", function() { return Timer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timer\", function() { return timer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timerFlush\", function() { return timerFlush; });\nvar frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nfunction now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nfunction Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nfunction timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nfunction timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-timer/src/timer.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var tslib__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! tslib */ \"./node_modules/tslib/tslib.es6.js\");\n/* harmony import */ var _values__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./values */ \"./node_modules/@antv/util/esm/values.js\");\n/* harmony import */ var _memoize__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./memoize */ \"./node_modules/@antv/util/esm/memoize.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n\n\n\nvar ctx;\n/**\n * 计算文本的宽度\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (Object(_memoize__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(function (text, font) {\n if (font === void 0) { font = {}; }\n var fontSize = font.fontSize, fontFamily = font.fontFamily, fontWeight = font.fontWeight, fontStyle = font.fontStyle, fontVariant = font.fontVariant;\n if (!ctx) {\n ctx = document.createElement('canvas').getContext('2d');\n }\n ctx.font = [fontStyle, fontVariant, fontWeight, fontSize + \"px\", fontFamily].join(' ');\n return ctx.measureText(Object(_is_string__WEBPACK_IMPORTED_MODULE_3__[\"default\"])(text) ? text : '').width;\n}, function (text, font) {\n if (font === void 0) { font = {}; }\n return Object(tslib__WEBPACK_IMPORTED_MODULE_0__[\"__spreadArrays\"])([text], Object(_values__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(font)).join('');\n}));\n//# sourceMappingURL=measure-text-width.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/measure-text-width.js?"); /***/ }), -/***/ "./node_modules/dagre-compound/dist/dagre-compound.es5.js": -/*!****************************************************************!*\ - !*** ./node_modules/dagre-compound/dist/dagre-compound.es5.js ***! - \****************************************************************/ -/*! exports provided: BRIDGE_GRAPH_NAME, GraphType, HierarchyNodeType, InclusionType, LAYOUT_CONFIG, NodeType, ROOT_NAME, buildGraph, flatGraph, getEdges, mergeConfig */ +/***/ "./node_modules/@antv/util/esm/memoize.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/memoize.js ***! + \************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BRIDGE_GRAPH_NAME\", function() { return o; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GraphType\", function() { return u; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HierarchyNodeType\", function() { return c; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InclusionType\", function() { return a; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LAYOUT_CONFIG\", function() { return e; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NodeType\", function() { return i; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ROOT_NAME\", function() { return r; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildGraph\", function() { return rc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flatGraph\", function() { return oc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getEdges\", function() { return ic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeConfig\", function() { return n; });\nconst e={graph:{meta:{rankDir:\"TB\",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function n(n={},t=e){var r,o,i,a;const u=JSON.parse(JSON.stringify(t)),c=(null===(r=null==n?void 0:n.graph)||void 0===r?void 0:r.meta)||{},s=(null===(o=null==n?void 0:n.subScene)||void 0===o?void 0:o.meta)||{},d=(null===(i=null==n?void 0:n.nodeSize)||void 0===i?void 0:i.meta)||{},f=(null===(a=null==n?void 0:n.nodeSize)||void 0===a?void 0:a.node)||{},h=u.nodeSize.bridge;return{graph:{meta:Object.assign(u.graph.meta,c)},subScene:{meta:Object.assign(u.subScene.meta,s)},nodeSize:{meta:Object.assign(u.nodeSize.meta,d),node:Object.assign(u.nodeSize.node,f),bridge:h}}}function t(e){return`◬${e}◬`}const r=t(\"ROOT\"),o=t(\"BRIDGE_GRAPH\");var i,a,u,c;!function(e){e[e.META=0]=\"META\",e[e.NODE=1]=\"NODE\",e[e.BRIDGE=2]=\"BRIDGE\"}(i||(i={})),function(e){e[e.INCLUDE=0]=\"INCLUDE\",e[e.EXCLUDE=1]=\"EXCLUDE\",e[e.UNSPECIFIED=2]=\"UNSPECIFIED\"}(a||(a={})),function(e){e[e.META=0]=\"META\",e[e.CORE=1]=\"CORE\",e[e.BRIDGE=2]=\"BRIDGE\"}(u||(u={})),function(e){e[e.META=0]=\"META\",e[e.OP=1]=\"OP\",e[e.SERIES=2]=\"SERIES\"}(c||(c={}));var s=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{};function d(e,n){return e(n={exports:{}},n.exports),n.exports}var f=function(){this.__data__=[],this.size=0};var h=function(e,n){return e===n||e!=e&&n!=n};var l=function(e,n){for(var t=e.length;t--;)if(h(e[t][0],n))return t;return-1},v=Array.prototype.splice;var p=function(e){var n=this.__data__,t=l(n,e);return!(t<0)&&(t==n.length-1?n.pop():v.call(n,t,1),--this.size,!0)};var g=function(e){var n=this.__data__,t=l(n,e);return t<0?void 0:n[t][1]};var y=function(e){return l(this.__data__,e)>-1};var b=function(e,n){var t=this.__data__,r=l(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function m(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Ve={};Ve[\"[object Float32Array]\"]=Ve[\"[object Float64Array]\"]=Ve[\"[object Int8Array]\"]=Ve[\"[object Int16Array]\"]=Ve[\"[object Int32Array]\"]=Ve[\"[object Uint8Array]\"]=Ve[\"[object Uint8ClampedArray]\"]=Ve[\"[object Uint16Array]\"]=Ve[\"[object Uint32Array]\"]=!0,Ve[\"[object Arguments]\"]=Ve[\"[object Array]\"]=Ve[\"[object ArrayBuffer]\"]=Ve[\"[object Boolean]\"]=Ve[\"[object DataView]\"]=Ve[\"[object Date]\"]=Ve[\"[object Error]\"]=Ve[\"[object Function]\"]=Ve[\"[object Map]\"]=Ve[\"[object Number]\"]=Ve[\"[object Object]\"]=Ve[\"[object RegExp]\"]=Ve[\"[object Set]\"]=Ve[\"[object String]\"]=Ve[\"[object WeakMap]\"]=!1;var $e=function(e){return Ce(e)&&Ue(e.length)&&!!Ve[T(e)]};var He=function(e){return function(n){return e(n)}},We=d((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,o=r&&r.exports===t&&N.process,i=function(){try{var e=r&&r.require&&r.require(\"util\").types;return e||o&&o.binding&&o.binding(\"util\")}catch(e){}}();e.exports=i})),qe=We&&We.isTypedArray,Ye=qe?He(qe):$e,Je=Object.prototype.hasOwnProperty;var Xe=function(e,n){var t=Te(e),r=!t&&Re(e),o=!t&&!r&&Pe(e),i=!t&&!r&&!o&&Ye(e),a=t||r||o||i,u=a?Me(e.length,String):[],c=u.length;for(var s in e)!n&&!Je.call(e,s)||a&&(\"length\"==s||o&&(\"offset\"==s||\"parent\"==s)||i&&(\"buffer\"==s||\"byteLength\"==s||\"byteOffset\"==s)||Fe(s,c))||u.push(s);return u},Ke=Object.prototype;var Qe=function(e){var n=e&&e.constructor;return e===(\"function\"==typeof n&&n.prototype||Ke)};var Ze=function(e,n){return function(t){return e(n(t))}},en=Ze(Object.keys,Object),nn=Object.prototype.hasOwnProperty;var tn=function(e){if(!Qe(e))return en(e);var n=[];for(var t in Object(e))nn.call(e,t)&&\"constructor\"!=t&&n.push(t);return n};var rn=function(e){return null!=e&&Ue(e.length)&&!z(e)};var on=function(e){return rn(e)?Xe(e):tn(e)};var an=function(e,n){return e&&Se(n,on(n),e)};var un=function(e){var n=[];if(null!=e)for(var t in Object(e))n.push(t);return n},cn=Object.prototype.hasOwnProperty;var sn=function(e){if(!D(e))return un(e);var n=Qe(e),t=[];for(var r in e)(\"constructor\"!=r||!n&&cn.call(e,r))&&t.push(r);return t};var dn=function(e){return rn(e)?Xe(e,!0):sn(e)};var fn=function(e,n){return e&&Se(n,dn(n),e)},hn=d((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,o=r&&r.exports===t?k.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,n){if(n)return e.slice();var t=e.length,r=i?i(t):new e.constructor(t);return e.copy(r),r}}));var ln=function(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++tu))return!1;var s=i.get(e),d=i.get(n);if(s&&d)return s==n&&d==e;var f=-1,h=!0,l=2&t?new wt:void 0;for(i.set(e,n),i.set(n,e);++f0&&r(c)?t>1?e(c,t-1,r,o,i):wn(i,c):o||(i[i.length]=c)}return i};var $r=function(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)},Hr=Math.max;var Wr=function(e,n,t){return n=Hr(void 0===n?e.length-1:n,0),function(){for(var r=arguments,o=-1,i=Hr(r.length-n,0),a=Array(i);++o0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}(qr);var Xr=function(e,n){return Jr(Wr(e,n,ht),e+\"\")};var Kr=function(e,n,t,r){for(var o=e.length,i=t+(r?1:-1);r?i--:++i-1};var to=function(e,n,t){for(var r=-1,o=null==e?0:e.length;++r=200){var s=n?null:oo(e);if(s)return Nt(s);a=!1,o=_t,c=new wt}else c=n?[]:u;e:for(;++ri){var a=o;o=i,i=a}return o+\"\u0001\"+i+\"\u0001\"+(ho.isUndefined(r)?\"\\0\":r)}function bo(e,n,t,r){var o=\"\"+n,i=\"\"+t;if(!e&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};return r&&(u.name=r),u}function mo(e,n){return yo(e,n.v,n.w,n.name)}vo.prototype._nodeCount=0,vo.prototype._edgeCount=0,vo.prototype.isDirected=function(){return this._isDirected},vo.prototype.isMultigraph=function(){return this._isMultigraph},vo.prototype.isCompound=function(){return this._isCompound},vo.prototype.setGraph=function(e){return this._label=e,this},vo.prototype.graph=function(){return this._label},vo.prototype.setDefaultNodeLabel=function(e){return ho.isFunction(e)||(e=ho.constant(e)),this._defaultNodeLabelFn=e,this},vo.prototype.nodeCount=function(){return this._nodeCount},vo.prototype.nodes=function(){return ho.keys(this._nodes)},vo.prototype.sources=function(){var e=this;return ho.filter(this.nodes(),(function(n){return ho.isEmpty(e._in[n])}))},vo.prototype.sinks=function(){var e=this;return ho.filter(this.nodes(),(function(n){return ho.isEmpty(e._out[n])}))},vo.prototype.setNodes=function(e,n){var t=arguments,r=this;return ho.each(e,(function(e){t.length>1?r.setNode(e,n):r.setNode(e)})),this},vo.prototype.setNode=function(e,n){return ho.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=n),this):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=\"\\0\",this._children[e]={},this._children[\"\\0\"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},vo.prototype.node=function(e){return this._nodes[e]},vo.prototype.hasNode=function(e){return ho.has(this._nodes,e)},vo.prototype.removeNode=function(e){var n=this;if(ho.has(this._nodes,e)){var t=function(e){n.removeEdge(n._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],ho.each(this.children(e),(function(e){n.setParent(e)})),delete this._children[e]),ho.each(ho.keys(this._in[e]),t),delete this._in[e],delete this._preds[e],ho.each(ho.keys(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},vo.prototype.setParent=function(e,n){if(!this._isCompound)throw new Error(\"Cannot set parent in a non-compound graph\");if(ho.isUndefined(n))n=\"\\0\";else{for(var t=n+=\"\";!ho.isUndefined(t);t=this.parent(t))if(t===e)throw new Error(\"Setting \"+n+\" as parent of \"+e+\" would create a cycle\");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this},vo.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},vo.prototype.parent=function(e){if(this._isCompound){var n=this._parent[e];if(\"\\0\"!==n)return n}},vo.prototype.children=function(e){if(ho.isUndefined(e)&&(e=\"\\0\"),this._isCompound){var n=this._children[e];if(n)return ho.keys(n)}else{if(\"\\0\"===e)return this.nodes();if(this.hasNode(e))return[]}},vo.prototype.predecessors=function(e){var n=this._preds[e];if(n)return ho.keys(n)},vo.prototype.successors=function(e){var n=this._sucs[e];if(n)return ho.keys(n)},vo.prototype.neighbors=function(e){var n=this.predecessors(e);if(n)return ho.union(n,this.successors(e))},vo.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},vo.prototype.filterNodes=function(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var t=this;ho.each(this._nodes,(function(t,r){e(r)&&n.setNode(r,t)})),ho.each(this._edgeObjs,(function(e){n.hasNode(e.v)&&n.hasNode(e.w)&&n.setEdge(e,t.edge(e))}));var r={};function o(e){var i=t.parent(e);return void 0===i||n.hasNode(i)?(r[e]=i,i):i in r?r[i]:o(i)}return this._isCompound&&ho.each(n.nodes(),(function(e){n.setParent(e,o(e))})),n},vo.prototype.setDefaultEdgeLabel=function(e){return ho.isFunction(e)||(e=ho.constant(e)),this._defaultEdgeLabelFn=e,this},vo.prototype.edgeCount=function(){return this._edgeCount},vo.prototype.edges=function(){return ho.values(this._edgeObjs)},vo.prototype.setPath=function(e,n){var t=this,r=arguments;return ho.reduce(e,(function(e,o){return r.length>1?t.setEdge(e,o,n):t.setEdge(e,o),o})),this},vo.prototype.setEdge=function(){var e,n,t,r,o=!1,i=arguments[0];\"object\"==typeof i&&null!==i&&\"v\"in i?(e=i.v,n=i.w,t=i.name,2===arguments.length&&(r=arguments[1],o=!0)):(e=i,n=arguments[1],t=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),e=\"\"+e,n=\"\"+n,ho.isUndefined(t)||(t=\"\"+t);var a=yo(this._isDirected,e,n,t);if(ho.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=r),this;if(!ho.isUndefined(t)&&!this._isMultigraph)throw new Error(\"Cannot set a named edge when isMultigraph = false\");this.setNode(e),this.setNode(n),this._edgeLabels[a]=o?r:this._defaultEdgeLabelFn(e,n,t);var u=bo(this._isDirected,e,n,t);return e=u.v,n=u.w,Object.freeze(u),this._edgeObjs[a]=u,po(this._preds[n],e),po(this._sucs[e],n),this._in[n][a]=u,this._out[e][a]=u,this._edgeCount++,this},vo.prototype.edge=function(e,n,t){var r=1===arguments.length?mo(this._isDirected,arguments[0]):yo(this._isDirected,e,n,t);return this._edgeLabels[r]},vo.prototype.hasEdge=function(e,n,t){var r=1===arguments.length?mo(this._isDirected,arguments[0]):yo(this._isDirected,e,n,t);return ho.has(this._edgeLabels,r)},vo.prototype.removeEdge=function(e,n,t){var r=1===arguments.length?mo(this._isDirected,arguments[0]):yo(this._isDirected,e,n,t),o=this._edgeObjs[r];return o&&(e=o.v,n=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],go(this._preds[n],e),go(this._sucs[e],n),delete this._in[n][r],delete this._out[e][r],this._edgeCount--),this},vo.prototype.inEdges=function(e,n){var t=this._in[e];if(t){var r=ho.values(t);return n?ho.filter(r,(function(e){return e.v===n})):r}},vo.prototype.outEdges=function(e,n){var t=this._out[e];if(t){var r=ho.values(t);return n?ho.filter(r,(function(e){return e.w===n})):r}},vo.prototype.nodeEdges=function(e,n){var t=this.inEdges(e,n);if(t)return t.concat(this.outEdges(e,n))};var wo={Graph:lo,version:\"2.1.8\"},Eo={write:function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:_o(e),edges:jo(e)};ho.isUndefined(e.graph())||(n.value=ho.clone(e.graph()));return n},read:function(e){var n=new lo(e.options).setGraph(e.value);return ho.each(e.nodes,(function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)})),ho.each(e.edges,(function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),n}};function _o(e){return ho.map(e.nodes(),(function(n){var t=e.node(n),r=e.parent(n),o={v:n};return ho.isUndefined(t)||(o.value=t),ho.isUndefined(r)||(o.parent=r),o}))}function jo(e){return ho.map(e.edges(),(function(n){var t=e.edge(n),r={v:n.v,w:n.w};return ho.isUndefined(n.name)||(r.name=n.name),ho.isUndefined(t)||(r.value=t),r}))}var xo=function(e){var n,t={},r=[];function o(r){ho.has(t,r)||(t[r]=!0,n.push(r),ho.each(e.successors(r),o),ho.each(e.predecessors(r),o))}return ho.each(e.nodes(),(function(e){n=[],o(e),n.length&&r.push(n)})),r};var No=Oo;function Oo(){this._arr=[],this._keyIndices={}}Oo.prototype.size=function(){return this._arr.length},Oo.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},Oo.prototype.has=function(e){return ho.has(this._keyIndices,e)},Oo.prototype.priority=function(e){var n=this._keyIndices[e];if(void 0!==n)return this._arr[n].priority},Oo.prototype.min=function(){if(0===this.size())throw new Error(\"Queue underflow\");return this._arr[0].key},Oo.prototype.add=function(e,n){var t=this._keyIndices;if(e=String(e),!ho.has(t,e)){var r=this._arr,o=r.length;return t[e]=o,r.push({key:e,priority:n}),this._decrease(o),!0}return!1},Oo.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},Oo.prototype.decrease=function(e,n){var t=this._keyIndices[e];if(n>this._arr[t].priority)throw new Error(\"New priority is greater than current priority. Key: \"+e+\" Old: \"+this._arr[t].priority+\" New: \"+n);this._arr[t].priority=n,this._decrease(t)},Oo.prototype._heapify=function(e){var n=this._arr,t=2*e,r=t+1,o=e;t>1].priority0&&(o=u.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return a}(e,String(n),t||Io,r||function(n){return e.outEdges(n)})},Io=ho.constant(1);var So=function(e,n,t){return ho.transform(e.nodes(),(function(r,o){r[o]=ko(e,o,n,t)}),{})};var Mo=function(e){var n=0,t=[],r={},o=[];function i(a){var u=r[a]={onStack:!0,lowlink:n,index:n++};if(t.push(a),e.successors(a).forEach((function(e){ho.has(r,e)?r[e].onStack&&(u.lowlink=Math.min(u.lowlink,r[e].index)):(i(e),u.lowlink=Math.min(u.lowlink,r[e].lowlink))})),u.lowlink===u.index){var c,s=[];do{c=t.pop(),r[c].onStack=!1,s.push(c)}while(a!==c);o.push(s)}}return e.nodes().forEach((function(e){ho.has(r,e)||i(e)})),o};var Co=function(e){return ho.filter(Mo(e),(function(n){return n.length>1||1===n.length&&e.hasEdge(n[0],n[0])}))};var Go=function(e,n,t){return function(e,n,t){var r={},o=e.nodes();return o.forEach((function(e){r[e]={},r[e][e]={distance:0},o.forEach((function(n){e!==n&&(r[e][n]={distance:Number.POSITIVE_INFINITY})})),t(e).forEach((function(t){var o=t.v===e?t.w:t.v,i=n(t);r[e][o]={distance:i,predecessor:e}}))})),o.forEach((function(e){var n=r[e];o.forEach((function(t){var i=r[t];o.forEach((function(t){var r=i[e],o=n[t],a=i[t],u=r.distance+o.distance;u0;){if(t=i.removeMin(),ho.has(o,t))r.setEdge(t,o[t]);else{if(u)throw new Error(\"Input graph is not connected: \"+e);u=!0}e.nodeEdges(t).forEach(a)}return r},tarjan:Mo,topsort:Ao},version:wo.version};try{Po=zo}catch(e){}Po||(Po=window.graphlib);var Fo=Po;var Uo=function(e){return at(e,5)};var Vo=function(e,n,t){if(!D(t))return!1;var r=typeof n;return!!(\"number\"==r?rn(t)&&Fe(n,t.length):\"string\"==r&&n in t)&&h(t[n],e)},$o=Object.prototype,Ho=$o.hasOwnProperty,Wo=Xr((function(e,n){e=Object(e);var t=-1,r=n.length,o=r>2?n[2]:void 0;for(o&&Vo(n[0],n[1],o)&&(r=1);++t-1?o[i?n[a]:a]:void 0}},Yo=/^\\s+|\\s+$/g,Jo=/^[-+]0x[0-9a-f]+$/i,Xo=/^0b[01]+$/i,Ko=/^0o[0-7]+$/i,Qo=parseInt;var Zo=function(e){if(\"number\"==typeof e)return e;if(Pt(e))return NaN;if(D(e)){var n=\"function\"==typeof e.valueOf?e.valueOf():e;e=D(n)?n+\"\":n}if(\"string\"!=typeof e)return 0===e?e:+e;e=e.replace(Yo,\"\");var t=Xo.test(e);return t||Ko.test(e)?Qo(e.slice(2),t?2:8):Jo.test(e)?NaN:+e};var ei=function(e){return e?Infinity===(e=Zo(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var ni=function(e){var n=ei(e),t=n%1;return n==n?t?n-t:n:0},ti=Math.max;var ri=qo((function(e,n,t){var r=null==e?0:e.length;if(!r)return-1;var o=null==t?0:ni(t);return o<0&&(o=ti(r+o,0)),Kr(e,dr(n),o)}));var oi=function(e){return(null==e?0:e.length)?Vr(e,1):[]};var ii=function(e,n){return null==e?e:st(e,lt(n),dn)};var ai=function(e){var n=null==e?0:e.length;return n?e[n-1]:void 0};var ui=function(e,n){var t={};return n=dr(n),dt(e,(function(e,r,o){Oe(t,r,n(e,r,o))})),t};var ci=function(e,n,t){for(var r=-1,o=e.length;++rn};var di=function(e){return e&&e.length?ci(e,ht,si):void 0};var fi=function(e,n,t){(void 0!==t&&!h(e[n],t)||void 0===t&&!(n in e))&&Oe(e,n,t)},hi=Function.prototype,li=Object.prototype,vi=hi.toString,pi=li.hasOwnProperty,gi=vi.call(Object);var yi=function(e){if(!Ce(e)||\"[object Object]\"!=T(e))return!1;var n=En(e);if(null===n)return!0;var t=pi.call(n,\"constructor\")&&n.constructor;return\"function\"==typeof t&&t instanceof t&&vi.call(t)==gi};var bi=function(e,n){if((\"constructor\"!==n||\"function\"!=typeof e[n])&&\"__proto__\"!=n)return e[n]};var mi=function(e){return Se(e,dn(e))};var wi=function(e,n,t,r,o,i,a){var u=bi(e,t),c=bi(n,t),s=a.get(c);if(s)fi(e,t,s);else{var d=i?i(u,c,t+\"\",e,n,a):void 0,f=void 0===d;if(f){var h=Te(c),l=!h&&Pe(c),v=!h&&!l&&Ye(c);d=c,h||l||v?Te(u)?d=u:ao(u)?d=ln(u):l?(f=!1,d=hn(c,!0)):v?(f=!1,d=Yn(c,!0)):d=[]:yi(c)||Re(c)?(d=u,Re(u)?d=mi(u):D(u)&&!z(u)||(d=Qn(c))):f=!1}f&&(a.set(c,d),o(d,c,r,i,a),a.delete(c)),fi(e,t,d)}};var Ei=function e(n,t,r,o,i){n!==t&&st(t,(function(a,u){if(i||(i=new je),D(a))wi(n,t,u,r,e,o,i);else{var c=o?o(bi(n,u),a,u+\"\",n,t,i):void 0;void 0===c&&(c=a),fi(n,u,c)}}),dn)};var _i=function(e){return Xr((function(n,t){var r=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=e.length>3&&\"function\"==typeof i?(o--,i):void 0,a&&Vo(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),n=Object(n);++rn||i&&a&&c&&!u&&!s||r&&a&&c||!t&&c||!o)return 1;if(!r&&!i&&!s&&e=u?c:c*(\"desc\"==t[r]?-1:1)}return e.index-n.index};var Di=function(e,n,t){n=n.length?Yt(n,(function(e){return Te(e)?function(n){return nr(n,1===e.length?e[0]:e)}:e})):[ht];var r=-1;n=Yt(n,He(dr));var o=br(e,(function(e,t,o){return{criteria:Yt(n,(function(n){return n(e)})),index:++r,value:e}}));return Li(o,(function(e,n){return Ti(e,n,t)}))},Pi=Xr((function(e,n){if(null==e)return[];var t=n.length;return t>1&&Vo(e,n[0],n[1])?n=[]:t>2&&Vo(n[0],n[1],n[2])&&(n=[n[0]]),Di(e,Vr(n,1),[])})),zi=0;var Fi=function(e){var n=++zi;return Qt(e)+n};var Ui=function(e,n,t){for(var r=-1,o=e.length,i=n.length,a={};++r0;--u)if(r=n[u].dequeue()){o=o.concat(Zi(e,n,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return Hi.flatten(Hi.map(r,(function(n){return e.outEdges(n.v,n.w)})),!0)},Qi=Hi.constant(1);function Zi(e,n,t,r,o){var i=o?[]:void 0;return Hi.forEach(e.inEdges(r.v),(function(r){var a=e.edge(r),u=e.node(r.v);o&&i.push({v:r.v,w:r.w}),u.out-=a,ea(n,t,u)})),Hi.forEach(e.outEdges(r.v),(function(r){var o=e.edge(r),i=r.w,a=e.node(i);a.in-=o,ea(n,t,a)})),e.removeNode(r.v),i}function ea(e,n,t){t.out?t.in?e[t.out-t.in+n].enqueue(t):e[e.length-1].enqueue(t):e[0].enqueue(t)}var na={run:function(e){var n=\"greedy\"===e.graph().acyclicer?Ki(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],t={},r={};function o(i){Hi.has(r,i)||(r[i]=!0,t[i]=!0,Hi.forEach(e.outEdges(i),(function(e){Hi.has(t,e.w)?n.push(e):o(e.w)})),delete t[i])}return Hi.forEach(e.nodes(),o),n}(e);Hi.forEach(n,(function(n){var t=e.edge(n);e.removeEdge(n),t.forwardName=n.name,t.reversed=!0,e.setEdge(n.w,n.v,t,Hi.uniqueId(\"rev\"))}))},undo:function(e){Hi.forEach(e.edges(),(function(n){var t=e.edge(n);if(t.reversed){e.removeEdge(n);var r=t.forwardName;delete t.reversed,delete t.forwardName,e.setEdge(n.w,n.v,t,r)}}))}};var ta=Fo.Graph,ra={addDummyNode:oa,simplify:function(e){var n=(new ta).setGraph(e.graph());return Hi.forEach(e.nodes(),(function(t){n.setNode(t,e.node(t))})),Hi.forEach(e.edges(),(function(t){var r=n.edge(t.v,t.w)||{weight:0,minlen:1},o=e.edge(t);n.setEdge(t.v,t.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),n},asNonCompoundGraph:function(e){var n=new ta({multigraph:e.isMultigraph()}).setGraph(e.graph());return Hi.forEach(e.nodes(),(function(t){e.children(t).length||n.setNode(t,e.node(t))})),Hi.forEach(e.edges(),(function(t){n.setEdge(t,e.edge(t))})),n},successorWeights:function(e){var n=Hi.map(e.nodes(),(function(n){var t={};return Hi.forEach(e.outEdges(n),(function(n){t[n.w]=(t[n.w]||0)+e.edge(n).weight})),t}));return Hi.zipObject(e.nodes(),n)},predecessorWeights:function(e){var n=Hi.map(e.nodes(),(function(n){var t={};return Hi.forEach(e.inEdges(n),(function(n){t[n.v]=(t[n.v]||0)+e.edge(n).weight})),t}));return Hi.zipObject(e.nodes(),n)},intersectRect:function(e,n){var t,r,o=e.x,i=e.y,a=n.x-o,u=n.y-i,c=e.width/2,s=e.height/2;if(!a&&!u)throw new Error(\"Not possible to find intersection inside of the rectangle\");Math.abs(u)*c>Math.abs(a)*s?(u<0&&(s=-s),t=s*a/u,r=s):(a<0&&(c=-c),t=c,r=c*u/a);return{x:o+t,y:i+r}},buildLayerMatrix:function(e){var n=Hi.map(Hi.range(ia(e)+1),(function(){return[]}));return Hi.forEach(e.nodes(),(function(t){var r=e.node(t),o=r.rank;Hi.isUndefined(o)||(n[o][r.order]=t)})),n},normalizeRanks:function(e){var n=Hi.min(Hi.map(e.nodes(),(function(n){return e.node(n).rank})));Hi.forEach(e.nodes(),(function(t){var r=e.node(t);Hi.has(r,\"rank\")&&(r.rank-=n)}))},removeEmptyRanks:function(e){var n=Hi.min(Hi.map(e.nodes(),(function(n){return e.node(n).rank}))),t=[];Hi.forEach(e.nodes(),(function(r){var o=e.node(r).rank-n;t[o]||(t[o]=[]),t[o].push(r)}));var r=0,o=e.graph().nodeRankFactor;Hi.forEach(t,(function(n,t){Hi.isUndefined(n)&&t%o!=0?--r:r&&Hi.forEach(n,(function(n){e.node(n).rank+=r}))}))},addBorderNode:function(e,n,t,r){var o={width:0,height:0};arguments.length>=4&&(o.rank=t,o.order=r);return oa(e,\"border\",o,n)},maxRank:ia,partition:function(e,n){var t={lhs:[],rhs:[]};return Hi.forEach(e,(function(e){n(e)?t.lhs.push(e):t.rhs.push(e)})),t},time:function(e,n){var t=Hi.now();try{return n()}finally{console.log(e+\" time: \"+(Hi.now()-t)+\"ms\")}},notime:function(e,n){return n()}};function oa(e,n,t,r){var o;do{o=Hi.uniqueId(r)}while(e.hasNode(o));return t.dummy=n,e.setNode(o,t),o}function ia(e){return Hi.max(Hi.map(e.nodes(),(function(n){var t=e.node(n).rank;if(!Hi.isUndefined(t))return t})))}var aa={run:function(e){e.graph().dummyChains=[],Hi.forEach(e.edges(),(function(n){!function(e,n){var t,r,o,i=n.v,a=e.node(i).rank,u=n.w,c=e.node(u).rank,s=n.name,d=e.edge(n),f=d.labelRank;if(c===a+1)return;for(e.removeEdge(n),o=0,++a;aa.lim&&(u=a,c=!0);var s=Hi.filter(n.edges(),(function(n){return c===Sa(e,e.node(n.v),u)&&c!==Sa(e,e.node(n.w),u)}));return Hi.minBy(s,(function(e){return pa(n,e)}))}function Ia(e,n,t,r){var o=t.v,i=t.w;e.removeEdge(o,i),e.setEdge(r.v,r.w,{}),xa(e),_a(e,n),function(e,n){var t=Hi.find(e.nodes(),(function(e){return!n.node(e).parent})),r=ya(e,t);r=r.slice(1),Hi.forEach(r,(function(t){var r=e.node(t).parent,o=n.edge(t,r),i=!1;o||(o=n.edge(r,t),i=!0),n.node(t).rank=n.node(r).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function Sa(e,n,t){return t.low<=n.lim&&n.lim<=t.lim}Ea.initLowLimValues=xa,Ea.initCutValues=_a,Ea.calcCutValue=ja,Ea.leaveEdge=Oa,Ea.enterEdge=ka,Ea.exchangeEdges=Ia;var Ma=ua,Ca=function(e){switch(e.graph().ranker){case\"network-simplex\":Ba(e);break;case\"tight-tree\":!function(e){Ma(e),fa(e)}(e);break;case\"longest-path\":Ga(e);break;default:Ba(e)}};var Ga=Ma;function Ba(e){wa(e)}var Aa=function(e){var n=function(e){var n={},t=0;function r(o){var i=t;Hi.forEach(e.children(o),r),n[o]={low:i,lim:t++}}return Hi.forEach(e.children(),r),n}(e);Hi.forEach(e.graph().dummyChains,(function(t){for(var r=e.node(t),o=r.edgeObj,i=function(e,n,t,r){var o,i,a=[],u=[],c=Math.min(n[t].low,n[r].low),s=Math.max(n[t].lim,n[r].lim);o=t;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>c||s>n[o].lim));i=o,o=r;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,c=0,s=a[c],d=!0;t!==o.w;){if(r=e.node(t),d){for(;(s=a[c])!==u&&e.node(s).maxRank0;)n%2&&(t+=u[n+1]),u[n=n-1>>1]+=e.weight;c+=e.weight*t}))),c}var qa=function(e,n){return Hi.map(n,(function(n){var t=e.inEdges(n);if(t.length){var r=Hi.reduce(t,(function(n,t){var r=e.edge(t),o=e.node(t.v);return{sum:n.sum+r.weight*o.order,weight:n.weight+r.weight}}),{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}return{v:n}}))};var Ya=function(e,n){var t={};return Hi.forEach(e,(function(e,n){var r=t[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};Hi.isUndefined(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)})),Hi.forEach(n.edges(),(function(e){var n=t[e.v],r=t[e.w];Hi.isUndefined(n)||Hi.isUndefined(r)||(r.indegree++,n.out.push(t[e.w]))})),function(e){var n=[];function t(e){return function(n){n.merged||(Hi.isUndefined(n.barycenter)||Hi.isUndefined(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var t=0,r=0;e.weight&&(t+=e.barycenter*e.weight,r+=e.weight);n.weight&&(t+=n.barycenter*n.weight,r+=n.weight);e.vs=n.vs.concat(e.vs),e.barycenter=t/r,e.weight=r,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function r(n){return function(t){t.in.push(n),0==--t.indegree&&e.push(t)}}for(;e.length;){var o=e.pop();n.push(o),Hi.forEach(o.in.reverse(),t(o)),Hi.forEach(o.out,r(o))}return Hi.map(Hi.filter(n,(function(e){return!e.merged})),(function(e){return Hi.pick(e,[\"vs\",\"i\",\"barycenter\",\"weight\"])}))}(Hi.filter(t,(function(e){return!e.indegree})))};var Ja=function(e,n){var t=ra.partition(e,(function(e){return Hi.has(e,\"barycenter\")})),r=t.lhs,o=Hi.sortBy(t.rhs,(function(e){return-e.i})),i=[],a=0,u=0,c=0;r.sort((s=!!n,function(e,n){return e.barycentern.barycenter?1:s?n.i-e.i:e.i-n.i})),c=Xa(i,o,c),Hi.forEach(r,(function(e){c+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,c=Xa(i,o,c)}));var s;var d={vs:Hi.flatten(i,!0)};u&&(d.barycenter=a/u,d.weight=u);return d};function Xa(e,n,t){for(var r;n.length&&(r=Hi.last(n)).i<=t;)n.pop(),e.push(r.vs),t++;return t}var Ka=function e(n,t,r,o){var i=n.children(t),a=n.node(t),u=a?a.borderLeft:void 0,c=a?a.borderRight:void 0,s={};u&&(i=Hi.filter(i,(function(e){return e!==u&&e!==c})));var d=qa(n,i);Hi.forEach(d,(function(t){if(n.children(t.v).length){var i=e(n,t.v,r,o);s[t.v]=i,Hi.has(i,\"barycenter\")&&(a=t,u=i,Hi.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u}));var f=Ya(d,r);!function(e,n){Hi.forEach(e,(function(e){e.vs=Hi.flatten(e.vs.map((function(e){return n[e]?n[e].vs:e})),!0)}))}(f,s);var h=Ja(f,o);if(u&&(h.vs=Hi.flatten([u,h.vs,c],!0),n.predecessors(u).length)){var l=n.node(n.predecessors(u)[0]),v=n.node(n.predecessors(c)[0]);Hi.has(h,\"barycenter\")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+l.order+v.order)/(h.weight+2),h.weight+=2}return h};var Qa=Fo.Graph,Za=function(e,n,t){var r=function(e){var n;for(;e.hasNode(n=Hi.uniqueId(\"_root\")););return n}(e),o=new Qa({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(n){return e.node(n)}));return Hi.forEach(e.nodes(),(function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||r),Hi.forEach(e[t](i),(function(n){var t=n.v===i?n.w:n.v,r=o.edge(t,i),a=Hi.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:e.edge(n).weight+a})})),Hi.has(a,\"minRank\")&&o.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))})),o};var eu=function(e,n,t){var r,o={};Hi.forEach(t,(function(t){for(var i,a,u=e.parent(t);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=r,r=u),a&&a!==u)return void n.setEdge(a,u);u=i}}))};var nu=Fo.Graph,tu=function(e){var n=ra.maxRank(e),t=ru(e,Hi.range(1,n+1),\"inEdges\"),r=ru(e,Hi.range(n-1,-1,-1),\"outEdges\"),o=$a(e);iu(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){ou(u%2?t:r,u%4>=2),o=ra.buildLayerMatrix(e);var s=Ha(e,o);sa)&&du(t,n,u)}))}))}return Hi.reduce(n,(function(n,t){var o,i=-1,a=0;return Hi.forEach(t,(function(u,c){if(\"border\"===e.node(u).dummy){var s=e.predecessors(u);s.length&&(o=e.node(s[0]).order,r(t,a,c,i,o),a=c,i=o)}r(t,a,t.length,o,n.length)})),t})),t}function du(e,n,t){if(n>t){var r=n;n=t,t=r}var o=e[n];o||(e[n]=o={}),o[t]=!0}function fu(e,n,t){if(n>t){var r=n;n=t,t=r}return Hi.has(e[n],t)}function hu(e,n,t,r){var o={},i={},a={};return Hi.forEach(n,(function(e){Hi.forEach(e,(function(e,n){o[e]=e,i[e]=e,a[e]=n}))})),Hi.forEach(n,(function(e){var n=-1;Hi.forEach(e,(function(e){var u=r(e);if(u.length)for(var c=((u=Hi.sortBy(u,(function(e){return a[e]}))).length-1)/2,s=Math.floor(c),d=Math.ceil(c);s<=d;++s){var f=u[s];i[e]===e&&nnew Du(e))).forEach((e=>{n.nodes[e.name]=e,e.inputs.forEach((t=>{!function(e,n,t){t.name!==n.name&&e.edges.push(Object.assign(Object.assign({},t.attr),{v:t.name,w:n.name}))}(n,e,t)}))})),n}class Fu{constructor(e,n={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=a.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=i.META,this.path=[],this.name=e,this.metaGraph=Hu(e,u.META,n)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map((e=>this.metaGraph.node(e)))}leaves(){let e,n=[],t=[this];for(;t.length;){let r=t.shift();r.isGroupNode?(e=r.metaGraph,e.nodes().forEach((n=>t.push(e.node(n))))):n.push(r.name)}return n}}class Uu{constructor(e,n){this.v=e,this.w=n,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(e,n){this.baseEdgeList.push(e)}}function Vu(e,n={}){return new Fu(e,n)}function $u(e,n){return new Uu(e,n)}function Hu(e,n,t){const r=t||{},o=new Ru.Graph(r);return o.setGraph({name:e,rankdir:r.rankdir,type:n,align:r.align}),o}class Wu{constructor(e={}){this.graphOptions=e,this.index={},this.graphOptions.compound=!0,this.root=Vu(r,this.graphOptions),this.index[r]=this.root}getNodeMap(){return this.index}node(e){return this.index[e]}setNode(e,n){this.index[e]=n}getBridgeGraph(e){const n=this.index[e];if(!n)throw Error(\"Could not find node in hierarchy: \"+e);if(!(\"metaGraph\"in n))return null;const t=n;if(t.bridgeGraph)return t.bridgeGraph;const r=Hu(o,u.BRIDGE,this.graphOptions);if(t.bridgeGraph=r,!n.parentNode||!(\"metaGraph\"in n.parentNode))return r;const i=n.parentNode;return[i.metaGraph,this.getBridgeGraph(i.name)].forEach((n=>{n.edges().filter((n=>n.v===e||n.w===e)).forEach((t=>{const o=t.w===e;n.edge(t).baseEdgeList.forEach((n=>{const[i,a]=o?[n.w,t.v]:[n.v,t.w],u=this.getChildName(e,i),c={v:o?a:u,w:o?u:a};let s=r.edge(c);s||(s=$u(c.v,c.w),s.inbound=o,r.setEdge(c.v,c.w,s)),s.addBaseEdge(n,this)}))}))})),r}getChildName(e,n){let t=this.index[n];for(;t;){if(t.parentNode&&t.parentNode.name===e)return t.name;t=t.parentNode}throw Error(\"Could not find immediate child for descendant: \"+n)}getPredecessors(e){const n=this.index[e];if(!n)throw Error(\"Could not find node with name: \"+e);return this.getOneWayEdges(n,!0)}getSuccessors(e){const n=this.index[e];if(!n)throw Error(\"Could not find node with name: \"+e);return this.getOneWayEdges(n,!1)}getOneWayEdges(e,n){const t=[];if(!e.parentNode||!e.parentNode.isGroupNode)return t;const r=e.parentNode,o=r.metaGraph,i=this.getBridgeGraph(r.name);return Yu(o,e,n,t),Yu(i,e,n,t),t}}function qu(e,n){const{rankDirection:t,align:r}=n,o=new Wu({rankdir:t,align:r});return function(e,n){Object.keys(n.nodes).forEach((t=>{const r=n.nodes[t],o=r.path;let i=e.root;i.depth=Math.max(o.length,i.depth);for(let n=0;n{let t=0;for(;e;)n[t++]=e.name,e=e.parentNode;return t-1};n.edges.forEach((a=>{r=[],o=[];let u=i(n.nodes[a.v],r),c=i(n.nodes[a.w],o);for(;r[u]===o[c];)if(u--,c--,u<0||c<0)throw Error(\"No difference found between ancestor paths.\");const s=t[r[u+1]],d=r[u],f=o[c];let h=s.metaGraph.edge(d,f);h||(h=$u(d,f),s.metaGraph.setEdge(d,f,h)),h.addBaseEdge(a,e)}))}(o,e),o}function Yu(e,n,t,r){(t?e.inEdges(n.name):e.outEdges(n.name)).forEach((n=>{const t=e.edge(n);r.push(t)}))}class Ju{constructor(e){this.hierarchy=e,this.index={},this.hasSubHierarchy={},this.root=new Qu(this.hierarchy.root,this.hierarchy.graphOptions),this.index[e.root.name]=this.root,this.buildSubHierarchy(e.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(e){if(e in this.hasSubHierarchy)return;this.hasSubHierarchy[e]=!0;const n=this.index[e];if(n.node.type!==i.META)return;const t=n,r=t.node.metaGraph,o=t.coreGraph;r.nodes().forEach((e=>{const n=this.getOrCreateRenderNodeByName(e);o.setNode(e,n)})),r.edges().forEach((e=>{const n=r.edge(e),t=new Ku(n);o.setEdge(e.v,e.w,t)}));const u=t.node.parentNode;if(!u)return;const c=this.getRenderNodeByName(u.name),s=(e,...n)=>n.concat([e?\"IN\":\"OUT\"]).join(\"~~\"),d=this.hierarchy.getBridgeGraph(e);d.edges().forEach((n=>{const t=d.edge(n),f=!!r.node(n.w),[h,l]=f?[n.w,n.v]:[n.v,n.w],v=n=>{const t=f?{v:n,w:e}:{v:e,w:n};return c.coreGraph.edge(t)};let p=v(l);p||(p=v(s(f,l,u.name)));const g=s(f,e),y=s(f,l,e);let b=o.node(y);if(!b){let e=o.node(g);if(!e){const n={name:g,type:i.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:a.UNSPECIFIED,inbound:f,attr:{}};e=new Xu(n),this.index[g]=e,o.setNode(g,e)}const n={name:y,type:i.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:a.UNSPECIFIED,inbound:f,attr:{}};b=new Xu(n),this.index[y]=b,o.setNode(y,b),o.setParent(y,g),e.node.cardinality++}const m=new Ku(t);m.adjoiningMetaEdge=p,f?o.setEdge(y,h,m):o.setEdge(h,y,m)}))}getOrCreateRenderNodeByName(e){if(!e)return null;if(e in this.index)return this.index[e];const n=this.getNodeByName(e);return n?(this.index[e]=n.isGroupNode?new Qu(n,this.hierarchy.graphOptions):new Xu(n),this.index[e]):null}getRenderNodeByName(e){return this.index[e]}getNodeByName(e){return this.hierarchy.node(e)}}class Xu{constructor(e){this.node=e,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=e.width||0,this.height=e.height||0,this.displayName=e.name,this.attr=e.attr}}class Ku{constructor(e){this.metaEdge=e,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class Qu extends Xu{constructor(e,n){super(e);const t=e.metaGraph.graph();n.compound=!0,this.coreGraph=Hu(t.name,u.CORE,n)}}function Zu(e,t){e.node.isGroupNode&&function(e,t){const r=n(t);e.coreGraph.nodes().map((n=>e.coreGraph.node(n))).forEach((e=>{var n,o,a,u,c,s;const{height:d,width:f}=e;switch(e.node.type){case i.NODE:Object.assign(e,r.nodeSize.node),e.height=d||r.nodeSize.node.height,e.width=f||r.nodeSize.node.width;break;case i.BRIDGE:Object.assign(e,r.nodeSize.bridge);break;case i.META:if(e.expanded){Zu(e,t)}else Object.assign(e,r.nodeSize.meta),e.height=r.nodeSize.meta.height,e.width=r.nodeSize.meta.width;break;default:throw Error(\"Unrecognized node type: \"+e.node.type)}if(!e.expanded){const r=e.attr;!function(e,n=!1){if(e.coreBox.width=e.width,e.coreBox.height=e.height,!n){const n=`${e.displayName}`.length,t=3;e.width=Math.max(e.coreBox.width,n*t)}}(e,t&&(0===e.node.type&&!!(null===(o=null===(n=null==t?void 0:t.nodeSize)||void 0===n?void 0:n.meta)||void 0===o?void 0:o.width)||1===e.node.type&&(!!(null===(u=null===(a=null==t?void 0:t.nodeSize)||void 0===a?void 0:a.node)||void 0===u?void 0:u.width)||!!r.width)||2===e.node.type&&!!(null===(s=null===(c=null==t?void 0:t.nodeSize)||void 0===c?void 0:c.bridge)||void 0===s?void 0:s.width)))}}))}(e,t),e.node.type===i.META&&function(e,t){const r=n(t),o=r.subScene.meta;Object.assign(e,o);const{nodeSep:a,rankSep:u,edgeSep:c,align:s}=r.graph.meta,d={nodesep:a,ranksep:u,edgesep:c,align:s};Object.assign(e.coreBox,function(e,n){const{ranksep:t,nodesep:r,edgesep:o,align:a}=n;Object.assign(e.graph(),{ranksep:t,nodesep:r,edgesep:o,align:a});const u=[];if(e.nodes().forEach((n=>{e.node(n).node.type!==i.BRIDGE&&u.push(n)})),!u.length)return{width:0,height:0};Tu(e);let c=1/0,s=1/0,d=-1/0,f=-1/0;return u.forEach((n=>{const t=e.node(n),r=.5*t.width,o=t.x-r,i=t.x+r;c=od?i:d;const a=.5*t.height,u=t.y-a,h=t.y+a;s=uf?h:f})),e.edges().forEach((n=>{const t=e.edge(n),r=e.node(t.metaEdge.v),o=e.node(t.metaEdge.w);if(3===t.points.length&&function(e){let n=ec(e[0],e[1]);for(let t=1;t1)return!1;n=r}return!0}(t.points)){if(null!=r){const e=r.expanded?r.x:nc(r);t.points[0].x=e}if(null!=o){const e=o.expanded?o.x:nc(o);t.points[2].x=e}t.points=[t.points[0],t.points[1]]}const i=t.points[t.points.length-2];null!=o&&(t.points[t.points.length-1]=tc(i,o));const a=t.points[1];null!=r&&(t.points[0]=tc(a,r)),t.points.forEach((e=>{c=e.xd?e.x:d,s=e.yf?e.y:f}))})),e.nodes().forEach((n=>{const t=e.node(n);t.x-=c,t.y-=s})),e.edges().forEach((n=>{e.edge(n).points.forEach((e=>{e.x-=c,e.y-=s}))})),{width:d-c,height:f-s}}(e.coreGraph,d));let f=0;e.coreGraph.nodeCount()>0&&f++;const h=f<=1?0:f;e.coreBox.width+=h+h,e.coreBox.height=o.labelHeight+e.coreBox.height,e.width=e.coreBox.width+o.paddingLeft+o.paddingRight,e.height=e.paddingTop+e.coreBox.height+e.paddingBottom}(e,t)}function ec(e,n){const t=n.x-e.x,r=n.y-e.y;return 180*Math.atan(r/t)/Math.PI}function nc(e){if(e.expanded)return e.x;return e.x-e.width/2+0+e.coreBox.width/2}function tc(e,n){const t=n.expanded?n.x:nc(n),r=n.y,o=e.x-t,i=e.y-r;let a,u,c=n.expanded?n.width:n.coreBox.width,s=n.expanded?n.height:n.coreBox.height;return Math.abs(i)*c/2>Math.abs(o)*s/2?(i<0&&(s=-s),a=0===i?0:s/2*o/i,u=s/2):(o<0&&(c=-c),a=c/2,u=0===o?0:c/2*i/o),{x:t+a,y:r+u}}function rc(n,t,r){var o,i,a,u;const c=n.nodes.filter(((e,n,t)=>t.findIndex((n=>n.id===e.id))!==n)).map((e=>e.id));if(c.length)throw new Error(`Duplicated ids found: ${c.join(\", \")}`);const s=function(e){const n={nodes:[]},t=e.compound,r=Object.keys(t||{}),o=new Map,i=(e,n=[])=>{if(o.has(e))return o.get(e);for(let o=0;oe.edges.filter((e=>e.w===n)).map((e=>({name:e.v})));return e.nodes.forEach((e=>{const t=e.id,r=[...i(t),t];let o=a(t);n.nodes.push({name:t,path:r,inputs:o,width:e.width,height:e.height,attr:Object.assign({},e)})})),n}(n),d=function(e,n){const t=(e,n)=>{for(let t of n.values())if(t.includes(e))return!0;return!1},r=(e,n=[])=>{if(0===Object.keys(e).length)return[...new Set(n)];const o=new Map(Object.keys(e).map((n=>[n,e[n]]))),i={};for(let[e,r]of o)t(e,o)?i[e]=r:n=n.concat(e,r);return r(i,n)};return r(e).filter((e=>n.includes(e)))}(n.compound||{},(null==t?void 0:t.expanded)||[]),f=function(e,n){return function(e){return new Ju(e)}(qu(zu(e),n))}(s,{rankDirection:(null===(i=null===(o=null==r?void 0:r.graph)||void 0===o?void 0:o.meta)||void 0===i?void 0:i.rankDir)||(null==t?void 0:t.rankDirection)||e.graph.meta.rankDir,align:(null===(u=null===(a=null==r?void 0:r.graph)||void 0===a?void 0:a.meta)||void 0===u?void 0:u.align)||e.graph.meta.align});return function(e,n){n.forEach((n=>{const t=e.getRenderInfoNodes().find((e=>e.displayName===n));let r=t&&t.node&&t.node.name||\"\";const o=e.getRenderNodeByName(r);if(!o)throw new Error(`No nodes found: ${r}`);o.expanded=!0,e.buildSubHierarchy(r)}))}(f,d),Zu(f.root,r),ac(f.root)}function oc(e,n=!1){const t=JSON.parse(JSON.stringify(e)),o={nodes:[t],edges:[...t.edges]};return t.nodes.forEach((function e(n){(0===n.type||1===n.type)&&o.nodes.push(n),0===n.type&&(o.edges=o.edges.concat(n.edges)),Array.isArray(n.nodes)&&n.nodes.forEach(e)})),n&&o.nodes.forEach((e=>{const n=o.nodes.find((n=>n.id===e.parentNodeName));if(n){const t=n.x-n.width/2+n.paddingLeft,o=n.y-n.height/2+n.labelHeight+n.paddingTop;n.id!==r&&(e.x+=t,e.y+=o),0===e.type&&e.edges.forEach((n=>{n.points.forEach((n=>{n.x+=e.x-e.width/2+e.paddingLeft,n.y+=e.y-e.height/2+e.labelHeight+e.paddingTop}))}))}})),o}function ic(e,n,t,o){var i,a;let u=[];const c=(null===(i=t.find((n=>n.id===e)))||void 0===i?void 0:i.path)||[],s=(null===(a=t.find((e=>e.id===n)))||void 0===a?void 0:a.path)||[],d=[r,...c].slice(0,c.length).reverse(),f=[r,...s].slice(0,s.length);return d.forEach((r=>{const i=t.find((e=>e.id===r));u=u.concat(i.edges.filter((t=>t.baseEdgeList.some((t=>t.v===((null==o?void 0:o.v)||e)&&t.w===((null==o?void 0:o.w)||n))))))})),f.filter((e=>!d.includes(e))).forEach((r=>{const i=t.find((e=>e.id===r));u=u.concat(i.edges.filter((t=>t.baseEdgeList.some((t=>t.v===((null==o?void 0:o.v)||e)&&t.w===((null==o?void 0:o.w)||n))))))})),u}function ac(e){const n=e.coreGraph.nodes().map((n=>e.coreGraph.node(n)));return Object.assign(Object.assign({},uc(e)),{expanded:e.expanded,nodes:e.expanded?(t=n,t.map((e=>e.node.type===i.META?ac(e):uc(e)))):[],edges:e.expanded?cc(e):[]});var t}function uc(e){return{id:e.node.name,name:e.node.name,type:e.node.type,cardinality:e.node.cardinality,attr:e.attr,parentNodeName:e.node.parentNode?e.node.parentNode.name:null,coreBox:Object.assign({},e.coreBox),x:e.x,y:e.y,width:e.width,height:e.height,radius:e.radius,labelHeight:e.labelHeight,labelOffset:e.labelOffset,outboxWidth:e.outboxWidth,paddingLeft:e.paddingLeft,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,path:e.node.path}}function cc(e){return e.coreGraph.edges().map((n=>({renderInfoEdge:e.coreGraph.edge(n),edge:n}))).filter((({renderInfoEdge:e})=>e.metaEdge)).map((({edge:n,renderInfoEdge:t})=>{const r=function(e,n){const t=n.points.map((e=>Object.assign({},e)));if(n.adjoiningMetaEdge){const r=n.adjoiningMetaEdge.points,o=n.metaEdge.inbound,i=o?r[r.length-1]:r[0],a=t[o?0:t.length-1],u=e.x-e.width/2,c=e.y-e.height/2,s=i.x-u,d=i.y-c,f=-e.paddingLeft,h=-(e.paddingTop+e.labelHeight);a.x=s+f,a.y=d+h}return t}(e,t);return{adjoiningEdge:t.adjoiningMetaEdge?{w:t.adjoiningMetaEdge.metaEdge.w,v:t.adjoiningMetaEdge.metaEdge.v}:null,inbound:t.metaEdge.inbound,w:n.w,v:n.v,points:r,weight:t.weight,baseEdgeList:t.metaEdge.baseEdgeList,parentNodeName:e.node.name}}))}\n//# sourceMappingURL=dagre-compound.es5.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/dagre-compound/dist/dagre-compound.es5.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n/**\n * _.memoize(calColor);\n * _.memoize(calColor, (...args) => args[0]);\n * @param f\n * @param resolver\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (f, resolver) {\n if (!Object(_is_function__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(f)) {\n throw new TypeError('Expected a function');\n }\n var memoized = function () {\n var args = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n args[_i] = arguments[_i];\n }\n // 使用方法构造 key,如果不存在 resolver,则直接取第一个参数作为 key\n var key = resolver ? resolver.apply(this, args) : args[0];\n var cache = memoized.cache;\n if (cache.has(key)) {\n return cache.get(key);\n }\n var result = f.apply(this, args);\n // 缓存起来\n cache.set(key, result);\n return result;\n };\n memoized.cache = new Map();\n return memoized;\n});\n//# sourceMappingURL=memoize.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/memoize.js?"); /***/ }), -/***/ "./node_modules/detect-browser/es/index.js": -/*!*************************************************!*\ - !*** ./node_modules/detect-browser/es/index.js ***! - \*************************************************/ -/*! exports provided: BrowserInfo, NodeInfo, SearchBotDeviceInfo, BotInfo, ReactNativeInfo, detect, browserName, parseUserAgent, detectOS, getNodeVersion */ +/***/ "./node_modules/@antv/util/esm/min-by.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/min-by.js ***! + \***********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BrowserInfo\", function() { return BrowserInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NodeInfo\", function() { return NodeInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SearchBotDeviceInfo\", function() { return SearchBotDeviceInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BotInfo\", function() { return BotInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReactNativeInfo\", function() { return ReactNativeInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detect\", function() { return detect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"browserName\", function() { return browserName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseUserAgent\", function() { return parseUserAgent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectOS\", function() { return detectOS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNodeVersion\", function() { return getNodeVersion; });\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar BrowserInfo = /** @class */ (function () {\n function BrowserInfo(name, version, os) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.type = 'browser';\n }\n return BrowserInfo;\n}());\n\nvar NodeInfo = /** @class */ (function () {\n function NodeInfo(version) {\n this.version = version;\n this.type = 'node';\n this.name = 'node';\n this.os = process.platform;\n }\n return NodeInfo;\n}());\n\nvar SearchBotDeviceInfo = /** @class */ (function () {\n function SearchBotDeviceInfo(name, version, os, bot) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.bot = bot;\n this.type = 'bot-device';\n }\n return SearchBotDeviceInfo;\n}());\n\nvar BotInfo = /** @class */ (function () {\n function BotInfo() {\n this.type = 'bot';\n this.bot = true; // NOTE: deprecated test name instead\n this.name = 'bot';\n this.version = null;\n this.os = null;\n }\n return BotInfo;\n}());\n\nvar ReactNativeInfo = /** @class */ (function () {\n function ReactNativeInfo() {\n this.type = 'react-native';\n this.name = 'react-native';\n this.version = null;\n this.os = null;\n }\n return ReactNativeInfo;\n}());\n\n// tslint:disable-next-line:max-line-length\nvar SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;\nvar SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\\ Jeeves\\/Teoma|ia_archiver)/;\nvar REQUIRED_VERSION_PARTS = 3;\nvar userAgentRules = [\n ['aol', /AOLShield\\/([0-9\\._]+)/],\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['edge-ios', /EdgiOS\\/([0-9\\._]+)/],\n ['yandexbrowser', /YaBrowser\\/([0-9\\._]+)/],\n ['kakaotalk', /KAKAOTALK\\s([0-9\\.]+)/],\n ['samsung', /SamsungBrowser\\/([0-9\\.]+)/],\n ['silk', /\\bSilk\\/([0-9._-]+)\\b/],\n ['miui', /MiuiBrowser\\/([0-9\\.]+)$/],\n ['beaker', /BeakerBrowser\\/([0-9\\.]+)/],\n ['edge-chromium', /EdgA?\\/([0-9\\.]+)/],\n [\n 'chromium-webview',\n /(?!Chrom.*OPR)wv\\).*Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/,\n ],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['phantomjs', /PhantomJS\\/([0-9\\.]+)(:?\\s|$)/],\n ['crios', /CriOS\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['fxios', /FxiOS\\/([0-9\\.]+)/],\n ['opera-mini', /Opera Mini.*Version\\/([0-9\\.]+)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)/],\n ['pie', /^Microsoft Pocket Internet Explorer\\/(\\d+\\.\\d+)$/],\n ['pie', /^Mozilla\\/\\d\\.\\d+\\s\\(compatible;\\s(?:MSP?IE|MSInternet Explorer) (\\d+\\.\\d+);.*Windows CE.*\\)$/],\n ['netfront', /^Mozilla\\/\\d\\.\\d+.*NetFront\\/(\\d.\\d)/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['bb10', /BB10;\\sTouch.*Version\\/([0-9\\.]+)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['ios', /Version\\/([0-9\\._]+).*Mobile.*Safari.*/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n ['facebook', /FB[AS]V\\/([0-9\\.]+)/],\n ['instagram', /Instagram\\s([0-9\\.]+)/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Mobile/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Gecko\\)$/],\n ['curl', /^curl\\/([0-9\\.]+)$/],\n ['searchbot', SEARCHBOX_UA_REGEX],\n];\nvar operatingSystemRules = [\n ['iOS', /iP(hone|od|ad)/],\n ['Android OS', /Android/],\n ['BlackBerry OS', /BlackBerry|BB10/],\n ['Windows Mobile', /IEMobile/],\n ['Amazon OS', /Kindle/],\n ['Windows 3.11', /Win16/],\n ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/],\n ['Windows 98', /(Windows 98)|(Win98)/],\n ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/],\n ['Windows XP', /(Windows NT 5.1)|(Windows XP)/],\n ['Windows Server 2003', /(Windows NT 5.2)/],\n ['Windows Vista', /(Windows NT 6.0)/],\n ['Windows 7', /(Windows NT 6.1)/],\n ['Windows 8', /(Windows NT 6.2)/],\n ['Windows 8.1', /(Windows NT 6.3)/],\n ['Windows 10', /(Windows NT 10.0)/],\n ['Windows ME', /Windows ME/],\n ['Windows CE', /Windows CE|WinCE|Microsoft Pocket Internet Explorer/],\n ['Open BSD', /OpenBSD/],\n ['Sun OS', /SunOS/],\n ['Chrome OS', /CrOS/],\n ['Linux', /(Linux)|(X11)/],\n ['Mac OS', /(Mac_PowerPC)|(Macintosh)/],\n ['QNX', /QNX/],\n ['BeOS', /BeOS/],\n ['OS/2', /OS\\/2/],\n];\nfunction detect(userAgent) {\n if (!!userAgent) {\n return parseUserAgent(userAgent);\n }\n if (typeof document === 'undefined' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative') {\n return new ReactNativeInfo();\n }\n if (typeof navigator !== 'undefined') {\n return parseUserAgent(navigator.userAgent);\n }\n return getNodeVersion();\n}\nfunction matchUserAgent(ua) {\n // opted for using reduce here rather than Array#first with a regex.test call\n // this is primarily because using the reduce we only perform the regex\n // execution once rather than once for the test and for the exec again below\n // probably something that needs to be benchmarked though\n return (ua !== '' &&\n userAgentRules.reduce(function (matched, _a) {\n var browser = _a[0], regex = _a[1];\n if (matched) {\n return matched;\n }\n var uaMatch = regex.exec(ua);\n return !!uaMatch && [browser, uaMatch];\n }, false));\n}\nfunction browserName(ua) {\n var data = matchUserAgent(ua);\n return data ? data[0] : null;\n}\nfunction parseUserAgent(ua) {\n var matchedRule = matchUserAgent(ua);\n if (!matchedRule) {\n return null;\n }\n var name = matchedRule[0], match = matchedRule[1];\n if (name === 'searchbot') {\n return new BotInfo();\n }\n // Do not use RegExp for split operation as some browser do not support it (See: http://blog.stevenlevithan.com/archives/cross-browser-split)\n var versionParts = match[1] && match[1].split('.').join('_').split('_').slice(0, 3);\n if (versionParts) {\n if (versionParts.length < REQUIRED_VERSION_PARTS) {\n versionParts = __spreadArray(__spreadArray([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true);\n }\n }\n else {\n versionParts = [];\n }\n var version = versionParts.join('.');\n var os = detectOS(ua);\n var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);\n if (searchBotMatch && searchBotMatch[1]) {\n return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);\n }\n return new BrowserInfo(name, version, os);\n}\nfunction detectOS(ua) {\n for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {\n var _a = operatingSystemRules[ii], os = _a[0], regex = _a[1];\n var match = regex.exec(ua);\n if (match) {\n return os;\n }\n }\n return null;\n}\nfunction getNodeVersion() {\n var isNode = typeof process !== 'undefined' && process.version;\n return isNode ? new NodeInfo(process.version.slice(1)) : null;\n}\nfunction createVersionParts(count) {\n var output = [];\n for (var ii = 0; ii < count; ii++) {\n output.push('0');\n }\n return output;\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ \"./node_modules/node-libs-browser/mock/process.js\")))\n\n//# sourceURL=webpack:///./node_modules/detect-browser/es/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\n/**\n * @param {Array} arr The array to iterate over.\n * @param {Function} [fn] The iteratee invoked per element.\n * @return {*} Returns the minimum value.\n * @example\n *\n * var objects = [{ 'n': 1 }, { 'n': 2 }];\n *\n * minBy(objects, function(o) { return o.n; });\n * // => { 'n': 1 }\n *\n * minBy(objects, 'n');\n * // => { 'n': 1 }\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr, fn) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n var minItem;\n var min = Infinity;\n for (var i = 0; i < arr.length; i++) {\n var item = arr[i];\n var v = Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(fn) ? fn(item) : item[fn];\n if (v < min) {\n minItem = item;\n min = v;\n }\n }\n return minItem;\n});\n//# sourceMappingURL=min-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/min-by.js?"); /***/ }), -/***/ "./node_modules/fecha/lib/fecha.js": -/*!*****************************************!*\ - !*** ./node_modules/fecha/lib/fecha.js ***! - \*****************************************/ -/*! exports provided: default, assign, format, parse, defaultI18n, setGlobalDateI18n, setGlobalDateMasks */ +/***/ "./node_modules/@antv/util/esm/min.js": +/*!********************************************!*\ + !*** ./node_modules/@antv/util/esm/min.js ***! + \********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"assign\", function() { return assign; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"format\", function() { return format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parse\", function() { return parse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultI18n\", function() { return defaultI18n; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setGlobalDateI18n\", function() { return setGlobalDateI18n; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setGlobalDateMasks\", function() { return setGlobalDateMasks; });\nvar token = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\\1?|[aA]|\"[^\"]*\"|'[^']*'/g;\nvar twoDigitsOptional = \"\\\\d\\\\d?\";\nvar twoDigits = \"\\\\d\\\\d\";\nvar threeDigits = \"\\\\d{3}\";\nvar fourDigits = \"\\\\d{4}\";\nvar word = \"[^\\\\s]+\";\nvar literal = /\\[([^]*?)\\]/gm;\nfunction shorten(arr, sLen) {\n var newArr = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n newArr.push(arr[i].substr(0, sLen));\n }\n return newArr;\n}\nvar monthUpdate = function (arrName) { return function (v, i18n) {\n var lowerCaseArr = i18n[arrName].map(function (v) { return v.toLowerCase(); });\n var index = lowerCaseArr.indexOf(v.toLowerCase());\n if (index > -1) {\n return index;\n }\n return null;\n}; };\nfunction assign(origObj) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var obj = args_1[_a];\n for (var key in obj) {\n // @ts-ignore ex\n origObj[key] = obj[key];\n }\n }\n return origObj;\n}\nvar dayNames = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n];\nvar monthNames = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n];\nvar monthNamesShort = shorten(monthNames, 3);\nvar dayNamesShort = shorten(dayNames, 3);\nvar defaultI18n = {\n dayNamesShort: dayNamesShort,\n dayNames: dayNames,\n monthNamesShort: monthNamesShort,\n monthNames: monthNames,\n amPm: [\"am\", \"pm\"],\n DoFn: function (dayOfMonth) {\n return (dayOfMonth +\n [\"th\", \"st\", \"nd\", \"rd\"][dayOfMonth % 10 > 3\n ? 0\n : ((dayOfMonth - (dayOfMonth % 10) !== 10 ? 1 : 0) * dayOfMonth) % 10]);\n }\n};\nvar globalI18n = assign({}, defaultI18n);\nvar setGlobalDateI18n = function (i18n) {\n return (globalI18n = assign(globalI18n, i18n));\n};\nvar regexEscape = function (str) {\n return str.replace(/[|\\\\{()[^$+*?.-]/g, \"\\\\$&\");\n};\nvar pad = function (val, len) {\n if (len === void 0) { len = 2; }\n val = String(val);\n while (val.length < len) {\n val = \"0\" + val;\n }\n return val;\n};\nvar formatFlags = {\n D: function (dateObj) { return String(dateObj.getDate()); },\n DD: function (dateObj) { return pad(dateObj.getDate()); },\n Do: function (dateObj, i18n) {\n return i18n.DoFn(dateObj.getDate());\n },\n d: function (dateObj) { return String(dateObj.getDay()); },\n dd: function (dateObj) { return pad(dateObj.getDay()); },\n ddd: function (dateObj, i18n) {\n return i18n.dayNamesShort[dateObj.getDay()];\n },\n dddd: function (dateObj, i18n) {\n return i18n.dayNames[dateObj.getDay()];\n },\n M: function (dateObj) { return String(dateObj.getMonth() + 1); },\n MM: function (dateObj) { return pad(dateObj.getMonth() + 1); },\n MMM: function (dateObj, i18n) {\n return i18n.monthNamesShort[dateObj.getMonth()];\n },\n MMMM: function (dateObj, i18n) {\n return i18n.monthNames[dateObj.getMonth()];\n },\n YY: function (dateObj) {\n return pad(String(dateObj.getFullYear()), 4).substr(2);\n },\n YYYY: function (dateObj) { return pad(dateObj.getFullYear(), 4); },\n h: function (dateObj) { return String(dateObj.getHours() % 12 || 12); },\n hh: function (dateObj) { return pad(dateObj.getHours() % 12 || 12); },\n H: function (dateObj) { return String(dateObj.getHours()); },\n HH: function (dateObj) { return pad(dateObj.getHours()); },\n m: function (dateObj) { return String(dateObj.getMinutes()); },\n mm: function (dateObj) { return pad(dateObj.getMinutes()); },\n s: function (dateObj) { return String(dateObj.getSeconds()); },\n ss: function (dateObj) { return pad(dateObj.getSeconds()); },\n S: function (dateObj) {\n return String(Math.round(dateObj.getMilliseconds() / 100));\n },\n SS: function (dateObj) {\n return pad(Math.round(dateObj.getMilliseconds() / 10), 2);\n },\n SSS: function (dateObj) { return pad(dateObj.getMilliseconds(), 3); },\n a: function (dateObj, i18n) {\n return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];\n },\n A: function (dateObj, i18n) {\n return dateObj.getHours() < 12\n ? i18n.amPm[0].toUpperCase()\n : i18n.amPm[1].toUpperCase();\n },\n ZZ: function (dateObj) {\n var offset = dateObj.getTimezoneOffset();\n return ((offset > 0 ? \"-\" : \"+\") +\n pad(Math.floor(Math.abs(offset) / 60) * 100 + (Math.abs(offset) % 60), 4));\n },\n Z: function (dateObj) {\n var offset = dateObj.getTimezoneOffset();\n return ((offset > 0 ? \"-\" : \"+\") +\n pad(Math.floor(Math.abs(offset) / 60), 2) +\n \":\" +\n pad(Math.abs(offset) % 60, 2));\n }\n};\nvar monthParse = function (v) { return +v - 1; };\nvar emptyDigits = [null, twoDigitsOptional];\nvar emptyWord = [null, word];\nvar amPm = [\n \"isPm\",\n word,\n function (v, i18n) {\n var val = v.toLowerCase();\n if (val === i18n.amPm[0]) {\n return 0;\n }\n else if (val === i18n.amPm[1]) {\n return 1;\n }\n return null;\n }\n];\nvar timezoneOffset = [\n \"timezoneOffset\",\n \"[^\\\\s]*?[\\\\+\\\\-]\\\\d\\\\d:?\\\\d\\\\d|[^\\\\s]*?Z?\",\n function (v) {\n var parts = (v + \"\").match(/([+-]|\\d\\d)/gi);\n if (parts) {\n var minutes = +parts[1] * 60 + parseInt(parts[2], 10);\n return parts[0] === \"+\" ? minutes : -minutes;\n }\n return 0;\n }\n];\nvar parseFlags = {\n D: [\"day\", twoDigitsOptional],\n DD: [\"day\", twoDigits],\n Do: [\"day\", twoDigitsOptional + word, function (v) { return parseInt(v, 10); }],\n M: [\"month\", twoDigitsOptional, monthParse],\n MM: [\"month\", twoDigits, monthParse],\n YY: [\n \"year\",\n twoDigits,\n function (v) {\n var now = new Date();\n var cent = +(\"\" + now.getFullYear()).substr(0, 2);\n return +(\"\" + (+v > 68 ? cent - 1 : cent) + v);\n }\n ],\n h: [\"hour\", twoDigitsOptional, undefined, \"isPm\"],\n hh: [\"hour\", twoDigits, undefined, \"isPm\"],\n H: [\"hour\", twoDigitsOptional],\n HH: [\"hour\", twoDigits],\n m: [\"minute\", twoDigitsOptional],\n mm: [\"minute\", twoDigits],\n s: [\"second\", twoDigitsOptional],\n ss: [\"second\", twoDigits],\n YYYY: [\"year\", fourDigits],\n S: [\"millisecond\", \"\\\\d\", function (v) { return +v * 100; }],\n SS: [\"millisecond\", twoDigits, function (v) { return +v * 10; }],\n SSS: [\"millisecond\", threeDigits],\n d: emptyDigits,\n dd: emptyDigits,\n ddd: emptyWord,\n dddd: emptyWord,\n MMM: [\"month\", word, monthUpdate(\"monthNamesShort\")],\n MMMM: [\"month\", word, monthUpdate(\"monthNames\")],\n a: amPm,\n A: amPm,\n ZZ: timezoneOffset,\n Z: timezoneOffset\n};\n// Some common format strings\nvar globalMasks = {\n default: \"ddd MMM DD YYYY HH:mm:ss\",\n shortDate: \"M/D/YY\",\n mediumDate: \"MMM D, YYYY\",\n longDate: \"MMMM D, YYYY\",\n fullDate: \"dddd, MMMM D, YYYY\",\n isoDate: \"YYYY-MM-DD\",\n isoDateTime: \"YYYY-MM-DDTHH:mm:ssZ\",\n shortTime: \"HH:mm\",\n mediumTime: \"HH:mm:ss\",\n longTime: \"HH:mm:ss.SSS\"\n};\nvar setGlobalDateMasks = function (masks) { return assign(globalMasks, masks); };\n/***\n * Format a date\n * @method format\n * @param {Date|number} dateObj\n * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'\n * @returns {string} Formatted date string\n */\nvar format = function (dateObj, mask, i18n) {\n if (mask === void 0) { mask = globalMasks[\"default\"]; }\n if (i18n === void 0) { i18n = {}; }\n if (typeof dateObj === \"number\") {\n dateObj = new Date(dateObj);\n }\n if (Object.prototype.toString.call(dateObj) !== \"[object Date]\" ||\n isNaN(dateObj.getTime())) {\n throw new Error(\"Invalid Date pass to format\");\n }\n mask = globalMasks[mask] || mask;\n var literals = [];\n // Make literals inactive by replacing them with @@@\n mask = mask.replace(literal, function ($0, $1) {\n literals.push($1);\n return \"@@@\";\n });\n var combinedI18nSettings = assign(assign({}, globalI18n), i18n);\n // Apply formatting rules\n mask = mask.replace(token, function ($0) {\n return formatFlags[$0](dateObj, combinedI18nSettings);\n });\n // Inline literal values back into the formatted value\n return mask.replace(/@@@/g, function () { return literals.shift(); });\n};\n/**\n * Parse a date string into a Javascript Date object /\n * @method parse\n * @param {string} dateStr Date string\n * @param {string} format Date parse format\n * @param {i18n} I18nSettingsOptional Full or subset of I18N settings\n * @returns {Date|null} Returns Date object. Returns null what date string is invalid or doesn't match format\n */\nfunction parse(dateStr, format, i18n) {\n if (i18n === void 0) { i18n = {}; }\n if (typeof format !== \"string\") {\n throw new Error(\"Invalid format in fecha parse\");\n }\n // Check to see if the format is actually a mask\n format = globalMasks[format] || format;\n // Avoid regular expression denial of service, fail early for really long strings\n // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS\n if (dateStr.length > 1000) {\n return null;\n }\n // Default to the beginning of the year.\n var today = new Date();\n var dateInfo = {\n year: today.getFullYear(),\n month: 0,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n isPm: null,\n timezoneOffset: null\n };\n var parseInfo = [];\n var literals = [];\n // Replace all the literals with @@@. Hopefully a string that won't exist in the format\n var newFormat = format.replace(literal, function ($0, $1) {\n literals.push(regexEscape($1));\n return \"@@@\";\n });\n var specifiedFields = {};\n var requiredFields = {};\n // Change every token that we find into the correct regex\n newFormat = regexEscape(newFormat).replace(token, function ($0) {\n var info = parseFlags[$0];\n var field = info[0], regex = info[1], requiredField = info[3];\n // Check if the person has specified the same field twice. This will lead to confusing results.\n if (specifiedFields[field]) {\n throw new Error(\"Invalid format. \" + field + \" specified twice in format\");\n }\n specifiedFields[field] = true;\n // Check if there are any required fields. For instance, 12 hour time requires AM/PM specified\n if (requiredField) {\n requiredFields[requiredField] = true;\n }\n parseInfo.push(info);\n return \"(\" + regex + \")\";\n });\n // Check all the required fields are present\n Object.keys(requiredFields).forEach(function (field) {\n if (!specifiedFields[field]) {\n throw new Error(\"Invalid format. \" + field + \" is required in specified format\");\n }\n });\n // Add back all the literals after\n newFormat = newFormat.replace(/@@@/g, function () { return literals.shift(); });\n // Check if the date string matches the format. If it doesn't return null\n var matches = dateStr.match(new RegExp(newFormat, \"i\"));\n if (!matches) {\n return null;\n }\n var combinedI18nSettings = assign(assign({}, globalI18n), i18n);\n // For each match, call the parser function for that date part\n for (var i = 1; i < matches.length; i++) {\n var _a = parseInfo[i - 1], field = _a[0], parser = _a[2];\n var value = parser\n ? parser(matches[i], combinedI18nSettings)\n : +matches[i];\n // If the parser can't make sense of the value, return null\n if (value == null) {\n return null;\n }\n dateInfo[field] = value;\n }\n if (dateInfo.isPm === 1 && dateInfo.hour != null && +dateInfo.hour !== 12) {\n dateInfo.hour = +dateInfo.hour + 12;\n }\n else if (dateInfo.isPm === 0 && +dateInfo.hour === 12) {\n dateInfo.hour = 0;\n }\n var dateTZ;\n if (dateInfo.timezoneOffset == null) {\n dateTZ = new Date(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute, dateInfo.second, dateInfo.millisecond);\n var validateFields = [\n [\"month\", \"getMonth\"],\n [\"day\", \"getDate\"],\n [\"hour\", \"getHours\"],\n [\"minute\", \"getMinutes\"],\n [\"second\", \"getSeconds\"]\n ];\n for (var i = 0, len = validateFields.length; i < len; i++) {\n // Check to make sure the date field is within the allowed range. Javascript dates allows values\n // outside the allowed range. If the values don't match the value was invalid\n if (specifiedFields[validateFields[i][0]] &&\n dateInfo[validateFields[i][0]] !== dateTZ[validateFields[i][1]]()) {\n return null;\n }\n }\n }\n else {\n dateTZ = new Date(Date.UTC(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute - dateInfo.timezoneOffset, dateInfo.second, dateInfo.millisecond));\n // We can't validate dates in another timezone unfortunately. Do a basic check instead\n if (dateInfo.month > 11 ||\n dateInfo.month < 0 ||\n dateInfo.day > 31 ||\n dateInfo.day < 1 ||\n dateInfo.hour > 23 ||\n dateInfo.hour < 0 ||\n dateInfo.minute > 59 ||\n dateInfo.minute < 0 ||\n dateInfo.second > 59 ||\n dateInfo.second < 0) {\n return null;\n }\n }\n // Don't allow invalid dates\n return dateTZ;\n}\nvar fecha = {\n format: format,\n parse: parse,\n defaultI18n: defaultI18n,\n setGlobalDateI18n: setGlobalDateI18n,\n setGlobalDateMasks: setGlobalDateMasks\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (fecha);\n\n//# sourceMappingURL=fecha.js.map\n\n\n//# sourceURL=webpack:///./node_modules/fecha/lib/fecha.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\n/**\n * @param {Array} arr The array to iterate over.\n * @return {*} Returns the minimum value.\n * @example\n *\n * min([1, 2]);\n * // => 1\n *\n * min([]);\n * // => undefined\n *\n * const data = new Array(1250010).fill(1).map((d,idx) => idx);\n *\n * min(data);\n * // => 1250010\n * // Math.min(...data) will encounter \"Maximum call stack size exceeded\" error\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (arr) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return undefined;\n }\n return arr.reduce(function (prev, curr) {\n return Math.min(prev, curr);\n }, arr[0]);\n});\n//# sourceMappingURL=min.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/min.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/common.js": -/*!**********************************************!*\ - !*** ./node_modules/gl-matrix/esm/common.js ***! - \**********************************************/ -/*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */ +/***/ "./node_modules/@antv/util/esm/mix.js": +/*!********************************************!*\ + !*** ./node_modules/@antv/util/esm/mix.js ***! + \********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EPSILON\", function() { return EPSILON; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ARRAY_TYPE\", function() { return ARRAY_TYPE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RANDOM\", function() { return RANDOM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setMatrixArrayType\", function() { return setMatrixArrayType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return toRadian; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nvar EPSILON = 0.000001;\nvar ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nvar RANDOM = Math.random;\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\n\nfunction setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\n\nfunction toRadian(a) {\n return a * degree;\n}\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\n\nfunction equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/common.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return mix; });\n// FIXME: Mutable param should be forbidden in static lang.\nfunction _mix(dist, obj) {\n for (var key in obj) {\n if (obj.hasOwnProperty(key) && key !== 'constructor' && obj[key] !== undefined) {\n dist[key] = obj[key];\n }\n }\n}\nfunction mix(dist, src1, src2, src3) {\n if (src1)\n _mix(dist, src1);\n if (src2)\n _mix(dist, src2);\n if (src3)\n _mix(dist, src3);\n return dist;\n}\n//# sourceMappingURL=mix.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/mix.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/index.js": +/***/ "./node_modules/@antv/util/esm/mod.js": +/*!********************************************!*\ + !*** ./node_modules/@antv/util/esm/mod.js ***! + \********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { + +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar mod = function (n, m) {\n return ((n % m) + m) % m;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (mod);\n//# sourceMappingURL=mod.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/mod.js?"); + +/***/ }), + +/***/ "./node_modules/@antv/util/esm/noop.js": /*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/index.js ***! + !*** ./node_modules/@antv/util/esm/noop.js ***! \*********************************************/ -/*! exports provided: glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"glMatrix\", function() { return _common_js__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat2.js */ \"./node_modules/gl-matrix/esm/mat2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat2\", function() { return _mat2_js__WEBPACK_IMPORTED_MODULE_1__; });\n/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat2d.js */ \"./node_modules/gl-matrix/esm/mat2d.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat2d\", function() { return _mat2d_js__WEBPACK_IMPORTED_MODULE_2__; });\n/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mat3.js */ \"./node_modules/gl-matrix/esm/mat3.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat3\", function() { return _mat3_js__WEBPACK_IMPORTED_MODULE_3__; });\n/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mat4.js */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat4\", function() { return _mat4_js__WEBPACK_IMPORTED_MODULE_4__; });\n/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quat.js */ \"./node_modules/gl-matrix/esm/quat.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"quat\", function() { return _quat_js__WEBPACK_IMPORTED_MODULE_5__; });\n/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./quat2.js */ \"./node_modules/gl-matrix/esm/quat2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"quat2\", function() { return _quat2_js__WEBPACK_IMPORTED_MODULE_6__; });\n/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vec2.js */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec2\", function() { return _vec2_js__WEBPACK_IMPORTED_MODULE_7__; });\n/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./vec3.js */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec3\", function() { return _vec3_js__WEBPACK_IMPORTED_MODULE_8__; });\n/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./vec4.js */ \"./node_modules/gl-matrix/esm/vec4.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec4\", function() { return _vec4_js__WEBPACK_IMPORTED_MODULE_9__; });\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function () { });\n//# sourceMappingURL=noop.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/noop.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/mat2.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat2.js ***! - \********************************************/ -/*! exports provided: create, clone, copy, identity, fromValues, set, transpose, invert, adjoint, determinant, multiply, rotate, scale, fromRotation, fromScaling, str, frob, LDU, add, subtract, exactEquals, equals, multiplyScalar, multiplyScalarAndAdd, mul, sub */ +/***/ "./node_modules/@antv/util/esm/number2color.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/util/esm/number2color.js ***! + \*****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LDU\", function() { return LDU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 2x2 Matrix\n * @module mat2\n */\n\n/**\n * Creates a new identity mat2\n *\n * @returns {mat2} a new 2x2 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\n * Creates a new mat2 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2} a matrix to clone\n * @returns {mat2} a new 2x2 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Copy the values from one mat2 to another\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\n * Create a new mat2 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out A new 2x2 matrix\n */\n\nfunction fromValues(m00, m01, m10, m11) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\n * Set the components of a mat2 to the given values\n *\n * @param {mat2} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out\n */\n\nfunction set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\n * Transpose the values of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nfunction adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\n * Calculates the determinant of a mat2\n *\n * @param {ReadonlyMat2} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\n * Multiplies two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nfunction multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\n * Rotates a mat2 by the given angle\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\n\nfunction rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\n * Scales the mat2 by the dimensions in the given vec2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2} out\n **/\n\nfunction scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\n * Returns a string representation of a mat2\n *\n * @param {ReadonlyMat2} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat2\n *\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @param {ReadonlyMat2} L the lower triangular matrix\n * @param {ReadonlyMat2} D the diagonal matrix\n * @param {ReadonlyMat2} U the upper triangular matrix\n * @param {ReadonlyMat2} a the input matrix to factorize\n */\n\nfunction LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\n * Adds two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2} out the receiving vector\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Alias for {@link mat2.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat2.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/mat2.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar numColorCache = {};\nfunction numberToColor(num) {\n // 增加缓存\n var color = numColorCache[num];\n if (!color) {\n var str = num.toString(16);\n for (var i = str.length; i < 6; i++) {\n str = '0' + str;\n }\n color = '#' + str;\n numColorCache[num] = color;\n }\n return color;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (numberToColor);\n//# sourceMappingURL=number2color.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/number2color.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/mat2d.js": +/***/ "./node_modules/@antv/util/esm/omit.js": /*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat2d.js ***! + !*** ./node_modules/@antv/util/esm/omit.js ***! \*********************************************/ -/*! exports provided: create, clone, copy, identity, fromValues, set, invert, determinant, multiply, rotate, scale, translate, fromRotation, fromScaling, fromTranslation, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 2x3 Matrix\n * @module mat2d\n * @description\n * A mat2d contains six elements defined as:\n *
\n * [a, b,\n *  c, d,\n *  tx, ty]\n * 
\n * This is a short form for the 3x3 matrix:\n *
\n * [a, b, 0,\n *  c, d, 0,\n *  tx, ty, 1]\n * 
\n * The last column is ignored so the array is shorter and operations are faster.\n */\n\n/**\n * Creates a new identity mat2d\n *\n * @returns {mat2d} a new 2x3 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\n * Creates a new mat2d initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2d} a matrix to clone\n * @returns {mat2d} a new 2x3 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\n * Copy the values from one mat2d to another\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {mat2d} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\n * Set a mat2d to the identity matrix\n *\n * @param {mat2d} out the receiving matrix\n * @returns {mat2d} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Create a new mat2d with the given values\n *\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} A new mat2d\n */\n\nfunction fromValues(a, b, c, d, tx, ty) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\n * Set the components of a mat2d to the given values\n *\n * @param {mat2d} out the receiving matrix\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} out\n */\n\nfunction set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\n * Inverts a mat2d\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {mat2d} out\n */\n\nfunction invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\n * Calculates the determinant of a mat2d\n *\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\n * Multiplies two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nfunction multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\n * Rotates a mat2d by the given angle\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\n\nfunction rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\n * Scales the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to translate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2d} out\n **/\n\nfunction scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\n * Translates the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to translate\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\n * @returns {mat2d} out\n **/\n\nfunction translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.rotate(dest, dest, rad);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.scale(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2d} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.translate(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat2d} out\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\n * Returns a string representation of a mat2d\n *\n * @param {ReadonlyMat2d} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat2d\n *\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\n * Adds two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2d} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2d} out the receiving vector\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2d} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2d} a The first matrix.\n * @param {ReadonlyMat2d} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2d} a The first matrix.\n * @param {ReadonlyMat2d} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\n * Alias for {@link mat2d.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat2d.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/mat2d.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _reduce__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./reduce */ \"./node_modules/@antv/util/esm/reduce.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, keys) {\n return Object(_reduce__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (r, curr, key) {\n if (!keys.includes(key)) {\n r[key] = curr;\n }\n return r;\n }, {});\n});\n//# sourceMappingURL=omit.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/omit.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/mat3.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat3.js ***! - \********************************************/ -/*! exports provided: create, fromMat4, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, rotate, scale, fromTranslation, fromRotation, fromScaling, fromMat2d, fromQuat, normalFromMat4, projection, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ +/***/ "./node_modules/@antv/util/esm/parse-radius.js": +/*!*****************************************************!*\ + !*** ./node_modules/@antv/util/esm/parse-radius.js ***! + \*****************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat4\", function() { return fromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat2d\", function() { return fromMat2d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat\", function() { return fromQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalFromMat4\", function() { return normalFromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projection\", function() { return projection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {ReadonlyMat4} a the source 4x4 matrix\n * @returns {mat3} out\n */\n\nfunction fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Create a new mat3 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} A new mat3\n */\n\nfunction fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set the components of a mat3 to the given values\n *\n * @param {mat3} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} out\n */\n\nfunction set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\n * Calculates the determinant of a mat3\n *\n * @param {ReadonlyMat3} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to translate\n * @param {ReadonlyVec2} v vector to translate by\n * @returns {mat3} out\n */\n\nfunction translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nfunction rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat3} out\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat3} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to copy\n * @returns {mat3} out\n **/\n\nfunction fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\n * Calculates a 3x3 matrix from the given quaternion\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat3} out\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n *\n * @returns {mat3} out\n */\n\nfunction normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\n\nfunction projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat3\n *\n * @param {ReadonlyMat3} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\n * Adds two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat3} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat3} out the receiving vector\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat3} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/mat3.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n\nfunction parseRadius(radius) {\n var r1 = 0, r2 = 0, r3 = 0, r4 = 0;\n if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(radius)) {\n if (radius.length === 1) {\n r1 = r2 = r3 = r4 = radius[0];\n }\n else if (radius.length === 2) {\n r1 = r3 = radius[0];\n r2 = r4 = radius[1];\n }\n else if (radius.length === 3) {\n r1 = radius[0];\n r2 = r4 = radius[1];\n r3 = radius[2];\n }\n else {\n r1 = radius[0];\n r2 = radius[1];\n r3 = radius[2];\n r4 = radius[3];\n }\n }\n else {\n r1 = r2 = r3 = r4 = radius;\n }\n return {\n r1: r1,\n r2: r2,\n r3: r3,\n r4: r4\n };\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (parseRadius);\n//# sourceMappingURL=parse-radius.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/parse-radius.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/mat4.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/mat4.js ***! - \********************************************/ -/*! exports provided: create, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, scale, rotate, rotateX, rotateY, rotateZ, fromTranslation, fromScaling, fromRotation, fromXRotation, fromYRotation, fromZRotation, fromRotationTranslation, fromQuat2, getTranslation, getScaling, getRotation, fromRotationTranslationScale, fromRotationTranslationScaleOrigin, fromQuat, frustum, perspectiveNO, perspective, perspectiveZO, perspectiveFromFieldOfView, orthoNO, ortho, orthoZO, lookAt, targetTo, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ +/***/ "./node_modules/@antv/util/esm/pick.js": +/*!*********************************************!*\ + !*** ./node_modules/@antv/util/esm/pick.js ***! + \*********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromXRotation\", function() { return fromXRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromYRotation\", function() { return fromYRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromZRotation\", function() { return fromZRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslation\", function() { return fromRotationTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat2\", function() { return fromQuat2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTranslation\", function() { return getTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaling\", function() { return getScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRotation\", function() { return getRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationScale\", function() { return fromRotationTranslationScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationScaleOrigin\", function() { return fromRotationTranslationScaleOrigin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat\", function() { return fromQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frustum\", function() { return frustum; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspectiveNO\", function() { return perspectiveNO; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspective\", function() { return perspective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspectiveZO\", function() { return perspectiveZO; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspectiveFromFieldOfView\", function() { return perspectiveFromFieldOfView; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orthoNO\", function() { return orthoNO; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ortho\", function() { return ortho; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orthoZO\", function() { return orthoZO; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lookAt\", function() { return lookAt; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"targetTo\", function() { return targetTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\n\nfunction fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\n\nfunction set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\n\nfunction translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nfunction rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nfunction fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\n\nfunction fromQuat2(out, a) {\n var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nfunction getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion paramter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nfunction getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\n\nfunction getRotation(out, mat) {\n var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nfunction perspectiveNO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\n\nvar perspective = perspectiveNO;\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nfunction perspectiveZO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction orthoNO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\n\nvar ortho = orthoNO;\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction orthoZO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nfunction lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nfunction targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/mat4.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n\n\nvar hasOwnProperty = Object.prototype.hasOwnProperty;\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (object, keys) {\n if (object === null || !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(object)) {\n return {};\n }\n var result = {};\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(keys, function (key) {\n if (hasOwnProperty.call(object, key)) {\n result[key] = object[key];\n }\n });\n return result;\n});\n//# sourceMappingURL=pick.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/pick.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/quat.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/quat.js ***! - \********************************************/ -/*! exports provided: create, identity, setAxisAngle, getAxisAngle, getAngle, multiply, rotateX, rotateY, rotateZ, calculateW, exp, ln, pow, slerp, random, invert, conjugate, fromMat3, fromEuler, str, clone, fromValues, copy, set, add, mul, scale, dot, lerp, length, len, squaredLength, sqrLen, normalize, exactEquals, equals, rotationTo, sqlerp, setAxes */ +/***/ "./node_modules/@antv/util/esm/pull-at.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/pull-at.js ***! + \************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAxisAngle\", function() { return setAxisAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAxisAngle\", function() { return getAxisAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAngle\", function() { return getAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"calculateW\", function() { return calculateW; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exp\", function() { return exp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ln\", function() { return ln; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pow\", function() { return pow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"slerp\", function() { return slerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conjugate\", function() { return conjugate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat3\", function() { return fromMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromEuler\", function() { return fromEuler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotationTo\", function() { return rotationTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqlerp\", function() { return sqlerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAxes\", function() { return setAxes; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat3.js */ \"./node_modules/gl-matrix/esm/mat3.js\");\n/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vec3.js */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vec4.js */ \"./node_modules/gl-matrix/esm/vec4.js\");\n\n\n\n\n/**\n * Quaternion\n * @module quat\n */\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyVec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\n\nfunction setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @param {vec3} out_axis Vector receiving the axis of rotation\n * @param {ReadonlyQuat} q Quaternion to be decomposed\n * @return {Number} Angle, in radians, of the rotation\n */\n\nfunction getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\n * Gets the angular distance between two unit quaternions\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n\nfunction getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n */\n\nfunction multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nfunction rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nfunction rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nfunction rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate W component of\n * @returns {quat} out\n */\n\nfunction calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\n * Calculate the exponential of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\nfunction exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\n * Calculate the natural logarithm of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\nfunction ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\n * Calculate the scalar power of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @param {Number} b amount to scale the quaternion by\n * @returns {quat} out\n */\n\nfunction pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\nfunction slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\n * Generates a random unit quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\nfunction random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate inverse of\n * @returns {quat} out\n */\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate conjugate of\n * @returns {quat} out\n */\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyMat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\n\nfunction fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\n * Creates a quaternion from the given euler angle x, y, z.\n *\n * @param {quat} out the receiving quaternion\n * @param {x} Angle to rotate around X axis in degrees.\n * @param {y} Angle to rotate around Y axis in degrees.\n * @param {z} Angle to rotate around Z axis in degrees.\n * @returns {quat} out\n * @function\n */\n\nfunction fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\n * Returns a string representation of a quatenion\n *\n * @param {ReadonlyQuat} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\n\nvar clone = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"clone\"];\n/**\n * Creates a new quat initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} a new quaternion\n * @function\n */\n\nvar fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"fromValues\"];\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the source quaternion\n * @returns {quat} out\n * @function\n */\n\nvar copy = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"copy\"];\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} out\n * @function\n */\n\nvar set = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"set\"];\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n * @function\n */\n\nvar add = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"add\"];\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {ReadonlyQuat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\n\nvar scale = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"scale\"];\n/**\n * Calculates the dot product of two quat's\n *\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\n\nvar dot = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"dot\"];\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n * @function\n */\n\nvar lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"lerp\"];\n/**\n * Calculates the length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nvar length = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"length\"];\n/**\n * Alias for {@link quat.length}\n * @function\n */\n\nvar len = length;\n/**\n * Calculates the squared length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\n\nvar squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"squaredLength\"];\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\n\nvar normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"];\n/**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat} a The first quaternion.\n * @param {ReadonlyQuat} b The second quaternion.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nvar exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"exactEquals\"];\n/**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n *\n * @param {ReadonlyQuat} a The first vector.\n * @param {ReadonlyQuat} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nvar equals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"equals\"];\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {ReadonlyVec3} a the initial vector\n * @param {ReadonlyVec3} b the destination vector\n * @returns {quat} out\n */\n\nvar rotationTo = function () {\n var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"create\"]();\n var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"fromValues\"](1, 0, 0);\n var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"fromValues\"](0, 1, 0);\n return function (out, a, b) {\n var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"dot\"](a, b);\n\n if (dot < -0.999999) {\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, xUnitVec3, a);\n if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"len\"](tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, yUnitVec3, a);\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"normalize\"](tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {ReadonlyQuat} c the third operand\n * @param {ReadonlyQuat} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\nvar sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {ReadonlyVec3} view the vector representing the viewing direction\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\n * @returns {quat} out\n */\n\nvar setAxes = function () {\n var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_1__[\"create\"]();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/quat.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\nvar splice = Array.prototype.splice;\nvar pullAt = function pullAt(arr, indexes) {\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return [];\n }\n var length = arr ? indexes.length : 0;\n var last = length - 1;\n while (length--) {\n var previous = void 0;\n var index = indexes[length];\n if (length === last || index !== previous) {\n previous = index;\n splice.call(arr, index, 1);\n }\n }\n return arr;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (pullAt);\n//# sourceMappingURL=pull-at.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/pull-at.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/quat2.js": +/***/ "./node_modules/@antv/util/esm/pull.js": /*!*********************************************!*\ - !*** ./node_modules/gl-matrix/esm/quat2.js ***! + !*** ./node_modules/@antv/util/esm/pull.js ***! \*********************************************/ -/*! exports provided: create, clone, fromValues, fromRotationTranslationValues, fromRotationTranslation, fromTranslation, fromRotation, fromMat4, copy, identity, set, getReal, getDual, setReal, setDual, getTranslation, translate, rotateX, rotateY, rotateZ, rotateByQuatAppend, rotateByQuatPrepend, rotateAroundAxis, add, multiply, mul, scale, dot, lerp, invert, conjugate, length, len, squaredLength, sqrLen, normalize, str, exactEquals, equals */ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationValues\", function() { return fromRotationTranslationValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslation\", function() { return fromRotationTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat4\", function() { return fromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getReal\", function() { return getReal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDual\", function() { return getDual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setReal\", function() { return setReal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setDual\", function() { return setDual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTranslation\", function() { return getTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateByQuatAppend\", function() { return rotateByQuatAppend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateByQuatPrepend\", function() { return rotateByQuatPrepend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateAroundAxis\", function() { return rotateAroundAxis; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conjugate\", function() { return conjugate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quat.js */ \"./node_modules/gl-matrix/esm/quat.js\");\n/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat4.js */ \"./node_modules/gl-matrix/esm/mat4.js\");\n\n\n\n/**\n * Dual Quaternion
\n * Format: [real, dual]
\n * Quaternion format: XYZW
\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\n * @module quat2\n */\n\n/**\n * Creates a new identity dual quat\n *\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\n */\n\nfunction create() {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat2} a dual quaternion to clone\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nfunction clone(a) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\n * Creates a new dual quat initialized with the given values\n *\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component\n * @param {Number} y2 Y component\n * @param {Number} z2 Z component\n * @param {Number} w2 W component\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nfunction fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\n * Creates a new dual quat from the given values (quat and translation)\n *\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component (translation)\n * @param {Number} y2 Y component (translation)\n * @param {Number} z2 Z component (translation)\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nfunction fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\n * Creates a dual quat from a quaternion and a translation\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyQuat} q a normalized quaternion\n * @param {ReadonlyVec3} t tranlation vector\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nfunction fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Creates a dual quat from a translation\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyVec3} t translation vector\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nfunction fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\n * Creates a dual quat from a quaternion\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyQuat} q the quaternion\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nfunction fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\n * Creates a new dual quat from a matrix (4x4)\n *\n * @param {quat2} out the dual quaternion\n * @param {ReadonlyMat4} a the matrix\n * @returns {quat2} dual quat receiving operation result\n * @function\n */\n\nfunction fromMat4(out, a) {\n //TODO Optimize this\n var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"create\"]();\n _mat4_js__WEBPACK_IMPORTED_MODULE_2__[\"getRotation\"](outer, a);\n var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n _mat4_js__WEBPACK_IMPORTED_MODULE_2__[\"getTranslation\"](t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\n * Copy the values from one dual quat to another\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the source dual quaternion\n * @returns {quat2} out\n * @function\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\n * Set a dual quat to the identity dual quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @returns {quat2} out\n */\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\n * Set the components of a dual quat to the given values\n *\n * @param {quat2} out the receiving quaternion\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component\n * @param {Number} y2 Y component\n * @param {Number} z2 Z component\n * @param {Number} w2 W component\n * @returns {quat2} out\n * @function\n */\n\nfunction set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\n * Gets the real part of a dual quat\n * @param {quat} out real part\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @return {quat} real part\n */\n\nvar getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"copy\"];\n/**\n * Gets the dual part of a dual quat\n * @param {quat} out dual part\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @return {quat} dual part\n */\n\nfunction getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\n * Set the real component of a dual quat to the given quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat} q a quaternion representing the real part\n * @returns {quat2} out\n * @function\n */\n\nvar setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"copy\"];\n/**\n * Set the dual component of a dual quat to the given quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat} q a quaternion representing the dual part\n * @returns {quat2} out\n * @function\n */\n\nfunction setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\n * Gets the translation of a normalized dual quat\n * @param {vec3} out translation\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\n * @return {vec3} translation\n */\n\nfunction getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\n * Translates a dual quat by the given vector\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {quat2} out\n */\n\nfunction translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\n * Rotates a dual quat around the X axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nfunction rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateX\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat around the Y axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nfunction rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateY\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat around the Z axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nfunction rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateZ\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat by a given quaternion (a * q)\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {ReadonlyQuat} q quaternion to rotate by\n * @returns {quat2} out\n */\n\nfunction rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\n * Rotates a dual quat by a given quaternion (q * a)\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat} q quaternion to rotate by\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @returns {quat2} out\n */\n\nfunction rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\n * Rotates a dual quat around a given axis. Does the normalisation automatically\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @param {Number} rad how far the rotation should be\n * @returns {quat2} out\n */\n\nfunction rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Adds two dual quat's\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {quat2} out\n * @function\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\n * Multiplies two dual quat's\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {quat2} out\n */\n\nfunction multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\n * Alias for {@link quat2.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Scales a dual quat by a scalar number\n *\n * @param {quat2} out the receiving dual quat\n * @param {ReadonlyQuat2} a the dual quat to scale\n * @param {Number} b amount to scale the dual quat by\n * @returns {quat2} out\n * @function\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\n *\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\n\nvar dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"dot\"];\n/**\n * Performs a linear interpolation between two dual quats's\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\n *\n * @param {quat2} out the receiving dual quat\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat2} out\n */\n\nfunction lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\n * @returns {quat2} out\n */\n\nfunction invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\n * Calculates the conjugate of a dual quat\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\n * @returns {quat2} out\n */\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\n * Calculates the length of a dual quat\n *\n * @param {ReadonlyQuat2} a dual quat to calculate length of\n * @returns {Number} length of a\n * @function\n */\n\nvar length = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"length\"];\n/**\n * Alias for {@link quat2.length}\n * @function\n */\n\nvar len = length;\n/**\n * Calculates the squared length of a dual quat\n *\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\n\nvar squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"squaredLength\"];\n/**\n * Alias for {@link quat2.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Normalize a dual quat\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a dual quaternion to normalize\n * @returns {quat2} out\n * @function\n */\n\nfunction normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\n * Returns a string representation of a dual quatenion\n *\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\n * @returns {String} string representation of the dual quat\n */\n\nfunction str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat2} a the first dual quaternion.\n * @param {ReadonlyQuat2} b the second dual quaternion.\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\n *\n * @param {ReadonlyQuat2} a the first dual quat.\n * @param {ReadonlyQuat2} b the second dual quat.\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/quat2.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar arrPrototype = Array.prototype;\nvar splice = arrPrototype.splice;\nvar indexOf = arrPrototype.indexOf;\nvar pull = function (arr) {\n var values = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n values[_i - 1] = arguments[_i];\n }\n for (var i = 0; i < values.length; i++) {\n var value = values[i];\n var fromIndex = -1;\n while ((fromIndex = indexOf.call(arr, value)) > -1) {\n splice.call(arr, fromIndex, 1);\n }\n }\n return arr;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (pull);\n//# sourceMappingURL=pull.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/pull.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/vec2.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec2.js ***! - \********************************************/ -/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat2, transformMat2d, transformMat3, transformMat4, rotate, angle, zero, str, exactEquals, equals, len, sub, mul, div, dist, sqrDist, sqrLen, forEach */ +/***/ "./node_modules/@antv/util/esm/reduce.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/reduce.js ***! + \***********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat2\", function() { return transformMat2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat2d\", function() { return transformMat2d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat3\", function() { return transformMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angle\", function() { return angle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {ReadonlyVec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\n\nfunction fromValues(x, y) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the source vector\n * @returns {vec2} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\n\nfunction set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to ceil\n * @returns {vec2} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to floor\n * @returns {vec2} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to round\n * @returns {vec2} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to negate\n * @returns {vec2} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to invert\n * @returns {vec2} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\n\nfunction normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec3} out\n */\n\nfunction cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec2} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\n * Rotate a 2D vector\n * @param {vec2} out The receiving vec2\n * @param {ReadonlyVec2} a The vec2 point to rotate\n * @param {ReadonlyVec2} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec2} out\n */\n\nfunction rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\n * Get the angle between two 2D vectors\n * @param {ReadonlyVec2} a The first operand\n * @param {ReadonlyVec2} b The second operand\n * @returns {Number} The angle in radians\n */\n\nfunction angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\n * Alias for {@link vec2.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/vec2.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_plain_object__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-plain-object */ \"./node_modules/@antv/util/esm/is-plain-object.js\");\n\n\n\nvar reduce = function (arr, fn, init) {\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr) && !Object(_is_plain_object__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(arr)) {\n return arr;\n }\n var result = init;\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr, function (data, i) {\n result = fn(result, data, i);\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (reduce);\n//# sourceMappingURL=reduce.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/reduce.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/vec3.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec3.js ***! - \********************************************/ -/*! exports provided: create, clone, length, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, squaredLength, negate, inverse, normalize, dot, cross, lerp, hermite, bezier, random, transformMat4, transformMat3, transformQuat, rotateX, rotateY, rotateZ, angle, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */ +/***/ "./node_modules/@antv/util/esm/remove.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/remove.js ***! + \***********************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hermite\", function() { return hermite; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bezier\", function() { return bezier; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat3\", function() { return transformMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformQuat\", function() { return transformQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angle\", function() { return angle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\n\nfunction fromValues(x, y, z) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\n\nfunction set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\n * Math.round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 * Math.PI;\n var z = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec3} out\n */\n\nfunction transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\n\nfunction angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec3.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/vec3.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n/* harmony import */ var _pull_at__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./pull-at */ \"./node_modules/@antv/util/esm/pull-at.js\");\n\n\nvar remove = function (arr, predicate) {\n /**\n * const arr = [1, 2, 3, 4]\n * const evens = remove(arr, n => n % 2 == 0)\n * console.log(arr) // => [1, 3]\n * console.log(evens) // => [2, 4]\n */\n var result = [];\n if (!Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr)) {\n return result;\n }\n var i = -1;\n var indexes = [];\n var length = arr.length;\n while (++i < length) {\n var value = arr[i];\n if (predicate(value, i, arr)) {\n result.push(value);\n indexes.push(i);\n }\n }\n Object(_pull_at__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr, indexes);\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (remove);\n//# sourceMappingURL=remove.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/remove.js?"); /***/ }), -/***/ "./node_modules/gl-matrix/esm/vec4.js": -/*!********************************************!*\ - !*** ./node_modules/gl-matrix/esm/vec4.js ***! - \********************************************/ -/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat4, transformQuat, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */ +/***/ "./node_modules/@antv/util/esm/request-animation-frame.js": +/*!****************************************************************!*\ + !*** ./node_modules/@antv/util/esm/request-animation-frame.js ***! + \****************************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformQuat\", function() { return transformQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\n\nfunction fromValues(x, y, z, w) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\n\nfunction set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\n * Math.round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} result the receiving vector\n * @param {ReadonlyVec4} U the first vector\n * @param {ReadonlyVec4} V the second vector\n * @param {ReadonlyVec4} W the third vector\n * @returns {vec4} result\n */\n\nfunction cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec4} out\n */\n\nfunction transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec4.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/vec4.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return requestAnimationFrame; });\nfunction requestAnimationFrame(fn) {\n var method = window.requestAnimationFrame ||\n window.webkitRequestAnimationFrame ||\n // @ts-ignore\n window.mozRequestAnimationFrame ||\n // @ts-ignore\n window.msRequestAnimationFrame ||\n function (f) {\n return setTimeout(f, 16);\n };\n return method(fn);\n}\n;\n//# sourceMappingURL=request-animation-frame.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/request-animation-frame.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/add.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/add.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/set.js": +/*!********************************************!*\ + !*** ./node_modules/@antv/util/esm/set.js ***! + \********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = add\n\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nfunction add(out, a, b) {\n out[0] = a[0] + b[0]\n out[1] = a[1] + b[1]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/add.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_object__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-object */ \"./node_modules/@antv/util/esm/is-object.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n/* harmony import */ var _is_number__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-number */ \"./node_modules/@antv/util/esm/is-number.js\");\n\n\n\n/**\n * https://github.com/developit/dlv/blob/master/index.js\n * @param obj\n * @param path\n * @param value\n */\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (obj, path, value) {\n var o = obj;\n var keyArr = Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(path) ? path.split('.') : path;\n keyArr.forEach(function (key, idx) {\n // 不是最后一个\n if (idx < keyArr.length - 1) {\n if (!Object(_is_object__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o[key])) {\n o[key] = Object(_is_number__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(keyArr[idx + 1]) ? [] : {};\n }\n o = o[key];\n }\n else {\n o[key] = value;\n }\n });\n return obj;\n});\n//# sourceMappingURL=set.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/set.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/ceil.js": -/*!**************************************!*\ - !*** ./node_modules/gl-vec2/ceil.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/size.js": +/*!*********************************************!*\ + !*** ./node_modules/@antv/util/esm/size.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = ceil\n\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to ceil\n * @returns {vec2} out\n */\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0])\n out[1] = Math.ceil(a[1])\n return out\n}\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/ceil.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return size; });\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\n\nfunction size(o) {\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(o)) {\n return 0;\n }\n if (Object(_is_array_like__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(o)) {\n return o.length;\n }\n return Object.keys(o).length;\n}\n//# sourceMappingURL=size.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/size.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/clone.js": -/*!***************************************!*\ - !*** ./node_modules/gl-vec2/clone.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/some.js": +/*!*********************************************!*\ + !*** ./node_modules/@antv/util/esm/some.js ***! + \*********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = clone\n\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {vec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\nfunction clone(a) {\n var out = new Float32Array(2)\n out[0] = a[0]\n out[1] = a[1]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/clone.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 只要有一个满足条件就返回 true\n * @param arr\n * @param func\n */\nvar some = function (arr, func) {\n for (var i = 0; i < arr.length; i++) {\n if (func(arr[i], i))\n return true;\n }\n return false;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (some);\n//# sourceMappingURL=some.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/some.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/copy.js": -/*!**************************************!*\ - !*** ./node_modules/gl-vec2/copy.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/sort-by.js": +/*!************************************************!*\ + !*** ./node_modules/@antv/util/esm/sort-by.js ***! + \************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = copy\n\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the source vector\n * @returns {vec2} out\n */\nfunction copy(out, a) {\n out[0] = a[0]\n out[1] = a[1]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/copy.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\n\nfunction sortBy(arr, key) {\n var comparer;\n if (Object(_is_function__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(key)) {\n comparer = function (a, b) { return key(a) - key(b); };\n }\n else {\n var keys_1 = [];\n if (Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(key)) {\n keys_1.push(key);\n }\n else if (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(key)) {\n keys_1 = key;\n }\n comparer = function (a, b) {\n for (var i = 0; i < keys_1.length; i += 1) {\n var prop = keys_1[i];\n if (a[prop] > b[prop]) {\n return 1;\n }\n if (a[prop] < b[prop]) {\n return -1;\n }\n }\n return 0;\n };\n }\n arr.sort(comparer);\n return arr;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (sortBy);\n//# sourceMappingURL=sort-by.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/sort-by.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/create.js": -/*!****************************************!*\ - !*** ./node_modules/gl-vec2/create.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/starts-with.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/util/esm/starts-with.js ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = create\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\nfunction create() {\n var out = new Float32Array(2)\n out[0] = 0\n out[1] = 0\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/create.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_string__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-string */ \"./node_modules/@antv/util/esm/is-string.js\");\n\n\nfunction startsWith(arr, e) {\n return (Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(arr) || Object(_is_string__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(arr)) ? arr[0] === e : false;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (startsWith);\n//# sourceMappingURL=starts-with.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/starts-with.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/cross.js": -/*!***************************************!*\ - !*** ./node_modules/gl-vec2/cross.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/substitute.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/substitute.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = cross\n\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec3} out\n */\nfunction cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0]\n out[0] = out[1] = 0\n out[2] = z\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/cross.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nfunction substitute(str, o) {\n if (!str || !o) {\n return str;\n }\n return str.replace(/\\\\?\\{([^{}]+)\\}/g, function (match, name) {\n if (match.charAt(0) === '\\\\') {\n return match.slice(1);\n }\n return (o[name] === undefined) ? '' : o[name];\n });\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (substitute);\n//# sourceMappingURL=substitute.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/substitute.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/dist.js": -/*!**************************************!*\ - !*** ./node_modules/gl-vec2/dist.js ***! - \**************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/throttle.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/throttle.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./distance */ \"./node_modules/gl-vec2/distance.js\")\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/dist.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (func, wait, options) {\n var timeout, context, args, result;\n var previous = 0;\n if (!options)\n options = {};\n var later = function () {\n previous = options.leading === false ? 0 : Date.now();\n timeout = null;\n result = func.apply(context, args);\n if (!timeout)\n context = args = null;\n };\n var throttled = function () {\n var now = Date.now();\n if (!previous && options.leading === false)\n previous = now;\n var remaining = wait - (now - previous);\n context = this;\n args = arguments;\n if (remaining <= 0 || remaining > wait) {\n if (timeout) {\n clearTimeout(timeout);\n timeout = null;\n }\n previous = now;\n result = func.apply(context, args);\n if (!timeout)\n context = args = null;\n }\n else if (!timeout && options.trailing !== false) {\n timeout = setTimeout(later, remaining);\n }\n return result;\n };\n throttled.cancel = function () {\n clearTimeout(timeout);\n previous = 0;\n timeout = context = args = null;\n };\n return throttled;\n});\n//# sourceMappingURL=throttle.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/throttle.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/distance.js": -/*!******************************************!*\ - !*** ./node_modules/gl-vec2/distance.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/to-array.js": +/*!*************************************************!*\ + !*** ./node_modules/@antv/util/esm/to-array.js ***! + \*************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = distance\n\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} distance between a and b\n */\nfunction distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1]\n return Math.sqrt(x*x + y*y)\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/distance.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array_like__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array-like */ \"./node_modules/@antv/util/esm/is-array-like.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n return Object(_is_array_like__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value) ? Array.prototype.slice.call(value) : [];\n});\n//# sourceMappingURL=to-array.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-array.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/div.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/div.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/to-degree.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/util/esm/to-degree.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./divide */ \"./node_modules/gl-vec2/divide.js\")\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/div.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar DEGREE = 180 / Math.PI;\nvar toDegree = function (radian) {\n return DEGREE * radian;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (toDegree);\n//# sourceMappingURL=to-degree.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-degree.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/divide.js": -/*!****************************************!*\ - !*** ./node_modules/gl-vec2/divide.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/to-integer.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/to-integer.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = divide\n\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0]\n out[1] = a[1] / b[1]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/divide.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony default export */ __webpack_exports__[\"default\"] = (parseInt);\n//# sourceMappingURL=to-integer.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-integer.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/dot.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/dot.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/to-radian.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/util/esm/to-radian.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = dot\n\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} dot product of a and b\n */\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1]\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/dot.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar RADIAN = Math.PI / 180;\nvar toRadian = function (degree) {\n return RADIAN * degree;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (toRadian);\n//# sourceMappingURL=to-radian.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-radian.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/epsilon.js": -/*!*****************************************!*\ - !*** ./node_modules/gl-vec2/epsilon.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/to-string.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/util/esm/to-string.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = 0.000001\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/epsilon.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (value) {\n if (Object(_is_nil__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value))\n return '';\n return value.toString();\n});\n//# sourceMappingURL=to-string.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/to-string.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/equals.js": -/*!****************************************!*\ - !*** ./node_modules/gl-vec2/equals.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/union.js": +/*!**********************************************!*\ + !*** ./node_modules/@antv/util/esm/union.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = equals\n\nvar EPSILON = __webpack_require__(/*! ./epsilon */ \"./node_modules/gl-vec2/epsilon.js\")\n\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {vec2} a The first vector.\n * @param {vec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nfunction equals(a, b) {\n var a0 = a[0]\n var a1 = a[1]\n var b0 = b[0]\n var b1 = b[1]\n return (Math.abs(a0 - b0) <= EPSILON * Math.max(1.0, Math.abs(a0), Math.abs(b0)) &&\n Math.abs(a1 - b1) <= EPSILON * Math.max(1.0, Math.abs(a1), Math.abs(b1)))\n}\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/equals.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _uniq__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./uniq */ \"./node_modules/@antv/util/esm/uniq.js\");\n\nvar union = function () {\n var sources = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n sources[_i] = arguments[_i];\n }\n return Object(_uniq__WEBPACK_IMPORTED_MODULE_0__[\"default\"])([].concat.apply([], sources));\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (union);\n//# sourceMappingURL=union.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/union.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/exactEquals.js": +/***/ "./node_modules/@antv/util/esm/uniq.js": /*!*********************************************!*\ - !*** ./node_modules/gl-vec2/exactEquals.js ***! + !*** ./node_modules/@antv/util/esm/uniq.js ***! \*********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = exactEquals\n\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {vec2} a The first vector.\n * @param {vec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1]\n}\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/exactEquals.js?"); - -/***/ }), - -/***/ "./node_modules/gl-vec2/floor.js": -/*!***************************************!*\ - !*** ./node_modules/gl-vec2/floor.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = floor\n\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to floor\n * @returns {vec2} out\n */\nfunction floor(out, a) {\n out[0] = Math.floor(a[0])\n out[1] = Math.floor(a[1])\n return out\n}\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/floor.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return uniq; });\nfunction uniq(arr, cache) {\n if (cache === void 0) { cache = new Map(); }\n var r = [];\n if (Array.isArray(arr)) {\n for (var i = 0, len = arr.length; i < len; i++) {\n var item = arr[i];\n // 加一个 cache,提升性能\n if (!cache.has(item)) {\n r.push(item);\n cache.set(item, true);\n }\n }\n }\n return r;\n}\n//# sourceMappingURL=uniq.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/uniq.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/forEach.js": -/*!*****************************************!*\ - !*** ./node_modules/gl-vec2/forEach.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/unique-id.js": +/*!**************************************************!*\ + !*** ./node_modules/@antv/util/esm/unique-id.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = forEach\n\nvar vec = __webpack_require__(/*! ./create */ \"./node_modules/gl-vec2/create.js\")()\n\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\nfunction forEach(a, stride, offset, count, fn, arg) {\n var i, l\n if(!stride) {\n stride = 2\n }\n\n if(!offset) {\n offset = 0\n }\n \n if(count) {\n l = Math.min((count * stride) + offset, a.length)\n } else {\n l = a.length\n }\n\n for(i = offset; i < l; i += stride) {\n vec[0] = a[i]\n vec[1] = a[i+1]\n fn(vec, vec, arg)\n a[i] = vec[0]\n a[i+1] = vec[1]\n }\n \n return a\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/forEach.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\nvar map = {};\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (prefix) {\n prefix = prefix || 'g';\n if (!map[prefix]) {\n map[prefix] = 1;\n }\n else {\n map[prefix] += 1;\n }\n return prefix + map[prefix];\n});\n//# sourceMappingURL=unique-id.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/unique-id.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/fromValues.js": -/*!********************************************!*\ - !*** ./node_modules/gl-vec2/fromValues.js ***! - \********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/upper-case.js": +/*!***************************************************!*\ + !*** ./node_modules/@antv/util/esm/upper-case.js ***! + \***************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = fromValues\n\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\nfunction fromValues(x, y) {\n var out = new Float32Array(2)\n out[0] = x\n out[1] = y\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/fromValues.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n\nvar upperCase = function (str) {\n return Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(str).toUpperCase();\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (upperCase);\n//# sourceMappingURL=upper-case.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/upper-case.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/index.js": -/*!***************************************!*\ - !*** ./node_modules/gl-vec2/index.js ***! - \***************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/upper-first.js": +/*!****************************************************!*\ + !*** ./node_modules/@antv/util/esm/upper-first.js ***! + \****************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = {\n EPSILON: __webpack_require__(/*! ./epsilon */ \"./node_modules/gl-vec2/epsilon.js\")\n , create: __webpack_require__(/*! ./create */ \"./node_modules/gl-vec2/create.js\")\n , clone: __webpack_require__(/*! ./clone */ \"./node_modules/gl-vec2/clone.js\")\n , fromValues: __webpack_require__(/*! ./fromValues */ \"./node_modules/gl-vec2/fromValues.js\")\n , copy: __webpack_require__(/*! ./copy */ \"./node_modules/gl-vec2/copy.js\")\n , set: __webpack_require__(/*! ./set */ \"./node_modules/gl-vec2/set.js\")\n , equals: __webpack_require__(/*! ./equals */ \"./node_modules/gl-vec2/equals.js\")\n , exactEquals: __webpack_require__(/*! ./exactEquals */ \"./node_modules/gl-vec2/exactEquals.js\")\n , add: __webpack_require__(/*! ./add */ \"./node_modules/gl-vec2/add.js\")\n , subtract: __webpack_require__(/*! ./subtract */ \"./node_modules/gl-vec2/subtract.js\")\n , sub: __webpack_require__(/*! ./sub */ \"./node_modules/gl-vec2/sub.js\")\n , multiply: __webpack_require__(/*! ./multiply */ \"./node_modules/gl-vec2/multiply.js\")\n , mul: __webpack_require__(/*! ./mul */ \"./node_modules/gl-vec2/mul.js\")\n , divide: __webpack_require__(/*! ./divide */ \"./node_modules/gl-vec2/divide.js\")\n , div: __webpack_require__(/*! ./div */ \"./node_modules/gl-vec2/div.js\")\n , inverse: __webpack_require__(/*! ./inverse */ \"./node_modules/gl-vec2/inverse.js\")\n , min: __webpack_require__(/*! ./min */ \"./node_modules/gl-vec2/min.js\")\n , max: __webpack_require__(/*! ./max */ \"./node_modules/gl-vec2/max.js\")\n , rotate: __webpack_require__(/*! ./rotate */ \"./node_modules/gl-vec2/rotate.js\")\n , floor: __webpack_require__(/*! ./floor */ \"./node_modules/gl-vec2/floor.js\")\n , ceil: __webpack_require__(/*! ./ceil */ \"./node_modules/gl-vec2/ceil.js\")\n , round: __webpack_require__(/*! ./round */ \"./node_modules/gl-vec2/round.js\")\n , scale: __webpack_require__(/*! ./scale */ \"./node_modules/gl-vec2/scale.js\")\n , scaleAndAdd: __webpack_require__(/*! ./scaleAndAdd */ \"./node_modules/gl-vec2/scaleAndAdd.js\")\n , distance: __webpack_require__(/*! ./distance */ \"./node_modules/gl-vec2/distance.js\")\n , dist: __webpack_require__(/*! ./dist */ \"./node_modules/gl-vec2/dist.js\")\n , squaredDistance: __webpack_require__(/*! ./squaredDistance */ \"./node_modules/gl-vec2/squaredDistance.js\")\n , sqrDist: __webpack_require__(/*! ./sqrDist */ \"./node_modules/gl-vec2/sqrDist.js\")\n , length: __webpack_require__(/*! ./length */ \"./node_modules/gl-vec2/length.js\")\n , len: __webpack_require__(/*! ./len */ \"./node_modules/gl-vec2/len.js\")\n , squaredLength: __webpack_require__(/*! ./squaredLength */ \"./node_modules/gl-vec2/squaredLength.js\")\n , sqrLen: __webpack_require__(/*! ./sqrLen */ \"./node_modules/gl-vec2/sqrLen.js\")\n , negate: __webpack_require__(/*! ./negate */ \"./node_modules/gl-vec2/negate.js\")\n , normalize: __webpack_require__(/*! ./normalize */ \"./node_modules/gl-vec2/normalize.js\")\n , dot: __webpack_require__(/*! ./dot */ \"./node_modules/gl-vec2/dot.js\")\n , cross: __webpack_require__(/*! ./cross */ \"./node_modules/gl-vec2/cross.js\")\n , lerp: __webpack_require__(/*! ./lerp */ \"./node_modules/gl-vec2/lerp.js\")\n , random: __webpack_require__(/*! ./random */ \"./node_modules/gl-vec2/random.js\")\n , transformMat2: __webpack_require__(/*! ./transformMat2 */ \"./node_modules/gl-vec2/transformMat2.js\")\n , transformMat2d: __webpack_require__(/*! ./transformMat2d */ \"./node_modules/gl-vec2/transformMat2d.js\")\n , transformMat3: __webpack_require__(/*! ./transformMat3 */ \"./node_modules/gl-vec2/transformMat3.js\")\n , transformMat4: __webpack_require__(/*! ./transformMat4 */ \"./node_modules/gl-vec2/transformMat4.js\")\n , forEach: __webpack_require__(/*! ./forEach */ \"./node_modules/gl-vec2/forEach.js\")\n , limit: __webpack_require__(/*! ./limit */ \"./node_modules/gl-vec2/limit.js\")\n}\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/index.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _to_string__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./to-string */ \"./node_modules/@antv/util/esm/to-string.js\");\n\nvar upperFirst = function (value) {\n var str = Object(_to_string__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value);\n return str.charAt(0).toUpperCase() + str.substring(1);\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (upperFirst);\n//# sourceMappingURL=upper-first.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/upper-first.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/inverse.js": -/*!*****************************************!*\ - !*** ./node_modules/gl-vec2/inverse.js ***! - \*****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/values-of-key.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/util/esm/values-of-key.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = inverse\n\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to invert\n * @returns {vec2} out\n */\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0]\n out[1] = 1.0 / a[1]\n return out\n}\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/inverse.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _is_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./is-array */ \"./node_modules/@antv/util/esm/is-array.js\");\n/* harmony import */ var _is_nil__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-nil */ \"./node_modules/@antv/util/esm/is-nil.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function (data, name) {\n var rst = [];\n var tmpMap = {};\n for (var i = 0; i < data.length; i++) {\n var obj = data[i];\n var value = obj[name];\n if (!Object(_is_nil__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(value)) {\n // flatten\n if (!Object(_is_array__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(value)) {\n value = [value];\n }\n for (var j = 0; j < value.length; j++) {\n var val = value[j];\n // unique\n if (!tmpMap[val]) {\n rst.push(val);\n tmpMap[val] = true;\n }\n }\n }\n }\n return rst;\n});\n//# sourceMappingURL=values-of-key.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/values-of-key.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/len.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/len.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/@antv/util/esm/values.js": +/*!***********************************************!*\ + !*** ./node_modules/@antv/util/esm/values.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./length */ \"./node_modules/gl-vec2/length.js\")\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/len.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _each__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./each */ \"./node_modules/@antv/util/esm/each.js\");\n/* harmony import */ var _is_function__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./is-function */ \"./node_modules/@antv/util/esm/is-function.js\");\n\n\n// @ts-ignore\nvar values = Object.values ? function (obj) { return Object.values(obj); } : function (obj) {\n var result = [];\n Object(_each__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(obj, function (value, key) {\n if (!(Object(_is_function__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(obj) && key === 'prototype')) {\n result.push(value);\n }\n });\n return result;\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = (values);\n//# sourceMappingURL=values.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/values.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/length.js": -/*!****************************************!*\ - !*** ./node_modules/gl-vec2/length.js ***! - \****************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/@antv/util/esm/wrap-behavior.js": +/*!******************************************************!*\ + !*** ./node_modules/@antv/util/esm/wrap-behavior.js ***! + \******************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = length\n\n/**\n * Calculates the length of a vec2\n *\n * @param {vec2} a vector to calculate length of\n * @returns {Number} length of a\n */\nfunction length(a) {\n var x = a[0],\n y = a[1]\n return Math.sqrt(x*x + y*y)\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/length.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/**\n * 封装事件,便于使用上下文this,和便于解除事件时使用\n * @protected\n * @param {Object} obj 对象\n * @param {String} action 事件名称\n * @return {Function} 返回事件处理函数\n */\nfunction wrapBehavior(obj, action) {\n if (obj['_wrap_' + action]) {\n return obj['_wrap_' + action];\n }\n var method = function (e) {\n obj[action](e);\n };\n obj['_wrap_' + action] = method;\n return method;\n}\n/* harmony default export */ __webpack_exports__[\"default\"] = (wrapBehavior);\n//# sourceMappingURL=wrap-behavior.js.map\n\n//# sourceURL=webpack:///./node_modules/@antv/util/esm/wrap-behavior.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/lerp.js": -/*!**************************************!*\ - !*** ./node_modules/gl-vec2/lerp.js ***! - \**************************************/ +/***/ "./node_modules/@babel/runtime/helpers/arrayLikeToArray.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/arrayLikeToArray.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("module.exports = lerp\n\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @param {Number} t interpolation amount between the two inputs\n * @returns {vec2} out\n */\nfunction lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1]\n out[0] = ax + t * (b[0] - ax)\n out[1] = ay + t * (b[1] - ay)\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/lerp.js?"); +eval("function _arrayLikeToArray(arr, len) {\n if (len == null || len > arr.length) len = arr.length;\n for (var i = 0, arr2 = new Array(len); i < len; i++) arr2[i] = arr[i];\n return arr2;\n}\nmodule.exports = _arrayLikeToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayLikeToArray.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/limit.js": -/*!***************************************!*\ - !*** ./node_modules/gl-vec2/limit.js ***! - \***************************************/ +/***/ "./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js ***! + \******************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = limit;\n\n/**\n * Limit the magnitude of this vector to the value used for the `max`\n * parameter.\n *\n * @param {vec2} the vector to limit\n * @param {Number} max the maximum magnitude for the vector\n * @returns {vec2} out\n */\nfunction limit(out, a, max) {\n var mSq = a[0] * a[0] + a[1] * a[1];\n\n if (mSq > max * max) {\n var n = Math.sqrt(mSq);\n out[0] = a[0] / n * max;\n out[1] = a[1] / n * max;\n } else {\n out[0] = a[0];\n out[1] = a[1];\n }\n\n return out;\n}\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/limit.js?"); +eval("var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ \"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\nfunction _arrayWithoutHoles(arr) {\n if (Array.isArray(arr)) return arrayLikeToArray(arr);\n}\nmodule.exports = _arrayWithoutHoles, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/max.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/max.js ***! - \*************************************/ +/***/ "./node_modules/@babel/runtime/helpers/asyncToGenerator.js": +/*!*****************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/asyncToGenerator.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("module.exports = max\n\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0])\n out[1] = Math.max(a[1], b[1])\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/max.js?"); +eval("function asyncGeneratorStep(gen, resolve, reject, _next, _throw, key, arg) {\n try {\n var info = gen[key](arg);\n var value = info.value;\n } catch (error) {\n reject(error);\n return;\n }\n if (info.done) {\n resolve(value);\n } else {\n Promise.resolve(value).then(_next, _throw);\n }\n}\nfunction _asyncToGenerator(fn) {\n return function () {\n var self = this,\n args = arguments;\n return new Promise(function (resolve, reject) {\n var gen = fn.apply(self, args);\n function _next(value) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"next\", value);\n }\n function _throw(err) {\n asyncGeneratorStep(gen, resolve, reject, _next, _throw, \"throw\", err);\n }\n _next(undefined);\n });\n };\n}\nmodule.exports = _asyncToGenerator, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/asyncToGenerator.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/min.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/min.js ***! - \*************************************/ +/***/ "./node_modules/@babel/runtime/helpers/classCallCheck.js": +/*!***************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/classCallCheck.js ***! + \***************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = min\n\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0])\n out[1] = Math.min(a[1], b[1])\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/min.js?"); +eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\nfunction _classCallCheck(instance, Constructor) {\n if (!(instance instanceof Constructor)) {\n throw new TypeError(\"Cannot call a class as a function\");\n }\n}\nmodule.exports = _classCallCheck, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/classCallCheck.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/mul.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/mul.js ***! - \*************************************/ +/***/ "./node_modules/@babel/runtime/helpers/createClass.js": +/*!************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/createClass.js ***! + \************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./multiply */ \"./node_modules/gl-vec2/multiply.js\")\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/mul.js?"); +eval("var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ \"./node_modules/@babel/runtime/helpers/toPropertyKey.js\");\nfunction _defineProperties(target, props) {\n for (var i = 0; i < props.length; i++) {\n var descriptor = props[i];\n descriptor.enumerable = descriptor.enumerable || false;\n descriptor.configurable = true;\n if (\"value\" in descriptor) descriptor.writable = true;\n Object.defineProperty(target, toPropertyKey(descriptor.key), descriptor);\n }\n}\nfunction _createClass(Constructor, protoProps, staticProps) {\n if (protoProps) _defineProperties(Constructor.prototype, protoProps);\n if (staticProps) _defineProperties(Constructor, staticProps);\n Object.defineProperty(Constructor, \"prototype\", {\n writable: false\n });\n return Constructor;\n}\nmodule.exports = _createClass, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/createClass.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/multiply.js": -/*!******************************************!*\ - !*** ./node_modules/gl-vec2/multiply.js ***! - \******************************************/ +/***/ "./node_modules/@babel/runtime/helpers/defineProperty.js": +/*!***************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/defineProperty.js ***! + \***************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = multiply\n\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0]\n out[1] = a[1] * b[1]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/multiply.js?"); +eval("var toPropertyKey = __webpack_require__(/*! ./toPropertyKey.js */ \"./node_modules/@babel/runtime/helpers/toPropertyKey.js\");\nfunction _defineProperty(obj, key, value) {\n key = toPropertyKey(key);\n if (key in obj) {\n Object.defineProperty(obj, key, {\n value: value,\n enumerable: true,\n configurable: true,\n writable: true\n });\n } else {\n obj[key] = value;\n }\n return obj;\n}\nmodule.exports = _defineProperty, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/defineProperty.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/negate.js": -/*!****************************************!*\ - !*** ./node_modules/gl-vec2/negate.js ***! - \****************************************/ +/***/ "./node_modules/@babel/runtime/helpers/iterableToArray.js": +/*!****************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/iterableToArray.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("module.exports = negate\n\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to negate\n * @returns {vec2} out\n */\nfunction negate(out, a) {\n out[0] = -a[0]\n out[1] = -a[1]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/negate.js?"); +eval("function _iterableToArray(iter) {\n if (typeof Symbol !== \"undefined\" && iter[Symbol.iterator] != null || iter[\"@@iterator\"] != null) return Array.from(iter);\n}\nmodule.exports = _iterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/iterableToArray.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/normalize.js": -/*!*******************************************!*\ - !*** ./node_modules/gl-vec2/normalize.js ***! - \*******************************************/ +/***/ "./node_modules/@babel/runtime/helpers/nonIterableSpread.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/nonIterableSpread.js ***! + \******************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = normalize\n\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to normalize\n * @returns {vec2} out\n */\nfunction normalize(out, a) {\n var x = a[0],\n y = a[1]\n var len = x*x + y*y\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len)\n out[0] = a[0] * len\n out[1] = a[1] * len\n }\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/normalize.js?"); +eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\nfunction _nonIterableSpread() {\n throw new TypeError(\"Invalid attempt to spread non-iterable instance.\\nIn order to be iterable, non-array objects must have a [Symbol.iterator]() method.\");\n}\nmodule.exports = _nonIterableSpread, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/nonIterableSpread.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/random.js": -/*!****************************************!*\ - !*** ./node_modules/gl-vec2/random.js ***! - \****************************************/ +/***/ "./node_modules/@babel/runtime/helpers/regeneratorRuntime.js": +/*!*******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/regeneratorRuntime.js ***! + \*******************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = random\n\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\nfunction random(out, scale) {\n scale = scale || 1.0\n var r = Math.random() * 2.0 * Math.PI\n out[0] = Math.cos(r) * scale\n out[1] = Math.sin(r) * scale\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/random.js?"); +eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\n__webpack_require__(/*! core-js/modules/es.array.push.js */ \"./node_modules/core-js/modules/es.array.push.js\");\nvar _typeof = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/typeof.js\")[\"default\"];\nfunction _regeneratorRuntime() {\n \"use strict\";\n\n /*! regenerator-runtime -- Copyright (c) 2014-present, Facebook, Inc. -- license (MIT): https://github.com/facebook/regenerator/blob/main/LICENSE */\n module.exports = _regeneratorRuntime = function _regeneratorRuntime() {\n return e;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n var t,\n e = {},\n r = Object.prototype,\n n = r.hasOwnProperty,\n o = Object.defineProperty || function (t, e, r) {\n t[e] = r.value;\n },\n i = \"function\" == typeof Symbol ? Symbol : {},\n a = i.iterator || \"@@iterator\",\n c = i.asyncIterator || \"@@asyncIterator\",\n u = i.toStringTag || \"@@toStringTag\";\n function define(t, e, r) {\n return Object.defineProperty(t, e, {\n value: r,\n enumerable: !0,\n configurable: !0,\n writable: !0\n }), t[e];\n }\n try {\n define({}, \"\");\n } catch (t) {\n define = function define(t, e, r) {\n return t[e] = r;\n };\n }\n function wrap(t, e, r, n) {\n var i = e && e.prototype instanceof Generator ? e : Generator,\n a = Object.create(i.prototype),\n c = new Context(n || []);\n return o(a, \"_invoke\", {\n value: makeInvokeMethod(t, r, c)\n }), a;\n }\n function tryCatch(t, e, r) {\n try {\n return {\n type: \"normal\",\n arg: t.call(e, r)\n };\n } catch (t) {\n return {\n type: \"throw\",\n arg: t\n };\n }\n }\n e.wrap = wrap;\n var h = \"suspendedStart\",\n l = \"suspendedYield\",\n f = \"executing\",\n s = \"completed\",\n y = {};\n function Generator() {}\n function GeneratorFunction() {}\n function GeneratorFunctionPrototype() {}\n var p = {};\n define(p, a, function () {\n return this;\n });\n var d = Object.getPrototypeOf,\n v = d && d(d(values([])));\n v && v !== r && n.call(v, a) && (p = v);\n var g = GeneratorFunctionPrototype.prototype = Generator.prototype = Object.create(p);\n function defineIteratorMethods(t) {\n [\"next\", \"throw\", \"return\"].forEach(function (e) {\n define(t, e, function (t) {\n return this._invoke(e, t);\n });\n });\n }\n function AsyncIterator(t, e) {\n function invoke(r, o, i, a) {\n var c = tryCatch(t[r], t, o);\n if (\"throw\" !== c.type) {\n var u = c.arg,\n h = u.value;\n return h && \"object\" == _typeof(h) && n.call(h, \"__await\") ? e.resolve(h.__await).then(function (t) {\n invoke(\"next\", t, i, a);\n }, function (t) {\n invoke(\"throw\", t, i, a);\n }) : e.resolve(h).then(function (t) {\n u.value = t, i(u);\n }, function (t) {\n return invoke(\"throw\", t, i, a);\n });\n }\n a(c.arg);\n }\n var r;\n o(this, \"_invoke\", {\n value: function value(t, n) {\n function callInvokeWithMethodAndArg() {\n return new e(function (e, r) {\n invoke(t, n, e, r);\n });\n }\n return r = r ? r.then(callInvokeWithMethodAndArg, callInvokeWithMethodAndArg) : callInvokeWithMethodAndArg();\n }\n });\n }\n function makeInvokeMethod(e, r, n) {\n var o = h;\n return function (i, a) {\n if (o === f) throw new Error(\"Generator is already running\");\n if (o === s) {\n if (\"throw\" === i) throw a;\n return {\n value: t,\n done: !0\n };\n }\n for (n.method = i, n.arg = a;;) {\n var c = n.delegate;\n if (c) {\n var u = maybeInvokeDelegate(c, n);\n if (u) {\n if (u === y) continue;\n return u;\n }\n }\n if (\"next\" === n.method) n.sent = n._sent = n.arg;else if (\"throw\" === n.method) {\n if (o === h) throw o = s, n.arg;\n n.dispatchException(n.arg);\n } else \"return\" === n.method && n.abrupt(\"return\", n.arg);\n o = f;\n var p = tryCatch(e, r, n);\n if (\"normal\" === p.type) {\n if (o = n.done ? s : l, p.arg === y) continue;\n return {\n value: p.arg,\n done: n.done\n };\n }\n \"throw\" === p.type && (o = s, n.method = \"throw\", n.arg = p.arg);\n }\n };\n }\n function maybeInvokeDelegate(e, r) {\n var n = r.method,\n o = e.iterator[n];\n if (o === t) return r.delegate = null, \"throw\" === n && e.iterator[\"return\"] && (r.method = \"return\", r.arg = t, maybeInvokeDelegate(e, r), \"throw\" === r.method) || \"return\" !== n && (r.method = \"throw\", r.arg = new TypeError(\"The iterator does not provide a '\" + n + \"' method\")), y;\n var i = tryCatch(o, e.iterator, r.arg);\n if (\"throw\" === i.type) return r.method = \"throw\", r.arg = i.arg, r.delegate = null, y;\n var a = i.arg;\n return a ? a.done ? (r[e.resultName] = a.value, r.next = e.nextLoc, \"return\" !== r.method && (r.method = \"next\", r.arg = t), r.delegate = null, y) : a : (r.method = \"throw\", r.arg = new TypeError(\"iterator result is not an object\"), r.delegate = null, y);\n }\n function pushTryEntry(t) {\n var e = {\n tryLoc: t[0]\n };\n 1 in t && (e.catchLoc = t[1]), 2 in t && (e.finallyLoc = t[2], e.afterLoc = t[3]), this.tryEntries.push(e);\n }\n function resetTryEntry(t) {\n var e = t.completion || {};\n e.type = \"normal\", delete e.arg, t.completion = e;\n }\n function Context(t) {\n this.tryEntries = [{\n tryLoc: \"root\"\n }], t.forEach(pushTryEntry, this), this.reset(!0);\n }\n function values(e) {\n if (e || \"\" === e) {\n var r = e[a];\n if (r) return r.call(e);\n if (\"function\" == typeof e.next) return e;\n if (!isNaN(e.length)) {\n var o = -1,\n i = function next() {\n for (; ++o < e.length;) if (n.call(e, o)) return next.value = e[o], next.done = !1, next;\n return next.value = t, next.done = !0, next;\n };\n return i.next = i;\n }\n }\n throw new TypeError(_typeof(e) + \" is not iterable\");\n }\n return GeneratorFunction.prototype = GeneratorFunctionPrototype, o(g, \"constructor\", {\n value: GeneratorFunctionPrototype,\n configurable: !0\n }), o(GeneratorFunctionPrototype, \"constructor\", {\n value: GeneratorFunction,\n configurable: !0\n }), GeneratorFunction.displayName = define(GeneratorFunctionPrototype, u, \"GeneratorFunction\"), e.isGeneratorFunction = function (t) {\n var e = \"function\" == typeof t && t.constructor;\n return !!e && (e === GeneratorFunction || \"GeneratorFunction\" === (e.displayName || e.name));\n }, e.mark = function (t) {\n return Object.setPrototypeOf ? Object.setPrototypeOf(t, GeneratorFunctionPrototype) : (t.__proto__ = GeneratorFunctionPrototype, define(t, u, \"GeneratorFunction\")), t.prototype = Object.create(g), t;\n }, e.awrap = function (t) {\n return {\n __await: t\n };\n }, defineIteratorMethods(AsyncIterator.prototype), define(AsyncIterator.prototype, c, function () {\n return this;\n }), e.AsyncIterator = AsyncIterator, e.async = function (t, r, n, o, i) {\n void 0 === i && (i = Promise);\n var a = new AsyncIterator(wrap(t, r, n, o), i);\n return e.isGeneratorFunction(r) ? a : a.next().then(function (t) {\n return t.done ? t.value : a.next();\n });\n }, defineIteratorMethods(g), define(g, u, \"Generator\"), define(g, a, function () {\n return this;\n }), define(g, \"toString\", function () {\n return \"[object Generator]\";\n }), e.keys = function (t) {\n var e = Object(t),\n r = [];\n for (var n in e) r.push(n);\n return r.reverse(), function next() {\n for (; r.length;) {\n var t = r.pop();\n if (t in e) return next.value = t, next.done = !1, next;\n }\n return next.done = !0, next;\n };\n }, e.values = values, Context.prototype = {\n constructor: Context,\n reset: function reset(e) {\n if (this.prev = 0, this.next = 0, this.sent = this._sent = t, this.done = !1, this.delegate = null, this.method = \"next\", this.arg = t, this.tryEntries.forEach(resetTryEntry), !e) for (var r in this) \"t\" === r.charAt(0) && n.call(this, r) && !isNaN(+r.slice(1)) && (this[r] = t);\n },\n stop: function stop() {\n this.done = !0;\n var t = this.tryEntries[0].completion;\n if (\"throw\" === t.type) throw t.arg;\n return this.rval;\n },\n dispatchException: function dispatchException(e) {\n if (this.done) throw e;\n var r = this;\n function handle(n, o) {\n return a.type = \"throw\", a.arg = e, r.next = n, o && (r.method = \"next\", r.arg = t), !!o;\n }\n for (var o = this.tryEntries.length - 1; o >= 0; --o) {\n var i = this.tryEntries[o],\n a = i.completion;\n if (\"root\" === i.tryLoc) return handle(\"end\");\n if (i.tryLoc <= this.prev) {\n var c = n.call(i, \"catchLoc\"),\n u = n.call(i, \"finallyLoc\");\n if (c && u) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n } else if (c) {\n if (this.prev < i.catchLoc) return handle(i.catchLoc, !0);\n } else {\n if (!u) throw new Error(\"try statement without catch or finally\");\n if (this.prev < i.finallyLoc) return handle(i.finallyLoc);\n }\n }\n }\n },\n abrupt: function abrupt(t, e) {\n for (var r = this.tryEntries.length - 1; r >= 0; --r) {\n var o = this.tryEntries[r];\n if (o.tryLoc <= this.prev && n.call(o, \"finallyLoc\") && this.prev < o.finallyLoc) {\n var i = o;\n break;\n }\n }\n i && (\"break\" === t || \"continue\" === t) && i.tryLoc <= e && e <= i.finallyLoc && (i = null);\n var a = i ? i.completion : {};\n return a.type = t, a.arg = e, i ? (this.method = \"next\", this.next = i.finallyLoc, y) : this.complete(a);\n },\n complete: function complete(t, e) {\n if (\"throw\" === t.type) throw t.arg;\n return \"break\" === t.type || \"continue\" === t.type ? this.next = t.arg : \"return\" === t.type ? (this.rval = this.arg = t.arg, this.method = \"return\", this.next = \"end\") : \"normal\" === t.type && e && (this.next = e), y;\n },\n finish: function finish(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.finallyLoc === t) return this.complete(r.completion, r.afterLoc), resetTryEntry(r), y;\n }\n },\n \"catch\": function _catch(t) {\n for (var e = this.tryEntries.length - 1; e >= 0; --e) {\n var r = this.tryEntries[e];\n if (r.tryLoc === t) {\n var n = r.completion;\n if (\"throw\" === n.type) {\n var o = n.arg;\n resetTryEntry(r);\n }\n return o;\n }\n }\n throw new Error(\"illegal catch attempt\");\n },\n delegateYield: function delegateYield(e, r, n) {\n return this.delegate = {\n iterator: values(e),\n resultName: r,\n nextLoc: n\n }, \"next\" === this.method && (this.arg = t), y;\n }\n }, e;\n}\nmodule.exports = _regeneratorRuntime, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/regeneratorRuntime.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/rotate.js": -/*!****************************************!*\ - !*** ./node_modules/gl-vec2/rotate.js ***! - \****************************************/ +/***/ "./node_modules/@babel/runtime/helpers/toConsumableArray.js": +/*!******************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/toConsumableArray.js ***! + \******************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = rotate\n\n/**\n * Rotates a vec2 by an angle\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to rotate\n * @param {Number} angle the angle of rotation (in radians)\n * @returns {vec2} out\n */\nfunction rotate(out, a, angle) {\n var c = Math.cos(angle),\n s = Math.sin(angle)\n var x = a[0],\n y = a[1]\n\n out[0] = x * c - y * s\n out[1] = x * s + y * c\n\n return out\n}\n\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/rotate.js?"); +eval("var arrayWithoutHoles = __webpack_require__(/*! ./arrayWithoutHoles.js */ \"./node_modules/@babel/runtime/helpers/arrayWithoutHoles.js\");\nvar iterableToArray = __webpack_require__(/*! ./iterableToArray.js */ \"./node_modules/@babel/runtime/helpers/iterableToArray.js\");\nvar unsupportedIterableToArray = __webpack_require__(/*! ./unsupportedIterableToArray.js */ \"./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js\");\nvar nonIterableSpread = __webpack_require__(/*! ./nonIterableSpread.js */ \"./node_modules/@babel/runtime/helpers/nonIterableSpread.js\");\nfunction _toConsumableArray(arr) {\n return arrayWithoutHoles(arr) || iterableToArray(arr) || unsupportedIterableToArray(arr) || nonIterableSpread();\n}\nmodule.exports = _toConsumableArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/toConsumableArray.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/round.js": -/*!***************************************!*\ - !*** ./node_modules/gl-vec2/round.js ***! - \***************************************/ +/***/ "./node_modules/@babel/runtime/helpers/toPrimitive.js": +/*!************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/toPrimitive.js ***! + \************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = round\n\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a vector to round\n * @returns {vec2} out\n */\nfunction round(out, a) {\n out[0] = Math.round(a[0])\n out[1] = Math.round(a[1])\n return out\n}\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/round.js?"); +eval("__webpack_require__(/*! core-js/modules/es.error.cause.js */ \"./node_modules/core-js/modules/es.error.cause.js\");\nvar _typeof = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/typeof.js\")[\"default\"];\nfunction toPrimitive(t, r) {\n if (\"object\" != _typeof(t) || !t) return t;\n var e = t[Symbol.toPrimitive];\n if (void 0 !== e) {\n var i = e.call(t, r || \"default\");\n if (\"object\" != _typeof(i)) return i;\n throw new TypeError(\"@@toPrimitive must return a primitive value.\");\n }\n return (\"string\" === r ? String : Number)(t);\n}\nmodule.exports = toPrimitive, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/toPrimitive.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/scale.js": -/*!***************************************!*\ - !*** ./node_modules/gl-vec2/scale.js ***! - \***************************************/ +/***/ "./node_modules/@babel/runtime/helpers/toPropertyKey.js": +/*!**************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/toPropertyKey.js ***! + \**************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = scale\n\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\nfunction scale(out, a, b) {\n out[0] = a[0] * b\n out[1] = a[1] * b\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/scale.js?"); +eval("var _typeof = __webpack_require__(/*! ./typeof.js */ \"./node_modules/@babel/runtime/helpers/typeof.js\")[\"default\"];\nvar toPrimitive = __webpack_require__(/*! ./toPrimitive.js */ \"./node_modules/@babel/runtime/helpers/toPrimitive.js\");\nfunction toPropertyKey(t) {\n var i = toPrimitive(t, \"string\");\n return \"symbol\" == _typeof(i) ? i : String(i);\n}\nmodule.exports = toPropertyKey, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/toPropertyKey.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/scaleAndAdd.js": -/*!*********************************************!*\ - !*** ./node_modules/gl-vec2/scaleAndAdd.js ***! - \*********************************************/ +/***/ "./node_modules/@babel/runtime/helpers/typeof.js": +/*!*******************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/typeof.js ***! + \*******************************************************/ /*! no static exports found */ /***/ (function(module, exports) { -eval("module.exports = scaleAndAdd\n\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + (b[0] * scale)\n out[1] = a[1] + (b[1] * scale)\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/scaleAndAdd.js?"); +eval("function _typeof(o) {\n \"@babel/helpers - typeof\";\n\n return (module.exports = _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (o) {\n return typeof o;\n } : function (o) {\n return o && \"function\" == typeof Symbol && o.constructor === Symbol && o !== Symbol.prototype ? \"symbol\" : typeof o;\n }, module.exports.__esModule = true, module.exports[\"default\"] = module.exports), _typeof(o);\n}\nmodule.exports = _typeof, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/typeof.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/set.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/set.js ***! - \*************************************/ +/***/ "./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js": +/*!***************************************************************************!*\ + !*** ./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js ***! + \***************************************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = set\n\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\nfunction set(out, x, y) {\n out[0] = x\n out[1] = y\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/set.js?"); +eval("var arrayLikeToArray = __webpack_require__(/*! ./arrayLikeToArray.js */ \"./node_modules/@babel/runtime/helpers/arrayLikeToArray.js\");\nfunction _unsupportedIterableToArray(o, minLen) {\n if (!o) return;\n if (typeof o === \"string\") return arrayLikeToArray(o, minLen);\n var n = Object.prototype.toString.call(o).slice(8, -1);\n if (n === \"Object\" && o.constructor) n = o.constructor.name;\n if (n === \"Map\" || n === \"Set\") return Array.from(o);\n if (n === \"Arguments\" || /^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(n)) return arrayLikeToArray(o, minLen);\n}\nmodule.exports = _unsupportedIterableToArray, module.exports.__esModule = true, module.exports[\"default\"] = module.exports;\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/helpers/unsupportedIterableToArray.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/sqrDist.js": -/*!*****************************************!*\ - !*** ./node_modules/gl-vec2/sqrDist.js ***! - \*****************************************/ +/***/ "./node_modules/@babel/runtime/regenerator/index.js": +/*!**********************************************************!*\ + !*** ./node_modules/@babel/runtime/regenerator/index.js ***! + \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./squaredDistance */ \"./node_modules/gl-vec2/squaredDistance.js\")\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/sqrDist.js?"); +eval("// TODO(Babel 8): Remove this file.\n\nvar runtime = __webpack_require__(/*! ../helpers/regeneratorRuntime */ \"./node_modules/@babel/runtime/helpers/regeneratorRuntime.js\")();\nmodule.exports = runtime;\n\n// Copied from https://github.com/facebook/regenerator/blob/main/packages/runtime/runtime.js#L736=\ntry {\n regeneratorRuntime = runtime;\n} catch (accidentalStrictMode) {\n if (typeof globalThis === \"object\") {\n globalThis.regeneratorRuntime = runtime;\n } else {\n Function(\"r\", \"regeneratorRuntime = r\")(runtime);\n }\n}\n\n//# sourceURL=webpack:///./node_modules/@babel/runtime/regenerator/index.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/sqrLen.js": -/*!****************************************!*\ - !*** ./node_modules/gl-vec2/sqrLen.js ***! - \****************************************/ +/***/ "./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js": +/*!**********************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js ***! + \**********************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./squaredLength */ \"./node_modules/gl-vec2/squaredLength.js\")\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/sqrLen.js?"); +eval("var debounce = __webpack_require__(/*! lodash.debounce */ \"./node_modules/lodash.debounce/index.js\");\nvar monacoLoader = __webpack_require__(/*! ./MonacoLoader */ \"./node_modules/vue-monaco-editor/src/MonacoLoader.js\");\nmodule.exports = {\n props: {\n width: {\n type: [String, Number],\n default: '100%'\n },\n height: {\n type: [String, Number],\n default: '100%'\n },\n code: {\n type: String,\n default: '// code \\n'\n },\n srcPath: {\n type: String\n },\n language: {\n type: String,\n default: 'javascript'\n },\n theme: {\n type: String,\n default: 'vs-dark'\n },\n // vs, hc-black\n options: {\n type: Object,\n default: () => {}\n },\n highlighted: {\n type: Array,\n default: () => [{\n number: 0,\n class: ''\n }]\n },\n changeThrottle: {\n type: Number,\n default: 0\n }\n },\n mounted() {\n this.fetchEditor();\n },\n destroyed() {\n this.destroyMonaco();\n },\n computed: {\n style() {\n const {\n width,\n height\n } = this;\n const fixedWidth = width.toString().indexOf('%') !== -1 ? width : `${width}px`;\n const fixedHeight = height.toString().indexOf('%') !== -1 ? height : `${height}px`;\n return {\n width: fixedWidth,\n height: fixedHeight\n };\n },\n editorOptions() {\n return Object.assign({}, this.defaults, this.options, {\n value: this.code,\n language: this.language,\n theme: this.theme\n });\n }\n },\n data() {\n return {\n defaults: {\n selectOnLineNumbers: true,\n roundedSelection: false,\n readOnly: false,\n cursorStyle: 'line',\n automaticLayout: false,\n glyphMargin: true\n }\n };\n },\n watch: {\n highlighted: {\n handler(lines) {\n this.highlightLines(lines);\n },\n deep: true\n }\n },\n methods: {\n highlightLines(lines) {\n if (!this.editor) {\n return;\n }\n lines.forEach(line => {\n const className = line.class;\n const highlighted = this.$el.querySelector(`.${className}`);\n if (highlighted) {\n highlighted.classList.remove(className);\n }\n const number = parseInt(line.number);\n if (!this.editor && number < 1 || isNaN(number)) {\n return;\n }\n const selectedLine = this.$el.querySelector(`.view-lines [linenumber=\"${number}\"]`);\n if (selectedLine) {\n selectedLine.classList.add(className);\n }\n });\n },\n editorHasLoaded(editor, monaco) {\n this.editor = editor;\n this.monaco = monaco;\n this.editor.onDidChangeModelContent(event => this.codeChangeHandler(editor, event));\n this.$emit('mounted', editor);\n },\n codeChangeHandler: function (editor) {\n if (this.codeChangeEmitter) {\n this.codeChangeEmitter(editor);\n } else {\n this.codeChangeEmitter = debounce(function (editor) {\n this.$emit('codeChange', editor);\n }, this.changeThrottle);\n this.codeChangeEmitter(editor);\n }\n },\n fetchEditor() {\n monacoLoader.load(this.srcPath, this.createMonaco);\n },\n createMonaco() {\n this.editor = window.monaco.editor.create(this.$el, this.editorOptions);\n this.editorHasLoaded(this.editor, window.monaco);\n },\n destroyMonaco() {\n if (typeof this.editor !== 'undefined') {\n this.editor.dispose();\n }\n }\n }\n};\n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), -/***/ "./node_modules/gl-vec2/squaredDistance.js": -/*!*************************************************!*\ - !*** ./node_modules/gl-vec2/squaredDistance.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/JSEditor.vue?vue&type=script&lang=js": +/*!********************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/JSEditor.vue?vue&type=script&lang=js ***! + \********************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = squaredDistance\n\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1]\n return x*x + y*y\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/squaredDistance.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var vue_monaco_editor__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! vue-monaco-editor */ \"./node_modules/vue-monaco-editor/index.js\");\n/* harmony import */ var vue_monaco_editor__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(vue_monaco_editor__WEBPACK_IMPORTED_MODULE_0__);\n\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: 'WorkflowEditor',\n components: {\n MonacoEditor: (vue_monaco_editor__WEBPACK_IMPORTED_MODULE_0___default())\n },\n props: ['code'],\n data() {\n return {\n /** 代码组件 */\n editor: null,\n options: {\n selectOnLineNumbers: false\n },\n randomKey: 1231231\n };\n },\n methods: {\n onMounted(editor) {\n this.editor = editor;\n },\n onCodeChange() {\n this.$emit('onCodeChange', this.editor.getValue());\n }\n }\n});\n\n//# sourceURL=webpack:///./src/components/dag/JSEditor.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), -/***/ "./node_modules/gl-vec2/squaredLength.js": -/*!***********************************************!*\ - !*** ./node_modules/gl-vec2/squaredLength.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/PowerWorkflow.vue?vue&type=script&lang=js": +/*!*************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/PowerWorkflow.vue?vue&type=script&lang=js ***! + \*************************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = squaredLength\n\n/**\n * Calculates the squared length of a vec2\n *\n * @param {vec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\nfunction squaredLength(a) {\n var x = a[0],\n y = a[1]\n return x*x + y*y\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/squaredLength.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var power_workflow__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! power-workflow */ \"./node_modules/power-workflow/index.js\");\n/* harmony import */ var power_workflow__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(power_workflow__WEBPACK_IMPORTED_MODULE_0__);\n\nconst defaultSize = {\n width: (document.body.clientWidth - 254) * 0.7,\n height: 700\n};\nconst dagSize = {\n default: {\n width: (defaultWidthInc, radio) => (document.body.clientWidth - defaultWidthInc) * radio,\n height: () => document.body.clientHeight\n },\n fiexd: {\n width: (defaultWidthInc, rightWidth) => document.body.clientWidth - defaultWidthInc - rightWidth,\n height: () => document.body.clientHeight\n }\n};\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\n name: \"PowerWorkflow\",\n data() {\n return {\n size: {\n width: document.body.clientWidth - 254,\n height: defaultSize.height\n },\n powerFlow: null,\n selectNode: null,\n zoom: 1\n };\n },\n props: [\"onClickImportNode\", \"defaultWidthInc\", \"nodes\", \"edges\", \"rightFixed\", \"fullInc\", \"mode\", \"interceptSelectedNode\", \"onClickImportSpecialNode\"],\n mounted() {\n this.size.width = this.defaultWidthInc ? document.body.clientWidth - this.defaultWidthInc : document.body.clientWidth - 254;\n this.initFlow();\n window.addEventListener(\"resize\", this.onFullScreenListener);\n },\n methods: {\n /** 初始化图 */\n initFlow() {\n // 整理节点数据\n let {\n nodes,\n edges\n } = this.makeNodes();\n const powerFlow = new power_workflow__WEBPACK_IMPORTED_MODULE_0___default.a({\n container: this.$refs.powerDag,\n width: this.size.width,\n height: this.size.height,\n initNodes: nodes,\n initEdges: edges,\n // layout: 'vertical',\n\n layout: {\n type: 'dagre',\n // align: 'UR', // 可选\n nodesep: 40,\n // 可选\n // ranksep: 60, // 可选\n rankdir: 'LR',\n controlPoints: true,\n // 可选\n ranksepFunc: node => {\n // console.log(node);\n if (node.nodeType === 2) {\n return 55;\n }\n return 60;\n }\n },\n edgeCallback: this.edgeEnd\n });\n powerFlow.graph.setMode(\"edit\");\n // powerFlow.graph.fitCenter(20);\n this.powerFlow = powerFlow;\n this.powerFlow.graph.on(\"onSelectNode\", item => {\n if (this.interceptSelectedNode && !this.interceptSelectedNode(item)) {\n this.$emit(\"onSelectedNode\", item);\n return;\n } else {\n this.selectNode = item;\n this.$emit(\"onSelectedNode\", item);\n }\n });\n this.powerFlow.graph.on(\"onClearSelectNode\", () => {\n this.selectNode = null;\n this.$emit(\"onClearSelectNode\", null);\n });\n if (this.mode) this.powerFlow.graph.setMode(this.mode);\n this.$emit(\"getDag\", powerFlow, {\n nodes,\n edges,\n resetNodes: this.resetNodes\n });\n },\n /** 重置节点 */\n resetNodes() {\n let {\n nodes,\n edges\n } = this.makeNodes();\n this.powerFlow.graph.data({\n nodes,\n edges\n });\n this.powerFlow.graph.render();\n },\n /** 判断线是否可以 */\n edgeEnd(sourceNode) {\n // console.log(sourceNode);\n // console.log(targetNode);\n // console.log(sourceNode.get('currentShape'))\n const data = this.isEdge(sourceNode);\n if (!data) return false;\n return {\n ...data\n };\n },\n /** 判断线上是否添加文字以及是否可添加线 */\n isEdge(node) {\n const nodeType = node.get('currentShape');\n if (nodeType !== 'max-diamond-node') {\n return {};\n }\n const edges = node.getOutEdges();\n if (edges.length > 1) {\n this.$message('最多只能有两条边哦');\n return false;\n }\n console.log(edges);\n if (edges.length === 0) {\n return {\n label: 'Y'\n };\n }\n const item = edges[0];\n const model = item.get('model');\n return {\n label: model.label === 'Y' ? 'N' : 'Y'\n };\n },\n /** 整理节点信息 */\n makeNodes() {\n let width = 0;\n this.nodes.forEach(item => {\n let len = item.nodeName.length * 9;\n let curtWidth = 0;\n if (len > 220) {\n curtWidth = 220;\n } else if (len < 180) {\n curtWidth = 180;\n } else {\n curtWidth = len;\n }\n if (curtWidth > width) {\n width = curtWidth;\n }\n });\n let status = {\n 3: {\n color: \"\",\n text: this.$t(\"message.running\")\n },\n 4: {\n color: \"#FFADA4\",\n text: this.$t(\"message.failed\")\n },\n 5: {\n color: \"#C3FFD2\",\n text: this.$t(\"message.success\")\n },\n 10: {\n color: \"\",\n text: this.$t(\"message.stopped\")\n },\n 9: {\n text: this.$t(\"message.canceleded\"),\n color: '#E2E2E2',\n stroke: \"#A5A5A5\"\n }\n };\n let nodes = this.nodes.map(item => {\n let statusValue = {};\n let statusStyle = {};\n if (item.nodeType === 2) {\n return {\n id: `${item.nodeId}`,\n type: \"max-diamond-node\",\n text: item.nodeName ? item.nodeName : \"判断\",\n size: [15, 80],\n style: {\n sideLength: 80,\n textStyle: {\n // fill: \"#FFFFFF\",\n }\n },\n ...item\n };\n }\n if (item.status) {\n statusValue = {\n taskStatus: status[item.status] ? status[item.status].text : this.$t(\"message.waitingUpstream\"),\n taskStatusValue: item.status\n };\n if (status[item.status] && status[item.status].color) {\n statusStyle = {\n fill: status[item.status].color\n };\n if (status[item.status].stroke) {\n statusStyle.stroke = status[item.status].stroke;\n }\n }\n }\n return {\n id: `${item.nodeId}`,\n type: item.nodeType === 1 ? \"flow-node\" : 'flow-child-node',\n size: [width, 70],\n leftText: item.jobId,\n titleText: item.nodeName,\n icon1: item.enable ? __webpack_require__(/*! ../../assets/start.svg */ \"./src/assets/start.svg\") : \"\",\n icon2: item.skipWhenFailed ? __webpack_require__(/*! ../../assets/skip.svg */ \"./src/assets/skip.svg\") : \"\",\n // taskStatus: text,\n ...statusValue,\n style: statusStyle,\n rightText: item.instanceId ? item.instanceId : null,\n ...item\n };\n });\n let edges = this.edges.map(item => {\n const property = {};\n if (item.property) {\n property.label = item.property === 'true' ? 'Y' : 'N';\n }\n return {\n source: `${item.from}`,\n target: `${item.to}`,\n type: \"cvte-polyline\",\n ...property\n };\n });\n return {\n nodes,\n edges\n };\n },\n /** 引入判断节点 */\n importJudgeNode() {\n this.onClickImportSpecialNode && this.onClickImportSpecialNode({\n type: 2\n });\n },\n /** 引入工作流节点 */\n importWorkflowNode() {\n this.onClickImportSpecialNode && this.onClickImportSpecialNode({\n type: 3\n });\n },\n /** 监控全屏 */\n onFullScreenListener() {\n let isFull = document.fullscreenElement || document.msFullscreenElement || document.mozFullScreenElement || document.webkitFullscreenElement || false;\n if (isFull === undefined) isFull = false;\n let incValue = 1;\n if (this.selectNode) {\n incValue = 0.7;\n }\n let width = 0;\n let height = 0;\n let strage = \"default\";\n if (this.rightFixed) {\n strage = \"fiexd\";\n incValue = this.rightFixed;\n if (!this.selectNode) {\n incValue = 0;\n }\n }\n if (isFull) {\n // if(!this.selectNode) {\n // width = dagSize[strage].width(this.defaultWidthInc, incValue);\n // }\n width = dagSize[strage].width(0, incValue);\n height = dagSize[strage].height();\n this.size = {\n width,\n height\n };\n this.powerFlow.graph.changeSize(this.size.width, this.size.height);\n } else {\n width = dagSize[strage].width(this.defaultWidthInc, incValue);\n height = dagSize[strage].height();\n this.size = {\n width,\n height: defaultSize.height\n };\n this.powerFlow.graph.changeSize(this.size.width, this.size.height);\n }\n },\n /** 缩小 */\n handleZoomOut() {\n let zoom = this.powerFlow.graph.getZoom();\n zoom -= 0.1;\n this.powerFlow.graph.zoomTo(zoom);\n },\n /** 放大 */\n handleZoomIn() {\n let zoom = this.powerFlow.graph.getZoom();\n zoom += 0.1;\n this.powerFlow.graph.zoomTo(zoom);\n },\n /** 自适应 */\n handleAutoFit() {\n this.powerFlow.graph.layout();\n this.powerFlow.graph.fitView(20);\n },\n /** 全屏 */\n fullScreen() {\n const el = document.getElementById(this.fullInc) || this.$refs[\"power-job\"];\n const rfs = el.requestFullScreen || el.webkitRequestFullScreen || el.mozRequestFullScreen || el.msRequestFullScreen;\n if (typeof rfs != \"undefined\" && rfs) {\n rfs.call(el);\n return;\n }\n }\n },\n watch: {\n /** 监控节点的选中 */\n selectNode() {\n this.onFullScreenListener();\n }\n }\n});\n\n//# sourceURL=webpack:///./src/components/dag/PowerWorkflow.vue?./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), -/***/ "./node_modules/gl-vec2/sub.js": -/*!*************************************!*\ - !*** ./node_modules/gl-vec2/sub.js ***! - \*************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"77823dab-vue-loader-template\"}!./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30": +/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"77823dab-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30 ***! + \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = __webpack_require__(/*! ./subtract */ \"./node_modules/gl-vec2/subtract.js\")\n\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/sub.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c,\n _setup = _vm._self._setupProxy;\n return _c(\"div\", {\n style: _vm.style\n });\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%2277823dab-vue-loader-template%22%7D!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), -/***/ "./node_modules/gl-vec2/subtract.js": -/*!******************************************!*\ - !*** ./node_modules/gl-vec2/subtract.js ***! - \******************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"77823dab-vue-loader-template\"}!./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/JSEditor.vue?vue&type=template&id=123e60ea": +/*!***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"77823dab-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/JSEditor.vue?vue&type=template&id=123e60ea ***! + \***************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = subtract\n\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the first operand\n * @param {vec2} b the second operand\n * @returns {vec2} out\n */\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0]\n out[1] = a[1] - b[1]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/subtract.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n staticClass: \"code-edit\"\n }, [_c(\"MonacoEditor\", {\n key: _vm.randomKey,\n attrs: {\n code: _vm.code,\n theme: \"vs\",\n height: 300,\n options: _vm.options\n },\n on: {\n mounted: _vm.onMounted,\n codeChange: _vm.onCodeChange\n }\n })], 1);\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack:///./src/components/dag/JSEditor.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%2277823dab-vue-loader-template%22%7D!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), -/***/ "./node_modules/gl-vec2/transformMat2.js": -/*!***********************************************!*\ - !*** ./node_modules/gl-vec2/transformMat2.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { +/***/ "./node_modules/cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"77823dab-vue-loader-template\"}!./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/PowerWorkflow.vue?vue&type=template&id=1175569f&scoped=true": +/*!********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/cache-loader/dist/cjs.js?{"cacheDirectory":"node_modules/.cache/vue-loader","cacheIdentifier":"77823dab-vue-loader-template"}!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/PowerWorkflow.vue?vue&type=template&id=1175569f&scoped=true ***! + \********************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/*! exports provided: render, staticRenderFns */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("module.exports = transformMat2\n\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat2} m matrix to transform with\n * @returns {vec2} out\n */\nfunction transformMat2(out, a, m) {\n var x = a[0],\n y = a[1]\n out[0] = m[0] * x + m[2] * y\n out[1] = m[1] * x + m[3] * y\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/transformMat2.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return render; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return staticRenderFns; });\nvar render = function render() {\n var _vm = this,\n _c = _vm._self._c;\n return _c(\"div\", {\n ref: \"power-job\",\n staticClass: \"power-job\"\n }, [_c(\"div\", {\n staticClass: \"power-job-header\"\n }, [_c(\"div\", {\n staticClass: \"job-tools\"\n }, [_vm.onClickImportNode ? _c(\"div\", {\n on: {\n click: _vm.onClickImportNode\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.importJob\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-document-add\"\n })])], 1) : _vm._e(), _vm.mode !== \"view\" ? _c(\"div\", {\n on: {\n click: _vm.importJudgeNode\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.condition\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"iconfont icon-panduanti\"\n })])], 1) : _vm._e(), _vm.mode !== \"view\" ? _c(\"div\", {\n on: {\n click: _vm.importWorkflowNode\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.workflowChild\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"iconfont icon-workflow_\"\n })])], 1) : _vm._e(), _vm._t(\"tool\"), _c(\"div\", {\n on: {\n click: _vm.handleZoomOut\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.zoomOut\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-zoom-out\"\n })])], 1), _c(\"div\", {\n on: {\n click: _vm.handleZoomIn\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.zoomIn\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-zoom-in\"\n })])], 1), _c(\"div\", {\n on: {\n click: _vm.handleAutoFit\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.autoFit\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-aim\"\n })])], 1), _c(\"div\", {\n on: {\n click: _vm.fullScreen\n }\n }, [_c(\"el-tooltip\", {\n attrs: {\n content: _vm.$t(\"message.fullScreen\"),\n placement: \"top\",\n effect: \"light\"\n }\n }, [_c(\"i\", {\n staticClass: \"el-icon-full-screen\"\n })])], 1)], 2)]), _c(\"div\", {\n staticClass: \"power-job-body\"\n }, [_c(\"div\", {\n ref: \"powerDag\",\n staticClass: \"power-power-flow\",\n style: {\n width: `${_vm.size.width}px`\n }\n }), _vm.selectNode !== null ? _c(\"div\", {\n staticClass: \"power-job-detail\"\n }, [_vm._t(\"default\")], 2) : _vm._e()])]);\n};\nvar staticRenderFns = [];\nrender._withStripped = true;\n\n\n//# sourceURL=webpack:///./src/components/dag/PowerWorkflow.vue?./node_modules/cache-loader/dist/cjs.js?%7B%22cacheDirectory%22:%22node_modules/.cache/vue-loader%22,%22cacheIdentifier%22:%2277823dab-vue-loader-template%22%7D!./node_modules/cache-loader/dist/cjs.js??ref--12-0!./node_modules/babel-loader/lib!./node_modules/vue-loader/lib/loaders/templateLoader.js??ref--6!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), -/***/ "./node_modules/gl-vec2/transformMat2d.js": -/*!************************************************!*\ - !*** ./node_modules/gl-vec2/transformMat2d.js ***! - \************************************************/ +/***/ "./node_modules/color-convert/conversions.js": +/*!***************************************************!*\ + !*** ./node_modules/color-convert/conversions.js ***! + \***************************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = transformMat2d\n\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat2d} m matrix to transform with\n * @returns {vec2} out\n */\nfunction transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1]\n out[0] = m[0] * x + m[2] * y + m[4]\n out[1] = m[1] * x + m[3] * y + m[5]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/transformMat2d.js?"); +eval("/* MIT license */\nvar cssKeywords = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\n\n// NOTE: conversions should only return primitive values (i.e. arrays, or\n// values that give correct `typeof` results).\n// do not use box values types (i.e. Number(), String(), etc.)\n\nvar reverseKeywords = {};\nfor (var key in cssKeywords) {\n\tif (cssKeywords.hasOwnProperty(key)) {\n\t\treverseKeywords[cssKeywords[key]] = key;\n\t}\n}\n\nvar convert = module.exports = {\n\trgb: {channels: 3, labels: 'rgb'},\n\thsl: {channels: 3, labels: 'hsl'},\n\thsv: {channels: 3, labels: 'hsv'},\n\thwb: {channels: 3, labels: 'hwb'},\n\tcmyk: {channels: 4, labels: 'cmyk'},\n\txyz: {channels: 3, labels: 'xyz'},\n\tlab: {channels: 3, labels: 'lab'},\n\tlch: {channels: 3, labels: 'lch'},\n\thex: {channels: 1, labels: ['hex']},\n\tkeyword: {channels: 1, labels: ['keyword']},\n\tansi16: {channels: 1, labels: ['ansi16']},\n\tansi256: {channels: 1, labels: ['ansi256']},\n\thcg: {channels: 3, labels: ['h', 'c', 'g']},\n\tapple: {channels: 3, labels: ['r16', 'g16', 'b16']},\n\tgray: {channels: 1, labels: ['gray']}\n};\n\n// hide .channels and .labels properties\nfor (var model in convert) {\n\tif (convert.hasOwnProperty(model)) {\n\t\tif (!('channels' in convert[model])) {\n\t\t\tthrow new Error('missing channels property: ' + model);\n\t\t}\n\n\t\tif (!('labels' in convert[model])) {\n\t\t\tthrow new Error('missing channel labels property: ' + model);\n\t\t}\n\n\t\tif (convert[model].labels.length !== convert[model].channels) {\n\t\t\tthrow new Error('channel and label counts mismatch: ' + model);\n\t\t}\n\n\t\tvar channels = convert[model].channels;\n\t\tvar labels = convert[model].labels;\n\t\tdelete convert[model].channels;\n\t\tdelete convert[model].labels;\n\t\tObject.defineProperty(convert[model], 'channels', {value: channels});\n\t\tObject.defineProperty(convert[model], 'labels', {value: labels});\n\t}\n}\n\nconvert.rgb.hsl = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar min = Math.min(r, g, b);\n\tvar max = Math.max(r, g, b);\n\tvar delta = max - min;\n\tvar h;\n\tvar s;\n\tvar l;\n\n\tif (max === min) {\n\t\th = 0;\n\t} else if (r === max) {\n\t\th = (g - b) / delta;\n\t} else if (g === max) {\n\t\th = 2 + (b - r) / delta;\n\t} else if (b === max) {\n\t\th = 4 + (r - g) / delta;\n\t}\n\n\th = Math.min(h * 60, 360);\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tl = (min + max) / 2;\n\n\tif (max === min) {\n\t\ts = 0;\n\t} else if (l <= 0.5) {\n\t\ts = delta / (max + min);\n\t} else {\n\t\ts = delta / (2 - max - min);\n\t}\n\n\treturn [h, s * 100, l * 100];\n};\n\nconvert.rgb.hsv = function (rgb) {\n\tvar rdif;\n\tvar gdif;\n\tvar bdif;\n\tvar h;\n\tvar s;\n\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar v = Math.max(r, g, b);\n\tvar diff = v - Math.min(r, g, b);\n\tvar diffc = function (c) {\n\t\treturn (v - c) / 6 / diff + 1 / 2;\n\t};\n\n\tif (diff === 0) {\n\t\th = s = 0;\n\t} else {\n\t\ts = diff / v;\n\t\trdif = diffc(r);\n\t\tgdif = diffc(g);\n\t\tbdif = diffc(b);\n\n\t\tif (r === v) {\n\t\t\th = bdif - gdif;\n\t\t} else if (g === v) {\n\t\t\th = (1 / 3) + rdif - bdif;\n\t\t} else if (b === v) {\n\t\t\th = (2 / 3) + gdif - rdif;\n\t\t}\n\t\tif (h < 0) {\n\t\t\th += 1;\n\t\t} else if (h > 1) {\n\t\t\th -= 1;\n\t\t}\n\t}\n\n\treturn [\n\t\th * 360,\n\t\ts * 100,\n\t\tv * 100\n\t];\n};\n\nconvert.rgb.hwb = function (rgb) {\n\tvar r = rgb[0];\n\tvar g = rgb[1];\n\tvar b = rgb[2];\n\tvar h = convert.rgb.hsl(rgb)[0];\n\tvar w = 1 / 255 * Math.min(r, Math.min(g, b));\n\n\tb = 1 - 1 / 255 * Math.max(r, Math.max(g, b));\n\n\treturn [h, w * 100, b * 100];\n};\n\nconvert.rgb.cmyk = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar c;\n\tvar m;\n\tvar y;\n\tvar k;\n\n\tk = Math.min(1 - r, 1 - g, 1 - b);\n\tc = (1 - r - k) / (1 - k) || 0;\n\tm = (1 - g - k) / (1 - k) || 0;\n\ty = (1 - b - k) / (1 - k) || 0;\n\n\treturn [c * 100, m * 100, y * 100, k * 100];\n};\n\n/**\n * See https://en.m.wikipedia.org/wiki/Euclidean_distance#Squared_Euclidean_distance\n * */\nfunction comparativeDistance(x, y) {\n\treturn (\n\t\tMath.pow(x[0] - y[0], 2) +\n\t\tMath.pow(x[1] - y[1], 2) +\n\t\tMath.pow(x[2] - y[2], 2)\n\t);\n}\n\nconvert.rgb.keyword = function (rgb) {\n\tvar reversed = reverseKeywords[rgb];\n\tif (reversed) {\n\t\treturn reversed;\n\t}\n\n\tvar currentClosestDistance = Infinity;\n\tvar currentClosestKeyword;\n\n\tfor (var keyword in cssKeywords) {\n\t\tif (cssKeywords.hasOwnProperty(keyword)) {\n\t\t\tvar value = cssKeywords[keyword];\n\n\t\t\t// Compute comparative distance\n\t\t\tvar distance = comparativeDistance(rgb, value);\n\n\t\t\t// Check if its less, if so set as closest\n\t\t\tif (distance < currentClosestDistance) {\n\t\t\t\tcurrentClosestDistance = distance;\n\t\t\t\tcurrentClosestKeyword = keyword;\n\t\t\t}\n\t\t}\n\t}\n\n\treturn currentClosestKeyword;\n};\n\nconvert.keyword.rgb = function (keyword) {\n\treturn cssKeywords[keyword];\n};\n\nconvert.rgb.xyz = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\n\t// assume sRGB\n\tr = r > 0.04045 ? Math.pow(((r + 0.055) / 1.055), 2.4) : (r / 12.92);\n\tg = g > 0.04045 ? Math.pow(((g + 0.055) / 1.055), 2.4) : (g / 12.92);\n\tb = b > 0.04045 ? Math.pow(((b + 0.055) / 1.055), 2.4) : (b / 12.92);\n\n\tvar x = (r * 0.4124) + (g * 0.3576) + (b * 0.1805);\n\tvar y = (r * 0.2126) + (g * 0.7152) + (b * 0.0722);\n\tvar z = (r * 0.0193) + (g * 0.1192) + (b * 0.9505);\n\n\treturn [x * 100, y * 100, z * 100];\n};\n\nconvert.rgb.lab = function (rgb) {\n\tvar xyz = convert.rgb.xyz(rgb);\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.hsl.rgb = function (hsl) {\n\tvar h = hsl[0] / 360;\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar t1;\n\tvar t2;\n\tvar t3;\n\tvar rgb;\n\tvar val;\n\n\tif (s === 0) {\n\t\tval = l * 255;\n\t\treturn [val, val, val];\n\t}\n\n\tif (l < 0.5) {\n\t\tt2 = l * (1 + s);\n\t} else {\n\t\tt2 = l + s - l * s;\n\t}\n\n\tt1 = 2 * l - t2;\n\n\trgb = [0, 0, 0];\n\tfor (var i = 0; i < 3; i++) {\n\t\tt3 = h + 1 / 3 * -(i - 1);\n\t\tif (t3 < 0) {\n\t\t\tt3++;\n\t\t}\n\t\tif (t3 > 1) {\n\t\t\tt3--;\n\t\t}\n\n\t\tif (6 * t3 < 1) {\n\t\t\tval = t1 + (t2 - t1) * 6 * t3;\n\t\t} else if (2 * t3 < 1) {\n\t\t\tval = t2;\n\t\t} else if (3 * t3 < 2) {\n\t\t\tval = t1 + (t2 - t1) * (2 / 3 - t3) * 6;\n\t\t} else {\n\t\t\tval = t1;\n\t\t}\n\n\t\trgb[i] = val * 255;\n\t}\n\n\treturn rgb;\n};\n\nconvert.hsl.hsv = function (hsl) {\n\tvar h = hsl[0];\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar smin = s;\n\tvar lmin = Math.max(l, 0.01);\n\tvar sv;\n\tvar v;\n\n\tl *= 2;\n\ts *= (l <= 1) ? l : 2 - l;\n\tsmin *= lmin <= 1 ? lmin : 2 - lmin;\n\tv = (l + s) / 2;\n\tsv = l === 0 ? (2 * smin) / (lmin + smin) : (2 * s) / (l + s);\n\n\treturn [h, sv * 100, v * 100];\n};\n\nconvert.hsv.rgb = function (hsv) {\n\tvar h = hsv[0] / 60;\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar hi = Math.floor(h) % 6;\n\n\tvar f = h - Math.floor(h);\n\tvar p = 255 * v * (1 - s);\n\tvar q = 255 * v * (1 - (s * f));\n\tvar t = 255 * v * (1 - (s * (1 - f)));\n\tv *= 255;\n\n\tswitch (hi) {\n\t\tcase 0:\n\t\t\treturn [v, t, p];\n\t\tcase 1:\n\t\t\treturn [q, v, p];\n\t\tcase 2:\n\t\t\treturn [p, v, t];\n\t\tcase 3:\n\t\t\treturn [p, q, v];\n\t\tcase 4:\n\t\t\treturn [t, p, v];\n\t\tcase 5:\n\t\t\treturn [v, p, q];\n\t}\n};\n\nconvert.hsv.hsl = function (hsv) {\n\tvar h = hsv[0];\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\tvar vmin = Math.max(v, 0.01);\n\tvar lmin;\n\tvar sl;\n\tvar l;\n\n\tl = (2 - s) * v;\n\tlmin = (2 - s) * vmin;\n\tsl = s * vmin;\n\tsl /= (lmin <= 1) ? lmin : 2 - lmin;\n\tsl = sl || 0;\n\tl /= 2;\n\n\treturn [h, sl * 100, l * 100];\n};\n\n// http://dev.w3.org/csswg/css-color/#hwb-to-rgb\nconvert.hwb.rgb = function (hwb) {\n\tvar h = hwb[0] / 360;\n\tvar wh = hwb[1] / 100;\n\tvar bl = hwb[2] / 100;\n\tvar ratio = wh + bl;\n\tvar i;\n\tvar v;\n\tvar f;\n\tvar n;\n\n\t// wh + bl cant be > 1\n\tif (ratio > 1) {\n\t\twh /= ratio;\n\t\tbl /= ratio;\n\t}\n\n\ti = Math.floor(6 * h);\n\tv = 1 - bl;\n\tf = 6 * h - i;\n\n\tif ((i & 0x01) !== 0) {\n\t\tf = 1 - f;\n\t}\n\n\tn = wh + f * (v - wh); // linear interpolation\n\n\tvar r;\n\tvar g;\n\tvar b;\n\tswitch (i) {\n\t\tdefault:\n\t\tcase 6:\n\t\tcase 0: r = v; g = n; b = wh; break;\n\t\tcase 1: r = n; g = v; b = wh; break;\n\t\tcase 2: r = wh; g = v; b = n; break;\n\t\tcase 3: r = wh; g = n; b = v; break;\n\t\tcase 4: r = n; g = wh; b = v; break;\n\t\tcase 5: r = v; g = wh; b = n; break;\n\t}\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.cmyk.rgb = function (cmyk) {\n\tvar c = cmyk[0] / 100;\n\tvar m = cmyk[1] / 100;\n\tvar y = cmyk[2] / 100;\n\tvar k = cmyk[3] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = 1 - Math.min(1, c * (1 - k) + k);\n\tg = 1 - Math.min(1, m * (1 - k) + k);\n\tb = 1 - Math.min(1, y * (1 - k) + k);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.rgb = function (xyz) {\n\tvar x = xyz[0] / 100;\n\tvar y = xyz[1] / 100;\n\tvar z = xyz[2] / 100;\n\tvar r;\n\tvar g;\n\tvar b;\n\n\tr = (x * 3.2406) + (y * -1.5372) + (z * -0.4986);\n\tg = (x * -0.9689) + (y * 1.8758) + (z * 0.0415);\n\tb = (x * 0.0557) + (y * -0.2040) + (z * 1.0570);\n\n\t// assume sRGB\n\tr = r > 0.0031308\n\t\t? ((1.055 * Math.pow(r, 1.0 / 2.4)) - 0.055)\n\t\t: r * 12.92;\n\n\tg = g > 0.0031308\n\t\t? ((1.055 * Math.pow(g, 1.0 / 2.4)) - 0.055)\n\t\t: g * 12.92;\n\n\tb = b > 0.0031308\n\t\t? ((1.055 * Math.pow(b, 1.0 / 2.4)) - 0.055)\n\t\t: b * 12.92;\n\n\tr = Math.min(Math.max(0, r), 1);\n\tg = Math.min(Math.max(0, g), 1);\n\tb = Math.min(Math.max(0, b), 1);\n\n\treturn [r * 255, g * 255, b * 255];\n};\n\nconvert.xyz.lab = function (xyz) {\n\tvar x = xyz[0];\n\tvar y = xyz[1];\n\tvar z = xyz[2];\n\tvar l;\n\tvar a;\n\tvar b;\n\n\tx /= 95.047;\n\ty /= 100;\n\tz /= 108.883;\n\n\tx = x > 0.008856 ? Math.pow(x, 1 / 3) : (7.787 * x) + (16 / 116);\n\ty = y > 0.008856 ? Math.pow(y, 1 / 3) : (7.787 * y) + (16 / 116);\n\tz = z > 0.008856 ? Math.pow(z, 1 / 3) : (7.787 * z) + (16 / 116);\n\n\tl = (116 * y) - 16;\n\ta = 500 * (x - y);\n\tb = 200 * (y - z);\n\n\treturn [l, a, b];\n};\n\nconvert.lab.xyz = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar x;\n\tvar y;\n\tvar z;\n\n\ty = (l + 16) / 116;\n\tx = a / 500 + y;\n\tz = y - b / 200;\n\n\tvar y2 = Math.pow(y, 3);\n\tvar x2 = Math.pow(x, 3);\n\tvar z2 = Math.pow(z, 3);\n\ty = y2 > 0.008856 ? y2 : (y - 16 / 116) / 7.787;\n\tx = x2 > 0.008856 ? x2 : (x - 16 / 116) / 7.787;\n\tz = z2 > 0.008856 ? z2 : (z - 16 / 116) / 7.787;\n\n\tx *= 95.047;\n\ty *= 100;\n\tz *= 108.883;\n\n\treturn [x, y, z];\n};\n\nconvert.lab.lch = function (lab) {\n\tvar l = lab[0];\n\tvar a = lab[1];\n\tvar b = lab[2];\n\tvar hr;\n\tvar h;\n\tvar c;\n\n\thr = Math.atan2(b, a);\n\th = hr * 360 / 2 / Math.PI;\n\n\tif (h < 0) {\n\t\th += 360;\n\t}\n\n\tc = Math.sqrt(a * a + b * b);\n\n\treturn [l, c, h];\n};\n\nconvert.lch.lab = function (lch) {\n\tvar l = lch[0];\n\tvar c = lch[1];\n\tvar h = lch[2];\n\tvar a;\n\tvar b;\n\tvar hr;\n\n\thr = h / 360 * 2 * Math.PI;\n\ta = c * Math.cos(hr);\n\tb = c * Math.sin(hr);\n\n\treturn [l, a, b];\n};\n\nconvert.rgb.ansi16 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\tvar value = 1 in arguments ? arguments[1] : convert.rgb.hsv(args)[2]; // hsv -> ansi16 optimization\n\n\tvalue = Math.round(value / 50);\n\n\tif (value === 0) {\n\t\treturn 30;\n\t}\n\n\tvar ansi = 30\n\t\t+ ((Math.round(b / 255) << 2)\n\t\t| (Math.round(g / 255) << 1)\n\t\t| Math.round(r / 255));\n\n\tif (value === 2) {\n\t\tansi += 60;\n\t}\n\n\treturn ansi;\n};\n\nconvert.hsv.ansi16 = function (args) {\n\t// optimization here; we already know the value and don't need to get\n\t// it converted for us.\n\treturn convert.rgb.ansi16(convert.hsv.rgb(args), args[2]);\n};\n\nconvert.rgb.ansi256 = function (args) {\n\tvar r = args[0];\n\tvar g = args[1];\n\tvar b = args[2];\n\n\t// we use the extended greyscale palette here, with the exception of\n\t// black and white. normal palette only has 4 greyscale shades.\n\tif (r === g && g === b) {\n\t\tif (r < 8) {\n\t\t\treturn 16;\n\t\t}\n\n\t\tif (r > 248) {\n\t\t\treturn 231;\n\t\t}\n\n\t\treturn Math.round(((r - 8) / 247) * 24) + 232;\n\t}\n\n\tvar ansi = 16\n\t\t+ (36 * Math.round(r / 255 * 5))\n\t\t+ (6 * Math.round(g / 255 * 5))\n\t\t+ Math.round(b / 255 * 5);\n\n\treturn ansi;\n};\n\nconvert.ansi16.rgb = function (args) {\n\tvar color = args % 10;\n\n\t// handle greyscale\n\tif (color === 0 || color === 7) {\n\t\tif (args > 50) {\n\t\t\tcolor += 3.5;\n\t\t}\n\n\t\tcolor = color / 10.5 * 255;\n\n\t\treturn [color, color, color];\n\t}\n\n\tvar mult = (~~(args > 50) + 1) * 0.5;\n\tvar r = ((color & 1) * mult) * 255;\n\tvar g = (((color >> 1) & 1) * mult) * 255;\n\tvar b = (((color >> 2) & 1) * mult) * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.ansi256.rgb = function (args) {\n\t// handle greyscale\n\tif (args >= 232) {\n\t\tvar c = (args - 232) * 10 + 8;\n\t\treturn [c, c, c];\n\t}\n\n\targs -= 16;\n\n\tvar rem;\n\tvar r = Math.floor(args / 36) / 5 * 255;\n\tvar g = Math.floor((rem = args % 36) / 6) / 5 * 255;\n\tvar b = (rem % 6) / 5 * 255;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hex = function (args) {\n\tvar integer = ((Math.round(args[0]) & 0xFF) << 16)\n\t\t+ ((Math.round(args[1]) & 0xFF) << 8)\n\t\t+ (Math.round(args[2]) & 0xFF);\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.hex.rgb = function (args) {\n\tvar match = args.toString(16).match(/[a-f0-9]{6}|[a-f0-9]{3}/i);\n\tif (!match) {\n\t\treturn [0, 0, 0];\n\t}\n\n\tvar colorString = match[0];\n\n\tif (match[0].length === 3) {\n\t\tcolorString = colorString.split('').map(function (char) {\n\t\t\treturn char + char;\n\t\t}).join('');\n\t}\n\n\tvar integer = parseInt(colorString, 16);\n\tvar r = (integer >> 16) & 0xFF;\n\tvar g = (integer >> 8) & 0xFF;\n\tvar b = integer & 0xFF;\n\n\treturn [r, g, b];\n};\n\nconvert.rgb.hcg = function (rgb) {\n\tvar r = rgb[0] / 255;\n\tvar g = rgb[1] / 255;\n\tvar b = rgb[2] / 255;\n\tvar max = Math.max(Math.max(r, g), b);\n\tvar min = Math.min(Math.min(r, g), b);\n\tvar chroma = (max - min);\n\tvar grayscale;\n\tvar hue;\n\n\tif (chroma < 1) {\n\t\tgrayscale = min / (1 - chroma);\n\t} else {\n\t\tgrayscale = 0;\n\t}\n\n\tif (chroma <= 0) {\n\t\thue = 0;\n\t} else\n\tif (max === r) {\n\t\thue = ((g - b) / chroma) % 6;\n\t} else\n\tif (max === g) {\n\t\thue = 2 + (b - r) / chroma;\n\t} else {\n\t\thue = 4 + (r - g) / chroma + 4;\n\t}\n\n\thue /= 6;\n\thue %= 1;\n\n\treturn [hue * 360, chroma * 100, grayscale * 100];\n};\n\nconvert.hsl.hcg = function (hsl) {\n\tvar s = hsl[1] / 100;\n\tvar l = hsl[2] / 100;\n\tvar c = 1;\n\tvar f = 0;\n\n\tif (l < 0.5) {\n\t\tc = 2.0 * s * l;\n\t} else {\n\t\tc = 2.0 * s * (1.0 - l);\n\t}\n\n\tif (c < 1.0) {\n\t\tf = (l - 0.5 * c) / (1.0 - c);\n\t}\n\n\treturn [hsl[0], c * 100, f * 100];\n};\n\nconvert.hsv.hcg = function (hsv) {\n\tvar s = hsv[1] / 100;\n\tvar v = hsv[2] / 100;\n\n\tvar c = s * v;\n\tvar f = 0;\n\n\tif (c < 1.0) {\n\t\tf = (v - c) / (1 - c);\n\t}\n\n\treturn [hsv[0], c * 100, f * 100];\n};\n\nconvert.hcg.rgb = function (hcg) {\n\tvar h = hcg[0] / 360;\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tif (c === 0.0) {\n\t\treturn [g * 255, g * 255, g * 255];\n\t}\n\n\tvar pure = [0, 0, 0];\n\tvar hi = (h % 1) * 6;\n\tvar v = hi % 1;\n\tvar w = 1 - v;\n\tvar mg = 0;\n\n\tswitch (Math.floor(hi)) {\n\t\tcase 0:\n\t\t\tpure[0] = 1; pure[1] = v; pure[2] = 0; break;\n\t\tcase 1:\n\t\t\tpure[0] = w; pure[1] = 1; pure[2] = 0; break;\n\t\tcase 2:\n\t\t\tpure[0] = 0; pure[1] = 1; pure[2] = v; break;\n\t\tcase 3:\n\t\t\tpure[0] = 0; pure[1] = w; pure[2] = 1; break;\n\t\tcase 4:\n\t\t\tpure[0] = v; pure[1] = 0; pure[2] = 1; break;\n\t\tdefault:\n\t\t\tpure[0] = 1; pure[1] = 0; pure[2] = w;\n\t}\n\n\tmg = (1.0 - c) * g;\n\n\treturn [\n\t\t(c * pure[0] + mg) * 255,\n\t\t(c * pure[1] + mg) * 255,\n\t\t(c * pure[2] + mg) * 255\n\t];\n};\n\nconvert.hcg.hsv = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar v = c + g * (1.0 - c);\n\tvar f = 0;\n\n\tif (v > 0.0) {\n\t\tf = c / v;\n\t}\n\n\treturn [hcg[0], f * 100, v * 100];\n};\n\nconvert.hcg.hsl = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\n\tvar l = g * (1.0 - c) + 0.5 * c;\n\tvar s = 0;\n\n\tif (l > 0.0 && l < 0.5) {\n\t\ts = c / (2 * l);\n\t} else\n\tif (l >= 0.5 && l < 1.0) {\n\t\ts = c / (2 * (1 - l));\n\t}\n\n\treturn [hcg[0], s * 100, l * 100];\n};\n\nconvert.hcg.hwb = function (hcg) {\n\tvar c = hcg[1] / 100;\n\tvar g = hcg[2] / 100;\n\tvar v = c + g * (1.0 - c);\n\treturn [hcg[0], (v - c) * 100, (1 - v) * 100];\n};\n\nconvert.hwb.hcg = function (hwb) {\n\tvar w = hwb[1] / 100;\n\tvar b = hwb[2] / 100;\n\tvar v = 1 - b;\n\tvar c = v - w;\n\tvar g = 0;\n\n\tif (c < 1) {\n\t\tg = (v - c) / (1 - c);\n\t}\n\n\treturn [hwb[0], c * 100, g * 100];\n};\n\nconvert.apple.rgb = function (apple) {\n\treturn [(apple[0] / 65535) * 255, (apple[1] / 65535) * 255, (apple[2] / 65535) * 255];\n};\n\nconvert.rgb.apple = function (rgb) {\n\treturn [(rgb[0] / 255) * 65535, (rgb[1] / 255) * 65535, (rgb[2] / 255) * 65535];\n};\n\nconvert.gray.rgb = function (args) {\n\treturn [args[0] / 100 * 255, args[0] / 100 * 255, args[0] / 100 * 255];\n};\n\nconvert.gray.hsl = convert.gray.hsv = function (args) {\n\treturn [0, 0, args[0]];\n};\n\nconvert.gray.hwb = function (gray) {\n\treturn [0, 100, gray[0]];\n};\n\nconvert.gray.cmyk = function (gray) {\n\treturn [0, 0, 0, gray[0]];\n};\n\nconvert.gray.lab = function (gray) {\n\treturn [gray[0], 0, 0];\n};\n\nconvert.gray.hex = function (gray) {\n\tvar val = Math.round(gray[0] / 100 * 255) & 0xFF;\n\tvar integer = (val << 16) + (val << 8) + val;\n\n\tvar string = integer.toString(16).toUpperCase();\n\treturn '000000'.substring(string.length) + string;\n};\n\nconvert.rgb.gray = function (rgb) {\n\tvar val = (rgb[0] + rgb[1] + rgb[2]) / 3;\n\treturn [val / 255 * 100];\n};\n\n\n//# sourceURL=webpack:///./node_modules/color-convert/conversions.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/transformMat3.js": -/*!***********************************************!*\ - !*** ./node_modules/gl-vec2/transformMat3.js ***! - \***********************************************/ +/***/ "./node_modules/color-convert/index.js": +/*!*********************************************!*\ + !*** ./node_modules/color-convert/index.js ***! + \*********************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = transformMat3\n\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat3} m matrix to transform with\n * @returns {vec2} out\n */\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1]\n out[0] = m[0] * x + m[3] * y + m[6]\n out[1] = m[1] * x + m[4] * y + m[7]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/transformMat3.js?"); +eval("var conversions = __webpack_require__(/*! ./conversions */ \"./node_modules/color-convert/conversions.js\");\nvar route = __webpack_require__(/*! ./route */ \"./node_modules/color-convert/route.js\");\n\nvar convert = {};\n\nvar models = Object.keys(conversions);\n\nfunction wrapRaw(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\treturn fn(args);\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nfunction wrapRounded(fn) {\n\tvar wrappedFn = function (args) {\n\t\tif (args === undefined || args === null) {\n\t\t\treturn args;\n\t\t}\n\n\t\tif (arguments.length > 1) {\n\t\t\targs = Array.prototype.slice.call(arguments);\n\t\t}\n\n\t\tvar result = fn(args);\n\n\t\t// we're assuming the result is an array here.\n\t\t// see notice in conversions.js; don't use box types\n\t\t// in conversion functions.\n\t\tif (typeof result === 'object') {\n\t\t\tfor (var len = result.length, i = 0; i < len; i++) {\n\t\t\t\tresult[i] = Math.round(result[i]);\n\t\t\t}\n\t\t}\n\n\t\treturn result;\n\t};\n\n\t// preserve .conversion property if there is one\n\tif ('conversion' in fn) {\n\t\twrappedFn.conversion = fn.conversion;\n\t}\n\n\treturn wrappedFn;\n}\n\nmodels.forEach(function (fromModel) {\n\tconvert[fromModel] = {};\n\n\tObject.defineProperty(convert[fromModel], 'channels', {value: conversions[fromModel].channels});\n\tObject.defineProperty(convert[fromModel], 'labels', {value: conversions[fromModel].labels});\n\n\tvar routes = route(fromModel);\n\tvar routeModels = Object.keys(routes);\n\n\trouteModels.forEach(function (toModel) {\n\t\tvar fn = routes[toModel];\n\n\t\tconvert[fromModel][toModel] = wrapRounded(fn);\n\t\tconvert[fromModel][toModel].raw = wrapRaw(fn);\n\t});\n});\n\nmodule.exports = convert;\n\n\n//# sourceURL=webpack:///./node_modules/color-convert/index.js?"); /***/ }), -/***/ "./node_modules/gl-vec2/transformMat4.js": -/*!***********************************************!*\ - !*** ./node_modules/gl-vec2/transformMat4.js ***! - \***********************************************/ +/***/ "./node_modules/color-convert/route.js": +/*!*********************************************!*\ + !*** ./node_modules/color-convert/route.js ***! + \*********************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("module.exports = transformMat4\n\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {vec2} a the vector to transform\n * @param {mat4} m matrix to transform with\n * @returns {vec2} out\n */\nfunction transformMat4(out, a, m) {\n var x = a[0], \n y = a[1]\n out[0] = m[0] * x + m[4] * y + m[12]\n out[1] = m[1] * x + m[5] * y + m[13]\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/gl-vec2/transformMat4.js?"); +eval("var conversions = __webpack_require__(/*! ./conversions */ \"./node_modules/color-convert/conversions.js\");\n\n/*\n\tthis function routes a model to all other models.\n\n\tall functions that are routed have a property `.conversion` attached\n\tto the returned synthetic function. This property is an array\n\tof strings, each with the steps in between the 'from' and 'to'\n\tcolor models (inclusive).\n\n\tconversions that are not possible simply are not included.\n*/\n\nfunction buildGraph() {\n\tvar graph = {};\n\t// https://jsperf.com/object-keys-vs-for-in-with-closure/3\n\tvar models = Object.keys(conversions);\n\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tgraph[models[i]] = {\n\t\t\t// http://jsperf.com/1-vs-infinity\n\t\t\t// micro-opt, but this is simple.\n\t\t\tdistance: -1,\n\t\t\tparent: null\n\t\t};\n\t}\n\n\treturn graph;\n}\n\n// https://en.wikipedia.org/wiki/Breadth-first_search\nfunction deriveBFS(fromModel) {\n\tvar graph = buildGraph();\n\tvar queue = [fromModel]; // unshift -> queue -> pop\n\n\tgraph[fromModel].distance = 0;\n\n\twhile (queue.length) {\n\t\tvar current = queue.pop();\n\t\tvar adjacents = Object.keys(conversions[current]);\n\n\t\tfor (var len = adjacents.length, i = 0; i < len; i++) {\n\t\t\tvar adjacent = adjacents[i];\n\t\t\tvar node = graph[adjacent];\n\n\t\t\tif (node.distance === -1) {\n\t\t\t\tnode.distance = graph[current].distance + 1;\n\t\t\t\tnode.parent = current;\n\t\t\t\tqueue.unshift(adjacent);\n\t\t\t}\n\t\t}\n\t}\n\n\treturn graph;\n}\n\nfunction link(from, to) {\n\treturn function (args) {\n\t\treturn to(from(args));\n\t};\n}\n\nfunction wrapConversion(toModel, graph) {\n\tvar path = [graph[toModel].parent, toModel];\n\tvar fn = conversions[graph[toModel].parent][toModel];\n\n\tvar cur = graph[toModel].parent;\n\twhile (graph[cur].parent) {\n\t\tpath.unshift(graph[cur].parent);\n\t\tfn = link(conversions[graph[cur].parent][cur], fn);\n\t\tcur = graph[cur].parent;\n\t}\n\n\tfn.conversion = path;\n\treturn fn;\n}\n\nmodule.exports = function (fromModel) {\n\tvar graph = deriveBFS(fromModel);\n\tvar conversion = {};\n\n\tvar models = Object.keys(graph);\n\tfor (var len = models.length, i = 0; i < len; i++) {\n\t\tvar toModel = models[i];\n\t\tvar node = graph[toModel];\n\n\t\tif (node.parent === null) {\n\t\t\t// no possible conversion, or this node is the source model.\n\t\t\tcontinue;\n\t\t}\n\n\t\tconversion[toModel] = wrapConversion(toModel, graph);\n\t}\n\n\treturn conversion;\n};\n\n\n\n//# sourceURL=webpack:///./node_modules/color-convert/route.js?"); /***/ }), -/***/ "./node_modules/insert-css/index.js": +/***/ "./node_modules/color-name/index.js": /*!******************************************!*\ - !*** ./node_modules/insert-css/index.js ***! + !*** ./node_modules/color-name/index.js ***! \******************************************/ /*! no static exports found */ -/***/ (function(module, exports) { +/***/ (function(module, exports, __webpack_require__) { -eval("var containers = []; // will store container HTMLElement references\nvar styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}\n\nvar usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';\n\nfunction insertCss(css, options) {\n options = options || {};\n\n if (css === undefined) {\n throw new Error(usage);\n }\n\n var position = options.prepend === true ? 'prepend' : 'append';\n var container = options.container !== undefined ? options.container : document.querySelector('head');\n var containerId = containers.indexOf(container);\n\n // first time we see this container, create the necessary entries\n if (containerId === -1) {\n containerId = containers.push(container) - 1;\n styleElements[containerId] = {};\n }\n\n // try to get the correponding container + position styleElement, create it otherwise\n var styleElement;\n\n if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {\n styleElement = styleElements[containerId][position];\n } else {\n styleElement = styleElements[containerId][position] = createStyleElement();\n\n if (position === 'prepend') {\n container.insertBefore(styleElement, container.childNodes[0]);\n } else {\n container.appendChild(styleElement);\n }\n }\n\n // strip potential UTF-8 BOM if css was read from a file\n if (css.charCodeAt(0) === 0xFEFF) { css = css.substr(1, css.length); }\n\n // actually add the stylesheet\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText += css\n } else {\n styleElement.textContent += css;\n }\n\n return styleElement;\n};\n\nfunction createStyleElement() {\n var styleElement = document.createElement('style');\n styleElement.setAttribute('type', 'text/css');\n return styleElement;\n}\n\nmodule.exports = insertCss;\nmodule.exports.insertCss = insertCss;\n\n\n//# sourceURL=webpack:///./node_modules/insert-css/index.js?"); +"use strict"; +eval("\r\n\r\nmodule.exports = {\r\n\t\"aliceblue\": [240, 248, 255],\r\n\t\"antiquewhite\": [250, 235, 215],\r\n\t\"aqua\": [0, 255, 255],\r\n\t\"aquamarine\": [127, 255, 212],\r\n\t\"azure\": [240, 255, 255],\r\n\t\"beige\": [245, 245, 220],\r\n\t\"bisque\": [255, 228, 196],\r\n\t\"black\": [0, 0, 0],\r\n\t\"blanchedalmond\": [255, 235, 205],\r\n\t\"blue\": [0, 0, 255],\r\n\t\"blueviolet\": [138, 43, 226],\r\n\t\"brown\": [165, 42, 42],\r\n\t\"burlywood\": [222, 184, 135],\r\n\t\"cadetblue\": [95, 158, 160],\r\n\t\"chartreuse\": [127, 255, 0],\r\n\t\"chocolate\": [210, 105, 30],\r\n\t\"coral\": [255, 127, 80],\r\n\t\"cornflowerblue\": [100, 149, 237],\r\n\t\"cornsilk\": [255, 248, 220],\r\n\t\"crimson\": [220, 20, 60],\r\n\t\"cyan\": [0, 255, 255],\r\n\t\"darkblue\": [0, 0, 139],\r\n\t\"darkcyan\": [0, 139, 139],\r\n\t\"darkgoldenrod\": [184, 134, 11],\r\n\t\"darkgray\": [169, 169, 169],\r\n\t\"darkgreen\": [0, 100, 0],\r\n\t\"darkgrey\": [169, 169, 169],\r\n\t\"darkkhaki\": [189, 183, 107],\r\n\t\"darkmagenta\": [139, 0, 139],\r\n\t\"darkolivegreen\": [85, 107, 47],\r\n\t\"darkorange\": [255, 140, 0],\r\n\t\"darkorchid\": [153, 50, 204],\r\n\t\"darkred\": [139, 0, 0],\r\n\t\"darksalmon\": [233, 150, 122],\r\n\t\"darkseagreen\": [143, 188, 143],\r\n\t\"darkslateblue\": [72, 61, 139],\r\n\t\"darkslategray\": [47, 79, 79],\r\n\t\"darkslategrey\": [47, 79, 79],\r\n\t\"darkturquoise\": [0, 206, 209],\r\n\t\"darkviolet\": [148, 0, 211],\r\n\t\"deeppink\": [255, 20, 147],\r\n\t\"deepskyblue\": [0, 191, 255],\r\n\t\"dimgray\": [105, 105, 105],\r\n\t\"dimgrey\": [105, 105, 105],\r\n\t\"dodgerblue\": [30, 144, 255],\r\n\t\"firebrick\": [178, 34, 34],\r\n\t\"floralwhite\": [255, 250, 240],\r\n\t\"forestgreen\": [34, 139, 34],\r\n\t\"fuchsia\": [255, 0, 255],\r\n\t\"gainsboro\": [220, 220, 220],\r\n\t\"ghostwhite\": [248, 248, 255],\r\n\t\"gold\": [255, 215, 0],\r\n\t\"goldenrod\": [218, 165, 32],\r\n\t\"gray\": [128, 128, 128],\r\n\t\"green\": [0, 128, 0],\r\n\t\"greenyellow\": [173, 255, 47],\r\n\t\"grey\": [128, 128, 128],\r\n\t\"honeydew\": [240, 255, 240],\r\n\t\"hotpink\": [255, 105, 180],\r\n\t\"indianred\": [205, 92, 92],\r\n\t\"indigo\": [75, 0, 130],\r\n\t\"ivory\": [255, 255, 240],\r\n\t\"khaki\": [240, 230, 140],\r\n\t\"lavender\": [230, 230, 250],\r\n\t\"lavenderblush\": [255, 240, 245],\r\n\t\"lawngreen\": [124, 252, 0],\r\n\t\"lemonchiffon\": [255, 250, 205],\r\n\t\"lightblue\": [173, 216, 230],\r\n\t\"lightcoral\": [240, 128, 128],\r\n\t\"lightcyan\": [224, 255, 255],\r\n\t\"lightgoldenrodyellow\": [250, 250, 210],\r\n\t\"lightgray\": [211, 211, 211],\r\n\t\"lightgreen\": [144, 238, 144],\r\n\t\"lightgrey\": [211, 211, 211],\r\n\t\"lightpink\": [255, 182, 193],\r\n\t\"lightsalmon\": [255, 160, 122],\r\n\t\"lightseagreen\": [32, 178, 170],\r\n\t\"lightskyblue\": [135, 206, 250],\r\n\t\"lightslategray\": [119, 136, 153],\r\n\t\"lightslategrey\": [119, 136, 153],\r\n\t\"lightsteelblue\": [176, 196, 222],\r\n\t\"lightyellow\": [255, 255, 224],\r\n\t\"lime\": [0, 255, 0],\r\n\t\"limegreen\": [50, 205, 50],\r\n\t\"linen\": [250, 240, 230],\r\n\t\"magenta\": [255, 0, 255],\r\n\t\"maroon\": [128, 0, 0],\r\n\t\"mediumaquamarine\": [102, 205, 170],\r\n\t\"mediumblue\": [0, 0, 205],\r\n\t\"mediumorchid\": [186, 85, 211],\r\n\t\"mediumpurple\": [147, 112, 219],\r\n\t\"mediumseagreen\": [60, 179, 113],\r\n\t\"mediumslateblue\": [123, 104, 238],\r\n\t\"mediumspringgreen\": [0, 250, 154],\r\n\t\"mediumturquoise\": [72, 209, 204],\r\n\t\"mediumvioletred\": [199, 21, 133],\r\n\t\"midnightblue\": [25, 25, 112],\r\n\t\"mintcream\": [245, 255, 250],\r\n\t\"mistyrose\": [255, 228, 225],\r\n\t\"moccasin\": [255, 228, 181],\r\n\t\"navajowhite\": [255, 222, 173],\r\n\t\"navy\": [0, 0, 128],\r\n\t\"oldlace\": [253, 245, 230],\r\n\t\"olive\": [128, 128, 0],\r\n\t\"olivedrab\": [107, 142, 35],\r\n\t\"orange\": [255, 165, 0],\r\n\t\"orangered\": [255, 69, 0],\r\n\t\"orchid\": [218, 112, 214],\r\n\t\"palegoldenrod\": [238, 232, 170],\r\n\t\"palegreen\": [152, 251, 152],\r\n\t\"paleturquoise\": [175, 238, 238],\r\n\t\"palevioletred\": [219, 112, 147],\r\n\t\"papayawhip\": [255, 239, 213],\r\n\t\"peachpuff\": [255, 218, 185],\r\n\t\"peru\": [205, 133, 63],\r\n\t\"pink\": [255, 192, 203],\r\n\t\"plum\": [221, 160, 221],\r\n\t\"powderblue\": [176, 224, 230],\r\n\t\"purple\": [128, 0, 128],\r\n\t\"rebeccapurple\": [102, 51, 153],\r\n\t\"red\": [255, 0, 0],\r\n\t\"rosybrown\": [188, 143, 143],\r\n\t\"royalblue\": [65, 105, 225],\r\n\t\"saddlebrown\": [139, 69, 19],\r\n\t\"salmon\": [250, 128, 114],\r\n\t\"sandybrown\": [244, 164, 96],\r\n\t\"seagreen\": [46, 139, 87],\r\n\t\"seashell\": [255, 245, 238],\r\n\t\"sienna\": [160, 82, 45],\r\n\t\"silver\": [192, 192, 192],\r\n\t\"skyblue\": [135, 206, 235],\r\n\t\"slateblue\": [106, 90, 205],\r\n\t\"slategray\": [112, 128, 144],\r\n\t\"slategrey\": [112, 128, 144],\r\n\t\"snow\": [255, 250, 250],\r\n\t\"springgreen\": [0, 255, 127],\r\n\t\"steelblue\": [70, 130, 180],\r\n\t\"tan\": [210, 180, 140],\r\n\t\"teal\": [0, 128, 128],\r\n\t\"thistle\": [216, 191, 216],\r\n\t\"tomato\": [255, 99, 71],\r\n\t\"turquoise\": [64, 224, 208],\r\n\t\"violet\": [238, 130, 238],\r\n\t\"wheat\": [245, 222, 179],\r\n\t\"white\": [255, 255, 255],\r\n\t\"whitesmoke\": [245, 245, 245],\r\n\t\"yellow\": [255, 255, 0],\r\n\t\"yellowgreen\": [154, 205, 50]\r\n};\r\n\n\n//# sourceURL=webpack:///./node_modules/color-name/index.js?"); /***/ }), -/***/ "./node_modules/inversify-inject-decorators/lib/decorators.js": -/*!********************************************************************!*\ - !*** ./node_modules/inversify-inject-decorators/lib/decorators.js ***! - \********************************************************************/ +/***/ "./node_modules/color-string/index.js": +/*!********************************************!*\ + !*** ./node_modules/color-string/index.js ***! + \********************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar INJECTION = Symbol.for(\"INJECTION\");\nfunction _proxyGetter(proto, key, resolve, doCache) {\n function getter() {\n if (doCache && !Reflect.hasMetadata(INJECTION, this, key)) {\n Reflect.defineMetadata(INJECTION, resolve(), this, key);\n }\n if (Reflect.hasMetadata(INJECTION, this, key)) {\n return Reflect.getMetadata(INJECTION, this, key);\n }\n else {\n return resolve();\n }\n }\n function setter(newVal) {\n Reflect.defineMetadata(INJECTION, newVal, this, key);\n }\n Object.defineProperty(proto, key, {\n configurable: true,\n enumerable: true,\n get: getter,\n set: setter\n });\n}\nfunction makePropertyInjectDecorator(container, doCache) {\n return function (serviceIdentifier) {\n return function (proto, key) {\n var resolve = function () {\n return container.get(serviceIdentifier);\n };\n _proxyGetter(proto, key, resolve, doCache);\n };\n };\n}\nexports.makePropertyInjectDecorator = makePropertyInjectDecorator;\nfunction makePropertyInjectNamedDecorator(container, doCache) {\n return function (serviceIdentifier, named) {\n return function (proto, key) {\n var resolve = function () {\n return container.getNamed(serviceIdentifier, named);\n };\n _proxyGetter(proto, key, resolve, doCache);\n };\n };\n}\nexports.makePropertyInjectNamedDecorator = makePropertyInjectNamedDecorator;\nfunction makePropertyInjectTaggedDecorator(container, doCache) {\n return function (serviceIdentifier, key, value) {\n return function (proto, propertyName) {\n var resolve = function () {\n return container.getTagged(serviceIdentifier, key, value);\n };\n _proxyGetter(proto, propertyName, resolve, doCache);\n };\n };\n}\nexports.makePropertyInjectTaggedDecorator = makePropertyInjectTaggedDecorator;\nfunction makePropertyMultiInjectDecorator(container, doCache) {\n return function (serviceIdentifier) {\n return function (proto, key) {\n var resolve = function () {\n return container.getAll(serviceIdentifier);\n };\n _proxyGetter(proto, key, resolve, doCache);\n };\n };\n}\nexports.makePropertyMultiInjectDecorator = makePropertyMultiInjectDecorator;\n\n\n//# sourceURL=webpack:///./node_modules/inversify-inject-decorators/lib/decorators.js?"); +eval("/* MIT license */\nvar colorNames = __webpack_require__(/*! color-name */ \"./node_modules/color-name/index.js\");\nvar swizzle = __webpack_require__(/*! simple-swizzle */ \"./node_modules/simple-swizzle/index.js\");\nvar hasOwnProperty = Object.hasOwnProperty;\n\nvar reverseNames = Object.create(null);\n\n// create a list of reverse color names\nfor (var name in colorNames) {\n\tif (hasOwnProperty.call(colorNames, name)) {\n\t\treverseNames[colorNames[name]] = name;\n\t}\n}\n\nvar cs = module.exports = {\n\tto: {},\n\tget: {}\n};\n\ncs.get = function (string) {\n\tvar prefix = string.substring(0, 3).toLowerCase();\n\tvar val;\n\tvar model;\n\tswitch (prefix) {\n\t\tcase 'hsl':\n\t\t\tval = cs.get.hsl(string);\n\t\t\tmodel = 'hsl';\n\t\t\tbreak;\n\t\tcase 'hwb':\n\t\t\tval = cs.get.hwb(string);\n\t\t\tmodel = 'hwb';\n\t\t\tbreak;\n\t\tdefault:\n\t\t\tval = cs.get.rgb(string);\n\t\t\tmodel = 'rgb';\n\t\t\tbreak;\n\t}\n\n\tif (!val) {\n\t\treturn null;\n\t}\n\n\treturn {model: model, value: val};\n};\n\ncs.get.rgb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar abbr = /^#([a-f0-9]{3,4})$/i;\n\tvar hex = /^#([a-f0-9]{6})([a-f0-9]{2})?$/i;\n\tvar rgba = /^rgba?\\(\\s*([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)(?=[\\s,])\\s*(?:,\\s*)?([+-]?\\d+)\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar per = /^rgba?\\(\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*,?\\s*([+-]?[\\d\\.]+)\\%\\s*(?:[,|\\/]\\s*([+-]?[\\d\\.]+)(%?)\\s*)?\\)$/;\n\tvar keyword = /^(\\w+)$/;\n\n\tvar rgb = [0, 0, 0, 1];\n\tvar match;\n\tvar i;\n\tvar hexAlpha;\n\n\tif (match = string.match(hex)) {\n\t\thexAlpha = match[2];\n\t\tmatch = match[1];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\t// https://jsperf.com/slice-vs-substr-vs-substring-methods-long-string/19\n\t\t\tvar i2 = i * 2;\n\t\t\trgb[i] = parseInt(match.slice(i2, i2 + 2), 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(abbr)) {\n\t\tmatch = match[1];\n\t\thexAlpha = match[3];\n\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i] + match[i], 16);\n\t\t}\n\n\t\tif (hexAlpha) {\n\t\t\trgb[3] = parseInt(hexAlpha + hexAlpha, 16) / 255;\n\t\t}\n\t} else if (match = string.match(rgba)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = parseInt(match[i + 1], 0);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(per)) {\n\t\tfor (i = 0; i < 3; i++) {\n\t\t\trgb[i] = Math.round(parseFloat(match[i + 1]) * 2.55);\n\t\t}\n\n\t\tif (match[4]) {\n\t\t\tif (match[5]) {\n\t\t\t\trgb[3] = parseFloat(match[4]) * 0.01;\n\t\t\t} else {\n\t\t\t\trgb[3] = parseFloat(match[4]);\n\t\t\t}\n\t\t}\n\t} else if (match = string.match(keyword)) {\n\t\tif (match[1] === 'transparent') {\n\t\t\treturn [0, 0, 0, 0];\n\t\t}\n\n\t\tif (!hasOwnProperty.call(colorNames, match[1])) {\n\t\t\treturn null;\n\t\t}\n\n\t\trgb = colorNames[match[1]];\n\t\trgb[3] = 1;\n\n\t\treturn rgb;\n\t} else {\n\t\treturn null;\n\t}\n\n\tfor (i = 0; i < 3; i++) {\n\t\trgb[i] = clamp(rgb[i], 0, 255);\n\t}\n\trgb[3] = clamp(rgb[3], 0, 1);\n\n\treturn rgb;\n};\n\ncs.get.hsl = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hsl = /^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*)?\\)$/;\n\tvar match = string.match(hsl);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar s = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar l = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\n\t\treturn [h, s, l, a];\n\t}\n\n\treturn null;\n};\n\ncs.get.hwb = function (string) {\n\tif (!string) {\n\t\treturn null;\n\t}\n\n\tvar hwb = /^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*)?\\)$/;\n\tvar match = string.match(hwb);\n\n\tif (match) {\n\t\tvar alpha = parseFloat(match[4]);\n\t\tvar h = ((parseFloat(match[1]) % 360) + 360) % 360;\n\t\tvar w = clamp(parseFloat(match[2]), 0, 100);\n\t\tvar b = clamp(parseFloat(match[3]), 0, 100);\n\t\tvar a = clamp(isNaN(alpha) ? 1 : alpha, 0, 1);\n\t\treturn [h, w, b, a];\n\t}\n\n\treturn null;\n};\n\ncs.to.hex = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn (\n\t\t'#' +\n\t\thexDouble(rgba[0]) +\n\t\thexDouble(rgba[1]) +\n\t\thexDouble(rgba[2]) +\n\t\t(rgba[3] < 1\n\t\t\t? (hexDouble(Math.round(rgba[3] * 255)))\n\t\t\t: '')\n\t);\n};\n\ncs.to.rgb = function () {\n\tvar rgba = swizzle(arguments);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ')'\n\t\t: 'rgba(' + Math.round(rgba[0]) + ', ' + Math.round(rgba[1]) + ', ' + Math.round(rgba[2]) + ', ' + rgba[3] + ')';\n};\n\ncs.to.rgb.percent = function () {\n\tvar rgba = swizzle(arguments);\n\n\tvar r = Math.round(rgba[0] / 255 * 100);\n\tvar g = Math.round(rgba[1] / 255 * 100);\n\tvar b = Math.round(rgba[2] / 255 * 100);\n\n\treturn rgba.length < 4 || rgba[3] === 1\n\t\t? 'rgb(' + r + '%, ' + g + '%, ' + b + '%)'\n\t\t: 'rgba(' + r + '%, ' + g + '%, ' + b + '%, ' + rgba[3] + ')';\n};\n\ncs.to.hsl = function () {\n\tvar hsla = swizzle(arguments);\n\treturn hsla.length < 4 || hsla[3] === 1\n\t\t? 'hsl(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%)'\n\t\t: 'hsla(' + hsla[0] + ', ' + hsla[1] + '%, ' + hsla[2] + '%, ' + hsla[3] + ')';\n};\n\n// hwb is a bit different than rgb(a) & hsl(a) since there is no alpha specific syntax\n// (hwb have alpha optional & 1 is default value)\ncs.to.hwb = function () {\n\tvar hwba = swizzle(arguments);\n\n\tvar a = '';\n\tif (hwba.length >= 4 && hwba[3] !== 1) {\n\t\ta = ', ' + hwba[3];\n\t}\n\n\treturn 'hwb(' + hwba[0] + ', ' + hwba[1] + '%, ' + hwba[2] + '%' + a + ')';\n};\n\ncs.to.keyword = function (rgb) {\n\treturn reverseNames[rgb.slice(0, 3)];\n};\n\n// helpers\nfunction clamp(num, min, max) {\n\treturn Math.min(Math.max(min, num), max);\n}\n\nfunction hexDouble(num) {\n\tvar str = Math.round(num).toString(16).toUpperCase();\n\treturn (str.length < 2) ? '0' + str : str;\n}\n\n\n//# sourceURL=webpack:///./node_modules/color-string/index.js?"); /***/ }), - -/***/ "./node_modules/inversify-inject-decorators/lib/index.js": -/*!***************************************************************!*\ - !*** ./node_modules/inversify-inject-decorators/lib/index.js ***! - \***************************************************************/ + +/***/ "./node_modules/color/index.js": +/*!*************************************!*\ + !*** ./node_modules/color/index.js ***! + \*************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nvar decorators_1 = __webpack_require__(/*! ./decorators */ \"./node_modules/inversify-inject-decorators/lib/decorators.js\");\nfunction getDecorators(container, doCache) {\n if (doCache === void 0) { doCache = true; }\n var lazyInject = decorators_1.makePropertyInjectDecorator(container, doCache);\n var lazyInjectNamed = decorators_1.makePropertyInjectNamedDecorator(container, doCache);\n var lazyInjectTagged = decorators_1.makePropertyInjectTaggedDecorator(container, doCache);\n var lazyMultiInject = decorators_1.makePropertyMultiInjectDecorator(container, doCache);\n return {\n lazyInject: lazyInject,\n lazyInjectNamed: lazyInjectNamed,\n lazyInjectTagged: lazyInjectTagged,\n lazyMultiInject: lazyMultiInject\n };\n}\nexports.default = getDecorators;\n\n\n//# sourceURL=webpack:///./node_modules/inversify-inject-decorators/lib/index.js?"); +eval("\n\nvar colorString = __webpack_require__(/*! color-string */ \"./node_modules/color-string/index.js\");\nvar convert = __webpack_require__(/*! color-convert */ \"./node_modules/color-convert/index.js\");\n\nvar _slice = [].slice;\n\nvar skippedModels = [\n\t// to be honest, I don't really feel like keyword belongs in color convert, but eh.\n\t'keyword',\n\n\t// gray conflicts with some method names, and has its own method defined.\n\t'gray',\n\n\t// shouldn't really be in color-convert either...\n\t'hex'\n];\n\nvar hashedModelKeys = {};\nObject.keys(convert).forEach(function (model) {\n\thashedModelKeys[_slice.call(convert[model].labels).sort().join('')] = model;\n});\n\nvar limiters = {};\n\nfunction Color(obj, model) {\n\tif (!(this instanceof Color)) {\n\t\treturn new Color(obj, model);\n\t}\n\n\tif (model && model in skippedModels) {\n\t\tmodel = null;\n\t}\n\n\tif (model && !(model in convert)) {\n\t\tthrow new Error('Unknown model: ' + model);\n\t}\n\n\tvar i;\n\tvar channels;\n\n\tif (obj == null) { // eslint-disable-line no-eq-null,eqeqeq\n\t\tthis.model = 'rgb';\n\t\tthis.color = [0, 0, 0];\n\t\tthis.valpha = 1;\n\t} else if (obj instanceof Color) {\n\t\tthis.model = obj.model;\n\t\tthis.color = obj.color.slice();\n\t\tthis.valpha = obj.valpha;\n\t} else if (typeof obj === 'string') {\n\t\tvar result = colorString.get(obj);\n\t\tif (result === null) {\n\t\t\tthrow new Error('Unable to parse color from string: ' + obj);\n\t\t}\n\n\t\tthis.model = result.model;\n\t\tchannels = convert[this.model].channels;\n\t\tthis.color = result.value.slice(0, channels);\n\t\tthis.valpha = typeof result.value[channels] === 'number' ? result.value[channels] : 1;\n\t} else if (obj.length) {\n\t\tthis.model = model || 'rgb';\n\t\tchannels = convert[this.model].channels;\n\t\tvar newArr = _slice.call(obj, 0, channels);\n\t\tthis.color = zeroArray(newArr, channels);\n\t\tthis.valpha = typeof obj[channels] === 'number' ? obj[channels] : 1;\n\t} else if (typeof obj === 'number') {\n\t\t// this is always RGB - can be converted later on.\n\t\tobj &= 0xFFFFFF;\n\t\tthis.model = 'rgb';\n\t\tthis.color = [\n\t\t\t(obj >> 16) & 0xFF,\n\t\t\t(obj >> 8) & 0xFF,\n\t\t\tobj & 0xFF\n\t\t];\n\t\tthis.valpha = 1;\n\t} else {\n\t\tthis.valpha = 1;\n\n\t\tvar keys = Object.keys(obj);\n\t\tif ('alpha' in obj) {\n\t\t\tkeys.splice(keys.indexOf('alpha'), 1);\n\t\t\tthis.valpha = typeof obj.alpha === 'number' ? obj.alpha : 0;\n\t\t}\n\n\t\tvar hashedKeys = keys.sort().join('');\n\t\tif (!(hashedKeys in hashedModelKeys)) {\n\t\t\tthrow new Error('Unable to parse color from object: ' + JSON.stringify(obj));\n\t\t}\n\n\t\tthis.model = hashedModelKeys[hashedKeys];\n\n\t\tvar labels = convert[this.model].labels;\n\t\tvar color = [];\n\t\tfor (i = 0; i < labels.length; i++) {\n\t\t\tcolor.push(obj[labels[i]]);\n\t\t}\n\n\t\tthis.color = zeroArray(color);\n\t}\n\n\t// perform limitations (clamping, etc.)\n\tif (limiters[this.model]) {\n\t\tchannels = convert[this.model].channels;\n\t\tfor (i = 0; i < channels; i++) {\n\t\t\tvar limit = limiters[this.model][i];\n\t\t\tif (limit) {\n\t\t\t\tthis.color[i] = limit(this.color[i]);\n\t\t\t}\n\t\t}\n\t}\n\n\tthis.valpha = Math.max(0, Math.min(1, this.valpha));\n\n\tif (Object.freeze) {\n\t\tObject.freeze(this);\n\t}\n}\n\nColor.prototype = {\n\ttoString: function () {\n\t\treturn this.string();\n\t},\n\n\ttoJSON: function () {\n\t\treturn this[this.model]();\n\t},\n\n\tstring: function (places) {\n\t\tvar self = this.model in colorString.to ? this : this.rgb();\n\t\tself = self.round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to[self.model](args);\n\t},\n\n\tpercentString: function (places) {\n\t\tvar self = this.rgb().round(typeof places === 'number' ? places : 1);\n\t\tvar args = self.valpha === 1 ? self.color : self.color.concat(this.valpha);\n\t\treturn colorString.to.rgb.percent(args);\n\t},\n\n\tarray: function () {\n\t\treturn this.valpha === 1 ? this.color.slice() : this.color.concat(this.valpha);\n\t},\n\n\tobject: function () {\n\t\tvar result = {};\n\t\tvar channels = convert[this.model].channels;\n\t\tvar labels = convert[this.model].labels;\n\n\t\tfor (var i = 0; i < channels; i++) {\n\t\t\tresult[labels[i]] = this.color[i];\n\t\t}\n\n\t\tif (this.valpha !== 1) {\n\t\t\tresult.alpha = this.valpha;\n\t\t}\n\n\t\treturn result;\n\t},\n\n\tunitArray: function () {\n\t\tvar rgb = this.rgb().color;\n\t\trgb[0] /= 255;\n\t\trgb[1] /= 255;\n\t\trgb[2] /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.push(this.valpha);\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tunitObject: function () {\n\t\tvar rgb = this.rgb().object();\n\t\trgb.r /= 255;\n\t\trgb.g /= 255;\n\t\trgb.b /= 255;\n\n\t\tif (this.valpha !== 1) {\n\t\t\trgb.alpha = this.valpha;\n\t\t}\n\n\t\treturn rgb;\n\t},\n\n\tround: function (places) {\n\t\tplaces = Math.max(places || 0, 0);\n\t\treturn new Color(this.color.map(roundToPlace(places)).concat(this.valpha), this.model);\n\t},\n\n\talpha: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(this.color.concat(Math.max(0, Math.min(1, val))), this.model);\n\t\t}\n\n\t\treturn this.valpha;\n\t},\n\n\t// rgb\n\tred: getset('rgb', 0, maxfn(255)),\n\tgreen: getset('rgb', 1, maxfn(255)),\n\tblue: getset('rgb', 2, maxfn(255)),\n\n\thue: getset(['hsl', 'hsv', 'hsl', 'hwb', 'hcg'], 0, function (val) { return ((val % 360) + 360) % 360; }), // eslint-disable-line brace-style\n\n\tsaturationl: getset('hsl', 1, maxfn(100)),\n\tlightness: getset('hsl', 2, maxfn(100)),\n\n\tsaturationv: getset('hsv', 1, maxfn(100)),\n\tvalue: getset('hsv', 2, maxfn(100)),\n\n\tchroma: getset('hcg', 1, maxfn(100)),\n\tgray: getset('hcg', 2, maxfn(100)),\n\n\twhite: getset('hwb', 1, maxfn(100)),\n\twblack: getset('hwb', 2, maxfn(100)),\n\n\tcyan: getset('cmyk', 0, maxfn(100)),\n\tmagenta: getset('cmyk', 1, maxfn(100)),\n\tyellow: getset('cmyk', 2, maxfn(100)),\n\tblack: getset('cmyk', 3, maxfn(100)),\n\n\tx: getset('xyz', 0, maxfn(100)),\n\ty: getset('xyz', 1, maxfn(100)),\n\tz: getset('xyz', 2, maxfn(100)),\n\n\tl: getset('lab', 0, maxfn(100)),\n\ta: getset('lab', 1),\n\tb: getset('lab', 2),\n\n\tkeyword: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn convert[this.model].keyword(this.color);\n\t},\n\n\thex: function (val) {\n\t\tif (arguments.length) {\n\t\t\treturn new Color(val);\n\t\t}\n\n\t\treturn colorString.to.hex(this.rgb().round().color);\n\t},\n\n\trgbNumber: function () {\n\t\tvar rgb = this.rgb().color;\n\t\treturn ((rgb[0] & 0xFF) << 16) | ((rgb[1] & 0xFF) << 8) | (rgb[2] & 0xFF);\n\t},\n\n\tluminosity: function () {\n\t\t// http://www.w3.org/TR/WCAG20/#relativeluminancedef\n\t\tvar rgb = this.rgb().color;\n\n\t\tvar lum = [];\n\t\tfor (var i = 0; i < rgb.length; i++) {\n\t\t\tvar chan = rgb[i] / 255;\n\t\t\tlum[i] = (chan <= 0.03928) ? chan / 12.92 : Math.pow(((chan + 0.055) / 1.055), 2.4);\n\t\t}\n\n\t\treturn 0.2126 * lum[0] + 0.7152 * lum[1] + 0.0722 * lum[2];\n\t},\n\n\tcontrast: function (color2) {\n\t\t// http://www.w3.org/TR/WCAG20/#contrast-ratiodef\n\t\tvar lum1 = this.luminosity();\n\t\tvar lum2 = color2.luminosity();\n\n\t\tif (lum1 > lum2) {\n\t\t\treturn (lum1 + 0.05) / (lum2 + 0.05);\n\t\t}\n\n\t\treturn (lum2 + 0.05) / (lum1 + 0.05);\n\t},\n\n\tlevel: function (color2) {\n\t\tvar contrastRatio = this.contrast(color2);\n\t\tif (contrastRatio >= 7.1) {\n\t\t\treturn 'AAA';\n\t\t}\n\n\t\treturn (contrastRatio >= 4.5) ? 'AA' : '';\n\t},\n\n\tisDark: function () {\n\t\t// YIQ equation from http://24ways.org/2010/calculating-color-contrast\n\t\tvar rgb = this.rgb().color;\n\t\tvar yiq = (rgb[0] * 299 + rgb[1] * 587 + rgb[2] * 114) / 1000;\n\t\treturn yiq < 128;\n\t},\n\n\tisLight: function () {\n\t\treturn !this.isDark();\n\t},\n\n\tnegate: function () {\n\t\tvar rgb = this.rgb();\n\t\tfor (var i = 0; i < 3; i++) {\n\t\t\trgb.color[i] = 255 - rgb.color[i];\n\t\t}\n\t\treturn rgb;\n\t},\n\n\tlighten: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] += hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdarken: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[2] -= hsl.color[2] * ratio;\n\t\treturn hsl;\n\t},\n\n\tsaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] += hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\tdesaturate: function (ratio) {\n\t\tvar hsl = this.hsl();\n\t\thsl.color[1] -= hsl.color[1] * ratio;\n\t\treturn hsl;\n\t},\n\n\twhiten: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[1] += hwb.color[1] * ratio;\n\t\treturn hwb;\n\t},\n\n\tblacken: function (ratio) {\n\t\tvar hwb = this.hwb();\n\t\thwb.color[2] += hwb.color[2] * ratio;\n\t\treturn hwb;\n\t},\n\n\tgrayscale: function () {\n\t\t// http://en.wikipedia.org/wiki/Grayscale#Converting_color_to_grayscale\n\t\tvar rgb = this.rgb().color;\n\t\tvar val = rgb[0] * 0.3 + rgb[1] * 0.59 + rgb[2] * 0.11;\n\t\treturn Color.rgb(val, val, val);\n\t},\n\n\tfade: function (ratio) {\n\t\treturn this.alpha(this.valpha - (this.valpha * ratio));\n\t},\n\n\topaquer: function (ratio) {\n\t\treturn this.alpha(this.valpha + (this.valpha * ratio));\n\t},\n\n\trotate: function (degrees) {\n\t\tvar hsl = this.hsl();\n\t\tvar hue = hsl.color[0];\n\t\thue = (hue + degrees) % 360;\n\t\thue = hue < 0 ? 360 + hue : hue;\n\t\thsl.color[0] = hue;\n\t\treturn hsl;\n\t},\n\n\tmix: function (mixinColor, weight) {\n\t\t// ported from sass implementation in C\n\t\t// https://github.com/sass/libsass/blob/0e6b4a2850092356aa3ece07c6b249f0221caced/functions.cpp#L209\n\t\tif (!mixinColor || !mixinColor.rgb) {\n\t\t\tthrow new Error('Argument to \"mix\" was not a Color instance, but rather an instance of ' + typeof mixinColor);\n\t\t}\n\t\tvar color1 = mixinColor.rgb();\n\t\tvar color2 = this.rgb();\n\t\tvar p = weight === undefined ? 0.5 : weight;\n\n\t\tvar w = 2 * p - 1;\n\t\tvar a = color1.alpha() - color2.alpha();\n\n\t\tvar w1 = (((w * a === -1) ? w : (w + a) / (1 + w * a)) + 1) / 2.0;\n\t\tvar w2 = 1 - w1;\n\n\t\treturn Color.rgb(\n\t\t\t\tw1 * color1.red() + w2 * color2.red(),\n\t\t\t\tw1 * color1.green() + w2 * color2.green(),\n\t\t\t\tw1 * color1.blue() + w2 * color2.blue(),\n\t\t\t\tcolor1.alpha() * p + color2.alpha() * (1 - p));\n\t}\n};\n\n// model conversion methods and static constructors\nObject.keys(convert).forEach(function (model) {\n\tif (skippedModels.indexOf(model) !== -1) {\n\t\treturn;\n\t}\n\n\tvar channels = convert[model].channels;\n\n\t// conversion methods\n\tColor.prototype[model] = function () {\n\t\tif (this.model === model) {\n\t\t\treturn new Color(this);\n\t\t}\n\n\t\tif (arguments.length) {\n\t\t\treturn new Color(arguments, model);\n\t\t}\n\n\t\tvar newAlpha = typeof arguments[channels] === 'number' ? channels : this.valpha;\n\t\treturn new Color(assertArray(convert[this.model][model].raw(this.color)).concat(newAlpha), model);\n\t};\n\n\t// 'static' construction methods\n\tColor[model] = function (color) {\n\t\tif (typeof color === 'number') {\n\t\t\tcolor = zeroArray(_slice.call(arguments), channels);\n\t\t}\n\t\treturn new Color(color, model);\n\t};\n});\n\nfunction roundTo(num, places) {\n\treturn Number(num.toFixed(places));\n}\n\nfunction roundToPlace(places) {\n\treturn function (num) {\n\t\treturn roundTo(num, places);\n\t};\n}\n\nfunction getset(model, channel, modifier) {\n\tmodel = Array.isArray(model) ? model : [model];\n\n\tmodel.forEach(function (m) {\n\t\t(limiters[m] || (limiters[m] = []))[channel] = modifier;\n\t});\n\n\tmodel = model[0];\n\n\treturn function (val) {\n\t\tvar result;\n\n\t\tif (arguments.length) {\n\t\t\tif (modifier) {\n\t\t\t\tval = modifier(val);\n\t\t\t}\n\n\t\t\tresult = this[model]();\n\t\t\tresult.color[channel] = val;\n\t\t\treturn result;\n\t\t}\n\n\t\tresult = this[model]().color[channel];\n\t\tif (modifier) {\n\t\t\tresult = modifier(result);\n\t\t}\n\n\t\treturn result;\n\t};\n}\n\nfunction maxfn(max) {\n\treturn function (v) {\n\t\treturn Math.max(0, Math.min(max, v));\n\t};\n}\n\nfunction assertArray(val) {\n\treturn Array.isArray(val) ? val : [val];\n}\n\nfunction zeroArray(arr, length) {\n\tfor (var i = 0; i < length; i++) {\n\t\tif (typeof arr[i] !== 'number') {\n\t\t\tarr[i] = 0;\n\t\t}\n\t}\n\n\treturn arr;\n}\n\nmodule.exports = Color;\n\n\n//# sourceURL=webpack:///./node_modules/color/index.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/decorator_utils.js": -/*!******************************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/decorator_utils.js ***! - \******************************************************************/ +/***/ "./node_modules/core-js/internals/a-possible-prototype.js": +/*!****************************************************************!*\ + !*** ./node_modules/core-js/internals/a-possible-prototype.js ***! + \****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tagProperty = exports.tagParameter = exports.decorate = void 0;\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nfunction tagParameter(annotationTarget, propertyName, parameterIndex, metadata) {\n var metadataKey = METADATA_KEY.TAGGED;\n _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex);\n}\nexports.tagParameter = tagParameter;\nfunction tagProperty(annotationTarget, propertyName, metadata) {\n var metadataKey = METADATA_KEY.TAGGED_PROP;\n _tagParameterOrProperty(metadataKey, annotationTarget.constructor, propertyName, metadata);\n}\nexports.tagProperty = tagProperty;\nfunction _tagParameterOrProperty(metadataKey, annotationTarget, propertyName, metadata, parameterIndex) {\n var paramsOrPropertiesMetadata = {};\n var isParameterDecorator = (typeof parameterIndex === \"number\");\n var key = (parameterIndex !== undefined && isParameterDecorator) ? parameterIndex.toString() : propertyName;\n if (isParameterDecorator && propertyName !== undefined) {\n throw new Error(ERROR_MSGS.INVALID_DECORATOR_OPERATION);\n }\n if (Reflect.hasOwnMetadata(metadataKey, annotationTarget)) {\n paramsOrPropertiesMetadata = Reflect.getMetadata(metadataKey, annotationTarget);\n }\n var paramOrPropertyMetadata = paramsOrPropertiesMetadata[key];\n if (!Array.isArray(paramOrPropertyMetadata)) {\n paramOrPropertyMetadata = [];\n }\n else {\n for (var _i = 0, paramOrPropertyMetadata_1 = paramOrPropertyMetadata; _i < paramOrPropertyMetadata_1.length; _i++) {\n var m = paramOrPropertyMetadata_1[_i];\n if (m.key === metadata.key) {\n throw new Error(ERROR_MSGS.DUPLICATED_METADATA + \" \" + m.key.toString());\n }\n }\n }\n paramOrPropertyMetadata.push(metadata);\n paramsOrPropertiesMetadata[key] = paramOrPropertyMetadata;\n Reflect.defineMetadata(metadataKey, paramsOrPropertiesMetadata, annotationTarget);\n}\nfunction _decorate(decorators, target) {\n Reflect.decorate(decorators, target);\n}\nfunction _param(paramIndex, decorator) {\n return function (target, key) { decorator(target, key, paramIndex); };\n}\nfunction decorate(decorator, target, parameterIndex) {\n if (typeof parameterIndex === \"number\") {\n _decorate([_param(parameterIndex, decorator)], target);\n }\n else if (typeof parameterIndex === \"string\") {\n Reflect.decorate([decorator], target, parameterIndex);\n }\n else {\n _decorate([decorator], target);\n }\n}\nexports.decorate = decorate;\n//# sourceMappingURL=decorator_utils.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/decorator_utils.js?"); +eval("\nvar isPossiblePrototype = __webpack_require__(/*! ../internals/is-possible-prototype */ \"./node_modules/core-js/internals/is-possible-prototype.js\");\n\nvar $String = String;\nvar $TypeError = TypeError;\n\nmodule.exports = function (argument) {\n if (isPossiblePrototype(argument)) return argument;\n throw new $TypeError(\"Can't set \" + $String(argument) + ' as a prototype');\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/a-possible-prototype.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/inject.js": -/*!*********************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/inject.js ***! - \*********************************************************/ +/***/ "./node_modules/core-js/internals/classof.js": +/*!***************************************************!*\ + !*** ./node_modules/core-js/internals/classof.js ***! + \***************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.inject = exports.LazyServiceIdentifer = void 0;\nvar error_msgs_1 = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar decorator_utils_1 = __webpack_require__(/*! ./decorator_utils */ \"./node_modules/inversify/lib/annotation/decorator_utils.js\");\nvar LazyServiceIdentifer = (function () {\n function LazyServiceIdentifer(cb) {\n this._cb = cb;\n }\n LazyServiceIdentifer.prototype.unwrap = function () {\n return this._cb();\n };\n return LazyServiceIdentifer;\n}());\nexports.LazyServiceIdentifer = LazyServiceIdentifer;\nfunction inject(serviceIdentifier) {\n return function (target, targetKey, index) {\n if (serviceIdentifier === undefined) {\n throw new Error(error_msgs_1.UNDEFINED_INJECT_ANNOTATION(target.name));\n }\n var metadata = new metadata_1.Metadata(METADATA_KEY.INJECT_TAG, serviceIdentifier);\n if (typeof index === \"number\") {\n decorator_utils_1.tagParameter(target, targetKey, index, metadata);\n }\n else {\n decorator_utils_1.tagProperty(target, targetKey, metadata);\n }\n };\n}\nexports.inject = inject;\n//# sourceMappingURL=inject.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/inject.js?"); +eval("\nvar TO_STRING_TAG_SUPPORT = __webpack_require__(/*! ../internals/to-string-tag-support */ \"./node_modules/core-js/internals/to-string-tag-support.js\");\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js/internals/is-callable.js\");\nvar classofRaw = __webpack_require__(/*! ../internals/classof-raw */ \"./node_modules/core-js/internals/classof-raw.js\");\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js/internals/well-known-symbol.js\");\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar $Object = Object;\n\n// ES3 wrong here\nvar CORRECT_ARGUMENTS = classofRaw(function () { return arguments; }()) === 'Arguments';\n\n// fallback for IE11 Script Access Denied error\nvar tryGet = function (it, key) {\n try {\n return it[key];\n } catch (error) { /* empty */ }\n};\n\n// getting tag from ES6+ `Object.prototype.toString`\nmodule.exports = TO_STRING_TAG_SUPPORT ? classofRaw : function (it) {\n var O, tag, result;\n return it === undefined ? 'Undefined' : it === null ? 'Null'\n // @@toStringTag case\n : typeof (tag = tryGet(O = $Object(it), TO_STRING_TAG)) == 'string' ? tag\n // builtinTag case\n : CORRECT_ARGUMENTS ? classofRaw(O)\n // ES3 arguments fallback\n : (result = classofRaw(O)) === 'Object' && isCallable(O.callee) ? 'Arguments' : result;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/classof.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/injectable.js": +/***/ "./node_modules/core-js/internals/error-stack-clear.js": /*!*************************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/injectable.js ***! + !*** ./node_modules/core-js/internals/error-stack-clear.js ***! \*************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.injectable = void 0;\nvar ERRORS_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nfunction injectable() {\n return function (target) {\n if (Reflect.hasOwnMetadata(METADATA_KEY.PARAM_TYPES, target)) {\n throw new Error(ERRORS_MSGS.DUPLICATED_INJECTABLE_DECORATOR);\n }\n var types = Reflect.getMetadata(METADATA_KEY.DESIGN_PARAM_TYPES, target) || [];\n Reflect.defineMetadata(METADATA_KEY.PARAM_TYPES, types, target);\n return target;\n };\n}\nexports.injectable = injectable;\n//# sourceMappingURL=injectable.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/injectable.js?"); +eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js/internals/function-uncurry-this.js\");\n\nvar $Error = Error;\nvar replace = uncurryThis(''.replace);\n\nvar TEST = (function (arg) { return String(new $Error(arg).stack); })('zxcasd');\n// eslint-disable-next-line redos/no-vulnerable -- safe\nvar V8_OR_CHAKRA_STACK_ENTRY = /\\n\\s*at [^:]*:[^\\n]*/;\nvar IS_V8_OR_CHAKRA_STACK = V8_OR_CHAKRA_STACK_ENTRY.test(TEST);\n\nmodule.exports = function (stack, dropEntries) {\n if (IS_V8_OR_CHAKRA_STACK && typeof stack == 'string' && !$Error.prepareStackTrace) {\n while (dropEntries--) stack = replace(stack, V8_OR_CHAKRA_STACK_ENTRY, '');\n } return stack;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/error-stack-clear.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/multi_inject.js": +/***/ "./node_modules/core-js/internals/error-stack-install.js": /*!***************************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/multi_inject.js ***! + !*** ./node_modules/core-js/internals/error-stack-install.js ***! \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.multiInject = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar decorator_utils_1 = __webpack_require__(/*! ./decorator_utils */ \"./node_modules/inversify/lib/annotation/decorator_utils.js\");\nfunction multiInject(serviceIdentifier) {\n return function (target, targetKey, index) {\n var metadata = new metadata_1.Metadata(METADATA_KEY.MULTI_INJECT_TAG, serviceIdentifier);\n if (typeof index === \"number\") {\n decorator_utils_1.tagParameter(target, targetKey, index, metadata);\n }\n else {\n decorator_utils_1.tagProperty(target, targetKey, metadata);\n }\n };\n}\nexports.multiInject = multiInject;\n//# sourceMappingURL=multi_inject.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/multi_inject.js?"); +eval("\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js/internals/create-non-enumerable-property.js\");\nvar clearErrorStack = __webpack_require__(/*! ../internals/error-stack-clear */ \"./node_modules/core-js/internals/error-stack-clear.js\");\nvar ERROR_STACK_INSTALLABLE = __webpack_require__(/*! ../internals/error-stack-installable */ \"./node_modules/core-js/internals/error-stack-installable.js\");\n\n// non-standard V8\nvar captureStackTrace = Error.captureStackTrace;\n\nmodule.exports = function (error, C, stack, dropEntries) {\n if (ERROR_STACK_INSTALLABLE) {\n if (captureStackTrace) captureStackTrace(error, C);\n else createNonEnumerableProperty(error, 'stack', clearErrorStack(stack, dropEntries));\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/error-stack-install.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/named.js": -/*!********************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/named.js ***! - \********************************************************/ +/***/ "./node_modules/core-js/internals/error-stack-installable.js": +/*!*******************************************************************!*\ + !*** ./node_modules/core-js/internals/error-stack-installable.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.named = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar decorator_utils_1 = __webpack_require__(/*! ./decorator_utils */ \"./node_modules/inversify/lib/annotation/decorator_utils.js\");\nfunction named(name) {\n return function (target, targetKey, index) {\n var metadata = new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, name);\n if (typeof index === \"number\") {\n decorator_utils_1.tagParameter(target, targetKey, index, metadata);\n }\n else {\n decorator_utils_1.tagProperty(target, targetKey, metadata);\n }\n };\n}\nexports.named = named;\n//# sourceMappingURL=named.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/named.js?"); +eval("\nvar fails = __webpack_require__(/*! ../internals/fails */ \"./node_modules/core-js/internals/fails.js\");\nvar createPropertyDescriptor = __webpack_require__(/*! ../internals/create-property-descriptor */ \"./node_modules/core-js/internals/create-property-descriptor.js\");\n\nmodule.exports = !fails(function () {\n var error = new Error('a');\n if (!('stack' in error)) return true;\n // eslint-disable-next-line es/no-object-defineproperty -- safe\n Object.defineProperty(error, 'stack', createPropertyDescriptor(1, 7));\n return error.stack !== 7;\n});\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/error-stack-installable.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/optional.js": -/*!***********************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/optional.js ***! - \***********************************************************/ +/***/ "./node_modules/core-js/internals/function-apply.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/internals/function-apply.js ***! + \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.optional = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar decorator_utils_1 = __webpack_require__(/*! ./decorator_utils */ \"./node_modules/inversify/lib/annotation/decorator_utils.js\");\nfunction optional() {\n return function (target, targetKey, index) {\n var metadata = new metadata_1.Metadata(METADATA_KEY.OPTIONAL_TAG, true);\n if (typeof index === \"number\") {\n decorator_utils_1.tagParameter(target, targetKey, index, metadata);\n }\n else {\n decorator_utils_1.tagProperty(target, targetKey, metadata);\n }\n };\n}\nexports.optional = optional;\n//# sourceMappingURL=optional.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/optional.js?"); +eval("\nvar NATIVE_BIND = __webpack_require__(/*! ../internals/function-bind-native */ \"./node_modules/core-js/internals/function-bind-native.js\");\n\nvar FunctionPrototype = Function.prototype;\nvar apply = FunctionPrototype.apply;\nvar call = FunctionPrototype.call;\n\n// eslint-disable-next-line es/no-reflect -- safe\nmodule.exports = typeof Reflect == 'object' && Reflect.apply || (NATIVE_BIND ? call.bind(apply) : function () {\n return call.apply(apply, arguments);\n});\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/function-apply.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/post_construct.js": -/*!*****************************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/post_construct.js ***! - \*****************************************************************/ +/***/ "./node_modules/core-js/internals/function-uncurry-this-accessor.js": +/*!**************************************************************************!*\ + !*** ./node_modules/core-js/internals/function-uncurry-this-accessor.js ***! + \**************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.postConstruct = void 0;\nvar ERRORS_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nfunction postConstruct() {\n return function (target, propertyKey, descriptor) {\n var metadata = new metadata_1.Metadata(METADATA_KEY.POST_CONSTRUCT, propertyKey);\n if (Reflect.hasOwnMetadata(METADATA_KEY.POST_CONSTRUCT, target.constructor)) {\n throw new Error(ERRORS_MSGS.MULTIPLE_POST_CONSTRUCT_METHODS);\n }\n Reflect.defineMetadata(METADATA_KEY.POST_CONSTRUCT, metadata, target.constructor);\n };\n}\nexports.postConstruct = postConstruct;\n//# sourceMappingURL=post_construct.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/post_construct.js?"); +eval("\nvar uncurryThis = __webpack_require__(/*! ../internals/function-uncurry-this */ \"./node_modules/core-js/internals/function-uncurry-this.js\");\nvar aCallable = __webpack_require__(/*! ../internals/a-callable */ \"./node_modules/core-js/internals/a-callable.js\");\n\nmodule.exports = function (object, key, method) {\n try {\n // eslint-disable-next-line es/no-object-getownpropertydescriptor -- safe\n return uncurryThis(aCallable(Object.getOwnPropertyDescriptor(object, key)[method]));\n } catch (error) { /* empty */ }\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/function-uncurry-this-accessor.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/tagged.js": -/*!*********************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/tagged.js ***! - \*********************************************************/ +/***/ "./node_modules/core-js/internals/inherit-if-required.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/internals/inherit-if-required.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.tagged = void 0;\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar decorator_utils_1 = __webpack_require__(/*! ./decorator_utils */ \"./node_modules/inversify/lib/annotation/decorator_utils.js\");\nfunction tagged(metadataKey, metadataValue) {\n return function (target, targetKey, index) {\n var metadata = new metadata_1.Metadata(metadataKey, metadataValue);\n if (typeof index === \"number\") {\n decorator_utils_1.tagParameter(target, targetKey, index, metadata);\n }\n else {\n decorator_utils_1.tagProperty(target, targetKey, metadata);\n }\n };\n}\nexports.tagged = tagged;\n//# sourceMappingURL=tagged.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/tagged.js?"); +eval("\nvar isCallable = __webpack_require__(/*! ../internals/is-callable */ \"./node_modules/core-js/internals/is-callable.js\");\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js/internals/is-object.js\");\nvar setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ \"./node_modules/core-js/internals/object-set-prototype-of.js\");\n\n// makes subclassing work correct for wrapped built-ins\nmodule.exports = function ($this, dummy, Wrapper) {\n var NewTarget, NewTargetPrototype;\n if (\n // it can work only with native `setPrototypeOf`\n setPrototypeOf &&\n // we haven't completely correct pre-ES6 way for getting `new.target`, so use this\n isCallable(NewTarget = dummy.constructor) &&\n NewTarget !== Wrapper &&\n isObject(NewTargetPrototype = NewTarget.prototype) &&\n NewTargetPrototype !== Wrapper.prototype\n ) setPrototypeOf($this, NewTargetPrototype);\n return $this;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/inherit-if-required.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/target_name.js": -/*!**************************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/target_name.js ***! - \**************************************************************/ +/***/ "./node_modules/core-js/internals/install-error-cause.js": +/*!***************************************************************!*\ + !*** ./node_modules/core-js/internals/install-error-cause.js ***! + \***************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.targetName = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar decorator_utils_1 = __webpack_require__(/*! ./decorator_utils */ \"./node_modules/inversify/lib/annotation/decorator_utils.js\");\nfunction targetName(name) {\n return function (target, targetKey, index) {\n var metadata = new metadata_1.Metadata(METADATA_KEY.NAME_TAG, name);\n decorator_utils_1.tagParameter(target, targetKey, index, metadata);\n };\n}\nexports.targetName = targetName;\n//# sourceMappingURL=target_name.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/target_name.js?"); +eval("\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js/internals/is-object.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js/internals/create-non-enumerable-property.js\");\n\n// `InstallErrorCause` abstract operation\n// https://tc39.es/proposal-error-cause/#sec-errorobjects-install-error-cause\nmodule.exports = function (O, options) {\n if (isObject(options) && 'cause' in options) {\n createNonEnumerableProperty(O, 'cause', options.cause);\n }\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/install-error-cause.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/annotation/unmanaged.js": -/*!************************************************************!*\ - !*** ./node_modules/inversify/lib/annotation/unmanaged.js ***! - \************************************************************/ +/***/ "./node_modules/core-js/internals/is-possible-prototype.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/internals/is-possible-prototype.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.unmanaged = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar decorator_utils_1 = __webpack_require__(/*! ./decorator_utils */ \"./node_modules/inversify/lib/annotation/decorator_utils.js\");\nfunction unmanaged() {\n return function (target, targetKey, index) {\n var metadata = new metadata_1.Metadata(METADATA_KEY.UNMANAGED_TAG, true);\n decorator_utils_1.tagParameter(target, targetKey, index, metadata);\n };\n}\nexports.unmanaged = unmanaged;\n//# sourceMappingURL=unmanaged.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/annotation/unmanaged.js?"); +eval("\nvar isObject = __webpack_require__(/*! ../internals/is-object */ \"./node_modules/core-js/internals/is-object.js\");\n\nmodule.exports = function (argument) {\n return isObject(argument) || argument === null;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/is-possible-prototype.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/bindings/binding.js": -/*!********************************************************!*\ - !*** ./node_modules/inversify/lib/bindings/binding.js ***! - \********************************************************/ +/***/ "./node_modules/core-js/internals/normalize-string-argument.js": +/*!*********************************************************************!*\ + !*** ./node_modules/core-js/internals/normalize-string-argument.js ***! + \*********************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Binding = void 0;\nvar literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nvar id_1 = __webpack_require__(/*! ../utils/id */ \"./node_modules/inversify/lib/utils/id.js\");\nvar Binding = (function () {\n function Binding(serviceIdentifier, scope) {\n this.id = id_1.id();\n this.activated = false;\n this.serviceIdentifier = serviceIdentifier;\n this.scope = scope;\n this.type = literal_types_1.BindingTypeEnum.Invalid;\n this.constraint = function (request) { return true; };\n this.implementationType = null;\n this.cache = null;\n this.factory = null;\n this.provider = null;\n this.onActivation = null;\n this.dynamicValue = null;\n }\n Binding.prototype.clone = function () {\n var clone = new Binding(this.serviceIdentifier, this.scope);\n clone.activated = (clone.scope === literal_types_1.BindingScopeEnum.Singleton) ? this.activated : false;\n clone.implementationType = this.implementationType;\n clone.dynamicValue = this.dynamicValue;\n clone.scope = this.scope;\n clone.type = this.type;\n clone.factory = this.factory;\n clone.provider = this.provider;\n clone.constraint = this.constraint;\n clone.onActivation = this.onActivation;\n clone.cache = this.cache;\n return clone;\n };\n return Binding;\n}());\nexports.Binding = Binding;\n//# sourceMappingURL=binding.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/bindings/binding.js?"); +eval("\nvar toString = __webpack_require__(/*! ../internals/to-string */ \"./node_modules/core-js/internals/to-string.js\");\n\nmodule.exports = function (argument, $default) {\n return argument === undefined ? arguments.length < 2 ? '' : $default : toString(argument);\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/normalize-string-argument.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/bindings/binding_count.js": -/*!**************************************************************!*\ - !*** ./node_modules/inversify/lib/bindings/binding_count.js ***! - \**************************************************************/ +/***/ "./node_modules/core-js/internals/object-set-prototype-of.js": +/*!*******************************************************************!*\ + !*** ./node_modules/core-js/internals/object-set-prototype-of.js ***! + \*******************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingCount = void 0;\nvar BindingCount = {\n MultipleBindingsAvailable: 2,\n NoBindingsAvailable: 0,\n OnlyOneBindingAvailable: 1\n};\nexports.BindingCount = BindingCount;\n//# sourceMappingURL=binding_count.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/bindings/binding_count.js?"); +eval("\n/* eslint-disable no-proto -- safe */\nvar uncurryThisAccessor = __webpack_require__(/*! ../internals/function-uncurry-this-accessor */ \"./node_modules/core-js/internals/function-uncurry-this-accessor.js\");\nvar anObject = __webpack_require__(/*! ../internals/an-object */ \"./node_modules/core-js/internals/an-object.js\");\nvar aPossiblePrototype = __webpack_require__(/*! ../internals/a-possible-prototype */ \"./node_modules/core-js/internals/a-possible-prototype.js\");\n\n// `Object.setPrototypeOf` method\n// https://tc39.es/ecma262/#sec-object.setprototypeof\n// Works with __proto__ only. Old v8 can't work with null proto objects.\n// eslint-disable-next-line es/no-object-setprototypeof -- safe\nmodule.exports = Object.setPrototypeOf || ('__proto__' in {} ? function () {\n var CORRECT_SETTER = false;\n var test = {};\n var setter;\n try {\n setter = uncurryThisAccessor(Object.prototype, '__proto__', 'set');\n setter(test, []);\n CORRECT_SETTER = test instanceof Array;\n } catch (error) { /* empty */ }\n return function setPrototypeOf(O, proto) {\n anObject(O);\n aPossiblePrototype(proto);\n if (CORRECT_SETTER) setter(O, proto);\n else O.__proto__ = proto;\n return O;\n };\n}() : undefined);\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/object-set-prototype-of.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/constants/error_msgs.js": -/*!************************************************************!*\ - !*** ./node_modules/inversify/lib/constants/error_msgs.js ***! - \************************************************************/ +/***/ "./node_modules/core-js/internals/proxy-accessor.js": +/*!**********************************************************!*\ + !*** ./node_modules/core-js/internals/proxy-accessor.js ***! + \**********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.STACK_OVERFLOW = exports.CIRCULAR_DEPENDENCY_IN_FACTORY = exports.POST_CONSTRUCT_ERROR = exports.MULTIPLE_POST_CONSTRUCT_METHODS = exports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = exports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = exports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = exports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = exports.ARGUMENTS_LENGTH_MISMATCH = exports.INVALID_DECORATOR_OPERATION = exports.INVALID_TO_SELF_VALUE = exports.INVALID_FUNCTION_BINDING = exports.INVALID_MIDDLEWARE_RETURN = exports.NO_MORE_SNAPSHOTS_AVAILABLE = exports.INVALID_BINDING_TYPE = exports.NOT_IMPLEMENTED = exports.CIRCULAR_DEPENDENCY = exports.UNDEFINED_INJECT_ANNOTATION = exports.MISSING_INJECT_ANNOTATION = exports.MISSING_INJECTABLE_ANNOTATION = exports.NOT_REGISTERED = exports.CANNOT_UNBIND = exports.AMBIGUOUS_MATCH = exports.KEY_NOT_FOUND = exports.NULL_ARGUMENT = exports.DUPLICATED_METADATA = exports.DUPLICATED_INJECTABLE_DECORATOR = void 0;\nexports.DUPLICATED_INJECTABLE_DECORATOR = \"Cannot apply @injectable decorator multiple times.\";\nexports.DUPLICATED_METADATA = \"Metadata key was used more than once in a parameter:\";\nexports.NULL_ARGUMENT = \"NULL argument\";\nexports.KEY_NOT_FOUND = \"Key Not Found\";\nexports.AMBIGUOUS_MATCH = \"Ambiguous match found for serviceIdentifier:\";\nexports.CANNOT_UNBIND = \"Could not unbind serviceIdentifier:\";\nexports.NOT_REGISTERED = \"No matching bindings found for serviceIdentifier:\";\nexports.MISSING_INJECTABLE_ANNOTATION = \"Missing required @injectable annotation in:\";\nexports.MISSING_INJECT_ANNOTATION = \"Missing required @inject or @multiInject annotation in:\";\nvar UNDEFINED_INJECT_ANNOTATION = function (name) {\n return \"@inject called with undefined this could mean that the class \" + name + \" has \" +\n \"a circular dependency problem. You can use a LazyServiceIdentifer to \" +\n \"overcome this limitation.\";\n};\nexports.UNDEFINED_INJECT_ANNOTATION = UNDEFINED_INJECT_ANNOTATION;\nexports.CIRCULAR_DEPENDENCY = \"Circular dependency found:\";\nexports.NOT_IMPLEMENTED = \"Sorry, this feature is not fully implemented yet.\";\nexports.INVALID_BINDING_TYPE = \"Invalid binding type:\";\nexports.NO_MORE_SNAPSHOTS_AVAILABLE = \"No snapshot available to restore.\";\nexports.INVALID_MIDDLEWARE_RETURN = \"Invalid return type in middleware. Middleware must return!\";\nexports.INVALID_FUNCTION_BINDING = \"Value provided to function binding must be a function!\";\nexports.INVALID_TO_SELF_VALUE = \"The toSelf function can only be applied when a constructor is \" +\n \"used as service identifier\";\nexports.INVALID_DECORATOR_OPERATION = \"The @inject @multiInject @tagged and @named decorators \" +\n \"must be applied to the parameters of a class constructor or a class property.\";\nvar ARGUMENTS_LENGTH_MISMATCH = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n return \"The number of constructor arguments in the derived class \" +\n (values[0] + \" must be >= than the number of constructor arguments of its base class.\");\n};\nexports.ARGUMENTS_LENGTH_MISMATCH = ARGUMENTS_LENGTH_MISMATCH;\nexports.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT = \"Invalid Container constructor argument. Container options \" +\n \"must be an object.\";\nexports.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE = \"Invalid Container option. Default scope must \" +\n \"be a string ('singleton' or 'transient').\";\nexports.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE = \"Invalid Container option. Auto bind injectable must \" +\n \"be a boolean\";\nexports.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK = \"Invalid Container option. Skip base check must \" +\n \"be a boolean\";\nexports.MULTIPLE_POST_CONSTRUCT_METHODS = \"Cannot apply @postConstruct decorator multiple times in the same class\";\nvar POST_CONSTRUCT_ERROR = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n return \"@postConstruct error in class \" + values[0] + \": \" + values[1];\n};\nexports.POST_CONSTRUCT_ERROR = POST_CONSTRUCT_ERROR;\nvar CIRCULAR_DEPENDENCY_IN_FACTORY = function () {\n var values = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n values[_i] = arguments[_i];\n }\n return \"It looks like there is a circular dependency \" +\n (\"in one of the '\" + values[0] + \"' bindings. Please investigate bindings with\") +\n (\"service identifier '\" + values[1] + \"'.\");\n};\nexports.CIRCULAR_DEPENDENCY_IN_FACTORY = CIRCULAR_DEPENDENCY_IN_FACTORY;\nexports.STACK_OVERFLOW = \"Maximum call stack size exceeded\";\n//# sourceMappingURL=error_msgs.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/constants/error_msgs.js?"); +eval("\nvar defineProperty = __webpack_require__(/*! ../internals/object-define-property */ \"./node_modules/core-js/internals/object-define-property.js\").f;\n\nmodule.exports = function (Target, Source, key) {\n key in Target || defineProperty(Target, key, {\n configurable: true,\n get: function () { return Source[key]; },\n set: function (it) { Source[key] = it; }\n });\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/proxy-accessor.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/constants/literal_types.js": -/*!***************************************************************!*\ - !*** ./node_modules/inversify/lib/constants/literal_types.js ***! - \***************************************************************/ +/***/ "./node_modules/core-js/internals/to-string-tag-support.js": +/*!*****************************************************************!*\ + !*** ./node_modules/core-js/internals/to-string-tag-support.js ***! + \*****************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.TargetTypeEnum = exports.BindingTypeEnum = exports.BindingScopeEnum = void 0;\nvar BindingScopeEnum = {\n Request: \"Request\",\n Singleton: \"Singleton\",\n Transient: \"Transient\"\n};\nexports.BindingScopeEnum = BindingScopeEnum;\nvar BindingTypeEnum = {\n ConstantValue: \"ConstantValue\",\n Constructor: \"Constructor\",\n DynamicValue: \"DynamicValue\",\n Factory: \"Factory\",\n Function: \"Function\",\n Instance: \"Instance\",\n Invalid: \"Invalid\",\n Provider: \"Provider\"\n};\nexports.BindingTypeEnum = BindingTypeEnum;\nvar TargetTypeEnum = {\n ClassProperty: \"ClassProperty\",\n ConstructorArgument: \"ConstructorArgument\",\n Variable: \"Variable\"\n};\nexports.TargetTypeEnum = TargetTypeEnum;\n//# sourceMappingURL=literal_types.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/constants/literal_types.js?"); +eval("\nvar wellKnownSymbol = __webpack_require__(/*! ../internals/well-known-symbol */ \"./node_modules/core-js/internals/well-known-symbol.js\");\n\nvar TO_STRING_TAG = wellKnownSymbol('toStringTag');\nvar test = {};\n\ntest[TO_STRING_TAG] = 'z';\n\nmodule.exports = String(test) === '[object z]';\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/to-string-tag-support.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/constants/metadata_keys.js": -/*!***************************************************************!*\ - !*** ./node_modules/inversify/lib/constants/metadata_keys.js ***! - \***************************************************************/ +/***/ "./node_modules/core-js/internals/to-string.js": +/*!*****************************************************!*\ + !*** ./node_modules/core-js/internals/to-string.js ***! + \*****************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.NON_CUSTOM_TAG_KEYS = exports.POST_CONSTRUCT = exports.DESIGN_PARAM_TYPES = exports.PARAM_TYPES = exports.TAGGED_PROP = exports.TAGGED = exports.MULTI_INJECT_TAG = exports.INJECT_TAG = exports.OPTIONAL_TAG = exports.UNMANAGED_TAG = exports.NAME_TAG = exports.NAMED_TAG = void 0;\nexports.NAMED_TAG = \"named\";\nexports.NAME_TAG = \"name\";\nexports.UNMANAGED_TAG = \"unmanaged\";\nexports.OPTIONAL_TAG = \"optional\";\nexports.INJECT_TAG = \"inject\";\nexports.MULTI_INJECT_TAG = \"multi_inject\";\nexports.TAGGED = \"inversify:tagged\";\nexports.TAGGED_PROP = \"inversify:tagged_props\";\nexports.PARAM_TYPES = \"inversify:paramtypes\";\nexports.DESIGN_PARAM_TYPES = \"design:paramtypes\";\nexports.POST_CONSTRUCT = \"post_construct\";\nfunction getNonCustomTagKeys() {\n return [\n exports.INJECT_TAG,\n exports.MULTI_INJECT_TAG,\n exports.NAME_TAG,\n exports.UNMANAGED_TAG,\n exports.NAMED_TAG,\n exports.OPTIONAL_TAG,\n ];\n}\nexports.NON_CUSTOM_TAG_KEYS = getNonCustomTagKeys();\n//# sourceMappingURL=metadata_keys.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/constants/metadata_keys.js?"); +eval("\nvar classof = __webpack_require__(/*! ../internals/classof */ \"./node_modules/core-js/internals/classof.js\");\n\nvar $String = String;\n\nmodule.exports = function (argument) {\n if (classof(argument) === 'Symbol') throw new TypeError('Cannot convert a Symbol value to a string');\n return $String(argument);\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/to-string.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/container/container.js": -/*!***********************************************************!*\ - !*** ./node_modules/inversify/lib/container/container.js ***! - \***********************************************************/ +/***/ "./node_modules/core-js/internals/wrap-error-constructor-with-cause.js": +/*!*****************************************************************************!*\ + !*** ./node_modules/core-js/internals/wrap-error-constructor-with-cause.js ***! + \*****************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nvar __awaiter = (this && this.__awaiter) || function (thisArg, _arguments, P, generator) {\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\n return new (P || (P = Promise))(function (resolve, reject) {\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\n step((generator = generator.apply(thisArg, _arguments || [])).next());\n });\n};\nvar __generator = (this && this.__generator) || function (thisArg, body) {\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\n function verb(n) { return function (v) { return step([n, v]); }; }\n function step(op) {\n if (f) throw new TypeError(\"Generator is already executing.\");\n while (_) try {\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\n if (y = 0, t) op = [op[0] & 2, t.value];\n switch (op[0]) {\n case 0: case 1: t = op; break;\n case 4: _.label++; return { value: op[1], done: false };\n case 5: _.label++; y = op[1]; op = [0]; continue;\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\n default:\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\n if (t[2]) _.ops.pop();\n _.trys.pop(); continue;\n }\n op = body.call(thisArg, _);\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\n }\n};\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Container = void 0;\nvar binding_1 = __webpack_require__(/*! ../bindings/binding */ \"./node_modules/inversify/lib/bindings/binding.js\");\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_reader_1 = __webpack_require__(/*! ../planning/metadata_reader */ \"./node_modules/inversify/lib/planning/metadata_reader.js\");\nvar planner_1 = __webpack_require__(/*! ../planning/planner */ \"./node_modules/inversify/lib/planning/planner.js\");\nvar resolver_1 = __webpack_require__(/*! ../resolution/resolver */ \"./node_modules/inversify/lib/resolution/resolver.js\");\nvar binding_to_syntax_1 = __webpack_require__(/*! ../syntax/binding_to_syntax */ \"./node_modules/inversify/lib/syntax/binding_to_syntax.js\");\nvar id_1 = __webpack_require__(/*! ../utils/id */ \"./node_modules/inversify/lib/utils/id.js\");\nvar serialization_1 = __webpack_require__(/*! ../utils/serialization */ \"./node_modules/inversify/lib/utils/serialization.js\");\nvar container_snapshot_1 = __webpack_require__(/*! ./container_snapshot */ \"./node_modules/inversify/lib/container/container_snapshot.js\");\nvar lookup_1 = __webpack_require__(/*! ./lookup */ \"./node_modules/inversify/lib/container/lookup.js\");\nvar Container = (function () {\n function Container(containerOptions) {\n this._appliedMiddleware = [];\n var options = containerOptions || {};\n if (typeof options !== \"object\") {\n throw new Error(\"\" + ERROR_MSGS.CONTAINER_OPTIONS_MUST_BE_AN_OBJECT);\n }\n if (options.defaultScope === undefined) {\n options.defaultScope = literal_types_1.BindingScopeEnum.Transient;\n }\n else if (options.defaultScope !== literal_types_1.BindingScopeEnum.Singleton &&\n options.defaultScope !== literal_types_1.BindingScopeEnum.Transient &&\n options.defaultScope !== literal_types_1.BindingScopeEnum.Request) {\n throw new Error(\"\" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_DEFAULT_SCOPE);\n }\n if (options.autoBindInjectable === undefined) {\n options.autoBindInjectable = false;\n }\n else if (typeof options.autoBindInjectable !== \"boolean\") {\n throw new Error(\"\" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_AUTO_BIND_INJECTABLE);\n }\n if (options.skipBaseClassChecks === undefined) {\n options.skipBaseClassChecks = false;\n }\n else if (typeof options.skipBaseClassChecks !== \"boolean\") {\n throw new Error(\"\" + ERROR_MSGS.CONTAINER_OPTIONS_INVALID_SKIP_BASE_CHECK);\n }\n this.options = {\n autoBindInjectable: options.autoBindInjectable,\n defaultScope: options.defaultScope,\n skipBaseClassChecks: options.skipBaseClassChecks\n };\n this.id = id_1.id();\n this._bindingDictionary = new lookup_1.Lookup();\n this._snapshots = [];\n this._middleware = null;\n this.parent = null;\n this._metadataReader = new metadata_reader_1.MetadataReader();\n }\n Container.merge = function (container1, container2) {\n var container3 = [];\n for (var _i = 2; _i < arguments.length; _i++) {\n container3[_i - 2] = arguments[_i];\n }\n var container = new Container();\n var targetContainers = __spreadArray([container1, container2], container3).map(function (targetContainer) { return planner_1.getBindingDictionary(targetContainer); });\n var bindingDictionary = planner_1.getBindingDictionary(container);\n function copyDictionary(origin, destination) {\n origin.traverse(function (key, value) {\n value.forEach(function (binding) {\n destination.add(binding.serviceIdentifier, binding.clone());\n });\n });\n }\n targetContainers.forEach(function (targetBindingDictionary) {\n copyDictionary(targetBindingDictionary, bindingDictionary);\n });\n return container;\n };\n Container.prototype.load = function () {\n var modules = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n modules[_i] = arguments[_i];\n }\n var getHelpers = this._getContainerModuleHelpersFactory();\n for (var _a = 0, modules_1 = modules; _a < modules_1.length; _a++) {\n var currentModule = modules_1[_a];\n var containerModuleHelpers = getHelpers(currentModule.id);\n currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction);\n }\n };\n Container.prototype.loadAsync = function () {\n var modules = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n modules[_i] = arguments[_i];\n }\n return __awaiter(this, void 0, void 0, function () {\n var getHelpers, _a, modules_2, currentModule, containerModuleHelpers;\n return __generator(this, function (_b) {\n switch (_b.label) {\n case 0:\n getHelpers = this._getContainerModuleHelpersFactory();\n _a = 0, modules_2 = modules;\n _b.label = 1;\n case 1:\n if (!(_a < modules_2.length)) return [3, 4];\n currentModule = modules_2[_a];\n containerModuleHelpers = getHelpers(currentModule.id);\n return [4, currentModule.registry(containerModuleHelpers.bindFunction, containerModuleHelpers.unbindFunction, containerModuleHelpers.isboundFunction, containerModuleHelpers.rebindFunction)];\n case 2:\n _b.sent();\n _b.label = 3;\n case 3:\n _a++;\n return [3, 1];\n case 4: return [2];\n }\n });\n });\n };\n Container.prototype.unload = function () {\n var _this = this;\n var modules = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n modules[_i] = arguments[_i];\n }\n var conditionFactory = function (expected) { return function (item) {\n return item.moduleId === expected;\n }; };\n modules.forEach(function (module) {\n var condition = conditionFactory(module.id);\n _this._bindingDictionary.removeByCondition(condition);\n });\n };\n Container.prototype.bind = function (serviceIdentifier) {\n var scope = this.options.defaultScope || literal_types_1.BindingScopeEnum.Transient;\n var binding = new binding_1.Binding(serviceIdentifier, scope);\n this._bindingDictionary.add(serviceIdentifier, binding);\n return new binding_to_syntax_1.BindingToSyntax(binding);\n };\n Container.prototype.rebind = function (serviceIdentifier) {\n this.unbind(serviceIdentifier);\n return this.bind(serviceIdentifier);\n };\n Container.prototype.unbind = function (serviceIdentifier) {\n try {\n this._bindingDictionary.remove(serviceIdentifier);\n }\n catch (e) {\n throw new Error(ERROR_MSGS.CANNOT_UNBIND + \" \" + serialization_1.getServiceIdentifierAsString(serviceIdentifier));\n }\n };\n Container.prototype.unbindAll = function () {\n this._bindingDictionary = new lookup_1.Lookup();\n };\n Container.prototype.isBound = function (serviceIdentifier) {\n var bound = this._bindingDictionary.hasKey(serviceIdentifier);\n if (!bound && this.parent) {\n bound = this.parent.isBound(serviceIdentifier);\n }\n return bound;\n };\n Container.prototype.isBoundNamed = function (serviceIdentifier, named) {\n return this.isBoundTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n };\n Container.prototype.isBoundTagged = function (serviceIdentifier, key, value) {\n var bound = false;\n if (this._bindingDictionary.hasKey(serviceIdentifier)) {\n var bindings = this._bindingDictionary.get(serviceIdentifier);\n var request_1 = planner_1.createMockRequest(this, serviceIdentifier, key, value);\n bound = bindings.some(function (b) { return b.constraint(request_1); });\n }\n if (!bound && this.parent) {\n bound = this.parent.isBoundTagged(serviceIdentifier, key, value);\n }\n return bound;\n };\n Container.prototype.snapshot = function () {\n this._snapshots.push(container_snapshot_1.ContainerSnapshot.of(this._bindingDictionary.clone(), this._middleware));\n };\n Container.prototype.restore = function () {\n var snapshot = this._snapshots.pop();\n if (snapshot === undefined) {\n throw new Error(ERROR_MSGS.NO_MORE_SNAPSHOTS_AVAILABLE);\n }\n this._bindingDictionary = snapshot.bindings;\n this._middleware = snapshot.middleware;\n };\n Container.prototype.createChild = function (containerOptions) {\n var child = new Container(containerOptions || this.options);\n child.parent = this;\n return child;\n };\n Container.prototype.applyMiddleware = function () {\n var middlewares = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n middlewares[_i] = arguments[_i];\n }\n this._appliedMiddleware = this._appliedMiddleware.concat(middlewares);\n var initial = (this._middleware) ? this._middleware : this._planAndResolve();\n this._middleware = middlewares.reduce(function (prev, curr) { return curr(prev); }, initial);\n };\n Container.prototype.applyCustomMetadataReader = function (metadataReader) {\n this._metadataReader = metadataReader;\n };\n Container.prototype.get = function (serviceIdentifier) {\n return this._get(false, false, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier);\n };\n Container.prototype.getTagged = function (serviceIdentifier, key, value) {\n return this._get(false, false, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier, key, value);\n };\n Container.prototype.getNamed = function (serviceIdentifier, named) {\n return this.getTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n };\n Container.prototype.getAll = function (serviceIdentifier) {\n return this._get(true, true, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier);\n };\n Container.prototype.getAllTagged = function (serviceIdentifier, key, value) {\n return this._get(false, true, literal_types_1.TargetTypeEnum.Variable, serviceIdentifier, key, value);\n };\n Container.prototype.getAllNamed = function (serviceIdentifier, named) {\n return this.getAllTagged(serviceIdentifier, METADATA_KEY.NAMED_TAG, named);\n };\n Container.prototype.resolve = function (constructorFunction) {\n var tempContainer = this.createChild();\n tempContainer.bind(constructorFunction).toSelf();\n this._appliedMiddleware.forEach(function (m) {\n tempContainer.applyMiddleware(m);\n });\n return tempContainer.get(constructorFunction);\n };\n Container.prototype._getContainerModuleHelpersFactory = function () {\n var _this = this;\n var setModuleId = function (bindingToSyntax, moduleId) {\n bindingToSyntax._binding.moduleId = moduleId;\n };\n var getBindFunction = function (moduleId) {\n return function (serviceIdentifier) {\n var _bind = _this.bind.bind(_this);\n var bindingToSyntax = _bind(serviceIdentifier);\n setModuleId(bindingToSyntax, moduleId);\n return bindingToSyntax;\n };\n };\n var getUnbindFunction = function (moduleId) {\n return function (serviceIdentifier) {\n var _unbind = _this.unbind.bind(_this);\n _unbind(serviceIdentifier);\n };\n };\n var getIsboundFunction = function (moduleId) {\n return function (serviceIdentifier) {\n var _isBound = _this.isBound.bind(_this);\n return _isBound(serviceIdentifier);\n };\n };\n var getRebindFunction = function (moduleId) {\n return function (serviceIdentifier) {\n var _rebind = _this.rebind.bind(_this);\n var bindingToSyntax = _rebind(serviceIdentifier);\n setModuleId(bindingToSyntax, moduleId);\n return bindingToSyntax;\n };\n };\n return function (mId) { return ({\n bindFunction: getBindFunction(mId),\n isboundFunction: getIsboundFunction(mId),\n rebindFunction: getRebindFunction(mId),\n unbindFunction: getUnbindFunction(mId)\n }); };\n };\n Container.prototype._get = function (avoidConstraints, isMultiInject, targetType, serviceIdentifier, key, value) {\n var result = null;\n var defaultArgs = {\n avoidConstraints: avoidConstraints,\n contextInterceptor: function (context) { return context; },\n isMultiInject: isMultiInject,\n key: key,\n serviceIdentifier: serviceIdentifier,\n targetType: targetType,\n value: value\n };\n if (this._middleware) {\n result = this._middleware(defaultArgs);\n if (result === undefined || result === null) {\n throw new Error(ERROR_MSGS.INVALID_MIDDLEWARE_RETURN);\n }\n }\n else {\n result = this._planAndResolve()(defaultArgs);\n }\n return result;\n };\n Container.prototype._planAndResolve = function () {\n var _this = this;\n return function (args) {\n var context = planner_1.plan(_this._metadataReader, _this, args.isMultiInject, args.targetType, args.serviceIdentifier, args.key, args.value, args.avoidConstraints);\n context = args.contextInterceptor(context);\n var result = resolver_1.resolve(context);\n return result;\n };\n };\n return Container;\n}());\nexports.Container = Container;\n//# sourceMappingURL=container.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/container/container.js?"); +eval("\nvar getBuiltIn = __webpack_require__(/*! ../internals/get-built-in */ \"./node_modules/core-js/internals/get-built-in.js\");\nvar hasOwn = __webpack_require__(/*! ../internals/has-own-property */ \"./node_modules/core-js/internals/has-own-property.js\");\nvar createNonEnumerableProperty = __webpack_require__(/*! ../internals/create-non-enumerable-property */ \"./node_modules/core-js/internals/create-non-enumerable-property.js\");\nvar isPrototypeOf = __webpack_require__(/*! ../internals/object-is-prototype-of */ \"./node_modules/core-js/internals/object-is-prototype-of.js\");\nvar setPrototypeOf = __webpack_require__(/*! ../internals/object-set-prototype-of */ \"./node_modules/core-js/internals/object-set-prototype-of.js\");\nvar copyConstructorProperties = __webpack_require__(/*! ../internals/copy-constructor-properties */ \"./node_modules/core-js/internals/copy-constructor-properties.js\");\nvar proxyAccessor = __webpack_require__(/*! ../internals/proxy-accessor */ \"./node_modules/core-js/internals/proxy-accessor.js\");\nvar inheritIfRequired = __webpack_require__(/*! ../internals/inherit-if-required */ \"./node_modules/core-js/internals/inherit-if-required.js\");\nvar normalizeStringArgument = __webpack_require__(/*! ../internals/normalize-string-argument */ \"./node_modules/core-js/internals/normalize-string-argument.js\");\nvar installErrorCause = __webpack_require__(/*! ../internals/install-error-cause */ \"./node_modules/core-js/internals/install-error-cause.js\");\nvar installErrorStack = __webpack_require__(/*! ../internals/error-stack-install */ \"./node_modules/core-js/internals/error-stack-install.js\");\nvar DESCRIPTORS = __webpack_require__(/*! ../internals/descriptors */ \"./node_modules/core-js/internals/descriptors.js\");\nvar IS_PURE = __webpack_require__(/*! ../internals/is-pure */ \"./node_modules/core-js/internals/is-pure.js\");\n\nmodule.exports = function (FULL_NAME, wrapper, FORCED, IS_AGGREGATE_ERROR) {\n var STACK_TRACE_LIMIT = 'stackTraceLimit';\n var OPTIONS_POSITION = IS_AGGREGATE_ERROR ? 2 : 1;\n var path = FULL_NAME.split('.');\n var ERROR_NAME = path[path.length - 1];\n var OriginalError = getBuiltIn.apply(null, path);\n\n if (!OriginalError) return;\n\n var OriginalErrorPrototype = OriginalError.prototype;\n\n // V8 9.3- bug https://bugs.chromium.org/p/v8/issues/detail?id=12006\n if (!IS_PURE && hasOwn(OriginalErrorPrototype, 'cause')) delete OriginalErrorPrototype.cause;\n\n if (!FORCED) return OriginalError;\n\n var BaseError = getBuiltIn('Error');\n\n var WrappedError = wrapper(function (a, b) {\n var message = normalizeStringArgument(IS_AGGREGATE_ERROR ? b : a, undefined);\n var result = IS_AGGREGATE_ERROR ? new OriginalError(a) : new OriginalError();\n if (message !== undefined) createNonEnumerableProperty(result, 'message', message);\n installErrorStack(result, WrappedError, result.stack, 2);\n if (this && isPrototypeOf(OriginalErrorPrototype, this)) inheritIfRequired(result, this, WrappedError);\n if (arguments.length > OPTIONS_POSITION) installErrorCause(result, arguments[OPTIONS_POSITION]);\n return result;\n });\n\n WrappedError.prototype = OriginalErrorPrototype;\n\n if (ERROR_NAME !== 'Error') {\n if (setPrototypeOf) setPrototypeOf(WrappedError, BaseError);\n else copyConstructorProperties(WrappedError, BaseError, { name: true });\n } else if (DESCRIPTORS && STACK_TRACE_LIMIT in OriginalError) {\n proxyAccessor(WrappedError, OriginalError, STACK_TRACE_LIMIT);\n proxyAccessor(WrappedError, OriginalError, 'prepareStackTrace');\n }\n\n copyConstructorProperties(WrappedError, OriginalError);\n\n if (!IS_PURE) try {\n // Safari 13- bug: WebAssembly errors does not have a proper `.name`\n if (OriginalErrorPrototype.name !== ERROR_NAME) {\n createNonEnumerableProperty(OriginalErrorPrototype, 'name', ERROR_NAME);\n }\n OriginalErrorPrototype.constructor = WrappedError;\n } catch (error) { /* empty */ }\n\n return WrappedError;\n};\n\n\n//# sourceURL=webpack:///./node_modules/core-js/internals/wrap-error-constructor-with-cause.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/container/container_module.js": -/*!******************************************************************!*\ - !*** ./node_modules/inversify/lib/container/container_module.js ***! - \******************************************************************/ +/***/ "./node_modules/core-js/modules/es.error.cause.js": +/*!********************************************************!*\ + !*** ./node_modules/core-js/modules/es.error.cause.js ***! + \********************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.AsyncContainerModule = exports.ContainerModule = void 0;\nvar id_1 = __webpack_require__(/*! ../utils/id */ \"./node_modules/inversify/lib/utils/id.js\");\nvar ContainerModule = (function () {\n function ContainerModule(registry) {\n this.id = id_1.id();\n this.registry = registry;\n }\n return ContainerModule;\n}());\nexports.ContainerModule = ContainerModule;\nvar AsyncContainerModule = (function () {\n function AsyncContainerModule(registry) {\n this.id = id_1.id();\n this.registry = registry;\n }\n return AsyncContainerModule;\n}());\nexports.AsyncContainerModule = AsyncContainerModule;\n//# sourceMappingURL=container_module.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/container/container_module.js?"); +eval("\n/* eslint-disable no-unused-vars -- required for functions `.length` */\nvar $ = __webpack_require__(/*! ../internals/export */ \"./node_modules/core-js/internals/export.js\");\nvar global = __webpack_require__(/*! ../internals/global */ \"./node_modules/core-js/internals/global.js\");\nvar apply = __webpack_require__(/*! ../internals/function-apply */ \"./node_modules/core-js/internals/function-apply.js\");\nvar wrapErrorConstructorWithCause = __webpack_require__(/*! ../internals/wrap-error-constructor-with-cause */ \"./node_modules/core-js/internals/wrap-error-constructor-with-cause.js\");\n\nvar WEB_ASSEMBLY = 'WebAssembly';\nvar WebAssembly = global[WEB_ASSEMBLY];\n\n// eslint-disable-next-line es/no-error-cause -- feature detection\nvar FORCED = new Error('e', { cause: 7 }).cause !== 7;\n\nvar exportGlobalErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(ERROR_NAME, wrapper, FORCED);\n $({ global: true, constructor: true, arity: 1, forced: FORCED }, O);\n};\n\nvar exportWebAssemblyErrorCauseWrapper = function (ERROR_NAME, wrapper) {\n if (WebAssembly && WebAssembly[ERROR_NAME]) {\n var O = {};\n O[ERROR_NAME] = wrapErrorConstructorWithCause(WEB_ASSEMBLY + '.' + ERROR_NAME, wrapper, FORCED);\n $({ target: WEB_ASSEMBLY, stat: true, constructor: true, arity: 1, forced: FORCED }, O);\n }\n};\n\n// https://tc39.es/ecma262/#sec-nativeerror\nexportGlobalErrorCauseWrapper('Error', function (init) {\n return function Error(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('EvalError', function (init) {\n return function EvalError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('RangeError', function (init) {\n return function RangeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('ReferenceError', function (init) {\n return function ReferenceError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('SyntaxError', function (init) {\n return function SyntaxError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('TypeError', function (init) {\n return function TypeError(message) { return apply(init, this, arguments); };\n});\nexportGlobalErrorCauseWrapper('URIError', function (init) {\n return function URIError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('CompileError', function (init) {\n return function CompileError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('LinkError', function (init) {\n return function LinkError(message) { return apply(init, this, arguments); };\n});\nexportWebAssemblyErrorCauseWrapper('RuntimeError', function (init) {\n return function RuntimeError(message) { return apply(init, this, arguments); };\n});\n\n\n//# sourceURL=webpack:///./node_modules/core-js/modules/es.error.cause.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/container/container_snapshot.js": -/*!********************************************************************!*\ - !*** ./node_modules/inversify/lib/container/container_snapshot.js ***! - \********************************************************************/ +/***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/JSEditor.vue?vue&type=style&index=0&id=123e60ea&lang=css": +/*!**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/JSEditor.vue?vue&type=style&index=0&id=123e60ea&lang=css ***! + \**************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.ContainerSnapshot = void 0;\nvar ContainerSnapshot = (function () {\n function ContainerSnapshot() {\n }\n ContainerSnapshot.of = function (bindings, middleware) {\n var snapshot = new ContainerSnapshot();\n snapshot.bindings = bindings;\n snapshot.middleware = middleware;\n return snapshot;\n };\n return ContainerSnapshot;\n}());\nexports.ContainerSnapshot = ContainerSnapshot;\n//# sourceMappingURL=container_snapshot.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/container/container_snapshot.js?"); +eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"\\n.code-edit {\\n border: 1px solid #f0f0f0;\\n}\\n.code-edit .margin-view-overlays.monaco-editor-background {\\n width: 0px !important;\\n}\\n.code-edit .margin-view-overlays.monaco-editor-background .view-line .line-numbers {\\n width: 24px !important;\\n left: 0px !important;\\n}\\n.code-edit .margin-view-overlays.monaco-editor-background .glyph-margin {\\n width: 0px !important;\\n}\\n.code-edit .monaco-scrollable-element.editor-scrollable {\\n left: 32px !important;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack:///./src/components/dag/JSEditor.vue?./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), -/***/ "./node_modules/inversify/lib/container/lookup.js": -/*!********************************************************!*\ - !*** ./node_modules/inversify/lib/container/lookup.js ***! - \********************************************************/ +/***/ "./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/PowerWorkflow.vue?vue&type=style&index=0&id=1175569f&scoped=true&lang=css": +/*!*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/PowerWorkflow.vue?vue&type=style&index=0&id=1175569f&scoped=true&lang=css ***! + \*******************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Lookup = void 0;\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar Lookup = (function () {\n function Lookup() {\n this._map = new Map();\n }\n Lookup.prototype.getMap = function () {\n return this._map;\n };\n Lookup.prototype.add = function (serviceIdentifier, value) {\n if (serviceIdentifier === null || serviceIdentifier === undefined) {\n throw new Error(ERROR_MSGS.NULL_ARGUMENT);\n }\n if (value === null || value === undefined) {\n throw new Error(ERROR_MSGS.NULL_ARGUMENT);\n }\n var entry = this._map.get(serviceIdentifier);\n if (entry !== undefined) {\n entry.push(value);\n this._map.set(serviceIdentifier, entry);\n }\n else {\n this._map.set(serviceIdentifier, [value]);\n }\n };\n Lookup.prototype.get = function (serviceIdentifier) {\n if (serviceIdentifier === null || serviceIdentifier === undefined) {\n throw new Error(ERROR_MSGS.NULL_ARGUMENT);\n }\n var entry = this._map.get(serviceIdentifier);\n if (entry !== undefined) {\n return entry;\n }\n else {\n throw new Error(ERROR_MSGS.KEY_NOT_FOUND);\n }\n };\n Lookup.prototype.remove = function (serviceIdentifier) {\n if (serviceIdentifier === null || serviceIdentifier === undefined) {\n throw new Error(ERROR_MSGS.NULL_ARGUMENT);\n }\n if (!this._map.delete(serviceIdentifier)) {\n throw new Error(ERROR_MSGS.KEY_NOT_FOUND);\n }\n };\n Lookup.prototype.removeByCondition = function (condition) {\n var _this = this;\n this._map.forEach(function (entries, key) {\n var updatedEntries = entries.filter(function (entry) { return !condition(entry); });\n if (updatedEntries.length > 0) {\n _this._map.set(key, updatedEntries);\n }\n else {\n _this._map.delete(key);\n }\n });\n };\n Lookup.prototype.hasKey = function (serviceIdentifier) {\n if (serviceIdentifier === null || serviceIdentifier === undefined) {\n throw new Error(ERROR_MSGS.NULL_ARGUMENT);\n }\n return this._map.has(serviceIdentifier);\n };\n Lookup.prototype.clone = function () {\n var copy = new Lookup();\n this._map.forEach(function (value, key) {\n value.forEach(function (b) { return copy.add(key, b.clone()); });\n });\n return copy;\n };\n Lookup.prototype.traverse = function (func) {\n this._map.forEach(function (value, key) {\n func(key, value);\n });\n };\n return Lookup;\n}());\nexports.Lookup = Lookup;\n//# sourceMappingURL=lookup.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/container/lookup.js?"); +eval("// Imports\nvar ___CSS_LOADER_API_IMPORT___ = __webpack_require__(/*! ../../../node_modules/css-loader/dist/runtime/api.js */ \"./node_modules/css-loader/dist/runtime/api.js\");\nexports = ___CSS_LOADER_API_IMPORT___(false);\n// Module\nexports.push([module.i, \"\\n*[data-v-1175569f],\\n*[data-v-1175569f]::before,\\n*[data-v-1175569f]::after {\\n box-sizing: border-box;\\n}\\n.iconfont[data-v-1175569f] {\\n font-size: 18px !important;\\n}\\n.power-power-flow[data-v-1175569f] {\\n border: 1px solid #d0d0d0;\\n border-top: 0px;\\n /* box-shadow: 0 10px 10px 1px #c0c0c0; */\\n box-sizing: border-box;\\n border-radius: 10px;\\n border-top-left-radius: 0px;\\n border-top-right-radius: 0px;\\n /* width: 700px; */\\n}\\n.job-tools[data-v-1175569f] {\\n width: 100%;\\n box-sizing: border-box;\\n border: 1px solid #d0d0d0;\\n /* box-shadow: 0 0 10px 1px #c0c0c0; */\\n border-radius: 10px;\\n margin-right: 10px;\\n border-bottom-left-radius: 0px;\\n border-bottom-right-radius: 0px;\\n display: flex;\\n padding: 8px 10px;\\n}\\n.job-tools > div[data-v-1175569f] {\\n box-sizing: border-box;\\n height: 30px;\\n width: 30px;\\n display: flex;\\n justify-content: center;\\n align-items: center;\\n cursor: pointer;\\n}\\n.job-tools div[data-v-1175569f]:hover {\\n border: 1px solid #f0f0f0;\\n}\\n.job-tools > div + div[data-v-1175569f] {\\n margin-left: 24px;\\n}\\n.job-tools i[data-v-1175569f] {\\n font-size: 20px;\\n color: #3d3e3e;\\n}\\n.power-job[data-v-1175569f] {\\n width: 100%;\\n background: #fff;\\n}\\n.power-job-body[data-v-1175569f] {\\n display: flex;\\n}\\n.power-job-detail[data-v-1175569f] {\\n flex: 1;\\n border-right: 1px solid #e0e0e0;\\n border-bottom: 1px solid #e0e0e0;\\n}\\n\", \"\"]);\n// Exports\nmodule.exports = exports;\n\n\n//# sourceURL=webpack:///./src/components/dag/PowerWorkflow.vue?./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options"); /***/ }), -/***/ "./node_modules/inversify/lib/inversify.js": -/*!*************************************************!*\ - !*** ./node_modules/inversify/lib/inversify.js ***! - \*************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-color/src/color.js": +/*!********************************************!*\ + !*** ./node_modules/d3-color/src/color.js ***! + \********************************************/ +/*! exports provided: Color, darker, brighter, default, rgbConvert, rgb, Rgb, hslConvert, hsl */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.multiBindToService = exports.getServiceIdentifierAsString = exports.typeConstraint = exports.namedConstraint = exports.taggedConstraint = exports.traverseAncerstors = exports.decorate = exports.id = exports.MetadataReader = exports.postConstruct = exports.targetName = exports.multiInject = exports.unmanaged = exports.optional = exports.LazyServiceIdentifer = exports.inject = exports.named = exports.tagged = exports.injectable = exports.ContainerModule = exports.AsyncContainerModule = exports.TargetTypeEnum = exports.BindingTypeEnum = exports.BindingScopeEnum = exports.Container = exports.METADATA_KEY = void 0;\nvar keys = __webpack_require__(/*! ./constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nexports.METADATA_KEY = keys;\nvar container_1 = __webpack_require__(/*! ./container/container */ \"./node_modules/inversify/lib/container/container.js\");\nObject.defineProperty(exports, \"Container\", { enumerable: true, get: function () { return container_1.Container; } });\nvar literal_types_1 = __webpack_require__(/*! ./constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nObject.defineProperty(exports, \"BindingScopeEnum\", { enumerable: true, get: function () { return literal_types_1.BindingScopeEnum; } });\nObject.defineProperty(exports, \"BindingTypeEnum\", { enumerable: true, get: function () { return literal_types_1.BindingTypeEnum; } });\nObject.defineProperty(exports, \"TargetTypeEnum\", { enumerable: true, get: function () { return literal_types_1.TargetTypeEnum; } });\nvar container_module_1 = __webpack_require__(/*! ./container/container_module */ \"./node_modules/inversify/lib/container/container_module.js\");\nObject.defineProperty(exports, \"AsyncContainerModule\", { enumerable: true, get: function () { return container_module_1.AsyncContainerModule; } });\nObject.defineProperty(exports, \"ContainerModule\", { enumerable: true, get: function () { return container_module_1.ContainerModule; } });\nvar injectable_1 = __webpack_require__(/*! ./annotation/injectable */ \"./node_modules/inversify/lib/annotation/injectable.js\");\nObject.defineProperty(exports, \"injectable\", { enumerable: true, get: function () { return injectable_1.injectable; } });\nvar tagged_1 = __webpack_require__(/*! ./annotation/tagged */ \"./node_modules/inversify/lib/annotation/tagged.js\");\nObject.defineProperty(exports, \"tagged\", { enumerable: true, get: function () { return tagged_1.tagged; } });\nvar named_1 = __webpack_require__(/*! ./annotation/named */ \"./node_modules/inversify/lib/annotation/named.js\");\nObject.defineProperty(exports, \"named\", { enumerable: true, get: function () { return named_1.named; } });\nvar inject_1 = __webpack_require__(/*! ./annotation/inject */ \"./node_modules/inversify/lib/annotation/inject.js\");\nObject.defineProperty(exports, \"inject\", { enumerable: true, get: function () { return inject_1.inject; } });\nObject.defineProperty(exports, \"LazyServiceIdentifer\", { enumerable: true, get: function () { return inject_1.LazyServiceIdentifer; } });\nvar optional_1 = __webpack_require__(/*! ./annotation/optional */ \"./node_modules/inversify/lib/annotation/optional.js\");\nObject.defineProperty(exports, \"optional\", { enumerable: true, get: function () { return optional_1.optional; } });\nvar unmanaged_1 = __webpack_require__(/*! ./annotation/unmanaged */ \"./node_modules/inversify/lib/annotation/unmanaged.js\");\nObject.defineProperty(exports, \"unmanaged\", { enumerable: true, get: function () { return unmanaged_1.unmanaged; } });\nvar multi_inject_1 = __webpack_require__(/*! ./annotation/multi_inject */ \"./node_modules/inversify/lib/annotation/multi_inject.js\");\nObject.defineProperty(exports, \"multiInject\", { enumerable: true, get: function () { return multi_inject_1.multiInject; } });\nvar target_name_1 = __webpack_require__(/*! ./annotation/target_name */ \"./node_modules/inversify/lib/annotation/target_name.js\");\nObject.defineProperty(exports, \"targetName\", { enumerable: true, get: function () { return target_name_1.targetName; } });\nvar post_construct_1 = __webpack_require__(/*! ./annotation/post_construct */ \"./node_modules/inversify/lib/annotation/post_construct.js\");\nObject.defineProperty(exports, \"postConstruct\", { enumerable: true, get: function () { return post_construct_1.postConstruct; } });\nvar metadata_reader_1 = __webpack_require__(/*! ./planning/metadata_reader */ \"./node_modules/inversify/lib/planning/metadata_reader.js\");\nObject.defineProperty(exports, \"MetadataReader\", { enumerable: true, get: function () { return metadata_reader_1.MetadataReader; } });\nvar id_1 = __webpack_require__(/*! ./utils/id */ \"./node_modules/inversify/lib/utils/id.js\");\nObject.defineProperty(exports, \"id\", { enumerable: true, get: function () { return id_1.id; } });\nvar decorator_utils_1 = __webpack_require__(/*! ./annotation/decorator_utils */ \"./node_modules/inversify/lib/annotation/decorator_utils.js\");\nObject.defineProperty(exports, \"decorate\", { enumerable: true, get: function () { return decorator_utils_1.decorate; } });\nvar constraint_helpers_1 = __webpack_require__(/*! ./syntax/constraint_helpers */ \"./node_modules/inversify/lib/syntax/constraint_helpers.js\");\nObject.defineProperty(exports, \"traverseAncerstors\", { enumerable: true, get: function () { return constraint_helpers_1.traverseAncerstors; } });\nObject.defineProperty(exports, \"taggedConstraint\", { enumerable: true, get: function () { return constraint_helpers_1.taggedConstraint; } });\nObject.defineProperty(exports, \"namedConstraint\", { enumerable: true, get: function () { return constraint_helpers_1.namedConstraint; } });\nObject.defineProperty(exports, \"typeConstraint\", { enumerable: true, get: function () { return constraint_helpers_1.typeConstraint; } });\nvar serialization_1 = __webpack_require__(/*! ./utils/serialization */ \"./node_modules/inversify/lib/utils/serialization.js\");\nObject.defineProperty(exports, \"getServiceIdentifierAsString\", { enumerable: true, get: function () { return serialization_1.getServiceIdentifierAsString; } });\nvar binding_utils_1 = __webpack_require__(/*! ./utils/binding_utils */ \"./node_modules/inversify/lib/utils/binding_utils.js\");\nObject.defineProperty(exports, \"multiBindToService\", { enumerable: true, get: function () { return binding_utils_1.multiBindToService; } });\n//# sourceMappingURL=inversify.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/inversify.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Color\", function() { return Color; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"darker\", function() { return darker; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"brighter\", function() { return brighter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return color; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgbConvert\", function() { return rgbConvert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rgb\", function() { return rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Rgb\", function() { return Rgb; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hslConvert\", function() { return hslConvert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hsl\", function() { return hsl; });\n/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ \"./node_modules/d3-color/src/define.js\");\n\n\nfunction Color() {}\n\nvar darker = 0.7;\nvar brighter = 1 / darker;\n\nvar reI = \"\\\\s*([+-]?\\\\d+)\\\\s*\",\n reN = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)\\\\s*\",\n reP = \"\\\\s*([+-]?\\\\d*\\\\.?\\\\d+(?:[eE][+-]?\\\\d+)?)%\\\\s*\",\n reHex = /^#([0-9a-f]{3,8})$/,\n reRgbInteger = new RegExp(\"^rgb\\\\(\" + [reI, reI, reI] + \"\\\\)$\"),\n reRgbPercent = new RegExp(\"^rgb\\\\(\" + [reP, reP, reP] + \"\\\\)$\"),\n reRgbaInteger = new RegExp(\"^rgba\\\\(\" + [reI, reI, reI, reN] + \"\\\\)$\"),\n reRgbaPercent = new RegExp(\"^rgba\\\\(\" + [reP, reP, reP, reN] + \"\\\\)$\"),\n reHslPercent = new RegExp(\"^hsl\\\\(\" + [reN, reP, reP] + \"\\\\)$\"),\n reHslaPercent = new RegExp(\"^hsla\\\\(\" + [reN, reP, reP, reN] + \"\\\\)$\");\n\nvar named = {\n aliceblue: 0xf0f8ff,\n antiquewhite: 0xfaebd7,\n aqua: 0x00ffff,\n aquamarine: 0x7fffd4,\n azure: 0xf0ffff,\n beige: 0xf5f5dc,\n bisque: 0xffe4c4,\n black: 0x000000,\n blanchedalmond: 0xffebcd,\n blue: 0x0000ff,\n blueviolet: 0x8a2be2,\n brown: 0xa52a2a,\n burlywood: 0xdeb887,\n cadetblue: 0x5f9ea0,\n chartreuse: 0x7fff00,\n chocolate: 0xd2691e,\n coral: 0xff7f50,\n cornflowerblue: 0x6495ed,\n cornsilk: 0xfff8dc,\n crimson: 0xdc143c,\n cyan: 0x00ffff,\n darkblue: 0x00008b,\n darkcyan: 0x008b8b,\n darkgoldenrod: 0xb8860b,\n darkgray: 0xa9a9a9,\n darkgreen: 0x006400,\n darkgrey: 0xa9a9a9,\n darkkhaki: 0xbdb76b,\n darkmagenta: 0x8b008b,\n darkolivegreen: 0x556b2f,\n darkorange: 0xff8c00,\n darkorchid: 0x9932cc,\n darkred: 0x8b0000,\n darksalmon: 0xe9967a,\n darkseagreen: 0x8fbc8f,\n darkslateblue: 0x483d8b,\n darkslategray: 0x2f4f4f,\n darkslategrey: 0x2f4f4f,\n darkturquoise: 0x00ced1,\n darkviolet: 0x9400d3,\n deeppink: 0xff1493,\n deepskyblue: 0x00bfff,\n dimgray: 0x696969,\n dimgrey: 0x696969,\n dodgerblue: 0x1e90ff,\n firebrick: 0xb22222,\n floralwhite: 0xfffaf0,\n forestgreen: 0x228b22,\n fuchsia: 0xff00ff,\n gainsboro: 0xdcdcdc,\n ghostwhite: 0xf8f8ff,\n gold: 0xffd700,\n goldenrod: 0xdaa520,\n gray: 0x808080,\n green: 0x008000,\n greenyellow: 0xadff2f,\n grey: 0x808080,\n honeydew: 0xf0fff0,\n hotpink: 0xff69b4,\n indianred: 0xcd5c5c,\n indigo: 0x4b0082,\n ivory: 0xfffff0,\n khaki: 0xf0e68c,\n lavender: 0xe6e6fa,\n lavenderblush: 0xfff0f5,\n lawngreen: 0x7cfc00,\n lemonchiffon: 0xfffacd,\n lightblue: 0xadd8e6,\n lightcoral: 0xf08080,\n lightcyan: 0xe0ffff,\n lightgoldenrodyellow: 0xfafad2,\n lightgray: 0xd3d3d3,\n lightgreen: 0x90ee90,\n lightgrey: 0xd3d3d3,\n lightpink: 0xffb6c1,\n lightsalmon: 0xffa07a,\n lightseagreen: 0x20b2aa,\n lightskyblue: 0x87cefa,\n lightslategray: 0x778899,\n lightslategrey: 0x778899,\n lightsteelblue: 0xb0c4de,\n lightyellow: 0xffffe0,\n lime: 0x00ff00,\n limegreen: 0x32cd32,\n linen: 0xfaf0e6,\n magenta: 0xff00ff,\n maroon: 0x800000,\n mediumaquamarine: 0x66cdaa,\n mediumblue: 0x0000cd,\n mediumorchid: 0xba55d3,\n mediumpurple: 0x9370db,\n mediumseagreen: 0x3cb371,\n mediumslateblue: 0x7b68ee,\n mediumspringgreen: 0x00fa9a,\n mediumturquoise: 0x48d1cc,\n mediumvioletred: 0xc71585,\n midnightblue: 0x191970,\n mintcream: 0xf5fffa,\n mistyrose: 0xffe4e1,\n moccasin: 0xffe4b5,\n navajowhite: 0xffdead,\n navy: 0x000080,\n oldlace: 0xfdf5e6,\n olive: 0x808000,\n olivedrab: 0x6b8e23,\n orange: 0xffa500,\n orangered: 0xff4500,\n orchid: 0xda70d6,\n palegoldenrod: 0xeee8aa,\n palegreen: 0x98fb98,\n paleturquoise: 0xafeeee,\n palevioletred: 0xdb7093,\n papayawhip: 0xffefd5,\n peachpuff: 0xffdab9,\n peru: 0xcd853f,\n pink: 0xffc0cb,\n plum: 0xdda0dd,\n powderblue: 0xb0e0e6,\n purple: 0x800080,\n rebeccapurple: 0x663399,\n red: 0xff0000,\n rosybrown: 0xbc8f8f,\n royalblue: 0x4169e1,\n saddlebrown: 0x8b4513,\n salmon: 0xfa8072,\n sandybrown: 0xf4a460,\n seagreen: 0x2e8b57,\n seashell: 0xfff5ee,\n sienna: 0xa0522d,\n silver: 0xc0c0c0,\n skyblue: 0x87ceeb,\n slateblue: 0x6a5acd,\n slategray: 0x708090,\n slategrey: 0x708090,\n snow: 0xfffafa,\n springgreen: 0x00ff7f,\n steelblue: 0x4682b4,\n tan: 0xd2b48c,\n teal: 0x008080,\n thistle: 0xd8bfd8,\n tomato: 0xff6347,\n turquoise: 0x40e0d0,\n violet: 0xee82ee,\n wheat: 0xf5deb3,\n white: 0xffffff,\n whitesmoke: 0xf5f5f5,\n yellow: 0xffff00,\n yellowgreen: 0x9acd32\n};\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Color, color, {\n copy: function(channels) {\n return Object.assign(new this.constructor, this, channels);\n },\n displayable: function() {\n return this.rgb().displayable();\n },\n hex: color_formatHex, // Deprecated! Use color.formatHex.\n formatHex: color_formatHex,\n formatHsl: color_formatHsl,\n formatRgb: color_formatRgb,\n toString: color_formatRgb\n});\n\nfunction color_formatHex() {\n return this.rgb().formatHex();\n}\n\nfunction color_formatHsl() {\n return hslConvert(this).formatHsl();\n}\n\nfunction color_formatRgb() {\n return this.rgb().formatRgb();\n}\n\nfunction color(format) {\n var m, l;\n format = (format + \"\").trim().toLowerCase();\n return (m = reHex.exec(format)) ? (l = m[1].length, m = parseInt(m[1], 16), l === 6 ? rgbn(m) // #ff0000\n : l === 3 ? new Rgb((m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), ((m & 0xf) << 4) | (m & 0xf), 1) // #f00\n : l === 8 ? rgba(m >> 24 & 0xff, m >> 16 & 0xff, m >> 8 & 0xff, (m & 0xff) / 0xff) // #ff000000\n : l === 4 ? rgba((m >> 12 & 0xf) | (m >> 8 & 0xf0), (m >> 8 & 0xf) | (m >> 4 & 0xf0), (m >> 4 & 0xf) | (m & 0xf0), (((m & 0xf) << 4) | (m & 0xf)) / 0xff) // #f000\n : null) // invalid hex\n : (m = reRgbInteger.exec(format)) ? new Rgb(m[1], m[2], m[3], 1) // rgb(255, 0, 0)\n : (m = reRgbPercent.exec(format)) ? new Rgb(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, 1) // rgb(100%, 0%, 0%)\n : (m = reRgbaInteger.exec(format)) ? rgba(m[1], m[2], m[3], m[4]) // rgba(255, 0, 0, 1)\n : (m = reRgbaPercent.exec(format)) ? rgba(m[1] * 255 / 100, m[2] * 255 / 100, m[3] * 255 / 100, m[4]) // rgb(100%, 0%, 0%, 1)\n : (m = reHslPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, 1) // hsl(120, 50%, 50%)\n : (m = reHslaPercent.exec(format)) ? hsla(m[1], m[2] / 100, m[3] / 100, m[4]) // hsla(120, 50%, 50%, 1)\n : named.hasOwnProperty(format) ? rgbn(named[format]) // eslint-disable-line no-prototype-builtins\n : format === \"transparent\" ? new Rgb(NaN, NaN, NaN, 0)\n : null;\n}\n\nfunction rgbn(n) {\n return new Rgb(n >> 16 & 0xff, n >> 8 & 0xff, n & 0xff, 1);\n}\n\nfunction rgba(r, g, b, a) {\n if (a <= 0) r = g = b = NaN;\n return new Rgb(r, g, b, a);\n}\n\nfunction rgbConvert(o) {\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Rgb;\n o = o.rgb();\n return new Rgb(o.r, o.g, o.b, o.opacity);\n}\n\nfunction rgb(r, g, b, opacity) {\n return arguments.length === 1 ? rgbConvert(r) : new Rgb(r, g, b, opacity == null ? 1 : opacity);\n}\n\nfunction Rgb(r, g, b, opacity) {\n this.r = +r;\n this.g = +g;\n this.b = +b;\n this.opacity = +opacity;\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Rgb, rgb, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Rgb(this.r * k, this.g * k, this.b * k, this.opacity);\n },\n rgb: function() {\n return this;\n },\n displayable: function() {\n return (-0.5 <= this.r && this.r < 255.5)\n && (-0.5 <= this.g && this.g < 255.5)\n && (-0.5 <= this.b && this.b < 255.5)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n hex: rgb_formatHex, // Deprecated! Use color.formatHex.\n formatHex: rgb_formatHex,\n formatRgb: rgb_formatRgb,\n toString: rgb_formatRgb\n}));\n\nfunction rgb_formatHex() {\n return \"#\" + hex(this.r) + hex(this.g) + hex(this.b);\n}\n\nfunction rgb_formatRgb() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"rgb(\" : \"rgba(\")\n + Math.max(0, Math.min(255, Math.round(this.r) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.g) || 0)) + \", \"\n + Math.max(0, Math.min(255, Math.round(this.b) || 0))\n + (a === 1 ? \")\" : \", \" + a + \")\");\n}\n\nfunction hex(value) {\n value = Math.max(0, Math.min(255, Math.round(value) || 0));\n return (value < 16 ? \"0\" : \"\") + value.toString(16);\n}\n\nfunction hsla(h, s, l, a) {\n if (a <= 0) h = s = l = NaN;\n else if (l <= 0 || l >= 1) h = s = NaN;\n else if (s <= 0) h = NaN;\n return new Hsl(h, s, l, a);\n}\n\nfunction hslConvert(o) {\n if (o instanceof Hsl) return new Hsl(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof Color)) o = color(o);\n if (!o) return new Hsl;\n if (o instanceof Hsl) return o;\n o = o.rgb();\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n min = Math.min(r, g, b),\n max = Math.max(r, g, b),\n h = NaN,\n s = max - min,\n l = (max + min) / 2;\n if (s) {\n if (r === max) h = (g - b) / s + (g < b) * 6;\n else if (g === max) h = (b - r) / s + 2;\n else h = (r - g) / s + 4;\n s /= l < 0.5 ? max + min : 2 - max - min;\n h *= 60;\n } else {\n s = l > 0 && l < 1 ? 0 : h;\n }\n return new Hsl(h, s, l, o.opacity);\n}\n\nfunction hsl(h, s, l, opacity) {\n return arguments.length === 1 ? hslConvert(h) : new Hsl(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hsl(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Hsl, hsl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(Color, {\n brighter: function(k) {\n k = k == null ? brighter : Math.pow(brighter, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? darker : Math.pow(darker, k);\n return new Hsl(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = this.h % 360 + (this.h < 0) * 360,\n s = isNaN(h) || isNaN(this.s) ? 0 : this.s,\n l = this.l,\n m2 = l + (l < 0.5 ? l : 1 - l) * s,\n m1 = 2 * l - m2;\n return new Rgb(\n hsl2rgb(h >= 240 ? h - 240 : h + 120, m1, m2),\n hsl2rgb(h, m1, m2),\n hsl2rgb(h < 120 ? h + 240 : h - 120, m1, m2),\n this.opacity\n );\n },\n displayable: function() {\n return (0 <= this.s && this.s <= 1 || isNaN(this.s))\n && (0 <= this.l && this.l <= 1)\n && (0 <= this.opacity && this.opacity <= 1);\n },\n formatHsl: function() {\n var a = this.opacity; a = isNaN(a) ? 1 : Math.max(0, Math.min(1, a));\n return (a === 1 ? \"hsl(\" : \"hsla(\")\n + (this.h || 0) + \", \"\n + (this.s || 0) * 100 + \"%, \"\n + (this.l || 0) * 100 + \"%\"\n + (a === 1 ? \")\" : \", \" + a + \")\");\n }\n}));\n\n/* From FvD 13.37, CSS Color Module Level 3 */\nfunction hsl2rgb(h, m1, m2) {\n return (h < 60 ? m1 + (m2 - m1) * h / 60\n : h < 180 ? m2\n : h < 240 ? m1 + (m2 - m1) * (240 - h) / 60\n : m1) * 255;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/color.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/context.js": -/*!********************************************************!*\ - !*** ./node_modules/inversify/lib/planning/context.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-color/src/cubehelix.js": +/*!************************************************!*\ + !*** ./node_modules/d3-color/src/cubehelix.js ***! + \************************************************/ +/*! exports provided: default, Cubehelix */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Context = void 0;\nvar id_1 = __webpack_require__(/*! ../utils/id */ \"./node_modules/inversify/lib/utils/id.js\");\nvar Context = (function () {\n function Context(container) {\n this.id = id_1.id();\n this.container = container;\n }\n Context.prototype.addPlan = function (plan) {\n this.plan = plan;\n };\n Context.prototype.setCurrentRequest = function (currentRequest) {\n this.currentRequest = currentRequest;\n };\n return Context;\n}());\nexports.Context = Context;\n//# sourceMappingURL=context.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/context.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return cubehelix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Cubehelix\", function() { return Cubehelix; });\n/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ \"./node_modules/d3-color/src/define.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-color/src/color.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ \"./node_modules/d3-color/src/math.js\");\n\n\n\n\nvar A = -0.14861,\n B = +1.78277,\n C = -0.29227,\n D = -0.90649,\n E = +1.97294,\n ED = E * D,\n EB = E * B,\n BC_DA = B * C - D * A;\n\nfunction cubehelixConvert(o) {\n if (o instanceof Cubehelix) return new Cubehelix(o.h, o.s, o.l, o.opacity);\n if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__[\"Rgb\"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"rgbConvert\"])(o);\n var r = o.r / 255,\n g = o.g / 255,\n b = o.b / 255,\n l = (BC_DA * b + ED * r - EB * g) / (BC_DA + ED - EB),\n bl = b - l,\n k = (E * (g - l) - C * bl) / D,\n s = Math.sqrt(k * k + bl * bl) / (E * l * (1 - l)), // NaN if l=0 or l=1\n h = s ? Math.atan2(k, bl) * _math_js__WEBPACK_IMPORTED_MODULE_2__[\"rad2deg\"] - 120 : NaN;\n return new Cubehelix(h < 0 ? h + 360 : h, s, l, o.opacity);\n}\n\nfunction cubehelix(h, s, l, opacity) {\n return arguments.length === 1 ? cubehelixConvert(h) : new Cubehelix(h, s, l, opacity == null ? 1 : opacity);\n}\n\nfunction Cubehelix(h, s, l, opacity) {\n this.h = +h;\n this.s = +s;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Cubehelix, cubehelix, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"Color\"], {\n brighter: function(k) {\n k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__[\"brighter\"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"brighter\"], k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n darker: function(k) {\n k = k == null ? _color_js__WEBPACK_IMPORTED_MODULE_1__[\"darker\"] : Math.pow(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"darker\"], k);\n return new Cubehelix(this.h, this.s, this.l * k, this.opacity);\n },\n rgb: function() {\n var h = isNaN(this.h) ? 0 : (this.h + 120) * _math_js__WEBPACK_IMPORTED_MODULE_2__[\"deg2rad\"],\n l = +this.l,\n a = isNaN(this.s) ? 0 : this.s * l * (1 - l),\n cosh = Math.cos(h),\n sinh = Math.sin(h);\n return new _color_js__WEBPACK_IMPORTED_MODULE_1__[\"Rgb\"](\n 255 * (l + a * (A * cosh + B * sinh)),\n 255 * (l + a * (C * cosh + D * sinh)),\n 255 * (l + a * (E * cosh)),\n this.opacity\n );\n }\n}));\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/cubehelix.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/metadata.js": -/*!*********************************************************!*\ - !*** ./node_modules/inversify/lib/planning/metadata.js ***! - \*********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-color/src/define.js": +/*!*********************************************!*\ + !*** ./node_modules/d3-color/src/define.js ***! + \*********************************************/ +/*! exports provided: default, extend */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Metadata = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar Metadata = (function () {\n function Metadata(key, value) {\n this.key = key;\n this.value = value;\n }\n Metadata.prototype.toString = function () {\n if (this.key === METADATA_KEY.NAMED_TAG) {\n return \"named: \" + this.value.toString() + \" \";\n }\n else {\n return \"tagged: { key:\" + this.key.toString() + \", value: \" + this.value + \" }\";\n }\n };\n return Metadata;\n}());\nexports.Metadata = Metadata;\n//# sourceMappingURL=metadata.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/metadata.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"extend\", function() { return extend; });\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(constructor, factory, prototype) {\n constructor.prototype = factory.prototype = prototype;\n prototype.constructor = constructor;\n});\n\nfunction extend(parent, definition) {\n var prototype = Object.create(parent.prototype);\n for (var key in definition) prototype[key] = definition[key];\n return prototype;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/define.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/metadata_reader.js": -/*!****************************************************************!*\ - !*** ./node_modules/inversify/lib/planning/metadata_reader.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-color/src/index.js": +/*!********************************************!*\ + !*** ./node_modules/d3-color/src/index.js ***! + \********************************************/ +/*! exports provided: color, rgb, hsl, lab, hcl, lch, gray, cubehelix */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.MetadataReader = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar MetadataReader = (function () {\n function MetadataReader() {\n }\n MetadataReader.prototype.getConstructorMetadata = function (constructorFunc) {\n var compilerGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.PARAM_TYPES, constructorFunc);\n var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED, constructorFunc);\n return {\n compilerGeneratedMetadata: compilerGeneratedMetadata,\n userGeneratedMetadata: userGeneratedMetadata || {}\n };\n };\n MetadataReader.prototype.getPropertiesMetadata = function (constructorFunc) {\n var userGeneratedMetadata = Reflect.getMetadata(METADATA_KEY.TAGGED_PROP, constructorFunc) || [];\n return userGeneratedMetadata;\n };\n return MetadataReader;\n}());\nexports.MetadataReader = MetadataReader;\n//# sourceMappingURL=metadata_reader.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/metadata_reader.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-color/src/color.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"color\", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"rgb\", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__[\"rgb\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hsl\", function() { return _color_js__WEBPACK_IMPORTED_MODULE_0__[\"hsl\"]; });\n\n/* harmony import */ var _lab_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./lab.js */ \"./node_modules/d3-color/src/lab.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lab\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"hcl\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__[\"hcl\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"lch\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__[\"lch\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"gray\", function() { return _lab_js__WEBPACK_IMPORTED_MODULE_1__[\"gray\"]; });\n\n/* harmony import */ var _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubehelix.js */ \"./node_modules/d3-color/src/cubehelix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"cubehelix\", function() { return _cubehelix_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/index.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/plan.js": -/*!*****************************************************!*\ - !*** ./node_modules/inversify/lib/planning/plan.js ***! - \*****************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-color/src/lab.js": +/*!******************************************!*\ + !*** ./node_modules/d3-color/src/lab.js ***! + \******************************************/ +/*! exports provided: gray, default, Lab, lch, hcl, Hcl */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Plan = void 0;\nvar Plan = (function () {\n function Plan(parentContext, rootRequest) {\n this.parentContext = parentContext;\n this.rootRequest = rootRequest;\n }\n return Plan;\n}());\nexports.Plan = Plan;\n//# sourceMappingURL=plan.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/plan.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"gray\", function() { return gray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return lab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Lab\", function() { return Lab; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lch\", function() { return lch; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hcl\", function() { return hcl; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Hcl\", function() { return Hcl; });\n/* harmony import */ var _define_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./define.js */ \"./node_modules/d3-color/src/define.js\");\n/* harmony import */ var _color_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./color.js */ \"./node_modules/d3-color/src/color.js\");\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./math.js */ \"./node_modules/d3-color/src/math.js\");\n\n\n\n\n// https://observablehq.com/@mbostock/lab-and-rgb\nvar K = 18,\n Xn = 0.96422,\n Yn = 1,\n Zn = 0.82521,\n t0 = 4 / 29,\n t1 = 6 / 29,\n t2 = 3 * t1 * t1,\n t3 = t1 * t1 * t1;\n\nfunction labConvert(o) {\n if (o instanceof Lab) return new Lab(o.l, o.a, o.b, o.opacity);\n if (o instanceof Hcl) return hcl2lab(o);\n if (!(o instanceof _color_js__WEBPACK_IMPORTED_MODULE_1__[\"Rgb\"])) o = Object(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"rgbConvert\"])(o);\n var r = rgb2lrgb(o.r),\n g = rgb2lrgb(o.g),\n b = rgb2lrgb(o.b),\n y = xyz2lab((0.2225045 * r + 0.7168786 * g + 0.0606169 * b) / Yn), x, z;\n if (r === g && g === b) x = z = y; else {\n x = xyz2lab((0.4360747 * r + 0.3850649 * g + 0.1430804 * b) / Xn);\n z = xyz2lab((0.0139322 * r + 0.0971045 * g + 0.7141733 * b) / Zn);\n }\n return new Lab(116 * y - 16, 500 * (x - y), 200 * (y - z), o.opacity);\n}\n\nfunction gray(l, opacity) {\n return new Lab(l, 0, 0, opacity == null ? 1 : opacity);\n}\n\nfunction lab(l, a, b, opacity) {\n return arguments.length === 1 ? labConvert(l) : new Lab(l, a, b, opacity == null ? 1 : opacity);\n}\n\nfunction Lab(l, a, b, opacity) {\n this.l = +l;\n this.a = +a;\n this.b = +b;\n this.opacity = +opacity;\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Lab, lab, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"Color\"], {\n brighter: function(k) {\n return new Lab(this.l + K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n darker: function(k) {\n return new Lab(this.l - K * (k == null ? 1 : k), this.a, this.b, this.opacity);\n },\n rgb: function() {\n var y = (this.l + 16) / 116,\n x = isNaN(this.a) ? y : y + this.a / 500,\n z = isNaN(this.b) ? y : y - this.b / 200;\n x = Xn * lab2xyz(x);\n y = Yn * lab2xyz(y);\n z = Zn * lab2xyz(z);\n return new _color_js__WEBPACK_IMPORTED_MODULE_1__[\"Rgb\"](\n lrgb2rgb( 3.1338561 * x - 1.6168667 * y - 0.4906146 * z),\n lrgb2rgb(-0.9787684 * x + 1.9161415 * y + 0.0334540 * z),\n lrgb2rgb( 0.0719453 * x - 0.2289914 * y + 1.4052427 * z),\n this.opacity\n );\n }\n}));\n\nfunction xyz2lab(t) {\n return t > t3 ? Math.pow(t, 1 / 3) : t / t2 + t0;\n}\n\nfunction lab2xyz(t) {\n return t > t1 ? t * t * t : t2 * (t - t0);\n}\n\nfunction lrgb2rgb(x) {\n return 255 * (x <= 0.0031308 ? 12.92 * x : 1.055 * Math.pow(x, 1 / 2.4) - 0.055);\n}\n\nfunction rgb2lrgb(x) {\n return (x /= 255) <= 0.04045 ? x / 12.92 : Math.pow((x + 0.055) / 1.055, 2.4);\n}\n\nfunction hclConvert(o) {\n if (o instanceof Hcl) return new Hcl(o.h, o.c, o.l, o.opacity);\n if (!(o instanceof Lab)) o = labConvert(o);\n if (o.a === 0 && o.b === 0) return new Hcl(NaN, 0 < o.l && o.l < 100 ? 0 : NaN, o.l, o.opacity);\n var h = Math.atan2(o.b, o.a) * _math_js__WEBPACK_IMPORTED_MODULE_2__[\"rad2deg\"];\n return new Hcl(h < 0 ? h + 360 : h, Math.sqrt(o.a * o.a + o.b * o.b), o.l, o.opacity);\n}\n\nfunction lch(l, c, h, opacity) {\n return arguments.length === 1 ? hclConvert(l) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nfunction hcl(h, c, l, opacity) {\n return arguments.length === 1 ? hclConvert(h) : new Hcl(h, c, l, opacity == null ? 1 : opacity);\n}\n\nfunction Hcl(h, c, l, opacity) {\n this.h = +h;\n this.c = +c;\n this.l = +l;\n this.opacity = +opacity;\n}\n\nfunction hcl2lab(o) {\n if (isNaN(o.h)) return new Lab(o.l, 0, 0, o.opacity);\n var h = o.h * _math_js__WEBPACK_IMPORTED_MODULE_2__[\"deg2rad\"];\n return new Lab(o.l, Math.cos(h) * o.c, Math.sin(h) * o.c, o.opacity);\n}\n\nObject(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"])(Hcl, hcl, Object(_define_js__WEBPACK_IMPORTED_MODULE_0__[\"extend\"])(_color_js__WEBPACK_IMPORTED_MODULE_1__[\"Color\"], {\n brighter: function(k) {\n return new Hcl(this.h, this.c, this.l + K * (k == null ? 1 : k), this.opacity);\n },\n darker: function(k) {\n return new Hcl(this.h, this.c, this.l - K * (k == null ? 1 : k), this.opacity);\n },\n rgb: function() {\n return hcl2lab(this).rgb();\n }\n}));\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/lab.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/planner.js": -/*!********************************************************!*\ - !*** ./node_modules/inversify/lib/planning/planner.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-color/src/math.js": +/*!*******************************************!*\ + !*** ./node_modules/d3-color/src/math.js ***! + \*******************************************/ +/*! exports provided: deg2rad, rad2deg */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getBindingDictionary = exports.createMockRequest = exports.plan = void 0;\nvar binding_count_1 = __webpack_require__(/*! ../bindings/binding_count */ \"./node_modules/inversify/lib/bindings/binding_count.js\");\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar exceptions_1 = __webpack_require__(/*! ../utils/exceptions */ \"./node_modules/inversify/lib/utils/exceptions.js\");\nvar serialization_1 = __webpack_require__(/*! ../utils/serialization */ \"./node_modules/inversify/lib/utils/serialization.js\");\nvar context_1 = __webpack_require__(/*! ./context */ \"./node_modules/inversify/lib/planning/context.js\");\nvar metadata_1 = __webpack_require__(/*! ./metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar plan_1 = __webpack_require__(/*! ./plan */ \"./node_modules/inversify/lib/planning/plan.js\");\nvar reflection_utils_1 = __webpack_require__(/*! ./reflection_utils */ \"./node_modules/inversify/lib/planning/reflection_utils.js\");\nvar request_1 = __webpack_require__(/*! ./request */ \"./node_modules/inversify/lib/planning/request.js\");\nvar target_1 = __webpack_require__(/*! ./target */ \"./node_modules/inversify/lib/planning/target.js\");\nfunction getBindingDictionary(cntnr) {\n return cntnr._bindingDictionary;\n}\nexports.getBindingDictionary = getBindingDictionary;\nfunction _createTarget(isMultiInject, targetType, serviceIdentifier, name, key, value) {\n var metadataKey = isMultiInject ? METADATA_KEY.MULTI_INJECT_TAG : METADATA_KEY.INJECT_TAG;\n var injectMetadata = new metadata_1.Metadata(metadataKey, serviceIdentifier);\n var target = new target_1.Target(targetType, name, serviceIdentifier, injectMetadata);\n if (key !== undefined) {\n var tagMetadata = new metadata_1.Metadata(key, value);\n target.metadata.push(tagMetadata);\n }\n return target;\n}\nfunction _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target) {\n var bindings = getBindings(context.container, target.serviceIdentifier);\n var activeBindings = [];\n if (bindings.length === binding_count_1.BindingCount.NoBindingsAvailable &&\n context.container.options.autoBindInjectable &&\n typeof target.serviceIdentifier === \"function\" &&\n metadataReader.getConstructorMetadata(target.serviceIdentifier).compilerGeneratedMetadata) {\n context.container.bind(target.serviceIdentifier).toSelf();\n bindings = getBindings(context.container, target.serviceIdentifier);\n }\n if (!avoidConstraints) {\n activeBindings = bindings.filter(function (binding) {\n var request = new request_1.Request(binding.serviceIdentifier, context, parentRequest, binding, target);\n return binding.constraint(request);\n });\n }\n else {\n activeBindings = bindings;\n }\n _validateActiveBindingCount(target.serviceIdentifier, activeBindings, target, context.container);\n return activeBindings;\n}\nfunction _validateActiveBindingCount(serviceIdentifier, bindings, target, container) {\n switch (bindings.length) {\n case binding_count_1.BindingCount.NoBindingsAvailable:\n if (target.isOptional()) {\n return bindings;\n }\n else {\n var serviceIdentifierString = serialization_1.getServiceIdentifierAsString(serviceIdentifier);\n var msg = ERROR_MSGS.NOT_REGISTERED;\n msg += serialization_1.listMetadataForTarget(serviceIdentifierString, target);\n msg += serialization_1.listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);\n throw new Error(msg);\n }\n case binding_count_1.BindingCount.OnlyOneBindingAvailable:\n if (!target.isArray()) {\n return bindings;\n }\n case binding_count_1.BindingCount.MultipleBindingsAvailable:\n default:\n if (!target.isArray()) {\n var serviceIdentifierString = serialization_1.getServiceIdentifierAsString(serviceIdentifier);\n var msg = ERROR_MSGS.AMBIGUOUS_MATCH + \" \" + serviceIdentifierString;\n msg += serialization_1.listRegisteredBindingsForServiceIdentifier(container, serviceIdentifierString, getBindings);\n throw new Error(msg);\n }\n else {\n return bindings;\n }\n }\n}\nfunction _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, parentRequest, target) {\n var activeBindings;\n var childRequest;\n if (parentRequest === null) {\n activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, null, target);\n childRequest = new request_1.Request(serviceIdentifier, context, null, activeBindings, target);\n var thePlan = new plan_1.Plan(context, childRequest);\n context.addPlan(thePlan);\n }\n else {\n activeBindings = _getActiveBindings(metadataReader, avoidConstraints, context, parentRequest, target);\n childRequest = parentRequest.addChildRequest(target.serviceIdentifier, activeBindings, target);\n }\n activeBindings.forEach(function (binding) {\n var subChildRequest = null;\n if (target.isArray()) {\n subChildRequest = childRequest.addChildRequest(binding.serviceIdentifier, binding, target);\n }\n else {\n if (binding.cache) {\n return;\n }\n subChildRequest = childRequest;\n }\n if (binding.type === literal_types_1.BindingTypeEnum.Instance && binding.implementationType !== null) {\n var dependencies = reflection_utils_1.getDependencies(metadataReader, binding.implementationType);\n if (!context.container.options.skipBaseClassChecks) {\n var baseClassDependencyCount = reflection_utils_1.getBaseClassDependencyCount(metadataReader, binding.implementationType);\n if (dependencies.length < baseClassDependencyCount) {\n var error = ERROR_MSGS.ARGUMENTS_LENGTH_MISMATCH(reflection_utils_1.getFunctionName(binding.implementationType));\n throw new Error(error);\n }\n }\n dependencies.forEach(function (dependency) {\n _createSubRequests(metadataReader, false, dependency.serviceIdentifier, context, subChildRequest, dependency);\n });\n }\n });\n}\nfunction getBindings(container, serviceIdentifier) {\n var bindings = [];\n var bindingDictionary = getBindingDictionary(container);\n if (bindingDictionary.hasKey(serviceIdentifier)) {\n bindings = bindingDictionary.get(serviceIdentifier);\n }\n else if (container.parent !== null) {\n bindings = getBindings(container.parent, serviceIdentifier);\n }\n return bindings;\n}\nfunction plan(metadataReader, container, isMultiInject, targetType, serviceIdentifier, key, value, avoidConstraints) {\n if (avoidConstraints === void 0) { avoidConstraints = false; }\n var context = new context_1.Context(container);\n var target = _createTarget(isMultiInject, targetType, serviceIdentifier, \"\", key, value);\n try {\n _createSubRequests(metadataReader, avoidConstraints, serviceIdentifier, context, null, target);\n return context;\n }\n catch (error) {\n if (exceptions_1.isStackOverflowExeption(error)) {\n if (context.plan) {\n serialization_1.circularDependencyToException(context.plan.rootRequest);\n }\n }\n throw error;\n }\n}\nexports.plan = plan;\nfunction createMockRequest(container, serviceIdentifier, key, value) {\n var target = new target_1.Target(literal_types_1.TargetTypeEnum.Variable, \"\", serviceIdentifier, new metadata_1.Metadata(key, value));\n var context = new context_1.Context(container);\n var request = new request_1.Request(serviceIdentifier, context, null, [], target);\n return request;\n}\nexports.createMockRequest = createMockRequest;\n//# sourceMappingURL=planner.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/planner.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"deg2rad\", function() { return deg2rad; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rad2deg\", function() { return rad2deg; });\nvar deg2rad = Math.PI / 180;\nvar rad2deg = 180 / Math.PI;\n\n\n//# sourceURL=webpack:///./node_modules/d3-color/src/math.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/queryable_string.js": -/*!*****************************************************************!*\ - !*** ./node_modules/inversify/lib/planning/queryable_string.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-dispatch/src/dispatch.js": +/*!**************************************************!*\ + !*** ./node_modules/d3-dispatch/src/dispatch.js ***! + \**************************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.QueryableString = void 0;\nvar QueryableString = (function () {\n function QueryableString(str) {\n this.str = str;\n }\n QueryableString.prototype.startsWith = function (searchString) {\n return this.str.indexOf(searchString) === 0;\n };\n QueryableString.prototype.endsWith = function (searchString) {\n var reverseString = \"\";\n var reverseSearchString = searchString.split(\"\").reverse().join(\"\");\n reverseString = this.str.split(\"\").reverse().join(\"\");\n return this.startsWith.call({ str: reverseString }, reverseSearchString);\n };\n QueryableString.prototype.contains = function (searchString) {\n return (this.str.indexOf(searchString) !== -1);\n };\n QueryableString.prototype.equals = function (compareString) {\n return this.str === compareString;\n };\n QueryableString.prototype.value = function () {\n return this.str;\n };\n return QueryableString;\n}());\nexports.QueryableString = QueryableString;\n//# sourceMappingURL=queryable_string.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/queryable_string.js?"); +eval("__webpack_require__.r(__webpack_exports__);\nvar noop = {value: function() {}};\n\nfunction dispatch() {\n for (var i = 0, n = arguments.length, _ = {}, t; i < n; ++i) {\n if (!(t = arguments[i] + \"\") || (t in _) || /[\\s.]/.test(t)) throw new Error(\"illegal type: \" + t);\n _[t] = [];\n }\n return new Dispatch(_);\n}\n\nfunction Dispatch(_) {\n this._ = _;\n}\n\nfunction parseTypenames(typenames, types) {\n return typenames.trim().split(/^|\\s+/).map(function(t) {\n var name = \"\", i = t.indexOf(\".\");\n if (i >= 0) name = t.slice(i + 1), t = t.slice(0, i);\n if (t && !types.hasOwnProperty(t)) throw new Error(\"unknown type: \" + t);\n return {type: t, name: name};\n });\n}\n\nDispatch.prototype = dispatch.prototype = {\n constructor: Dispatch,\n on: function(typename, callback) {\n var _ = this._,\n T = parseTypenames(typename + \"\", _),\n t,\n i = -1,\n n = T.length;\n\n // If no callback was specified, return the callback of the given type and name.\n if (arguments.length < 2) {\n while (++i < n) if ((t = (typename = T[i]).type) && (t = get(_[t], typename.name))) return t;\n return;\n }\n\n // If a type was specified, set the callback for the given type and name.\n // Otherwise, if a null callback was specified, remove callbacks of the given name.\n if (callback != null && typeof callback !== \"function\") throw new Error(\"invalid callback: \" + callback);\n while (++i < n) {\n if (t = (typename = T[i]).type) _[t] = set(_[t], typename.name, callback);\n else if (callback == null) for (t in _) _[t] = set(_[t], typename.name, null);\n }\n\n return this;\n },\n copy: function() {\n var copy = {}, _ = this._;\n for (var t in _) copy[t] = _[t].slice();\n return new Dispatch(copy);\n },\n call: function(type, that) {\n if ((n = arguments.length - 2) > 0) for (var args = new Array(n), i = 0, n, t; i < n; ++i) args[i] = arguments[i + 2];\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n },\n apply: function(type, that, args) {\n if (!this._.hasOwnProperty(type)) throw new Error(\"unknown type: \" + type);\n for (var t = this._[type], i = 0, n = t.length; i < n; ++i) t[i].value.apply(that, args);\n }\n};\n\nfunction get(type, name) {\n for (var i = 0, n = type.length, c; i < n; ++i) {\n if ((c = type[i]).name === name) {\n return c.value;\n }\n }\n}\n\nfunction set(type, name, callback) {\n for (var i = 0, n = type.length; i < n; ++i) {\n if (type[i].name === name) {\n type[i] = noop, type = type.slice(0, i).concat(type.slice(i + 1));\n break;\n }\n }\n if (callback != null) type.push({name: name, value: callback});\n return type;\n}\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (dispatch);\n\n\n//# sourceURL=webpack:///./node_modules/d3-dispatch/src/dispatch.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/reflection_utils.js": -/*!*****************************************************************!*\ - !*** ./node_modules/inversify/lib/planning/reflection_utils.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-dispatch/src/index.js": +/*!***********************************************!*\ + !*** ./node_modules/d3-dispatch/src/index.js ***! + \***********************************************/ +/*! exports provided: dispatch */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.getFunctionName = exports.getBaseClassDependencyCount = exports.getDependencies = void 0;\nvar inject_1 = __webpack_require__(/*! ../annotation/inject */ \"./node_modules/inversify/lib/annotation/inject.js\");\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar serialization_1 = __webpack_require__(/*! ../utils/serialization */ \"./node_modules/inversify/lib/utils/serialization.js\");\nObject.defineProperty(exports, \"getFunctionName\", { enumerable: true, get: function () { return serialization_1.getFunctionName; } });\nvar target_1 = __webpack_require__(/*! ./target */ \"./node_modules/inversify/lib/planning/target.js\");\nfunction getDependencies(metadataReader, func) {\n var constructorName = serialization_1.getFunctionName(func);\n var targets = getTargets(metadataReader, constructorName, func, false);\n return targets;\n}\nexports.getDependencies = getDependencies;\nfunction getTargets(metadataReader, constructorName, func, isBaseClass) {\n var metadata = metadataReader.getConstructorMetadata(func);\n var serviceIdentifiers = metadata.compilerGeneratedMetadata;\n if (serviceIdentifiers === undefined) {\n var msg = ERROR_MSGS.MISSING_INJECTABLE_ANNOTATION + \" \" + constructorName + \".\";\n throw new Error(msg);\n }\n var constructorArgsMetadata = metadata.userGeneratedMetadata;\n var keys = Object.keys(constructorArgsMetadata);\n var hasUserDeclaredUnknownInjections = (func.length === 0 && keys.length > 0);\n var hasOptionalParameters = keys.length > func.length;\n var iterations = (hasUserDeclaredUnknownInjections || hasOptionalParameters) ? keys.length : func.length;\n var constructorTargets = getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations);\n var propertyTargets = getClassPropsAsTargets(metadataReader, func);\n var targets = __spreadArray(__spreadArray([], constructorTargets), propertyTargets);\n return targets;\n}\nfunction getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata) {\n var targetMetadata = constructorArgsMetadata[index.toString()] || [];\n var metadata = formatTargetMetadata(targetMetadata);\n var isManaged = metadata.unmanaged !== true;\n var serviceIdentifier = serviceIdentifiers[index];\n var injectIdentifier = (metadata.inject || metadata.multiInject);\n serviceIdentifier = (injectIdentifier) ? (injectIdentifier) : serviceIdentifier;\n if (serviceIdentifier instanceof inject_1.LazyServiceIdentifer) {\n serviceIdentifier = serviceIdentifier.unwrap();\n }\n if (isManaged) {\n var isObject = serviceIdentifier === Object;\n var isFunction = serviceIdentifier === Function;\n var isUndefined = serviceIdentifier === undefined;\n var isUnknownType = (isObject || isFunction || isUndefined);\n if (!isBaseClass && isUnknownType) {\n var msg = ERROR_MSGS.MISSING_INJECT_ANNOTATION + \" argument \" + index + \" in class \" + constructorName + \".\";\n throw new Error(msg);\n }\n var target = new target_1.Target(literal_types_1.TargetTypeEnum.ConstructorArgument, metadata.targetName, serviceIdentifier);\n target.metadata = targetMetadata;\n return target;\n }\n return null;\n}\nfunction getConstructorArgsAsTargets(isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata, iterations) {\n var targets = [];\n for (var i = 0; i < iterations; i++) {\n var index = i;\n var target = getConstructorArgsAsTarget(index, isBaseClass, constructorName, serviceIdentifiers, constructorArgsMetadata);\n if (target !== null) {\n targets.push(target);\n }\n }\n return targets;\n}\nfunction getClassPropsAsTargets(metadataReader, constructorFunc) {\n var classPropsMetadata = metadataReader.getPropertiesMetadata(constructorFunc);\n var targets = [];\n var keys = Object.keys(classPropsMetadata);\n for (var _i = 0, keys_1 = keys; _i < keys_1.length; _i++) {\n var key = keys_1[_i];\n var targetMetadata = classPropsMetadata[key];\n var metadata = formatTargetMetadata(classPropsMetadata[key]);\n var targetName = metadata.targetName || key;\n var serviceIdentifier = (metadata.inject || metadata.multiInject);\n var target = new target_1.Target(literal_types_1.TargetTypeEnum.ClassProperty, targetName, serviceIdentifier);\n target.metadata = targetMetadata;\n targets.push(target);\n }\n var baseConstructor = Object.getPrototypeOf(constructorFunc.prototype).constructor;\n if (baseConstructor !== Object) {\n var baseTargets = getClassPropsAsTargets(metadataReader, baseConstructor);\n targets = __spreadArray(__spreadArray([], targets), baseTargets);\n }\n return targets;\n}\nfunction getBaseClassDependencyCount(metadataReader, func) {\n var baseConstructor = Object.getPrototypeOf(func.prototype).constructor;\n if (baseConstructor !== Object) {\n var baseConstructorName = serialization_1.getFunctionName(baseConstructor);\n var targets = getTargets(metadataReader, baseConstructorName, baseConstructor, true);\n var metadata = targets.map(function (t) {\n return t.metadata.filter(function (m) {\n return m.key === METADATA_KEY.UNMANAGED_TAG;\n });\n });\n var unmanagedCount = [].concat.apply([], metadata).length;\n var dependencyCount = targets.length - unmanagedCount;\n if (dependencyCount > 0) {\n return dependencyCount;\n }\n else {\n return getBaseClassDependencyCount(metadataReader, baseConstructor);\n }\n }\n else {\n return 0;\n }\n}\nexports.getBaseClassDependencyCount = getBaseClassDependencyCount;\nfunction formatTargetMetadata(targetMetadata) {\n var targetMetadataMap = {};\n targetMetadata.forEach(function (m) {\n targetMetadataMap[m.key.toString()] = m.value;\n });\n return {\n inject: targetMetadataMap[METADATA_KEY.INJECT_TAG],\n multiInject: targetMetadataMap[METADATA_KEY.MULTI_INJECT_TAG],\n targetName: targetMetadataMap[METADATA_KEY.NAME_TAG],\n unmanaged: targetMetadataMap[METADATA_KEY.UNMANAGED_TAG]\n };\n}\n//# sourceMappingURL=reflection_utils.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/reflection_utils.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _dispatch_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dispatch.js */ \"./node_modules/d3-dispatch/src/dispatch.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"dispatch\", function() { return _dispatch_js__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-dispatch/src/index.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/request.js": -/*!********************************************************!*\ - !*** ./node_modules/inversify/lib/planning/request.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/back.js": +/*!******************************************!*\ + !*** ./node_modules/d3-ease/src/back.js ***! + \******************************************/ +/*! exports provided: backIn, backOut, backInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Request = void 0;\nvar id_1 = __webpack_require__(/*! ../utils/id */ \"./node_modules/inversify/lib/utils/id.js\");\nvar Request = (function () {\n function Request(serviceIdentifier, parentContext, parentRequest, bindings, target) {\n this.id = id_1.id();\n this.serviceIdentifier = serviceIdentifier;\n this.parentContext = parentContext;\n this.parentRequest = parentRequest;\n this.target = target;\n this.childRequests = [];\n this.bindings = (Array.isArray(bindings) ? bindings : [bindings]);\n this.requestScope = parentRequest === null\n ? new Map()\n : null;\n }\n Request.prototype.addChildRequest = function (serviceIdentifier, bindings, target) {\n var child = new Request(serviceIdentifier, this.parentContext, this, bindings, target);\n this.childRequests.push(child);\n return child;\n };\n return Request;\n}());\nexports.Request = Request;\n//# sourceMappingURL=request.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/request.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"backIn\", function() { return backIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"backOut\", function() { return backOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"backInOut\", function() { return backInOut; });\nvar overshoot = 1.70158;\n\nvar backIn = (function custom(s) {\n s = +s;\n\n function backIn(t) {\n return (t = +t) * t * (s * (t - 1) + t);\n }\n\n backIn.overshoot = custom;\n\n return backIn;\n})(overshoot);\n\nvar backOut = (function custom(s) {\n s = +s;\n\n function backOut(t) {\n return --t * t * ((t + 1) * s + t) + 1;\n }\n\n backOut.overshoot = custom;\n\n return backOut;\n})(overshoot);\n\nvar backInOut = (function custom(s) {\n s = +s;\n\n function backInOut(t) {\n return ((t *= 2) < 1 ? t * t * ((s + 1) * t - s) : (t -= 2) * t * ((s + 1) * t + s) + 2) / 2;\n }\n\n backInOut.overshoot = custom;\n\n return backInOut;\n})(overshoot);\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/back.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/planning/target.js": -/*!*******************************************************!*\ - !*** ./node_modules/inversify/lib/planning/target.js ***! - \*******************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/bounce.js": +/*!********************************************!*\ + !*** ./node_modules/d3-ease/src/bounce.js ***! + \********************************************/ +/*! exports provided: bounceIn, bounceOut, bounceInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.Target = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar id_1 = __webpack_require__(/*! ../utils/id */ \"./node_modules/inversify/lib/utils/id.js\");\nvar metadata_1 = __webpack_require__(/*! ./metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar queryable_string_1 = __webpack_require__(/*! ./queryable_string */ \"./node_modules/inversify/lib/planning/queryable_string.js\");\nvar Target = (function () {\n function Target(type, name, serviceIdentifier, namedOrTagged) {\n this.id = id_1.id();\n this.type = type;\n this.serviceIdentifier = serviceIdentifier;\n this.name = new queryable_string_1.QueryableString(name || \"\");\n this.metadata = new Array();\n var metadataItem = null;\n if (typeof namedOrTagged === \"string\") {\n metadataItem = new metadata_1.Metadata(METADATA_KEY.NAMED_TAG, namedOrTagged);\n }\n else if (namedOrTagged instanceof metadata_1.Metadata) {\n metadataItem = namedOrTagged;\n }\n if (metadataItem !== null) {\n this.metadata.push(metadataItem);\n }\n }\n Target.prototype.hasTag = function (key) {\n for (var _i = 0, _a = this.metadata; _i < _a.length; _i++) {\n var m = _a[_i];\n if (m.key === key) {\n return true;\n }\n }\n return false;\n };\n Target.prototype.isArray = function () {\n return this.hasTag(METADATA_KEY.MULTI_INJECT_TAG);\n };\n Target.prototype.matchesArray = function (name) {\n return this.matchesTag(METADATA_KEY.MULTI_INJECT_TAG)(name);\n };\n Target.prototype.isNamed = function () {\n return this.hasTag(METADATA_KEY.NAMED_TAG);\n };\n Target.prototype.isTagged = function () {\n return this.metadata.some(function (metadata) { return METADATA_KEY.NON_CUSTOM_TAG_KEYS.every(function (key) { return metadata.key !== key; }); });\n };\n Target.prototype.isOptional = function () {\n return this.matchesTag(METADATA_KEY.OPTIONAL_TAG)(true);\n };\n Target.prototype.getNamedTag = function () {\n if (this.isNamed()) {\n return this.metadata.filter(function (m) { return m.key === METADATA_KEY.NAMED_TAG; })[0];\n }\n return null;\n };\n Target.prototype.getCustomTags = function () {\n if (this.isTagged()) {\n return this.metadata.filter(function (metadata) { return METADATA_KEY.NON_CUSTOM_TAG_KEYS.every(function (key) { return metadata.key !== key; }); });\n }\n else {\n return null;\n }\n };\n Target.prototype.matchesNamedTag = function (name) {\n return this.matchesTag(METADATA_KEY.NAMED_TAG)(name);\n };\n Target.prototype.matchesTag = function (key) {\n var _this = this;\n return function (value) {\n for (var _i = 0, _a = _this.metadata; _i < _a.length; _i++) {\n var m = _a[_i];\n if (m.key === key && m.value === value) {\n return true;\n }\n }\n return false;\n };\n };\n return Target;\n}());\nexports.Target = Target;\n//# sourceMappingURL=target.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/planning/target.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bounceIn\", function() { return bounceIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bounceOut\", function() { return bounceOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bounceInOut\", function() { return bounceInOut; });\nvar b1 = 4 / 11,\n b2 = 6 / 11,\n b3 = 8 / 11,\n b4 = 3 / 4,\n b5 = 9 / 11,\n b6 = 10 / 11,\n b7 = 15 / 16,\n b8 = 21 / 22,\n b9 = 63 / 64,\n b0 = 1 / b1 / b1;\n\nfunction bounceIn(t) {\n return 1 - bounceOut(1 - t);\n}\n\nfunction bounceOut(t) {\n return (t = +t) < b1 ? b0 * t * t : t < b3 ? b0 * (t -= b2) * t + b4 : t < b6 ? b0 * (t -= b5) * t + b7 : b0 * (t -= b8) * t + b9;\n}\n\nfunction bounceInOut(t) {\n return ((t *= 2) <= 1 ? 1 - bounceOut(1 - t) : bounceOut(t - 1) + 1) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/bounce.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/resolution/instantiation.js": -/*!****************************************************************!*\ - !*** ./node_modules/inversify/lib/resolution/instantiation.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/circle.js": +/*!********************************************!*\ + !*** ./node_modules/d3-ease/src/circle.js ***! + \********************************************/ +/*! exports provided: circleIn, circleOut, circleInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nvar __spreadArray = (this && this.__spreadArray) || function (to, from) {\n for (var i = 0, il = from.length, j = to.length; i < il; i++, j++)\n to[j] = from[i];\n return to;\n};\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolveInstance = void 0;\nvar error_msgs_1 = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nfunction _injectProperties(instance, childRequests, resolveRequest) {\n var propertyInjectionsRequests = childRequests.filter(function (childRequest) {\n return (childRequest.target !== null &&\n childRequest.target.type === literal_types_1.TargetTypeEnum.ClassProperty);\n });\n var propertyInjections = propertyInjectionsRequests.map(resolveRequest);\n propertyInjectionsRequests.forEach(function (r, index) {\n var propertyName = \"\";\n propertyName = r.target.name.value();\n var injection = propertyInjections[index];\n instance[propertyName] = injection;\n });\n return instance;\n}\nfunction _createInstance(Func, injections) {\n return new (Func.bind.apply(Func, __spreadArray([void 0], injections)))();\n}\nfunction _postConstruct(constr, result) {\n if (Reflect.hasMetadata(METADATA_KEY.POST_CONSTRUCT, constr)) {\n var data = Reflect.getMetadata(METADATA_KEY.POST_CONSTRUCT, constr);\n try {\n result[data.value]();\n }\n catch (e) {\n throw new Error(error_msgs_1.POST_CONSTRUCT_ERROR(constr.name, e.message));\n }\n }\n}\nfunction resolveInstance(constr, childRequests, resolveRequest) {\n var result = null;\n if (childRequests.length > 0) {\n var constructorInjectionsRequests = childRequests.filter(function (childRequest) {\n return (childRequest.target !== null && childRequest.target.type === literal_types_1.TargetTypeEnum.ConstructorArgument);\n });\n var constructorInjections = constructorInjectionsRequests.map(resolveRequest);\n result = _createInstance(constr, constructorInjections);\n result = _injectProperties(result, childRequests, resolveRequest);\n }\n else {\n result = new constr();\n }\n _postConstruct(constr, result);\n return result;\n}\nexports.resolveInstance = resolveInstance;\n//# sourceMappingURL=instantiation.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/resolution/instantiation.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"circleIn\", function() { return circleIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"circleOut\", function() { return circleOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"circleInOut\", function() { return circleInOut; });\nfunction circleIn(t) {\n return 1 - Math.sqrt(1 - t * t);\n}\n\nfunction circleOut(t) {\n return Math.sqrt(1 - --t * t);\n}\n\nfunction circleInOut(t) {\n return ((t *= 2) <= 1 ? 1 - Math.sqrt(1 - t * t) : Math.sqrt(1 - (t -= 2) * t) + 1) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/circle.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/resolution/resolver.js": -/*!***********************************************************!*\ - !*** ./node_modules/inversify/lib/resolution/resolver.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/cubic.js": +/*!*******************************************!*\ + !*** ./node_modules/d3-ease/src/cubic.js ***! + \*******************************************/ +/*! exports provided: cubicIn, cubicOut, cubicInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.resolve = void 0;\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nvar exceptions_1 = __webpack_require__(/*! ../utils/exceptions */ \"./node_modules/inversify/lib/utils/exceptions.js\");\nvar serialization_1 = __webpack_require__(/*! ../utils/serialization */ \"./node_modules/inversify/lib/utils/serialization.js\");\nvar instantiation_1 = __webpack_require__(/*! ./instantiation */ \"./node_modules/inversify/lib/resolution/instantiation.js\");\nvar invokeFactory = function (factoryType, serviceIdentifier, fn) {\n try {\n return fn();\n }\n catch (error) {\n if (exceptions_1.isStackOverflowExeption(error)) {\n throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY_IN_FACTORY(factoryType, serviceIdentifier.toString()));\n }\n else {\n throw error;\n }\n }\n};\nvar _resolveRequest = function (requestScope) {\n return function (request) {\n request.parentContext.setCurrentRequest(request);\n var bindings = request.bindings;\n var childRequests = request.childRequests;\n var targetIsAnArray = request.target && request.target.isArray();\n var targetParentIsNotAnArray = !request.parentRequest ||\n !request.parentRequest.target ||\n !request.target ||\n !request.parentRequest.target.matchesArray(request.target.serviceIdentifier);\n if (targetIsAnArray && targetParentIsNotAnArray) {\n return childRequests.map(function (childRequest) {\n var _f = _resolveRequest(requestScope);\n return _f(childRequest);\n });\n }\n else {\n var result = null;\n if (request.target.isOptional() && bindings.length === 0) {\n return undefined;\n }\n var binding_1 = bindings[0];\n var isSingleton = binding_1.scope === literal_types_1.BindingScopeEnum.Singleton;\n var isRequestSingleton = binding_1.scope === literal_types_1.BindingScopeEnum.Request;\n if (isSingleton && binding_1.activated) {\n return binding_1.cache;\n }\n if (isRequestSingleton &&\n requestScope !== null &&\n requestScope.has(binding_1.id)) {\n return requestScope.get(binding_1.id);\n }\n if (binding_1.type === literal_types_1.BindingTypeEnum.ConstantValue) {\n result = binding_1.cache;\n binding_1.activated = true;\n }\n else if (binding_1.type === literal_types_1.BindingTypeEnum.Function) {\n result = binding_1.cache;\n binding_1.activated = true;\n }\n else if (binding_1.type === literal_types_1.BindingTypeEnum.Constructor) {\n result = binding_1.implementationType;\n }\n else if (binding_1.type === literal_types_1.BindingTypeEnum.DynamicValue && binding_1.dynamicValue !== null) {\n result = invokeFactory(\"toDynamicValue\", binding_1.serviceIdentifier, function () { return binding_1.dynamicValue(request.parentContext); });\n }\n else if (binding_1.type === literal_types_1.BindingTypeEnum.Factory && binding_1.factory !== null) {\n result = invokeFactory(\"toFactory\", binding_1.serviceIdentifier, function () { return binding_1.factory(request.parentContext); });\n }\n else if (binding_1.type === literal_types_1.BindingTypeEnum.Provider && binding_1.provider !== null) {\n result = invokeFactory(\"toProvider\", binding_1.serviceIdentifier, function () { return binding_1.provider(request.parentContext); });\n }\n else if (binding_1.type === literal_types_1.BindingTypeEnum.Instance && binding_1.implementationType !== null) {\n result = instantiation_1.resolveInstance(binding_1.implementationType, childRequests, _resolveRequest(requestScope));\n }\n else {\n var serviceIdentifier = serialization_1.getServiceIdentifierAsString(request.serviceIdentifier);\n throw new Error(ERROR_MSGS.INVALID_BINDING_TYPE + \" \" + serviceIdentifier);\n }\n if (typeof binding_1.onActivation === \"function\") {\n result = binding_1.onActivation(request.parentContext, result);\n }\n if (isSingleton) {\n binding_1.cache = result;\n binding_1.activated = true;\n }\n if (isRequestSingleton &&\n requestScope !== null &&\n !requestScope.has(binding_1.id)) {\n requestScope.set(binding_1.id, result);\n }\n return result;\n }\n };\n};\nfunction resolve(context) {\n var _f = _resolveRequest(context.plan.rootRequest.requestScope);\n return _f(context.plan.rootRequest);\n}\nexports.resolve = resolve;\n//# sourceMappingURL=resolver.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/resolution/resolver.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cubicIn\", function() { return cubicIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cubicOut\", function() { return cubicOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cubicInOut\", function() { return cubicInOut; });\nfunction cubicIn(t) {\n return t * t * t;\n}\n\nfunction cubicOut(t) {\n return --t * t * t + 1;\n}\n\nfunction cubicInOut(t) {\n return ((t *= 2) <= 1 ? t * t * t : (t -= 2) * t * t + 2) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/cubic.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/syntax/binding_in_syntax.js": -/*!****************************************************************!*\ - !*** ./node_modules/inversify/lib/syntax/binding_in_syntax.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/elastic.js": +/*!*********************************************!*\ + !*** ./node_modules/d3-ease/src/elastic.js ***! + \*********************************************/ +/*! exports provided: elasticIn, elasticOut, elasticInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingInSyntax = void 0;\nvar literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nvar binding_when_on_syntax_1 = __webpack_require__(/*! ./binding_when_on_syntax */ \"./node_modules/inversify/lib/syntax/binding_when_on_syntax.js\");\nvar BindingInSyntax = (function () {\n function BindingInSyntax(binding) {\n this._binding = binding;\n }\n BindingInSyntax.prototype.inRequestScope = function () {\n this._binding.scope = literal_types_1.BindingScopeEnum.Request;\n return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n };\n BindingInSyntax.prototype.inSingletonScope = function () {\n this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n };\n BindingInSyntax.prototype.inTransientScope = function () {\n this._binding.scope = literal_types_1.BindingScopeEnum.Transient;\n return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n };\n return BindingInSyntax;\n}());\nexports.BindingInSyntax = BindingInSyntax;\n//# sourceMappingURL=binding_in_syntax.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/syntax/binding_in_syntax.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"elasticIn\", function() { return elasticIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"elasticOut\", function() { return elasticOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"elasticInOut\", function() { return elasticInOut; });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/d3-ease/src/math.js\");\n\n\nvar tau = 2 * Math.PI,\n amplitude = 1,\n period = 0.3;\n\nvar elasticIn = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticIn(t) {\n return a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(-(--t)) * Math.sin((s - t) / p);\n }\n\n elasticIn.amplitude = function(a) { return custom(a, p * tau); };\n elasticIn.period = function(p) { return custom(a, p); };\n\n return elasticIn;\n})(amplitude, period);\n\nvar elasticOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticOut(t) {\n return 1 - a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(t = +t) * Math.sin((t + s) / p);\n }\n\n elasticOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticOut.period = function(p) { return custom(a, p); };\n\n return elasticOut;\n})(amplitude, period);\n\nvar elasticInOut = (function custom(a, p) {\n var s = Math.asin(1 / (a = Math.max(1, a))) * (p /= tau);\n\n function elasticInOut(t) {\n return ((t = t * 2 - 1) < 0\n ? a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(-t) * Math.sin((s - t) / p)\n : 2 - a * Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(t) * Math.sin((s + t) / p)) / 2;\n }\n\n elasticInOut.amplitude = function(a) { return custom(a, p * tau); };\n elasticInOut.period = function(p) { return custom(a, p); };\n\n return elasticInOut;\n})(amplitude, period);\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/elastic.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js": -/*!************************************************************************!*\ - !*** ./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js ***! - \************************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/exp.js": +/*!*****************************************!*\ + !*** ./node_modules/d3-ease/src/exp.js ***! + \*****************************************/ +/*! exports provided: expIn, expOut, expInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingInWhenOnSyntax = void 0;\nvar binding_in_syntax_1 = __webpack_require__(/*! ./binding_in_syntax */ \"./node_modules/inversify/lib/syntax/binding_in_syntax.js\");\nvar binding_on_syntax_1 = __webpack_require__(/*! ./binding_on_syntax */ \"./node_modules/inversify/lib/syntax/binding_on_syntax.js\");\nvar binding_when_syntax_1 = __webpack_require__(/*! ./binding_when_syntax */ \"./node_modules/inversify/lib/syntax/binding_when_syntax.js\");\nvar BindingInWhenOnSyntax = (function () {\n function BindingInWhenOnSyntax(binding) {\n this._binding = binding;\n this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding);\n this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding);\n this._bindingInSyntax = new binding_in_syntax_1.BindingInSyntax(binding);\n }\n BindingInWhenOnSyntax.prototype.inRequestScope = function () {\n return this._bindingInSyntax.inRequestScope();\n };\n BindingInWhenOnSyntax.prototype.inSingletonScope = function () {\n return this._bindingInSyntax.inSingletonScope();\n };\n BindingInWhenOnSyntax.prototype.inTransientScope = function () {\n return this._bindingInSyntax.inTransientScope();\n };\n BindingInWhenOnSyntax.prototype.when = function (constraint) {\n return this._bindingWhenSyntax.when(constraint);\n };\n BindingInWhenOnSyntax.prototype.whenTargetNamed = function (name) {\n return this._bindingWhenSyntax.whenTargetNamed(name);\n };\n BindingInWhenOnSyntax.prototype.whenTargetIsDefault = function () {\n return this._bindingWhenSyntax.whenTargetIsDefault();\n };\n BindingInWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {\n return this._bindingWhenSyntax.whenTargetTagged(tag, value);\n };\n BindingInWhenOnSyntax.prototype.whenInjectedInto = function (parent) {\n return this._bindingWhenSyntax.whenInjectedInto(parent);\n };\n BindingInWhenOnSyntax.prototype.whenParentNamed = function (name) {\n return this._bindingWhenSyntax.whenParentNamed(name);\n };\n BindingInWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {\n return this._bindingWhenSyntax.whenParentTagged(tag, value);\n };\n BindingInWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {\n return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);\n };\n BindingInWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {\n return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);\n };\n BindingInWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {\n return this._bindingWhenSyntax.whenAnyAncestorNamed(name);\n };\n BindingInWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {\n return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);\n };\n BindingInWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {\n return this._bindingWhenSyntax.whenNoAncestorNamed(name);\n };\n BindingInWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {\n return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);\n };\n BindingInWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {\n return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);\n };\n BindingInWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {\n return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);\n };\n BindingInWhenOnSyntax.prototype.onActivation = function (handler) {\n return this._bindingOnSyntax.onActivation(handler);\n };\n return BindingInWhenOnSyntax;\n}());\nexports.BindingInWhenOnSyntax = BindingInWhenOnSyntax;\n//# sourceMappingURL=binding_in_when_on_syntax.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expIn\", function() { return expIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expOut\", function() { return expOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"expInOut\", function() { return expInOut; });\n/* harmony import */ var _math_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./math.js */ \"./node_modules/d3-ease/src/math.js\");\n\n\nfunction expIn(t) {\n return Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(1 - +t);\n}\n\nfunction expOut(t) {\n return 1 - Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(t);\n}\n\nfunction expInOut(t) {\n return ((t *= 2) <= 1 ? Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(1 - t) : 2 - Object(_math_js__WEBPACK_IMPORTED_MODULE_0__[\"tpmt\"])(t - 1)) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/exp.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/syntax/binding_on_syntax.js": -/*!****************************************************************!*\ - !*** ./node_modules/inversify/lib/syntax/binding_on_syntax.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/index.js": +/*!*******************************************!*\ + !*** ./node_modules/d3-ease/src/index.js ***! + \*******************************************/ +/*! exports provided: easeLinear, easeQuad, easeQuadIn, easeQuadOut, easeQuadInOut, easeCubic, easeCubicIn, easeCubicOut, easeCubicInOut, easePoly, easePolyIn, easePolyOut, easePolyInOut, easeSin, easeSinIn, easeSinOut, easeSinInOut, easeExp, easeExpIn, easeExpOut, easeExpInOut, easeCircle, easeCircleIn, easeCircleOut, easeCircleInOut, easeBounce, easeBounceIn, easeBounceOut, easeBounceInOut, easeBack, easeBackIn, easeBackOut, easeBackInOut, easeElastic, easeElasticIn, easeElasticOut, easeElasticInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingOnSyntax = void 0;\nvar binding_when_syntax_1 = __webpack_require__(/*! ./binding_when_syntax */ \"./node_modules/inversify/lib/syntax/binding_when_syntax.js\");\nvar BindingOnSyntax = (function () {\n function BindingOnSyntax(binding) {\n this._binding = binding;\n }\n BindingOnSyntax.prototype.onActivation = function (handler) {\n this._binding.onActivation = handler;\n return new binding_when_syntax_1.BindingWhenSyntax(this._binding);\n };\n return BindingOnSyntax;\n}());\nexports.BindingOnSyntax = BindingOnSyntax;\n//# sourceMappingURL=binding_on_syntax.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/syntax/binding_on_syntax.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _linear_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./linear.js */ \"./node_modules/d3-ease/src/linear.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeLinear\", function() { return _linear_js__WEBPACK_IMPORTED_MODULE_0__[\"linear\"]; });\n\n/* harmony import */ var _quad_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quad.js */ \"./node_modules/d3-ease/src/quad.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeQuad\", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__[\"quadInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeQuadIn\", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__[\"quadIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeQuadOut\", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__[\"quadOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeQuadInOut\", function() { return _quad_js__WEBPACK_IMPORTED_MODULE_1__[\"quadInOut\"]; });\n\n/* harmony import */ var _cubic_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./cubic.js */ \"./node_modules/d3-ease/src/cubic.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCubic\", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__[\"cubicInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCubicIn\", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__[\"cubicIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCubicOut\", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__[\"cubicOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCubicInOut\", function() { return _cubic_js__WEBPACK_IMPORTED_MODULE_2__[\"cubicInOut\"]; });\n\n/* harmony import */ var _poly_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./poly.js */ \"./node_modules/d3-ease/src/poly.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easePoly\", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__[\"polyInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easePolyIn\", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__[\"polyIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easePolyOut\", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__[\"polyOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easePolyInOut\", function() { return _poly_js__WEBPACK_IMPORTED_MODULE_3__[\"polyInOut\"]; });\n\n/* harmony import */ var _sin_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./sin.js */ \"./node_modules/d3-ease/src/sin.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeSin\", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__[\"sinInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeSinIn\", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__[\"sinIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeSinOut\", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__[\"sinOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeSinInOut\", function() { return _sin_js__WEBPACK_IMPORTED_MODULE_4__[\"sinInOut\"]; });\n\n/* harmony import */ var _exp_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./exp.js */ \"./node_modules/d3-ease/src/exp.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeExp\", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__[\"expInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeExpIn\", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__[\"expIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeExpOut\", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__[\"expOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeExpInOut\", function() { return _exp_js__WEBPACK_IMPORTED_MODULE_5__[\"expInOut\"]; });\n\n/* harmony import */ var _circle_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./circle.js */ \"./node_modules/d3-ease/src/circle.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCircle\", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__[\"circleInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCircleIn\", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__[\"circleIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCircleOut\", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__[\"circleOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeCircleInOut\", function() { return _circle_js__WEBPACK_IMPORTED_MODULE_6__[\"circleInOut\"]; });\n\n/* harmony import */ var _bounce_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./bounce.js */ \"./node_modules/d3-ease/src/bounce.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBounce\", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__[\"bounceOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBounceIn\", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__[\"bounceIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBounceOut\", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__[\"bounceOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBounceInOut\", function() { return _bounce_js__WEBPACK_IMPORTED_MODULE_7__[\"bounceInOut\"]; });\n\n/* harmony import */ var _back_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./back.js */ \"./node_modules/d3-ease/src/back.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBack\", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__[\"backInOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBackIn\", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__[\"backIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBackOut\", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__[\"backOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeBackInOut\", function() { return _back_js__WEBPACK_IMPORTED_MODULE_8__[\"backInOut\"]; });\n\n/* harmony import */ var _elastic_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./elastic.js */ \"./node_modules/d3-ease/src/elastic.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeElastic\", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__[\"elasticOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeElasticIn\", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__[\"elasticIn\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeElasticOut\", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__[\"elasticOut\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"easeElasticInOut\", function() { return _elastic_js__WEBPACK_IMPORTED_MODULE_9__[\"elasticInOut\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/index.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/syntax/binding_to_syntax.js": -/*!****************************************************************!*\ - !*** ./node_modules/inversify/lib/syntax/binding_to_syntax.js ***! - \****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/linear.js": +/*!********************************************!*\ + !*** ./node_modules/d3-ease/src/linear.js ***! + \********************************************/ +/*! exports provided: linear */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingToSyntax = void 0;\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nvar literal_types_1 = __webpack_require__(/*! ../constants/literal_types */ \"./node_modules/inversify/lib/constants/literal_types.js\");\nvar binding_in_when_on_syntax_1 = __webpack_require__(/*! ./binding_in_when_on_syntax */ \"./node_modules/inversify/lib/syntax/binding_in_when_on_syntax.js\");\nvar binding_when_on_syntax_1 = __webpack_require__(/*! ./binding_when_on_syntax */ \"./node_modules/inversify/lib/syntax/binding_when_on_syntax.js\");\nvar BindingToSyntax = (function () {\n function BindingToSyntax(binding) {\n this._binding = binding;\n }\n BindingToSyntax.prototype.to = function (constructor) {\n this._binding.type = literal_types_1.BindingTypeEnum.Instance;\n this._binding.implementationType = constructor;\n return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding);\n };\n BindingToSyntax.prototype.toSelf = function () {\n if (typeof this._binding.serviceIdentifier !== \"function\") {\n throw new Error(\"\" + ERROR_MSGS.INVALID_TO_SELF_VALUE);\n }\n var self = this._binding.serviceIdentifier;\n return this.to(self);\n };\n BindingToSyntax.prototype.toConstantValue = function (value) {\n this._binding.type = literal_types_1.BindingTypeEnum.ConstantValue;\n this._binding.cache = value;\n this._binding.dynamicValue = null;\n this._binding.implementationType = null;\n this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n };\n BindingToSyntax.prototype.toDynamicValue = function (func) {\n this._binding.type = literal_types_1.BindingTypeEnum.DynamicValue;\n this._binding.cache = null;\n this._binding.dynamicValue = func;\n this._binding.implementationType = null;\n return new binding_in_when_on_syntax_1.BindingInWhenOnSyntax(this._binding);\n };\n BindingToSyntax.prototype.toConstructor = function (constructor) {\n this._binding.type = literal_types_1.BindingTypeEnum.Constructor;\n this._binding.implementationType = constructor;\n this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n };\n BindingToSyntax.prototype.toFactory = function (factory) {\n this._binding.type = literal_types_1.BindingTypeEnum.Factory;\n this._binding.factory = factory;\n this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n };\n BindingToSyntax.prototype.toFunction = function (func) {\n if (typeof func !== \"function\") {\n throw new Error(ERROR_MSGS.INVALID_FUNCTION_BINDING);\n }\n var bindingWhenOnSyntax = this.toConstantValue(func);\n this._binding.type = literal_types_1.BindingTypeEnum.Function;\n this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n return bindingWhenOnSyntax;\n };\n BindingToSyntax.prototype.toAutoFactory = function (serviceIdentifier) {\n this._binding.type = literal_types_1.BindingTypeEnum.Factory;\n this._binding.factory = function (context) {\n var autofactory = function () { return context.container.get(serviceIdentifier); };\n return autofactory;\n };\n this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n };\n BindingToSyntax.prototype.toProvider = function (provider) {\n this._binding.type = literal_types_1.BindingTypeEnum.Provider;\n this._binding.provider = provider;\n this._binding.scope = literal_types_1.BindingScopeEnum.Singleton;\n return new binding_when_on_syntax_1.BindingWhenOnSyntax(this._binding);\n };\n BindingToSyntax.prototype.toService = function (service) {\n this.toDynamicValue(function (context) { return context.container.get(service); });\n };\n return BindingToSyntax;\n}());\nexports.BindingToSyntax = BindingToSyntax;\n//# sourceMappingURL=binding_to_syntax.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/syntax/binding_to_syntax.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"linear\", function() { return linear; });\nfunction linear(t) {\n return +t;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/linear.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/syntax/binding_when_on_syntax.js": -/*!*********************************************************************!*\ - !*** ./node_modules/inversify/lib/syntax/binding_when_on_syntax.js ***! - \*********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/math.js": +/*!******************************************!*\ + !*** ./node_modules/d3-ease/src/math.js ***! + \******************************************/ +/*! exports provided: tpmt */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingWhenOnSyntax = void 0;\nvar binding_on_syntax_1 = __webpack_require__(/*! ./binding_on_syntax */ \"./node_modules/inversify/lib/syntax/binding_on_syntax.js\");\nvar binding_when_syntax_1 = __webpack_require__(/*! ./binding_when_syntax */ \"./node_modules/inversify/lib/syntax/binding_when_syntax.js\");\nvar BindingWhenOnSyntax = (function () {\n function BindingWhenOnSyntax(binding) {\n this._binding = binding;\n this._bindingWhenSyntax = new binding_when_syntax_1.BindingWhenSyntax(this._binding);\n this._bindingOnSyntax = new binding_on_syntax_1.BindingOnSyntax(this._binding);\n }\n BindingWhenOnSyntax.prototype.when = function (constraint) {\n return this._bindingWhenSyntax.when(constraint);\n };\n BindingWhenOnSyntax.prototype.whenTargetNamed = function (name) {\n return this._bindingWhenSyntax.whenTargetNamed(name);\n };\n BindingWhenOnSyntax.prototype.whenTargetIsDefault = function () {\n return this._bindingWhenSyntax.whenTargetIsDefault();\n };\n BindingWhenOnSyntax.prototype.whenTargetTagged = function (tag, value) {\n return this._bindingWhenSyntax.whenTargetTagged(tag, value);\n };\n BindingWhenOnSyntax.prototype.whenInjectedInto = function (parent) {\n return this._bindingWhenSyntax.whenInjectedInto(parent);\n };\n BindingWhenOnSyntax.prototype.whenParentNamed = function (name) {\n return this._bindingWhenSyntax.whenParentNamed(name);\n };\n BindingWhenOnSyntax.prototype.whenParentTagged = function (tag, value) {\n return this._bindingWhenSyntax.whenParentTagged(tag, value);\n };\n BindingWhenOnSyntax.prototype.whenAnyAncestorIs = function (ancestor) {\n return this._bindingWhenSyntax.whenAnyAncestorIs(ancestor);\n };\n BindingWhenOnSyntax.prototype.whenNoAncestorIs = function (ancestor) {\n return this._bindingWhenSyntax.whenNoAncestorIs(ancestor);\n };\n BindingWhenOnSyntax.prototype.whenAnyAncestorNamed = function (name) {\n return this._bindingWhenSyntax.whenAnyAncestorNamed(name);\n };\n BindingWhenOnSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {\n return this._bindingWhenSyntax.whenAnyAncestorTagged(tag, value);\n };\n BindingWhenOnSyntax.prototype.whenNoAncestorNamed = function (name) {\n return this._bindingWhenSyntax.whenNoAncestorNamed(name);\n };\n BindingWhenOnSyntax.prototype.whenNoAncestorTagged = function (tag, value) {\n return this._bindingWhenSyntax.whenNoAncestorTagged(tag, value);\n };\n BindingWhenOnSyntax.prototype.whenAnyAncestorMatches = function (constraint) {\n return this._bindingWhenSyntax.whenAnyAncestorMatches(constraint);\n };\n BindingWhenOnSyntax.prototype.whenNoAncestorMatches = function (constraint) {\n return this._bindingWhenSyntax.whenNoAncestorMatches(constraint);\n };\n BindingWhenOnSyntax.prototype.onActivation = function (handler) {\n return this._bindingOnSyntax.onActivation(handler);\n };\n return BindingWhenOnSyntax;\n}());\nexports.BindingWhenOnSyntax = BindingWhenOnSyntax;\n//# sourceMappingURL=binding_when_on_syntax.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/syntax/binding_when_on_syntax.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"tpmt\", function() { return tpmt; });\n// tpmt is two power minus ten times t scaled to [0,1]\nfunction tpmt(x) {\n return (Math.pow(2, -10 * x) - 0.0009765625) * 1.0009775171065494;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/math.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/syntax/binding_when_syntax.js": -/*!******************************************************************!*\ - !*** ./node_modules/inversify/lib/syntax/binding_when_syntax.js ***! - \******************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/poly.js": +/*!******************************************!*\ + !*** ./node_modules/d3-ease/src/poly.js ***! + \******************************************/ +/*! exports provided: polyIn, polyOut, polyInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.BindingWhenSyntax = void 0;\nvar binding_on_syntax_1 = __webpack_require__(/*! ./binding_on_syntax */ \"./node_modules/inversify/lib/syntax/binding_on_syntax.js\");\nvar constraint_helpers_1 = __webpack_require__(/*! ./constraint_helpers */ \"./node_modules/inversify/lib/syntax/constraint_helpers.js\");\nvar BindingWhenSyntax = (function () {\n function BindingWhenSyntax(binding) {\n this._binding = binding;\n }\n BindingWhenSyntax.prototype.when = function (constraint) {\n this._binding.constraint = constraint;\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenTargetNamed = function (name) {\n this._binding.constraint = constraint_helpers_1.namedConstraint(name);\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenTargetIsDefault = function () {\n this._binding.constraint = function (request) {\n var targetIsDefault = (request.target !== null) &&\n (!request.target.isNamed()) &&\n (!request.target.isTagged());\n return targetIsDefault;\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenTargetTagged = function (tag, value) {\n this._binding.constraint = constraint_helpers_1.taggedConstraint(tag)(value);\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenInjectedInto = function (parent) {\n this._binding.constraint = function (request) {\n return constraint_helpers_1.typeConstraint(parent)(request.parentRequest);\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenParentNamed = function (name) {\n this._binding.constraint = function (request) {\n return constraint_helpers_1.namedConstraint(name)(request.parentRequest);\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenParentTagged = function (tag, value) {\n this._binding.constraint = function (request) {\n return constraint_helpers_1.taggedConstraint(tag)(value)(request.parentRequest);\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenAnyAncestorIs = function (ancestor) {\n this._binding.constraint = function (request) {\n return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.typeConstraint(ancestor));\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenNoAncestorIs = function (ancestor) {\n this._binding.constraint = function (request) {\n return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.typeConstraint(ancestor));\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenAnyAncestorNamed = function (name) {\n this._binding.constraint = function (request) {\n return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.namedConstraint(name));\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenNoAncestorNamed = function (name) {\n this._binding.constraint = function (request) {\n return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.namedConstraint(name));\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenAnyAncestorTagged = function (tag, value) {\n this._binding.constraint = function (request) {\n return constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.taggedConstraint(tag)(value));\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenNoAncestorTagged = function (tag, value) {\n this._binding.constraint = function (request) {\n return !constraint_helpers_1.traverseAncerstors(request, constraint_helpers_1.taggedConstraint(tag)(value));\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenAnyAncestorMatches = function (constraint) {\n this._binding.constraint = function (request) {\n return constraint_helpers_1.traverseAncerstors(request, constraint);\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n BindingWhenSyntax.prototype.whenNoAncestorMatches = function (constraint) {\n this._binding.constraint = function (request) {\n return !constraint_helpers_1.traverseAncerstors(request, constraint);\n };\n return new binding_on_syntax_1.BindingOnSyntax(this._binding);\n };\n return BindingWhenSyntax;\n}());\nexports.BindingWhenSyntax = BindingWhenSyntax;\n//# sourceMappingURL=binding_when_syntax.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/syntax/binding_when_syntax.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polyIn\", function() { return polyIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polyOut\", function() { return polyOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"polyInOut\", function() { return polyInOut; });\nvar exponent = 3;\n\nvar polyIn = (function custom(e) {\n e = +e;\n\n function polyIn(t) {\n return Math.pow(t, e);\n }\n\n polyIn.exponent = custom;\n\n return polyIn;\n})(exponent);\n\nvar polyOut = (function custom(e) {\n e = +e;\n\n function polyOut(t) {\n return 1 - Math.pow(1 - t, e);\n }\n\n polyOut.exponent = custom;\n\n return polyOut;\n})(exponent);\n\nvar polyInOut = (function custom(e) {\n e = +e;\n\n function polyInOut(t) {\n return ((t *= 2) <= 1 ? Math.pow(t, e) : 2 - Math.pow(2 - t, e)) / 2;\n }\n\n polyInOut.exponent = custom;\n\n return polyInOut;\n})(exponent);\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/poly.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/syntax/constraint_helpers.js": -/*!*****************************************************************!*\ - !*** ./node_modules/inversify/lib/syntax/constraint_helpers.js ***! - \*****************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/quad.js": +/*!******************************************!*\ + !*** ./node_modules/d3-ease/src/quad.js ***! + \******************************************/ +/*! exports provided: quadIn, quadOut, quadInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.typeConstraint = exports.namedConstraint = exports.taggedConstraint = exports.traverseAncerstors = void 0;\nvar METADATA_KEY = __webpack_require__(/*! ../constants/metadata_keys */ \"./node_modules/inversify/lib/constants/metadata_keys.js\");\nvar metadata_1 = __webpack_require__(/*! ../planning/metadata */ \"./node_modules/inversify/lib/planning/metadata.js\");\nvar traverseAncerstors = function (request, constraint) {\n var parent = request.parentRequest;\n if (parent !== null) {\n return constraint(parent) ? true : traverseAncerstors(parent, constraint);\n }\n else {\n return false;\n }\n};\nexports.traverseAncerstors = traverseAncerstors;\nvar taggedConstraint = function (key) { return function (value) {\n var constraint = function (request) {\n return request !== null && request.target !== null && request.target.matchesTag(key)(value);\n };\n constraint.metaData = new metadata_1.Metadata(key, value);\n return constraint;\n}; };\nexports.taggedConstraint = taggedConstraint;\nvar namedConstraint = taggedConstraint(METADATA_KEY.NAMED_TAG);\nexports.namedConstraint = namedConstraint;\nvar typeConstraint = function (type) { return function (request) {\n var binding = null;\n if (request !== null) {\n binding = request.bindings[0];\n if (typeof type === \"string\") {\n var serviceIdentifier = binding.serviceIdentifier;\n return serviceIdentifier === type;\n }\n else {\n var constructor = request.bindings[0].implementationType;\n return type === constructor;\n }\n }\n return false;\n}; };\nexports.typeConstraint = typeConstraint;\n//# sourceMappingURL=constraint_helpers.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/syntax/constraint_helpers.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadIn\", function() { return quadIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadOut\", function() { return quadOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"quadInOut\", function() { return quadInOut; });\nfunction quadIn(t) {\n return t * t;\n}\n\nfunction quadOut(t) {\n return t * (2 - t);\n}\n\nfunction quadInOut(t) {\n return ((t *= 2) <= 1 ? t * t : --t * (2 - t) + 1) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/quad.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/utils/binding_utils.js": -/*!***********************************************************!*\ - !*** ./node_modules/inversify/lib/utils/binding_utils.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-ease/src/sin.js": +/*!*****************************************!*\ + !*** ./node_modules/d3-ease/src/sin.js ***! + \*****************************************/ +/*! exports provided: sinIn, sinOut, sinInOut */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.multiBindToService = void 0;\nvar multiBindToService = function (container) {\n return function (service) {\n return function () {\n var types = [];\n for (var _i = 0; _i < arguments.length; _i++) {\n types[_i] = arguments[_i];\n }\n return types.forEach(function (t) { return container.bind(t).toService(service); });\n };\n };\n};\nexports.multiBindToService = multiBindToService;\n//# sourceMappingURL=binding_utils.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/utils/binding_utils.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sinIn\", function() { return sinIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sinOut\", function() { return sinOut; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sinInOut\", function() { return sinInOut; });\nvar pi = Math.PI,\n halfPi = pi / 2;\n\nfunction sinIn(t) {\n return (+t === 1) ? 1 : 1 - Math.cos(t * halfPi);\n}\n\nfunction sinOut(t) {\n return Math.sin(t * halfPi);\n}\n\nfunction sinInOut(t) {\n return (1 - Math.cos(pi * t)) / 2;\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-ease/src/sin.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/utils/exceptions.js": -/*!********************************************************!*\ - !*** ./node_modules/inversify/lib/utils/exceptions.js ***! - \********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-timer/src/index.js": +/*!********************************************!*\ + !*** ./node_modules/d3-timer/src/index.js ***! + \********************************************/ +/*! exports provided: now, timer, timerFlush, timeout, interval */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.isStackOverflowExeption = void 0;\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nfunction isStackOverflowExeption(error) {\n return (error instanceof RangeError ||\n error.message === ERROR_MSGS.STACK_OVERFLOW);\n}\nexports.isStackOverflowExeption = isStackOverflowExeption;\n//# sourceMappingURL=exceptions.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/utils/exceptions.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ \"./node_modules/d3-timer/src/timer.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"now\", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"now\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"timer\", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"timer\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"timerFlush\", function() { return _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"timerFlush\"]; });\n\n/* harmony import */ var _timeout_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./timeout.js */ \"./node_modules/d3-timer/src/timeout.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"timeout\", function() { return _timeout_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _interval_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./interval.js */ \"./node_modules/d3-timer/src/interval.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"interval\", function() { return _interval_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/d3-timer/src/index.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/utils/id.js": -/*!************************************************!*\ - !*** ./node_modules/inversify/lib/utils/id.js ***! - \************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-timer/src/interval.js": +/*!***********************************************!*\ + !*** ./node_modules/d3-timer/src/interval.js ***! + \***********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.id = void 0;\nvar idCounter = 0;\nfunction id() {\n return idCounter++;\n}\nexports.id = id;\n//# sourceMappingURL=id.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/utils/id.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ \"./node_modules/d3-timer/src/timer.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(callback, delay, time) {\n var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"Timer\"], total = delay;\n if (delay == null) return t.restart(callback, delay, time), t;\n delay = +delay, time = time == null ? Object(_timer_js__WEBPACK_IMPORTED_MODULE_0__[\"now\"])() : +time;\n t.restart(function tick(elapsed) {\n elapsed += total;\n t.restart(tick, total += delay, time);\n callback(elapsed);\n }, delay, time);\n return t;\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-timer/src/interval.js?"); /***/ }), -/***/ "./node_modules/inversify/lib/utils/serialization.js": -/*!***********************************************************!*\ - !*** ./node_modules/inversify/lib/utils/serialization.js ***! - \***********************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/d3-timer/src/timeout.js": +/*!**********************************************!*\ + !*** ./node_modules/d3-timer/src/timeout.js ***! + \**********************************************/ +/*! exports provided: default */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("\nObject.defineProperty(exports, \"__esModule\", { value: true });\nexports.circularDependencyToException = exports.listMetadataForTarget = exports.listRegisteredBindingsForServiceIdentifier = exports.getServiceIdentifierAsString = exports.getFunctionName = void 0;\nvar ERROR_MSGS = __webpack_require__(/*! ../constants/error_msgs */ \"./node_modules/inversify/lib/constants/error_msgs.js\");\nfunction getServiceIdentifierAsString(serviceIdentifier) {\n if (typeof serviceIdentifier === \"function\") {\n var _serviceIdentifier = serviceIdentifier;\n return _serviceIdentifier.name;\n }\n else if (typeof serviceIdentifier === \"symbol\") {\n return serviceIdentifier.toString();\n }\n else {\n var _serviceIdentifier = serviceIdentifier;\n return _serviceIdentifier;\n }\n}\nexports.getServiceIdentifierAsString = getServiceIdentifierAsString;\nfunction listRegisteredBindingsForServiceIdentifier(container, serviceIdentifier, getBindings) {\n var registeredBindingsList = \"\";\n var registeredBindings = getBindings(container, serviceIdentifier);\n if (registeredBindings.length !== 0) {\n registeredBindingsList = \"\\nRegistered bindings:\";\n registeredBindings.forEach(function (binding) {\n var name = \"Object\";\n if (binding.implementationType !== null) {\n name = getFunctionName(binding.implementationType);\n }\n registeredBindingsList = registeredBindingsList + \"\\n \" + name;\n if (binding.constraint.metaData) {\n registeredBindingsList = registeredBindingsList + \" - \" + binding.constraint.metaData;\n }\n });\n }\n return registeredBindingsList;\n}\nexports.listRegisteredBindingsForServiceIdentifier = listRegisteredBindingsForServiceIdentifier;\nfunction alreadyDependencyChain(request, serviceIdentifier) {\n if (request.parentRequest === null) {\n return false;\n }\n else if (request.parentRequest.serviceIdentifier === serviceIdentifier) {\n return true;\n }\n else {\n return alreadyDependencyChain(request.parentRequest, serviceIdentifier);\n }\n}\nfunction dependencyChainToString(request) {\n function _createStringArr(req, result) {\n if (result === void 0) { result = []; }\n var serviceIdentifier = getServiceIdentifierAsString(req.serviceIdentifier);\n result.push(serviceIdentifier);\n if (req.parentRequest !== null) {\n return _createStringArr(req.parentRequest, result);\n }\n return result;\n }\n var stringArr = _createStringArr(request);\n return stringArr.reverse().join(\" --> \");\n}\nfunction circularDependencyToException(request) {\n request.childRequests.forEach(function (childRequest) {\n if (alreadyDependencyChain(childRequest, childRequest.serviceIdentifier)) {\n var services = dependencyChainToString(childRequest);\n throw new Error(ERROR_MSGS.CIRCULAR_DEPENDENCY + \" \" + services);\n }\n else {\n circularDependencyToException(childRequest);\n }\n });\n}\nexports.circularDependencyToException = circularDependencyToException;\nfunction listMetadataForTarget(serviceIdentifierString, target) {\n if (target.isTagged() || target.isNamed()) {\n var m_1 = \"\";\n var namedTag = target.getNamedTag();\n var otherTags = target.getCustomTags();\n if (namedTag !== null) {\n m_1 += namedTag.toString() + \"\\n\";\n }\n if (otherTags !== null) {\n otherTags.forEach(function (tag) {\n m_1 += tag.toString() + \"\\n\";\n });\n }\n return \" \" + serviceIdentifierString + \"\\n \" + serviceIdentifierString + \" - \" + m_1;\n }\n else {\n return \" \" + serviceIdentifierString;\n }\n}\nexports.listMetadataForTarget = listMetadataForTarget;\nfunction getFunctionName(v) {\n if (v.name) {\n return v.name;\n }\n else {\n var name_1 = v.toString();\n var match = name_1.match(/^function\\s*([^\\s(]+)/);\n return match ? match[1] : \"Anonymous function: \" + name_1;\n }\n}\nexports.getFunctionName = getFunctionName;\n//# sourceMappingURL=serialization.js.map\n\n//# sourceURL=webpack:///./node_modules/inversify/lib/utils/serialization.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _timer_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./timer.js */ \"./node_modules/d3-timer/src/timer.js\");\n\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (function(callback, delay, time) {\n var t = new _timer_js__WEBPACK_IMPORTED_MODULE_0__[\"Timer\"];\n delay = delay == null ? 0 : +delay;\n t.restart(function(elapsed) {\n t.stop();\n callback(elapsed + delay);\n }, delay, time);\n return t;\n});\n\n\n//# sourceURL=webpack:///./node_modules/d3-timer/src/timeout.js?"); /***/ }), -/***/ "./node_modules/is-any-array/lib-esm/index.js": -/*!****************************************************!*\ - !*** ./node_modules/is-any-array/lib-esm/index.js ***! - \****************************************************/ -/*! exports provided: isAnyArray */ +/***/ "./node_modules/d3-timer/src/timer.js": +/*!********************************************!*\ + !*** ./node_modules/d3-timer/src/timer.js ***! + \********************************************/ +/*! exports provided: now, Timer, timer, timerFlush */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAnyArray\", function() { return isAnyArray; });\nconst toString = Object.prototype.toString;\n/**\n * Checks if an object is an instance of an Array (array or typed array).\n *\n * @param {any} value - Object to check.\n * @returns {boolean} True if the object is an array.\n */\nfunction isAnyArray(value) {\n return toString.call(value).endsWith('Array]');\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/is-any-array/lib-esm/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"now\", function() { return now; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"Timer\", function() { return Timer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timer\", function() { return timer; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"timerFlush\", function() { return timerFlush; });\nvar frame = 0, // is an animation frame pending?\n timeout = 0, // is a timeout pending?\n interval = 0, // are any timers active?\n pokeDelay = 1000, // how frequently we check for clock skew\n taskHead,\n taskTail,\n clockLast = 0,\n clockNow = 0,\n clockSkew = 0,\n clock = typeof performance === \"object\" && performance.now ? performance : Date,\n setFrame = typeof window === \"object\" && window.requestAnimationFrame ? window.requestAnimationFrame.bind(window) : function(f) { setTimeout(f, 17); };\n\nfunction now() {\n return clockNow || (setFrame(clearNow), clockNow = clock.now() + clockSkew);\n}\n\nfunction clearNow() {\n clockNow = 0;\n}\n\nfunction Timer() {\n this._call =\n this._time =\n this._next = null;\n}\n\nTimer.prototype = timer.prototype = {\n constructor: Timer,\n restart: function(callback, delay, time) {\n if (typeof callback !== \"function\") throw new TypeError(\"callback is not a function\");\n time = (time == null ? now() : +time) + (delay == null ? 0 : +delay);\n if (!this._next && taskTail !== this) {\n if (taskTail) taskTail._next = this;\n else taskHead = this;\n taskTail = this;\n }\n this._call = callback;\n this._time = time;\n sleep();\n },\n stop: function() {\n if (this._call) {\n this._call = null;\n this._time = Infinity;\n sleep();\n }\n }\n};\n\nfunction timer(callback, delay, time) {\n var t = new Timer;\n t.restart(callback, delay, time);\n return t;\n}\n\nfunction timerFlush() {\n now(); // Get the current time, if not already set.\n ++frame; // Pretend we’ve set an alarm, if we haven’t already.\n var t = taskHead, e;\n while (t) {\n if ((e = clockNow - t._time) >= 0) t._call.call(null, e);\n t = t._next;\n }\n --frame;\n}\n\nfunction wake() {\n clockNow = (clockLast = clock.now()) + clockSkew;\n frame = timeout = 0;\n try {\n timerFlush();\n } finally {\n frame = 0;\n nap();\n clockNow = 0;\n }\n}\n\nfunction poke() {\n var now = clock.now(), delay = now - clockLast;\n if (delay > pokeDelay) clockSkew -= delay, clockLast = now;\n}\n\nfunction nap() {\n var t0, t1 = taskHead, t2, time = Infinity;\n while (t1) {\n if (t1._call) {\n if (time > t1._time) time = t1._time;\n t0 = t1, t1 = t1._next;\n } else {\n t2 = t1._next, t1._next = null;\n t1 = t0 ? t0._next = t2 : taskHead = t2;\n }\n }\n taskTail = t0;\n sleep(time);\n}\n\nfunction sleep(time) {\n if (frame) return; // Soonest alarm already set, or will be.\n if (timeout) timeout = clearTimeout(timeout);\n var delay = time - clockNow; // Strictly less than if we recomputed clockNow.\n if (delay > 24) {\n if (time < Infinity) timeout = setTimeout(wake, time - clock.now() - clockSkew);\n if (interval) interval = clearInterval(interval);\n } else {\n if (!interval) clockLast = clock.now(), interval = setInterval(poke, pokeDelay);\n frame = 1, setFrame(wake);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/d3-timer/src/timer.js?"); /***/ }), -/***/ "./node_modules/lodash.debounce/index.js": -/*!***********************************************!*\ - !*** ./node_modules/lodash.debounce/index.js ***! - \***********************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { +/***/ "./node_modules/dagre-compound/dist/dagre-compound.es5.js": +/*!****************************************************************!*\ + !*** ./node_modules/dagre-compound/dist/dagre-compound.es5.js ***! + \****************************************************************/ +/*! exports provided: BRIDGE_GRAPH_NAME, GraphType, HierarchyNodeType, InclusionType, LAYOUT_CONFIG, NodeType, ROOT_NAME, buildGraph, flatGraph, getEdges, mergeConfig */ +/***/ (function(module, __webpack_exports__, __webpack_require__) { -eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/lodash.debounce/index.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(global) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BRIDGE_GRAPH_NAME\", function() { return o; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"GraphType\", function() { return u; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"HierarchyNodeType\", function() { return c; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"InclusionType\", function() { return a; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LAYOUT_CONFIG\", function() { return e; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NodeType\", function() { return i; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ROOT_NAME\", function() { return r; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"buildGraph\", function() { return rc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"flatGraph\", function() { return oc; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getEdges\", function() { return ic; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mergeConfig\", function() { return n; });\nconst e={graph:{meta:{rankDir:\"TB\",nodeSep:50,rankSep:50,edgeSep:5,align:void 0}},subScene:{meta:{paddingTop:20,paddingBottom:20,paddingLeft:20,paddingRight:20,labelHeight:20}},nodeSize:{meta:{width:100,maxLabelWidth:0,height:20},node:{width:80,height:20,labelOffset:10,maxLabelWidth:40},bridge:{width:5,height:5,radius:2,labelOffset:0}}};function n(n={},t=e){var r,o,i,a;const u=JSON.parse(JSON.stringify(t)),c=(null===(r=null==n?void 0:n.graph)||void 0===r?void 0:r.meta)||{},s=(null===(o=null==n?void 0:n.subScene)||void 0===o?void 0:o.meta)||{},d=(null===(i=null==n?void 0:n.nodeSize)||void 0===i?void 0:i.meta)||{},f=(null===(a=null==n?void 0:n.nodeSize)||void 0===a?void 0:a.node)||{},h=u.nodeSize.bridge;return{graph:{meta:Object.assign(u.graph.meta,c)},subScene:{meta:Object.assign(u.subScene.meta,s)},nodeSize:{meta:Object.assign(u.nodeSize.meta,d),node:Object.assign(u.nodeSize.node,f),bridge:h}}}function t(e){return`◬${e}◬`}const r=t(\"ROOT\"),o=t(\"BRIDGE_GRAPH\");var i,a,u,c;!function(e){e[e.META=0]=\"META\",e[e.NODE=1]=\"NODE\",e[e.BRIDGE=2]=\"BRIDGE\"}(i||(i={})),function(e){e[e.INCLUDE=0]=\"INCLUDE\",e[e.EXCLUDE=1]=\"EXCLUDE\",e[e.UNSPECIFIED=2]=\"UNSPECIFIED\"}(a||(a={})),function(e){e[e.META=0]=\"META\",e[e.CORE=1]=\"CORE\",e[e.BRIDGE=2]=\"BRIDGE\"}(u||(u={})),function(e){e[e.META=0]=\"META\",e[e.OP=1]=\"OP\",e[e.SERIES=2]=\"SERIES\"}(c||(c={}));var s=\"undefined\"!=typeof globalThis?globalThis:\"undefined\"!=typeof window?window:\"undefined\"!=typeof global?global:\"undefined\"!=typeof self?self:{};function d(e,n){return e(n={exports:{}},n.exports),n.exports}var f=function(){this.__data__=[],this.size=0};var h=function(e,n){return e===n||e!=e&&n!=n};var l=function(e,n){for(var t=e.length;t--;)if(h(e[t][0],n))return t;return-1},v=Array.prototype.splice;var p=function(e){var n=this.__data__,t=l(n,e);return!(t<0)&&(t==n.length-1?n.pop():v.call(n,t,1),--this.size,!0)};var g=function(e){var n=this.__data__,t=l(n,e);return t<0?void 0:n[t][1]};var y=function(e){return l(this.__data__,e)>-1};var b=function(e,n){var t=this.__data__,r=l(t,e);return r<0?(++this.size,t.push([e,n])):t[r][1]=n,this};function m(e){var n=-1,t=null==e?0:e.length;for(this.clear();++n-1&&e%1==0&&e-1&&e%1==0&&e<=9007199254740991},Ve={};Ve[\"[object Float32Array]\"]=Ve[\"[object Float64Array]\"]=Ve[\"[object Int8Array]\"]=Ve[\"[object Int16Array]\"]=Ve[\"[object Int32Array]\"]=Ve[\"[object Uint8Array]\"]=Ve[\"[object Uint8ClampedArray]\"]=Ve[\"[object Uint16Array]\"]=Ve[\"[object Uint32Array]\"]=!0,Ve[\"[object Arguments]\"]=Ve[\"[object Array]\"]=Ve[\"[object ArrayBuffer]\"]=Ve[\"[object Boolean]\"]=Ve[\"[object DataView]\"]=Ve[\"[object Date]\"]=Ve[\"[object Error]\"]=Ve[\"[object Function]\"]=Ve[\"[object Map]\"]=Ve[\"[object Number]\"]=Ve[\"[object Object]\"]=Ve[\"[object RegExp]\"]=Ve[\"[object Set]\"]=Ve[\"[object String]\"]=Ve[\"[object WeakMap]\"]=!1;var $e=function(e){return Ce(e)&&Ue(e.length)&&!!Ve[T(e)]};var He=function(e){return function(n){return e(n)}},We=d((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,o=r&&r.exports===t&&N.process,i=function(){try{var e=r&&r.require&&r.require(\"util\").types;return e||o&&o.binding&&o.binding(\"util\")}catch(e){}}();e.exports=i})),qe=We&&We.isTypedArray,Ye=qe?He(qe):$e,Je=Object.prototype.hasOwnProperty;var Xe=function(e,n){var t=Te(e),r=!t&&Re(e),o=!t&&!r&&Pe(e),i=!t&&!r&&!o&&Ye(e),a=t||r||o||i,u=a?Me(e.length,String):[],c=u.length;for(var s in e)!n&&!Je.call(e,s)||a&&(\"length\"==s||o&&(\"offset\"==s||\"parent\"==s)||i&&(\"buffer\"==s||\"byteLength\"==s||\"byteOffset\"==s)||Fe(s,c))||u.push(s);return u},Ke=Object.prototype;var Qe=function(e){var n=e&&e.constructor;return e===(\"function\"==typeof n&&n.prototype||Ke)};var Ze=function(e,n){return function(t){return e(n(t))}},en=Ze(Object.keys,Object),nn=Object.prototype.hasOwnProperty;var tn=function(e){if(!Qe(e))return en(e);var n=[];for(var t in Object(e))nn.call(e,t)&&\"constructor\"!=t&&n.push(t);return n};var rn=function(e){return null!=e&&Ue(e.length)&&!z(e)};var on=function(e){return rn(e)?Xe(e):tn(e)};var an=function(e,n){return e&&Se(n,on(n),e)};var un=function(e){var n=[];if(null!=e)for(var t in Object(e))n.push(t);return n},cn=Object.prototype.hasOwnProperty;var sn=function(e){if(!D(e))return un(e);var n=Qe(e),t=[];for(var r in e)(\"constructor\"!=r||!n&&cn.call(e,r))&&t.push(r);return t};var dn=function(e){return rn(e)?Xe(e,!0):sn(e)};var fn=function(e,n){return e&&Se(n,dn(n),e)},hn=d((function(e,n){var t=n&&!n.nodeType&&n,r=t&&e&&!e.nodeType&&e,o=r&&r.exports===t?k.Buffer:void 0,i=o?o.allocUnsafe:void 0;e.exports=function(e,n){if(n)return e.slice();var t=e.length,r=i?i(t):new e.constructor(t);return e.copy(r),r}}));var ln=function(e,n){var t=-1,r=e.length;for(n||(n=Array(r));++tu))return!1;var s=i.get(e),d=i.get(n);if(s&&d)return s==n&&d==e;var f=-1,h=!0,l=2&t?new wt:void 0;for(i.set(e,n),i.set(n,e);++f0&&r(c)?t>1?e(c,t-1,r,o,i):wn(i,c):o||(i[i.length]=c)}return i};var $r=function(e,n,t){switch(t.length){case 0:return e.call(n);case 1:return e.call(n,t[0]);case 2:return e.call(n,t[0],t[1]);case 3:return e.call(n,t[0],t[1],t[2])}return e.apply(n,t)},Hr=Math.max;var Wr=function(e,n,t){return n=Hr(void 0===n?e.length-1:n,0),function(){for(var r=arguments,o=-1,i=Hr(r.length-n,0),a=Array(i);++o0){if(++n>=800)return arguments[0]}else n=0;return e.apply(void 0,arguments)}}(qr);var Xr=function(e,n){return Jr(Wr(e,n,ht),e+\"\")};var Kr=function(e,n,t,r){for(var o=e.length,i=t+(r?1:-1);r?i--:++i-1};var to=function(e,n,t){for(var r=-1,o=null==e?0:e.length;++r=200){var s=n?null:oo(e);if(s)return Nt(s);a=!1,o=_t,c=new wt}else c=n?[]:u;e:for(;++ri){var a=o;o=i,i=a}return o+\"\u0001\"+i+\"\u0001\"+(ho.isUndefined(r)?\"\\0\":r)}function bo(e,n,t,r){var o=\"\"+n,i=\"\"+t;if(!e&&o>i){var a=o;o=i,i=a}var u={v:o,w:i};return r&&(u.name=r),u}function mo(e,n){return yo(e,n.v,n.w,n.name)}vo.prototype._nodeCount=0,vo.prototype._edgeCount=0,vo.prototype.isDirected=function(){return this._isDirected},vo.prototype.isMultigraph=function(){return this._isMultigraph},vo.prototype.isCompound=function(){return this._isCompound},vo.prototype.setGraph=function(e){return this._label=e,this},vo.prototype.graph=function(){return this._label},vo.prototype.setDefaultNodeLabel=function(e){return ho.isFunction(e)||(e=ho.constant(e)),this._defaultNodeLabelFn=e,this},vo.prototype.nodeCount=function(){return this._nodeCount},vo.prototype.nodes=function(){return ho.keys(this._nodes)},vo.prototype.sources=function(){var e=this;return ho.filter(this.nodes(),(function(n){return ho.isEmpty(e._in[n])}))},vo.prototype.sinks=function(){var e=this;return ho.filter(this.nodes(),(function(n){return ho.isEmpty(e._out[n])}))},vo.prototype.setNodes=function(e,n){var t=arguments,r=this;return ho.each(e,(function(e){t.length>1?r.setNode(e,n):r.setNode(e)})),this},vo.prototype.setNode=function(e,n){return ho.has(this._nodes,e)?(arguments.length>1&&(this._nodes[e]=n),this):(this._nodes[e]=arguments.length>1?n:this._defaultNodeLabelFn(e),this._isCompound&&(this._parent[e]=\"\\0\",this._children[e]={},this._children[\"\\0\"][e]=!0),this._in[e]={},this._preds[e]={},this._out[e]={},this._sucs[e]={},++this._nodeCount,this)},vo.prototype.node=function(e){return this._nodes[e]},vo.prototype.hasNode=function(e){return ho.has(this._nodes,e)},vo.prototype.removeNode=function(e){var n=this;if(ho.has(this._nodes,e)){var t=function(e){n.removeEdge(n._edgeObjs[e])};delete this._nodes[e],this._isCompound&&(this._removeFromParentsChildList(e),delete this._parent[e],ho.each(this.children(e),(function(e){n.setParent(e)})),delete this._children[e]),ho.each(ho.keys(this._in[e]),t),delete this._in[e],delete this._preds[e],ho.each(ho.keys(this._out[e]),t),delete this._out[e],delete this._sucs[e],--this._nodeCount}return this},vo.prototype.setParent=function(e,n){if(!this._isCompound)throw new Error(\"Cannot set parent in a non-compound graph\");if(ho.isUndefined(n))n=\"\\0\";else{for(var t=n+=\"\";!ho.isUndefined(t);t=this.parent(t))if(t===e)throw new Error(\"Setting \"+n+\" as parent of \"+e+\" would create a cycle\");this.setNode(n)}return this.setNode(e),this._removeFromParentsChildList(e),this._parent[e]=n,this._children[n][e]=!0,this},vo.prototype._removeFromParentsChildList=function(e){delete this._children[this._parent[e]][e]},vo.prototype.parent=function(e){if(this._isCompound){var n=this._parent[e];if(\"\\0\"!==n)return n}},vo.prototype.children=function(e){if(ho.isUndefined(e)&&(e=\"\\0\"),this._isCompound){var n=this._children[e];if(n)return ho.keys(n)}else{if(\"\\0\"===e)return this.nodes();if(this.hasNode(e))return[]}},vo.prototype.predecessors=function(e){var n=this._preds[e];if(n)return ho.keys(n)},vo.prototype.successors=function(e){var n=this._sucs[e];if(n)return ho.keys(n)},vo.prototype.neighbors=function(e){var n=this.predecessors(e);if(n)return ho.union(n,this.successors(e))},vo.prototype.isLeaf=function(e){return 0===(this.isDirected()?this.successors(e):this.neighbors(e)).length},vo.prototype.filterNodes=function(e){var n=new this.constructor({directed:this._isDirected,multigraph:this._isMultigraph,compound:this._isCompound});n.setGraph(this.graph());var t=this;ho.each(this._nodes,(function(t,r){e(r)&&n.setNode(r,t)})),ho.each(this._edgeObjs,(function(e){n.hasNode(e.v)&&n.hasNode(e.w)&&n.setEdge(e,t.edge(e))}));var r={};function o(e){var i=t.parent(e);return void 0===i||n.hasNode(i)?(r[e]=i,i):i in r?r[i]:o(i)}return this._isCompound&&ho.each(n.nodes(),(function(e){n.setParent(e,o(e))})),n},vo.prototype.setDefaultEdgeLabel=function(e){return ho.isFunction(e)||(e=ho.constant(e)),this._defaultEdgeLabelFn=e,this},vo.prototype.edgeCount=function(){return this._edgeCount},vo.prototype.edges=function(){return ho.values(this._edgeObjs)},vo.prototype.setPath=function(e,n){var t=this,r=arguments;return ho.reduce(e,(function(e,o){return r.length>1?t.setEdge(e,o,n):t.setEdge(e,o),o})),this},vo.prototype.setEdge=function(){var e,n,t,r,o=!1,i=arguments[0];\"object\"==typeof i&&null!==i&&\"v\"in i?(e=i.v,n=i.w,t=i.name,2===arguments.length&&(r=arguments[1],o=!0)):(e=i,n=arguments[1],t=arguments[3],arguments.length>2&&(r=arguments[2],o=!0)),e=\"\"+e,n=\"\"+n,ho.isUndefined(t)||(t=\"\"+t);var a=yo(this._isDirected,e,n,t);if(ho.has(this._edgeLabels,a))return o&&(this._edgeLabels[a]=r),this;if(!ho.isUndefined(t)&&!this._isMultigraph)throw new Error(\"Cannot set a named edge when isMultigraph = false\");this.setNode(e),this.setNode(n),this._edgeLabels[a]=o?r:this._defaultEdgeLabelFn(e,n,t);var u=bo(this._isDirected,e,n,t);return e=u.v,n=u.w,Object.freeze(u),this._edgeObjs[a]=u,po(this._preds[n],e),po(this._sucs[e],n),this._in[n][a]=u,this._out[e][a]=u,this._edgeCount++,this},vo.prototype.edge=function(e,n,t){var r=1===arguments.length?mo(this._isDirected,arguments[0]):yo(this._isDirected,e,n,t);return this._edgeLabels[r]},vo.prototype.hasEdge=function(e,n,t){var r=1===arguments.length?mo(this._isDirected,arguments[0]):yo(this._isDirected,e,n,t);return ho.has(this._edgeLabels,r)},vo.prototype.removeEdge=function(e,n,t){var r=1===arguments.length?mo(this._isDirected,arguments[0]):yo(this._isDirected,e,n,t),o=this._edgeObjs[r];return o&&(e=o.v,n=o.w,delete this._edgeLabels[r],delete this._edgeObjs[r],go(this._preds[n],e),go(this._sucs[e],n),delete this._in[n][r],delete this._out[e][r],this._edgeCount--),this},vo.prototype.inEdges=function(e,n){var t=this._in[e];if(t){var r=ho.values(t);return n?ho.filter(r,(function(e){return e.v===n})):r}},vo.prototype.outEdges=function(e,n){var t=this._out[e];if(t){var r=ho.values(t);return n?ho.filter(r,(function(e){return e.w===n})):r}},vo.prototype.nodeEdges=function(e,n){var t=this.inEdges(e,n);if(t)return t.concat(this.outEdges(e,n))};var wo={Graph:lo,version:\"2.1.8\"},Eo={write:function(e){var n={options:{directed:e.isDirected(),multigraph:e.isMultigraph(),compound:e.isCompound()},nodes:_o(e),edges:jo(e)};ho.isUndefined(e.graph())||(n.value=ho.clone(e.graph()));return n},read:function(e){var n=new lo(e.options).setGraph(e.value);return ho.each(e.nodes,(function(e){n.setNode(e.v,e.value),e.parent&&n.setParent(e.v,e.parent)})),ho.each(e.edges,(function(e){n.setEdge({v:e.v,w:e.w,name:e.name},e.value)})),n}};function _o(e){return ho.map(e.nodes(),(function(n){var t=e.node(n),r=e.parent(n),o={v:n};return ho.isUndefined(t)||(o.value=t),ho.isUndefined(r)||(o.parent=r),o}))}function jo(e){return ho.map(e.edges(),(function(n){var t=e.edge(n),r={v:n.v,w:n.w};return ho.isUndefined(n.name)||(r.name=n.name),ho.isUndefined(t)||(r.value=t),r}))}var xo=function(e){var n,t={},r=[];function o(r){ho.has(t,r)||(t[r]=!0,n.push(r),ho.each(e.successors(r),o),ho.each(e.predecessors(r),o))}return ho.each(e.nodes(),(function(e){n=[],o(e),n.length&&r.push(n)})),r};var No=Oo;function Oo(){this._arr=[],this._keyIndices={}}Oo.prototype.size=function(){return this._arr.length},Oo.prototype.keys=function(){return this._arr.map((function(e){return e.key}))},Oo.prototype.has=function(e){return ho.has(this._keyIndices,e)},Oo.prototype.priority=function(e){var n=this._keyIndices[e];if(void 0!==n)return this._arr[n].priority},Oo.prototype.min=function(){if(0===this.size())throw new Error(\"Queue underflow\");return this._arr[0].key},Oo.prototype.add=function(e,n){var t=this._keyIndices;if(e=String(e),!ho.has(t,e)){var r=this._arr,o=r.length;return t[e]=o,r.push({key:e,priority:n}),this._decrease(o),!0}return!1},Oo.prototype.removeMin=function(){this._swap(0,this._arr.length-1);var e=this._arr.pop();return delete this._keyIndices[e.key],this._heapify(0),e.key},Oo.prototype.decrease=function(e,n){var t=this._keyIndices[e];if(n>this._arr[t].priority)throw new Error(\"New priority is greater than current priority. Key: \"+e+\" Old: \"+this._arr[t].priority+\" New: \"+n);this._arr[t].priority=n,this._decrease(t)},Oo.prototype._heapify=function(e){var n=this._arr,t=2*e,r=t+1,o=e;t>1].priority0&&(o=u.removeMin(),(i=a[o]).distance!==Number.POSITIVE_INFINITY);)r(o).forEach(c);return a}(e,String(n),t||Io,r||function(n){return e.outEdges(n)})},Io=ho.constant(1);var So=function(e,n,t){return ho.transform(e.nodes(),(function(r,o){r[o]=ko(e,o,n,t)}),{})};var Mo=function(e){var n=0,t=[],r={},o=[];function i(a){var u=r[a]={onStack:!0,lowlink:n,index:n++};if(t.push(a),e.successors(a).forEach((function(e){ho.has(r,e)?r[e].onStack&&(u.lowlink=Math.min(u.lowlink,r[e].index)):(i(e),u.lowlink=Math.min(u.lowlink,r[e].lowlink))})),u.lowlink===u.index){var c,s=[];do{c=t.pop(),r[c].onStack=!1,s.push(c)}while(a!==c);o.push(s)}}return e.nodes().forEach((function(e){ho.has(r,e)||i(e)})),o};var Co=function(e){return ho.filter(Mo(e),(function(n){return n.length>1||1===n.length&&e.hasEdge(n[0],n[0])}))};var Go=function(e,n,t){return function(e,n,t){var r={},o=e.nodes();return o.forEach((function(e){r[e]={},r[e][e]={distance:0},o.forEach((function(n){e!==n&&(r[e][n]={distance:Number.POSITIVE_INFINITY})})),t(e).forEach((function(t){var o=t.v===e?t.w:t.v,i=n(t);r[e][o]={distance:i,predecessor:e}}))})),o.forEach((function(e){var n=r[e];o.forEach((function(t){var i=r[t];o.forEach((function(t){var r=i[e],o=n[t],a=i[t],u=r.distance+o.distance;u0;){if(t=i.removeMin(),ho.has(o,t))r.setEdge(t,o[t]);else{if(u)throw new Error(\"Input graph is not connected: \"+e);u=!0}e.nodeEdges(t).forEach(a)}return r},tarjan:Mo,topsort:Ao},version:wo.version};try{Po=zo}catch(e){}Po||(Po=window.graphlib);var Fo=Po;var Uo=function(e){return at(e,5)};var Vo=function(e,n,t){if(!D(t))return!1;var r=typeof n;return!!(\"number\"==r?rn(t)&&Fe(n,t.length):\"string\"==r&&n in t)&&h(t[n],e)},$o=Object.prototype,Ho=$o.hasOwnProperty,Wo=Xr((function(e,n){e=Object(e);var t=-1,r=n.length,o=r>2?n[2]:void 0;for(o&&Vo(n[0],n[1],o)&&(r=1);++t-1?o[i?n[a]:a]:void 0}},Yo=/^\\s+|\\s+$/g,Jo=/^[-+]0x[0-9a-f]+$/i,Xo=/^0b[01]+$/i,Ko=/^0o[0-7]+$/i,Qo=parseInt;var Zo=function(e){if(\"number\"==typeof e)return e;if(Pt(e))return NaN;if(D(e)){var n=\"function\"==typeof e.valueOf?e.valueOf():e;e=D(n)?n+\"\":n}if(\"string\"!=typeof e)return 0===e?e:+e;e=e.replace(Yo,\"\");var t=Xo.test(e);return t||Ko.test(e)?Qo(e.slice(2),t?2:8):Jo.test(e)?NaN:+e};var ei=function(e){return e?Infinity===(e=Zo(e))||-Infinity===e?17976931348623157e292*(e<0?-1:1):e==e?e:0:0===e?e:0};var ni=function(e){var n=ei(e),t=n%1;return n==n?t?n-t:n:0},ti=Math.max;var ri=qo((function(e,n,t){var r=null==e?0:e.length;if(!r)return-1;var o=null==t?0:ni(t);return o<0&&(o=ti(r+o,0)),Kr(e,dr(n),o)}));var oi=function(e){return(null==e?0:e.length)?Vr(e,1):[]};var ii=function(e,n){return null==e?e:st(e,lt(n),dn)};var ai=function(e){var n=null==e?0:e.length;return n?e[n-1]:void 0};var ui=function(e,n){var t={};return n=dr(n),dt(e,(function(e,r,o){Oe(t,r,n(e,r,o))})),t};var ci=function(e,n,t){for(var r=-1,o=e.length;++rn};var di=function(e){return e&&e.length?ci(e,ht,si):void 0};var fi=function(e,n,t){(void 0!==t&&!h(e[n],t)||void 0===t&&!(n in e))&&Oe(e,n,t)},hi=Function.prototype,li=Object.prototype,vi=hi.toString,pi=li.hasOwnProperty,gi=vi.call(Object);var yi=function(e){if(!Ce(e)||\"[object Object]\"!=T(e))return!1;var n=En(e);if(null===n)return!0;var t=pi.call(n,\"constructor\")&&n.constructor;return\"function\"==typeof t&&t instanceof t&&vi.call(t)==gi};var bi=function(e,n){if((\"constructor\"!==n||\"function\"!=typeof e[n])&&\"__proto__\"!=n)return e[n]};var mi=function(e){return Se(e,dn(e))};var wi=function(e,n,t,r,o,i,a){var u=bi(e,t),c=bi(n,t),s=a.get(c);if(s)fi(e,t,s);else{var d=i?i(u,c,t+\"\",e,n,a):void 0,f=void 0===d;if(f){var h=Te(c),l=!h&&Pe(c),v=!h&&!l&&Ye(c);d=c,h||l||v?Te(u)?d=u:ao(u)?d=ln(u):l?(f=!1,d=hn(c,!0)):v?(f=!1,d=Yn(c,!0)):d=[]:yi(c)||Re(c)?(d=u,Re(u)?d=mi(u):D(u)&&!z(u)||(d=Qn(c))):f=!1}f&&(a.set(c,d),o(d,c,r,i,a),a.delete(c)),fi(e,t,d)}};var Ei=function e(n,t,r,o,i){n!==t&&st(t,(function(a,u){if(i||(i=new je),D(a))wi(n,t,u,r,e,o,i);else{var c=o?o(bi(n,u),a,u+\"\",n,t,i):void 0;void 0===c&&(c=a),fi(n,u,c)}}),dn)};var _i=function(e){return Xr((function(n,t){var r=-1,o=t.length,i=o>1?t[o-1]:void 0,a=o>2?t[2]:void 0;for(i=e.length>3&&\"function\"==typeof i?(o--,i):void 0,a&&Vo(t[0],t[1],a)&&(i=o<3?void 0:i,o=1),n=Object(n);++rn||i&&a&&c&&!u&&!s||r&&a&&c||!t&&c||!o)return 1;if(!r&&!i&&!s&&e=u?c:c*(\"desc\"==t[r]?-1:1)}return e.index-n.index};var Di=function(e,n,t){n=n.length?Yt(n,(function(e){return Te(e)?function(n){return nr(n,1===e.length?e[0]:e)}:e})):[ht];var r=-1;n=Yt(n,He(dr));var o=br(e,(function(e,t,o){return{criteria:Yt(n,(function(n){return n(e)})),index:++r,value:e}}));return Li(o,(function(e,n){return Ti(e,n,t)}))},Pi=Xr((function(e,n){if(null==e)return[];var t=n.length;return t>1&&Vo(e,n[0],n[1])?n=[]:t>2&&Vo(n[0],n[1],n[2])&&(n=[n[0]]),Di(e,Vr(n,1),[])})),zi=0;var Fi=function(e){var n=++zi;return Qt(e)+n};var Ui=function(e,n,t){for(var r=-1,o=e.length,i=n.length,a={};++r0;--u)if(r=n[u].dequeue()){o=o.concat(Zi(e,n,t,r,!0));break}}return o}(t.graph,t.buckets,t.zeroIdx);return Hi.flatten(Hi.map(r,(function(n){return e.outEdges(n.v,n.w)})),!0)},Qi=Hi.constant(1);function Zi(e,n,t,r,o){var i=o?[]:void 0;return Hi.forEach(e.inEdges(r.v),(function(r){var a=e.edge(r),u=e.node(r.v);o&&i.push({v:r.v,w:r.w}),u.out-=a,ea(n,t,u)})),Hi.forEach(e.outEdges(r.v),(function(r){var o=e.edge(r),i=r.w,a=e.node(i);a.in-=o,ea(n,t,a)})),e.removeNode(r.v),i}function ea(e,n,t){t.out?t.in?e[t.out-t.in+n].enqueue(t):e[e.length-1].enqueue(t):e[0].enqueue(t)}var na={run:function(e){var n=\"greedy\"===e.graph().acyclicer?Ki(e,function(e){return function(n){return e.edge(n).weight}}(e)):function(e){var n=[],t={},r={};function o(i){Hi.has(r,i)||(r[i]=!0,t[i]=!0,Hi.forEach(e.outEdges(i),(function(e){Hi.has(t,e.w)?n.push(e):o(e.w)})),delete t[i])}return Hi.forEach(e.nodes(),o),n}(e);Hi.forEach(n,(function(n){var t=e.edge(n);e.removeEdge(n),t.forwardName=n.name,t.reversed=!0,e.setEdge(n.w,n.v,t,Hi.uniqueId(\"rev\"))}))},undo:function(e){Hi.forEach(e.edges(),(function(n){var t=e.edge(n);if(t.reversed){e.removeEdge(n);var r=t.forwardName;delete t.reversed,delete t.forwardName,e.setEdge(n.w,n.v,t,r)}}))}};var ta=Fo.Graph,ra={addDummyNode:oa,simplify:function(e){var n=(new ta).setGraph(e.graph());return Hi.forEach(e.nodes(),(function(t){n.setNode(t,e.node(t))})),Hi.forEach(e.edges(),(function(t){var r=n.edge(t.v,t.w)||{weight:0,minlen:1},o=e.edge(t);n.setEdge(t.v,t.w,{weight:r.weight+o.weight,minlen:Math.max(r.minlen,o.minlen)})})),n},asNonCompoundGraph:function(e){var n=new ta({multigraph:e.isMultigraph()}).setGraph(e.graph());return Hi.forEach(e.nodes(),(function(t){e.children(t).length||n.setNode(t,e.node(t))})),Hi.forEach(e.edges(),(function(t){n.setEdge(t,e.edge(t))})),n},successorWeights:function(e){var n=Hi.map(e.nodes(),(function(n){var t={};return Hi.forEach(e.outEdges(n),(function(n){t[n.w]=(t[n.w]||0)+e.edge(n).weight})),t}));return Hi.zipObject(e.nodes(),n)},predecessorWeights:function(e){var n=Hi.map(e.nodes(),(function(n){var t={};return Hi.forEach(e.inEdges(n),(function(n){t[n.v]=(t[n.v]||0)+e.edge(n).weight})),t}));return Hi.zipObject(e.nodes(),n)},intersectRect:function(e,n){var t,r,o=e.x,i=e.y,a=n.x-o,u=n.y-i,c=e.width/2,s=e.height/2;if(!a&&!u)throw new Error(\"Not possible to find intersection inside of the rectangle\");Math.abs(u)*c>Math.abs(a)*s?(u<0&&(s=-s),t=s*a/u,r=s):(a<0&&(c=-c),t=c,r=c*u/a);return{x:o+t,y:i+r}},buildLayerMatrix:function(e){var n=Hi.map(Hi.range(ia(e)+1),(function(){return[]}));return Hi.forEach(e.nodes(),(function(t){var r=e.node(t),o=r.rank;Hi.isUndefined(o)||(n[o][r.order]=t)})),n},normalizeRanks:function(e){var n=Hi.min(Hi.map(e.nodes(),(function(n){return e.node(n).rank})));Hi.forEach(e.nodes(),(function(t){var r=e.node(t);Hi.has(r,\"rank\")&&(r.rank-=n)}))},removeEmptyRanks:function(e){var n=Hi.min(Hi.map(e.nodes(),(function(n){return e.node(n).rank}))),t=[];Hi.forEach(e.nodes(),(function(r){var o=e.node(r).rank-n;t[o]||(t[o]=[]),t[o].push(r)}));var r=0,o=e.graph().nodeRankFactor;Hi.forEach(t,(function(n,t){Hi.isUndefined(n)&&t%o!=0?--r:r&&Hi.forEach(n,(function(n){e.node(n).rank+=r}))}))},addBorderNode:function(e,n,t,r){var o={width:0,height:0};arguments.length>=4&&(o.rank=t,o.order=r);return oa(e,\"border\",o,n)},maxRank:ia,partition:function(e,n){var t={lhs:[],rhs:[]};return Hi.forEach(e,(function(e){n(e)?t.lhs.push(e):t.rhs.push(e)})),t},time:function(e,n){var t=Hi.now();try{return n()}finally{console.log(e+\" time: \"+(Hi.now()-t)+\"ms\")}},notime:function(e,n){return n()}};function oa(e,n,t,r){var o;do{o=Hi.uniqueId(r)}while(e.hasNode(o));return t.dummy=n,e.setNode(o,t),o}function ia(e){return Hi.max(Hi.map(e.nodes(),(function(n){var t=e.node(n).rank;if(!Hi.isUndefined(t))return t})))}var aa={run:function(e){e.graph().dummyChains=[],Hi.forEach(e.edges(),(function(n){!function(e,n){var t,r,o,i=n.v,a=e.node(i).rank,u=n.w,c=e.node(u).rank,s=n.name,d=e.edge(n),f=d.labelRank;if(c===a+1)return;for(e.removeEdge(n),o=0,++a;aa.lim&&(u=a,c=!0);var s=Hi.filter(n.edges(),(function(n){return c===Sa(e,e.node(n.v),u)&&c!==Sa(e,e.node(n.w),u)}));return Hi.minBy(s,(function(e){return pa(n,e)}))}function Ia(e,n,t,r){var o=t.v,i=t.w;e.removeEdge(o,i),e.setEdge(r.v,r.w,{}),xa(e),_a(e,n),function(e,n){var t=Hi.find(e.nodes(),(function(e){return!n.node(e).parent})),r=ya(e,t);r=r.slice(1),Hi.forEach(r,(function(t){var r=e.node(t).parent,o=n.edge(t,r),i=!1;o||(o=n.edge(r,t),i=!0),n.node(t).rank=n.node(r).rank+(i?o.minlen:-o.minlen)}))}(e,n)}function Sa(e,n,t){return t.low<=n.lim&&n.lim<=t.lim}Ea.initLowLimValues=xa,Ea.initCutValues=_a,Ea.calcCutValue=ja,Ea.leaveEdge=Oa,Ea.enterEdge=ka,Ea.exchangeEdges=Ia;var Ma=ua,Ca=function(e){switch(e.graph().ranker){case\"network-simplex\":Ba(e);break;case\"tight-tree\":!function(e){Ma(e),fa(e)}(e);break;case\"longest-path\":Ga(e);break;default:Ba(e)}};var Ga=Ma;function Ba(e){wa(e)}var Aa=function(e){var n=function(e){var n={},t=0;function r(o){var i=t;Hi.forEach(e.children(o),r),n[o]={low:i,lim:t++}}return Hi.forEach(e.children(),r),n}(e);Hi.forEach(e.graph().dummyChains,(function(t){for(var r=e.node(t),o=r.edgeObj,i=function(e,n,t,r){var o,i,a=[],u=[],c=Math.min(n[t].low,n[r].low),s=Math.max(n[t].lim,n[r].lim);o=t;do{o=e.parent(o),a.push(o)}while(o&&(n[o].low>c||s>n[o].lim));i=o,o=r;for(;(o=e.parent(o))!==i;)u.push(o);return{path:a.concat(u.reverse()),lca:i}}(e,n,o.v,o.w),a=i.path,u=i.lca,c=0,s=a[c],d=!0;t!==o.w;){if(r=e.node(t),d){for(;(s=a[c])!==u&&e.node(s).maxRank0;)n%2&&(t+=u[n+1]),u[n=n-1>>1]+=e.weight;c+=e.weight*t}))),c}var qa=function(e,n){return Hi.map(n,(function(n){var t=e.inEdges(n);if(t.length){var r=Hi.reduce(t,(function(n,t){var r=e.edge(t),o=e.node(t.v);return{sum:n.sum+r.weight*o.order,weight:n.weight+r.weight}}),{sum:0,weight:0});return{v:n,barycenter:r.sum/r.weight,weight:r.weight}}return{v:n}}))};var Ya=function(e,n){var t={};return Hi.forEach(e,(function(e,n){var r=t[e.v]={indegree:0,in:[],out:[],vs:[e.v],i:n};Hi.isUndefined(e.barycenter)||(r.barycenter=e.barycenter,r.weight=e.weight)})),Hi.forEach(n.edges(),(function(e){var n=t[e.v],r=t[e.w];Hi.isUndefined(n)||Hi.isUndefined(r)||(r.indegree++,n.out.push(t[e.w]))})),function(e){var n=[];function t(e){return function(n){n.merged||(Hi.isUndefined(n.barycenter)||Hi.isUndefined(e.barycenter)||n.barycenter>=e.barycenter)&&function(e,n){var t=0,r=0;e.weight&&(t+=e.barycenter*e.weight,r+=e.weight);n.weight&&(t+=n.barycenter*n.weight,r+=n.weight);e.vs=n.vs.concat(e.vs),e.barycenter=t/r,e.weight=r,e.i=Math.min(n.i,e.i),n.merged=!0}(e,n)}}function r(n){return function(t){t.in.push(n),0==--t.indegree&&e.push(t)}}for(;e.length;){var o=e.pop();n.push(o),Hi.forEach(o.in.reverse(),t(o)),Hi.forEach(o.out,r(o))}return Hi.map(Hi.filter(n,(function(e){return!e.merged})),(function(e){return Hi.pick(e,[\"vs\",\"i\",\"barycenter\",\"weight\"])}))}(Hi.filter(t,(function(e){return!e.indegree})))};var Ja=function(e,n){var t=ra.partition(e,(function(e){return Hi.has(e,\"barycenter\")})),r=t.lhs,o=Hi.sortBy(t.rhs,(function(e){return-e.i})),i=[],a=0,u=0,c=0;r.sort((s=!!n,function(e,n){return e.barycentern.barycenter?1:s?n.i-e.i:e.i-n.i})),c=Xa(i,o,c),Hi.forEach(r,(function(e){c+=e.vs.length,i.push(e.vs),a+=e.barycenter*e.weight,u+=e.weight,c=Xa(i,o,c)}));var s;var d={vs:Hi.flatten(i,!0)};u&&(d.barycenter=a/u,d.weight=u);return d};function Xa(e,n,t){for(var r;n.length&&(r=Hi.last(n)).i<=t;)n.pop(),e.push(r.vs),t++;return t}var Ka=function e(n,t,r,o){var i=n.children(t),a=n.node(t),u=a?a.borderLeft:void 0,c=a?a.borderRight:void 0,s={};u&&(i=Hi.filter(i,(function(e){return e!==u&&e!==c})));var d=qa(n,i);Hi.forEach(d,(function(t){if(n.children(t.v).length){var i=e(n,t.v,r,o);s[t.v]=i,Hi.has(i,\"barycenter\")&&(a=t,u=i,Hi.isUndefined(a.barycenter)?(a.barycenter=u.barycenter,a.weight=u.weight):(a.barycenter=(a.barycenter*a.weight+u.barycenter*u.weight)/(a.weight+u.weight),a.weight+=u.weight))}var a,u}));var f=Ya(d,r);!function(e,n){Hi.forEach(e,(function(e){e.vs=Hi.flatten(e.vs.map((function(e){return n[e]?n[e].vs:e})),!0)}))}(f,s);var h=Ja(f,o);if(u&&(h.vs=Hi.flatten([u,h.vs,c],!0),n.predecessors(u).length)){var l=n.node(n.predecessors(u)[0]),v=n.node(n.predecessors(c)[0]);Hi.has(h,\"barycenter\")||(h.barycenter=0,h.weight=0),h.barycenter=(h.barycenter*h.weight+l.order+v.order)/(h.weight+2),h.weight+=2}return h};var Qa=Fo.Graph,Za=function(e,n,t){var r=function(e){var n;for(;e.hasNode(n=Hi.uniqueId(\"_root\")););return n}(e),o=new Qa({compound:!0}).setGraph({root:r}).setDefaultNodeLabel((function(n){return e.node(n)}));return Hi.forEach(e.nodes(),(function(i){var a=e.node(i),u=e.parent(i);(a.rank===n||a.minRank<=n&&n<=a.maxRank)&&(o.setNode(i),o.setParent(i,u||r),Hi.forEach(e[t](i),(function(n){var t=n.v===i?n.w:n.v,r=o.edge(t,i),a=Hi.isUndefined(r)?0:r.weight;o.setEdge(t,i,{weight:e.edge(n).weight+a})})),Hi.has(a,\"minRank\")&&o.setNode(i,{borderLeft:a.borderLeft[n],borderRight:a.borderRight[n]}))})),o};var eu=function(e,n,t){var r,o={};Hi.forEach(t,(function(t){for(var i,a,u=e.parent(t);u;){if((i=e.parent(u))?(a=o[i],o[i]=u):(a=r,r=u),a&&a!==u)return void n.setEdge(a,u);u=i}}))};var nu=Fo.Graph,tu=function(e){var n=ra.maxRank(e),t=ru(e,Hi.range(1,n+1),\"inEdges\"),r=ru(e,Hi.range(n-1,-1,-1),\"outEdges\"),o=$a(e);iu(e,o);for(var i,a=Number.POSITIVE_INFINITY,u=0,c=0;c<4;++u,++c){ou(u%2?t:r,u%4>=2),o=ra.buildLayerMatrix(e);var s=Ha(e,o);sa)&&du(t,n,u)}))}))}return Hi.reduce(n,(function(n,t){var o,i=-1,a=0;return Hi.forEach(t,(function(u,c){if(\"border\"===e.node(u).dummy){var s=e.predecessors(u);s.length&&(o=e.node(s[0]).order,r(t,a,c,i,o),a=c,i=o)}r(t,a,t.length,o,n.length)})),t})),t}function du(e,n,t){if(n>t){var r=n;n=t,t=r}var o=e[n];o||(e[n]=o={}),o[t]=!0}function fu(e,n,t){if(n>t){var r=n;n=t,t=r}return Hi.has(e[n],t)}function hu(e,n,t,r){var o={},i={},a={};return Hi.forEach(n,(function(e){Hi.forEach(e,(function(e,n){o[e]=e,i[e]=e,a[e]=n}))})),Hi.forEach(n,(function(e){var n=-1;Hi.forEach(e,(function(e){var u=r(e);if(u.length)for(var c=((u=Hi.sortBy(u,(function(e){return a[e]}))).length-1)/2,s=Math.floor(c),d=Math.ceil(c);s<=d;++s){var f=u[s];i[e]===e&&nnew Du(e))).forEach((e=>{n.nodes[e.name]=e,e.inputs.forEach((t=>{!function(e,n,t){t.name!==n.name&&e.edges.push(Object.assign(Object.assign({},t.attr),{v:t.name,w:n.name}))}(n,e,t)}))})),n}class Fu{constructor(e,n={}){this.attr=null,this.bridgeGraph=null,this.cardinality=0,this.depth=1,this.include=a.UNSPECIFIED,this.isGroupNode=!0,this.parentNode=null,this.type=i.META,this.path=[],this.name=e,this.metaGraph=Hu(e,u.META,n)}getFirstChild(){return this.metaGraph.node(this.metaGraph.nodes()[0])}getChildren(){return this.metaGraph.nodes().map((e=>this.metaGraph.node(e)))}leaves(){let e,n=[],t=[this];for(;t.length;){let r=t.shift();r.isGroupNode?(e=r.metaGraph,e.nodes().forEach((n=>t.push(e.node(n))))):n.push(r.name)}return n}}class Uu{constructor(e,n){this.v=e,this.w=n,this.baseEdgeList=[],this.inbound=null,this.name=null}addBaseEdge(e,n){this.baseEdgeList.push(e)}}function Vu(e,n={}){return new Fu(e,n)}function $u(e,n){return new Uu(e,n)}function Hu(e,n,t){const r=t||{},o=new Ru.Graph(r);return o.setGraph({name:e,rankdir:r.rankdir,type:n,align:r.align}),o}class Wu{constructor(e={}){this.graphOptions=e,this.index={},this.graphOptions.compound=!0,this.root=Vu(r,this.graphOptions),this.index[r]=this.root}getNodeMap(){return this.index}node(e){return this.index[e]}setNode(e,n){this.index[e]=n}getBridgeGraph(e){const n=this.index[e];if(!n)throw Error(\"Could not find node in hierarchy: \"+e);if(!(\"metaGraph\"in n))return null;const t=n;if(t.bridgeGraph)return t.bridgeGraph;const r=Hu(o,u.BRIDGE,this.graphOptions);if(t.bridgeGraph=r,!n.parentNode||!(\"metaGraph\"in n.parentNode))return r;const i=n.parentNode;return[i.metaGraph,this.getBridgeGraph(i.name)].forEach((n=>{n.edges().filter((n=>n.v===e||n.w===e)).forEach((t=>{const o=t.w===e;n.edge(t).baseEdgeList.forEach((n=>{const[i,a]=o?[n.w,t.v]:[n.v,t.w],u=this.getChildName(e,i),c={v:o?a:u,w:o?u:a};let s=r.edge(c);s||(s=$u(c.v,c.w),s.inbound=o,r.setEdge(c.v,c.w,s)),s.addBaseEdge(n,this)}))}))})),r}getChildName(e,n){let t=this.index[n];for(;t;){if(t.parentNode&&t.parentNode.name===e)return t.name;t=t.parentNode}throw Error(\"Could not find immediate child for descendant: \"+n)}getPredecessors(e){const n=this.index[e];if(!n)throw Error(\"Could not find node with name: \"+e);return this.getOneWayEdges(n,!0)}getSuccessors(e){const n=this.index[e];if(!n)throw Error(\"Could not find node with name: \"+e);return this.getOneWayEdges(n,!1)}getOneWayEdges(e,n){const t=[];if(!e.parentNode||!e.parentNode.isGroupNode)return t;const r=e.parentNode,o=r.metaGraph,i=this.getBridgeGraph(r.name);return Yu(o,e,n,t),Yu(i,e,n,t),t}}function qu(e,n){const{rankDirection:t,align:r}=n,o=new Wu({rankdir:t,align:r});return function(e,n){Object.keys(n.nodes).forEach((t=>{const r=n.nodes[t],o=r.path;let i=e.root;i.depth=Math.max(o.length,i.depth);for(let n=0;n{let t=0;for(;e;)n[t++]=e.name,e=e.parentNode;return t-1};n.edges.forEach((a=>{r=[],o=[];let u=i(n.nodes[a.v],r),c=i(n.nodes[a.w],o);for(;r[u]===o[c];)if(u--,c--,u<0||c<0)throw Error(\"No difference found between ancestor paths.\");const s=t[r[u+1]],d=r[u],f=o[c];let h=s.metaGraph.edge(d,f);h||(h=$u(d,f),s.metaGraph.setEdge(d,f,h)),h.addBaseEdge(a,e)}))}(o,e),o}function Yu(e,n,t,r){(t?e.inEdges(n.name):e.outEdges(n.name)).forEach((n=>{const t=e.edge(n);r.push(t)}))}class Ju{constructor(e){this.hierarchy=e,this.index={},this.hasSubHierarchy={},this.root=new Qu(this.hierarchy.root,this.hierarchy.graphOptions),this.index[e.root.name]=this.root,this.buildSubHierarchy(e.root.name),this.root.expanded=!0}getRenderInfoNodes(){return Object.values(this.index)}getSubHierarchy(){return this.hasSubHierarchy}buildSubHierarchy(e){if(e in this.hasSubHierarchy)return;this.hasSubHierarchy[e]=!0;const n=this.index[e];if(n.node.type!==i.META)return;const t=n,r=t.node.metaGraph,o=t.coreGraph;r.nodes().forEach((e=>{const n=this.getOrCreateRenderNodeByName(e);o.setNode(e,n)})),r.edges().forEach((e=>{const n=r.edge(e),t=new Ku(n);o.setEdge(e.v,e.w,t)}));const u=t.node.parentNode;if(!u)return;const c=this.getRenderNodeByName(u.name),s=(e,...n)=>n.concat([e?\"IN\":\"OUT\"]).join(\"~~\"),d=this.hierarchy.getBridgeGraph(e);d.edges().forEach((n=>{const t=d.edge(n),f=!!r.node(n.w),[h,l]=f?[n.w,n.v]:[n.v,n.w],v=n=>{const t=f?{v:n,w:e}:{v:e,w:n};return c.coreGraph.edge(t)};let p=v(l);p||(p=v(s(f,l,u.name)));const g=s(f,e),y=s(f,l,e);let b=o.node(y);if(!b){let e=o.node(g);if(!e){const n={name:g,type:i.BRIDGE,isGroupNode:!1,cardinality:0,parentNode:null,include:a.UNSPECIFIED,inbound:f,attr:{}};e=new Xu(n),this.index[g]=e,o.setNode(g,e)}const n={name:y,type:i.BRIDGE,isGroupNode:!1,cardinality:1,parentNode:null,include:a.UNSPECIFIED,inbound:f,attr:{}};b=new Xu(n),this.index[y]=b,o.setNode(y,b),o.setParent(y,g),e.node.cardinality++}const m=new Ku(t);m.adjoiningMetaEdge=p,f?o.setEdge(y,h,m):o.setEdge(h,y,m)}))}getOrCreateRenderNodeByName(e){if(!e)return null;if(e in this.index)return this.index[e];const n=this.getNodeByName(e);return n?(this.index[e]=n.isGroupNode?new Qu(n,this.hierarchy.graphOptions):new Xu(n),this.index[e]):null}getRenderNodeByName(e){return this.index[e]}getNodeByName(e){return this.hierarchy.node(e)}}class Xu{constructor(e){this.node=e,this.expanded=!1,this.x=0,this.y=0,this.coreBox={width:0,height:0},this.outboxWidth=0,this.labelOffset=0,this.radius=0,this.labelHeight=0,this.paddingTop=0,this.paddingLeft=0,this.paddingRight=0,this.paddingBottom=0,this.width=e.width||0,this.height=e.height||0,this.displayName=e.name,this.attr=e.attr}}class Ku{constructor(e){this.metaEdge=e,this.adjoiningMetaEdge=null,this.weight=1,this.points=[]}}class Qu extends Xu{constructor(e,n){super(e);const t=e.metaGraph.graph();n.compound=!0,this.coreGraph=Hu(t.name,u.CORE,n)}}function Zu(e,t){e.node.isGroupNode&&function(e,t){const r=n(t);e.coreGraph.nodes().map((n=>e.coreGraph.node(n))).forEach((e=>{var n,o,a,u,c,s;const{height:d,width:f}=e;switch(e.node.type){case i.NODE:Object.assign(e,r.nodeSize.node),e.height=d||r.nodeSize.node.height,e.width=f||r.nodeSize.node.width;break;case i.BRIDGE:Object.assign(e,r.nodeSize.bridge);break;case i.META:if(e.expanded){Zu(e,t)}else Object.assign(e,r.nodeSize.meta),e.height=r.nodeSize.meta.height,e.width=r.nodeSize.meta.width;break;default:throw Error(\"Unrecognized node type: \"+e.node.type)}if(!e.expanded){const r=e.attr;!function(e,n=!1){if(e.coreBox.width=e.width,e.coreBox.height=e.height,!n){const n=`${e.displayName}`.length,t=3;e.width=Math.max(e.coreBox.width,n*t)}}(e,t&&(0===e.node.type&&!!(null===(o=null===(n=null==t?void 0:t.nodeSize)||void 0===n?void 0:n.meta)||void 0===o?void 0:o.width)||1===e.node.type&&(!!(null===(u=null===(a=null==t?void 0:t.nodeSize)||void 0===a?void 0:a.node)||void 0===u?void 0:u.width)||!!r.width)||2===e.node.type&&!!(null===(s=null===(c=null==t?void 0:t.nodeSize)||void 0===c?void 0:c.bridge)||void 0===s?void 0:s.width)))}}))}(e,t),e.node.type===i.META&&function(e,t){const r=n(t),o=r.subScene.meta;Object.assign(e,o);const{nodeSep:a,rankSep:u,edgeSep:c,align:s}=r.graph.meta,d={nodesep:a,ranksep:u,edgesep:c,align:s};Object.assign(e.coreBox,function(e,n){const{ranksep:t,nodesep:r,edgesep:o,align:a}=n;Object.assign(e.graph(),{ranksep:t,nodesep:r,edgesep:o,align:a});const u=[];if(e.nodes().forEach((n=>{e.node(n).node.type!==i.BRIDGE&&u.push(n)})),!u.length)return{width:0,height:0};Tu(e);let c=1/0,s=1/0,d=-1/0,f=-1/0;return u.forEach((n=>{const t=e.node(n),r=.5*t.width,o=t.x-r,i=t.x+r;c=od?i:d;const a=.5*t.height,u=t.y-a,h=t.y+a;s=uf?h:f})),e.edges().forEach((n=>{const t=e.edge(n),r=e.node(t.metaEdge.v),o=e.node(t.metaEdge.w);if(3===t.points.length&&function(e){let n=ec(e[0],e[1]);for(let t=1;t1)return!1;n=r}return!0}(t.points)){if(null!=r){const e=r.expanded?r.x:nc(r);t.points[0].x=e}if(null!=o){const e=o.expanded?o.x:nc(o);t.points[2].x=e}t.points=[t.points[0],t.points[1]]}const i=t.points[t.points.length-2];null!=o&&(t.points[t.points.length-1]=tc(i,o));const a=t.points[1];null!=r&&(t.points[0]=tc(a,r)),t.points.forEach((e=>{c=e.xd?e.x:d,s=e.yf?e.y:f}))})),e.nodes().forEach((n=>{const t=e.node(n);t.x-=c,t.y-=s})),e.edges().forEach((n=>{e.edge(n).points.forEach((e=>{e.x-=c,e.y-=s}))})),{width:d-c,height:f-s}}(e.coreGraph,d));let f=0;e.coreGraph.nodeCount()>0&&f++;const h=f<=1?0:f;e.coreBox.width+=h+h,e.coreBox.height=o.labelHeight+e.coreBox.height,e.width=e.coreBox.width+o.paddingLeft+o.paddingRight,e.height=e.paddingTop+e.coreBox.height+e.paddingBottom}(e,t)}function ec(e,n){const t=n.x-e.x,r=n.y-e.y;return 180*Math.atan(r/t)/Math.PI}function nc(e){if(e.expanded)return e.x;return e.x-e.width/2+0+e.coreBox.width/2}function tc(e,n){const t=n.expanded?n.x:nc(n),r=n.y,o=e.x-t,i=e.y-r;let a,u,c=n.expanded?n.width:n.coreBox.width,s=n.expanded?n.height:n.coreBox.height;return Math.abs(i)*c/2>Math.abs(o)*s/2?(i<0&&(s=-s),a=0===i?0:s/2*o/i,u=s/2):(o<0&&(c=-c),a=c/2,u=0===o?0:c/2*i/o),{x:t+a,y:r+u}}function rc(n,t,r){var o,i,a,u;const c=n.nodes.filter(((e,n,t)=>t.findIndex((n=>n.id===e.id))!==n)).map((e=>e.id));if(c.length)throw new Error(`Duplicated ids found: ${c.join(\", \")}`);const s=function(e){const n={nodes:[]},t=e.compound,r=Object.keys(t||{}),o=new Map,i=(e,n=[])=>{if(o.has(e))return o.get(e);for(let o=0;oe.edges.filter((e=>e.w===n)).map((e=>({name:e.v})));return e.nodes.forEach((e=>{const t=e.id,r=[...i(t),t];let o=a(t);n.nodes.push({name:t,path:r,inputs:o,width:e.width,height:e.height,attr:Object.assign({},e)})})),n}(n),d=function(e,n){const t=(e,n)=>{for(let t of n.values())if(t.includes(e))return!0;return!1},r=(e,n=[])=>{if(0===Object.keys(e).length)return[...new Set(n)];const o=new Map(Object.keys(e).map((n=>[n,e[n]]))),i={};for(let[e,r]of o)t(e,o)?i[e]=r:n=n.concat(e,r);return r(i,n)};return r(e).filter((e=>n.includes(e)))}(n.compound||{},(null==t?void 0:t.expanded)||[]),f=function(e,n){return function(e){return new Ju(e)}(qu(zu(e),n))}(s,{rankDirection:(null===(i=null===(o=null==r?void 0:r.graph)||void 0===o?void 0:o.meta)||void 0===i?void 0:i.rankDir)||(null==t?void 0:t.rankDirection)||e.graph.meta.rankDir,align:(null===(u=null===(a=null==r?void 0:r.graph)||void 0===a?void 0:a.meta)||void 0===u?void 0:u.align)||e.graph.meta.align});return function(e,n){n.forEach((n=>{const t=e.getRenderInfoNodes().find((e=>e.displayName===n));let r=t&&t.node&&t.node.name||\"\";const o=e.getRenderNodeByName(r);if(!o)throw new Error(`No nodes found: ${r}`);o.expanded=!0,e.buildSubHierarchy(r)}))}(f,d),Zu(f.root,r),ac(f.root)}function oc(e,n=!1){const t=JSON.parse(JSON.stringify(e)),o={nodes:[t],edges:[...t.edges]};return t.nodes.forEach((function e(n){(0===n.type||1===n.type)&&o.nodes.push(n),0===n.type&&(o.edges=o.edges.concat(n.edges)),Array.isArray(n.nodes)&&n.nodes.forEach(e)})),n&&o.nodes.forEach((e=>{const n=o.nodes.find((n=>n.id===e.parentNodeName));if(n){const t=n.x-n.width/2+n.paddingLeft,o=n.y-n.height/2+n.labelHeight+n.paddingTop;n.id!==r&&(e.x+=t,e.y+=o),0===e.type&&e.edges.forEach((n=>{n.points.forEach((n=>{n.x+=e.x-e.width/2+e.paddingLeft,n.y+=e.y-e.height/2+e.labelHeight+e.paddingTop}))}))}})),o}function ic(e,n,t,o){var i,a;let u=[];const c=(null===(i=t.find((n=>n.id===e)))||void 0===i?void 0:i.path)||[],s=(null===(a=t.find((e=>e.id===n)))||void 0===a?void 0:a.path)||[],d=[r,...c].slice(0,c.length).reverse(),f=[r,...s].slice(0,s.length);return d.forEach((r=>{const i=t.find((e=>e.id===r));u=u.concat(i.edges.filter((t=>t.baseEdgeList.some((t=>t.v===((null==o?void 0:o.v)||e)&&t.w===((null==o?void 0:o.w)||n))))))})),f.filter((e=>!d.includes(e))).forEach((r=>{const i=t.find((e=>e.id===r));u=u.concat(i.edges.filter((t=>t.baseEdgeList.some((t=>t.v===((null==o?void 0:o.v)||e)&&t.w===((null==o?void 0:o.w)||n))))))})),u}function ac(e){const n=e.coreGraph.nodes().map((n=>e.coreGraph.node(n)));return Object.assign(Object.assign({},uc(e)),{expanded:e.expanded,nodes:e.expanded?(t=n,t.map((e=>e.node.type===i.META?ac(e):uc(e)))):[],edges:e.expanded?cc(e):[]});var t}function uc(e){return{id:e.node.name,name:e.node.name,type:e.node.type,cardinality:e.node.cardinality,attr:e.attr,parentNodeName:e.node.parentNode?e.node.parentNode.name:null,coreBox:Object.assign({},e.coreBox),x:e.x,y:e.y,width:e.width,height:e.height,radius:e.radius,labelHeight:e.labelHeight,labelOffset:e.labelOffset,outboxWidth:e.outboxWidth,paddingLeft:e.paddingLeft,paddingTop:e.paddingTop,paddingRight:e.paddingRight,paddingBottom:e.paddingBottom,path:e.node.path}}function cc(e){return e.coreGraph.edges().map((n=>({renderInfoEdge:e.coreGraph.edge(n),edge:n}))).filter((({renderInfoEdge:e})=>e.metaEdge)).map((({edge:n,renderInfoEdge:t})=>{const r=function(e,n){const t=n.points.map((e=>Object.assign({},e)));if(n.adjoiningMetaEdge){const r=n.adjoiningMetaEdge.points,o=n.metaEdge.inbound,i=o?r[r.length-1]:r[0],a=t[o?0:t.length-1],u=e.x-e.width/2,c=e.y-e.height/2,s=i.x-u,d=i.y-c,f=-e.paddingLeft,h=-(e.paddingTop+e.labelHeight);a.x=s+f,a.y=d+h}return t}(e,t);return{adjoiningEdge:t.adjoiningMetaEdge?{w:t.adjoiningMetaEdge.metaEdge.w,v:t.adjoiningMetaEdge.metaEdge.v}:null,inbound:t.metaEdge.inbound,w:n.w,v:n.v,points:r,weight:t.weight,baseEdgeList:t.metaEdge.baseEdgeList,parentNodeName:e.node.name}}))}\n//# sourceMappingURL=dagre-compound.es5.js.map\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/dagre-compound/dist/dagre-compound.es5.js?"); /***/ }), -/***/ "./node_modules/ml-array-max/lib-es6/index.js": -/*!****************************************************!*\ - !*** ./node_modules/ml-array-max/lib-es6/index.js ***! - \****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/detect-browser/es/index.js": +/*!*************************************************!*\ + !*** ./node_modules/detect-browser/es/index.js ***! + \*************************************************/ +/*! exports provided: BrowserInfo, NodeInfo, SearchBotDeviceInfo, BotInfo, ReactNativeInfo, detect, browserName, parseUserAgent, detectOS, getNodeVersion */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return max; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n\n\nfunction max(input) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(input)) {\n throw new TypeError('input must be an array');\n }\n\n if (input.length === 0) {\n throw new TypeError('input must not be empty');\n }\n\n var _options$fromIndex = options.fromIndex,\n fromIndex = _options$fromIndex === void 0 ? 0 : _options$fromIndex,\n _options$toIndex = options.toIndex,\n toIndex = _options$toIndex === void 0 ? input.length : _options$toIndex;\n\n if (fromIndex < 0 || fromIndex >= input.length || !Number.isInteger(fromIndex)) {\n throw new Error('fromIndex must be a positive integer smaller than length');\n }\n\n if (toIndex <= fromIndex || toIndex > input.length || !Number.isInteger(toIndex)) {\n throw new Error('toIndex must be an integer greater than fromIndex and at most equal to length');\n }\n\n var maxValue = input[fromIndex];\n\n for (var i = fromIndex + 1; i < toIndex; i++) {\n if (input[i] > maxValue) maxValue = input[i];\n }\n\n return maxValue;\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/ml-array-max/lib-es6/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* WEBPACK VAR INJECTION */(function(process) {/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BrowserInfo\", function() { return BrowserInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"NodeInfo\", function() { return NodeInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"SearchBotDeviceInfo\", function() { return SearchBotDeviceInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"BotInfo\", function() { return BotInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ReactNativeInfo\", function() { return ReactNativeInfo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detect\", function() { return detect; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"browserName\", function() { return browserName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parseUserAgent\", function() { return parseUserAgent; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"detectOS\", function() { return detectOS; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getNodeVersion\", function() { return getNodeVersion; });\nvar __spreadArray = (undefined && undefined.__spreadArray) || function (to, from, pack) {\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\n if (ar || !(i in from)) {\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\n ar[i] = from[i];\n }\n }\n return to.concat(ar || Array.prototype.slice.call(from));\n};\nvar BrowserInfo = /** @class */ (function () {\n function BrowserInfo(name, version, os) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.type = 'browser';\n }\n return BrowserInfo;\n}());\n\nvar NodeInfo = /** @class */ (function () {\n function NodeInfo(version) {\n this.version = version;\n this.type = 'node';\n this.name = 'node';\n this.os = process.platform;\n }\n return NodeInfo;\n}());\n\nvar SearchBotDeviceInfo = /** @class */ (function () {\n function SearchBotDeviceInfo(name, version, os, bot) {\n this.name = name;\n this.version = version;\n this.os = os;\n this.bot = bot;\n this.type = 'bot-device';\n }\n return SearchBotDeviceInfo;\n}());\n\nvar BotInfo = /** @class */ (function () {\n function BotInfo() {\n this.type = 'bot';\n this.bot = true; // NOTE: deprecated test name instead\n this.name = 'bot';\n this.version = null;\n this.os = null;\n }\n return BotInfo;\n}());\n\nvar ReactNativeInfo = /** @class */ (function () {\n function ReactNativeInfo() {\n this.type = 'react-native';\n this.name = 'react-native';\n this.version = null;\n this.os = null;\n }\n return ReactNativeInfo;\n}());\n\n// tslint:disable-next-line:max-line-length\nvar SEARCHBOX_UA_REGEX = /alexa|bot|crawl(er|ing)|facebookexternalhit|feedburner|google web preview|nagios|postrank|pingdom|slurp|spider|yahoo!|yandex/;\nvar SEARCHBOT_OS_REGEX = /(nuhk|curl|Googlebot|Yammybot|Openbot|Slurp|MSNBot|Ask\\ Jeeves\\/Teoma|ia_archiver)/;\nvar REQUIRED_VERSION_PARTS = 3;\nvar userAgentRules = [\n ['aol', /AOLShield\\/([0-9\\._]+)/],\n ['edge', /Edge\\/([0-9\\._]+)/],\n ['edge-ios', /EdgiOS\\/([0-9\\._]+)/],\n ['yandexbrowser', /YaBrowser\\/([0-9\\._]+)/],\n ['kakaotalk', /KAKAOTALK\\s([0-9\\.]+)/],\n ['samsung', /SamsungBrowser\\/([0-9\\.]+)/],\n ['silk', /\\bSilk\\/([0-9._-]+)\\b/],\n ['miui', /MiuiBrowser\\/([0-9\\.]+)$/],\n ['beaker', /BeakerBrowser\\/([0-9\\.]+)/],\n ['edge-chromium', /EdgA?\\/([0-9\\.]+)/],\n [\n 'chromium-webview',\n /(?!Chrom.*OPR)wv\\).*Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/,\n ],\n ['chrome', /(?!Chrom.*OPR)Chrom(?:e|ium)\\/([0-9\\.]+)(:?\\s|$)/],\n ['phantomjs', /PhantomJS\\/([0-9\\.]+)(:?\\s|$)/],\n ['crios', /CriOS\\/([0-9\\.]+)(:?\\s|$)/],\n ['firefox', /Firefox\\/([0-9\\.]+)(?:\\s|$)/],\n ['fxios', /FxiOS\\/([0-9\\.]+)/],\n ['opera-mini', /Opera Mini.*Version\\/([0-9\\.]+)/],\n ['opera', /Opera\\/([0-9\\.]+)(?:\\s|$)/],\n ['opera', /OPR\\/([0-9\\.]+)(:?\\s|$)/],\n ['pie', /^Microsoft Pocket Internet Explorer\\/(\\d+\\.\\d+)$/],\n ['pie', /^Mozilla\\/\\d\\.\\d+\\s\\(compatible;\\s(?:MSP?IE|MSInternet Explorer) (\\d+\\.\\d+);.*Windows CE.*\\)$/],\n ['netfront', /^Mozilla\\/\\d\\.\\d+.*NetFront\\/(\\d.\\d)/],\n ['ie', /Trident\\/7\\.0.*rv\\:([0-9\\.]+).*\\).*Gecko$/],\n ['ie', /MSIE\\s([0-9\\.]+);.*Trident\\/[4-7].0/],\n ['ie', /MSIE\\s(7\\.0)/],\n ['bb10', /BB10;\\sTouch.*Version\\/([0-9\\.]+)/],\n ['android', /Android\\s([0-9\\.]+)/],\n ['ios', /Version\\/([0-9\\._]+).*Mobile.*Safari.*/],\n ['safari', /Version\\/([0-9\\._]+).*Safari/],\n ['facebook', /FB[AS]V\\/([0-9\\.]+)/],\n ['instagram', /Instagram\\s([0-9\\.]+)/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Mobile/],\n ['ios-webview', /AppleWebKit\\/([0-9\\.]+).*Gecko\\)$/],\n ['curl', /^curl\\/([0-9\\.]+)$/],\n ['searchbot', SEARCHBOX_UA_REGEX],\n];\nvar operatingSystemRules = [\n ['iOS', /iP(hone|od|ad)/],\n ['Android OS', /Android/],\n ['BlackBerry OS', /BlackBerry|BB10/],\n ['Windows Mobile', /IEMobile/],\n ['Amazon OS', /Kindle/],\n ['Windows 3.11', /Win16/],\n ['Windows 95', /(Windows 95)|(Win95)|(Windows_95)/],\n ['Windows 98', /(Windows 98)|(Win98)/],\n ['Windows 2000', /(Windows NT 5.0)|(Windows 2000)/],\n ['Windows XP', /(Windows NT 5.1)|(Windows XP)/],\n ['Windows Server 2003', /(Windows NT 5.2)/],\n ['Windows Vista', /(Windows NT 6.0)/],\n ['Windows 7', /(Windows NT 6.1)/],\n ['Windows 8', /(Windows NT 6.2)/],\n ['Windows 8.1', /(Windows NT 6.3)/],\n ['Windows 10', /(Windows NT 10.0)/],\n ['Windows ME', /Windows ME/],\n ['Windows CE', /Windows CE|WinCE|Microsoft Pocket Internet Explorer/],\n ['Open BSD', /OpenBSD/],\n ['Sun OS', /SunOS/],\n ['Chrome OS', /CrOS/],\n ['Linux', /(Linux)|(X11)/],\n ['Mac OS', /(Mac_PowerPC)|(Macintosh)/],\n ['QNX', /QNX/],\n ['BeOS', /BeOS/],\n ['OS/2', /OS\\/2/],\n];\nfunction detect(userAgent) {\n if (!!userAgent) {\n return parseUserAgent(userAgent);\n }\n if (typeof document === 'undefined' &&\n typeof navigator !== 'undefined' &&\n navigator.product === 'ReactNative') {\n return new ReactNativeInfo();\n }\n if (typeof navigator !== 'undefined') {\n return parseUserAgent(navigator.userAgent);\n }\n return getNodeVersion();\n}\nfunction matchUserAgent(ua) {\n // opted for using reduce here rather than Array#first with a regex.test call\n // this is primarily because using the reduce we only perform the regex\n // execution once rather than once for the test and for the exec again below\n // probably something that needs to be benchmarked though\n return (ua !== '' &&\n userAgentRules.reduce(function (matched, _a) {\n var browser = _a[0], regex = _a[1];\n if (matched) {\n return matched;\n }\n var uaMatch = regex.exec(ua);\n return !!uaMatch && [browser, uaMatch];\n }, false));\n}\nfunction browserName(ua) {\n var data = matchUserAgent(ua);\n return data ? data[0] : null;\n}\nfunction parseUserAgent(ua) {\n var matchedRule = matchUserAgent(ua);\n if (!matchedRule) {\n return null;\n }\n var name = matchedRule[0], match = matchedRule[1];\n if (name === 'searchbot') {\n return new BotInfo();\n }\n // Do not use RegExp for split operation as some browser do not support it (See: http://blog.stevenlevithan.com/archives/cross-browser-split)\n var versionParts = match[1] && match[1].split('.').join('_').split('_').slice(0, 3);\n if (versionParts) {\n if (versionParts.length < REQUIRED_VERSION_PARTS) {\n versionParts = __spreadArray(__spreadArray([], versionParts, true), createVersionParts(REQUIRED_VERSION_PARTS - versionParts.length), true);\n }\n }\n else {\n versionParts = [];\n }\n var version = versionParts.join('.');\n var os = detectOS(ua);\n var searchBotMatch = SEARCHBOT_OS_REGEX.exec(ua);\n if (searchBotMatch && searchBotMatch[1]) {\n return new SearchBotDeviceInfo(name, version, os, searchBotMatch[1]);\n }\n return new BrowserInfo(name, version, os);\n}\nfunction detectOS(ua) {\n for (var ii = 0, count = operatingSystemRules.length; ii < count; ii++) {\n var _a = operatingSystemRules[ii], os = _a[0], regex = _a[1];\n var match = regex.exec(ua);\n if (match) {\n return os;\n }\n }\n return null;\n}\nfunction getNodeVersion() {\n var isNode = typeof process !== 'undefined' && process.version;\n return isNode ? new NodeInfo(process.version.slice(1)) : null;\n}\nfunction createVersionParts(count) {\n var output = [];\n for (var ii = 0; ii < count; ii++) {\n output.push('0');\n }\n return output;\n}\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../../node-libs-browser/mock/process.js */ \"./node_modules/node-libs-browser/mock/process.js\")))\n\n//# sourceURL=webpack:///./node_modules/detect-browser/es/index.js?"); /***/ }), -/***/ "./node_modules/ml-array-min/lib-es6/index.js": -/*!****************************************************!*\ - !*** ./node_modules/ml-array-min/lib-es6/index.js ***! - \****************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/fecha/lib/fecha.js": +/*!*****************************************!*\ + !*** ./node_modules/fecha/lib/fecha.js ***! + \*****************************************/ +/*! exports provided: default, assign, format, parse, defaultI18n, setGlobalDateI18n, setGlobalDateMasks */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return min; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n\n\nfunction min(input) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(input)) {\n throw new TypeError('input must be an array');\n }\n\n if (input.length === 0) {\n throw new TypeError('input must not be empty');\n }\n\n var _options$fromIndex = options.fromIndex,\n fromIndex = _options$fromIndex === void 0 ? 0 : _options$fromIndex,\n _options$toIndex = options.toIndex,\n toIndex = _options$toIndex === void 0 ? input.length : _options$toIndex;\n\n if (fromIndex < 0 || fromIndex >= input.length || !Number.isInteger(fromIndex)) {\n throw new Error('fromIndex must be a positive integer smaller than length');\n }\n\n if (toIndex <= fromIndex || toIndex > input.length || !Number.isInteger(toIndex)) {\n throw new Error('toIndex must be an integer greater than fromIndex and at most equal to length');\n }\n\n var minValue = input[fromIndex];\n\n for (var i = fromIndex + 1; i < toIndex; i++) {\n if (input[i] < minValue) minValue = input[i];\n }\n\n return minValue;\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/ml-array-min/lib-es6/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"assign\", function() { return assign; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"format\", function() { return format; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"parse\", function() { return parse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"defaultI18n\", function() { return defaultI18n; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setGlobalDateI18n\", function() { return setGlobalDateI18n; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setGlobalDateMasks\", function() { return setGlobalDateMasks; });\nvar token = /d{1,4}|M{1,4}|YY(?:YY)?|S{1,3}|Do|ZZ|Z|([HhMsDm])\\1?|[aA]|\"[^\"]*\"|'[^']*'/g;\nvar twoDigitsOptional = \"\\\\d\\\\d?\";\nvar twoDigits = \"\\\\d\\\\d\";\nvar threeDigits = \"\\\\d{3}\";\nvar fourDigits = \"\\\\d{4}\";\nvar word = \"[^\\\\s]+\";\nvar literal = /\\[([^]*?)\\]/gm;\nfunction shorten(arr, sLen) {\n var newArr = [];\n for (var i = 0, len = arr.length; i < len; i++) {\n newArr.push(arr[i].substr(0, sLen));\n }\n return newArr;\n}\nvar monthUpdate = function (arrName) { return function (v, i18n) {\n var lowerCaseArr = i18n[arrName].map(function (v) { return v.toLowerCase(); });\n var index = lowerCaseArr.indexOf(v.toLowerCase());\n if (index > -1) {\n return index;\n }\n return null;\n}; };\nfunction assign(origObj) {\n var args = [];\n for (var _i = 1; _i < arguments.length; _i++) {\n args[_i - 1] = arguments[_i];\n }\n for (var _a = 0, args_1 = args; _a < args_1.length; _a++) {\n var obj = args_1[_a];\n for (var key in obj) {\n // @ts-ignore ex\n origObj[key] = obj[key];\n }\n }\n return origObj;\n}\nvar dayNames = [\n \"Sunday\",\n \"Monday\",\n \"Tuesday\",\n \"Wednesday\",\n \"Thursday\",\n \"Friday\",\n \"Saturday\"\n];\nvar monthNames = [\n \"January\",\n \"February\",\n \"March\",\n \"April\",\n \"May\",\n \"June\",\n \"July\",\n \"August\",\n \"September\",\n \"October\",\n \"November\",\n \"December\"\n];\nvar monthNamesShort = shorten(monthNames, 3);\nvar dayNamesShort = shorten(dayNames, 3);\nvar defaultI18n = {\n dayNamesShort: dayNamesShort,\n dayNames: dayNames,\n monthNamesShort: monthNamesShort,\n monthNames: monthNames,\n amPm: [\"am\", \"pm\"],\n DoFn: function (dayOfMonth) {\n return (dayOfMonth +\n [\"th\", \"st\", \"nd\", \"rd\"][dayOfMonth % 10 > 3\n ? 0\n : ((dayOfMonth - (dayOfMonth % 10) !== 10 ? 1 : 0) * dayOfMonth) % 10]);\n }\n};\nvar globalI18n = assign({}, defaultI18n);\nvar setGlobalDateI18n = function (i18n) {\n return (globalI18n = assign(globalI18n, i18n));\n};\nvar regexEscape = function (str) {\n return str.replace(/[|\\\\{()[^$+*?.-]/g, \"\\\\$&\");\n};\nvar pad = function (val, len) {\n if (len === void 0) { len = 2; }\n val = String(val);\n while (val.length < len) {\n val = \"0\" + val;\n }\n return val;\n};\nvar formatFlags = {\n D: function (dateObj) { return String(dateObj.getDate()); },\n DD: function (dateObj) { return pad(dateObj.getDate()); },\n Do: function (dateObj, i18n) {\n return i18n.DoFn(dateObj.getDate());\n },\n d: function (dateObj) { return String(dateObj.getDay()); },\n dd: function (dateObj) { return pad(dateObj.getDay()); },\n ddd: function (dateObj, i18n) {\n return i18n.dayNamesShort[dateObj.getDay()];\n },\n dddd: function (dateObj, i18n) {\n return i18n.dayNames[dateObj.getDay()];\n },\n M: function (dateObj) { return String(dateObj.getMonth() + 1); },\n MM: function (dateObj) { return pad(dateObj.getMonth() + 1); },\n MMM: function (dateObj, i18n) {\n return i18n.monthNamesShort[dateObj.getMonth()];\n },\n MMMM: function (dateObj, i18n) {\n return i18n.monthNames[dateObj.getMonth()];\n },\n YY: function (dateObj) {\n return pad(String(dateObj.getFullYear()), 4).substr(2);\n },\n YYYY: function (dateObj) { return pad(dateObj.getFullYear(), 4); },\n h: function (dateObj) { return String(dateObj.getHours() % 12 || 12); },\n hh: function (dateObj) { return pad(dateObj.getHours() % 12 || 12); },\n H: function (dateObj) { return String(dateObj.getHours()); },\n HH: function (dateObj) { return pad(dateObj.getHours()); },\n m: function (dateObj) { return String(dateObj.getMinutes()); },\n mm: function (dateObj) { return pad(dateObj.getMinutes()); },\n s: function (dateObj) { return String(dateObj.getSeconds()); },\n ss: function (dateObj) { return pad(dateObj.getSeconds()); },\n S: function (dateObj) {\n return String(Math.round(dateObj.getMilliseconds() / 100));\n },\n SS: function (dateObj) {\n return pad(Math.round(dateObj.getMilliseconds() / 10), 2);\n },\n SSS: function (dateObj) { return pad(dateObj.getMilliseconds(), 3); },\n a: function (dateObj, i18n) {\n return dateObj.getHours() < 12 ? i18n.amPm[0] : i18n.amPm[1];\n },\n A: function (dateObj, i18n) {\n return dateObj.getHours() < 12\n ? i18n.amPm[0].toUpperCase()\n : i18n.amPm[1].toUpperCase();\n },\n ZZ: function (dateObj) {\n var offset = dateObj.getTimezoneOffset();\n return ((offset > 0 ? \"-\" : \"+\") +\n pad(Math.floor(Math.abs(offset) / 60) * 100 + (Math.abs(offset) % 60), 4));\n },\n Z: function (dateObj) {\n var offset = dateObj.getTimezoneOffset();\n return ((offset > 0 ? \"-\" : \"+\") +\n pad(Math.floor(Math.abs(offset) / 60), 2) +\n \":\" +\n pad(Math.abs(offset) % 60, 2));\n }\n};\nvar monthParse = function (v) { return +v - 1; };\nvar emptyDigits = [null, twoDigitsOptional];\nvar emptyWord = [null, word];\nvar amPm = [\n \"isPm\",\n word,\n function (v, i18n) {\n var val = v.toLowerCase();\n if (val === i18n.amPm[0]) {\n return 0;\n }\n else if (val === i18n.amPm[1]) {\n return 1;\n }\n return null;\n }\n];\nvar timezoneOffset = [\n \"timezoneOffset\",\n \"[^\\\\s]*?[\\\\+\\\\-]\\\\d\\\\d:?\\\\d\\\\d|[^\\\\s]*?Z?\",\n function (v) {\n var parts = (v + \"\").match(/([+-]|\\d\\d)/gi);\n if (parts) {\n var minutes = +parts[1] * 60 + parseInt(parts[2], 10);\n return parts[0] === \"+\" ? minutes : -minutes;\n }\n return 0;\n }\n];\nvar parseFlags = {\n D: [\"day\", twoDigitsOptional],\n DD: [\"day\", twoDigits],\n Do: [\"day\", twoDigitsOptional + word, function (v) { return parseInt(v, 10); }],\n M: [\"month\", twoDigitsOptional, monthParse],\n MM: [\"month\", twoDigits, monthParse],\n YY: [\n \"year\",\n twoDigits,\n function (v) {\n var now = new Date();\n var cent = +(\"\" + now.getFullYear()).substr(0, 2);\n return +(\"\" + (+v > 68 ? cent - 1 : cent) + v);\n }\n ],\n h: [\"hour\", twoDigitsOptional, undefined, \"isPm\"],\n hh: [\"hour\", twoDigits, undefined, \"isPm\"],\n H: [\"hour\", twoDigitsOptional],\n HH: [\"hour\", twoDigits],\n m: [\"minute\", twoDigitsOptional],\n mm: [\"minute\", twoDigits],\n s: [\"second\", twoDigitsOptional],\n ss: [\"second\", twoDigits],\n YYYY: [\"year\", fourDigits],\n S: [\"millisecond\", \"\\\\d\", function (v) { return +v * 100; }],\n SS: [\"millisecond\", twoDigits, function (v) { return +v * 10; }],\n SSS: [\"millisecond\", threeDigits],\n d: emptyDigits,\n dd: emptyDigits,\n ddd: emptyWord,\n dddd: emptyWord,\n MMM: [\"month\", word, monthUpdate(\"monthNamesShort\")],\n MMMM: [\"month\", word, monthUpdate(\"monthNames\")],\n a: amPm,\n A: amPm,\n ZZ: timezoneOffset,\n Z: timezoneOffset\n};\n// Some common format strings\nvar globalMasks = {\n default: \"ddd MMM DD YYYY HH:mm:ss\",\n shortDate: \"M/D/YY\",\n mediumDate: \"MMM D, YYYY\",\n longDate: \"MMMM D, YYYY\",\n fullDate: \"dddd, MMMM D, YYYY\",\n isoDate: \"YYYY-MM-DD\",\n isoDateTime: \"YYYY-MM-DDTHH:mm:ssZ\",\n shortTime: \"HH:mm\",\n mediumTime: \"HH:mm:ss\",\n longTime: \"HH:mm:ss.SSS\"\n};\nvar setGlobalDateMasks = function (masks) { return assign(globalMasks, masks); };\n/***\n * Format a date\n * @method format\n * @param {Date|number} dateObj\n * @param {string} mask Format of the date, i.e. 'mm-dd-yy' or 'shortDate'\n * @returns {string} Formatted date string\n */\nvar format = function (dateObj, mask, i18n) {\n if (mask === void 0) { mask = globalMasks[\"default\"]; }\n if (i18n === void 0) { i18n = {}; }\n if (typeof dateObj === \"number\") {\n dateObj = new Date(dateObj);\n }\n if (Object.prototype.toString.call(dateObj) !== \"[object Date]\" ||\n isNaN(dateObj.getTime())) {\n throw new Error(\"Invalid Date pass to format\");\n }\n mask = globalMasks[mask] || mask;\n var literals = [];\n // Make literals inactive by replacing them with @@@\n mask = mask.replace(literal, function ($0, $1) {\n literals.push($1);\n return \"@@@\";\n });\n var combinedI18nSettings = assign(assign({}, globalI18n), i18n);\n // Apply formatting rules\n mask = mask.replace(token, function ($0) {\n return formatFlags[$0](dateObj, combinedI18nSettings);\n });\n // Inline literal values back into the formatted value\n return mask.replace(/@@@/g, function () { return literals.shift(); });\n};\n/**\n * Parse a date string into a Javascript Date object /\n * @method parse\n * @param {string} dateStr Date string\n * @param {string} format Date parse format\n * @param {i18n} I18nSettingsOptional Full or subset of I18N settings\n * @returns {Date|null} Returns Date object. Returns null what date string is invalid or doesn't match format\n */\nfunction parse(dateStr, format, i18n) {\n if (i18n === void 0) { i18n = {}; }\n if (typeof format !== \"string\") {\n throw new Error(\"Invalid format in fecha parse\");\n }\n // Check to see if the format is actually a mask\n format = globalMasks[format] || format;\n // Avoid regular expression denial of service, fail early for really long strings\n // https://www.owasp.org/index.php/Regular_expression_Denial_of_Service_-_ReDoS\n if (dateStr.length > 1000) {\n return null;\n }\n // Default to the beginning of the year.\n var today = new Date();\n var dateInfo = {\n year: today.getFullYear(),\n month: 0,\n day: 1,\n hour: 0,\n minute: 0,\n second: 0,\n millisecond: 0,\n isPm: null,\n timezoneOffset: null\n };\n var parseInfo = [];\n var literals = [];\n // Replace all the literals with @@@. Hopefully a string that won't exist in the format\n var newFormat = format.replace(literal, function ($0, $1) {\n literals.push(regexEscape($1));\n return \"@@@\";\n });\n var specifiedFields = {};\n var requiredFields = {};\n // Change every token that we find into the correct regex\n newFormat = regexEscape(newFormat).replace(token, function ($0) {\n var info = parseFlags[$0];\n var field = info[0], regex = info[1], requiredField = info[3];\n // Check if the person has specified the same field twice. This will lead to confusing results.\n if (specifiedFields[field]) {\n throw new Error(\"Invalid format. \" + field + \" specified twice in format\");\n }\n specifiedFields[field] = true;\n // Check if there are any required fields. For instance, 12 hour time requires AM/PM specified\n if (requiredField) {\n requiredFields[requiredField] = true;\n }\n parseInfo.push(info);\n return \"(\" + regex + \")\";\n });\n // Check all the required fields are present\n Object.keys(requiredFields).forEach(function (field) {\n if (!specifiedFields[field]) {\n throw new Error(\"Invalid format. \" + field + \" is required in specified format\");\n }\n });\n // Add back all the literals after\n newFormat = newFormat.replace(/@@@/g, function () { return literals.shift(); });\n // Check if the date string matches the format. If it doesn't return null\n var matches = dateStr.match(new RegExp(newFormat, \"i\"));\n if (!matches) {\n return null;\n }\n var combinedI18nSettings = assign(assign({}, globalI18n), i18n);\n // For each match, call the parser function for that date part\n for (var i = 1; i < matches.length; i++) {\n var _a = parseInfo[i - 1], field = _a[0], parser = _a[2];\n var value = parser\n ? parser(matches[i], combinedI18nSettings)\n : +matches[i];\n // If the parser can't make sense of the value, return null\n if (value == null) {\n return null;\n }\n dateInfo[field] = value;\n }\n if (dateInfo.isPm === 1 && dateInfo.hour != null && +dateInfo.hour !== 12) {\n dateInfo.hour = +dateInfo.hour + 12;\n }\n else if (dateInfo.isPm === 0 && +dateInfo.hour === 12) {\n dateInfo.hour = 0;\n }\n var dateTZ;\n if (dateInfo.timezoneOffset == null) {\n dateTZ = new Date(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute, dateInfo.second, dateInfo.millisecond);\n var validateFields = [\n [\"month\", \"getMonth\"],\n [\"day\", \"getDate\"],\n [\"hour\", \"getHours\"],\n [\"minute\", \"getMinutes\"],\n [\"second\", \"getSeconds\"]\n ];\n for (var i = 0, len = validateFields.length; i < len; i++) {\n // Check to make sure the date field is within the allowed range. Javascript dates allows values\n // outside the allowed range. If the values don't match the value was invalid\n if (specifiedFields[validateFields[i][0]] &&\n dateInfo[validateFields[i][0]] !== dateTZ[validateFields[i][1]]()) {\n return null;\n }\n }\n }\n else {\n dateTZ = new Date(Date.UTC(dateInfo.year, dateInfo.month, dateInfo.day, dateInfo.hour, dateInfo.minute - dateInfo.timezoneOffset, dateInfo.second, dateInfo.millisecond));\n // We can't validate dates in another timezone unfortunately. Do a basic check instead\n if (dateInfo.month > 11 ||\n dateInfo.month < 0 ||\n dateInfo.day > 31 ||\n dateInfo.day < 1 ||\n dateInfo.hour > 23 ||\n dateInfo.hour < 0 ||\n dateInfo.minute > 59 ||\n dateInfo.minute < 0 ||\n dateInfo.second > 59 ||\n dateInfo.second < 0) {\n return null;\n }\n }\n // Don't allow invalid dates\n return dateTZ;\n}\nvar fecha = {\n format: format,\n parse: parse,\n defaultI18n: defaultI18n,\n setGlobalDateI18n: setGlobalDateI18n,\n setGlobalDateMasks: setGlobalDateMasks\n};\n\n/* harmony default export */ __webpack_exports__[\"default\"] = (fecha);\n\n//# sourceMappingURL=fecha.js.map\n\n\n//# sourceURL=webpack:///./node_modules/fecha/lib/fecha.js?"); /***/ }), -/***/ "./node_modules/ml-array-rescale/lib-es6/index.js": -/*!********************************************************!*\ - !*** ./node_modules/ml-array-rescale/lib-es6/index.js ***! - \********************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/gl-matrix/esm/common.js": +/*!**********************************************!*\ + !*** ./node_modules/gl-matrix/esm/common.js ***! + \**********************************************/ +/*! exports provided: EPSILON, ARRAY_TYPE, RANDOM, setMatrixArrayType, toRadian, equals */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return rescale; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n/* harmony import */ var ml_array_max__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ml-array-max */ \"./node_modules/ml-array-max/lib-es6/index.js\");\n/* harmony import */ var ml_array_min__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ml-array-min */ \"./node_modules/ml-array-min/lib-es6/index.js\");\n\n\n\n\nfunction rescale(input) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(input)) {\n throw new TypeError('input must be an array');\n } else if (input.length === 0) {\n throw new TypeError('input must not be empty');\n }\n\n var output;\n\n if (options.output !== undefined) {\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(options.output)) {\n throw new TypeError('output option must be an array if specified');\n }\n\n output = options.output;\n } else {\n output = new Array(input.length);\n }\n\n var currentMin = Object(ml_array_min__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(input);\n var currentMax = Object(ml_array_max__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(input);\n\n if (currentMin === currentMax) {\n throw new RangeError('minimum and maximum input values are equal. Cannot rescale a constant array');\n }\n\n var _options$min = options.min,\n minValue = _options$min === void 0 ? options.autoMinMax ? currentMin : 0 : _options$min,\n _options$max = options.max,\n maxValue = _options$max === void 0 ? options.autoMinMax ? currentMax : 1 : _options$max;\n\n if (minValue >= maxValue) {\n throw new RangeError('min option must be smaller than max option');\n }\n\n var factor = (maxValue - minValue) / (currentMax - currentMin);\n\n for (var i = 0; i < input.length; i++) {\n output[i] = (input[i] - currentMin) * factor + minValue;\n }\n\n return output;\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/ml-array-rescale/lib-es6/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"EPSILON\", function() { return EPSILON; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ARRAY_TYPE\", function() { return ARRAY_TYPE; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"RANDOM\", function() { return RANDOM; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setMatrixArrayType\", function() { return setMatrixArrayType; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"toRadian\", function() { return toRadian; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/**\n * Common utilities\n * @module glMatrix\n */\n// Configuration Constants\nvar EPSILON = 0.000001;\nvar ARRAY_TYPE = typeof Float32Array !== 'undefined' ? Float32Array : Array;\nvar RANDOM = Math.random;\n/**\n * Sets the type of array used when creating new vectors and matrices\n *\n * @param {Float32ArrayConstructor | ArrayConstructor} type Array type, such as Float32Array or Array\n */\n\nfunction setMatrixArrayType(type) {\n ARRAY_TYPE = type;\n}\nvar degree = Math.PI / 180;\n/**\n * Convert Degree To Radian\n *\n * @param {Number} a Angle in Degrees\n */\n\nfunction toRadian(a) {\n return a * degree;\n}\n/**\n * Tests whether or not the arguments have approximately the same value, within an absolute\n * or relative tolerance of glMatrix.EPSILON (an absolute tolerance is used for values less\n * than or equal to 1.0, and a relative tolerance is used for larger values)\n *\n * @param {Number} a The first number to test.\n * @param {Number} b The second number to test.\n * @returns {Boolean} True if the numbers are approximately equal, false otherwise.\n */\n\nfunction equals(a, b) {\n return Math.abs(a - b) <= EPSILON * Math.max(1.0, Math.abs(a), Math.abs(b));\n}\nif (!Math.hypot) Math.hypot = function () {\n var y = 0,\n i = arguments.length;\n\n while (i--) {\n y += arguments[i] * arguments[i];\n }\n\n return Math.sqrt(y);\n};\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/common.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/correlation.js": -/*!***************************************************!*\ - !*** ./node_modules/ml-matrix/src/correlation.js ***! - \***************************************************/ -/*! exports provided: correlation */ +/***/ "./node_modules/gl-matrix/esm/index.js": +/*!*********************************************!*\ + !*** ./node_modules/gl-matrix/esm/index.js ***! + \*********************************************/ +/*! exports provided: glMatrix, mat2, mat2d, mat3, mat4, quat, quat2, vec2, vec3, vec4 */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"correlation\", function() { return correlation; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n\n\n\n\nfunction correlation(xMatrix, yMatrix = xMatrix, options = {}) {\n xMatrix = new _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"](xMatrix);\n let yIsSame = false;\n if (\n typeof yMatrix === 'object' &&\n !_matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isMatrix(yMatrix) &&\n !Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(yMatrix)\n ) {\n options = yMatrix;\n yMatrix = xMatrix;\n yIsSame = true;\n } else {\n yMatrix = new _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"](yMatrix);\n }\n if (xMatrix.rows !== yMatrix.rows) {\n throw new TypeError('Both matrices must have the same number of rows');\n }\n\n const { center = true, scale = true } = options;\n if (center) {\n xMatrix.center('column');\n if (!yIsSame) {\n yMatrix.center('column');\n }\n }\n if (scale) {\n xMatrix.scale('column');\n if (!yIsSame) {\n yMatrix.scale('column');\n }\n }\n\n const sdx = xMatrix.standardDeviation('column', { unbiased: true });\n const sdy = yIsSame\n ? sdx\n : yMatrix.standardDeviation('column', { unbiased: true });\n\n const corr = xMatrix.transpose().mmul(yMatrix);\n for (let i = 0; i < corr.rows; i++) {\n for (let j = 0; j < corr.columns; j++) {\n corr.set(\n i,\n j,\n corr.get(i, j) * (1 / (sdx[i] * sdy[j])) * (1 / (xMatrix.rows - 1)),\n );\n }\n }\n return corr;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/correlation.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"glMatrix\", function() { return _common_js__WEBPACK_IMPORTED_MODULE_0__; });\n/* harmony import */ var _mat2_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat2.js */ \"./node_modules/gl-matrix/esm/mat2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat2\", function() { return _mat2_js__WEBPACK_IMPORTED_MODULE_1__; });\n/* harmony import */ var _mat2d_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat2d.js */ \"./node_modules/gl-matrix/esm/mat2d.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat2d\", function() { return _mat2d_js__WEBPACK_IMPORTED_MODULE_2__; });\n/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mat3.js */ \"./node_modules/gl-matrix/esm/mat3.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat3\", function() { return _mat3_js__WEBPACK_IMPORTED_MODULE_3__; });\n/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./mat4.js */ \"./node_modules/gl-matrix/esm/mat4.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"mat4\", function() { return _mat4_js__WEBPACK_IMPORTED_MODULE_4__; });\n/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./quat.js */ \"./node_modules/gl-matrix/esm/quat.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"quat\", function() { return _quat_js__WEBPACK_IMPORTED_MODULE_5__; });\n/* harmony import */ var _quat2_js__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./quat2.js */ \"./node_modules/gl-matrix/esm/quat2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"quat2\", function() { return _quat2_js__WEBPACK_IMPORTED_MODULE_6__; });\n/* harmony import */ var _vec2_js__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./vec2.js */ \"./node_modules/gl-matrix/esm/vec2.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec2\", function() { return _vec2_js__WEBPACK_IMPORTED_MODULE_7__; });\n/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./vec3.js */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec3\", function() { return _vec3_js__WEBPACK_IMPORTED_MODULE_8__; });\n/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./vec4.js */ \"./node_modules/gl-matrix/esm/vec4.js\");\n/* harmony reexport (module object) */ __webpack_require__.d(__webpack_exports__, \"vec4\", function() { return _vec4_js__WEBPACK_IMPORTED_MODULE_9__; });\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/index.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/covariance.js": -/*!**************************************************!*\ - !*** ./node_modules/ml-matrix/src/covariance.js ***! - \**************************************************/ -/*! exports provided: covariance */ +/***/ "./node_modules/gl-matrix/esm/mat2.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/mat2.js ***! + \********************************************/ +/*! exports provided: create, clone, copy, identity, fromValues, set, transpose, invert, adjoint, determinant, multiply, rotate, scale, fromRotation, fromScaling, str, frob, LDU, add, subtract, exactEquals, equals, multiplyScalar, multiplyScalarAndAdd, mul, sub */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"covariance\", function() { return covariance; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n\n\n\n\nfunction covariance(xMatrix, yMatrix = xMatrix, options = {}) {\n xMatrix = new _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"](xMatrix);\n let yIsSame = false;\n if (\n typeof yMatrix === 'object' &&\n !_matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].isMatrix(yMatrix) &&\n !Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(yMatrix)\n ) {\n options = yMatrix;\n yMatrix = xMatrix;\n yIsSame = true;\n } else {\n yMatrix = new _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"](yMatrix);\n }\n if (xMatrix.rows !== yMatrix.rows) {\n throw new TypeError('Both matrices must have the same number of rows');\n }\n const { center = true } = options;\n if (center) {\n xMatrix = xMatrix.center('column');\n if (!yIsSame) {\n yMatrix = yMatrix.center('column');\n }\n }\n const cov = xMatrix.transpose().mmul(yMatrix);\n for (let i = 0; i < cov.rows; i++) {\n for (let j = 0; j < cov.columns; j++) {\n cov.set(i, j, cov.get(i, j) * (1 / (xMatrix.rows - 1)));\n }\n }\n return cov;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/covariance.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"LDU\", function() { return LDU; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 2x2 Matrix\n * @module mat2\n */\n\n/**\n * Creates a new identity mat2\n *\n * @returns {mat2} a new 2x2 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\n * Creates a new mat2 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2} a matrix to clone\n * @returns {mat2} a new 2x2 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Copy the values from one mat2 to another\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set a mat2 to the identity matrix\n *\n * @param {mat2} out the receiving matrix\n * @returns {mat2} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\n * Create a new mat2 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out A new 2x2 matrix\n */\n\nfunction fromValues(m00, m01, m10, m11) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\n * Set the components of a mat2 to the given values\n *\n * @param {mat2} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m10 Component in column 1, row 0 position (index 2)\n * @param {Number} m11 Component in column 1, row 1 position (index 3)\n * @returns {mat2} out\n */\n\nfunction set(out, m00, m01, m10, m11) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m10;\n out[3] = m11;\n return out;\n}\n/**\n * Transpose the values of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache\n // some values\n if (out === a) {\n var a1 = a[1];\n out[1] = a[2];\n out[2] = a1;\n } else {\n out[0] = a[0];\n out[1] = a[2];\n out[2] = a[1];\n out[3] = a[3];\n }\n\n return out;\n}\n/**\n * Inverts a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3]; // Calculate the determinant\n\n var det = a0 * a3 - a2 * a1;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = a3 * det;\n out[1] = -a1 * det;\n out[2] = -a2 * det;\n out[3] = a0 * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the source matrix\n * @returns {mat2} out\n */\n\nfunction adjoint(out, a) {\n // Caching this value is nessecary if out == a\n var a0 = a[0];\n out[0] = a[3];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a0;\n return out;\n}\n/**\n * Calculates the determinant of a mat2\n *\n * @param {ReadonlyMat2} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n return a[0] * a[3] - a[2] * a[1];\n}\n/**\n * Multiplies two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nfunction multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n return out;\n}\n/**\n * Rotates a mat2 by the given angle\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\n\nfunction rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n return out;\n}\n/**\n * Scales the mat2 by the dimensions in the given vec2\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2} out\n **/\n\nfunction scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.rotate(dest, dest, rad);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2} out\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2.identity(dest);\n * mat2.scale(dest, dest, vec);\n *\n * @param {mat2} out mat2 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n return out;\n}\n/**\n * Returns a string representation of a mat2\n *\n * @param {ReadonlyMat2} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat2\n *\n * @param {ReadonlyMat2} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3]);\n}\n/**\n * Returns L, D and U matrices (Lower triangular, Diagonal and Upper triangular) by factorizing the input matrix\n * @param {ReadonlyMat2} L the lower triangular matrix\n * @param {ReadonlyMat2} D the diagonal matrix\n * @param {ReadonlyMat2} U the upper triangular matrix\n * @param {ReadonlyMat2} a the input matrix to factorize\n */\n\nfunction LDU(L, D, U, a) {\n L[2] = a[2] / a[0];\n U[0] = a[0];\n U[1] = a[1];\n U[3] = a[3] - L[2] * U[1];\n return [L, D, U];\n}\n/**\n * Adds two mat2's\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @returns {mat2} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2} a The first matrix.\n * @param {ReadonlyMat2} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2} out the receiving matrix\n * @param {ReadonlyMat2} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two mat2's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2} out the receiving vector\n * @param {ReadonlyMat2} a the first operand\n * @param {ReadonlyMat2} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Alias for {@link mat2.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat2.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/mat2.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/dc/cholesky.js": -/*!***************************************************!*\ - !*** ./node_modules/ml-matrix/src/dc/cholesky.js ***! - \***************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/gl-matrix/esm/mat2d.js": +/*!*********************************************!*\ + !*** ./node_modules/gl-matrix/esm/mat2d.js ***! + \*********************************************/ +/*! exports provided: create, clone, copy, identity, fromValues, set, invert, determinant, multiply, rotate, scale, translate, fromRotation, fromScaling, fromTranslation, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return CholeskyDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\nclass CholeskyDecomposition {\n constructor(value) {\n value = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(value);\n if (!value.isSymmetric()) {\n throw new Error('Matrix is not symmetric');\n }\n\n let a = value;\n let dimension = a.rows;\n let l = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](dimension, dimension);\n let positiveDefinite = true;\n let i, j, k;\n\n for (j = 0; j < dimension; j++) {\n let d = 0;\n for (k = 0; k < j; k++) {\n let s = 0;\n for (i = 0; i < k; i++) {\n s += l.get(k, i) * l.get(j, i);\n }\n s = (a.get(j, k) - s) / l.get(k, k);\n l.set(j, k, s);\n d = d + s * s;\n }\n\n d = a.get(j, j) - d;\n\n positiveDefinite &= d > 0;\n l.set(j, j, Math.sqrt(Math.max(d, 0)));\n for (k = j + 1; k < dimension; k++) {\n l.set(j, k, 0);\n }\n }\n\n this.L = l;\n this.positiveDefinite = Boolean(positiveDefinite);\n }\n\n isPositiveDefinite() {\n return this.positiveDefinite;\n }\n\n solve(value) {\n value = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(value);\n\n let l = this.L;\n let dimension = l.rows;\n\n if (value.rows !== dimension) {\n throw new Error('Matrix dimensions do not match');\n }\n if (this.isPositiveDefinite() === false) {\n throw new Error('Matrix is not positive definite');\n }\n\n let count = value.columns;\n let B = value.clone();\n let i, j, k;\n\n for (k = 0; k < dimension; k++) {\n for (j = 0; j < count; j++) {\n for (i = 0; i < k; i++) {\n B.set(k, j, B.get(k, j) - B.get(i, j) * l.get(k, i));\n }\n B.set(k, j, B.get(k, j) / l.get(k, k));\n }\n }\n\n for (k = dimension - 1; k >= 0; k--) {\n for (j = 0; j < count; j++) {\n for (i = k + 1; i < dimension; i++) {\n B.set(k, j, B.get(k, j) - B.get(i, j) * l.get(i, k));\n }\n B.set(k, j, B.get(k, j) / l.get(k, k));\n }\n }\n\n return B;\n }\n\n get lowerTriangularMatrix() {\n return this.L;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/dc/cholesky.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 2x3 Matrix\n * @module mat2d\n * @description\n * A mat2d contains six elements defined as:\n *
\n * [a, b,\n *  c, d,\n *  tx, ty]\n * 
\n * This is a short form for the 3x3 matrix:\n *
\n * [a, b, 0,\n *  c, d, 0,\n *  tx, ty, 1]\n * 
\n * The last column is ignored so the array is shorter and operations are faster.\n */\n\n/**\n * Creates a new identity mat2d\n *\n * @returns {mat2d} a new 2x3 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[4] = 0;\n out[5] = 0;\n }\n\n out[0] = 1;\n out[3] = 1;\n return out;\n}\n/**\n * Creates a new mat2d initialized with values from an existing matrix\n *\n * @param {ReadonlyMat2d} a matrix to clone\n * @returns {mat2d} a new 2x3 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\n * Copy the values from one mat2d to another\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {mat2d} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n return out;\n}\n/**\n * Set a mat2d to the identity matrix\n *\n * @param {mat2d} out the receiving matrix\n * @returns {mat2d} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Create a new mat2d with the given values\n *\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} A new mat2d\n */\n\nfunction fromValues(a, b, c, d, tx, ty) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](6);\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\n * Set the components of a mat2d to the given values\n *\n * @param {mat2d} out the receiving matrix\n * @param {Number} a Component A (index 0)\n * @param {Number} b Component B (index 1)\n * @param {Number} c Component C (index 2)\n * @param {Number} d Component D (index 3)\n * @param {Number} tx Component TX (index 4)\n * @param {Number} ty Component TY (index 5)\n * @returns {mat2d} out\n */\n\nfunction set(out, a, b, c, d, tx, ty) {\n out[0] = a;\n out[1] = b;\n out[2] = c;\n out[3] = d;\n out[4] = tx;\n out[5] = ty;\n return out;\n}\n/**\n * Inverts a mat2d\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {mat2d} out\n */\n\nfunction invert(out, a) {\n var aa = a[0],\n ab = a[1],\n ac = a[2],\n ad = a[3];\n var atx = a[4],\n aty = a[5];\n var det = aa * ad - ab * ac;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = ad * det;\n out[1] = -ab * det;\n out[2] = -ac * det;\n out[3] = aa * det;\n out[4] = (ac * aty - ad * atx) * det;\n out[5] = (ab * atx - aa * aty) * det;\n return out;\n}\n/**\n * Calculates the determinant of a mat2d\n *\n * @param {ReadonlyMat2d} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n return a[0] * a[3] - a[1] * a[2];\n}\n/**\n * Multiplies two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nfunction multiply(out, a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n out[0] = a0 * b0 + a2 * b1;\n out[1] = a1 * b0 + a3 * b1;\n out[2] = a0 * b2 + a2 * b3;\n out[3] = a1 * b2 + a3 * b3;\n out[4] = a0 * b4 + a2 * b5 + a4;\n out[5] = a1 * b4 + a3 * b5 + a5;\n return out;\n}\n/**\n * Rotates a mat2d by the given angle\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\n\nfunction rotate(out, a, rad) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n out[0] = a0 * c + a2 * s;\n out[1] = a1 * c + a3 * s;\n out[2] = a0 * -s + a2 * c;\n out[3] = a1 * -s + a3 * c;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\n * Scales the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to translate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat2d} out\n **/\n\nfunction scale(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0 * v0;\n out[1] = a1 * v0;\n out[2] = a2 * v1;\n out[3] = a3 * v1;\n out[4] = a4;\n out[5] = a5;\n return out;\n}\n/**\n * Translates the mat2d by the dimensions in the given vec2\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to translate\n * @param {ReadonlyVec2} v the vec2 to translate the matrix by\n * @returns {mat2d} out\n **/\n\nfunction translate(out, a, v) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var v0 = v[0],\n v1 = v[1];\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = a0 * v0 + a2 * v1 + a4;\n out[5] = a1 * v0 + a3 * v1 + a5;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.rotate(dest, dest, rad);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat2d} out\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = -s;\n out[3] = c;\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.scale(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat2d} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = v[1];\n out[4] = 0;\n out[5] = 0;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat2d.identity(dest);\n * mat2d.translate(dest, dest, vec);\n *\n * @param {mat2d} out mat2d receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat2d} out\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = v[0];\n out[5] = v[1];\n return out;\n}\n/**\n * Returns a string representation of a mat2d\n *\n * @param {ReadonlyMat2d} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat2d(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat2d\n *\n * @param {ReadonlyMat2d} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], 1);\n}\n/**\n * Adds two mat2d's\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @returns {mat2d} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat2d} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat2d} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n return out;\n}\n/**\n * Adds two mat2d's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat2d} out the receiving vector\n * @param {ReadonlyMat2d} a the first operand\n * @param {ReadonlyMat2d} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat2d} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat2d} a The first matrix.\n * @param {ReadonlyMat2d} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat2d} a The first matrix.\n * @param {ReadonlyMat2d} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5));\n}\n/**\n * Alias for {@link mat2d.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat2d.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/mat2d.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/dc/evd.js": -/*!**********************************************!*\ - !*** ./node_modules/ml-matrix/src/dc/evd.js ***! - \**********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/gl-matrix/esm/mat3.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/mat3.js ***! + \********************************************/ +/*! exports provided: create, fromMat4, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, rotate, scale, fromTranslation, fromRotation, fromScaling, fromMat2d, fromQuat, normalFromMat4, projection, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return EigenvalueDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/ml-matrix/src/dc/util.js\");\n\n\n\n\n\nclass EigenvalueDecomposition {\n constructor(matrix, options = {}) {\n const { assumeSymmetric = false } = options;\n\n matrix = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n if (!matrix.isSquare()) {\n throw new Error('Matrix is not a square matrix');\n }\n\n if (matrix.isEmpty()) {\n throw new Error('Matrix must be non-empty');\n }\n\n let n = matrix.columns;\n let V = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n let d = new Float64Array(n);\n let e = new Float64Array(n);\n let value = matrix;\n let i, j;\n\n let isSymmetric = false;\n if (assumeSymmetric) {\n isSymmetric = true;\n } else {\n isSymmetric = matrix.isSymmetric();\n }\n\n if (isSymmetric) {\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n V.set(i, j, value.get(i, j));\n }\n }\n tred2(n, e, d, V);\n tql2(n, e, d, V);\n } else {\n let H = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n let ort = new Float64Array(n);\n for (j = 0; j < n; j++) {\n for (i = 0; i < n; i++) {\n H.set(i, j, value.get(i, j));\n }\n }\n orthes(n, H, ort, V);\n hqr2(n, e, d, V, H);\n }\n\n this.n = n;\n this.e = e;\n this.d = d;\n this.V = V;\n }\n\n get realEigenvalues() {\n return Array.from(this.d);\n }\n\n get imaginaryEigenvalues() {\n return Array.from(this.e);\n }\n\n get eigenvectorMatrix() {\n return this.V;\n }\n\n get diagonalMatrix() {\n let n = this.n;\n let e = this.e;\n let d = this.d;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n let i, j;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n X.set(i, j, 0);\n }\n X.set(i, i, d[i]);\n if (e[i] > 0) {\n X.set(i, i + 1, e[i]);\n } else if (e[i] < 0) {\n X.set(i, i - 1, e[i]);\n }\n }\n return X;\n }\n}\n\nfunction tred2(n, e, d, V) {\n let f, g, h, i, j, k, hh, scale;\n\n for (j = 0; j < n; j++) {\n d[j] = V.get(n - 1, j);\n }\n\n for (i = n - 1; i > 0; i--) {\n scale = 0;\n h = 0;\n for (k = 0; k < i; k++) {\n scale = scale + Math.abs(d[k]);\n }\n\n if (scale === 0) {\n e[i] = d[i - 1];\n for (j = 0; j < i; j++) {\n d[j] = V.get(i - 1, j);\n V.set(i, j, 0);\n V.set(j, i, 0);\n }\n } else {\n for (k = 0; k < i; k++) {\n d[k] /= scale;\n h += d[k] * d[k];\n }\n\n f = d[i - 1];\n g = Math.sqrt(h);\n if (f > 0) {\n g = -g;\n }\n\n e[i] = scale * g;\n h = h - f * g;\n d[i - 1] = f - g;\n for (j = 0; j < i; j++) {\n e[j] = 0;\n }\n\n for (j = 0; j < i; j++) {\n f = d[j];\n V.set(j, i, f);\n g = e[j] + V.get(j, j) * f;\n for (k = j + 1; k <= i - 1; k++) {\n g += V.get(k, j) * d[k];\n e[k] += V.get(k, j) * f;\n }\n e[j] = g;\n }\n\n f = 0;\n for (j = 0; j < i; j++) {\n e[j] /= h;\n f += e[j] * d[j];\n }\n\n hh = f / (h + h);\n for (j = 0; j < i; j++) {\n e[j] -= hh * d[j];\n }\n\n for (j = 0; j < i; j++) {\n f = d[j];\n g = e[j];\n for (k = j; k <= i - 1; k++) {\n V.set(k, j, V.get(k, j) - (f * e[k] + g * d[k]));\n }\n d[j] = V.get(i - 1, j);\n V.set(i, j, 0);\n }\n }\n d[i] = h;\n }\n\n for (i = 0; i < n - 1; i++) {\n V.set(n - 1, i, V.get(i, i));\n V.set(i, i, 1);\n h = d[i + 1];\n if (h !== 0) {\n for (k = 0; k <= i; k++) {\n d[k] = V.get(k, i + 1) / h;\n }\n\n for (j = 0; j <= i; j++) {\n g = 0;\n for (k = 0; k <= i; k++) {\n g += V.get(k, i + 1) * V.get(k, j);\n }\n for (k = 0; k <= i; k++) {\n V.set(k, j, V.get(k, j) - g * d[k]);\n }\n }\n }\n\n for (k = 0; k <= i; k++) {\n V.set(k, i + 1, 0);\n }\n }\n\n for (j = 0; j < n; j++) {\n d[j] = V.get(n - 1, j);\n V.set(n - 1, j, 0);\n }\n\n V.set(n - 1, n - 1, 1);\n e[0] = 0;\n}\n\nfunction tql2(n, e, d, V) {\n let g, h, i, j, k, l, m, p, r, dl1, c, c2, c3, el1, s, s2, iter;\n\n for (i = 1; i < n; i++) {\n e[i - 1] = e[i];\n }\n\n e[n - 1] = 0;\n\n let f = 0;\n let tst1 = 0;\n let eps = Number.EPSILON;\n\n for (l = 0; l < n; l++) {\n tst1 = Math.max(tst1, Math.abs(d[l]) + Math.abs(e[l]));\n m = l;\n while (m < n) {\n if (Math.abs(e[m]) <= eps * tst1) {\n break;\n }\n m++;\n }\n\n if (m > l) {\n iter = 0;\n do {\n iter = iter + 1;\n\n g = d[l];\n p = (d[l + 1] - g) / (2 * e[l]);\n r = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(p, 1);\n if (p < 0) {\n r = -r;\n }\n\n d[l] = e[l] / (p + r);\n d[l + 1] = e[l] * (p + r);\n dl1 = d[l + 1];\n h = g - d[l];\n for (i = l + 2; i < n; i++) {\n d[i] -= h;\n }\n\n f = f + h;\n\n p = d[m];\n c = 1;\n c2 = c;\n c3 = c;\n el1 = e[l + 1];\n s = 0;\n s2 = 0;\n for (i = m - 1; i >= l; i--) {\n c3 = c2;\n c2 = c;\n s2 = s;\n g = c * e[i];\n h = c * p;\n r = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(p, e[i]);\n e[i + 1] = s * r;\n s = e[i] / r;\n c = p / r;\n p = c * d[i] - s * g;\n d[i + 1] = h + s * (c * g + s * d[i]);\n\n for (k = 0; k < n; k++) {\n h = V.get(k, i + 1);\n V.set(k, i + 1, s * V.get(k, i) + c * h);\n V.set(k, i, c * V.get(k, i) - s * h);\n }\n }\n\n p = (-s * s2 * c3 * el1 * e[l]) / dl1;\n e[l] = s * p;\n d[l] = c * p;\n } while (Math.abs(e[l]) > eps * tst1);\n }\n d[l] = d[l] + f;\n e[l] = 0;\n }\n\n for (i = 0; i < n - 1; i++) {\n k = i;\n p = d[i];\n for (j = i + 1; j < n; j++) {\n if (d[j] < p) {\n k = j;\n p = d[j];\n }\n }\n\n if (k !== i) {\n d[k] = d[i];\n d[i] = p;\n for (j = 0; j < n; j++) {\n p = V.get(j, i);\n V.set(j, i, V.get(j, k));\n V.set(j, k, p);\n }\n }\n }\n}\n\nfunction orthes(n, H, ort, V) {\n let low = 0;\n let high = n - 1;\n let f, g, h, i, j, m;\n let scale;\n\n for (m = low + 1; m <= high - 1; m++) {\n scale = 0;\n for (i = m; i <= high; i++) {\n scale = scale + Math.abs(H.get(i, m - 1));\n }\n\n if (scale !== 0) {\n h = 0;\n for (i = high; i >= m; i--) {\n ort[i] = H.get(i, m - 1) / scale;\n h += ort[i] * ort[i];\n }\n\n g = Math.sqrt(h);\n if (ort[m] > 0) {\n g = -g;\n }\n\n h = h - ort[m] * g;\n ort[m] = ort[m] - g;\n\n for (j = m; j < n; j++) {\n f = 0;\n for (i = high; i >= m; i--) {\n f += ort[i] * H.get(i, j);\n }\n\n f = f / h;\n for (i = m; i <= high; i++) {\n H.set(i, j, H.get(i, j) - f * ort[i]);\n }\n }\n\n for (i = 0; i <= high; i++) {\n f = 0;\n for (j = high; j >= m; j--) {\n f += ort[j] * H.get(i, j);\n }\n\n f = f / h;\n for (j = m; j <= high; j++) {\n H.set(i, j, H.get(i, j) - f * ort[j]);\n }\n }\n\n ort[m] = scale * ort[m];\n H.set(m, m - 1, scale * g);\n }\n }\n\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n V.set(i, j, i === j ? 1 : 0);\n }\n }\n\n for (m = high - 1; m >= low + 1; m--) {\n if (H.get(m, m - 1) !== 0) {\n for (i = m + 1; i <= high; i++) {\n ort[i] = H.get(i, m - 1);\n }\n\n for (j = m; j <= high; j++) {\n g = 0;\n for (i = m; i <= high; i++) {\n g += ort[i] * V.get(i, j);\n }\n\n g = g / ort[m] / H.get(m, m - 1);\n for (i = m; i <= high; i++) {\n V.set(i, j, V.get(i, j) + g * ort[i]);\n }\n }\n }\n }\n}\n\nfunction hqr2(nn, e, d, V, H) {\n let n = nn - 1;\n let low = 0;\n let high = nn - 1;\n let eps = Number.EPSILON;\n let exshift = 0;\n let norm = 0;\n let p = 0;\n let q = 0;\n let r = 0;\n let s = 0;\n let z = 0;\n let iter = 0;\n let i, j, k, l, m, t, w, x, y;\n let ra, sa, vr, vi;\n let notlast, cdivres;\n\n for (i = 0; i < nn; i++) {\n if (i < low || i > high) {\n d[i] = H.get(i, i);\n e[i] = 0;\n }\n\n for (j = Math.max(i - 1, 0); j < nn; j++) {\n norm = norm + Math.abs(H.get(i, j));\n }\n }\n\n while (n >= low) {\n l = n;\n while (l > low) {\n s = Math.abs(H.get(l - 1, l - 1)) + Math.abs(H.get(l, l));\n if (s === 0) {\n s = norm;\n }\n if (Math.abs(H.get(l, l - 1)) < eps * s) {\n break;\n }\n l--;\n }\n\n if (l === n) {\n H.set(n, n, H.get(n, n) + exshift);\n d[n] = H.get(n, n);\n e[n] = 0;\n n--;\n iter = 0;\n } else if (l === n - 1) {\n w = H.get(n, n - 1) * H.get(n - 1, n);\n p = (H.get(n - 1, n - 1) - H.get(n, n)) / 2;\n q = p * p + w;\n z = Math.sqrt(Math.abs(q));\n H.set(n, n, H.get(n, n) + exshift);\n H.set(n - 1, n - 1, H.get(n - 1, n - 1) + exshift);\n x = H.get(n, n);\n\n if (q >= 0) {\n z = p >= 0 ? p + z : p - z;\n d[n - 1] = x + z;\n d[n] = d[n - 1];\n if (z !== 0) {\n d[n] = x - w / z;\n }\n e[n - 1] = 0;\n e[n] = 0;\n x = H.get(n, n - 1);\n s = Math.abs(x) + Math.abs(z);\n p = x / s;\n q = z / s;\n r = Math.sqrt(p * p + q * q);\n p = p / r;\n q = q / r;\n\n for (j = n - 1; j < nn; j++) {\n z = H.get(n - 1, j);\n H.set(n - 1, j, q * z + p * H.get(n, j));\n H.set(n, j, q * H.get(n, j) - p * z);\n }\n\n for (i = 0; i <= n; i++) {\n z = H.get(i, n - 1);\n H.set(i, n - 1, q * z + p * H.get(i, n));\n H.set(i, n, q * H.get(i, n) - p * z);\n }\n\n for (i = low; i <= high; i++) {\n z = V.get(i, n - 1);\n V.set(i, n - 1, q * z + p * V.get(i, n));\n V.set(i, n, q * V.get(i, n) - p * z);\n }\n } else {\n d[n - 1] = x + p;\n d[n] = x + p;\n e[n - 1] = z;\n e[n] = -z;\n }\n\n n = n - 2;\n iter = 0;\n } else {\n x = H.get(n, n);\n y = 0;\n w = 0;\n if (l < n) {\n y = H.get(n - 1, n - 1);\n w = H.get(n, n - 1) * H.get(n - 1, n);\n }\n\n if (iter === 10) {\n exshift += x;\n for (i = low; i <= n; i++) {\n H.set(i, i, H.get(i, i) - x);\n }\n s = Math.abs(H.get(n, n - 1)) + Math.abs(H.get(n - 1, n - 2));\n x = y = 0.75 * s;\n w = -0.4375 * s * s;\n }\n\n if (iter === 30) {\n s = (y - x) / 2;\n s = s * s + w;\n if (s > 0) {\n s = Math.sqrt(s);\n if (y < x) {\n s = -s;\n }\n s = x - w / ((y - x) / 2 + s);\n for (i = low; i <= n; i++) {\n H.set(i, i, H.get(i, i) - s);\n }\n exshift += s;\n x = y = w = 0.964;\n }\n }\n\n iter = iter + 1;\n\n m = n - 2;\n while (m >= l) {\n z = H.get(m, m);\n r = x - z;\n s = y - z;\n p = (r * s - w) / H.get(m + 1, m) + H.get(m, m + 1);\n q = H.get(m + 1, m + 1) - z - r - s;\n r = H.get(m + 2, m + 1);\n s = Math.abs(p) + Math.abs(q) + Math.abs(r);\n p = p / s;\n q = q / s;\n r = r / s;\n if (m === l) {\n break;\n }\n if (\n Math.abs(H.get(m, m - 1)) * (Math.abs(q) + Math.abs(r)) <\n eps *\n (Math.abs(p) *\n (Math.abs(H.get(m - 1, m - 1)) +\n Math.abs(z) +\n Math.abs(H.get(m + 1, m + 1))))\n ) {\n break;\n }\n m--;\n }\n\n for (i = m + 2; i <= n; i++) {\n H.set(i, i - 2, 0);\n if (i > m + 2) {\n H.set(i, i - 3, 0);\n }\n }\n\n for (k = m; k <= n - 1; k++) {\n notlast = k !== n - 1;\n if (k !== m) {\n p = H.get(k, k - 1);\n q = H.get(k + 1, k - 1);\n r = notlast ? H.get(k + 2, k - 1) : 0;\n x = Math.abs(p) + Math.abs(q) + Math.abs(r);\n if (x !== 0) {\n p = p / x;\n q = q / x;\n r = r / x;\n }\n }\n\n if (x === 0) {\n break;\n }\n\n s = Math.sqrt(p * p + q * q + r * r);\n if (p < 0) {\n s = -s;\n }\n\n if (s !== 0) {\n if (k !== m) {\n H.set(k, k - 1, -s * x);\n } else if (l !== m) {\n H.set(k, k - 1, -H.get(k, k - 1));\n }\n\n p = p + s;\n x = p / s;\n y = q / s;\n z = r / s;\n q = q / p;\n r = r / p;\n\n for (j = k; j < nn; j++) {\n p = H.get(k, j) + q * H.get(k + 1, j);\n if (notlast) {\n p = p + r * H.get(k + 2, j);\n H.set(k + 2, j, H.get(k + 2, j) - p * z);\n }\n\n H.set(k, j, H.get(k, j) - p * x);\n H.set(k + 1, j, H.get(k + 1, j) - p * y);\n }\n\n for (i = 0; i <= Math.min(n, k + 3); i++) {\n p = x * H.get(i, k) + y * H.get(i, k + 1);\n if (notlast) {\n p = p + z * H.get(i, k + 2);\n H.set(i, k + 2, H.get(i, k + 2) - p * r);\n }\n\n H.set(i, k, H.get(i, k) - p);\n H.set(i, k + 1, H.get(i, k + 1) - p * q);\n }\n\n for (i = low; i <= high; i++) {\n p = x * V.get(i, k) + y * V.get(i, k + 1);\n if (notlast) {\n p = p + z * V.get(i, k + 2);\n V.set(i, k + 2, V.get(i, k + 2) - p * r);\n }\n\n V.set(i, k, V.get(i, k) - p);\n V.set(i, k + 1, V.get(i, k + 1) - p * q);\n }\n }\n }\n }\n }\n\n if (norm === 0) {\n return;\n }\n\n for (n = nn - 1; n >= 0; n--) {\n p = d[n];\n q = e[n];\n\n if (q === 0) {\n l = n;\n H.set(n, n, 1);\n for (i = n - 1; i >= 0; i--) {\n w = H.get(i, i) - p;\n r = 0;\n for (j = l; j <= n; j++) {\n r = r + H.get(i, j) * H.get(j, n);\n }\n\n if (e[i] < 0) {\n z = w;\n s = r;\n } else {\n l = i;\n if (e[i] === 0) {\n H.set(i, n, w !== 0 ? -r / w : -r / (eps * norm));\n } else {\n x = H.get(i, i + 1);\n y = H.get(i + 1, i);\n q = (d[i] - p) * (d[i] - p) + e[i] * e[i];\n t = (x * s - z * r) / q;\n H.set(i, n, t);\n H.set(\n i + 1,\n n,\n Math.abs(x) > Math.abs(z) ? (-r - w * t) / x : (-s - y * t) / z,\n );\n }\n\n t = Math.abs(H.get(i, n));\n if (eps * t * t > 1) {\n for (j = i; j <= n; j++) {\n H.set(j, n, H.get(j, n) / t);\n }\n }\n }\n }\n } else if (q < 0) {\n l = n - 1;\n\n if (Math.abs(H.get(n, n - 1)) > Math.abs(H.get(n - 1, n))) {\n H.set(n - 1, n - 1, q / H.get(n, n - 1));\n H.set(n - 1, n, -(H.get(n, n) - p) / H.get(n, n - 1));\n } else {\n cdivres = cdiv(0, -H.get(n - 1, n), H.get(n - 1, n - 1) - p, q);\n H.set(n - 1, n - 1, cdivres[0]);\n H.set(n - 1, n, cdivres[1]);\n }\n\n H.set(n, n - 1, 0);\n H.set(n, n, 1);\n for (i = n - 2; i >= 0; i--) {\n ra = 0;\n sa = 0;\n for (j = l; j <= n; j++) {\n ra = ra + H.get(i, j) * H.get(j, n - 1);\n sa = sa + H.get(i, j) * H.get(j, n);\n }\n\n w = H.get(i, i) - p;\n\n if (e[i] < 0) {\n z = w;\n r = ra;\n s = sa;\n } else {\n l = i;\n if (e[i] === 0) {\n cdivres = cdiv(-ra, -sa, w, q);\n H.set(i, n - 1, cdivres[0]);\n H.set(i, n, cdivres[1]);\n } else {\n x = H.get(i, i + 1);\n y = H.get(i + 1, i);\n vr = (d[i] - p) * (d[i] - p) + e[i] * e[i] - q * q;\n vi = (d[i] - p) * 2 * q;\n if (vr === 0 && vi === 0) {\n vr =\n eps *\n norm *\n (Math.abs(w) +\n Math.abs(q) +\n Math.abs(x) +\n Math.abs(y) +\n Math.abs(z));\n }\n cdivres = cdiv(\n x * r - z * ra + q * sa,\n x * s - z * sa - q * ra,\n vr,\n vi,\n );\n H.set(i, n - 1, cdivres[0]);\n H.set(i, n, cdivres[1]);\n if (Math.abs(x) > Math.abs(z) + Math.abs(q)) {\n H.set(\n i + 1,\n n - 1,\n (-ra - w * H.get(i, n - 1) + q * H.get(i, n)) / x,\n );\n H.set(\n i + 1,\n n,\n (-sa - w * H.get(i, n) - q * H.get(i, n - 1)) / x,\n );\n } else {\n cdivres = cdiv(\n -r - y * H.get(i, n - 1),\n -s - y * H.get(i, n),\n z,\n q,\n );\n H.set(i + 1, n - 1, cdivres[0]);\n H.set(i + 1, n, cdivres[1]);\n }\n }\n\n t = Math.max(Math.abs(H.get(i, n - 1)), Math.abs(H.get(i, n)));\n if (eps * t * t > 1) {\n for (j = i; j <= n; j++) {\n H.set(j, n - 1, H.get(j, n - 1) / t);\n H.set(j, n, H.get(j, n) / t);\n }\n }\n }\n }\n }\n }\n\n for (i = 0; i < nn; i++) {\n if (i < low || i > high) {\n for (j = i; j < nn; j++) {\n V.set(i, j, H.get(i, j));\n }\n }\n }\n\n for (j = nn - 1; j >= low; j--) {\n for (i = low; i <= high; i++) {\n z = 0;\n for (k = low; k <= Math.min(j, high); k++) {\n z = z + V.get(i, k) * H.get(k, j);\n }\n V.set(i, j, z);\n }\n }\n}\n\nfunction cdiv(xr, xi, yr, yi) {\n let r, d;\n if (Math.abs(yr) > Math.abs(yi)) {\n r = yi / yr;\n d = yr + r * yi;\n return [(xr + r * xi) / d, (xi - r * xr) / d];\n } else {\n r = yr / yi;\n d = yi + r * yr;\n return [(r * xr + xi) / d, (r * xi - xr) / d];\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/dc/evd.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat4\", function() { return fromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat2d\", function() { return fromMat2d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat\", function() { return fromQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalFromMat4\", function() { return normalFromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"projection\", function() { return projection; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 3x3 Matrix\n * @module mat3\n */\n\n/**\n * Creates a new identity mat3\n *\n * @returns {mat3} a new 3x3 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n }\n\n out[0] = 1;\n out[4] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the upper-left 3x3 values into the given mat3.\n *\n * @param {mat3} out the receiving 3x3 matrix\n * @param {ReadonlyMat4} a the source 4x4 matrix\n * @returns {mat3} out\n */\n\nfunction fromMat4(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[4];\n out[4] = a[5];\n out[5] = a[6];\n out[6] = a[8];\n out[7] = a[9];\n out[8] = a[10];\n return out;\n}\n/**\n * Creates a new mat3 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat3} a matrix to clone\n * @returns {mat3} a new 3x3 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Copy the values from one mat3 to another\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Create a new mat3 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} A new mat3\n */\n\nfunction fromValues(m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](9);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set the components of a mat3 to the given values\n *\n * @param {mat3} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m10 Component in column 1, row 0 position (index 3)\n * @param {Number} m11 Component in column 1, row 1 position (index 4)\n * @param {Number} m12 Component in column 1, row 2 position (index 5)\n * @param {Number} m20 Component in column 2, row 0 position (index 6)\n * @param {Number} m21 Component in column 2, row 1 position (index 7)\n * @param {Number} m22 Component in column 2, row 2 position (index 8)\n * @returns {mat3} out\n */\n\nfunction set(out, m00, m01, m02, m10, m11, m12, m20, m21, m22) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m10;\n out[4] = m11;\n out[5] = m12;\n out[6] = m20;\n out[7] = m21;\n out[8] = m22;\n return out;\n}\n/**\n * Set a mat3 to the identity matrix\n *\n * @param {mat3} out the receiving matrix\n * @returns {mat3} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a12 = a[5];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a01;\n out[5] = a[7];\n out[6] = a02;\n out[7] = a12;\n } else {\n out[0] = a[0];\n out[1] = a[3];\n out[2] = a[6];\n out[3] = a[1];\n out[4] = a[4];\n out[5] = a[7];\n out[6] = a[2];\n out[7] = a[5];\n out[8] = a[8];\n }\n\n return out;\n}\n/**\n * Inverts a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b01 = a22 * a11 - a12 * a21;\n var b11 = -a22 * a10 + a12 * a20;\n var b21 = a21 * a10 - a11 * a20; // Calculate the determinant\n\n var det = a00 * b01 + a01 * b11 + a02 * b21;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = b01 * det;\n out[1] = (-a22 * a01 + a02 * a21) * det;\n out[2] = (a12 * a01 - a02 * a11) * det;\n out[3] = b11 * det;\n out[4] = (a22 * a00 - a02 * a20) * det;\n out[5] = (-a12 * a00 + a02 * a10) * det;\n out[6] = b21 * det;\n out[7] = (-a21 * a00 + a01 * a20) * det;\n out[8] = (a11 * a00 - a01 * a10) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the source matrix\n * @returns {mat3} out\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n out[0] = a11 * a22 - a12 * a21;\n out[1] = a02 * a21 - a01 * a22;\n out[2] = a01 * a12 - a02 * a11;\n out[3] = a12 * a20 - a10 * a22;\n out[4] = a00 * a22 - a02 * a20;\n out[5] = a02 * a10 - a00 * a12;\n out[6] = a10 * a21 - a11 * a20;\n out[7] = a01 * a20 - a00 * a21;\n out[8] = a00 * a11 - a01 * a10;\n return out;\n}\n/**\n * Calculates the determinant of a mat3\n *\n * @param {ReadonlyMat3} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n return a00 * (a22 * a11 - a12 * a21) + a01 * (-a22 * a10 + a12 * a20) + a02 * (a21 * a10 - a11 * a20);\n}\n/**\n * Multiplies two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2];\n var a10 = a[3],\n a11 = a[4],\n a12 = a[5];\n var a20 = a[6],\n a21 = a[7],\n a22 = a[8];\n var b00 = b[0],\n b01 = b[1],\n b02 = b[2];\n var b10 = b[3],\n b11 = b[4],\n b12 = b[5];\n var b20 = b[6],\n b21 = b[7],\n b22 = b[8];\n out[0] = b00 * a00 + b01 * a10 + b02 * a20;\n out[1] = b00 * a01 + b01 * a11 + b02 * a21;\n out[2] = b00 * a02 + b01 * a12 + b02 * a22;\n out[3] = b10 * a00 + b11 * a10 + b12 * a20;\n out[4] = b10 * a01 + b11 * a11 + b12 * a21;\n out[5] = b10 * a02 + b11 * a12 + b12 * a22;\n out[6] = b20 * a00 + b21 * a10 + b22 * a20;\n out[7] = b20 * a01 + b21 * a11 + b22 * a21;\n out[8] = b20 * a02 + b21 * a12 + b22 * a22;\n return out;\n}\n/**\n * Translate a mat3 by the given vector\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to translate\n * @param {ReadonlyVec2} v vector to translate by\n * @returns {mat3} out\n */\n\nfunction translate(out, a, v) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n x = v[0],\n y = v[1];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a10;\n out[4] = a11;\n out[5] = a12;\n out[6] = x * a00 + y * a10 + a20;\n out[7] = x * a01 + y * a11 + a21;\n out[8] = x * a02 + y * a12 + a22;\n return out;\n}\n/**\n * Rotates a mat3 by the given angle\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nfunction rotate(out, a, rad) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a10 = a[3],\n a11 = a[4],\n a12 = a[5],\n a20 = a[6],\n a21 = a[7],\n a22 = a[8],\n s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c * a00 + s * a10;\n out[1] = c * a01 + s * a11;\n out[2] = c * a02 + s * a12;\n out[3] = c * a10 - s * a00;\n out[4] = c * a11 - s * a01;\n out[5] = c * a12 - s * a02;\n out[6] = a20;\n out[7] = a21;\n out[8] = a22;\n return out;\n}\n/**\n * Scales the mat3 by the dimensions in the given vec2\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to rotate\n * @param {ReadonlyVec2} v the vec2 to scale the matrix by\n * @returns {mat3} out\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1];\n out[0] = x * a[0];\n out[1] = x * a[1];\n out[2] = x * a[2];\n out[3] = y * a[3];\n out[4] = y * a[4];\n out[5] = y * a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.translate(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Translation vector\n * @returns {mat3} out\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 1;\n out[5] = 0;\n out[6] = v[0];\n out[7] = v[1];\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.rotate(dest, dest, rad);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat3} out\n */\n\nfunction fromRotation(out, rad) {\n var s = Math.sin(rad),\n c = Math.cos(rad);\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = -s;\n out[4] = c;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat3.identity(dest);\n * mat3.scale(dest, dest, vec);\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyVec2} v Scaling vector\n * @returns {mat3} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = v[1];\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 1;\n return out;\n}\n/**\n * Copies the values from a mat2d into a mat3\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat2d} a the matrix to copy\n * @returns {mat3} out\n **/\n\nfunction fromMat2d(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = 0;\n out[3] = a[2];\n out[4] = a[3];\n out[5] = 0;\n out[6] = a[4];\n out[7] = a[5];\n out[8] = 1;\n return out;\n}\n/**\n * Calculates a 3x3 matrix from the given quaternion\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat3} out\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[3] = yx - wz;\n out[6] = zx + wy;\n out[1] = yx + wz;\n out[4] = 1 - xx - zz;\n out[7] = zy - wx;\n out[2] = zx - wy;\n out[5] = zy + wx;\n out[8] = 1 - xx - yy;\n return out;\n}\n/**\n * Calculates a 3x3 normal matrix (transpose inverse) from the 4x4 matrix\n *\n * @param {mat3} out mat3 receiving operation result\n * @param {ReadonlyMat4} a Mat4 to derive the normal matrix from\n *\n * @returns {mat3} out\n */\n\nfunction normalFromMat4(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[2] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[3] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[4] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[5] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[6] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[7] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[8] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n return out;\n}\n/**\n * Generates a 2D projection matrix with the given bounds\n *\n * @param {mat3} out mat3 frustum matrix will be written into\n * @param {number} width Width of your gl context\n * @param {number} height Height of gl context\n * @returns {mat3} out\n */\n\nfunction projection(out, width, height) {\n out[0] = 2 / width;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = -2 / height;\n out[5] = 0;\n out[6] = -1;\n out[7] = 1;\n out[8] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat3\n *\n * @param {ReadonlyMat3} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat3\n *\n * @param {ReadonlyMat3} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8]);\n}\n/**\n * Adds two mat3's\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @returns {mat3} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat3} out the receiving matrix\n * @param {ReadonlyMat3} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat3} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n return out;\n}\n/**\n * Adds two mat3's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat3} out the receiving vector\n * @param {ReadonlyMat3} a the first operand\n * @param {ReadonlyMat3} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat3} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat3} a The first matrix.\n * @param {ReadonlyMat3} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7],\n a8 = a[8];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7],\n b8 = b[8];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a8), Math.abs(b8));\n}\n/**\n * Alias for {@link mat3.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat3.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/mat3.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/dc/lu.js": -/*!*********************************************!*\ - !*** ./node_modules/ml-matrix/src/dc/lu.js ***! - \*********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/gl-matrix/esm/mat4.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/mat4.js ***! + \********************************************/ +/*! exports provided: create, clone, copy, fromValues, set, identity, transpose, invert, adjoint, determinant, multiply, translate, scale, rotate, rotateX, rotateY, rotateZ, fromTranslation, fromScaling, fromRotation, fromXRotation, fromYRotation, fromZRotation, fromRotationTranslation, fromQuat2, getTranslation, getScaling, getRotation, fromRotationTranslationScale, fromRotationTranslationScaleOrigin, fromQuat, frustum, perspectiveNO, perspective, perspectiveZO, perspectiveFromFieldOfView, orthoNO, ortho, orthoZO, lookAt, targetTo, str, frob, add, subtract, multiplyScalar, multiplyScalarAndAdd, exactEquals, equals, mul, sub */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return LuDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\nclass LuDecomposition {\n constructor(matrix) {\n matrix = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n\n let lu = matrix.clone();\n let rows = lu.rows;\n let columns = lu.columns;\n let pivotVector = new Float64Array(rows);\n let pivotSign = 1;\n let i, j, k, p, s, t, v;\n let LUcolj, kmax;\n\n for (i = 0; i < rows; i++) {\n pivotVector[i] = i;\n }\n\n LUcolj = new Float64Array(rows);\n\n for (j = 0; j < columns; j++) {\n for (i = 0; i < rows; i++) {\n LUcolj[i] = lu.get(i, j);\n }\n\n for (i = 0; i < rows; i++) {\n kmax = Math.min(i, j);\n s = 0;\n for (k = 0; k < kmax; k++) {\n s += lu.get(i, k) * LUcolj[k];\n }\n LUcolj[i] -= s;\n lu.set(i, j, LUcolj[i]);\n }\n\n p = j;\n for (i = j + 1; i < rows; i++) {\n if (Math.abs(LUcolj[i]) > Math.abs(LUcolj[p])) {\n p = i;\n }\n }\n\n if (p !== j) {\n for (k = 0; k < columns; k++) {\n t = lu.get(p, k);\n lu.set(p, k, lu.get(j, k));\n lu.set(j, k, t);\n }\n\n v = pivotVector[p];\n pivotVector[p] = pivotVector[j];\n pivotVector[j] = v;\n\n pivotSign = -pivotSign;\n }\n\n if (j < rows && lu.get(j, j) !== 0) {\n for (i = j + 1; i < rows; i++) {\n lu.set(i, j, lu.get(i, j) / lu.get(j, j));\n }\n }\n }\n\n this.LU = lu;\n this.pivotVector = pivotVector;\n this.pivotSign = pivotSign;\n }\n\n isSingular() {\n let data = this.LU;\n let col = data.columns;\n for (let j = 0; j < col; j++) {\n if (data.get(j, j) === 0) {\n return true;\n }\n }\n return false;\n }\n\n solve(value) {\n value = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].checkMatrix(value);\n\n let lu = this.LU;\n let rows = lu.rows;\n\n if (rows !== value.rows) {\n throw new Error('Invalid matrix dimensions');\n }\n if (this.isSingular()) {\n throw new Error('LU matrix is singular');\n }\n\n let count = value.columns;\n let X = value.subMatrixRow(this.pivotVector, 0, count - 1);\n let columns = lu.columns;\n let i, j, k;\n\n for (k = 0; k < columns; k++) {\n for (i = k + 1; i < columns; i++) {\n for (j = 0; j < count; j++) {\n X.set(i, j, X.get(i, j) - X.get(k, j) * lu.get(i, k));\n }\n }\n }\n for (k = columns - 1; k >= 0; k--) {\n for (j = 0; j < count; j++) {\n X.set(k, j, X.get(k, j) / lu.get(k, k));\n }\n for (i = 0; i < k; i++) {\n for (j = 0; j < count; j++) {\n X.set(i, j, X.get(i, j) - X.get(k, j) * lu.get(i, k));\n }\n }\n }\n return X;\n }\n\n get determinant() {\n let data = this.LU;\n if (!data.isSquare()) {\n throw new Error('Matrix must be square');\n }\n let determinant = this.pivotSign;\n let col = data.columns;\n for (let j = 0; j < col; j++) {\n determinant *= data.get(j, j);\n }\n return determinant;\n }\n\n get lowerTriangularMatrix() {\n let data = this.LU;\n let rows = data.rows;\n let columns = data.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n if (i > j) {\n X.set(i, j, data.get(i, j));\n } else if (i === j) {\n X.set(i, j, 1);\n } else {\n X.set(i, j, 0);\n }\n }\n }\n return X;\n }\n\n get upperTriangularMatrix() {\n let data = this.LU;\n let rows = data.rows;\n let columns = data.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n if (i <= j) {\n X.set(i, j, data.get(i, j));\n } else {\n X.set(i, j, 0);\n }\n }\n }\n return X;\n }\n\n get pivotPermutationVector() {\n return Array.from(this.pivotVector);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/dc/lu.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transpose\", function() { return transpose; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"adjoint\", function() { return adjoint; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromScaling\", function() { return fromScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromXRotation\", function() { return fromXRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromYRotation\", function() { return fromYRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromZRotation\", function() { return fromZRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslation\", function() { return fromRotationTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat2\", function() { return fromQuat2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTranslation\", function() { return getTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaling\", function() { return getScaling; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getRotation\", function() { return getRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationScale\", function() { return fromRotationTranslationScale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationScaleOrigin\", function() { return fromRotationTranslationScaleOrigin; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromQuat\", function() { return fromQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frustum\", function() { return frustum; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspectiveNO\", function() { return perspectiveNO; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspective\", function() { return perspective; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspectiveZO\", function() { return perspectiveZO; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"perspectiveFromFieldOfView\", function() { return perspectiveFromFieldOfView; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orthoNO\", function() { return orthoNO; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ortho\", function() { return ortho; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"orthoZO\", function() { return orthoZO; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lookAt\", function() { return lookAt; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"targetTo\", function() { return targetTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"frob\", function() { return frob; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalar\", function() { return multiplyScalar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiplyScalarAndAdd\", function() { return multiplyScalarAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 4x4 Matrix
Format: column-major, when typed out it looks like row-major
The matrices are being post multiplied.\n * @module mat4\n */\n\n/**\n * Creates a new identity mat4\n *\n * @returns {mat4} a new 4x4 matrix\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n }\n\n out[0] = 1;\n out[5] = 1;\n out[10] = 1;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 initialized with values from an existing matrix\n *\n * @param {ReadonlyMat4} a matrix to clone\n * @returns {mat4} a new 4x4 matrix\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Copy the values from one mat4 to another\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Create a new mat4 with the given values\n *\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} A new mat4\n */\n\nfunction fromValues(m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](16);\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set the components of a mat4 to the given values\n *\n * @param {mat4} out the receiving matrix\n * @param {Number} m00 Component in column 0, row 0 position (index 0)\n * @param {Number} m01 Component in column 0, row 1 position (index 1)\n * @param {Number} m02 Component in column 0, row 2 position (index 2)\n * @param {Number} m03 Component in column 0, row 3 position (index 3)\n * @param {Number} m10 Component in column 1, row 0 position (index 4)\n * @param {Number} m11 Component in column 1, row 1 position (index 5)\n * @param {Number} m12 Component in column 1, row 2 position (index 6)\n * @param {Number} m13 Component in column 1, row 3 position (index 7)\n * @param {Number} m20 Component in column 2, row 0 position (index 8)\n * @param {Number} m21 Component in column 2, row 1 position (index 9)\n * @param {Number} m22 Component in column 2, row 2 position (index 10)\n * @param {Number} m23 Component in column 2, row 3 position (index 11)\n * @param {Number} m30 Component in column 3, row 0 position (index 12)\n * @param {Number} m31 Component in column 3, row 1 position (index 13)\n * @param {Number} m32 Component in column 3, row 2 position (index 14)\n * @param {Number} m33 Component in column 3, row 3 position (index 15)\n * @returns {mat4} out\n */\n\nfunction set(out, m00, m01, m02, m03, m10, m11, m12, m13, m20, m21, m22, m23, m30, m31, m32, m33) {\n out[0] = m00;\n out[1] = m01;\n out[2] = m02;\n out[3] = m03;\n out[4] = m10;\n out[5] = m11;\n out[6] = m12;\n out[7] = m13;\n out[8] = m20;\n out[9] = m21;\n out[10] = m22;\n out[11] = m23;\n out[12] = m30;\n out[13] = m31;\n out[14] = m32;\n out[15] = m33;\n return out;\n}\n/**\n * Set a mat4 to the identity matrix\n *\n * @param {mat4} out the receiving matrix\n * @returns {mat4} out\n */\n\nfunction identity(out) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Transpose the values of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction transpose(out, a) {\n // If we are transposing ourselves we can skip a few steps but have to cache some values\n if (out === a) {\n var a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a12 = a[6],\n a13 = a[7];\n var a23 = a[11];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a01;\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a02;\n out[9] = a12;\n out[11] = a[14];\n out[12] = a03;\n out[13] = a13;\n out[14] = a23;\n } else {\n out[0] = a[0];\n out[1] = a[4];\n out[2] = a[8];\n out[3] = a[12];\n out[4] = a[1];\n out[5] = a[5];\n out[6] = a[9];\n out[7] = a[13];\n out[8] = a[2];\n out[9] = a[6];\n out[10] = a[10];\n out[11] = a[14];\n out[12] = a[3];\n out[13] = a[7];\n out[14] = a[11];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Inverts a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction invert(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n var det = b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n\n if (!det) {\n return null;\n }\n\n det = 1.0 / det;\n out[0] = (a11 * b11 - a12 * b10 + a13 * b09) * det;\n out[1] = (a02 * b10 - a01 * b11 - a03 * b09) * det;\n out[2] = (a31 * b05 - a32 * b04 + a33 * b03) * det;\n out[3] = (a22 * b04 - a21 * b05 - a23 * b03) * det;\n out[4] = (a12 * b08 - a10 * b11 - a13 * b07) * det;\n out[5] = (a00 * b11 - a02 * b08 + a03 * b07) * det;\n out[6] = (a32 * b02 - a30 * b05 - a33 * b01) * det;\n out[7] = (a20 * b05 - a22 * b02 + a23 * b01) * det;\n out[8] = (a10 * b10 - a11 * b08 + a13 * b06) * det;\n out[9] = (a01 * b08 - a00 * b10 - a03 * b06) * det;\n out[10] = (a30 * b04 - a31 * b02 + a33 * b00) * det;\n out[11] = (a21 * b02 - a20 * b04 - a23 * b00) * det;\n out[12] = (a11 * b07 - a10 * b09 - a12 * b06) * det;\n out[13] = (a00 * b09 - a01 * b07 + a02 * b06) * det;\n out[14] = (a31 * b01 - a30 * b03 - a32 * b00) * det;\n out[15] = (a20 * b03 - a21 * b01 + a22 * b00) * det;\n return out;\n}\n/**\n * Calculates the adjugate of a mat4\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the source matrix\n * @returns {mat4} out\n */\n\nfunction adjoint(out, a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n out[0] = a11 * (a22 * a33 - a23 * a32) - a21 * (a12 * a33 - a13 * a32) + a31 * (a12 * a23 - a13 * a22);\n out[1] = -(a01 * (a22 * a33 - a23 * a32) - a21 * (a02 * a33 - a03 * a32) + a31 * (a02 * a23 - a03 * a22));\n out[2] = a01 * (a12 * a33 - a13 * a32) - a11 * (a02 * a33 - a03 * a32) + a31 * (a02 * a13 - a03 * a12);\n out[3] = -(a01 * (a12 * a23 - a13 * a22) - a11 * (a02 * a23 - a03 * a22) + a21 * (a02 * a13 - a03 * a12));\n out[4] = -(a10 * (a22 * a33 - a23 * a32) - a20 * (a12 * a33 - a13 * a32) + a30 * (a12 * a23 - a13 * a22));\n out[5] = a00 * (a22 * a33 - a23 * a32) - a20 * (a02 * a33 - a03 * a32) + a30 * (a02 * a23 - a03 * a22);\n out[6] = -(a00 * (a12 * a33 - a13 * a32) - a10 * (a02 * a33 - a03 * a32) + a30 * (a02 * a13 - a03 * a12));\n out[7] = a00 * (a12 * a23 - a13 * a22) - a10 * (a02 * a23 - a03 * a22) + a20 * (a02 * a13 - a03 * a12);\n out[8] = a10 * (a21 * a33 - a23 * a31) - a20 * (a11 * a33 - a13 * a31) + a30 * (a11 * a23 - a13 * a21);\n out[9] = -(a00 * (a21 * a33 - a23 * a31) - a20 * (a01 * a33 - a03 * a31) + a30 * (a01 * a23 - a03 * a21));\n out[10] = a00 * (a11 * a33 - a13 * a31) - a10 * (a01 * a33 - a03 * a31) + a30 * (a01 * a13 - a03 * a11);\n out[11] = -(a00 * (a11 * a23 - a13 * a21) - a10 * (a01 * a23 - a03 * a21) + a20 * (a01 * a13 - a03 * a11));\n out[12] = -(a10 * (a21 * a32 - a22 * a31) - a20 * (a11 * a32 - a12 * a31) + a30 * (a11 * a22 - a12 * a21));\n out[13] = a00 * (a21 * a32 - a22 * a31) - a20 * (a01 * a32 - a02 * a31) + a30 * (a01 * a22 - a02 * a21);\n out[14] = -(a00 * (a11 * a32 - a12 * a31) - a10 * (a01 * a32 - a02 * a31) + a30 * (a01 * a12 - a02 * a11));\n out[15] = a00 * (a11 * a22 - a12 * a21) - a10 * (a01 * a22 - a02 * a21) + a20 * (a01 * a12 - a02 * a11);\n return out;\n}\n/**\n * Calculates the determinant of a mat4\n *\n * @param {ReadonlyMat4} a the source matrix\n * @returns {Number} determinant of a\n */\n\nfunction determinant(a) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15];\n var b00 = a00 * a11 - a01 * a10;\n var b01 = a00 * a12 - a02 * a10;\n var b02 = a00 * a13 - a03 * a10;\n var b03 = a01 * a12 - a02 * a11;\n var b04 = a01 * a13 - a03 * a11;\n var b05 = a02 * a13 - a03 * a12;\n var b06 = a20 * a31 - a21 * a30;\n var b07 = a20 * a32 - a22 * a30;\n var b08 = a20 * a33 - a23 * a30;\n var b09 = a21 * a32 - a22 * a31;\n var b10 = a21 * a33 - a23 * a31;\n var b11 = a22 * a33 - a23 * a32; // Calculate the determinant\n\n return b00 * b11 - b01 * b10 + b02 * b09 + b03 * b08 - b04 * b07 + b05 * b06;\n}\n/**\n * Multiplies two mat4s\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction multiply(out, a, b) {\n var a00 = a[0],\n a01 = a[1],\n a02 = a[2],\n a03 = a[3];\n var a10 = a[4],\n a11 = a[5],\n a12 = a[6],\n a13 = a[7];\n var a20 = a[8],\n a21 = a[9],\n a22 = a[10],\n a23 = a[11];\n var a30 = a[12],\n a31 = a[13],\n a32 = a[14],\n a33 = a[15]; // Cache only the current line of the second matrix\n\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n out[0] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[1] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[2] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[3] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[4];\n b1 = b[5];\n b2 = b[6];\n b3 = b[7];\n out[4] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[5] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[6] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[7] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[8];\n b1 = b[9];\n b2 = b[10];\n b3 = b[11];\n out[8] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[9] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[10] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[11] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n b0 = b[12];\n b1 = b[13];\n b2 = b[14];\n b3 = b[15];\n out[12] = b0 * a00 + b1 * a10 + b2 * a20 + b3 * a30;\n out[13] = b0 * a01 + b1 * a11 + b2 * a21 + b3 * a31;\n out[14] = b0 * a02 + b1 * a12 + b2 * a22 + b3 * a32;\n out[15] = b0 * a03 + b1 * a13 + b2 * a23 + b3 * a33;\n return out;\n}\n/**\n * Translate a mat4 by the given vector\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {mat4} out\n */\n\nfunction translate(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n\n if (a === out) {\n out[12] = a[0] * x + a[4] * y + a[8] * z + a[12];\n out[13] = a[1] * x + a[5] * y + a[9] * z + a[13];\n out[14] = a[2] * x + a[6] * y + a[10] * z + a[14];\n out[15] = a[3] * x + a[7] * y + a[11] * z + a[15];\n } else {\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11];\n out[0] = a00;\n out[1] = a01;\n out[2] = a02;\n out[3] = a03;\n out[4] = a10;\n out[5] = a11;\n out[6] = a12;\n out[7] = a13;\n out[8] = a20;\n out[9] = a21;\n out[10] = a22;\n out[11] = a23;\n out[12] = a00 * x + a10 * y + a20 * z + a[12];\n out[13] = a01 * x + a11 * y + a21 * z + a[13];\n out[14] = a02 * x + a12 * y + a22 * z + a[14];\n out[15] = a03 * x + a13 * y + a23 * z + a[15];\n }\n\n return out;\n}\n/**\n * Scales the mat4 by the dimensions in the given vec3 not using vectorization\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {ReadonlyVec3} v the vec3 to scale the matrix by\n * @returns {mat4} out\n **/\n\nfunction scale(out, a, v) {\n var x = v[0],\n y = v[1],\n z = v[2];\n out[0] = a[0] * x;\n out[1] = a[1] * x;\n out[2] = a[2] * x;\n out[3] = a[3] * x;\n out[4] = a[4] * y;\n out[5] = a[5] * y;\n out[6] = a[6] * y;\n out[7] = a[7] * y;\n out[8] = a[8] * z;\n out[9] = a[9] * z;\n out[10] = a[10] * z;\n out[11] = a[11] * z;\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n return out;\n}\n/**\n * Rotates a mat4 by the given angle around the given axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nfunction rotate(out, a, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n var a00, a01, a02, a03;\n var a10, a11, a12, a13;\n var a20, a21, a22, a23;\n var b00, b01, b02;\n var b10, b11, b12;\n var b20, b21, b22;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c;\n a00 = a[0];\n a01 = a[1];\n a02 = a[2];\n a03 = a[3];\n a10 = a[4];\n a11 = a[5];\n a12 = a[6];\n a13 = a[7];\n a20 = a[8];\n a21 = a[9];\n a22 = a[10];\n a23 = a[11]; // Construct the elements of the rotation matrix\n\n b00 = x * x * t + c;\n b01 = y * x * t + z * s;\n b02 = z * x * t - y * s;\n b10 = x * y * t - z * s;\n b11 = y * y * t + c;\n b12 = z * y * t + x * s;\n b20 = x * z * t + y * s;\n b21 = y * z * t - x * s;\n b22 = z * z * t + c; // Perform rotation-specific matrix multiplication\n\n out[0] = a00 * b00 + a10 * b01 + a20 * b02;\n out[1] = a01 * b00 + a11 * b01 + a21 * b02;\n out[2] = a02 * b00 + a12 * b01 + a22 * b02;\n out[3] = a03 * b00 + a13 * b01 + a23 * b02;\n out[4] = a00 * b10 + a10 * b11 + a20 * b12;\n out[5] = a01 * b10 + a11 * b11 + a21 * b12;\n out[6] = a02 * b10 + a12 * b11 + a22 * b12;\n out[7] = a03 * b10 + a13 * b11 + a23 * b12;\n out[8] = a00 * b20 + a10 * b21 + a20 * b22;\n out[9] = a01 * b20 + a11 * b21 + a21 * b22;\n out[10] = a02 * b20 + a12 * b21 + a22 * b22;\n out[11] = a03 * b20 + a13 * b21 + a23 * b22;\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n }\n\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the X axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateX(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[4] = a10 * c + a20 * s;\n out[5] = a11 * c + a21 * s;\n out[6] = a12 * c + a22 * s;\n out[7] = a13 * c + a23 * s;\n out[8] = a20 * c - a10 * s;\n out[9] = a21 * c - a11 * s;\n out[10] = a22 * c - a12 * s;\n out[11] = a23 * c - a13 * s;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Y axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateY(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a20 = a[8];\n var a21 = a[9];\n var a22 = a[10];\n var a23 = a[11];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged rows\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c - a20 * s;\n out[1] = a01 * c - a21 * s;\n out[2] = a02 * c - a22 * s;\n out[3] = a03 * c - a23 * s;\n out[8] = a00 * s + a20 * c;\n out[9] = a01 * s + a21 * c;\n out[10] = a02 * s + a22 * c;\n out[11] = a03 * s + a23 * c;\n return out;\n}\n/**\n * Rotates a matrix by the given angle around the Z axis\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to rotate\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction rotateZ(out, a, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad);\n var a00 = a[0];\n var a01 = a[1];\n var a02 = a[2];\n var a03 = a[3];\n var a10 = a[4];\n var a11 = a[5];\n var a12 = a[6];\n var a13 = a[7];\n\n if (a !== out) {\n // If the source and destination differ, copy the unchanged last row\n out[8] = a[8];\n out[9] = a[9];\n out[10] = a[10];\n out[11] = a[11];\n out[12] = a[12];\n out[13] = a[13];\n out[14] = a[14];\n out[15] = a[15];\n } // Perform axis-specific matrix multiplication\n\n\n out[0] = a00 * c + a10 * s;\n out[1] = a01 * c + a11 * s;\n out[2] = a02 * c + a12 * s;\n out[3] = a03 * c + a13 * s;\n out[4] = a10 * c - a00 * s;\n out[5] = a11 * c - a01 * s;\n out[6] = a12 * c - a02 * s;\n out[7] = a13 * c - a03 * s;\n return out;\n}\n/**\n * Creates a matrix from a vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nfunction fromTranslation(out, v) {\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a vector scaling\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.scale(dest, dest, vec);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyVec3} v Scaling vector\n * @returns {mat4} out\n */\n\nfunction fromScaling(out, v) {\n out[0] = v[0];\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = v[1];\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = v[2];\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a given angle around a given axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotate(dest, dest, rad, axis);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @returns {mat4} out\n */\n\nfunction fromRotation(out, rad, axis) {\n var x = axis[0],\n y = axis[1],\n z = axis[2];\n var len = Math.hypot(x, y, z);\n var s, c, t;\n\n if (len < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return null;\n }\n\n len = 1 / len;\n x *= len;\n y *= len;\n z *= len;\n s = Math.sin(rad);\n c = Math.cos(rad);\n t = 1 - c; // Perform rotation-specific matrix multiplication\n\n out[0] = x * x * t + c;\n out[1] = y * x * t + z * s;\n out[2] = z * x * t - y * s;\n out[3] = 0;\n out[4] = x * y * t - z * s;\n out[5] = y * y * t + c;\n out[6] = z * y * t + x * s;\n out[7] = 0;\n out[8] = x * z * t + y * s;\n out[9] = y * z * t - x * s;\n out[10] = z * z * t + c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the X axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateX(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromXRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = 1;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = c;\n out[6] = s;\n out[7] = 0;\n out[8] = 0;\n out[9] = -s;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Y axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateY(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromYRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = 0;\n out[2] = -s;\n out[3] = 0;\n out[4] = 0;\n out[5] = 1;\n out[6] = 0;\n out[7] = 0;\n out[8] = s;\n out[9] = 0;\n out[10] = c;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from the given angle around the Z axis\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.rotateZ(dest, dest, rad);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {Number} rad the angle to rotate the matrix by\n * @returns {mat4} out\n */\n\nfunction fromZRotation(out, rad) {\n var s = Math.sin(rad);\n var c = Math.cos(rad); // Perform axis-specific matrix multiplication\n\n out[0] = c;\n out[1] = s;\n out[2] = 0;\n out[3] = 0;\n out[4] = -s;\n out[5] = c;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 1;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation and vector translation\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslation(out, q, v) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - (yy + zz);\n out[1] = xy + wz;\n out[2] = xz - wy;\n out[3] = 0;\n out[4] = xy - wz;\n out[5] = 1 - (xx + zz);\n out[6] = yz + wx;\n out[7] = 0;\n out[8] = xz + wy;\n out[9] = yz - wx;\n out[10] = 1 - (xx + yy);\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a new mat4 from a dual quat.\n *\n * @param {mat4} out Matrix\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @returns {mat4} mat4 receiving operation result\n */\n\nfunction fromQuat2(out, a) {\n var translation = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n var magnitude = bx * bx + by * by + bz * bz + bw * bw; //Only scale if it makes sense\n\n if (magnitude > 0) {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2 / magnitude;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2 / magnitude;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2 / magnitude;\n } else {\n translation[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n translation[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n translation[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n }\n\n fromRotationTranslation(out, a, translation);\n return out;\n}\n/**\n * Returns the translation vector component of a transformation\n * matrix. If a matrix is built with fromRotationTranslation,\n * the returned vector will be the same as the translation vector\n * originally supplied.\n * @param {vec3} out Vector to receive translation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nfunction getTranslation(out, mat) {\n out[0] = mat[12];\n out[1] = mat[13];\n out[2] = mat[14];\n return out;\n}\n/**\n * Returns the scaling factor component of a transformation\n * matrix. If a matrix is built with fromRotationTranslationScale\n * with a normalized Quaternion paramter, the returned vector will be\n * the same as the scaling vector\n * originally supplied.\n * @param {vec3} out Vector to receive scaling factor component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {vec3} out\n */\n\nfunction getScaling(out, mat) {\n var m11 = mat[0];\n var m12 = mat[1];\n var m13 = mat[2];\n var m21 = mat[4];\n var m22 = mat[5];\n var m23 = mat[6];\n var m31 = mat[8];\n var m32 = mat[9];\n var m33 = mat[10];\n out[0] = Math.hypot(m11, m12, m13);\n out[1] = Math.hypot(m21, m22, m23);\n out[2] = Math.hypot(m31, m32, m33);\n return out;\n}\n/**\n * Returns a quaternion representing the rotational component\n * of a transformation matrix. If a matrix is built with\n * fromRotationTranslation, the returned quaternion will be the\n * same as the quaternion originally supplied.\n * @param {quat} out Quaternion to receive the rotation component\n * @param {ReadonlyMat4} mat Matrix to be decomposed (input)\n * @return {quat} out\n */\n\nfunction getRotation(out, mat) {\n var scaling = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n getScaling(scaling, mat);\n var is1 = 1 / scaling[0];\n var is2 = 1 / scaling[1];\n var is3 = 1 / scaling[2];\n var sm11 = mat[0] * is1;\n var sm12 = mat[1] * is2;\n var sm13 = mat[2] * is3;\n var sm21 = mat[4] * is1;\n var sm22 = mat[5] * is2;\n var sm23 = mat[6] * is3;\n var sm31 = mat[8] * is1;\n var sm32 = mat[9] * is2;\n var sm33 = mat[10] * is3;\n var trace = sm11 + sm22 + sm33;\n var S = 0;\n\n if (trace > 0) {\n S = Math.sqrt(trace + 1.0) * 2;\n out[3] = 0.25 * S;\n out[0] = (sm23 - sm32) / S;\n out[1] = (sm31 - sm13) / S;\n out[2] = (sm12 - sm21) / S;\n } else if (sm11 > sm22 && sm11 > sm33) {\n S = Math.sqrt(1.0 + sm11 - sm22 - sm33) * 2;\n out[3] = (sm23 - sm32) / S;\n out[0] = 0.25 * S;\n out[1] = (sm12 + sm21) / S;\n out[2] = (sm31 + sm13) / S;\n } else if (sm22 > sm33) {\n S = Math.sqrt(1.0 + sm22 - sm11 - sm33) * 2;\n out[3] = (sm31 - sm13) / S;\n out[0] = (sm12 + sm21) / S;\n out[1] = 0.25 * S;\n out[2] = (sm23 + sm32) / S;\n } else {\n S = Math.sqrt(1.0 + sm33 - sm11 - sm22) * 2;\n out[3] = (sm12 - sm21) / S;\n out[0] = (sm31 + sm13) / S;\n out[1] = (sm23 + sm32) / S;\n out[2] = 0.25 * S;\n }\n\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslationScale(out, q, v, s) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n out[0] = (1 - (yy + zz)) * sx;\n out[1] = (xy + wz) * sx;\n out[2] = (xz - wy) * sx;\n out[3] = 0;\n out[4] = (xy - wz) * sy;\n out[5] = (1 - (xx + zz)) * sy;\n out[6] = (yz + wx) * sy;\n out[7] = 0;\n out[8] = (xz + wy) * sz;\n out[9] = (yz - wx) * sz;\n out[10] = (1 - (xx + yy)) * sz;\n out[11] = 0;\n out[12] = v[0];\n out[13] = v[1];\n out[14] = v[2];\n out[15] = 1;\n return out;\n}\n/**\n * Creates a matrix from a quaternion rotation, vector translation and vector scale, rotating and scaling around the given origin\n * This is equivalent to (but much faster than):\n *\n * mat4.identity(dest);\n * mat4.translate(dest, vec);\n * mat4.translate(dest, origin);\n * let quatMat = mat4.create();\n * quat4.toMat4(quat, quatMat);\n * mat4.multiply(dest, quatMat);\n * mat4.scale(dest, scale)\n * mat4.translate(dest, negativeOrigin);\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {quat4} q Rotation quaternion\n * @param {ReadonlyVec3} v Translation vector\n * @param {ReadonlyVec3} s Scaling vector\n * @param {ReadonlyVec3} o The origin vector around which to scale and rotate\n * @returns {mat4} out\n */\n\nfunction fromRotationTranslationScaleOrigin(out, q, v, s, o) {\n // Quaternion math\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var xy = x * y2;\n var xz = x * z2;\n var yy = y * y2;\n var yz = y * z2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n var sx = s[0];\n var sy = s[1];\n var sz = s[2];\n var ox = o[0];\n var oy = o[1];\n var oz = o[2];\n var out0 = (1 - (yy + zz)) * sx;\n var out1 = (xy + wz) * sx;\n var out2 = (xz - wy) * sx;\n var out4 = (xy - wz) * sy;\n var out5 = (1 - (xx + zz)) * sy;\n var out6 = (yz + wx) * sy;\n var out8 = (xz + wy) * sz;\n var out9 = (yz - wx) * sz;\n var out10 = (1 - (xx + yy)) * sz;\n out[0] = out0;\n out[1] = out1;\n out[2] = out2;\n out[3] = 0;\n out[4] = out4;\n out[5] = out5;\n out[6] = out6;\n out[7] = 0;\n out[8] = out8;\n out[9] = out9;\n out[10] = out10;\n out[11] = 0;\n out[12] = v[0] + ox - (out0 * ox + out4 * oy + out8 * oz);\n out[13] = v[1] + oy - (out1 * ox + out5 * oy + out9 * oz);\n out[14] = v[2] + oz - (out2 * ox + out6 * oy + out10 * oz);\n out[15] = 1;\n return out;\n}\n/**\n * Calculates a 4x4 matrix from the given quaternion\n *\n * @param {mat4} out mat4 receiving operation result\n * @param {ReadonlyQuat} q Quaternion to create matrix from\n *\n * @returns {mat4} out\n */\n\nfunction fromQuat(out, q) {\n var x = q[0],\n y = q[1],\n z = q[2],\n w = q[3];\n var x2 = x + x;\n var y2 = y + y;\n var z2 = z + z;\n var xx = x * x2;\n var yx = y * x2;\n var yy = y * y2;\n var zx = z * x2;\n var zy = z * y2;\n var zz = z * z2;\n var wx = w * x2;\n var wy = w * y2;\n var wz = w * z2;\n out[0] = 1 - yy - zz;\n out[1] = yx + wz;\n out[2] = zx - wy;\n out[3] = 0;\n out[4] = yx - wz;\n out[5] = 1 - xx - zz;\n out[6] = zy + wx;\n out[7] = 0;\n out[8] = zx + wy;\n out[9] = zy - wx;\n out[10] = 1 - xx - yy;\n out[11] = 0;\n out[12] = 0;\n out[13] = 0;\n out[14] = 0;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a frustum matrix with the given bounds\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Number} left Left bound of the frustum\n * @param {Number} right Right bound of the frustum\n * @param {Number} bottom Bottom bound of the frustum\n * @param {Number} top Top bound of the frustum\n * @param {Number} near Near bound of the frustum\n * @param {Number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction frustum(out, left, right, bottom, top, near, far) {\n var rl = 1 / (right - left);\n var tb = 1 / (top - bottom);\n var nf = 1 / (near - far);\n out[0] = near * 2 * rl;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = near * 2 * tb;\n out[6] = 0;\n out[7] = 0;\n out[8] = (right + left) * rl;\n out[9] = (top + bottom) * tb;\n out[10] = (far + near) * nf;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[14] = far * near * 2 * nf;\n out[15] = 0;\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nfunction perspectiveNO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = (far + near) * nf;\n out[14] = 2 * far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -2 * near;\n }\n\n return out;\n}\n/**\n * Alias for {@link mat4.perspectiveNO}\n * @function\n */\n\nvar perspective = perspectiveNO;\n/**\n * Generates a perspective projection matrix suitable for WebGPU with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n * Passing null/undefined/no value for far will generate infinite projection matrix.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} fovy Vertical field of view in radians\n * @param {number} aspect Aspect ratio. typically viewport width/height\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum, can be null or Infinity\n * @returns {mat4} out\n */\n\nfunction perspectiveZO(out, fovy, aspect, near, far) {\n var f = 1.0 / Math.tan(fovy / 2),\n nf;\n out[0] = f / aspect;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = f;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[11] = -1;\n out[12] = 0;\n out[13] = 0;\n out[15] = 0;\n\n if (far != null && far !== Infinity) {\n nf = 1 / (near - far);\n out[10] = far * nf;\n out[14] = far * near * nf;\n } else {\n out[10] = -1;\n out[14] = -near;\n }\n\n return out;\n}\n/**\n * Generates a perspective projection matrix with the given field of view.\n * This is primarily useful for generating projection matrices to be used\n * with the still experiemental WebVR API.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {Object} fov Object containing the following values: upDegrees, downDegrees, leftDegrees, rightDegrees\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction perspectiveFromFieldOfView(out, fov, near, far) {\n var upTan = Math.tan(fov.upDegrees * Math.PI / 180.0);\n var downTan = Math.tan(fov.downDegrees * Math.PI / 180.0);\n var leftTan = Math.tan(fov.leftDegrees * Math.PI / 180.0);\n var rightTan = Math.tan(fov.rightDegrees * Math.PI / 180.0);\n var xScale = 2.0 / (leftTan + rightTan);\n var yScale = 2.0 / (upTan + downTan);\n out[0] = xScale;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n out[4] = 0.0;\n out[5] = yScale;\n out[6] = 0.0;\n out[7] = 0.0;\n out[8] = -((leftTan - rightTan) * xScale * 0.5);\n out[9] = (upTan - downTan) * yScale * 0.5;\n out[10] = far / (near - far);\n out[11] = -1.0;\n out[12] = 0.0;\n out[13] = 0.0;\n out[14] = far * near / (near - far);\n out[15] = 0.0;\n return out;\n}\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [-1, 1],\n * which matches WebGL/OpenGL's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction orthoNO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = 2 * nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = (far + near) * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Alias for {@link mat4.orthoNO}\n * @function\n */\n\nvar ortho = orthoNO;\n/**\n * Generates a orthogonal projection matrix with the given bounds.\n * The near/far clip planes correspond to a normalized device coordinate Z range of [0, 1],\n * which matches WebGPU/Vulkan/DirectX/Metal's clip volume.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {number} left Left bound of the frustum\n * @param {number} right Right bound of the frustum\n * @param {number} bottom Bottom bound of the frustum\n * @param {number} top Top bound of the frustum\n * @param {number} near Near bound of the frustum\n * @param {number} far Far bound of the frustum\n * @returns {mat4} out\n */\n\nfunction orthoZO(out, left, right, bottom, top, near, far) {\n var lr = 1 / (left - right);\n var bt = 1 / (bottom - top);\n var nf = 1 / (near - far);\n out[0] = -2 * lr;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n out[4] = 0;\n out[5] = -2 * bt;\n out[6] = 0;\n out[7] = 0;\n out[8] = 0;\n out[9] = 0;\n out[10] = nf;\n out[11] = 0;\n out[12] = (left + right) * lr;\n out[13] = (top + bottom) * bt;\n out[14] = near * nf;\n out[15] = 1;\n return out;\n}\n/**\n * Generates a look-at matrix with the given eye position, focal point, and up axis.\n * If you want a matrix that actually makes an object look at another object, you should use targetTo instead.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nfunction lookAt(out, eye, center, up) {\n var x0, x1, x2, y0, y1, y2, z0, z1, z2, len;\n var eyex = eye[0];\n var eyey = eye[1];\n var eyez = eye[2];\n var upx = up[0];\n var upy = up[1];\n var upz = up[2];\n var centerx = center[0];\n var centery = center[1];\n var centerz = center[2];\n\n if (Math.abs(eyex - centerx) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] && Math.abs(eyey - centery) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] && Math.abs(eyez - centerz) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return identity(out);\n }\n\n z0 = eyex - centerx;\n z1 = eyey - centery;\n z2 = eyez - centerz;\n len = 1 / Math.hypot(z0, z1, z2);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n x0 = upy * z2 - upz * z1;\n x1 = upz * z0 - upx * z2;\n x2 = upx * z1 - upy * z0;\n len = Math.hypot(x0, x1, x2);\n\n if (!len) {\n x0 = 0;\n x1 = 0;\n x2 = 0;\n } else {\n len = 1 / len;\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n y0 = z1 * x2 - z2 * x1;\n y1 = z2 * x0 - z0 * x2;\n y2 = z0 * x1 - z1 * x0;\n len = Math.hypot(y0, y1, y2);\n\n if (!len) {\n y0 = 0;\n y1 = 0;\n y2 = 0;\n } else {\n len = 1 / len;\n y0 *= len;\n y1 *= len;\n y2 *= len;\n }\n\n out[0] = x0;\n out[1] = y0;\n out[2] = z0;\n out[3] = 0;\n out[4] = x1;\n out[5] = y1;\n out[6] = z1;\n out[7] = 0;\n out[8] = x2;\n out[9] = y2;\n out[10] = z2;\n out[11] = 0;\n out[12] = -(x0 * eyex + x1 * eyey + x2 * eyez);\n out[13] = -(y0 * eyex + y1 * eyey + y2 * eyez);\n out[14] = -(z0 * eyex + z1 * eyey + z2 * eyez);\n out[15] = 1;\n return out;\n}\n/**\n * Generates a matrix that makes something look at something else.\n *\n * @param {mat4} out mat4 frustum matrix will be written into\n * @param {ReadonlyVec3} eye Position of the viewer\n * @param {ReadonlyVec3} center Point the viewer is looking at\n * @param {ReadonlyVec3} up vec3 pointing up\n * @returns {mat4} out\n */\n\nfunction targetTo(out, eye, target, up) {\n var eyex = eye[0],\n eyey = eye[1],\n eyez = eye[2],\n upx = up[0],\n upy = up[1],\n upz = up[2];\n var z0 = eyex - target[0],\n z1 = eyey - target[1],\n z2 = eyez - target[2];\n var len = z0 * z0 + z1 * z1 + z2 * z2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n z0 *= len;\n z1 *= len;\n z2 *= len;\n }\n\n var x0 = upy * z2 - upz * z1,\n x1 = upz * z0 - upx * z2,\n x2 = upx * z1 - upy * z0;\n len = x0 * x0 + x1 * x1 + x2 * x2;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n x0 *= len;\n x1 *= len;\n x2 *= len;\n }\n\n out[0] = x0;\n out[1] = x1;\n out[2] = x2;\n out[3] = 0;\n out[4] = z1 * x2 - z2 * x1;\n out[5] = z2 * x0 - z0 * x2;\n out[6] = z0 * x1 - z1 * x0;\n out[7] = 0;\n out[8] = z0;\n out[9] = z1;\n out[10] = z2;\n out[11] = 0;\n out[12] = eyex;\n out[13] = eyey;\n out[14] = eyez;\n out[15] = 1;\n return out;\n}\n/**\n * Returns a string representation of a mat4\n *\n * @param {ReadonlyMat4} a matrix to represent as a string\n * @returns {String} string representation of the matrix\n */\n\nfunction str(a) {\n return \"mat4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \", \" + a[8] + \", \" + a[9] + \", \" + a[10] + \", \" + a[11] + \", \" + a[12] + \", \" + a[13] + \", \" + a[14] + \", \" + a[15] + \")\";\n}\n/**\n * Returns Frobenius norm of a mat4\n *\n * @param {ReadonlyMat4} a the matrix to calculate Frobenius norm of\n * @returns {Number} Frobenius norm\n */\n\nfunction frob(a) {\n return Math.hypot(a[0], a[1], a[2], a[3], a[4], a[5], a[6], a[7], a[8], a[9], a[10], a[11], a[12], a[13], a[14], a[15]);\n}\n/**\n * Adds two mat4's\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n out[8] = a[8] + b[8];\n out[9] = a[9] + b[9];\n out[10] = a[10] + b[10];\n out[11] = a[11] + b[11];\n out[12] = a[12] + b[12];\n out[13] = a[13] + b[13];\n out[14] = a[14] + b[14];\n out[15] = a[15] + b[15];\n return out;\n}\n/**\n * Subtracts matrix b from matrix a\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @returns {mat4} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n out[4] = a[4] - b[4];\n out[5] = a[5] - b[5];\n out[6] = a[6] - b[6];\n out[7] = a[7] - b[7];\n out[8] = a[8] - b[8];\n out[9] = a[9] - b[9];\n out[10] = a[10] - b[10];\n out[11] = a[11] - b[11];\n out[12] = a[12] - b[12];\n out[13] = a[13] - b[13];\n out[14] = a[14] - b[14];\n out[15] = a[15] - b[15];\n return out;\n}\n/**\n * Multiply each element of the matrix by a scalar.\n *\n * @param {mat4} out the receiving matrix\n * @param {ReadonlyMat4} a the matrix to scale\n * @param {Number} b amount to scale the matrix's elements by\n * @returns {mat4} out\n */\n\nfunction multiplyScalar(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n out[8] = a[8] * b;\n out[9] = a[9] * b;\n out[10] = a[10] * b;\n out[11] = a[11] * b;\n out[12] = a[12] * b;\n out[13] = a[13] * b;\n out[14] = a[14] * b;\n out[15] = a[15] * b;\n return out;\n}\n/**\n * Adds two mat4's after multiplying each element of the second operand by a scalar value.\n *\n * @param {mat4} out the receiving vector\n * @param {ReadonlyMat4} a the first operand\n * @param {ReadonlyMat4} b the second operand\n * @param {Number} scale the amount to scale b's elements by before adding\n * @returns {mat4} out\n */\n\nfunction multiplyScalarAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n out[4] = a[4] + b[4] * scale;\n out[5] = a[5] + b[5] * scale;\n out[6] = a[6] + b[6] * scale;\n out[7] = a[7] + b[7] * scale;\n out[8] = a[8] + b[8] * scale;\n out[9] = a[9] + b[9] * scale;\n out[10] = a[10] + b[10] * scale;\n out[11] = a[11] + b[11] * scale;\n out[12] = a[12] + b[12] * scale;\n out[13] = a[13] + b[13] * scale;\n out[14] = a[14] + b[14] * scale;\n out[15] = a[15] + b[15] * scale;\n return out;\n}\n/**\n * Returns whether or not the matrices have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7] && a[8] === b[8] && a[9] === b[9] && a[10] === b[10] && a[11] === b[11] && a[12] === b[12] && a[13] === b[13] && a[14] === b[14] && a[15] === b[15];\n}\n/**\n * Returns whether or not the matrices have approximately the same elements in the same position.\n *\n * @param {ReadonlyMat4} a The first matrix.\n * @param {ReadonlyMat4} b The second matrix.\n * @returns {Boolean} True if the matrices are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var a8 = a[8],\n a9 = a[9],\n a10 = a[10],\n a11 = a[11];\n var a12 = a[12],\n a13 = a[13],\n a14 = a[14],\n a15 = a[15];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n var b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n var b8 = b[8],\n b9 = b[9],\n b10 = b[10],\n b11 = b[11];\n var b12 = b[12],\n b13 = b[13],\n b14 = b[14],\n b15 = b[15];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7)) && Math.abs(a8 - b8) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a8), Math.abs(b8)) && Math.abs(a9 - b9) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a9), Math.abs(b9)) && Math.abs(a10 - b10) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a10), Math.abs(b10)) && Math.abs(a11 - b11) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a11), Math.abs(b11)) && Math.abs(a12 - b12) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a12), Math.abs(b12)) && Math.abs(a13 - b13) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a13), Math.abs(b13)) && Math.abs(a14 - b14) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a14), Math.abs(b14)) && Math.abs(a15 - b15) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a15), Math.abs(b15));\n}\n/**\n * Alias for {@link mat4.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link mat4.subtract}\n * @function\n */\n\nvar sub = subtract;\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/mat4.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/dc/nipals.js": -/*!*************************************************!*\ - !*** ./node_modules/ml-matrix/src/dc/nipals.js ***! - \*************************************************/ -/*! exports provided: default */ +/***/ "./node_modules/gl-matrix/esm/quat.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/quat.js ***! + \********************************************/ +/*! exports provided: create, identity, setAxisAngle, getAxisAngle, getAngle, multiply, rotateX, rotateY, rotateZ, calculateW, exp, ln, pow, slerp, random, invert, conjugate, fromMat3, fromEuler, str, clone, fromValues, copy, set, add, mul, scale, dot, lerp, length, len, squaredLength, sqrLen, normalize, exactEquals, equals, rotationTo, sqlerp, setAxes */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return nipals; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\n\n\nclass nipals {\n constructor(X, options = {}) {\n X = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_2__[\"default\"].checkMatrix(X);\n let { Y } = options;\n const {\n scaleScores = false,\n maxIterations = 1000,\n terminationCriteria = 1e-10,\n } = options;\n\n let u;\n if (Y) {\n if (Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(Y) && typeof Y[0] === 'number') {\n Y = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].columnVector(Y);\n } else {\n Y = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_2__[\"default\"].checkMatrix(Y);\n }\n if (Y.rows !== X.rows) {\n throw new Error('Y should have the same number of rows as X');\n }\n u = Y.getColumnVector(0);\n } else {\n u = X.getColumnVector(0);\n }\n\n let diff = 1;\n let t, q, w, tOld;\n\n for (\n let counter = 0;\n counter < maxIterations && diff > terminationCriteria;\n counter++\n ) {\n w = X.transpose().mmul(u).div(u.transpose().mmul(u).get(0, 0));\n w = w.div(w.norm());\n\n t = X.mmul(w).div(w.transpose().mmul(w).get(0, 0));\n\n if (counter > 0) {\n diff = t.clone().sub(tOld).pow(2).sum();\n }\n tOld = t.clone();\n\n if (Y) {\n q = Y.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n q = q.div(q.norm());\n\n u = Y.mmul(q).div(q.transpose().mmul(q).get(0, 0));\n } else {\n u = t;\n }\n }\n\n if (Y) {\n let p = X.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n p = p.div(p.norm());\n let xResidual = X.clone().sub(t.clone().mmul(p.transpose()));\n let residual = u.transpose().mmul(t).div(t.transpose().mmul(t).get(0, 0));\n let yResidual = Y.clone().sub(\n t.clone().mulS(residual.get(0, 0)).mmul(q.transpose()),\n );\n\n this.t = t;\n this.p = p.transpose();\n this.w = w.transpose();\n this.q = q;\n this.u = u;\n this.s = t.transpose().mmul(t);\n this.xResidual = xResidual;\n this.yResidual = yResidual;\n this.betas = residual;\n } else {\n this.w = w.transpose();\n this.s = t.transpose().mmul(t).sqrt();\n if (scaleScores) {\n this.t = t.clone().div(this.s.get(0, 0));\n } else {\n this.t = t;\n }\n this.xResidual = X.sub(t.mmul(w.transpose()));\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/dc/nipals.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAxisAngle\", function() { return setAxisAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAxisAngle\", function() { return getAxisAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getAngle\", function() { return getAngle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"calculateW\", function() { return calculateW; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exp\", function() { return exp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ln\", function() { return ln; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pow\", function() { return pow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"slerp\", function() { return slerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conjugate\", function() { return conjugate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat3\", function() { return fromMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromEuler\", function() { return fromEuler; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotationTo\", function() { return rotationTo; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqlerp\", function() { return sqlerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setAxes\", function() { return setAxes; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony import */ var _mat3_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./mat3.js */ \"./node_modules/gl-matrix/esm/mat3.js\");\n/* harmony import */ var _vec3_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./vec3.js */ \"./node_modules/gl-matrix/esm/vec3.js\");\n/* harmony import */ var _vec4_js__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./vec4.js */ \"./node_modules/gl-matrix/esm/vec4.js\");\n\n\n\n\n/**\n * Quaternion\n * @module quat\n */\n\n/**\n * Creates a new identity quat\n *\n * @returns {quat} a new quaternion\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n out[3] = 1;\n return out;\n}\n/**\n * Set a quat to the identity quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n}\n/**\n * Sets a quat from the given angle and rotation axis,\n * then returns it.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyVec3} axis the axis around which to rotate\n * @param {Number} rad the angle in radians\n * @returns {quat} out\n **/\n\nfunction setAxisAngle(out, axis, rad) {\n rad = rad * 0.5;\n var s = Math.sin(rad);\n out[0] = s * axis[0];\n out[1] = s * axis[1];\n out[2] = s * axis[2];\n out[3] = Math.cos(rad);\n return out;\n}\n/**\n * Gets the rotation axis and angle for a given\n * quaternion. If a quaternion is created with\n * setAxisAngle, this method will return the same\n * values as providied in the original parameter list\n * OR functionally equivalent values.\n * Example: The quaternion formed by axis [0, 0, 1] and\n * angle -90 is the same as the quaternion formed by\n * [0, 0, 1] and 270. This method favors the latter.\n * @param {vec3} out_axis Vector receiving the axis of rotation\n * @param {ReadonlyQuat} q Quaternion to be decomposed\n * @return {Number} Angle, in radians, of the rotation\n */\n\nfunction getAxisAngle(out_axis, q) {\n var rad = Math.acos(q[3]) * 2.0;\n var s = Math.sin(rad / 2.0);\n\n if (s > _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n out_axis[0] = q[0] / s;\n out_axis[1] = q[1] / s;\n out_axis[2] = q[2] / s;\n } else {\n // If s is zero, return any axis (no rotation - axis does not matter)\n out_axis[0] = 1;\n out_axis[1] = 0;\n out_axis[2] = 0;\n }\n\n return rad;\n}\n/**\n * Gets the angular distance between two unit quaternions\n *\n * @param {ReadonlyQuat} a Origin unit quaternion\n * @param {ReadonlyQuat} b Destination unit quaternion\n * @return {Number} Angle, in radians, between the two quaternions\n */\n\nfunction getAngle(a, b) {\n var dotproduct = dot(a, b);\n return Math.acos(2 * dotproduct * dotproduct - 1);\n}\n/**\n * Multiplies two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n */\n\nfunction multiply(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n out[0] = ax * bw + aw * bx + ay * bz - az * by;\n out[1] = ay * bw + aw * by + az * bx - ax * bz;\n out[2] = az * bw + aw * bz + ax * by - ay * bx;\n out[3] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the X axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nfunction rotateX(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + aw * bx;\n out[1] = ay * bw + az * bx;\n out[2] = az * bw - ay * bx;\n out[3] = aw * bw - ax * bx;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Y axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nfunction rotateY(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var by = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw - az * by;\n out[1] = ay * bw + aw * by;\n out[2] = az * bw + ax * by;\n out[3] = aw * bw - ay * by;\n return out;\n}\n/**\n * Rotates a quaternion by the given angle about the Z axis\n *\n * @param {quat} out quat receiving operation result\n * @param {ReadonlyQuat} a quat to rotate\n * @param {number} rad angle (in radians) to rotate\n * @returns {quat} out\n */\n\nfunction rotateZ(out, a, rad) {\n rad *= 0.5;\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bz = Math.sin(rad),\n bw = Math.cos(rad);\n out[0] = ax * bw + ay * bz;\n out[1] = ay * bw - ax * bz;\n out[2] = az * bw + aw * bz;\n out[3] = aw * bw - az * bz;\n return out;\n}\n/**\n * Calculates the W component of a quat from the X, Y, and Z components.\n * Assumes that quaternion is 1 unit in length.\n * Any existing W component will be ignored.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate W component of\n * @returns {quat} out\n */\n\nfunction calculateW(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = Math.sqrt(Math.abs(1.0 - x * x - y * y - z * z));\n return out;\n}\n/**\n * Calculate the exponential of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\nfunction exp(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var et = Math.exp(w);\n var s = r > 0 ? et * Math.sin(r) / r : 0;\n out[0] = x * s;\n out[1] = y * s;\n out[2] = z * s;\n out[3] = et * Math.cos(r);\n return out;\n}\n/**\n * Calculate the natural logarithm of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @returns {quat} out\n */\n\nfunction ln(out, a) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n var r = Math.sqrt(x * x + y * y + z * z);\n var t = r > 0 ? Math.atan2(r, w) / r : 0;\n out[0] = x * t;\n out[1] = y * t;\n out[2] = z * t;\n out[3] = 0.5 * Math.log(x * x + y * y + z * z + w * w);\n return out;\n}\n/**\n * Calculate the scalar power of a unit quaternion.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate the exponential of\n * @param {Number} b amount to scale the quaternion by\n * @returns {quat} out\n */\n\nfunction pow(out, a, b) {\n ln(out, a);\n scale(out, out, b);\n exp(out, out);\n return out;\n}\n/**\n * Performs a spherical linear interpolation between two quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\nfunction slerp(out, a, b, t) {\n // benchmarks:\n // http://jsperf.com/quaternion-slerp-implementations\n var ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n var bx = b[0],\n by = b[1],\n bz = b[2],\n bw = b[3];\n var omega, cosom, sinom, scale0, scale1; // calc cosine\n\n cosom = ax * bx + ay * by + az * bz + aw * bw; // adjust signs (if necessary)\n\n if (cosom < 0.0) {\n cosom = -cosom;\n bx = -bx;\n by = -by;\n bz = -bz;\n bw = -bw;\n } // calculate coefficients\n\n\n if (1.0 - cosom > _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n // standard case (slerp)\n omega = Math.acos(cosom);\n sinom = Math.sin(omega);\n scale0 = Math.sin((1.0 - t) * omega) / sinom;\n scale1 = Math.sin(t * omega) / sinom;\n } else {\n // \"from\" and \"to\" quaternions are very close\n // ... so we can do a linear interpolation\n scale0 = 1.0 - t;\n scale1 = t;\n } // calculate final values\n\n\n out[0] = scale0 * ax + scale1 * bx;\n out[1] = scale0 * ay + scale1 * by;\n out[2] = scale0 * az + scale1 * bz;\n out[3] = scale0 * aw + scale1 * bw;\n return out;\n}\n/**\n * Generates a random unit quaternion\n *\n * @param {quat} out the receiving quaternion\n * @returns {quat} out\n */\n\nfunction random(out) {\n // Implementation of http://planning.cs.uiuc.edu/node198.html\n // TODO: Calling random 3 times is probably not the fastest solution\n var u1 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var u2 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var u3 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]();\n var sqrt1MinusU1 = Math.sqrt(1 - u1);\n var sqrtU1 = Math.sqrt(u1);\n out[0] = sqrt1MinusU1 * Math.sin(2.0 * Math.PI * u2);\n out[1] = sqrt1MinusU1 * Math.cos(2.0 * Math.PI * u2);\n out[2] = sqrtU1 * Math.sin(2.0 * Math.PI * u3);\n out[3] = sqrtU1 * Math.cos(2.0 * Math.PI * u3);\n return out;\n}\n/**\n * Calculates the inverse of a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate inverse of\n * @returns {quat} out\n */\n\nfunction invert(out, a) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var dot = a0 * a0 + a1 * a1 + a2 * a2 + a3 * a3;\n var invDot = dot ? 1.0 / dot : 0; // TODO: Would be faster to return [0,0,0,0] immediately if dot == 0\n\n out[0] = -a0 * invDot;\n out[1] = -a1 * invDot;\n out[2] = -a2 * invDot;\n out[3] = a3 * invDot;\n return out;\n}\n/**\n * Calculates the conjugate of a quat\n * If the quaternion is normalized, this function is faster than quat.inverse and produces the same result.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quat to calculate conjugate of\n * @returns {quat} out\n */\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a quaternion from the given 3x3 rotation matrix.\n *\n * NOTE: The resultant quaternion is not normalized, so you should be sure\n * to renormalize the quaternion yourself where necessary.\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyMat3} m rotation matrix\n * @returns {quat} out\n * @function\n */\n\nfunction fromMat3(out, m) {\n // Algorithm in Ken Shoemake's article in 1987 SIGGRAPH course notes\n // article \"Quaternion Calculus and Fast Animation\".\n var fTrace = m[0] + m[4] + m[8];\n var fRoot;\n\n if (fTrace > 0.0) {\n // |w| > 1/2, may as well choose w > 1/2\n fRoot = Math.sqrt(fTrace + 1.0); // 2w\n\n out[3] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot; // 1/(4w)\n\n out[0] = (m[5] - m[7]) * fRoot;\n out[1] = (m[6] - m[2]) * fRoot;\n out[2] = (m[1] - m[3]) * fRoot;\n } else {\n // |w| <= 1/2\n var i = 0;\n if (m[4] > m[0]) i = 1;\n if (m[8] > m[i * 3 + i]) i = 2;\n var j = (i + 1) % 3;\n var k = (i + 2) % 3;\n fRoot = Math.sqrt(m[i * 3 + i] - m[j * 3 + j] - m[k * 3 + k] + 1.0);\n out[i] = 0.5 * fRoot;\n fRoot = 0.5 / fRoot;\n out[3] = (m[j * 3 + k] - m[k * 3 + j]) * fRoot;\n out[j] = (m[j * 3 + i] + m[i * 3 + j]) * fRoot;\n out[k] = (m[k * 3 + i] + m[i * 3 + k]) * fRoot;\n }\n\n return out;\n}\n/**\n * Creates a quaternion from the given euler angle x, y, z.\n *\n * @param {quat} out the receiving quaternion\n * @param {x} Angle to rotate around X axis in degrees.\n * @param {y} Angle to rotate around Y axis in degrees.\n * @param {z} Angle to rotate around Z axis in degrees.\n * @returns {quat} out\n * @function\n */\n\nfunction fromEuler(out, x, y, z) {\n var halfToRad = 0.5 * Math.PI / 180.0;\n x *= halfToRad;\n y *= halfToRad;\n z *= halfToRad;\n var sx = Math.sin(x);\n var cx = Math.cos(x);\n var sy = Math.sin(y);\n var cy = Math.cos(y);\n var sz = Math.sin(z);\n var cz = Math.cos(z);\n out[0] = sx * cy * cz - cx * sy * sz;\n out[1] = cx * sy * cz + sx * cy * sz;\n out[2] = cx * cy * sz - sx * sy * cz;\n out[3] = cx * cy * cz + sx * sy * sz;\n return out;\n}\n/**\n * Returns a string representation of a quatenion\n *\n * @param {ReadonlyQuat} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"quat(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat} a quaternion to clone\n * @returns {quat} a new quaternion\n * @function\n */\n\nvar clone = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"clone\"];\n/**\n * Creates a new quat initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} a new quaternion\n * @function\n */\n\nvar fromValues = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"fromValues\"];\n/**\n * Copy the values from one quat to another\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the source quaternion\n * @returns {quat} out\n * @function\n */\n\nvar copy = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"copy\"];\n/**\n * Set the components of a quat to the given values\n *\n * @param {quat} out the receiving quaternion\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {quat} out\n * @function\n */\n\nvar set = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"set\"];\n/**\n * Adds two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {quat} out\n * @function\n */\n\nvar add = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"add\"];\n/**\n * Alias for {@link quat.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Scales a quat by a scalar number\n *\n * @param {quat} out the receiving vector\n * @param {ReadonlyQuat} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {quat} out\n * @function\n */\n\nvar scale = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"scale\"];\n/**\n * Calculates the dot product of two quat's\n *\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\n\nvar dot = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"dot\"];\n/**\n * Performs a linear interpolation between two quat's\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n * @function\n */\n\nvar lerp = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"lerp\"];\n/**\n * Calculates the length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nvar length = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"length\"];\n/**\n * Alias for {@link quat.length}\n * @function\n */\n\nvar len = length;\n/**\n * Calculates the squared length of a quat\n *\n * @param {ReadonlyQuat} a vector to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\n\nvar squaredLength = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"squaredLength\"];\n/**\n * Alias for {@link quat.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Normalize a quat\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a quaternion to normalize\n * @returns {quat} out\n * @function\n */\n\nvar normalize = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"normalize\"];\n/**\n * Returns whether or not the quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat} a The first quaternion.\n * @param {ReadonlyQuat} b The second quaternion.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nvar exactEquals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"exactEquals\"];\n/**\n * Returns whether or not the quaternions have approximately the same elements in the same position.\n *\n * @param {ReadonlyQuat} a The first vector.\n * @param {ReadonlyQuat} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nvar equals = _vec4_js__WEBPACK_IMPORTED_MODULE_3__[\"equals\"];\n/**\n * Sets a quaternion to represent the shortest rotation from one\n * vector to another.\n *\n * Both vectors are assumed to be unit length.\n *\n * @param {quat} out the receiving quaternion.\n * @param {ReadonlyVec3} a the initial vector\n * @param {ReadonlyVec3} b the destination vector\n * @returns {quat} out\n */\n\nvar rotationTo = function () {\n var tmpvec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"create\"]();\n var xUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"fromValues\"](1, 0, 0);\n var yUnitVec3 = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"fromValues\"](0, 1, 0);\n return function (out, a, b) {\n var dot = _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"dot\"](a, b);\n\n if (dot < -0.999999) {\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, xUnitVec3, a);\n if (_vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"len\"](tmpvec3) < 0.000001) _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, yUnitVec3, a);\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"normalize\"](tmpvec3, tmpvec3);\n setAxisAngle(out, tmpvec3, Math.PI);\n return out;\n } else if (dot > 0.999999) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n return out;\n } else {\n _vec3_js__WEBPACK_IMPORTED_MODULE_2__[\"cross\"](tmpvec3, a, b);\n out[0] = tmpvec3[0];\n out[1] = tmpvec3[1];\n out[2] = tmpvec3[2];\n out[3] = 1 + dot;\n return normalize(out, out);\n }\n };\n}();\n/**\n * Performs a spherical linear interpolation with two control points\n *\n * @param {quat} out the receiving quaternion\n * @param {ReadonlyQuat} a the first operand\n * @param {ReadonlyQuat} b the second operand\n * @param {ReadonlyQuat} c the third operand\n * @param {ReadonlyQuat} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat} out\n */\n\nvar sqlerp = function () {\n var temp1 = create();\n var temp2 = create();\n return function (out, a, b, c, d, t) {\n slerp(temp1, a, d, t);\n slerp(temp2, b, c, t);\n slerp(out, temp1, temp2, 2 * t * (1 - t));\n return out;\n };\n}();\n/**\n * Sets the specified quaternion with values corresponding to the given\n * axes. Each axis is a vec3 and is expected to be unit length and\n * perpendicular to all other specified axes.\n *\n * @param {ReadonlyVec3} view the vector representing the viewing direction\n * @param {ReadonlyVec3} right the vector representing the local \"right\" direction\n * @param {ReadonlyVec3} up the vector representing the local \"up\" direction\n * @returns {quat} out\n */\n\nvar setAxes = function () {\n var matr = _mat3_js__WEBPACK_IMPORTED_MODULE_1__[\"create\"]();\n return function (out, view, right, up) {\n matr[0] = right[0];\n matr[3] = right[1];\n matr[6] = right[2];\n matr[1] = up[0];\n matr[4] = up[1];\n matr[7] = up[2];\n matr[2] = -view[0];\n matr[5] = -view[1];\n matr[8] = -view[2];\n return normalize(out, fromMat3(out, matr));\n };\n}();\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/quat.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/dc/qr.js": +/***/ "./node_modules/gl-matrix/esm/quat2.js": /*!*********************************************!*\ - !*** ./node_modules/ml-matrix/src/dc/qr.js ***! + !*** ./node_modules/gl-matrix/esm/quat2.js ***! \*********************************************/ -/*! exports provided: default */ +/*! exports provided: create, clone, fromValues, fromRotationTranslationValues, fromRotationTranslation, fromTranslation, fromRotation, fromMat4, copy, identity, set, getReal, getDual, setReal, setDual, getTranslation, translate, rotateX, rotateY, rotateZ, rotateByQuatAppend, rotateByQuatPrepend, rotateAroundAxis, add, multiply, mul, scale, dot, lerp, invert, conjugate, length, len, squaredLength, sqrLen, normalize, str, exactEquals, equals */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return QrDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/ml-matrix/src/dc/util.js\");\n\n\n\n\n\nclass QrDecomposition {\n constructor(value) {\n value = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(value);\n\n let qr = value.clone();\n let m = value.rows;\n let n = value.columns;\n let rdiag = new Float64Array(n);\n let i, j, k, s;\n\n for (k = 0; k < n; k++) {\n let nrm = 0;\n for (i = k; i < m; i++) {\n nrm = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(nrm, qr.get(i, k));\n }\n if (nrm !== 0) {\n if (qr.get(k, k) < 0) {\n nrm = -nrm;\n }\n for (i = k; i < m; i++) {\n qr.set(i, k, qr.get(i, k) / nrm);\n }\n qr.set(k, k, qr.get(k, k) + 1);\n for (j = k + 1; j < n; j++) {\n s = 0;\n for (i = k; i < m; i++) {\n s += qr.get(i, k) * qr.get(i, j);\n }\n s = -s / qr.get(k, k);\n for (i = k; i < m; i++) {\n qr.set(i, j, qr.get(i, j) + s * qr.get(i, k));\n }\n }\n }\n rdiag[k] = -nrm;\n }\n\n this.QR = qr;\n this.Rdiag = rdiag;\n }\n\n solve(value) {\n value = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].checkMatrix(value);\n\n let qr = this.QR;\n let m = qr.rows;\n\n if (value.rows !== m) {\n throw new Error('Matrix row dimensions must agree');\n }\n if (!this.isFullRank()) {\n throw new Error('Matrix is rank deficient');\n }\n\n let count = value.columns;\n let X = value.clone();\n let n = qr.columns;\n let i, j, k, s;\n\n for (k = 0; k < n; k++) {\n for (j = 0; j < count; j++) {\n s = 0;\n for (i = k; i < m; i++) {\n s += qr.get(i, k) * X.get(i, j);\n }\n s = -s / qr.get(k, k);\n for (i = k; i < m; i++) {\n X.set(i, j, X.get(i, j) + s * qr.get(i, k));\n }\n }\n }\n for (k = n - 1; k >= 0; k--) {\n for (j = 0; j < count; j++) {\n X.set(k, j, X.get(k, j) / this.Rdiag[k]);\n }\n for (i = 0; i < k; i++) {\n for (j = 0; j < count; j++) {\n X.set(i, j, X.get(i, j) - X.get(k, j) * qr.get(i, k));\n }\n }\n }\n\n return X.subMatrix(0, n - 1, 0, count - 1);\n }\n\n isFullRank() {\n let columns = this.QR.columns;\n for (let i = 0; i < columns; i++) {\n if (this.Rdiag[i] === 0) {\n return false;\n }\n }\n return true;\n }\n\n get upperTriangularMatrix() {\n let qr = this.QR;\n let n = qr.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n let i, j;\n for (i = 0; i < n; i++) {\n for (j = 0; j < n; j++) {\n if (i < j) {\n X.set(i, j, qr.get(i, j));\n } else if (i === j) {\n X.set(i, j, this.Rdiag[i]);\n } else {\n X.set(i, j, 0);\n }\n }\n }\n return X;\n }\n\n get orthogonalMatrix() {\n let qr = this.QR;\n let rows = qr.rows;\n let columns = qr.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](rows, columns);\n let i, j, k, s;\n\n for (k = columns - 1; k >= 0; k--) {\n for (i = 0; i < rows; i++) {\n X.set(i, k, 0);\n }\n X.set(k, k, 1);\n for (j = k; j < columns; j++) {\n if (qr.get(k, k) !== 0) {\n s = 0;\n for (i = k; i < rows; i++) {\n s += qr.get(i, k) * X.get(i, j);\n }\n\n s = -s / qr.get(k, k);\n\n for (i = k; i < rows; i++) {\n X.set(i, j, X.get(i, j) + s * qr.get(i, k));\n }\n }\n }\n }\n return X;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/dc/qr.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslationValues\", function() { return fromRotationTranslationValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotationTranslation\", function() { return fromRotationTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromTranslation\", function() { return fromTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromRotation\", function() { return fromRotation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromMat4\", function() { return fromMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"identity\", function() { return identity; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getReal\", function() { return getReal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getDual\", function() { return getDual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setReal\", function() { return setReal; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"setDual\", function() { return setDual; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getTranslation\", function() { return getTranslation; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"translate\", function() { return translate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateByQuatAppend\", function() { return rotateByQuatAppend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateByQuatPrepend\", function() { return rotateByQuatPrepend; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateAroundAxis\", function() { return rotateAroundAxis; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"invert\", function() { return invert; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"conjugate\", function() { return conjugate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n/* harmony import */ var _quat_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./quat.js */ \"./node_modules/gl-matrix/esm/quat.js\");\n/* harmony import */ var _mat4_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./mat4.js */ \"./node_modules/gl-matrix/esm/mat4.js\");\n\n\n\n/**\n * Dual Quaternion
\n * Format: [real, dual]
\n * Quaternion format: XYZW
\n * Make sure to have normalized dual quaternions, otherwise the functions may not work as intended.
\n * @module quat2\n */\n\n/**\n * Creates a new identity dual quat\n *\n * @returns {quat2} a new dual quaternion [real -> rotation, dual -> translation]\n */\n\nfunction create() {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n dq[0] = 0;\n dq[1] = 0;\n dq[2] = 0;\n dq[4] = 0;\n dq[5] = 0;\n dq[6] = 0;\n dq[7] = 0;\n }\n\n dq[3] = 1;\n return dq;\n}\n/**\n * Creates a new quat initialized with values from an existing quaternion\n *\n * @param {ReadonlyQuat2} a dual quaternion to clone\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nfunction clone(a) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = a[0];\n dq[1] = a[1];\n dq[2] = a[2];\n dq[3] = a[3];\n dq[4] = a[4];\n dq[5] = a[5];\n dq[6] = a[6];\n dq[7] = a[7];\n return dq;\n}\n/**\n * Creates a new dual quat initialized with the given values\n *\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component\n * @param {Number} y2 Y component\n * @param {Number} z2 Z component\n * @param {Number} w2 W component\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nfunction fromValues(x1, y1, z1, w1, x2, y2, z2, w2) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n dq[4] = x2;\n dq[5] = y2;\n dq[6] = z2;\n dq[7] = w2;\n return dq;\n}\n/**\n * Creates a new dual quat from the given values (quat and translation)\n *\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component (translation)\n * @param {Number} y2 Y component (translation)\n * @param {Number} z2 Z component (translation)\n * @returns {quat2} new dual quaternion\n * @function\n */\n\nfunction fromRotationTranslationValues(x1, y1, z1, w1, x2, y2, z2) {\n var dq = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](8);\n dq[0] = x1;\n dq[1] = y1;\n dq[2] = z1;\n dq[3] = w1;\n var ax = x2 * 0.5,\n ay = y2 * 0.5,\n az = z2 * 0.5;\n dq[4] = ax * w1 + ay * z1 - az * y1;\n dq[5] = ay * w1 + az * x1 - ax * z1;\n dq[6] = az * w1 + ax * y1 - ay * x1;\n dq[7] = -ax * x1 - ay * y1 - az * z1;\n return dq;\n}\n/**\n * Creates a dual quat from a quaternion and a translation\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyQuat} q a normalized quaternion\n * @param {ReadonlyVec3} t tranlation vector\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nfunction fromRotationTranslation(out, q, t) {\n var ax = t[0] * 0.5,\n ay = t[1] * 0.5,\n az = t[2] * 0.5,\n bx = q[0],\n by = q[1],\n bz = q[2],\n bw = q[3];\n out[0] = bx;\n out[1] = by;\n out[2] = bz;\n out[3] = bw;\n out[4] = ax * bw + ay * bz - az * by;\n out[5] = ay * bw + az * bx - ax * bz;\n out[6] = az * bw + ax * by - ay * bx;\n out[7] = -ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Creates a dual quat from a translation\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyVec3} t translation vector\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nfunction fromTranslation(out, t) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = t[0] * 0.5;\n out[5] = t[1] * 0.5;\n out[6] = t[2] * 0.5;\n out[7] = 0;\n return out;\n}\n/**\n * Creates a dual quat from a quaternion\n *\n * @param {ReadonlyQuat2} dual quaternion receiving operation result\n * @param {ReadonlyQuat} q the quaternion\n * @returns {quat2} dual quaternion receiving operation result\n * @function\n */\n\nfunction fromRotation(out, q) {\n out[0] = q[0];\n out[1] = q[1];\n out[2] = q[2];\n out[3] = q[3];\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\n * Creates a new dual quat from a matrix (4x4)\n *\n * @param {quat2} out the dual quaternion\n * @param {ReadonlyMat4} a the matrix\n * @returns {quat2} dual quat receiving operation result\n * @function\n */\n\nfunction fromMat4(out, a) {\n //TODO Optimize this\n var outer = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"create\"]();\n _mat4_js__WEBPACK_IMPORTED_MODULE_2__[\"getRotation\"](outer, a);\n var t = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n _mat4_js__WEBPACK_IMPORTED_MODULE_2__[\"getTranslation\"](t, a);\n fromRotationTranslation(out, outer, t);\n return out;\n}\n/**\n * Copy the values from one dual quat to another\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the source dual quaternion\n * @returns {quat2} out\n * @function\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n out[4] = a[4];\n out[5] = a[5];\n out[6] = a[6];\n out[7] = a[7];\n return out;\n}\n/**\n * Set a dual quat to the identity dual quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @returns {quat2} out\n */\n\nfunction identity(out) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 1;\n out[4] = 0;\n out[5] = 0;\n out[6] = 0;\n out[7] = 0;\n return out;\n}\n/**\n * Set the components of a dual quat to the given values\n *\n * @param {quat2} out the receiving quaternion\n * @param {Number} x1 X component\n * @param {Number} y1 Y component\n * @param {Number} z1 Z component\n * @param {Number} w1 W component\n * @param {Number} x2 X component\n * @param {Number} y2 Y component\n * @param {Number} z2 Z component\n * @param {Number} w2 W component\n * @returns {quat2} out\n * @function\n */\n\nfunction set(out, x1, y1, z1, w1, x2, y2, z2, w2) {\n out[0] = x1;\n out[1] = y1;\n out[2] = z1;\n out[3] = w1;\n out[4] = x2;\n out[5] = y2;\n out[6] = z2;\n out[7] = w2;\n return out;\n}\n/**\n * Gets the real part of a dual quat\n * @param {quat} out real part\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @return {quat} real part\n */\n\nvar getReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"copy\"];\n/**\n * Gets the dual part of a dual quat\n * @param {quat} out dual part\n * @param {ReadonlyQuat2} a Dual Quaternion\n * @return {quat} dual part\n */\n\nfunction getDual(out, a) {\n out[0] = a[4];\n out[1] = a[5];\n out[2] = a[6];\n out[3] = a[7];\n return out;\n}\n/**\n * Set the real component of a dual quat to the given quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat} q a quaternion representing the real part\n * @returns {quat2} out\n * @function\n */\n\nvar setReal = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"copy\"];\n/**\n * Set the dual component of a dual quat to the given quaternion\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat} q a quaternion representing the dual part\n * @returns {quat2} out\n * @function\n */\n\nfunction setDual(out, q) {\n out[4] = q[0];\n out[5] = q[1];\n out[6] = q[2];\n out[7] = q[3];\n return out;\n}\n/**\n * Gets the translation of a normalized dual quat\n * @param {vec3} out translation\n * @param {ReadonlyQuat2} a Dual Quaternion to be decomposed\n * @return {vec3} translation\n */\n\nfunction getTranslation(out, a) {\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3];\n out[0] = (ax * bw + aw * bx + ay * bz - az * by) * 2;\n out[1] = (ay * bw + aw * by + az * bx - ax * bz) * 2;\n out[2] = (az * bw + aw * bz + ax * by - ay * bx) * 2;\n return out;\n}\n/**\n * Translates a dual quat by the given vector\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to translate\n * @param {ReadonlyVec3} v vector to translate by\n * @returns {quat2} out\n */\n\nfunction translate(out, a, v) {\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3],\n bx1 = v[0] * 0.5,\n by1 = v[1] * 0.5,\n bz1 = v[2] * 0.5,\n ax2 = a[4],\n ay2 = a[5],\n az2 = a[6],\n aw2 = a[7];\n out[0] = ax1;\n out[1] = ay1;\n out[2] = az1;\n out[3] = aw1;\n out[4] = aw1 * bx1 + ay1 * bz1 - az1 * by1 + ax2;\n out[5] = aw1 * by1 + az1 * bx1 - ax1 * bz1 + ay2;\n out[6] = aw1 * bz1 + ax1 * by1 - ay1 * bx1 + az2;\n out[7] = -ax1 * bx1 - ay1 * by1 - az1 * bz1 + aw2;\n return out;\n}\n/**\n * Rotates a dual quat around the X axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nfunction rotateX(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateX\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat around the Y axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nfunction rotateY(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateY\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat around the Z axis\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {number} rad how far should the rotation be\n * @returns {quat2} out\n */\n\nfunction rotateZ(out, a, rad) {\n var bx = -a[0],\n by = -a[1],\n bz = -a[2],\n bw = a[3],\n ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7],\n ax1 = ax * bw + aw * bx + ay * bz - az * by,\n ay1 = ay * bw + aw * by + az * bx - ax * bz,\n az1 = az * bw + aw * bz + ax * by - ay * bx,\n aw1 = aw * bw - ax * bx - ay * by - az * bz;\n _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"rotateZ\"](out, a, rad);\n bx = out[0];\n by = out[1];\n bz = out[2];\n bw = out[3];\n out[4] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[5] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[6] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[7] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n return out;\n}\n/**\n * Rotates a dual quat by a given quaternion (a * q)\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {ReadonlyQuat} q quaternion to rotate by\n * @returns {quat2} out\n */\n\nfunction rotateByQuatAppend(out, a, q) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n ax = a[0],\n ay = a[1],\n az = a[2],\n aw = a[3];\n out[0] = ax * qw + aw * qx + ay * qz - az * qy;\n out[1] = ay * qw + aw * qy + az * qx - ax * qz;\n out[2] = az * qw + aw * qz + ax * qy - ay * qx;\n out[3] = aw * qw - ax * qx - ay * qy - az * qz;\n ax = a[4];\n ay = a[5];\n az = a[6];\n aw = a[7];\n out[4] = ax * qw + aw * qx + ay * qz - az * qy;\n out[5] = ay * qw + aw * qy + az * qx - ax * qz;\n out[6] = az * qw + aw * qz + ax * qy - ay * qx;\n out[7] = aw * qw - ax * qx - ay * qy - az * qz;\n return out;\n}\n/**\n * Rotates a dual quat by a given quaternion (q * a)\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat} q quaternion to rotate by\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @returns {quat2} out\n */\n\nfunction rotateByQuatPrepend(out, q, a) {\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3],\n bx = a[0],\n by = a[1],\n bz = a[2],\n bw = a[3];\n out[0] = qx * bw + qw * bx + qy * bz - qz * by;\n out[1] = qy * bw + qw * by + qz * bx - qx * bz;\n out[2] = qz * bw + qw * bz + qx * by - qy * bx;\n out[3] = qw * bw - qx * bx - qy * by - qz * bz;\n bx = a[4];\n by = a[5];\n bz = a[6];\n bw = a[7];\n out[4] = qx * bw + qw * bx + qy * bz - qz * by;\n out[5] = qy * bw + qw * by + qz * bx - qx * bz;\n out[6] = qz * bw + qw * bz + qx * by - qy * bx;\n out[7] = qw * bw - qx * bx - qy * by - qz * bz;\n return out;\n}\n/**\n * Rotates a dual quat around a given axis. Does the normalisation automatically\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the dual quaternion to rotate\n * @param {ReadonlyVec3} axis the axis to rotate around\n * @param {Number} rad how far the rotation should be\n * @returns {quat2} out\n */\n\nfunction rotateAroundAxis(out, a, axis, rad) {\n //Special case for rad = 0\n if (Math.abs(rad) < _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"]) {\n return copy(out, a);\n }\n\n var axisLength = Math.hypot(axis[0], axis[1], axis[2]);\n rad = rad * 0.5;\n var s = Math.sin(rad);\n var bx = s * axis[0] / axisLength;\n var by = s * axis[1] / axisLength;\n var bz = s * axis[2] / axisLength;\n var bw = Math.cos(rad);\n var ax1 = a[0],\n ay1 = a[1],\n az1 = a[2],\n aw1 = a[3];\n out[0] = ax1 * bw + aw1 * bx + ay1 * bz - az1 * by;\n out[1] = ay1 * bw + aw1 * by + az1 * bx - ax1 * bz;\n out[2] = az1 * bw + aw1 * bz + ax1 * by - ay1 * bx;\n out[3] = aw1 * bw - ax1 * bx - ay1 * by - az1 * bz;\n var ax = a[4],\n ay = a[5],\n az = a[6],\n aw = a[7];\n out[4] = ax * bw + aw * bx + ay * bz - az * by;\n out[5] = ay * bw + aw * by + az * bx - ax * bz;\n out[6] = az * bw + aw * bz + ax * by - ay * bx;\n out[7] = aw * bw - ax * bx - ay * by - az * bz;\n return out;\n}\n/**\n * Adds two dual quat's\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {quat2} out\n * @function\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n out[4] = a[4] + b[4];\n out[5] = a[5] + b[5];\n out[6] = a[6] + b[6];\n out[7] = a[7] + b[7];\n return out;\n}\n/**\n * Multiplies two dual quat's\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {quat2} out\n */\n\nfunction multiply(out, a, b) {\n var ax0 = a[0],\n ay0 = a[1],\n az0 = a[2],\n aw0 = a[3],\n bx1 = b[4],\n by1 = b[5],\n bz1 = b[6],\n bw1 = b[7],\n ax1 = a[4],\n ay1 = a[5],\n az1 = a[6],\n aw1 = a[7],\n bx0 = b[0],\n by0 = b[1],\n bz0 = b[2],\n bw0 = b[3];\n out[0] = ax0 * bw0 + aw0 * bx0 + ay0 * bz0 - az0 * by0;\n out[1] = ay0 * bw0 + aw0 * by0 + az0 * bx0 - ax0 * bz0;\n out[2] = az0 * bw0 + aw0 * bz0 + ax0 * by0 - ay0 * bx0;\n out[3] = aw0 * bw0 - ax0 * bx0 - ay0 * by0 - az0 * bz0;\n out[4] = ax0 * bw1 + aw0 * bx1 + ay0 * bz1 - az0 * by1 + ax1 * bw0 + aw1 * bx0 + ay1 * bz0 - az1 * by0;\n out[5] = ay0 * bw1 + aw0 * by1 + az0 * bx1 - ax0 * bz1 + ay1 * bw0 + aw1 * by0 + az1 * bx0 - ax1 * bz0;\n out[6] = az0 * bw1 + aw0 * bz1 + ax0 * by1 - ay0 * bx1 + az1 * bw0 + aw1 * bz0 + ax1 * by0 - ay1 * bx0;\n out[7] = aw0 * bw1 - ax0 * bx1 - ay0 * by1 - az0 * bz1 + aw1 * bw0 - ax1 * bx0 - ay1 * by0 - az1 * bz0;\n return out;\n}\n/**\n * Alias for {@link quat2.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Scales a dual quat by a scalar number\n *\n * @param {quat2} out the receiving dual quat\n * @param {ReadonlyQuat2} a the dual quat to scale\n * @param {Number} b amount to scale the dual quat by\n * @returns {quat2} out\n * @function\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n out[4] = a[4] * b;\n out[5] = a[5] * b;\n out[6] = a[6] * b;\n out[7] = a[7] * b;\n return out;\n}\n/**\n * Calculates the dot product of two dual quat's (The dot product of the real parts)\n *\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @returns {Number} dot product of a and b\n * @function\n */\n\nvar dot = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"dot\"];\n/**\n * Performs a linear interpolation between two dual quats's\n * NOTE: The resulting dual quaternions won't always be normalized (The error is most noticeable when t = 0.5)\n *\n * @param {quat2} out the receiving dual quat\n * @param {ReadonlyQuat2} a the first operand\n * @param {ReadonlyQuat2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {quat2} out\n */\n\nfunction lerp(out, a, b, t) {\n var mt = 1 - t;\n if (dot(a, b) < 0) t = -t;\n out[0] = a[0] * mt + b[0] * t;\n out[1] = a[1] * mt + b[1] * t;\n out[2] = a[2] * mt + b[2] * t;\n out[3] = a[3] * mt + b[3] * t;\n out[4] = a[4] * mt + b[4] * t;\n out[5] = a[5] * mt + b[5] * t;\n out[6] = a[6] * mt + b[6] * t;\n out[7] = a[7] * mt + b[7] * t;\n return out;\n}\n/**\n * Calculates the inverse of a dual quat. If they are normalized, conjugate is cheaper\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a dual quat to calculate inverse of\n * @returns {quat2} out\n */\n\nfunction invert(out, a) {\n var sqlen = squaredLength(a);\n out[0] = -a[0] / sqlen;\n out[1] = -a[1] / sqlen;\n out[2] = -a[2] / sqlen;\n out[3] = a[3] / sqlen;\n out[4] = -a[4] / sqlen;\n out[5] = -a[5] / sqlen;\n out[6] = -a[6] / sqlen;\n out[7] = a[7] / sqlen;\n return out;\n}\n/**\n * Calculates the conjugate of a dual quat\n * If the dual quaternion is normalized, this function is faster than quat2.inverse and produces the same result.\n *\n * @param {quat2} out the receiving quaternion\n * @param {ReadonlyQuat2} a quat to calculate conjugate of\n * @returns {quat2} out\n */\n\nfunction conjugate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = a[3];\n out[4] = -a[4];\n out[5] = -a[5];\n out[6] = -a[6];\n out[7] = a[7];\n return out;\n}\n/**\n * Calculates the length of a dual quat\n *\n * @param {ReadonlyQuat2} a dual quat to calculate length of\n * @returns {Number} length of a\n * @function\n */\n\nvar length = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"length\"];\n/**\n * Alias for {@link quat2.length}\n * @function\n */\n\nvar len = length;\n/**\n * Calculates the squared length of a dual quat\n *\n * @param {ReadonlyQuat2} a dual quat to calculate squared length of\n * @returns {Number} squared length of a\n * @function\n */\n\nvar squaredLength = _quat_js__WEBPACK_IMPORTED_MODULE_1__[\"squaredLength\"];\n/**\n * Alias for {@link quat2.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Normalize a dual quat\n *\n * @param {quat2} out the receiving dual quaternion\n * @param {ReadonlyQuat2} a dual quaternion to normalize\n * @returns {quat2} out\n * @function\n */\n\nfunction normalize(out, a) {\n var magnitude = squaredLength(a);\n\n if (magnitude > 0) {\n magnitude = Math.sqrt(magnitude);\n var a0 = a[0] / magnitude;\n var a1 = a[1] / magnitude;\n var a2 = a[2] / magnitude;\n var a3 = a[3] / magnitude;\n var b0 = a[4];\n var b1 = a[5];\n var b2 = a[6];\n var b3 = a[7];\n var a_dot_b = a0 * b0 + a1 * b1 + a2 * b2 + a3 * b3;\n out[0] = a0;\n out[1] = a1;\n out[2] = a2;\n out[3] = a3;\n out[4] = (b0 - a0 * a_dot_b) / magnitude;\n out[5] = (b1 - a1 * a_dot_b) / magnitude;\n out[6] = (b2 - a2 * a_dot_b) / magnitude;\n out[7] = (b3 - a3 * a_dot_b) / magnitude;\n }\n\n return out;\n}\n/**\n * Returns a string representation of a dual quatenion\n *\n * @param {ReadonlyQuat2} a dual quaternion to represent as a string\n * @returns {String} string representation of the dual quat\n */\n\nfunction str(a) {\n return \"quat2(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \", \" + a[4] + \", \" + a[5] + \", \" + a[6] + \", \" + a[7] + \")\";\n}\n/**\n * Returns whether or not the dual quaternions have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyQuat2} a the first dual quaternion.\n * @param {ReadonlyQuat2} b the second dual quaternion.\n * @returns {Boolean} true if the dual quaternions are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3] && a[4] === b[4] && a[5] === b[5] && a[6] === b[6] && a[7] === b[7];\n}\n/**\n * Returns whether or not the dual quaternions have approximately the same elements in the same position.\n *\n * @param {ReadonlyQuat2} a the first dual quat.\n * @param {ReadonlyQuat2} b the second dual quat.\n * @returns {Boolean} true if the dual quats are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3],\n a4 = a[4],\n a5 = a[5],\n a6 = a[6],\n a7 = a[7];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3],\n b4 = b[4],\n b5 = b[5],\n b6 = b[6],\n b7 = b[7];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3)) && Math.abs(a4 - b4) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a4), Math.abs(b4)) && Math.abs(a5 - b5) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a5), Math.abs(b5)) && Math.abs(a6 - b6) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a6), Math.abs(b6)) && Math.abs(a7 - b7) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a7), Math.abs(b7));\n}\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/quat2.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/dc/svd.js": -/*!**********************************************!*\ - !*** ./node_modules/ml-matrix/src/dc/svd.js ***! - \**********************************************/ -/*! exports provided: default */ +/***/ "./node_modules/gl-matrix/esm/vec2.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/vec2.js ***! + \********************************************/ +/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat2, transformMat2d, transformMat3, transformMat4, rotate, angle, zero, str, exactEquals, equals, len, sub, mul, div, dist, sqrDist, sqrLen, forEach */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return SingularValueDecomposition; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ../wrap/WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./util */ \"./node_modules/ml-matrix/src/dc/util.js\");\n\n\n\n\n\nclass SingularValueDecomposition {\n constructor(value, options = {}) {\n value = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(value);\n\n if (value.isEmpty()) {\n throw new Error('Matrix must be non-empty');\n }\n\n let m = value.rows;\n let n = value.columns;\n\n const {\n computeLeftSingularVectors = true,\n computeRightSingularVectors = true,\n autoTranspose = false,\n } = options;\n\n let wantu = Boolean(computeLeftSingularVectors);\n let wantv = Boolean(computeRightSingularVectors);\n\n let swapped = false;\n let a;\n if (m < n) {\n if (!autoTranspose) {\n a = value.clone();\n // eslint-disable-next-line no-console\n console.warn(\n 'Computing SVD on a matrix with more columns than rows. Consider enabling autoTranspose',\n );\n } else {\n a = value.transpose();\n m = a.rows;\n n = a.columns;\n swapped = true;\n let aux = wantu;\n wantu = wantv;\n wantv = aux;\n }\n } else {\n a = value.clone();\n }\n\n let nu = Math.min(m, n);\n let ni = Math.min(m + 1, n);\n let s = new Float64Array(ni);\n let U = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](m, nu);\n let V = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](n, n);\n\n let e = new Float64Array(n);\n let work = new Float64Array(m);\n\n let si = new Float64Array(ni);\n for (let i = 0; i < ni; i++) si[i] = i;\n\n let nct = Math.min(m - 1, n);\n let nrt = Math.max(0, Math.min(n - 2, m));\n let mrc = Math.max(nct, nrt);\n\n for (let k = 0; k < mrc; k++) {\n if (k < nct) {\n s[k] = 0;\n for (let i = k; i < m; i++) {\n s[k] = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(s[k], a.get(i, k));\n }\n if (s[k] !== 0) {\n if (a.get(k, k) < 0) {\n s[k] = -s[k];\n }\n for (let i = k; i < m; i++) {\n a.set(i, k, a.get(i, k) / s[k]);\n }\n a.set(k, k, a.get(k, k) + 1);\n }\n s[k] = -s[k];\n }\n\n for (let j = k + 1; j < n; j++) {\n if (k < nct && s[k] !== 0) {\n let t = 0;\n for (let i = k; i < m; i++) {\n t += a.get(i, k) * a.get(i, j);\n }\n t = -t / a.get(k, k);\n for (let i = k; i < m; i++) {\n a.set(i, j, a.get(i, j) + t * a.get(i, k));\n }\n }\n e[j] = a.get(k, j);\n }\n\n if (wantu && k < nct) {\n for (let i = k; i < m; i++) {\n U.set(i, k, a.get(i, k));\n }\n }\n\n if (k < nrt) {\n e[k] = 0;\n for (let i = k + 1; i < n; i++) {\n e[k] = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(e[k], e[i]);\n }\n if (e[k] !== 0) {\n if (e[k + 1] < 0) {\n e[k] = 0 - e[k];\n }\n for (let i = k + 1; i < n; i++) {\n e[i] /= e[k];\n }\n e[k + 1] += 1;\n }\n e[k] = -e[k];\n if (k + 1 < m && e[k] !== 0) {\n for (let i = k + 1; i < m; i++) {\n work[i] = 0;\n }\n for (let i = k + 1; i < m; i++) {\n for (let j = k + 1; j < n; j++) {\n work[i] += e[j] * a.get(i, j);\n }\n }\n for (let j = k + 1; j < n; j++) {\n let t = -e[j] / e[k + 1];\n for (let i = k + 1; i < m; i++) {\n a.set(i, j, a.get(i, j) + t * work[i]);\n }\n }\n }\n if (wantv) {\n for (let i = k + 1; i < n; i++) {\n V.set(i, k, e[i]);\n }\n }\n }\n }\n\n let p = Math.min(n, m + 1);\n if (nct < n) {\n s[nct] = a.get(nct, nct);\n }\n if (m < p) {\n s[p - 1] = 0;\n }\n if (nrt + 1 < p) {\n e[nrt] = a.get(nrt, p - 1);\n }\n e[p - 1] = 0;\n\n if (wantu) {\n for (let j = nct; j < nu; j++) {\n for (let i = 0; i < m; i++) {\n U.set(i, j, 0);\n }\n U.set(j, j, 1);\n }\n for (let k = nct - 1; k >= 0; k--) {\n if (s[k] !== 0) {\n for (let j = k + 1; j < nu; j++) {\n let t = 0;\n for (let i = k; i < m; i++) {\n t += U.get(i, k) * U.get(i, j);\n }\n t = -t / U.get(k, k);\n for (let i = k; i < m; i++) {\n U.set(i, j, U.get(i, j) + t * U.get(i, k));\n }\n }\n for (let i = k; i < m; i++) {\n U.set(i, k, -U.get(i, k));\n }\n U.set(k, k, 1 + U.get(k, k));\n for (let i = 0; i < k - 1; i++) {\n U.set(i, k, 0);\n }\n } else {\n for (let i = 0; i < m; i++) {\n U.set(i, k, 0);\n }\n U.set(k, k, 1);\n }\n }\n }\n\n if (wantv) {\n for (let k = n - 1; k >= 0; k--) {\n if (k < nrt && e[k] !== 0) {\n for (let j = k + 1; j < n; j++) {\n let t = 0;\n for (let i = k + 1; i < n; i++) {\n t += V.get(i, k) * V.get(i, j);\n }\n t = -t / V.get(k + 1, k);\n for (let i = k + 1; i < n; i++) {\n V.set(i, j, V.get(i, j) + t * V.get(i, k));\n }\n }\n }\n for (let i = 0; i < n; i++) {\n V.set(i, k, 0);\n }\n V.set(k, k, 1);\n }\n }\n\n let pp = p - 1;\n let iter = 0;\n let eps = Number.EPSILON;\n while (p > 0) {\n let k, kase;\n for (k = p - 2; k >= -1; k--) {\n if (k === -1) {\n break;\n }\n const alpha =\n Number.MIN_VALUE + eps * Math.abs(s[k] + Math.abs(s[k + 1]));\n if (Math.abs(e[k]) <= alpha || Number.isNaN(e[k])) {\n e[k] = 0;\n break;\n }\n }\n if (k === p - 2) {\n kase = 4;\n } else {\n let ks;\n for (ks = p - 1; ks >= k; ks--) {\n if (ks === k) {\n break;\n }\n let t =\n (ks !== p ? Math.abs(e[ks]) : 0) +\n (ks !== k + 1 ? Math.abs(e[ks - 1]) : 0);\n if (Math.abs(s[ks]) <= eps * t) {\n s[ks] = 0;\n break;\n }\n }\n if (ks === k) {\n kase = 3;\n } else if (ks === p - 1) {\n kase = 1;\n } else {\n kase = 2;\n k = ks;\n }\n }\n\n k++;\n\n switch (kase) {\n case 1: {\n let f = e[p - 2];\n e[p - 2] = 0;\n for (let j = p - 2; j >= k; j--) {\n let t = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(s[j], f);\n let cs = s[j] / t;\n let sn = f / t;\n s[j] = t;\n if (j !== k) {\n f = -sn * e[j - 1];\n e[j - 1] = cs * e[j - 1];\n }\n if (wantv) {\n for (let i = 0; i < n; i++) {\n t = cs * V.get(i, j) + sn * V.get(i, p - 1);\n V.set(i, p - 1, -sn * V.get(i, j) + cs * V.get(i, p - 1));\n V.set(i, j, t);\n }\n }\n }\n break;\n }\n case 2: {\n let f = e[k - 1];\n e[k - 1] = 0;\n for (let j = k; j < p; j++) {\n let t = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(s[j], f);\n let cs = s[j] / t;\n let sn = f / t;\n s[j] = t;\n f = -sn * e[j];\n e[j] = cs * e[j];\n if (wantu) {\n for (let i = 0; i < m; i++) {\n t = cs * U.get(i, j) + sn * U.get(i, k - 1);\n U.set(i, k - 1, -sn * U.get(i, j) + cs * U.get(i, k - 1));\n U.set(i, j, t);\n }\n }\n }\n break;\n }\n case 3: {\n const scale = Math.max(\n Math.abs(s[p - 1]),\n Math.abs(s[p - 2]),\n Math.abs(e[p - 2]),\n Math.abs(s[k]),\n Math.abs(e[k]),\n );\n const sp = s[p - 1] / scale;\n const spm1 = s[p - 2] / scale;\n const epm1 = e[p - 2] / scale;\n const sk = s[k] / scale;\n const ek = e[k] / scale;\n const b = ((spm1 + sp) * (spm1 - sp) + epm1 * epm1) / 2;\n const c = sp * epm1 * (sp * epm1);\n let shift = 0;\n if (b !== 0 || c !== 0) {\n if (b < 0) {\n shift = 0 - Math.sqrt(b * b + c);\n } else {\n shift = Math.sqrt(b * b + c);\n }\n shift = c / (b + shift);\n }\n let f = (sk + sp) * (sk - sp) + shift;\n let g = sk * ek;\n for (let j = k; j < p - 1; j++) {\n let t = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(f, g);\n if (t === 0) t = Number.MIN_VALUE;\n let cs = f / t;\n let sn = g / t;\n if (j !== k) {\n e[j - 1] = t;\n }\n f = cs * s[j] + sn * e[j];\n e[j] = cs * e[j] - sn * s[j];\n g = sn * s[j + 1];\n s[j + 1] = cs * s[j + 1];\n if (wantv) {\n for (let i = 0; i < n; i++) {\n t = cs * V.get(i, j) + sn * V.get(i, j + 1);\n V.set(i, j + 1, -sn * V.get(i, j) + cs * V.get(i, j + 1));\n V.set(i, j, t);\n }\n }\n t = Object(_util__WEBPACK_IMPORTED_MODULE_2__[\"hypotenuse\"])(f, g);\n if (t === 0) t = Number.MIN_VALUE;\n cs = f / t;\n sn = g / t;\n s[j] = t;\n f = cs * e[j] + sn * s[j + 1];\n s[j + 1] = -sn * e[j] + cs * s[j + 1];\n g = sn * e[j + 1];\n e[j + 1] = cs * e[j + 1];\n if (wantu && j < m - 1) {\n for (let i = 0; i < m; i++) {\n t = cs * U.get(i, j) + sn * U.get(i, j + 1);\n U.set(i, j + 1, -sn * U.get(i, j) + cs * U.get(i, j + 1));\n U.set(i, j, t);\n }\n }\n }\n e[p - 2] = f;\n iter = iter + 1;\n break;\n }\n case 4: {\n if (s[k] <= 0) {\n s[k] = s[k] < 0 ? -s[k] : 0;\n if (wantv) {\n for (let i = 0; i <= pp; i++) {\n V.set(i, k, -V.get(i, k));\n }\n }\n }\n while (k < pp) {\n if (s[k] >= s[k + 1]) {\n break;\n }\n let t = s[k];\n s[k] = s[k + 1];\n s[k + 1] = t;\n if (wantv && k < n - 1) {\n for (let i = 0; i < n; i++) {\n t = V.get(i, k + 1);\n V.set(i, k + 1, V.get(i, k));\n V.set(i, k, t);\n }\n }\n if (wantu && k < m - 1) {\n for (let i = 0; i < m; i++) {\n t = U.get(i, k + 1);\n U.set(i, k + 1, U.get(i, k));\n U.set(i, k, t);\n }\n }\n k++;\n }\n iter = 0;\n p--;\n break;\n }\n // no default\n }\n }\n\n if (swapped) {\n let tmp = V;\n V = U;\n U = tmp;\n }\n\n this.m = m;\n this.n = n;\n this.s = s;\n this.U = U;\n this.V = V;\n }\n\n solve(value) {\n let Y = value;\n let e = this.threshold;\n let scols = this.s.length;\n let Ls = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].zeros(scols, scols);\n\n for (let i = 0; i < scols; i++) {\n if (Math.abs(this.s[i]) <= e) {\n Ls.set(i, i, 0);\n } else {\n Ls.set(i, i, 1 / this.s[i]);\n }\n }\n\n let U = this.U;\n let V = this.rightSingularVectors;\n\n let VL = V.mmul(Ls);\n let vrows = V.rows;\n let urows = U.rows;\n let VLU = _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].zeros(vrows, urows);\n\n for (let i = 0; i < vrows; i++) {\n for (let j = 0; j < urows; j++) {\n let sum = 0;\n for (let k = 0; k < scols; k++) {\n sum += VL.get(i, k) * U.get(j, k);\n }\n VLU.set(i, j, sum);\n }\n }\n\n return VLU.mmul(Y);\n }\n\n solveForDiagonal(value) {\n return this.solve(_matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].diag(value));\n }\n\n inverse() {\n let V = this.V;\n let e = this.threshold;\n let vrows = V.rows;\n let vcols = V.columns;\n let X = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](vrows, this.s.length);\n\n for (let i = 0; i < vrows; i++) {\n for (let j = 0; j < vcols; j++) {\n if (Math.abs(this.s[j]) > e) {\n X.set(i, j, V.get(i, j) / this.s[j]);\n }\n }\n }\n\n let U = this.U;\n\n let urows = U.rows;\n let ucols = U.columns;\n let Y = new _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"](vrows, urows);\n\n for (let i = 0; i < vrows; i++) {\n for (let j = 0; j < urows; j++) {\n let sum = 0;\n for (let k = 0; k < ucols; k++) {\n sum += X.get(i, k) * U.get(j, k);\n }\n Y.set(i, j, sum);\n }\n }\n\n return Y;\n }\n\n get condition() {\n return this.s[0] / this.s[Math.min(this.m, this.n) - 1];\n }\n\n get norm2() {\n return this.s[0];\n }\n\n get rank() {\n let tol = Math.max(this.m, this.n) * this.s[0] * Number.EPSILON;\n let r = 0;\n let s = this.s;\n for (let i = 0, ii = s.length; i < ii; i++) {\n if (s[i] > tol) {\n r++;\n }\n }\n return r;\n }\n\n get diagonal() {\n return Array.from(this.s);\n }\n\n get threshold() {\n return (Number.EPSILON / 2) * Math.max(this.m, this.n) * this.s[0];\n }\n\n get leftSingularVectors() {\n return this.U;\n }\n\n get rightSingularVectors() {\n return this.V;\n }\n\n get diagonalMatrix() {\n return _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"].diag(this.s);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/dc/svd.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat2\", function() { return transformMat2; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat2d\", function() { return transformMat2d; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat3\", function() { return transformMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotate\", function() { return rotate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angle\", function() { return angle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 2 Dimensional Vector\n * @module vec2\n */\n\n/**\n * Creates a new, empty vec2\n *\n * @returns {vec2} a new 2D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec2 initialized with values from an existing vector\n *\n * @param {ReadonlyVec2} a vector to clone\n * @returns {vec2} a new 2D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Creates a new vec2 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} a new 2D vector\n */\n\nfunction fromValues(x, y) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](2);\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Copy the values from one vec2 to another\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the source vector\n * @returns {vec2} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n return out;\n}\n/**\n * Set the components of a vec2 to the given values\n *\n * @param {vec2} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @returns {vec2} out\n */\n\nfunction set(out, x, y) {\n out[0] = x;\n out[1] = y;\n return out;\n}\n/**\n * Adds two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n return out;\n}\n/**\n * Multiplies two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n return out;\n}\n/**\n * Divides two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n return out;\n}\n/**\n * Math.ceil the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to ceil\n * @returns {vec2} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n return out;\n}\n/**\n * Math.floor the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to floor\n * @returns {vec2} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n return out;\n}\n/**\n * Returns the minimum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n return out;\n}\n/**\n * Returns the maximum of two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec2} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n return out;\n}\n/**\n * Math.round the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to round\n * @returns {vec2} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n return out;\n}\n/**\n * Scales a vec2 by a scalar number\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec2} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n return out;\n}\n/**\n * Adds two vec2's after scaling the second operand by a scalar value\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec2} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared euclidian distance between two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0],\n y = b[1] - a[1];\n return x * x + y * y;\n}\n/**\n * Calculates the length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0],\n y = a[1];\n return Math.hypot(x, y);\n}\n/**\n * Calculates the squared length of a vec2\n *\n * @param {ReadonlyVec2} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0],\n y = a[1];\n return x * x + y * y;\n}\n/**\n * Negates the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to negate\n * @returns {vec2} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to invert\n * @returns {vec2} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n return out;\n}\n/**\n * Normalize a vec2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a vector to normalize\n * @returns {vec2} out\n */\n\nfunction normalize(out, a) {\n var x = a[0],\n y = a[1];\n var len = x * x + y * y;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec2's\n *\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1];\n}\n/**\n * Computes the cross product of two vec2's\n * Note that the cross product must by definition produce a 3D vector\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @returns {vec3} out\n */\n\nfunction cross(out, a, b) {\n var z = a[0] * b[1] - a[1] * b[0];\n out[0] = out[1] = 0;\n out[2] = z;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec2's\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the first operand\n * @param {ReadonlyVec2} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec2} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0],\n ay = a[1];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec2} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec2} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 * Math.PI;\n out[0] = Math.cos(r) * scale;\n out[1] = Math.sin(r) * scale;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat2(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y;\n out[1] = m[1] * x + m[3] * y;\n return out;\n}\n/**\n * Transforms the vec2 with a mat2d\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat2d} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat2d(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[2] * y + m[4];\n out[1] = m[1] * x + m[3] * y + m[5];\n return out;\n}\n/**\n * Transforms the vec2 with a mat3\n * 3rd vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat3} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1];\n out[0] = m[0] * x + m[3] * y + m[6];\n out[1] = m[1] * x + m[4] * y + m[7];\n return out;\n}\n/**\n * Transforms the vec2 with a mat4\n * 3rd vector component is implicitly '0'\n * 4th vector component is implicitly '1'\n *\n * @param {vec2} out the receiving vector\n * @param {ReadonlyVec2} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec2} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0];\n var y = a[1];\n out[0] = m[0] * x + m[4] * y + m[12];\n out[1] = m[1] * x + m[5] * y + m[13];\n return out;\n}\n/**\n * Rotate a 2D vector\n * @param {vec2} out The receiving vec2\n * @param {ReadonlyVec2} a The vec2 point to rotate\n * @param {ReadonlyVec2} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec2} out\n */\n\nfunction rotate(out, a, b, rad) {\n //Translate point to the origin\n var p0 = a[0] - b[0],\n p1 = a[1] - b[1],\n sinC = Math.sin(rad),\n cosC = Math.cos(rad); //perform rotation and translate to correct position\n\n out[0] = p0 * cosC - p1 * sinC + b[0];\n out[1] = p0 * sinC + p1 * cosC + b[1];\n return out;\n}\n/**\n * Get the angle between two 2D vectors\n * @param {ReadonlyVec2} a The first operand\n * @param {ReadonlyVec2} b The second operand\n * @returns {Number} The angle in radians\n */\n\nfunction angle(a, b) {\n var x1 = a[0],\n y1 = a[1],\n x2 = b[0],\n y2 = b[1],\n // mag is the product of the magnitudes of a and b\n mag = Math.sqrt(x1 * x1 + y1 * y1) * Math.sqrt(x2 * x2 + y2 * y2),\n // mag &&.. short circuits if mag == 0\n cosine = mag && (x1 * x2 + y1 * y2) / mag; // Math.min(Math.max(cosine, -1), 1) clamps the cosine between -1 and 1\n\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec2 to zero\n *\n * @param {vec2} out the receiving vector\n * @returns {vec2} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec2} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec2(\" + a[0] + \", \" + a[1] + \")\";\n}\n/**\n * Returns whether or not the vectors exactly have the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec2} a The first vector.\n * @param {ReadonlyVec2} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1];\n var b0 = b[0],\n b1 = b[1];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1));\n}\n/**\n * Alias for {@link vec2.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec2.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec2.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec2.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec2.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec2.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec2.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec2s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec2. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec2s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 2;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/vec2.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/dc/util.js": -/*!***********************************************!*\ - !*** ./node_modules/ml-matrix/src/dc/util.js ***! - \***********************************************/ -/*! exports provided: hypotenuse */ +/***/ "./node_modules/gl-matrix/esm/vec3.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/vec3.js ***! + \********************************************/ +/*! exports provided: create, clone, length, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, squaredLength, negate, inverse, normalize, dot, cross, lerp, hermite, bezier, random, transformMat4, transformMat3, transformQuat, rotateX, rotateY, rotateZ, angle, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hypotenuse\", function() { return hypotenuse; });\nfunction hypotenuse(a, b) {\n let r = 0;\n if (Math.abs(a) > Math.abs(b)) {\n r = b / a;\n return Math.abs(a) * Math.sqrt(1 + r * r);\n }\n if (b !== 0) {\n r = a / b;\n return Math.abs(b) * Math.sqrt(1 + r * r);\n }\n return 0;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/dc/util.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"hermite\", function() { return hermite; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"bezier\", function() { return bezier; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat3\", function() { return transformMat3; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformQuat\", function() { return transformQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateX\", function() { return rotateX; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateY\", function() { return rotateY; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"rotateZ\", function() { return rotateZ; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"angle\", function() { return angle; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 3 Dimensional Vector\n * @module vec3\n */\n\n/**\n * Creates a new, empty vec3\n *\n * @returns {vec3} a new 3D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec3 initialized with values from an existing vector\n *\n * @param {ReadonlyVec3} a vector to clone\n * @returns {vec3} a new 3D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Calculates the length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Creates a new vec3 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} a new 3D vector\n */\n\nfunction fromValues(x, y, z) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](3);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Copy the values from one vec3 to another\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the source vector\n * @returns {vec3} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n return out;\n}\n/**\n * Set the components of a vec3 to the given values\n *\n * @param {vec3} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @returns {vec3} out\n */\n\nfunction set(out, x, y, z) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n return out;\n}\n/**\n * Adds two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n return out;\n}\n/**\n * Multiplies two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n return out;\n}\n/**\n * Divides two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n return out;\n}\n/**\n * Math.ceil the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to ceil\n * @returns {vec3} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n return out;\n}\n/**\n * Math.floor the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to floor\n * @returns {vec3} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n return out;\n}\n/**\n * Returns the minimum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n return out;\n}\n/**\n * Returns the maximum of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n return out;\n}\n/**\n * Math.round the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to round\n * @returns {vec3} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n return out;\n}\n/**\n * Scales a vec3 by a scalar number\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec3} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n return out;\n}\n/**\n * Adds two vec3's after scaling the second operand by a scalar value\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec3} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return Math.hypot(x, y, z);\n}\n/**\n * Calculates the squared euclidian distance between two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Calculates the squared length of a vec3\n *\n * @param {ReadonlyVec3} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n return x * x + y * y + z * z;\n}\n/**\n * Negates the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to negate\n * @returns {vec3} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to invert\n * @returns {vec3} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n return out;\n}\n/**\n * Normalize a vec3\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a vector to normalize\n * @returns {vec3} out\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var len = x * x + y * y + z * z;\n\n if (len > 0) {\n //TODO: evaluate use of glm_invsqrt here?\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = a[0] * len;\n out[1] = a[1] * len;\n out[2] = a[2] * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec3's\n *\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2];\n}\n/**\n * Computes the cross product of two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @returns {vec3} out\n */\n\nfunction cross(out, a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2];\n var bx = b[0],\n by = b[1],\n bz = b[2];\n out[0] = ay * bz - az * by;\n out[1] = az * bx - ax * bz;\n out[2] = ax * by - ay * bx;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec3's\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n return out;\n}\n/**\n * Performs a hermite interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction hermite(out, a, b, c, d, t) {\n var factorTimes2 = t * t;\n var factor1 = factorTimes2 * (2 * t - 3) + 1;\n var factor2 = factorTimes2 * (t - 2) + t;\n var factor3 = factorTimes2 * (t - 1);\n var factor4 = factorTimes2 * (3 - 2 * t);\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Performs a bezier interpolation with two control points\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the first operand\n * @param {ReadonlyVec3} b the second operand\n * @param {ReadonlyVec3} c the third operand\n * @param {ReadonlyVec3} d the fourth operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec3} out\n */\n\nfunction bezier(out, a, b, c, d, t) {\n var inverseFactor = 1 - t;\n var inverseFactorTimesTwo = inverseFactor * inverseFactor;\n var factorTimes2 = t * t;\n var factor1 = inverseFactorTimesTwo * inverseFactor;\n var factor2 = 3 * t * inverseFactorTimesTwo;\n var factor3 = 3 * factorTimes2 * inverseFactor;\n var factor4 = factorTimes2 * t;\n out[0] = a[0] * factor1 + b[0] * factor2 + c[0] * factor3 + d[0] * factor4;\n out[1] = a[1] * factor1 + b[1] * factor2 + c[1] * factor3 + d[1] * factor4;\n out[2] = a[2] * factor1 + b[2] * factor2 + c[2] * factor3 + d[2] * factor4;\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec3} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec3} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0;\n var r = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 * Math.PI;\n var z = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2.0 - 1.0;\n var zScale = Math.sqrt(1.0 - z * z) * scale;\n out[0] = Math.cos(r) * zScale;\n out[1] = Math.sin(r) * zScale;\n out[2] = z * scale;\n return out;\n}\n/**\n * Transforms the vec3 with a mat4.\n * 4th vector component is implicitly '1'\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec3} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var w = m[3] * x + m[7] * y + m[11] * z + m[15];\n w = w || 1.0;\n out[0] = (m[0] * x + m[4] * y + m[8] * z + m[12]) / w;\n out[1] = (m[1] * x + m[5] * y + m[9] * z + m[13]) / w;\n out[2] = (m[2] * x + m[6] * y + m[10] * z + m[14]) / w;\n return out;\n}\n/**\n * Transforms the vec3 with a mat3.\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyMat3} m the 3x3 matrix to transform with\n * @returns {vec3} out\n */\n\nfunction transformMat3(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2];\n out[0] = x * m[0] + y * m[3] + z * m[6];\n out[1] = x * m[1] + y * m[4] + z * m[7];\n out[2] = x * m[2] + y * m[5] + z * m[8];\n return out;\n}\n/**\n * Transforms the vec3 with a quat\n * Can also be used for dual quaternions. (Multiply it with the real part)\n *\n * @param {vec3} out the receiving vector\n * @param {ReadonlyVec3} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec3} out\n */\n\nfunction transformQuat(out, a, q) {\n // benchmarks: https://jsperf.com/quaternion-transform-vec3-implementations-fixed\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3];\n var x = a[0],\n y = a[1],\n z = a[2]; // var qvec = [qx, qy, qz];\n // var uv = vec3.cross([], qvec, a);\n\n var uvx = qy * z - qz * y,\n uvy = qz * x - qx * z,\n uvz = qx * y - qy * x; // var uuv = vec3.cross([], qvec, uv);\n\n var uuvx = qy * uvz - qz * uvy,\n uuvy = qz * uvx - qx * uvz,\n uuvz = qx * uvy - qy * uvx; // vec3.scale(uv, uv, 2 * w);\n\n var w2 = qw * 2;\n uvx *= w2;\n uvy *= w2;\n uvz *= w2; // vec3.scale(uuv, uuv, 2);\n\n uuvx *= 2;\n uuvy *= 2;\n uuvz *= 2; // return vec3.add(out, a, vec3.add(out, uv, uuv));\n\n out[0] = x + uvx + uuvx;\n out[1] = y + uvy + uuvy;\n out[2] = z + uvz + uuvz;\n return out;\n}\n/**\n * Rotate a 3D vector around the x-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateX(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0];\n r[1] = p[1] * Math.cos(rad) - p[2] * Math.sin(rad);\n r[2] = p[1] * Math.sin(rad) + p[2] * Math.cos(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the y-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateY(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[2] * Math.sin(rad) + p[0] * Math.cos(rad);\n r[1] = p[1];\n r[2] = p[2] * Math.cos(rad) - p[0] * Math.sin(rad); //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Rotate a 3D vector around the z-axis\n * @param {vec3} out The receiving vec3\n * @param {ReadonlyVec3} a The vec3 point to rotate\n * @param {ReadonlyVec3} b The origin of the rotation\n * @param {Number} rad The angle of rotation in radians\n * @returns {vec3} out\n */\n\nfunction rotateZ(out, a, b, rad) {\n var p = [],\n r = []; //Translate point to the origin\n\n p[0] = a[0] - b[0];\n p[1] = a[1] - b[1];\n p[2] = a[2] - b[2]; //perform rotation\n\n r[0] = p[0] * Math.cos(rad) - p[1] * Math.sin(rad);\n r[1] = p[0] * Math.sin(rad) + p[1] * Math.cos(rad);\n r[2] = p[2]; //translate to correct position\n\n out[0] = r[0] + b[0];\n out[1] = r[1] + b[1];\n out[2] = r[2] + b[2];\n return out;\n}\n/**\n * Get the angle between two 3D vectors\n * @param {ReadonlyVec3} a The first operand\n * @param {ReadonlyVec3} b The second operand\n * @returns {Number} The angle in radians\n */\n\nfunction angle(a, b) {\n var ax = a[0],\n ay = a[1],\n az = a[2],\n bx = b[0],\n by = b[1],\n bz = b[2],\n mag1 = Math.sqrt(ax * ax + ay * ay + az * az),\n mag2 = Math.sqrt(bx * bx + by * by + bz * bz),\n mag = mag1 * mag2,\n cosine = mag && dot(a, b) / mag;\n return Math.acos(Math.min(Math.max(cosine, -1), 1));\n}\n/**\n * Set the components of a vec3 to zero\n *\n * @param {vec3} out the receiving vector\n * @returns {vec3} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec3} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec3(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec3} a The first vector.\n * @param {ReadonlyVec3} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2));\n}\n/**\n * Alias for {@link vec3.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec3.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec3.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec3.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec3.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec3.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec3.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec3s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec3. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec3s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 3;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/vec3.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/decompositions.js": -/*!******************************************************!*\ - !*** ./node_modules/ml-matrix/src/decompositions.js ***! - \******************************************************/ -/*! exports provided: inverse, solve */ +/***/ "./node_modules/gl-matrix/esm/vec4.js": +/*!********************************************!*\ + !*** ./node_modules/gl-matrix/esm/vec4.js ***! + \********************************************/ +/*! exports provided: create, clone, fromValues, copy, set, add, subtract, multiply, divide, ceil, floor, min, max, round, scale, scaleAndAdd, distance, squaredDistance, length, squaredLength, negate, inverse, normalize, dot, cross, lerp, random, transformMat4, transformQuat, zero, str, exactEquals, equals, sub, mul, div, dist, sqrDist, len, sqrLen, forEach */ /***/ (function(module, __webpack_exports__, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"solve\", function() { return solve; });\n/* harmony import */ var _dc_lu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dc/lu */ \"./node_modules/ml-matrix/src/dc/lu.js\");\n/* harmony import */ var _dc_qr__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./dc/qr */ \"./node_modules/ml-matrix/src/dc/qr.js\");\n/* harmony import */ var _dc_svd__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./dc/svd */ \"./node_modules/ml-matrix/src/dc/svd.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wrap/WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\n\n\n\nfunction inverse(matrix, useSVD = false) {\n matrix = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__[\"default\"].checkMatrix(matrix);\n if (useSVD) {\n return new _dc_svd__WEBPACK_IMPORTED_MODULE_2__[\"default\"](matrix).inverse();\n } else {\n return solve(matrix, _matrix__WEBPACK_IMPORTED_MODULE_3__[\"default\"].eye(matrix.rows));\n }\n}\n\nfunction solve(leftHandSide, rightHandSide, useSVD = false) {\n leftHandSide = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__[\"default\"].checkMatrix(leftHandSide);\n rightHandSide = _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__[\"default\"].checkMatrix(rightHandSide);\n if (useSVD) {\n return new _dc_svd__WEBPACK_IMPORTED_MODULE_2__[\"default\"](leftHandSide).solve(rightHandSide);\n } else {\n return leftHandSide.isSquare()\n ? new _dc_lu__WEBPACK_IMPORTED_MODULE_0__[\"default\"](leftHandSide).solve(rightHandSide)\n : new _dc_qr__WEBPACK_IMPORTED_MODULE_1__[\"default\"](leftHandSide).solve(rightHandSide);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/decompositions.js?"); +"use strict"; +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"create\", function() { return create; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"clone\", function() { return clone; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"fromValues\", function() { return fromValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"copy\", function() { return copy; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"set\", function() { return set; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"add\", function() { return add; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"subtract\", function() { return subtract; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"multiply\", function() { return multiply; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"divide\", function() { return divide; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"ceil\", function() { return ceil; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"floor\", function() { return floor; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"min\", function() { return min; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"max\", function() { return max; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"round\", function() { return round; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scale\", function() { return scale; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAndAdd\", function() { return scaleAndAdd; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"distance\", function() { return distance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredDistance\", function() { return squaredDistance; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"length\", function() { return length; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"squaredLength\", function() { return squaredLength; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"negate\", function() { return negate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return inverse; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"normalize\", function() { return normalize; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dot\", function() { return dot; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"cross\", function() { return cross; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"lerp\", function() { return lerp; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"random\", function() { return random; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformMat4\", function() { return transformMat4; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"transformQuat\", function() { return transformQuat; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"zero\", function() { return zero; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"str\", function() { return str; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"exactEquals\", function() { return exactEquals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"equals\", function() { return equals; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sub\", function() { return sub; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"mul\", function() { return mul; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"div\", function() { return div; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"dist\", function() { return dist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrDist\", function() { return sqrDist; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"len\", function() { return len; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sqrLen\", function() { return sqrLen; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"forEach\", function() { return forEach; });\n/* harmony import */ var _common_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./common.js */ \"./node_modules/gl-matrix/esm/common.js\");\n\n/**\n * 4 Dimensional Vector\n * @module vec4\n */\n\n/**\n * Creates a new, empty vec4\n *\n * @returns {vec4} a new 4D vector\n */\n\nfunction create() {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n\n if (_common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"] != Float32Array) {\n out[0] = 0;\n out[1] = 0;\n out[2] = 0;\n out[3] = 0;\n }\n\n return out;\n}\n/**\n * Creates a new vec4 initialized with values from an existing vector\n *\n * @param {ReadonlyVec4} a vector to clone\n * @returns {vec4} a new 4D vector\n */\n\nfunction clone(a) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Creates a new vec4 initialized with the given values\n *\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} a new 4D vector\n */\n\nfunction fromValues(x, y, z, w) {\n var out = new _common_js__WEBPACK_IMPORTED_MODULE_0__[\"ARRAY_TYPE\"](4);\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Copy the values from one vec4 to another\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the source vector\n * @returns {vec4} out\n */\n\nfunction copy(out, a) {\n out[0] = a[0];\n out[1] = a[1];\n out[2] = a[2];\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to the given values\n *\n * @param {vec4} out the receiving vector\n * @param {Number} x X component\n * @param {Number} y Y component\n * @param {Number} z Z component\n * @param {Number} w W component\n * @returns {vec4} out\n */\n\nfunction set(out, x, y, z, w) {\n out[0] = x;\n out[1] = y;\n out[2] = z;\n out[3] = w;\n return out;\n}\n/**\n * Adds two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction add(out, a, b) {\n out[0] = a[0] + b[0];\n out[1] = a[1] + b[1];\n out[2] = a[2] + b[2];\n out[3] = a[3] + b[3];\n return out;\n}\n/**\n * Subtracts vector b from vector a\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction subtract(out, a, b) {\n out[0] = a[0] - b[0];\n out[1] = a[1] - b[1];\n out[2] = a[2] - b[2];\n out[3] = a[3] - b[3];\n return out;\n}\n/**\n * Multiplies two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction multiply(out, a, b) {\n out[0] = a[0] * b[0];\n out[1] = a[1] * b[1];\n out[2] = a[2] * b[2];\n out[3] = a[3] * b[3];\n return out;\n}\n/**\n * Divides two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction divide(out, a, b) {\n out[0] = a[0] / b[0];\n out[1] = a[1] / b[1];\n out[2] = a[2] / b[2];\n out[3] = a[3] / b[3];\n return out;\n}\n/**\n * Math.ceil the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to ceil\n * @returns {vec4} out\n */\n\nfunction ceil(out, a) {\n out[0] = Math.ceil(a[0]);\n out[1] = Math.ceil(a[1]);\n out[2] = Math.ceil(a[2]);\n out[3] = Math.ceil(a[3]);\n return out;\n}\n/**\n * Math.floor the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to floor\n * @returns {vec4} out\n */\n\nfunction floor(out, a) {\n out[0] = Math.floor(a[0]);\n out[1] = Math.floor(a[1]);\n out[2] = Math.floor(a[2]);\n out[3] = Math.floor(a[3]);\n return out;\n}\n/**\n * Returns the minimum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction min(out, a, b) {\n out[0] = Math.min(a[0], b[0]);\n out[1] = Math.min(a[1], b[1]);\n out[2] = Math.min(a[2], b[2]);\n out[3] = Math.min(a[3], b[3]);\n return out;\n}\n/**\n * Returns the maximum of two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {vec4} out\n */\n\nfunction max(out, a, b) {\n out[0] = Math.max(a[0], b[0]);\n out[1] = Math.max(a[1], b[1]);\n out[2] = Math.max(a[2], b[2]);\n out[3] = Math.max(a[3], b[3]);\n return out;\n}\n/**\n * Math.round the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to round\n * @returns {vec4} out\n */\n\nfunction round(out, a) {\n out[0] = Math.round(a[0]);\n out[1] = Math.round(a[1]);\n out[2] = Math.round(a[2]);\n out[3] = Math.round(a[3]);\n return out;\n}\n/**\n * Scales a vec4 by a scalar number\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to scale\n * @param {Number} b amount to scale the vector by\n * @returns {vec4} out\n */\n\nfunction scale(out, a, b) {\n out[0] = a[0] * b;\n out[1] = a[1] * b;\n out[2] = a[2] * b;\n out[3] = a[3] * b;\n return out;\n}\n/**\n * Adds two vec4's after scaling the second operand by a scalar value\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} scale the amount to scale b by before adding\n * @returns {vec4} out\n */\n\nfunction scaleAndAdd(out, a, b, scale) {\n out[0] = a[0] + b[0] * scale;\n out[1] = a[1] + b[1] * scale;\n out[2] = a[2] + b[2] * scale;\n out[3] = a[3] + b[3] * scale;\n return out;\n}\n/**\n * Calculates the euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} distance between a and b\n */\n\nfunction distance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared euclidian distance between two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} squared distance between a and b\n */\n\nfunction squaredDistance(a, b) {\n var x = b[0] - a[0];\n var y = b[1] - a[1];\n var z = b[2] - a[2];\n var w = b[3] - a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Calculates the length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate length of\n * @returns {Number} length of a\n */\n\nfunction length(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return Math.hypot(x, y, z, w);\n}\n/**\n * Calculates the squared length of a vec4\n *\n * @param {ReadonlyVec4} a vector to calculate squared length of\n * @returns {Number} squared length of a\n */\n\nfunction squaredLength(a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n return x * x + y * y + z * z + w * w;\n}\n/**\n * Negates the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to negate\n * @returns {vec4} out\n */\n\nfunction negate(out, a) {\n out[0] = -a[0];\n out[1] = -a[1];\n out[2] = -a[2];\n out[3] = -a[3];\n return out;\n}\n/**\n * Returns the inverse of the components of a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to invert\n * @returns {vec4} out\n */\n\nfunction inverse(out, a) {\n out[0] = 1.0 / a[0];\n out[1] = 1.0 / a[1];\n out[2] = 1.0 / a[2];\n out[3] = 1.0 / a[3];\n return out;\n}\n/**\n * Normalize a vec4\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a vector to normalize\n * @returns {vec4} out\n */\n\nfunction normalize(out, a) {\n var x = a[0];\n var y = a[1];\n var z = a[2];\n var w = a[3];\n var len = x * x + y * y + z * z + w * w;\n\n if (len > 0) {\n len = 1 / Math.sqrt(len);\n }\n\n out[0] = x * len;\n out[1] = y * len;\n out[2] = z * len;\n out[3] = w * len;\n return out;\n}\n/**\n * Calculates the dot product of two vec4's\n *\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @returns {Number} dot product of a and b\n */\n\nfunction dot(a, b) {\n return a[0] * b[0] + a[1] * b[1] + a[2] * b[2] + a[3] * b[3];\n}\n/**\n * Returns the cross-product of three vectors in a 4-dimensional space\n *\n * @param {ReadonlyVec4} result the receiving vector\n * @param {ReadonlyVec4} U the first vector\n * @param {ReadonlyVec4} V the second vector\n * @param {ReadonlyVec4} W the third vector\n * @returns {vec4} result\n */\n\nfunction cross(out, u, v, w) {\n var A = v[0] * w[1] - v[1] * w[0],\n B = v[0] * w[2] - v[2] * w[0],\n C = v[0] * w[3] - v[3] * w[0],\n D = v[1] * w[2] - v[2] * w[1],\n E = v[1] * w[3] - v[3] * w[1],\n F = v[2] * w[3] - v[3] * w[2];\n var G = u[0];\n var H = u[1];\n var I = u[2];\n var J = u[3];\n out[0] = H * F - I * E + J * D;\n out[1] = -(G * F) + I * C - J * B;\n out[2] = G * E - H * C + J * A;\n out[3] = -(G * D) + H * B - I * A;\n return out;\n}\n/**\n * Performs a linear interpolation between two vec4's\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the first operand\n * @param {ReadonlyVec4} b the second operand\n * @param {Number} t interpolation amount, in the range [0-1], between the two inputs\n * @returns {vec4} out\n */\n\nfunction lerp(out, a, b, t) {\n var ax = a[0];\n var ay = a[1];\n var az = a[2];\n var aw = a[3];\n out[0] = ax + t * (b[0] - ax);\n out[1] = ay + t * (b[1] - ay);\n out[2] = az + t * (b[2] - az);\n out[3] = aw + t * (b[3] - aw);\n return out;\n}\n/**\n * Generates a random vector with the given scale\n *\n * @param {vec4} out the receiving vector\n * @param {Number} [scale] Length of the resulting vector. If ommitted, a unit vector will be returned\n * @returns {vec4} out\n */\n\nfunction random(out, scale) {\n scale = scale || 1.0; // Marsaglia, George. Choosing a Point from the Surface of a\n // Sphere. Ann. Math. Statist. 43 (1972), no. 2, 645--646.\n // http://projecteuclid.org/euclid.aoms/1177692644;\n\n var v1, v2, v3, v4;\n var s1, s2;\n\n do {\n v1 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n v2 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n s1 = v1 * v1 + v2 * v2;\n } while (s1 >= 1);\n\n do {\n v3 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n v4 = _common_js__WEBPACK_IMPORTED_MODULE_0__[\"RANDOM\"]() * 2 - 1;\n s2 = v3 * v3 + v4 * v4;\n } while (s2 >= 1);\n\n var d = Math.sqrt((1 - s1) / s2);\n out[0] = scale * v1;\n out[1] = scale * v2;\n out[2] = scale * v3 * d;\n out[3] = scale * v4 * d;\n return out;\n}\n/**\n * Transforms the vec4 with a mat4.\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyMat4} m matrix to transform with\n * @returns {vec4} out\n */\n\nfunction transformMat4(out, a, m) {\n var x = a[0],\n y = a[1],\n z = a[2],\n w = a[3];\n out[0] = m[0] * x + m[4] * y + m[8] * z + m[12] * w;\n out[1] = m[1] * x + m[5] * y + m[9] * z + m[13] * w;\n out[2] = m[2] * x + m[6] * y + m[10] * z + m[14] * w;\n out[3] = m[3] * x + m[7] * y + m[11] * z + m[15] * w;\n return out;\n}\n/**\n * Transforms the vec4 with a quat\n *\n * @param {vec4} out the receiving vector\n * @param {ReadonlyVec4} a the vector to transform\n * @param {ReadonlyQuat} q quaternion to transform with\n * @returns {vec4} out\n */\n\nfunction transformQuat(out, a, q) {\n var x = a[0],\n y = a[1],\n z = a[2];\n var qx = q[0],\n qy = q[1],\n qz = q[2],\n qw = q[3]; // calculate quat * vec\n\n var ix = qw * x + qy * z - qz * y;\n var iy = qw * y + qz * x - qx * z;\n var iz = qw * z + qx * y - qy * x;\n var iw = -qx * x - qy * y - qz * z; // calculate result * inverse quat\n\n out[0] = ix * qw + iw * -qx + iy * -qz - iz * -qy;\n out[1] = iy * qw + iw * -qy + iz * -qx - ix * -qz;\n out[2] = iz * qw + iw * -qz + ix * -qy - iy * -qx;\n out[3] = a[3];\n return out;\n}\n/**\n * Set the components of a vec4 to zero\n *\n * @param {vec4} out the receiving vector\n * @returns {vec4} out\n */\n\nfunction zero(out) {\n out[0] = 0.0;\n out[1] = 0.0;\n out[2] = 0.0;\n out[3] = 0.0;\n return out;\n}\n/**\n * Returns a string representation of a vector\n *\n * @param {ReadonlyVec4} a vector to represent as a string\n * @returns {String} string representation of the vector\n */\n\nfunction str(a) {\n return \"vec4(\" + a[0] + \", \" + a[1] + \", \" + a[2] + \", \" + a[3] + \")\";\n}\n/**\n * Returns whether or not the vectors have exactly the same elements in the same position (when compared with ===)\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction exactEquals(a, b) {\n return a[0] === b[0] && a[1] === b[1] && a[2] === b[2] && a[3] === b[3];\n}\n/**\n * Returns whether or not the vectors have approximately the same elements in the same position.\n *\n * @param {ReadonlyVec4} a The first vector.\n * @param {ReadonlyVec4} b The second vector.\n * @returns {Boolean} True if the vectors are equal, false otherwise.\n */\n\nfunction equals(a, b) {\n var a0 = a[0],\n a1 = a[1],\n a2 = a[2],\n a3 = a[3];\n var b0 = b[0],\n b1 = b[1],\n b2 = b[2],\n b3 = b[3];\n return Math.abs(a0 - b0) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a0), Math.abs(b0)) && Math.abs(a1 - b1) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a1), Math.abs(b1)) && Math.abs(a2 - b2) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a2), Math.abs(b2)) && Math.abs(a3 - b3) <= _common_js__WEBPACK_IMPORTED_MODULE_0__[\"EPSILON\"] * Math.max(1.0, Math.abs(a3), Math.abs(b3));\n}\n/**\n * Alias for {@link vec4.subtract}\n * @function\n */\n\nvar sub = subtract;\n/**\n * Alias for {@link vec4.multiply}\n * @function\n */\n\nvar mul = multiply;\n/**\n * Alias for {@link vec4.divide}\n * @function\n */\n\nvar div = divide;\n/**\n * Alias for {@link vec4.distance}\n * @function\n */\n\nvar dist = distance;\n/**\n * Alias for {@link vec4.squaredDistance}\n * @function\n */\n\nvar sqrDist = squaredDistance;\n/**\n * Alias for {@link vec4.length}\n * @function\n */\n\nvar len = length;\n/**\n * Alias for {@link vec4.squaredLength}\n * @function\n */\n\nvar sqrLen = squaredLength;\n/**\n * Perform some operation over an array of vec4s.\n *\n * @param {Array} a the array of vectors to iterate over\n * @param {Number} stride Number of elements between the start of each vec4. If 0 assumes tightly packed\n * @param {Number} offset Number of elements to skip at the beginning of the array\n * @param {Number} count Number of vec4s to iterate over. If 0 iterates over entire array\n * @param {Function} fn Function to call for each vector in the array\n * @param {Object} [arg] additional argument to pass to fn\n * @returns {Array} a\n * @function\n */\n\nvar forEach = function () {\n var vec = create();\n return function (a, stride, offset, count, fn, arg) {\n var i, l;\n\n if (!stride) {\n stride = 4;\n }\n\n if (!offset) {\n offset = 0;\n }\n\n if (count) {\n l = Math.min(count * stride + offset, a.length);\n } else {\n l = a.length;\n }\n\n for (i = offset; i < l; i += stride) {\n vec[0] = a[i];\n vec[1] = a[i + 1];\n vec[2] = a[i + 2];\n vec[3] = a[i + 3];\n fn(vec, vec, arg);\n a[i] = vec[0];\n a[i + 1] = vec[1];\n a[i + 2] = vec[2];\n a[i + 3] = vec[3];\n }\n\n return a;\n };\n}();\n\n//# sourceURL=webpack:///./node_modules/gl-matrix/esm/vec4.js?"); + +/***/ }), + +/***/ "./node_modules/insert-css/index.js": +/*!******************************************!*\ + !*** ./node_modules/insert-css/index.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { + +eval("var containers = []; // will store container HTMLElement references\nvar styleElements = []; // will store {prepend: HTMLElement, append: HTMLElement}\n\nvar usage = 'insert-css: You need to provide a CSS string. Usage: insertCss(cssString[, options]).';\n\nfunction insertCss(css, options) {\n options = options || {};\n\n if (css === undefined) {\n throw new Error(usage);\n }\n\n var position = options.prepend === true ? 'prepend' : 'append';\n var container = options.container !== undefined ? options.container : document.querySelector('head');\n var containerId = containers.indexOf(container);\n\n // first time we see this container, create the necessary entries\n if (containerId === -1) {\n containerId = containers.push(container) - 1;\n styleElements[containerId] = {};\n }\n\n // try to get the correponding container + position styleElement, create it otherwise\n var styleElement;\n\n if (styleElements[containerId] !== undefined && styleElements[containerId][position] !== undefined) {\n styleElement = styleElements[containerId][position];\n } else {\n styleElement = styleElements[containerId][position] = createStyleElement();\n\n if (position === 'prepend') {\n container.insertBefore(styleElement, container.childNodes[0]);\n } else {\n container.appendChild(styleElement);\n }\n }\n\n // strip potential UTF-8 BOM if css was read from a file\n if (css.charCodeAt(0) === 0xFEFF) { css = css.substr(1, css.length); }\n\n // actually add the stylesheet\n if (styleElement.styleSheet) {\n styleElement.styleSheet.cssText += css\n } else {\n styleElement.textContent += css;\n }\n\n return styleElement;\n};\n\nfunction createStyleElement() {\n var styleElement = document.createElement('style');\n styleElement.setAttribute('type', 'text/css');\n return styleElement;\n}\n\nmodule.exports = insertCss;\nmodule.exports.insertCss = insertCss;\n\n\n//# sourceURL=webpack:///./node_modules/insert-css/index.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/determinant.js": -/*!***************************************************!*\ - !*** ./node_modules/ml-matrix/src/determinant.js ***! - \***************************************************/ -/*! exports provided: determinant */ +/***/ "./node_modules/is-any-array/lib-esm/index.js": +/*!****************************************************!*\ + !*** ./node_modules/is-any-array/lib-esm/index.js ***! + \****************************************************/ +/*! exports provided: isAnyArray */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return determinant; });\n/* harmony import */ var _dc_lu__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dc/lu */ \"./node_modules/ml-matrix/src/dc/lu.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony import */ var _views_selection__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./views/selection */ \"./node_modules/ml-matrix/src/views/selection.js\");\n\n\n\n\nfunction determinant(matrix) {\n matrix = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n if (matrix.isSquare()) {\n if (matrix.columns === 0) {\n return 1;\n }\n\n let a, b, c, d;\n if (matrix.columns === 2) {\n // 2 x 2 matrix\n a = matrix.get(0, 0);\n b = matrix.get(0, 1);\n c = matrix.get(1, 0);\n d = matrix.get(1, 1);\n\n return a * d - b * c;\n } else if (matrix.columns === 3) {\n // 3 x 3 matrix\n let subMatrix0, subMatrix1, subMatrix2;\n subMatrix0 = new _views_selection__WEBPACK_IMPORTED_MODULE_2__[\"default\"](matrix, [1, 2], [1, 2]);\n subMatrix1 = new _views_selection__WEBPACK_IMPORTED_MODULE_2__[\"default\"](matrix, [1, 2], [0, 2]);\n subMatrix2 = new _views_selection__WEBPACK_IMPORTED_MODULE_2__[\"default\"](matrix, [1, 2], [0, 1]);\n a = matrix.get(0, 0);\n b = matrix.get(0, 1);\n c = matrix.get(0, 2);\n\n return (\n a * determinant(subMatrix0) -\n b * determinant(subMatrix1) +\n c * determinant(subMatrix2)\n );\n } else {\n // general purpose determinant using the LU decomposition\n return new _dc_lu__WEBPACK_IMPORTED_MODULE_0__[\"default\"](matrix).determinant;\n }\n } else {\n throw Error('determinant can only be calculated for a square matrix');\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/determinant.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"isAnyArray\", function() { return isAnyArray; });\n// eslint-disable-next-line @typescript-eslint/unbound-method\nconst toString = Object.prototype.toString;\n/**\n * Checks if an object is an instance of an Array (array or typed array, except those that contain bigint values).\n *\n * @param value - Object to check.\n * @returns True if the object is an array or a typed array.\n */\nfunction isAnyArray(value) {\n const tag = toString.call(value);\n return tag.endsWith('Array]') && !tag.includes('Big');\n}\n//# sourceMappingURL=index.js.map\n\n//# sourceURL=webpack:///./node_modules/is-any-array/lib-esm/index.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/index.js": -/*!*********************************************!*\ - !*** ./node_modules/ml-matrix/src/index.js ***! - \*********************************************/ -/*! exports provided: AbstractMatrix, default, Matrix, MatrixColumnView, MatrixColumnSelectionView, MatrixFlipColumnView, MatrixFlipRowView, MatrixRowView, MatrixRowSelectionView, MatrixSelectionView, MatrixSubView, MatrixTransposeView, wrap, WrapperMatrix1D, WrapperMatrix2D, solve, inverse, determinant, linearDependencies, pseudoInverse, covariance, correlation, SingularValueDecomposition, SVD, EigenvalueDecomposition, EVD, CholeskyDecomposition, CHO, LuDecomposition, LU, QrDecomposition, QR, Nipals, NIPALS */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/is-arrayish/index.js": +/*!*******************************************!*\ + !*** ./node_modules/is-arrayish/index.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"AbstractMatrix\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_0__[\"AbstractMatrix\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Matrix\", function() { return _matrix__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _views_index__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./views/index */ \"./node_modules/ml-matrix/src/views/index.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixColumnView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixColumnView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixColumnSelectionView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixColumnSelectionView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixFlipColumnView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixFlipColumnView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixFlipRowView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixFlipRowView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixRowView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixRowView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixRowSelectionView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixRowSelectionView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixSelectionView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixSelectionView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixSubView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixSubView\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixTransposeView\", function() { return _views_index__WEBPACK_IMPORTED_MODULE_1__[\"MatrixTransposeView\"]; });\n\n/* harmony import */ var _wrap_wrap__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./wrap/wrap */ \"./node_modules/ml-matrix/src/wrap/wrap.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"wrap\", function() { return _wrap_wrap__WEBPACK_IMPORTED_MODULE_2__[\"wrap\"]; });\n\n/* harmony import */ var _wrap_WrapperMatrix1D__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./wrap/WrapperMatrix1D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WrapperMatrix1D\", function() { return _wrap_WrapperMatrix1D__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./wrap/WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"WrapperMatrix2D\", function() { return _wrap_WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _decompositions__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./decompositions */ \"./node_modules/ml-matrix/src/decompositions.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"solve\", function() { return _decompositions__WEBPACK_IMPORTED_MODULE_5__[\"solve\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"inverse\", function() { return _decompositions__WEBPACK_IMPORTED_MODULE_5__[\"inverse\"]; });\n\n/* harmony import */ var _determinant__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./determinant */ \"./node_modules/ml-matrix/src/determinant.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"determinant\", function() { return _determinant__WEBPACK_IMPORTED_MODULE_6__[\"determinant\"]; });\n\n/* harmony import */ var _linearDependencies__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./linearDependencies */ \"./node_modules/ml-matrix/src/linearDependencies.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"linearDependencies\", function() { return _linearDependencies__WEBPACK_IMPORTED_MODULE_7__[\"linearDependencies\"]; });\n\n/* harmony import */ var _pseudoInverse__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./pseudoInverse */ \"./node_modules/ml-matrix/src/pseudoInverse.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"pseudoInverse\", function() { return _pseudoInverse__WEBPACK_IMPORTED_MODULE_8__[\"pseudoInverse\"]; });\n\n/* harmony import */ var _covariance__WEBPACK_IMPORTED_MODULE_9__ = __webpack_require__(/*! ./covariance */ \"./node_modules/ml-matrix/src/covariance.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"covariance\", function() { return _covariance__WEBPACK_IMPORTED_MODULE_9__[\"covariance\"]; });\n\n/* harmony import */ var _correlation__WEBPACK_IMPORTED_MODULE_10__ = __webpack_require__(/*! ./correlation */ \"./node_modules/ml-matrix/src/correlation.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"correlation\", function() { return _correlation__WEBPACK_IMPORTED_MODULE_10__[\"correlation\"]; });\n\n/* harmony import */ var _dc_svd_js__WEBPACK_IMPORTED_MODULE_11__ = __webpack_require__(/*! ./dc/svd.js */ \"./node_modules/ml-matrix/src/dc/svd.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SingularValueDecomposition\", function() { return _dc_svd_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"SVD\", function() { return _dc_svd_js__WEBPACK_IMPORTED_MODULE_11__[\"default\"]; });\n\n/* harmony import */ var _dc_evd_js__WEBPACK_IMPORTED_MODULE_12__ = __webpack_require__(/*! ./dc/evd.js */ \"./node_modules/ml-matrix/src/dc/evd.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EigenvalueDecomposition\", function() { return _dc_evd_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"EVD\", function() { return _dc_evd_js__WEBPACK_IMPORTED_MODULE_12__[\"default\"]; });\n\n/* harmony import */ var _dc_cholesky_js__WEBPACK_IMPORTED_MODULE_13__ = __webpack_require__(/*! ./dc/cholesky.js */ \"./node_modules/ml-matrix/src/dc/cholesky.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CholeskyDecomposition\", function() { return _dc_cholesky_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"CHO\", function() { return _dc_cholesky_js__WEBPACK_IMPORTED_MODULE_13__[\"default\"]; });\n\n/* harmony import */ var _dc_lu_js__WEBPACK_IMPORTED_MODULE_14__ = __webpack_require__(/*! ./dc/lu.js */ \"./node_modules/ml-matrix/src/dc/lu.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LuDecomposition\", function() { return _dc_lu_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"LU\", function() { return _dc_lu_js__WEBPACK_IMPORTED_MODULE_14__[\"default\"]; });\n\n/* harmony import */ var _dc_qr_js__WEBPACK_IMPORTED_MODULE_15__ = __webpack_require__(/*! ./dc/qr.js */ \"./node_modules/ml-matrix/src/dc/qr.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"QrDecomposition\", function() { return _dc_qr_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"QR\", function() { return _dc_qr_js__WEBPACK_IMPORTED_MODULE_15__[\"default\"]; });\n\n/* harmony import */ var _dc_nipals_js__WEBPACK_IMPORTED_MODULE_16__ = __webpack_require__(/*! ./dc/nipals.js */ \"./node_modules/ml-matrix/src/dc/nipals.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"Nipals\", function() { return _dc_nipals_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"NIPALS\", function() { return _dc_nipals_js__WEBPACK_IMPORTED_MODULE_16__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/index.js?"); +eval("module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n\n\n//# sourceURL=webpack:///./node_modules/is-arrayish/index.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/inspect.js": +/***/ "./node_modules/lodash.debounce/index.js": /*!***********************************************!*\ - !*** ./node_modules/ml-matrix/src/inspect.js ***! + !*** ./node_modules/lodash.debounce/index.js ***! \***********************************************/ -/*! exports provided: inspectMatrix, inspectMatrixWithOptions */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inspectMatrix\", function() { return inspectMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"inspectMatrixWithOptions\", function() { return inspectMatrixWithOptions; });\nconst indent = ' '.repeat(2);\nconst indentData = ' '.repeat(4);\n\nfunction inspectMatrix() {\n return inspectMatrixWithOptions(this);\n}\n\nfunction inspectMatrixWithOptions(matrix, options = {}) {\n const { maxRows = 15, maxColumns = 10, maxNumSize = 8 } = options;\n return `${matrix.constructor.name} {\n${indent}[\n${indentData}${inspectData(matrix, maxRows, maxColumns, maxNumSize)}\n${indent}]\n${indent}rows: ${matrix.rows}\n${indent}columns: ${matrix.columns}\n}`;\n}\n\nfunction inspectData(matrix, maxRows, maxColumns, maxNumSize) {\n const { rows, columns } = matrix;\n const maxI = Math.min(rows, maxRows);\n const maxJ = Math.min(columns, maxColumns);\n const result = [];\n for (let i = 0; i < maxI; i++) {\n let line = [];\n for (let j = 0; j < maxJ; j++) {\n line.push(formatNumber(matrix.get(i, j), maxNumSize));\n }\n result.push(`${line.join(' ')}`);\n }\n if (maxJ !== columns) {\n result[result.length - 1] += ` ... ${columns - maxColumns} more columns`;\n }\n if (maxI !== rows) {\n result.push(`... ${rows - maxRows} more rows`);\n }\n return result.join(`\\n${indentData}`);\n}\n\nfunction formatNumber(num, maxNumSize) {\n const numStr = String(num);\n if (numStr.length <= maxNumSize) {\n return numStr.padEnd(maxNumSize, ' ');\n }\n const precise = num.toPrecision(maxNumSize - 2);\n if (precise.length <= maxNumSize) {\n return precise;\n }\n const exponential = num.toExponential(maxNumSize - 2);\n const eIndex = exponential.indexOf('e');\n const e = exponential.slice(eIndex);\n return exponential.slice(0, maxNumSize - e.length) + e;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/inspect.js?"); +eval("/* WEBPACK VAR INJECTION */(function(global) {/**\n * lodash (Custom Build) \n * Build: `lodash modularize exports=\"npm\" -o ./`\n * Copyright jQuery Foundation and other contributors \n * Released under MIT license \n * Based on Underscore.js 1.8.3 \n * Copyright Jeremy Ashkenas, DocumentCloud and Investigative Reporters & Editors\n */\n\n/** Used as the `TypeError` message for \"Functions\" methods. */\nvar FUNC_ERROR_TEXT = 'Expected a function';\n\n/** Used as references for various `Number` constants. */\nvar NAN = 0 / 0;\n\n/** `Object#toString` result references. */\nvar symbolTag = '[object Symbol]';\n\n/** Used to match leading and trailing whitespace. */\nvar reTrim = /^\\s+|\\s+$/g;\n\n/** Used to detect bad signed hexadecimal string values. */\nvar reIsBadHex = /^[-+]0x[0-9a-f]+$/i;\n\n/** Used to detect binary string values. */\nvar reIsBinary = /^0b[01]+$/i;\n\n/** Used to detect octal string values. */\nvar reIsOctal = /^0o[0-7]+$/i;\n\n/** Built-in method references without a dependency on `root`. */\nvar freeParseInt = parseInt;\n\n/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar objectToString = objectProto.toString;\n\n/* Built-in method references for those with the same name as other `lodash` methods. */\nvar nativeMax = Math.max,\n nativeMin = Math.min;\n\n/**\n * Gets the timestamp of the number of milliseconds that have elapsed since\n * the Unix epoch (1 January 1970 00:00:00 UTC).\n *\n * @static\n * @memberOf _\n * @since 2.4.0\n * @category Date\n * @returns {number} Returns the timestamp.\n * @example\n *\n * _.defer(function(stamp) {\n * console.log(_.now() - stamp);\n * }, _.now());\n * // => Logs the number of milliseconds it took for the deferred invocation.\n */\nvar now = function() {\n return root.Date.now();\n};\n\n/**\n * Creates a debounced function that delays invoking `func` until after `wait`\n * milliseconds have elapsed since the last time the debounced function was\n * invoked. The debounced function comes with a `cancel` method to cancel\n * delayed `func` invocations and a `flush` method to immediately invoke them.\n * Provide `options` to indicate whether `func` should be invoked on the\n * leading and/or trailing edge of the `wait` timeout. The `func` is invoked\n * with the last arguments provided to the debounced function. Subsequent\n * calls to the debounced function return the result of the last `func`\n * invocation.\n *\n * **Note:** If `leading` and `trailing` options are `true`, `func` is\n * invoked on the trailing edge of the timeout only if the debounced function\n * is invoked more than once during the `wait` timeout.\n *\n * If `wait` is `0` and `leading` is `false`, `func` invocation is deferred\n * until to the next tick, similar to `setTimeout` with a timeout of `0`.\n *\n * See [David Corbacho's article](https://css-tricks.com/debouncing-throttling-explained-examples/)\n * for details over the differences between `_.debounce` and `_.throttle`.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Function\n * @param {Function} func The function to debounce.\n * @param {number} [wait=0] The number of milliseconds to delay.\n * @param {Object} [options={}] The options object.\n * @param {boolean} [options.leading=false]\n * Specify invoking on the leading edge of the timeout.\n * @param {number} [options.maxWait]\n * The maximum time `func` is allowed to be delayed before it's invoked.\n * @param {boolean} [options.trailing=true]\n * Specify invoking on the trailing edge of the timeout.\n * @returns {Function} Returns the new debounced function.\n * @example\n *\n * // Avoid costly calculations while the window size is in flux.\n * jQuery(window).on('resize', _.debounce(calculateLayout, 150));\n *\n * // Invoke `sendMail` when clicked, debouncing subsequent calls.\n * jQuery(element).on('click', _.debounce(sendMail, 300, {\n * 'leading': true,\n * 'trailing': false\n * }));\n *\n * // Ensure `batchLog` is invoked once after 1 second of debounced calls.\n * var debounced = _.debounce(batchLog, 250, { 'maxWait': 1000 });\n * var source = new EventSource('/stream');\n * jQuery(source).on('message', debounced);\n *\n * // Cancel the trailing debounced invocation.\n * jQuery(window).on('popstate', debounced.cancel);\n */\nfunction debounce(func, wait, options) {\n var lastArgs,\n lastThis,\n maxWait,\n result,\n timerId,\n lastCallTime,\n lastInvokeTime = 0,\n leading = false,\n maxing = false,\n trailing = true;\n\n if (typeof func != 'function') {\n throw new TypeError(FUNC_ERROR_TEXT);\n }\n wait = toNumber(wait) || 0;\n if (isObject(options)) {\n leading = !!options.leading;\n maxing = 'maxWait' in options;\n maxWait = maxing ? nativeMax(toNumber(options.maxWait) || 0, wait) : maxWait;\n trailing = 'trailing' in options ? !!options.trailing : trailing;\n }\n\n function invokeFunc(time) {\n var args = lastArgs,\n thisArg = lastThis;\n\n lastArgs = lastThis = undefined;\n lastInvokeTime = time;\n result = func.apply(thisArg, args);\n return result;\n }\n\n function leadingEdge(time) {\n // Reset any `maxWait` timer.\n lastInvokeTime = time;\n // Start the timer for the trailing edge.\n timerId = setTimeout(timerExpired, wait);\n // Invoke the leading edge.\n return leading ? invokeFunc(time) : result;\n }\n\n function remainingWait(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime,\n result = wait - timeSinceLastCall;\n\n return maxing ? nativeMin(result, maxWait - timeSinceLastInvoke) : result;\n }\n\n function shouldInvoke(time) {\n var timeSinceLastCall = time - lastCallTime,\n timeSinceLastInvoke = time - lastInvokeTime;\n\n // Either this is the first call, activity has stopped and we're at the\n // trailing edge, the system time has gone backwards and we're treating\n // it as the trailing edge, or we've hit the `maxWait` limit.\n return (lastCallTime === undefined || (timeSinceLastCall >= wait) ||\n (timeSinceLastCall < 0) || (maxing && timeSinceLastInvoke >= maxWait));\n }\n\n function timerExpired() {\n var time = now();\n if (shouldInvoke(time)) {\n return trailingEdge(time);\n }\n // Restart the timer.\n timerId = setTimeout(timerExpired, remainingWait(time));\n }\n\n function trailingEdge(time) {\n timerId = undefined;\n\n // Only invoke if we have `lastArgs` which means `func` has been\n // debounced at least once.\n if (trailing && lastArgs) {\n return invokeFunc(time);\n }\n lastArgs = lastThis = undefined;\n return result;\n }\n\n function cancel() {\n if (timerId !== undefined) {\n clearTimeout(timerId);\n }\n lastInvokeTime = 0;\n lastArgs = lastCallTime = lastThis = timerId = undefined;\n }\n\n function flush() {\n return timerId === undefined ? result : trailingEdge(now());\n }\n\n function debounced() {\n var time = now(),\n isInvoking = shouldInvoke(time);\n\n lastArgs = arguments;\n lastThis = this;\n lastCallTime = time;\n\n if (isInvoking) {\n if (timerId === undefined) {\n return leadingEdge(lastCallTime);\n }\n if (maxing) {\n // Handle invocations in a tight loop.\n timerId = setTimeout(timerExpired, wait);\n return invokeFunc(lastCallTime);\n }\n }\n if (timerId === undefined) {\n timerId = setTimeout(timerExpired, wait);\n }\n return result;\n }\n debounced.cancel = cancel;\n debounced.flush = flush;\n return debounced;\n}\n\n/**\n * Checks if `value` is the\n * [language type](http://www.ecma-international.org/ecma-262/7.0/#sec-ecmascript-language-types)\n * of `Object`. (e.g. arrays, functions, objects, regexes, `new Number(0)`, and `new String('')`)\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an object, else `false`.\n * @example\n *\n * _.isObject({});\n * // => true\n *\n * _.isObject([1, 2, 3]);\n * // => true\n *\n * _.isObject(_.noop);\n * // => true\n *\n * _.isObject(null);\n * // => false\n */\nfunction isObject(value) {\n var type = typeof value;\n return !!value && (type == 'object' || type == 'function');\n}\n\n/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return !!value && typeof value == 'object';\n}\n\n/**\n * Checks if `value` is classified as a `Symbol` primitive or object.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a symbol, else `false`.\n * @example\n *\n * _.isSymbol(Symbol.iterator);\n * // => true\n *\n * _.isSymbol('abc');\n * // => false\n */\nfunction isSymbol(value) {\n return typeof value == 'symbol' ||\n (isObjectLike(value) && objectToString.call(value) == symbolTag);\n}\n\n/**\n * Converts `value` to a number.\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to process.\n * @returns {number} Returns the number.\n * @example\n *\n * _.toNumber(3.2);\n * // => 3.2\n *\n * _.toNumber(Number.MIN_VALUE);\n * // => 5e-324\n *\n * _.toNumber(Infinity);\n * // => Infinity\n *\n * _.toNumber('3.2');\n * // => 3.2\n */\nfunction toNumber(value) {\n if (typeof value == 'number') {\n return value;\n }\n if (isSymbol(value)) {\n return NAN;\n }\n if (isObject(value)) {\n var other = typeof value.valueOf == 'function' ? value.valueOf() : value;\n value = isObject(other) ? (other + '') : other;\n }\n if (typeof value != 'string') {\n return value === 0 ? value : +value;\n }\n value = value.replace(reTrim, '');\n var isBinary = reIsBinary.test(value);\n return (isBinary || reIsOctal.test(value))\n ? freeParseInt(value.slice(2), isBinary ? 2 : 8)\n : (reIsBadHex.test(value) ? NAN : +value);\n}\n\nmodule.exports = debounce;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/lodash.debounce/index.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/linearDependencies.js": -/*!**********************************************************!*\ - !*** ./node_modules/ml-matrix/src/linearDependencies.js ***! - \**********************************************************/ -/*! exports provided: linearDependencies */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_Symbol.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/_Symbol.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"linearDependencies\", function() { return linearDependencies; });\n/* harmony import */ var _dc_svd__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dc/svd */ \"./node_modules/ml-matrix/src/dc/svd.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n\n\n\nfunction xrange(n, exception) {\n let range = [];\n for (let i = 0; i < n; i++) {\n if (i !== exception) {\n range.push(i);\n }\n }\n return range;\n}\n\nfunction dependenciesOneRow(\n error,\n matrix,\n index,\n thresholdValue = 10e-10,\n thresholdError = 10e-10,\n) {\n if (error > thresholdError) {\n return new Array(matrix.rows + 1).fill(0);\n } else {\n let returnArray = matrix.addRow(index, [0]);\n for (let i = 0; i < returnArray.rows; i++) {\n if (Math.abs(returnArray.get(i, 0)) < thresholdValue) {\n returnArray.set(i, 0, 0);\n }\n }\n return returnArray.to1DArray();\n }\n}\n\nfunction linearDependencies(matrix, options = {}) {\n const { thresholdValue = 10e-10, thresholdError = 10e-10 } = options;\n matrix = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n\n let n = matrix.rows;\n let results = new _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"](n, n);\n\n for (let i = 0; i < n; i++) {\n let b = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].columnVector(matrix.getRow(i));\n let Abis = matrix.subMatrixRow(xrange(n, i)).transpose();\n let svd = new _dc_svd__WEBPACK_IMPORTED_MODULE_0__[\"default\"](Abis);\n let x = svd.solve(b);\n let error = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].sub(b, Abis.mmul(x)).abs().max();\n results.setRow(\n i,\n dependenciesOneRow(error, x, i, thresholdValue, thresholdError),\n );\n }\n return results;\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/linearDependencies.js?"); +eval("var root = __webpack_require__(/*! ./_root */ \"./node_modules/lodash/_root.js\");\n\n/** Built-in value references. */\nvar Symbol = root.Symbol;\n\nmodule.exports = Symbol;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_Symbol.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/mathOperations.js": -/*!******************************************************!*\ - !*** ./node_modules/ml-matrix/src/mathOperations.js ***! - \******************************************************/ -/*! exports provided: installMathOperations */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_baseGetTag.js": +/*!********************************************!*\ + !*** ./node_modules/lodash/_baseGetTag.js ***! + \********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"installMathOperations\", function() { return installMathOperations; });\nfunction installMathOperations(AbstractMatrix, Matrix) {\n AbstractMatrix.prototype.add = function add(value) {\n if (typeof value === 'number') return this.addS(value);\n return this.addM(value);\n };\n\n AbstractMatrix.prototype.addS = function addS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) + value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.addM = function addM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) + matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.add = function add(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.add(value);\n };\n\n AbstractMatrix.prototype.sub = function sub(value) {\n if (typeof value === 'number') return this.subS(value);\n return this.subM(value);\n };\n\n AbstractMatrix.prototype.subS = function subS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) - value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.subM = function subM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) - matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.sub = function sub(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sub(value);\n };\n AbstractMatrix.prototype.subtract = AbstractMatrix.prototype.sub;\n AbstractMatrix.prototype.subtractS = AbstractMatrix.prototype.subS;\n AbstractMatrix.prototype.subtractM = AbstractMatrix.prototype.subM;\n AbstractMatrix.subtract = AbstractMatrix.sub;\n\n AbstractMatrix.prototype.mul = function mul(value) {\n if (typeof value === 'number') return this.mulS(value);\n return this.mulM(value);\n };\n\n AbstractMatrix.prototype.mulS = function mulS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) * value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.mulM = function mulM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) * matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.mul = function mul(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.mul(value);\n };\n AbstractMatrix.prototype.multiply = AbstractMatrix.prototype.mul;\n AbstractMatrix.prototype.multiplyS = AbstractMatrix.prototype.mulS;\n AbstractMatrix.prototype.multiplyM = AbstractMatrix.prototype.mulM;\n AbstractMatrix.multiply = AbstractMatrix.mul;\n\n AbstractMatrix.prototype.div = function div(value) {\n if (typeof value === 'number') return this.divS(value);\n return this.divM(value);\n };\n\n AbstractMatrix.prototype.divS = function divS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) / value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.divM = function divM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) / matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.div = function div(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.div(value);\n };\n AbstractMatrix.prototype.divide = AbstractMatrix.prototype.div;\n AbstractMatrix.prototype.divideS = AbstractMatrix.prototype.divS;\n AbstractMatrix.prototype.divideM = AbstractMatrix.prototype.divM;\n AbstractMatrix.divide = AbstractMatrix.div;\n\n AbstractMatrix.prototype.mod = function mod(value) {\n if (typeof value === 'number') return this.modS(value);\n return this.modM(value);\n };\n\n AbstractMatrix.prototype.modS = function modS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) % value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.modM = function modM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) % matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.mod = function mod(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.mod(value);\n };\n AbstractMatrix.prototype.modulus = AbstractMatrix.prototype.mod;\n AbstractMatrix.prototype.modulusS = AbstractMatrix.prototype.modS;\n AbstractMatrix.prototype.modulusM = AbstractMatrix.prototype.modM;\n AbstractMatrix.modulus = AbstractMatrix.mod;\n\n AbstractMatrix.prototype.and = function and(value) {\n if (typeof value === 'number') return this.andS(value);\n return this.andM(value);\n };\n\n AbstractMatrix.prototype.andS = function andS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) & value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.andM = function andM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) & matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.and = function and(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.and(value);\n };\n\n AbstractMatrix.prototype.or = function or(value) {\n if (typeof value === 'number') return this.orS(value);\n return this.orM(value);\n };\n\n AbstractMatrix.prototype.orS = function orS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) | value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.orM = function orM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) | matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.or = function or(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.or(value);\n };\n\n AbstractMatrix.prototype.xor = function xor(value) {\n if (typeof value === 'number') return this.xorS(value);\n return this.xorM(value);\n };\n\n AbstractMatrix.prototype.xorS = function xorS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) ^ value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.xorM = function xorM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) ^ matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.xor = function xor(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.xor(value);\n };\n\n AbstractMatrix.prototype.leftShift = function leftShift(value) {\n if (typeof value === 'number') return this.leftShiftS(value);\n return this.leftShiftM(value);\n };\n\n AbstractMatrix.prototype.leftShiftS = function leftShiftS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) << value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.leftShiftM = function leftShiftM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) << matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.leftShift = function leftShift(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.leftShift(value);\n };\n\n AbstractMatrix.prototype.signPropagatingRightShift = function signPropagatingRightShift(value) {\n if (typeof value === 'number') return this.signPropagatingRightShiftS(value);\n return this.signPropagatingRightShiftM(value);\n };\n\n AbstractMatrix.prototype.signPropagatingRightShiftS = function signPropagatingRightShiftS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) >> value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.signPropagatingRightShiftM = function signPropagatingRightShiftM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) >> matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.signPropagatingRightShift = function signPropagatingRightShift(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.signPropagatingRightShift(value);\n };\n\n AbstractMatrix.prototype.rightShift = function rightShift(value) {\n if (typeof value === 'number') return this.rightShiftS(value);\n return this.rightShiftM(value);\n };\n\n AbstractMatrix.prototype.rightShiftS = function rightShiftS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) >>> value);\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.rightShiftM = function rightShiftM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) >>> matrix.get(i, j));\n }\n }\n return this;\n };\n\n AbstractMatrix.rightShift = function rightShift(matrix, value) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.rightShift(value);\n };\n AbstractMatrix.prototype.zeroFillRightShift = AbstractMatrix.prototype.rightShift;\n AbstractMatrix.prototype.zeroFillRightShiftS = AbstractMatrix.prototype.rightShiftS;\n AbstractMatrix.prototype.zeroFillRightShiftM = AbstractMatrix.prototype.rightShiftM;\n AbstractMatrix.zeroFillRightShift = AbstractMatrix.rightShift;\n\n AbstractMatrix.prototype.not = function not() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, ~(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.not = function not(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.not();\n };\n\n AbstractMatrix.prototype.abs = function abs() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.abs(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.abs = function abs(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.abs();\n };\n\n AbstractMatrix.prototype.acos = function acos() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.acos(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.acos = function acos(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.acos();\n };\n\n AbstractMatrix.prototype.acosh = function acosh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.acosh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.acosh = function acosh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.acosh();\n };\n\n AbstractMatrix.prototype.asin = function asin() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.asin(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.asin = function asin(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.asin();\n };\n\n AbstractMatrix.prototype.asinh = function asinh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.asinh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.asinh = function asinh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.asinh();\n };\n\n AbstractMatrix.prototype.atan = function atan() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.atan(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.atan = function atan(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.atan();\n };\n\n AbstractMatrix.prototype.atanh = function atanh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.atanh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.atanh = function atanh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.atanh();\n };\n\n AbstractMatrix.prototype.cbrt = function cbrt() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.cbrt(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.cbrt = function cbrt(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.cbrt();\n };\n\n AbstractMatrix.prototype.ceil = function ceil() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.ceil(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.ceil = function ceil(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.ceil();\n };\n\n AbstractMatrix.prototype.clz32 = function clz32() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.clz32(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.clz32 = function clz32(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.clz32();\n };\n\n AbstractMatrix.prototype.cos = function cos() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.cos(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.cos = function cos(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.cos();\n };\n\n AbstractMatrix.prototype.cosh = function cosh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.cosh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.cosh = function cosh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.cosh();\n };\n\n AbstractMatrix.prototype.exp = function exp() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.exp(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.exp = function exp(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.exp();\n };\n\n AbstractMatrix.prototype.expm1 = function expm1() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.expm1(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.expm1 = function expm1(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.expm1();\n };\n\n AbstractMatrix.prototype.floor = function floor() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.floor(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.floor = function floor(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.floor();\n };\n\n AbstractMatrix.prototype.fround = function fround() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.fround(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.fround = function fround(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.fround();\n };\n\n AbstractMatrix.prototype.log = function log() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.log(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.log = function log(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.log();\n };\n\n AbstractMatrix.prototype.log1p = function log1p() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.log1p(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.log1p = function log1p(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.log1p();\n };\n\n AbstractMatrix.prototype.log10 = function log10() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.log10(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.log10 = function log10(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.log10();\n };\n\n AbstractMatrix.prototype.log2 = function log2() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.log2(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.log2 = function log2(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.log2();\n };\n\n AbstractMatrix.prototype.round = function round() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.round(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.round = function round(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.round();\n };\n\n AbstractMatrix.prototype.sign = function sign() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.sign(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.sign = function sign(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sign();\n };\n\n AbstractMatrix.prototype.sin = function sin() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.sin(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.sin = function sin(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sin();\n };\n\n AbstractMatrix.prototype.sinh = function sinh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.sinh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.sinh = function sinh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sinh();\n };\n\n AbstractMatrix.prototype.sqrt = function sqrt() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.sqrt(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.sqrt = function sqrt(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.sqrt();\n };\n\n AbstractMatrix.prototype.tan = function tan() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.tan(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.tan = function tan(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.tan();\n };\n\n AbstractMatrix.prototype.tanh = function tanh() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.tanh(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.tanh = function tanh(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.tanh();\n };\n\n AbstractMatrix.prototype.trunc = function trunc() {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.trunc(this.get(i, j)));\n }\n }\n return this;\n };\n\n AbstractMatrix.trunc = function trunc(matrix) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.trunc();\n };\n\n AbstractMatrix.pow = function pow(matrix, arg0) {\n const newMatrix = new Matrix(matrix);\n return newMatrix.pow(arg0);\n };\n\n AbstractMatrix.prototype.pow = function pow(value) {\n if (typeof value === 'number') return this.powS(value);\n return this.powM(value);\n };\n\n AbstractMatrix.prototype.powS = function powS(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.pow(this.get(i, j), value));\n }\n }\n return this;\n };\n\n AbstractMatrix.prototype.powM = function powM(matrix) {\n matrix = Matrix.checkMatrix(matrix);\n if (this.rows !== matrix.rows ||\n this.columns !== matrix.columns) {\n throw new RangeError('Matrices dimensions must be equal');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, Math.pow(this.get(i, j), matrix.get(i, j)));\n }\n }\n return this;\n };\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/mathOperations.js?"); +eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\"),\n getRawTag = __webpack_require__(/*! ./_getRawTag */ \"./node_modules/lodash/_getRawTag.js\"),\n objectToString = __webpack_require__(/*! ./_objectToString */ \"./node_modules/lodash/_objectToString.js\");\n\n/** `Object#toString` result references. */\nvar nullTag = '[object Null]',\n undefinedTag = '[object Undefined]';\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * The base implementation of `getTag` without fallbacks for buggy environments.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the `toStringTag`.\n */\nfunction baseGetTag(value) {\n if (value == null) {\n return value === undefined ? undefinedTag : nullTag;\n }\n return (symToStringTag && symToStringTag in Object(value))\n ? getRawTag(value)\n : objectToString(value);\n}\n\nmodule.exports = baseGetTag;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseGetTag.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/matrix.js": -/*!**********************************************!*\ - !*** ./node_modules/ml-matrix/src/matrix.js ***! - \**********************************************/ -/*! exports provided: AbstractMatrix, default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_baseIsTypedArray.js": +/*!**************************************************!*\ + !*** ./node_modules/lodash/_baseIsTypedArray.js ***! + \**************************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"AbstractMatrix\", function() { return AbstractMatrix; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return Matrix; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n/* harmony import */ var ml_array_rescale__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ml-array-rescale */ \"./node_modules/ml-array-rescale/lib-es6/index.js\");\n/* harmony import */ var _inspect__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./inspect */ \"./node_modules/ml-matrix/src/inspect.js\");\n/* harmony import */ var _mathOperations__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./mathOperations */ \"./node_modules/ml-matrix/src/mathOperations.js\");\n/* harmony import */ var _stat__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./stat */ \"./node_modules/ml-matrix/src/stat.js\");\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./util */ \"./node_modules/ml-matrix/src/util.js\");\n\n\n\n\n\n\n\n\nclass AbstractMatrix {\n static from1DArray(newRows, newColumns, newData) {\n let length = newRows * newColumns;\n if (length !== newData.length) {\n throw new RangeError('data length does not match given dimensions');\n }\n let newMatrix = new Matrix(newRows, newColumns);\n for (let row = 0; row < newRows; row++) {\n for (let column = 0; column < newColumns; column++) {\n newMatrix.set(row, column, newData[row * newColumns + column]);\n }\n }\n return newMatrix;\n }\n\n static rowVector(newData) {\n let vector = new Matrix(1, newData.length);\n for (let i = 0; i < newData.length; i++) {\n vector.set(0, i, newData[i]);\n }\n return vector;\n }\n\n static columnVector(newData) {\n let vector = new Matrix(newData.length, 1);\n for (let i = 0; i < newData.length; i++) {\n vector.set(i, 0, newData[i]);\n }\n return vector;\n }\n\n static zeros(rows, columns) {\n return new Matrix(rows, columns);\n }\n\n static ones(rows, columns) {\n return new Matrix(rows, columns).fill(1);\n }\n\n static rand(rows, columns, options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { random = Math.random } = options;\n let matrix = new Matrix(rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n matrix.set(i, j, random());\n }\n }\n return matrix;\n }\n\n static randInt(rows, columns, options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { min = 0, max = 1000, random = Math.random } = options;\n if (!Number.isInteger(min)) throw new TypeError('min must be an integer');\n if (!Number.isInteger(max)) throw new TypeError('max must be an integer');\n if (min >= max) throw new RangeError('min must be smaller than max');\n let interval = max - min;\n let matrix = new Matrix(rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n let value = min + Math.round(random() * interval);\n matrix.set(i, j, value);\n }\n }\n return matrix;\n }\n\n static eye(rows, columns, value) {\n if (columns === undefined) columns = rows;\n if (value === undefined) value = 1;\n let min = Math.min(rows, columns);\n let matrix = this.zeros(rows, columns);\n for (let i = 0; i < min; i++) {\n matrix.set(i, i, value);\n }\n return matrix;\n }\n\n static diag(data, rows, columns) {\n let l = data.length;\n if (rows === undefined) rows = l;\n if (columns === undefined) columns = rows;\n let min = Math.min(l, rows, columns);\n let matrix = this.zeros(rows, columns);\n for (let i = 0; i < min; i++) {\n matrix.set(i, i, data[i]);\n }\n return matrix;\n }\n\n static min(matrix1, matrix2) {\n matrix1 = this.checkMatrix(matrix1);\n matrix2 = this.checkMatrix(matrix2);\n let rows = matrix1.rows;\n let columns = matrix1.columns;\n let result = new Matrix(rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n result.set(i, j, Math.min(matrix1.get(i, j), matrix2.get(i, j)));\n }\n }\n return result;\n }\n\n static max(matrix1, matrix2) {\n matrix1 = this.checkMatrix(matrix1);\n matrix2 = this.checkMatrix(matrix2);\n let rows = matrix1.rows;\n let columns = matrix1.columns;\n let result = new this(rows, columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n result.set(i, j, Math.max(matrix1.get(i, j), matrix2.get(i, j)));\n }\n }\n return result;\n }\n\n static checkMatrix(value) {\n return AbstractMatrix.isMatrix(value) ? value : new Matrix(value);\n }\n\n static isMatrix(value) {\n return value != null && value.klass === 'Matrix';\n }\n\n get size() {\n return this.rows * this.columns;\n }\n\n apply(callback) {\n if (typeof callback !== 'function') {\n throw new TypeError('callback must be a function');\n }\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n callback.call(this, i, j);\n }\n }\n return this;\n }\n\n to1DArray() {\n let array = [];\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n array.push(this.get(i, j));\n }\n }\n return array;\n }\n\n to2DArray() {\n let copy = [];\n for (let i = 0; i < this.rows; i++) {\n copy.push([]);\n for (let j = 0; j < this.columns; j++) {\n copy[i].push(this.get(i, j));\n }\n }\n return copy;\n }\n\n toJSON() {\n return this.to2DArray();\n }\n\n isRowVector() {\n return this.rows === 1;\n }\n\n isColumnVector() {\n return this.columns === 1;\n }\n\n isVector() {\n return this.rows === 1 || this.columns === 1;\n }\n\n isSquare() {\n return this.rows === this.columns;\n }\n\n isEmpty() {\n return this.rows === 0 || this.columns === 0;\n }\n\n isSymmetric() {\n if (this.isSquare()) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j <= i; j++) {\n if (this.get(i, j) !== this.get(j, i)) {\n return false;\n }\n }\n }\n return true;\n }\n return false;\n }\n\n isEchelonForm() {\n let i = 0;\n let j = 0;\n let previousColumn = -1;\n let isEchelonForm = true;\n let checked = false;\n while (i < this.rows && isEchelonForm) {\n j = 0;\n checked = false;\n while (j < this.columns && checked === false) {\n if (this.get(i, j) === 0) {\n j++;\n } else if (this.get(i, j) === 1 && j > previousColumn) {\n checked = true;\n previousColumn = j;\n } else {\n isEchelonForm = false;\n checked = true;\n }\n }\n i++;\n }\n return isEchelonForm;\n }\n\n isReducedEchelonForm() {\n let i = 0;\n let j = 0;\n let previousColumn = -1;\n let isReducedEchelonForm = true;\n let checked = false;\n while (i < this.rows && isReducedEchelonForm) {\n j = 0;\n checked = false;\n while (j < this.columns && checked === false) {\n if (this.get(i, j) === 0) {\n j++;\n } else if (this.get(i, j) === 1 && j > previousColumn) {\n checked = true;\n previousColumn = j;\n } else {\n isReducedEchelonForm = false;\n checked = true;\n }\n }\n for (let k = j + 1; k < this.rows; k++) {\n if (this.get(i, k) !== 0) {\n isReducedEchelonForm = false;\n }\n }\n i++;\n }\n return isReducedEchelonForm;\n }\n\n echelonForm() {\n let result = this.clone();\n let h = 0;\n let k = 0;\n while (h < result.rows && k < result.columns) {\n let iMax = h;\n for (let i = h; i < result.rows; i++) {\n if (result.get(i, k) > result.get(iMax, k)) {\n iMax = i;\n }\n }\n if (result.get(iMax, k) === 0) {\n k++;\n } else {\n result.swapRows(h, iMax);\n let tmp = result.get(h, k);\n for (let j = k; j < result.columns; j++) {\n result.set(h, j, result.get(h, j) / tmp);\n }\n for (let i = h + 1; i < result.rows; i++) {\n let factor = result.get(i, k) / result.get(h, k);\n result.set(i, k, 0);\n for (let j = k + 1; j < result.columns; j++) {\n result.set(i, j, result.get(i, j) - result.get(h, j) * factor);\n }\n }\n h++;\n k++;\n }\n }\n return result;\n }\n\n reducedEchelonForm() {\n let result = this.echelonForm();\n let m = result.columns;\n let n = result.rows;\n let h = n - 1;\n while (h >= 0) {\n if (result.maxRow(h) === 0) {\n h--;\n } else {\n let p = 0;\n let pivot = false;\n while (p < n && pivot === false) {\n if (result.get(h, p) === 1) {\n pivot = true;\n } else {\n p++;\n }\n }\n for (let i = 0; i < h; i++) {\n let factor = result.get(i, p);\n for (let j = p; j < m; j++) {\n let tmp = result.get(i, j) - factor * result.get(h, j);\n result.set(i, j, tmp);\n }\n }\n h--;\n }\n }\n return result;\n }\n\n set() {\n throw new Error('set method is unimplemented');\n }\n\n get() {\n throw new Error('get method is unimplemented');\n }\n\n repeat(options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { rows = 1, columns = 1 } = options;\n if (!Number.isInteger(rows) || rows <= 0) {\n throw new TypeError('rows must be a positive integer');\n }\n if (!Number.isInteger(columns) || columns <= 0) {\n throw new TypeError('columns must be a positive integer');\n }\n let matrix = new Matrix(this.rows * rows, this.columns * columns);\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < columns; j++) {\n matrix.setSubMatrix(this, this.rows * i, this.columns * j);\n }\n }\n return matrix;\n }\n\n fill(value) {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, value);\n }\n }\n return this;\n }\n\n neg() {\n return this.mulS(-1);\n }\n\n getRow(index) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, index);\n let row = [];\n for (let i = 0; i < this.columns; i++) {\n row.push(this.get(index, i));\n }\n return row;\n }\n\n getRowVector(index) {\n return Matrix.rowVector(this.getRow(index));\n }\n\n setRow(index, array) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, index);\n array = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowVector\"])(this, array);\n for (let i = 0; i < this.columns; i++) {\n this.set(index, i, array[i]);\n }\n return this;\n }\n\n swapRows(row1, row2) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, row1);\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, row2);\n for (let i = 0; i < this.columns; i++) {\n let temp = this.get(row1, i);\n this.set(row1, i, this.get(row2, i));\n this.set(row2, i, temp);\n }\n return this;\n }\n\n getColumn(index) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, index);\n let column = [];\n for (let i = 0; i < this.rows; i++) {\n column.push(this.get(i, index));\n }\n return column;\n }\n\n getColumnVector(index) {\n return Matrix.columnVector(this.getColumn(index));\n }\n\n setColumn(index, array) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, index);\n array = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnVector\"])(this, array);\n for (let i = 0; i < this.rows; i++) {\n this.set(i, index, array[i]);\n }\n return this;\n }\n\n swapColumns(column1, column2) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, column1);\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, column2);\n for (let i = 0; i < this.rows; i++) {\n let temp = this.get(i, column1);\n this.set(i, column1, this.get(i, column2));\n this.set(i, column2, temp);\n }\n return this;\n }\n\n addRowVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) + vector[j]);\n }\n }\n return this;\n }\n\n subRowVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) - vector[j]);\n }\n }\n return this;\n }\n\n mulRowVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) * vector[j]);\n }\n }\n return this;\n }\n\n divRowVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) / vector[j]);\n }\n }\n return this;\n }\n\n addColumnVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) + vector[i]);\n }\n }\n return this;\n }\n\n subColumnVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) - vector[i]);\n }\n }\n return this;\n }\n\n mulColumnVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) * vector[i]);\n }\n }\n return this;\n }\n\n divColumnVector(vector) {\n vector = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnVector\"])(this, vector);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n this.set(i, j, this.get(i, j) / vector[i]);\n }\n }\n return this;\n }\n\n mulRow(index, value) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, index);\n for (let i = 0; i < this.columns; i++) {\n this.set(index, i, this.get(index, i) * value);\n }\n return this;\n }\n\n mulColumn(index, value) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, index);\n for (let i = 0; i < this.rows; i++) {\n this.set(i, index, this.get(i, index) * value);\n }\n return this;\n }\n\n max(by) {\n if (this.isEmpty()) {\n return NaN;\n }\n switch (by) {\n case 'row': {\n const max = new Array(this.rows).fill(Number.NEGATIVE_INFINITY);\n for (let row = 0; row < this.rows; row++) {\n for (let column = 0; column < this.columns; column++) {\n if (this.get(row, column) > max[row]) {\n max[row] = this.get(row, column);\n }\n }\n }\n return max;\n }\n case 'column': {\n const max = new Array(this.columns).fill(Number.NEGATIVE_INFINITY);\n for (let row = 0; row < this.rows; row++) {\n for (let column = 0; column < this.columns; column++) {\n if (this.get(row, column) > max[column]) {\n max[column] = this.get(row, column);\n }\n }\n }\n return max;\n }\n case undefined: {\n let max = this.get(0, 0);\n for (let row = 0; row < this.rows; row++) {\n for (let column = 0; column < this.columns; column++) {\n if (this.get(row, column) > max) {\n max = this.get(row, column);\n }\n }\n }\n return max;\n }\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n maxIndex() {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkNonEmpty\"])(this);\n let v = this.get(0, 0);\n let idx = [0, 0];\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n if (this.get(i, j) > v) {\n v = this.get(i, j);\n idx[0] = i;\n idx[1] = j;\n }\n }\n }\n return idx;\n }\n\n min(by) {\n if (this.isEmpty()) {\n return NaN;\n }\n\n switch (by) {\n case 'row': {\n const min = new Array(this.rows).fill(Number.POSITIVE_INFINITY);\n for (let row = 0; row < this.rows; row++) {\n for (let column = 0; column < this.columns; column++) {\n if (this.get(row, column) < min[row]) {\n min[row] = this.get(row, column);\n }\n }\n }\n return min;\n }\n case 'column': {\n const min = new Array(this.columns).fill(Number.POSITIVE_INFINITY);\n for (let row = 0; row < this.rows; row++) {\n for (let column = 0; column < this.columns; column++) {\n if (this.get(row, column) < min[column]) {\n min[column] = this.get(row, column);\n }\n }\n }\n return min;\n }\n case undefined: {\n let min = this.get(0, 0);\n for (let row = 0; row < this.rows; row++) {\n for (let column = 0; column < this.columns; column++) {\n if (this.get(row, column) < min) {\n min = this.get(row, column);\n }\n }\n }\n return min;\n }\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n minIndex() {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkNonEmpty\"])(this);\n let v = this.get(0, 0);\n let idx = [0, 0];\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n if (this.get(i, j) < v) {\n v = this.get(i, j);\n idx[0] = i;\n idx[1] = j;\n }\n }\n }\n return idx;\n }\n\n maxRow(row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, row);\n if (this.isEmpty()) {\n return NaN;\n }\n let v = this.get(row, 0);\n for (let i = 1; i < this.columns; i++) {\n if (this.get(row, i) > v) {\n v = this.get(row, i);\n }\n }\n return v;\n }\n\n maxRowIndex(row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, row);\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkNonEmpty\"])(this);\n let v = this.get(row, 0);\n let idx = [row, 0];\n for (let i = 1; i < this.columns; i++) {\n if (this.get(row, i) > v) {\n v = this.get(row, i);\n idx[1] = i;\n }\n }\n return idx;\n }\n\n minRow(row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, row);\n if (this.isEmpty()) {\n return NaN;\n }\n let v = this.get(row, 0);\n for (let i = 1; i < this.columns; i++) {\n if (this.get(row, i) < v) {\n v = this.get(row, i);\n }\n }\n return v;\n }\n\n minRowIndex(row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, row);\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkNonEmpty\"])(this);\n let v = this.get(row, 0);\n let idx = [row, 0];\n for (let i = 1; i < this.columns; i++) {\n if (this.get(row, i) < v) {\n v = this.get(row, i);\n idx[1] = i;\n }\n }\n return idx;\n }\n\n maxColumn(column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, column);\n if (this.isEmpty()) {\n return NaN;\n }\n let v = this.get(0, column);\n for (let i = 1; i < this.rows; i++) {\n if (this.get(i, column) > v) {\n v = this.get(i, column);\n }\n }\n return v;\n }\n\n maxColumnIndex(column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, column);\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkNonEmpty\"])(this);\n let v = this.get(0, column);\n let idx = [0, column];\n for (let i = 1; i < this.rows; i++) {\n if (this.get(i, column) > v) {\n v = this.get(i, column);\n idx[0] = i;\n }\n }\n return idx;\n }\n\n minColumn(column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, column);\n if (this.isEmpty()) {\n return NaN;\n }\n let v = this.get(0, column);\n for (let i = 1; i < this.rows; i++) {\n if (this.get(i, column) < v) {\n v = this.get(i, column);\n }\n }\n return v;\n }\n\n minColumnIndex(column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, column);\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkNonEmpty\"])(this);\n let v = this.get(0, column);\n let idx = [0, column];\n for (let i = 1; i < this.rows; i++) {\n if (this.get(i, column) < v) {\n v = this.get(i, column);\n idx[0] = i;\n }\n }\n return idx;\n }\n\n diag() {\n let min = Math.min(this.rows, this.columns);\n let diag = [];\n for (let i = 0; i < min; i++) {\n diag.push(this.get(i, i));\n }\n return diag;\n }\n\n norm(type = 'frobenius') {\n let result = 0;\n if (type === 'max') {\n return this.max();\n } else if (type === 'frobenius') {\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n result = result + this.get(i, j) * this.get(i, j);\n }\n }\n return Math.sqrt(result);\n } else {\n throw new RangeError(`unknown norm type: ${type}`);\n }\n }\n\n cumulativeSum() {\n let sum = 0;\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n sum += this.get(i, j);\n this.set(i, j, sum);\n }\n }\n return this;\n }\n\n dot(vector2) {\n if (AbstractMatrix.isMatrix(vector2)) vector2 = vector2.to1DArray();\n let vector1 = this.to1DArray();\n if (vector1.length !== vector2.length) {\n throw new RangeError('vectors do not have the same size');\n }\n let dot = 0;\n for (let i = 0; i < vector1.length; i++) {\n dot += vector1[i] * vector2[i];\n }\n return dot;\n }\n\n mmul(other) {\n other = Matrix.checkMatrix(other);\n\n let m = this.rows;\n let n = this.columns;\n let p = other.columns;\n\n let result = new Matrix(m, p);\n\n let Bcolj = new Float64Array(n);\n for (let j = 0; j < p; j++) {\n for (let k = 0; k < n; k++) {\n Bcolj[k] = other.get(k, j);\n }\n\n for (let i = 0; i < m; i++) {\n let s = 0;\n for (let k = 0; k < n; k++) {\n s += this.get(i, k) * Bcolj[k];\n }\n\n result.set(i, j, s);\n }\n }\n return result;\n }\n\n strassen2x2(other) {\n other = Matrix.checkMatrix(other);\n let result = new Matrix(2, 2);\n const a11 = this.get(0, 0);\n const b11 = other.get(0, 0);\n const a12 = this.get(0, 1);\n const b12 = other.get(0, 1);\n const a21 = this.get(1, 0);\n const b21 = other.get(1, 0);\n const a22 = this.get(1, 1);\n const b22 = other.get(1, 1);\n\n // Compute intermediate values.\n const m1 = (a11 + a22) * (b11 + b22);\n const m2 = (a21 + a22) * b11;\n const m3 = a11 * (b12 - b22);\n const m4 = a22 * (b21 - b11);\n const m5 = (a11 + a12) * b22;\n const m6 = (a21 - a11) * (b11 + b12);\n const m7 = (a12 - a22) * (b21 + b22);\n\n // Combine intermediate values into the output.\n const c00 = m1 + m4 - m5 + m7;\n const c01 = m3 + m5;\n const c10 = m2 + m4;\n const c11 = m1 - m2 + m3 + m6;\n\n result.set(0, 0, c00);\n result.set(0, 1, c01);\n result.set(1, 0, c10);\n result.set(1, 1, c11);\n return result;\n }\n\n strassen3x3(other) {\n other = Matrix.checkMatrix(other);\n let result = new Matrix(3, 3);\n\n const a00 = this.get(0, 0);\n const a01 = this.get(0, 1);\n const a02 = this.get(0, 2);\n const a10 = this.get(1, 0);\n const a11 = this.get(1, 1);\n const a12 = this.get(1, 2);\n const a20 = this.get(2, 0);\n const a21 = this.get(2, 1);\n const a22 = this.get(2, 2);\n\n const b00 = other.get(0, 0);\n const b01 = other.get(0, 1);\n const b02 = other.get(0, 2);\n const b10 = other.get(1, 0);\n const b11 = other.get(1, 1);\n const b12 = other.get(1, 2);\n const b20 = other.get(2, 0);\n const b21 = other.get(2, 1);\n const b22 = other.get(2, 2);\n\n const m1 = (a00 + a01 + a02 - a10 - a11 - a21 - a22) * b11;\n const m2 = (a00 - a10) * (-b01 + b11);\n const m3 = a11 * (-b00 + b01 + b10 - b11 - b12 - b20 + b22);\n const m4 = (-a00 + a10 + a11) * (b00 - b01 + b11);\n const m5 = (a10 + a11) * (-b00 + b01);\n const m6 = a00 * b00;\n const m7 = (-a00 + a20 + a21) * (b00 - b02 + b12);\n const m8 = (-a00 + a20) * (b02 - b12);\n const m9 = (a20 + a21) * (-b00 + b02);\n const m10 = (a00 + a01 + a02 - a11 - a12 - a20 - a21) * b12;\n const m11 = a21 * (-b00 + b02 + b10 - b11 - b12 - b20 + b21);\n const m12 = (-a02 + a21 + a22) * (b11 + b20 - b21);\n const m13 = (a02 - a22) * (b11 - b21);\n const m14 = a02 * b20;\n const m15 = (a21 + a22) * (-b20 + b21);\n const m16 = (-a02 + a11 + a12) * (b12 + b20 - b22);\n const m17 = (a02 - a12) * (b12 - b22);\n const m18 = (a11 + a12) * (-b20 + b22);\n const m19 = a01 * b10;\n const m20 = a12 * b21;\n const m21 = a10 * b02;\n const m22 = a20 * b01;\n const m23 = a22 * b22;\n\n const c00 = m6 + m14 + m19;\n const c01 = m1 + m4 + m5 + m6 + m12 + m14 + m15;\n const c02 = m6 + m7 + m9 + m10 + m14 + m16 + m18;\n const c10 = m2 + m3 + m4 + m6 + m14 + m16 + m17;\n const c11 = m2 + m4 + m5 + m6 + m20;\n const c12 = m14 + m16 + m17 + m18 + m21;\n const c20 = m6 + m7 + m8 + m11 + m12 + m13 + m14;\n const c21 = m12 + m13 + m14 + m15 + m22;\n const c22 = m6 + m7 + m8 + m9 + m23;\n\n result.set(0, 0, c00);\n result.set(0, 1, c01);\n result.set(0, 2, c02);\n result.set(1, 0, c10);\n result.set(1, 1, c11);\n result.set(1, 2, c12);\n result.set(2, 0, c20);\n result.set(2, 1, c21);\n result.set(2, 2, c22);\n return result;\n }\n\n mmulStrassen(y) {\n y = Matrix.checkMatrix(y);\n let x = this.clone();\n let r1 = x.rows;\n let c1 = x.columns;\n let r2 = y.rows;\n let c2 = y.columns;\n if (c1 !== r2) {\n // eslint-disable-next-line no-console\n console.warn(\n `Multiplying ${r1} x ${c1} and ${r2} x ${c2} matrix: dimensions do not match.`,\n );\n }\n\n // Put a matrix into the top left of a matrix of zeros.\n // `rows` and `cols` are the dimensions of the output matrix.\n function embed(mat, rows, cols) {\n let r = mat.rows;\n let c = mat.columns;\n if (r === rows && c === cols) {\n return mat;\n } else {\n let resultat = AbstractMatrix.zeros(rows, cols);\n resultat = resultat.setSubMatrix(mat, 0, 0);\n return resultat;\n }\n }\n\n // Make sure both matrices are the same size.\n // This is exclusively for simplicity:\n // this algorithm can be implemented with matrices of different sizes.\n\n let r = Math.max(r1, r2);\n let c = Math.max(c1, c2);\n x = embed(x, r, c);\n y = embed(y, r, c);\n\n // Our recursive multiplication function.\n function blockMult(a, b, rows, cols) {\n // For small matrices, resort to naive multiplication.\n if (rows <= 512 || cols <= 512) {\n return a.mmul(b); // a is equivalent to this\n }\n\n // Apply dynamic padding.\n if (rows % 2 === 1 && cols % 2 === 1) {\n a = embed(a, rows + 1, cols + 1);\n b = embed(b, rows + 1, cols + 1);\n } else if (rows % 2 === 1) {\n a = embed(a, rows + 1, cols);\n b = embed(b, rows + 1, cols);\n } else if (cols % 2 === 1) {\n a = embed(a, rows, cols + 1);\n b = embed(b, rows, cols + 1);\n }\n\n let halfRows = parseInt(a.rows / 2, 10);\n let halfCols = parseInt(a.columns / 2, 10);\n // Subdivide input matrices.\n let a11 = a.subMatrix(0, halfRows - 1, 0, halfCols - 1);\n let b11 = b.subMatrix(0, halfRows - 1, 0, halfCols - 1);\n\n let a12 = a.subMatrix(0, halfRows - 1, halfCols, a.columns - 1);\n let b12 = b.subMatrix(0, halfRows - 1, halfCols, b.columns - 1);\n\n let a21 = a.subMatrix(halfRows, a.rows - 1, 0, halfCols - 1);\n let b21 = b.subMatrix(halfRows, b.rows - 1, 0, halfCols - 1);\n\n let a22 = a.subMatrix(halfRows, a.rows - 1, halfCols, a.columns - 1);\n let b22 = b.subMatrix(halfRows, b.rows - 1, halfCols, b.columns - 1);\n\n // Compute intermediate values.\n let m1 = blockMult(\n AbstractMatrix.add(a11, a22),\n AbstractMatrix.add(b11, b22),\n halfRows,\n halfCols,\n );\n let m2 = blockMult(AbstractMatrix.add(a21, a22), b11, halfRows, halfCols);\n let m3 = blockMult(a11, AbstractMatrix.sub(b12, b22), halfRows, halfCols);\n let m4 = blockMult(a22, AbstractMatrix.sub(b21, b11), halfRows, halfCols);\n let m5 = blockMult(AbstractMatrix.add(a11, a12), b22, halfRows, halfCols);\n let m6 = blockMult(\n AbstractMatrix.sub(a21, a11),\n AbstractMatrix.add(b11, b12),\n halfRows,\n halfCols,\n );\n let m7 = blockMult(\n AbstractMatrix.sub(a12, a22),\n AbstractMatrix.add(b21, b22),\n halfRows,\n halfCols,\n );\n\n // Combine intermediate values into the output.\n let c11 = AbstractMatrix.add(m1, m4);\n c11.sub(m5);\n c11.add(m7);\n let c12 = AbstractMatrix.add(m3, m5);\n let c21 = AbstractMatrix.add(m2, m4);\n let c22 = AbstractMatrix.sub(m1, m2);\n c22.add(m3);\n c22.add(m6);\n\n // Crop output to the desired size (undo dynamic padding).\n let resultat = AbstractMatrix.zeros(2 * c11.rows, 2 * c11.columns);\n resultat = resultat.setSubMatrix(c11, 0, 0);\n resultat = resultat.setSubMatrix(c12, c11.rows, 0);\n resultat = resultat.setSubMatrix(c21, 0, c11.columns);\n resultat = resultat.setSubMatrix(c22, c11.rows, c11.columns);\n return resultat.subMatrix(0, rows - 1, 0, cols - 1);\n }\n\n return blockMult(x, y, r, c);\n }\n\n scaleRows(options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { min = 0, max = 1 } = options;\n if (!Number.isFinite(min)) throw new TypeError('min must be a number');\n if (!Number.isFinite(max)) throw new TypeError('max must be a number');\n if (min >= max) throw new RangeError('min must be smaller than max');\n let newMatrix = new Matrix(this.rows, this.columns);\n for (let i = 0; i < this.rows; i++) {\n const row = this.getRow(i);\n if (row.length > 0) {\n Object(ml_array_rescale__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(row, { min, max, output: row });\n }\n newMatrix.setRow(i, row);\n }\n return newMatrix;\n }\n\n scaleColumns(options = {}) {\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { min = 0, max = 1 } = options;\n if (!Number.isFinite(min)) throw new TypeError('min must be a number');\n if (!Number.isFinite(max)) throw new TypeError('max must be a number');\n if (min >= max) throw new RangeError('min must be smaller than max');\n let newMatrix = new Matrix(this.rows, this.columns);\n for (let i = 0; i < this.columns; i++) {\n const column = this.getColumn(i);\n if (column.length) {\n Object(ml_array_rescale__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(column, {\n min: min,\n max: max,\n output: column,\n });\n }\n newMatrix.setColumn(i, column);\n }\n return newMatrix;\n }\n\n flipRows() {\n const middle = Math.ceil(this.columns / 2);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < middle; j++) {\n let first = this.get(i, j);\n let last = this.get(i, this.columns - 1 - j);\n this.set(i, j, last);\n this.set(i, this.columns - 1 - j, first);\n }\n }\n return this;\n }\n\n flipColumns() {\n const middle = Math.ceil(this.rows / 2);\n for (let j = 0; j < this.columns; j++) {\n for (let i = 0; i < middle; i++) {\n let first = this.get(i, j);\n let last = this.get(this.rows - 1 - i, j);\n this.set(i, j, last);\n this.set(this.rows - 1 - i, j, first);\n }\n }\n return this;\n }\n\n kroneckerProduct(other) {\n other = Matrix.checkMatrix(other);\n\n let m = this.rows;\n let n = this.columns;\n let p = other.rows;\n let q = other.columns;\n\n let result = new Matrix(m * p, n * q);\n for (let i = 0; i < m; i++) {\n for (let j = 0; j < n; j++) {\n for (let k = 0; k < p; k++) {\n for (let l = 0; l < q; l++) {\n result.set(p * i + k, q * j + l, this.get(i, j) * other.get(k, l));\n }\n }\n }\n }\n return result;\n }\n\n kroneckerSum(other) {\n other = Matrix.checkMatrix(other);\n if (!this.isSquare() || !other.isSquare()) {\n throw new Error('Kronecker Sum needs two Square Matrices');\n }\n let m = this.rows;\n let n = other.rows;\n let AxI = this.kroneckerProduct(Matrix.eye(n, n));\n let IxB = Matrix.eye(m, m).kroneckerProduct(other);\n return AxI.add(IxB);\n }\n\n transpose() {\n let result = new Matrix(this.columns, this.rows);\n for (let i = 0; i < this.rows; i++) {\n for (let j = 0; j < this.columns; j++) {\n result.set(j, i, this.get(i, j));\n }\n }\n return result;\n }\n\n sortRows(compareFunction = compareNumbers) {\n for (let i = 0; i < this.rows; i++) {\n this.setRow(i, this.getRow(i).sort(compareFunction));\n }\n return this;\n }\n\n sortColumns(compareFunction = compareNumbers) {\n for (let i = 0; i < this.columns; i++) {\n this.setColumn(i, this.getColumn(i).sort(compareFunction));\n }\n return this;\n }\n\n subMatrix(startRow, endRow, startColumn, endColumn) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRange\"])(this, startRow, endRow, startColumn, endColumn);\n let newMatrix = new Matrix(\n endRow - startRow + 1,\n endColumn - startColumn + 1,\n );\n for (let i = startRow; i <= endRow; i++) {\n for (let j = startColumn; j <= endColumn; j++) {\n newMatrix.set(i - startRow, j - startColumn, this.get(i, j));\n }\n }\n return newMatrix;\n }\n\n subMatrixRow(indices, startColumn, endColumn) {\n if (startColumn === undefined) startColumn = 0;\n if (endColumn === undefined) endColumn = this.columns - 1;\n if (\n startColumn > endColumn ||\n startColumn < 0 ||\n startColumn >= this.columns ||\n endColumn < 0 ||\n endColumn >= this.columns\n ) {\n throw new RangeError('Argument out of range');\n }\n\n let newMatrix = new Matrix(indices.length, endColumn - startColumn + 1);\n for (let i = 0; i < indices.length; i++) {\n for (let j = startColumn; j <= endColumn; j++) {\n if (indices[i] < 0 || indices[i] >= this.rows) {\n throw new RangeError(`Row index out of range: ${indices[i]}`);\n }\n newMatrix.set(i, j - startColumn, this.get(indices[i], j));\n }\n }\n return newMatrix;\n }\n\n subMatrixColumn(indices, startRow, endRow) {\n if (startRow === undefined) startRow = 0;\n if (endRow === undefined) endRow = this.rows - 1;\n if (\n startRow > endRow ||\n startRow < 0 ||\n startRow >= this.rows ||\n endRow < 0 ||\n endRow >= this.rows\n ) {\n throw new RangeError('Argument out of range');\n }\n\n let newMatrix = new Matrix(endRow - startRow + 1, indices.length);\n for (let i = 0; i < indices.length; i++) {\n for (let j = startRow; j <= endRow; j++) {\n if (indices[i] < 0 || indices[i] >= this.columns) {\n throw new RangeError(`Column index out of range: ${indices[i]}`);\n }\n newMatrix.set(j - startRow, i, this.get(j, indices[i]));\n }\n }\n return newMatrix;\n }\n\n setSubMatrix(matrix, startRow, startColumn) {\n matrix = Matrix.checkMatrix(matrix);\n if (matrix.isEmpty()) {\n return this;\n }\n let endRow = startRow + matrix.rows - 1;\n let endColumn = startColumn + matrix.columns - 1;\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRange\"])(this, startRow, endRow, startColumn, endColumn);\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n this.set(startRow + i, startColumn + j, matrix.get(i, j));\n }\n }\n return this;\n }\n\n selection(rowIndices, columnIndices) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndices\"])(this, rowIndices);\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndices\"])(this, columnIndices);\n let newMatrix = new Matrix(rowIndices.length, columnIndices.length);\n for (let i = 0; i < rowIndices.length; i++) {\n let rowIndex = rowIndices[i];\n for (let j = 0; j < columnIndices.length; j++) {\n let columnIndex = columnIndices[j];\n newMatrix.set(i, j, this.get(rowIndex, columnIndex));\n }\n }\n return newMatrix;\n }\n\n trace() {\n let min = Math.min(this.rows, this.columns);\n let trace = 0;\n for (let i = 0; i < min; i++) {\n trace += this.get(i, i);\n }\n return trace;\n }\n\n clone() {\n let newMatrix = new Matrix(this.rows, this.columns);\n for (let row = 0; row < this.rows; row++) {\n for (let column = 0; column < this.columns; column++) {\n newMatrix.set(row, column, this.get(row, column));\n }\n }\n return newMatrix;\n }\n\n sum(by) {\n switch (by) {\n case 'row':\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"sumByRow\"])(this);\n case 'column':\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"sumByColumn\"])(this);\n case undefined:\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"sumAll\"])(this);\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n product(by) {\n switch (by) {\n case 'row':\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"productByRow\"])(this);\n case 'column':\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"productByColumn\"])(this);\n case undefined:\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"productAll\"])(this);\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n mean(by) {\n const sum = this.sum(by);\n switch (by) {\n case 'row': {\n for (let i = 0; i < this.rows; i++) {\n sum[i] /= this.columns;\n }\n return sum;\n }\n case 'column': {\n for (let i = 0; i < this.columns; i++) {\n sum[i] /= this.rows;\n }\n return sum;\n }\n case undefined:\n return sum / this.size;\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n variance(by, options = {}) {\n if (typeof by === 'object') {\n options = by;\n by = undefined;\n }\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { unbiased = true, mean = this.mean(by) } = options;\n if (typeof unbiased !== 'boolean') {\n throw new TypeError('unbiased must be a boolean');\n }\n switch (by) {\n case 'row': {\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(mean)) {\n throw new TypeError('mean must be an array');\n }\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"varianceByRow\"])(this, unbiased, mean);\n }\n case 'column': {\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(mean)) {\n throw new TypeError('mean must be an array');\n }\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"varianceByColumn\"])(this, unbiased, mean);\n }\n case undefined: {\n if (typeof mean !== 'number') {\n throw new TypeError('mean must be a number');\n }\n return Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"varianceAll\"])(this, unbiased, mean);\n }\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n standardDeviation(by, options) {\n if (typeof by === 'object') {\n options = by;\n by = undefined;\n }\n const variance = this.variance(by, options);\n if (by === undefined) {\n return Math.sqrt(variance);\n } else {\n for (let i = 0; i < variance.length; i++) {\n variance[i] = Math.sqrt(variance[i]);\n }\n return variance;\n }\n }\n\n center(by, options = {}) {\n if (typeof by === 'object') {\n options = by;\n by = undefined;\n }\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n const { center = this.mean(by) } = options;\n switch (by) {\n case 'row': {\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(center)) {\n throw new TypeError('center must be an array');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"centerByRow\"])(this, center);\n return this;\n }\n case 'column': {\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(center)) {\n throw new TypeError('center must be an array');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"centerByColumn\"])(this, center);\n return this;\n }\n case undefined: {\n if (typeof center !== 'number') {\n throw new TypeError('center must be a number');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"centerAll\"])(this, center);\n return this;\n }\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n scale(by, options = {}) {\n if (typeof by === 'object') {\n options = by;\n by = undefined;\n }\n if (typeof options !== 'object') {\n throw new TypeError('options must be an object');\n }\n let scale = options.scale;\n switch (by) {\n case 'row': {\n if (scale === undefined) {\n scale = Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"getScaleByRow\"])(this);\n } else if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(scale)) {\n throw new TypeError('scale must be an array');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"scaleByRow\"])(this, scale);\n return this;\n }\n case 'column': {\n if (scale === undefined) {\n scale = Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"getScaleByColumn\"])(this);\n } else if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(scale)) {\n throw new TypeError('scale must be an array');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"scaleByColumn\"])(this, scale);\n return this;\n }\n case undefined: {\n if (scale === undefined) {\n scale = Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"getScaleAll\"])(this);\n } else if (typeof scale !== 'number') {\n throw new TypeError('scale must be a number');\n }\n Object(_stat__WEBPACK_IMPORTED_MODULE_4__[\"scaleAll\"])(this, scale);\n return this;\n }\n default:\n throw new Error(`invalid option: ${by}`);\n }\n }\n\n toString(options) {\n return Object(_inspect__WEBPACK_IMPORTED_MODULE_2__[\"inspectMatrixWithOptions\"])(this, options);\n }\n}\n\nAbstractMatrix.prototype.klass = 'Matrix';\nif (typeof Symbol !== 'undefined') {\n AbstractMatrix.prototype[Symbol.for('nodejs.util.inspect.custom')] =\n _inspect__WEBPACK_IMPORTED_MODULE_2__[\"inspectMatrix\"];\n}\n\nfunction compareNumbers(a, b) {\n return a - b;\n}\n\nfunction isArrayOfNumbers(array) {\n return array.every((element) => {\n return typeof element === 'number';\n });\n}\n\n// Synonyms\nAbstractMatrix.random = AbstractMatrix.rand;\nAbstractMatrix.randomInt = AbstractMatrix.randInt;\nAbstractMatrix.diagonal = AbstractMatrix.diag;\nAbstractMatrix.prototype.diagonal = AbstractMatrix.prototype.diag;\nAbstractMatrix.identity = AbstractMatrix.eye;\nAbstractMatrix.prototype.negate = AbstractMatrix.prototype.neg;\nAbstractMatrix.prototype.tensorProduct =\n AbstractMatrix.prototype.kroneckerProduct;\n\nclass Matrix extends AbstractMatrix {\n constructor(nRows, nColumns) {\n super();\n if (Matrix.isMatrix(nRows)) {\n // eslint-disable-next-line no-constructor-return\n return nRows.clone();\n } else if (Number.isInteger(nRows) && nRows >= 0) {\n // Create an empty matrix\n this.data = [];\n if (Number.isInteger(nColumns) && nColumns >= 0) {\n for (let i = 0; i < nRows; i++) {\n this.data.push(new Float64Array(nColumns));\n }\n } else {\n throw new TypeError('nColumns must be a positive integer');\n }\n } else if (Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(nRows)) {\n // Copy the values from the 2D array\n const arrayData = nRows;\n nRows = arrayData.length;\n nColumns = nRows ? arrayData[0].length : 0;\n if (typeof nColumns !== 'number') {\n throw new TypeError(\n 'Data must be a 2D array with at least one element',\n );\n }\n this.data = [];\n for (let i = 0; i < nRows; i++) {\n if (arrayData[i].length !== nColumns) {\n throw new RangeError('Inconsistent array dimensions');\n }\n if (!isArrayOfNumbers(arrayData[i])) {\n throw new TypeError('Input data contains non-numeric values');\n }\n this.data.push(Float64Array.from(arrayData[i]));\n }\n } else {\n throw new TypeError(\n 'First argument must be a positive number or an array',\n );\n }\n this.rows = nRows;\n this.columns = nColumns;\n }\n\n set(rowIndex, columnIndex, value) {\n this.data[rowIndex][columnIndex] = value;\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.data[rowIndex][columnIndex];\n }\n\n removeRow(index) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, index);\n this.data.splice(index, 1);\n this.rows -= 1;\n return this;\n }\n\n addRow(index, array) {\n if (array === undefined) {\n array = index;\n index = this.rows;\n }\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowIndex\"])(this, index, true);\n array = Float64Array.from(Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkRowVector\"])(this, array));\n this.data.splice(index, 0, array);\n this.rows += 1;\n return this;\n }\n\n removeColumn(index) {\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, index);\n for (let i = 0; i < this.rows; i++) {\n const newRow = new Float64Array(this.columns - 1);\n for (let j = 0; j < index; j++) {\n newRow[j] = this.data[i][j];\n }\n for (let j = index + 1; j < this.columns; j++) {\n newRow[j - 1] = this.data[i][j];\n }\n this.data[i] = newRow;\n }\n this.columns -= 1;\n return this;\n }\n\n addColumn(index, array) {\n if (typeof array === 'undefined') {\n array = index;\n index = this.columns;\n }\n Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnIndex\"])(this, index, true);\n array = Object(_util__WEBPACK_IMPORTED_MODULE_5__[\"checkColumnVector\"])(this, array);\n for (let i = 0; i < this.rows; i++) {\n const newRow = new Float64Array(this.columns + 1);\n let j = 0;\n for (; j < index; j++) {\n newRow[j] = this.data[i][j];\n }\n newRow[j++] = array[i];\n for (; j < this.columns + 1; j++) {\n newRow[j] = this.data[i][j - 1];\n }\n this.data[i] = newRow;\n }\n this.columns += 1;\n return this;\n }\n}\n\nObject(_mathOperations__WEBPACK_IMPORTED_MODULE_3__[\"installMathOperations\"])(AbstractMatrix, Matrix);\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/matrix.js?"); +eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isLength = __webpack_require__(/*! ./isLength */ \"./node_modules/lodash/isLength.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar argsTag = '[object Arguments]',\n arrayTag = '[object Array]',\n boolTag = '[object Boolean]',\n dateTag = '[object Date]',\n errorTag = '[object Error]',\n funcTag = '[object Function]',\n mapTag = '[object Map]',\n numberTag = '[object Number]',\n objectTag = '[object Object]',\n regexpTag = '[object RegExp]',\n setTag = '[object Set]',\n stringTag = '[object String]',\n weakMapTag = '[object WeakMap]';\n\nvar arrayBufferTag = '[object ArrayBuffer]',\n dataViewTag = '[object DataView]',\n float32Tag = '[object Float32Array]',\n float64Tag = '[object Float64Array]',\n int8Tag = '[object Int8Array]',\n int16Tag = '[object Int16Array]',\n int32Tag = '[object Int32Array]',\n uint8Tag = '[object Uint8Array]',\n uint8ClampedTag = '[object Uint8ClampedArray]',\n uint16Tag = '[object Uint16Array]',\n uint32Tag = '[object Uint32Array]';\n\n/** Used to identify `toStringTag` values of typed arrays. */\nvar typedArrayTags = {};\ntypedArrayTags[float32Tag] = typedArrayTags[float64Tag] =\ntypedArrayTags[int8Tag] = typedArrayTags[int16Tag] =\ntypedArrayTags[int32Tag] = typedArrayTags[uint8Tag] =\ntypedArrayTags[uint8ClampedTag] = typedArrayTags[uint16Tag] =\ntypedArrayTags[uint32Tag] = true;\ntypedArrayTags[argsTag] = typedArrayTags[arrayTag] =\ntypedArrayTags[arrayBufferTag] = typedArrayTags[boolTag] =\ntypedArrayTags[dataViewTag] = typedArrayTags[dateTag] =\ntypedArrayTags[errorTag] = typedArrayTags[funcTag] =\ntypedArrayTags[mapTag] = typedArrayTags[numberTag] =\ntypedArrayTags[objectTag] = typedArrayTags[regexpTag] =\ntypedArrayTags[setTag] = typedArrayTags[stringTag] =\ntypedArrayTags[weakMapTag] = false;\n\n/**\n * The base implementation of `_.isTypedArray` without Node.js optimizations.\n *\n * @private\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n */\nfunction baseIsTypedArray(value) {\n return isObjectLike(value) &&\n isLength(value.length) && !!typedArrayTags[baseGetTag(value)];\n}\n\nmodule.exports = baseIsTypedArray;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseIsTypedArray.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/pseudoInverse.js": -/*!*****************************************************!*\ - !*** ./node_modules/ml-matrix/src/pseudoInverse.js ***! - \*****************************************************/ -/*! exports provided: pseudoInverse */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_baseUnary.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_baseUnary.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"pseudoInverse\", function() { return pseudoInverse; });\n/* harmony import */ var _dc_svd__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./dc/svd */ \"./node_modules/ml-matrix/src/dc/svd.js\");\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n\n\n\nfunction pseudoInverse(matrix, threshold = Number.EPSILON) {\n matrix = _matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].checkMatrix(matrix);\n if (matrix.isEmpty()) {\n // with a zero dimension, the pseudo-inverse is the transpose, since all 0xn and nx0 matrices are singular\n // (0xn)*(nx0)*(0xn) = 0xn\n // (nx0)*(0xn)*(nx0) = nx0\n return matrix.transpose();\n }\n let svdSolution = new _dc_svd__WEBPACK_IMPORTED_MODULE_0__[\"default\"](matrix, { autoTranspose: true });\n\n let U = svdSolution.leftSingularVectors;\n let V = svdSolution.rightSingularVectors;\n let s = svdSolution.diagonal;\n\n for (let i = 0; i < s.length; i++) {\n if (Math.abs(s[i]) > threshold) {\n s[i] = 1.0 / s[i];\n } else {\n s[i] = 0.0;\n }\n }\n\n return V.mmul(_matrix__WEBPACK_IMPORTED_MODULE_1__[\"default\"].diag(s).mmul(U.transpose()));\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/pseudoInverse.js?"); +eval("/**\n * The base implementation of `_.unary` without support for storing metadata.\n *\n * @private\n * @param {Function} func The function to cap arguments for.\n * @returns {Function} Returns the new capped function.\n */\nfunction baseUnary(func) {\n return function(value) {\n return func(value);\n };\n}\n\nmodule.exports = baseUnary;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_baseUnary.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/stat.js": +/***/ "./node_modules/lodash/_freeGlobal.js": /*!********************************************!*\ - !*** ./node_modules/ml-matrix/src/stat.js ***! + !*** ./node_modules/lodash/_freeGlobal.js ***! \********************************************/ -/*! exports provided: sumByRow, sumByColumn, sumAll, productByRow, productByColumn, productAll, varianceByRow, varianceByColumn, varianceAll, centerByRow, centerByColumn, centerAll, getScaleByRow, scaleByRow, getScaleByColumn, scaleByColumn, getScaleAll, scaleAll */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sumByRow\", function() { return sumByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sumByColumn\", function() { return sumByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"sumAll\", function() { return sumAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"productByRow\", function() { return productByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"productByColumn\", function() { return productByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"productAll\", function() { return productAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"varianceByRow\", function() { return varianceByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"varianceByColumn\", function() { return varianceByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"varianceAll\", function() { return varianceAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"centerByRow\", function() { return centerByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"centerByColumn\", function() { return centerByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"centerAll\", function() { return centerAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaleByRow\", function() { return getScaleByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleByRow\", function() { return scaleByRow; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaleByColumn\", function() { return getScaleByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleByColumn\", function() { return scaleByColumn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"getScaleAll\", function() { return getScaleAll; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"scaleAll\", function() { return scaleAll; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./util */ \"./node_modules/ml-matrix/src/util.js\");\n\n\nfunction sumByRow(matrix) {\n let sum = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"newArray\"])(matrix.rows);\n for (let i = 0; i < matrix.rows; ++i) {\n for (let j = 0; j < matrix.columns; ++j) {\n sum[i] += matrix.get(i, j);\n }\n }\n return sum;\n}\n\nfunction sumByColumn(matrix) {\n let sum = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"newArray\"])(matrix.columns);\n for (let i = 0; i < matrix.rows; ++i) {\n for (let j = 0; j < matrix.columns; ++j) {\n sum[j] += matrix.get(i, j);\n }\n }\n return sum;\n}\n\nfunction sumAll(matrix) {\n let v = 0;\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n v += matrix.get(i, j);\n }\n }\n return v;\n}\n\nfunction productByRow(matrix) {\n let sum = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"newArray\"])(matrix.rows, 1);\n for (let i = 0; i < matrix.rows; ++i) {\n for (let j = 0; j < matrix.columns; ++j) {\n sum[i] *= matrix.get(i, j);\n }\n }\n return sum;\n}\n\nfunction productByColumn(matrix) {\n let sum = Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"newArray\"])(matrix.columns, 1);\n for (let i = 0; i < matrix.rows; ++i) {\n for (let j = 0; j < matrix.columns; ++j) {\n sum[j] *= matrix.get(i, j);\n }\n }\n return sum;\n}\n\nfunction productAll(matrix) {\n let v = 1;\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n v *= matrix.get(i, j);\n }\n }\n return v;\n}\n\nfunction varianceByRow(matrix, unbiased, mean) {\n const rows = matrix.rows;\n const cols = matrix.columns;\n const variance = [];\n\n for (let i = 0; i < rows; i++) {\n let sum1 = 0;\n let sum2 = 0;\n let x = 0;\n for (let j = 0; j < cols; j++) {\n x = matrix.get(i, j) - mean[i];\n sum1 += x;\n sum2 += x * x;\n }\n if (unbiased) {\n variance.push((sum2 - (sum1 * sum1) / cols) / (cols - 1));\n } else {\n variance.push((sum2 - (sum1 * sum1) / cols) / cols);\n }\n }\n return variance;\n}\n\nfunction varianceByColumn(matrix, unbiased, mean) {\n const rows = matrix.rows;\n const cols = matrix.columns;\n const variance = [];\n\n for (let j = 0; j < cols; j++) {\n let sum1 = 0;\n let sum2 = 0;\n let x = 0;\n for (let i = 0; i < rows; i++) {\n x = matrix.get(i, j) - mean[j];\n sum1 += x;\n sum2 += x * x;\n }\n if (unbiased) {\n variance.push((sum2 - (sum1 * sum1) / rows) / (rows - 1));\n } else {\n variance.push((sum2 - (sum1 * sum1) / rows) / rows);\n }\n }\n return variance;\n}\n\nfunction varianceAll(matrix, unbiased, mean) {\n const rows = matrix.rows;\n const cols = matrix.columns;\n const size = rows * cols;\n\n let sum1 = 0;\n let sum2 = 0;\n let x = 0;\n for (let i = 0; i < rows; i++) {\n for (let j = 0; j < cols; j++) {\n x = matrix.get(i, j) - mean;\n sum1 += x;\n sum2 += x * x;\n }\n }\n if (unbiased) {\n return (sum2 - (sum1 * sum1) / size) / (size - 1);\n } else {\n return (sum2 - (sum1 * sum1) / size) / size;\n }\n}\n\nfunction centerByRow(matrix, mean) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) - mean[i]);\n }\n }\n}\n\nfunction centerByColumn(matrix, mean) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) - mean[j]);\n }\n }\n}\n\nfunction centerAll(matrix, mean) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) - mean);\n }\n }\n}\n\nfunction getScaleByRow(matrix) {\n const scale = [];\n for (let i = 0; i < matrix.rows; i++) {\n let sum = 0;\n for (let j = 0; j < matrix.columns; j++) {\n sum += Math.pow(matrix.get(i, j), 2) / (matrix.columns - 1);\n }\n scale.push(Math.sqrt(sum));\n }\n return scale;\n}\n\nfunction scaleByRow(matrix, scale) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) / scale[i]);\n }\n }\n}\n\nfunction getScaleByColumn(matrix) {\n const scale = [];\n for (let j = 0; j < matrix.columns; j++) {\n let sum = 0;\n for (let i = 0; i < matrix.rows; i++) {\n sum += Math.pow(matrix.get(i, j), 2) / (matrix.rows - 1);\n }\n scale.push(Math.sqrt(sum));\n }\n return scale;\n}\n\nfunction scaleByColumn(matrix, scale) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) / scale[j]);\n }\n }\n}\n\nfunction getScaleAll(matrix) {\n const divider = matrix.size - 1;\n let sum = 0;\n for (let j = 0; j < matrix.columns; j++) {\n for (let i = 0; i < matrix.rows; i++) {\n sum += Math.pow(matrix.get(i, j), 2) / divider;\n }\n }\n return Math.sqrt(sum);\n}\n\nfunction scaleAll(matrix, scale) {\n for (let i = 0; i < matrix.rows; i++) {\n for (let j = 0; j < matrix.columns; j++) {\n matrix.set(i, j, matrix.get(i, j) / scale);\n }\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/stat.js?"); +eval("/* WEBPACK VAR INJECTION */(function(global) {/** Detect free variable `global` from Node.js. */\nvar freeGlobal = typeof global == 'object' && global && global.Object === Object && global;\n\nmodule.exports = freeGlobal;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/lodash/_freeGlobal.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/util.js": -/*!********************************************!*\ - !*** ./node_modules/ml-matrix/src/util.js ***! - \********************************************/ -/*! exports provided: checkRowIndex, checkColumnIndex, checkRowVector, checkColumnVector, checkRowIndices, checkColumnIndices, checkRange, newArray, checkNonEmpty */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_getPrototype.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/_getPrototype.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRowIndex\", function() { return checkRowIndex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkColumnIndex\", function() { return checkColumnIndex; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRowVector\", function() { return checkRowVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkColumnVector\", function() { return checkColumnVector; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRowIndices\", function() { return checkRowIndices; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkColumnIndices\", function() { return checkColumnIndices; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkRange\", function() { return checkRange; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"newArray\", function() { return newArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"checkNonEmpty\", function() { return checkNonEmpty; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n\n\n/**\n * @private\n * Check that a row index is not out of bounds\n * @param {Matrix} matrix\n * @param {number} index\n * @param {boolean} [outer]\n */\nfunction checkRowIndex(matrix, index, outer) {\n let max = outer ? matrix.rows : matrix.rows - 1;\n if (index < 0 || index > max) {\n throw new RangeError('Row index out of range');\n }\n}\n\n/**\n * @private\n * Check that a column index is not out of bounds\n * @param {Matrix} matrix\n * @param {number} index\n * @param {boolean} [outer]\n */\nfunction checkColumnIndex(matrix, index, outer) {\n let max = outer ? matrix.columns : matrix.columns - 1;\n if (index < 0 || index > max) {\n throw new RangeError('Column index out of range');\n }\n}\n\n/**\n * @private\n * Check that the provided vector is an array with the right length\n * @param {Matrix} matrix\n * @param {Array|Matrix} vector\n * @return {Array}\n * @throws {RangeError}\n */\nfunction checkRowVector(matrix, vector) {\n if (vector.to1DArray) {\n vector = vector.to1DArray();\n }\n if (vector.length !== matrix.columns) {\n throw new RangeError(\n 'vector size must be the same as the number of columns',\n );\n }\n return vector;\n}\n\n/**\n * @private\n * Check that the provided vector is an array with the right length\n * @param {Matrix} matrix\n * @param {Array|Matrix} vector\n * @return {Array}\n * @throws {RangeError}\n */\nfunction checkColumnVector(matrix, vector) {\n if (vector.to1DArray) {\n vector = vector.to1DArray();\n }\n if (vector.length !== matrix.rows) {\n throw new RangeError('vector size must be the same as the number of rows');\n }\n return vector;\n}\n\nfunction checkRowIndices(matrix, rowIndices) {\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(rowIndices)) {\n throw new TypeError('row indices must be an array');\n }\n\n for (let i = 0; i < rowIndices.length; i++) {\n if (rowIndices[i] < 0 || rowIndices[i] >= matrix.rows) {\n throw new RangeError('row indices are out of range');\n }\n }\n}\n\nfunction checkColumnIndices(matrix, columnIndices) {\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(columnIndices)) {\n throw new TypeError('column indices must be an array');\n }\n\n for (let i = 0; i < columnIndices.length; i++) {\n if (columnIndices[i] < 0 || columnIndices[i] >= matrix.columns) {\n throw new RangeError('column indices are out of range');\n }\n }\n}\n\nfunction checkRange(matrix, startRow, endRow, startColumn, endColumn) {\n if (arguments.length !== 5) {\n throw new RangeError('expected 4 arguments');\n }\n checkNumber('startRow', startRow);\n checkNumber('endRow', endRow);\n checkNumber('startColumn', startColumn);\n checkNumber('endColumn', endColumn);\n if (\n startRow > endRow ||\n startColumn > endColumn ||\n startRow < 0 ||\n startRow >= matrix.rows ||\n endRow < 0 ||\n endRow >= matrix.rows ||\n startColumn < 0 ||\n startColumn >= matrix.columns ||\n endColumn < 0 ||\n endColumn >= matrix.columns\n ) {\n throw new RangeError('Submatrix indices are out of range');\n }\n}\n\nfunction newArray(length, value = 0) {\n let array = [];\n for (let i = 0; i < length; i++) {\n array.push(value);\n }\n return array;\n}\n\nfunction checkNumber(name, value) {\n if (typeof value !== 'number') {\n throw new TypeError(`${name} must be a number`);\n }\n}\n\nfunction checkNonEmpty(matrix) {\n if (matrix.isEmpty()) {\n throw new Error('Empty matrix has no elements to index');\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/util.js?"); +eval("var overArg = __webpack_require__(/*! ./_overArg */ \"./node_modules/lodash/_overArg.js\");\n\n/** Built-in value references. */\nvar getPrototype = overArg(Object.getPrototypeOf, Object);\n\nmodule.exports = getPrototype;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_getPrototype.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/base.js": -/*!**************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/base.js ***! - \**************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_getRawTag.js": +/*!*******************************************!*\ + !*** ./node_modules/lodash/_getRawTag.js ***! + \*******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return BaseView; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n\n\nclass BaseView extends _matrix__WEBPACK_IMPORTED_MODULE_0__[\"AbstractMatrix\"] {\n constructor(matrix, rows, columns) {\n super();\n this.matrix = matrix;\n this.rows = rows;\n this.columns = columns;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/base.js?"); +eval("var Symbol = __webpack_require__(/*! ./_Symbol */ \"./node_modules/lodash/_Symbol.js\");\n\n/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/** Built-in value references. */\nvar symToStringTag = Symbol ? Symbol.toStringTag : undefined;\n\n/**\n * A specialized version of `baseGetTag` which ignores `Symbol.toStringTag` values.\n *\n * @private\n * @param {*} value The value to query.\n * @returns {string} Returns the raw `toStringTag`.\n */\nfunction getRawTag(value) {\n var isOwn = hasOwnProperty.call(value, symToStringTag),\n tag = value[symToStringTag];\n\n try {\n value[symToStringTag] = undefined;\n var unmasked = true;\n } catch (e) {}\n\n var result = nativeObjectToString.call(value);\n if (unmasked) {\n if (isOwn) {\n value[symToStringTag] = tag;\n } else {\n delete value[symToStringTag];\n }\n }\n return result;\n}\n\nmodule.exports = getRawTag;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_getRawTag.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/column.js": -/*!****************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/column.js ***! - \****************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_nodeUtil.js": +/*!******************************************!*\ + !*** ./node_modules/lodash/_nodeUtil.js ***! + \******************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixColumnView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixColumnView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, column) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkColumnIndex\"])(matrix, column);\n super(matrix, matrix.rows, 1);\n this.column = column;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(rowIndex, this.column, value);\n return this;\n }\n\n get(rowIndex) {\n return this.matrix.get(rowIndex, this.column);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/column.js?"); +eval("/* WEBPACK VAR INJECTION */(function(module) {var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `exports`. */\nvar freeExports = true && exports && !exports.nodeType && exports;\n\n/** Detect free variable `module`. */\nvar freeModule = freeExports && typeof module == 'object' && module && !module.nodeType && module;\n\n/** Detect the popular CommonJS extension `module.exports`. */\nvar moduleExports = freeModule && freeModule.exports === freeExports;\n\n/** Detect free variable `process` from Node.js. */\nvar freeProcess = moduleExports && freeGlobal.process;\n\n/** Used to access faster Node.js helpers. */\nvar nodeUtil = (function() {\n try {\n // Use `util.types` for Node.js 10+.\n var types = freeModule && freeModule.require && freeModule.require('util').types;\n\n if (types) {\n return types;\n }\n\n // Legacy `process.binding('util')` for Node.js < 10.\n return freeProcess && freeProcess.binding && freeProcess.binding('util');\n } catch (e) {}\n}());\n\nmodule.exports = nodeUtil;\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../webpack/buildin/module.js */ \"./node_modules/webpack/buildin/module.js\")(module)))\n\n//# sourceURL=webpack:///./node_modules/lodash/_nodeUtil.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/columnSelection.js": -/*!*************************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/columnSelection.js ***! - \*************************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_objectToString.js": +/*!************************************************!*\ + !*** ./node_modules/lodash/_objectToString.js ***! + \************************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixColumnSelectionView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixColumnSelectionView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, columnIndices) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkColumnIndices\"])(matrix, columnIndices);\n super(matrix, matrix.rows, columnIndices.length);\n this.columnIndices = columnIndices;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(rowIndex, this.columnIndices[columnIndex], value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(rowIndex, this.columnIndices[columnIndex]);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/columnSelection.js?"); +eval("/** Used for built-in method references. */\nvar objectProto = Object.prototype;\n\n/**\n * Used to resolve the\n * [`toStringTag`](http://ecma-international.org/ecma-262/7.0/#sec-object.prototype.tostring)\n * of values.\n */\nvar nativeObjectToString = objectProto.toString;\n\n/**\n * Converts `value` to a string using `Object.prototype.toString`.\n *\n * @private\n * @param {*} value The value to convert.\n * @returns {string} Returns the converted string.\n */\nfunction objectToString(value) {\n return nativeObjectToString.call(value);\n}\n\nmodule.exports = objectToString;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_objectToString.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/flipColumn.js": -/*!********************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/flipColumn.js ***! - \********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_overArg.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/_overArg.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixFlipColumnView; });\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\nclass MatrixFlipColumnView extends _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(matrix) {\n super(matrix, matrix.rows, matrix.columns);\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(rowIndex, this.columns - columnIndex - 1, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(rowIndex, this.columns - columnIndex - 1);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/flipColumn.js?"); +eval("/**\n * Creates a unary function that invokes `func` with its argument transformed.\n *\n * @private\n * @param {Function} func The function to wrap.\n * @param {Function} transform The argument transform.\n * @returns {Function} Returns the new function.\n */\nfunction overArg(func, transform) {\n return function(arg) {\n return func(transform(arg));\n };\n}\n\nmodule.exports = overArg;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_overArg.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/flipRow.js": -/*!*****************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/flipRow.js ***! - \*****************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/_root.js": +/*!**************************************!*\ + !*** ./node_modules/lodash/_root.js ***! + \**************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixFlipRowView; });\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\nclass MatrixFlipRowView extends _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(matrix) {\n super(matrix, matrix.rows, matrix.columns);\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(this.rows - rowIndex - 1, columnIndex, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(this.rows - rowIndex - 1, columnIndex);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/flipRow.js?"); +eval("var freeGlobal = __webpack_require__(/*! ./_freeGlobal */ \"./node_modules/lodash/_freeGlobal.js\");\n\n/** Detect free variable `self`. */\nvar freeSelf = typeof self == 'object' && self && self.Object === Object && self;\n\n/** Used as a reference to the global object. */\nvar root = freeGlobal || freeSelf || Function('return this')();\n\nmodule.exports = root;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/_root.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/index.js": -/*!***************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/index.js ***! - \***************************************************/ -/*! exports provided: MatrixColumnView, MatrixColumnSelectionView, MatrixFlipColumnView, MatrixFlipRowView, MatrixRowView, MatrixRowSelectionView, MatrixSelectionView, MatrixSubView, MatrixTransposeView */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/isArray.js": +/*!****************************************!*\ + !*** ./node_modules/lodash/isArray.js ***! + \****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _column__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./column */ \"./node_modules/ml-matrix/src/views/column.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixColumnView\", function() { return _column__WEBPACK_IMPORTED_MODULE_0__[\"default\"]; });\n\n/* harmony import */ var _columnSelection__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./columnSelection */ \"./node_modules/ml-matrix/src/views/columnSelection.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixColumnSelectionView\", function() { return _columnSelection__WEBPACK_IMPORTED_MODULE_1__[\"default\"]; });\n\n/* harmony import */ var _flipColumn__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./flipColumn */ \"./node_modules/ml-matrix/src/views/flipColumn.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixFlipColumnView\", function() { return _flipColumn__WEBPACK_IMPORTED_MODULE_2__[\"default\"]; });\n\n/* harmony import */ var _flipRow__WEBPACK_IMPORTED_MODULE_3__ = __webpack_require__(/*! ./flipRow */ \"./node_modules/ml-matrix/src/views/flipRow.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixFlipRowView\", function() { return _flipRow__WEBPACK_IMPORTED_MODULE_3__[\"default\"]; });\n\n/* harmony import */ var _row__WEBPACK_IMPORTED_MODULE_4__ = __webpack_require__(/*! ./row */ \"./node_modules/ml-matrix/src/views/row.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixRowView\", function() { return _row__WEBPACK_IMPORTED_MODULE_4__[\"default\"]; });\n\n/* harmony import */ var _rowSelection__WEBPACK_IMPORTED_MODULE_5__ = __webpack_require__(/*! ./rowSelection */ \"./node_modules/ml-matrix/src/views/rowSelection.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixRowSelectionView\", function() { return _rowSelection__WEBPACK_IMPORTED_MODULE_5__[\"default\"]; });\n\n/* harmony import */ var _selection__WEBPACK_IMPORTED_MODULE_6__ = __webpack_require__(/*! ./selection */ \"./node_modules/ml-matrix/src/views/selection.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixSelectionView\", function() { return _selection__WEBPACK_IMPORTED_MODULE_6__[\"default\"]; });\n\n/* harmony import */ var _sub__WEBPACK_IMPORTED_MODULE_7__ = __webpack_require__(/*! ./sub */ \"./node_modules/ml-matrix/src/views/sub.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixSubView\", function() { return _sub__WEBPACK_IMPORTED_MODULE_7__[\"default\"]; });\n\n/* harmony import */ var _transpose__WEBPACK_IMPORTED_MODULE_8__ = __webpack_require__(/*! ./transpose */ \"./node_modules/ml-matrix/src/views/transpose.js\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"MatrixTransposeView\", function() { return _transpose__WEBPACK_IMPORTED_MODULE_8__[\"default\"]; });\n\n\n\n\n\n\n\n\n\n\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/index.js?"); +eval("/**\n * Checks if `value` is classified as an `Array` object.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is an array, else `false`.\n * @example\n *\n * _.isArray([1, 2, 3]);\n * // => true\n *\n * _.isArray(document.body.children);\n * // => false\n *\n * _.isArray('abc');\n * // => false\n *\n * _.isArray(_.noop);\n * // => false\n */\nvar isArray = Array.isArray;\n\nmodule.exports = isArray;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isArray.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/row.js": -/*!*************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/row.js ***! - \*************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/isLength.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isLength.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixRowView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixRowView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, row) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkRowIndex\"])(matrix, row);\n super(matrix, 1, matrix.columns);\n this.row = row;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(this.row, columnIndex, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(this.row, columnIndex);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/row.js?"); +eval("/** Used as references for various `Number` constants. */\nvar MAX_SAFE_INTEGER = 9007199254740991;\n\n/**\n * Checks if `value` is a valid array-like length.\n *\n * **Note:** This method is loosely based on\n * [`ToLength`](http://ecma-international.org/ecma-262/7.0/#sec-tolength).\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a valid length, else `false`.\n * @example\n *\n * _.isLength(3);\n * // => true\n *\n * _.isLength(Number.MIN_VALUE);\n * // => false\n *\n * _.isLength(Infinity);\n * // => false\n *\n * _.isLength('3');\n * // => false\n */\nfunction isLength(value) {\n return typeof value == 'number' &&\n value > -1 && value % 1 == 0 && value <= MAX_SAFE_INTEGER;\n}\n\nmodule.exports = isLength;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isLength.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/rowSelection.js": -/*!**********************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/rowSelection.js ***! - \**********************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/isNumber.js": +/*!*****************************************!*\ + !*** ./node_modules/lodash/isNumber.js ***! + \*****************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixRowSelectionView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixRowSelectionView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, rowIndices) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkRowIndices\"])(matrix, rowIndices);\n super(matrix, rowIndices.length, matrix.columns);\n this.rowIndices = rowIndices;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(this.rowIndices[rowIndex], columnIndex, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(this.rowIndices[rowIndex], columnIndex);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/rowSelection.js?"); +eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar numberTag = '[object Number]';\n\n/**\n * Checks if `value` is classified as a `Number` primitive or object.\n *\n * **Note:** To exclude `Infinity`, `-Infinity`, and `NaN`, which are\n * classified as numbers, use the `_.isFinite` method.\n *\n * @static\n * @memberOf _\n * @since 0.1.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a number, else `false`.\n * @example\n *\n * _.isNumber(3);\n * // => true\n *\n * _.isNumber(Number.MIN_VALUE);\n * // => true\n *\n * _.isNumber(Infinity);\n * // => true\n *\n * _.isNumber('3');\n * // => false\n */\nfunction isNumber(value) {\n return typeof value == 'number' ||\n (isObjectLike(value) && baseGetTag(value) == numberTag);\n}\n\nmodule.exports = isNumber;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isNumber.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/selection.js": -/*!*******************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/selection.js ***! - \*******************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/isObjectLike.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/isObjectLike.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixSelectionView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixSelectionView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, rowIndices, columnIndices) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkRowIndices\"])(matrix, rowIndices);\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkColumnIndices\"])(matrix, columnIndices);\n super(matrix, rowIndices.length, columnIndices.length);\n this.rowIndices = rowIndices;\n this.columnIndices = columnIndices;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(\n this.rowIndices[rowIndex],\n this.columnIndices[columnIndex],\n value,\n );\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(\n this.rowIndices[rowIndex],\n this.columnIndices[columnIndex],\n );\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/selection.js?"); +eval("/**\n * Checks if `value` is object-like. A value is object-like if it's not `null`\n * and has a `typeof` result of \"object\".\n *\n * @static\n * @memberOf _\n * @since 4.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is object-like, else `false`.\n * @example\n *\n * _.isObjectLike({});\n * // => true\n *\n * _.isObjectLike([1, 2, 3]);\n * // => true\n *\n * _.isObjectLike(_.noop);\n * // => false\n *\n * _.isObjectLike(null);\n * // => false\n */\nfunction isObjectLike(value) {\n return value != null && typeof value == 'object';\n}\n\nmodule.exports = isObjectLike;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isObjectLike.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/sub.js": -/*!*************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/sub.js ***! - \*************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/isPlainObject.js": +/*!**********************************************!*\ + !*** ./node_modules/lodash/isPlainObject.js ***! + \**********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixSubView; });\n/* harmony import */ var _util__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../util */ \"./node_modules/ml-matrix/src/util.js\");\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\n\n\nclass MatrixSubView extends _base__WEBPACK_IMPORTED_MODULE_1__[\"default\"] {\n constructor(matrix, startRow, endRow, startColumn, endColumn) {\n Object(_util__WEBPACK_IMPORTED_MODULE_0__[\"checkRange\"])(matrix, startRow, endRow, startColumn, endColumn);\n super(matrix, endRow - startRow + 1, endColumn - startColumn + 1);\n this.startRow = startRow;\n this.startColumn = startColumn;\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(\n this.startRow + rowIndex,\n this.startColumn + columnIndex,\n value,\n );\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(\n this.startRow + rowIndex,\n this.startColumn + columnIndex,\n );\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/sub.js?"); +eval("var baseGetTag = __webpack_require__(/*! ./_baseGetTag */ \"./node_modules/lodash/_baseGetTag.js\"),\n getPrototype = __webpack_require__(/*! ./_getPrototype */ \"./node_modules/lodash/_getPrototype.js\"),\n isObjectLike = __webpack_require__(/*! ./isObjectLike */ \"./node_modules/lodash/isObjectLike.js\");\n\n/** `Object#toString` result references. */\nvar objectTag = '[object Object]';\n\n/** Used for built-in method references. */\nvar funcProto = Function.prototype,\n objectProto = Object.prototype;\n\n/** Used to resolve the decompiled source of functions. */\nvar funcToString = funcProto.toString;\n\n/** Used to check objects for own properties. */\nvar hasOwnProperty = objectProto.hasOwnProperty;\n\n/** Used to infer the `Object` constructor. */\nvar objectCtorString = funcToString.call(Object);\n\n/**\n * Checks if `value` is a plain object, that is, an object created by the\n * `Object` constructor or one with a `[[Prototype]]` of `null`.\n *\n * @static\n * @memberOf _\n * @since 0.8.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a plain object, else `false`.\n * @example\n *\n * function Foo() {\n * this.a = 1;\n * }\n *\n * _.isPlainObject(new Foo);\n * // => false\n *\n * _.isPlainObject([1, 2, 3]);\n * // => false\n *\n * _.isPlainObject({ 'x': 0, 'y': 0 });\n * // => true\n *\n * _.isPlainObject(Object.create(null));\n * // => true\n */\nfunction isPlainObject(value) {\n if (!isObjectLike(value) || baseGetTag(value) != objectTag) {\n return false;\n }\n var proto = getPrototype(value);\n if (proto === null) {\n return true;\n }\n var Ctor = hasOwnProperty.call(proto, 'constructor') && proto.constructor;\n return typeof Ctor == 'function' && Ctor instanceof Ctor &&\n funcToString.call(Ctor) == objectCtorString;\n}\n\nmodule.exports = isPlainObject;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isPlainObject.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/views/transpose.js": -/*!*******************************************************!*\ - !*** ./node_modules/ml-matrix/src/views/transpose.js ***! - \*******************************************************/ -/*! exports provided: default */ -/***/ (function(module, __webpack_exports__, __webpack_require__) { +/***/ "./node_modules/lodash/isTypedArray.js": +/*!*********************************************!*\ + !*** ./node_modules/lodash/isTypedArray.js ***! + \*********************************************/ +/*! no static exports found */ +/***/ (function(module, exports, __webpack_require__) { -"use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return MatrixTransposeView; });\n/* harmony import */ var _base__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./base */ \"./node_modules/ml-matrix/src/views/base.js\");\n\n\nclass MatrixTransposeView extends _base__WEBPACK_IMPORTED_MODULE_0__[\"default\"] {\n constructor(matrix) {\n super(matrix, matrix.columns, matrix.rows);\n }\n\n set(rowIndex, columnIndex, value) {\n this.matrix.set(columnIndex, rowIndex, value);\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.matrix.get(columnIndex, rowIndex);\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/views/transpose.js?"); +eval("var baseIsTypedArray = __webpack_require__(/*! ./_baseIsTypedArray */ \"./node_modules/lodash/_baseIsTypedArray.js\"),\n baseUnary = __webpack_require__(/*! ./_baseUnary */ \"./node_modules/lodash/_baseUnary.js\"),\n nodeUtil = __webpack_require__(/*! ./_nodeUtil */ \"./node_modules/lodash/_nodeUtil.js\");\n\n/* Node.js helper references. */\nvar nodeIsTypedArray = nodeUtil && nodeUtil.isTypedArray;\n\n/**\n * Checks if `value` is classified as a typed array.\n *\n * @static\n * @memberOf _\n * @since 3.0.0\n * @category Lang\n * @param {*} value The value to check.\n * @returns {boolean} Returns `true` if `value` is a typed array, else `false`.\n * @example\n *\n * _.isTypedArray(new Uint8Array);\n * // => true\n *\n * _.isTypedArray([]);\n * // => false\n */\nvar isTypedArray = nodeIsTypedArray ? baseUnary(nodeIsTypedArray) : baseIsTypedArray;\n\nmodule.exports = isTypedArray;\n\n\n//# sourceURL=webpack:///./node_modules/lodash/isTypedArray.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js": -/*!************************************************************!*\ - !*** ./node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js ***! - \************************************************************/ +/***/ "./node_modules/ml-array-max/lib-es6/index.js": +/*!****************************************************!*\ + !*** ./node_modules/ml-array-max/lib-es6/index.js ***! + \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WrapperMatrix1D; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n\n\nclass WrapperMatrix1D extends _matrix__WEBPACK_IMPORTED_MODULE_0__[\"AbstractMatrix\"] {\n constructor(data, options = {}) {\n const { rows = 1 } = options;\n\n if (data.length % rows !== 0) {\n throw new Error('the data length is not divisible by the number of rows');\n }\n super();\n this.rows = rows;\n this.columns = data.length / rows;\n this.data = data;\n }\n\n set(rowIndex, columnIndex, value) {\n let index = this._calculateIndex(rowIndex, columnIndex);\n this.data[index] = value;\n return this;\n }\n\n get(rowIndex, columnIndex) {\n let index = this._calculateIndex(rowIndex, columnIndex);\n return this.data[index];\n }\n\n _calculateIndex(row, column) {\n return row * this.columns + column;\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return max; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n\n\nfunction max(input) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(input)) {\n throw new TypeError('input must be an array');\n }\n\n if (input.length === 0) {\n throw new TypeError('input must not be empty');\n }\n\n var _options$fromIndex = options.fromIndex,\n fromIndex = _options$fromIndex === void 0 ? 0 : _options$fromIndex,\n _options$toIndex = options.toIndex,\n toIndex = _options$toIndex === void 0 ? input.length : _options$toIndex;\n\n if (fromIndex < 0 || fromIndex >= input.length || !Number.isInteger(fromIndex)) {\n throw new Error('fromIndex must be a positive integer smaller than length');\n }\n\n if (toIndex <= fromIndex || toIndex > input.length || !Number.isInteger(toIndex)) {\n throw new Error('toIndex must be an integer greater than fromIndex and at most equal to length');\n }\n\n var maxValue = input[fromIndex];\n\n for (var i = fromIndex + 1; i < toIndex; i++) {\n if (input[i] > maxValue) maxValue = input[i];\n }\n\n return maxValue;\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/ml-array-max/lib-es6/index.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js": -/*!************************************************************!*\ - !*** ./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js ***! - \************************************************************/ +/***/ "./node_modules/ml-array-min/lib-es6/index.js": +/*!****************************************************!*\ + !*** ./node_modules/ml-array-min/lib-es6/index.js ***! + \****************************************************/ /*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return WrapperMatrix2D; });\n/* harmony import */ var _matrix__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ../matrix */ \"./node_modules/ml-matrix/src/matrix.js\");\n\n\nclass WrapperMatrix2D extends _matrix__WEBPACK_IMPORTED_MODULE_0__[\"AbstractMatrix\"] {\n constructor(data) {\n super();\n this.data = data;\n this.rows = data.length;\n this.columns = data[0].length;\n }\n\n set(rowIndex, columnIndex, value) {\n this.data[rowIndex][columnIndex] = value;\n return this;\n }\n\n get(rowIndex, columnIndex) {\n return this.data[rowIndex][columnIndex];\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return min; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n\n\nfunction min(input) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(input)) {\n throw new TypeError('input must be an array');\n }\n\n if (input.length === 0) {\n throw new TypeError('input must not be empty');\n }\n\n var _options$fromIndex = options.fromIndex,\n fromIndex = _options$fromIndex === void 0 ? 0 : _options$fromIndex,\n _options$toIndex = options.toIndex,\n toIndex = _options$toIndex === void 0 ? input.length : _options$toIndex;\n\n if (fromIndex < 0 || fromIndex >= input.length || !Number.isInteger(fromIndex)) {\n throw new Error('fromIndex must be a positive integer smaller than length');\n }\n\n if (toIndex <= fromIndex || toIndex > input.length || !Number.isInteger(toIndex)) {\n throw new Error('toIndex must be an integer greater than fromIndex and at most equal to length');\n }\n\n var minValue = input[fromIndex];\n\n for (var i = fromIndex + 1; i < toIndex; i++) {\n if (input[i] < minValue) minValue = input[i];\n }\n\n return minValue;\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/ml-array-min/lib-es6/index.js?"); /***/ }), -/***/ "./node_modules/ml-matrix/src/wrap/wrap.js": -/*!*************************************************!*\ - !*** ./node_modules/ml-matrix/src/wrap/wrap.js ***! - \*************************************************/ -/*! exports provided: wrap */ +/***/ "./node_modules/ml-array-rescale/lib-es6/index.js": +/*!********************************************************!*\ + !*** ./node_modules/ml-array-rescale/lib-es6/index.js ***! + \********************************************************/ +/*! exports provided: default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"wrap\", function() { return wrap; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n/* harmony import */ var _WrapperMatrix1D__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./WrapperMatrix1D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix1D.js\");\n/* harmony import */ var _WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ./WrapperMatrix2D */ \"./node_modules/ml-matrix/src/wrap/WrapperMatrix2D.js\");\n\n\n\n\n\nfunction wrap(array, options) {\n if (Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(array)) {\n if (array[0] && Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(array[0])) {\n return new _WrapperMatrix2D__WEBPACK_IMPORTED_MODULE_2__[\"default\"](array);\n } else {\n return new _WrapperMatrix1D__WEBPACK_IMPORTED_MODULE_1__[\"default\"](array, options);\n }\n } else {\n throw new Error('the argument is not an array');\n }\n}\n\n\n//# sourceURL=webpack:///./node_modules/ml-matrix/src/wrap/wrap.js?"); - -/***/ }), - -/***/ "./node_modules/polyline-miter-util/index.js": -/*!***************************************************!*\ - !*** ./node_modules/polyline-miter-util/index.js ***! - \***************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("var add = __webpack_require__(/*! gl-vec2/add */ \"./node_modules/gl-vec2/add.js\")\nvar set = __webpack_require__(/*! gl-vec2/set */ \"./node_modules/gl-vec2/set.js\")\nvar normalize = __webpack_require__(/*! gl-vec2/normalize */ \"./node_modules/gl-vec2/normalize.js\")\nvar subtract = __webpack_require__(/*! gl-vec2/subtract */ \"./node_modules/gl-vec2/subtract.js\")\nvar dot = __webpack_require__(/*! gl-vec2/dot */ \"./node_modules/gl-vec2/dot.js\")\n\nvar tmp = [0, 0]\n\nmodule.exports.computeMiter = function computeMiter(tangent, miter, lineA, lineB, halfThick) {\n //get tangent line\n add(tangent, lineA, lineB)\n normalize(tangent, tangent)\n\n //get miter as a unit vector\n set(miter, -tangent[1], tangent[0])\n set(tmp, -lineA[1], lineA[0])\n\n //get the necessary length of our miter\n return halfThick / dot(miter, tmp)\n}\n\nmodule.exports.normal = function normal(out, dir) {\n //get perpendicular\n set(out, -dir[1], dir[0])\n return out\n}\n\nmodule.exports.direction = function direction(out, a, b) {\n //get unit dir of two lines\n subtract(out, a, b)\n normalize(out, out)\n return out\n}\n\n//# sourceURL=webpack:///./node_modules/polyline-miter-util/index.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"default\", function() { return rescale; });\n/* harmony import */ var is_any_array__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! is-any-array */ \"./node_modules/is-any-array/lib-esm/index.js\");\n/* harmony import */ var ml_array_max__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ml-array-max */ \"./node_modules/ml-array-max/lib-es6/index.js\");\n/* harmony import */ var ml_array_min__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ml-array-min */ \"./node_modules/ml-array-min/lib-es6/index.js\");\n\n\n\n\nfunction rescale(input) {\n var options = arguments.length > 1 && arguments[1] !== undefined ? arguments[1] : {};\n\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(input)) {\n throw new TypeError('input must be an array');\n } else if (input.length === 0) {\n throw new TypeError('input must not be empty');\n }\n\n var output;\n\n if (options.output !== undefined) {\n if (!Object(is_any_array__WEBPACK_IMPORTED_MODULE_0__[\"isAnyArray\"])(options.output)) {\n throw new TypeError('output option must be an array if specified');\n }\n\n output = options.output;\n } else {\n output = new Array(input.length);\n }\n\n var currentMin = Object(ml_array_min__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(input);\n var currentMax = Object(ml_array_max__WEBPACK_IMPORTED_MODULE_1__[\"default\"])(input);\n\n if (currentMin === currentMax) {\n throw new RangeError('minimum and maximum input values are equal. Cannot rescale a constant array');\n }\n\n var _options$min = options.min,\n minValue = _options$min === void 0 ? options.autoMinMax ? currentMin : 0 : _options$min,\n _options$max = options.max,\n maxValue = _options$max === void 0 ? options.autoMinMax ? currentMax : 1 : _options$max;\n\n if (minValue >= maxValue) {\n throw new RangeError('min option must be smaller than max option');\n }\n\n var factor = (maxValue - minValue) / (currentMax - currentMin);\n\n for (var i = 0; i < input.length; i++) {\n output[i] = (input[i] - currentMin) * factor + minValue;\n }\n\n return output;\n}\n\n\n\n\n//# sourceURL=webpack:///./node_modules/ml-array-rescale/lib-es6/index.js?"); /***/ }), @@ -11686,17 +11761,6 @@ eval("if(false) {} else {\n module.exports = __webpack_require__(/*! ./dist/pow /***/ }), -/***/ "./node_modules/reflect-metadata/Reflect.js": -/*!**************************************************!*\ - !*** ./node_modules/reflect-metadata/Reflect.js ***! - \**************************************************/ -/*! no static exports found */ -/***/ (function(module, exports, __webpack_require__) { - -eval("/* WEBPACK VAR INJECTION */(function(process, global) {/*! *****************************************************************************\nCopyright (C) Microsoft. All rights reserved.\nLicensed under the Apache License, Version 2.0 (the \"License\"); you may not use\nthis file except in compliance with the License. You may obtain a copy of the\nLicense at http://www.apache.org/licenses/LICENSE-2.0\n\nTHIS CODE IS PROVIDED ON AN *AS IS* BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY\nKIND, EITHER EXPRESS OR IMPLIED, INCLUDING WITHOUT LIMITATION ANY IMPLIED\nWARRANTIES OR CONDITIONS OF TITLE, FITNESS FOR A PARTICULAR PURPOSE,\nMERCHANTABLITY OR NON-INFRINGEMENT.\n\nSee the Apache Version 2.0 License for specific language governing permissions\nand limitations under the License.\n***************************************************************************** */\nvar Reflect;\n(function (Reflect) {\n // Metadata Proposal\n // https://rbuckton.github.io/reflect-metadata/\n (function (factory) {\n var root = typeof global === \"object\" ? global :\n typeof self === \"object\" ? self :\n typeof this === \"object\" ? this :\n Function(\"return this;\")();\n var exporter = makeExporter(Reflect);\n if (typeof root.Reflect === \"undefined\") {\n root.Reflect = Reflect;\n }\n else {\n exporter = makeExporter(root.Reflect, exporter);\n }\n factory(exporter);\n function makeExporter(target, previous) {\n return function (key, value) {\n if (typeof target[key] !== \"function\") {\n Object.defineProperty(target, key, { configurable: true, writable: true, value: value });\n }\n if (previous)\n previous(key, value);\n };\n }\n })(function (exporter) {\n var hasOwn = Object.prototype.hasOwnProperty;\n // feature test for Symbol support\n var supportsSymbol = typeof Symbol === \"function\";\n var toPrimitiveSymbol = supportsSymbol && typeof Symbol.toPrimitive !== \"undefined\" ? Symbol.toPrimitive : \"@@toPrimitive\";\n var iteratorSymbol = supportsSymbol && typeof Symbol.iterator !== \"undefined\" ? Symbol.iterator : \"@@iterator\";\n var supportsCreate = typeof Object.create === \"function\"; // feature test for Object.create support\n var supportsProto = { __proto__: [] } instanceof Array; // feature test for __proto__ support\n var downLevel = !supportsCreate && !supportsProto;\n var HashMap = {\n // create an object in dictionary mode (a.k.a. \"slow\" mode in v8)\n create: supportsCreate\n ? function () { return MakeDictionary(Object.create(null)); }\n : supportsProto\n ? function () { return MakeDictionary({ __proto__: null }); }\n : function () { return MakeDictionary({}); },\n has: downLevel\n ? function (map, key) { return hasOwn.call(map, key); }\n : function (map, key) { return key in map; },\n get: downLevel\n ? function (map, key) { return hasOwn.call(map, key) ? map[key] : undefined; }\n : function (map, key) { return map[key]; },\n };\n // Load global or shim versions of Map, Set, and WeakMap\n var functionPrototype = Object.getPrototypeOf(Function);\n var usePolyfill = typeof process === \"object\" && Object({\"NODE_ENV\":\"spring\",\"VUE_APP_BASE_URL\":\"./\",\"BASE_URL\":\"/\"}) && Object({\"NODE_ENV\":\"spring\",\"VUE_APP_BASE_URL\":\"./\",\"BASE_URL\":\"/\"})[\"REFLECT_METADATA_USE_MAP_POLYFILL\"] === \"true\";\n var _Map = !usePolyfill && typeof Map === \"function\" && typeof Map.prototype.entries === \"function\" ? Map : CreateMapPolyfill();\n var _Set = !usePolyfill && typeof Set === \"function\" && typeof Set.prototype.entries === \"function\" ? Set : CreateSetPolyfill();\n var _WeakMap = !usePolyfill && typeof WeakMap === \"function\" ? WeakMap : CreateWeakMapPolyfill();\n // [[Metadata]] internal slot\n // https://rbuckton.github.io/reflect-metadata/#ordinary-object-internal-methods-and-internal-slots\n var Metadata = new _WeakMap();\n /**\n * Applies a set of decorators to a property of a target object.\n * @param decorators An array of decorators.\n * @param target The target object.\n * @param propertyKey (Optional) The property key to decorate.\n * @param attributes (Optional) The property descriptor for the target key.\n * @remarks Decorators are applied in reverse order.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Example = Reflect.decorate(decoratorsArray, Example);\n *\n * // property (on constructor)\n * Reflect.decorate(decoratorsArray, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.decorate(decoratorsArray, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Object.defineProperty(Example, \"staticMethod\",\n * Reflect.decorate(decoratorsArray, Example, \"staticMethod\",\n * Object.getOwnPropertyDescriptor(Example, \"staticMethod\")));\n *\n * // method (on prototype)\n * Object.defineProperty(Example.prototype, \"method\",\n * Reflect.decorate(decoratorsArray, Example.prototype, \"method\",\n * Object.getOwnPropertyDescriptor(Example.prototype, \"method\")));\n *\n */\n function decorate(decorators, target, propertyKey, attributes) {\n if (!IsUndefined(propertyKey)) {\n if (!IsArray(decorators))\n throw new TypeError();\n if (!IsObject(target))\n throw new TypeError();\n if (!IsObject(attributes) && !IsUndefined(attributes) && !IsNull(attributes))\n throw new TypeError();\n if (IsNull(attributes))\n attributes = undefined;\n propertyKey = ToPropertyKey(propertyKey);\n return DecorateProperty(decorators, target, propertyKey, attributes);\n }\n else {\n if (!IsArray(decorators))\n throw new TypeError();\n if (!IsConstructor(target))\n throw new TypeError();\n return DecorateConstructor(decorators, target);\n }\n }\n exporter(\"decorate\", decorate);\n // 4.1.2 Reflect.metadata(metadataKey, metadataValue)\n // https://rbuckton.github.io/reflect-metadata/#reflect.metadata\n /**\n * A default metadata decorator factory that can be used on a class, class member, or parameter.\n * @param metadataKey The key for the metadata entry.\n * @param metadataValue The value for the metadata entry.\n * @returns A decorator function.\n * @remarks\n * If `metadataKey` is already defined for the target and target key, the\n * metadataValue for that key will be overwritten.\n * @example\n *\n * // constructor\n * @Reflect.metadata(key, value)\n * class Example {\n * }\n *\n * // property (on constructor, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticProperty;\n * }\n *\n * // property (on prototype, TypeScript only)\n * class Example {\n * @Reflect.metadata(key, value)\n * property;\n * }\n *\n * // method (on constructor)\n * class Example {\n * @Reflect.metadata(key, value)\n * static staticMethod() { }\n * }\n *\n * // method (on prototype)\n * class Example {\n * @Reflect.metadata(key, value)\n * method() { }\n * }\n *\n */\n function metadata(metadataKey, metadataValue) {\n function decorator(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey) && !IsPropertyKey(propertyKey))\n throw new TypeError();\n OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n return decorator;\n }\n exporter(\"metadata\", metadata);\n /**\n * Define a unique metadata entry on the target.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param metadataValue A value that contains attached metadata.\n * @param target The target object on which to define metadata.\n * @param propertyKey (Optional) The property key for the target.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * Reflect.defineMetadata(\"custom:annotation\", options, Example);\n *\n * // property (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticProperty\");\n *\n * // property (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"property\");\n *\n * // method (on constructor)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example, \"staticMethod\");\n *\n * // method (on prototype)\n * Reflect.defineMetadata(\"custom:annotation\", options, Example.prototype, \"method\");\n *\n * // decorator factory as metadata-producing annotation.\n * function MyAnnotation(options): Decorator {\n * return (target, key?) => Reflect.defineMetadata(\"custom:annotation\", options, target, key);\n * }\n *\n */\n function defineMetadata(metadataKey, metadataValue, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryDefineOwnMetadata(metadataKey, metadataValue, target, propertyKey);\n }\n exporter(\"defineMetadata\", defineMetadata);\n /**\n * Gets a value indicating whether the target object or its prototype chain has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object or its prototype chain; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function hasMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"hasMetadata\", hasMetadata);\n /**\n * Gets a value indicating whether the target object has the provided metadata key defined.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata key was defined on the target object; otherwise, `false`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.hasOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function hasOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryHasOwnMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"hasOwnMetadata\", hasOwnMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object or its prototype chain.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function getMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"getMetadata\", getMetadata);\n /**\n * Gets the metadata value for the provided metadata key on the target object.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns The metadata value for the metadata key if found; otherwise, `undefined`.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function getOwnMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryGetOwnMetadata(metadataKey, target, propertyKey);\n }\n exporter(\"getOwnMetadata\", getOwnMetadata);\n /**\n * Gets the metadata keys defined on the target object or its prototype chain.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getMetadataKeys(Example.prototype, \"method\");\n *\n */\n function getMetadataKeys(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryMetadataKeys(target, propertyKey);\n }\n exporter(\"getMetadataKeys\", getMetadataKeys);\n /**\n * Gets the unique metadata keys defined on the target object.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns An array of unique metadata keys.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.getOwnMetadataKeys(Example);\n *\n * // property (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.getOwnMetadataKeys(Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.getOwnMetadataKeys(Example.prototype, \"method\");\n *\n */\n function getOwnMetadataKeys(target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n return OrdinaryOwnMetadataKeys(target, propertyKey);\n }\n exporter(\"getOwnMetadataKeys\", getOwnMetadataKeys);\n /**\n * Deletes the metadata entry from the target object with the provided key.\n * @param metadataKey A key used to store and retrieve metadata.\n * @param target The target object on which the metadata is defined.\n * @param propertyKey (Optional) The property key for the target.\n * @returns `true` if the metadata entry was found and deleted; otherwise, false.\n * @example\n *\n * class Example {\n * // property declarations are not part of ES6, though they are valid in TypeScript:\n * // static staticProperty;\n * // property;\n *\n * constructor(p) { }\n * static staticMethod(p) { }\n * method(p) { }\n * }\n *\n * // constructor\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example);\n *\n * // property (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticProperty\");\n *\n * // property (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"property\");\n *\n * // method (on constructor)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example, \"staticMethod\");\n *\n * // method (on prototype)\n * result = Reflect.deleteMetadata(\"custom:annotation\", Example.prototype, \"method\");\n *\n */\n function deleteMetadata(metadataKey, target, propertyKey) {\n if (!IsObject(target))\n throw new TypeError();\n if (!IsUndefined(propertyKey))\n propertyKey = ToPropertyKey(propertyKey);\n var metadataMap = GetOrCreateMetadataMap(target, propertyKey, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return false;\n if (!metadataMap.delete(metadataKey))\n return false;\n if (metadataMap.size > 0)\n return true;\n var targetMetadata = Metadata.get(target);\n targetMetadata.delete(propertyKey);\n if (targetMetadata.size > 0)\n return true;\n Metadata.delete(target);\n return true;\n }\n exporter(\"deleteMetadata\", deleteMetadata);\n function DecorateConstructor(decorators, target) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target);\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsConstructor(decorated))\n throw new TypeError();\n target = decorated;\n }\n }\n return target;\n }\n function DecorateProperty(decorators, target, propertyKey, descriptor) {\n for (var i = decorators.length - 1; i >= 0; --i) {\n var decorator = decorators[i];\n var decorated = decorator(target, propertyKey, descriptor);\n if (!IsUndefined(decorated) && !IsNull(decorated)) {\n if (!IsObject(decorated))\n throw new TypeError();\n descriptor = decorated;\n }\n }\n return descriptor;\n }\n function GetOrCreateMetadataMap(O, P, Create) {\n var targetMetadata = Metadata.get(O);\n if (IsUndefined(targetMetadata)) {\n if (!Create)\n return undefined;\n targetMetadata = new _Map();\n Metadata.set(O, targetMetadata);\n }\n var metadataMap = targetMetadata.get(P);\n if (IsUndefined(metadataMap)) {\n if (!Create)\n return undefined;\n metadataMap = new _Map();\n targetMetadata.set(P, metadataMap);\n }\n return metadataMap;\n }\n // 3.1.1.1 OrdinaryHasMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasmetadata\n function OrdinaryHasMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn)\n return true;\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent))\n return OrdinaryHasMetadata(MetadataKey, parent, P);\n return false;\n }\n // 3.1.2.1 OrdinaryHasOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryhasownmetadata\n function OrdinaryHasOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return false;\n return ToBoolean(metadataMap.has(MetadataKey));\n }\n // 3.1.3.1 OrdinaryGetMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetmetadata\n function OrdinaryGetMetadata(MetadataKey, O, P) {\n var hasOwn = OrdinaryHasOwnMetadata(MetadataKey, O, P);\n if (hasOwn)\n return OrdinaryGetOwnMetadata(MetadataKey, O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (!IsNull(parent))\n return OrdinaryGetMetadata(MetadataKey, parent, P);\n return undefined;\n }\n // 3.1.4.1 OrdinaryGetOwnMetadata(MetadataKey, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarygetownmetadata\n function OrdinaryGetOwnMetadata(MetadataKey, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return undefined;\n return metadataMap.get(MetadataKey);\n }\n // 3.1.5.1 OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarydefineownmetadata\n function OrdinaryDefineOwnMetadata(MetadataKey, MetadataValue, O, P) {\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ true);\n metadataMap.set(MetadataKey, MetadataValue);\n }\n // 3.1.6.1 OrdinaryMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinarymetadatakeys\n function OrdinaryMetadataKeys(O, P) {\n var ownKeys = OrdinaryOwnMetadataKeys(O, P);\n var parent = OrdinaryGetPrototypeOf(O);\n if (parent === null)\n return ownKeys;\n var parentKeys = OrdinaryMetadataKeys(parent, P);\n if (parentKeys.length <= 0)\n return ownKeys;\n if (ownKeys.length <= 0)\n return parentKeys;\n var set = new _Set();\n var keys = [];\n for (var _i = 0, ownKeys_1 = ownKeys; _i < ownKeys_1.length; _i++) {\n var key = ownKeys_1[_i];\n var hasKey = set.has(key);\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n for (var _a = 0, parentKeys_1 = parentKeys; _a < parentKeys_1.length; _a++) {\n var key = parentKeys_1[_a];\n var hasKey = set.has(key);\n if (!hasKey) {\n set.add(key);\n keys.push(key);\n }\n }\n return keys;\n }\n // 3.1.7.1 OrdinaryOwnMetadataKeys(O, P)\n // https://rbuckton.github.io/reflect-metadata/#ordinaryownmetadatakeys\n function OrdinaryOwnMetadataKeys(O, P) {\n var keys = [];\n var metadataMap = GetOrCreateMetadataMap(O, P, /*Create*/ false);\n if (IsUndefined(metadataMap))\n return keys;\n var keysObj = metadataMap.keys();\n var iterator = GetIterator(keysObj);\n var k = 0;\n while (true) {\n var next = IteratorStep(iterator);\n if (!next) {\n keys.length = k;\n return keys;\n }\n var nextValue = IteratorValue(next);\n try {\n keys[k] = nextValue;\n }\n catch (e) {\n try {\n IteratorClose(iterator);\n }\n finally {\n throw e;\n }\n }\n k++;\n }\n }\n // 6 ECMAScript Data Typ0es and Values\n // https://tc39.github.io/ecma262/#sec-ecmascript-data-types-and-values\n function Type(x) {\n if (x === null)\n return 1 /* Null */;\n switch (typeof x) {\n case \"undefined\": return 0 /* Undefined */;\n case \"boolean\": return 2 /* Boolean */;\n case \"string\": return 3 /* String */;\n case \"symbol\": return 4 /* Symbol */;\n case \"number\": return 5 /* Number */;\n case \"object\": return x === null ? 1 /* Null */ : 6 /* Object */;\n default: return 6 /* Object */;\n }\n }\n // 6.1.1 The Undefined Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-undefined-type\n function IsUndefined(x) {\n return x === undefined;\n }\n // 6.1.2 The Null Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-null-type\n function IsNull(x) {\n return x === null;\n }\n // 6.1.5 The Symbol Type\n // https://tc39.github.io/ecma262/#sec-ecmascript-language-types-symbol-type\n function IsSymbol(x) {\n return typeof x === \"symbol\";\n }\n // 6.1.7 The Object Type\n // https://tc39.github.io/ecma262/#sec-object-type\n function IsObject(x) {\n return typeof x === \"object\" ? x !== null : typeof x === \"function\";\n }\n // 7.1 Type Conversion\n // https://tc39.github.io/ecma262/#sec-type-conversion\n // 7.1.1 ToPrimitive(input [, PreferredType])\n // https://tc39.github.io/ecma262/#sec-toprimitive\n function ToPrimitive(input, PreferredType) {\n switch (Type(input)) {\n case 0 /* Undefined */: return input;\n case 1 /* Null */: return input;\n case 2 /* Boolean */: return input;\n case 3 /* String */: return input;\n case 4 /* Symbol */: return input;\n case 5 /* Number */: return input;\n }\n var hint = PreferredType === 3 /* String */ ? \"string\" : PreferredType === 5 /* Number */ ? \"number\" : \"default\";\n var exoticToPrim = GetMethod(input, toPrimitiveSymbol);\n if (exoticToPrim !== undefined) {\n var result = exoticToPrim.call(input, hint);\n if (IsObject(result))\n throw new TypeError();\n return result;\n }\n return OrdinaryToPrimitive(input, hint === \"default\" ? \"number\" : hint);\n }\n // 7.1.1.1 OrdinaryToPrimitive(O, hint)\n // https://tc39.github.io/ecma262/#sec-ordinarytoprimitive\n function OrdinaryToPrimitive(O, hint) {\n if (hint === \"string\") {\n var toString_1 = O.toString;\n if (IsCallable(toString_1)) {\n var result = toString_1.call(O);\n if (!IsObject(result))\n return result;\n }\n var valueOf = O.valueOf;\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result))\n return result;\n }\n }\n else {\n var valueOf = O.valueOf;\n if (IsCallable(valueOf)) {\n var result = valueOf.call(O);\n if (!IsObject(result))\n return result;\n }\n var toString_2 = O.toString;\n if (IsCallable(toString_2)) {\n var result = toString_2.call(O);\n if (!IsObject(result))\n return result;\n }\n }\n throw new TypeError();\n }\n // 7.1.2 ToBoolean(argument)\n // https://tc39.github.io/ecma262/2016/#sec-toboolean\n function ToBoolean(argument) {\n return !!argument;\n }\n // 7.1.12 ToString(argument)\n // https://tc39.github.io/ecma262/#sec-tostring\n function ToString(argument) {\n return \"\" + argument;\n }\n // 7.1.14 ToPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-topropertykey\n function ToPropertyKey(argument) {\n var key = ToPrimitive(argument, 3 /* String */);\n if (IsSymbol(key))\n return key;\n return ToString(key);\n }\n // 7.2 Testing and Comparison Operations\n // https://tc39.github.io/ecma262/#sec-testing-and-comparison-operations\n // 7.2.2 IsArray(argument)\n // https://tc39.github.io/ecma262/#sec-isarray\n function IsArray(argument) {\n return Array.isArray\n ? Array.isArray(argument)\n : argument instanceof Object\n ? argument instanceof Array\n : Object.prototype.toString.call(argument) === \"[object Array]\";\n }\n // 7.2.3 IsCallable(argument)\n // https://tc39.github.io/ecma262/#sec-iscallable\n function IsCallable(argument) {\n // NOTE: This is an approximation as we cannot check for [[Call]] internal method.\n return typeof argument === \"function\";\n }\n // 7.2.4 IsConstructor(argument)\n // https://tc39.github.io/ecma262/#sec-isconstructor\n function IsConstructor(argument) {\n // NOTE: This is an approximation as we cannot check for [[Construct]] internal method.\n return typeof argument === \"function\";\n }\n // 7.2.7 IsPropertyKey(argument)\n // https://tc39.github.io/ecma262/#sec-ispropertykey\n function IsPropertyKey(argument) {\n switch (Type(argument)) {\n case 3 /* String */: return true;\n case 4 /* Symbol */: return true;\n default: return false;\n }\n }\n // 7.3 Operations on Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-objects\n // 7.3.9 GetMethod(V, P)\n // https://tc39.github.io/ecma262/#sec-getmethod\n function GetMethod(V, P) {\n var func = V[P];\n if (func === undefined || func === null)\n return undefined;\n if (!IsCallable(func))\n throw new TypeError();\n return func;\n }\n // 7.4 Operations on Iterator Objects\n // https://tc39.github.io/ecma262/#sec-operations-on-iterator-objects\n function GetIterator(obj) {\n var method = GetMethod(obj, iteratorSymbol);\n if (!IsCallable(method))\n throw new TypeError(); // from Call\n var iterator = method.call(obj);\n if (!IsObject(iterator))\n throw new TypeError();\n return iterator;\n }\n // 7.4.4 IteratorValue(iterResult)\n // https://tc39.github.io/ecma262/2016/#sec-iteratorvalue\n function IteratorValue(iterResult) {\n return iterResult.value;\n }\n // 7.4.5 IteratorStep(iterator)\n // https://tc39.github.io/ecma262/#sec-iteratorstep\n function IteratorStep(iterator) {\n var result = iterator.next();\n return result.done ? false : result;\n }\n // 7.4.6 IteratorClose(iterator, completion)\n // https://tc39.github.io/ecma262/#sec-iteratorclose\n function IteratorClose(iterator) {\n var f = iterator[\"return\"];\n if (f)\n f.call(iterator);\n }\n // 9.1 Ordinary Object Internal Methods and Internal Slots\n // https://tc39.github.io/ecma262/#sec-ordinary-object-internal-methods-and-internal-slots\n // 9.1.1.1 OrdinaryGetPrototypeOf(O)\n // https://tc39.github.io/ecma262/#sec-ordinarygetprototypeof\n function OrdinaryGetPrototypeOf(O) {\n var proto = Object.getPrototypeOf(O);\n if (typeof O !== \"function\" || O === functionPrototype)\n return proto;\n // TypeScript doesn't set __proto__ in ES5, as it's non-standard.\n // Try to determine the superclass constructor. Compatible implementations\n // must either set __proto__ on a subclass constructor to the superclass constructor,\n // or ensure each class has a valid `constructor` property on its prototype that\n // points back to the constructor.\n // If this is not the same as Function.[[Prototype]], then this is definately inherited.\n // This is the case when in ES6 or when using __proto__ in a compatible browser.\n if (proto !== functionPrototype)\n return proto;\n // If the super prototype is Object.prototype, null, or undefined, then we cannot determine the heritage.\n var prototype = O.prototype;\n var prototypeProto = prototype && Object.getPrototypeOf(prototype);\n if (prototypeProto == null || prototypeProto === Object.prototype)\n return proto;\n // If the constructor was not a function, then we cannot determine the heritage.\n var constructor = prototypeProto.constructor;\n if (typeof constructor !== \"function\")\n return proto;\n // If we have some kind of self-reference, then we cannot determine the heritage.\n if (constructor === O)\n return proto;\n // we have a pretty good guess at the heritage.\n return constructor;\n }\n // naive Map shim\n function CreateMapPolyfill() {\n var cacheSentinel = {};\n var arraySentinel = [];\n var MapIterator = /** @class */ (function () {\n function MapIterator(keys, values, selector) {\n this._index = 0;\n this._keys = keys;\n this._values = values;\n this._selector = selector;\n }\n MapIterator.prototype[\"@@iterator\"] = function () { return this; };\n MapIterator.prototype[iteratorSymbol] = function () { return this; };\n MapIterator.prototype.next = function () {\n var index = this._index;\n if (index >= 0 && index < this._keys.length) {\n var result = this._selector(this._keys[index], this._values[index]);\n if (index + 1 >= this._keys.length) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n else {\n this._index++;\n }\n return { value: result, done: false };\n }\n return { value: undefined, done: true };\n };\n MapIterator.prototype.throw = function (error) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n throw error;\n };\n MapIterator.prototype.return = function (value) {\n if (this._index >= 0) {\n this._index = -1;\n this._keys = arraySentinel;\n this._values = arraySentinel;\n }\n return { value: value, done: true };\n };\n return MapIterator;\n }());\n return /** @class */ (function () {\n function Map() {\n this._keys = [];\n this._values = [];\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n Object.defineProperty(Map.prototype, \"size\", {\n get: function () { return this._keys.length; },\n enumerable: true,\n configurable: true\n });\n Map.prototype.has = function (key) { return this._find(key, /*insert*/ false) >= 0; };\n Map.prototype.get = function (key) {\n var index = this._find(key, /*insert*/ false);\n return index >= 0 ? this._values[index] : undefined;\n };\n Map.prototype.set = function (key, value) {\n var index = this._find(key, /*insert*/ true);\n this._values[index] = value;\n return this;\n };\n Map.prototype.delete = function (key) {\n var index = this._find(key, /*insert*/ false);\n if (index >= 0) {\n var size = this._keys.length;\n for (var i = index + 1; i < size; i++) {\n this._keys[i - 1] = this._keys[i];\n this._values[i - 1] = this._values[i];\n }\n this._keys.length--;\n this._values.length--;\n if (key === this._cacheKey) {\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n }\n return true;\n }\n return false;\n };\n Map.prototype.clear = function () {\n this._keys.length = 0;\n this._values.length = 0;\n this._cacheKey = cacheSentinel;\n this._cacheIndex = -2;\n };\n Map.prototype.keys = function () { return new MapIterator(this._keys, this._values, getKey); };\n Map.prototype.values = function () { return new MapIterator(this._keys, this._values, getValue); };\n Map.prototype.entries = function () { return new MapIterator(this._keys, this._values, getEntry); };\n Map.prototype[\"@@iterator\"] = function () { return this.entries(); };\n Map.prototype[iteratorSymbol] = function () { return this.entries(); };\n Map.prototype._find = function (key, insert) {\n if (this._cacheKey !== key) {\n this._cacheIndex = this._keys.indexOf(this._cacheKey = key);\n }\n if (this._cacheIndex < 0 && insert) {\n this._cacheIndex = this._keys.length;\n this._keys.push(key);\n this._values.push(undefined);\n }\n return this._cacheIndex;\n };\n return Map;\n }());\n function getKey(key, _) {\n return key;\n }\n function getValue(_, value) {\n return value;\n }\n function getEntry(key, value) {\n return [key, value];\n }\n }\n // naive Set shim\n function CreateSetPolyfill() {\n return /** @class */ (function () {\n function Set() {\n this._map = new _Map();\n }\n Object.defineProperty(Set.prototype, \"size\", {\n get: function () { return this._map.size; },\n enumerable: true,\n configurable: true\n });\n Set.prototype.has = function (value) { return this._map.has(value); };\n Set.prototype.add = function (value) { return this._map.set(value, value), this; };\n Set.prototype.delete = function (value) { return this._map.delete(value); };\n Set.prototype.clear = function () { this._map.clear(); };\n Set.prototype.keys = function () { return this._map.keys(); };\n Set.prototype.values = function () { return this._map.values(); };\n Set.prototype.entries = function () { return this._map.entries(); };\n Set.prototype[\"@@iterator\"] = function () { return this.keys(); };\n Set.prototype[iteratorSymbol] = function () { return this.keys(); };\n return Set;\n }());\n }\n // naive WeakMap shim\n function CreateWeakMapPolyfill() {\n var UUID_SIZE = 16;\n var keys = HashMap.create();\n var rootKey = CreateUniqueKey();\n return /** @class */ (function () {\n function WeakMap() {\n this._key = CreateUniqueKey();\n }\n WeakMap.prototype.has = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? HashMap.has(table, this._key) : false;\n };\n WeakMap.prototype.get = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? HashMap.get(table, this._key) : undefined;\n };\n WeakMap.prototype.set = function (target, value) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ true);\n table[this._key] = value;\n return this;\n };\n WeakMap.prototype.delete = function (target) {\n var table = GetOrCreateWeakMapTable(target, /*create*/ false);\n return table !== undefined ? delete table[this._key] : false;\n };\n WeakMap.prototype.clear = function () {\n // NOTE: not a real clear, just makes the previous data unreachable\n this._key = CreateUniqueKey();\n };\n return WeakMap;\n }());\n function CreateUniqueKey() {\n var key;\n do\n key = \"@@WeakMap@@\" + CreateUUID();\n while (HashMap.has(keys, key));\n keys[key] = true;\n return key;\n }\n function GetOrCreateWeakMapTable(target, create) {\n if (!hasOwn.call(target, rootKey)) {\n if (!create)\n return undefined;\n Object.defineProperty(target, rootKey, { value: HashMap.create() });\n }\n return target[rootKey];\n }\n function FillRandomBytes(buffer, size) {\n for (var i = 0; i < size; ++i)\n buffer[i] = Math.random() * 0xff | 0;\n return buffer;\n }\n function GenRandomBytes(size) {\n if (typeof Uint8Array === \"function\") {\n if (typeof crypto !== \"undefined\")\n return crypto.getRandomValues(new Uint8Array(size));\n if (typeof msCrypto !== \"undefined\")\n return msCrypto.getRandomValues(new Uint8Array(size));\n return FillRandomBytes(new Uint8Array(size), size);\n }\n return FillRandomBytes(new Array(size), size);\n }\n function CreateUUID() {\n var data = GenRandomBytes(UUID_SIZE);\n // mark as random - RFC 4122 § 4.4\n data[6] = data[6] & 0x4f | 0x40;\n data[8] = data[8] & 0xbf | 0x80;\n var result = \"\";\n for (var offset = 0; offset < UUID_SIZE; ++offset) {\n var byte = data[offset];\n if (offset === 4 || offset === 6 || offset === 8)\n result += \"-\";\n if (byte < 16)\n result += \"0\";\n result += byte.toString(16).toLowerCase();\n }\n return result;\n }\n }\n // uses a heuristic used by v8 and chakra to force an object into dictionary mode.\n function MakeDictionary(obj) {\n obj.__ = undefined;\n delete obj.__;\n return obj;\n }\n });\n})(Reflect || (Reflect = {}));\n\n/* WEBPACK VAR INJECTION */}.call(this, __webpack_require__(/*! ./../node-libs-browser/mock/process.js */ \"./node_modules/node-libs-browser/mock/process.js\"), __webpack_require__(/*! ./../webpack/buildin/global.js */ \"./node_modules/webpack/buildin/global.js\")))\n\n//# sourceURL=webpack:///./node_modules/reflect-metadata/Reflect.js?"); - -/***/ }), - /***/ "./node_modules/regl/dist/regl.js": /*!****************************************!*\ !*** ./node_modules/regl/dist/regl.js ***! @@ -11716,29 +11780,18 @@ eval("(function (global, factory) {\n true ? module.exports = factory() :\n /***/ (function(module, exports, __webpack_require__) { "use strict"; -eval("\n\nvar isArrayish = __webpack_require__(/*! is-arrayish */ \"./node_modules/simple-swizzle/node_modules/is-arrayish/index.js\");\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n\n\n//# sourceURL=webpack:///./node_modules/simple-swizzle/index.js?"); - -/***/ }), - -/***/ "./node_modules/simple-swizzle/node_modules/is-arrayish/index.js": -/*!***********************************************************************!*\ - !*** ./node_modules/simple-swizzle/node_modules/is-arrayish/index.js ***! - \***********************************************************************/ -/*! no static exports found */ -/***/ (function(module, exports) { - -eval("module.exports = function isArrayish(obj) {\n\tif (!obj || typeof obj === 'string') {\n\t\treturn false;\n\t}\n\n\treturn obj instanceof Array || Array.isArray(obj) ||\n\t\t(obj.length >= 0 && (obj.splice instanceof Function ||\n\t\t\t(Object.getOwnPropertyDescriptor(obj, (obj.length - 1)) && obj.constructor.name !== 'String')));\n};\n\n\n//# sourceURL=webpack:///./node_modules/simple-swizzle/node_modules/is-arrayish/index.js?"); +eval("\n\nvar isArrayish = __webpack_require__(/*! is-arrayish */ \"./node_modules/is-arrayish/index.js\");\n\nvar concat = Array.prototype.concat;\nvar slice = Array.prototype.slice;\n\nvar swizzle = module.exports = function swizzle(args) {\n\tvar results = [];\n\n\tfor (var i = 0, len = args.length; i < len; i++) {\n\t\tvar arg = args[i];\n\n\t\tif (isArrayish(arg)) {\n\t\t\t// http://jsperf.com/javascript-array-concat-vs-push/98\n\t\t\tresults = concat.call(results, slice.call(arg));\n\t\t} else {\n\t\t\tresults.push(arg);\n\t\t}\n\t}\n\n\treturn results;\n};\n\nswizzle.wrap = function (fn) {\n\treturn function () {\n\t\treturn fn(swizzle(arguments));\n\t};\n};\n\n\n//# sourceURL=webpack:///./node_modules/simple-swizzle/index.js?"); /***/ }), -/***/ "./node_modules/tinycolor2/tinycolor.js": -/*!**********************************************!*\ - !*** ./node_modules/tinycolor2/tinycolor.js ***! - \**********************************************/ +/***/ "./node_modules/tinycolor2/cjs/tinycolor.js": +/*!**************************************************!*\ + !*** ./node_modules/tinycolor2/cjs/tinycolor.js ***! + \**************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.2\n// https://github.com/bgrins/TinyColor\n// Brian Grinstead, MIT License\n\n(function(Math) {\n\nvar trimLeft = /^\\s+/,\n trimRight = /\\s+$/,\n tinyCounter = 0,\n mathRound = Math.round,\n mathMin = Math.min,\n mathMax = Math.max,\n mathRandom = Math.random;\n\nfunction tinycolor (color, opts) {\n\n color = (color) ? color : '';\n opts = opts || { };\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n\n var rgb = inputToRGB(color);\n this._originalInput = color,\n this._r = rgb.r,\n this._g = rgb.g,\n this._b = rgb.b,\n this._a = rgb.a,\n this._roundA = mathRound(100*this._a) / 100,\n this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) { this._r = mathRound(this._r); }\n if (this._g < 1) { this._g = mathRound(this._g); }\n if (this._b < 1) { this._b = mathRound(this._b); }\n\n this._ok = rgb.ok;\n this._tc_id = tinyCounter++;\n}\n\ntinycolor.prototype = {\n isDark: function() {\n return this.getBrightness() < 128;\n },\n isLight: function() {\n return !this.isDark();\n },\n isValid: function() {\n return this._ok;\n },\n getOriginalInput: function() {\n return this._originalInput;\n },\n getFormat: function() {\n return this._format;\n },\n getAlpha: function() {\n return this._a;\n },\n getBrightness: function() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r/255;\n GsRGB = rgb.g/255;\n BsRGB = rgb.b/255;\n\n if (RsRGB <= 0.03928) {R = RsRGB / 12.92;} else {R = Math.pow(((RsRGB + 0.055) / 1.055), 2.4);}\n if (GsRGB <= 0.03928) {G = GsRGB / 12.92;} else {G = Math.pow(((GsRGB + 0.055) / 1.055), 2.4);}\n if (BsRGB <= 0.03928) {B = BsRGB / 12.92;} else {B = Math.pow(((BsRGB + 0.055) / 1.055), 2.4);}\n return (0.2126 * R) + (0.7152 * G) + (0.0722 * B);\n },\n setAlpha: function(value) {\n this._a = boundAlpha(value);\n this._roundA = mathRound(100*this._a) / 100;\n return this;\n },\n toHsv: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return { h: hsv.h * 360, s: hsv.s, v: hsv.v, a: this._a };\n },\n toHsvString: function() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = mathRound(hsv.h * 360), s = mathRound(hsv.s * 100), v = mathRound(hsv.v * 100);\n return (this._a == 1) ?\n \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" :\n \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \"+ this._roundA + \")\";\n },\n toHsl: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return { h: hsl.h * 360, s: hsl.s, l: hsl.l, a: this._a };\n },\n toHslString: function() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = mathRound(hsl.h * 360), s = mathRound(hsl.s * 100), l = mathRound(hsl.l * 100);\n return (this._a == 1) ?\n \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" :\n \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \"+ this._roundA + \")\";\n },\n toHex: function(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function(allow3Char) {\n return '#' + this.toHex(allow3Char);\n },\n toHex8: function(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function(allow4Char) {\n return '#' + this.toHex8(allow4Char);\n },\n toRgb: function() {\n return { r: mathRound(this._r), g: mathRound(this._g), b: mathRound(this._b), a: this._a };\n },\n toRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \")\" :\n \"rgba(\" + mathRound(this._r) + \", \" + mathRound(this._g) + \", \" + mathRound(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function() {\n return { r: mathRound(bound01(this._r, 255) * 100) + \"%\", g: mathRound(bound01(this._g, 255) * 100) + \"%\", b: mathRound(bound01(this._b, 255) * 100) + \"%\", a: this._a };\n },\n toPercentageRgbString: function() {\n return (this._a == 1) ?\n \"rgb(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%)\" :\n \"rgba(\" + mathRound(bound01(this._r, 255) * 100) + \"%, \" + mathRound(bound01(this._g, 255) * 100) + \"%, \" + mathRound(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function() {\n if (this._a === 0) {\n return \"transparent\";\n }\n\n if (this._a < 1) {\n return false;\n }\n\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function(secondColor) {\n var hex8String = '#' + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = '#' + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n\n return \"progid:DXImageTransform.Microsoft.gradient(\"+gradientType+\"startColorstr=\"+hex8String+\",endColorstr=\"+secondHex8String+\")\";\n },\n toString: function(format) {\n var formatSet = !!format;\n format = format || this._format;\n\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n\n return formattedString || this.toHexString();\n },\n clone: function() {\n return tinycolor(this.toString());\n },\n\n _applyModification: function(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function() {\n return this._applyModification(lighten, arguments);\n },\n brighten: function() {\n return this._applyModification(brighten, arguments);\n },\n darken: function() {\n return this._applyModification(darken, arguments);\n },\n desaturate: function() {\n return this._applyModification(desaturate, arguments);\n },\n saturate: function() {\n return this._applyModification(saturate, arguments);\n },\n greyscale: function() {\n return this._applyModification(greyscale, arguments);\n },\n spin: function() {\n return this._applyModification(spin, arguments);\n },\n\n _applyCombination: function(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function() {\n return this._applyCombination(analogous, arguments);\n },\n complement: function() {\n return this._applyCombination(complement, arguments);\n },\n monochromatic: function() {\n return this._applyCombination(monochromatic, arguments);\n },\n splitcomplement: function() {\n return this._applyCombination(splitcomplement, arguments);\n },\n triad: function() {\n return this._applyCombination(triad, arguments);\n },\n tetrad: function() {\n return this._applyCombination(tetrad, arguments);\n }\n};\n\n// If input is an object, force 1 into \"1.0\" to handle ratios properly\n// String input requires \"1.0\" as input, so 1 will be treated as 1\ntinycolor.fromRatio = function(color, opts) {\n if (typeof color == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n }\n else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n\n return tinycolor(color, opts);\n};\n\n// Given a string or object, convert that input to RGB\n// Possible string inputs:\n//\n// \"red\"\n// \"#f00\" or \"f00\"\n// \"#ff0000\" or \"ff0000\"\n// \"#ff000000\" or \"ff000000\"\n// \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n// \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n// \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n// \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n// \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n// \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n// \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n//\nfunction inputToRGB(color) {\n\n var rgb = { r: 0, g: 0, b: 0 };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n\n if (typeof color == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n }\n else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n\n a = boundAlpha(a);\n\n return {\n ok: ok,\n format: color.format || format,\n r: mathMin(255, mathMax(rgb.r, 0)),\n g: mathMin(255, mathMax(rgb.g, 0)),\n b: mathMin(255, mathMax(rgb.b, 0)),\n a: a\n };\n}\n\n\n// Conversion Functions\n// --------------------\n\n// `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n// \n\n// `rgbToRgb`\n// Handle bounds / percentage checking to conform to CSS color spec\n// \n// *Assumes:* r, g, b in [0, 255] or [0, 1]\n// *Returns:* { r, g, b } in [0, 255]\nfunction rgbToRgb(r, g, b){\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n}\n\n// `rgbToHsl`\n// Converts an RGB color value to HSL.\n// *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n// *Returns:* { h, s, l } in [0,1]\nfunction rgbToHsl(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, l = (max + min) / 2;\n\n if(max == min) {\n h = s = 0; // achromatic\n }\n else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n\n h /= 6;\n }\n\n return { h: h, s: s, l: l };\n}\n\n// `hslToRgb`\n// Converts an HSL color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\nfunction hslToRgb(h, s, l) {\n var r, g, b;\n\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n\n function hue2rgb(p, q, t) {\n if(t < 0) t += 1;\n if(t > 1) t -= 1;\n if(t < 1/6) return p + (q - p) * 6 * t;\n if(t < 1/2) return q;\n if(t < 2/3) return p + (q - p) * (2/3 - t) * 6;\n return p;\n }\n\n if(s === 0) {\n r = g = b = l; // achromatic\n }\n else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1/3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1/3);\n }\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHsv`\n// Converts an RGB color value to HSV\n// *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n// *Returns:* { h, s, v } in [0,1]\nfunction rgbToHsv(r, g, b) {\n\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n\n var max = mathMax(r, g, b), min = mathMin(r, g, b);\n var h, s, v = max;\n\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n\n if(max == min) {\n h = 0; // achromatic\n }\n else {\n switch(max) {\n case r: h = (g - b) / d + (g < b ? 6 : 0); break;\n case g: h = (b - r) / d + 2; break;\n case b: h = (r - g) / d + 4; break;\n }\n h /= 6;\n }\n return { h: h, s: s, v: v };\n}\n\n// `hsvToRgb`\n// Converts an HSV color value to RGB.\n// *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n// *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n\n return { r: r * 255, g: g * 255, b: b * 255 };\n}\n\n// `rgbToHex`\n// Converts an RGB color to hex\n// Assumes r, g, and b are contained in the set [0, 255]\n// Returns a 3 or 6 character hex\nfunction rgbToHex(r, g, b, allow3Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToHex`\n// Converts an RGBA color plus alpha transparency to hex\n// Assumes r, g, b are contained in the set [0, 255] and\n// a in [0, 1]. Returns a 4 or 8 character rgba hex\nfunction rgbaToHex(r, g, b, a, allow4Char) {\n\n var hex = [\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16)),\n pad2(convertDecimalToHex(a))\n ];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n\n return hex.join(\"\");\n}\n\n// `rgbaToArgbHex`\n// Converts an RGBA color to an ARGB Hex8 string\n// Rarely used, but required for \"toFilter()\"\nfunction rgbaToArgbHex(r, g, b, a) {\n\n var hex = [\n pad2(convertDecimalToHex(a)),\n pad2(mathRound(r).toString(16)),\n pad2(mathRound(g).toString(16)),\n pad2(mathRound(b).toString(16))\n ];\n\n return hex.join(\"\");\n}\n\n// `equals`\n// Can be called with any tinycolor input\ntinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) { return false; }\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n};\n\ntinycolor.random = function() {\n return tinycolor.fromRatio({\n r: mathRandom(),\n g: mathRandom(),\n b: mathRandom()\n });\n};\n\n\n// Modification Functions\n// ----------------------\n// Thanks to less.js for some of the basics here\n// \n\nfunction desaturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction saturate(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n}\n\nfunction greyscale(color) {\n return tinycolor(color).desaturate(100);\n}\n\nfunction lighten (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\nfunction brighten(color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var rgb = tinycolor(color).toRgb();\n rgb.r = mathMax(0, mathMin(255, rgb.r - mathRound(255 * - (amount / 100))));\n rgb.g = mathMax(0, mathMin(255, rgb.g - mathRound(255 * - (amount / 100))));\n rgb.b = mathMax(0, mathMin(255, rgb.b - mathRound(255 * - (amount / 100))));\n return tinycolor(rgb);\n}\n\nfunction darken (color, amount) {\n amount = (amount === 0) ? 0 : (amount || 10);\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n}\n\n// Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n// Values outside of this range will be wrapped into this range.\nfunction spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n}\n\n// Combination Functions\n// ---------------------\n// Thanks to jQuery xColor for some of the ideas behind these\n// \n\nfunction complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n}\n\nfunction triad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 120) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 240) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction tetrad(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 90) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 180) % 360, s: hsl.s, l: hsl.l }),\n tinycolor({ h: (h + 270) % 360, s: hsl.s, l: hsl.l })\n ];\n}\n\nfunction splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [\n tinycolor(color),\n tinycolor({ h: (h + 72) % 360, s: hsl.s, l: hsl.l}),\n tinycolor({ h: (h + 216) % 360, s: hsl.s, l: hsl.l})\n ];\n}\n\nfunction analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n\n for (hsl.h = ((hsl.h - (part * results >> 1)) + 720) % 360; --results; ) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n}\n\nfunction monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h, s = hsv.s, v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n\n while (results--) {\n ret.push(tinycolor({ h: h, s: s, v: v}));\n v = (v + modification) % 1;\n }\n\n return ret;\n}\n\n// Utility Functions\n// ---------------------\n\ntinycolor.mix = function(color1, color2, amount) {\n amount = (amount === 0) ? 0 : (amount || 50);\n\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n\n var p = amount / 100;\n\n var rgba = {\n r: ((rgb2.r - rgb1.r) * p) + rgb1.r,\n g: ((rgb2.g - rgb1.g) * p) + rgb1.g,\n b: ((rgb2.b - rgb1.b) * p) + rgb1.b,\n a: ((rgb2.a - rgb1.a) * p) + rgb1.a\n };\n\n return tinycolor(rgba);\n};\n\n\n// Readability Functions\n// ---------------------\n// false\n// tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\ntinycolor.isReadable = function(color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n\n out = false;\n\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n\n};\n\n// `mostReadable`\n// Given a base color and a list of possible foreground or background\n// colors for that base, returns the most readable color.\n// Optionally returns Black or White if the most readable color is unreadable.\n// *Example*\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n// tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n// tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\ntinycolor.mostReadable = function(baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size ;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors ;\n level = args.level;\n size = args.size;\n\n for (var i= 0; i < colorList.length ; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n\n if (tinycolor.isReadable(baseColor, bestColor, {\"level\":level,\"size\":size}) || !includeFallbackColors) {\n return bestColor;\n }\n else {\n args.includeFallbackColors=false;\n return tinycolor.mostReadable(baseColor,[\"#fff\", \"#000\"],args);\n }\n};\n\n\n// Big List of Colors\n// ------------------\n// \nvar names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n};\n\n// Make it easy to access colors via `hexNames[hex]`\nvar hexNames = tinycolor.hexNames = flip(names);\n\n\n// Utilities\n// ---------\n\n// `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\nfunction flip(o) {\n var flipped = { };\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n}\n\n// Return a valid alpha value [0,1] with all invalid values being set to 1\nfunction boundAlpha(a) {\n a = parseFloat(a);\n\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n\n return a;\n}\n\n// Take input from [0, n] and return it as [0, 1]\nfunction bound01(n, max) {\n if (isOnePointZero(n)) { n = \"100%\"; }\n\n var processPercent = isPercentage(n);\n n = mathMin(max, mathMax(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if ((Math.abs(n - max) < 0.000001)) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return (n % max) / parseFloat(max);\n}\n\n// Force a number between 0 and 1\nfunction clamp01(val) {\n return mathMin(1, mathMax(0, val));\n}\n\n// Parse a base-16 hex value into a base-10 integer\nfunction parseIntFromHex(val) {\n return parseInt(val, 16);\n}\n\n// Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n// \nfunction isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf('.') != -1 && parseFloat(n) === 1;\n}\n\n// Check to see if string passed in is a percentage\nfunction isPercentage(n) {\n return typeof n === \"string\" && n.indexOf('%') != -1;\n}\n\n// Force a hex value to have 2 characters\nfunction pad2(c) {\n return c.length == 1 ? '0' + c : '' + c;\n}\n\n// Replace a decimal with it's percentage value\nfunction convertToPercentage(n) {\n if (n <= 1) {\n n = (n * 100) + \"%\";\n }\n\n return n;\n}\n\n// Converts a decimal to a hex value\nfunction convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n}\n// Converts a hex value to a decimal\nfunction convertHexToDecimal(h) {\n return (parseIntFromHex(h) / 255);\n}\n\nvar matchers = (function() {\n\n // \n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // \n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n})();\n\n// `isValidCSSUnit`\n// Take in a single string / number and check to see if it looks like a CSS unit\n// (see `matchers` above for definition).\nfunction isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n}\n\n// `stringInputToObject`\n// Permissive string parsing. Take in a number of formats, and output an object\n// based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\nfunction stringInputToObject(color) {\n\n color = color.replace(trimLeft,'').replace(trimRight, '').toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n }\n else if (color == 'transparent') {\n return { r: 0, g: 0, b: 0, a: 0, format: \"name\" };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if ((match = matchers.rgb.exec(color))) {\n return { r: match[1], g: match[2], b: match[3] };\n }\n if ((match = matchers.rgba.exec(color))) {\n return { r: match[1], g: match[2], b: match[3], a: match[4] };\n }\n if ((match = matchers.hsl.exec(color))) {\n return { h: match[1], s: match[2], l: match[3] };\n }\n if ((match = matchers.hsla.exec(color))) {\n return { h: match[1], s: match[2], l: match[3], a: match[4] };\n }\n if ((match = matchers.hsv.exec(color))) {\n return { h: match[1], s: match[2], v: match[3] };\n }\n if ((match = matchers.hsva.exec(color))) {\n return { h: match[1], s: match[2], v: match[3], a: match[4] };\n }\n if ((match = matchers.hex8.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex6.exec(color))) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if ((match = matchers.hex4.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n a: convertHexToDecimal(match[4] + '' + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if ((match = matchers.hex3.exec(color))) {\n return {\n r: parseIntFromHex(match[1] + '' + match[1]),\n g: parseIntFromHex(match[2] + '' + match[2]),\n b: parseIntFromHex(match[3] + '' + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n\n return false;\n}\n\nfunction validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\"level\":\"AA\", \"size\":\"small\"};\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\"level\":level, \"size\":size};\n}\n\n// Node: Export function\nif ( true && module.exports) {\n module.exports = tinycolor;\n}\n// AMD/requirejs: Define the module\nelse if (true) {\n !(__WEBPACK_AMD_DEFINE_RESULT__ = (function () {return tinycolor;}).call(exports, __webpack_require__, exports, module),\n\t\t\t\t__WEBPACK_AMD_DEFINE_RESULT__ !== undefined && (module.exports = __WEBPACK_AMD_DEFINE_RESULT__));\n}\n// Browser: Expose to window\nelse {}\n\n})(Math);\n\n\n//# sourceURL=webpack:///./node_modules/tinycolor2/tinycolor.js?"); +eval("// This file is autogenerated. It's used to publish CJS to npm.\n(function (global, factory) {\n true ? module.exports = factory() :\n undefined;\n})(this, (function () { 'use strict';\n\n function _typeof(obj) {\n \"@babel/helpers - typeof\";\n\n return _typeof = \"function\" == typeof Symbol && \"symbol\" == typeof Symbol.iterator ? function (obj) {\n return typeof obj;\n } : function (obj) {\n return obj && \"function\" == typeof Symbol && obj.constructor === Symbol && obj !== Symbol.prototype ? \"symbol\" : typeof obj;\n }, _typeof(obj);\n }\n\n // https://github.com/bgrins/TinyColor\n // Brian Grinstead, MIT License\n\n var trimLeft = /^\\s+/;\n var trimRight = /\\s+$/;\n function tinycolor(color, opts) {\n color = color ? color : \"\";\n opts = opts || {};\n\n // If input is already a tinycolor, return itself\n if (color instanceof tinycolor) {\n return color;\n }\n // If we are called as a function, call using new instead\n if (!(this instanceof tinycolor)) {\n return new tinycolor(color, opts);\n }\n var rgb = inputToRGB(color);\n this._originalInput = color, this._r = rgb.r, this._g = rgb.g, this._b = rgb.b, this._a = rgb.a, this._roundA = Math.round(100 * this._a) / 100, this._format = opts.format || rgb.format;\n this._gradientType = opts.gradientType;\n\n // Don't let the range of [0,255] come back in [0,1].\n // Potentially lose a little bit of precision here, but will fix issues where\n // .5 gets interpreted as half of the total, instead of half of 1\n // If it was supposed to be 128, this was already taken care of by `inputToRgb`\n if (this._r < 1) this._r = Math.round(this._r);\n if (this._g < 1) this._g = Math.round(this._g);\n if (this._b < 1) this._b = Math.round(this._b);\n this._ok = rgb.ok;\n }\n tinycolor.prototype = {\n isDark: function isDark() {\n return this.getBrightness() < 128;\n },\n isLight: function isLight() {\n return !this.isDark();\n },\n isValid: function isValid() {\n return this._ok;\n },\n getOriginalInput: function getOriginalInput() {\n return this._originalInput;\n },\n getFormat: function getFormat() {\n return this._format;\n },\n getAlpha: function getAlpha() {\n return this._a;\n },\n getBrightness: function getBrightness() {\n //http://www.w3.org/TR/AERT#color-contrast\n var rgb = this.toRgb();\n return (rgb.r * 299 + rgb.g * 587 + rgb.b * 114) / 1000;\n },\n getLuminance: function getLuminance() {\n //http://www.w3.org/TR/2008/REC-WCAG20-20081211/#relativeluminancedef\n var rgb = this.toRgb();\n var RsRGB, GsRGB, BsRGB, R, G, B;\n RsRGB = rgb.r / 255;\n GsRGB = rgb.g / 255;\n BsRGB = rgb.b / 255;\n if (RsRGB <= 0.03928) R = RsRGB / 12.92;else R = Math.pow((RsRGB + 0.055) / 1.055, 2.4);\n if (GsRGB <= 0.03928) G = GsRGB / 12.92;else G = Math.pow((GsRGB + 0.055) / 1.055, 2.4);\n if (BsRGB <= 0.03928) B = BsRGB / 12.92;else B = Math.pow((BsRGB + 0.055) / 1.055, 2.4);\n return 0.2126 * R + 0.7152 * G + 0.0722 * B;\n },\n setAlpha: function setAlpha(value) {\n this._a = boundAlpha(value);\n this._roundA = Math.round(100 * this._a) / 100;\n return this;\n },\n toHsv: function toHsv() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n return {\n h: hsv.h * 360,\n s: hsv.s,\n v: hsv.v,\n a: this._a\n };\n },\n toHsvString: function toHsvString() {\n var hsv = rgbToHsv(this._r, this._g, this._b);\n var h = Math.round(hsv.h * 360),\n s = Math.round(hsv.s * 100),\n v = Math.round(hsv.v * 100);\n return this._a == 1 ? \"hsv(\" + h + \", \" + s + \"%, \" + v + \"%)\" : \"hsva(\" + h + \", \" + s + \"%, \" + v + \"%, \" + this._roundA + \")\";\n },\n toHsl: function toHsl() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n return {\n h: hsl.h * 360,\n s: hsl.s,\n l: hsl.l,\n a: this._a\n };\n },\n toHslString: function toHslString() {\n var hsl = rgbToHsl(this._r, this._g, this._b);\n var h = Math.round(hsl.h * 360),\n s = Math.round(hsl.s * 100),\n l = Math.round(hsl.l * 100);\n return this._a == 1 ? \"hsl(\" + h + \", \" + s + \"%, \" + l + \"%)\" : \"hsla(\" + h + \", \" + s + \"%, \" + l + \"%, \" + this._roundA + \")\";\n },\n toHex: function toHex(allow3Char) {\n return rgbToHex(this._r, this._g, this._b, allow3Char);\n },\n toHexString: function toHexString(allow3Char) {\n return \"#\" + this.toHex(allow3Char);\n },\n toHex8: function toHex8(allow4Char) {\n return rgbaToHex(this._r, this._g, this._b, this._a, allow4Char);\n },\n toHex8String: function toHex8String(allow4Char) {\n return \"#\" + this.toHex8(allow4Char);\n },\n toRgb: function toRgb() {\n return {\n r: Math.round(this._r),\n g: Math.round(this._g),\n b: Math.round(this._b),\n a: this._a\n };\n },\n toRgbString: function toRgbString() {\n return this._a == 1 ? \"rgb(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \")\" : \"rgba(\" + Math.round(this._r) + \", \" + Math.round(this._g) + \", \" + Math.round(this._b) + \", \" + this._roundA + \")\";\n },\n toPercentageRgb: function toPercentageRgb() {\n return {\n r: Math.round(bound01(this._r, 255) * 100) + \"%\",\n g: Math.round(bound01(this._g, 255) * 100) + \"%\",\n b: Math.round(bound01(this._b, 255) * 100) + \"%\",\n a: this._a\n };\n },\n toPercentageRgbString: function toPercentageRgbString() {\n return this._a == 1 ? \"rgb(\" + Math.round(bound01(this._r, 255) * 100) + \"%, \" + Math.round(bound01(this._g, 255) * 100) + \"%, \" + Math.round(bound01(this._b, 255) * 100) + \"%)\" : \"rgba(\" + Math.round(bound01(this._r, 255) * 100) + \"%, \" + Math.round(bound01(this._g, 255) * 100) + \"%, \" + Math.round(bound01(this._b, 255) * 100) + \"%, \" + this._roundA + \")\";\n },\n toName: function toName() {\n if (this._a === 0) {\n return \"transparent\";\n }\n if (this._a < 1) {\n return false;\n }\n return hexNames[rgbToHex(this._r, this._g, this._b, true)] || false;\n },\n toFilter: function toFilter(secondColor) {\n var hex8String = \"#\" + rgbaToArgbHex(this._r, this._g, this._b, this._a);\n var secondHex8String = hex8String;\n var gradientType = this._gradientType ? \"GradientType = 1, \" : \"\";\n if (secondColor) {\n var s = tinycolor(secondColor);\n secondHex8String = \"#\" + rgbaToArgbHex(s._r, s._g, s._b, s._a);\n }\n return \"progid:DXImageTransform.Microsoft.gradient(\" + gradientType + \"startColorstr=\" + hex8String + \",endColorstr=\" + secondHex8String + \")\";\n },\n toString: function toString(format) {\n var formatSet = !!format;\n format = format || this._format;\n var formattedString = false;\n var hasAlpha = this._a < 1 && this._a >= 0;\n var needsAlphaFormat = !formatSet && hasAlpha && (format === \"hex\" || format === \"hex6\" || format === \"hex3\" || format === \"hex4\" || format === \"hex8\" || format === \"name\");\n if (needsAlphaFormat) {\n // Special case for \"transparent\", all other non-alpha formats\n // will return rgba when there is transparency.\n if (format === \"name\" && this._a === 0) {\n return this.toName();\n }\n return this.toRgbString();\n }\n if (format === \"rgb\") {\n formattedString = this.toRgbString();\n }\n if (format === \"prgb\") {\n formattedString = this.toPercentageRgbString();\n }\n if (format === \"hex\" || format === \"hex6\") {\n formattedString = this.toHexString();\n }\n if (format === \"hex3\") {\n formattedString = this.toHexString(true);\n }\n if (format === \"hex4\") {\n formattedString = this.toHex8String(true);\n }\n if (format === \"hex8\") {\n formattedString = this.toHex8String();\n }\n if (format === \"name\") {\n formattedString = this.toName();\n }\n if (format === \"hsl\") {\n formattedString = this.toHslString();\n }\n if (format === \"hsv\") {\n formattedString = this.toHsvString();\n }\n return formattedString || this.toHexString();\n },\n clone: function clone() {\n return tinycolor(this.toString());\n },\n _applyModification: function _applyModification(fn, args) {\n var color = fn.apply(null, [this].concat([].slice.call(args)));\n this._r = color._r;\n this._g = color._g;\n this._b = color._b;\n this.setAlpha(color._a);\n return this;\n },\n lighten: function lighten() {\n return this._applyModification(_lighten, arguments);\n },\n brighten: function brighten() {\n return this._applyModification(_brighten, arguments);\n },\n darken: function darken() {\n return this._applyModification(_darken, arguments);\n },\n desaturate: function desaturate() {\n return this._applyModification(_desaturate, arguments);\n },\n saturate: function saturate() {\n return this._applyModification(_saturate, arguments);\n },\n greyscale: function greyscale() {\n return this._applyModification(_greyscale, arguments);\n },\n spin: function spin() {\n return this._applyModification(_spin, arguments);\n },\n _applyCombination: function _applyCombination(fn, args) {\n return fn.apply(null, [this].concat([].slice.call(args)));\n },\n analogous: function analogous() {\n return this._applyCombination(_analogous, arguments);\n },\n complement: function complement() {\n return this._applyCombination(_complement, arguments);\n },\n monochromatic: function monochromatic() {\n return this._applyCombination(_monochromatic, arguments);\n },\n splitcomplement: function splitcomplement() {\n return this._applyCombination(_splitcomplement, arguments);\n },\n // Disabled until https://github.com/bgrins/TinyColor/issues/254\n // polyad: function (number) {\n // return this._applyCombination(polyad, [number]);\n // },\n triad: function triad() {\n return this._applyCombination(polyad, [3]);\n },\n tetrad: function tetrad() {\n return this._applyCombination(polyad, [4]);\n }\n };\n\n // If input is an object, force 1 into \"1.0\" to handle ratios properly\n // String input requires \"1.0\" as input, so 1 will be treated as 1\n tinycolor.fromRatio = function (color, opts) {\n if (_typeof(color) == \"object\") {\n var newColor = {};\n for (var i in color) {\n if (color.hasOwnProperty(i)) {\n if (i === \"a\") {\n newColor[i] = color[i];\n } else {\n newColor[i] = convertToPercentage(color[i]);\n }\n }\n }\n color = newColor;\n }\n return tinycolor(color, opts);\n };\n\n // Given a string or object, convert that input to RGB\n // Possible string inputs:\n //\n // \"red\"\n // \"#f00\" or \"f00\"\n // \"#ff0000\" or \"ff0000\"\n // \"#ff000000\" or \"ff000000\"\n // \"rgb 255 0 0\" or \"rgb (255, 0, 0)\"\n // \"rgb 1.0 0 0\" or \"rgb (1, 0, 0)\"\n // \"rgba (255, 0, 0, 1)\" or \"rgba 255, 0, 0, 1\"\n // \"rgba (1.0, 0, 0, 1)\" or \"rgba 1.0, 0, 0, 1\"\n // \"hsl(0, 100%, 50%)\" or \"hsl 0 100% 50%\"\n // \"hsla(0, 100%, 50%, 1)\" or \"hsla 0 100% 50%, 1\"\n // \"hsv(0, 100%, 100%)\" or \"hsv 0 100% 100%\"\n //\n function inputToRGB(color) {\n var rgb = {\n r: 0,\n g: 0,\n b: 0\n };\n var a = 1;\n var s = null;\n var v = null;\n var l = null;\n var ok = false;\n var format = false;\n if (typeof color == \"string\") {\n color = stringInputToObject(color);\n }\n if (_typeof(color) == \"object\") {\n if (isValidCSSUnit(color.r) && isValidCSSUnit(color.g) && isValidCSSUnit(color.b)) {\n rgb = rgbToRgb(color.r, color.g, color.b);\n ok = true;\n format = String(color.r).substr(-1) === \"%\" ? \"prgb\" : \"rgb\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.v)) {\n s = convertToPercentage(color.s);\n v = convertToPercentage(color.v);\n rgb = hsvToRgb(color.h, s, v);\n ok = true;\n format = \"hsv\";\n } else if (isValidCSSUnit(color.h) && isValidCSSUnit(color.s) && isValidCSSUnit(color.l)) {\n s = convertToPercentage(color.s);\n l = convertToPercentage(color.l);\n rgb = hslToRgb(color.h, s, l);\n ok = true;\n format = \"hsl\";\n }\n if (color.hasOwnProperty(\"a\")) {\n a = color.a;\n }\n }\n a = boundAlpha(a);\n return {\n ok: ok,\n format: color.format || format,\n r: Math.min(255, Math.max(rgb.r, 0)),\n g: Math.min(255, Math.max(rgb.g, 0)),\n b: Math.min(255, Math.max(rgb.b, 0)),\n a: a\n };\n }\n\n // Conversion Functions\n // --------------------\n\n // `rgbToHsl`, `rgbToHsv`, `hslToRgb`, `hsvToRgb` modified from:\n // \n\n // `rgbToRgb`\n // Handle bounds / percentage checking to conform to CSS color spec\n // \n // *Assumes:* r, g, b in [0, 255] or [0, 1]\n // *Returns:* { r, g, b } in [0, 255]\n function rgbToRgb(r, g, b) {\n return {\n r: bound01(r, 255) * 255,\n g: bound01(g, 255) * 255,\n b: bound01(b, 255) * 255\n };\n }\n\n // `rgbToHsl`\n // Converts an RGB color value to HSL.\n // *Assumes:* r, g, and b are contained in [0, 255] or [0, 1]\n // *Returns:* { h, s, l } in [0,1]\n function rgbToHsl(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h,\n s,\n l = (max + min) / 2;\n if (max == min) {\n h = s = 0; // achromatic\n } else {\n var d = max - min;\n s = l > 0.5 ? d / (2 - max - min) : d / (max + min);\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return {\n h: h,\n s: s,\n l: l\n };\n }\n\n // `hslToRgb`\n // Converts an HSL color value to RGB.\n // *Assumes:* h is contained in [0, 1] or [0, 360] and s and l are contained [0, 1] or [0, 100]\n // *Returns:* { r, g, b } in the set [0, 255]\n function hslToRgb(h, s, l) {\n var r, g, b;\n h = bound01(h, 360);\n s = bound01(s, 100);\n l = bound01(l, 100);\n function hue2rgb(p, q, t) {\n if (t < 0) t += 1;\n if (t > 1) t -= 1;\n if (t < 1 / 6) return p + (q - p) * 6 * t;\n if (t < 1 / 2) return q;\n if (t < 2 / 3) return p + (q - p) * (2 / 3 - t) * 6;\n return p;\n }\n if (s === 0) {\n r = g = b = l; // achromatic\n } else {\n var q = l < 0.5 ? l * (1 + s) : l + s - l * s;\n var p = 2 * l - q;\n r = hue2rgb(p, q, h + 1 / 3);\n g = hue2rgb(p, q, h);\n b = hue2rgb(p, q, h - 1 / 3);\n }\n return {\n r: r * 255,\n g: g * 255,\n b: b * 255\n };\n }\n\n // `rgbToHsv`\n // Converts an RGB color value to HSV\n // *Assumes:* r, g, and b are contained in the set [0, 255] or [0, 1]\n // *Returns:* { h, s, v } in [0,1]\n function rgbToHsv(r, g, b) {\n r = bound01(r, 255);\n g = bound01(g, 255);\n b = bound01(b, 255);\n var max = Math.max(r, g, b),\n min = Math.min(r, g, b);\n var h,\n s,\n v = max;\n var d = max - min;\n s = max === 0 ? 0 : d / max;\n if (max == min) {\n h = 0; // achromatic\n } else {\n switch (max) {\n case r:\n h = (g - b) / d + (g < b ? 6 : 0);\n break;\n case g:\n h = (b - r) / d + 2;\n break;\n case b:\n h = (r - g) / d + 4;\n break;\n }\n h /= 6;\n }\n return {\n h: h,\n s: s,\n v: v\n };\n }\n\n // `hsvToRgb`\n // Converts an HSV color value to RGB.\n // *Assumes:* h is contained in [0, 1] or [0, 360] and s and v are contained in [0, 1] or [0, 100]\n // *Returns:* { r, g, b } in the set [0, 255]\n function hsvToRgb(h, s, v) {\n h = bound01(h, 360) * 6;\n s = bound01(s, 100);\n v = bound01(v, 100);\n var i = Math.floor(h),\n f = h - i,\n p = v * (1 - s),\n q = v * (1 - f * s),\n t = v * (1 - (1 - f) * s),\n mod = i % 6,\n r = [v, q, p, p, t, v][mod],\n g = [t, v, v, q, p, p][mod],\n b = [p, p, t, v, v, q][mod];\n return {\n r: r * 255,\n g: g * 255,\n b: b * 255\n };\n }\n\n // `rgbToHex`\n // Converts an RGB color to hex\n // Assumes r, g, and b are contained in the set [0, 255]\n // Returns a 3 or 6 character hex\n function rgbToHex(r, g, b, allow3Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n\n // Return a 3 character hex if possible\n if (allow3Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0);\n }\n return hex.join(\"\");\n }\n\n // `rgbaToHex`\n // Converts an RGBA color plus alpha transparency to hex\n // Assumes r, g, b are contained in the set [0, 255] and\n // a in [0, 1]. Returns a 4 or 8 character rgba hex\n function rgbaToHex(r, g, b, a, allow4Char) {\n var hex = [pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16)), pad2(convertDecimalToHex(a))];\n\n // Return a 4 character hex if possible\n if (allow4Char && hex[0].charAt(0) == hex[0].charAt(1) && hex[1].charAt(0) == hex[1].charAt(1) && hex[2].charAt(0) == hex[2].charAt(1) && hex[3].charAt(0) == hex[3].charAt(1)) {\n return hex[0].charAt(0) + hex[1].charAt(0) + hex[2].charAt(0) + hex[3].charAt(0);\n }\n return hex.join(\"\");\n }\n\n // `rgbaToArgbHex`\n // Converts an RGBA color to an ARGB Hex8 string\n // Rarely used, but required for \"toFilter()\"\n function rgbaToArgbHex(r, g, b, a) {\n var hex = [pad2(convertDecimalToHex(a)), pad2(Math.round(r).toString(16)), pad2(Math.round(g).toString(16)), pad2(Math.round(b).toString(16))];\n return hex.join(\"\");\n }\n\n // `equals`\n // Can be called with any tinycolor input\n tinycolor.equals = function (color1, color2) {\n if (!color1 || !color2) return false;\n return tinycolor(color1).toRgbString() == tinycolor(color2).toRgbString();\n };\n tinycolor.random = function () {\n return tinycolor.fromRatio({\n r: Math.random(),\n g: Math.random(),\n b: Math.random()\n });\n };\n\n // Modification Functions\n // ----------------------\n // Thanks to less.js for some of the basics here\n // \n\n function _desaturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s -= amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }\n function _saturate(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.s += amount / 100;\n hsl.s = clamp01(hsl.s);\n return tinycolor(hsl);\n }\n function _greyscale(color) {\n return tinycolor(color).desaturate(100);\n }\n function _lighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l += amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n }\n function _brighten(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var rgb = tinycolor(color).toRgb();\n rgb.r = Math.max(0, Math.min(255, rgb.r - Math.round(255 * -(amount / 100))));\n rgb.g = Math.max(0, Math.min(255, rgb.g - Math.round(255 * -(amount / 100))));\n rgb.b = Math.max(0, Math.min(255, rgb.b - Math.round(255 * -(amount / 100))));\n return tinycolor(rgb);\n }\n function _darken(color, amount) {\n amount = amount === 0 ? 0 : amount || 10;\n var hsl = tinycolor(color).toHsl();\n hsl.l -= amount / 100;\n hsl.l = clamp01(hsl.l);\n return tinycolor(hsl);\n }\n\n // Spin takes a positive or negative amount within [-360, 360] indicating the change of hue.\n // Values outside of this range will be wrapped into this range.\n function _spin(color, amount) {\n var hsl = tinycolor(color).toHsl();\n var hue = (hsl.h + amount) % 360;\n hsl.h = hue < 0 ? 360 + hue : hue;\n return tinycolor(hsl);\n }\n\n // Combination Functions\n // ---------------------\n // Thanks to jQuery xColor for some of the ideas behind these\n // \n\n function _complement(color) {\n var hsl = tinycolor(color).toHsl();\n hsl.h = (hsl.h + 180) % 360;\n return tinycolor(hsl);\n }\n function polyad(color, number) {\n if (isNaN(number) || number <= 0) {\n throw new Error(\"Argument to polyad must be a positive number\");\n }\n var hsl = tinycolor(color).toHsl();\n var result = [tinycolor(color)];\n var step = 360 / number;\n for (var i = 1; i < number; i++) {\n result.push(tinycolor({\n h: (hsl.h + i * step) % 360,\n s: hsl.s,\n l: hsl.l\n }));\n }\n return result;\n }\n function _splitcomplement(color) {\n var hsl = tinycolor(color).toHsl();\n var h = hsl.h;\n return [tinycolor(color), tinycolor({\n h: (h + 72) % 360,\n s: hsl.s,\n l: hsl.l\n }), tinycolor({\n h: (h + 216) % 360,\n s: hsl.s,\n l: hsl.l\n })];\n }\n function _analogous(color, results, slices) {\n results = results || 6;\n slices = slices || 30;\n var hsl = tinycolor(color).toHsl();\n var part = 360 / slices;\n var ret = [tinycolor(color)];\n for (hsl.h = (hsl.h - (part * results >> 1) + 720) % 360; --results;) {\n hsl.h = (hsl.h + part) % 360;\n ret.push(tinycolor(hsl));\n }\n return ret;\n }\n function _monochromatic(color, results) {\n results = results || 6;\n var hsv = tinycolor(color).toHsv();\n var h = hsv.h,\n s = hsv.s,\n v = hsv.v;\n var ret = [];\n var modification = 1 / results;\n while (results--) {\n ret.push(tinycolor({\n h: h,\n s: s,\n v: v\n }));\n v = (v + modification) % 1;\n }\n return ret;\n }\n\n // Utility Functions\n // ---------------------\n\n tinycolor.mix = function (color1, color2, amount) {\n amount = amount === 0 ? 0 : amount || 50;\n var rgb1 = tinycolor(color1).toRgb();\n var rgb2 = tinycolor(color2).toRgb();\n var p = amount / 100;\n var rgba = {\n r: (rgb2.r - rgb1.r) * p + rgb1.r,\n g: (rgb2.g - rgb1.g) * p + rgb1.g,\n b: (rgb2.b - rgb1.b) * p + rgb1.b,\n a: (rgb2.a - rgb1.a) * p + rgb1.a\n };\n return tinycolor(rgba);\n };\n\n // Readability Functions\n // ---------------------\n // false\n // tinycolor.isReadable(\"#000\", \"#111\",{level:\"AA\",size:\"large\"}) => false\n tinycolor.isReadable = function (color1, color2, wcag2) {\n var readability = tinycolor.readability(color1, color2);\n var wcag2Parms, out;\n out = false;\n wcag2Parms = validateWCAG2Parms(wcag2);\n switch (wcag2Parms.level + wcag2Parms.size) {\n case \"AAsmall\":\n case \"AAAlarge\":\n out = readability >= 4.5;\n break;\n case \"AAlarge\":\n out = readability >= 3;\n break;\n case \"AAAsmall\":\n out = readability >= 7;\n break;\n }\n return out;\n };\n\n // `mostReadable`\n // Given a base color and a list of possible foreground or background\n // colors for that base, returns the most readable color.\n // Optionally returns Black or White if the most readable color is unreadable.\n // *Example*\n // tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:false}).toHexString(); // \"#112255\"\n // tinycolor.mostReadable(tinycolor.mostReadable(\"#123\", [\"#124\", \"#125\"],{includeFallbackColors:true}).toHexString(); // \"#ffffff\"\n // tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"large\"}).toHexString(); // \"#faf3f3\"\n // tinycolor.mostReadable(\"#a8015a\", [\"#faf3f3\"],{includeFallbackColors:true,level:\"AAA\",size:\"small\"}).toHexString(); // \"#ffffff\"\n tinycolor.mostReadable = function (baseColor, colorList, args) {\n var bestColor = null;\n var bestScore = 0;\n var readability;\n var includeFallbackColors, level, size;\n args = args || {};\n includeFallbackColors = args.includeFallbackColors;\n level = args.level;\n size = args.size;\n for (var i = 0; i < colorList.length; i++) {\n readability = tinycolor.readability(baseColor, colorList[i]);\n if (readability > bestScore) {\n bestScore = readability;\n bestColor = tinycolor(colorList[i]);\n }\n }\n if (tinycolor.isReadable(baseColor, bestColor, {\n level: level,\n size: size\n }) || !includeFallbackColors) {\n return bestColor;\n } else {\n args.includeFallbackColors = false;\n return tinycolor.mostReadable(baseColor, [\"#fff\", \"#000\"], args);\n }\n };\n\n // Big List of Colors\n // ------------------\n // \n var names = tinycolor.names = {\n aliceblue: \"f0f8ff\",\n antiquewhite: \"faebd7\",\n aqua: \"0ff\",\n aquamarine: \"7fffd4\",\n azure: \"f0ffff\",\n beige: \"f5f5dc\",\n bisque: \"ffe4c4\",\n black: \"000\",\n blanchedalmond: \"ffebcd\",\n blue: \"00f\",\n blueviolet: \"8a2be2\",\n brown: \"a52a2a\",\n burlywood: \"deb887\",\n burntsienna: \"ea7e5d\",\n cadetblue: \"5f9ea0\",\n chartreuse: \"7fff00\",\n chocolate: \"d2691e\",\n coral: \"ff7f50\",\n cornflowerblue: \"6495ed\",\n cornsilk: \"fff8dc\",\n crimson: \"dc143c\",\n cyan: \"0ff\",\n darkblue: \"00008b\",\n darkcyan: \"008b8b\",\n darkgoldenrod: \"b8860b\",\n darkgray: \"a9a9a9\",\n darkgreen: \"006400\",\n darkgrey: \"a9a9a9\",\n darkkhaki: \"bdb76b\",\n darkmagenta: \"8b008b\",\n darkolivegreen: \"556b2f\",\n darkorange: \"ff8c00\",\n darkorchid: \"9932cc\",\n darkred: \"8b0000\",\n darksalmon: \"e9967a\",\n darkseagreen: \"8fbc8f\",\n darkslateblue: \"483d8b\",\n darkslategray: \"2f4f4f\",\n darkslategrey: \"2f4f4f\",\n darkturquoise: \"00ced1\",\n darkviolet: \"9400d3\",\n deeppink: \"ff1493\",\n deepskyblue: \"00bfff\",\n dimgray: \"696969\",\n dimgrey: \"696969\",\n dodgerblue: \"1e90ff\",\n firebrick: \"b22222\",\n floralwhite: \"fffaf0\",\n forestgreen: \"228b22\",\n fuchsia: \"f0f\",\n gainsboro: \"dcdcdc\",\n ghostwhite: \"f8f8ff\",\n gold: \"ffd700\",\n goldenrod: \"daa520\",\n gray: \"808080\",\n green: \"008000\",\n greenyellow: \"adff2f\",\n grey: \"808080\",\n honeydew: \"f0fff0\",\n hotpink: \"ff69b4\",\n indianred: \"cd5c5c\",\n indigo: \"4b0082\",\n ivory: \"fffff0\",\n khaki: \"f0e68c\",\n lavender: \"e6e6fa\",\n lavenderblush: \"fff0f5\",\n lawngreen: \"7cfc00\",\n lemonchiffon: \"fffacd\",\n lightblue: \"add8e6\",\n lightcoral: \"f08080\",\n lightcyan: \"e0ffff\",\n lightgoldenrodyellow: \"fafad2\",\n lightgray: \"d3d3d3\",\n lightgreen: \"90ee90\",\n lightgrey: \"d3d3d3\",\n lightpink: \"ffb6c1\",\n lightsalmon: \"ffa07a\",\n lightseagreen: \"20b2aa\",\n lightskyblue: \"87cefa\",\n lightslategray: \"789\",\n lightslategrey: \"789\",\n lightsteelblue: \"b0c4de\",\n lightyellow: \"ffffe0\",\n lime: \"0f0\",\n limegreen: \"32cd32\",\n linen: \"faf0e6\",\n magenta: \"f0f\",\n maroon: \"800000\",\n mediumaquamarine: \"66cdaa\",\n mediumblue: \"0000cd\",\n mediumorchid: \"ba55d3\",\n mediumpurple: \"9370db\",\n mediumseagreen: \"3cb371\",\n mediumslateblue: \"7b68ee\",\n mediumspringgreen: \"00fa9a\",\n mediumturquoise: \"48d1cc\",\n mediumvioletred: \"c71585\",\n midnightblue: \"191970\",\n mintcream: \"f5fffa\",\n mistyrose: \"ffe4e1\",\n moccasin: \"ffe4b5\",\n navajowhite: \"ffdead\",\n navy: \"000080\",\n oldlace: \"fdf5e6\",\n olive: \"808000\",\n olivedrab: \"6b8e23\",\n orange: \"ffa500\",\n orangered: \"ff4500\",\n orchid: \"da70d6\",\n palegoldenrod: \"eee8aa\",\n palegreen: \"98fb98\",\n paleturquoise: \"afeeee\",\n palevioletred: \"db7093\",\n papayawhip: \"ffefd5\",\n peachpuff: \"ffdab9\",\n peru: \"cd853f\",\n pink: \"ffc0cb\",\n plum: \"dda0dd\",\n powderblue: \"b0e0e6\",\n purple: \"800080\",\n rebeccapurple: \"663399\",\n red: \"f00\",\n rosybrown: \"bc8f8f\",\n royalblue: \"4169e1\",\n saddlebrown: \"8b4513\",\n salmon: \"fa8072\",\n sandybrown: \"f4a460\",\n seagreen: \"2e8b57\",\n seashell: \"fff5ee\",\n sienna: \"a0522d\",\n silver: \"c0c0c0\",\n skyblue: \"87ceeb\",\n slateblue: \"6a5acd\",\n slategray: \"708090\",\n slategrey: \"708090\",\n snow: \"fffafa\",\n springgreen: \"00ff7f\",\n steelblue: \"4682b4\",\n tan: \"d2b48c\",\n teal: \"008080\",\n thistle: \"d8bfd8\",\n tomato: \"ff6347\",\n turquoise: \"40e0d0\",\n violet: \"ee82ee\",\n wheat: \"f5deb3\",\n white: \"fff\",\n whitesmoke: \"f5f5f5\",\n yellow: \"ff0\",\n yellowgreen: \"9acd32\"\n };\n\n // Make it easy to access colors via `hexNames[hex]`\n var hexNames = tinycolor.hexNames = flip(names);\n\n // Utilities\n // ---------\n\n // `{ 'name1': 'val1' }` becomes `{ 'val1': 'name1' }`\n function flip(o) {\n var flipped = {};\n for (var i in o) {\n if (o.hasOwnProperty(i)) {\n flipped[o[i]] = i;\n }\n }\n return flipped;\n }\n\n // Return a valid alpha value [0,1] with all invalid values being set to 1\n function boundAlpha(a) {\n a = parseFloat(a);\n if (isNaN(a) || a < 0 || a > 1) {\n a = 1;\n }\n return a;\n }\n\n // Take input from [0, n] and return it as [0, 1]\n function bound01(n, max) {\n if (isOnePointZero(n)) n = \"100%\";\n var processPercent = isPercentage(n);\n n = Math.min(max, Math.max(0, parseFloat(n)));\n\n // Automatically convert percentage into number\n if (processPercent) {\n n = parseInt(n * max, 10) / 100;\n }\n\n // Handle floating point rounding errors\n if (Math.abs(n - max) < 0.000001) {\n return 1;\n }\n\n // Convert into [0, 1] range if it isn't already\n return n % max / parseFloat(max);\n }\n\n // Force a number between 0 and 1\n function clamp01(val) {\n return Math.min(1, Math.max(0, val));\n }\n\n // Parse a base-16 hex value into a base-10 integer\n function parseIntFromHex(val) {\n return parseInt(val, 16);\n }\n\n // Need to handle 1.0 as 100%, since once it is a number, there is no difference between it and 1\n // \n function isOnePointZero(n) {\n return typeof n == \"string\" && n.indexOf(\".\") != -1 && parseFloat(n) === 1;\n }\n\n // Check to see if string passed in is a percentage\n function isPercentage(n) {\n return typeof n === \"string\" && n.indexOf(\"%\") != -1;\n }\n\n // Force a hex value to have 2 characters\n function pad2(c) {\n return c.length == 1 ? \"0\" + c : \"\" + c;\n }\n\n // Replace a decimal with it's percentage value\n function convertToPercentage(n) {\n if (n <= 1) {\n n = n * 100 + \"%\";\n }\n return n;\n }\n\n // Converts a decimal to a hex value\n function convertDecimalToHex(d) {\n return Math.round(parseFloat(d) * 255).toString(16);\n }\n // Converts a hex value to a decimal\n function convertHexToDecimal(h) {\n return parseIntFromHex(h) / 255;\n }\n var matchers = function () {\n // \n var CSS_INTEGER = \"[-\\\\+]?\\\\d+%?\";\n\n // \n var CSS_NUMBER = \"[-\\\\+]?\\\\d*\\\\.\\\\d+%?\";\n\n // Allow positive/negative integer/number. Don't capture the either/or, just the entire outcome.\n var CSS_UNIT = \"(?:\" + CSS_NUMBER + \")|(?:\" + CSS_INTEGER + \")\";\n\n // Actual matching.\n // Parentheses and commas are optional, but not required.\n // Whitespace can take the place of commas or opening paren\n var PERMISSIVE_MATCH3 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n var PERMISSIVE_MATCH4 = \"[\\\\s|\\\\(]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")[,|\\\\s]+(\" + CSS_UNIT + \")\\\\s*\\\\)?\";\n return {\n CSS_UNIT: new RegExp(CSS_UNIT),\n rgb: new RegExp(\"rgb\" + PERMISSIVE_MATCH3),\n rgba: new RegExp(\"rgba\" + PERMISSIVE_MATCH4),\n hsl: new RegExp(\"hsl\" + PERMISSIVE_MATCH3),\n hsla: new RegExp(\"hsla\" + PERMISSIVE_MATCH4),\n hsv: new RegExp(\"hsv\" + PERMISSIVE_MATCH3),\n hsva: new RegExp(\"hsva\" + PERMISSIVE_MATCH4),\n hex3: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex6: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/,\n hex4: /^#?([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})([0-9a-fA-F]{1})$/,\n hex8: /^#?([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})([0-9a-fA-F]{2})$/\n };\n }();\n\n // `isValidCSSUnit`\n // Take in a single string / number and check to see if it looks like a CSS unit\n // (see `matchers` above for definition).\n function isValidCSSUnit(color) {\n return !!matchers.CSS_UNIT.exec(color);\n }\n\n // `stringInputToObject`\n // Permissive string parsing. Take in a number of formats, and output an object\n // based on detected format. Returns `{ r, g, b }` or `{ h, s, l }` or `{ h, s, v}`\n function stringInputToObject(color) {\n color = color.replace(trimLeft, \"\").replace(trimRight, \"\").toLowerCase();\n var named = false;\n if (names[color]) {\n color = names[color];\n named = true;\n } else if (color == \"transparent\") {\n return {\n r: 0,\n g: 0,\n b: 0,\n a: 0,\n format: \"name\"\n };\n }\n\n // Try to match string input using regular expressions.\n // Keep most of the number bounding out of this function - don't worry about [0,1] or [0,100] or [0,360]\n // Just return an object and let the conversion functions handle that.\n // This way the result will be the same whether the tinycolor is initialized with string or object.\n var match;\n if (match = matchers.rgb.exec(color)) {\n return {\n r: match[1],\n g: match[2],\n b: match[3]\n };\n }\n if (match = matchers.rgba.exec(color)) {\n return {\n r: match[1],\n g: match[2],\n b: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hsl.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n l: match[3]\n };\n }\n if (match = matchers.hsla.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n l: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hsv.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n v: match[3]\n };\n }\n if (match = matchers.hsva.exec(color)) {\n return {\n h: match[1],\n s: match[2],\n v: match[3],\n a: match[4]\n };\n }\n if (match = matchers.hex8.exec(color)) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n a: convertHexToDecimal(match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if (match = matchers.hex6.exec(color)) {\n return {\n r: parseIntFromHex(match[1]),\n g: parseIntFromHex(match[2]),\n b: parseIntFromHex(match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n if (match = matchers.hex4.exec(color)) {\n return {\n r: parseIntFromHex(match[1] + \"\" + match[1]),\n g: parseIntFromHex(match[2] + \"\" + match[2]),\n b: parseIntFromHex(match[3] + \"\" + match[3]),\n a: convertHexToDecimal(match[4] + \"\" + match[4]),\n format: named ? \"name\" : \"hex8\"\n };\n }\n if (match = matchers.hex3.exec(color)) {\n return {\n r: parseIntFromHex(match[1] + \"\" + match[1]),\n g: parseIntFromHex(match[2] + \"\" + match[2]),\n b: parseIntFromHex(match[3] + \"\" + match[3]),\n format: named ? \"name\" : \"hex\"\n };\n }\n return false;\n }\n function validateWCAG2Parms(parms) {\n // return valid WCAG2 parms for isReadable.\n // If input parms are invalid, return {\"level\":\"AA\", \"size\":\"small\"}\n var level, size;\n parms = parms || {\n level: \"AA\",\n size: \"small\"\n };\n level = (parms.level || \"AA\").toUpperCase();\n size = (parms.size || \"small\").toLowerCase();\n if (level !== \"AA\" && level !== \"AAA\") {\n level = \"AA\";\n }\n if (size !== \"small\" && size !== \"large\") {\n size = \"small\";\n }\n return {\n level: level,\n size: size\n };\n }\n\n return tinycolor;\n\n}));\n\n\n//# sourceURL=webpack:///./node_modules/tinycolor2/cjs/tinycolor.js?"); /***/ }), @@ -11746,11 +11799,11 @@ eval("var __WEBPACK_AMD_DEFINE_RESULT__;// TinyColor v1.4.2\n// https://github.c /*!*****************************************!*\ !*** ./node_modules/tslib/tslib.es6.js ***! \*****************************************/ -/*! exports provided: __extends, __assign, __rest, __decorate, __param, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn */ +/*! exports provided: __extends, __assign, __rest, __decorate, __param, __esDecorate, __runInitializers, __propKey, __setFunctionName, __metadata, __awaiter, __generator, __createBinding, __exportStar, __values, __read, __spread, __spreadArrays, __spreadArray, __await, __asyncGenerator, __asyncDelegator, __asyncValues, __makeTemplateObject, __importStar, __importDefault, __classPrivateFieldGet, __classPrivateFieldSet, __classPrivateFieldIn, __addDisposableResource, __disposeResources, default */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__extends\", function() { return __extends; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__assign\", function() { return __assign; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__rest\", function() { return __rest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__decorate\", function() { return __decorate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__param\", function() { return __param; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__metadata\", function() { return __metadata; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__awaiter\", function() { return __awaiter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__generator\", function() { return __generator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__createBinding\", function() { return __createBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__exportStar\", function() { return __exportStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__values\", function() { return __values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__read\", function() { return __read; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spread\", function() { return __spread; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spreadArrays\", function() { return __spreadArrays; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spreadArray\", function() { return __spreadArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__await\", function() { return __await; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncGenerator\", function() { return __asyncGenerator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncDelegator\", function() { return __asyncDelegator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncValues\", function() { return __asyncValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__makeTemplateObject\", function() { return __makeTemplateObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importStar\", function() { return __importStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importDefault\", function() { return __importDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldGet\", function() { return __classPrivateFieldGet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldSet\", function() { return __classPrivateFieldSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldIn\", function() { return __classPrivateFieldIn; });\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (_) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nvar __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nfunction __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nfunction __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nfunction __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nfunction __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: n === \"return\" } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nfunction __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nfunction __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nfunction __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nfunction __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nfunction __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\n\n//# sourceURL=webpack:///./node_modules/tslib/tslib.es6.js?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__extends\", function() { return __extends; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__assign\", function() { return __assign; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__rest\", function() { return __rest; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__decorate\", function() { return __decorate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__param\", function() { return __param; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__esDecorate\", function() { return __esDecorate; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__runInitializers\", function() { return __runInitializers; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__propKey\", function() { return __propKey; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__setFunctionName\", function() { return __setFunctionName; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__metadata\", function() { return __metadata; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__awaiter\", function() { return __awaiter; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__generator\", function() { return __generator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__createBinding\", function() { return __createBinding; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__exportStar\", function() { return __exportStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__values\", function() { return __values; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__read\", function() { return __read; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spread\", function() { return __spread; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spreadArrays\", function() { return __spreadArrays; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__spreadArray\", function() { return __spreadArray; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__await\", function() { return __await; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncGenerator\", function() { return __asyncGenerator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncDelegator\", function() { return __asyncDelegator; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__asyncValues\", function() { return __asyncValues; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__makeTemplateObject\", function() { return __makeTemplateObject; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importStar\", function() { return __importStar; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__importDefault\", function() { return __importDefault; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldGet\", function() { return __classPrivateFieldGet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldSet\", function() { return __classPrivateFieldSet; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__classPrivateFieldIn\", function() { return __classPrivateFieldIn; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__addDisposableResource\", function() { return __addDisposableResource; });\n/* harmony export (binding) */ __webpack_require__.d(__webpack_exports__, \"__disposeResources\", function() { return __disposeResources; });\n/******************************************************************************\r\nCopyright (c) Microsoft Corporation.\r\n\r\nPermission to use, copy, modify, and/or distribute this software for any\r\npurpose with or without fee is hereby granted.\r\n\r\nTHE SOFTWARE IS PROVIDED \"AS IS\" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH\r\nREGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY\r\nAND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,\r\nINDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM\r\nLOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR\r\nOTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR\r\nPERFORMANCE OF THIS SOFTWARE.\r\n***************************************************************************** */\r\n/* global Reflect, Promise, SuppressedError, Symbol */\r\n\r\nvar extendStatics = function(d, b) {\r\n extendStatics = Object.setPrototypeOf ||\r\n ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) ||\r\n function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; };\r\n return extendStatics(d, b);\r\n};\r\n\r\nfunction __extends(d, b) {\r\n if (typeof b !== \"function\" && b !== null)\r\n throw new TypeError(\"Class extends value \" + String(b) + \" is not a constructor or null\");\r\n extendStatics(d, b);\r\n function __() { this.constructor = d; }\r\n d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());\r\n}\r\n\r\nvar __assign = function() {\r\n __assign = Object.assign || function __assign(t) {\r\n for (var s, i = 1, n = arguments.length; i < n; i++) {\r\n s = arguments[i];\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p)) t[p] = s[p];\r\n }\r\n return t;\r\n }\r\n return __assign.apply(this, arguments);\r\n}\r\n\r\nfunction __rest(s, e) {\r\n var t = {};\r\n for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)\r\n t[p] = s[p];\r\n if (s != null && typeof Object.getOwnPropertySymbols === \"function\")\r\n for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {\r\n if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))\r\n t[p[i]] = s[p[i]];\r\n }\r\n return t;\r\n}\r\n\r\nfunction __decorate(decorators, target, key, desc) {\r\n var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d;\r\n if (typeof Reflect === \"object\" && typeof Reflect.decorate === \"function\") r = Reflect.decorate(decorators, target, key, desc);\r\n else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r;\r\n return c > 3 && r && Object.defineProperty(target, key, r), r;\r\n}\r\n\r\nfunction __param(paramIndex, decorator) {\r\n return function (target, key) { decorator(target, key, paramIndex); }\r\n}\r\n\r\nfunction __esDecorate(ctor, descriptorIn, decorators, contextIn, initializers, extraInitializers) {\r\n function accept(f) { if (f !== void 0 && typeof f !== \"function\") throw new TypeError(\"Function expected\"); return f; }\r\n var kind = contextIn.kind, key = kind === \"getter\" ? \"get\" : kind === \"setter\" ? \"set\" : \"value\";\r\n var target = !descriptorIn && ctor ? contextIn[\"static\"] ? ctor : ctor.prototype : null;\r\n var descriptor = descriptorIn || (target ? Object.getOwnPropertyDescriptor(target, contextIn.name) : {});\r\n var _, done = false;\r\n for (var i = decorators.length - 1; i >= 0; i--) {\r\n var context = {};\r\n for (var p in contextIn) context[p] = p === \"access\" ? {} : contextIn[p];\r\n for (var p in contextIn.access) context.access[p] = contextIn.access[p];\r\n context.addInitializer = function (f) { if (done) throw new TypeError(\"Cannot add initializers after decoration has completed\"); extraInitializers.push(accept(f || null)); };\r\n var result = (0, decorators[i])(kind === \"accessor\" ? { get: descriptor.get, set: descriptor.set } : descriptor[key], context);\r\n if (kind === \"accessor\") {\r\n if (result === void 0) continue;\r\n if (result === null || typeof result !== \"object\") throw new TypeError(\"Object expected\");\r\n if (_ = accept(result.get)) descriptor.get = _;\r\n if (_ = accept(result.set)) descriptor.set = _;\r\n if (_ = accept(result.init)) initializers.unshift(_);\r\n }\r\n else if (_ = accept(result)) {\r\n if (kind === \"field\") initializers.unshift(_);\r\n else descriptor[key] = _;\r\n }\r\n }\r\n if (target) Object.defineProperty(target, contextIn.name, descriptor);\r\n done = true;\r\n};\r\n\r\nfunction __runInitializers(thisArg, initializers, value) {\r\n var useValue = arguments.length > 2;\r\n for (var i = 0; i < initializers.length; i++) {\r\n value = useValue ? initializers[i].call(thisArg, value) : initializers[i].call(thisArg);\r\n }\r\n return useValue ? value : void 0;\r\n};\r\n\r\nfunction __propKey(x) {\r\n return typeof x === \"symbol\" ? x : \"\".concat(x);\r\n};\r\n\r\nfunction __setFunctionName(f, name, prefix) {\r\n if (typeof name === \"symbol\") name = name.description ? \"[\".concat(name.description, \"]\") : \"\";\r\n return Object.defineProperty(f, \"name\", { configurable: true, value: prefix ? \"\".concat(prefix, \" \", name) : name });\r\n};\r\n\r\nfunction __metadata(metadataKey, metadataValue) {\r\n if (typeof Reflect === \"object\" && typeof Reflect.metadata === \"function\") return Reflect.metadata(metadataKey, metadataValue);\r\n}\r\n\r\nfunction __awaiter(thisArg, _arguments, P, generator) {\r\n function adopt(value) { return value instanceof P ? value : new P(function (resolve) { resolve(value); }); }\r\n return new (P || (P = Promise))(function (resolve, reject) {\r\n function fulfilled(value) { try { step(generator.next(value)); } catch (e) { reject(e); } }\r\n function rejected(value) { try { step(generator[\"throw\"](value)); } catch (e) { reject(e); } }\r\n function step(result) { result.done ? resolve(result.value) : adopt(result.value).then(fulfilled, rejected); }\r\n step((generator = generator.apply(thisArg, _arguments || [])).next());\r\n });\r\n}\r\n\r\nfunction __generator(thisArg, body) {\r\n var _ = { label: 0, sent: function() { if (t[0] & 1) throw t[1]; return t[1]; }, trys: [], ops: [] }, f, y, t, g;\r\n return g = { next: verb(0), \"throw\": verb(1), \"return\": verb(2) }, typeof Symbol === \"function\" && (g[Symbol.iterator] = function() { return this; }), g;\r\n function verb(n) { return function (v) { return step([n, v]); }; }\r\n function step(op) {\r\n if (f) throw new TypeError(\"Generator is already executing.\");\r\n while (g && (g = 0, op[0] && (_ = 0)), _) try {\r\n if (f = 1, y && (t = op[0] & 2 ? y[\"return\"] : op[0] ? y[\"throw\"] || ((t = y[\"return\"]) && t.call(y), 0) : y.next) && !(t = t.call(y, op[1])).done) return t;\r\n if (y = 0, t) op = [op[0] & 2, t.value];\r\n switch (op[0]) {\r\n case 0: case 1: t = op; break;\r\n case 4: _.label++; return { value: op[1], done: false };\r\n case 5: _.label++; y = op[1]; op = [0]; continue;\r\n case 7: op = _.ops.pop(); _.trys.pop(); continue;\r\n default:\r\n if (!(t = _.trys, t = t.length > 0 && t[t.length - 1]) && (op[0] === 6 || op[0] === 2)) { _ = 0; continue; }\r\n if (op[0] === 3 && (!t || (op[1] > t[0] && op[1] < t[3]))) { _.label = op[1]; break; }\r\n if (op[0] === 6 && _.label < t[1]) { _.label = t[1]; t = op; break; }\r\n if (t && _.label < t[2]) { _.label = t[2]; _.ops.push(op); break; }\r\n if (t[2]) _.ops.pop();\r\n _.trys.pop(); continue;\r\n }\r\n op = body.call(thisArg, _);\r\n } catch (e) { op = [6, e]; y = 0; } finally { f = t = 0; }\r\n if (op[0] & 5) throw op[1]; return { value: op[0] ? op[1] : void 0, done: true };\r\n }\r\n}\r\n\r\nvar __createBinding = Object.create ? (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n var desc = Object.getOwnPropertyDescriptor(m, k);\r\n if (!desc || (\"get\" in desc ? !m.__esModule : desc.writable || desc.configurable)) {\r\n desc = { enumerable: true, get: function() { return m[k]; } };\r\n }\r\n Object.defineProperty(o, k2, desc);\r\n}) : (function(o, m, k, k2) {\r\n if (k2 === undefined) k2 = k;\r\n o[k2] = m[k];\r\n});\r\n\r\nfunction __exportStar(m, o) {\r\n for (var p in m) if (p !== \"default\" && !Object.prototype.hasOwnProperty.call(o, p)) __createBinding(o, m, p);\r\n}\r\n\r\nfunction __values(o) {\r\n var s = typeof Symbol === \"function\" && Symbol.iterator, m = s && o[s], i = 0;\r\n if (m) return m.call(o);\r\n if (o && typeof o.length === \"number\") return {\r\n next: function () {\r\n if (o && i >= o.length) o = void 0;\r\n return { value: o && o[i++], done: !o };\r\n }\r\n };\r\n throw new TypeError(s ? \"Object is not iterable.\" : \"Symbol.iterator is not defined.\");\r\n}\r\n\r\nfunction __read(o, n) {\r\n var m = typeof Symbol === \"function\" && o[Symbol.iterator];\r\n if (!m) return o;\r\n var i = m.call(o), r, ar = [], e;\r\n try {\r\n while ((n === void 0 || n-- > 0) && !(r = i.next()).done) ar.push(r.value);\r\n }\r\n catch (error) { e = { error: error }; }\r\n finally {\r\n try {\r\n if (r && !r.done && (m = i[\"return\"])) m.call(i);\r\n }\r\n finally { if (e) throw e.error; }\r\n }\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nfunction __spread() {\r\n for (var ar = [], i = 0; i < arguments.length; i++)\r\n ar = ar.concat(__read(arguments[i]));\r\n return ar;\r\n}\r\n\r\n/** @deprecated */\r\nfunction __spreadArrays() {\r\n for (var s = 0, i = 0, il = arguments.length; i < il; i++) s += arguments[i].length;\r\n for (var r = Array(s), k = 0, i = 0; i < il; i++)\r\n for (var a = arguments[i], j = 0, jl = a.length; j < jl; j++, k++)\r\n r[k] = a[j];\r\n return r;\r\n}\r\n\r\nfunction __spreadArray(to, from, pack) {\r\n if (pack || arguments.length === 2) for (var i = 0, l = from.length, ar; i < l; i++) {\r\n if (ar || !(i in from)) {\r\n if (!ar) ar = Array.prototype.slice.call(from, 0, i);\r\n ar[i] = from[i];\r\n }\r\n }\r\n return to.concat(ar || Array.prototype.slice.call(from));\r\n}\r\n\r\nfunction __await(v) {\r\n return this instanceof __await ? (this.v = v, this) : new __await(v);\r\n}\r\n\r\nfunction __asyncGenerator(thisArg, _arguments, generator) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var g = generator.apply(thisArg, _arguments || []), i, q = [];\r\n return i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i;\r\n function verb(n) { if (g[n]) i[n] = function (v) { return new Promise(function (a, b) { q.push([n, v, a, b]) > 1 || resume(n, v); }); }; }\r\n function resume(n, v) { try { step(g[n](v)); } catch (e) { settle(q[0][3], e); } }\r\n function step(r) { r.value instanceof __await ? Promise.resolve(r.value.v).then(fulfill, reject) : settle(q[0][2], r); }\r\n function fulfill(value) { resume(\"next\", value); }\r\n function reject(value) { resume(\"throw\", value); }\r\n function settle(f, v) { if (f(v), q.shift(), q.length) resume(q[0][0], q[0][1]); }\r\n}\r\n\r\nfunction __asyncDelegator(o) {\r\n var i, p;\r\n return i = {}, verb(\"next\"), verb(\"throw\", function (e) { throw e; }), verb(\"return\"), i[Symbol.iterator] = function () { return this; }, i;\r\n function verb(n, f) { i[n] = o[n] ? function (v) { return (p = !p) ? { value: __await(o[n](v)), done: false } : f ? f(v) : v; } : f; }\r\n}\r\n\r\nfunction __asyncValues(o) {\r\n if (!Symbol.asyncIterator) throw new TypeError(\"Symbol.asyncIterator is not defined.\");\r\n var m = o[Symbol.asyncIterator], i;\r\n return m ? m.call(o) : (o = typeof __values === \"function\" ? __values(o) : o[Symbol.iterator](), i = {}, verb(\"next\"), verb(\"throw\"), verb(\"return\"), i[Symbol.asyncIterator] = function () { return this; }, i);\r\n function verb(n) { i[n] = o[n] && function (v) { return new Promise(function (resolve, reject) { v = o[n](v), settle(resolve, reject, v.done, v.value); }); }; }\r\n function settle(resolve, reject, d, v) { Promise.resolve(v).then(function(v) { resolve({ value: v, done: d }); }, reject); }\r\n}\r\n\r\nfunction __makeTemplateObject(cooked, raw) {\r\n if (Object.defineProperty) { Object.defineProperty(cooked, \"raw\", { value: raw }); } else { cooked.raw = raw; }\r\n return cooked;\r\n};\r\n\r\nvar __setModuleDefault = Object.create ? (function(o, v) {\r\n Object.defineProperty(o, \"default\", { enumerable: true, value: v });\r\n}) : function(o, v) {\r\n o[\"default\"] = v;\r\n};\r\n\r\nfunction __importStar(mod) {\r\n if (mod && mod.__esModule) return mod;\r\n var result = {};\r\n if (mod != null) for (var k in mod) if (k !== \"default\" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);\r\n __setModuleDefault(result, mod);\r\n return result;\r\n}\r\n\r\nfunction __importDefault(mod) {\r\n return (mod && mod.__esModule) ? mod : { default: mod };\r\n}\r\n\r\nfunction __classPrivateFieldGet(receiver, state, kind, f) {\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a getter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot read private member from an object whose class did not declare it\");\r\n return kind === \"m\" ? f : kind === \"a\" ? f.call(receiver) : f ? f.value : state.get(receiver);\r\n}\r\n\r\nfunction __classPrivateFieldSet(receiver, state, value, kind, f) {\r\n if (kind === \"m\") throw new TypeError(\"Private method is not writable\");\r\n if (kind === \"a\" && !f) throw new TypeError(\"Private accessor was defined without a setter\");\r\n if (typeof state === \"function\" ? receiver !== state || !f : !state.has(receiver)) throw new TypeError(\"Cannot write private member to an object whose class did not declare it\");\r\n return (kind === \"a\" ? f.call(receiver, value) : f ? f.value = value : state.set(receiver, value)), value;\r\n}\r\n\r\nfunction __classPrivateFieldIn(state, receiver) {\r\n if (receiver === null || (typeof receiver !== \"object\" && typeof receiver !== \"function\")) throw new TypeError(\"Cannot use 'in' operator on non-object\");\r\n return typeof state === \"function\" ? receiver === state : state.has(receiver);\r\n}\r\n\r\nfunction __addDisposableResource(env, value, async) {\r\n if (value !== null && value !== void 0) {\r\n if (typeof value !== \"object\" && typeof value !== \"function\") throw new TypeError(\"Object expected.\");\r\n var dispose;\r\n if (async) {\r\n if (!Symbol.asyncDispose) throw new TypeError(\"Symbol.asyncDispose is not defined.\");\r\n dispose = value[Symbol.asyncDispose];\r\n }\r\n if (dispose === void 0) {\r\n if (!Symbol.dispose) throw new TypeError(\"Symbol.dispose is not defined.\");\r\n dispose = value[Symbol.dispose];\r\n }\r\n if (typeof dispose !== \"function\") throw new TypeError(\"Object not disposable.\");\r\n env.stack.push({ value: value, dispose: dispose, async: async });\r\n }\r\n else if (async) {\r\n env.stack.push({ async: true });\r\n }\r\n return value;\r\n}\r\n\r\nvar _SuppressedError = typeof SuppressedError === \"function\" ? SuppressedError : function (error, suppressed, message) {\r\n var e = new Error(message);\r\n return e.name = \"SuppressedError\", e.error = error, e.suppressed = suppressed, e;\r\n};\r\n\r\nfunction __disposeResources(env) {\r\n function fail(e) {\r\n env.error = env.hasError ? new _SuppressedError(e, env.error, \"An error was suppressed during disposal.\") : e;\r\n env.hasError = true;\r\n }\r\n function next() {\r\n while (env.stack.length) {\r\n var rec = env.stack.pop();\r\n try {\r\n var result = rec.dispose && rec.dispose.call(rec.value);\r\n if (rec.async) return Promise.resolve(result).then(next, function(e) { fail(e); return next(); });\r\n }\r\n catch (e) {\r\n fail(e);\r\n }\r\n }\r\n if (env.hasError) throw env.error;\r\n }\r\n return next();\r\n}\r\n\r\n/* harmony default export */ __webpack_exports__[\"default\"] = ({\r\n __extends: __extends,\r\n __assign: __assign,\r\n __rest: __rest,\r\n __decorate: __decorate,\r\n __param: __param,\r\n __metadata: __metadata,\r\n __awaiter: __awaiter,\r\n __generator: __generator,\r\n __createBinding: __createBinding,\r\n __exportStar: __exportStar,\r\n __values: __values,\r\n __read: __read,\r\n __spread: __spread,\r\n __spreadArrays: __spreadArrays,\r\n __spreadArray: __spreadArray,\r\n __await: __await,\r\n __asyncGenerator: __asyncGenerator,\r\n __asyncDelegator: __asyncDelegator,\r\n __asyncValues: __asyncValues,\r\n __makeTemplateObject: __makeTemplateObject,\r\n __importStar: __importStar,\r\n __importDefault: __importDefault,\r\n __classPrivateFieldGet: __classPrivateFieldGet,\r\n __classPrivateFieldSet: __classPrivateFieldSet,\r\n __classPrivateFieldIn: __classPrivateFieldIn,\r\n __addDisposableResource: __addDisposableResource,\r\n __disposeResources: __disposeResources,\r\n});\r\n\n\n//# sourceURL=webpack:///./node_modules/tslib/tslib.es6.js?"); /***/ }), @@ -11773,31 +11826,31 @@ eval("var monaco = __webpack_require__(/*! ./src/Monaco.vue */ \"./node_modules/ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Monaco_vue_vue_type_template_id_77d5ad30___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Monaco.vue?vue&type=template&id=77d5ad30& */ \"./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30&\");\n/* harmony import */ var _Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Monaco.vue?vue&type=script&lang=js& */ \"./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js&\");\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__) if([\"default\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _Monaco_vue_vue_type_template_id_77d5ad30___WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _Monaco_vue_vue_type_template_id_77d5ad30___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"node_modules/vue-monaco-editor/src/Monaco.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);\n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _Monaco_vue_vue_type_template_id_77d5ad30__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! ./Monaco.vue?vue&type=template&id=77d5ad30 */ \"./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30\");\n/* harmony import */ var _Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__ = __webpack_require__(/*! ./Monaco.vue?vue&type=script&lang=js */ \"./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js\");\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__) if([\"default\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n/* harmony import */ var _vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__ = __webpack_require__(/*! ../../vue-loader/lib/runtime/componentNormalizer.js */ \"./node_modules/vue-loader/lib/runtime/componentNormalizer.js\");\n\n\n\n\n\n/* normalize component */\n\nvar component = Object(_vue_loader_lib_runtime_componentNormalizer_js__WEBPACK_IMPORTED_MODULE_2__[\"default\"])(\n _Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_1__[\"default\"],\n _Monaco_vue_vue_type_template_id_77d5ad30__WEBPACK_IMPORTED_MODULE_0__[\"render\"],\n _Monaco_vue_vue_type_template_id_77d5ad30__WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"],\n false,\n null,\n null,\n null\n \n)\n\n/* hot reload */\nif (false) { var api; }\ncomponent.options.__file = \"node_modules/vue-monaco-editor/src/Monaco.vue\"\n/* harmony default export */ __webpack_exports__[\"default\"] = (component.exports);\n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?"); /***/ }), -/***/ "./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js&": -/*!********************************************************************************!*\ - !*** ./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js& ***! - \********************************************************************************/ +/***/ "./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js": +/*!*******************************************************************************!*\ + !*** ./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js ***! + \*******************************************************************************/ /*! no static exports found */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../cache-loader/dist/cjs.js??ref--12-0!../../babel-loader/lib!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib??vue-loader-options!./Monaco.vue?vue&type=script&lang=js& */ \"./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js&\");\n/* harmony import */ var _cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__) if([\"default\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n /* harmony default export */ __webpack_exports__[\"default\"] = (_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js___WEBPACK_IMPORTED_MODULE_0___default.a); \n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../cache-loader/dist/cjs.js??ref--12-0!../../babel-loader/lib!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib??vue-loader-options!./Monaco.vue?vue&type=script&lang=js */ \"./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=script&lang=js\");\n/* harmony import */ var _cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0___default = /*#__PURE__*/__webpack_require__.n(_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__);\n/* harmony reexport (unknown) */ for(var __WEBPACK_IMPORT_KEY__ in _cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__) if([\"default\"].indexOf(__WEBPACK_IMPORT_KEY__) < 0) (function(key) { __webpack_require__.d(__webpack_exports__, key, function() { return _cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0__[key]; }) }(__WEBPACK_IMPORT_KEY__));\n /* harmony default export */ __webpack_exports__[\"default\"] = (_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_script_lang_js__WEBPACK_IMPORTED_MODULE_0___default.a); \n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?"); /***/ }), -/***/ "./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30&": -/*!**************************************************************************************!*\ - !*** ./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30& ***! - \**************************************************************************************/ +/***/ "./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30": +/*!*************************************************************************************!*\ + !*** ./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30 ***! + \*************************************************************************************/ /*! exports provided: render, staticRenderFns */ /***/ (function(module, __webpack_exports__, __webpack_require__) { "use strict"; -eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_3d9796ac_vue_loader_template_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_vue_loader_lib_loaders_templateLoader_js_ref_6_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_template_id_77d5ad30___WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"3d9796ac-vue-loader-template\"}!../../cache-loader/dist/cjs.js??ref--12-0!../../babel-loader/lib!../../vue-loader/lib/loaders/templateLoader.js??ref--6!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib??vue-loader-options!./Monaco.vue?vue&type=template&id=77d5ad30& */ \"./node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"3d9796ac-vue-loader-template\\\"}!./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30&\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return _cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_3d9796ac_vue_loader_template_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_vue_loader_lib_loaders_templateLoader_js_ref_6_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_template_id_77d5ad30___WEBPACK_IMPORTED_MODULE_0__[\"render\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return _cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_3d9796ac_vue_loader_template_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_vue_loader_lib_loaders_templateLoader_js_ref_6_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_template_id_77d5ad30___WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"]; });\n\n\n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?"); +eval("__webpack_require__.r(__webpack_exports__);\n/* harmony import */ var _cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_77823dab_vue_loader_template_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_vue_loader_lib_loaders_templateLoader_js_ref_6_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_template_id_77d5ad30__WEBPACK_IMPORTED_MODULE_0__ = __webpack_require__(/*! -!../../cache-loader/dist/cjs.js?{\"cacheDirectory\":\"node_modules/.cache/vue-loader\",\"cacheIdentifier\":\"77823dab-vue-loader-template\"}!../../cache-loader/dist/cjs.js??ref--12-0!../../babel-loader/lib!../../vue-loader/lib/loaders/templateLoader.js??ref--6!../../cache-loader/dist/cjs.js??ref--0-0!../../vue-loader/lib??vue-loader-options!./Monaco.vue?vue&type=template&id=77d5ad30 */ \"./node_modules/cache-loader/dist/cjs.js?{\\\"cacheDirectory\\\":\\\"node_modules/.cache/vue-loader\\\",\\\"cacheIdentifier\\\":\\\"77823dab-vue-loader-template\\\"}!./node_modules/cache-loader/dist/cjs.js?!./node_modules/babel-loader/lib/index.js!./node_modules/vue-loader/lib/loaders/templateLoader.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./node_modules/vue-monaco-editor/src/Monaco.vue?vue&type=template&id=77d5ad30\");\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"render\", function() { return _cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_77823dab_vue_loader_template_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_vue_loader_lib_loaders_templateLoader_js_ref_6_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_template_id_77d5ad30__WEBPACK_IMPORTED_MODULE_0__[\"render\"]; });\n\n/* harmony reexport (safe) */ __webpack_require__.d(__webpack_exports__, \"staticRenderFns\", function() { return _cache_loader_dist_cjs_js_cacheDirectory_node_modules_cache_vue_loader_cacheIdentifier_77823dab_vue_loader_template_cache_loader_dist_cjs_js_ref_12_0_babel_loader_lib_index_js_vue_loader_lib_loaders_templateLoader_js_ref_6_cache_loader_dist_cjs_js_ref_0_0_vue_loader_lib_index_js_vue_loader_options_Monaco_vue_vue_type_template_id_77d5ad30__WEBPACK_IMPORTED_MODULE_0__[\"staticRenderFns\"]; });\n\n\n\n//# sourceURL=webpack:///./node_modules/vue-monaco-editor/src/Monaco.vue?"); /***/ }), @@ -11812,25 +11865,25 @@ eval("module.exports = {\n /* For now: default to cdn. */\n load(srcPath = 'ht /***/ }), -/***/ "./node_modules/vue-style-loader/index.js?!./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/JSEditor.vue?vue&type=style&index=0&id=123e60ea&lang=css&": -/*!*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ - !*** ./node_modules/vue-style-loader??ref--6-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/JSEditor.vue?vue&type=style&index=0&id=123e60ea&lang=css& ***! - \*****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ +/***/ "./node_modules/vue-style-loader/index.js?!./node_modules/css-loader/dist/cjs.js?!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src/index.js?!./node_modules/cache-loader/dist/cjs.js?!./node_modules/vue-loader/lib/index.js?!./src/components/dag/JSEditor.vue?vue&type=style&index=0&id=123e60ea&lang=css": +/*!****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************!*\ + !*** ./node_modules/vue-style-loader??ref--6-oneOf-1-0!./node_modules/css-loader/dist/cjs.js??ref--6-oneOf-1-1!./node_modules/vue-loader/lib/loaders/stylePostLoader.js!./node_modules/postcss-loader/src??ref--6-oneOf-1-2!./node_modules/cache-loader/dist/cjs.js??ref--0-0!./node_modules/vue-loader/lib??vue-loader-options!./src/components/dag/JSEditor.vue?vue&type=style&index=0&id=123e60ea&lang=css ***! + \****************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************************/ /*! no static exports found */ /***/ (function(module, exports, __webpack_require__) { -eval("// style-loader: Adds some css to the DOM by adding a